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
21018e34
Commit
21018e34
authored
Jun 24, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b4198
parents
edb9af25
382ed47f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
sql/sql_select.cc
sql/sql_select.cc
+18
-9
No files found.
sql/sql_select.cc
View file @
21018e34
...
...
@@ -131,7 +131,8 @@ static int remove_dup_with_hash_index(THD *thd,TABLE *table,
static
int
join_init_cache
(
THD
*
thd
,
JOIN_TAB
*
tables
,
uint
table_count
);
static
ulong
used_blob_length
(
CACHE_FIELD
**
ptr
);
static
bool
store_record_in_cache
(
JOIN_CACHE
*
cache
);
static
void
reset_cache
(
JOIN_CACHE
*
cache
);
static
void
reset_cache_read
(
JOIN_CACHE
*
cache
);
static
void
reset_cache_write
(
JOIN_CACHE
*
cache
);
static
void
read_cached_record
(
JOIN_TAB
*
tab
);
static
bool
cmp_buffer_with_ref
(
JOIN_TAB
*
tab
);
static
bool
setup_new_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
List
<
Item
>
&
fields
,
...
...
@@ -5843,8 +5844,7 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last)
/* read through all records */
if
((
error
=
join_init_read_record
(
join_tab
)))
{
reset_cache
(
&
join_tab
->
cache
);
join_tab
->
cache
.
records
=
0
;
join_tab
->
cache
.
ptr_record
=
(
uint
)
~
0
;
reset_cache_write
(
&
join_tab
->
cache
);
return
-
error
;
/* No records or error */
}
...
...
@@ -5867,21 +5867,23 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last)
!
join_tab
->
cache
.
select
->
skip_record
()))
{
uint
i
;
reset_cache
(
&
join_tab
->
cache
);
reset_cache
_read
(
&
join_tab
->
cache
);
for
(
i
=
(
join_tab
->
cache
.
records
-
(
skip_last
?
1
:
0
))
;
i
--
>
0
;)
{
read_cached_record
(
join_tab
);
if
(
!
select
||
!
select
->
skip_record
())
if
((
error
=
(
join_tab
->
next_select
)(
join
,
join_tab
+
1
,
0
))
<
0
)
{
reset_cache_write
(
&
join_tab
->
cache
);
return
error
;
/* purecov: inspected */
}
}
}
}
while
(
!
(
error
=
info
->
read_record
(
info
)));
if
(
skip_last
)
read_cached_record
(
join_tab
);
// Restore current record
reset_cache
(
&
join_tab
->
cache
);
join_tab
->
cache
.
records
=
0
;
join_tab
->
cache
.
ptr_record
=
(
uint
)
~
0
;
reset_cache_write
(
&
join_tab
->
cache
);
if
(
error
>
0
)
// Fatal error
return
-
1
;
/* purecov: inspected */
for
(
JOIN_TAB
*
tmp2
=
join
->
join_tab
;
tmp2
!=
join_tab
;
tmp2
++
)
...
...
@@ -7776,7 +7778,6 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
}
}
cache
->
records
=
0
;
cache
->
ptr_record
=
(
uint
)
~
0
;
cache
->
length
=
length
+
blobs
*
sizeof
(
char
*
);
cache
->
blobs
=
blobs
;
*
blob_ptr
=
0
;
/* End sequentel */
...
...
@@ -7784,7 +7785,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
if
(
!
(
cache
->
buff
=
(
uchar
*
)
my_malloc
(
size
,
MYF
(
0
))))
DBUG_RETURN
(
1
);
/* Don't use cache */
/* purecov: inspected */
cache
->
end
=
cache
->
buff
+
size
;
reset_cache
(
cache
);
reset_cache
_write
(
cache
);
DBUG_RETURN
(
0
);
}
...
...
@@ -7868,13 +7869,21 @@ store_record_in_cache(JOIN_CACHE *cache)
static
void
reset_cache
(
JOIN_CACHE
*
cache
)
reset_cache
_read
(
JOIN_CACHE
*
cache
)
{
cache
->
record_nr
=
0
;
cache
->
pos
=
cache
->
buff
;
}
static
void
reset_cache_write
(
JOIN_CACHE
*
cache
)
{
reset_cache_read
(
cache
);
cache
->
records
=
0
;
cache
->
ptr_record
=
(
uint
)
~
0
;
}
static
void
read_cached_record
(
JOIN_TAB
*
tab
)
{
...
...
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