chore: make every CREATE TABLE stmt in entire repo have 1 space after tbl name

`BTreeTable::to_sql` makes us incompatible with SQLite by losing e.g. the original whitespace provided during the CREATE TABLE command.

For now let's fix our tests by regex-replacing every CREATE TABLE in
the entire repo to have exactly 1 space after the table name in the
CREATE TABLE statement.
This commit is contained in:
Jussi Saurio
2025-07-22 11:33:49 +03:00
parent f83870731d
commit 022f679fab
59 changed files with 666 additions and 661 deletions

View File

@@ -21,7 +21,7 @@ set testprefix insert2
# Create some tables with data that we can select against
#
do_test insert2-1.0 {
execsql {CREATE TABLE d1(n int, log int);}
execsql {CREATE TABLE d1 (n int, log int);}
for {set i 1} {$i<=20} {incr i} {
for {set j 0} {(1<<$j)<$i} {incr j} {}
execsql "INSERT INTO d1 VALUES($i,$j)"
@@ -33,7 +33,7 @@ do_test insert2-1.0 {
#
do_test insert2-1.1.1 {
execsql {
CREATE TABLE t1(log int, cnt int);
CREATE TABLE t1 (log int, cnt int);
PRAGMA count_changes=on;
}
ifcapable explain {
@@ -56,7 +56,7 @@ ifcapable compound {
do_test insert2-1.2.1 {
catch {execsql {DROP TABLE t1}}
execsql {
CREATE TABLE t1(log int, cnt int);
CREATE TABLE t1 (log int, cnt int);
INSERT INTO t1
SELECT log, count(*) FROM d1 GROUP BY log
EXCEPT SELECT n-1,log FROM d1;
@@ -70,7 +70,7 @@ do_test insert2-1.2.2 {
do_test insert2-1.3.1 {
catch {execsql {DROP TABLE t1}}
execsql {
CREATE TABLE t1(log int, cnt int);
CREATE TABLE t1 (log int, cnt int);
PRAGMA count_changes=off;
INSERT INTO t1
SELECT log, count(*) FROM d1 GROUP BY log
@@ -88,7 +88,7 @@ execsql {PRAGMA count_changes=off;}
do_test insert2-1.4 {
catch {execsql {DROP TABLE t1}}
set r [execsql {
CREATE TABLE t1(log int, cnt int);
CREATE TABLE t1 (log int, cnt int);
CREATE INDEX i1 ON t1(log);
CREATE INDEX i2 ON t1(cnt);
INSERT INTO t1 SELECT log, count() FROM d1 GROUP BY log;
@@ -100,8 +100,8 @@ do_test insert2-1.4 {
do_test insert2-2.0 {
execsql {
CREATE TABLE t3(a,b,c);
CREATE TABLE t4(x,y);
CREATE TABLE t3 (a,b,c);
CREATE TABLE t4 (x,y);
INSERT INTO t4 VALUES(1,2);
SELECT * FROM t4;
}
@@ -231,7 +231,7 @@ integrity_check insert2-3.9
ifcapable tempdb {
do_test insert2-4.1 {
execsql {
CREATE TABLE Dependencies(depId integer primary key,
CREATE TABLE Dependencies (depId integer primary key,
class integer, name str, flag str);
CREATE TEMPORARY TABLE DepCheck(troveId INT, depNum INT,
flagCount INT, isProvides BOOL, class INTEGER, name STRING,
@@ -260,7 +260,7 @@ ifcapable tempdb {
# only.
do_test insert2-5.1 {
execsql {
CREATE TABLE t2(a, b);
CREATE TABLE t2 (a, b);
INSERT INTO t2 VALUES(1, 2);
CREATE INDEX t2i1 ON t2(a);
INSERT INTO t2 SELECT a, 3 FROM t2 WHERE a = 1;
@@ -277,7 +277,7 @@ ifcapable subquery {
}
do_execsql_test 6.0 {
CREATE TABLE t5(a, b, c DEFAULT 'c', d);
CREATE TABLE t5 (a, b, c DEFAULT 'c', d);
}
do_execsql_test 6.1 {
INSERT INTO t5(a) SELECT 456 UNION ALL SELECT 123 ORDER BY 1;