[MDEV-4878] LOCK TABLE is not working with ConnectSE Created: 2013-08-09  Updated: 2013-08-12  Resolved: 2013-08-12

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.0.4

Type: Bug Priority: Major
Reporter: erkan yanar Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine
Environment:

Ubuntu/Precise/LXContainer



 Description   

You can't lock a Connect Table.

MariaDB [test]> lock table federatedconnect read;
ERROR 1015 (HY000): Can't lock file (errno: 122 "Internal (unspecified) error in handler")
 
MariaDB [test]> lock table federate_classic read;
Query OK, 0 rows affected (0.00 sec)

It should work like with federated SE.
Additional while working with mysqldump (MDEV-4877) having no LOCK support will break any dump requiring a LOCK.



 Comments   
Comment by Olivier Bertrand [ 2013-08-09 ]

CONNECT is not transactional and does not support table locking.
This command, as many others, are not supported.
However, a more explicit error message is now issued.

Comment by erkan yanar [ 2013-08-09 ]

I see no link between LOCK TABLE and a transactional table.
Anyway then you got to extend the docs and document mysqldump will work with --skip-lock-tables or --single-transaction only.
The later one is some kind of funny

Comment by Sergei Golubchik [ 2013-08-09 ]

LOCK TABLE is not related to being transactional, it's mainly handled on the server level. For example, MyISAM and Federated engines support it just fine.

The following patch add simple support for LOCK TABLE ... READ:

=== modified file 'storage/connect/ha_connect.cc'
— storage/connect/ha_connect.cc 2013-07-23 14:29:16 +0000
+++ storage/connect/ha_connect.cc 2013-08-09 17:47:01 +0000
@@ -2822,7 +2822,7 @@ int ha_connect::external_lock(THD *thd,

if (newmode == MODE_ANY) {
// This is unlocking, do it by closing the table

  • if (xp->CheckQueryID())
    + if (xp->CheckQueryID() && thd_sql_command(thd) != SQLCOM_UNLOCK_TABLES)
    rc= 2; // Logical error ???
    else if (g->Xchk) {
    if (!tdbp || *tdbp->GetName() == '#') {
    @@ -2985,6 +2985,7 @@ int ha_connect::external_lock(THD *thd,
    cras= true;
    case SQLCOM_INSERT:
    case SQLCOM_LOAD:
    + case SQLCOM_LOCK_TABLES:
    case SQLCOM_INSERT_SELECT:
    // case SQLCOM_REPLACE:
    // case SQLCOM_REPLACE_SELECT:

but making Connect engine to work with LOCK TABLE ... WRITE is a bit more complex.

Comment by Olivier Bertrand [ 2013-08-10 ]

I reopened the issue and will study it.

Comment by Olivier Bertrand [ 2013-08-12 ]

Fixed by revno 3784. This is a major update. More test are welcome.

Generated at Thu Feb 08 06:59:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.