Re: Bug in 3.1.6 ?
Posted by: Mark Matthews
Date: January 11, 2005 09:55PM

R Lenard wrote:
> This works with the old driver but fails with a
> "This command is not supported in the prepared
> statement protocol yet" error with 3.1.6.
>
> Surely it is known what is supported in the
> protocol, and thus server side prepared statements
> should only be used for SQL that is supported the
> protocol..
>
> This is effectively the prepared statement
> statement I was running.
>
> REPLACE INTO summaryTable ( f1, f2, f3 ) SELECT ?
> AS f1, ? AS f2, CURRENT_TIMESTAMP AS f3 FROM
> origTable WHERE f2 = ?

R,

It's not that simple, as 'what is supported' changes with each release of the server.

Even if the list were static, checking for this on the client side would require a nearly full-blown parser to be written, and would have severe performance implications. Most 'normal' statements that someone would use (SELECT/UPDATE/INSERT/DELETE) are all supported.

If you know that you won't be gaining anything from the use of server-side prepared statements, or if you know you have statements that aren't supported (the list is at http://dev.mysql.com/doc/mysql/en/C_API_Prepared_statements.html , I'll add that to the Connector/J docs so that it's easier to find), then just turn off server-side prepared statements with the 'useServerPrepStmts=false' flag.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
January 11, 2005 08:52PM
Re: Bug in 3.1.6 ?
January 11, 2005 09:55PM
January 11, 2005 10:03PM
January 11, 2005 10:26PM
January 11, 2005 10:28PM
January 11, 2005 11:31PM
January 11, 2005 10:06PM
January 11, 2005 10:13PM
January 11, 2005 10:17PM
January 11, 2005 10:28PM
January 11, 2005 10:30PM
January 11, 2005 10:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.