Merge pull request #2756 from sysown/v2.1.0-set_tests2

V2.1.0 set tests2
pull/2758/head
René Cannaò 6 years ago committed by GitHub
commit 1e1cb478d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -159,21 +159,21 @@ void queryVariables(MYSQL *mysql, json& j) {
std::stringstream query;
if (is_mariadb) {
query << "SELECT /* mysql " << mysql << " */ lower(variable_name), variable_value FROM information_schema.session_variables WHERE variable_name IN "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'autocommit', 'sql_auto_is_null', "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'sql_auto_is_null', "
" 'sql_safe_updates', 'max_join_size', 'net_write_timeout', 'sql_select_limit', "
" 'sql_select_limit', 'character_set_results', 'tx_isolation', 'tx_read_only', "
" 'sql_auto_is_null', 'collation_connection', 'character_set_connection', 'character_set_client', 'character_set_database');";
}
if (is_cluster) {
query << "SELECT /* mysql " << mysql << " */ * FROM performance_schema.session_variables WHERE variable_name IN "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'autocommit', 'sql_auto_is_null', "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'sql_auto_is_null', "
" 'sql_safe_updates', 'session_track_gtids', 'max_join_size', 'net_write_timeout', 'sql_select_limit', "
" 'sql_select_limit', 'character_set_results', 'transaction_isolation', 'transaction_read_only', "
" 'sql_auto_is_null', 'collation_connection', 'character_set_connection', 'character_set_client', 'character_set_database', 'wsrep_sync_wait');";
}
if (!is_mariadb && !is_cluster) {
query << "SELECT /* mysql " << mysql << " */ * FROM performance_schema.session_variables WHERE variable_name IN "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'autocommit', 'sql_auto_is_null', "
" ('hostname', 'sql_log_bin', 'sql_mode', 'init_connect', 'time_zone', 'sql_auto_is_null', "
" 'sql_safe_updates', 'session_track_gtids', 'max_join_size', 'net_write_timeout', 'sql_select_limit', "
" 'sql_select_limit', 'character_set_results', 'transaction_isolation', 'transaction_read_only', "
" 'sql_auto_is_null', 'collation_connection', 'character_set_connection', 'character_set_client', 'character_set_database');";
@ -224,7 +224,7 @@ void queryInternalStatus(MYSQL *mysql, json& j) {
j["conn"]["sql_log_bin"] = "OFF";
}
// autocommit {true|false}
// sql_auto_is_null {true|false}
if (!el.value()["sql_auto_is_null"].dump().compare("ON") ||
!el.value()["sql_auto_is_null"].dump().compare("1") ||
!el.value()["sql_auto_is_null"].dump().compare("on") ||
@ -240,6 +240,8 @@ void queryInternalStatus(MYSQL *mysql, json& j) {
j["conn"]["sql_auto_is_null"] = "OFF";
}
// completely remove autocommit test
/*
// autocommit {true|false}
if (!el.value()["autocommit"].dump().compare("ON") ||
!el.value()["autocommit"].dump().compare("1") ||
@ -255,7 +257,7 @@ void queryInternalStatus(MYSQL *mysql, json& j) {
el.value().erase("autocommit");
j["conn"]["autocommit"] = "OFF";
}
*/
// sql_safe_updates
if (!el.value()["sql_safe_updates"].dump().compare("\"ON\"") ||
!el.value()["sql_safe_updates"].dump().compare("\"1\"") ||
@ -410,11 +412,13 @@ void * my_conn_thread(void *arg) {
}
if (strcmp(username,(char *)"root")) {
if (strstr(testCases[r2].command.c_str(),"database")) {
ok(true, "mysql connection [%p], thread_id [%lu], skipped test for command [%s]", mysql, mysql->thread_id, testCases[r2].command.c_str());
std::lock_guard<std::mutex> lock(mtx_);
skip(1, "mysql connection [%p], command [%s]", mysql, testCases[r2].command.c_str());
continue;
}
if (strstr(testCases[r2].command.c_str(),"sql_log_bin")) {
ok(true, "mysql connection [%p], thread_id [%lu], skipped test for command [%s]", mysql, mysql->thread_id, testCases[r2].command.c_str());
std::lock_guard<std::mutex> lock(mtx_);
skip(1, "mysql connection [%p], command [%s]", mysql, testCases[r2].command.c_str());
continue;
}
}
@ -527,6 +531,8 @@ int main(int argc, char *argv[]) {
return exit_status();
std::string fileName(std::string(cl.workdir) + "/set_testing-t.csv");
/*
// do not connect to admin at all
MYSQL* mysqladmin = mysql_init(NULL);
if (!mysqladmin)
return exit_status();
@ -547,7 +553,7 @@ int main(int argc, char *argv[]) {
MYSQL_QUERY(mysqladmin, "load mysql variables to runtime");
mysql_close(mysqladmin);
*/
MYSQL* mysql = mysql_init(NULL);
if (!mysql)
return exit_status();

@ -31,7 +31,6 @@
"SET sql_mode='PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'", "{'sql_mode':'PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'}"
"SET time_zone='+01:00'","{'time_zone':'+01:00'}"
"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}"
"SET autocommit=0","{'autocommit':'OFF'}"
"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}"
"SET sql_safe_updates='OFF'", "{'sql_safe_updates':'OFF'}"
"SET sql_safe_updates='ON'", "{'sql_safe_updates':'ON'}"

Can't render this file because it has a wrong number of fields in line 6.
Loading…
Cancel
Save