Commit 94249ec8 authored by unknown's avatar unknown
Browse files

Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1

into kite-hub.kitebird.com:/src/extern/MySQL/bk/mysql-4.1

parents 7f69f44f e0cbfe76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ collation(hex(130)) coercibility(hex(130))
latin1_swedish_ci	3
select collation(char(130)), coercibility(hex(130));
collation(char(130))	coercibility(hex(130))
binary	3
latin1_swedish_ci	3
select collation(format(130,10)), coercibility(format(130,10));
collation(format(130,10))	coercibility(format(130,10))
latin1_swedish_ci	3
+38 −0
Original line number Diff line number Diff line
@@ -733,3 +733,41 @@ xxxxxxxxxxxxxxxxxxxaa
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxz
drop table t1;
create table t1 (
`sid` decimal(8,0) default null,
`wnid` varchar(11) not null default '',
key `wnid14` (`wnid`(4)),
key `wnid` (`wnid`)
) engine=myisam default charset=latin1;
insert into t1 (`sid`, `wnid`) values
('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
explain select * from t1 where wnid like '0101%' order by wnid;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	wnid14,wnid	wnid	11	NULL	10	Using where
select * from t1 where wnid like '0101%' order by wnid;
sid	wnid
10100	01019000000
37986	01019000000
37989	01019000000
37987	01019010000
37990	01019011000
37991	01019011000
37992	01019019000
37993	01019030000
39560	01019090000
37994	01019090000
drop table t1;
+2 −2
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.000001	79	User var	1	79	@`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001	120	Query	1	120	use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001	184	User var	1	184	@`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001	226	User var	1	226	@`var2`=_binary 0x61 COLLATE binary
master-bin.000001	226	User var	1	226	@`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001	264	Query	1	264	use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
@@ -183,7 +183,7 @@ use test;
SET TIMESTAMP=10000;
INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
SET @`var2`:=_binary 0x61 COLLATE `binary`;
SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
SET TIMESTAMP=10000;
insert into t1 values (@var1),(@var2);
drop table t1;
+34 −0
Original line number Diff line number Diff line
@@ -500,3 +500,37 @@ insert into t1 set a = concat(repeat('x', 19), 'aa');
set max_sort_length=20;
select a from t1 order by a;
drop table t1;

#
# Bug #7331
#

create table t1 (
  `sid` decimal(8,0) default null,
  `wnid` varchar(11) not null default '',
  key `wnid14` (`wnid`(4)),
  key `wnid` (`wnid`)
) engine=myisam default charset=latin1;

insert into t1 (`sid`, `wnid`) values
('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
('25295','02071491000'),('25296','02071491000'),('25297','02071499000');

explain select * from t1 where wnid like '0101%' order by wnid;

select * from t1 where wnid like '0101%' order by wnid;

drop table t1;
+19 −14
Original line number Diff line number Diff line
@@ -187,28 +187,33 @@ public:
  };

  void update_max_auto_val(const char *data, int size) {
    Uint64 val= 0;
    union {
      Uint8  u8;
      Uint16 u16;
      Uint32 u32;
    } val;
    Uint64 v;
    switch(size){
    case 8:
      val= *(Uint8*)data;
      break;
    case 16:
      val= *(Uint16*)data;
      break;
    case 24:
      val= (0xffffff)&*(Uint32*)data;
    case 64:
      memcpy(&v,data,8);
      break;
    case 32:
      val= *(Uint32*)data;
      memcpy(&val.u32,data,4);
      v= val.u32;
      break;
    case 64:
      val= *(Uint64*)data;
    case 16:
      memcpy(&val.u16,data,2);
      v= val.u16;
      break;
    case 8:
      memcpy(&val.u8,data,1);
      v= val.u8;
      break;
    default:
      return;
    };
    if(val > m_max_auto_val)
      m_max_auto_val= val;
    if(v > m_max_auto_val)
      m_max_auto_val= v;
  };
  /**
   * Get attribute descriptor
Loading