mirror of
https://github.com/MariaDB/server.git
synced 2026-05-09 16:44:29 +02:00
Fix for bug #33758: Got query result when using ORDER BY ASC, but
empty result when using DESC Problem: fetching MyISAM keys we copy a key block pointer to the end of the key buffer. However, we don't take into account the pointer length calculatig the buffer size, that may leads to memory overwriting and in turn to unpredictable results. Fix: increase key buffer size by length of the key block pointer. Note: no simple test case. myisam/mi_open.c: Fix for bug #33758: Got query result when using ORDER BY ASC, but empty result when using DESC - increase possible maximum key length by size of the key block pointer, as it's copied into the key buffer in the get_key() MyISAM functions.
This commit is contained in:
parent
5177c97ec0
commit
863b86db24
1 changed files with 3 additions and 0 deletions
|
|
@ -270,6 +270,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||
if (share->options & HA_OPTION_COMPRESS_RECORD)
|
||||
share->base.max_key_length+=2; /* For safety */
|
||||
|
||||
/* Add space for node pointer */
|
||||
share->base.max_key_length+= share->base.key_reflength;
|
||||
|
||||
if (!my_multi_malloc(MY_WME,
|
||||
&share,sizeof(*share),
|
||||
&share->state.rec_per_key_part,sizeof(long)*key_parts,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue