How long can a command sent to MySQL from Perl be?

How long can a command sent to MySQL from Perl be?

am 17.03.2003 23:04:17 von Hal Vaughan

I'm new to SQL and MySQL, so if there is a better way to do this, I don't=
mind=20
hearing this.

I need to select records from one database and put them in a temporary ta=
ble=20
and I'm using the Perl DBI module. The records I need to select will hav=
e to=20
match anywhere from a small to a large number of criteria. I'd like to b=
e=20
able to send one LONG command to MySQL, something that might look like th=
is:

SELECT * FROM Clients where (Field1 =3D "xyz" and Field2 =3D "ABC") or (F=
ield1 =
"tuv" and FIeld2 =3D "DEF);

I'd like to be able to use many more critieria (actually my client would =
like=20
to be able to use many more critieria), so I might have 12 criteria joine=
d by=20
AND or OR.

So just how long a line can I send to MySQL from Perl without the line ge=
tting=20
chomped off or rejected? How can I build really long command lines simil=
iar=20
to multi-line commands when I'm using the MySQL prompt?

Thanks for comments and ideas!

Hal


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2085@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: How long can a command sent to MySQL from Perl be?

am 18.03.2003 10:25:40 von Jochen Wiedmann

Zitiere Hal Vaughan :

> So just how long a line can I send to MySQL from Perl without the line
> getting
> chomped off or rejected? How can I build really long command lines
> similiar
> to multi-line commands when I'm using the MySQL prompt?

That is precisely evaluated by the "crashme" script. The "crashme"
results are part of the MySQL distribution, AFAIK.

I don't know the exact numbers, but 12 clauses are nothing.

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2087@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: How long can a command sent to MySQL from Perl be?

am 18.03.2003 10:25:40 von Jochen Wiedmann

Zitiere Hal Vaughan :

> So just how long a line can I send to MySQL from Perl without the line
> getting
> chomped off or rejected? How can I build really long command lines
> similiar
> to multi-line commands when I'm using the MySQL prompt?

That is precisely evaluated by the "crashme" script. The "crashme"
results are part of the MySQL distribution, AFAIK.

I don't know the exact numbers, but 12 clauses are nothing.

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2087@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: How long can a command sent to MySQL from Perl be?

am 18.03.2003 20:25:05 von Marc Prewitt

This is dependent upon how large you have max_allowed_packet set.
However, there is an upper limit. From
http://www.mysql.com/doc/en/Packet_too_large.html:

In MySQL 3.23 the biggest possible packet is 16M (due to limits in the
client/server protocol). In MySQL 4.0.1 and up, this is only limited by
the amount on memory you have on your server (up to a theoretical maximum
of 2G).

A communication packet is a single SQL statement sent to the MySQL server
or a single row that is sent to the client.




Hal Vaughan wrote:
>
> I'm new to SQL and MySQL, so if there is a better way to do this, I don't mind
> hearing this.
>
> I need to select records from one database and put them in a temporary table
> and I'm using the Perl DBI module. The records I need to select will have to
> match anywhere from a small to a large number of criteria. I'd like to be
> able to send one LONG command to MySQL, something that might look like this:
>
> SELECT * FROM Clients where (Field1 = "xyz" and Field2 = "ABC") or (Field1 =
> "tuv" and FIeld2 = "DEF);
>
> I'd like to be able to use many more critieria (actually my client would like
> to be able to use many more critieria), so I might have 12 criteria joined by
> AND or OR.
>
> So just how long a line can I send to MySQL from Perl without the line getting
> chomped off or rejected? How can I build really long command lines similiar
> to multi-line commands when I'm using the MySQL prompt?
>
> Thanks for comments and ideas!
>
> Hal
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread2085@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2096@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: How long can a command sent to MySQL from Perl be?

am 18.03.2003 20:25:05 von Marc Prewitt

This is dependent upon how large you have max_allowed_packet set.
However, there is an upper limit. From
http://www.mysql.com/doc/en/Packet_too_large.html:

In MySQL 3.23 the biggest possible packet is 16M (due to limits in the
client/server protocol). In MySQL 4.0.1 and up, this is only limited by
the amount on memory you have on your server (up to a theoretical maximum
of 2G).

A communication packet is a single SQL statement sent to the MySQL server
or a single row that is sent to the client.




Hal Vaughan wrote:
>
> I'm new to SQL and MySQL, so if there is a better way to do this, I don't mind
> hearing this.
>
> I need to select records from one database and put them in a temporary table
> and I'm using the Perl DBI module. The records I need to select will have to
> match anywhere from a small to a large number of criteria. I'd like to be
> able to send one LONG command to MySQL, something that might look like this:
>
> SELECT * FROM Clients where (Field1 = "xyz" and Field2 = "ABC") or (Field1 =
> "tuv" and FIeld2 = "DEF);
>
> I'd like to be able to use many more critieria (actually my client would like
> to be able to use many more critieria), so I might have 12 criteria joined by
> AND or OR.
>
> So just how long a line can I send to MySQL from Perl without the line getting
> chomped off or rejected? How can I build really long command lines similiar
> to multi-line commands when I'm using the MySQL prompt?
>
> Thanks for comments and ideas!
>
> Hal
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread2085@lists.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2096@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.