Commit 7220e48d authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/jonas/src/mysql-5.0

into mysql.com:/home/jonas/src/mysql-5.0-ndb


sql/item.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents cafae817 5630f073
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3656,7 +3656,6 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
  }
}


/*
  Convert double/float column to supplied buffer of any type.

@@ -3673,6 +3672,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
                                        double value, int width)
{
  char *buffer= (char *)param->buffer;
  double val64 = (value < 0 ? -floor(-value) : floor(value));

  switch (param->buffer_type) {
  case MYSQL_TYPE_NULL: /* do nothing */
@@ -3688,7 +3688,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
      *buffer= (uint8) value;
    else
      *buffer= (int8) value;
    *param->error= value != (param->is_unsigned ? (double) ((uint8) *buffer) :
    *param->error= val64 != (param->is_unsigned ? (double)((uint8) *buffer) :
                                                  (double)((int8) *buffer));
    break;
  case MYSQL_TYPE_SHORT:
@@ -3702,7 +3702,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
      short data= (short) value;
      shortstore(buffer, data);
    }
    *param->error= value != (param->is_unsigned ? (double) (*(ushort*) buffer):
    *param->error= val64 != (param->is_unsigned ? (double) (*(ushort*) buffer):
                                                  (double) (*(short*) buffer));
    break;
  case MYSQL_TYPE_LONG:
@@ -3716,7 +3716,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
      int32 data= (int32) value;
      longstore(buffer, data);
    }
    *param->error= value != (param->is_unsigned ? (double) (*(uint32*) buffer):
    *param->error= val64 != (param->is_unsigned ? (double) (*(uint32*) buffer):
                                                  (double) (*(int32*) buffer));
      break;
  case MYSQL_TYPE_LONGLONG:
@@ -3730,7 +3730,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
      longlong data= (longlong) value;
      longlongstore(buffer, data);
    }
    *param->error= value != (param->is_unsigned ?
    *param->error= val64 != (param->is_unsigned ?
                             ulonglong2double(*(ulonglong*) buffer) :
                             (double) (*(longlong*) buffer));
    break;
+13 −0
Original line number Diff line number Diff line
@@ -535,6 +535,19 @@ s2 CHAR(5) COLLATE latin1_swedish_ci);
SELECT * FROM t1 WHERE s1 = s2;
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='
DROP TABLE t1;
CREATE TABLE t1
(s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci,
s3 CHAR(5) COLLATE latin1_bin);
INSERT INTO t1 VALUES ('a','A','A');
SELECT * FROM t1 WHERE s1 = s2;
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='
SELECT * FROM t1 WHERE s1 = s3;
s1	s2	s3
SELECT * FROM t1 WHERE s2 = s3;
s1	s2	s3
a	A	A
DROP TABLE t1;
SET NAMES latin1;
CREATE TABLE t1 
(s1 char(10) COLLATE latin1_german1_ci,
+15 −0
Original line number Diff line number Diff line
@@ -37,3 +37,18 @@ show create database test;
Database	Create Database
test	CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
create table t1 (a int) engine=innodb;
reset master;
set autocommit=0;
insert t1 values (1);
flush tables with read lock;
show master status;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000001	98		
 commit;
show master status;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000001	98		
unlock tables;
drop table t1;
set autocommit=1;
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ a b
4	4
drop table t1;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
insert into t1 values (869751),(736494),(226312),(802616),(728912);
select * from t1 where a > 736494;
a
869751
@@ -66,7 +66,7 @@ a
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	uniq_id	uniq_id	4	NULL	4	Using where; Using index
1	SIMPLE	t1	range	uniq_id	uniq_id	4	NULL	4	Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x (x), unique y (y))
engine=heap;
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ a b
4	4
drop table t1;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
insert into t1 values (869751),(736494),(226312),(802616),(728912);
select * from t1 where a > 736494;
a
869751
@@ -66,7 +66,7 @@ a
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	uniq_id	uniq_id	4	NULL	4	Using where; Using index
1	SIMPLE	t1	range	uniq_id	uniq_id	4	NULL	4	Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x  using BTREE (x,y), unique y  using BTREE (y))
engine=heap;
Loading