diff --git a/src/sql/ob_spi.cpp b/src/sql/ob_spi.cpp index 9dd847a602..75e6ee5619 100644 --- a/src/sql/ob_spi.cpp +++ b/src/sql/ob_spi.cpp @@ -2355,6 +2355,9 @@ int ObSPIService::calc_dynamic_sqlstr( ObCharsetType client_cs_type = CHARSET_INVALID; OZ (result.get_string(tmp_sql)); + if (OB_SUCC(ret) && tmp_sql.length() > 1 && ';' == tmp_sql[tmp_sql.length() - 1]) { + tmp_sql.assign_ptr(tmp_sql.ptr(), tmp_sql.length() - 1); + } OZ (ctx->exec_ctx_->get_my_session()->get_character_set_client(client_cs_type)); OZ (ObCharset::charset_convert(temp_allocator, tmp_sql, result.get_collation_type(),