server crashes creating tables with variables

server crashes creating tables with variables

am 12.12.2002 15:46:35 von Marek

Description:
Creating tables with variable names as field names server crashes.

How-To-Repeat:
mysql> select @something:="a";
+-----------------+
| @something:="a" |
+-----------------+
| a |
+-----------------+
1 row in set (0.06 sec)

mysql> create table newone select @something;
ERROR 2013: Lost connection to MySQL server during query

Fix:
if variable is numeric one can set query like "create table newone select
@something" to the form "create table newone select 1.0*@something" which
works, if variable is string one can write it in the form for example like
"create table newone select concat("",@something)"

Synopsis: may be software doesn't examine type of field while creating
table
using "select" syntax.
Submitter-Id:
Originator: Marek Woch
Organization:
MySQL support: none
Severity: non-critical
Priority: low
Category: mysqld
Class: sw-bug
Release: mysql-4.03 beta

Exectutable: mysqld-opt
Environment: Celeron 700, memory 196 Mb
System: Win98


--------------r-e-k-l-a-m-a-----------------

Masz dosc placenia prowizji bankowi ?
mBank - zaloz konto
http://epieniadze.onet.pl/mbank

------------------------------------------------------------ ---------
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-thread13265@lists.mysql.com
To unsubscribe, e-mail

Re: server crashes creating tables with variables

am 12.12.2002 16:16:43 von Sinisa Milivojevic

Marek writes:
> Description:
> Creating tables with variable names as field names server crashes.
>
> How-To-Repeat:
> mysql> select @something:="a";
> +-----------------+
> | @something:="a" |
> +-----------------+
> | a |
> +-----------------+
> 1 row in set (0.06 sec)
>
> mysql> create table newone select @something;
> ERROR 2013: Lost connection to MySQL server during query
>

Hi!

I just tested your report with 4.0.6 and it just worked find for me.

This is what I have done:

mysql> select @aa:1="aaaaaaaaaaaaa";
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ':1="aaaaaaaaaaaaa"' at line 1
mysql> select @aa1="aaaaaaaaaaaaa";
+----------------------+
| @aa1="aaaaaaaaaaaaa" |
+----------------------+
| NULL |
+----------------------+
1 row in set (0.07 sec)

mysql> create table xx select @aa;
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0

mysql> describe xx;
+-------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| @aa | mediumtext | YES | | NULL | |
+-------+------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> select * from xx;
+------+
| @aa |
+------+
| NULL |
+------+
1 row in set (0.00 sec)


--
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

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


------------------------------------------------------------ ---------
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-thread13266@lists.mysql.com
To unsubscribe, e-mail