Skip to content

Commit

Permalink
Fix test inverted index (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored Apr 28, 2024
1 parent 57a05e9 commit 86869c7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
48 changes: 24 additions & 24 deletions regression-test/data/table-sync/test_inverted_index.out
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-- !sql --
2 bason bason hate pear 98

-- !sql --
-- !target_sql --
1 andy andy love apple 100
1 bason bason hate pear 100
2 andy andy love apple 100
Expand All @@ -34,19 +34,19 @@
4 andy andy love apple 100
4 bason bason hate pear 99

-- !sql --
-- !target_sql --
1 andy andy love apple 100
2 andy andy love apple 100
3 andy andy love apple 100
4 andy andy love apple 100

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98

-- !sql --
Expand Down Expand Up @@ -83,7 +83,7 @@
2 bason bason hate pear 98
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 andy andy love apple 100
1 bason bason hate pear 100
2 andy andy love apple 100
Expand All @@ -97,23 +97,23 @@
6 andy andy love apple 98
6 bason bason hate pear 99

-- !sql --
-- !target_sql --
1 andy andy love apple 100
2 andy andy love apple 100
3 andy andy love apple 100
4 andy andy love apple 100
5 andy andy love apple 100
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 bason bason hate pear 99
5 bason bason hate pear 99
6 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98
6 andy andy love apple 98

Expand All @@ -134,21 +134,21 @@
-- !sql --
2 bason bason hate pear 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 andy andy love apple 100

-- !sql --
-- !target_sql --
4 andy andy love apple 100

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98

-- !sql --
Expand All @@ -173,25 +173,25 @@
2 bason bason hate pear 98
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 andy andy love apple 100
5 andy andy love apple 100
6 andy andy love apple 98

-- !sql --
-- !target_sql --
4 andy andy love apple 100
5 andy andy love apple 100
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98
6 andy andy love apple 98

Expand All @@ -212,21 +212,21 @@
-- !sql --
2 bason bason hate pear 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 andy andy love apple 100

-- !sql --
-- !target_sql --
4 andy andy love apple 100

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98

-- !sql --
Expand All @@ -251,25 +251,25 @@
2 bason bason hate pear 98
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99
4 andy andy love apple 100
5 andy andy love apple 100
6 andy andy love apple 98

-- !sql --
-- !target_sql --
4 andy andy love apple 100
5 andy andy love apple 100
6 andy andy love apple 98

-- !sql --
-- !target_sql --
1 bason bason hate pear 100
2 bason bason hate pear 98
3 bason bason hate pear 99

-- !sql --
-- !target_sql --
2 bason bason hate pear 98
6 andy andy love apple 98

19 changes: 13 additions & 6 deletions regression-test/suites/table-sync/test_inverted_index.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,23 @@ suite("test_inverted_index") {
sql """ INSERT INTO ${tableName} VALUES (6, "andy", "andy love apple", 98); """
}

def run_sql = { String db ->
qt_sql """ select * from ${db}.${tableName} order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where name match "andy" order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where hobbies match "pear" order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where score < 99 order by id, name, hobbies, score """
def run_sql = { String db ->
if (db.startsWith('TEST_')) {
qt_target_sql """ select * from ${db}.${tableName} order by id, name, hobbies, score """
qt_target_sql """ select * from ${db}.${tableName} where name match "andy" order by id, name, hobbies, score """
qt_target_sql """ select * from ${db}.${tableName} where hobbies match "pear" order by id, name, hobbies, score """
qt_target_sql """ select * from ${db}.${tableName} where score < 99 order by id, name, hobbies, score """
} else {
qt_sql """ select * from ${db}.${tableName} order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where name match "andy" order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where hobbies match "pear" order by id, name, hobbies, score """
qt_sql """ select * from ${db}.${tableName} where score < 99 order by id, name, hobbies, score """
}
}

def run_test = { ->
insert_data.call()

sql """ALTER TABLE ${tableName} set ("binlog.enable" = "true")"""
sql "sync"

Expand Down

0 comments on commit 86869c7

Please sign in to comment.