FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » db_li and a postgres setup on not english language
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
db_li and a postgres setup on not english language [message #24180] Tue, 19 April 2005 11:37 Go to next message
ngockhoi is currently offline  ngockhoi   United Kingdom
Messages: 15
Registered: July 2003
Location: Paris
Karma: 0
Junior Member
Hi all,

There's a special mysql keyword "ON DUPLICATE KEY UPDATE" is use and the db_li get a sql_error event :
if (strpos($err, 'duplicate key') !== false) {
$ef = ltrim(strrchr($err, ' '));
return null;
} else {
die(fud_sql_error_handler($q, pg_last_error(fud_sql_lnk), '', get_version()));
}


But Postgresql for any langage (french for me) is not the same error message 'duplicate key'.

Regards,
Re: db_li and a postgres setup on not english language [message #24183 is a reply to message #24180] Tue, 19 April 2005 13:11 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What message is it?

FUDforum Core Developer
Re: db_li and a postgres setup on not english language [message #28098 is a reply to message #24183] Tue, 11 October 2005 12:49 Go to previous messageGo to next message
ngockhoi is currently offline  ngockhoi   France
Messages: 15
Registered: July 2003
Location: Paris
Karma: 0
Junior Member
Sorry for my english,

This code (db_li) don't work with postgresql setup on French or other language.

if (strpos($err, 'duplicate key') !== false) {
$ef = ltrim(strrchr($err, ' '));
return null;
} else {
die(fud_sql_error_handler($q, pg_last_error(fud_sql_lnk), '', get_version()));
}

Because on french the error message of postgresql don't have the "duplicate key" words

Regards,

[Updated on: Tue, 11 October 2005 12:49]

Report message to a moderator

Re: db_li and a postgres setup on not english language [message #28103 is a reply to message #28098] Tue, 11 October 2005 14:47 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can you tell me what is the french version of the error message?

FUDforum Core Developer
Re: db_li and a postgres setup on not english language [message #28142 is a reply to message #28103] Wed, 12 October 2005 13:50 Go to previous messageGo to next message
ngockhoi is currently offline  ngockhoi   France
Messages: 15
Registered: July 2003
Location: Paris
Karma: 0
Junior Member

The french error message it's :
une clé dupliqué rompt la contrainte unique A<<tablename_pkey>>


And i has use only "contrainte unique" because the UTF8 charset can be a problem with any "é" character

Regards,
Re: db_li and a postgres setup on not english language [message #28143 is a reply to message #28142] Wed, 12 October 2005 13:53 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
See if this patch does the trick for you:
http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=7376


FUDforum Core Developer
Re: db_li and a postgres setup on not english language [message #29222 is a reply to message #24180] Sun, 04 December 2005 23:19 Go to previous messageGo to next message
ngockhoi is currently offline  ngockhoi   France
Messages: 15
Registered: July 2003
Location: Paris
Karma: 0
Junior Member
The problem come back !

I get the new version from cvs and the db.inc is
if (strpos($err, 'key') !== false) {

But the duplicate key of forum_read table is forum_read_i_fu while the french error message (and other language of postgresql installation) don't have key word.

The french message is :
une clé dupliqué rompt la contrainte unique A<<forum_read_i_fu>>

I don't find have to get the error number of postgresql from php. Why i thing the last solution it's define on the special keyword for each langague and for french is "rompt la contrainte unique" it's a good sentence.


Regards,
Re: db_li and a postgres setup on not english language [message #29236 is a reply to message #29222] Mon, 05 December 2005 15:55 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Here is the final fix:
http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=7471


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Group Permissions inheritance issue
Next Topic: New topic E-mail notification does not work anymore
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Jun 17 17:58:31 GMT 2024

Total time taken to generate the page: 0.02670 seconds