can create threads, but unable to reply to them [message #4215] |
Thu, 18 July 2002 13:38 |
ben!
Messages: 7 Registered: July 2002
Karma: 0
|
Junior Member |
|
|
So yeah, i can create threads, but when it comes to replying, no dice, due to the following error:
I'm running PostgreSQL 7.2.1 on a hacked-up RedHat box, with PHP 4.2.1 and Apache 2.0.39.
Now, i did just notice that i compiled my PHP against an older version of PostgreSQL, and i'm rebuilding it as we speak....
query failed: %( INSERT INTO fud21_ftvt_1060317709 (thread_id,forum_id,page,tmp) SELECT fud21_thread.id, fud21_thread.forum_id, 4294967294, CASE WHEN is_sticky='Y' AND (fud21_msg.post_stamp+fud21_thread.orderexpiry>1026999181 OR fud21_thread.orderexpiry=0) THEN 4294967294 ELSE fud21_thread.last_post_date END AS sort_order_fld FROM fud21_thread INNER JOIN fud21_msg ON fud21_thread.root_msg_id=fud21_msg.id WHERE forum_id=1 AND fud21_msg.approved='Y' ORDER BY sort_order_fld DESC, fud21_thread.last_post_id DESC LIMIT 40, 0 )% because %( LAST_ERROR: ERROR: dtoi4: integer out of range )%Query Failed: INSERT INTO fud21_ftvt_1060317709 (thread_id,forum_id,page,tmp) SELECT fud21_thread.id, fud21_thread.forum_id, 4294967294, CASE WHEN is_sticky='Y' AND (fud21_msg.post_stamp+fud21_thread.orderexpiry>1026999181 OR fud21_thread.orderexpiry=0) THEN 4294967294 ELSE fud21_thread.last_post_date END AS sort_order_fld FROM fud21_thread INNER JOIN fud21_msg ON fud21_thread.root_msg_id=fud21_msg.id WHERE forum_id=1 AND fud21_msg.approved='Y' ORDER BY sort_order_fld DESC, fud21_thread.last_post_id DESC LIMIT 40, 0
Reason: LAST_ERROR: ERROR: dtoi4: integer out of range
From: /home/httpd/html/bored/index.php
Server Version:
|
|
|
|
Re: can create threads, but unable to reply to them [message #4217 is a reply to message #4215] |
Thu, 18 July 2002 14:10 |
ben!
Messages: 7 Registered: July 2002
Karma: 0
|
Junior Member |
|
|
FURTHER DEVELOPMENTS:
Okay, apparently when FUD did it's install, it assigned all its files to group 4294967295, which is apparently overloading that dtoi4 field, near as i can tell.
Now, why it came up with group 4294967295, i don't know. I DO know, however, that i run my webserver as "nobody".
|
|
|
Re: can create threads, but unable to reply to them [message #4219 is a reply to message #4217] |
Thu, 18 July 2002 15:23 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
That is internal group system dealing with permissions.
The fix is quite simple,
1) Unlock forum's files using the file manager.
2) Run: perl -p -i -e 's/4294967294/2147483647/g' *.t (inside the src directory).
3) Rebuild theme using the theme manager.
FUDforum Core Developer
|
|
|
Re: can create threads, but unable to reply to them [message #4222 is a reply to message #4215] |
Thu, 18 July 2002 15:52 |
ben!
Messages: 7 Registered: July 2002
Karma: 0
|
Junior Member |
|
|
Ok, figured out the problem.
Now, to refresh memories, when i attempted to reply to a thread, i was getting a nasty integer overflow error. So, i did a little snooping around, and found that a number too big for INT4 (aka INT, smallINT) was attempting to be inserted into a temporary table.
This is most notably found in a bunch of files in $WHEREEVER/theme/default/.
The temp table is created:
q("CREATE TEMP TABLE ".$tmp_tbl_name." ( forum_id INT NOT NULL, page INT NOT NULL, thread_id INT NOT NULL, pos SERIAL, tmp INT )");
an INSERT is attempted:
q("INSERT INTO ".$tmp_tbl_name." (thread_id,forum_id,page,tmp) SELECT fud21_thread.id, fud21_thread.forum_id, 4294967294, CASE WHEN is_sticky='Y' AND (fud21_msg.post_stamp+fud21_thread.orderexpiry>".$tm." OR fud21_thread.orderexpiry=0) THEN 4294967294
ELSE fud21_thread.last_post_date END AS sort_order_fld FROM fud21_thread INNER JOIN fud21_msg ON fud21_thread.root_msg_id=fud21_msg.id WHERE forum_id=".$forum_id." AND fud21_msg.approved='Y' ORDER BY sort_order_fld DESC, fud21_thread.last_post_id DESC LIMIT ".($GLOBALS['THREADS_PER_PAGE']*$page).", 0");
Note that the number 4294967294 is being inserted into a field with data type "INT", which can only handle numbers up to 2147483647.
However, the "BIGINT" type (aka INT8) can handle numbers up to 9223372036854775807. I don't think this affects MYSQL, but it sure does with PostgreSQL 7.2.1, as i have.
Attached are the file affected, with the data type of INT changed to INT8.
Yay!. BTW, i'm really enjoying FUD.
|
|
|
|