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

SQL Error in ACP (Icons) when using Firebird

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.0.6
    • Fix Version/s: 3.0.7
    • Component/s: ACP
    • Labels:
      None
    • Environment:
      PHP Environment: 5.3.1
      Database: Firebird 2.1.3

      Description

      When clicking on "Smilies" aka Icons" in ACP, I get the attached SQL Error.
      Since "count" is a reserved word in Firebird because there is a function named "count", I fixed this by changing the column alias in the query. See patch at the bottom.

      SQL ERROR [ firebird ]

      Dynamic SQL Error SQL error code = -104 Token unknown - line 1, column 20 count [-104]

      SQL

      SELECT COUNT AS count FROM phpbb_smilies

      BACKTRACE

      FILE: includes/db/firebird.php
      LINE: 216
      CALL: dbal->sql_error()

      FILE: includes/acp/acp_icons.php
      LINE: 946
      CALL: dbal_firebird->sql_query()

      FILE: includes/acp/acp_icons.php
      LINE: 897
      CALL: acp_icons->item_count()

      FILE: includes/functions_module.php
      LINE: 507
      CALL: acp_icons->main()

      FILE: adm/index.php
      LINE: 74
      CALL: p_master->load_active()

      PATCH:

          • acp_icons.php.orig Mon Feb 8 09:36:27 2010
          • acp_icons.php Mon Feb 8 09:18:02 2010
            ***************
          • 941,953 **** { global $db; ! $sql = "SELECT COUNT(*) AS count FROM $table"; $result = $db->sql_query($sql); ! $item_count = (int) $db->sql_fetchfield('count'); $db->sql_freeresult($result); return $item_count; }

            }

      ! ?>
      \ No newline at end of file
      — 941,953 ----

      { global $db; ! $sql = "SELECT COUNT(*) AS cnt FROM $table"; $result = $db->sql_query($sql); ! $item_count = (int) $db->sql_fetchfield('cnt'); $db->sql_freeresult($result); return $item_count; }

      }

      ! ?>

        Attachments

          Activity

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              programmiernutte programmiernutte
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: