Bug #4046 using column type DECIMAL (0,11) will crash mysql
Submitted: 7 Jun 2004 23:47 Modified: 9 Jun 2004 22:04
Reporter: Allen Rice Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.21 and 4.1.3 OS:MacOS (osx windows xp pro linux)
Assigned to: Sergei Golubchik CPU Architecture:Any

[7 Jun 2004 23:47] Allen Rice
Description:
when executing a rather large CREATE TABLE statement, on the osx server running 4.0.18, it made both cpu processes goto 100% and the process had to be killed, i did not do this, bryan mcnabb my hosting provider / friend did (bryan.mcnabb@daytoncreative.net)

later on i tried the same query on his server again after he got it up, and it would say...
#2013 - Lost connection to MySQL server during query big create
(bryan tells me that he gave it 5 megs extra ram or something)

so i setup 4.1 real quick on my workstation, win xp pro, and when i ran the query through mysql cc, it killed the mysql process. 

The query i was running was to create a table and one table had the column type
DECIMAL (0,11)
after i took that out, it worked fine and wouldnt crash the server

another note, i tried adding the columns one by one, when it got to the decimal 0,11 column, just that column would yeild the same results (error #2013)
if i try this on mysql 4.1 running on the windows xp platform...

CREATE TABLE RawImport(
ImportID INT NOT NULL AUTO_INCREMENT ,
Latitude DECIMAL( 0, 11 ) ,
PRIMARY KEY ( ImportID ) 
) 

it crashes mysqld-nt

How to repeat:
run this query
http://www.allenrice.cjb.net/create.txt

or this

CREATE TABLE RawImport(
ImportID INT NOT NULL AUTO_INCREMENT ,
Latitude DECIMAL( 0, 11 ) ,
PRIMARY KEY ( ImportID ) 
) 

Suggested fix:
heh not a clue, for me i just changed it to varchar and viola, no more issues, and yes i know thats the easy way out :)
[8 Jun 2004 0:16] Dean Ellis
Verified against 4.0.21 and 4.1.3 in Linux.  Thank you for the report.

Note that this column definition is not, technically, useful.  With a precision of 0 you could not store any values in the column.
[8 Jun 2004 16:07] Oleksandr Byelkin
ChangeSet 
  1.1882 04/06/08 17:04:33 bell@sanja.is.com.ua +6 -0 
  wrong precision test (BUG#4046)
[9 Jun 2004 22:04] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

fixed in 4.0.21