Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-767

Incorrect database query error reporting

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.1.2-RC1
    • Component/s: Database
    • Labels:
      None

      Description

      In-Portal has kDBConnection class, that can handle any type of database interactions. When database query being executed produces an error, then it's handled differently based on criteria listed below:

      debug mode enabled AND DBG_SQL_FAILURE option set in debug.php file - will be PHP fatal error and script stops
      debug mode enabled AND DBG_SQL_FAILURE option not set in debug.php file - will be PHP warning and script continues to execute
      debug mode is disabled - will be PHP warning and script continues to execute
      All works ok, until you need to check if last database query ended with error in last 2 cases from above mentioned.

      Class kDBConnection has "getErrorCode", "getErrorMsg" and "hasError" methods, that do the trick, but if there was a query with error before checked query, then error isn't cleared an all methods will tell, that there is an error, but there are none.

      I propose to reset "last remembered error information" before running new database query.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: