Commit a31a3716 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-4786 - merge 10.0-monty - 10.0

Fixed sql_discovery.simple failure.

storage/sequence/sequence.cc:
  Let sequence share class have unique name to avoid collision with other
  classes.
storage/test_sql_discovery/test_sql_discovery.cc:
  Let test_sql_discovery share class have unique name to avoid collision with
  other classes.
parent 50aaf5ce
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <table.h> #include <table.h>
#include <field.h> #include <field.h>
class SHARE : public Handler_share { class Sequence_share : public Handler_share {
public: public:
const char *name; const char *name;
THR_LOCK lock; THR_LOCK lock;
...@@ -33,14 +33,14 @@ class SHARE : public Handler_share { ...@@ -33,14 +33,14 @@ class SHARE : public Handler_share {
ulonglong from, to, step; ulonglong from, to, step;
bool reverse; bool reverse;
SHARE(const char *name_arg, ulonglong from_arg, ulonglong to_arg, Sequence_share(const char *name_arg, ulonglong from_arg, ulonglong to_arg,
ulonglong step_arg, bool reverse_arg): ulonglong step_arg, bool reverse_arg):
name(name_arg), from(from_arg), to(to_arg), step(step_arg), name(name_arg), from(from_arg), to(to_arg), step(step_arg),
reverse(reverse_arg) reverse(reverse_arg)
{ {
thr_lock_init(&lock); thr_lock_init(&lock);
} }
~SHARE() ~Sequence_share()
{ {
thr_lock_delete(&lock); thr_lock_delete(&lock);
} }
...@@ -50,8 +50,8 @@ class ha_seq: public handler ...@@ -50,8 +50,8 @@ class ha_seq: public handler
{ {
private: private:
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
SHARE *seqs; Sequence_share *seqs;
SHARE *get_share(); Sequence_share *get_share();
ulonglong cur; ulonglong cur;
public: public:
...@@ -276,11 +276,11 @@ static bool parse_table_name(const char *name, size_t name_length, ...@@ -276,11 +276,11 @@ static bool parse_table_name(const char *name, size_t name_length,
} }
SHARE *ha_seq::get_share() Sequence_share *ha_seq::get_share()
{ {
SHARE *tmp_share; Sequence_share *tmp_share;
lock_shared_ha_data(); lock_shared_ha_data();
if (!(tmp_share= static_cast<SHARE*>(get_ha_share_ptr()))) if (!(tmp_share= static_cast<Sequence_share*>(get_ha_share_ptr())))
{ {
bool reverse; bool reverse;
ulonglong from, to, step; ulonglong from, to, step;
...@@ -303,7 +303,7 @@ SHARE *ha_seq::get_share() ...@@ -303,7 +303,7 @@ SHARE *ha_seq::get_share()
to= (to - from) / step * step + step + from; to= (to - from) / step * step + step + from;
tmp_share= new SHARE(table_share->normalized_path.str, from, to, step, reverse); tmp_share= new Sequence_share(table_share->normalized_path.str, from, to, step, reverse);
if (!tmp_share) if (!tmp_share)
goto err; goto err;
......
...@@ -40,14 +40,14 @@ static struct st_mysql_sys_var *sysvars[] = { ...@@ -40,14 +40,14 @@ static struct st_mysql_sys_var *sysvars[] = {
NULL NULL
}; };
class SHARE : public Handler_share { class TSD_share : public Handler_share {
public: public:
THR_LOCK lock; THR_LOCK lock;
SHARE() TSD_share()
{ {
thr_lock_init(&lock); thr_lock_init(&lock);
} }
~SHARE() ~TSD_share()
{ {
thr_lock_delete(&lock); thr_lock_delete(&lock);
} }
...@@ -57,8 +57,8 @@ class ha_tsd: public handler ...@@ -57,8 +57,8 @@ class ha_tsd: public handler
{ {
private: private:
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
SHARE *share; TSD_share *share;
SHARE *get_share(); TSD_share *get_share();
public: public:
ha_tsd(handlerton *hton, TABLE_SHARE *table_arg) ha_tsd(handlerton *hton, TABLE_SHARE *table_arg)
...@@ -94,13 +94,13 @@ class ha_tsd: public handler ...@@ -94,13 +94,13 @@ class ha_tsd: public handler
int close(void); int close(void);
}; };
SHARE *ha_tsd::get_share() TSD_share *ha_tsd::get_share()
{ {
SHARE *tmp_share; TSD_share *tmp_share;
lock_shared_ha_data(); lock_shared_ha_data();
if (!(tmp_share= static_cast<SHARE*>(get_ha_share_ptr()))) if (!(tmp_share= static_cast<TSD_share*>(get_ha_share_ptr())))
{ {
tmp_share= new SHARE; tmp_share= new TSD_share;
if (!tmp_share) if (!tmp_share)
goto err; goto err;
......
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