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

        Attachments

          Issue Links

            Activity

              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: