Skip to content

Commit f073593

Browse files
committed
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
1 parent 8e524d2 commit f073593

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
281281
*.vcproj.*
282282
*.vcproj.*.*
283283
*.vcproj.*.*.*
284+
*.vcxproj
285+
*.vcxproj.*
286+
*.vcxproj.*.*
287+
*.vcxproj.*.*.*
284288

285289
# Build results
286290
[Dd]ebug/

storage/connect/ha_connect.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
#define JSONMAX 10 // JSON Default max grp size
170170

171171
extern "C" {
172-
char version[]= "Version 1.03.0007 June 03, 2015";
172+
char version[]= "Version 1.03.0007 July 05, 2015";
173173
#if defined(__WIN__)
174174
char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__;
175175
char slash= '\\';
@@ -2237,7 +2237,9 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL op, char q,
22372237
case OP_EQ:
22382238
case OP_GT:
22392239
case OP_GE:
2240-
oom|= qry->Append((PSZ)GetValStr(op, false));
2240+
case OP_LT:
2241+
case OP_LE:
2242+
oom |= qry->Append((PSZ)GetValStr(op, false));
22412243
break;
22422244
default:
22432245
oom|= qry->Append(" ??? ");

storage/connect/tabmysql.cpp

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,27 +1059,35 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const void *key, int len)
10591059
bool oom;
10601060
int oldlen = Query->GetLength();
10611061

1062+
if (op == OP_FIRST) {
1063+
#ifdef _DEBUG
1064+
assert(!key);
1065+
#endif
1066+
key_range *end_key = &To_Def->GetHandler()->save_end_range;
1067+
1068+
key = end_key->key;
1069+
len = end_key->length;
1070+
1071+
switch (end_key->flag) {
1072+
case HA_READ_BEFORE_KEY: op = OP_LT; break;
1073+
case HA_READ_AFTER_KEY: op = OP_LE; break;
1074+
default: key = NULL;
1075+
} // endswitch flag
1076+
1077+
} // endif OP_FIRST
1078+
10621079
if (!key || op == OP_NEXT ||
10631080
Mode == MODE_UPDATE || Mode == MODE_DELETE) {
1081+
#if 0
10641082
if (!key && Mode == MODE_READX) {
10651083
// This is a false indexed read
10661084
m_Rc = Myc.ExecSQL(g, Query->GetStr());
10671085
Mode = MODE_READ;
10681086
return (m_Rc == RC_FX) ? true : false;
10691087
} // endif key
1088+
#endif // 0
10701089

10711090
return false;
1072-
} else if (op == OP_FIRST) {
1073-
if (To_CondFil) {
1074-
oom = Query->Append(" WHERE ");
1075-
1076-
if ((oom |= Query->Append(To_CondFil->Body))) {
1077-
strcpy(g->Message, "Readkey: Out of memory");
1078-
return true;
1079-
} // endif oom
1080-
1081-
} // endif To_Condfil
1082-
10831091
} else {
10841092
if (Myc.m_Res)
10851093
Myc.FreeResult();

0 commit comments

Comments
 (0)