Commit f0f0e628 authored by unknown's avatar unknown
Browse files

Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-5.0

into hundin.mysql.fi:/home/jan/new/mysql-5.0

parents d518f871 c04ac3c5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -661,6 +661,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define UINT_MAX16      0xFFFF
#define INT_MIN8        (~0x7F)
#define INT_MAX8        0x7F
#define UINT_MAX8       0xFF

/* From limits.h instead */
#ifndef DBL_MIN
+11 −11
Original line number Diff line number Diff line
@@ -3442,7 +3442,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
    longlong data= my_strntoll(&my_charset_latin1, value, length, 10,
                                 &endptr, &err);
    *param->error= (IS_TRUNCATED(data, param->is_unsigned,
                                 INT8_MIN, INT8_MAX, UINT8_MAX) |
                                 INT_MIN8, INT_MAX8, UINT_MAX8) |
                    test(err));
    *buffer= (uchar) data;
    break;
@@ -3452,7 +3452,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
    longlong data= my_strntoll(&my_charset_latin1, value, length, 10,
                               &endptr, &err);
    *param->error= (IS_TRUNCATED(data, param->is_unsigned,
                                 INT16_MIN, INT16_MAX, UINT16_MAX) |
                                 INT_MIN16, INT_MAX16, UINT_MAX16) |
                    test(err));
    shortstore(buffer, (short) data);
    break;
@@ -3462,7 +3462,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
    longlong data= my_strntoll(&my_charset_latin1, value, length, 10,
                               &endptr, &err);
    *param->error= (IS_TRUNCATED(data, param->is_unsigned,
                                 INT32_MIN, INT32_MAX, UINT32_MAX) |
                                 INT_MIN32, INT_MAX32, UINT_MAX32) |
                    test(err));
    longstore(buffer, (int32) data);
    break;
@@ -3564,17 +3564,17 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
    break;
  case MYSQL_TYPE_TINY:
    *param->error= IS_TRUNCATED(value, param->is_unsigned,
                                INT8_MIN, INT8_MAX, UINT8_MAX);
                                INT_MIN8, INT_MAX8, UINT_MAX8);
    *(uchar *)param->buffer= (uchar) value;
    break;
  case MYSQL_TYPE_SHORT:
    *param->error= IS_TRUNCATED(value, param->is_unsigned,
                                INT16_MIN, INT16_MAX, UINT16_MAX);
                                INT_MIN16, INT_MAX16, UINT_MAX16);
    shortstore(buffer, (short) value);
    break;
  case MYSQL_TYPE_LONG:
    *param->error= IS_TRUNCATED(value, param->is_unsigned,
                                INT32_MIN, INT32_MAX, UINT32_MAX);
                                INT_MIN32, INT_MAX32, UINT_MAX32);
    longstore(buffer, (int32) value);
    break;
  case MYSQL_TYPE_LONGLONG:
@@ -3978,7 +3978,7 @@ static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field,
  my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
  uchar data= **row;
  *(uchar *)param->buffer= data;
  *param->error= param->is_unsigned != field_is_unsigned && data > INT8_MAX;
  *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX8;
  (*row)++;
}

@@ -3988,7 +3988,7 @@ static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field,
  my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
  ushort data= (ushort) sint2korr(*row);
  shortstore(param->buffer, data);
  *param->error= param->is_unsigned != field_is_unsigned && data > INT16_MAX;
  *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX16;
  *row+= 2;
}

@@ -3999,7 +3999,7 @@ static void fetch_result_int32(MYSQL_BIND *param,
  my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
  uint32 data= (uint32) sint4korr(*row);
  longstore(param->buffer, data);
  *param->error= param->is_unsigned != field_is_unsigned && data > INT32_MAX;
  *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX32;
  *row+= 4;
}

@@ -4009,7 +4009,7 @@ static void fetch_result_int64(MYSQL_BIND *param,
{
  my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
  ulonglong data= (ulonglong) sint8korr(*row);
  *param->error= param->is_unsigned != field_is_unsigned && data > INT64_MAX;
  *param->error= param->is_unsigned != field_is_unsigned && data > LONGLONG_MAX;
  longlongstore(param->buffer, data);
  *row+= 8;
}
@@ -4149,7 +4149,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1,
                MYSQL_TYPE_DECIMAL, 0 },
   *range_list[]= { range1, range2, range3, range4 },
   **range_list_end= range_list + sizeof(range_list)/sizeof(*range_list);
   enum enum_field_types **range, *type;
   const enum enum_field_types **range, *type;

  if (type1 == type2)
    return TRUE;
+37 −0
Original line number Diff line number Diff line
@@ -590,3 +590,40 @@ TABLES
TABLE_PRIVILEGES
TABLE_CONSTRAINTS
TABLE_NAMES
use test;
create function sub1(i int) returns int
return i+1;
create table t1(f1 int);
create view t2 (c) as select f1 from t1;
create view t3 (c) as select sub1(1);
create table t4(f1 int, KEY f1_key (f1));
drop table t1;
drop function sub1;
select table_name from information_schema.views
where table_schema='test';
table_name
Warnings:
Warning	1356	View 'test.t2' references invalid table(s) or column(s) or function(s)
Warning	1356	View 'test.t3' references invalid table(s) or column(s) or function(s)
select table_name from information_schema.views
where table_schema='test';
table_name
Warnings:
Warning	1356	View 'test.t2' references invalid table(s) or column(s) or function(s)
Warning	1356	View 'test.t3' references invalid table(s) or column(s) or function(s)
select column_name from information_schema.columns
where table_schema='test';
column_name
f1
Warnings:
Warning	1356	View 'test.t2' references invalid table(s) or column(s) or function(s)
Warning	1356	View 'test.t3' references invalid table(s) or column(s) or function(s)
select index_name from information_schema.statistics where table_schema='test';
index_name
f1_key
select constraint_name from information_schema.table_constraints
where table_schema='test';
constraint_name
drop view t2;
drop view t3;
drop table t4;
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ set GLOBAL init_connect=DEFAULT;
select @a;
@a
NULL
set global init_connect="create table t1(a char(10));\
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
select hex(a) from t1;
hex(a)
+5 −5
Original line number Diff line number Diff line
@@ -983,10 +983,10 @@ create view v1 as select * from t1;
drop table t1;
create table t1 (col1 char(5),newcol2 char(5));
insert into v1 values('a','aa');
ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
drop table t1;
select * from v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
@@ -1217,11 +1217,11 @@ create table t1 (s1 int);
create view v1 as select x1() from t1;
drop function x1;
select * from v1;
ERROR 42000: FUNCTION test.x1 does not exist
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	MyISAM	9	Fixed	0	0	0	21474836479	1024	0	NULL	#	#	NULL	latin1_swedish_ci	NULL		
v1	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	#	#	NULL	NULL	NULL	NULL	FUNCTION test.x1 does not exist
v1	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	#	#	NULL	NULL	NULL	NULL	View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
@@ -1655,7 +1655,7 @@ test.t1 check status OK
drop table t1;
check table v1;
Table	Op	Msg_type	Msg_text
test.v1	check	error	View 'test.v1' references invalid table(s) or column(s)
test.v1	check	error	View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
create table t1 (a int);
create table t2 (a int);
Loading