mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-13 03:10:03 -05:00
Update Dolt to handle the information_schema having capital column names (#3719)
This commit is contained in:
@@ -62,7 +62,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629164035-b3edd77f2c25
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629224435-0c357f684fe0
|
||||
github.com/google/flatbuffers v2.0.6+incompatible
|
||||
github.com/gosuri/uilive v0.0.4
|
||||
github.com/kch42/buzhash v0.0.0-20160816060738-9bdec3dec7c6
|
||||
|
||||
@@ -175,8 +175,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
|
||||
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629164035-b3edd77f2c25 h1:6XWLC3d4C0fJdYiF34Vzp2naFk4LlzECm3Wz2v3Hh4Y=
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629164035-b3edd77f2c25/go.mod h1:E7d38ZJM2YloaxJl+f7P3MYwfAA+NxAxBEKzNkzlUag=
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629224435-0c357f684fe0 h1:C3PQPKZ/TjQ9HrrpK8mhut3RR3bAXROfUs/OPOTm1Rg=
|
||||
github.com/dolthub/go-mysql-server v0.12.1-0.20220629224435-0c357f684fe0/go.mod h1:E7d38ZJM2YloaxJl+f7P3MYwfAA+NxAxBEKzNkzlUag=
|
||||
github.com/dolthub/ishell v0.0.0-20220112232610-14e753f0f371 h1:oyPHJlzumKta1vnOQqUnfdz+pk3EmnHS3Nd0cCT0I2g=
|
||||
github.com/dolthub/ishell v0.0.0-20220112232610-14e753f0f371/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
|
||||
github.com/dolthub/jsonpath v0.0.0-20210609232853-d49537a30474 h1:xTrR+l5l+1Lfq0NvhiEsctylXinUMFhhsqaEcl414p8=
|
||||
|
||||
@@ -492,7 +492,7 @@ DELIM
|
||||
dolt sql -q "CREATE TABLE test(pk BIGINT PRIMARY KEY, c1 BIGINT, c2 BIGINT, c3 INT)"
|
||||
run dolt sql -q "SELECT column_name, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'test'" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "column_name,is_nullable,column_default" ]] || false
|
||||
[[ "$output" =~ "COLUMN_NAME,IS_NULLABLE,COLUMN_DEFAULT" ]] || false
|
||||
[[ "$output" =~ "pk,NO," ]] || false
|
||||
[[ "$output" =~ "c1,YES," ]] || false
|
||||
[[ "$output" =~ "c2,YES," ]] || false
|
||||
@@ -503,7 +503,7 @@ DELIM
|
||||
dolt sql -q "ALTER TABLE test CHANGE c3 c3 varchar(4) NOT NULL DEFAULT 'ln'"
|
||||
run dolt sql -q "SELECT column_name, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'test'" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "column_name,is_nullable,column_default" ]] || false
|
||||
[[ "$output" =~ "COLUMN_NAME,IS_NULLABLE,COLUMN_DEFAULT" ]] || false
|
||||
[[ "$output" =~ "pk,NO," ]] || false
|
||||
[[ "$output" =~ "c1,YES," ]] || false
|
||||
[[ "$output" =~ "c2,NO," ]] || false
|
||||
@@ -514,7 +514,7 @@ DELIM
|
||||
dolt sql -q "ALTER TABLE test CHANGE c3 c3 BOOLEAN NULL DEFAULT FALSE"
|
||||
run dolt sql -q "SELECT column_name, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'test'" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "column_name,is_nullable,column_default" ]] || false
|
||||
[[ "$output" =~ "COLUMN_NAME,IS_NULLABLE,COLUMN_DEFAULT" ]] || false
|
||||
[[ "$output" =~ "pk,NO," ]] || false
|
||||
[[ "$output" =~ "c1,NO,4.44" ]] || false
|
||||
[[ "$output" =~ "c2,NO,3.333" ]] || false
|
||||
@@ -524,7 +524,7 @@ DELIM
|
||||
dolt sql -q "ALTER TABLE test CHANGE c2 c2 TIMESTAMP NULL DEFAULT '2008-04-22 16:16:16'"
|
||||
run dolt sql -q "SELECT column_name, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'test'" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "column_name,is_nullable,column_default" ]] || false
|
||||
[[ "$output" =~ "COLUMN_NAME,IS_NULLABLE,COLUMN_DEFAULT" ]] || false
|
||||
[[ "$output" =~ "pk,NO," ]] || false
|
||||
[[ "$output" =~ "c1,NO,2020-04-01 16:16:16" ]] || false
|
||||
[[ "$output" =~ "c2,YES,2008-04-22 16:16:16" ]] || false
|
||||
@@ -560,7 +560,7 @@ DELIM
|
||||
|
||||
run dolt sql -q "SELECT column_name, column_default FROM information_schema.columns where table_name='test_table'" -r csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "column_name,column_default" ]] || false
|
||||
[[ "$output" =~ "COLUMN_NAME,COLUMN_DEFAULT" ]] || false
|
||||
[[ "$output" =~ "pk," ]] || false
|
||||
[[ "$output" =~ "col2,(RAND() + RAND())" ]] || false
|
||||
[[ "$output" =~ "col3,CASE pk WHEN 1 THEN false ELSE true END" ]] || false
|
||||
|
||||
@@ -183,7 +183,7 @@ SQL
|
||||
|
||||
run dolt sql -r csv -q "SELECT TABLE_NAME,TABLE_SCHEMA,COLUMN_NAME,REFERENCED_TABLE_SCHEMA,REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA='test' AND REFERENCED_TABLE_NAME IS NOT NULL ORDER BY ORDINAL_POSITION;"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "table_name,table_schema,column_name,referenced_table_schema,referenced_table_name,referenced_column_name" ]] || false
|
||||
[[ "$output" =~ "TABLE_NAME,TABLE_SCHEMA,COLUMN_NAME,REFERENCED_TABLE_SCHEMA,REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME" ]] || false
|
||||
[[ "$output" =~ "objects,test,color,test,colors,color" ]] || false
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ SQL
|
||||
dolt sql -q "INSERT INTO mytable (id, col3) VALUES (1, TIMESTAMP('2003-12-31'));"
|
||||
run dolt sql -q "SELECT * FROM myview;" -r csv
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "1,999,2003-12-31 00:00:00 +0000 UTC" ]] || false
|
||||
[[ "$output" =~ "1,999,2003-12-31 00:00:00" ]] || false
|
||||
|
||||
run dolt sql -q "SHOW CREATE VIEW myview;" -r csv
|
||||
[ "$status" -eq 0 ]
|
||||
@@ -344,7 +344,7 @@ SQL
|
||||
run dolt sql <<SQL
|
||||
CREATE TABLE polygon_type (
|
||||
pk int NOT NULL,
|
||||
p polygon DEFAULT polygon(linestring(point(0,0),point(8,0),point(12,9),point(0,9),point(0,0))),
|
||||
p polygon DEFAULT (polygon(linestring(point(0,0),point(8,0),point(12,9),point(0,9),point(0,0)))),
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
SQL
|
||||
|
||||
@@ -25,7 +25,7 @@ teardown() {
|
||||
|
||||
# triggers
|
||||
run dolt sql -q "select trigger_name from information_schema.triggers;" -r csv
|
||||
[ "$output" = "trigger_name
|
||||
[ "$output" = "TRIGGER_NAME
|
||||
customer_create_date
|
||||
payment_date
|
||||
rental_date
|
||||
@@ -35,7 +35,7 @@ upd_film" ]
|
||||
|
||||
# views
|
||||
run dolt sql -q "select table_name from information_schema.views;" -r csv
|
||||
[ "$output" = "table_name
|
||||
[ "$output" = "TABLE_NAME
|
||||
actor_info
|
||||
customer_list
|
||||
film_list
|
||||
|
||||
Reference in New Issue
Block a user