[ODBC-77] Execution of 'ANALYZE TABLE' statement would invalidate the statement and connection handles. Created: 2017-01-05  Updated: 2017-02-03  Resolved: 2017-02-03

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 2.0.13
Fix Version/s: 2.0.14, 3.0.1

Type: Bug Priority: Major
Reporter: Yuriy Vasylchenko Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

MariaDB 5.5.53 and MySQL 5.5.28, Linux



 Description   

Consequent execution of a statement would return error:
08S01:#:2013:[ma-2.0.13][5.5.53-MariaDB]Lost connection to MySQL server during query

The driver does not expect any results returned whether the server returns one row with four columns.

Suggested fix

--- ./ma_parse.h.ori    2017-01-04 18:48:39.481680000 -0800
+++ ./ma_parse.h        2017-01-04 19:34:12.473327000 -0800
@@ -27,7 +27,8 @@
                             MADB_QUERY_DELETE= SQL_DELETE,
                             MADB_QUERY_SELECT,
                             MADB_QUERY_SHOW,
-                            MADB_QUERY_CALL
+                            MADB_QUERY_CALL,
+                            MADB_QUERY_ANALYZE
                           };
 
 #define QUERY_DOESNT_RETURN_RESULT(query_type) ((query_type) < MADB_QUERY_SELECT)
--- ./ma_parse.c.ori    2016-10-30 08:49:31.000000000 -0700
+++ ./ma_parse.c        2017-01-04 18:49:59.273705000 -0800
@@ -163,6 +163,10 @@
   {
     return MADB_QUERY_SHOW;
   }
+  if (_strnicmp(Stmt->StmtString, "ANALYZE", 7) == 0)
+  {
+    return MADB_QUERY_ANALYZE;
+  }
 
   return MADB_QUERY_NO_RESULT;
 }



 Comments   
Comment by Lawrin Novitsky [ 2017-01-17 ]

Hi Yuriy,

Thank you for your bug reports(this and ODBC-78) and proposed solutions.

Similar to other open source projects, the MariaDB Foundation needs to have shared ownership of all code that is included in the MariaDB distribution. The easiest way to achieve this is by submitting your code under the BSD-new license. (The other alternative is to sign the code contribution agreement which can be found here: https://mariadb.com/kb/en/mariadb/mca/)
Please indicate in a comment below that you are contributing your new code of the whole patch, including one or several files that are either new files or modified ones, under the BSD-new license or that you have filled out the contribution agreement and sent it.

Thanks,
Lawrin

Comment by Lawrin Novitsky [ 2017-02-03 ]

Well, fixed it independently, however since fix is trivial unlikely it's much different from proposed solution.
Also fixed similar problem with EXPLAIN and ANALYZE <query>(however the latter depends on MDEV-11966)

Generated at Thu Feb 08 03:26:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.