Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.11.2, 10.6
-
None
-
None
-
None
Description
Executing the following SQL code (no transaction, SQL code passed via ODBC as single ADO.Execute statement):
BEGIN NOT ATOMIC |
LOCK TABLES MyTable WRITE;
|
INSERT INTO MyTable (name) VALUES ('test'); |
UNLOCK TABLES;
|
END |
I get this error:
Microsoft OLE DB Provider for ODBC Drivers: [ma-3.1.17][10.11.2-MariaDB]LOCK is not allowed in stored procedures |
There are some issues:
- I am not using any stored procedure. So there should be no reason to disallow this. If this is also disallowed in BEGIN/END blocks, then the error message is wrong.
- The official MariaDB documentation says "LOCK TABLES can not be used in stored routines - if you try, the following error will be produced on creation. This restriction was removed in MariaDB 10.6.2". My MariaDB version is newer than 10.6.2 but I still got this restriction. Is this a bug? Or is the documentation wrong? See: https://mariadb.com/kb/en/lock-tables/