Commit bce59293 authored by Olivier Bertrand's avatar Olivier Bertrand

-Fix MDEV-4878. Table locking is now supported.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/plgdbsem.h

- Fiw a bug making records_in_range sometimes return a negative
  value.

modified:
  storage/connect/xindex.cpp
parent 8b3e07e1
This diff is collapsed.
...@@ -406,6 +406,7 @@ const char *GetValStr(OPVAL vop, bool neg); ...@@ -406,6 +406,7 @@ const char *GetValStr(OPVAL vop, bool neg);
void position(const uchar *record); ///< required void position(const uchar *record); ///< required
int info(uint); ///< required int info(uint); ///< required
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation);
int start_stmt(THD *thd, thr_lock_type lock_type);
int external_lock(THD *thd, int lock_type); ///< required int external_lock(THD *thd, int lock_type); ///< required
int delete_all_rows(void); int delete_all_rows(void);
ha_rows records_in_range(uint inx, key_range *min_key, ha_rows records_in_range(uint inx, key_range *min_key,
...@@ -435,6 +436,7 @@ const char *GetValStr(OPVAL vop, bool neg); ...@@ -435,6 +436,7 @@ const char *GetValStr(OPVAL vop, bool neg);
protected: protected:
bool check_privileges(THD *thd, PTOS options); bool check_privileges(THD *thd, PTOS options);
MODE CheckMode(PGLOBAL g, THD *thd, MODE newmode, bool *chk, bool *cras);
// Members // Members
static ulong num; // Tracable handler number static ulong num; // Tracable handler number
...@@ -452,6 +454,7 @@ const char *GetValStr(OPVAL vop, bool neg); ...@@ -452,6 +454,7 @@ const char *GetValStr(OPVAL vop, bool neg);
bool valid_info; // True if xinfo is valid bool valid_info; // True if xinfo is valid
bool stop; // Used when creating index bool stop; // Used when creating index
int indexing; // Type of indexing for CONNECT int indexing; // Type of indexing for CONNECT
int locked; // Table lock
THR_LOCK_DATA lock_data; THR_LOCK_DATA lock_data;
public: public:
......
...@@ -151,7 +151,8 @@ enum ALGMOD {AMOD_AUTO = 0, /* PLG chooses best algorithm */ ...@@ -151,7 +151,8 @@ enum ALGMOD {AMOD_AUTO = 0, /* PLG chooses best algorithm */
#define NAM_LEN 128 #define NAM_LEN 128
#endif // !0 #endif // !0
enum MODE {MODE_ANY = 0, /* Unspecified mode */ enum MODE {MODE_ERROR = -1, /* Invalid mode */
MODE_ANY = 0, /* Unspecified mode */
MODE_READ = 10, /* Input/Output mode */ MODE_READ = 10, /* Input/Output mode */
MODE_WRITE = 20, /* Input/Output mode */ MODE_WRITE = 20, /* Input/Output mode */
MODE_UPDATE = 30, /* Input/Output mode */ MODE_UPDATE = 30, /* Input/Output mode */
......
...@@ -1832,8 +1832,9 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl) ...@@ -1832,8 +1832,9 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl)
/*********************************************************************/ /*********************************************************************/
if (xp->GetType() == TYPE_CONST) { if (xp->GetType() == TYPE_CONST) {
kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix); kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix);
k = FastFind(Nval);
if ((k = FastFind(Nval)) < Num_K) if (k < Num_K || Op != OP_EQ)
if (limit) if (limit)
n = (Mul) ? k : kp->Val_K; n = (Mul) ? k : kp->Val_K;
else else
......
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