[TYPO3-core] Warning in t3lib_db line 1047
Martin Kutschker
martin.kutschker-no at spam-blackbox.net
Wed Jun 11 18:03:18 CEST 2008
Stefan Geith schrieb:
> Hi Devs,
>
> when I update sites of my clients to 4.2.1
> I get on some site warnings like this:
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL
> result resource in
> /htdocs/typo3/typo3_src-4.2.1/t3lib/class.t3lib_db.php on line 1047
>
> SourceCode:
> $columns_res = mysql_query('SHOW CHARACTER SET', $this->link);
> while ($row = mysql_fetch_assoc($columns_res)) {
> $output[$row['Charset']] = $row;
> }
>
> Maybe the installed mySql doesnt support this query, so
> I changed these lines to:
> $columns_res = mysql_query('SHOW CHARACTER SET', $this->link);
> if ($columns_res) while ($row = mysql_fetch_assoc($columns_res)) {
> $output[$row['Charset']] = $row;
> }
>
> The sites now work without problems.
Please consult the Mysql docs. They state that this is supported since 4.1.
> --------
>
> Does anybody know what impact it has, if no
> charsets can be read from mysql ?
>
> Should the above change get applied to the core ?
Only if TYPO3 4.2 is supposed to run on Mysql 4.0 or even 3.23.
Personally I think that 4.2 should require at least 4.1 I have asked on
the list for a decision but unlike the PHP rquirement there was never an
official statement about it.
As TYPO3 4.2 runs probably fine on 4.0 besides this issue it might be a
nice move to add this code to the Core. OTOH it's always a good move to
check the result set. I think it's somewhat sloppy if it's missing.
For 4.3 we should remove it again (or better not add it to the trunk)
and make a Mysql version check in the installer and in the about module
(where the other admin warnings are).
Masi
More information about the TYPO3-team-core
mailing list