I am currently experiencing an issue with the visibility of prepared queries in my query analytics tool for an application using the nodejs mysql2 library and MariaDB.
Application is using the execute method for performing queries. All these operations are working perfectly fine. However, these prepared queries are not visible in percona query analytics.
Performance schema in MariaDB is enabled.
MariaDB configuration
performance_schema=ON
performance_schema_instrument='statement/%=ON'
performance_schema_instrument='wait/%=ON'
performance_schema_instrument='memory/%=ON'
performance-schema-instrument='stage/%=ON'
performance-schema-consumer-statements-digest=ON
performance-schema-consumer-events_stages_current=ON
performance-schema-consumer-events_stages_history=ON
performance-schema-consumer-events_stages_history_long=ON
performance_schema_consumer_events_statements_current=ON
performance_schema_consumer_events_statements_history=ON
performance_schema_consumer_events_statements_history_long=ON
performance-schema-consumer-events_transactions_current=ON
performance-schema-consumer-events_transactions_history=ON
performance-schema-consumer-events_transactions_history_long=ON
performance-schema-consumer-events_waits_current=ON
performance-schema-consumer-events_waits_history=ON
performance-schema-consumer-events_waits_history_long=ON
innodb_monitor_enable=all
userstat=1
I know this is too much but I was just trying everything to make it work.
Mysql2 example query:
const pool = mysql.createPool({
host: 'localhost',
user: 'root',
database: 'test'
});
pool.execute(
'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',
['Rick C-137', 53],
function(err, results, fields) {
}
);
NodeJS Version: 20.2.0
Mysql2 Version: 3.3.1
MariaDB Version: 10.11.2