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
fee5128d
Commit
fee5128d
authored
Sep 03, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
27390a8d
ca3cecf8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
39 deletions
+67
-39
Docs/manual.texi
Docs/manual.texi
+4
-0
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+2
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_base.cc
sql/sql_base.cc
+45
-35
sql/sql_table.cc
sql/sql_table.cc
+13
-3
No files found.
Docs/manual.texi
View file @
fee5128d
...
@@ -46929,6 +46929,10 @@ not yet 100% confident in this code.
...
@@ -46929,6 +46929,10 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.53
@appendixsubsec Changes in release 3.23.53
@itemize @bullet
@itemize @bullet
@item
@item
Changed @code{AND/OR} to report that they can return NULL. This fixes a
small problem in @code{GROUP BY} on @code{AND/OR} expression that return
@code{NULL}.
@item
Fixed a bug that @code{OPTIMIZE} of locked and modified MyISAM table,
Fixed a bug that @code{OPTIMIZE} of locked and modified MyISAM table,
reported table corruption.
reported table corruption.
@item
@item
mysql-test/r/distinct.result
View file @
fee5128d
...
@@ -69,7 +69,8 @@ a max(id) b
...
@@ -69,7 +69,8 @@ a max(id) b
0 0
0 0
NULL NULL NULL
NULL NULL NULL
grp count(*)
grp count(*)
0 7
NULL 1
0 6
1 6
1 6
FACILITY
FACILITY
NULL
NULL
...
...
sql/item_cmpfunc.cc
View file @
fee5128d
...
@@ -1097,6 +1097,8 @@ Item_cond::fix_fields(THD *thd,TABLE_LIST *tables)
...
@@ -1097,6 +1097,8 @@ Item_cond::fix_fields(THD *thd,TABLE_LIST *tables)
used_tables_cache
|=
item
->
used_tables
();
used_tables_cache
|=
item
->
used_tables
();
with_sum_func
=
with_sum_func
||
item
->
with_sum_func
;
with_sum_func
=
with_sum_func
||
item
->
with_sum_func
;
const_item_cache
&=
item
->
const_item
();
const_item_cache
&=
item
->
const_item
();
if
(
item
->
maybe_null
)
maybe_null
=
1
;
}
}
if
(
thd
)
if
(
thd
)
thd
->
cond_count
+=
list
.
elements
;
thd
->
cond_count
+=
list
.
elements
;
...
...
sql/mysql_priv.h
View file @
fee5128d
...
@@ -447,6 +447,7 @@ bool rm_temporary_table(enum db_type base, char *path);
...
@@ -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
);
bool
send_fields
(
THD
*
thd
,
List
<
Item
>
&
item
,
uint
send_field_count
);
void
free_io_cache
(
TABLE
*
entry
);
void
free_io_cache
(
TABLE
*
entry
);
void
intern_close_table
(
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_thread_tables
(
THD
*
thd
,
bool
locked
=
0
);
void
close_temporary_tables
(
THD
*
thd
);
void
close_temporary_tables
(
THD
*
thd
);
TABLE
**
find_temporary_table
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table_name
);
TABLE
**
find_temporary_table
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table_name
);
...
...
sql/sql_base.cc
View file @
fee5128d
...
@@ -428,7 +428,6 @@ void close_thread_tables(THD *thd, bool locked)
...
@@ -428,7 +428,6 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_VOID_RETURN
;
// LOCK TABLES in use
DBUG_VOID_RETURN
;
// LOCK TABLES in use
}
}
TABLE
*
table
,
*
next
;
bool
found_old_table
=
0
;
bool
found_old_table
=
0
;
if
(
thd
->
lock
)
if
(
thd
->
lock
)
...
@@ -441,9 +440,35 @@ void close_thread_tables(THD *thd, bool locked)
...
@@ -441,9 +440,35 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_PRINT
(
"info"
,
(
"thd->open_tables=%p"
,
thd
->
open_tables
));
DBUG_PRINT
(
"info"
,
(
"thd->open_tables=%p"
,
thd
->
open_tables
));
for
(
table
=
thd
->
open_tables
;
table
;
table
=
next
)
while
(
thd
->
open_tables
)
found_old_table
|=
close_thread_table
(
thd
,
&
thd
->
open_tables
);
thd
->
some_tables_deleted
=
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 */
check_unused
();
if
(
found_old_table
)
{
{
next
=
table
->
next
;
/* Tell threads waiting for refresh that something has happened */
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
}
if
(
!
locked
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
/* VOID(pthread_sigmask(SIG_SETMASK,&thd->signals,NULL)); */
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
||
if
(
table
->
version
!=
refresh_version
||
thd
->
version
!=
refresh_version
||
!
table
->
db_stat
)
thd
->
version
!=
refresh_version
||
!
table
->
db_stat
)
{
{
...
@@ -473,22 +498,7 @@ void close_thread_tables(THD *thd, bool locked)
...
@@ -473,22 +498,7 @@ void close_thread_tables(THD *thd, bool locked)
else
else
unused_tables
=
table
->
next
=
table
->
prev
=
table
;
unused_tables
=
table
->
next
=
table
->
prev
=
table
;
}
}
}
DBUG_RETURN
(
found_old_table
);
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 */
check_unused
();
if
(
found_old_table
)
{
/* Tell threads waiting for refresh that something has happened */
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
}
if
(
!
locked
)
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
/* VOID(pthread_sigmask(SIG_SETMASK,&thd->signals,NULL)); */
DBUG_VOID_RETURN
;
}
}
/* Close and delete temporary tables */
/* Close and delete temporary tables */
...
...
sql/sql_table.cc
View file @
fee5128d
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
#include "mysql_priv.h"
#include "mysql_priv.h"
#include <hash.h>
#include <hash.h>
#ifdef HAVE_BERKELEY_DB
#include <ha_berkeley.h>
#endif
#include <myisam.h>
#include <myisam.h>
#ifdef __WIN__
#ifdef __WIN__
...
@@ -1675,11 +1678,18 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -1675,11 +1678,18 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
VOID
(
pthread_cond_broadcast
(
&
COND_refresh
));
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
VOID
(
pthread_mutex_unlock
(
&
LOCK_open
));
#ifdef HAVE_BERKELEY_DB
#ifdef HAVE_BERKELEY_DB
extern
bool
berkeley_flush_logs
(
void
);
if
(
old_db_type
==
DB_TYPE_BERKELEY_DB
)
if
(
old_db_type
==
DB_TYPE_BERKELEY_DB
)
{
{
(
void
)
berkeley_flush_logs
();
(
void
)
berkeley_flush_logs
();
table
=
open_ltable
(
thd
,
table_list
,
TL_READ
);
/*
For the alter table to be properly flushed to the logs, we
have to open the new table. If not, we get a problem on server
shutdown.
*/
if
(
!
open_tables
(
thd
,
table_list
))
// Should always succeed
{
close_thread_table
(
thd
,
&
table_list
->
table
);
}
}
}
#endif
#endif
...
...
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