alzalabany / sql-buddy

Automatically exported from code.google.com/p/sql-buddy
MIT License
0 stars 0 forks source link

Extremely long queries (exported from SB) do not run #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a table with 400 rows (total data size is around 200 kB).
2. Export using SQL Buddy.
3. Import using SQL Buddy (e.g. into another database).

What is the expected output? What do you see instead?

I expect all queries to be imported.

What version of the product are you using? On what operating system?

SB 1.3.1
Apache 2.0
PHP version 5.2.6-3ubuntu4.1
MySQL 5.0.75

Please provide any additional information below.

I believe the issue is due to the fact that when exporting, there is
actually only one query in the file (when using "Compact inserts"). You
have an "INSERT INTO" line, followed by 400 lines of data.

When exporting SB should split compact inserts into groups of 50 or so (as
phpMyAdmin does). In other words, one "INSERT INTO" line, then 50 data
lines, semicolon, another "INSERT INTO" line, 50 data lines, etc etc.

Original issue reported on code.google.com by scott.vi...@gmail.com on 5 Jul 2009 at 11:26

GoogleCodeExporter commented 9 years ago
After a little more investigation, it appears that SQL Buddy is ignoring any 
query
over ~32 kB (~32,000 characters I suppose).

I manually added "INSERT INTO" lines to my SQL files that came from SB, one 
every 40
lines. Semicolons are in the right places. On the first attempt at importing, 
320
rows were added to the database, but SB flunked on the next set of lines 
(without
this section, it inserted all other rows).

I also tested this and similar queries in separate files - at about the 32kB 
mark SB
starts ignoring the file totally. Under this, SB either inserts the data as 
normal or
tells me that there is a problem (e.g. duplicate key).

Side note: it would be useful if SQL Buddy provided some better error messages 
across
the app!

Original comment by scott.vi...@gmail.com on 5 Jul 2009 at 11:37