Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make schema change cases compatible with 2.0 #159

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ suite("test_add_agg_column") {

def has_column_first = { res -> Boolean
// Field == 'first' && 'Key' == 'YES'
return res[0][0] == 'first' && res[0][3] == 'YES'
return res[0][0] == 'first' && (res[0][3] == 'YES' || res[0][3] == 'true')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_first, 60, "target_sql"))
Expand Down Expand Up @@ -212,7 +212,7 @@ suite("test_add_agg_column") {

def has_column_last = { res -> Boolean
// Field == 'last' && 'Key' == 'YES'
return res[3][0] == 'last' && res[3][3] == 'YES'
return res[3][0] == 'last' && (res[3][3] == 'YES' || res[3][3] == 'true')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_last, 60, "target_sql"))
Expand Down Expand Up @@ -244,7 +244,7 @@ suite("test_add_agg_column") {

def has_column_first_value = { res -> Boolean
// Field == 'first_value' && 'Key' == 'NO'
return res[4][0] == 'first_value' && res[4][3] == 'NO'
return res[4][0] == 'first_value' && (res[4][3] == 'NO' || res[4][3] == 'false')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_first_value, 60, "target_sql"))
Expand Down Expand Up @@ -276,7 +276,7 @@ suite("test_add_agg_column") {

def has_column_last_value = { res -> Boolean
// Field == 'last_value' && 'Key' == 'NO'
return res[6][0] == 'last_value' && res[6][3] == 'NO'
return res[6][0] == 'last_value' && (res[6][3] == 'NO' || res[6][3] == 'false')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_last_value, 60, "target_sql"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ suite("test_add_column") {

def has_column_first = { res -> Boolean
// Field == 'first' && 'Key' == 'YES'
return res[0][0] == 'first' && res[0][3] == 'YES'
return res[0][0] == 'first' && (res[0][3] == 'YES' || res[0][3] == 'true')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_first, 60, "target_sql"))
Expand Down Expand Up @@ -249,7 +249,7 @@ suite("test_add_column") {

def has_column_last = { res -> Boolean
// Field == 'last' && 'Key' == 'YES'
return res[3][0] == 'last' && res[3][3] == 'YES'
return res[3][0] == 'last' && (res[3][3] == 'YES' || res[3][3] == 'true')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_last, 60, "target_sql"))
Expand Down Expand Up @@ -281,7 +281,7 @@ suite("test_add_column") {

def has_column_first_value = { res -> Boolean
// Field == 'first_value' && 'Key' == 'NO'
return res[4][0] == 'first_value' && res[4][3] == 'NO'
return res[4][0] == 'first_value' && (res[4][3] == 'NO' || res[4][3] == 'false')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_first_value, 60, "target_sql"))
Expand Down Expand Up @@ -313,7 +313,7 @@ suite("test_add_column") {

def has_column_last_value = { res -> Boolean
// Field == 'last_value' && 'Key' == 'NO'
return res[6][0] == 'last_value' && res[6][3] == 'NO'
return res[6][0] == 'last_value' && (res[6][3] == 'NO' || res[6][3] == 'false')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_last_value, 60, "target_sql"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ suite("test_add_many_column") {
def found_last_key = false
def found_last_value = false
for (int i = 0; i < res.size(); i++) {
if (res[i][0] == 'last_key' && res[i][3] == 'YES') {
if (res[i][0] == 'last_key' && (res[i][3] == 'YES' || res[i][3] == 'true')) {
found_last_key = true
}
if (res[i][0] == 'last_value' && res[i][3] == 'NO') {
if (res[i][0] == 'last_value' && (res[i][3] == 'NO' || res[i][3] == 'false')) {
found_last_value = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ suite("test_order_by") {

def key_columns_order = { res -> Boolean
// Field == 'id' && 'Key' == 'YES'
return res[0][0] == 'id' && res[0][3] == 'YES' &&
res[1][0] == 'test' && res[1][3] == 'YES' &&
res[2][0] == 'value1' && res[2][3] == 'NO' &&
res[3][0] == 'value' && res[3][3] == 'NO'
return res[0][0] == 'id' && (res[0][3] == 'YES' || res[0][3] == 'true') &&
res[1][0] == 'test' && (res[1][3] == 'YES' || res[1][3] == 'true') &&
res[2][0] == 'value1' && (res[2][3] == 'NO' || res[2][3] == 'false') &&
res[3][0] == 'value' && (res[3][3] == 'NO' || res[3][3] == 'false')
}

assertTrue(checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", key_columns_order, 60, "target_sql"))
Expand Down
Loading