Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4878

LOCK TABLE is not working with ConnectSE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.3
    • Fix Version/s: 10.0.4
    • Component/s: None
    • Labels:
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bertrandop Olivier Bertrand added a comment -

            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.

            Show
            bertrandop Olivier Bertrand added a comment - 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.
            Hide
            erkules erkan yanar added a comment -

            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

            Show
            erkules erkan yanar added a comment - 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
            Hide
            serg Sergei Golubchik added a comment -

            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.

            Show
            serg Sergei Golubchik added a comment - 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.
            Hide
            bertrandop Olivier Bertrand added a comment -

            I reopened the issue and will study it.

            Show
            bertrandop Olivier Bertrand added a comment - I reopened the issue and will study it.
            Hide
            bertrandop Olivier Bertrand added a comment -

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

            Show
            bertrandop Olivier Bertrand added a comment - Fixed by revno 3784. This is a major update. More test are welcome.

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                erkules erkan yanar
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 5 hours
                  2d 5h