summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-09-03 19:41:01 +0200
committerunknown <serg@serg.mylan>2003-09-03 19:41:01 +0200
commit96757dd788a22be2ee36fe79a97420914f40afa9 (patch)
treea9e74218efbc4aa75298290226a53e53435bf97d
parent9de22b36373ec374f452320448fea9d04d4a08d5 (diff)
parente1af4a65dcfd53db807bf08fb4f06a465073cb57 (diff)
downloadmariadb-git-96757dd788a22be2ee36fe79a97420914f40afa9.tar.gz
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
-rw-r--r--libmysql/get_password.c2
-rw-r--r--mysql-test/r/bdb.result31
-rw-r--r--mysql-test/t/bdb.test13
-rw-r--r--sql/ha_berkeley.cc3
4 files changed, 48 insertions, 1 deletions
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index e6221ea556e..0e3b2dcb0ae 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -78,7 +78,7 @@ char *get_tty_password(char *opt_message)
char *pos=to,*end=to+sizeof(to)-1;
int i=0;
DBUG_ENTER("get_tty_password");
- fprintf(stdout,opt_message ? opt_message : "Enter password: ");
+ _cputs(opt_message ? opt_message : "Enter password: ");
for (;;)
{
char tmp;
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index eb97d19136d..ebc2866183c 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -1123,3 +1123,34 @@ a b
select * from t2;
a b
drop table t1,t2;
+create table t1 (x int not null, index(x)) type=bdb;
+insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+select * from t1 where x <= 10 and x >= 7;
+x
+7
+8
+9
+10
+select * from t1 where x <= 10 and x >= 7 order by x;
+x
+7
+8
+9
+10
+select * from t1 where x <= 10 and x >= 7 order by x desc;
+x
+10
+9
+8
+7
+select * from t1 where x <= 8 and x >= 5 order by x desc;
+x
+8
+7
+6
+5
+select * from t1 where x < 8 and x > 5 order by x desc;
+x
+7
+6
+drop table t1;
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 608d4bf5042..d0cc63a9389 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -783,3 +783,16 @@ select * from t1;
select * from t2;
select * from t2;
drop table t1,t2;
+
+#
+# The bug #971
+#
+
+create table t1 (x int not null, index(x)) type=bdb;
+insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+select * from t1 where x <= 10 and x >= 7;
+select * from t1 where x <= 10 and x >= 7 order by x;
+select * from t1 where x <= 10 and x >= 7 order by x desc;
+select * from t1 where x <= 8 and x >= 5 order by x desc;
+select * from t1 where x < 8 and x > 5 order by x desc;
+drop table t1;
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 2154fbd7a32..78704a18052 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -1420,6 +1420,8 @@ int ha_berkeley::index_read(byte * buf, const byte * key,
bzero((char*) &row,sizeof(row));
if (key_len == key_info->key_length)
{
+ if (find_flag == HA_READ_AFTER_KEY)
+ key_info->handler.bdb_return_if_eq= 1;
error=read_row(cursor->c_get(cursor, pack_key(&last_key,
active_index,
key_buff,
@@ -1428,6 +1430,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key,
(find_flag == HA_READ_KEY_EXACT ?
DB_SET : DB_SET_RANGE)),
(char*) buf, active_index, &row, (DBT*) 0, 0);
+ key_info->handler.bdb_return_if_eq= 0;
}
else
{