We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0496233 commit 36ab588Copy full SHA for 36ab588
spec/mysql2/statement_spec.rb
@@ -6,6 +6,10 @@
6
end
7
8
def stmt_count
9
+ # Use the performance schema in MySQL 5.7 and above
10
+ @client.query("SELECT COUNT(1) AS count FROM performance_schema.prepared_statements_instances").first['count'].to_i
11
+ rescue Mysql2::Error
12
+ # Fall back to the global prepapred statement counter
13
@client.query("SHOW STATUS LIKE 'Prepared_stmt_count'").first['Value'].to_i
14
15
0 commit comments