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 df2ea71 commit 8ab77a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 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 @@ -218,21 +219,25 @@ suite("test_prepared_stmt", "nonConcurrent") {
assertEquals(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
// alter stmt
stmt_read = prepareStatement "alter table mytable1 rename mytable2"
assertEquals(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
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(com.mysql.cj.jdbc.ServerPreparedStatement, stmt_read.class)
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(com.mysql.cj.jdbc.ServerPreparedStatement, stmt_read.class)
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(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
stmt_read = prepareStatement "SHOW CREATE TABLE tbl_prepared_stmt"
result = stmt_read.execute()
logger.info("result: ${result}")
// assertEquals(com.mysql.cj.jdbc.ClientPreparedStatement, stmt_read.class)
// not stable
// qe_select16 stmt_read
stmt_read.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ suite("test_prepared_stmt_in_list", "nonConcurrent") {
def tableName = "tbl_prepared_stmt_in_list"
def user = context.config.jdbcUser
def password = context.config.jdbcPassword
def url = context.config.jdbcUrl + "&useServerPrepStmts=true"
// def url = context.config.jdbcUrl + "&useServerPrepStmts=true"
String url = getServerPrepareJdbcUrl(context.config.jdbcUrl, "regression_test_prepared_stmt_p0")
sql """set global max_prepared_stmt_count = 1024"""
def result1 = connect(user=user, password=password, url=url) {
sql """DROP TABLE IF EXISTS ${tableName} """
Expand Down

0 comments on commit 8ab77a2

Please sign in to comment.