Project

General

Profile

Actions

Bug #24796

closed

error with exec_PREPAREDquery

Added by Philipp Bergsmann almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-01-25
Due date:
% Done:

0%

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

Description

I'm trying to update some old TYPO3 instance from 4.2.9 to 4.5RC2. After the update procedure I encountered the following error message in the sysLog:

Core: Error handler (FE): PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in typo3_src-4.5.0rc2/t3lib/class.t3lib_db.php line 742

We are using the dbal with postgres. I don't know, if it's a bug in the instance or in the dbal, but regarding the release of 4.5 tomorrow (and prepared queries are kind of new) i thought i'll file a bug report, probably someone else can reproduce this?

dbal-conf:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array (
'_DEFAULT' => array (
'type' => 'adodb',
'config' => array(
'driver' => 'postgres',
)
)
);
(issue imported from #M17296)

Actions #1

Updated by Xavier Perseguers almost 14 years ago

Line 742 of t3lib_db is this:

public function exec_PREPAREDquery($query, array $queryComponents) {
$res = mysql_query($query, $this->link);
if ($this->debugOutput) {
$this->debug('stmt_execute', $query);
}
return $res;
}

but when using DBAL, you should lend into corresponding function from ux_t3lib_db, in package DBAL, line 1531.

Actions #2

Updated by Philipp Bergsmann almost 14 years ago

i would have expected that too... dbal seems to work as expected (i tried with die()s in the code) but not with the prepared_query...

i'll try again with the RC3 later, probably it's a different problem....

Actions #3

Updated by Xavier Perseguers almost 14 years ago

I'd say the error could come from t3lib_userauth, when fetching the user session (it's using prepared query) if for any reason, $GLOBALS['TYPO3_DB'] is not (yet) set to the DBAL XCLASS of t3lib_DB.

Could you please open file t3lib/class.t3lib_db.php and add a debug_backtrace() in this method? When using DBAL you should not lend there:

public function exec_PREPAREDquery(...) {
t3lib_utility_Debug::debug(debug_backtrace(), 'trace');

// current code
}

and post the trace here? (or better attach it to the BT)

Actions #4

Updated by Philipp Bergsmann almost 14 years ago

OK, after an update to RC3, the problem no longer exists... thank you for your support!

Actions

Also available in: Atom PDF