Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10146

Firebird cannot handle DECIMAL(255, 0)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0.9-RC1
    • 3.0.8
    • None
    • None

      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

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

              Created:
              Updated:
              Resolved: