This is a modifiction of my previous patch after receiving feedback. This is a better way to fix the problem. With this patch, data directory and index directory will use only forward slashes (/) when on Windows.
mysqldump.c:
Removed fixPaths routine. Was improper fix for bug #6660
sql_show.cc:
Changed append_directory to convert backslashes to foward slashes when on Windows.
This really should not happen on Windows and part of the problem not fixed here is why show create table includes data directory when being run on Windows. However, this patch fixes the bug in mysqldump.c
mysqldump.c:
Added fixPaths function to convert \ to / in data directory and index directory entries only on Windows
Change string->float conversion to delay division as long as possible.
This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740)
Added the get_actual_table_name function that issues a SHOW TABLES LIKE '%s'. This will get the table
name in the proper case. We use this table name rather than the one given on the command line. This will
prevent problems when importing SQL on Linux that was generated on a Windows platform where case can be
an issue.
mysqldump.c:
call get_actual_table_name to get the table name in the proper case
Fixed bug by adding code that displays the contents of mysql.host when \p is added as part of the prompt.
mysql.cc:
Added code to display mysql.host as prompt when using shared memory
(back to behaviour of 4.1.7). Warning was not fatal: mysqldump continued. And the good thing is that it helped spot that starting from 4.1.7,
SHOW CREATE DATABASE failed (if --single-transaction and first db has non-empty InnoDB table and there is a second db) and thus mysqldump
produced CREATE DATABASE statements missing the CHARACTER SET clause. Removing the bug which was in the server, and the warning reporting in
mysqldump (compatibility with old servers).
corrected mysql_test_run_new.dsp
added dependency
corrected path of mysql_test_run_new.dsp
fixed wrong code
added my_create_tables.c
removed command_line
fixed #elif
restored NAME_MAX and MAX_FNAME
added create_system_files()
added compare() for windows
added all files of testes in script
added mysql-test in script
Moved "../regex/libregex.a" before "../libmysql/libmysqlclient.la"
when linking. For -all-static linking libtool put -lc after the .la
file and this put the libc regex functions before our regex functions
when linking on Linux.
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
clause the the SELECT statement used to dump the data
for any table which has a primary or unique key. This
is useful for dumping MyISAM tables which will be later
imported into InnoDB tables.
added libs variable for ndbmgmclient used by mysqladmin
add linkage with @ndb_mgmclient_libs@
additional options for ndbcluster
added support for managing the cluster to mysqladmin
added DEFINE_CXA_PURE_VIRTUAL flag to CFLAGS to enable linkage with c++ libs
use macros for C_MODE_START/END so that define of FIX_GCC_LINKING_PROBLEM works in c-programs
binlog coordinates corresponding to the dump".
The good news is that now mysqldump can be used to get an online backup of InnoDB *which works for
point-in-time recovery and replication slave creation*. Formerly, mysqldump --master-data --single-transaction
used to call in fact mysqldump --master-data, so the dump was not an online dump (took big lock all time of dump).
The only lock which is now taken in this patch is at the beginning of the dump: mysqldump does:
FLUSH TABLES WITH READ LOCK; START TRANSACTION WITH CONSISTENT SNAPSHOT; SHOW MASTER STATUS; UNLOCK TABLES;
so the lock time is in fact the time FLUSH TABLES WITH READ LOCK takes to return (can be 0 or very long, if
a table is undergoing a huge update).
I have done some more minor changes listed in the paragraph of mysqldump.c.
WL#2237 "WITH CONSISTENT SNAPSHOT clause for START TRANSACTION":
it's a START TRANSACTION which additionally starts a consistent read on all
capable storage engine (i.e. InnoDB). So, can serve as a replacement for
BEGIN; SELECT * FROM some_innodb_table LIMIT 1; which starts a consistent read too.
Revise the --hex-blob help message string. (This will need
revising after merge to 4.1, too, but the CHAR BINARY and
VARCHAR BINARY data types will be BINARY and VARBINRY.)
Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root.
This gives us the following benefits:
- Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases)
- Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT)
- We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root
- 'mysqldump --help' comment that --xeh-blob
doesn't work with --extended-inserts was removed.
It does work now. Thanks to Lachlan
who noticed this wrong help message.
- Switched to use the recently introduced
mysql_hex_string() instead of slow sprintf().
Thanks to Sinisa for the idea.
- 'mysqldump --hex-blob' dumps in HEX not only
BLOBs but also BINARY(x) columns.
Thanks to Paul.
Added protocol::flush() for easier embedded-server code
Increase block allocation variables a bit as they where a bit too small for MySQL 4.1
Added option --silent to client_test
WL#2067 add features to mysqltest: "disable_error_abort" + "$mysql_errno"
$mysql_errno is a new builtin variable of mysqltest and contains the
return code of the last command send to the server.
"--disable_abort_on_error" switches the abort of mysqltest
after "unmasked" failing statements off.
"--enable_abort_on_error" switches the abort of mysqltest
after "unmasked" failing statements on. (default)
"Maskings" are
!$<error number> and --error <error number>
in the line before the statement to be checked.
The benefit of the option "--disable_abort_on_error" is that
- all statements after the failing statement are executed
- a r/<test>.reject will be produced
- it is possible to write test cases, which perform
code sequences depending on the return code of a single
statement
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
Simple optimzations and cleanups
Removed compiler warnings and fixed portability issues
Added client functions 'mysql_embedded()' to allow client to check if we are using embedded server
Fixes for purify
Original code was checking ! unix_socket for local_file flag. This doesn't work and so was removed. Now
to import a local file, you must use the --local command line option.
mysqlimport.c:
Removed check of unix_socket to set local_file
Run client_test as a testcase
new file
mysql-test-run.sh:
More clearly report failure if --force, also exit 1
client_test.c:
Use MAXPATHLEN in test_frm_bug()
Renable test cases disabled for running from mysql-test-run
mysqltest.c:
Don't check errno from popen, may not be set
Added timing output for each test case.
Added --embedded-server option.
mysqltest.c:
Added 'start_timer', 'end_timer' commands
Makefile.am:
Include mysys/my_getsystime.c to get time function in mysqltest
Many files:
new file
Return exit(1) instead of exit(0) on failure.
Allow longer path names using MAXPATHLEN.
Added option --testcase that skips some failing tests.
Replaced 'return' with exit(1) in test_frm_bug().
mysqltest.c:
Let --exec fail if command fails
BUG# 5229 --password=foobar does not override the empty 'password' option in the my.cnf
This is a backport of a change made by jani in the 4.1 tree.
mysql.cc:
Add tty_password=0 in the p case handling in get_one_option
used in the handle_options() function (instead of using additional
handle_option() parameter). The default value of the
my_getopt_error_reporter is default_reporter(). One can set it to
other functions if case of need.
Added declarations for print_msg_to_log and vprint_msg_to_log. sql_print_error are simple functions that wrap calls to print_msg_to_log. Define the different error types with MY_ERROR_TYPE, MY_WARNING_TYPE, and MY_INFORMATION_TYPE
gen_lex_hash.cc:
Added NULL error reporting parameter to handle_options
log.cc:
Add print_msg_to_log, print_buffer_to_log, and vprint_msg_to_log. Print_msg_to_log will write the message to the windows event log if on NT. We now have error, warning, and information versions of sql_print_xxxx. T his is a variation of a similar changeset WAX did.
mysqld.cc:
Added option_error_reporter callback function and pass that into handle_options
mysql.cc:
Added NULL as error reporter arg to the end of handle_options
Many files:
Added NULL error reporter parameter as the last paramter to handle_options
my_getopt.c:
Added second function pointer to server as an error reporting callback. Added local function report_option_error that will either write the error to stderr or to the error reporting callback. changed all calls in handle_options from fprintf(stderr, ... ) to report_option_error
my_getopt.h:
Changed declaration of handle_options to use typedefs for the two function pointers. added second function pointer to server as an error reporting callback
mysqld.dsp:
Added custom build step for compiling message file and added message resource file (output of mc)
options for mysqlbinlog, with a test file.
This enables user to say "recover my database to how it was this morning at 10:30"
(mysqlbinlog "--stop-datetime=2003-07-29 10:30:00").
Using time functions into client/ made me move them out of sql/ into sql-common/.
+ (small) fix for BUG#4507 "mysqlbinlog --read-from-remote-server sometimes
cannot accept 2 binlogs" (that is, on command line).
BUG#4506 "mysqlbinlog --position --read-from-remote-server has wrong "# at" lines",
BUG#4553 "Multi-table DROP TABLE replicates improperly for nonexistent table" with a test file.
It was not possible to add a test for BUG#4506 as in the test suite we must use --short-form
which does not display the "# at" lines.
if a command has a comment at the end of line, like:
error 2002 ; # this is error 2002
then the parsing of comment should not make mysqltest
forget about the value of expected error.
Reason it forgot it (so the next query caused the test to fail)
is that internally the above line is 2 queries.
Won't be pushed as is - separate email sent for internal review.
WL#1717 "binlog-innodb consistency".
Now when mysqld starts, if InnoDB does a crash recovery, we use the binlog name
and position retrieved from InnoDB (corresponding to the last transaction
successfully committed by InnoDB) to cut any rolled back transaction from
the binary log. This is triggered by the --innodb-safe-binlog option.
Provided you configure mysqld to fsync() InnoDB at every commit (using
flush_log_at_trx_commit) and to fsync() the binlog at every write
(using --sync-binlog=1), this behaviour guarantees that a master always has
consistency between binlog and InnoDB, whenever the crash happens.
6 tests to verify that it works.
Server will however still accept shutdown without specified level; so that old
mysqladmin can still shut server down.
I would like your comments on the names of shutdown level which I chose. You
are welcome to propose better names. Please however check WL#709 before.
Reason for the names I propose is to be accurate, thus leaving possibility
for other levels which we may imagine in the future; that's why I have rejected
names like "fast", "smart", "graceful" so far. My position is that WAIT_ALL_BUFFERS
or WAIT_CRITICAL_BUFFERS say what the shutdown does, whereas for "smart", "fast" you
need to remember what it does.
This should be pushed in 4.1.3 but only after your comments.
Dump could fail to load because of --default-character-set command line option.
More safe dump is now produces, --default-character-set doesn't matter.
produce hex digits in lower case). (fixed version)
Replaced _dig_vec array with two _dig_vec_upper/_dig_vec_lower arrays.
Added extra argument to int2str function which controls case of digits you get.
Replaced lot of invocations of int2str for decimal radix with more optimized int10_to_str()
function.
Removed unused my_itoa/my_ltoa functions.
It causes mysqlbinlog to not stop after the end of the requested binlog, and instead read
until the end of the last binlog of mysqld (beware of endless loops if you pipe this
into the same mysqld).
I.e. it enables back (at customer's request) what we considered (and I still do)
as BUG#3204, but now with an option instead of being the default behaviour.
The default behaviour is still to stop after the end of the requested binlog,
whether --read-from-remote-server or not.
by adding sleep-and-retries (max 4 times) if MASTER_POS_WAIT() returns NULL
in sync_with_master and sync_slave_with_master.
The problem showed up only today, in MySQL 5.0 in rpl_server_id2.test,
but may affect 4.x as well, so fixing it here. Note that I am also fixing
5.0 too, with the same exact patch, because I don't want to leave 5.0 broken
until the next 4.0->4.1->5.0 merge.
allow several -e on the command line
clarify --help text
make -B to work as advertised
in force mode execute the rest of multi-statement line in case of error in one statement
Fixed security problem that password was temporarly reset when someone changed GRANT for a user. (Bug #3404)
Fixed problem with PROCEDURE analyse() and impossible WHERE (Bug #2238)
Don't auto-repair tables in mysqlcheck if table type doesn't support 'check' command.
Marked --no-set-names as deprecated, the name is misleading and --no- in front
makes it cumbersome to use with --disable or --skip prefixes.
The old option will still work for the time being.