Segfault with LOAD DATA without default database

Segfault with LOAD DATA without default database

am 25.02.2003 21:10:02 von Stefan Hinz

Hi,

sorry to bother you again with a bug; here I go:

How-to-repeat:

C:\mysql\bin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26 to server version: 4.0.10-gamma-max-nt-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> LOAD DATA INFILE 'test' INTO TABLE test.t;
ERROR 2013: Lost connection to MySQL server during query
[server segfaulted at this point; I restarted it then with no problems
reported]
mysql> SELECT VERSION();
No connection. Trying to reconnect...
Connection id: 2
Current database: *** NONE ***
+-------------------------+
| VERSION() |
+-------------------------+
| 4.0.10-gamma-max-nt-log |
+-------------------------+

File 'test' does not exist anywhere on my system, but this cannot be
the cause of the segmentation fault.

The server doesn't write anything to the error log, it just dies.

And, once again, it's Win2K with SP2.

Regards,
--
Stefan Hinz
iConnect GmbH
Heesestr. 6, 12169 Berlin (Germany)
Telefon: +49 30 7970948-0 Fax: +49 30 7970948-3


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13839@lists.mysql.com
To unsubscribe, e-mail

Re: Segfault with LOAD DATA without default database

am 25.02.2003 21:49:53 von Sinisa Milivojevic

Stefan Hinz writes:
> Hi,
>
> sorry to bother you again with a bug; here I go:
>
> How-to-repeat:
>
> C:\mysql\bin>mysql
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 26 to server version: 4.0.10-gamma-max-nt-log
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> mysql> LOAD DATA INFILE 'test' INTO TABLE test.t;
> ERROR 2013: Lost connection to MySQL server during query
> [server segfaulted at this point; I restarted it then with no problems
> reported]
> mysql> SELECT VERSION();
> No connection. Trying to reconnect...
> Connection id: 2
> Current database: *** NONE ***
> +-------------------------+
> | VERSION() |
> +-------------------------+
> | 4.0.10-gamma-max-nt-log |
> +-------------------------+
>
> File 'test' does not exist anywhere on my system, but this cannot be
> the cause of the segmentation fault.
>
> The server doesn't write anything to the error log, it just dies.
>
> And, once again, it's Win2K with SP2.
>
> Regards,
> --
> Stefan Hinz
> iConnect GmbH
> Heesestr. 6, 12169 Berlin (Germany)
> Telefon: +49 30 7970948-0 Fax: +49 30 7970948-3
>

Thank you for your bug report.

This one was repeatable on Linux.

This is a patch:

===== sql/sql_load.cc 1.43 vs edited =====
*** /tmp/sql_load.cc-1.43-13225 Fri Feb 14 22:20:33 2003
--- edited/sql/sql_load.cc Tue Feb 25 22:47:09 2003
***************
*** 90,95 ****
--- 90,96 ----
bool is_fifo=0;
LOAD_FILE_INFO lf_info;
char * db = table_list->db ? table_list->db : thd->db;
+ char * tdb= thd->db ? thd->db : db;
bool transactional_table, log_delayed;
DBUG_ENTER("mysql_load");

***************
*** 168,177 ****
ex->file_name+=dirname_length(ex->file_name);
#endif
if (!dirname_length(ex->file_name) &&
! strlen(ex->file_name)+strlen(mysql_data_home)+strlen(thd->db )+3 <
FN_REFLEN)
{
! (void) sprintf(name,"%s/%s/%s",mysql_data_home,thd->db,ex->file_nam e);
unpack_filename(name,name); /* Convert to system format */
}
else
--- 169,178 ----
ex->file_name+=dirname_length(ex->file_name);
#endif
if (!dirname_length(ex->file_name) &&
! strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
FN_REFLEN)
{
! (void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
unpack_filename(name,name); /* Convert to system format */
}
else


--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com

Join MySQL Users Conference and Expo:
http://www.mysql.com/events/uc2003/


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13840@lists.mysql.com
To unsubscribe, e-mail