Changeset: 2b4d23ba17d0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b4d23ba17d0
Added Files:
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.sql
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.err
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.sql
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.stable.err
sql/test/BugTracker-2015/Tests/ukey_check_unaligned.Bug-3669.stable.out
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/atoms/inet.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_optimizer.c
sql/server/rel_optimizer.c
sql/test/BugTracker-2015/Tests/All
sql/test/mergetables/Tests/mergequery.stable.out
Branch: default
Log Message:
Merge with default
diffs (truncated from 678 to 300 lines):
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -67,31 +67,31 @@ typedef struct _inet {
#define inet_export extern
#endif
-inet_export int INETfromString(str src, int *len, inet **retval);
-inet_export int INETtoString(str *retval, int *len, inet *handle);
-inet_export int INETcompare(inet *l, inet *r);
-inet_export str INETnew(inet * retval, str *in);
-inet_export str INET_isnil(bit *retval, inet * val);
-inet_export str INET_comp_EQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_NEQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_GT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_GE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CW(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CWE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CS(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CSE(bit *retval, inet * val1, inet *val2);
-inet_export str INETbroadcast(inet * retval, inet *val);
-inet_export str INEThost(str *retval, inet *val);
-inet_export str INETmasklen(int *retval, inet *val);
-inet_export str INETsetmasklen(inet *retval, inet *val, int *mask);
-inet_export str INETnetmask(inet *retval, inet *val);
-inet_export str INEThostmask(inet *retval, inet *val);
-inet_export str INETnetwork(inet *retval, inet *val);
-inet_export str INETtext(str *retval, inet *val);
-inet_export str INETabbrev(str *retval, inet *val);
-inet_export str INET_inet(inet *d, inet *s);
+inet_export int INETfromString(const char *src, int *len, inet **retval);
+inet_export int INETtoString(str *retval, int *len, const inet *handle);
+inet_export int INETcompare(const inet *l, const inet *r);
+inet_export str INETnew(inet *retval, str *in);
+inet_export str INET_isnil(bit *retval, const inet *val);
+inet_export str INET_comp_EQ(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_NEQ(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_LT(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_GT(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_LE(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_GE(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_CW(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_CWE(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_CS(bit *retval, const inet *val1, const inet *val2);
+inet_export str INET_comp_CSE(bit *retval, const inet *val1, const inet *val2);
+inet_export str INETbroadcast(inet *retval, const inet *val);
+inet_export str INEThost(str *retval, const inet *val);
+inet_export str INETmasklen(int *retval, const inet *val);
+inet_export str INETsetmasklen(inet *retval, const inet *val, const int *mask);
+inet_export str INETnetmask(inet *retval, const inet *val);
+inet_export str INEThostmask(inet *retval, const inet *val);
+inet_export str INETnetwork(inet *retval, const inet *val);
+inet_export str INETtext(str *retval, const inet *val);
+inet_export str INETabbrev(str *retval, const inet *val);
+inet_export str INET_inet(inet *d, const inet *s);
inet_export str INET_fromstr(inet *ret, str *s);
inet_export inet *INETnull(void);
@@ -104,7 +104,7 @@ static inet inet_nil = {0,0,0,0,0,0,0,1}
* Returns the number of chars read
*/
int
-INETfromString(str src, int *len, inet **retval)
+INETfromString(const char *src, int *len, inet **retval)
{
int i, last, type;
long parse;
@@ -133,9 +133,8 @@ INETfromString(str src, int *len, inet *
for (i = 0; src[i] != '\0'; i++) {
if (src[i] == '.' || src[i] == '/') {
sep = src[i];
- src[i] = '\0';
parse = strtol(src + last, &endptr, 10);
- if (*endptr != '\0' || last >= i) {
+ if (*endptr != sep || last >= i) {
GDKerror("Error while parsing, unexpected
string '%s'", endptr);
goto error;
}
@@ -219,9 +218,9 @@ error: /* catch exception: return NULL *
* Returns the length of the string
*/
int
-INETtoString(str *retval, int *len, inet *handle)
+INETtoString(str *retval, int *len, const inet *handle)
{
- inet *value = (inet *)handle;
+ const inet *value = (const inet *)handle;
if (*len < 19) {
if (*retval != NULL)
@@ -259,7 +258,7 @@ INETnew(inet *retval, str *in)
}
int
-INETcompare(inet *l, inet *r)
+INETcompare(const inet *l, const inet *r)
{
bit res = 0;
if (in_isnil(l))
@@ -280,7 +279,7 @@ INETcompare(inet *l, inet *r)
* Returns whether val represents a nil inet value
*/
str
-INET_isnil(bit *retval, inet * val)
+INET_isnil(bit *retval, const inet *val)
{
*retval = in_isnil(val);
@@ -290,7 +289,7 @@ INET_isnil(bit *retval, inet * val)
* Returns whether val1 and val2 are equal.
*/
str
-INET_comp_EQ(bit *retval, inet * val1, inet * val2)
+INET_comp_EQ(bit *retval, const inet *val1, const inet *val2)
{
if (in_isnil(val1) || in_isnil(val2)) {
*retval = bit_nil;
@@ -308,7 +307,7 @@ INET_comp_EQ(bit *retval, inet * val1, i
* Returns whether val1 and val2 are not equal.
*/
str
-INET_comp_NEQ(bit *retval, inet * val1, inet * val2)
+INET_comp_NEQ(bit *retval, const inet *val1, const inet *val2)
{
if (in_isnil(val1) || in_isnil(val2)) {
*retval = bit_nil;
@@ -326,7 +325,7 @@ INET_comp_NEQ(bit *retval, inet * val1,
* Returns whether val1 is smaller than val2.
*/
str
-INET_comp_LT(bit *retval, inet * val1, inet * val2)
+INET_comp_LT(bit *retval, const inet *val1, const inet *val2)
{
if (in_isnil(val1) || in_isnil(val2)) {
*retval = bit_nil;
@@ -358,7 +357,7 @@ INET_comp_LT(bit *retval, inet * val1, i
* Returns whether val1 is greater than val2.
*/
str
-INET_comp_GT(bit *retval, inet * val1, inet * val2)
+INET_comp_GT(bit *retval, const inet *val1, const inet *val2)
{
return (INET_comp_LT(retval, val2, val1));
}
@@ -366,7 +365,7 @@ INET_comp_GT(bit *retval, inet * val1, i
* Returns whether val1 is smaller than or equal to val2.
*/
str
-INET_comp_LE(bit *retval, inet * val1, inet * val2)
+INET_comp_LE(bit *retval, const inet *val1, const inet *val2)
{
bit ret;
@@ -381,7 +380,7 @@ INET_comp_LE(bit *retval, inet * val1, i
* Returns whether val1 is smaller than or equal to val2.
*/
str
-INET_comp_GE(bit *retval, inet * val1, inet * val2)
+INET_comp_GE(bit *retval, const inet *val1, const inet *val2)
{
bit ret;
@@ -398,7 +397,7 @@ INET_comp_GE(bit *retval, inet * val1, i
* Returns whether val1 is contained within val2
*/
str
-INET_comp_CW(bit *retval, inet * val1, inet * val2)
+INET_comp_CW(bit *retval, const inet *val1, const inet *val2)
{
if (in_isnil(val1) || in_isnil(val2)) {
*retval = bit_nil;
@@ -457,7 +456,7 @@ INET_comp_CW(bit *retval, inet * val1, i
* Returns whether val1 is contained within or equal to val2
*/
str
-INET_comp_CWE(bit *retval, inet * val1, inet * val2)
+INET_comp_CWE(bit *retval, const inet *val1, const inet *val2)
{
bit ret;
@@ -473,7 +472,7 @@ INET_comp_CWE(bit *retval, inet * val1,
* Returns whether val1 is contains val2
*/
str
-INET_comp_CS(bit *retval, inet * val1, inet * val2)
+INET_comp_CS(bit *retval, const inet *val1, const inet *val2)
{
/* swap the input arguments and call the contained within function */
return (INET_comp_CW(retval, val2, val1));
@@ -482,7 +481,7 @@ INET_comp_CS(bit *retval, inet * val1, i
* Returns whether val1 contains or is equal to val2
*/
str
-INET_comp_CSE(bit *retval, inet * val1, inet * val2)
+INET_comp_CSE(bit *retval, const inet *val1, const inet *val2)
{
/* swap the input arguments and call the contained within function */
return (INET_comp_CWE(retval, val2, val1));
@@ -495,7 +494,7 @@ INET_comp_CSE(bit *retval, inet * val1,
* If the subnet mask is 32, the given input inet is returned.
*/
str
-INETbroadcast(inet * retval, inet * val)
+INETbroadcast(inet *retval, const inet *val)
{
*retval = *val;
if (!in_isnil(val) && val->mask != 32) {
@@ -540,7 +539,7 @@ INETbroadcast(inet * retval, inet * val)
* this function never returns the netmask length.
*/
str
-INEThost(str *retval, inet * val)
+INEThost(str *retval, const inet *val)
{
str ip;
@@ -559,7 +558,7 @@ INEThost(str *retval, inet * val)
* Extract netmask length.
*/
str
-INETmasklen(int *retval, inet * val)
+INETmasklen(int *retval, const inet *val)
{
if (in_isnil(val)) {
*retval = int_nil;
@@ -572,7 +571,7 @@ INETmasklen(int *retval, inet * val)
* Set netmask length for inet value.
*/
str
-INETsetmasklen(inet * retval, inet * val, int *mask)
+INETsetmasklen(inet *retval, const inet *val, const int *mask)
{
if (*mask < 0 || *mask > 32)
throw(ILLARG, "inet.setmask", "Illegal netmask length value:
%d", *mask);
@@ -587,7 +586,7 @@ INETsetmasklen(inet * retval, inet * val
* Construct netmask for network.
*/
str
-INETnetmask(inet * retval, inet * val)
+INETnetmask(inet *retval, const inet *val)
{
*retval = *val;
if (!in_isnil(val)) {
@@ -622,7 +621,7 @@ INETnetmask(inet * retval, inet * val)
* Construct host mask for network.
*/
str
-INEThostmask(inet * retval, inet * val)
+INEThostmask(inet *retval, const inet *val)
{
INETnetmask(retval, val);
/* invert the netmask to obtain the host mask */
@@ -648,7 +647,7 @@ INEThostmask(inet * retval, inet * val)
* not covered by the netmask.
*/
str
-INETnetwork(inet * retval, inet * val)
+INETnetwork(inet *retval, const inet *val)
{
*retval = *val;
if (!in_isnil(val)) {
@@ -685,7 +684,7 @@ INETnetwork(inet * retval, inet * val)
* function, this function always prints the netmask length.
*/
str
-INETtext(str *retval, inet * val)
+INETtext(str *retval, const inet *val)
{
str ip;
@@ -707,7 +706,7 @@ INETtext(str *retval, inet * val)
* this function is equal to the function text.
*/
str
-INETabbrev(str *retval, inet * val)
+INETabbrev(str *retval, const inet *val)
{
str ip;
@@ -767,7 +766,7 @@ INETabbrev(str *retval, inet * val)
return (MAL_SUCCEED);
}
str
-INET_inet(inet *d, inet *s)
+INET_inet(inet *d, const inet *s)
{
*d = *s;
return MAL_SUCCEED;
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -3200,16 +3200,16 @@ update_check_ukey(mvc *sql, stmt **updat
ext = stmt_result(sql->sa, g, 1);
Cnt = stmt_result(sql->sa, g, 2);
- /* choose only groups with cnt > 1 */
+ /* continue only with groups with a cnt > 1 */
cand = stmt_uselect(sql->sa, Cnt,
stmt_atom_wrd(sql->sa, 1), cmp_gt, NULL);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list