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

Home » FUDforum Development » Bug Reports » pg_query() prepare issue
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
pg_query() prepare issue [message #22031] Mon, 10 January 2005 06:17 Go to next message
petej74 is currently offline  petej74   Canada
Messages: 5
Registered: January 2005
Karma: 0
Junior Member
First off, just want to express my happiness with your forum software. I've lately had to work a little with a phpBB board, and I really find myself missing FUD's ease of use and intuitive design. Great work, guys. Smile

To the point. I found an issue today with my newly upgraded version of fudforum. With this post (from http://skdr.net/forum):

Quote:

A few people have asked how to display dynamic splash screen content. It seems fairly easy, but there are a lot of little things that are hard to figure out. I've spent a lot of time working on it, and so I thought I'd post a nice little write up for all of you.

The first thing to look at is Application.renderSplashScreen(View inView, Pen inPen). This is the method that is used to do the actual drawing. Now if you only need to put dynamic content on the splash screen once while the app is running its very easy. Just draw your content with inPen.

If you need to update the content, which I'm sure you will, because you prolly wouldn't be reading this post if you didn't, then its a lot more complex. The hiptop OS will draw the splash screen image once for you. After that if you write anything on top of it, it will not clear it. So, we need to clear the view each time, and since we are clearing it we need to draw the splash screen image ourselfs as well.

public void renderSplashScreen(View inView, Pen inPen) {
	/* Clear the content that was there before, and draw the splash screen image */
	inView.clear(inPen);
	inPen.drawBitmap(0, 0, getBitmap(AppResources.ID_SPLASH_SCREEN));

	/* Setup the font */
	inPen.setFont(Font.findBoldOutlineSystemFont());
	inPen.setColor(Color.WHITE);
	inPen.setTextOutlineColor(Color.BLACK);

	/* Draw the content */
	inPen.drawText(15, 35, "This is my dynamic content....");
}




I was tickling a bug that presented itself like so:

Quote:

Warning: pg_query(): Query failed: ERROR: Unable to identify an operator '=$' for types 'character varying' and 'integer' You will have to retype this query using an explicit cast in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2738

Warning: pg_query(): Query failed: ERROR: Prepared statement with name "fud26_srch_sel" does not exist in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2741

Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2741

Warning: pg_query(): Query failed: ERROR: Cannot insert a duplicate key into unique index fud26_search_i_w in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2742

Warning: pg_query(): Query failed: ERROR: Prepared statement with name "fud26_srch_sel" does not exist in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2741

Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2741

Warning: pg_query(): Query failed: ERROR: Cannot insert a duplicate key into unique index fud26_search_i_w in /usr/local/www/data-dist/www.skdr.net/forum/theme/default/post.php on line 2742

. . .


I'm running FUDforum 2.6.9 on PHP 4.3 and PostgreSQL 7.3.8. I was able to prevent this issue by changing this:

   2736             define('search_prep2', 'PREPARE fud26_srch_sel (text) AS SELECT id FROM fud26_search WHERE word=$1');


to this:

   2736             define('search_prep2', 'PREPARE fud26_srch_sel (text) AS SELECT id FROM fud26_search WHERE word= $1');


Seems the postgres parser misinterprets the operator, so this is definitely a postgres bug. Just thought you might like to change that line anyway.

Cheers.
Re: pg_query() prepare issue [message #22040 is a reply to message #22031] Mon, 10 January 2005 22:02 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I'll test this on 7.4.6, if the space does not break anything there I'll definately add this hack for older PostgreSQL installations.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Space ignored in eMail-Validation
Next Topic: [2.6.9]sorry, duplic report, pls delete
Goto Forum:
  

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

Current Time: Fri Nov 22 07:43:04 GMT 2024

Total time taken to generate the page: 0.06019 seconds