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
25929faf
Commit
25929faf
authored
Aug 29, 2000
by
monty@donna.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql into donna.mysql.com:/home/my/bk/mysql
parents
980e9113
306640e2
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
260 additions
and
106 deletions
+260
-106
BUILD/compile-alpha-ccc
BUILD/compile-alpha-ccc
+1
-1
Docs/bk.txt
Docs/bk.txt
+64
-0
Docs/manual.texi
Docs/manual.texi
+90
-60
Makefile.am
Makefile.am
+3
-1
client/mysql.cc
client/mysql.cc
+8
-7
myisam/Makefile.am
myisam/Makefile.am
+1
-1
myisam/mi_check.c
myisam/mi_check.c
+1
-2
myisam/mi_dbug.c
myisam/mi_dbug.c
+23
-0
myisammrg/myrg_rkey.c
myisammrg/myrg_rkey.c
+2
-2
myisammrg/myrg_rnext.c
myisammrg/myrg_rnext.c
+2
-2
myisammrg/myrg_rprev.c
myisammrg/myrg_rprev.c
+4
-3
sql/mini_client.cc
sql/mini_client.cc
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+5
-1
sql/sql_parse.cc
sql/sql_parse.cc
+8
-3
tests/grant.pl
tests/grant.pl
+22
-7
tests/grant.res
tests/grant.res
+25
-15
No files found.
BUILD/compile-alpha-ccc
View file @
25929faf
...
@@ -4,7 +4,7 @@ make -k clean
...
@@ -4,7 +4,7 @@ make -k clean
/bin/rm -f config.cache mysql-*.tar.gz
/bin/rm -f config.cache mysql-*.tar.gz
aclocal; autoheader; aclocal; automake; autoconf
aclocal; autoheader; aclocal; automake; autoconf
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex
--enable-thread-safe-client
make
make
if [ $? = 0 ]
if [ $? = 0 ]
then
then
...
...
Docs/bk.txt
0 → 100644
View file @
25929faf
Mail by sasha, should be rewritten as a HOWTO sometimes
-----------
I have set up a repository with BitKeeper on work. There are still some things
about it that I would like to learn, but I have gotten far enough with it to
replace CVS functionality were are currently using, so let's just go ahead and
get started on it. Please follow the instructions below (make sure to save the
message for future reference):
a) http://www.bitmover.com/download
user: beta
password: get bitkeeper
get the version appropriate for your platform - download it to a temp
directory, chmod +x and then run it. You will have to tell it which directory
to install, for consistency, let's use /usr/local/bin
b) we will take advantage of bk capablity of working with master/slave
repositories. The master will be on work.mysql.com, the slaves will be our
individual machines. The master repository has already been set up on work, so
you will need just to set up a slave repository on your machine:
mkdir bk
cd bk
bk clone yourusername@work:/home/bk/mysql mysql
cd mysql
bk -r edit
Now you have the entire source tree in the current directory. Let's compile it:
BUILD/compile-pentium-debug
After you edit a file, you need to check it in using bk citool or bk ci
filename. Note that ci is different than commit - you ci a file, but you commit
a change set. This is a very nice concept - instead of thinking of each
individual file as CVS does, bk groups the changes you are making and allows you
to document what you actually did between the commits as a whole, rather than
just commenting on every file. When you commit, bk will ask you to comment on
the change set.
Commit is done just to your local repository. To make your changes global, you
will need to run bk push. Be careful with that - it is a good idea to run bk
push -l -n first too see what you are just about to push to the master
repository.
When somebody does a push, you will be getting a email ( I will set this up to
day). You will then need to execute bk pull to update your sources. If there are
any conflicts, bk will force you to resolve them by asking you questions on what
to do with each conflict.
To learn more about bk, use bk helptool - I will be doing this a lot in the next
couple of days :-) If you find bugs or have questions/feature
suggestions/comments for developers, feel free to e-mail dev@bitmover.com .
Their developers, and especially the president of the company Larry McCoy really
like MySQL and are very anxious to help us. Make sure it is obvious that you
work for MySQL, of course. And, of course, do not bug them with little things
that you can figure out on your own or with my help - they were nice to offer us
support, but we should not abuse it.
If you are working on 3.23 MySQL source, please make sure to convert to bk ASAP
before you do any further developement - otherwise, things will get
exponentially worse as the code mass increases. I will work on mysql-4.0 next
and try to set it up so that when we update 3.23 source tree, the update makes
it to mysql-4.0.
Docs/manual.texi
View file @
25929faf
...
@@ -180,7 +180,7 @@ Installing MySQL
...
@@ -180,7 +180,7 @@ Installing MySQL
* Source install system issues:: System-specific issues
* Source install system issues:: System-specific issues
* Windows:: Windows notes
* Windows:: Windows notes
* OS/2:: OS/2 notes
* OS/2:: OS/2 notes
* MySQL binaries::
* MySQL binaries::
* Post-installation:: Post-installation setup and testing
* Post-installation:: Post-installation setup and testing
* Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}?
* Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}?
...
@@ -238,7 +238,7 @@ Linux notes (all Linux versions)
...
@@ -238,7 +238,7 @@ Linux notes (all Linux versions)
* Linux-Alpha:: Linux-Alpha notes
* Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes
* MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes
* Qube2:: Qube2 Linux notes
* Linux-Ia64::
* Linux-Ia64::
BSD/OS notes
BSD/OS notes
...
@@ -253,7 +253,7 @@ Windows notes
...
@@ -253,7 +253,7 @@ Windows notes
* NT start:: Starting @strong{MySQL} on NT / Win2000
* NT start:: Starting @strong{MySQL} on NT / Win2000
* Windows running:: Running @strong{MySQL} on Windows
* Windows running:: Running @strong{MySQL} on Windows
* Windows and SSH:: Connecting to a remote @strong{MySQL} from Windows with SSH
* Windows and SSH:: Connecting to a remote @strong{MySQL} from Windows with SSH
* Windows symbolic links:: Splitting data across different disks under Win
dows
* Windows symbolic links:: Splitting data across different disks under Win
32
* Windows compiling:: Compiling MySQL clients on Windows.
* Windows compiling:: Compiling MySQL clients on Windows.
* Windows vs Unix:: @strong{MySQL}-Windows compared to Unix @strong{MySQL}
* Windows vs Unix:: @strong{MySQL}-Windows compared to Unix @strong{MySQL}
...
@@ -411,13 +411,13 @@ Functions for use in @code{SELECT} and @code{WHERE} clauses
...
@@ -411,13 +411,13 @@ Functions for use in @code{SELECT} and @code{WHERE} clauses
@code{SHOW} syntax (Get information about tables, columns,...)
@code{SHOW} syntax (Get information about tables, columns,...)
* SHOW DATABASE INFO::
* SHOW DATABASE INFO::
* SHOW TABLE STATUS::
* SHOW TABLE STATUS::
* SHOW STATUS::
* SHOW STATUS::
* SHOW VARIABLES::
* SHOW VARIABLES::
* SHOW PROCESSLIST::
* SHOW PROCESSLIST::
* SHOW GRANTS::
* SHOW GRANTS::
* SHOW CREATE TABLE::
* SHOW CREATE TABLE::
MySQL table types
MySQL table types
...
@@ -567,10 +567,10 @@ Using @code{myisamchk} for table maintenance and crash recovery
...
@@ -567,10 +567,10 @@ Using @code{myisamchk} for table maintenance and crash recovery
@code{myisamchk} invocation syntax
@code{myisamchk} invocation syntax
* myisamchk general options::
* myisamchk general options::
* myisamchk check options::
* myisamchk check options::
* myisamchk repair options::
* myisamchk repair options::
* myisamchk other options::
* myisamchk other options::
Using @code{myisamchk} for crash recovery
Using @code{myisamchk} for crash recovery
...
@@ -643,16 +643,17 @@ Some common errors when using MySQL
...
@@ -643,16 +643,17 @@ Some common errors when using MySQL
* Packet too large:: @code{Packet too large} error
* Packet too large:: @code{Packet too large} error
* Communication errors:: Communication errors / Aborted connection
* Communication errors:: Communication errors / Aborted connection
* Full table:: @code{The table is full} error
* Full table:: @code{The table is full} error
* Cannot create::
* Cannot create::
* Commands out of sync:: @code{Commands out of sync} error in client
* Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error
* Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
Solving some common problems with MySQL
Solving some common problems with MySQL
* Log Replication:: Database replication with update log
* Log Replication:: Database replication with
update log
* Backup:: Database backups
* Backup:: Database backups
* Update log:: The update log
* Update log:: The update log
* Slow query log::
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
MySQL client tools and APIs
MySQL client tools and APIs
...
@@ -753,6 +754,7 @@ How MySQL compares to @code{mSQL}
...
@@ -753,6 +754,7 @@ How MySQL compares to @code{mSQL}
MySQL internals
MySQL internals
* MySQL threads:: MySQL threads
* MySQL threads:: MySQL threads
* MySQL full-text search:: MySQL full-text search
MySQL change history
MySQL change history
...
@@ -900,7 +902,7 @@ Comments on porting to other systems
...
@@ -900,7 +902,7 @@ Comments on porting to other systems
* Debugging server:: Debugging a @strong{MySQL} server
* Debugging server:: Debugging a @strong{MySQL} server
* Debugging client:: Debugging a @strong{MySQL} client
* Debugging client:: Debugging a @strong{MySQL} client
* The DBUG package:: The DBUG package
* The DBUG package:: The DBUG package
* Locking methods::
* Locking methods::
* RTS-threads:: Comments about RTS threads
* RTS-threads:: Comments about RTS threads
* Thread packages:: Differences between different thread packages
* Thread packages:: Differences between different thread packages
...
@@ -3359,7 +3361,7 @@ encounter per year, but we are as always very flexible towards our customers!
...
@@ -3359,7 +3361,7 @@ encounter per year, but we are as always very flexible towards our customers!
* Source install system issues:: System-specific issues
* Source install system issues:: System-specific issues
* Windows:: Windows notes
* Windows:: Windows notes
* OS/2:: OS/2 notes
* OS/2:: OS/2 notes
* MySQL binaries::
* MySQL binaries::
* Post-installation:: Post-installation setup and testing
* Post-installation:: Post-installation setup and testing
* Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}?
* Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}?
@end menu
@end menu
...
@@ -6026,7 +6028,7 @@ CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE -DCONST=const -
...
@@ -6026,7 +6028,7 @@ CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE -DCONST=const -
* Linux-Alpha:: Linux-Alpha notes
* Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes
* MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes
* Qube2:: Qube2 Linux notes
* Linux-Ia64::
* Linux-Ia64::
@end menu
@end menu
@node Linux-x86, Linux-RedHat50, Linux, Linux
@node Linux-x86, Linux-RedHat50, Linux, Linux
...
@@ -8368,13 +8370,17 @@ Client error messages in given language. May be given as a full path.
...
@@ -8368,13 +8370,17 @@ Client error messages in given language. May be given as a full path.
@item -l, --log[=file]
@item -l, --log[=file]
Log connections and queries to file
Log connections and queries to file
@item --log-isam[=file]
Log all ISAM/MyISAM changes to file (only used when debugging ISAM/MyISAM).
@item --log-slow-queries[=file]
Log all queries that has taken more than @code{long_query_time} to execute
to file. @xref{Slow query log}.
@item --log-update[=file]
@item --log-update[=file]
Log updates to @code{file.#} where @code{#} is a unique number if not given.
Log updates to @code{file.#} where @code{#} is a unique number if not given.
@xref{Update log}.
@xref{Update log}.
@item --log-isam[=file]
Log all isam changes to file.
@item --log-long-format
@item --log-long-format
Log some extra information to update log.
Log some extra information to update log.
...
@@ -8692,6 +8698,7 @@ The following lists tell what you have to watch out for when upgrading to 3.23:
...
@@ -8692,6 +8698,7 @@ The following lists tell what you have to watch out for when upgrading to 3.23:
(-g) by default. This option can be disabled with --enable-named-commands
(-g) by default. This option can be disabled with --enable-named-commands
(-G). This may cause incompatibility problems in some cases, for example
(-G). This may cause incompatibility problems in some cases, for example
in SQL scripts that use named commands without a semicolon, etc. !
in SQL scripts that use named commands without a semicolon, etc. !
Long format commands still work from the first line.
@item The default return type of @code{IF} will now depend on both arguments
@item The default return type of @code{IF} will now depend on both arguments
and not only the first argument.
and not only the first argument.
@item @code{AUTO_INCREMENT} will not work with negative numbers.
@item @code{AUTO_INCREMENT} will not work with negative numbers.
...
@@ -16872,7 +16879,7 @@ RENAME TABLE current_database.table_name TO other_database.table_name;
...
@@ -16872,7 +16879,7 @@ RENAME TABLE current_database.table_name TO other_database.table_name;
@end example
@end example
When you execute @code{RENAME}, you can't have any locked tables or
When you execute @code{RENAME}, you can't have any locked tables or
active transactions. You must also have the @code{ALTER
TABLE
}
active transactions. You must also have the @code{ALTER
} and @code{DROP
}
privilege on the original table and @code{CREATE} and @code{INSERT}
privilege on the original table and @code{CREATE} and @code{INSERT}
privilege on the new table.
privilege on the new table.
...
@@ -18353,13 +18360,13 @@ and @samp{_} wildcard characters.
...
@@ -18353,13 +18360,13 @@ and @samp{_} wildcard characters.
@findex SHOW INDEX
@findex SHOW INDEX
@findex SHOW KEYS
@findex SHOW KEYS
@menu
@menu
* SHOW DATABASE INFO::
* SHOW DATABASE INFO::
* SHOW TABLE STATUS::
* SHOW TABLE STATUS::
* SHOW STATUS::
* SHOW STATUS::
* SHOW VARIABLES::
* SHOW VARIABLES::
* SHOW PROCESSLIST::
* SHOW PROCESSLIST::
* SHOW GRANTS::
* SHOW GRANTS::
* SHOW CREATE TABLE::
* SHOW CREATE TABLE::
@end menu
@end menu
@node SHOW DATABASE INFO, SHOW TABLE STATUS, SHOW, SHOW
@node SHOW DATABASE INFO, SHOW TABLE STATUS, SHOW, SHOW
...
@@ -18543,7 +18550,7 @@ have..
...
@@ -18543,7 +18550,7 @@ have..
@item @code{Opened_tables} @tab Number of tables that have been opened.
@item @code{Opened_tables} @tab Number of tables that have been opened.
@item @code{Questions} @tab Number of queries sent to the server.
@item @code{Questions} @tab Number of queries sent to the server.
@item @code{Slow_launch_threads} @tab Number of threads that has taken more than @code{slow_launch_time} to connect.
@item @code{Slow_launch_threads} @tab Number of threads that has taken more than @code{slow_launch_time} to connect.
@item @code{Slow_queries} @tab Number of queries that has taken more than @code{long_query_time}
@item @code{Slow_queries} @tab Number of queries that has taken more than @code{long_query_time}
. @xref{Slow query log}.
@item @code{Threads_cached} @tab Number of threads in the thread cache.
@item @code{Threads_cached} @tab Number of threads in the thread cache.
@item @code{Threads_connected} @tab Number of currently open connections.
@item @code{Threads_connected} @tab Number of currently open connections.
@item @code{Threads_running} @tab Number of threads that are not sleeping.
@item @code{Threads_running} @tab Number of threads that are not sleeping.
...
@@ -18773,7 +18780,8 @@ Change all table names to lower case on disk.
...
@@ -18773,7 +18780,8 @@ Change all table names to lower case on disk.
@item @code{long_query_time}
@item @code{long_query_time}
If a query takes longer than this (in seconds), the @code{Slow_queries} counter
If a query takes longer than this (in seconds), the @code{Slow_queries} counter
will be incremented.
will be incremented. If you are using @code{--log-slow-queries}, the query
will be logged to the slow query logfile. @xref{Slow query log}.
@item @code{max_allowed_packet}
@item @code{max_allowed_packet}
The maximum size of one packet. The message buffer is initialized to
The maximum size of one packet. The message buffer is initialized to
...
@@ -18929,7 +18937,7 @@ threads. Otherwise, you can see only your own threads. @xref{KILL, ,
...
@@ -18929,7 +18937,7 @@ threads. Otherwise, you can see only your own threads. @xref{KILL, ,
@code{KILL}}. If you don't use the the @code{FULL} option, then only
@code{KILL}}. If you don't use the the @code{FULL} option, then only
the first 100 characters of each query will be shown.
the first 100 characters of each query will be shown.
@node SHOW GRANTS,
SHOW CREATE TABLE
, SHOW PROCESSLIST, SHOW
@node SHOW GRANTS,
SHOW CREATE TABLE
, SHOW PROCESSLIST, SHOW
@subsection SHOW GRANTS (privileges) for a user
@subsection SHOW GRANTS (privileges) for a user
@code{SHOW GRANTS FOR user} lists the grant commands that must be issued to
@code{SHOW GRANTS FOR user} lists the grant commands that must be issued to
...
@@ -18944,7 +18952,7 @@ mysql> SHOW GRANTS FOR root@@localhost;
...
@@ -18944,7 +18952,7 @@ mysql> SHOW GRANTS FOR root@@localhost;
+---------------------------------------------------------------------+
+---------------------------------------------------------------------+
@end example
@end example
@node SHOW CREATE TABLE,
,
SHOW GRANTS, SHOW
@node SHOW CREATE TABLE,
,
SHOW GRANTS, SHOW
@subsection SHOW CREATE TABLE
@subsection SHOW CREATE TABLE
Shows a @code{CREATE TABLE} statement that will create the given table
Shows a @code{CREATE TABLE} statement that will create the given table
@example
@example
...
@@ -25569,7 +25577,7 @@ Continue even if we get an SQL error.
...
@@ -25569,7 +25577,7 @@ Continue even if we get an SQL error.
Named commands are disabled. Use \* form only, or use named commands
Named commands are disabled. Use \* form only, or use named commands
only in the beginning of a line ending with a semicolon (;) Since
only in the beginning of a line ending with a semicolon (;) Since
version 10.9 the client now starts with this option ENABLED by default!
version 10.9 the client now starts with this option ENABLED by default!
Disable with '-G'
Disable with '-G'
. Long format commands still work from the first line.
@item -i, --ignore-space
@item -i, --ignore-space
Ignore space after function names.
Ignore space after function names.
@item -h, --host=...
@item -h, --host=...
...
@@ -25736,7 +25744,7 @@ The @code{mysqladmin status} command result has the following columns:
...
@@ -25736,7 +25744,7 @@ The @code{mysqladmin status} command result has the following columns:
@item Uptime @tab Number of seconds the @strong{MySQL} server has been up.
@item Uptime @tab Number of seconds the @strong{MySQL} server has been up.
@item Threads @tab Number of active threads (clients).
@item Threads @tab Number of active threads (clients).
@item Questions @tab Number of questions from clients since @code{mysqld} was started.
@item Questions @tab Number of questions from clients since @code{mysqld} was started.
@item Slow queries @tab Queries that have taken more than @code{long_query_time} seconds.
@item Slow queries @tab Queries that have taken more than @code{long_query_time} seconds.
@xref{Slow query log}.
@item Opens @tab How many tables @code{mysqld} has opened.
@item Opens @tab How many tables @code{mysqld} has opened.
@item Flush tables @tab Number of @code{flush ...}, @code{refresh} and @code{reload} commands.
@item Flush tables @tab Number of @code{flush ...}, @code{refresh} and @code{reload} commands.
@item Open tables @tab Number of tables that are open now.
@item Open tables @tab Number of tables that are open now.
...
@@ -26558,10 +26566,10 @@ shell> myisamchk /path/to/datadir/*/*.MYI
...
@@ -26558,10 +26566,10 @@ shell> myisamchk /path/to/datadir/*/*.MYI
@code{myisamchk} supports the following options:
@code{myisamchk} supports the following options:
@menu
@menu
* myisamchk general options::
* myisamchk general options::
* myisamchk check options::
* myisamchk check options::
* myisamchk repair options::
* myisamchk repair options::
* myisamchk other options::
* myisamchk other options::
@end menu
@end menu
@node myisamchk general options, myisamchk check options, myisamchk syntax, myisamchk syntax
@node myisamchk general options, myisamchk check options, myisamchk syntax, myisamchk syntax
...
@@ -27482,8 +27490,9 @@ The above command does the following:
...
@@ -27482,8 +27490,9 @@ The above command does the following:
@itemize @bullet
@itemize @bullet
@item
@item
If standard logging (@code{--log}) is used, closes and reopens the log file.
If standard logging (@code{--log}) or slow query logging
(@file{mysql.log} as default).
@code{--log-slow-queries} is used, closes and reopens the log file.
(@file{mysql.log} and @file{mysql-slow.log} as default).
@item
@item
If update logging (@code{--log-update}) is used, closes the update log and
If update logging (@code{--log-update}) is used, closes the update log and
opens a new log file with a higher sequence number.
opens a new log file with a higher sequence number.
...
@@ -28901,7 +28910,7 @@ sure that no other programs is using the dynamic libraries!
...
@@ -28901,7 +28910,7 @@ sure that no other programs is using the dynamic libraries!
* Packet too large:: @code{Packet too large} error
* Packet too large:: @code{Packet too large} error
* Communication errors:: Communication errors / Aborted connection
* Communication errors:: Communication errors / Aborted connection
* Full table:: @code{The table is full} error
* Full table:: @code{The table is full} error
* Cannot create::
* Cannot create::
* Commands out of sync:: @code{Commands out of sync} error in client
* Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error
* Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
...
@@ -29945,6 +29954,7 @@ Drop or rename @code{old_table}
...
@@ -29945,6 +29954,7 @@ Drop or rename @code{old_table}
* Log Replication:: Database replication with update log
* Log Replication:: Database replication with update log
* Backup:: Database backups
* Backup:: Database backups
* Update log:: The update log
* Update log:: The update log
* Slow query log::
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
@end menu
@end menu
...
@@ -30050,7 +30060,7 @@ to be replaced with new ones when a new record duplicates an old record on
...
@@ -30050,7 +30060,7 @@ to be replaced with new ones when a new record duplicates an old record on
a unique key value.
a unique key value.
@cindex Update log
@cindex Update log
@node Update log,
Multiple servers
, Backup, Common problems
@node Update log,
Slow query log
, Backup, Common problems
@section The update log
@section The update log
When started with the @code{--log-update[=file_name]} option,
When started with the @code{--log-update[=file_name]} option,
...
@@ -30104,6 +30114,20 @@ This can be useful if you have to revert to backup files after a crash
...
@@ -30104,6 +30114,20 @@ This can be useful if you have to revert to backup files after a crash
and you want to redo the updates that occurred between the time of the backup
and you want to redo the updates that occurred between the time of the backup
and the crash.
and the crash.
@cindex Slow query log
@node Slow query log, Multiple servers, Update log, Common problems
@section The slow query log
When started with the @code{--log-slow-queries[=file_name]} option,
@code{mysqld} writes a log file containing all SQL commands that took
more than @code{long_query_time} to execute. data. If no file name is
given, it defaults to the name of the host machine suffixed with
@code{-slow.log}. If file name is given, but it doesn't contain a path
the file is written in the data directory.
The slow query log can be used to find queries that takes a long time to
execute and are thus candidates for optimization.
@cindex Database replication
@cindex Database replication
@cindex Replication, database
@cindex Replication, database
@cindex Database mirroring
@cindex Database mirroring
...
@@ -30113,7 +30137,7 @@ another host and you want to replicate the changes that have been made
...
@@ -30113,7 +30137,7 @@ another host and you want to replicate the changes that have been made
to the master database. @xref{Log Replication}.
to the master database. @xref{Log Replication}.
@cindex Multiple servers
@cindex Multiple servers
@node Multiple servers, ,
Update
log, Common problems
@node Multiple servers, ,
Slow query
log, Common problems
@section Running multiple MySQL servers on the same machine
@section Running multiple MySQL servers on the same machine
There are circumstances when you might want to run multiple servers on the same
There are circumstances when you might want to run multiple servers on the same
...
@@ -30163,10 +30187,11 @@ by specifying them at runtime as options to @code{safe_mysqld}:
...
@@ -30163,10 +30187,11 @@ by specifying them at runtime as options to @code{safe_mysqld}:
shell> /path/to/safe_mysqld --socket=file_name --port=port_number
shell> /path/to/safe_mysqld --socket=file_name --port=port_number
@end example
@end example
If you run the new server on the same database directory as another server
If you run the new server on the same database directory as another
with logging enabled, you should also specify the name of the log files
server with logging enabled, you should also specify the name of the log
to @code{safe_mysqld} with @code{--log} and @code{--log-update}. Otherwise,
files to @code{safe_mysqld} with @code{--log}, @code{--log-update} or
both servers may be trying to write to the same log file.
@code{--log-slow-queries}. Otherwise, both servers may be trying to
write to the same log file.
@strong{Warning}: Normally you should never have two servers that update
@strong{Warning}: Normally you should never have two servers that update
data in the same database! If your OS doesn't support fault-free system
data in the same database! If your OS doesn't support fault-free system
...
@@ -34165,7 +34190,7 @@ started to read and apply updates from the master.
...
@@ -34165,7 +34190,7 @@ started to read and apply updates from the master.
@code{mysqladmin processlist} only shows the connection and @code{INSERT
@code{mysqladmin processlist} only shows the connection and @code{INSERT
DELAYED} threads.
DELAYED} threads.
@node MySQL full-text search, , MySQL threads, MySQL internals
@node MySQL full-text search,
, MySQL threads, MySQL internals
@section MySQL full-text search
@section MySQL full-text search
Since version 3.23.23, @strong{MySQL} has support for full-text indexing
Since version 3.23.23, @strong{MySQL} has support for full-text indexing
...
@@ -35665,6 +35690,7 @@ though, so 3.23 is not released as a stable version yet.
...
@@ -35665,6 +35690,7 @@ though, so 3.23 is not released as a stable version yet.
(-g) by default. This option can be disabled with --enable-named-commands
(-g) by default. This option can be disabled with --enable-named-commands
(-G). This may cause incompatibility problems in some cases, for example
(-G). This may cause incompatibility problems in some cases, for example
in SQL scripts that use named commands without a semicolon, etc. !
in SQL scripts that use named commands without a semicolon, etc. !
Long format commands still work from the first line.
@item
@item
Fixed a problem when using many pending @code{DROP TABLE} statement at
Fixed a problem when using many pending @code{DROP TABLE} statement at
the same time.
the same time.
...
@@ -40215,7 +40241,7 @@ will ensure that your thread installation has even a remote chance to work!
...
@@ -40215,7 +40241,7 @@ will ensure that your thread installation has even a remote chance to work!
* Debugging server:: Debugging a @strong{MySQL} server
* Debugging server:: Debugging a @strong{MySQL} server
* Debugging client:: Debugging a @strong{MySQL} client
* Debugging client:: Debugging a @strong{MySQL} client
* The DBUG package:: The DBUG package
* The DBUG package:: The DBUG package
* Locking methods::
* Locking methods::
* RTS-threads:: Comments about RTS threads
* RTS-threads:: Comments about RTS threads
* Thread packages:: Differences between different thread packages
* Thread packages:: Differences between different thread packages
@end menu
@end menu
...
@@ -40362,15 +40388,19 @@ mysqld are using indexes properly. @xref{EXPLAIN, , @code{EXPLAIN}}. You
...
@@ -40362,15 +40388,19 @@ mysqld are using indexes properly. @xref{EXPLAIN, , @code{EXPLAIN}}. You
should also test complicated queries that didn't complete within the
should also test complicated queries that didn't complete within the
@code{mysql} command line tool.
@code{mysql} command line tool.
If you find the text @code{mysqld restarted} in the error log file (normally
You can find the queries that takes a long time to run by starting
named @file{hostname.err}) you have probably found a query that causes
@code{mysqld} with @code{--log-slow-queries}. @xref{Slow query log}.
@code{mysqld} to fail. If this happens you should check all your tables with
@code{myisamchk} (@pxref{Maintenance}), and test the queries in the
If you find the text @code{mysqld restarted} in the error log file
@strong{MySQL} log files to see if one doesn't work. If you find such a query,
(normally named @file{hostname.err}) you have probably found a query
try first upgrading to the newest @strong{MySQL} version. If this doesn't
that causes @code{mysqld} to fail. If this happens you should check all
help and you can't find anything in the @code{mysql} mail archive, you should
your tables with @code{myisamchk} (@pxref{Maintenance}), and test the
report the bug to @email{mysql@@lists.mysql.com}. Links to mail archives are
queries in the @strong{MySQL} log files to see if one doesn't work. If
available online at the @uref{http://www.mysql.com/documentation/, @strong{MySQL}
you find such a query, try first upgrading to the newest @strong{MySQL}
version. If this doesn't help and you can't find anything in the
@code{mysql} mail archive, you should report the bug to
@email{mysql@@lists.mysql.com}. Links to mail archives are available
online at the @uref{http://www.mysql.com/documentation/, @strong{MySQL}
documentation page}.
documentation page}.
If you get corrupted tables or if @code{mysqld} always fails after some
If you get corrupted tables or if @code{mysqld} always fails after some
Makefile.am
View file @
25929faf
...
@@ -26,7 +26,7 @@ SUBDIRS = include @docs_dirs@ @readline_dir@ @sql_client_dirs@ \
...
@@ -26,7 +26,7 @@ SUBDIRS = include @docs_dirs@ @readline_dir@ @sql_client_dirs@ \
@bench_dirs@ support-files
@bench_dirs@ support-files
# Relink after clean
# Relink after clean
CLEANFILES
=
linked_client_sources linked_server_sources
CLEANFILES
=
linked_client_sources linked_server_sources
linked_libmysql_sources linked_libmysql_r_sources
# This is just so that the linking is done early.
# This is just so that the linking is done early.
config.h
:
linked_client_sources linked_server_sources
config.h
:
linked_client_sources linked_server_sources
...
@@ -36,9 +36,11 @@ linked_client_sources: @linked_client_targets@
...
@@ -36,9 +36,11 @@ linked_client_sources: @linked_client_targets@
linked_libmysql_sources
:
linked_libmysql_sources
:
cd
libmysql
;
$(MAKE)
link_sources
cd
libmysql
;
$(MAKE)
link_sources
echo
timestamp
>
linked_libmysql_sources
linked_libmysql_r_sources
:
linked_libmysql_sources
linked_libmysql_r_sources
:
linked_libmysql_sources
cd
libmysql_r
;
$(MAKE)
link_sources
cd
libmysql_r
;
$(MAKE)
link_sources
echo
timestamp
>
linked_libmysql_r_sources
#avoid recursive make calls in sql directory
#avoid recursive make calls in sql directory
linked_server_sources
:
linked_server_sources
:
...
...
client/mysql.cc
View file @
25929faf
...
@@ -402,7 +402,7 @@ CHANGEABLE_VAR changeable_vars[] = {
...
@@ -402,7 +402,7 @@ CHANGEABLE_VAR changeable_vars[] = {
static
void
usage
(
int
version
)
static
void
usage
(
int
version
)
{
{
printf
(
"%s Ver 10.1
0
Distrib %s, for %s (%s)
\n
"
,
printf
(
"%s Ver 10.1
1
Distrib %s, for %s (%s)
\n
"
,
my_progname
,
MYSQL_SERVER_VERSION
,
SYSTEM_TYPE
,
MACHINE_TYPE
);
my_progname
,
MYSQL_SERVER_VERSION
,
SYSTEM_TYPE
,
MACHINE_TYPE
);
if
(
version
)
if
(
version
)
return
;
return
;
...
@@ -435,9 +435,10 @@ static void usage(int version)
...
@@ -435,9 +435,10 @@ static void usage(int version)
-g, --no-named-commands
\n
\
-g, --no-named-commands
\n
\
Named commands are disabled. Use
\\
* form only, or
\n
\
Named commands are disabled. Use
\\
* form only, or
\n
\
use named commands only in the beginning of a line
\n
\
use named commands only in the beginning of a line
\n
\
ending with a semicolon (;)
\n
\
ending with a semicolon (;) Since version 10.9 the
\n
\
Since version 10.9 the client now starts with this
\n
\
client now starts with this option ENABLED by
\n
\
option ENABLED by default! Disable with '-G'
\n
\
default! Disable with '-G'. Long format commands
\n
\
still work from the first line.
\n
\
-i, --ignore-space Ignore space after function names.
\n
\
-i, --ignore-space Ignore space after function names.
\n
\
-h, --host=... Connect to host.
\n
\
-h, --host=... Connect to host.
\n
\
-H, --html Produce HTML output.
\n
\
-H, --html Produce HTML output.
\n
\
...
@@ -690,12 +691,12 @@ static int read_lines(bool execute_commands)
...
@@ -690,12 +691,12 @@ static int read_lines(bool execute_commands)
if
(
!
in_string
&&
(
line
[
0
]
==
'#'
||
if
(
!
in_string
&&
(
line
[
0
]
==
'#'
||
(
line
[
0
]
==
'-'
&&
line
[
1
]
==
'-'
)
||
(
line
[
0
]
==
'-'
&&
line
[
1
]
==
'-'
)
||
line
[
0
]
==
0
))
line
[
0
]
==
0
))
continue
;
// Skip
p
comment lines
continue
;
// Skip comment lines
/* Check if line is a mysql command line */
/* Check if line is a mysql command line */
/* (We want to allow help, print and clear anywhere at line start */
/* (We want to allow help, print and clear anywhere at line start */
if
(
execute_commands
&&
!
no_named_cmds
&&
!
in_string
&&
if
(
execute_commands
&&
(
!
no_named_cmds
||
glob_buffer
.
is_empty
())
(
com
=
find_command
(
line
,
0
)))
&&
!
in_string
&&
(
com
=
find_command
(
line
,
0
)))
{
{
if
((
*
com
->
func
)(
&
glob_buffer
,
line
)
>
0
)
if
((
*
com
->
func
)(
&
glob_buffer
,
line
)
>
0
)
break
;
break
;
...
...
myisam/Makefile.am
View file @
25929faf
...
@@ -43,7 +43,7 @@ libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
...
@@ -43,7 +43,7 @@ libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_rsamepos.c mi_panic.c mi_close.c mi_create.c
\
mi_rsamepos.c mi_panic.c mi_close.c mi_create.c
\
mi_range.c mi_dbug.c mi_checksum.c mi_log.c
\
mi_range.c mi_dbug.c mi_checksum.c mi_log.c
\
mi_changed.c mi_static.c mi_delete_all.c
\
mi_changed.c mi_static.c mi_delete_all.c
\
mi_delete_table.c mi_rename.c mi_check.c
mi_debug.c
\
mi_delete_table.c mi_rename.c mi_check.c
\
ft_parser.c ft_search.c ft_stopwords.c ft_static.c
\
ft_parser.c ft_search.c ft_stopwords.c ft_static.c
\
ft_update.c sort.c
ft_update.c sort.c
CLEANFILES
=
test
?.MY? FT?.MY? isam.log mi_test_all
CLEANFILES
=
test
?.MY? FT?.MY? isam.log mi_test_all
...
...
myisam/mi_check.c
View file @
25929faf
...
@@ -16,8 +16,7 @@
...
@@ -16,8 +16,7 @@
/* Descript, check and repair of ISAM tables */
/* Descript, check and repair of ISAM tables */
#include "myisamdef.h"
#include "fulltext.h"
#include <m_ctype.h>
#include <m_ctype.h>
#include <stdarg.h>
#include <stdarg.h>
#include <getopt.h>
#include <getopt.h>
...
...
myisam/mi_dbug.c
View file @
25929faf
...
@@ -147,3 +147,26 @@ void _mi_print_key(FILE *stream, register MI_KEYSEG *keyseg,
...
@@ -147,3 +147,26 @@ void _mi_print_key(FILE *stream, register MI_KEYSEG *keyseg,
VOID
(
fputs
(
"
\"\n
"
,
stream
));
VOID
(
fputs
(
"
\"\n
"
,
stream
));
return
;
return
;
}
/* print_key */
}
/* print_key */
#ifdef EXTRA_DEBUG
my_bool
check_table_is_closed
(
const
char
*
name
,
const
char
*
where
)
{
char
filename
[
FN_REFLEN
];
LIST
*
pos
;
(
void
)
fn_format
(
filename
,
name
,
""
,
MI_NAME_IEXT
,
4
+
16
+
32
);
for
(
pos
=
myisam_open_list
;
pos
;
pos
=
pos
->
next
)
{
MI_INFO
*
info
=
(
MI_INFO
*
)
pos
->
data
;
MYISAM_SHARE
*
share
=
info
->
s
;
if
(
!
strcmp
(
share
->
filename
,
filename
))
{
fprintf
(
stderr
,
"Warning: Table: %s is open on %s
\n
"
,
name
,
where
);
return
1
;
}
}
return
0
;
}
#endif
/* EXTRA_DEBUG */
myisammrg/myrg_rkey.c
View file @
25929faf
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
int
myrg_rkey
(
MYRG_INFO
*
info
,
byte
*
record
,
int
inx
,
const
byte
*
key
,
int
myrg_rkey
(
MYRG_INFO
*
info
,
byte
*
record
,
int
inx
,
const
byte
*
key
,
uint
key_len
,
enum
ha_rkey_function
search_flag
)
uint
key_len
,
enum
ha_rkey_function
search_flag
)
{
{
uchar
*
key_buff
;
byte
*
key_buff
;
uint
pack_key_length
;
uint
pack_key_length
;
MYRG_TABLE
*
table
;
MYRG_TABLE
*
table
;
MI_INFO
*
mi
;
MI_INFO
*
mi
;
...
@@ -45,7 +45,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
...
@@ -45,7 +45,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
if
(
table
==
info
->
open_tables
)
if
(
table
==
info
->
open_tables
)
{
{
err
=
mi_rkey
(
mi
,
buf
,
inx
,
key
,
key_len
,
search_flag
);
err
=
mi_rkey
(
mi
,
buf
,
inx
,
key
,
key_len
,
search_flag
);
key_buff
=
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
key_buff
=
(
byte
*
)
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
pack_key_length
=
mi
->
last_rkey_length
;
pack_key_length
=
mi
->
last_rkey_length
;
}
}
else
else
...
...
myisammrg/myrg_rnext.c
View file @
25929faf
...
@@ -24,7 +24,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
...
@@ -24,7 +24,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
{
{
MYRG_TABLE
*
table
;
MYRG_TABLE
*
table
;
MI_INFO
*
mi
;
MI_INFO
*
mi
;
uchar
*
key_buff
;
byte
*
key_buff
;
uint
pack_key_length
;
uint
pack_key_length
;
int
err
;
int
err
;
...
@@ -50,7 +50,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
...
@@ -50,7 +50,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
if
(
table
<
info
->
end_table
)
if
(
table
<
info
->
end_table
)
{
{
mi
=
info
->
last_used_table
->
table
;
mi
=
info
->
last_used_table
->
table
;
key_buff
=
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
key_buff
=
(
byte
*
)
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
pack_key_length
=
mi
->
last_rkey_length
;
pack_key_length
=
mi
->
last_rkey_length
;
for
(;
table
<
info
->
end_table
;
table
++
)
for
(;
table
<
info
->
end_table
;
table
++
)
{
{
...
...
myisammrg/myrg_rprev.c
View file @
25929faf
...
@@ -24,7 +24,7 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
...
@@ -24,7 +24,7 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
{
{
MYRG_TABLE
*
table
;
MYRG_TABLE
*
table
;
MI_INFO
*
mi
;
MI_INFO
*
mi
;
uchar
*
key_buff
;
byte
*
key_buff
;
uint
pack_key_length
;
uint
pack_key_length
;
int
err
;
int
err
;
...
@@ -50,12 +50,13 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
...
@@ -50,12 +50,13 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
if
(
table
<
info
->
end_table
)
if
(
table
<
info
->
end_table
)
{
{
mi
=
info
->
last_used_table
->
table
;
mi
=
info
->
last_used_table
->
table
;
key_buff
=
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
key_buff
=
(
byte
*
)
mi
->
lastkey
+
mi
->
s
->
base
.
max_key_length
;
pack_key_length
=
mi
->
last_rkey_length
;
pack_key_length
=
mi
->
last_rkey_length
;
for
(;
table
<
info
->
end_table
;
table
++
)
for
(;
table
<
info
->
end_table
;
table
++
)
{
{
mi
=
table
->
table
;
mi
=
table
->
table
;
err
=
_mi_rkey
(
mi
,
NULL
,
inx
,
key_buff
,
pack_key_length
,
HA_READ_KEY_OR_PREV
,
FALSE
);
err
=
_mi_rkey
(
mi
,
NULL
,
inx
,
key_buff
,
pack_key_length
,
HA_READ_KEY_OR_PREV
,
FALSE
);
info
->
last_used_table
=
table
;
info
->
last_used_table
=
table
;
if
(
err
==
HA_ERR_KEY_NOT_FOUND
)
if
(
err
==
HA_ERR_KEY_NOT_FOUND
)
...
...
sql/mini_client.cc
View file @
25929faf
...
@@ -232,7 +232,7 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
...
@@ -232,7 +232,7 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
#else
#else
int
flags
,
res
,
s_err
;
int
flags
,
res
,
s_err
;
s
ocklen_
t
s_err_size
=
sizeof
(
uint
);
s
ize_socke
t
s_err_size
=
sizeof
(
uint
);
fd_set
sfds
;
fd_set
sfds
;
struct
timeval
tv
;
struct
timeval
tv
;
...
...
sql/mysqld.cc
View file @
25929faf
...
@@ -2460,11 +2460,15 @@ static void usage(void)
...
@@ -2460,11 +2460,15 @@ static void usage(void)
--log-isam[=file] Log all isam changes to file
\n
\
--log-isam[=file] Log all isam changes to file
\n
\
--log-long-format Log some extra information to update log
\n
\
--log-long-format Log some extra information to update log
\n
\
--low-priority-updates INSERT/DELETE/UPDATE has lower priority than selects
\n
\
--low-priority-updates INSERT/DELETE/UPDATE has lower priority than selects
\n
\
--log-slow-queries=[file]
\n
\
Log slow queries to this log file
\n
\
--pid-file=path Pid file used by safe_mysqld
\n
\
--pid-file=path Pid file used by safe_mysqld
\n
\
-P, --port=... Port number to use for connection
\n
\
-P, --port=... Port number to use for connection
\n
\
-n, --new Use very new possible 'unsafe' functions
\n
\
-n, --new Use very new possible 'unsafe' functions
\n
\
-o, --old-protocol Use the old (3.20) protocol
\n
\
-o, --old-protocol Use the old (3.20) protocol
\n
\
--one-thread Only use one thread (for debugging under Linux)
\n
\
--one-thread Only use one thread (for debugging under Linux)
\n
"
);
/* We have to break the string here because of VC++ limits */
puts
(
"\
-O, --set-variable var=option
\n
\
-O, --set-variable var=option
\n
\
Give a variable an value. --help lists variables
\n
\
Give a variable an value. --help lists variables
\n
\
-Sg, --skip-grant-tables
\n
\
-Sg, --skip-grant-tables
\n
\
...
...
sql/sql_parse.cc
View file @
25929faf
...
@@ -1137,16 +1137,21 @@ mysql_execute_command(void)
...
@@ -1137,16 +1137,21 @@ mysql_execute_command(void)
goto
error
;
goto
error
;
for
(
table
=
tables
;
table
;
table
=
table
->
next
->
next
)
for
(
table
=
tables
;
table
;
table
=
table
->
next
->
next
)
{
{
if
(
check_access
(
thd
,
ALTER_ACL
,
table
->
db
,
&
table
->
grant
.
privilege
)
||
if
(
check_access
(
thd
,
ALTER_ACL
|
DROP_ACL
,
table
->
db
,
&
table
->
grant
.
privilege
)
||
check_access
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
table
->
next
->
db
,
check_access
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
table
->
next
->
db
,
&
table
->
next
->
grant
.
privilege
))
&
table
->
next
->
grant
.
privilege
))
goto
error
;
goto
error
;
if
(
grant_option
)
if
(
grant_option
)
{
{
if
(
check_grant
(
thd
,
ALTER_ACL
,
table
)
||
TABLE_LIST
old_list
,
new_list
;
old_list
=
table
[
0
];
new_list
=
table
->
next
[
0
];
old_list
.
next
=
new_list
.
next
=
0
;
if
(
check_grant
(
thd
,
ALTER_ACL
,
&
old_list
)
||
(
!
test_all_bits
(
table
->
next
->
grant
.
privilege
,
(
!
test_all_bits
(
table
->
next
->
grant
.
privilege
,
INSERT_ACL
|
CREATE_ACL
)
&&
INSERT_ACL
|
CREATE_ACL
)
&&
check_grant
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
table
->
nex
t
)))
check_grant
(
thd
,
INSERT_ACL
|
CREATE_ACL
,
&
new_lis
t
)))
goto
error
;
goto
error
;
}
}
}
}
...
...
tests/grant.pl
View file @
25929faf
...
@@ -40,9 +40,9 @@ $columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
...
@@ -40,9 +40,9 @@ $columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
# clear grant tables
# clear grant tables
#
#
$dbh
=
DBI
->
connect
("
DBI:mysql:mysql:
$opt_host
;mysql_read_default_group=perl
",
$dbh
=
DBI
->
connect
("
DBI:mysql:mysql:
$opt_host
",
$opt_root_user
,
$opt_password
,
$opt_root_user
,
$opt_password
,
{
PrintError
=>
0
})
||
die
"
Can't connect to mysql server:
$DBI
::errstr
\n
";
{
PrintError
=>
0
})
||
die
"
Can't connect to mysql server
with user '
$opt_root_user
'
:
$DBI
::errstr
\n
";
safe_query
("
delete from user where user='
$opt_user
' or user='
${opt_user}
2'
");
safe_query
("
delete from user where user='
$opt_user
' or user='
${opt_user}
2'
");
safe_query
("
delete from db where user='
$opt_user
'
");
safe_query
("
delete from db where user='
$opt_user
'
");
...
@@ -171,8 +171,7 @@ user_query("create table $opt_database.test2 (a int not null)");
...
@@ -171,8 +171,7 @@ user_query("create table $opt_database.test2 (a int not null)");
user_query
("
alter table
$opt_database
.test2 add b int
");
user_query
("
alter table
$opt_database
.test2 add b int
");
user_query
("
create index dummy on
$opt_database
.test2 (a)
");
user_query
("
create index dummy on
$opt_database
.test2 (a)
");
user_query
("
drop table
$opt_database
.test2
");
user_query
("
drop table
$opt_database
.test2
");
user_query
("
show tables
");
user_query
("
show tables from grant_test
");
# These should fail
# These should fail
user_query
("
insert into mysql.user (host,user) values ('error','
$opt_user
',0)
",
1
);
user_query
("
insert into mysql.user (host,user) values ('error','
$opt_user
',0)
",
1
);
...
@@ -242,7 +241,22 @@ user_query("grant select on $opt_database.test2 to $user with grant option",1);
...
@@ -242,7 +241,22 @@ user_query("grant select on $opt_database.test2 to $user with grant option",1);
safe_query
("
grant drop on
$opt_database
.test2 to
$user
with grant option
");
safe_query
("
grant drop on
$opt_database
.test2 to
$user
with grant option
");
user_query
("
grant drop on
$opt_database
.test2 to
$user
with grant option
");
user_query
("
grant drop on
$opt_database
.test2 to
$user
with grant option
");
user_query
("
grant select on
$opt_database
.test2 to
$user
with grant option
",
1
);
user_query
("
grant select on
$opt_database
.test2 to
$user
with grant option
",
1
);
user_query
("
drop table
$opt_database
.test2
");
# check rename privileges
user_query
("
rename table
$opt_database
.test2 to
$opt_database
.test3
",
1
);
safe_query
("
grant CREATE,DROP on
$opt_database
.test3 to
$user
");
user_query
("
rename table
$opt_database
.test2 to
$opt_database
.test3
",
1
);
user_query
("
create table
$opt_database
.test3 (a int)
");
safe_query
("
grant INSERT on
$opt_database
.test3 to
$user
");
user_query
("
drop table
$opt_database
.test3
");
user_query
("
rename table
$opt_database
.test2 to
$opt_database
.test3
");
user_query
("
rename table
$opt_database
.test3 to
$opt_database
.test2
",
1
);
safe_query
("
grant ALTER on
$opt_database
.test3 to
$user
");
user_query
("
rename table
$opt_database
.test3 to
$opt_database
.test2
");
safe_query
("
revoke DROP on
$opt_database
.test2 from
$user
");
user_query
("
rename table
$opt_database
.test2 to
$opt_database
.test3
");
user_query
("
drop table if exists
$opt_database
.test2,
$opt_database
.test3
",
1
);
safe_query
("
drop table if exists
$opt_database
.test2,
$opt_database
.test3
");
# Check that the user doesn't have some user privileges
# Check that the user doesn't have some user privileges
user_query
("
create database
$opt_database
",
1
);
user_query
("
create database
$opt_database
",
1
);
...
@@ -253,9 +267,9 @@ safe_query("flush privileges");
...
@@ -253,9 +267,9 @@ safe_query("flush privileges");
safe_query
("
select
$tables_cols
from mysql.tables_priv
");
safe_query
("
select
$tables_cols
from mysql.tables_priv
");
safe_query
("
revoke ALL PRIVILEGES on
$opt_database
.test from
$user
");
safe_query
("
revoke ALL PRIVILEGES on
$opt_database
.test from
$user
");
safe_query
("
revoke ALL PRIVILEGES on
$opt_database
.test2 from
$user
");
safe_query
("
revoke ALL PRIVILEGES on
$opt_database
.test2 from
$user
");
safe_query
("
revoke ALL PRIVILEGES on
$opt_database
.test3 from
$user
");
safe_query
("
revoke GRANT OPTION on
$opt_database
.test2 from
$user
");
safe_query
("
revoke GRANT OPTION on
$opt_database
.test2 from
$user
");
safe_query
("
select
$tables_cols
from mysql.tables_priv
");
safe_query
("
select
$tables_cols
from mysql.tables_priv
");
user_query
("
select count(a) from test
",
1
);
user_query
("
select count(a) from test
",
1
);
#
#
...
@@ -435,7 +449,8 @@ sub print_info
...
@@ -435,7 +449,8 @@ sub print_info
my
$tmp
;
my
$tmp
;
print
<<EOF;
print
<<EOF;
This test will clear your table and column grant table and recreate the
This test will clear your table and column grant table and recreate the
$opt_database database ! All privileges for $user will be destroyed !
$opt_database database !
All privileges for $user will be destroyed !
Don\'t run this test if you have done any GRANT commands that you want to keep!
Don\'t run this test if you have done any GRANT commands that you want to keep!
EOF
EOF
...
...
tests/grant.res
View file @
25929faf
...
@@ -119,7 +119,7 @@ Error in execute: Access denied for user: 'grant_user@localhost' to database 'gr
...
@@ -119,7 +119,7 @@ Error in execute: Access denied for user: 'grant_user@localhost' to database 'gr
drop table grant_test.test
drop table grant_test.test
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
Error in execute: Access denied for user: 'grant_user@localhost'
(Using password: NO)
Error in execute: Access denied for user: 'grant_user@localhost'
to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
Connecting grant_user
Connecting grant_user
insert into grant_test.test values (5,0)
insert into grant_test.test values (5,0)
...
@@ -145,7 +145,9 @@ create table grant_test.test2 (a int not null)
...
@@ -145,7 +145,9 @@ create table grant_test.test2 (a int not null)
alter table grant_test.test2 add b int
alter table grant_test.test2 add b int
create index dummy on grant_test.test2 (a)
create index dummy on grant_test.test2 (a)
drop table grant_test.test2
drop table grant_test.test2
show tables
show tables from grant_test
test
insert into mysql.user (host,user) values ('error','grant_user',0)
insert into mysql.user (host,user) values ('error','grant_user',0)
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
...
@@ -239,7 +241,24 @@ grant drop on grant_test.test2 to grant_user@localhost with grant option
...
@@ -239,7 +241,24 @@ grant drop on grant_test.test2 to grant_user@localhost with grant option
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant select on grant_test.test2 to grant_user@localhost with grant option
grant select on grant_test.test2 to grant_user@localhost with grant option
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
drop table grant_test.test2
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
grant CREATE,DROP on grant_test.test3 to grant_user@localhost
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
create table grant_test.test3 (a int)
grant INSERT on grant_test.test3 to grant_user@localhost
drop table grant_test.test3
rename table grant_test.test2 to grant_test.test3
rename table grant_test.test3 to grant_test.test2
Error in execute: alter command denied to user: 'grant_user@localhost' for table 'test3'
grant ALTER on grant_test.test3 to grant_user@localhost
rename table grant_test.test3 to grant_test.test2
revoke DROP on grant_test.test2 from grant_user@localhost
rename table grant_test.test2 to grant_test.test3
drop table if exists grant_test.test2,grant_test.test3
Error in execute: drop command denied to user: 'grant_user@localhost' for table 'test2'
drop table if exists grant_test.test2,grant_test.test3
create database grant_test
create database grant_test
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
drop database grant_test
drop database grant_test
...
@@ -248,15 +267,15 @@ flush tables
...
@@ -248,15 +267,15 @@ flush tables
Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
flush privileges
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2
grant_user@localhost Update,Delete,Create,Drop
,Grant,Index,Alter Insert
localhost grant_test grant_user test2
root@localhost Update,Delete,Create
,Grant,Index,Alter Insert
localhost grant_test grant_user test root@localhost Select,Insert,Update,Delete
localhost grant_test grant_user test root@localhost Select,Insert,Update,Delete
localhost grant_test grant_user test3 root@localhost Insert,Create,Drop,Alter
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test2 from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test2 from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test3 from grant_user@localhost
revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
select count(a) from test
select count(a) from test
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
delete from grant_test.test where a=2
delete from grant_test.test where a=2
...
@@ -284,13 +303,10 @@ select a,A from test
...
@@ -284,13 +303,10 @@ select a,A from test
7 7
7 7
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Delete Select,Update
localhost grant_test grant_user test root@localhost Delete Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
revoke GRANT OPTION on grant_test.test from grant_user@localhost
revoke GRANT OPTION on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
grant select(a) on grant_test.test to grant_user@localhost
grant select(a) on grant_test.test to grant_user@localhost
...
@@ -328,7 +344,6 @@ Error in execute: select command denied to user: 'grant_user@localhost' for colu
...
@@ -328,7 +344,6 @@ Error in execute: select command denied to user: 'grant_user@localhost' for colu
update test set b=3 where b > 0
update test set b=3 where b > 0
Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
...
@@ -337,7 +352,6 @@ localhost grant_test grant_user test a Select
...
@@ -337,7 +352,6 @@ localhost grant_test grant_user test a Select
revoke select(a), update (b) on grant_test.test from grant_user@localhost
revoke select(a), update (b) on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Insert
localhost grant_test grant_user test root@localhost Insert
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
...
@@ -355,7 +369,6 @@ insert into test (b) values (9)
...
@@ -355,7 +369,6 @@ insert into test (b) values (9)
update test set b=6 where b > 0
update test set b=6 where b > 0
flush privileges
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
...
@@ -402,7 +415,6 @@ select * from mysql.db where user = 'grant_user'
...
@@ -402,7 +415,6 @@ select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N
localhost grant_test grant_user N Y N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
...
@@ -418,8 +430,6 @@ select * from mysql.db where user = 'grant_user'
...
@@ -418,8 +430,6 @@ select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N
localhost grant_test grant_user N Y N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
delete from user where user='grant_user'
delete from user where user='grant_user'
flush privileges
flush privileges
...
...
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