Changeset: 2a62051659e8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2a62051659e8
Modified Files:
        monetdb5/modules/atoms/url.c
        sql/backends/monet5/sql.c
        sql/server/sql_atom.c
        sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out
Branch: default
Log Message:

Merge with Jan2014 branch.


diffs (159 lines):

diff --git a/monetdb5/modules/atoms/url.c b/monetdb5/modules/atoms/url.c
--- a/monetdb5/modules/atoms/url.c
+++ b/monetdb5/modules/atoms/url.c
@@ -229,11 +229,9 @@ URLgetDomain(str *retval, str *u)
        t++;
        b = buf;
        d = 0;
-       for (; *t && *t != '/'; t++) {
+       for (; *t && *t != '/' && *t != ':' && *t != '?' && *t != '#'; t++) {
                if (*t == '.')
                        d = b;
-               if (*t == ':')
-                       break;
                *b++ = *t;
                if (i++ == 1023)
                        throw(PARSE, "url.getDomain", "server name too long\n");
@@ -319,7 +317,7 @@ url_getHost(str *retval, url t)
        t++;
        b = buf;
        s = buf;
-       for (; *t && *t != '/'; t++) {
+       for (; *t && *t != '/' && *t != ':' && *t != '?' && *t != '#'; t++) {
                *b++ = *t;
                if (i++ == 1023)
                        throw(PARSE, "url.getHost", "server name too long");
@@ -487,7 +485,7 @@ url_getRobotURL(str *retval, /* put stri
        if (*t != '/')
                goto getRobot_done;
        *b++ = *t++;
-       for (; *t && *t != '/'; t++) {
+       for (; *t && *t && *t != '/' && *t != '?' && *t != '#'; t++) {
                *b++ = *t;
                if (i++ == 1000)
                        throw(PARSE, "url.getRobotURL", "server name too long");
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -1634,7 +1634,7 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb
                }
                return MAL_SUCCEED;
        }
-       if (*sname)
+       if (*sname && strcmp(*sname, str_nil) != 0)
                throw(SQL, "sql.bind", "unable to find %s.%s(%s)", *sname, 
*tname, *cname);
        throw(SQL, "sql.bind", "unable to find %s(%s)", *tname, *cname);
 }
diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c
--- a/sql/server/sql_atom.c
+++ b/sql/server/sql_atom.c
@@ -552,8 +552,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_INT
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
@@ -564,8 +566,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_LNG
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
@@ -602,8 +606,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_INT
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
@@ -614,8 +620,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_LNG
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
@@ -731,8 +739,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_int:
+#if SIZEOF_OID == SIZEOF_INT
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_INT
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
@@ -743,8 +753,10 @@ atom_cast(atom *a, sql_subtype *tp)
                                        return 0;
                                break;
                        case TYPE_lng:
+#if SIZEOF_OID == SIZEOF_LNG
+                       case TYPE_oid:
+#endif
 #if SIZEOF_WRD == SIZEOF_LNG
-                       case TYPE_oid:
                        case TYPE_wrd:
 #endif
                                if (at->type->localtype == TYPE_bte) 
diff --git a/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out 
b/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out
--- a/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out
+++ b/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.stable.out
@@ -79,9 +79,9 @@ Ready.
 % sys.L # table_name
 % getdomain_u # name
 % clob # type
-% 7 # length
+% 3 # length
 [ "nl" ]
-[ "com?x=2"    ]
+[ "com"        ]
 [ "org"        ]
 #select getExtension(u) from t2972;
 % sys.L # table_name
@@ -103,10 +103,10 @@ Ready.
 % sys.L # table_name
 % gethost_u # name
 % clob # type
-% 20 # length
+% 15 # length
 [ "www.cwi.nl" ]
-[ "www.monetdb.com?x=2"        ]
-[ "www.monetdb.org:8080"       ]
+[ "www.monetdb.com"    ]
+[ "www.monetdb.org"    ]
 #select getPort(u) from t2972;
 % sys.L # table_name
 % getport_u # name
@@ -137,7 +137,7 @@ Ready.
 % clob # type
 % 38 # length
 [ "http://www.cwi.nl/robots.txt";       ]
-[ "http://www.monetdb.com?x=2/robots.txt";      ]
+[ "http://www.monetdb.com/robots.txt";  ]
 [ "http://www.monetdb.org:8080/robots.txt";     ]
 #select isaURL(u) from t2972;
 % sys.L # table_name
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to