Changeset: ecdc21fa59c9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ecdc21fa59c9
Modified Files:
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_scenario.c
        sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
Branch: malerrors
Log Message:

Compilation issues


diffs (112 lines):

diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -281,7 +281,7 @@ SQLrun(Client c, backend *be, mvc *m)
        int i,j, retc;
        ValPtr val;
                        
-       if (m->errstr &&  *m->errstr){
+       if (*m->errstr){
                if( strstr(m->errstr,"SQLSTATE"))
                        msg = createException(PARSE, "SQLparser", "%s", 
m->errstr);
                else 
@@ -511,7 +511,7 @@ SQLstatementIntern(Client c, str *expr, 
                    (mvc_status(m) && m->type != Q_TRANS) || !m->sym) {
                        if (!err)
                                err = mvc_status(m);
-                       if (m->errstr && *m->errstr){
+                       if (*m->errstr){
                                if( strstr(m->errstr,"SQLSTATE"))
                                        msg = createException(PARSE, 
"SQLparser", "%s", m->errstr);
                                else
@@ -540,7 +540,7 @@ SQLstatementIntern(Client c, str *expr, 
                mnstr_printf(c->fdout, "#SQLstatement:\n");
 #endif
                scanner_query_processed(&(m->scanner));
-               if ((err = mvc_status(m)) && m->errstr) {
+               if ((err = mvc_status(m)) ) {
                                if( strstr(m->errstr,"SQLSTATE"))
                                        msg = createException(PARSE, 
"SQLparser", "%s", m->errstr);
                                else
@@ -574,13 +574,11 @@ SQLstatementIntern(Client c, str *expr, 
                        MSresetInstructions(c->curprg->def, oldstop);
                        freeVariables(c, c->curprg->def, c->glb, oldvtop);
                        c->curprg->def->errors = 0;
-                       if (*m->errstr) {
-                               if (strstr(m->errstr,"SQLSTATE"))
-                                       msg = createException(PARSE, 
"SQLparser", "%s", m->errstr);
-                               else
-                                       msg = createException(PARSE, 
"SQLparser", "SQLSTATE 42000 !""%s", m->errstr);
-                               *m->errstr = 0;
-                       }
+                       if( strstr(m->errstr,"SQLSTATE"))
+                               msg = createException(PARSE, "SQLparser", "%s", 
m->errstr);
+                       else
+                               msg = createException(PARSE, "SQLparser", 
"SQLSTATE 42000 !""%s", m->errstr);
+                       *m->errstr = 0;
                        goto endofcompile;
                }
 #ifdef _SQL_COMPILE
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -345,7 +345,7 @@ handle_error(mvc *m, int pstatus, str ms
        } else if( GDKerrbuf && GDKerrbuf[0]){
                new = GDKstrdup(GDKerrbuf);
                GDKerrbuf[0] = 0;
-       }else if( m->errstr && *m->errstr){
+       }else if( *m->errstr){
                new = GDKstrdup(m->errstr);
                m->errstr[0] = 0;
        }
@@ -1059,7 +1059,7 @@ SQLparser(Client c)
            (mvc_status(m) && m->type != Q_TRANS) || !m->sym) {
                if (!err &&m->scanner.started)  /* repeat old errors, with a 
parsed query */
                        err = mvc_status(m);
-               if (err && m->errstr && *m->errstr) {
+               if (err && *m->errstr) {
                        if( strstr(m->errstr,"SQLSTATE"))
                                msg = createException(PARSE, "SQLparser", "%s", 
m->errstr);
                        else
@@ -1105,7 +1105,7 @@ SQLparser(Client c)
 
                r = sql_symbol2relation(m, m->sym);
 
-               if (!r || (err = mvc_status(m) && m->type != Q_TRANS && 
m->errstr && *m->errstr)) {
+               if (!r || (err = mvc_status(m) && m->type != Q_TRANS && 
*m->errstr)) {
                        if( strstr(m->errstr,"SQLSTATE"))
                                msg = createException(PARSE, "SQLparser", "%s", 
m->errstr);
                        else
diff --git a/sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py 
b/sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
--- a/sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
+++ b/sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
@@ -26,15 +26,15 @@ def run(conn, sql):
 
 # boring setup and schema creation stuff:
 c1 = connect(True)
-run(c1, 'create table foo (a int)')
-run(c1, 'insert into foo values (1),(2),(3)')
-run(c1, 'create view bar as select * from foo')
+run(c1, 'create table foo_2017 (a int)')
+run(c1, 'insert into foo_2017 values (1),(2),(3)')
+run(c1, 'create view bar as select * from foo_2017')
 
 c2 = connect(True)
 run(c1, 'start transaction')
-run(c1, 'delete from foo')
+run(c1, 'delete from foo_2017')
 run(c1, 'drop view bar')
-run(c1, 'create view bar as select * from foo')
+run(c1, 'create view bar as select * from foo_2017')
 run(c2, 'create table baz (a int);drop table baz')
 try:
     run(c1, 'commit')
@@ -43,6 +43,6 @@ except pymonetdb.IntegrityError:
     print "commit failed"
     pass
 
-run(c1, 'insert into foo values (4),(5),(6)') # SIGABRT here
+run(c1, 'insert into foo_2017 values (4),(5),(6)') # SIGABRT here
 run(c1, 'drop view bar')
-run(c1, 'drop table foo')
+run(c1, 'drop table foo_2017')
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to