Index: class.ux_t3lib_db.php =================================================================== --- class.ux_t3lib_db.php (revision 28572) +++ class.ux_t3lib_db.php (working copy) @@ -1040,10 +1040,10 @@ */ protected function _quoteFieldNames(array $select_fields) { foreach ($select_fields as $k => $v) { - if ($select_fields[$k]['field'] != '' && $select_fields[$k]['field'] != '*') { + if ($select_fields[$k]['field'] != '' && $select_fields[$k]['field'] != '*' && !is_numeric($select_fields[$k]['field'])) { $select_fields[$k]['field'] = $this->quoteName($select_fields[$k]['field']); } - if ($select_fields[$k]['table'] != '') { + if ($select_fields[$k]['table'] != '' && !is_numeric($select_fields[$k]['table'])) { $select_fields[$k]['table'] = $this->quoteName($select_fields[$k]['table']); } if ($select_fields[$k]['as'] != '') { Index: tests/db_oracle_testcase.php =================================================================== --- tests/db_oracle_testcase.php (revision 28564) +++ tests/db_oracle_testcase.php (working copy) @@ -253,6 +253,20 @@ $this->assertEquals($expected, $query); } + /** + * @test + * http://bugs.typo3.org/view.php?id=13422 + */ + public function numericColumnsAreNotQuoted() { + $query = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery( + '1', + 'be_users', + 'username = \'_cli_scheduler\' AND admin = 0 AND be_users.deleted = 0' + )); + $expected = 'SELECT 1 FROM "be_users" WHERE "username" = \'_cli_scheduler\' AND "admin" = 0 AND "be_users"."deleted" = 0'; + $this->assertEquals($expected, $query); + } + /////////////////////////////////////// // Tests concerning remapping ///////////////////////////////////////