Commit graph

3527 commits

Author SHA1 Message Date
Michael Widenius
f458e198c0 Merge with 5.2 2011-05-16 14:05:45 +03:00
Vladislav Vaintroub
19f0d6b2d9 Small CMake fixes :
- add version info for the client library, dynamic plugins and some utilities
- do not recompile client library sources 3 times (for mysqlclient , mysqlclient_notls and libmysql)
  One time is sufficient, so get rid of mysqlclient_notls, and link  static client library  to  the shared.
- remove incremental linking flag
2011-05-15 13:38:18 +02:00
Michael Widenius
f09f1c7c7d Merge with dynamic column code 2011-05-12 14:30:34 +03:00
Michael Widenius
4c81cef75d Fixed bug when accessing wrong decimal value in dynamic string (Fixed lp:781233)
Store decimal 0.0 in zero bytes in dynamic strings.
mysqltest: Don't ignore error from mysql_stmt_fetch;  This could cause rows to be missing from log when running with --ps-protocol
Fixed wrong result length for CAST(... as TIME)






client/mysqltest.cc:
  Don't ignore error from mysql_stmt_fetch;  This could cause rows to be missing from log when running with --ps-protocol
libmysql/libmysql.c:
  The max length for a TIME column is 17, not 15.
mysql-test/r/dyncol.result:
  More tests
mysql-test/t/dyncol.test:
  More tests
mysys/ma_dyncol.c:
  Check content of decimal value on read and store to not get assert in decimal_bin_size().
  Store decimal 0.0 in zero bytes in dynamic strings. This also solves a problem where decimal 0 had different internal representations.
sql-common/my_time.c:
  Fixed DBUG_PRINT
sql/item_timefunc.h:
  Fixed wrong result length for CAST(... as TIME). This was the cause of failures in buildbot when doing cast(... as time);
sql/protocol.cc:
  More DBUG_PRINT
2011-05-12 02:19:28 +03:00
Michael Widenius
f34be18938 Merge with MariaDB 5.2 2011-05-10 18:17:43 +03:00
Michael Widenius
4cb68c0e89 mysqltest: Write command to be executed to the log BEFORE executing the command.
Fixed race condition in event that could cause hang when stopping event scheduler with SET GLOBAL event_scheduler=OFF 

client/mysqltest.cc:
  Write command to be executed to the log BEFORE executing the command.
  This makes it easier to debug crashes as the log will contain the fatal command.
mysql-test/r/mysqltest.result:
  Updated results (we now get more things logged)
sql/event_queue.cc:
  Fixed race condition in event that could cause hang when stopping event scheduler with SET GLOBAL event_scheduler=OFF.
  The reason was that a kill signal could be sent between last check of thd->killed and before thd->enter_cond() in which case the signal
  would be missed and we would be stuck in Event_scheduler::stop() forever.
2011-05-09 14:38:49 +03:00
Michael Widenius
718ddbb2ca Automatic merge with 5.1 2011-05-04 22:25:56 +03:00
Michael Widenius
3c9ae014ca Fixed build errors on centos5-amd64-minimal, where we compile with very few character sets
Fixed compiler warnings

client/readline.cc:
  Fixed compiler warning
mysql-test/t/mysqldump.test:
  Only run test if utf8 is used
sql/log.cc:
  Fixed compiler warning
sql/mysql_priv.h:
  Fixed compiler warnings
tests/mysql_client_test.c:
  Don't abort test if ucs2 is not in use.
2011-05-04 21:28:02 +03:00
unknown
32d88236f2 MWL#180: merge fixes from 5.2-rpl + forgot to adjust revision from which checksums are supported when merging into 5.3-based tree. 2011-05-04 15:44:29 +02:00
unknown
7a36035bd2 MWL#180 Buildbot fixes:
- Fix windows CMake build.
 - Merge some later test case fixes, to see if they solve the random rpl_checksum failure.
2011-05-04 15:41:05 +02:00
Michael Widenius
7191a44b4c Automatic merge 2011-05-04 12:04:13 +03:00
Vladislav Vaintroub
7d8a918c64 Fix warning (unused local variable) 2011-05-03 19:30:21 +02:00
Michael Widenius
1be5462d59 Merge with MariaDB 5.1 2011-05-03 19:10:10 +03:00
unknown
284f52476c Merge MWL#180, binlog checksum backport, into MariaDB 5.3-based tree. 2011-05-03 14:44:25 +02:00
unknown
014b8e7f43 Backport MySQL WL#2540 into MariaDB.
Patch backported:

bzr diff
'-rrevid:alfranio.correia@oracle.com-20101121143257-se3vpqus73l4mum0
..revid:luis.soares@oracle.com-20101124111752-9b8260bd1qak87hr'
--old=lp:mysql-server --new=lp:mysql-server
2011-05-03 14:01:11 +02:00
Michael Widenius
e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00
unknown
64e43e1cc8 Merge various replication-related patches into MariaDB 5.3:
- MWL#116 Group commit
 - MWL#136 Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT
 - MWL#47 Annotate_rows_log_event
 - MWL#163 innodb_release_locks_early
 - Percona patch enhancing row-based replication for tables with no primary key
2011-04-08 09:39:33 +02:00
Nirbhay Choubey
cb0e49c000 Bug#11765157 - 58090: mysqlslap drops schema specified in
create_schema if auto-generate-sql also set.

mysqlslap uses a schema to run its tests on and later
drops it if auto-generate-sql is used. This can be a
problem, if the schema is an already existing one.

If create-schema is used with auto-generate-sql option,
mysqlslap while performing the cleanup, drops the specified
database.

Fixed by introducing an option --no-drop, which, if used,
will prevent the dropping of schema at the end of the test.


client/client_priv.h:
  Bug#11765157 - 58090: mysqlslap drops schema specified in
                 create_schema if auto-generate-sql also set.
  
  Added an option.
client/mysqlslap.c:
  Bug#11765157 - 58090: mysqlslap drops schema specified in
                 create_schema if auto-generate-sql also set.
  
  Introduced an option 'no-drop' to forbid the removal of schema
  even if 'create' or 'auto-generate-sql' options are used.
mysql-test/r/mysqlslap.result:
  Added a testcase for Bug#11765157.
mysql-test/t/mysqlslap.test:
  Added a testcase for Bug#11765157.
2011-04-08 12:22:44 +05:30
unknown
c677fea7d0 Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl. 2011-04-01 15:07:10 +02:00
Vladislav Vaintroub
493a9108ae merge 2011-03-26 00:15:33 +01:00
Sven Sandberg
f1b638d33c BUG#11766427, BUG#59539: Filter by server id in mysqlbinlog fails
Problem: mysqlbinlog --server-id may filter out Format_description_log_events.
If mysqlbinlog does not process the Format_description_log_event,
then mysqlbinlog cannot read the rest of the binary log correctly.
This can have the effect that mysqlbinlog crashes, generates an error,
or generates output that causes mysqld to crash, generate an error,
or corrupt data.
Fix: Never filter out Format_description_log_events. Also, never filter
out Rotate_log_events.


client/mysqlbinlog.cc:
  Process Format_description_log_events even when the
  server_id does not match the number given by --server-id.
mysql-test/t/mysqlbinlog.test:
  Add test case.
2011-03-25 15:16:13 +01:00
Michael Widenius
eaed26053d Merge with base 5.2 2011-03-23 19:22:38 +02:00
Michael Widenius
0fae0335d4 Ensure that all clients reads the appropriate 'client', client-mariadb and 'mariadb' sections from my.cnf
The mysqld server and all clients now reads the new client-server section
Fixed that mysqldumpslow supports new slow log formats and new mysqld --slow- options


client/mysql.cc:
  Read also client-server and client-mariadb sections.
client/mysql_upgrade.c:
  Read also client-server and client-mariadb sections.
client/mysqladmin.cc:
  Read also client-server and client-mariadb sections.
client/mysqlbinlog.cc:
  Read also client-server and client-mariadb sections.
client/mysqlcheck.c:
  Read also client-server and client-mariadb sections.
client/mysqldump.c:
  Read also client-server and client-mariadb sections.
client/mysqlimport.c:
  Read also client-server and client-mariadb sections.
client/mysqlshow.c:
  Read also client-server and client-mariadb sections.
client/mysqltest.cc:
  Read also client-server and client-mariadb sections.
extra/my_print_defaults.c:
  Updated help text
scripts/mysql_fix_privilege_tables.sh:
  Read also sections client client-server client-mariadb
scripts/mysql_install_db.pl.in:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
scripts/mysql_install_db.sh:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
  Added --lose-skip-pbxt to bootstrap
scripts/mysql_secure_installation.sh:
  Read also groups client-server and client-mariadb
scripts/mysqld_multi.sh:
  Read also group mariadb
scripts/mysqld_safe.sh:
  Read also groups mariadb server and client-server
scripts/mysqldumpslow.sh:
  Fixed to support new slow log formats
  Added sorting on -ae (aggregated number of retreived rows) and e (retrieved rows)
  Read also group 'mariadb'
  If there is many instances of same option, use last one.
  Get slow log file from options log-slow-queries=filename or query-log-file=filename
  Added support for future --log-basename option
sql-common/client.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/mysql_client_test.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/thread_test.c:
  Read also groups 'client-server' and 'client-mariadb'
2011-03-18 17:03:43 +02:00
Bjorn Munch
c85237485a Bug #11885854 MYSQLTEST: PS-PROTOCOL IMPLIED BY CURSOR-PROTOCOL LOST AFTER ENABLE_PS_PROTOCOL
The condition cursor-protocol => ps-protocol was done at "current setting" level"
Moved it to "set by command line" level
2011-03-18 12:13:54 +01:00
Vladislav Vaintroub
75625f5652 merge mwl#55 2011-03-11 15:20:24 +01:00
Vladislav Vaintroub
41d432462b merge 5.2 2011-03-10 09:39:14 +01:00
Michael Widenius
139a2b64bf Merge with 5.2 2011-03-09 15:47:59 +02:00
Michael Widenius
3358cdd504 Merge with 5.1 to get in changes from MySQL 5.1.55 2011-02-28 19:39:30 +02:00
Michael Widenius
52b64be318 Fixed compiler warnings
client/readline.cc:
  Initialize not used variable (to kill wrong compiler warning)
mysql-test/suite/handler/aria.result:
  Updated test result
mysql-test/suite/handler/handler.inc:
  Changed index to ensure rows are in a fixed order
mysql-test/suite/handler/heap.result:
  Updated test result
mysql-test/suite/handler/innodb.result:
  Updated test result
mysql-test/suite/handler/myisam.result:
  Updated test result
plugin/handler_socket/handlersocket/Makefile.am:
  Use CXX flags to compile
sql/filesort.cc:
  Initialize variable that may be used
sql/log.cc:
  Initialize not used variable (to kill wrong compiler warning)
sql/opt_range_mrr.cc:
  Fixed cast to avoid compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to avoid compiler warning
2011-02-25 20:15:27 +02:00
Michael Widenius
e6c45f5e1f - Reduced memory requirements for mysqltest to 1/4.th This also gave a speedup for 5x for some tests.
- Reduced memory usage from safe_mutex.
- Fixed problem with failing tests that could not restart mysqld becasue the port was reserved
- More DBUG information
- Fixed bug where bitmap_set_prefix() wrote over buffer area.
- Initialize n_pages_flushed in xtradb which was used uninitialized.

client/mysqltest.cc:
  Reduced memory usage (400K -> 80 for simple test;  400M -> 70M for some other tests)
  - Smaller dynamic arrays at start
  - Made 'st_connection' significantly smaller by allocation 'mysql' on demand in mysql_init() and storing require_file in a mem_root.
  - Fixed that when one does --debug we get information from safemalloc in the trace
  (Most of changes are changing &connect->mysql to connect->mysql
libmysql/libmysql.c:
  Don't call mysql_thread_end() if my_init() was called outside of mysql_server_init()
  This is needed to get information from my_end() into the DBUG log
mysql-test/README:
  Fixed wrong comment
mysql-test/mysql-test-run.pl:
  Reserv 20 ports / mysql-test-run thread.
  (Needed as some tests uses 9 mysqld servers)
mysys/hash.c:
  More DBUG information
mysys/my_bitmap.c:
  Fixed bug where bitmap_set_prefix() wrote over buffer area.
mysys/safemalloc.c:
  More DBUG information
mysys/thr_mutex.c:
  Initialize smaller arrays be default.
sql-common/client.c:
  More DBUG_PRINT
storage/xtradb/srv/srv0srv.c:
  Initialize n_pages_flushed which was used uninitialized.
2011-02-24 02:36:32 +02:00
Nirbhay Choubey
876502d743 Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
("-") IN DATABASE NAMES IN ALTER DATABASE.

mysqldump did not quote database name in 'ALTER DATABASE'
statements in its output. This can further cause a failure
while loading if database name contains a hyphen '-'.

This happened as, while printing the 'ALTER DATABASE'
statements, the database name was not quoted.

Fixed by quoting the database name.


client/mysqldump.c:
  Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
                 ("-") IN DATABASE NAMES IN ALTER DATABASE.
  
  Modified the print statement in order to print the quoted
  database name for 'ALTER DATABASE' statements.
mysql-test/r/mysqldump.result:
  Added a test case for bug#11766310.
mysql-test/t/mysqldump.test:
  Added a test case for bug#11766310.
2011-02-21 12:37:24 +05:30
Michael Widenius
58bb0769bd Merge with MySQL 5.1.55
- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria

Now need to merge with latest xtradb before pushing 

sql/ha_partition.cc:
  Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
  Changed to use opt_stack_trace instead of opt_pstack.
  Removed references to pstack
sql/partition_element.h:
  Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
  Fixed wrong assert
2011-02-20 18:51:43 +02:00
Dmitry Shulga
960ae6da6a Follow up fix for bug#57450.
batch_readline_init() was modified - make check for 
type of file for input stream unless target platform
is WINDOWS since on this platform S_IFBLK is undefined.
2011-02-09 17:13:17 +06:00
Dmitry Shulga
c46e20f6c1 Follow up fix for bug#57450.
batch_readline_init() was modified - return an error
if the input source is a directory or a block device.

This follow-up is necessary because on some platforms,
such as Solaris, call to read() from directory may be
successful.
2011-02-09 12:46:12 +06:00
Dmitry Shulga
980868eb4e Fixed bug#57450 - mysql client enter in an infinite loop
if the standard input is a directory.

The problem is that mysql monitor try to read from stdin without
checking input source type.

The solution is to stop reading data from standard input if a call
to read(2) failed.

A new test case was added into mysql.test.

client/my_readline.h:
  Data members error and truncated was added to LINE_BUFFER structure.
  These data members used instead of out parameters in functions
  batch_readline, intern_read_line.
client/mysql.cc:
  read_and_execute() was modified: set status.exit_status to 1
  when the error occured while reading the next command line in
  non-interactive mode. Also the value of the truncated attribute
  of structure LINE_BUFF is taken into account only for non-iteractive mode.
client/readline.cc:
  intern_read_line() was modified: cancel reading from input if
  fill_buffer() returns -1, e.g. if call to read failed.
  batch_readline was modified: set the error data member of LINE_BUFFER
  structure to value of my_errno when system error happened during call
  to my_read/my_realloc.
mysql-test/t/mysql.test:
  Test for bug#57450 was added.
2011-02-05 11:02:00 +06:00
Michael Widenius
2e75dda33e Merge with 5.1
Fixed a couple of compilation failures that was not detected before merge.
2011-01-30 16:43:23 +02:00
Vladislav Vaintroub
b19e99865c MWL#55 : cherrypick MySQL 5.5 CMake/build improvements in order
to be able to build MSI based installer
2011-01-29 18:51:12 +01:00
Michael Widenius
c46305ab48 Better fix for mysql_test.cc::do_remove_files_wildcard
client/mysqltest.cc:
  Better fix for do_remove_files_wildcard
2011-01-26 21:15:25 +02:00
Mattias Jonsson
ad74ed74d9 merge 2011-01-26 16:34:34 +01:00
unknown
6dbd796074 Merge three Percona patches into mariadb-5.2-rpl:
- MWL#47, allowing to annotate row-based binlog events with the SQL test of
   the originating query (eg. in mysqlbinlog output).

 - row_based_replication_without_primary_key.patch, providing more intelligent
   selection of index to use on slave when applying row-based binlog events
   for tables with no primary key.

 - Make mysqlbinlog omit redundant `use` around BEGIN/SAVEPOINT/COMMIT/
   ROLLBACK in 5.0 binlogs.
2011-01-26 15:35:03 +01:00
Michael Widenius
69fe020f01 Fixed bugs found by buildbot:
- Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
- Fixed compiler warnings
- Added a name for each thr_lock to get better error messages (This is needed to find out why 'archive.test' sometimes fails)


BUILD/SETUP.sh:
  Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
BUILD/build_mccge.sh:
  Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
client/mysqltest.cc:
  Fixed bug in remove_files_wildcards (the orignal code never removed anything)
extra/libevent/devpoll.c:
  Fixed compiler warning
include/thr_lock.h:
  Added a name for each thr_lock to get better error messages.
mysql-test/suite/maria/t/maria3.test:
  Speed up test.
mysys/thr_lock.c:
  Added a name for each thr_lock to get better error messages.
  Added a second 'check_locks' to find if something goes wrong in 'wake_up_waiters'.
sql/lock.cc:
  Added a name for each thr_lock to get better error messages.
storage/xtradb/fil/fil0fil.c:
  Fixed compiler warning
2011-01-26 15:17:46 +02:00
Bjorn Munch
5a85609d6b Fixed copyright headers in mtr src files 2011-01-18 11:03:44 +01:00
Nirbhay Choubey
208b677637 Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
When mysqldadmin is run with sleep and count options,
it goes into an infinite loop and keeps executing the
specified command.

This happened because the statement, responsible for
decrementing the count value, was missing.

Fixed by adding a statement which will decrement the
count value for each iteration.


client/mysqladmin.cc:
  Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
  
  Added a condition to check and decrement the count
  value stored in nr_iterations per iteration.
mysql-test/r/mysqladmin.result:
  Added a testcase for Bug#58221.
mysql-test/t/mysqladmin.test:
  Added a testcase for Bug#58221.
2011-01-16 02:04:08 +05:30
Nirbhay Choubey
ab2d29ec6b Bug#13618 : mysqldump --xml omits comment on table field
When mysqldump tries to dump information in xml format,
the result does not contain field level comments.

In order to retrieve various informations for a field/column,
mysqldump currently uses 'show fields from <tab>' statement.
The attributes returned by the statement lacks the information
regarding field comments.

Fixed by changing the query to one that probes I_S to retrieve
required field informations, including the field comment.


client/mysqldump.c:
  Bug#13618 : mysqldump --xml omits comment on table field.
  
  Replaced the 'show fields' command by a statement that
  queries I_S, in order to retrieve information on all the
  attributes that 'show fields' returns along-with an additional
  column_comment information.
mysql-test/r/client_xml.result:
  Result modifications for bug#13618.
mysql-test/r/mysqldump.result:
  Result modifications for bug#13618.
mysql-test/t/mysqldump.test:
  Added a testcase for bug#13618.
2011-01-14 19:50:34 +05:30
unknown
a5b05b45f2 Make mysqlbinlog omit redundant use around BEGIN/SAVEPOINT/COMMIT/ROLLBACK in 5.0 binlogs
This is a merge of percona patch mysqlbinlog_fix.patch.

Apparently, MySQL 5.0 does not flag BEGIN/SAVEPOINT/COMMIT/ROLLBACK statements
in its binlogs with LOG_EVENT_SUPPRESS_USE_F like 5.1+ does. This causes
unnecessary `use` statements around such statements when the binlog is dumped
by mysqlbinlog.

Fix by always suppressing the output of `use` for these statements.
2011-01-13 14:15:07 +01:00
Nirbhay Choubey
db36f63984 Bug#59109 : mysqlslap crashes on mysql_fetch_row after ignoring
null from mysql_store_result.

mysqlslap segfaults at a point when it tries to fetch rows from
the result set.

Under some circumstances, mysql_store_result can return 'NULL',
even after query execution (mysql_query) succeeds, and eventually
a segfault might occur if same unchecked return value is passed
to mysql_fetch_row.

Fixed by adding a check on mysql_store_result's return value.


client/mysqlslap.c:
  Bug#59109 : mysqlslap crashes on mysql_fetch_row after ignoring
              null from mysql_store_result.
  
  Added a check on mysql_store_result's return value. A 'NULL' return
  value here shows an erroneous situation as mysql_field_count has already
  reported a non-zero value.
2011-01-13 15:56:42 +05:30
unknown
108e9ee84e MBug#702303: Spurious use statements in output from mysqlbinlog --rewrite-db="a->b" 2011-01-13 13:28:36 +01:00
Bjorn Munch
5376a76dea Bug #58900 query_get_value crashes when result begins with dollar sign
Generalized fix for recursive backtick
Optional arg to eval_expr telling it not to interpret
2011-01-11 10:54:42 +01:00
Bjorn Munch
8645caf79d Bug #59002 Please make mtr print correct file and line number when tests fail
This patchs adds printing of a file stack (with line numbers)
It does not fix the problem of a failure in the non-first iteration of a loop
2011-01-11 10:51:31 +01:00
Mattias Jonsson
38c5e2cae8 Bug#47902: partition_recover_myisam fails with --ps-protocol
The problem was that the warnings was never written out
when running with --ps-protocol. This was because the
warnings only appeared during the prepare phase, not
the execute phase.

Solved by not clearing the warnings from the prepare phase
if there was no other warnings.

If there are warnings from the execute phase, it is very
likely to be the same as from the prepare phase. My tests
show that if not clearing the warnings from the prepare
phase when there are warnings from the execute phase, there
will be duplicated warnings in the result.

client/mysqltest.cc:
  Only reset the prepare warnings if there are warnings from
  the execute phase. Otherwise these warnings will never be
  returned.
2011-01-10 23:42:37 +01:00