Changeset: aded104de8e5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aded104de8e5
Modified Files:
        sql/server/sql_parser.y
        sql/test/SQLancer/Tests/sqlancer01.sql
        sql/test/SQLancer/Tests/sqlancer01.stable.err
Branch: Jun2020
Log Message:

Making SQLancer happy. Allow predicates at default values and expressions in 
the parser, so we throw a better error message


diffs (84 lines):

diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -1585,7 +1585,7 @@ partition_type:
  ;
 
 partition_expression:
-   simple_scalar_exp   { $$ = $1; }
+   search_condition    { $$ = $1; }
  ;
 
 partition_on:
@@ -1615,16 +1615,16 @@ opt_partition_by:
  ;
 
 partition_list_value:
-   simple_scalar_exp { $$ = $1; }
+   search_condition { $$ = $1; }
  ;
 
 partition_range_from:
-   simple_scalar_exp { $$ = $1; }
+   search_condition { $$ = $1; }
  | RANGE MINVALUE    { $$ = _symbol_create(SQL_MINVALUE, NULL ); }
  ;
 
 partition_range_to:
-   simple_scalar_exp { $$ = $1; }
+   search_condition { $$ = $1; }
  | RANGE MAXVALUE    { $$ = _symbol_create(SQL_MAXVALUE, NULL ); }
  ;
 
@@ -1832,7 +1832,7 @@ default:
  ;
 
 default_value:
-    simple_scalar_exp  { $$ = $1; }
+    search_condition   { $$ = $1; }
  ;
 
 column_constraint:
diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -166,6 +166,11 @@ SELECT count(*) FROM t0 WHERE (NOT (CAST
        -- 0
 ROLLBACK;
 
+START TRANSACTION;
+CREATE TABLE t0 (c0 boolean);
+ALTER TABLE t0 ALTER c0 SET DEFAULT (0.1) IS NULL;
+ROLLBACK;
+
 DROP TABLE tbl_ProductSales;
 DROP TABLE another_T;
 DROP TABLE integers;
diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.err 
b/sql/test/SQLancer/Tests/sqlancer01.stable.err
--- a/sql/test/SQLancer/Tests/sqlancer01.stable.err
+++ b/sql/test/SQLancer/Tests/sqlancer01.stable.err
@@ -5,20 +5,10 @@ stderr of test 'sqlancer01` in directory
 # 11:08:10 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=30085" "--set" 
"mapi_usock=/var/tmp/mtest-117725/.s.monetdb.30085" "--forcemito" 
"--dbpath=/home/ferreira/repositories/MonetDB-Jun2020/BUILD/var/MonetDB/mTests_sql_test_SQLancer"
 "--set" "embedded_c=true"
 # 11:08:10 >  
 
-# builtin opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Jun2020/BUILD/var/monetdb5/dbfarm/demo
-# builtin opt  mapi_port = 50000
-# builtin opt  mapi_open = false
-# builtin opt  mapi_ipv6 = false
-# builtin opt  mapi_autosense = false
-# builtin opt  sql_optimizer = default_pipe
-# builtin opt  sql_debug = 0
-# builtin opt  raw_strings = false
-# cmdline opt  gdk_nr_threads = 0
-# cmdline opt  mapi_open = true
-# cmdline opt  mapi_port = 30085
-# cmdline opt  mapi_usock = /var/tmp/mtest-117725/.s.monetdb.30085
-# cmdline opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Jun2020/BUILD/var/MonetDB/mTests_sql_test_SQLancer
-# cmdline opt  embedded_c = true
+MAPI  = (monetdb) /var/tmp/mtest-328612/.s.monetdb.34214
+QUERY = ALTER TABLE t0 ALTER c0 SET DEFAULT (0.1) IS NULL;
+ERROR = !incorrect default value 'SQL feature not yet available for 
expressions and default values: IS_NULL'
+CODE  = 42000
 
 # 11:08:12 >  
 # 11:08:12 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-117725" "--port=30085"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to