Skip to content

Commit

Permalink
[cherry-pick](branch-3.0)fix the mutil threads tests (apache#42394)
Browse files Browse the repository at this point in the history
pick from master:
apache#39617
  • Loading branch information
cjj2010 authored Oct 29, 2024
1 parent de8e934 commit b9515fc
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ suite("test_agg_schema_key_change_modify","p0") {

//TODO Test the agg model by modify a key type from BOOLEAN to TINYINT
def errorMessage="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
def insertSql = ""
expectException({
sql initTable
sql initTableData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ suite("test_agg_schema_key_change_modify1","p0") {
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"
def initTable1 = ""
def initTableData1 = ""
def insertSql = ""

/**
* Test the agg model by modify a key type from LARGEINT to other type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ suite("test_agg_schema_value_modify","p0") {
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

def insertSql = ""
//TODO Test the agg model by modify a value type from BOOLEAN to TINYINT
errorMessagge="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
expectException({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ suite("test_agg_schema_value_modify2", "p0") {
def getTableStatusSql = " SHOW ALTER TABLE COLUMN WHERE IndexName='${tbName1}' ORDER BY createtime DESC LIMIT 1 "
def errorMessage = ""
def insertSql = "insert into ${tbName1} values(923456689, 'Alice', '四川省', 'Yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00');"
def initTable1 = ""
def initTableData1 = ""


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ suite("test_agg_schema_value_modify3", "p0") {
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"


def insertSql = ""
/**
* Test the agg model by modify a value type from MAP to other type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ suite("test_dup_schema_key_change_modify","p0") {

//TODO Test the dup model by modify a key type from BOOLEAN to TINYINT
def errorMessage="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
def insertSql = ""
expectException({
sql initTable
sql initTableData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ suite("test_dup_schema_key_change_modify1","p0") {
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"
def initTable1 = ""
def initTableData1 = ""

def insertSql = ""
/**
* Test the dup model by modify a key type from LARGEINT to other type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ suite("test_dup_schema_value_modify","p0") {
" (567890123, 'Eve', 0, 'Chengdu', 27, 0, 13572468091, 'No. 654 Street, Chengdu', '2022-05-05 18:00:00')," +
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

def insertSql = ""
//TODO Test the dup model by modify a value type from BOOLEAN to TINYINT
errorMessage="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
expectException({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ suite("test_dup_schema_value_modify1", "p0") {
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"


def insertSql = ""

/**
* Test the dup model by modify a value type from FLOAT to other type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ suite("test_dup_schema_value_modify2", "p0") {
def getTableStatusSql = " SHOW ALTER TABLE COLUMN WHERE IndexName='${tbName1}' ORDER BY createtime DESC LIMIT 1 "
def errorMessage = ""
def insertSql = "insert into ${tbName1} values(923456689, 'Alice', '四川省', 'Yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00');"

def initTable1 = ""
def initTableData1 = ""

/**
* Test the dup model by modify a value type from CHAR to other type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ suite("test_dup_schema_value_modify3", "p0") {
/**
* Test the dup model by modify a value type
*/
def initTable2 = ""
def initTableData2 = ""
sql """ DROP TABLE IF EXISTS ${tbName1} """
def initTable = " CREATE TABLE IF NOT EXISTS ${tbName1}\n" +
" (\n" +
Expand All @@ -53,7 +51,7 @@ suite("test_dup_schema_value_modify3", "p0") {
" (567890123, 'Eve', 0, 'Chengdu', 27, 0, 13572468091, 'No. 654 Street, Chengdu', '2022-05-05 18:00:00')," +
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

def insertSql = ""

/**
* Test the dup model by modify a value type from MAP to other type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

suite("test_dup_schema_value_modify4", "p0") {
def tbName1 = "test_dup_model_value_change3"
def tbName2 = "test_dup_model_value_change_3"

//Test the dup model by adding a value column
sql """ DROP TABLE IF EXISTS ${tbName1} """
Expand Down Expand Up @@ -53,7 +52,6 @@ suite("test_dup_schema_value_modify4", "p0") {
def errorMessage = ""
def insertSql = "insert into ${tbName1} values(923456689, 'Alice', '四川省', 'Yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00');"


/**
* Test the dup model by modify a value type from MAP to other type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ suite("test_unique_schema_key_change_add","p0") {
" (567890123, 'Eve', 'Chengdu', 27, 0, 13572468091, 'No. 654 Street, Chengdu', '2022-05-05 18:00:00')," +
" (678901234, 'Frank', 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

//Test the unique model by adding a key column with VARCHAR
sql initTable
sql initTableData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ suite("test_unique_schema_key_change_modify","p0") {
" (567890123, 'Eve', 0, 'Chengdu', 27, 0, 13572468091, 'No. 654 Street, Chengdu', '2022-05-05 18:00:00')," +
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

def insertSql = ""
def initTable2 = ""
def initTableData2 = ""
//TODO Test the unique model by modify a key type from BOOLEAN to TINYINT
def errorMessage="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
expectException({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ suite("test_unique_schema_value_drop", "p0") {
def errorMessage = ""
def insertSql = "insert into ${tbName} values(123456689, 'Alice', '四川省', 'Yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00');"


/**
* Test the unique model by drop a value type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ suite("test_unique_schema_value_modify","p0") {
" (567890123, 'Eve', 0, 'Chengdu', 27, 0, 13572468091, 'No. 654 Street, Chengdu', '2022-05-05 18:00:00')," +
" (678901234, 'Frank', 1, 'Hangzhou', 32, 1, 13467985213, 'No. 321 Street, Hangzhou', '2022-06-06 20:00:00')," +
" (789012345, 'Grace', 0, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00');"

def insertSql = ""
//TODO Test the unique model by modify a value type from BOOLEAN to TINYINT
errorMessage="errCode = 2, detailMessage = Can not change BOOLEAN to TINYINT"
expectException({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
suite("test_unique_schema_value_modify2", "p0") {
def tbName = "test_unique_model_value_change2"
def tbName2 = "test_unique_model_value_change_2"
def initTable1 = ""
def initTableData1 = ""
def on_write = getRandomBoolean()
println String.format("current enable_unique_key_merge_on_write is : %s ",on_write)
//Test the unique model by adding a value column
Expand Down

0 comments on commit b9515fc

Please sign in to comment.