[Maria-developers] MariaDB C-API and specific P_S tables
THis is probably a question that Gerog Richter (or possibly Wlad) could reply to. I came across this bug report: http://bugs.mysql.com/bug.php?id=71801 .. files by former MySQL/Sun/Oracle supporter Veleriuy Kravtchuk We have a 64 bit C-application compiled with MariaDB C-API (on and for Windows 64 bit). I connect to MySQL 5.6.15 and execute SELECT * FROM `session_connect_attrs`; /* PROCESSLIST_ID ATTR_NAME ATTR_VALUE ORDINAL_POSITION -------------- --------------- ---------- ------------------ 2 _os Windows 0 2 _client_name libmariadb 1 2 _pid 5012 2 2 _thread 4640 3 2 _platform x86 4 2 _client_version 1.1.2 5 */ With the MySQL CLI 5.6.15, you will get /* PROCESSLIST_ID ATTR_NAME ATTR_VALUE ORDINAL_POSITION -------------- --------------- ---------- ------------------ 4 _os Win64 0 4 _client_name libmysql 1 4 _pid 4888 2 4 _thread 4320 3 4 _platform x86_64 4 4 program_name mysql 5 4 _client_version 5.6.15 6 */ The differences I notice are * Our application populates P_S with "Windows" - not "Win64" as the 5.6.15 CLI * Our application populates 'P_S with "x86" and not "x86_64". * Our application does not populate P_S with a "program_name". But it has a name of course! MySQL 5.6 docs at http://dev.mysql.com/doc/refman/5.6/en/performance-schema-connection-attribu... (as far as I can understand) that the client should use mysql_options() and mysql_options4() C API functions to populate P_S with all information. I have two questions: 1) Will the first 2 differences listed require a patch in our code or in libmariadb? 2) Obviosuly the lacking program name in the P_S tables is something that we will neeed to take care of ourselves. However I think that mysql_options4() was added in MySQL 5.6 and the MariaDB API does not supprot it currently (it is targeted to be compatible with Oracle 5.5 API, I think). And to populate the program name we may need to use mysql_options4(). Am I right?
BTW: the two tables do not exist in P_S in MariaDB 10.0.8 -- Peter On Mon, Feb 24, 2014 at 4:02 PM, Peter Laursen <peter_laursen@webyog.com>wrote:
THis is probably a question that Gerog Richter (or possibly Wlad) could reply to.
I came across this bug report: http://bugs.mysql.com/bug.php?id=71801 .. files by former MySQL/Sun/Oracle supporter Veleriuy Kravtchuk
We have a 64 bit C-application compiled with MariaDB C-API (on and for Windows 64 bit). I connect to MySQL 5.6.15 and execute
SELECT * FROM `session_connect_attrs`;
/* PROCESSLIST_ID ATTR_NAME ATTR_VALUE ORDINAL_POSITION -------------- --------------- ---------- ------------------ 2 _os Windows 0 2 _client_name libmariadb 1 2 _pid 5012 2 2 _thread 4640 3 2 _platform x86 4 2 _client_version 1.1.2 5 */
With the MySQL CLI 5.6.15, you will get
/* PROCESSLIST_ID ATTR_NAME ATTR_VALUE ORDINAL_POSITION -------------- --------------- ---------- ------------------ 4 _os Win64 0 4 _client_name libmysql 1 4 _pid 4888 2 4 _thread 4320 3 4 _platform x86_64 4 4 program_name mysql 5 4 _client_version 5.6.15 6 */
The differences I notice are
* Our application populates P_S with "Windows" - not "Win64" as the 5.6.15 CLI * Our application populates 'P_S with "x86" and not "x86_64". * Our application does not populate P_S with a "program_name". But it has a name of course!
MySQL 5.6 docs at http://dev.mysql.com/doc/refman/5.6/en/performance-schema-connection-attribu... (as far as I can understand) that the client should use mysql_options() and mysql_options4() C API functions to populate P_S with all information.
I have two questions:
1) Will the first 2 differences listed require a patch in our code or in libmariadb?
2) Obviosuly the lacking program name in the P_S tables is something that we will neeed to take care of ourselves. However I think that mysql_options4() was added in MySQL 5.6 and the MariaDB API does not supprot it currently (it is targeted to be compatible with Oracle 5.5 API, I think). And to populate the program name we may need to use mysql_options4(). Am I right?
Hi, Peter! On Feb 24, Peter Laursen wrote:
BTW: the two tables do not exist in P_S in MariaDB 10.0.8
What tables don't exist? MariaDB [test]> SELECT * FROM performance_schema.session_connect_attrs; +----------------+-----------------+------------+------------------+ | PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION | +----------------+-----------------+------------+------------------+ | 2 | _os | Linux | 0 | | 2 | _client_name | libmysql | 1 | | 2 | _pid | 28713 | 2 | | 2 | _client_version | 10.0.8 | 3 | | 2 | _platform | x86_64 | 4 | | 2 | program_name | mysql | 5 | +----------------+-----------------+------------+------------------+ 6 rows in set (0.00 sec) MariaDB [test]> SELECT VERSION(); +----------------------+ | VERSION() | +----------------------+ | 10.0.8-MariaDB-debug | +----------------------+ 1 row in set (0.00 sec) Regards, Sergei
SELECT VERSION(); -- returns "10.0.8-MariaDB" USE `performance_schema`; SHOW TABLES LIKE 'session%'; -- empty set .. but maybe I should run rememer to run mysql_upgrade before complaining about such things! :-) I will update in a couple of hours if mysql_upgrade did the trick. If not it could be Win-only problem. -- Peter On Mon, Feb 24, 2014 at 5:47 PM, Sergei Golubchik <serg@mariadb.org> wrote:
Hi, Peter!
On Feb 24, Peter Laursen wrote:
BTW: the two tables do not exist in P_S in MariaDB 10.0.8
What tables don't exist?
MariaDB [test]> SELECT * FROM performance_schema.session_connect_attrs; +----------------+-----------------+------------+------------------+ | PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION | +----------------+-----------------+------------+------------------+ | 2 | _os | Linux | 0 | | 2 | _client_name | libmysql | 1 | | 2 | _pid | 28713 | 2 | | 2 | _client_version | 10.0.8 | 3 | | 2 | _platform | x86_64 | 4 | | 2 | program_name | mysql | 5 | +----------------+-----------------+------------+------------------+ 6 rows in set (0.00 sec)
MariaDB [test]> SELECT VERSION(); +----------------------+ | VERSION() | +----------------------+ | 10.0.8-MariaDB-debug | +----------------------+ 1 row in set (0.00 sec)
Regards, Sergei
Running mysql_upgrade did the trick. Sorry! C:\Program Files\MariaDB 10.0\bin>mysql_upgrade -uroot -p --port=3313 Enter password: ******** Phase 1/3: Fixing table and database names Phase 2/3: Checking and upgrading tables Processing databases information_schema mysql mysql.columns_priv OK mysql.db OK .. .. Phase 3/3: Running 'mysql_fix_privilege_tables'... OK C:\Program Files\MariaDB 10.0\bin>mysql -uroot -p --port=3313 Enter password: ******** Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 13 Server version: 10.0.8-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use performance_schema; Database changed MariaDB [performance_schema]> show tables like 'session%'; +-----------------------------------------+ | Tables_in_performance_schema (session%) | +-----------------------------------------+ | session_account_connect_attrs | | session_connect_attrs | +-----------------------------------------+ 2 rows in set (0.00 sec) MariaDB [performance_schema]> exit Bye C:\Program Files\MariaDB 10.0\bin> -- Peter On Mon, Feb 24, 2014 at 7:29 PM, Peter Laursen <peter_laursen@webyog.com>wrote:
SELECT VERSION(); -- returns "10.0.8-MariaDB" USE `performance_schema`; SHOW TABLES LIKE 'session%'; -- empty set
.. but maybe I should run rememer to run mysql_upgrade before complaining about such things! :-)
I will update in a couple of hours if mysql_upgrade did the trick. If not it could be Win-only problem.
-- Peter
On Mon, Feb 24, 2014 at 5:47 PM, Sergei Golubchik <serg@mariadb.org>wrote:
Hi, Peter!
On Feb 24, Peter Laursen wrote:
BTW: the two tables do not exist in P_S in MariaDB 10.0.8
What tables don't exist?
MariaDB [test]> SELECT * FROM performance_schema.session_connect_attrs; +----------------+-----------------+------------+------------------+ | PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION | +----------------+-----------------+------------+------------------+ | 2 | _os | Linux | 0 | | 2 | _client_name | libmysql | 1 | | 2 | _pid | 28713 | 2 | | 2 | _client_version | 10.0.8 | 3 | | 2 | _platform | x86_64 | 4 | | 2 | program_name | mysql | 5 | +----------------+-----------------+------------+------------------+ 6 rows in set (0.00 sec)
MariaDB [test]> SELECT VERSION(); +----------------------+ | VERSION() | +----------------------+ | 10.0.8-MariaDB-debug | +----------------------+ 1 row in set (0.00 sec)
Regards, Sergei
participants (2)
-
Peter Laursen
-
Sergei Golubchik