Commit 831e2c7f authored by unknown's avatar unknown
Browse files

Bug #7142 Show Fields from fails using Borland's dbExpress interface

The problem here is that columns that have an especially long type 
such as an enum type with many options would be longer than 40 chars
but the type column returned from show columns always was defined
as varchar(40).

This is fixed in 5.0 using info schema.


mysql-test/r/ps_1general.result:
  update columns which will now be reported as blobs
mysql-test/r/ps_2myisam.result:
  update columns which will now be reported as blobs
mysql-test/r/ps_3innodb.result:
  update columns which will now be reported as blobs
mysql-test/r/ps_4heap.result:
  update columns which will now be reported as blobs
mysql-test/r/ps_5merge.result:
  update columns which will now be reported as blobs
sql/item.cc:
  report a column as a particular blob type if it's size warrants
sql/sql_show.cc:
  Add function to iterate over all the fields of a table and determine 
  the longest type name.
  
  We call this function at the top of our show fields code.  We pass in 
  either 40 or max_len whichever is longer to the ctor of
  Item_empty_string.
tests/mysql_client_test.c:
  update columns which will now be reported as blobs
parent 8e9492f0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -470,12 +470,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	14	N	1	31	8
def					Extra	252	255	14	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	4	Using filesort
SET @arg00=1 ;
@@ -486,12 +486,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	5	Y	0	31	8
def					possible_keys	253	4096	7	Y	0	31	8
def					possible_keys	252	4096	7	Y	0	31	8
def					key	253	64	7	Y	0	31	8
def					key_len	8	3	1	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	27	N	1	31	8
def					Extra	252	255	27	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	3	Using where; Using filesort
drop table if exists t2;
+3 −3
Original line number Diff line number Diff line
@@ -1153,12 +1153,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	0	N	1	31	8
def					Extra	252	255	0	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
drop table if exists t2 ;
+3 −3
Original line number Diff line number Diff line
@@ -1153,12 +1153,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	0	N	1	31	8
def					Extra	252	255	0	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
test_sequence
+3 −3
Original line number Diff line number Diff line
@@ -1154,12 +1154,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	0	N	1	31	8
def					Extra	252	255	0	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
test_sequence
+6 −6
Original line number Diff line number Diff line
@@ -1196,12 +1196,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	0	N	1	31	8
def					Extra	252	255	0	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
test_sequence
@@ -4210,12 +4210,12 @@ def id 8 3 1 N 32929 0 63
def					select_type	253	19	6	N	1	31	8
def					table	253	64	2	Y	0	31	8
def					type	253	10	3	Y	0	31	8
def					possible_keys	253	4096	0	Y	0	31	8
def					possible_keys	252	4096	0	Y	0	31	8
def					key	253	64	0	Y	0	31	8
def					key_len	8	3	0	Y	32928	0	63
def					ref	253	1024	0	Y	0	31	8
def					ref	252	1024	0	Y	0	31	8
def					rows	8	10	1	Y	32928	0	63
def					Extra	253	255	0	N	1	31	8
def					Extra	252	255	0	N	1	31	8
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
test_sequence
Loading