Project

General

Profile

Actions

Bug #22063

closed

Backend login impossible with MSSQL via ODBC due to FetchRow() result

Added by Golo Meierhenrich over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2010-02-05
Due date:
% Done:

0%

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

Description

When setting up Typo3 with dbal using MS SQL Server via ODBC you always get thrown back to the backend login when entering the correct credentials.
Tested with SQL Server 2005 SP3/PHP 5.3.1 and SQL Server 2005 Standard SP2/PHP 5.2.12.

Problem occures because sql_fetch_row returns an empty result although SQL Server returns "1" when processing the query
SELECT COUNT FROM "be_sessions" WHERE "ses_id" = '<actual session id>'
On MySQL FetchRow() returns an array with associative (coulmn name) and numeric indices, on MSSQL/ODBC the array has only associative (empty) indices. sql_fetch_rows deletes all associative entries to prevent doubles, so we get an empty result.
I fixed it (quick and dirty) with inserting the following code at line 1495 in class.ux_t3lib_db.php:
if ($res->databaseType == 'odbc_mssql') { $c = 0;
foreach($output as $key => $value){
$output[$c] = $output[$key];
$c++;
}
}

(issue imported from #M13433)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #16781: Pagetree only shows up to Level 2 / Backend login impossible with MSSQL via ODBCClosedXavier Perseguers2006-12-12

Actions
Actions #1

Updated by Xavier Perseguers over 14 years ago

I do not like "quick and dirty" hacks... But anyway, your hack cannot apply to current version of class.ux_t3lib_db.php as line 1495 lies exactly between two methods in current code...

Actions #2

Updated by Xavier Perseguers over 14 years ago

Please have a look at bug #4640 and report here or there if it helps fixing your problem.

Actions #3

Updated by Golo Meierhenrich over 14 years ago

I don't like "quick & dirty" as well, but I just needed a way to make it work. I'd rather prefer a better solution from someone who knows the system better than me. That's why I went here.
Actually this applies to the version of dbal delivered with the 4.3.1 package of typo3. Sorry for not pointing that out further.

Line 1495 says: foreach ($output as $key => $value) {

I will check the related bug and give you feedback as soon as possible.

Actions #4

Updated by Xavier Perseguers over 14 years ago

There is a few places in DBAL were the "mssql" driver is tested, meaning using odbc_mssql will fail to be interpreted as a MSSQL link. Is use of "mssql" driver instead an option for you?

Actions #5

Updated by Golo Meierhenrich over 14 years ago

I can confirm that the patch from the related bug 0004640 solves the login problem. Only the line numbers have to be updated for the actual version.

Actions #6

Updated by Xavier Perseguers over 14 years ago

OK, I did some test and configured a website with MSSQL and odbc_mssql instead of native driver mssql and I could not log in anymore. Will have a look soon.

Here's the tutorial how to configure TYPO3 to use either mssql native driver or ODBC one: http://xavier.perseguers.ch/tutoriels/typo3/articles/mssql-database.html

Actions #7

Updated by Xavier Perseguers over 14 years ago

Patch of bug #4640 solves this issue. No need for another patch.

Actions

Also available in: Atom PDF