diff options
author | Michael Widenius <monty@askmonty.org> | 2011-02-23 14:46:16 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-02-23 14:46:16 +0200 |
commit | 6c610ed97964a6370e7082ca1fd1f11c4d6720ba (patch) | |
tree | 77221e972a6da561821375ec2b5cebee2fcf1088 /storage/heap | |
parent | 39616eb9ef974c69e73bcb80cd7e3c40228910fd (diff) | |
download | mariadb-git-6c610ed97964a6370e7082ca1fd1f11c4d6720ba.tar.gz |
Fixed build issues
- Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client
- Fixed bug in heap tables when doing handler read next-prev over last row
BUILD/compile-dist:
- Linking now with g++ instead of gcc with 'compile-dist' to solve problems with handlersocket/client
cmd-line-utils/libedit/vi.c:
Fixed compiler warning about not checking return value for write
mysql-test/r/index_intersect.result:
Updated results (missed this file in my last push)
mysql-test/suite/handler/aria.result:
Updated test results
mysql-test/suite/handler/handler.inc:
Changed test to use read next/read prev on key where there are duplicates that can come in different order depending on system
Added testing of read next-prev over last row and read prev-next around first row
mysql-test/suite/handler/heap.result:
Updated test results
mysql-test/suite/handler/init.inc:
More rows to test
mysql-test/suite/handler/innodb.result:
Updated test results
mysql-test/suite/handler/interface.result:
Updated test results
mysql-test/suite/handler/myisam.result:
Updated test results
mysql-test/t/variables-big.test:
Fixed test to not fail on windows
mysql-test/valgrind.supp:
Removed not matching fun: to get rid of valgrind warning
storage/heap/hp_rfirst.c:
Added state so that we know if we have an active position in the index.
storage/heap/hp_rkey.c:
Added state so that we know if we have an active position in the index.
storage/heap/hp_rnext.c:
Handle reading several next after finding the last row (this caused a crash before)
storage/heap/hp_rprev.c:
Handle reading several prev after finding the first row (this caused a crash before)
storage/xtradb/buf/buf0buf.c:
Fixed compiler warning about uninitialized value
Diffstat (limited to 'storage/heap')
-rw-r--r-- | storage/heap/hp_rfirst.c | 1 | ||||
-rw-r--r-- | storage/heap/hp_rkey.c | 4 | ||||
-rw-r--r-- | storage/heap/hp_rnext.c | 15 | ||||
-rw-r--r-- | storage/heap/hp_rprev.c | 15 | ||||
-rw-r--r-- | storage/heap/hp_rsame.c | 2 |
5 files changed, 32 insertions, 5 deletions
diff --git a/storage/heap/hp_rfirst.c b/storage/heap/hp_rfirst.c index 8e562983b02..e45af4a219f 100644 --- a/storage/heap/hp_rfirst.c +++ b/storage/heap/hp_rfirst.c @@ -52,6 +52,7 @@ int heap_rfirst(HP_INFO *info, uchar *record, int inx) } else { + info->update= HA_STATE_NO_KEY; my_errno = HA_ERR_END_OF_FILE; DBUG_RETURN(my_errno); } diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c index c2edf63f6f2..166ed28aed0 100644 --- a/storage/heap/hp_rkey.c +++ b/storage/heap/hp_rkey.c @@ -51,7 +51,7 @@ int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, if (!(pos= tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents, &info->last_pos, find_flag, &custom_arg))) { - info->update= 0; + info->update= HA_STATE_NO_KEY; DBUG_RETURN(my_errno= HA_ERR_KEY_NOT_FOUND); } memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(uchar*)); @@ -61,7 +61,7 @@ int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, { if (!(pos= hp_search(info, share->keydef + inx, key, 0))) { - info->update= 0; + info->update= HA_STATE_NO_KEY; DBUG_RETURN(my_errno); } if (!(keyinfo->flag & HA_NOSAME)) diff --git a/storage/heap/hp_rnext.c b/storage/heap/hp_rnext.c index 7a654850e0e..7a759e70972 100644 --- a/storage/heap/hp_rnext.c +++ b/storage/heap/hp_rnext.c @@ -32,7 +32,20 @@ int heap_rnext(HP_INFO *info, uchar *record) { heap_rb_param custom_arg; - if (info->last_pos) + /* If no active record and last was not deleted */ + if (!(info->update & (HA_STATE_AKTIV | HA_STATE_NO_KEY | + HA_STATE_DELETED))) + { + if (info->update & HA_STATE_NEXT_FOUND) + pos= 0; /* Can't search after last row */ + else + { + /* Last was 'prev' before first record; search after first record */ + pos= tree_search_edge(&keyinfo->rb_tree, info->parents, + &info->last_pos, offsetof(TREE_ELEMENT, left)); + } + } + else if (info->last_pos) { /* We enter this branch for non-DELETE queries after heap_rkey() diff --git a/storage/heap/hp_rprev.c b/storage/heap/hp_rprev.c index 1d71c20eef4..8a50444bb5f 100644 --- a/storage/heap/hp_rprev.c +++ b/storage/heap/hp_rprev.c @@ -32,7 +32,20 @@ int heap_rprev(HP_INFO *info, uchar *record) { heap_rb_param custom_arg; - if (info->last_pos) + /* If no active record and last was not deleted */ + if (!(info->update & (HA_STATE_AKTIV | HA_STATE_NO_KEY | + HA_STATE_DELETED))) + { + if (info->update & HA_STATE_PREV_FOUND) + pos= 0; /* Can't search before first row */ + else + { + /* Last was 'next' after last record; search after last record */ + pos= tree_search_edge(&keyinfo->rb_tree, info->parents, + &info->last_pos, offsetof(TREE_ELEMENT, right)); + } + } + else if (info->last_pos) pos = tree_search_next(&keyinfo->rb_tree, &info->last_pos, offsetof(TREE_ELEMENT, right), offsetof(TREE_ELEMENT, left)); diff --git a/storage/heap/hp_rsame.c b/storage/heap/hp_rsame.c index 1a3724672b6..f93a443aa48 100644 --- a/storage/heap/hp_rsame.c +++ b/storage/heap/hp_rsame.c @@ -43,7 +43,7 @@ int heap_rsame(register HP_INFO *info, uchar *record, int inx) hp_make_key(share->keydef + inx, info->lastkey, record); if (!hp_search(info, share->keydef + inx, info->lastkey, 3)) { - info->update=0; + info->update= 0; DBUG_RETURN(my_errno); } } |