Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
74bea98e
Commit
74bea98e
authored
Sep 17, 2013
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mrr duplicate key
parent
6458e115
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
1 deletion
+75
-1
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+73
-0
storage/spider/ha_spider.h
storage/spider/ha_spider.h
+1
-0
storage/spider/spd_include.h
storage/spider/spd_include.h
+1
-1
No files found.
storage/spider/ha_spider.cc
View file @
74bea98e
...
...
@@ -84,6 +84,7 @@ ha_spider::ha_spider(
#endif
#ifdef HA_MRR_USE_DEFAULT_IMPL
multi_range_keys
=
NULL
;
mrr_key_buff
=
NULL
;
#endif
append_tblnm_alias
=
NULL
;
is_clone
=
FALSE
;
...
...
@@ -177,6 +178,7 @@ ha_spider::ha_spider(
#endif
#ifdef HA_MRR_USE_DEFAULT_IMPL
multi_range_keys
=
NULL
;
mrr_key_buff
=
NULL
;
#endif
append_tblnm_alias
=
NULL
;
is_clone
=
FALSE
;
...
...
@@ -617,6 +619,11 @@ int ha_spider::close()
spider_free
(
spider_current_trx
,
multi_range_keys
,
MYF
(
0
));
multi_range_keys
=
NULL
;
}
if
(
mrr_key_buff
)
{
delete
[]
mrr_key_buff
;
mrr_key_buff
=
NULL
;
}
#endif
#ifdef HA_CAN_BULK_ACCESS
if
(
bulk_access_link_first
)
...
...
@@ -4660,6 +4667,10 @@ int ha_spider::read_multi_range_first_internal(
bool
tmp_high_priority
=
high_priority
;
bool
have_multi_range
;
#ifdef HA_MRR_USE_DEFAULT_IMPL
const
uchar
*
first_mrr_start_key
;
const
uchar
*
first_mrr_end_key
;
uint
first_mrr_start_key_length
;
uint
first_mrr_end_key_length
;
have_second_range
=
FALSE
;
#endif
if
(
keyread
)
...
...
@@ -4690,6 +4701,15 @@ int ha_spider::read_multi_range_first_internal(
#endif
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_PRINT
(
"info"
,(
"spider alloc multi_range_keys=%p"
,
multi_range_keys
));
if
(
!
mrr_key_buff
)
{
if
(
!
(
mrr_key_buff
=
new
spider_string
[
2
]))
{
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
}
for
(
roop_count
=
0
;
roop_count
<
2
;
roop_count
++
)
mrr_key_buff
[
roop_count
].
init_calc_mem
(
235
);
}
#else
multi_range_ranges
=
ranges
;
#endif
...
...
@@ -4709,6 +4729,28 @@ int ha_spider::read_multi_range_first_internal(
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
DBUG_PRINT
(
"info"
,(
"spider range_res4=%d"
,
range_res
));
mrr_key_buff
[
0
].
length
(
0
);
first_mrr_start_key
=
mrr_cur_range
.
start_key
.
key
;
first_mrr_start_key_length
=
mrr_cur_range
.
start_key
.
length
;
if
(
first_mrr_start_key_length
)
{
if
(
mrr_key_buff
[
0
].
reserve
(
first_mrr_start_key_length
))
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
mrr_key_buff
[
0
].
q_append
((
const
char
*
)
first_mrr_start_key
,
first_mrr_start_key_length
);
mrr_cur_range
.
start_key
.
key
=
(
const
uchar
*
)
mrr_key_buff
[
0
].
ptr
();
}
mrr_key_buff
[
1
].
length
(
0
);
first_mrr_end_key
=
mrr_cur_range
.
end_key
.
key
;
first_mrr_end_key_length
=
mrr_cur_range
.
end_key
.
length
;
if
(
first_mrr_end_key_length
)
{
if
(
mrr_key_buff
[
1
].
reserve
(
first_mrr_end_key_length
))
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
mrr_key_buff
[
1
].
q_append
((
const
char
*
)
first_mrr_end_key
,
first_mrr_end_key_length
);
mrr_cur_range
.
end_key
.
key
=
(
const
uchar
*
)
mrr_key_buff
[
1
].
ptr
();
}
#else
multi_range_curr
=
ranges
;
multi_range_end
=
ranges
+
range_count
;
...
...
@@ -5966,11 +6008,42 @@ int ha_spider::read_multi_range_next(
DBUG_RETURN
(
0
);
}
#ifdef HA_MRR_USE_DEFAULT_IMPL
const
uchar
*
first_mrr_start_key
;
const
uchar
*
first_mrr_end_key
;
uint
first_mrr_start_key_length
;
uint
first_mrr_end_key_length
;
#endif
if
(
!
result_list
.
tmp_table_join_break_after_get_next
)
{
#ifdef HA_MRR_USE_DEFAULT_IMPL
range_res
=
mrr_funcs
.
next
(
mrr_iter
,
&
mrr_cur_range
);
DBUG_PRINT
(
"info"
,(
"spider range_res4=%d"
,
range_res
));
if
(
!
range_res
)
{
mrr_key_buff
[
0
].
length
(
0
);
first_mrr_start_key
=
mrr_cur_range
.
start_key
.
key
;
first_mrr_start_key_length
=
mrr_cur_range
.
start_key
.
length
;
if
(
first_mrr_start_key_length
)
{
if
(
mrr_key_buff
[
0
].
reserve
(
first_mrr_start_key_length
))
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
mrr_key_buff
[
0
].
q_append
((
const
char
*
)
first_mrr_start_key
,
first_mrr_start_key_length
);
mrr_cur_range
.
start_key
.
key
=
(
const
uchar
*
)
mrr_key_buff
[
0
].
ptr
();
}
mrr_key_buff
[
1
].
length
(
0
);
first_mrr_end_key
=
mrr_cur_range
.
end_key
.
key
;
first_mrr_end_key_length
=
mrr_cur_range
.
end_key
.
length
;
if
(
first_mrr_end_key_length
)
{
if
(
mrr_key_buff
[
1
].
reserve
(
first_mrr_end_key_length
))
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
mrr_key_buff
[
1
].
q_append
((
const
char
*
)
first_mrr_end_key
,
first_mrr_end_key_length
);
mrr_cur_range
.
end_key
.
key
=
(
const
uchar
*
)
mrr_key_buff
[
1
].
ptr
();
}
}
#else
if
(
multi_range_curr
<
multi_range_end
)
multi_range_curr
++
;
...
...
storage/spider/ha_spider.h
View file @
74bea98e
...
...
@@ -140,6 +140,7 @@ public:
int
multi_range_num
;
bool
have_second_range
;
KEY_MULTI_RANGE
mrr_second_range
;
spider_string
*
mrr_key_buff
;
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
range_id_t
*
multi_range_keys
;
#else
...
...
storage/spider/spd_include.h
View file @
74bea98e
...
...
@@ -118,7 +118,7 @@
#define SPIDER_TMP_SHARE_LONG_COUNT 15
#define SPIDER_TMP_SHARE_LONGLONG_COUNT 3
#define SPIDER_MEM_CALC_LIST_NUM 23
5
#define SPIDER_MEM_CALC_LIST_NUM 23
6
#define SPIDER_BACKUP_DASTATUS \
bool da_status; if (thd) da_status = thd->is_error(); else da_status = FALSE;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment