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
ca3cecf8
Commit
ca3cecf8
authored
Sep 03, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug introduces by last changeset
(Fixing of problem with ALTER TABLE on BDB tables)
parent
20680f89
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
36 deletions
+48
-36
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+2
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_base.cc
sql/sql_base.cc
+45
-35
No files found.
mysql-test/r/distinct.result
View file @
ca3cecf8
...
...
@@ -69,7 +69,8 @@ a max(id) b
0 0
NULL NULL NULL
grp count(*)
0 7
NULL 1
0 6
1 6
FACILITY
NULL
...
...
sql/mysql_priv.h
View file @
ca3cecf8
...
...
@@ -447,6 +447,7 @@ bool rm_temporary_table(enum db_type base, char *path);
bool
send_fields
(
THD
*
thd
,
List
<
Item
>
&
item
,
uint
send_field_count
);
void
free_io_cache
(
TABLE
*
entry
);
void
intern_close_table
(
TABLE
*
entry
);
bool
close_thread_table
(
THD
*
thd
,
TABLE
**
table_ptr
);
void
close_thread_tables
(
THD
*
thd
,
bool
locked
=
0
);
void
close_temporary_tables
(
THD
*
thd
);
TABLE
**
find_temporary_table
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table_name
);
...
...
sql/sql_base.cc
View file @
ca3cecf8
...
...
@@ -428,7 +428,6 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_VOID_RETURN
;
// LOCK TABLES in use
}
TABLE
*
table
,
*
next
;
bool
found_old_table
=
0
;
if
(
thd
->
lock
)
...
...
@@ -441,41 +440,10 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_PRINT
(
"info"
,
(
"thd->open_tables=%p"
,
thd
->
open_tables
));
for
(
table
=
thd
->
open_tables
;
table
;
table
=
next
)
{
next
=
table
->
next
;
if
(
table
->
version
!=
refresh_version
||
thd
->
version
!=
refresh_version
||
!
table
->
db_stat
)
{
VOID
(
hash_delete
(
&
open_cache
,(
byte
*
)
table
));
found_old_table
=
1
;
}
else
{
if
(
table
->
flush_version
!=
flush_version
)
{
table
->
flush_version
=
flush_version
;
table
->
file
->
extra
(
HA_EXTRA_FLUSH
);
}
else
{
// Free memory and reset for next loop
table
->
file
->
extra
(
HA_EXTRA_RESET
);
}
table
->
in_use
=
0
;
if
(
unused_tables
)
{
table
->
next
=
unused_tables
;
/* Link in last */
table
->
prev
=
unused_tables
->
prev
;
unused_tables
->
prev
=
table
;
table
->
prev
->
next
=
table
;
}
else
unused_tables
=
table
->
next
=
table
->
prev
=
table
;
}
}
while
(
thd
->
open_tables
)
found_old_table
|=
close_thread_table
(
thd
,
&
thd
->
open_tables
);
thd
->
some_tables_deleted
=
0
;
thd
->
open_tables
=
0
;
/* Free tables to hold down open files */
while
(
open_cache
.
records
>
table_cache_size
&&
unused_tables
)
VOID
(
hash_delete
(
&
open_cache
,(
byte
*
)
unused_tables
));
/* purecov: tested */
...
...
@@ -491,6 +459,48 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_VOID_RETURN
;
}
/* move one table to free list */
bool
close_thread_table
(
THD
*
thd
,
TABLE
**
table_ptr
)
{
DBUG_ENTER
(
"close_thread_table"
);
bool
found_old_table
=
0
;
TABLE
*
table
=*
table_ptr
;
*
table_ptr
=
table
->
next
;
if
(
table
->
version
!=
refresh_version
||
thd
->
version
!=
refresh_version
||
!
table
->
db_stat
)
{
VOID
(
hash_delete
(
&
open_cache
,(
byte
*
)
table
));
found_old_table
=
1
;
}
else
{
if
(
table
->
flush_version
!=
flush_version
)
{
table
->
flush_version
=
flush_version
;
table
->
file
->
extra
(
HA_EXTRA_FLUSH
);
}
else
{
// Free memory and reset for next loop
table
->
file
->
extra
(
HA_EXTRA_RESET
);
}
table
->
in_use
=
0
;
if
(
unused_tables
)
{
table
->
next
=
unused_tables
;
/* Link in last */
table
->
prev
=
unused_tables
->
prev
;
unused_tables
->
prev
=
table
;
table
->
prev
->
next
=
table
;
}
else
unused_tables
=
table
->
next
=
table
->
prev
=
table
;
}
DBUG_RETURN
(
found_old_table
);
}
/* Close and delete temporary tables */
void
close_temporary
(
TABLE
*
table
,
bool
delete_table
)
...
...
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