Skip to content
Snippets Groups Projects

fix #844 General fix applied for adodb library. Now when $adb->getUniqueID fails…

Closed fix #844 General fix applied for adodb library. Now when $adb->getUniqueID fails…

… we retry with self::MIN_UNIQUE_ID_TRIES count

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
84 84 var $lastmysqlrow = -1;
85 85 var $enableSQLlog = false;
86 86 var $continueInstallOnError = true;
87
87 const MIN_UNIQUE_ID_TRIES = 3;
  • Maintainer

    Is there any lock that is affecting the table? We should review the root-cause than devising the workaround.

  • 84 84 var $lastmysqlrow = -1;
    85 85 var $enableSQLlog = false;
    86 86 var $continueInstallOnError = true;
    87
    87 const MIN_UNIQUE_ID_TRIES = 3;
    • No i don't think is having a table lock.

      And if we test with different table that has sequence for example vtiger_picklist it will result in the same.

      tested on Windows: mysql Ver 14.14 Distrib 5.7.17, for Win32 (AMD64)

      and linux: mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using EditLine wrapper

  • I have more info about when this behavior occurs. Its when the $dbconfig['log_sql'] = true; in config.inc.php

  • It seems that the adodb lib uses this for the gen sequence: update %s set id=LAST_INSERT_ID(id+1) and then it calls mysqli_insert_id to take the new id and returns it

    BUT if logging is enabled it will execute in parallel based on some time another insert for the sql log table

    the two inserts sometimes are in conflict and the result is 0 for recordid -> and failed Save if we are creating new record for some module in Vtiger

  • Maintainer

    @krastan.petrov - glad you nailed the steps. will review.

  • Krastan Petrov Status changed to closed

    Status changed to closed

  • Please register or sign in to reply
    Loading