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

Fix test inverted index #70

Merged
merged 1 commit into from
Apr 28, 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
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
Loading