mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug21618/my50-bug21618
into zippy.cornsilk.net:/home/cmiller/work/mysql/bug21618/my51-bug21618
This commit is contained in:
@ -2301,10 +2301,8 @@ print_table_data(MYSQL_RES *result)
|
|||||||
MYSQL_ROW cur;
|
MYSQL_ROW cur;
|
||||||
MYSQL_FIELD *field;
|
MYSQL_FIELD *field;
|
||||||
bool *num_flag;
|
bool *num_flag;
|
||||||
bool *not_null_flag;
|
|
||||||
|
|
||||||
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
|
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
|
||||||
not_null_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
|
|
||||||
if (info_flag)
|
if (info_flag)
|
||||||
{
|
{
|
||||||
print_field_types(result);
|
print_field_types(result);
|
||||||
@ -2343,7 +2341,6 @@ print_table_data(MYSQL_RES *result)
|
|||||||
MAX_COLUMN_LENGTH),
|
MAX_COLUMN_LENGTH),
|
||||||
field->name);
|
field->name);
|
||||||
num_flag[off]= IS_NUM(field->type);
|
num_flag[off]= IS_NUM(field->type);
|
||||||
not_null_flag[off]= IS_NOT_NULL(field->flags);
|
|
||||||
}
|
}
|
||||||
(void) tee_fputs("\n", PAGER);
|
(void) tee_fputs("\n", PAGER);
|
||||||
tee_puts((char*) separator.ptr(), PAGER);
|
tee_puts((char*) separator.ptr(), PAGER);
|
||||||
@ -2364,7 +2361,7 @@ print_table_data(MYSQL_RES *result)
|
|||||||
uint visible_length;
|
uint visible_length;
|
||||||
uint extra_padding;
|
uint extra_padding;
|
||||||
|
|
||||||
if (! not_null_flag[off] && (cur[off] == NULL))
|
if (cur[off] == NULL)
|
||||||
{
|
{
|
||||||
buffer= "NULL";
|
buffer= "NULL";
|
||||||
data_length= 4;
|
data_length= 4;
|
||||||
@ -2404,7 +2401,6 @@ print_table_data(MYSQL_RES *result)
|
|||||||
}
|
}
|
||||||
tee_puts((char*) separator.ptr(), PAGER);
|
tee_puts((char*) separator.ptr(), PAGER);
|
||||||
my_afree((gptr) num_flag);
|
my_afree((gptr) num_flag);
|
||||||
my_afree((gptr) not_null_flag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,6 +85,12 @@ c_cp932
|
|||||||
| NULL | NULL | Τη γλώσσα |
|
| NULL | NULL | Τη γλώσσα |
|
||||||
| NULL | NULL | ᛖᚴ ᚷᛖᛏ |
|
| NULL | NULL | ᛖᚴ ᚷᛖᛏ |
|
||||||
+------+------+---------------------------+
|
+------+------+---------------------------+
|
||||||
|
i j k
|
||||||
|
NULL 1 NULL
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
i int(11) YES NULL
|
||||||
|
j int(11) NO
|
||||||
|
k int(11) YES NULL
|
||||||
+------+---+------+
|
+------+---+------+
|
||||||
| i | j | k |
|
| i | j | k |
|
||||||
+------+---+------+
|
+------+---+------+
|
||||||
@ -97,6 +103,10 @@ c_cp932
|
|||||||
| j | int(11) | NO | | | |
|
| j | int(11) | NO | | | |
|
||||||
| k | int(11) | YES | | NULL | |
|
| k | int(11) | YES | | NULL | |
|
||||||
+-------+---------+------+-----+---------+-------+
|
+-------+---------+------+-----+---------+-------+
|
||||||
|
i s1
|
||||||
|
1 x
|
||||||
|
2 NULL
|
||||||
|
3
|
||||||
+------+------+
|
+------+------+
|
||||||
| i | s1 |
|
| i | s1 |
|
||||||
+------+------+
|
+------+------+
|
||||||
@ -104,6 +114,13 @@ c_cp932
|
|||||||
| 2 | NULL |
|
| 2 | NULL |
|
||||||
| 3 | |
|
| 3 | |
|
||||||
+------+------+
|
+------+------+
|
||||||
|
unhex('zz')
|
||||||
|
NULL
|
||||||
|
+-------------+
|
||||||
|
| unhex('zz') |
|
||||||
|
+-------------+
|
||||||
|
| NULL |
|
||||||
|
+-------------+
|
||||||
create table t1(a int, b varchar(255), c int);
|
create table t1(a int, b varchar(255), c int);
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
a int(11) YES NULL
|
a int(11) YES NULL
|
||||||
|
@ -70,13 +70,21 @@ drop table t1;
|
|||||||
#
|
#
|
||||||
# "DESCRIBE" commands may return strange NULLness flags.
|
# "DESCRIBE" commands may return strange NULLness flags.
|
||||||
#
|
#
|
||||||
|
--exec $MYSQL --default-character-set utf8 test -e "create table t1 (i int, j int not null, k int); insert into t1 values (null, 1, null); select * from t1; describe t1; drop table t1;"
|
||||||
--exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int not null, k int); insert into t1 values (null, 1, null); select * from t1; describe t1; drop table t1;"
|
--exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int not null, k int); insert into t1 values (null, 1, null); select * from t1; describe t1; drop table t1;"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#19564: mysql displays NULL instead of space
|
# Bug#19564: mysql displays NULL instead of space
|
||||||
#
|
#
|
||||||
|
--exec $MYSQL test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;"
|
||||||
--exec $MYSQL -t test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;"
|
--exec $MYSQL -t test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#21618: NULL shown as empty string in client
|
||||||
|
#
|
||||||
|
--exec $MYSQL test -e "select unhex('zz');"
|
||||||
|
--exec $MYSQL -t test -e "select unhex('zz');"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#19265 describe command does not work from mysql prompt
|
# Bug#19265 describe command does not work from mysql prompt
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user