Importing SQL script results in silent failure

Bug #656577 reported by m00dawg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
High
Andrew Hutchings
7.0
Fix Released
High
Andrew Hutchings

Bug Description

Importing a SQL script produced by drizzledump seems to result in an error, but not one that is presented to the user:

root@mcp:~# drizzle -p3307 moocowproductions < out.sql
root@mcp:~# echo $?
141
root@mcp:~#

The import only gets to about 5 of the 20 or so tables. drizzledump, however, does exit with a human readable error:

root@mcp:~# drizzledump -p3306 -uroot -Ppwd mcptest --destination-type=database --destination-port=3307 --destination-database=moocowproductions
-- drizzledump 2010.09.1802 libdrizzle 7, for pc-linux-gnu (x86_64)
--
-- Host: localhost Database: mcptest
-- ------------------------------------------------------
-- Server version 5.1.41-3ubuntu12.6 (MySQL server)

Error executing query: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'farm'),('5','The Bridge','The Bridge was my first back to raytracing project. I ' at line 1
Error executing query: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '2007-10-26 05:24:19','Paul McCullagh','','http://www.blobstreaming.org'),('56','' at line 1

Related branches

Revision history for this message
Patrick Crews (patrick-crews) wrote : Re: [Bug 656577] [NEW] Importing SQL script results in silent failure
Download full text (3.1 KiB)

Hmm, I would have thought our randgen testing would have caught something
like this :-/
However, thanks for the bug - and letting me know I need to tweak my test :
)

On Thu, Oct 7, 2010 at 6:50 PM, m00dawg <email address hidden> wrote:

> Public bug reported:
>
> Importing a SQL script produced by drizzledump seems to result in an
> error, but not one that is presented to the user:
>
> root@mcp:~# drizzle -p3307 moocowproductions < out.sql
> root@mcp:~# echo $?
> 141
> root@mcp:~#
>
> The import only gets to about 5 of the 20 or so tables. drizzledump,
> however, does exit with a human readable error:
>
> root@mcp:~# drizzledump -p3306 -uroot -Ppwd mcptest
> --destination-type=database --destination-port=3307
> --destination-database=moocowproductions
> -- drizzledump 2010.09.1802 libdrizzle 7, for pc-linux-gnu (x86_64)
> --
> -- Host: localhost Database: mcptest
> -- ------------------------------------------------------
> -- Server version 5.1.41-3ubuntu12.6 (MySQL server)
>
> Error executing query: You have an error in your SQL syntax; check the
> manual that corresponds to your Drizzle server version for the right syntax
> to use near 'farm'),('5','The Bridge','The Bridge was my first back to
> raytracing project. I ' at line 1
> Error executing query: You have an error in your SQL syntax; check the
> manual that corresponds to your Drizzle server version for the right syntax
> to use near '2007-10-26 05:24:19','Paul McCullagh','','
> http://www.blobstreaming.org'),('56','' at line 1
>
> ** Affects: drizzle
> Importance: Undecided
> Status: New
>
> --
> Importing SQL script results in silent failure
> https://bugs.launchpad.net/bugs/656577
> You received this bug notification because you are a member of Drizzle-
> developers, which is subscribed to Drizzle.
>
> Status in A Lightweight SQL Database for Cloud Infrastructure and Web
> Applications: New
>
> Bug description:
> Importing a SQL script produced by drizzledump seems to result in an error,
> but not one that is presented to the user:
>
> root@mcp:~# drizzle -p3307 moocowproductions < out.sql
> root@mcp:~# echo $?
> 141
> root@mcp:~#
>
> The import only gets to about 5 of the 20 or so tables. drizzledump,
> however, does exit with a human readable error:
>
> root@mcp:~# drizzledump -p3306 -uroot -Ppwd mcptest
> --destination-type=database --destination-port=3307
> --destination-database=moocowproductions
> -- drizzledump 2010.09.1802 libdrizzle 7, for pc-linux-gnu (x86_64)
> --
> -- Host: localhost Database: mcptest
> -- ------------------------------------------------------
> -- Server version 5.1.41-3ubuntu12.6 (MySQL server)
>
> Error executing query: You have an error in your SQL syntax; check the
> manual that corresponds to your Drizzle server version for the right syntax
> to use near 'farm'),('5','The Bridge','The Bridge was my first back to
> raytracing project. I ' at line 1
> Error executing query: You have an error in your SQL syntax; check the
> manual that corresponds to your Drizzle server version for the right syntax
> to use near '2007-10-26 05:24:19','Paul McCullagh','','
> http://www.blobstreaming.org'),('56','' at line 1
>
>
...

Read more...

Revision history for this message
Monty Taylor (mordred) wrote :
Download full text (3.3 KiB)

There are some definite issues related to drizzle.cc taking things from
stdin...

On 10/07/2010 04:06 PM, Patrick Crews wrote:
> Hmm, I would have thought our randgen testing would have caught something
> like this :-/
> However, thanks for the bug - and letting me know I need to tweak my test :
> )
>
> On Thu, Oct 7, 2010 at 6:50 PM, m00dawg <email address hidden>
> wrote:
>
>> Public bug reported:
>>
>> Importing a SQL script produced by drizzledump seems to result in an
>> error, but not one that is presented to the user:
>>
>> root@mcp:~# drizzle -p3307 moocowproductions < out.sql
>> root@mcp:~# echo $?
>> 141
>> root@mcp:~#
>>
>> The import only gets to about 5 of the 20 or so tables. drizzledump,
>> however, does exit with a human readable error:
>>
>> root@mcp:~# drizzledump -p3306 -uroot -Ppwd mcptest
>> --destination-type=database --destination-port=3307
>> --destination-database=moocowproductions
>> -- drizzledump 2010.09.1802 libdrizzle 7, for pc-linux-gnu (x86_64)
>> --
>> -- Host: localhost Database: mcptest
>> -- ------------------------------------------------------
>> -- Server version 5.1.41-3ubuntu12.6 (MySQL server)
>>
>> Error executing query: You have an error in your SQL syntax; check the
>> manual that corresponds to your Drizzle server version for the right syntax
>> to use near 'farm'),('5','The Bridge','The Bridge was my first back to
>> raytracing project. I ' at line 1
>> Error executing query: You have an error in your SQL syntax; check the
>> manual that corresponds to your Drizzle server version for the right syntax
>> to use near '2007-10-26 05:24:19','Paul McCullagh','','
>> http://www.blobstreaming.org'),('56','' at line 1
>>
>> ** Affects: drizzle
>> Importance: Undecided
>> Status: New
>>
>> --
>> Importing SQL script results in silent failure
>> https://bugs.launchpad.net/bugs/656577
>> You received this bug notification because you are a member of Drizzle-
>> developers, which is subscribed to Drizzle.
>>
>> Status in A Lightweight SQL Database for Cloud Infrastructure and Web
>> Applications: New
>>
>> Bug description:
>> Importing a SQL script produced by drizzledump seems to result in an error,
>> but not one that is presented to the user:
>>
>> root@mcp:~# drizzle -p3307 moocowproductions < out.sql
>> root@mcp:~# echo $?
>> 141
>> root@mcp:~#
>>
>> The import only gets to about 5 of the 20 or so tables. drizzledump,
>> however, does exit with a human readable error:
>>
>> root@mcp:~# drizzledump -p3306 -uroot -Ppwd mcptest
>> --destination-type=database --destination-port=3307
>> --destination-database=moocowproductions
>> -- drizzledump 2010.09.1802 libdrizzle 7, for pc-linux-gnu (x86_64)
>> --
>> -- Host: localhost Database: mcptest
>> -- ------------------------------------------------------
>> -- Server version 5.1.41-3ubuntu12.6 (MySQL server)
>>
>> Error executing query: You have an error in your SQL syntax; check the
>> manual that corresponds to your Drizzle server version for the right syntax
>> to use near 'farm'),('5','The Bridge','The Bridge was my first back to
>> raytracing project. I ' at line 1
>> Error executing query: You have an error in your S...

Read more...

Changed in drizzle:
assignee: nobody → Andrew Hutchings (linuxjedi)
Changed in drizzle:
importance: Undecided → Medium
milestone: none → 2010-10-25
status: New → In Progress
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Can I please have an example of this (a broken dump file or something)? I've not been able to reproduce it.

Changed in drizzle:
status: In Progress → Incomplete
Revision history for this message
m00dawg (tim-moocowproductions) wrote :

Original problem appears to be resolved in one of the later updates to Drizzle - it is now producing a proper error (though it is for a different part of the import):

root@mcp:~# drizzle mcp < mcptest-drz.sql
ERROR 1064 (42000) at line 4605: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '),(INSERT INTO `BlogPosts` VALUES ('471',NULL,1,1,'2010-01-18 03:39:39','live','' at line 1
root@mcp:~#

The error is still, well, a problem :) Did you want me to open a new bug on that as the original issues appears to have been resolved?

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Ah, excellent, thanks. I'll close this one. If you could open a new one that would be cool. Please also try the 2010-10-11 release as well (or latest trunk) if you haven't already as I have fixed many related bugs in it which could cause syntax errors.

Changed in drizzle:
milestone: 2010-10-25 → 2010-10-11
status: Incomplete → Fix Released
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

m00dawg: your second problem in this is bug#660619. I swear I tested this so I guess I broke something whilst fixing something else. I know what is wrong and will fix it ASAP.

Revision history for this message
m00dawg (tim-moocowproductions) wrote :

Not sure if this matches the version this was fixed in, but using the latest DEBs still gives me the silent failure:

root@mcp:/usr/lib/drizzle7# drizzle --version
Drizzle client 7 build 2010.10.1848, for pc-linux-gnu (x86_64) using readline 5.2
root@mcp:/usr/lib/drizzle7# drizzledump -p3306 -uroot -PtD2sMQamlWnZZuCd mcptest > mcp-drz.sql
root@mcp:/usr/lib/drizzle7# echo $?
0
root@mcp:/usr/lib/drizzle7# drizzle mcptest < mcp-drz.sql
root@mcp:/usr/lib/drizzle7# echo $?
141

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Is it possible to provide some kind of dump file which reproduces this?

Changed in drizzle:
status: Fix Released → Incomplete
milestone: 2010-10-11 → none
Revision history for this message
m00dawg (tim-moocowproductions) wrote :
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Thanks, I'll look into this ASAP

Changed in drizzle:
status: Incomplete → Triaged
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :
Download full text (13.9 KiB)

Cause: SIGPIPE

Program received signal SIGPIPE, Broken pipe.
0x00007ffff5d87802 in __libc_send (fd=<value optimised out>,
    buf=0x7ffff7ef5f6f, n=890279, flags=<value optimised out>)
    at ../sysdeps/unix/sysv/linux/x86_64/send.c:28
28 ../sysdeps/unix/sysv/linux/x86_64/send.c: No such file or directory.
 in ../sysdeps/unix/sysv/linux/x86_64/send.c

(gdb) bt full
#0 0x00007ffff5d87802 in __libc_send (fd=<value optimised out>, buf=0x7ffff7ef5f6f, n=890279, flags=<value optimised out>) at ../sysdeps/unix/sysv/linux/x86_64/send.c:28
        oldtype = <value optimised out>
        result = <value optimised out>
#1 0x00007ffff6be8573 in drizzle_state_write (con=0x644680) at libdrizzle/conn.c:1010
        ret = 4294967264
        write_size = -1
#2 0x00007ffff6beef7a in drizzle_state_loop (con=0x644680) at libdrizzle/state.c:24
        ret = <value optimised out>
#3 0x00007ffff6be9625 in drizzle_con_command_write (con=0x644680, result=0x7fffffffbcc0, command=DRIZZLE_COMMAND_QUERY, data=0x7ffff7eca028, size=0, total=0, ret_ptr=0x7fffffffb34c) at libdrizzle/conn.c:492
No locals.
#4 0x00007ffff6beb54b in drizzle_query (con=0x5, result=0x7ffff7ef5f6f, query=<value optimised out>, size=<value optimised out>, ret_ptr=<value optimised out>) at libdrizzle/query.c:22
No locals.
#5 0x000000000041a5ce in drizzleclient_real_query_for_lazy (buf=0x7ffff7eca028 "INSERT INTO `BlogPosts` VALUES ('1',NULL,5,1,NULL,'live','2004-05-05 00:53:46','0','First Post...Ever','Whelp...it\\'s my first post. First ever. None like it before. Blatantly obvious perhaps, but it\\"..., length=<value optimised out>, result=0x7fffffffbcc0, error_code=0x7fffffffb3e8) at client/drizzle.cc:2681
        error = 0
        retry = 0
        ret = 32767
#6 0x000000000041a7e2 in com_go (buffer=0x6577d0) at client/drizzle.cc:2810
        time_buff = "\320we\000\000\000\000\000(\240\354\367\377\177\000\000I\000\000\000\000\000\000\000\377\064~\362\377\177", '\000' <repeats 25 times>
        ret = <value optimised out>
        timer = 4085872
        error_code = 0
        buff = "Query OK, 0 rows affecte@\356\001\366\377\177\000\000\340_\020\000\000\000\000\000\340_\020", '\000' <repeats 21 times>"\320, we\000\000\000\000\000\216\303\321\365\377\177\000\000@\306\377\377\377\177\000\000(\000\341\367\377\177\000\000\307\377\017\000\000\000\000\000\327\337}\362\377\177\000\000(\340M\362\377\177\000\000\307_\020\000\000\000\000\000\340_\020\000\000\000\000\000@\356\001\366\377\177\000\000\356T\020\000\000\000\000\000\020\340m\362\377\177\000\000\000\000\000\000\000\000\000\000\263\215\334\365\377\177\000\000;", '\000' <repeats 15 times>, ";\000\000\000\000\000\000"
        result = {con = 0x644680, next = 0x0, prev = 0x0, options = DRIZZLE_RESULT_NONE, info = '\000' <repeats 2047 times>, error_code = 0, sqlstate = "\000\000\000\000\000", insert_id = 0, warning_count = 0, affected_rows = 0, column_count = 0, column_current = 0, column_list = 0x0, column = 0x0, column_buffer = 0x0, row_count = 0, row_current = 0, field_current = 0, field_total = 0, field_offset = 0, field_size = 0, field = 0x0, field_buffer = 0x0, row_list_size = 0, row = 0x0, row_list = 0x0, field_sizes = 0x0, field_size...

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

OK, so, rundown of what is happening:

1. Client sends just over 1MB of data
2. Drizzle server drizzleclient_net_read() returns ER_NET_PACKET_TOO_LARGE
3. Drizzle server forces disconnect due to error
4. send() function SIGPIPE as connection just died

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

How to fix:

1. Don't SIGPIPE here, error instead (done in branch attached to bug)
2. Investigate drizzledump's large output
3. Investigate packet size issues

Changed in drizzle:
status: Triaged → In Progress
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

4. Make this error about max packet size instead of lost server

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Whilst testing the fixes for this also found bug#666997 using your data.

Revision history for this message
m00dawg (tim-moocowproductions) wrote :

Hah, I guess glad my schema is particularly problematic? :) More bugs squashed at least :) Thanks for looking into these Andrew! I'm excited to try the new fixes!

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Hehe, its good these things are tested, thanks for the data, it has proved very useful. This particular bug actually wasn't anything really to do with drizzledump migration, it appears to be a long standing bug affecting all drizzle client connections.
As for the new one, a nice new edge case, should be much easier to fix :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.