Skip to content

Commit

Permalink
[regression-test](PreparedStatement) fix unstable cases when session …
Browse files Browse the repository at this point in the history
…var changed
  • Loading branch information
eldenmoon committed Aug 26, 2024
1 parent 43c9f67 commit 24eb7fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions regression-test/suites/prepared_stmt_p0/prepared_stmt.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ suite("test_prepared_stmt", "nonConcurrent") {
qt_sql """select * from ${tableName} order by 1, 2, 3"""
qt_sql """select * from ${tableName} order by 1, 2, 3"""
sql "set global max_prepared_stmt_count = 10000"
sql "set enable_fallback_to_original_planner = false"

def stmt_read = prepareStatement "select * from ${tableName} where k1 = ? order by k1"
assertEquals(com.mysql.cj.jdbc.ServerPreparedStatement, stmt_read.class)
Expand Down Expand Up @@ -239,5 +240,11 @@ suite("test_prepared_stmt", "nonConcurrent") {
// not stable
// qe_select16 stmt_read
stmt_read.close()

stmt_read = prepareStatement "SELECT connection_id()"
assertEquals(com.mysql.cj.jdbc.ServerPreparedStatement, stmt_read.class)
result = stmt_read.execute()
logger.info("connection_id: ${result}")
// qe_select16 stmt_read
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ suite("test_prepared_stmt_in_list", "nonConcurrent") {
def user = context.config.jdbcUser
def password = context.config.jdbcPassword
def url = context.config.jdbcUrl + "&useServerPrepStmts=true"
sql """set global max_prepared_stmt_count = 1024"""
def result1 = connect(user=user, password=password, url=url) {
sql """DROP TABLE IF EXISTS ${tableName} """
sql """
Expand Down

0 comments on commit 24eb7fc

Please sign in to comment.