Bug #10569 CREATE INDEX cause confusing warnings
Submitted: 12 May 2005 7:03 Modified: 12 May 2005 12:28
Reporter: Disha Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.5-beta-nt OS:Windows (Windows xp)
Assigned to: CPU Architecture:Any

[12 May 2005 7:03] Disha
Description:
 I have created table and does not contain any data but still 'CREATE INDEX' is giving confusing warning.

if you check any column for create index it is showing warngs.

How to repeat:
A) execute the following command.
	delimiter //
	Set @@sql_mode='traditional'//
	create table t1 (
	f176 numeric (0) unsigned not null DEFAULT 9, 
	f177 numeric (64) unsigned not null DEFAULT 9, 
	f178 numeric (0) zerofill not null DEFAULT 9, 
	f179 numeric (64) zerofill not null DEFAULT 9, 
	f180 numeric (0) unsigned zerofill not null DEFAULT 9, 
	f181 numeric (64) unsigned zerofill not null DEFAULT 9, 
	f182 numeric (0,0) not null DEFAULT 9, 
	f183 numeric (63,63) not null DEFAULT 9, 
	f184 numeric (0,0) unsigned not null DEFAULT 9, 
	f185 numeric (63,63) unsigned not null DEFAULT 9, 
	f186 numeric (0,0) zerofill not null DEFAULT 9, 
	f187 numeric (63,63) zerofill not null DEFAULT 9, 
	f188 numeric (0,0) unsigned zerofill not null DEFAULT 9, 
	f189 numeric (63,63) unsigned zerofill not null DEFAULT 9, 
	f190 real not null DEFAULT 88.8, 
	f191 real unsigned not null DEFAULT 88.8, 
	f192 real zerofill not null DEFAULT 88.8, 
	f193 real unsigned zerofill not null DEFAULT 88.8, 
	f194 double not null DEFAULT 55.5, 
	f195 double unsigned not null DEFAULT 55.5, 
	f196 double zerofill not null DEFAULT 55.5, 
	f197 double unsigned zerofill not null DEFAULT 55.5, 
	f198 float, 
	f199 float unsigned, 
	f200 float zerofill, 
	f201 float unsigned zerofill, 
	f202 float(0), 
	f203 float(23), 
	f204 float(0) unsigned, 
	f205 float(23) unsigned, 
	f206 float(0) zerofill, 
	f207 float(23) zerofill, 
	f208 float(0) unsigned zerofill, 
	f209 float(23) unsigned zerofill, 
	f210 float(24), 
	f211 float(53), 
	f212 float(24) unsigned, 
	f213 float(53) unsigned, 
	f214 float(24) zerofill, 
	f215 float(53) zerofill, 
	f216 float(24) unsigned zerofill, 
	f217 float(53) unsigned zerofill, 
	f218 date, 
	f219 time, 
	f220 datetime, 
	f221 timestamp, 
	f222 year, 
	f223 year(3), 
	f224 year(4), 
	f225 enum("1enum","2enum"), 
	f226 set("1set","2set"),
	f236 char(95) unicode,
	f241 char(255) unicode,
	f237 char(130) binary,
	f238 varchar(2500) binary,
	f239 varbinary(0),
	f240 varchar(120) unicode
	) engine = Memory//

	create index i_f238 using hash on t1(f238)//

	show warnings//

 
B) Expected Result: Sucessful index without any warnings
   

C) Actual Result: 	
+---------+------+----------------------------------------------------------------------------+
| Level   | Code | Message                                                                    |
+---------+------+----------------------------------------------------------------------------+
| Warning | 1071 | Specified key was too long; max key length is 255 bytes                    |
| Warning | 1292 | Incorrect datetime value: '0000-00-00 00:00:00' for column 'f221' at row 1 |
+---------+------+----------------------------------------------------------------------------+
2 rows in set (0.00 sec)
[12 May 2005 7:17] Hartmut Holzgraefe
I only get the first warning with latest 5.0bk on linux, 
and this one is expected given that the field length of the
colum to be indexed is 2500.

The 2nd warning might have been left over from a previous command?
[12 May 2005 10:41] MySQL Verification Team
With source:
ChangeSet@1.1938, 2005-05-10 16:41:47-07:00, igor@rurik.mysql.com
  Manual merge
both Linux and Windows I got:

mysql> create index i_f238 using hash on t1(f238)//
ERROR 1067 (42000): Invalid default value for 'f221'

Not showing warnings.
[12 May 2005 11:52] Disha
Can you check with @@sql_mode='tradition' and @@sql_mode='' in both the environment index the column f198.

In 'traditional' mode it's doesn't create index but in @sql_mode='' it does not show warnings.
[12 May 2005 12:28] MySQL Verification Team
I got same error message for both.