Commit f0735934 authored by Olivier Bertrand's avatar Olivier Bertrand

Fix loosing result lines when all of this is true:

  The table type is MYSQL
  The query where clause includes an indexed column
  The where clause contains < or <= operator on this column
Change version date
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabmysql.cpp

Add visual studio 2013 files to ignore
  modified:   .gitignore
parent 8e524d2f
......@@ -281,6 +281,10 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
*.vcproj.*
*.vcproj.*.*
*.vcproj.*.*.*
*.vcxproj
*.vcxproj.*
*.vcxproj.*.*
*.vcxproj.*.*.*
# Build results
[Dd]ebug/
......
......@@ -169,7 +169,7 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
char version[]= "Version 1.03.0007 June 03, 2015";
char version[]= "Version 1.03.0007 July 05, 2015";
#if defined(__WIN__)
char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__;
char slash= '\\';
......@@ -2237,7 +2237,9 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL op, char q,
case OP_EQ:
case OP_GT:
case OP_GE:
oom|= qry->Append((PSZ)GetValStr(op, false));
case OP_LT:
case OP_LE:
oom |= qry->Append((PSZ)GetValStr(op, false));
break;
default:
oom|= qry->Append(" ??? ");
......
......@@ -1059,27 +1059,35 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const void *key, int len)
bool oom;
int oldlen = Query->GetLength();
if (op == OP_FIRST) {
#ifdef _DEBUG
assert(!key);
#endif
key_range *end_key = &To_Def->GetHandler()->save_end_range;
key = end_key->key;
len = end_key->length;
switch (end_key->flag) {
case HA_READ_BEFORE_KEY: op = OP_LT; break;
case HA_READ_AFTER_KEY: op = OP_LE; break;
default: key = NULL;
} // endswitch flag
} // endif OP_FIRST
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 (op == OP_FIRST) {
if (To_CondFil) {
oom = Query->Append(" WHERE ");
if ((oom |= Query->Append(To_CondFil->Body))) {
strcpy(g->Message, "Readkey: Out of memory");
return true;
} // endif oom
} // endif To_Condfil
} else {
if (Myc.m_Res)
Myc.FreeResult();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment