Commit c1f11183 authored by unknown's avatar unknown
Browse files

information_schema.test:

  Added a comment line for a test case used for bug #12301.
information_schema.result:
  Fixed some test cases results (bug #12301).
sql_show.cc:
  Fixed bug #12301.
  The bug was due to a missing value setting for the NUMERIC_SCALE column
   in the get_schema_column_record() function (sql_show.cc).


sql/sql_show.cc:
  Fixed bug #12301.
  The bug was due to a missing value setting for the NUMERIC_SCALE column
   in the get_schema_column_record() function (sql_show.cc).
mysql-test/r/information_schema.result:
  Fixed some test cases results (bug #12301).
mysql-test/t/information_schema.test:
  Added a comment line for a test case used for bug #12301.
parent 107f7482
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME	ORDINAL_POSITION	COLUMN_DEFAULT	IS_NULLABLE	DATA_TYPE	CHARACTER_MAXIMUM_LENGTH	CHARACTER_OCTET_LENGTH	NUMERIC_PRECISION	NUMERIC_SCALE	CHARACTER_SET_NAME	COLLATION_NAME	COLUMN_TYPE	COLUMN_KEY	EXTRA	PRIVILEGES	COLUMN_COMMENT
NULL	mysqltest	t1	a	1	NULL	YES	int	NULL	NULL	10	NULL	NULL	NULL	int(11)			select,insert,update,references	
NULL	mysqltest	t1	a	1	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
show columns from mysqltest.t1 where field like "%a%";
Field	Type	Null	Key	Default	Extra
a	int(11)	YES		NULL	
@@ -535,7 +535,7 @@ c float(5,2) NULL NULL 5 2
d	decimal(6,4)	NULL	NULL	6	4
e	float	NULL	NULL	12	NULL
f	decimal(6,3)	NULL	NULL	6	3
g	int(11)	NULL	NULL	10	NULL
g	int(11)	NULL	NULL	10	0
h	double(10,3)	NULL	NULL	10	3
i	double	NULL	NULL	22	NULL
drop table t1;
@@ -941,11 +941,11 @@ select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
from information_schema.columns
where table_name='t1';
column_name	NUMERIC_PRECISION	NUMERIC_SCALE
f1	3	NULL
f2	5	NULL
f3	7	NULL
f4	10	NULL
f5	19	NULL
f1	3	0
f2	5	0
f3	7	0
f4	10	0
f5	19	0
f6	1	NULL
f7	64	NULL
drop table t1;
+1 −0
Original line number Diff line number Diff line
@@ -615,6 +615,7 @@ show create database information_schema;

#
# Bug #11057 information_schema: columns table has some questionable contents
# Bug #12301 information_schema: NUMERIC_SCALE must be 0 for integer columns
#
create table t1(f1 LONGBLOB, f2 LONGTEXT);
select column_name,data_type,CHARACTER_OCTET_LENGTH,
+2 −0
Original line number Diff line number Diff line
@@ -2513,6 +2513,8 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
        {
          table->field[10]->store((longlong) field->max_length() - 1);
          table->field[10]->set_notnull();
          table->field[11]->store((longlong) 0);
          table->field[11]->set_notnull();
          break;
        }
        case FIELD_TYPE_BIT: