You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix transaction isolation level tests for MySQL 5.6.
MySQL 5.6's general_log table only has second resolution, so ordering by
event_time doesn't put most recent events first. Instead, assume the
general_log table doesn't have many entries, select them all, and use
the last (i.e., most recent) one.
MariaDB puts both commands in the same entry in the general_log table,
so we can't assume 'start transaction' will be at the beginning.
m_connection.Execute(@"set global general_log = 0;");
75
-
varresults=connection.Query<string>($"select convert(argument USING utf8) from mysql.general_log where thread_id = {m_connection.ServerThread} order by event_time desc limit 10;");
// we could use @tx_isolation (in MySQL 5.6/5.7) and @transaction_isolation (in MySQL 5.7/8.0), but would require a different query for different server versions
75
+
varresults=connection.Query<string>($"select convert(argument USING utf8) from mysql.general_log where thread_id = @ServerThread and convert(argument using utf8) like '%isolation level%' and argument not like 'select%' order by event_time;",new{m_connection.ServerThread});
m_connection.Execute(@"set global general_log = 0;");
106
-
varresults=connection.Query<string>($"select convert(argument USING utf8) from mysql.general_log where thread_id = {m_connection.ServerThread} order by event_time desc limit 10;");
varresults=connection.Query<string>($"select convert(argument USING utf8) from mysql.general_log where thread_id = @ServerThread and convert(argument using utf8) like '%start transaction%' and argument not like 'select%' order by event_time;",new{m_connection.ServerThread});
0 commit comments