MySQL statement length

MySQL statement length

am 14.01.2007 03:12:03 von Roy Epperson

I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?

Re: MySQL statement length

am 15.01.2007 01:11:38 von Bill Karwin

Roy Epperson wrote:
> I'm not finding what the maximum number of characters that a statement
> can be. Anyone know where I can find that spec?

I have found it hard to find this stat as well. I could not find a
definitive answer, but I believe the maximum length of a SQL statement
is 1MB.

It may be the case that the programming interface you use may impose a
shorter limit on the query length than that supported by the MySQL server.

Regards,
Bill K.

Re: MySQL statement length

am 15.01.2007 03:47:04 von Michael Austin

Roy Epperson wrote:
> I'm not finding what the maximum number of characters that a statement
> can be. Anyone know where I can find that spec?

Are you having problems or just looking for some spec?

http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html

" A communication packet is a single SQL statement sent to the MySQL server, a
single row that is sent to the client, or a binary log event sent from a master
replication server to a slave.

The largest possible packet that can be transmitted to or from a MySQL 5.0
server or client is 1GB."

The C API is limited appears to be 16Mb.

Is there some reason for creating a single statement that long?

--
Michael Austin
Database Consultant
Domain Registration and Linux/Windows Web Hosting Reseller
http://www.spacelots.com

Re: MySQL statement length

am 15.01.2007 18:27:19 von Roy Epperson

Thanks Bill, I suspect that JDBC will allow close to that....

Bill Karwin wrote:
> Roy Epperson wrote:
>> I'm not finding what the maximum number of characters that a statement
>> can be. Anyone know where I can find that spec?
>
> I have found it hard to find this stat as well. I could not find a
> definitive answer, but I believe the maximum length of a SQL statement
> is 1MB.
>
> It may be the case that the programming interface you use may impose a
> shorter limit on the query length than that supported by the MySQL server.
>
> Regards,
> Bill K.

Re: MySQL statement length

am 15.01.2007 18:32:37 von Roy Epperson

Michael,
Not having a problem and don't expect to if the JDBC limit is close to
the C API limit. I've using a `select * from aTable where columnName in
()` statement there the primary key is an
autonumber.
Roy

Michael Austin wrote:
> Roy Epperson wrote:
>> I'm not finding what the maximum number of characters that a statement
>> can be. Anyone know where I can find that spec?
>
> Are you having problems or just looking for some spec?
>
> http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html
>
> " A communication packet is a single SQL statement sent to the MySQL
> server, a single row that is sent to the client, or a binary log event
> sent from a master replication server to a slave.
>
> The largest possible packet that can be transmitted to or from a MySQL
> 5.0 server or client is 1GB."
>
> The C API is limited appears to be 16Mb.
>
> Is there some reason for creating a single statement that long?
>