Project

General

Profile

Actions

Bug #28563

closed

Incorrect handler detected with DELETE, INSERT and UPDATE queries

Added by Jigal van Hemert over 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2011-07-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

exec_DELETEquery(), exec_INSERTquery() and exec_UPDATEquery() (maybe others too) fail to use the correct handler. exec_SELECTquery() and exec_SELECTgetRows() work correctly when used with an extra MySQL database, but I suspect that it fails when using a different DBMS.

The problem is that the handler ($this->lastHandlerKey) is selected based on the not-yet-mapped table(s) instead of the mapped table name(s). Inside SELECTquery() this operation is repeated with the mapped table name, so in the end it will select the right handler if both the default handler and the correct handler are 'native' (MySQL).

DELETEquery() does not set the lastHandlerKey again and will thus use the default handler.
INSERTquery() and UPDATEquery() analyse the handler again, but set a local variable with the result; the query will be executed by the default handler.

Solution would be to select the handler in the exec_* family of functions based on the mapped table name(s) and not the original table name(s).


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #18273: Install new Extension with table in native, external database will failClosedXavier Perseguers2008-02-21

Actions
Actions #1

Updated by Xavier Perseguers over 12 years ago

  • Project changed from TYPO3 Core to 329
  • Category deleted (999)
Actions #2

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I1d1c607ae7dc294feb621aff2b70a205b02b14b0 has been pushed to the review server.
It is available at http://review.typo3.org/3902

Actions #3

Updated by Xavier Perseguers over 12 years ago

  • Status changed from New to Under Review
  • Target version set to 4.6.0
Actions #4

Updated by Xavier Perseguers over 12 years ago

  • % Done changed from 0 to 50

Merged for master (4.6)
Still pending for 4.5

Actions #5

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I1d1c607ae7dc294feb621aff2b70a205b02b14b0 has been pushed to the review server.
It is available at http://review.typo3.org/3989

Actions #6

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I316d5a987641a058e51d8b6ce08f0c187ceb6535 has been pushed to the review server.
It is available at http://review.typo3.org/3990

Actions #7

Updated by Jigal van Hemert over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 50 to 100

Applied in changeset commit:cd1ea21d4af38095ed78c288808fcc327691fede.

Actions #8

Updated by Michael Stucki over 10 years ago

  • Project changed from 329 to TYPO3 Core
Actions #9

Updated by Michael Stucki over 10 years ago

  • Category set to 999
Actions #10

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF