[TYPO3-english] t3blog on postgres (continuation)

Boris Gulay boris at boressoft.ru
Tue Jun 21 16:06:53 CEST 2011


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.

 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.

 index.php tx_t3blog_post,be_users DISTINCT tx_t3blog_post.uid AS
uid,tx_t3blog_post.tagClouds,tx_t3blog_post.title,tx_t3blog_post.author,tx_t3blog_post.date,tx_t3blog_post.cat,tx_t3blog_post.number_views,be_users.email,be_users.uid
AS useruid,be_users.username,be_users.realName,be_users.tx_t3blog_avatar
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')) tx_t3blog_post.date DESC 0,5
---------------------------------
In both cases Postgres says that he cannot compare bigint and character
varying. That because of the following SQL construct:

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

Field be_users.uid is of type bigint, but field tx_t3blog_post.author is
of type character varying(255) (why?).
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?



More information about the TYPO3-english mailing list