[MDEV-6953] SET STATEMENT profiling = .. FOR does not have any effect Created: 2014-10-27  Updated: 2015-02-02  Resolved: 2014-10-29

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: N/A
Fix Version/s: 10.1.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 Description   

Note: it's all the same in Percona server, but I won't file a bug for Percona, because there the whole 'profiling' logic is deprecated, as it is in MySQL 5.6. In MariaDB 10.1 it's still not deprecated, so it should work.

Session profiling is OFF

MariaDB [test]> set profiling = 0;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [test]> select 'without profiling';
+-------------------+
| without profiling |
+-------------------+
| without profiling |
+-------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> set statement profiling=1 for select 'with one-statement profiling';
+------------------------------+
| with one-statement profiling |
+------------------------------+
| with one-statement profiling |
+------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> show profiles;
Empty set (0.00 sec)

Session profiling is ON

MariaDB [test]> set profiling = 1;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'with profiling';
+----------------+
| with profiling |
+----------------+
| with profiling |
+----------------+
1 row in set (0.00 sec)
 
MariaDB [test]> set statement profiling=0 for select 'with one-statement profiling turned off';
+-----------------------------------------+
| with one-statement profiling turned off |
+-----------------------------------------+
| with one-statement profiling turned off |
+-----------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> set profiling = 0;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> show profiles;
+----------+------------+--------------------------------------------------------------------------------+
| Query_ID | Duration   | Query                                                                          |
+----------+------------+--------------------------------------------------------------------------------+
|        1 | 0.00073110 | select 'with profiling'                                                        |
|        2 | 0.00060901 | set statement profiling=0 for select 'with one-statement profiling turned off' |
+----------+------------+--------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

commit e64f5d8f758bcc1a8856ba9fba01780533f80747
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Sun Oct 26 16:27:54 2014 +0100
 
    Fixed test suite global variable saving



 Comments   
Comment by Oleksandr Byelkin [ 2014-10-29 ]

The variable is prohibited in SET STATEMENT for now.

Generated at Thu Feb 08 07:15:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.