List:Internals« Previous MessageNext Message »
From:eugene Date:June 28 2005 12:32am
Subject:bk commit into 5.0 tree (evgen:1.2006) BUG#11335
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2006 05/06/28 02:32:33 evgen@stripped +4 -0
  Fix bug #11335 View redefines TinyInt(1) column definition
  
  Field_tiny::max_length() was always returned 4 which results in showing
  wrong field length.
  
  Metadata test was creating table with tinyint(3) field, but in old result
  length was wrongly displayed as 4.

  mysql-test/r/metadata.result
    1.12 05/06/28 02:23:41 evgen@stripped +1 -1
     Fix for metadata test result. True length is 3, not 4.

  mysql-test/r/view.result
    1.86 05/06/28 02:21:33 evgen@stripped +7 -0
    Test case for bug#11335 View redefines TinyInt(1) column definition

  mysql-test/t/view.test
    1.74 05/06/28 02:20:58 evgen@stripped +9 -0
    Test case for bug#11335 View redefines TinyInt(1) column definition

  sql/field.h
    1.163 05/06/28 02:20:07 evgen@stripped +1 -1
    Fix bug#11335 View redefines TinyInt(1) column definition

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	evgen
# Host:	moonbone.local
# Root:	/work/mysql-5.0-bug-11335

--- 1.162/sql/field.h	2005-06-21 00:28:17 +04:00
+++ 1.163/sql/field.h	2005-06-28 02:20:07 +04:00
@@ -506,7 +506,7 @@
   void sort_string(char *buff,uint length);
   uint32 pack_length() const { return 1; }
   void sql_type(String &str) const;
-  uint32 max_length() { return 4; }
+  uint32 max_length() { return field_length<4?field_length:4; }
 };
 
 

--- 1.85/mysql-test/r/view.result	2005-06-22 09:52:02 +04:00
+++ 1.86/mysql-test/r/view.result	2005-06-28 02:21:33 +04:00
@@ -1831,3 +1831,10 @@
 t
 01:00
 drop view v1;
+create table t1 (id tinyint(1));
+create view v1 as select * from t1;
+desc v1;
+Field	Type	Null	Key	Default	Extra
+id	tinyint(1)	YES		NULL	
+drop view v1;
+drop table t1;

--- 1.73/mysql-test/t/view.test	2005-06-22 09:42:00 +04:00
+++ 1.74/mysql-test/t/view.test	2005-06-28 02:20:58 +04:00
@@ -1673,3 +1673,12 @@
 create view v1 as SELECT TIME_FORMAT(SEC_TO_TIME(3600),'%H:%i') as t;
 select * from v1;
 drop view v1;
+
+#
+# Bug #11335 View redefines TinyInt(1) column definition
+#
+create table t1 (id tinyint(1));
+create view v1 as select * from t1;
+desc v1;
+drop view v1;
+drop table t1; 

--- 1.11/mysql-test/r/metadata.result	2005-05-06 00:01:34 +04:00
+++ 1.12/mysql-test/r/metadata.result	2005-06-28 02:23:41 +04:00
@@ -55,7 +55,7 @@
 2	female	no
 select t1.id from t1 union select t2.id from t2;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max
length	Is_null	Flags	Decimals	Charsetnr
-def				id	id	1	4	1	Y	32768	0	63
+def				id	id	1	3	1	Y	32768	0	63
 id
 1
 2
Thread
bk commit into 5.0 tree (evgen:1.2006) BUG#11335eugene27 Jun