List:Maria Storage Engine« Previous MessageNext Message »
From:Michael Widenius Date:August 18 2008 10:22pm
Subject:bzr commit into MySQL/Maria:mysql-maria branch (monty:2661)
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/

 2661 Michael Widenius	2008-08-19 [merge]
      Automatic merge
modified:
  mysql-test/r/maria.result
  mysql-test/t/maria.test
  storage/maria/ma_search.c

=== modified file 'mysql-test/r/maria.result'
--- a/mysql-test/r/maria.result	2008-08-11 14:40:32 +0000
+++ b/mysql-test/r/maria.result	2008-08-16 09:49:28 +0000
@@ -1900,9 +1900,6 @@ check table t2 extended;
 Table	Op	Msg_type	Msg_text
 test.t2	check	status	OK
 drop table t2;
-drop table if exists t1;
-Warnings:
-Note	1051	Unknown table 't1'
 CREATE TABLE t1 (
 col0 float DEFAULT NULL,
 col1 date DEFAULT NULL,   
@@ -2080,7 +2077,7 @@ col172 tinyint(1) DEFAULT NULL,
 col173 tinytext,
 col174 decimal(10,0) DEFAULT NULL,
 col175 double DEFAULT NULL
-) engine=maria DEFAULT CHARSET=latin1 COMMENT='generated';
+) engine=maria;
 insert ignore into t1 set 
 col10=abs(28449) % 2,
 col11='1973',
@@ -2205,3 +2202,23 @@ check table t1;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
+create table t1 (a char(200) primary key, b int default 12345) engine=maria;
+insert t1 (a) values (repeat('0', 200));
+insert t1 (a) values (repeat('1', 200)), (repeat('2', 200)), (repeat('3', 200)),
+(repeat('4', 200)), (repeat('5', 200)), (repeat('6', 200)), (repeat('7', 200)),
+(repeat('8', 200)), (repeat('9', 200)), (repeat('a', 200)), (repeat('b', 200)),
+(repeat('c', 200)), (repeat('d', 200)), (repeat('e', 200)), (repeat('f', 200)),
+(repeat('g', 200)), (repeat('h', 200)), (repeat('i', 200)), (repeat('j', 200)),
+(repeat('k', 200)), (repeat('l', 200)), (repeat('m', 200)), (repeat('n', 200)),
+(repeat('o', 200)), (repeat('p', 200)), (repeat('q', 200)), (repeat('r', 200)),
+(repeat('s', 200)), (repeat('t', 200)), (repeat('u', 200)), (repeat('v', 200)),
+(repeat('w', 200)), (repeat('x', 200)), (repeat('y', 200)), (repeat('z', 200)),
+(repeat('+', 200)), (repeat('-', 200)), (repeat('=', 200)), (repeat('*', 200));
+select b from t1 where a >= repeat('f', 200) and a < 'k';
+b
+12345
+12345
+12345
+12345
+12345
+drop table t1;

=== modified file 'mysql-test/t/maria.test'
--- a/mysql-test/t/maria.test	2008-08-11 14:40:32 +0000
+++ b/mysql-test/t/maria.test	2008-08-16 09:49:28 +0000
@@ -1186,7 +1186,6 @@ insert into t2 values (repeat('x',28)), 
 check table t2 extended;
 drop table t2;
 
-drop table if exists t1;
 CREATE TABLE t1 (
 col0 float DEFAULT NULL,
 col1 date DEFAULT NULL,   
@@ -1364,8 +1363,7 @@ col172 tinyint(1) DEFAULT NULL,
 col173 tinytext,
 col174 decimal(10,0) DEFAULT NULL,
 col175 double DEFAULT NULL
-) engine=maria DEFAULT CHARSET=latin1 COMMENT='generated';
-
+) engine=maria;
 
 insert ignore into t1 set 
 col10=abs(28449) % 2,
@@ -1481,6 +1479,25 @@ update ignore t1 set col165=repeat('a',7
 check table t1;
 drop table t1;
 
+#
+# Bug#38466 maria: range query returns no data
+#
+
+create table t1 (a char(200) primary key, b int default 12345) engine=maria;
+insert t1 (a) values (repeat('0', 200));
+insert t1 (a) values (repeat('1', 200)), (repeat('2', 200)), (repeat('3', 200)),
+ (repeat('4', 200)), (repeat('5', 200)), (repeat('6', 200)), (repeat('7', 200)),
+ (repeat('8', 200)), (repeat('9', 200)), (repeat('a', 200)), (repeat('b', 200)),
+ (repeat('c', 200)), (repeat('d', 200)), (repeat('e', 200)), (repeat('f', 200)),
+ (repeat('g', 200)), (repeat('h', 200)), (repeat('i', 200)), (repeat('j', 200)),
+ (repeat('k', 200)), (repeat('l', 200)), (repeat('m', 200)), (repeat('n', 200)),
+ (repeat('o', 200)), (repeat('p', 200)), (repeat('q', 200)), (repeat('r', 200)),
+ (repeat('s', 200)), (repeat('t', 200)), (repeat('u', 200)), (repeat('v', 200)),
+ (repeat('w', 200)), (repeat('x', 200)), (repeat('y', 200)), (repeat('z', 200)),
+ (repeat('+', 200)), (repeat('-', 200)), (repeat('=', 200)), (repeat('*', 200));
+select b from t1 where a >= repeat('f', 200) and a < 'k';
+drop table t1;
+
 --disable_result_log
 --disable_query_log
 eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum;

=== modified file 'storage/maria/ma_search.c'
--- a/storage/maria/ma_search.c	2008-07-05 11:03:21 +0000
+++ b/storage/maria/ma_search.c	2008-08-16 09:49:28 +0000
@@ -116,7 +116,8 @@ int _ma_search(register MARIA_HA *info, 
 	((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME ||
 	 (key->flag & SEARCH_PART_KEY) || info->s->base.born_transactional))
     {
-      if ((error= _ma_search(info, key, nextflag,
+      if ((error= _ma_search(info, key, (nextflag | SEARCH_FIND) &
+                             ~(SEARCH_BIGGER | SEARCH_SMALLER | SEARCH_LAST),
                              _ma_kpos(nod_flag,keypos))) >= 0 ||
           my_errno != HA_ERR_KEY_NOT_FOUND)
         DBUG_RETURN(error);
@@ -338,10 +339,8 @@ int _ma_seq_search(const MARIA_KEY *key,
                           comp_flag | tmp_key.flag,
                           not_used)) >= 0)
       break;
-#ifdef EXTRA_DEBUG
-    DBUG_PRINT("loop",("page: 0x%lx  key: '%s'  flag: %d", (long) page, t_buff,
-                       flag));
-#endif
+    DBUG_PRINT("loop_extra",("page: 0x%lx  key: '%s'  flag: %d",
+                             (long) page, t_buff, flag));
     memcpy(buff,t_buff,length);
     *ret_pos=page;
   }

Thread
bzr commit into MySQL/Maria:mysql-maria branch (monty:2661) Michael Widenius19 Aug