Skip to content

Commit

Permalink
more updates of expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed Dec 2, 2023
1 parent c7aa89d commit d01a83d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions libs/sql-ddl/src/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ mod tests {

let expected = indoc!(
r#"
SET foreign_key_checks = 0;
CREATE TABLE `Cat` (
`id` INTEGER NULL AUTO_INCREMENT PRIMARY KEY,
`test` BINARY(16) NOT NULL DEFAULT (uuid_to_bin(uuid()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ fn basic_create_migration_works(api: TestApi) {
"#]]
} else if is_mysql {
expect![[r#"
SET foreign_key_checks = 0;
-- CreateTable
CREATE TABLE `Cat` (
`id` INTEGER NOT NULL,
Expand Down Expand Up @@ -158,6 +160,8 @@ fn creating_a_second_migration_should_have_the_previous_sql_schema_as_baseline(a
"#]]
} else if is_mysql {
expect![[r#"
SET foreign_key_checks = 0;
-- CreateTable
CREATE TABLE `Dog` (
`id` INTEGER NOT NULL,
Expand Down Expand Up @@ -382,6 +386,8 @@ fn create_enum_step_only_rendered_when_needed(api: TestApi) {
} else if is_mysql {
indoc! {
r#"
SET foreign_key_checks = 0;
-- CreateTable
CREATE TABLE `Cat` (
`id` INTEGER NOT NULL,
Expand Down Expand Up @@ -696,6 +702,8 @@ fn create_constraint_name_tests_w_implicit_names(api: TestApi) {
} else if is_mysql {
expect![[
r#"
SET foreign_key_checks = 0;
-- CreateTable
CREATE TABLE `A` (
`id` INTEGER NOT NULL,
Expand Down Expand Up @@ -933,6 +941,8 @@ fn create_constraint_name_tests_w_explicit_names(api: TestApi) {
} else if is_mysql {
expect![[
r#"
SET foreign_key_checks = 0;
-- CreateTable
CREATE TABLE `A` (
`id` INTEGER NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions schema-engine/sql-migration-tests/tests/migrations/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ fn mysql_apply_migrations_errors_gives_the_failed_sql(api: TestApi) {
Database error:
target: test.0.primary: vttablet: rpc error: code = InvalidArgument desc = Unknown table 'vt_test_0.Emu' (errno 1051) (sqlstate 42S02) (CallerID: userData1): Sql: "drop table Emu", BindVars: {}
Please check the query number 2 from the migration file.
Please check the query number 3 from the migration file.
"#]]
} else if cfg!(windows) {
Expand All @@ -398,7 +398,7 @@ fn mysql_apply_migrations_errors_gives_the_failed_sql(api: TestApi) {
Database error:
Unknown table 'mysql_apply_migrations_errors_gives_the_failed_sql.emu'
Please check the query number 2 from the migration file.
Please check the query number 3 from the migration file.
"#]]
} else {
Expand All @@ -412,7 +412,7 @@ fn mysql_apply_migrations_errors_gives_the_failed_sql(api: TestApi) {
Database error:
Unknown table 'mysql_apply_migrations_errors_gives_the_failed_sql.Emu'
Please check the query number 2 from the migration file.
Please check the query number 3 from the migration file.
"#]]
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,8 @@ fn mysql_foreign_key_on_delete_must_be_handled(api: TestApi) {
#[test_connector(tags(Mysql))]
fn mysql_join_table_unique_indexes_must_be_inferred(api: TestApi) {
let sql = r#"
SET foreign_key_checks = 0;
CREATE TABLE `Cat` (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
name TEXT
Expand Down

0 comments on commit d01a83d

Please sign in to comment.