Skip to content

Commit

Permalink
[regression-test](prepared_stmt_p0) use master ip for prepared url (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Oct 28, 2024
1 parent 4b51554 commit 96b8796
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions regression-test/suites/prepared_stmt_p0/prepared_stmt.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ suite("test_prepared_stmt", "nonConcurrent") {
def tableName = "tbl_prepared_stmt"
def user = context.config.jdbcUser
def password = context.config.jdbcPassword
def url = context.config.jdbcUrl + "&useServerPrepStmts=true&useCursorFetch=true"
// def url = context.config.jdbcUrl + "&useServerPrepStmts=true&useCursorFetch=true"
String url = getServerPrepareJdbcUrl(context.config.jdbcUrl, "regression_test_prepared_stmt_p0")
def result1 = connect(user=user, password=password, url=url) {
sql """DROP TABLE IF EXISTS ${tableName} """
sql """
Expand Down Expand Up @@ -221,24 +222,26 @@ suite("test_prepared_stmt", "nonConcurrent") {
stmt_read = prepareStatement "insert into mytable1 with xxx_label 12222 values(?, ?, ?, ?)"
assertEquals(stmt_read.class, com.mysql.cj.jdbc.ClientPreparedStatement);
// alter stmt
stmt_read = prepareStatement "alter table mytable1 rename mytable2"
// assertEquals(stmt_read.class, com.mysql.cj.jdbc.ClientPreparedStatement);
stmt_read = prepareStatement "alter table mytable1 rename mytable2"
def result = stmt_read.execute()
logger.info("result: ${result}")
// assertEquals(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
// update stmt
stmt_read = prepareStatement "update tbl_prepared_stmt set k5 = ?"
assertEquals(stmt_read.class, com.mysql.cj.jdbc.ServerPreparedStatement);
stmt_read.setString(1, "2021-01-01")
def result = stmt_read.execute()
result = stmt_read.execute()
logger.info("result: ${result}")
stmt_read = prepareStatement "update tbl_prepared_stmt set k4 = 'Will we ignore LIMIT ?,?'"
assertEquals(stmt_read.class, com.mysql.cj.jdbc.ServerPreparedStatement);
result = stmt_read.execute()
logger.info("result: ${result}")
qt_sql "select * from tbl_prepared_stmt where k4 = 'Will we ignore LIMIT ?,?' order by k1"
// show create table
stmt_read = prepareStatement "SHOW CREATE TABLE mytable1"
// assertEquals(stmt_read.class, com.mysql.cj.jdbc.ClientPreparedStatement);
stmt_read = prepareStatement "SHOW CREATE TABLE tbl_prepared_stmt"
result = stmt_read.execute()
logger.info("show : ${result}")
logger.info("result: ${result}")
// assertEquals(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
// not stable
// qe_select16 stmt_read
stmt_read.close()
Expand Down

0 comments on commit 96b8796

Please sign in to comment.