Skip to content

Commit

Permalink
Make schema change cases compatible with 2.0 (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored Sep 9, 2024
1 parent fd5072a commit 68564dc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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

0 comments on commit 68564dc

Please sign in to comment.