Bug #49694 | Crash executing LOAD DATA LOCAL INFILE | ||
---|---|---|---|
Submitted: | 14 Dec 2009 20:39 | Modified: | 2 Aug 2010 16:48 |
Reporter: | Charles Bailey | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Workbench: SQL Editor | Severity: | S3 (Non-critical) |
Version: | 5.2.11, 5.2.15 | OS: | MacOS (10.5.8) |
Assigned to: | Sergei Tkachenko | CPU Architecture: | Any |
[14 Dec 2009 20:39]
Charles Bailey
[14 Dec 2009 20:42]
Charles Bailey
CrashReporter traceback
Attachment: 49694_abbrev_traceback.txt (text/plain), 11.34 KiB.
[15 Dec 2009 15:41]
Valeriy Kravchuk
Thank you for the problem report. Please, send the results of: show create table enclist\G and .csv file to load to get this crash.
[16 Jan 2010 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[25 Jan 2010 23:23]
Charles Bailey
Sorry for the delay; too quick submitting the bug and missed the update. Table structure: CREATE TABLE `enclist` ( `pat_id` int(11) NOT NULL, `episode_id` int(11) NOT NULL, `enc_id` double NOT NULL, PRIMARY KEY (`pat_id`,`episode_id`,`enc_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Rather than take up space, CSV file can be generated by the following bit of Perl: for (my $i = 0; $i < $ARGV[0]; $i++) { printf ("%.08d,%d,%f\r\n", 100 + $i, $i % 3 + 1, 60000 + $i/100); } for WB 5.2.11 r4842, 100 lines of CSV is sufficient to crash the application.
[28 Jan 2010 9:27]
David Merrill
I am experiencing the same problem; if I can provide any additional input, please let me know.
[6 Feb 2010 12:17]
Valeriy Kravchuk
Verified just as described using CREATE TABLE and Perl script provided.
[6 Feb 2010 12:18]
Valeriy Kravchuk
Crash information collcted by the OS
Attachment: bug49694.txt (text/plain), 39.08 KiB.
[9 Mar 2010 2:34]
Seth Willits
This bug isn't just in MySQL Workbench, this affects libmysqlclient period. I am seeing the same thing with the 5.1.35 C client library. Also on Mac OS X.
[14 Apr 2010 8:21]
Sergei Tkachenko
The bug #51583 is marked as duplicate of this one.
[21 May 2010 15:32]
david miner
Same problem with 5.2.21 OSS RC Rev 5918. Platform: Windows XP Script statement: LOAD DATA LOCAL INFILE 'C:/HD-P.dat' INTO TABLE application FIELDS TERMINATED BY '|' LINES TERMINATED BY '\r\n'; Workbench crashes without loading any data into the table.
[16 Jun 2010 13:29]
Alfredo Kojima
Set bug #54492 as duplicate
[16 Jun 2010 14:22]
Austin Kalb
So does "LOAD DATA LOCAL INFILE" ever work? Is there a work-around?
[16 Jun 2010 15:58]
Johannes Taxacher
Bug #54556 has been marked as duplicate of this one
[20 Jun 2010 20:38]
Alfredo Kojima
Marked bug #54632 as a duplicate
[21 Jun 2010 8:45]
Michael G. Zinner
[10:41] <stkachenko> Thread 13 Crashed: [10:41] <stkachenko> 0 libmysqlclient_r.16.0.0.dylib 0x010d4211 my_register_filename + 233 [10:42] <stkachenko> 1 libmysqlclient_r.16.0.0.dylib 0x010d42ac my_open + 83 [10:42] <stkachenko> 2 libmysqlclient_r.16.0.0.dylib 0x010cd38a default_local_infile_init + 145 [10:42] <stkachenko> 3 libmysqlclient_r.16.0.0.dylib 0x010d2431 handle_local_infile + 213 [10:42] <stkachenko> 4 libmysqlclient_r.16.0.0.dylib 0x010f8627 cli_read_query_result + 292 [10:42] <stkachenko> 5 libmysqlclient_r.16.0.0.dylib 0x010f64b0 mysql_real_query + 52 [10:42] <stkachenko> 6 mysqlcppconn.dylib 0x0052d1f2 sql::mysql::NativeAPI::MySQL_NativeConnectionWrapper::query(sql::SQLString const&) + 104 [10:42] <stkachenko> 7 mysqlcppconn.dylib 0x00525fcc sql::mysql::MySQL_Statement::do_query(char const*, unsigned long) + 140 [10:42] <stkachenko> 8 mysqlcppconn.dylib 0x005262b2 sql::mysql::MySQL_Statement::execute(sql::SQLString const&) + 56
[25 Jun 2010 4:39]
Georg Richter
I'm not able to reproduce this behaviour with Connector/C or libmysql. Can you please provide some more information about server version, connector version and if possible a small test program? I also like to know if the server crashed too. Thanks!
[25 Jun 2010 7:57]
Bogdan Degtyariov
Workbench 5.2.24 crashed for me even without data. Just put any file name for LOAD DATA query and observe it crashing. It seems that the server version does not matter. Trying debugging libmysql.dll, which is listed as module where the actual crash happened.
[25 Jun 2010 16:22]
Sergei Tkachenko
The key moment when trying to reproduce this bug is that query must be run in another thread (not main thread). On all 3 platforms (windows,linux,osx) trying to do so, reliably leads to crash somewhere in Connector/C.
[25 Jun 2010 16:23]
Sergei Tkachenko
Self sufficient project to reproduce this behavior can be accessed here: https://inside.mysql.com/mywiki/images/c/c8/Cppconn_test.zip It contains only windows build but should be easily ported.
[25 Jun 2010 16:32]
Sergei Tkachenko
Tried with following versions: MySQL Server v5.1.39 MySQL Connector/C v5.1.45. MySQL Connector/C++ corresponds to rev819 in the baseline branch.
[25 Jun 2010 16:35]
Sergei Tkachenko
And no, server didn't crash, only client.
[25 Jun 2010 21:09]
Georg Richter
Sorry guys, but this isn't really helpful. You set the bug category to Connector/C / ( or libmysql), so I expect that you will be able to deliver a reproducable testcase which clearly shows the problem is in Connector/C and not in the program or in Connector/C++ itself with a simple testcase. A crash in libmysql doesn't indicate that there is in error in libmysql, very often the underlying application is responsible for a possible crash.
[30 Jun 2010 4:05]
Valeriy Kravchuk
Bug #54904 was marked as a duplicate of this one.
[1 Jul 2010 13:26]
Georg Richter
Hi, the thread which executes the LOAD DATA statement doesn't call mysql_thread_init and mysql_thread_end (see http://dev.mysql.com/doc/refman/5.0/en/mysql-thread-init.html) and crashes therefore. -> Not a C/C bug.
[1 Jul 2010 14:14]
Ulf Wendel
Hi, this is rather a workbench/application/usage bug or a C/C++ feature request. The crash is caused by the wrong usage of the C API. The example will crash with C/C and with libmysql. The correct usage of the C API is well documented in the MySQL manual. Threaded applications using C/C++ must not share connections - or any other SQL objects - between threads. In the given example the LOAD DATA must not be run in its own thread. C/C++ is thread-agnostic: it does not know anything about threads. It does the mysql_library_ini() and mysql_init() C API calls for you, which in turn wrap down to mysql_thread_init(). But that is about it. However, when starting a new thread it is the duty of the application to call mysql_thread_init(). When the thread exists, it has to call mysql_thread_end(). See also, http://dev.mysql.com/doc/refman/5.1/en/c-thread-functions.html . C/C++ cannot call those functions for you implicitly. Applications must invoke them. Trouble is, the C/C++ API does not export those functions. You cannot call them. If you want those functions in the C/C++ API, you will have to file a feature request for C/C++. What can you do? Don't use threads ;-). Ok... Users of released Connector/C++ versions have pretty much no other option. Workbench is using a fork of C/C++ which gets synchronized with the C/C++ repository from time to time. Workbench can add Connection::threadInit(), Connection::threadEnd() calls to its C/C++ fork. This will allow WB to call the necessary C API functions upon the start and the end of the thread. There may be other ways - for the Workbench fork - to call the C API. You may be able to ignore the libmysql/C-API indirection level and call the C API directly. However, no promise on that. You may have some success using thread private connections. Again, no promise on that. Ulf
[13 Jul 2010 17:50]
Valeriy Kravchuk
Bug #55221 was marked as a duplicate of this one.
[14 Jul 2010 10:34]
Lawrenty Novitsky
Patch solving the problem on the c/c++ end has been pushed as rev#842 it allows to call mysql_thread_init and mysql_thread_end using Driver interface(threadInit and threadEnd methods respectively). Driver object is accessible through Connection via getDriver.
[14 Jul 2010 11:57]
Lawrenty Novitsky
yeah, already pushed in rev#844. sorry, forgot to add them
[19 Jul 2010 14:07]
Valeriy Kravchuk
Bug #55363 was marked as a duplicate of this one.
[27 Jul 2010 16:04]
Alfredo Kojima
Marked bug #53661 as duplicate
[29 Jul 2010 13:36]
Johannes Taxacher
fix confirmed in repository
[2 Aug 2010 16:48]
Tony Bedford
An entry has been added to the 5.2.26 changelog: MySQL Workbench crashed when executing LOAD DATA LOCAL INFILE as a query in the SQL Editor.
[2 Aug 2010 18:22]
Johannes Taxacher
Bug #55695 has been marked as duplicate of this one
[11 Aug 2010 17:38]
Prasad Subraveti
All, I ran into the same issue(LOAD DATA INFILE) with MySQL Workbench 5.2.25 CE (Revision 6303) on Windows XP SP 3 box. Ran the same line from my command line and it worked fine. So it is an issue with the MySQL Workbench and not the calls to C/C++ functions.