diff --git a/docker-compose.yml b/docker-compose.yml index 3087dcc6b4..1173e8a14a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,20 +10,8 @@ services: MYSQL_ROOT_PASSWORD: mysecretpassword MYSQL_ROOT_HOST: '%' - mysql5: - image: "mysql/mysql-server:5.7" - ports: - - "3305:3306" - restart: always - environment: - MYSQL_DATABASE: dinotest - MYSQL_ROOT_PASSWORD: mysecretpassword - MYSQL_ROOT_HOST: '%' - profiles: - - mysql - postgresql: - image: "postgres:15" + image: "postgres:16" ports: - "5432:5432" restart: always @@ -31,51 +19,3 @@ services: POSTGRES_DB: postgres POSTGRES_PASSWORD: mysecretpassword POSTGRES_USER: postgres - - postgresql14: - image: "postgres:14" - ports: - - "5414:5432" - restart: always - environment: - POSTGRES_DB: postgres - POSTGRES_PASSWORD: mysecretpassword - POSTGRES_USER: postgres - profiles: - - postgres - - postgresql13: - image: "postgres:13" - ports: - - "5413:5432" - restart: always - environment: - POSTGRES_DB: postgres - POSTGRES_PASSWORD: mysecretpassword - POSTGRES_USER: postgres - profiles: - - postgres - - postgresql12: - image: "postgres:12" - ports: - - "5412:5432" - restart: always - environment: - POSTGRES_DB: postgres - POSTGRES_PASSWORD: mysecretpassword - POSTGRES_USER: postgres - profiles: - - postgres - - postgresql11: - image: "postgres:11" - ports: - - "5411:5432" - restart: always - environment: - POSTGRES_DB: postgres - POSTGRES_PASSWORD: mysecretpassword - POSTGRES_USER: postgres - profiles: - - postgres \ No newline at end of file diff --git a/internal/endtoend/endtoend_test.go b/internal/endtoend/endtoend_test.go index c2792ee1d3..e766e42359 100644 --- a/internal/endtoend/endtoend_test.go +++ b/internal/endtoend/endtoend_test.go @@ -131,11 +131,11 @@ func TestReplay(t *testing.T) { c.SQL[i].Database = &config.Database{ URI: uri, } - // case config.EngineMySQL: - // uri := local.MySQL(t, files) - // c.SQL[i].Database = &config.Database{ - // URI: uri, - // } + case config.EngineMySQL: + uri := local.MySQL(t, files) + c.SQL[i].Database = &config.Database{ + URI: uri, + } default: // pass } @@ -146,9 +146,9 @@ func TestReplay(t *testing.T) { if len(os.Getenv("POSTGRESQL_SERVER_URI")) == 0 { return false } - // if len(os.Getenv("MYSQL_SERVER_URI")) == 0 { - // return false - // } + if len(os.Getenv("MYSQL_SERVER_URI")) == 0 { + return false + } return true }, }, diff --git a/internal/endtoend/testdata/invalid_group_by_reference/mysql/query.sql b/internal/endtoend/testdata/invalid_group_by_reference/mysql/query.sql index 75a8e210fd..b036fba240 100644 --- a/internal/endtoend/testdata/invalid_group_by_reference/mysql/query.sql +++ b/internal/endtoend/testdata/invalid_group_by_reference/mysql/query.sql @@ -1,10 +1,3 @@ -CREATE TABLE authors ( - id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name text NOT NULL, - bio text, - UNIQUE(name) -); - -- name: ListAuthors :many SELECT * FROM authors diff --git a/internal/endtoend/testdata/invalid_group_by_reference/mysql/schema.sql b/internal/endtoend/testdata/invalid_group_by_reference/mysql/schema.sql new file mode 100644 index 0000000000..5333d484a6 --- /dev/null +++ b/internal/endtoend/testdata/invalid_group_by_reference/mysql/schema.sql @@ -0,0 +1,5 @@ +CREATE TABLE authors ( + id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + name text NOT NULL, + bio text +); diff --git a/internal/endtoend/testdata/invalid_group_by_reference/mysql/sqlc.json b/internal/endtoend/testdata/invalid_group_by_reference/mysql/sqlc.json index 534b7e24e9..0390f67889 100644 --- a/internal/endtoend/testdata/invalid_group_by_reference/mysql/sqlc.json +++ b/internal/endtoend/testdata/invalid_group_by_reference/mysql/sqlc.json @@ -5,7 +5,7 @@ "path": "go", "engine": "mysql", "name": "querytest", - "schema": "query.sql", + "schema": "schema.sql", "queries": "query.sql" } ] diff --git a/internal/endtoend/testdata/invalid_group_by_reference/mysql/stderr.txt b/internal/endtoend/testdata/invalid_group_by_reference/mysql/stderr.txt index 1fc9998d4c..d686d4f4d8 100644 --- a/internal/endtoend/testdata/invalid_group_by_reference/mysql/stderr.txt +++ b/internal/endtoend/testdata/invalid_group_by_reference/mysql/stderr.txt @@ -1,2 +1,2 @@ # package querytest -query.sql:11:10: column reference "invalid_reference" not found +query.sql:4:10: column reference "invalid_reference" not found diff --git a/internal/endtoend/testdata/valid_group_by_reference/mysql/schema.sql b/internal/endtoend/testdata/valid_group_by_reference/mysql/schema.sql index 63bcff540c..db03e0d24a 100644 --- a/internal/endtoend/testdata/valid_group_by_reference/mysql/schema.sql +++ b/internal/endtoend/testdata/valid_group_by_reference/mysql/schema.sql @@ -1,8 +1,7 @@ CREATE TABLE authors ( - id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(10) NOT NULL, - bio text, - UNIQUE(name) + id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(10) NOT NULL, + bio text ); CREATE TABLE IF NOT EXISTS weather_metrics