diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-07-07 15:55:32 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-07-07 15:55:32 +0200 |
commit | 6114101344a9aa07a93b0620673e2b32c6d2a12c (patch) | |
tree | be8c468849ef9fd6b7bd7110d66fc891ea46bfb6 /storage/connect | |
parent | f07359349f86b29192419adbdd39e55b92c42e22 (diff) | |
download | mariadb-git-6114101344a9aa07a93b0620673e2b32c6d2a12c.tar.gz |
Fix regression bug on "select max(length(nom)) from emp1" when:
The emp1 table type is MYSQL
nom is an indexed column
Diffstat (limited to 'storage/connect')
-rw-r--r-- | storage/connect/tabmysql.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 053478de560..f82cca3b514 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -1058,12 +1058,13 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const void *key, int len) { bool oom; int oldlen = Query->GetLength(); + PHC hc = To_Def->GetHandler(); - if (op == OP_FIRST) { + if (op == OP_FIRST && hc->end_range) { #ifdef _DEBUG assert(!key); #endif - key_range *end_key = &To_Def->GetHandler()->save_end_range; + key_range *end_key = &hc->save_end_range; key = end_key->key; len = end_key->length; @@ -1078,21 +1079,20 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const void *key, int len) if (!key || op == OP_NEXT || Mode == MODE_UPDATE || Mode == MODE_DELETE) { -#if 0 if (!key && Mode == MODE_READX) { // This is a false indexed read m_Rc = Myc.ExecSQL(g, Query->GetStr()); Mode = MODE_READ; return (m_Rc == RC_FX) ? true : false; } // endif key -#endif // 0 return false; } else { if (Myc.m_Res) Myc.FreeResult(); - To_Def->GetHandler()->MakeKeyWhere(g, Query, op, '`', key, len); + if (hc->MakeKeyWhere(g, Query, op, '`', key, len)) + return true; if (To_CondFil) { oom = Query->Append(" AND ("); |