[TYPO3-english] t3blog on postgres (continuation)

Xavier Perseguers xavier at typo3.org
Wed Jun 22 09:47:52 CEST 2011


Hi,

Boris Gulay wrote:
> After fixing error mentioned in my previous message
> (http://lists.typo3.org/pipermail/typo3-english/2011-June/075677.html) I
> found another issue. DBAL reports a problem:
>
> Could not parse where clause in
> /usr/share/typo3/typo3/sysext/dbal/class.ux_t3lib_db.php : 1296
>
> In DBAL debug log I can see two similar errors:
> ---------------------------------
> sqlError ERROR: operator does not exist: bigint = character varying
> LINE 1: ..."tx_t3blog_post"."pid" = 46 AND "be_users"."uid" = "tx_t3bl...
> ^
> HINT: No operator matches the given name and argument type(s). You might
> need to add explicit type casts.

Line is truncated but "you" seem to try to compare a bigint (pid or uid 
column) with a string. Is it possible that the part that is truncated is 
in fact a string? I know that a few extensions do not care about column 
types and happily search for strings inside uid/pid columns as MySQL 
does not complain...

>   index.php SELECT COUNT("tx_t3blog_post"."uid") AS "t" FROM
> "tx_t3blog_post", "be_users" WHERE "tx_t3blog_post"."pid" = 46 AND
> "be_users"."uid" = "tx_t3blog_post"."author" AND
> "tx_t3blog_post"."deleted" = 0 AND "tx_t3blog_post"."t3ver_state"<= 0
> AND "tx_t3blog_post"."pid" != -1 AND "tx_t3blog_post"."hidden" = 0 AND
> "tx_t3blog_post"."starttime"<= 1308664320 AND
> ("tx_t3blog_post"."endtime" = 0 OR "tx_t3blog_post"."endtime">
> 1308664320) AND ("tx_t3blog_post"."fe_group" = '' OR
> "tx_t3blog_post"."fe_group" IS NULL OR "tx_t3blog_post"."fe_group" = '0'
> OR ("tx_t3blog_post"."fe_group" LIKE '%,0,%' OR
> "tx_t3blog_post"."fe_group" LIKE '0,%' OR "tx_t3blog_post"."fe_group"
> LIKE '%,0' OR "tx_t3blog_post"."fe_group" = '0') OR
> ("tx_t3blog_post"."fe_group" LIKE '%,-1,%' OR
> "tx_t3blog_post"."fe_group" LIKE '-1,%' OR "tx_t3blog_post"."fe_group"
> LIKE '%,-1' OR "tx_t3blog_post"."fe_group" = '-1'))
> ---------------------------------
> sqlError ERROR: operator does not exist: bigint = character varying
> LINE 1: ..."tx_t3blog_post"."pid" = 46 AND "be_users"."uid" = "tx_t3bl...
> ^
> HINT: No operator matches the given name and argument type(s). You might
> need to add explicit type casts.

Same problem here, this time with full query, good:

"be_users"."uid" = "tx_t3blog_post"."author"

Is is possible that type between uid and author does not match?

> [...]
>
> Field be_users.uid is of type bigint, but field tx_t3blog_post.author is
> of type character varying(255) (why?).

I should have read up to the end, I thought you were describing 3 
different problems that I could answer one after the other...

> It seems to me that value of author field should be converted to bigint
> before being compared. What is the correct (and portable) way to do it
> with DBAL?

Exactly! You have to make sure columns are comparable and comparing 
strings and numbers only works with MySQL. The extension must be much 
more strict about type comparison...

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list