List:Commits« Previous MessageNext Message »
From:ahristov Date:October 23 2006 2:30pm
Subject:bk commit into 5.1 tree (andrey:1.2325)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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@stripped, 2006-10-23 14:29:11+02:00, andrey@stripped +3 -0
  Merge example.com:/work/bug23037/my50
  into  example.com:/work/bug23037/my51
  MERGE: 1.1810.2216.3

  mysql-test/r/information_schema.result@stripped, 2006-10-23 14:29:03+02:00,
andrey@stripped +0 -1
    manual merge
    MERGE: 1.87.1.28

  mysql-test/t/information_schema.test@stripped, 2006-10-23 14:29:03+02:00, andrey@stripped
+0 -4
    manual merge
    MERGE: 1.65.1.21

  sql/sql_show.cc@stripped, 2006-10-23 14:22:32+02:00, andrey@stripped +0 -0
    Auto merged
    MERGE: 1.253.38.1

# 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:	andrey
# Host:	example.com
# Root:	/work/bug23037/my51/RESYNC

--- 1.368/sql/sql_show.cc	2006-10-23 14:30:00 +02:00
+++ 1.369/sql/sql_show.cc	2006-10-23 14:30:00 +02:00
@@ -5247,7 +5247,7 @@ ST_FIELD_INFO columns_fields_info[]=
   {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
   {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"},
   {"ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 0, 0},
-  {"COLUMN_DEFAULT", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Default"},
+  {"COLUMN_DEFAULT", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0, 1, "Default"},
   {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"},
   {"DATA_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
   {"CHARACTER_MAXIMUM_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, 0},

--- 1.135/mysql-test/r/information_schema.result	2006-10-23 14:30:00 +02:00
+++ 1.136/mysql-test/r/information_schema.result	2006-10-23 14:30:00 +02:00
@@ -1315,6 +1315,19 @@ WHERE table_name=(SELECT MAX(table_name)
 FROM information_schema.tables);
 table_name
 VIEWS
+DROP TABLE IF EXISTS bug23037;
+DROP FUNCTION IF EXISTS get_value;
+SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT) FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
+COLUMN_NAME	MD5(COLUMN_DEFAULT)	LENGTH(COLUMN_DEFAULT)
+fld1	7cf7a6782be951a1f2464a350da926a5	65532
+SELECT MD5(get_value());
+MD5(get_value())
+7cf7a6782be951a1f2464a350da926a5
+SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT),
COLUMN_DEFAULT=get_value() FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
+COLUMN_NAME	MD5(COLUMN_DEFAULT)	LENGTH(COLUMN_DEFAULT)	COLUMN_DEFAULT=get_value()
+fld1	7cf7a6782be951a1f2464a350da926a5	65532	1
+DROP TABLE bug23037;
+DROP FUNCTION get_value;
 End of 5.0 tests.
 select * from information_schema.engines WHERE ENGINE="MyISAM";
 ENGINE	SUPPORT	COMMENT	TRANSACTIONS	XA	SAVEPOINTS

--- 1.86/mysql-test/t/information_schema.test	2006-10-23 14:30:00 +02:00
+++ 1.87/mysql-test/t/information_schema.test	2006-10-23 14:30:00 +02:00
@@ -934,7 +934,46 @@ SELECT MAX(table_name) FROM information_
 SELECT table_name from information_schema.tables
   WHERE table_name=(SELECT MAX(table_name)
                       FROM information_schema.tables);
+#
+# Bug #23037: Bug in field "Default" of query "SHOW COLUMNS FROM table"
+#
+# Note, MyISAM/InnoDB can't take more that 65532 chars, because the row
+# size is limited to 65535 bytes (BLOBs not counted)
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug23037;
+DROP FUNCTION IF EXISTS get_value;
+--enable_warnings
+--disable_query_log
+DELIMITER |;
+CREATE FUNCTION get_value()
+  RETURNS TEXT
+  DETERMINISTIC
+BEGIN
+  DECLARE col1, col2, col3, col4, col6 CHAR(255);
+  DECLARE default_val VARCHAR(65532);
+  DECLARE done INT DEFAULT 0;
+  DECLARE cur1 CURSOR FOR SHOW COLUMNS FROM bug23037;
+  DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+  OPEN cur1;
+  FETCH cur1 INTO col1, col2, col3, col4, default_val, col6;
+  CLOSE cur1;
+  RETURN default_val;
+end|
+DELIMITER ;|
 
+let $body=`SELECT REPEAT('A', 65532)`;
+eval CREATE TABLE bug23037(fld1 VARCHAR(65532) CHARACTER SET latin1 DEFAULT "$body");
+--enable_query_log
+
+SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT) FROM
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
+
+SELECT MD5(get_value());
+
+SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT),
COLUMN_DEFAULT=get_value() FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='bug23037';
+
+DROP TABLE bug23037;
+DROP FUNCTION get_value;
 --echo End of 5.0 tests.
 #
 # Show engines
Thread
bk commit into 5.1 tree (andrey:1.2325)ahristov23 Oct