Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10146

Firebird cannot handle DECIMAL(255, 0)

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.0.9-RC1
    • Component/s: None
    • Labels:
      None

      Description

      Report: http://www.phpbb.com/community/viewtopic.php?f=46&t=2127576

      SQL ERROR [ firebird ]
       
      Dynamic SQL Error SQL error code = -842 Precision must be from 1 to 18 [-842]
       
      SQL
       
      UPDATE phpbb_config SET config_value = CAST(CAST(config_value as DECIMAL(255, 0)) + 1 as VARCHAR(255)) WHERE config_name = 'num_posts'
      

      while user registration.

      fix:

      /**
      * Set dynamic config value with arithmetic operation.
      */
      function set_config_count($config_name, $increment, $is_dynamic = false)
      {
              global $db, $cache;
       
              switch ($db->sql_layer)
              {
                      case 'firebird':
                              $sql_update = 'CAST(CAST(config_value as DECIMAL(18, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
      

      in file includes/functions.php

        Issue Links

          Activity

          Hide
          bantu Andreas Fischer added a comment -

          Take patch only if Firebird version is >= 2.1

          Show
          bantu Andreas Fischer added a comment - Take patch only if Firebird version is >= 2.1
          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          Noxwizard verified both bug and fix on firebird 2.1 and 2.5.

          Show
          Oleg Oleg [X] (Inactive) added a comment - Noxwizard verified both bug and fix on firebird 2.1 and 2.5.
          Show
          Oleg Oleg [X] (Inactive) added a comment - Fix on develop was: https://github.com/phpbb/phpbb3/commit/bfdb5c413deb15588c4e6d29e54cc42aae2ff5ae

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              Oleg Oleg [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development