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

CONNECT Engine JDBC not able to issue simple UPDATE statement from trigger or stored procedure

    XMLWordPrintable

Details

    Description

      Assume we have a CONNECT JDBC table called ProductVariants. I can successfully issue the following command:

      UPDATE ProductVariants
      SET InventoryQuantity = 3
      WHERE Id = 21163284529232
      

      The above works with hard coded values when issued direct, works when issued via a stored procedure, but does NOT work when issued via a trigger (on another table). With the trigger you get the following error:

      Table 'ProductVariants' is marked as crashed and should be repaired) #1194
      

      Of course hard coded values are useless, what I was originally trying to do via a trigger was the following:

      UPDATE ProductVariants
      SET InventoryQuantity = v_new_qty
      WHERE Id = v_ProductVariantId;
      

      where v_new_qty and v_ProductVariantId are declared as BIGINT and so are the corresponding connect columns. This command produces different errors depending on if issued via a trigger or stored procedure. When issued via a trigger the error is:

      Table 'ProductVariants' is marked as crashed and should be repaired) #1194
      

      When I call a stored procedure and pass in the values the error is:

      Got error 122 'ExecuteUpdate: XcoreXshopifyX180X6886.dlb: At least ID should be specified in this SQL statement. n=-1' from CONNECT
      

      In the stored procedure scenario it looks like it is somehow not seeing the variables. In the trigger case I have no idea.

      This is in a critical code path for a client deployment unfortunately, and we can't find a work around so a bug fix is critical for us.

      Thank you!

      Attachments

        1. Vendors.csv
          0.5 kB
        2. Vendor_Items.csv
          1 kB
        3. Triggers.sql
          4 kB
        4. trigger_test_3.sql
          2 kB
        5. test_db11615.sql.gz
          16 kB
        6. ROG.csv
          0.2 kB
        7. ROG_Lines.csv
          0.2 kB
        8. ProductVariants.csv
          3 kB

        Activity

          People

            bertrandop Olivier Bertrand
            rdyas Robert Dyas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.