Commit 34df99ab authored by serg@serg.mylan's avatar serg@serg.mylan

more than 64 indexes per table. bugfixes. bug#10995

parent f72841b4
...@@ -28,7 +28,7 @@ template <uint default_width> class Bitmap ...@@ -28,7 +28,7 @@ template <uint default_width> class Bitmap
uchar buffer[(default_width+7)/8]; uchar buffer[(default_width+7)/8];
public: public:
Bitmap() { init(); } Bitmap() { init(); }
Bitmap(Bitmap& from) { *this=from; } Bitmap(const Bitmap& from) { *this=from; }
explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); } explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); }
void init() { bitmap_init(&map, buffer, default_width, 0); } void init() { bitmap_init(&map, buffer, default_width, 0); }
void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); } void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); }
...@@ -61,18 +61,17 @@ template <uint default_width> class Bitmap ...@@ -61,18 +61,17 @@ template <uint default_width> class Bitmap
my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
char *print(char *buf) const char *print(char *buf) const
{ {
char *s=buf; int i; char *s=buf;
for (i=sizeof(buffer)-1; i>=0 ; i--) const uchar *e=buffer, *b=e+sizeof(buffer)-1;
while (!*b && b>e)
b--;
if ((*s=_dig_vec_upper[*b >> 4]) != '0')
s++;
*s++=_dig_vec_upper[*b & 15];
while (--b>=e)
{ {
if ((*s=_dig_vec_upper[buffer[i] >> 4]) != '0') *s++=_dig_vec_upper[*b >> 4];
break; *s++=_dig_vec_upper[*b & 15];
if ((*s=_dig_vec_upper[buffer[i] & 15]) != '0')
break;
}
for (s++, i-- ; i>=0 ; i--)
{
*s++=_dig_vec_upper[buffer[i] >> 4];
*s++=_dig_vec_upper[buffer[i] & 15];
} }
*s=0; *s=0;
return buf; return buf;
......
...@@ -5792,6 +5792,7 @@ make_join_readinfo(JOIN *join, uint options) ...@@ -5792,6 +5792,7 @@ make_join_readinfo(JOIN *join, uint options)
if (!table->no_keyread) if (!table->no_keyread)
{ {
if (tab->select && tab->select->quick && if (tab->select && tab->select->quick &&
tab->select->quick->index != MAX_KEY && //not index_merge
table->used_keys.is_set(tab->select->quick->index)) table->used_keys.is_set(tab->select->quick->index))
{ {
table->key_read=1; table->key_read=1;
......
...@@ -7455,12 +7455,16 @@ static void test_explain_bug() ...@@ -7455,12 +7455,16 @@ static void test_explain_bug()
verify_prepare_field(result, 5, "key", "", MYSQL_TYPE_VAR_STRING, verify_prepare_field(result, 5, "key", "", MYSQL_TYPE_VAR_STRING,
"", "", "", NAME_LEN, 0); "", "", "", NAME_LEN, 0);
verify_prepare_field(result, 6, "key_len", "", if (mysql_get_server_version(mysql) <= 50000)
(mysql_get_server_version(mysql) <= 50000 ? {
MYSQL_TYPE_LONGLONG : MYSQL_TYPE_VAR_STRING), verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_LONGLONG, "",
"", "", "", "", "", 3, 0);
(mysql_get_server_version(mysql) <= 50000 ? 3 : 4096), }
0); else
{
verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "",
"", "", NAME_LEN*MAX_KEY, 0);
}
verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING, verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING,
"", "", "", NAME_LEN*16, 0); "", "", "", NAME_LEN*16, 0);
......
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