Repository: codenotary/immudb (language: go)

Issue:
The <column> <type> NULL syntax should be allowed
**What happened**

```
immuclient>exec CREATE TABLE test (a INTEGER, b INTEGER NULL, PRIMARY KEY a)
INFO: Redunant argument(s) | [TABLE test (a INTEGER, b INTEGER NULL, PRIMARY KEY a)] 
ERROR: rpc error: code = Unknown desc = syntax error: unexpected NULL, expecting ','
```

**What you expected to happen**

In standard SQL and in most DBMSs the above syntax is allowed (though it adds nothing, because columns are NULLable by default).



Discussion / hints:
Thanks a lot for opening this issue @federico-razzoli

Fix patch:
diff --git a/embedded/sql/catalog.go b/embedded/sql/catalog.go
index 7c853a8c41..05c2f07360 100644
--- a/embedded/sql/catalog.go
+++ b/embedded/sql/catalog.go
@@ -239,7 +239,7 @@ func (db *Database) newTable(name string, colsSpec []*ColSpec, pk string) (*Tabl
 			table:   table,
 			colName: cs.colName,
 			colType: cs.colType,
-			notNull: cs.notNull,
+			notNull: cs.notNull || cs.colName == pk,
 		}
 
 		table.colsByID[col.id] = col
diff --git a/embedded/sql/sql_grammar.y b/embedded/sql/sql_grammar.y
index 1532b9508c..20a0d620e7 100644
--- a/embedded/sql/sql_grammar.y
+++ b/embedded/sql/sql_grammar.y
@@ -337,6 +337,11 @@ opt_not_null:
     {
         $$ = false
     }
+|
+    NULL
+    {
+        $$ = false
+    }
 |
     NOT NULL
     {
diff --git a/embedded/sql/sql_parser.go b/embedded/sql/sql_parser.go
index 2576c10f0b..9fc27274e3 100644
--- a/embedded/sql/sql_parser.go
+++ b/embedded/sql/sql_parser.go
@@ -181,67 +181,68 @@ var yyExca = [...]int{
 
 const yyPrivate = 57344
 
-const yyLast = 250
+const yyLast = 251
 
 var yyAct = [...]int{
 
-	204, 37, 56, 144, 122, 4, 124, 143, 99, 71,
-	63, 90, 126, 72, 85, 129, 136, 196, 195, 190,
-	134, 105, 130, 131, 132, 133, 38, 189, 185, 106,
-	127, 164, 136, 154, 155, 128, 170, 135, 130, 131,
-	132, 133, 48, 50, 150, 151, 153, 152, 105, 49,
-	59, 183, 161, 135, 154, 155, 104, 39, 116, 155,
-	77, 112, 96, 161, 73, 150, 151, 153, 152, 150,
-	151, 153, 152, 76, 145, 97, 160, 95, 81, 94,
-	150, 151, 153, 152, 88, 79, 53, 93, 69, 67,
-	58, 18, 16, 103, 153, 152, 39, 68, 59, 203,
-	194, 167, 38, 109, 111, 114, 55, 34, 123, 39,
-	182, 31, 199, 102, 138, 38, 5, 83, 139, 115,
-	137, 7, 39, 140, 187, 162, 118, 146, 113, 36,
-	100, 157, 158, 159, 101, 86, 32, 87, 78, 75,
-	62, 60, 49, 47, 49, 44, 40, 80, 92, 166,
-	100, 175, 169, 173, 42, 176, 177, 178, 179, 180,
-	181, 156, 142, 61, 74, 70, 184, 57, 186, 172,
-	32, 188, 205, 206, 192, 193, 149, 121, 15, 108,
-	148, 110, 82, 17, 65, 64, 54, 21, 10, 11,
-	7, 119, 117, 29, 198, 201, 202, 197, 12, 10,
-	11, 28, 51, 6, 165, 207, 13, 14, 208, 12,
-	7, 52, 19, 2, 84, 66, 22, 13, 14, 163,
-	43, 23, 24, 27, 46, 25, 26, 141, 41, 171,
-	30, 200, 191, 120, 125, 147, 107, 91, 89, 45,
-	20, 35, 33, 168, 174, 98, 9, 8, 3, 1,
+	205, 37, 56, 145, 122, 4, 124, 144, 99, 71,
+	63, 90, 126, 72, 85, 129, 136, 197, 196, 191,
+	134, 105, 130, 131, 132, 133, 38, 190, 186, 106,
+	127, 165, 136, 155, 156, 128, 171, 135, 130, 131,
+	132, 133, 48, 50, 151, 152, 154, 153, 105, 49,
+	59, 184, 162, 135, 155, 156, 104, 39, 116, 156,
+	77, 112, 96, 162, 73, 151, 152, 154, 153, 151,
+	152, 154, 153, 76, 146, 97, 161, 95, 81, 94,
+	151, 152, 154, 153, 88, 79, 53, 93, 69, 67,
+	58, 18, 16, 103, 154, 153, 39, 68, 59, 204,
+	195, 168, 38, 109, 111, 114, 55, 34, 123, 39,
+	183, 31, 200, 102, 138, 38, 5, 83, 139, 115,
+	137, 7, 39, 140, 188, 163, 118, 147, 113, 36,
+	100, 158, 159, 160, 101, 86, 32, 87, 78, 75,
+	62, 60, 49, 47, 49, 44, 40, 143, 92, 167,
+	100, 142, 176, 170, 174, 80, 177, 178, 179, 180,
+	181, 182, 42, 157, 74, 70, 61, 185, 57, 187,
+	32, 173, 189, 206, 207, 193, 194, 150, 121, 15,
+	108, 149, 110, 82, 17, 65, 64, 54, 21, 10,
+	11, 7, 119, 117, 29, 199, 202, 203, 198, 12,
+	10, 11, 28, 51, 6, 166, 208, 13, 14, 209,
+	12, 7, 52, 19, 2, 84, 66, 22, 13, 14,
+	164, 43, 23, 24, 27, 46, 25, 26, 141, 41,
+	172, 30, 201, 192, 120, 125, 148, 107, 91, 89,
+	45, 20, 35, 33, 169, 175, 98, 9, 8, 3,
+	1,
 }
 var yyPact = [...]int{
 
-	184, -1000, -1000, 29, 28, -1000, 192, 160, -1000, -1000,
-	210, 219, 212, 177, 169, -1000, 184, -1000, -1000, 195,
-	47, -1000, 97, 111, 207, 96, 216, 94, 93, 93,
-	-1000, 181, 23, 158, -1000, 49, 127, -1000, 26, 36,
-	-1000, 92, 122, 91, -1000, 156, 154, 200, 25, 35,
-	24, -1000, -1000, 195, 0, 60, -1000, 90, 8, 89,
-	21, 103, 14, -1000, 152, 66, 198, 86, 88, 86,
-	-1000, 102, -1000, 95, 127, -1000, -1000, -3, 13, 81,
-	-1000, 85, 62, -1000, 81, -9, -1000, -1000, -36, 146,
-	-1000, 102, 150, 156, -4, -1000, -1000, 79, 48, -1000,
-	69, -7, -1000, -1000, 167, 77, 166, 143, -29, -1000,
-	0, 127, -1000, -1000, 101, 121, -1000, 10, -1000, 10,
-	148, 141, 7, 119, -1000, -1000, -29, -29, -29, 12,
-	-1000, -1000, -1000, -1000, -12, 76, -1000, 206, -34, 186,
-	-1000, -1000, 104, 44, -1000, -13, 44, 132, -29, 73,
-	-29, -29, -29, -29, -29, -29, 58, 11, 34, -14,
-	164, -37, -1000, -29, -1000, 75, -1000, 10, -38, -1000,
-	-1, 138, 140, 7, 43, -1000, 34, 34, -1000, -1000,
-	11, 22, -1000, -1000, -47, -1000, 7, -48, -1000, -1000,
-	-13, 127, 61, 73, 73, -1000, -1000, -1000, -1000, -1000,
-	42, 134, -1000, 73, -1000, -1000, -1000, 134, -1000,
+	185, -1000, -1000, 29, 28, -1000, 193, 161, -1000, -1000,
+	211, 220, 213, 178, 170, -1000, 185, -1000, -1000, 196,
+	47, -1000, 97, 119, 208, 96, 217, 94, 93, 93,
+	-1000, 182, 23, 159, -1000, 49, 128, -1000, 26, 36,
+	-1000, 92, 125, 91, -1000, 157, 155, 201, 25, 35,
+	24, -1000, -1000, 196, 0, 60, -1000, 90, 8, 89,
+	21, 111, 14, -1000, 153, 66, 199, 86, 88, 86,
+	-1000, 102, -1000, 95, 128, -1000, -1000, -3, 13, 81,
+	-1000, 85, 62, -1000, 81, -9, -1000, -1000, -36, 147,
+	-1000, 102, 151, 157, -4, -1000, -1000, 79, 48, -1000,
+	69, -7, -1000, -1000, 168, 77, 167, 144, -29, -1000,
+	0, 128, -1000, -1000, 101, 106, -1000, 10, -1000, 10,
+	149, 142, 7, 121, -1000, -1000, -29, -29, -29, 12,
+	-1000, -1000, -1000, -1000, -12, 76, -1000, 207, -34, 187,
+	-1000, -1000, -1000, 104, 44, -1000, -13, 44, 134, -29,
+	73, -29, -29, -29, -29, -29, -29, 58, 11, 34,
+	-14, 165, -37, -1000, -29, -1000, 75, -1000, 10, -38,
+	-1000, -1, 139, 141, 7, 43, -1000, 34, 34, -1000,
+	-1000, 11, 22, -1000, -1000, -47, -1000, 7, -48, -1000,
+	-1000, -13, 128, 61, 73, 73, -1000, -1000, -1000, -1000,
+	-1000, 42, 135, -1000, 73, -1000, -1000, -1000, 135, -1000,
 }
 var yyPgo = [...]int{
 
-	0, 249, 213, 111, 248, 116, 247, 246, 5, 245,
-	8, 14, 244, 7, 3, 243, 6, 108, 242, 241,
-	1, 240, 9, 13, 239, 10, 238, 11, 237, 4,
-	236, 235, 234, 233, 232, 2, 231, 229, 0, 228,
-	227, 178,
+	0, 250, 214, 111, 249, 116, 248, 247, 5, 246,
+	8, 14, 245, 7, 3, 244, 6, 108, 243, 242,
+	1, 241, 9, 13, 240, 10, 239, 11, 238, 4,
+	237, 236, 235, 234, 233, 2, 232, 230, 0, 229,
+	228, 179,
 }
 var yyR1 = [...]int{
 
@@ -249,13 +250,13 @@ var yyR1 = [...]int{
 	5, 3, 3, 6, 6, 6, 6, 6, 6, 24,
 	24, 39, 39, 7, 7, 13, 13, 14, 11, 11,
 	12, 12, 15, 15, 16, 16, 16, 16, 16, 16,
-	16, 9, 9, 10, 40, 40, 8, 21, 21, 18,
-	18, 19, 19, 17, 17, 17, 20, 20, 20, 22,
-	22, 22, 23, 23, 25, 25, 26, 26, 27, 27,
-	28, 30, 30, 33, 33, 31, 31, 34, 34, 37,
-	37, 36, 36, 38, 38, 38, 35, 35, 29, 29,
-	29, 29, 29, 29, 29, 29, 32, 32, 32, 32,
-	32, 32,
+	16, 9, 9, 10, 40, 40, 40, 8, 21, 21,
+	18, 18, 19, 19, 17, 17, 17, 20, 20, 20,
+	22, 22, 22, 23, 23, 25, 25, 26, 26, 27,
+	27, 28, 30, 30, 33, 33, 31, 31, 34, 34,
+	37, 37, 36, 36, 38, 38, 38, 35, 35, 29,
+	29, 29, 29, 29, 29, 29, 29, 32, 32, 32,
+	32, 32, 32,
 }
 var yyR2 = [...]int{
 
@@ -263,13 +264,13 @@ var yyR2 = [...]int{
 	1, 2, 3, 3, 3, 4, 11, 7, 6, 0,
 	3, 0, 3, 8, 8, 1, 3, 3, 1, 3,
 	1, 3, 1, 3, 1, 1, 1, 1, 3, 2,
-	1, 1, 3, 3, 0, 2, 12, 0, 1, 1,
-	1, 2, 4, 1, 3, 4, 1, 3, 5, 1,
-	5, 3, 1, 3, 0, 3, 0, 1, 1, 2,
-	5, 0, 2, 0, 3, 0, 2, 0, 2, 0,
-	3, 2, 4, 0, 1, 1, 0, 2, 1, 1,
-	1, 2, 2, 3, 3, 4, 3, 3, 3, 3,
-	3, 3,
+	1, 1, 3, 3, 0, 1, 2, 12, 0, 1,
+	1, 1, 2, 4, 1, 3, 4, 1, 3, 5,
+	1, 5, 3, 1, 3, 0, 3, 0, 1, 1,
+	2, 5, 0, 2, 0, 3, 0, 2, 0, 2,
+	0, 3, 2, 4, 0, 1, 1, 0, 2, 1,
+	1, 1, 2, 2, 3, 3, 4, 3, 3, 3,
+	3, 3, 3,
 }
 var yyChk = [...]int{
 
@@ -287,37 +288,37 @@ var yyChk = [...]int{
 	31, -25, 65, 49, 57, 50, 65, 25, 49, 25,
 	-33, 34, -29, -17, -16, -32, 41, 59, 64, 44,
 	51, 52, 53, 54, 49, 66, 45, -22, -35, 17,
-	-10, -40, 41, -13, -14, 64, -13, -31, 32, 35,
-	58, 59, 61, 60, 47, 48, 42, -29, -29, -29,
-	64, 64, 49, 13, 65, 18, 45, 57, -15, -16,
-	49, -37, 37, -29, -12, -20, -29, -29, -29, -29,
-	-29, -29, 52, 65, -8, 65, -29, 49, -14, 65,
-	57, -34, 36, 35, 57, 65, 65, -16, -35, 51,
-	-36, -20, -20, 57, -38, 38, 39, -20, -38,
+	-10, -40, 45, 41, -13, -14, 64, -13, -31, 32,
+	35, 58, 59, 61, 60, 47, 48, 42, -29, -29,
+	-29, 64, 64, 49, 13, 65, 18, 45, 57, -15,
+	-16, 49, -37, 37, -29, -12, -20, -29, -29, -29,
+	-29, -29, -29, 52, 65, -8, 65, -29, 49, -14,
+	65, 57, -34, 36, 35, 57, 65, 65, -16, -35,
+	51, -36, -20, -20, 57, -38, 38, 39, -20, -38,
 }
 var yyDef = [...]int{
 
-	0, -2, 1, 5, 5, 7, 0, 47, 9, 10,
+	0, -2, 1, 5, 5, 7, 0, 48, 9, 10,
 	0, 0, 0, 0, 0, 2, 6, 3, 6, 0,
-	0, 48, 0, 21, 0, 0, 19, 0, 0, 0,
-	4, 0, 5, 0, 49, 50, 86, 53, 0, 56,
-	13, 0, 0, 0, 14, 64, 0, 0, 0, 62,
-	0, 8, 11, 6, 0, 0, 51, 0, 0, 0,
+	0, 49, 0, 21, 0, 0, 19, 0, 0, 0,
+	4, 0, 5, 0, 50, 51, 87, 54, 0, 57,
+	13, 0, 0, 0, 14, 65, 0, 0, 0, 63,
+	0, 8, 11, 6, 0, 0, 52, 0, 0, 0,
 	0, 0, 0, 15, 0, 0, 0, 0, 0, 0,
-	12, 66, 59, 0, 86, 87, 54, 0, 57, 0,
-	22, 0, 0, 20, 0, 0, 28, 63, 0, 71,
-	67, 68, 0, 64, 0, 52, 55, 0, 0, 41,
-	0, 0, 65, 18, 0, 0, 0, 73, 0, 69,
-	0, 86, 61, 58, 0, 44, 17, 0, 29, 0,
-	75, 0, 72, 88, 89, 90, 0, 0, 0, 0,
-	34, 35, 36, 37, 56, 0, 40, 0, 0, 0,
-	42, 43, 0, 23, 25, 0, 24, 79, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 91, 92, 0,
-	0, 0, 39, 0, 60, 0, 45, 0, 0, 32,
-	0, 77, 0, 76, 74, 30, 96, 97, 98, 99,
-	100, 101, 94, 93, 0, 38, 70, 0, 26, 27,
-	0, 86, 0, 0, 0, 95, 16, 33, 46, 78,
-	80, 83, 31, 0, 81, 84, 85, 83, 82,
+	12, 67, 60, 0, 87, 88, 55, 0, 58, 0,
+	22, 0, 0, 20, 0, 0, 28, 64, 0, 72,
+	68, 69, 0, 65, 0, 53, 56, 0, 0, 41,
+	0, 0, 66, 18, 0, 0, 0, 74, 0, 70,
+	0, 87, 62, 59, 0, 44, 17, 0, 29, 0,
+	76, 0, 73, 89, 90, 91, 0, 0, 0, 0,
+	34, 35, 36, 37, 57, 0, 40, 0, 0, 0,
+	42, 43, 45, 0, 23, 25, 0, 24, 80, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 92, 93,
+	0, 0, 0, 39, 0, 61, 0, 46, 0, 0,
+	32, 0, 78, 0, 77, 75, 30, 97, 98, 99,
+	100, 101, 102, 95, 94, 0, 38, 71, 0, 26,
+	27, 0, 87, 0, 0, 0, 96, 16, 33, 47,
+	79, 81, 84, 31, 0, 82, 85, 86, 84, 83,
 }
 var yyTok1 = [...]int{
 
@@ -883,11 +884,16 @@ yydefault:
 			yyVAL.boolean = false
 		}
 	case 45:
+		yyDollar = yyS[yypt-1 : yypt+1]
+		{
+			yyVAL.boolean = false
+		}
+	case 46:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.boolean = true
 		}
-	case 46:
+	case 47:
 		yyDollar = yyS[yypt-12 : yypt+1]
 		{
 			yyVAL.stmt = &SelectStmt{
@@ -903,281 +909,281 @@ yydefault:
 				as:        yyDollar[12].id,
 			}
 		}
-	case 47:
+	case 48:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.distinct = false
 		}
-	case 48:
+	case 49:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.distinct = true
 		}
-	case 49:
+	case 50:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.sels = nil
 		}
-	case 50:
+	case 51:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.sels = yyDollar[1].sels
 		}
-	case 51:
+	case 52:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyDollar[1].sel.setAlias(yyDollar[2].id)
 			yyVAL.sels = []Selector{yyDollar[1].sel}
 		}
-	case 52:
+	case 53:
 		yyDollar = yyS[yypt-4 : yypt+1]
 		{
 			yyDollar[3].sel.setAlias(yyDollar[4].id)
 			yyVAL.sels = append(yyDollar[1].sels, yyDollar[3].sel)
 		}
-	case 53:
+	case 54:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.sel = yyDollar[1].col
 		}
-	case 54:
+	case 55:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.sel = &AggColSelector{aggFn: yyDollar[1].aggFn, col: "*"}
 		}
-	case 55:
+	case 56:
 		yyDollar = yyS[yypt-4 : yypt+1]
 		{
 			yyVAL.sel = &AggColSelector{aggFn: yyDollar[1].aggFn, db: yyDollar[3].col.db, table: yyDollar[3].col.table, col: yyDollar[3].col.col}
 		}
-	case 56:
+	case 57:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.col = &ColSelector{col: yyDollar[1].id}
 		}
-	case 57:
+	case 58:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.col = &ColSelector{table: yyDollar[1].id, col: yyDollar[3].id}
 		}
-	case 58:
+	case 59:
 		yyDollar = yyS[yypt-5 : yypt+1]
 		{
 			yyVAL.col = &ColSelector{db: yyDollar[1].id, table: yyDollar[3].id, col: yyDollar[5].id}
 		}
-	case 59:
+	case 60:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.ds = yyDollar[1].tableRef
 		}
-	case 60:
+	case 61:
 		yyDollar = yyS[yypt-5 : yypt+1]
 		{
 			yyDollar[2].tableRef.asBefore = yyDollar[3].number
 			yyDollar[2].tableRef.as = yyDollar[4].id
 			yyVAL.ds = yyDollar[2].tableRef
 		}
-	case 61:
+	case 62:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.ds = yyDollar[2].stmt.(*SelectStmt)
 		}
-	case 62:
+	case 63:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.tableRef = &TableRef{table: yyDollar[1].id}
 		}
-	case 63:
+	case 64:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.tableRef = &TableRef{db: yyDollar[1].id, table: yyDollar[3].id}
 		}
-	case 64:
+	case 65:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.number = 0
 		}
-	case 65:
+	case 66:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.number = yyDollar[3].number
 		}
-	case 66:
+	case 67:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.joins = nil
 		}
-	case 67:
+	case 68:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.joins = yyDollar[1].joins
 		}
-	case 68:
+	case 69:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.joins = []*JoinSpec{yyDollar[1].join}
 		}
-	case 69:
+	case 70:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.joins = append([]*JoinSpec{yyDollar[1].join}, yyDollar[2].joins...)
 		}
-	case 70:
+	case 71:
 		yyDollar = yyS[yypt-5 : yypt+1]
 		{
 			yyVAL.join = &JoinSpec{joinType: yyDollar[1].joinType, ds: yyDollar[3].ds, cond: yyDollar[5].boolExp}
 		}
-	case 71:
+	case 72:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.boolExp = nil
 		}
-	case 72:
+	case 73:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[2].boolExp
 		}
-	case 73:
+	case 74:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.cols = nil
 		}
-	case 74:
+	case 75:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.cols = yyDollar[3].cols
 		}
-	case 75:
+	case 76:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.boolExp = nil
 		}
-	case 76:
+	case 77:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[2].boolExp
 		}
-	case 77:
+	case 78:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.number = 0
 		}
-	case 78:
+	case 79:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.number = yyDollar[2].number
 		}
-	case 79:
+	case 80:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.ordcols = nil
 		}
-	case 80:
+	case 81:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.ordcols = yyDollar[3].ordcols
 		}
-	case 81:
+	case 82:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.ordcols = []*OrdCol{{sel: yyDollar[1].col, cmp: yyDollar[2].opt_ord}}
 		}
-	case 82:
+	case 83:
 		yyDollar = yyS[yypt-4 : yypt+1]
 		{
 			yyVAL.ordcols = append(yyDollar[1].ordcols, &OrdCol{sel: yyDollar[3].col, cmp: yyDollar[4].opt_ord})
 		}
-	case 83:
+	case 84:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.opt_ord = GreaterOrEqualTo
 		}
-	case 84:
+	case 85:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.opt_ord = GreaterOrEqualTo
 		}
-	case 85:
+	case 86:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.opt_ord = LowerOrEqualTo
 		}
-	case 86:
+	case 87:
 		yyDollar = yyS[yypt-0 : yypt+1]
 		{
 			yyVAL.id = ""
 		}
-	case 87:
+	case 88:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.id = yyDollar[2].id
 		}
-	case 88:
+	case 89:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[1].sel
 		}
-	case 89:
+	case 90:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[1].value
 		}
-	case 90:
+	case 91:
 		yyDollar = yyS[yypt-1 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[1].binExp
 		}
-	case 91:
+	case 92:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.boolExp = &NotBoolExp{exp: yyDollar[2].boolExp}
 		}
-	case 92:
+	case 93:
 		yyDollar = yyS[yypt-2 : yypt+1]
 		{
 			yyVAL.boolExp = &NumExp{left: &Number{val: uint64(0)}, op: SUBSOP, right: yyDollar[2].boolExp}
 		}
-	case 93:
+	case 94:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.boolExp = yyDollar[2].boolExp
 		}
-	case 94:
+	case 95:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.boolExp = &LikeBoolExp{sel: yyDollar[1].sel, pattern: yyDollar[3].str}
 		}
-	case 95:
+	case 96:
 		yyDollar = yyS[yypt-4 : yypt+1]
 		{
 			yyVAL.boolExp = &ExistsBoolExp{q: (yyDollar[3].stmt).(*SelectStmt)}
 		}
-	case 96:
+	case 97:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &NumExp{left: yyDollar[1].boolExp, op: ADDOP, right: yyDollar[3].boolExp}
 		}
-	case 97:
+	case 98:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &NumExp{left: yyDollar[1].boolExp, op: SUBSOP, right: yyDollar[3].boolExp}
 		}
-	case 98:
+	case 99:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &NumExp{left: yyDollar[1].boolExp, op: DIVOP, right: yyDollar[3].boolExp}
 		}
-	case 99:
+	case 100:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &NumExp{left: yyDollar[1].boolExp, op: MULTOP, right: yyDollar[3].boolExp}
 		}
-	case 100:
+	case 101:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &BinBoolExp{left: yyDollar[1].boolExp, op: yyDollar[2].logicOp, right: yyDollar[3].boolExp}
 		}
-	case 101:
+	case 102:
 		yyDollar = yyS[yypt-3 : yypt+1]
 		{
 			yyVAL.binExp = &CmpBoolExp{left: yyDollar[1].boolExp, op: yyDollar[2].cmpOp, right: yyDollar[3].boolExp}
diff --git a/embedded/sql/y.output b/embedded/sql/y.output
deleted file mode 100644
index 0d01dbab84..0000000000
--- a/embedded/sql/y.output
+++ /dev/null
@@ -1,1889 +0,0 @@
-
-state 0
-	$accept: .sql $end 
-
-	CREATE  shift 10
-	USE  shift 11
-	ALTER  shift 12
-	BEGIN  shift 6
-	INSERT  shift 13
-	UPSERT  shift 14
-	SELECT  shift 7
-	.  error
-
-	sql  goto 1
-	sqlstmts  goto 2
-	sqlstmt  goto 3
-	dstmt  goto 5
-	ddlstmt  goto 8
-	dmlstmt  goto 9
-	dqlstmt  goto 4
-
-state 1
-	$accept:  sql.$end 
-
-	$end  accept
-	.  error
-
-
-state 2
-	sql:  sqlstmts.    (1)
-
-	.  reduce 1 (src line 123)
-
-
-state 3
-	sqlstmts:  sqlstmt.opt_separator 
-	sqlstmts:  sqlstmt.STMT_SEPARATOR sqlstmts 
-	opt_separator: .    (5)
-
-	STMT_SEPARATOR  shift 16
-	.  reduce 5 (src line 145)
-
-	opt_separator  goto 15
-
-state 4
-	sqlstmts:  dqlstmt.opt_separator 
-	opt_separator: .    (5)
-
-	STMT_SEPARATOR  shift 18
-	.  reduce 5 (src line 145)
-
-	opt_separator  goto 17
-
-state 5
-	sqlstmt:  dstmt.    (7)
-
-	.  reduce 7 (src line 147)
-
-
-state 6
-	sqlstmt:  BEGIN.TRANSACTION dstmts COMMIT 
-
-	TRANSACTION  shift 19
-	.  error
-
-
-state 7
-	dqlstmt:  SELECT.opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-	opt_distinct: .    (47)
-
-	DISTINCT  shift 21
-	.  reduce 47 (src line 363)
-
-	opt_distinct  goto 20
-
-state 8
-	dstmt:  ddlstmt.    (9)
-
-	.  reduce 9 (src line 158)
-
-
-state 9
-	dstmt:  dmlstmt.    (10)
-
-	.  reduce 10 (src line 158)
-
-
-state 10
-	ddlstmt:  CREATE.DATABASE IDENTIFIER 
-	ddlstmt:  CREATE.TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY KEY IDENTIFIER ')' 
-	ddlstmt:  CREATE.INDEX ON IDENTIFIER '(' IDENTIFIER ')' 
-
-	DATABASE  shift 22
-	TABLE  shift 23
-	INDEX  shift 24
-	.  error
-
-
-state 11
-	ddlstmt:  USE.DATABASE IDENTIFIER 
-	ddlstmt:  USE.SNAPSHOT opt_since opt_as_before 
-
-	DATABASE  shift 25
-	SNAPSHOT  shift 26
-	.  error
-
-
-state 12
-	ddlstmt:  ALTER.TABLE IDENTIFIER ADD COLUMN colSpec 
-
-	TABLE  shift 27
-	.  error
-
-
-state 13
-	dmlstmt:  INSERT.INTO tableRef '(' ids ')' VALUES rows 
-
-	INTO  shift 28
-	.  error
-
-
-state 14
-	dmlstmt:  UPSERT.INTO tableRef '(' ids ')' VALUES rows 
-
-	INTO  shift 29
-	.  error
-
-
-state 15
-	sqlstmts:  sqlstmt opt_separator.    (2)
-
-	.  reduce 2 (src line 129)
-
-
-state 16
-	sqlstmts:  sqlstmt STMT_SEPARATOR.sqlstmts 
-	opt_separator:  STMT_SEPARATOR.    (6)
-
-	CREATE  shift 10
-	USE  shift 11
-	ALTER  shift 12
-	BEGIN  shift 6
-	INSERT  shift 13
-	UPSERT  shift 14
-	SELECT  shift 7
-	.  reduce 6 (src line 145)
-
-	sqlstmts  goto 30
-	sqlstmt  goto 3
-	dstmt  goto 5
-	ddlstmt  goto 8
-	dmlstmt  goto 9
-	dqlstmt  goto 4
-
-state 17
-	sqlstmts:  dqlstmt opt_separator.    (3)
-
-	.  reduce 3 (src line 134)
-
-
-state 18
-	opt_separator:  STMT_SEPARATOR.    (6)
-
-	.  reduce 6 (src line 145)
-
-
-state 19
-	sqlstmt:  BEGIN TRANSACTION.dstmts COMMIT 
-
-	CREATE  shift 10
-	USE  shift 11
-	ALTER  shift 12
-	INSERT  shift 13
-	UPSERT  shift 14
-	.  error
-
-	dstmts  goto 31
-	dstmt  goto 32
-	ddlstmt  goto 8
-	dmlstmt  goto 9
-
-state 20
-	dqlstmt:  SELECT opt_distinct.opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-
-	IDENTIFIER  shift 39
-	AGGREGATE_FUNC  shift 38
-	'*'  shift 34
-	.  error
-
-	selector  goto 36
-	opt_selectors  goto 33
-	selectors  goto 35
-	col  goto 37
-
-state 21
-	opt_distinct:  DISTINCT.    (48)
-
-	.  reduce 48 (src line 367)
-
-
-state 22
-	ddlstmt:  CREATE DATABASE.IDENTIFIER 
-
-	IDENTIFIER  shift 40
-	.  error
-
-
-state 23
-	ddlstmt:  CREATE TABLE.opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY KEY IDENTIFIER ')' 
-	opt_if_not_exists: .    (21)
-
-	IF  shift 42
-	.  reduce 21 (src line 212)
-
-	opt_if_not_exists  goto 41
-
-state 24
-	ddlstmt:  CREATE INDEX.ON IDENTIFIER '(' IDENTIFIER ')' 
-
-	ON  shift 43
-	.  error
-
-
-state 25
-	ddlstmt:  USE DATABASE.IDENTIFIER 
-
-	IDENTIFIER  shift 44
-	.  error
-
-
-state 26
-	ddlstmt:  USE SNAPSHOT.opt_since opt_as_before 
-	opt_since: .    (19)
-
-	SINCE  shift 46
-	.  reduce 19 (src line 202)
-
-	opt_since  goto 45
-
-state 27
-	ddlstmt:  ALTER TABLE.IDENTIFIER ADD COLUMN colSpec 
-
-	IDENTIFIER  shift 47
-	.  error
-
-
-state 28
-	dmlstmt:  INSERT INTO.tableRef '(' ids ')' VALUES rows 
-
-	IDENTIFIER  shift 49
-	.  error
-
-	tableRef  goto 48
-
-state 29
-	dmlstmt:  UPSERT INTO.tableRef '(' ids ')' VALUES rows 
-
-	IDENTIFIER  shift 49
-	.  error
-
-	tableRef  goto 50
-
-state 30
-	sqlstmts:  sqlstmt STMT_SEPARATOR sqlstmts.    (4)
-
-	.  reduce 4 (src line 139)
-
-
-state 31
-	sqlstmt:  BEGIN TRANSACTION dstmts.COMMIT 
-
-	COMMIT  shift 51
-	.  error
-
-
-state 32
-	dstmts:  dstmt.opt_separator 
-	dstmts:  dstmt.STMT_SEPARATOR dstmts 
-	opt_separator: .    (5)
-
-	STMT_SEPARATOR  shift 53
-	.  reduce 5 (src line 145)
-
-	opt_separator  goto 52
-
-state 33
-	dqlstmt:  SELECT opt_distinct opt_selectors.FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-
-	FROM  shift 54
-	.  error
-
-
-state 34
-	opt_selectors:  '*'.    (49)
-
-	.  reduce 49 (src line 373)
-
-
-state 35
-	opt_selectors:  selectors.    (50)
-	selectors:  selectors.',' selector opt_as 
-
-	','  shift 55
-	.  reduce 50 (src line 378)
-
-
-state 36
-	selectors:  selector.opt_as 
-	opt_as: .    (86)
-
-	AS  shift 57
-	.  reduce 86 (src line 571)
-
-	opt_as  goto 56
-
-state 37
-	selector:  col.    (53)
-
-	.  reduce 53 (src line 397)
-
-
-state 38
-	selector:  AGGREGATE_FUNC.'(' ')' 
-	selector:  AGGREGATE_FUNC.'(' col ')' 
-
-	'('  shift 58
-	.  error
-
-
-state 39
-	col:  IDENTIFIER.    (56)
-	col:  IDENTIFIER.'.' IDENTIFIER 
-	col:  IDENTIFIER.'.' IDENTIFIER '.' IDENTIFIER 
-
-	'.'  shift 59
-	.  reduce 56 (src line 413)
-
-
-state 40
-	ddlstmt:  CREATE DATABASE IDENTIFIER.    (13)
-
-	.  reduce 13 (src line 171)
-
-
-state 41
-	ddlstmt:  CREATE TABLE opt_if_not_exists.IDENTIFIER '(' colsSpec ',' PRIMARY KEY IDENTIFIER ')' 
-
-	IDENTIFIER  shift 60
-	.  error
-
-
-state 42
-	opt_if_not_exists:  IF.NOT EXISTS 
-
-	NOT  shift 61
-	.  error
-
-
-state 43
-	ddlstmt:  CREATE INDEX ON.IDENTIFIER '(' IDENTIFIER ')' 
-
-	IDENTIFIER  shift 62
-	.  error
-
-
-state 44
-	ddlstmt:  USE DATABASE IDENTIFIER.    (14)
-
-	.  reduce 14 (src line 176)
-
-
-state 45
-	ddlstmt:  USE SNAPSHOT opt_since.opt_as_before 
-	opt_as_before: .    (64)
-
-	BEFORE  shift 64
-	.  reduce 64 (src line 458)
-
-	opt_as_before  goto 63
-
-state 46
-	opt_since:  SINCE.TX NUMBER 
-
-	TX  shift 65
-	.  error
-
-
-state 47
-	ddlstmt:  ALTER TABLE IDENTIFIER.ADD COLUMN colSpec 
-
-	ADD  shift 66
-	.  error
-
-
-state 48
-	dmlstmt:  INSERT INTO tableRef.'(' ids ')' VALUES rows 
-
-	'('  shift 67
-	.  error
-
-
-state 49
-	tableRef:  IDENTIFIER.    (62)
-	tableRef:  IDENTIFIER.'.' IDENTIFIER 
-
-	'.'  shift 68
-	.  reduce 62 (src line 447)
-
-
-state 50
-	dmlstmt:  UPSERT INTO tableRef.'(' ids ')' VALUES rows 
-
-	'('  shift 69
-	.  error
-
-
-state 51
-	sqlstmt:  BEGIN TRANSACTION dstmts COMMIT.    (8)
-
-	.  reduce 8 (src line 152)
-
-
-state 52
-	dstmts:  dstmt opt_separator.    (11)
-
-	.  reduce 11 (src line 160)
-
-
-state 53
-	opt_separator:  STMT_SEPARATOR.    (6)
-	dstmts:  dstmt STMT_SEPARATOR.dstmts 
-
-	CREATE  shift 10
-	USE  shift 11
-	ALTER  shift 12
-	INSERT  shift 13
-	UPSERT  shift 14
-	.  reduce 6 (src line 145)
-
-	dstmts  goto 70
-	dstmt  goto 32
-	ddlstmt  goto 8
-	dmlstmt  goto 9
-
-state 54
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM.ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-
-	IDENTIFIER  shift 49
-	'('  shift 73
-	.  error
-
-	ds  goto 71
-	tableRef  goto 72
-
-state 55
-	selectors:  selectors ','.selector opt_as 
-
-	IDENTIFIER  shift 39
-	AGGREGATE_FUNC  shift 38
-	.  error
-
-	selector  goto 74
-	col  goto 37
-
-state 56
-	selectors:  selector opt_as.    (51)
-
-	.  reduce 51 (src line 384)
-
-
-state 57
-	opt_as:  AS.IDENTIFIER 
-
-	IDENTIFIER  shift 75
-	.  error
-
-
-state 58
-	selector:  AGGREGATE_FUNC '('.')' 
-	selector:  AGGREGATE_FUNC '('.col ')' 
-
-	IDENTIFIER  shift 39
-	')'  shift 76
-	.  error
-
-	col  goto 77
-
-state 59
-	col:  IDENTIFIER '.'.IDENTIFIER 
-	col:  IDENTIFIER '.'.IDENTIFIER '.' IDENTIFIER 
-
-	IDENTIFIER  shift 78
-	.  error
-
-
-state 60
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER.'(' colsSpec ',' PRIMARY KEY IDENTIFIER ')' 
-
-	'('  shift 79
-	.  error
-
-
-state 61
-	opt_if_not_exists:  IF NOT.EXISTS 
-
-	EXISTS  shift 80
-	.  error
-
-
-state 62
-	ddlstmt:  CREATE INDEX ON IDENTIFIER.'(' IDENTIFIER ')' 
-
-	'('  shift 81
-	.  error
-
-
-state 63
-	ddlstmt:  USE SNAPSHOT opt_since opt_as_before.    (15)
-
-	.  reduce 15 (src line 181)
-
-
-state 64
-	opt_as_before:  BEFORE.TX NUMBER 
-
-	TX  shift 82
-	.  error
-
-
-state 65
-	opt_since:  SINCE TX.NUMBER 
-
-	NUMBER  shift 83
-	.  error
-
-
-state 66
-	ddlstmt:  ALTER TABLE IDENTIFIER ADD.COLUMN colSpec 
-
-	COLUMN  shift 84
-	.  error
-
-
-state 67
-	dmlstmt:  INSERT INTO tableRef '('.ids ')' VALUES rows 
-
-	IDENTIFIER  shift 86
-	.  error
-
-	ids  goto 85
-
-state 68
-	tableRef:  IDENTIFIER '.'.IDENTIFIER 
-
-	IDENTIFIER  shift 87
-	.  error
-
-
-state 69
-	dmlstmt:  UPSERT INTO tableRef '('.ids ')' VALUES rows 
-
-	IDENTIFIER  shift 86
-	.  error
-
-	ids  goto 88
-
-state 70
-	dstmts:  dstmt STMT_SEPARATOR dstmts.    (12)
-
-	.  reduce 12 (src line 165)
-
-
-state 71
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds.opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-	opt_joins: .    (66)
-
-	JOINTYPE  shift 92
-	.  reduce 66 (src line 468)
-
-	opt_joins  goto 89
-	joins  goto 90
-	join  goto 91
-
-state 72
-	ds:  tableRef.    (59)
-
-	.  reduce 59 (src line 429)
-
-
-state 73
-	ds:  '('.tableRef opt_as_before opt_as ')' 
-	ds:  '('.dqlstmt ')' 
-
-	SELECT  shift 7
-	IDENTIFIER  shift 49
-	.  error
-
-	dqlstmt  goto 94
-	tableRef  goto 93
-
-state 74
-	selectors:  selectors ',' selector.opt_as 
-	opt_as: .    (86)
-
-	AS  shift 57
-	.  reduce 86 (src line 571)
-
-	opt_as  goto 95
-
-state 75
-	opt_as:  AS IDENTIFIER.    (87)
-
-	.  reduce 87 (src line 575)
-
-
-state 76
-	selector:  AGGREGATE_FUNC '(' ')'.    (54)
-
-	.  reduce 54 (src line 402)
-
-
-state 77
-	selector:  AGGREGATE_FUNC '(' col.')' 
-
-	')'  shift 96
-	.  error
-
-
-state 78
-	col:  IDENTIFIER '.' IDENTIFIER.    (57)
-	col:  IDENTIFIER '.' IDENTIFIER.'.' IDENTIFIER 
-
-	'.'  shift 97
-	.  reduce 57 (src line 418)
-
-
-state 79
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '('.colsSpec ',' PRIMARY KEY IDENTIFIER ')' 
-
-	IDENTIFIER  shift 100
-	.  error
-
-	colsSpec  goto 98
-	colSpec  goto 99
-
-state 80
-	opt_if_not_exists:  IF NOT EXISTS.    (22)
-
-	.  reduce 22 (src line 216)
-
-
-state 81
-	ddlstmt:  CREATE INDEX ON IDENTIFIER '('.IDENTIFIER ')' 
-
-	IDENTIFIER  shift 101
-	.  error
-
-
-state 82
-	opt_as_before:  BEFORE TX.NUMBER 
-
-	NUMBER  shift 102
-	.  error
-
-
-state 83
-	opt_since:  SINCE TX NUMBER.    (20)
-
-	.  reduce 20 (src line 206)
-
-
-state 84
-	ddlstmt:  ALTER TABLE IDENTIFIER ADD COLUMN.colSpec 
-
-	IDENTIFIER  shift 100
-	.  error
-
-	colSpec  goto 103
-
-state 85
-	dmlstmt:  INSERT INTO tableRef '(' ids.')' VALUES rows 
-	ids:  ids.',' IDENTIFIER 
-
-	','  shift 105
-	')'  shift 104
-	.  error
-
-
-state 86
-	ids:  IDENTIFIER.    (28)
-
-	.  reduce 28 (src line 250)
-
-
-state 87
-	tableRef:  IDENTIFIER '.' IDENTIFIER.    (63)
-
-	.  reduce 63 (src line 452)
-
-
-state 88
-	dmlstmt:  UPSERT INTO tableRef '(' ids.')' VALUES rows 
-	ids:  ids.',' IDENTIFIER 
-
-	','  shift 105
-	')'  shift 106
-	.  error
-
-
-state 89
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins.opt_where opt_groupby opt_having opt_orderby opt_limit opt_as 
-	opt_where: .    (71)
-
-	WHERE  shift 108
-	.  reduce 71 (src line 495)
-
-	opt_where  goto 107
-
-state 90
-	opt_joins:  joins.    (67)
-
-	.  reduce 67 (src line 472)
-
-
-state 91
-	joins:  join.    (68)
-	joins:  join.joins 
-
-	JOINTYPE  shift 92
-	.  reduce 68 (src line 478)
-
-	joins  goto 109
-	join  goto 91
-
-state 92
-	join:  JOINTYPE.JOIN ds ON boolExp 
-
-	JOIN  shift 110
-	.  error
-
-
-state 93
-	ds:  '(' tableRef.opt_as_before opt_as ')' 
-	opt_as_before: .    (64)
-
-	BEFORE  shift 64
-	.  reduce 64 (src line 458)
-
-	opt_as_before  goto 111
-
-state 94
-	ds:  '(' dqlstmt.')' 
-
-	')'  shift 112
-	.  error
-
-
-state 95
-	selectors:  selectors ',' selector opt_as.    (52)
-
-	.  reduce 52 (src line 390)
-
-
-state 96
-	selector:  AGGREGATE_FUNC '(' col ')'.    (55)
-
-	.  reduce 55 (src line 407)
-
-
-state 97
-	col:  IDENTIFIER '.' IDENTIFIER '.'.IDENTIFIER 
-
-	IDENTIFIER  shift 113
-	.  error
-
-
-state 98
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec.',' PRIMARY KEY IDENTIFIER ')' 
-	colsSpec:  colsSpec.',' colSpec 
-
-	','  shift 114
-	.  error
-
-
-state 99
-	colsSpec:  colSpec.    (41)
-
-	.  reduce 41 (src line 319)
-
-
-state 100
-	colSpec:  IDENTIFIER.TYPE opt_not_null 
-
-	TYPE  shift 115
-	.  error
-
-
-state 101
-	ddlstmt:  CREATE INDEX ON IDENTIFIER '(' IDENTIFIER.')' 
-
-	')'  shift 116
-	.  error
-
-
-state 102
-	opt_as_before:  BEFORE TX NUMBER.    (65)
-
-	.  reduce 65 (src line 462)
-
-
-state 103
-	ddlstmt:  ALTER TABLE IDENTIFIER ADD COLUMN colSpec.    (18)
-
-	.  reduce 18 (src line 196)
-
-
-state 104
-	dmlstmt:  INSERT INTO tableRef '(' ids ')'.VALUES rows 
-
-	VALUES  shift 117
-	.  error
-
-
-state 105
-	ids:  ids ','.IDENTIFIER 
-
-	IDENTIFIER  shift 118
-	.  error
-
-
-state 106
-	dmlstmt:  UPSERT INTO tableRef '(' ids ')'.VALUES rows 
-
-	VALUES  shift 119
-	.  error
-
-
-state 107
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where.opt_groupby opt_having opt_orderby opt_limit opt_as 
-	opt_groupby: .    (73)
-
-	GROUP  shift 121
-	.  reduce 73 (src line 505)
-
-	opt_groupby  goto 120
-
-state 108
-	opt_where:  WHERE.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 122
-	binExp  goto 125
-
-state 109
-	joins:  join joins.    (69)
-
-	.  reduce 69 (src line 483)
-
-
-state 110
-	join:  JOINTYPE JOIN.ds ON boolExp 
-
-	IDENTIFIER  shift 49
-	'('  shift 73
-	.  error
-
-	ds  goto 137
-	tableRef  goto 72
-
-state 111
-	ds:  '(' tableRef opt_as_before.opt_as ')' 
-	opt_as: .    (86)
-
-	AS  shift 57
-	.  reduce 86 (src line 571)
-
-	opt_as  goto 138
-
-state 112
-	ds:  '(' dqlstmt ')'.    (61)
-
-	.  reduce 61 (src line 441)
-
-
-state 113
-	col:  IDENTIFIER '.' IDENTIFIER '.' IDENTIFIER.    (58)
-
-	.  reduce 58 (src line 423)
-
-
-state 114
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ','.PRIMARY KEY IDENTIFIER ')' 
-	colsSpec:  colsSpec ','.colSpec 
-
-	PRIMARY  shift 139
-	IDENTIFIER  shift 100
-	.  error
-
-	colSpec  goto 140
-
-state 115
-	colSpec:  IDENTIFIER TYPE.opt_not_null 
-	opt_not_null: .    (44)
-
-	NOT  shift 142
-	.  reduce 44 (src line 336)
-
-	opt_not_null  goto 141
-
-state 116
-	ddlstmt:  CREATE INDEX ON IDENTIFIER '(' IDENTIFIER ')'.    (17)
-
-	.  reduce 17 (src line 191)
-
-
-state 117
-	dmlstmt:  INSERT INTO tableRef '(' ids ')' VALUES.rows 
-
-	'('  shift 145
-	.  error
-
-	rows  goto 143
-	row  goto 144
-
-state 118
-	ids:  ids ',' IDENTIFIER.    (29)
-
-	.  reduce 29 (src line 255)
-
-
-state 119
-	dmlstmt:  UPSERT INTO tableRef '(' ids ')' VALUES.rows 
-
-	'('  shift 145
-	.  error
-
-	rows  goto 146
-	row  goto 144
-
-state 120
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby.opt_having opt_orderby opt_limit opt_as 
-	opt_having: .    (75)
-
-	HAVING  shift 148
-	.  reduce 75 (src line 515)
-
-	opt_having  goto 147
-
-state 121
-	opt_groupby:  GROUP.BY cols 
-
-	BY  shift 149
-	.  error
-
-
-state 122
-	opt_where:  WHERE boolExp.    (72)
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	LOP  shift 154
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 72 (src line 499)
-
-
-state 123
-	boolExp:  selector.    (88)
-	boolExp:  selector.LIKE VARCHAR 
-
-	LIKE  shift 156
-	.  reduce 88 (src line 581)
-
-
-state 124
-	boolExp:  val.    (89)
-
-	.  reduce 89 (src line 586)
-
-
-state 125
-	boolExp:  binExp.    (90)
-
-	.  reduce 90 (src line 591)
-
-
-state 126
-	boolExp:  NOT.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 157
-	binExp  goto 125
-
-state 127
-	boolExp:  '-'.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 158
-	binExp  goto 125
-
-state 128
-	boolExp:  '('.boolExp ')' 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 159
-	binExp  goto 125
-
-state 129
-	boolExp:  EXISTS.'(' dqlstmt ')' 
-
-	'('  shift 160
-	.  error
-
-
-state 130
-	val:  NUMBER.    (34)
-
-	.  reduce 34 (src line 283)
-
-
-state 131
-	val:  VARCHAR.    (35)
-
-	.  reduce 35 (src line 288)
-
-
-state 132
-	val:  BOOLEAN.    (36)
-
-	.  reduce 36 (src line 293)
-
-
-state 133
-	val:  BLOB.    (37)
-
-	.  reduce 37 (src line 298)
-
-
-state 134
-	val:  IDENTIFIER.'(' ')' 
-	col:  IDENTIFIER.    (56)
-	col:  IDENTIFIER.'.' IDENTIFIER 
-	col:  IDENTIFIER.'.' IDENTIFIER '.' IDENTIFIER 
-
-	'.'  shift 59
-	'('  shift 161
-	.  reduce 56 (src line 413)
-
-
-state 135
-	val:  '@'.IDENTIFIER 
-
-	IDENTIFIER  shift 162
-	.  error
-
-
-state 136
-	val:  NULL.    (40)
-
-	.  reduce 40 (src line 313)
-
-
-state 137
-	join:  JOINTYPE JOIN ds.ON boolExp 
-
-	ON  shift 163
-	.  error
-
-
-state 138
-	ds:  '(' tableRef opt_as_before opt_as.')' 
-
-	')'  shift 164
-	.  error
-
-
-state 139
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY.KEY IDENTIFIER ')' 
-
-	KEY  shift 165
-	.  error
-
-
-state 140
-	colsSpec:  colsSpec ',' colSpec.    (42)
-
-	.  reduce 42 (src line 324)
-
-
-state 141
-	colSpec:  IDENTIFIER TYPE opt_not_null.    (43)
-
-	.  reduce 43 (src line 330)
-
-
-state 142
-	opt_not_null:  NOT.NULL 
-
-	NULL  shift 166
-	.  error
-
-
-state 143
-	dmlstmt:  INSERT INTO tableRef '(' ids ')' VALUES rows.    (23)
-	rows:  rows.',' row 
-
-	','  shift 167
-	.  reduce 23 (src line 222)
-
-
-state 144
-	rows:  row.    (25)
-
-	.  reduce 25 (src line 233)
-
-
-state 145
-	row:  '('.values ')' 
-
-	NULL  shift 136
-	IDENTIFIER  shift 170
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	'@'  shift 135
-	.  error
-
-	values  goto 168
-	val  goto 169
-
-state 146
-	dmlstmt:  UPSERT INTO tableRef '(' ids ')' VALUES rows.    (24)
-	rows:  rows.',' row 
-
-	','  shift 167
-	.  reduce 24 (src line 227)
-
-
-state 147
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having.opt_orderby opt_limit opt_as 
-	opt_orderby: .    (79)
-
-	ORDER  shift 172
-	.  reduce 79 (src line 535)
-
-	opt_orderby  goto 171
-
-state 148
-	opt_having:  HAVING.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 173
-	binExp  goto 125
-
-state 149
-	opt_groupby:  GROUP BY.cols 
-
-	IDENTIFIER  shift 39
-	.  error
-
-	cols  goto 174
-	col  goto 175
-
-state 150
-	binExp:  boolExp '+'.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 176
-	binExp  goto 125
-
-state 151
-	binExp:  boolExp '-'.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 177
-	binExp  goto 125
-
-state 152
-	binExp:  boolExp '/'.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 178
-	binExp  goto 125
-
-state 153
-	binExp:  boolExp '*'.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 179
-	binExp  goto 125
-
-state 154
-	binExp:  boolExp LOP.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 180
-	binExp  goto 125
-
-state 155
-	binExp:  boolExp CMPOP.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 181
-	binExp  goto 125
-
-state 156
-	boolExp:  selector LIKE.VARCHAR 
-
-	VARCHAR  shift 182
-	.  error
-
-
-state 157
-	boolExp:  NOT boolExp.    (91)
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 91 (src line 596)
-
-
-state 158
-	boolExp:  '-' boolExp.    (92)
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 92 (src line 601)
-
-
-state 159
-	boolExp:  '(' boolExp.')' 
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	LOP  shift 154
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	')'  shift 183
-	.  error
-
-
-state 160
-	boolExp:  EXISTS '('.dqlstmt ')' 
-
-	SELECT  shift 7
-	.  error
-
-	dqlstmt  goto 184
-
-state 161
-	val:  IDENTIFIER '('.')' 
-
-	')'  shift 185
-	.  error
-
-
-state 162
-	val:  '@' IDENTIFIER.    (39)
-
-	.  reduce 39 (src line 308)
-
-
-state 163
-	join:  JOINTYPE JOIN ds ON.boolExp 
-
-	NOT  shift 126
-	EXISTS  shift 129
-	NULL  shift 136
-	IDENTIFIER  shift 134
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	AGGREGATE_FUNC  shift 38
-	'-'  shift 127
-	'('  shift 128
-	'@'  shift 135
-	.  error
-
-	val  goto 124
-	selector  goto 123
-	col  goto 37
-	boolExp  goto 186
-	binExp  goto 125
-
-state 164
-	ds:  '(' tableRef opt_as_before opt_as ')'.    (60)
-
-	.  reduce 60 (src line 434)
-
-
-state 165
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY KEY.IDENTIFIER ')' 
-
-	IDENTIFIER  shift 187
-	.  error
-
-
-state 166
-	opt_not_null:  NOT NULL.    (45)
-
-	.  reduce 45 (src line 340)
-
-
-state 167
-	rows:  rows ','.row 
-
-	'('  shift 145
-	.  error
-
-	row  goto 188
-
-state 168
-	row:  '(' values.')' 
-	values:  values.',' val 
-
-	','  shift 190
-	')'  shift 189
-	.  error
-
-
-state 169
-	values:  val.    (32)
-
-	.  reduce 32 (src line 272)
-
-
-state 170
-	val:  IDENTIFIER.'(' ')' 
-
-	'('  shift 161
-	.  error
-
-
-state 171
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby.opt_limit opt_as 
-	opt_limit: .    (77)
-
-	LIMIT  shift 192
-	.  reduce 77 (src line 525)
-
-	opt_limit  goto 191
-
-state 172
-	opt_orderby:  ORDER.BY ordcols 
-
-	BY  shift 193
-	.  error
-
-
-state 173
-	opt_having:  HAVING boolExp.    (76)
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	LOP  shift 154
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 76 (src line 519)
-
-
-state 174
-	cols:  cols.',' col 
-	opt_groupby:  GROUP BY cols.    (74)
-
-	','  shift 194
-	.  reduce 74 (src line 509)
-
-
-state 175
-	cols:  col.    (30)
-
-	.  reduce 30 (src line 261)
-
-
-state 176
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp '+' boolExp.    (96)
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 96 (src line 622)
-
-
-state 177
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp '-' boolExp.    (97)
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 97 (src line 627)
-
-
-state 178
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp '/' boolExp.    (98)
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	.  reduce 98 (src line 632)
-
-
-state 179
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp '*' boolExp.    (99)
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	.  reduce 99 (src line 637)
-
-
-state 180
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp LOP boolExp.    (100)
-	binExp:  boolExp.CMPOP boolExp 
-
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 100 (src line 642)
-
-
-state 181
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-	binExp:  boolExp CMPOP boolExp.    (101)
-
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 101 (src line 647)
-
-
-state 182
-	boolExp:  selector LIKE VARCHAR.    (94)
-
-	.  reduce 94 (src line 611)
-
-
-state 183
-	boolExp:  '(' boolExp ')'.    (93)
-
-	.  reduce 93 (src line 606)
-
-
-state 184
-	boolExp:  EXISTS '(' dqlstmt.')' 
-
-	')'  shift 195
-	.  error
-
-
-state 185
-	val:  IDENTIFIER '(' ')'.    (38)
-
-	.  reduce 38 (src line 303)
-
-
-state 186
-	join:  JOINTYPE JOIN ds ON boolExp.    (70)
-	binExp:  boolExp.'+' boolExp 
-	binExp:  boolExp.'-' boolExp 
-	binExp:  boolExp.'/' boolExp 
-	binExp:  boolExp.'*' boolExp 
-	binExp:  boolExp.LOP boolExp 
-	binExp:  boolExp.CMPOP boolExp 
-
-	LOP  shift 154
-	CMPOP  shift 155
-	'+'  shift 150
-	'-'  shift 151
-	'*'  shift 153
-	'/'  shift 152
-	.  reduce 70 (src line 489)
-
-
-state 187
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY KEY IDENTIFIER.')' 
-
-	')'  shift 196
-	.  error
-
-
-state 188
-	rows:  rows ',' row.    (26)
-
-	.  reduce 26 (src line 238)
-
-
-state 189
-	row:  '(' values ')'.    (27)
-
-	.  reduce 27 (src line 244)
-
-
-state 190
-	values:  values ','.val 
-
-	NULL  shift 136
-	IDENTIFIER  shift 170
-	NUMBER  shift 130
-	VARCHAR  shift 131
-	BOOLEAN  shift 132
-	BLOB  shift 133
-	'@'  shift 135
-	.  error
-
-	val  goto 197
-
-state 191
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit.opt_as 
-	opt_as: .    (86)
-
-	AS  shift 57
-	.  reduce 86 (src line 571)
-
-	opt_as  goto 198
-
-state 192
-	opt_limit:  LIMIT.NUMBER 
-
-	NUMBER  shift 199
-	.  error
-
-
-state 193
-	opt_orderby:  ORDER BY.ordcols 
-
-	IDENTIFIER  shift 39
-	.  error
-
-	col  goto 201
-	ordcols  goto 200
-
-state 194
-	cols:  cols ','.col 
-
-	IDENTIFIER  shift 39
-	.  error
-
-	col  goto 202
-
-state 195
-	boolExp:  EXISTS '(' dqlstmt ')'.    (95)
-
-	.  reduce 95 (src line 616)
-
-
-state 196
-	ddlstmt:  CREATE TABLE opt_if_not_exists IDENTIFIER '(' colsSpec ',' PRIMARY KEY IDENTIFIER ')'.    (16)
-
-	.  reduce 16 (src line 186)
-
-
-state 197
-	values:  values ',' val.    (33)
-
-	.  reduce 33 (src line 277)
-
-
-state 198
-	dqlstmt:  SELECT opt_distinct opt_selectors FROM ds opt_joins opt_where opt_groupby opt_having opt_orderby opt_limit opt_as.    (46)
-
-	.  reduce 46 (src line 346)
-
-
-state 199
-	opt_limit:  LIMIT NUMBER.    (78)
-
-	.  reduce 78 (src line 529)
-
-
-state 200
-	opt_orderby:  ORDER BY ordcols.    (80)
-	ordcols:  ordcols.',' col opt_ord 
-
-	','  shift 203
-	.  reduce 80 (src line 539)
-
-
-state 201
-	ordcols:  col.opt_ord 
-	opt_ord: .    (83)
-
-	ASC  shift 205
-	DESC  shift 206
-	.  reduce 83 (src line 556)
-
-	opt_ord  goto 204
-
-state 202
-	cols:  cols ',' col.    (31)
-
-	.  reduce 31 (src line 266)
-
-
-state 203
-	ordcols:  ordcols ','.col opt_ord 
-
-	IDENTIFIER  shift 39
-	.  error
-
-	col  goto 207
-
-state 204
-	ordcols:  col opt_ord.    (81)
-
-	.  reduce 81 (src line 545)
-
-
-state 205
-	opt_ord:  ASC.    (84)
-
-	.  reduce 84 (src line 560)
-
-
-state 206
-	opt_ord:  DESC.    (85)
-
-	.  reduce 85 (src line 565)
-
-
-state 207
-	ordcols:  ordcols ',' col.opt_ord 
-	opt_ord: .    (83)
-
-	ASC  shift 205
-	DESC  shift 206
-	.  reduce 83 (src line 556)
-
-	opt_ord  goto 208
-
-state 208
-	ordcols:  ordcols ',' col opt_ord.    (82)
-
-	.  reduce 82 (src line 550)
-
-
-66 terminals, 42 nonterminals
-102 grammar rules, 209/8000 states
-0 shift/reduce, 0 reduce/reduce conflicts reported
-91 working sets used
-memory: parser 158/120000
-174 extra closures
-356 shift entries, 1 exceptions
-84 goto entries
-58 entries saved by goto default
-Optimizer space used: output 250/120000
-250 table entries, 0 zero
-maximum spread: 66, maximum offset: 207


Test patch:
diff --git a/embedded/sql/parser_test.go b/embedded/sql/parser_test.go
index f57d842178..b93e070afe 100644
--- a/embedded/sql/parser_test.go
+++ b/embedded/sql/parser_test.go
@@ -1091,7 +1091,7 @@ func TestMultiLineStmts(t *testing.T) {
 
 			CREATE DATABASE db1;
 
-			CREATE TABLE table1 (id INTEGER, name VARCHAR, ts TIMESTAMP, active BOOLEAN, content BLOB, PRIMARY KEY id);
+			CREATE TABLE table1 (id INTEGER, name VARCHAR NULL, ts TIMESTAMP NOT NULL, active BOOLEAN, content BLOB, PRIMARY KEY id);
 
 			BEGIN TRANSACTION
 				UPSERT INTO table1 (id, label) VALUES (100, 'label1');
@@ -1109,7 +1109,7 @@ func TestMultiLineStmts(t *testing.T) {
 					colsSpec: []*ColSpec{
 						{colName: "id", colType: IntegerType},
 						{colName: "name", colType: VarcharType},
-						{colName: "ts", colType: TimestampType},
+						{colName: "ts", colType: TimestampType, notNull: true},
 						{colName: "active", colType: BooleanType},
 						{colName: "content", colType: BLOBType},
 					},