Commit graph

821 commits

Author SHA1 Message Date
Bjorn Munch
299f0f201c Follow-up to 54861, cannot assume pthread_t is integral type 2010-10-04 12:01:16 +02:00
Bjorn Munch
cd18aa3126 merge from 5.5-mtr 2010-10-04 10:40:28 +02:00
Bjorn Munch
e688b6c299 merge from 5.5-mtr 2010-10-04 10:40:28 +02:00
Bjorn Munch
64e189c37c merge from 5.1-mtr 2010-10-03 19:37:58 +02:00
Bjorn Munch
687696a97a merge from 5.1-mtr 2010-10-03 19:37:58 +02:00
Bjorn Munch
ad1824eed0 upmerge 20304 2010-10-01 15:55:49 +02:00
Bjorn Munch
53462869d3 upmerge 20304 2010-10-01 15:55:49 +02:00
Mattias Jonsson
9aa7484cfe merge 2010-10-01 15:25:13 +02:00
Mattias Jonsson
1045f4526f merge 2010-10-01 15:25:13 +02:00
Bjorn Munch
abaa5c91b4 Bug #20304 mysqltest: reap with no preceding statement hangs forever
Added sanity check, similar to the one preventing send without reap
2010-10-01 11:00:18 +02:00
Bjorn Munch
ad7521df31 Bug #20304 mysqltest: reap with no preceding statement hangs forever
Added sanity check, similar to the one preventing send without reap
2010-10-01 11:00:18 +02:00
Bjorn Munch
c84973c7e0 upmerge 52828 2010-09-30 12:53:36 +02:00
Bjorn Munch
32da790381 upmerge 52828 2010-09-30 12:53:36 +02:00
Bjorn Munch
be7b3c0040 Bug #52828 Tests that use perl fail when perl is not in path
Trying to run perl fails, just like it does when perl is started but fails
Trap the case that perl was not found/could not be started, and skip test
Also force a restart of servers since test may already have done something
mtr now also appends path of current perl to PATH to aid mysqltest
2010-09-30 12:42:37 +02:00
Bjorn Munch
87234b74ca Bug #52828 Tests that use perl fail when perl is not in path
Trying to run perl fails, just like it does when perl is started but fails
Trap the case that perl was not found/could not be started, and skip test
Also force a restart of servers since test may already have done something
mtr now also appends path of current perl to PATH to aid mysqltest
2010-09-30 12:42:37 +02:00
Bjorn Munch
dae793978a merge from 5.1 2010-09-29 12:56:10 +02:00
Bjorn Munch
1a75a23ce1 merge from 5.1 2010-09-29 12:56:10 +02:00
Michael Widenius
ca672e6b61 Automatic merge 2010-10-01 18:27:32 +03:00
Alexander Nozdrin
94e726ae3d Auto-merge from mysql-5.5-merge. 2010-09-28 19:15:58 +04:00
Alexander Nozdrin
a79093cd94 Auto-merge from mysql-5.5-merge. 2010-09-28 19:15:58 +04:00
Bjorn Munch
bd71a48649 upmerge 56125,56921 2010-09-28 16:00:11 +02:00
Bjorn Munch
cf362a41b9 upmerge 56125,56921 2010-09-28 16:00:11 +02:00
Bjorn Munch
500cb49295 Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints
Adds boolean flag is_int and a separete function to check for int value
Added tests to mysqltest.test
2010-09-27 14:36:16 +02:00
Bjorn Munch
3a404d4966 Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints
Adds boolean flag is_int and a separete function to check for int value
Added tests to mysqltest.test
2010-09-27 14:36:16 +02:00
Michael Widenius
bdba1d11c4 Change some my_bool in C++ classes and a few functions to bool to detect wrong usage of bool/my_bool.
Fix some bugs where we stored values other than 0 or 1 in my_bool
Fixed some compiler warnings


client/mysql.cc:
  Changed interrupted_query from my_bool to int, as we stored 2 in it.
client/mysqladmin.cc:
  Changed return variable type to same type as function value type
client/mysqltest.cc:
  Changed 'found' to int as we store other values than 0 or 1 into it
  Changed type for parameter of set_reconnect() to match usage.
extra/libevent/evbuffer.c:
  Added __attribute__((unused))
extra/libevent/event.c:
  Added __attribute__((unused))
extra/libevent/signal.c:
  Added __attribute__((unused))
sql/event_data_objects.h:
  my_bool -> bool
sql/event_db_repository.cc:
  my_bool -> bool
sql/event_db_repository.h:
  my_bool -> bool
sql/event_parse_data.h:
  my_bool -> bool
sql/events.cc:
  my_bool -> bool
sql/events.h:
  my_bool -> bool
sql/field.cc:
  my_bool -> bool
sql/field.h:
  my_bool -> bool
sql/hash_filo.h:
  my_bool -> bool
sql/item.cc:
  my_bool -> bool
sql/item.h:
  my_bool -> bool
sql/item_cmpfunc.h:
  my_bool -> bool
  Changed result_for_null_param from my_bool to int as we stored -1 in it.
sql/item_func.cc:
  my_bool -> bool
  Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
sql/item_func.h:
  my_bool -> bool
sql/item_subselect.h:
  my_bool -> bool
sql/item_sum.cc:
  Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
sql/parse_file.h:
  my_bool -> bool
sql/rpl_mi.h:
  my_bool -> bool
sql/sp_rcontext.h:
  my_bool -> bool
sql/sql_analyse.h:
  my_bool -> bool
sql/sql_base.cc:
  Change some assignments so that we don't initialize bool variables with int's.
sql/sql_bitmap.h:
  my_bool -> bool
sql/sql_cache.cc:
  my_bool -> bool
sql/sql_cache.h:
  my_bool -> bool
sql/sql_class.h:
  my_bool -> bool
sql/sql_insert.cc:
  Change some assignments so that we don't initialize bool variables with int's.
sql/sql_prepare.cc:
  my_bool -> bool
sql/table.h:
  my_bool -> bool
storage/maria/ma_check.c:
  Removed duplicate assignment
strings/decimal.c:
  Fixed wrong variable usage.
  Don't do complex arithmetic on bool when simple works.
2010-09-24 01:00:32 +03:00
Bjorn Munch
7b216d7625 Bug #56921 It should be possible to log connection statements in mysqltest
Added --enable-connect-log, somewhet similar to --enable-query-log
If query log is disabled, disable connect log too
Also some related cleanup in mysqltest.test: removing duplicate test loop
2010-09-22 10:57:10 +02:00
Bjorn Munch
80d666bc21 Bug #56921 It should be possible to log connection statements in mysqltest
Added --enable-connect-log, somewhet similar to --enable-query-log
If query log is disabled, disable connect log too
Also some related cleanup in mysqltest.test: removing duplicate test loop
2010-09-22 10:57:10 +02:00
Georgi Kodinov
353739fdef merge of mysql-5.5 into mysql-5.5-wl1054 2010-09-20 17:17:32 +03:00
Georgi Kodinov
dc0b8f7ada merge of mysql-5.5 into mysql-5.5-wl1054 2010-09-20 17:17:32 +03:00
Bjorn Munch
c18a34bda6 Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Follow-up: don't call pthread_join() on Windows
This change only valid for 5.1
2010-09-20 11:21:27 +02:00
Bjorn Munch
c679e8dc80 Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Follow-up: don't call pthread_join() on Windows
This change only valid for 5.1
2010-09-20 11:21:27 +02:00
Bjorn Munch
acf56b6d7a upmerge 56753 2010-09-20 10:08:32 +02:00
Bjorn Munch
0eaa320c2c upmerge 56753 2010-09-20 10:08:32 +02:00
Sergei Golubchik
b170b126b0 merge with 5.1 2010-09-16 09:58:57 +02:00
Bjorn Munch
6ff48a61f2 Bug #56753 mtr silently ignores junk after backticks
When stepping backward to end of `` expression, check for illegal chars
2010-09-15 14:56:22 +02:00
Bjorn Munch
38604de3a0 Bug #56753 mtr silently ignores junk after backticks
When stepping backward to end of `` expression, check for illegal chars
2010-09-15 14:56:22 +02:00
Michael Widenius
f4820ea62e mysqltest now gives error messages with error code for my_delete, my_rename, my_copy etc.
Fixed crashing bug when doing ALTER TABLE RENAME with transactional tables.

client/mysqltest.cc:
  Added errno to error message for system calls (delete, rename etc)
  Write error message for failures of system calls
mysql-test/include/cleanup_fake_relay_log.inc:
  Disable warnings for remove_file
mysql-test/include/diff_tables.inc:
  Disable warnings for remove_file
mysql-test/include/maria_empty_logs.inc:
  Disable warnings for remove_file
mysql-test/include/maria_make_snapshot.inc:
  Disable warnings for remove_file
mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc:
  Disable warnings for remove_file
mysql-test/include/mysqlhotcopy.inc:
  Disable warnings for remove_file
mysql-test/include/ndb_backup.inc:
  Disable warnings for remove_file
mysql-test/include/ndb_backup_print.inc:
  Disable warnings for remove_file
mysql-test/r/alter_table_trans.result:
  Test of crashing ALTER TABLE RENAME bug
mysql-test/t/alter_table_trans.test:
  Test of crashing ALTER TABLE RENAME bug
mysql-test/t/mysqltest.test:
  Disable warnings for remove_file and move_file
mysys/my_copy.c:
  Fixed wrong error message
sql/sql_table.cc:
  Fixed crashing bug when doing ALTER TABLE RENAME with transactional tables.
2010-09-15 15:48:15 +03:00
Mattias Jonsson
afd4b25d8a Bug#56659: Mismatch of CAPITAL vs small letters in "unified filelist" partitioning output
Bug#56657: Test still uses "--exec rm -f ..." which is non-portable
Bug#56601: Test uses Unix path for temporary file, fails, and writes misleading message

Several tests that was written in a non portable way (failed on windows)

Fixed by
1) backporting the fix for replace_result to also apply to list_files
(mysqltest from mysql-trunk)
2) replacing all #p#/#sp#/#tmp# to #P#/#SP#/#TMP#/
(innodb always converts filenames to lower case in windows).
3) replacing '--exec rm -f' with '--remove_files_wildcard'
4) replacing a perl snippet with '--write_file'

client/mysqltest.cc:
  backport from mysql-trunk to allow replace_result to apply
  also on list_files
mysql-test/suite/parts/inc/partition_check_drop.inc:
  Compensate for differences between innodb on windows vs unix.
  Using mysqltest command, instead of unix command to remove files.
mysql-test/suite/parts/inc/partition_crash.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_fail.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/r/partition_recover_myisam.result:
  updated result
mysql-test/suite/parts/r/partition_special_myisam.result:
  updated result
mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter4_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_debug_sync_innodb.test:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/t/partition_recover_myisam.test:
  more generic suppression (failed in windows)
mysql-test/suite/parts/t/partition_special_myisam.test:
  Using portable mysqltest command 'write_file' instead of perl snippet.
2010-09-15 10:22:12 +02:00
Mattias Jonsson
bde21e5810 Bug#56659: Mismatch of CAPITAL vs small letters in "unified filelist" partitioning output
Bug#56657: Test still uses "--exec rm -f ..." which is non-portable
Bug#56601: Test uses Unix path for temporary file, fails, and writes misleading message

Several tests that was written in a non portable way (failed on windows)

Fixed by
1) backporting the fix for replace_result to also apply to list_files
(mysqltest from mysql-trunk)
2) replacing all #p#/#sp#/#tmp# to #P#/#SP#/#TMP#/
(innodb always converts filenames to lower case in windows).
3) replacing '--exec rm -f' with '--remove_files_wildcard'
4) replacing a perl snippet with '--write_file'
2010-09-15 10:22:12 +02:00
Bjorn Munch
0dc8504b43 upmerge 55426(55546), 56647 2010-09-14 14:19:51 +02:00
Bjorn Munch
45ec20594f upmerge 55426(55546), 56647 2010-09-14 14:19:51 +02:00
Bjorn Munch
64ae6d4a7e Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Bug #55546 mysqltest fails to create a new thread on HPUX
Missing call to pthread_join(), in embedded mode
This independently solves both problems, see 55426 for details.
Addendum: cannot test against a pthread_t, adds boolean flag instead
2010-09-14 14:04:37 +02:00
Bjorn Munch
4e23534bf7 Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Bug #55546 mysqltest fails to create a new thread on HPUX
Missing call to pthread_join(), in embedded mode
This independently solves both problems, see 55426 for details.
Addendum: cannot test against a pthread_t, adds boolean flag instead
2010-09-14 14:04:37 +02:00
Sergei Golubchik
a3d80d952d merge with 5.1 2010-09-11 20:43:48 +02:00
Bjorn Munch
4937eec1a2 Bug #56647 Valgrind warnings for memory leak in mysqltest.cc
Moved an init_dynamic_string() from before to after potential die()
2010-09-10 13:08:06 +02:00
Bjorn Munch
c824cbbaff Bug #56647 Valgrind warnings for memory leak in mysqltest.cc
Moved an init_dynamic_string() from before to after potential die()
2010-09-10 13:08:06 +02:00
Bjorn Munch
223112ad42 merge 55178,55413,56383 2010-09-10 09:58:26 +02:00
Bjorn Munch
4b1d6118e8 merge 55178,55413,56383 2010-09-10 09:58:26 +02:00
Alexey Botchkov
3d8456252d merging. 2010-09-08 13:53:03 +05:00
Alexey Botchkov
406c5a176a merging. 2010-09-08 13:53:03 +05:00
Bjorn Munch
71c0fde097 merge from 5.5 2010-09-01 15:49:43 +02:00
Bjorn Munch
2154211192 merge from 5.5 2010-09-01 15:49:43 +02:00
Alexey Botchkov
cc81f969e9 Bug#54861 Additional connections not handled properly in mtr --embedded
When in embedded-serve mode, mysqltest tried to run '--send' commands in the separate thread.
        That upsets some engines (InnoDB particularly) as the transaction has to be executed in the same
        thread completely. So i implemented some different approach. So we create one separate thread for
        each connection and execute all the queries of this connection inside it. Looks even simpler than it was
        for me.

per-file comments:
  client/mysqltest.cc
Bug#54861      Additional connections not handled properly in mtr --embedded
        Now the connection has one running connection_thread() attached. And sends all the
        query and read-result requests to it.
2010-09-01 17:34:05 +05:00
Alexey Botchkov
26119c1337 Bug#54861 Additional connections not handled properly in mtr --embedded
When in embedded-serve mode, mysqltest tried to run '--send' commands in the separate thread.
        That upsets some engines (InnoDB particularly) as the transaction has to be executed in the same
        thread completely. So i implemented some different approach. So we create one separate thread for
        each connection and execute all the queries of this connection inside it. Looks even simpler than it was
        for me.

per-file comments:
  client/mysqltest.cc
Bug#54861      Additional connections not handled properly in mtr --embedded
        Now the connection has one running connection_thread() attached. And sends all the
        query and read-result requests to it.
2010-09-01 17:34:05 +05:00
Bjorn Munch
1f95aa82f1 upmerge 55178,55413 2010-08-30 15:19:46 +02:00
Bjorn Munch
8ee29b7e6a upmerge 55178,55413 2010-08-30 15:19:46 +02:00
Bjorn Munch
6d2ff118bc merge 55413 2010-08-30 11:26:40 +02:00
Bjorn Munch
c3f69b4191 merge 55413 2010-08-30 11:26:40 +02:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Sergey Vojtovich
0d21bbe387 Merge 5.1-bugteam to 5.5-merge. 2010-08-27 15:33:32 +04:00
Sergey Vojtovich
ab2414577a Merge 5.1-bugteam to 5.5-merge. 2010-08-27 15:33:32 +04:00
Bjorn Munch
a4154bd0a0 Reduced #ifndef for 52301, caused compile warning 2010-08-26 15:14:50 +02:00
Bjorn Munch
fba50f8401 Reduced #ifndef for 52301, caused compile warning 2010-08-26 15:14:50 +02:00
Bjorn Munch
e5a59eee5a merge followup fix for 52301 2010-08-25 22:49:52 +02:00
Bjorn Munch
79aefacb04 merge followup fix for 52301 2010-08-25 22:49:52 +02:00
Bjorn Munch
76907f8591 Bug #52301 Add --protocol to mysqltest
Added code resulted in strange linking problem for embedded on Windows
Avoided by not doing this for embedded mode
It's irrelevant for embedded server anyway, --protocol will be ignored
2010-08-25 10:23:19 +02:00
Bjorn Munch
a22b5651fd Bug #52301 Add --protocol to mysqltest
Added code resulted in strange linking problem for embedded on Windows
Avoided by not doing this for embedded mode
It's irrelevant for embedded server anyway, --protocol will be ignored
2010-08-25 10:23:19 +02:00
Georgi Kodinov
5564e0837f merged mysql-5.5 into WL1054-5.5 2010-08-16 18:16:07 +03:00
Georgi Kodinov
5c81e2cf16 merged mysql-5.5 into WL1054-5.5 2010-08-16 18:16:07 +03:00
Bjorn Munch
788b4e404b Bug #55413 mysqltest gives parse error for lines matching "^let.*\\.*;$"
Allow escaped quotes also in statements not starting with --
But will not support single unescaped ' or `
2010-08-10 12:13:58 +02:00
Bjorn Munch
3ca814b760 Bug #55413 mysqltest gives parse error for lines matching "^let.*\\.*;$"
Allow escaped quotes also in statements not starting with --
But will not support single unescaped ' or `
2010-08-10 12:13:58 +02:00
Georgi Kodinov
9705711596 WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
2010-08-09 11:32:50 +03:00
Georgi Kodinov
881a76699e WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
2010-08-09 11:32:50 +03:00
Michael Widenius
165eb1186c Added extra argument to longlong2str() to make it have same prototype is int2str()
Changed to use longlong10_to_str() instead of longlong2str() when base is 10 or -10 as former is much faster than later
Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit.

client/mysqltest.cc:
  longlong2str() -> longlong10_to_str()
include/m_string.h:
  Added extra argument to longlong2str() to make it have same prototype is int2str()
mysys/charset.c:
  Fixed compiler warning
mysys/mf_soundex.c:
  Fixed compiler warning
mysys/my_getopt.c:
  longlong2str() -> longlong10_to_str()
sql/create_options.cc:
  Fixed compiler warning
sql/item_strfunc.cc:
  Added extra argument to longlong2str
sql/opt_range.cc:
  longlong2str() -> longlong10_to_str()
sql/partition_info.cc:
  longlong2str() -> longlong10_to_str()
sql/slave.cc:
  longlong2str() -> longlong10_to_str()
sql/sql_bitmap.h:
  Added extra argument to longlong2str
sql/sql_partition.cc:
  Added extra argument to longlong2str
sql/sql_select.cc:
  longlong2str() -> longlong10_to_str()
sql/sql_show.cc:
  Added extra argument to longlong2str
storage/innodb_plugin/handler/ha_innodb.cc:
  Update to new parameters for longlong2str()
storage/maria/ma_dbug.c:
  longlong2str() -> longlong10_to_str()
storage/maria/maria_chk.c:
  Added extra argument to longlong2str
storage/myisam/mi_dbug.c:
  longlong2str() -> longlong10_to_str()
storage/myisam/myisamchk.c:
  Added extra argument to longlong2str
storage/xtradb/handler/ha_innodb.cc:
  Update to new parameters for longlong2str()
strings/longlong2str.c:
  Added extra argument to longlong2str() to make it have same prototype is int2str()
strings/my_vsnprintf.c:
  Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit.
  Added cast to get rid of compiler warnings
2010-08-07 15:27:23 +03:00
Bjorn Munch
944e3814e8 merge from 5.1-bugteam of merge from 5.1-mtr 2010-08-06 13:37:05 +02:00
Bjorn Munch
6777cc0db6 merge from 5.1-bugteam of merge from 5.1-mtr 2010-08-06 13:37:05 +02:00
Bjorn Munch
3d0819e2b1 merge from 5.1-mtr 2010-08-06 11:13:52 +02:00
Bjorn Munch
8e242e8140 merge from 5.1-mtr 2010-08-06 11:13:52 +02:00
Michael Widenius
d042146e5b Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
2010-08-05 22:56:11 +03:00
Bjorn Munch
5f18951577 merge from trunk-mtr 2010-08-05 14:53:09 +02:00
Bjorn Munch
f886745dfa merge from trunk-mtr 2010-08-05 14:53:09 +02:00
Bjorn Munch
682cdb520d upmerge 55582 2010-08-05 14:41:07 +02:00
Bjorn Munch
489e6c136b upmerge 55582 2010-08-05 14:41:07 +02:00
Bjorn Munch
f3f5e04a36 merge from 5.1 2010-08-04 12:19:51 +02:00
Bjorn Munch
992f49c0c4 merge from 5.1 2010-08-04 12:19:51 +02:00
Bjorn Munch
5e92df6e0e Bug #55582 mtr root detection (and if-expression execution) broken
if() treated any non-numeric string as false
Fixed to treat those as true instead
Added some test cases
Fixed missing $ in variable name in include/mix2.inc
2010-08-03 16:11:23 +02:00
Bjorn Munch
1ba9d79b7b Bug #55582 mtr root detection (and if-expression execution) broken
if() treated any non-numeric string as false
Fixed to treat those as true instead
Added some test cases
Fixed missing $ in variable name in include/mix2.inc
2010-08-03 16:11:23 +02:00
Michael Widenius
e0a6b02c5d Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
2010-08-02 12:01:24 +03:00
Davi Arnaut
7f80eb46e9 Bug#42733: Type-punning warnings when compiling MySQL
Post-merge fix: remove remaining casts which are now
unnecessary and are actually causing warnings.
2010-07-24 09:24:44 -03:00
Davi Arnaut
c1545bec1e Bug#42733: Type-punning warnings when compiling MySQL
Post-merge fix: remove remaining casts which are now
unnecessary and are actually causing warnings.
2010-07-24 09:24:44 -03:00
Davi Arnaut
75e2212397 WL#5498: Remove dead and unused source code
Remove unused macros or macro which are always defined.

include/my_global.h:
  Remove unused macros and move macros which aren't used globally.
2010-07-23 17:16:29 -03:00
Davi Arnaut
60ab2b9283 WL#5498: Remove dead and unused source code
Remove unused macros or macro which are always defined.
2010-07-23 17:16:29 -03:00
Bjorn Munch
44568b7014 merge from trunk 2010-07-23 15:12:58 +02:00
Bjorn Munch
be55e8d59d merge from trunk 2010-07-23 15:12:58 +02:00
Davi Arnaut
711c318c07 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
649390ac81 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
07e7b4d6fe WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
unknown
2be1a25faa Automerge MariaDB 5.1->5.2. 2010-07-09 13:39:19 +02:00
Davi Arnaut
00e62a0311 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: cast argument and correct type in assignment.
2010-07-08 22:19:57 -03:00
Davi Arnaut
dbf76b0deb Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: cast argument and correct type in assignment.
2010-07-08 22:19:57 -03:00
Davi Arnaut
f56dd32bf7 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -03:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Davi Arnaut
5641fb64b4 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
74283a052e Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
0eb26fdfa8 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.

BUILD/SETUP.sh:
  Remove flags that are implied by -Wall and -Wextra.
  Do not warn about unused parameters in C++.
BUILD/check-cpu:
  Print only the compiler version instead of verbose banner.
  Although the option is gcc specific, the check was only
  being used for GCC specific checks anyway.
client/mysql.cc:
  bcmp is no longer defined.
client/mysqltest.cc:
  Pass a string to function expecting a format string.
  Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
  Always define _GNU_SOURCE when compiling GNU readline.
  Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
  Condition for the code to be meaningful.
configure.in:
  Remove check for bcmp.
extra/comp_err.c:
  Use appropriate type.
extra/replace.c:
  Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
  Do not ignore the return value of fgets. Retrieve the file
  position if fgets succeed -- if it fails, the function will
  bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
  Use a single array instead of accessing positions of the sbox_
  through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
  One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
  Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
  Do not define type within a anonymous union.
  Use a variable to return a value instead of
  leaving the result in a register -- compiler
  does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
  Define handler for pure virtual functions.
  Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
  Function must have C language linkage.
include/m_string.h:
  Remove check which relied on bcmp being defined -- they weren't
  being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
  Remove bogus helpers which were used only in a few files and
  were causing warnings about dead code.
include/my_global.h:
  Due to G++ bug, always silence false-positive uninitialized
  variables warnings when compiling C++ code with G++.
  Remove bogus helper.
libmysql/Makefile.shared:
  Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
  Leave space of the ending nul.
mysys/mf_pack.c:
  Replace bcmp with memcmp.
mysys/my_bitmap.c:
  Dead code removal.
mysys/my_gethwaddr.c:
  Remove unused variable.
mysys/my_getopt.c:
  Silence bogus uninitialized variable warning.
  Do not cast away the constant qualifier.
mysys/safemalloc.c:
  Cast to expected type.
mysys/thr_lock.c:
  Silence bogus uninitialized variable warning.
sql/field.cc:
  Replace bogus helper with a more appropriate logic which is
  used throughout the code.
sql/item.cc:
  Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
  Simplify code to avoid signedness related warnings.
sql/log_event.cc:
  Replace use of bcmp with memcmp.
  No need to use helpers for simple bit operations.
sql/log_event_old.cc:
  Replace bmove_align with memcpy.
sql/mysqld.cc:
  Move use declaration of variable to the ifdef block where it
  is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
  Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
  Cast to expected type and silence bogus warning.
sql/sql_class.h:
  Don't use enum values as bit flags, the supposed type safety is
  bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
  Only declare variable when necessary.
sql/unireg.h:
  Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
  Silence bogus warning.
storage/myisam/mi_open.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
storage/myisam/mi_page.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
strings/bcmp.c:
  Remove built-in bcmp.
strings/ctype-ucs2.c:
  Silence bogus warning.
tests/mysql_client_test.c:
  Use a appropriate type as expected by simple_command().
2010-07-02 15:30:47 -03:00
Davi Arnaut
93fb8bb235 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.
2010-07-02 15:30:47 -03:00
Michael Widenius
5a2f40d48a Fixes for Opensolaris (to get buildbot green)
- Fixed memory leaks in mysqldump
- Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
- Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris


client/mysqldump.c:
  Fixed memory leaks
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
client/mysqltest.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
include/my_global.h:
  Added simple macro val_or_null() to simplify detecting of NULL strings for printf
sql/handler.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
sql/sql_db.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
  Removed testing of 'new_db_name' as this is guranteed never NULL
sql/sql_show.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
storage/csv/ha_tina.cc:
  Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris
  (OpenSolaris default malloc() can't handle a lot of reallocs() of strings that are growing one byte at a time)
  This did speed up logging to cvs with a magnitude for large strings.
2010-06-23 03:48:11 +03:00
Bjorn Munch
f35fbc4d93 merge from trunk 2010-06-17 12:27:50 +02:00
Bjorn Munch
7c181c5974 merge from trunk 2010-06-17 12:27:50 +02:00
Sergei Golubchik
9b48499dc4 merged 2010-06-16 12:58:56 +02:00
Bjorn Munch
062f57e279 upmerge 52321,53374,53949,54111,54364,54368 2010-06-15 12:37:13 +02:00
Bjorn Munch
e21e5e82d5 upmerge 52321,53374,53949,54111,54364,54368 2010-06-15 12:37:13 +02:00
Bjorn Munch
7f6ffe9a36 Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
Wildcard chars are changed in embedded mode
Temporarily reset the wild_* variables before wild_compare, also for list_files
2010-06-15 11:29:24 +02:00
Bjorn Munch
711ce77612 Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
Wildcard chars are changed in embedded mode
Temporarily reset the wild_* variables before wild_compare, also for list_files
2010-06-15 11:29:24 +02:00
Sergei Golubchik
b89384194d mysqltest: use setenv, not putenv, to make gcov happy.
(backport from MySQL)
2010-06-14 11:18:54 +02:00
Michael Widenius
ec281a3c34 Fixed some bugs in the Maria storage engine
- Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
- Fixed a rase condition when two threads calls external_lock and thr_lock() in different order. When this happend the transaction that called external lock first
  and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
- Fixed that one can run maria_chk on an automatcally recovered tables without warnings about too small transaction id
- Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
- Fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.

client/mysqldump.c:
  Add "" around error message to make it more readable
client/mysqltest.cc:
  Free environment variables
mysql-test/r/mysqldump.result:
  Updated results
mysql-test/r/openssl_1.result:
  Updated results
mysql-test/suite/maria/r/maria-recover.result:
  Updated results
mysql-test/suite/maria/r/maria3.result:
  Updated results
mysql-test/suite/maria/t/maria3.test:
  Added more test of temporary tables
storage/maria/ha_maria.cc:
  Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
  Start transaction in ma_block_get_status() instead of in ha_maria::external_lock().
  - This fixes a rase condition when two threads calls external lock and thr_lock() in different order. When this happend the transaction that called external lock first and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
  Store latest transaction id in controll file if recovery was done.
  - This allows one to run maria_chk on an automatcally recovered tables without warnings about too small transaction id
storage/maria/ha_maria.h:
  Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
storage/maria/ma_blockrec.h:
  Added new function "_ma_block_get_status_no_versioning()"
storage/maria/ma_init.c:
  Added hook to create trn in ma_block_get_status() if we are using MariaDB
storage/maria/ma_open.c:
  Ensure we call _ma_block_get_status_no_versioning() for transactional tables without versioning (like tables with fulltext)
storage/maria/ma_pagecache.c:
  Allow one to flush blocks that are pinned for read.
  This fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.
storage/maria/ma_recovery.c:
  Set maria_recovery_changed_data to 1 if recover changed something.
  Set max_trid_in_control_file to max found trn if we found a bigger trn.
  The allows will ensure that the control file is up to date after recovery which allows one to run maria_chk on the tables without warnings about too big trn
storage/maria/ma_state.c:
  Call maria_create_trn_hook() in _ma_setup_live_state() instead of ha_maria::external_lock()
  This ensures that 'state' and trn are in sync and thus fixes the race condition mentioned for ha_maria.cc
storage/maria/ma_static.c:
  Added maria_create_trn_hook() and maria_recovery_changed_data
storage/maria/maria_def.h:
  Added MARIA_HANDLER->external_ptr, which is used to hold MariaDB thd.
  Added some new external variables
  Removed reference to non existing function: maria_concurrent_inserts()
2010-06-14 01:13:32 +03:00
Davi Arnaut
db2fe44c84 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
d6e003545a Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
6f3a540c37 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.

client/mysql.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysql_upgrade.c:
  Remove now-unnecessary casts.
client/mysqladmin.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysqlbinlog.cc:
  Remove now-unnecessary casts.
client/mysqlcheck.c:
  Remove now-unnecessary casts.
client/mysqldump.c:
  Remove now-unnecessary casts.
client/mysqlimport.c:
  Remove now-unnecessary casts.
client/mysqlshow.c:
  Remove now-unnecessary casts.
client/mysqlslap.c:
  Remove now-unnecessary casts.
client/mysqltest.cc:
  Remove now-unnecessary casts.
extra/comp_err.c:
  Remove now-unnecessary casts.
extra/my_print_defaults.c:
  Remove now-unnecessary casts.
  Break up large strings.
extra/mysql_waitpid.c:
  Remove now-unnecessary casts.
extra/perror.c:
  Remove now-unnecessary casts.
extra/resolve_stack_dump.c:
  Remove now-unnecessary casts.
extra/resolveip.c:
  Remove now-unnecessary casts.
include/my_getopt.h:
  Use a void pointer type as the opaque type to avoid problems with type
  incompatibility -- GCC issues warnings when the type name is not type
  compatible with a operand. As a side bonus, a explicit cast won't be
  necessary anymore.
include/sslopt-longopts.h:
  Remove now-unnecessary casts.
  Break up large strings.
mysys/my_getopt.c:
  Update opaque type and introduce a type definition for the
  argument to my_getopt_register_get_addr.
server-tools/instance-manager/options.cc:
  Remove now-unnecessary casts.
sql/mysqld.cc:
  Remove now-unnecessary casts.
  Break up large strings.
  Update mysql_getopt_value prototype (the old prototype
  was different from the definition anyway).
sql/sql_plugin.cc:
  The type of a pointer to a function must be compatible with the
  pointed-to function type, otherwise the behavior is undefined.
sql/table.cc:
  The variable buf pointer to pointer to pointer to constant char
  could improperly alias a incompatible type in call to fix_type_
  pointers. Since this was actually dead code, it is simply removed.
sql/unireg.cc:
  Remove call to get_form_pos. The code creates a new FRM file which
  is always truncated and writes the form position as 0. Hence, no
  need to retrieve it, we now for sure it is 0.
storage/archive/archive_reader.c:
  Remove now-unnecessary casts.
storage/myisam/ft_nlq_search.c:
  Read weight directly from the buffer.
storage/myisam/fulltext.h:
  Add explanation about the type duality of a key buffer.
  Add accessor macro to retrieve a FT float value.
storage/myisam/mi_test1.c:
  Remove now-unnecessary casts.
storage/myisam/myisam_ftdump.c:
  Read weight directly from the buffer.
storage/myisam/myisamchk.c:
  Remove now-unnecessary casts.
storage/myisam/myisamlog.c:
  A pointer to char was used to alias a pointer to pointer to
  unsigned char, thus violating strict aliasing rules.
storage/myisam/myisampack.c:
  Remove now-unnecessary casts.
strings/decimal.c:
  Remove aliasing violation, printing the value is enough for
  debugging purposes.
tests/mysql_client_test.c:
  Remove now-unnecessary casts.
2010-06-10 17:16:43 -03:00
Davi Arnaut
bb036c93b4 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.
2010-06-10 17:16:43 -03:00
Bjorn Munch
bb6e8b6942 Bug #53374 Don't delete temporary perl file if perl fails
Simple condition on the delete stmt
But NB: next mtr run will clean up and remove the temp file
2010-06-07 13:30:23 +02:00
Bjorn Munch
f9fa3b7a3f Bug #53374 Don't delete temporary perl file if perl fails
Simple condition on the delete stmt
But NB: next mtr run will clean up and remove the temp file
2010-06-07 13:30:23 +02:00
Davi Arnaut
60a9d9bbb9 Post-merge fix: header is used by the client API. Obvious in retrospect.
Also, update a few cases missed by the initial patch.

client/mysqltest.cc:
  Remove trailing comma.
include/my_alloc.h:
  Do not use wrapper.
include/mysql.h.pp:
  Update ABI file.
plugin/semisync/semisync_master.h:
  Initialize variable.
sql/debug_sync.cc:
  Use C linkage.
2010-06-05 16:39:03 -03:00
Davi Arnaut
75dce25ca8 Post-merge fix: header is used by the client API. Obvious in retrospect.
Also, update a few cases missed by the initial patch.
2010-06-05 16:39:03 -03:00
Bjorn Munch
ae19d3e705 Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
Bjorn Munch
9a3a7297bb Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
Bjorn Munch
d5f2972628 Merge from 5.1 up to rev 3392 2010-06-02 16:23:29 +02:00
Bjorn Munch
b7c8385e05 Merge from 5.1 up to rev 3392 2010-06-02 16:23:29 +02:00
Sergei Golubchik
ffc8f62b08 merge 5.1->5.2 2010-06-01 21:52:20 +02:00
Davi Arnaut
a8c288054e Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).

client/mysql.cc:
  Mismatch between prototype and declaration.
client/mysqltest.cc:
  mysqltest used to be C code. Use C linkage where appropriate.
cmd-line-utils/readline/input.c:
  Isolate unreachable code.
include/my_alloc.h:
  Function type must have C linkage.
include/my_base.h:
  Function type must have C linkage.
include/my_global.h:
  Add helper macros to avoid spurious namespace indentation.
include/mysql.h.pp:
  Update ABI file.
mysys/my_gethwaddr.c:
  Remove stray carriage return and fix coding style.
plugin/semisync/semisync_master_plugin.cc:
  Callback function types have C linkage.
plugin/semisync/semisync_slave_plugin.cc:
  Callback function types have C linkage.
sql/derror.cc:
  Expected function type has C linkage.
sql/field.cc:
  Use helper macro and fix indentation.
sql/handler.cc:
  Expected function type has C linkage.
sql/item_sum.cc:
  Correct function linkages. Remove now unnecessary cast.
sql/item_sum.h:
  Add prototypes with the appropriate linkage as otherwise they
  are distinct.
sql/mysqld.cc:
  Wrap functions in C linkage mode.
sql/opt_range.cc:
  C language linkage is ignored for class member functions.
sql/partition_info.cc:
  Add wrapper functions with C linkage for class member functions.
sql/rpl_utility.h:
  Use helper macro and fix indentation.
sql/sql_class.cc:
  Change type of thd argument -- THD is a class.
  Use helper macro and fix indentation.
sql/sql_class.h:
  Change type of thd argument -- THD is a class.
sql/sql_select.cc:
  Expected function type has C linkage.
sql/sql_select.h:
  Move prototype to sql_test.h
sql/sql_show.cc:
  Expected function type has C linkage.
sql/sql_test.cc:
  Fix required function prototype and fix coding style.
sql/sql_test.h:
  Removed unnecessary export and add another.
storage/myisammrg/ha_myisammrg.cc:
  Expected function type has C linkage.
storage/perfschema/pfs.cc:
  PSI headers are declared with C language linkage, which also
  applies to function types.
2010-05-31 12:29:54 -03:00
Davi Arnaut
5dec0c9637 Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).
2010-05-31 12:29:54 -03:00
unknown
b1e00b6be8 Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
2010-04-28 14:52:24 +02:00
Konstantin Osipov
3227ba706f Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.


.bzrignore:
  Added libmysqld/sha2.cc to the ignore list.
client/mysql.cc:
  Add condition to remove code for embedded server.
client/mysqltest.cc:
  Add condition to remove code for embedded server.
include/Makefile.am:
  New header file to header list.
include/mysql_embed.h:
  Embedded servers can use SSL-library functions too!
include/sha2.h:
  Compatibility layer to make YaSSL behave like OpenSSL.
include/sslopt-case.h:
  Remove SSL-communication parameters from command lines.
include/sslopt-longopts.h:
  Remove SSL-communication parameters from command lines.
include/sslopt-vars.h:
  Don't declare variables that are only used in SSL communication, if
  we are compiling the embedded server.
include/violite.h:
  Don't even compile the SSL-communication function if we're in the
  embedded server.
  ---
  Remove CPP condition indentation.
libmysqld/CMakeLists.txt:
  Add new file to source list.
libmysqld/Makefile.am:
  Include standard DEFS in embedded compilation.  It's an undiscovered
  but that it's not there.
  
  Add new file to source list.
libmysqld/examples/Makefile.am:
  Include autoconf DEFS.
libmysqld/lib_sql.cc:
  Initialize SSL-related variables in embedded server.
mysql-test/include/have_ssl_crypto_functs.inc:
  Distinguish between communication and crypto.
  Use the tristate value of "have_ssl" variable to know whether to
  test or not for SSL-provided crypto functions.
mysql-test/r/func_digest.result:
  
  Test against the sample test vectors in the NIST Secure
  Hash Standard (http://csrc.nist.gov/cryptval/shs.htm)
mysql-test/r/func_encrypt_nossl.result:
  Update results to the new error message text.
mysql-test/r/have_ssl_is_yes_or_disabled_only.require:
  Distinguish between communication and crypto.
  
  Use the tristate value of "have_ssl" variable to know whether to
  test or not for SSL-provided crypto functions.
mysql-test/suite/rpl/t/rpl_ssl.test:
  Distinguish between communication and crypto.
mysql-test/suite/rpl/t/rpl_ssl1.test:
  Distinguish between communication and crypto.
mysql-test/t/func_des_encrypt.test:
  Distinguish between communication and crypto.
mysql-test/t/func_digest.test:
  Test against the sample test vectors in the NIST Secure
  Hash Standard (http://csrc.nist.gov/cryptval/shs.htm)
  
  Also, test that various parameters (legal and illegal)
  do what we expect.
  ---
  Distinguish between communication and crypto.
mysql-test/t/func_encrypt.test:
  Distinguish between communication and crypto.
mysql-test/t/openssl_1.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
mysql-test/t/ssl-big.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
mysql-test/t/ssl.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
mysql-test/t/ssl_8k_key.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
mysql-test/t/ssl_compress.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
mysql-test/t/ssl_connect.test:
  Don't test SSL communication if we're in the embedded server.
  ---
  Distinguish between communication and crypto.
sql-common/client.c:
  SSL is useful for more functionality than just connecting.  Test
  for whether we are not embedded server also.
sql/CMakeLists.txt:
  Add new source file to source list so that we have access to SHA2
  functions.
sql/Makefile.am:
  Add new source file to source list so that we have access to SHA2
  functions.
sql/item_create.cc:
  Bootstrap the SHA2 function into the server.
sql/item_strfunc.cc:
  Add new SHA2 Item class methods.
  
  Clean up two minor problems.
  ---
  Remove extraneous debugging.
  ---
  We must check nullness of a parameter only /after/ computing its
  value.
sql/item_strfunc.h:
  Declare new SHA2 Item class.
sql/mysqld.cc:
  For embedded server, don't refer to SSL-communications variables
  or values.
  ---
  Remove CPP condition indentation.
sql/sha2.cc:
  Compatibility layer to make YaSSL behave like OpenSSL.
  ---
  Add comment for generated functions.
sql/sql_acl.cc:
  For embedded server, don't refer to SSL-communications variables
  or values.
sql/sql_connect.cc:
  SSL is useful for more functionality than just connecting.  Test
  for whether we are not embedded server also.
sql/sys_vars.cc:
  For embedded server, don't refer to SSL-communications variables
  or values.
2010-04-13 19:04:45 +04:00
Konstantin Osipov
53fecff1ef Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 19:04:45 +04:00
Bjorn Munch
5c41c238fc upmerge 42513,52214 2010-04-13 13:55:11 +02:00
Bjorn Munch
83e673474b upmerge 42513,52214 2010-04-13 13:55:11 +02:00
Bjorn Munch
d5e9a45efd Bug #52214 Misleading error msg when test fails before having produced any query
output
Print error message only if real error
2010-04-13 12:41:42 +02:00
Bjorn Munch
2682fb67c3 Bug #52214 Misleading error msg when test fails before having produced any query
output
Print error message only if real error
2010-04-13 12:41:42 +02:00
Bjorn Munch
5a5cbff970 Bug #42513 mtr2: mysqltest doesn't count internal commands output as real output
MTR insited in exit; if run without result file
Simply remove the else part producing the error and let test finish
2010-04-13 10:01:04 +02:00
Bjorn Munch
723293de3e Bug #42513 mtr2: mysqltest doesn't count internal commands output as real output
MTR insited in exit; if run without result file
Simply remove the else part producing the error and let test finish
2010-04-13 10:01:04 +02:00
Bjorn Munch
aa2912a02b upmerge 52301 2010-03-31 12:53:56 +02:00
Bjorn Munch
b9a3e71171 upmerge 52301 2010-03-31 12:53:56 +02:00
Bjorn Munch
4d8324d61a merge from trunk 2010-03-26 11:20:41 +01:00
Bjorn Munch
085e69a4c1 merge from trunk 2010-03-26 11:20:41 +01:00
Alexey Kopytov
d95c1e3b47 Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Alexey Kopytov
f10885675c Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Bjorn Munch
9b9d01b31a Bug #52301 Add --protocol to mysqltest
Implement as for other clients
2010-03-23 15:01:40 +01:00
Bjorn Munch
5fbd98a1fb Bug #52301 Add --protocol to mysqltest
Implement as for other clients
2010-03-23 15:01:40 +01:00
Bjorn Munch
0a3fefd9b5 upmerge 43603 2010-03-22 11:33:54 +01:00
Bjorn Munch
88aa01ae50 upmerge 43603 2010-03-22 11:33:54 +01:00
Bjorn Munch
7f20e9fd06 Bug #43603 mysqltest command disable_abort_on_error does not affect all built-in commands
After disable_abort_on_error, behaved as if --error was in effect
Add condition before die, as after queries
2010-03-22 11:28:57 +01:00
Bjorn Munch
d7f2f03441 Bug #43603 mysqltest command disable_abort_on_error does not affect all built-in commands
After disable_abort_on_error, behaved as if --error was in effect
Add condition before die, as after queries
2010-03-22 11:28:57 +01:00
Bjorn Munch
fdad76feaa upmerge 43588 2010-03-18 22:29:53 +01:00
Bjorn Munch
f10dec68ee upmerge 43588 2010-03-18 22:29:53 +01:00
Bjorn Munch
ddb6a95abd Bug #43588 mysqltest command disable_abort_on_error logs connect commands
Only log connects after --error
A few small test adjustments needed/possible
2010-03-17 15:25:55 +01:00
Bjorn Munch
2fb8854aa0 Bug #43588 mysqltest command disable_abort_on_error logs connect commands
Only log connects after --error
A few small test adjustments needed/possible
2010-03-17 15:25:55 +01:00
Alexey Kopytov
dbbdc4b196 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/r/explain.result
Text conflict in mysql-test/r/subselect.result
Text conflict in mysql-test/r/subselect3.result
Text conflict in mysql-test/r/type_datetime.result
Text conflict in sql/share/Makefile.am
2010-03-12 12:51:53 +03:00
Alexey Kopytov
4db97ede5b Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/r/explain.result
Text conflict in mysql-test/r/subselect.result
Text conflict in mysql-test/r/subselect3.result
Text conflict in mysql-test/r/type_datetime.result
Text conflict in sql/share/Makefile.am
2010-03-12 12:51:53 +03:00
Davi Arnaut
d585322474 Bug#37316: Anonymous error messages noticed sometimes, while running tests in MTR
The problem was that mysqltest could attempt to execute a
SHOW WARNINGS statement through a connection that was not
properly reaped, thus violating its own rules.

The solution is to skip SHOW WARNINGS if a connection has
not been properly repeaed.

client/mysqltest.cc:
  Skip SHOW WARNINGS if connection hasn't been reaped.
2010-03-08 11:30:20 -03:00
Davi Arnaut
096cb4c6de Bug#37316: Anonymous error messages noticed sometimes, while running tests in MTR
The problem was that mysqltest could attempt to execute a
SHOW WARNINGS statement through a connection that was not
properly reaped, thus violating its own rules.

The solution is to skip SHOW WARNINGS if a connection has
not been properly repeaed.
2010-03-08 11:30:20 -03:00
Bjorn Munch
bf9d0ad5a7 merge from trunk 2010-03-08 12:05:57 +01:00
Bjorn Munch
40ac936df2 merge from trunk 2010-03-08 12:05:57 +01:00
Bjorn Munch
6f9b0927eb merge from trunk 2010-03-04 12:18:53 +01:00
Bjorn Munch
87ddc0186b merge from trunk 2010-03-04 12:18:53 +01:00
Bjorn Munch
15d7161a03 merge from 5.1 2010-03-04 12:10:36 +01:00
Bjorn Munch
7c468d5bfb merge from 5.1 2010-03-04 12:10:36 +01:00
Bjorn Munch
ae676e85e6 upmerge 51590 2010-03-03 11:19:06 +01:00
Bjorn Munch
aa29549050 upmerge 51590 2010-03-03 11:19:06 +01:00
Bjorn Munch
4760adbf3f Bug #51590 mysqltest: --disable_abort_on_error does not work inside while/if
abort_on_error flag for stmt was set at initial parse
(Re)-set flag before execution instead, also added to test
2010-03-02 12:39:32 +01:00
Bjorn Munch
3facbf180b Bug #51590 mysqltest: --disable_abort_on_error does not work inside while/if
abort_on_error flag for stmt was set at initial parse
(Re)-set flag before execution instead, also added to test
2010-03-02 12:39:32 +01:00
Alexander Nozdrin
b3018e8613 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Alexander Nozdrin
04b8cb1882 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Marc Alff
c7fa0c1b34 Bug#10143 Perror not showing error description
Backport to 5.5.99
2010-02-23 17:45:49 -07:00
Marc Alff
9d5deb076a Bug#10143 Perror not showing error description
Backport to 5.5.99
2010-02-23 17:45:49 -07:00
Alexey Kopytov
f0d2fe34f2 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqltest.cc
Text conflict in configure.in
Text conflict in mysql-test/include/mtr_warnings.sql
2010-02-23 16:26:45 +03:00
Alexey Kopytov
92a5dd0323 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqltest.cc
Text conflict in configure.in
Text conflict in mysql-test/include/mtr_warnings.sql
2010-02-23 16:26:45 +03:00
Bjorn Munch
ac0d9be196 merge from 5.1-mtr 2010-02-22 14:52:11 +01:00
Bjorn Munch
38e811b839 merge from 5.1-mtr 2010-02-22 14:52:11 +01:00
Vladislav Vaintroub
0fd18913d9 merge 2010-02-20 11:23:12 +01:00
Vladislav Vaintroub
d6f8da6e8a merge 2010-02-20 11:23:12 +01:00
Sergei Golubchik
eb30bb8579 bugfix: change_user should only take the password
of the previous user if it takes the username too.
otherwise it can never change to a passwordless account
2010-02-19 09:08:05 +01:00
Bjorn Munch
b64d50ae83 upmerge 51135 2010-02-18 09:09:08 +01:00
Bjorn Munch
3687803e11 upmerge 51135 2010-02-18 09:09:08 +01:00
Bjorn Munch
65d6444999 upmerge 51135 2010-02-18 09:02:38 +01:00
Bjorn Munch
a9af3b51a9 upmerge 51135 2010-02-18 09:02:38 +01:00
Bjorn Munch
90c3ace052 Bug #51135 Please increase the maximum number of connections allowed in mysqltest
Added --max-connections= argument to mysqltest and mtr
Small fix to first patch: forgot to check before free'ing connections array
2010-02-17 16:28:02 +01:00
Bjorn Munch
4d5c86fb27 Bug #51135 Please increase the maximum number of connections allowed in mysqltest
Added --max-connections= argument to mysqltest and mtr
Small fix to first patch: forgot to check before free'ing connections array
2010-02-17 16:28:02 +01:00
Bjorn Munch
67baad9b4c upmerge 31602,47389,50618 2010-02-11 14:35:54 +01:00
Bjorn Munch
a748b2bf21 upmerge 31602,47389,50618 2010-02-11 14:35:54 +01:00
Bjorn Munch
e6c93a4ef1 upmerge 31602,47389,50618 2010-02-11 14:33:21 +01:00
Bjorn Munch
7c34cd2ea2 upmerge 31602,47389,50618 2010-02-11 14:33:21 +01:00
Bjorn Munch
0ad9a5992d Bug #50618 Please allow 'sleep $variable' in mtr
Made mtr's sleep function understand $variables
A few fixes since previous patch, added tests
2010-02-09 18:13:57 +01:00
Bjorn Munch
1f97527aaa Bug #50618 Please allow 'sleep $variable' in mtr
Made mtr's sleep function understand $variables
A few fixes since previous patch, added tests
2010-02-09 18:13:57 +01:00
Alexey Kopytov
0888e40fa3 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/suite/rpl/r/rpl_slow_query_log.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/options.cc
Text conflict in sql/mysqld.cc
2010-02-09 12:59:38 +05:00
Alexey Kopytov
017c969896 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/suite/rpl/r/rpl_slow_query_log.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/options.cc
Text conflict in sql/mysqld.cc
2010-02-09 12:59:38 +05:00
Bjorn Munch
01c0d46af8 Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be documented
Added remove_files_wildcard that allows to remove multiple files at once.
This is a port of original patch to Windows.
2010-02-04 13:15:42 +01:00
Bjorn Munch
ad89fa1bcd Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be documented
Added remove_files_wildcard that allows to remove multiple files at once.
This is a port of original patch to Windows.
2010-02-04 13:15:42 +01:00
Bjorn Munch
bf5bb2942f upmerge 39774 2010-02-04 12:57:45 +01:00
Bjorn Munch
2cf9aaa886 upmerge 39774 2010-02-04 12:57:45 +01:00
Bjorn Munch
8bcb4cc74d upmerge 39774 2010-02-04 12:53:08 +01:00
Bjorn Munch
75047c6147 upmerge 39774 2010-02-04 12:53:08 +01:00
Bjorn Munch
25a4b33340 Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be documented
Added remove_files_wildcard that allows to remove multiple files at once.
This is a port of original patch to Windows.
2010-02-04 10:55:17 +01:00
Bjorn Munch
7b6e73d247 Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be documented
Added remove_files_wildcard that allows to remove multiple files at once.
This is a port of original patch to Windows.
2010-02-04 10:55:17 +01:00
Michael Widenius
a041747567 Fixed compiler warnings & failing test cases
When compiling with debug, don't clear buffer in 'net_clear()'
- This allows us to easier find bugs in the protocol and also get repeatable test failures in test cases where someone forgot to do --reap

client/mysqltest.cc:
  Fixed compiler warning
mysql-test/t/partition_innodb_semi_consistent.test:
  Added missing --reap (fixes random failure)
sql/net_serv.cc:
  When compiling with debug, don't clear buffer in 'net_clear()'
  - This allows us to easier find bugs in the protocol and also get repeatable test failures in test cases where someone forgot to do --reap
storage/myisam/ft_boolean_search.c:
  Fixed compiler warnings
storage/myisam/ft_parser.c:
  Fixed compiler warnings
storage/myisam/ft_stopwords.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Added a lot of new suppression of not relevant warnings and warnings in systems we are not in charge of
unittest/mysys/waiting_threads-t.c:
  Fixed compiler warnings
2010-01-28 16:49:14 +02:00
Bjorn Munch
a1b7959a22 upmerge 43005,48888,49837,49878,50471 2010-01-20 16:43:14 +01:00
Bjorn Munch
8bce94ae3e upmerge 43005,48888,49837,49878,50471 2010-01-20 16:43:14 +01:00
Vladislav Vaintroub
411788d5de Correctly cast the result of malloc. 2010-01-20 16:39:28 +01:00
Vladislav Vaintroub
4a9c5f7988 Correctly cast the result of malloc. 2010-01-20 16:39:28 +01:00
Bjorn Munch
33fde0c025 upmerge 43005,48888,49837,49878,50471 2010-01-20 14:37:48 +01:00
Bjorn Munch
8b046e600a upmerge 43005,48888,49837,49878,50471 2010-01-20 14:37:48 +01:00
Bjorn Munch
84616df3ff merge 49837 2010-01-20 14:23:57 +01:00
Bjorn Munch
acc2b1ba6f merge 49837 2010-01-20 14:23:57 +01:00
Bjorn Munch
87ff57cb7e merge 48888 2010-01-20 14:22:34 +01:00
Bjorn Munch
21f728d94c merge 48888 2010-01-20 14:22:34 +01:00
Bjorn Munch
94ccc34537 Bug #49878 delimiter under false 'if' makes mysqltest test fail with 'Missing end of block'
delimiter not executed so does not recognize end of block
Always execute delimiter command, revert after false if() block.
2010-01-20 14:18:27 +01:00
Bjorn Munch
37dc5f082a Bug #49878 delimiter under false 'if' makes mysqltest test fail with 'Missing end of block'
delimiter not executed so does not recognize end of block
Always execute delimiter command, revert after false if() block.
2010-01-20 14:18:27 +01:00
Bernd Ocklin
75e9a54a53 exporting server version and other as env var (bug#50471) 2010-01-20 12:54:55 +01:00
Bernd Ocklin
bdf5ace1a2 exporting server version and other as env var (bug#50471) 2010-01-20 12:54:55 +01:00
Bjorn Munch
b554f4c52d Bug #48888 mysqltest crashes on --replace_result if 'from' is longer than ~1024 symbols
valgrind pointed to a buffer allocated by my_realloc which looked fishy
Replaced size with what was probably intended, added test case.
Now also fixed line after review comment
2010-01-20 12:52:35 +01:00
Bjorn Munch
35d0d10ac2 Bug #48888 mysqltest crashes on --replace_result if 'from' is longer than ~1024 symbols
valgrind pointed to a buffer allocated by my_realloc which looked fishy
Replaced size with what was probably intended, added test case.
Now also fixed line after review comment
2010-01-20 12:52:35 +01:00
Bjorn Munch
5ae2eda776 Bug #49837 mysqltest exec cannot handle multi-line command correctly
Since the exec command line is passed on externally, it cannot take newlines
Simply replace \n with space
Now also added test case
2010-01-20 12:51:18 +01:00
Bjorn Munch
128216d35b Bug #49837 mysqltest exec cannot handle multi-line command correctly
Since the exec command line is passed on externally, it cannot take newlines
Simply replace \n with space
Now also added test case
2010-01-20 12:51:18 +01:00
Vladislav Vaintroub
7753db1d17 Fix compatibility problem with older HPUX 2010-01-19 20:44:01 +01:00
Vladislav Vaintroub
83bb5da586 Fix compatibility problem with older HPUX 2010-01-19 20:44:01 +01:00
Vladislav Vaintroub
8bffa163f8 Fix various compiler/OS compatibility errors 2010-01-19 16:31:21 +01:00
Vladislav Vaintroub
df4b65b533 Fix various compiler/OS compatibility errors 2010-01-19 16:31:21 +01:00
Bjorn Munch
2c9650f654 merge from next-mr 2010-01-19 13:35:23 +01:00
Bjorn Munch
da1aab425b merge from next-mr 2010-01-19 13:35:23 +01:00
Vladislav Vaintroub
b84abb3c40 merge 2010-01-13 21:14:42 +01:00
Vladislav Vaintroub
17dd1b248a merge 2010-01-13 21:14:42 +01:00
Alexander Nozdrin
0f300ac6b9 Backporting revision from mysql-6.0-codebase-bugfixing.
Original revision:
------------------------------------------------------------
revno: 3817
revision-id: guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38
parent: guilhem@mysql.com-20100107101133-hrrgcdqg508runuf
committer: Guilhem Bichot <guilhem@mysql.com>
branch nick: mysql-6.0-codebase-bugfixing
timestamp: Fri 2010-01-08 10:27:56 +0100
message:
  fix for BUG#50120 "Valgrind errors in any test, inside mysqltest"
  Problem was that as v->name[v->name_len] may be uninitialized (which is ok per se),
  it shouldn't be used in an if(). We remove this zero_the_char/restore_it logic by
  rather zero-terminating the v->name string when we create it in var_init().
------------------------------------------------------------
2010-01-11 19:43:55 +03:00
Alexander Nozdrin
ba3b5a7eb6 Backporting revision from mysql-6.0-codebase-bugfixing.
Original revision:
------------------------------------------------------------
revno: 3817
revision-id: guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38
parent: guilhem@mysql.com-20100107101133-hrrgcdqg508runuf
committer: Guilhem Bichot <guilhem@mysql.com>
branch nick: mysql-6.0-codebase-bugfixing
timestamp: Fri 2010-01-08 10:27:56 +0100
message:
  fix for BUG#50120 "Valgrind errors in any test, inside mysqltest"
  Problem was that as v->name[v->name_len] may be uninitialized (which is ok per se),
  it shouldn't be used in an if(). We remove this zero_the_char/restore_it logic by
  rather zero-terminating the v->name string when we create it in var_init().
------------------------------------------------------------
2010-01-11 19:43:55 +03:00
Alexander Nozdrin
5d61829b29 Backporting revision from mysql-6.0-codebase-bugfixing.
Original revision:

------------------------------------------------------------
revno: 3789.1.9
revision-id: serg@mysql.com-20091229134448-phe834ukzmi0k2e3
parent: serg@mysql.com-20091227081418-bgfg952gzumn1k3h
committer: Sergei Golubchik <serg@mysql.com>
branch nick: 6.0-codebase
timestamp: Tue 2009-12-29 14:44:48 +0100
message:
  better fix for Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
  
  use setenv instead of putenv
------------------------------------------------------------
2010-01-11 19:42:35 +03:00
Alexander Nozdrin
c06a305001 Backporting revision from mysql-6.0-codebase-bugfixing.
Original revision:

------------------------------------------------------------
revno: 3789.1.9
revision-id: serg@mysql.com-20091229134448-phe834ukzmi0k2e3
parent: serg@mysql.com-20091227081418-bgfg952gzumn1k3h
committer: Sergei Golubchik <serg@mysql.com>
branch nick: 6.0-codebase
timestamp: Tue 2009-12-29 14:44:48 +0100
message:
  better fix for Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
  
  use setenv instead of putenv
------------------------------------------------------------
2010-01-11 19:42:35 +03:00
Bjorn Munch
8b166f6d28 upmerge 49269 amendment 2010-01-07 11:28:35 +01:00
Bjorn Munch
6ead8efbe6 upmerge 49269 amendment 2010-01-07 11:28:35 +01:00
Bjorn Munch
73c93ea34c upmerge 49269 amendment 2010-01-07 11:27:00 +01:00
Bjorn Munch
4eb3d76533 upmerge 49269 amendment 2010-01-07 11:27:00 +01:00
Bjorn Munch
e1b42965a5 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Undid amendment allowing pending reap after switching connections
Moved check for pending reap earlier; failed if running with ps-protocol
2010-01-07 11:22:45 +01:00
Bjorn Munch
9ab9c73a87 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Undid amendment allowing pending reap after switching connections
Moved check for pending reap earlier; failed if running with ps-protocol
2010-01-07 11:22:45 +01:00
Bjorn Munch
3d3fad2000 upmerge 49269 amendment 2010-01-06 13:01:16 +01:00
Bjorn Munch
ee54d62d7a upmerge 49269 amendment 2010-01-06 13:01:16 +01:00
Bjorn Munch
b7c0557005 upmerge 49269 amendment 2010-01-06 12:59:41 +01:00
Bjorn Munch
8495313452 upmerge 49269 amendment 2010-01-06 12:59:41 +01:00
Bjorn Munch
ed64190b23 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Small amendment: ignore pending reap when switching connection, add test
2010-01-06 12:56:22 +01:00
Bjorn Munch
570ee4c5e8 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Small amendment: ignore pending reap when switching connection, add test
2010-01-06 12:56:22 +01:00
Bjorn Munch
067e4b8f7e merge 48863,49269,49345,49672,49761 2010-01-06 10:01:11 +01:00
Bjorn Munch
e9313022c2 merge 48863,49269,49345,49672,49761 2010-01-06 10:01:11 +01:00
Bjorn Munch
7ab9cbe3c3 merge 48863,49269,49345,49672,49761 2010-01-06 09:57:44 +01:00
Bjorn Munch
afdaf6d9df merge 48863,49269,49345,49672,49761 2010-01-06 09:57:44 +01:00
Bjorn Munch
08c8863ec4 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Set a flag after send to trap the case
2010-01-06 09:45:28 +01:00
Bjorn Munch
583f77011b Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Set a flag after send to trap the case
2010-01-06 09:45:28 +01:00
Bjorn Munch
5b66dab00f Bug #48863 mysql test: enable and disable case insensitive compare mode
Implemented --lowercase_result which lower cases next result
2010-01-06 09:42:21 +01:00
Bjorn Munch
2ec01d90d8 Bug #48863 mysql test: enable and disable case insensitive compare mode
Implemented --lowercase_result which lower cases next result
2010-01-06 09:42:21 +01:00
Bjorn Munch
bb9c8cd527 merge from mysql-next-mr 2010-01-04 14:12:30 +01:00
Bjorn Munch
a7b2a1ff99 merge from mysql-next-mr 2010-01-04 14:12:30 +01:00
Michael Widenius
85d78b62cc Fix test suite so that it works when doing configure --without-uca
Simplify testing of needed characterset
Remove ndb from --with-plugins=max build
mysqlbug now sends email to maria-developers@lists.launchpad.net

client/mysqltest.cc:
  SKIP now expands variables (for better error messages)
mysql-test/include/have_big5.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_collation.inc:
  Test if '$collation' is supported
mysql-test/include/have_cp1250_ch.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_cp1251.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_cp866.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_cp932.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_eucjpms.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_euckr.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_gb2312.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_gbk.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_koi8r.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_latin2_ch.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_sjis.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_tis620.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_ucs2.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_ujis.inc:
  Simplify by using have_collation.inc
mysql-test/include/have_utf8.inc:
  Simplify by using have_collation.inc
mysql-test/r/create-uca.result:
  Create tests that uses unicode
mysql-test/r/create.result:
  Move test with unicode to create-uca.test
mysql-test/r/have_big5.require:
  Not needed anymore
mysql-test/r/have_cp1250_ch.require:
  Not needed anymore
mysql-test/r/have_cp1251.require:
  Not needed anymore
mysql-test/r/have_cp866.require:
  Not needed anymore
mysql-test/r/have_cp932.require:
  Not needed anymore
mysql-test/r/have_eucjpms.require:
  Not needed anymore
mysql-test/r/have_euckr.require:
  Not needed anymore
mysql-test/r/have_gb2312.require:
  Not needed anymore
mysql-test/r/have_gbk.require:
  Not needed anymore
mysql-test/r/have_koi8r.require:
  Not needed anymore
mysql-test/r/have_latin2_ch.require:
  Not needed anymore
mysql-test/r/have_sjis.require:
  Not needed anymore
mysql-test/r/have_tis620.require:
  Not needed anymore
mysql-test/r/have_ucs2.require:
  Not needed anymore
mysql-test/r/have_ujis.require:
  Not needed anymore
mysql-test/r/have_utf8.require:
  Not needed anymore
mysql-test/r/innodb.result:
  Move tests that depends on unicode to innodb_utf8.test
mysql-test/r/innodb_utf8.result:
  Test moved from innodb.test
mysql-test/suite/rpl/t/rpl_ignore_table.test:
  Test for required collations
mysql-test/t/create-uca.test:
  Create tests that uses unicode
mysql-test/t/create.test:
  Move test with unicode to create-uca.test
mysql-test/t/ctype_utf8.test:
  Test that require unicode
mysql-test/t/ddl_i18n_koi8r.test:
  Test for required collations
mysql-test/t/ddl_i18n_utf8.test:
  Test for required collations
mysql-test/t/fulltext.test:
  Test for required collations
mysql-test/t/fulltext2.test:
  Test for required collations
mysql-test/t/innodb.test:
  Move tests that depends on unicode to innodb_utf8.test
mysql-test/t/innodb_utf8.test:
  Tests that uses unicode
mysql-test/t/query_cache_ps_no_prot.test:
  Test for required collations
mysql-test/t/query_cache_ps_ps_prot.test:
  Test for required collations
scripts/mysqlbug.sh:
  Send emails to maria-developers@lists.launchpad.net
storage/ndb/plug.in:
  Don't include ndb in 'max' builds
2009-12-27 15:54:41 +02:00
Vladislav Vaintroub
541edcc2e4 merge 2009-12-25 16:49:21 +01:00
Vladislav Vaintroub
e8bdef8fcd merge 2009-12-25 16:49:21 +01:00
Staale Smedseng
8c65b726a5 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Staale Smedseng
e3c1c83a16 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Sergei Golubchik
1ad5bb1a69 WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies


CMakeLists.txt:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
client/mysql.cc:
  don't crash with --show-warnings when mysqld dies
config/ac-macros/plugins.m4:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
include/my_getopt.h:
  comments
include/my_pthread.h:
  fix double #define
mysql-test/mysql-test-run.pl:
  run sys_vars suite by default
  properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0
  escape gdb command line arguments
mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
  init_slave+utf8 bug
mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
  init_slave+utf8 bug
mysys/my_getopt.c:
  Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
  Bug#46586 When using the plugin interface the type "set" for options caused a crash.
  Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
mysys/typelib.c:
  support for flagset
sql/ha_ndbcluster.cc:
  backport from telco tree
sql/item_func.cc:
  Bug#49644 init_connect and \0
  Bug#49645 init_slave and multi-byte characters
sql/sql_builtin.cc.in:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
sql/sql_plugin.cc:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
  Bug#32902 plugin variables don't know their names
  Bug#44797 plugins w/o command-line options have no disabling option in --help
sql/sys_vars.cc:
  all server variables are defined here
storage/myisam/ft_parser.c:
  remove unnecessary updates of param->quot
storage/myisam/ha_myisam.cc:
  myisam_* variables belong here
strings/my_vsnprintf.c:
  %o and %llx
unittest/mysys/my_vsnprintf-t.c:
  %o and %llx tests
vio/viosocket.c:
  bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
2009-12-22 10:35:56 +01:00
Sergei Golubchik
ae2768ce9c WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies
2009-12-22 10:35:56 +01:00
Bjorn Munch
034e86a533 Merge from next-mr 2009-12-16 12:14:14 +01:00
Bjorn Munch
b40dd1e592 Merge from next-mr 2009-12-16 12:14:14 +01:00
Bjorn Munch
d00c7a2d5f merge from trunk 2009-12-16 10:43:02 +01:00
Bjorn Munch
5828a6528b merge from trunk 2009-12-16 10:43:02 +01:00
Bjorn Munch
d4676c22e0 Merge from 5.1 main 2009-12-16 10:37:41 +01:00
Bjorn Munch
af9d564303 Merge from 5.1 main 2009-12-16 10:37:41 +01:00
Bjorn Munch
a88898e692 backport mysqltest send_eval from 42520 2009-12-16 10:06:37 +01:00
Bjorn Munch
fd81bc9f9c backport mysqltest send_eval from 42520 2009-12-16 10:06:37 +01:00
Vladislav Vaintroub
a6f6932e26 merge 2009-12-11 21:17:17 +01:00
Vladislav Vaintroub
91d9e6b670 merge 2009-12-11 21:17:17 +01:00
Michael Widenius
82e910d146 Merge with maria-5.1-federatedx; A patch to fix bugs in federatedx and enable federated_server.test
Author: Antony Curtis
License: BSD


client/mysql.cc:
  Reset variable if CTRL-C was used to kill running query, so that the user can do it again
client/mysqlcheck.c:
  Indentation fix
client/mysqlslap.c:
  Indentation fixes
client/mysqltest.cc:
  Make testing of commands safer by also testing length
  Removed not used variable
  Fixed indentation to be as it was before last patch
mysql-test/lib/mtr_report.pm:
  Fixed typo
mysql-test/mysql-test-run.pl:
  Merge (Align code with default mysql-tes-run.pl)
mysql-test/suite/federated/disabled.def:
  Removed test case
storage/federatedx/ha_federatedx.cc:
  Removed my changes and applied Antony's instead
2009-12-03 13:19:05 +02:00
Bjorn Munch
69c540588a Bug #48250 mysqtest_embedded can lock destroyed mutex
As suggested, replaced relevant uses of my_fopen with fopen (and close)
Tested on HPUX where it was reproducable with test innodb_bug30919
2009-11-26 11:16:06 +01:00
Bjorn Munch
ae3e5e3da0 Bug #48250 mysqtest_embedded can lock destroyed mutex
As suggested, replaced relevant uses of my_fopen with fopen (and close)
Tested on HPUX where it was reproducable with test innodb_bug30919
2009-11-26 11:16:06 +01:00
Vladislav Vaintroub
68cfabcc10 merge 2009-11-25 15:20:14 +01:00
Vladislav Vaintroub
53cc3b7bf8 merge 2009-11-25 15:20:14 +01:00
Alexander Nozdrin
52c66b5671 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Alexander Nozdrin
a8d553e0e3 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Konstantin Osipov
9a9e8d2311 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.


client/mysqladmin.cc:
  Bug#32082 : remove VOID macro
client/mysqldump.c:
  Bug#32082 : remove VOID macro
client/mysqlimport.c:
  Bug#32082 : remove VOID macro
client/mysqlslap.c:
  Bug#32082 : remove VOID macro
client/mysqltest.cc:
  Bug#32082 : remove VOID macro
client/sql_string.cc:
  Bug#32082 : remove VOID macro
extra/comp_err.c:
  Bug#32082 : remove VOID macro
extra/replace.c:
  Bug#32082 : remove VOID macro
include/my_alarm.h:
  Bug#32082 : remove VOID macro
include/my_global.h:
  Bug#32082 : remove VOID macro
libmysql/libmysql.c:
  Bug#32082 : remove VOID macro
mysys/errors.c:
  Bug#32082 : remove VOID macro
mysys/hash.c:
  Bug#32082 : remove VOID macro
mysys/mf_iocache2.c:
  Bug#32082 : remove VOID macro
mysys/mf_loadpath.c:
  Bug#32082 : remove VOID macro
mysys/mf_path.c:
  Bug#32082 : remove VOID macro
mysys/my_append.c:
  Bug#32082 : remove VOID macro
mysys/my_clock.c:
  Bug#32082 : remove VOID macro
mysys/my_copy.c:
  Bug#32082 : remove VOID macro
mysys/my_fstream.c:
  Bug#32082 : remove VOID macro
mysys/my_getwd.c:
  Bug#32082 : remove VOID macro
mysys/my_lib.c:
  Bug#32082 : remove VOID macro
mysys/my_lockmem.c:
  Bug#32082 : remove VOID macro
mysys/my_pthread.c:
  Bug#32082 : remove VOID macro
mysys/my_redel.c:
  Bug#32082 : remove VOID macro
mysys/stacktrace.c:
  Bug#32082 : remove VOID macro
mysys/thr_alarm.c:
  Bug#32082 : remove VOID macro
mysys/thr_lock.c:
  Bug#32082 : remove VOID macro
sql/derror.cc:
  Bug#32082 : remove VOID macro
sql/des_key_file.cc:
  Bug#32082 : remove VOID macro
sql/discover.cc:
  Bug#32082 : remove VOID macro
sql/field.cc:
  Bug#32082 : remove VOID macro
sql/filesort.cc:
  Bug#32082 : remove VOID macro
sql/ha_ndbcluster.cc:
  Bug#32082 : remove VOID macro
sql/ha_partition.cc:
  Bug#32082 : remove VOID macro
sql/handler.cc:
  Bug#32082 : remove VOID macro
sql/hostname.cc:
  Bug#32082 : remove VOID macro
sql/init.cc:
  Bug#32082 : remove VOID macro
sql/item.cc:
  Bug#32082 : remove VOID macro
sql/item_cmpfunc.cc:
  Bug#32082 : remove VOID macro
sql/item_strfunc.cc:
  Bug#32082 : remove VOID macro
sql/lock.cc:
  Bug#32082 : remove VOID macro
sql/log.cc:
  Bug#32082 : remove VOID macro
sql/log_event.cc:
  Bug#32082 : remove VOID macro
sql/mysqld.cc:
  Bug#32082 : remove VOID macro
sql/opt_range.h:
  Bug#32082 : remove VOID macro
sql/protocol.cc:
  Bug#32082 : remove VOID macro
sql/records.cc:
  Bug#32082 : remove VOID macro
sql/sp_head.cc:
  Bug#32082 : remove VOID macro
sql/sp_pcontext.cc:
  Bug#32082 : remove VOID macro
sql/sql_acl.cc:
  Bug#32082 : remove VOID macro
sql/sql_base.cc:
  Bug#32082 : remove VOID macro
sql/sql_cache.cc:
  Bug#32082 : remove VOID macro
sql/sql_connect.cc:
  Bug#32082 : remove VOID macro
sql/sql_db.cc:
  Bug#32082 : remove VOID macro
sql/sql_delete.cc:
  Bug#32082 : remove VOID macro
sql/sql_handler.cc:
  Bug#32082 : remove VOID macro
sql/sql_insert.cc:
  Bug#32082 : remove VOID macro
sql/sql_map.cc:
  Bug#32082 : remove VOID macro
sql/sql_parse.cc:
  Bug#32082 : remove VOID macro
sql/sql_select.cc:
  Bug#32082 : remove VOID macro
sql/sql_servers.cc:
  Bug#32082 : remove VOID macro
sql/sql_show.cc:
  Bug#32082 : remove VOID macro
sql/sql_string.cc:
  Bug#32082 : remove VOID macro
sql/sql_table.cc:
  Bug#32082 : remove VOID macro
sql/sql_test.cc:
  Bug#32082 : remove VOID macro
sql/sql_trigger.cc:
  Bug#32082 : remove VOID macro
sql/sql_update.cc:
  Bug#32082 : remove VOID macro
sql/sql_view.cc:
  Bug#32082 : remove VOID macro
sql/table.cc:
  Bug#32082 : remove VOID macro
sql/tztime.cc:
  Bug#32082 : remove VOID macro
sql/udf_example.c:
  Bug#32082 : remove VOID macro
sql/uniques.cc:
  Bug#32082 : remove VOID macro
sql/unireg.cc:
  Bug#32082 : remove VOID macro
storage/archive/ha_archive.cc:
  Bug#32082 : remove VOID macro
storage/blackhole/ha_blackhole.cc:
  Bug#32082 : remove VOID macro
storage/csv/ha_tina.cc:
  Bug#32082 : remove VOID macro
storage/csv/transparent_file.cc:
  Bug#32082 : remove VOID macro
storage/example/ha_example.cc:
  Bug#32082 : remove VOID macro
storage/federated/ha_federated.cc:
  Bug#32082 : remove VOID macro
storage/heap/hp_clear.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_create.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test1.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test2.c:
  Bug#32082 : remove VOID macro
storage/innobase/handler/ha_innodb.cc:
  Bug#32082 : remove VOID macro
storage/myisam/ft_eval.c:
  Bug#32082 : remove VOID macro
storage/myisam/ha_myisam.cc:
  Bug#32082 : remove VOID macro
storage/myisam/mi_changed.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_check.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_close.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_create.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dbug.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete_all.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dynrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_info.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_locking.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_log.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_open.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_packrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_panic.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_rsame.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_statrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test1.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test2.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test3.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_update.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_write.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamchk.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamlog.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisampack.c:
  Bug#32082 : remove VOID macro
storage/myisam/sort.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_close.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_create.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_open.c:
  Bug#32082 : remove VOID macro
strings/str_test.c:
  Bug#32082 : remove VOID macro
tests/thread_test.c:
  Bug#32082 : remove VOID macro
2009-11-24 16:54:59 +03:00
Konstantin Osipov
4cff617c25 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.
2009-11-24 16:54:59 +03:00
Davi Arnaut
64f097dc80 Post-merge fixes: fix typo and remove unused variables. 2009-11-21 10:11:45 -02:00
Davi Arnaut
0b87650887 Post-merge fixes: fix typo and remove unused variables. 2009-11-21 10:11:45 -02:00
Vladislav Vaintroub
39641dfd65 merge 2009-11-20 16:41:07 +01:00
Vladislav Vaintroub
134d5e3a31 merge 2009-11-20 16:41:07 +01:00
Konstantin Osipov
34b11fb627 Merge with next-mr 2009-11-20 17:18:37 +03:00
Konstantin Osipov
d51a4fae32 Merge with next-mr 2009-11-20 17:18:37 +03:00
Davi Arnaut
5aeeaaf507 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Davi Arnaut
ecb6228c62 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Alexey Botchkov
6c832ee4bf merging. 2009-11-17 15:27:40 +04:00
Alexey Botchkov
12043816fa merging. 2009-11-17 15:27:40 +04:00
unknown
a962160eec Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.

This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
2009-11-16 21:49:51 +01:00
Alexander Nozdrin
e99e453633 Auto-merge from mysql-next-mr. 2009-11-12 18:00:24 +03:00
Alexander Nozdrin
e2f935eff7 Auto-merge from mysql-next-mr. 2009-11-12 18:00:24 +03:00
Magne Mahre
a176b24912 Bug #37097 mysqltest add result file format version 2
Add result file format v2

Backport to 5.6.0
2009-11-11 20:25:32 +01:00
Magne Mahre
b2d7daeb6d Bug #37097 mysqltest add result file format version 2
Add result file format v2

Backport to 5.6.0
2009-11-11 20:25:32 +01:00
Bjorn Munch
b229781c2d Bug #48671 mysqltest fails on 'perl' in file sourced inside 'while'
Actually, fails on 'perl' in any while
Fixed essentially the same way as for append_file
2009-11-11 12:46:19 +01:00
Bjorn Munch
ffdb6be755 Bug #48671 mysqltest fails on 'perl' in file sourced inside 'while'
Actually, fails on 'perl' in any while
Fixed essentially the same way as for append_file
2009-11-11 12:46:19 +01:00
Michael Widenius
edd792fe12 Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

Todo before joining with main 5.1 tree:
- Join test fails (Igor to investigate)
- mysql-test-run shows warnings from tests; Some suppression rule is not working (Kristian to investiage)
- Run through all buildbots



sql/sql_table.cc:
  Reverted code for ROW_FORMAT is used. We must set the HA_CREATE_USED_ROW_FORMAT flag in alter table
  to signal the handler that it should not change row_type in update_create_info() (as happens for SHOW CREATE).
storage/maria/ha_maria.cc:
  Update for change in defintion of thd->query
storage/myisam/mi_check.c:
  Simplify code
storage/pbxt/src/discover_xt.cc:
  Update for change in defintion of thd->query
storage/xtradb/dict/dict0dict.c:
  Update for change in defintion of thd->query
storage/xtradb/handler/ha_innodb.cc:
  Copy some critical changes from innodb_plugin to get tests to pass
storage/xtradb/handler/ha_innodb.h:
  Copy some critical changes from innodb_plugin to get tests to pass
storage/xtradb/handler/handler0alter.cc:
  Copy some critical changes from innodb_plugin to get tests to pass
2009-11-11 13:17:49 +02:00
Alexey Botchkov
6388a13230 Bug#42520 killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
The additional patch. That 'loadxml.test' failure was actually about our testing system,
   not the code.
   Firstly we need a new mysqltest command, wich i called 'send_eval'. So the expression
   can be evaluated, then started in a parallel thread. We only have separane 'send' and
   'eval' commands at the moment.
   Then we need to add the waiting code after the 'KILL' to our test, so the thread will be killed
   before the test goes further. The present 'reap' command doesn't handle the killed threads
   well.
      
per-file comments:
  client/mysqltest.cc
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
    The 'send_eval' command implemented.

  mysql-test/r/loadxml.result
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test result updated.

  mysql-test/t/loadxml.test
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test case added.
2009-11-11 00:55:05 +04:00
Alexey Botchkov
6d9aa9ea29 Bug#42520 killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
The additional patch. That 'loadxml.test' failure was actually about our testing system,
   not the code.
   Firstly we need a new mysqltest command, wich i called 'send_eval'. So the expression
   can be evaluated, then started in a parallel thread. We only have separane 'send' and
   'eval' commands at the moment.
   Then we need to add the waiting code after the 'KILL' to our test, so the thread will be killed
   before the test goes further. The present 'reap' command doesn't handle the killed threads
   well.
      
per-file comments:
  client/mysqltest.cc
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
    The 'send_eval' command implemented.

  mysql-test/r/loadxml.result
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test result updated.

  mysql-test/t/loadxml.test
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test case added.
2009-11-11 00:55:05 +04:00
Davi Arnaut
17871ade9a Backport of Bug#41860 to mysql-next-mr
------------------------------------------------------------
revno: 3317
revision-id: davi.arnaut@sun.com-20090522170916-fzc5ca3tjs9roy1t
parent: patrick.crews@sun.com-20090522152933-ole8s3suy4zqyvku
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 41860-6.0
timestamp: Fri 2009-05-22 14:09:16 -0300
message:
  Bug#41860: Without Windows named pipe

  The problem was that the patch for Bug#10374 broke named pipe
  and shared memory transports on Windows due to a failure to
  implement a dummy poll method for transports other than BSD
  sockets. Another problem was that mysqltest lacked support
  for named pipe and shared memory connections, which lead to
  misleading test cases that were supposed run common queries
  over both transports.

  The solution is to properly implement, at the VIO layer, the
  poll and is_connected methods. The is_connected method is
  implemented for every suppported transport and the poll one
  only where it makes sense. Furthermore, support for named pipe
  and shared memory connections is added to mysqltest as to
  enable testing of both transports using the test suite.

client/mysqltest.cc:
  Add support for named pipe and shared memory connections.
include/violite.h:
  Move private functions to vio/vio_priv.h
  Add poll_read and is_connected methods.
mysql-test/t/named_pipe.test:
  Run tests over a named pipe connection.
mysql-test/t/shm.test:
  Run tests over a shared memory connection.
sql/item_func.cc:
  Rename method.
sql/sql_class.cc:
  Remove higher-level vio_is_connected implementation.
sql/sql_class.h:
  Rename vio_is_connected to not conflict with the vio one.
  Verify that there is a valid vio.
vio/vio.c:
  Add poll_read and is_connected methods.
vio/vio_priv.h:
  Add private functions.
vio/viosocket.c:
  Implement the is_connected method for the various transports.
2009-11-10 17:36:38 -02:00
Davi Arnaut
5783428f3b Backport of Bug#41860 to mysql-next-mr
------------------------------------------------------------
revno: 3317
revision-id: davi.arnaut@sun.com-20090522170916-fzc5ca3tjs9roy1t
parent: patrick.crews@sun.com-20090522152933-ole8s3suy4zqyvku
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 41860-6.0
timestamp: Fri 2009-05-22 14:09:16 -0300
message:
  Bug#41860: Without Windows named pipe

  The problem was that the patch for Bug#10374 broke named pipe
  and shared memory transports on Windows due to a failure to
  implement a dummy poll method for transports other than BSD
  sockets. Another problem was that mysqltest lacked support
  for named pipe and shared memory connections, which lead to
  misleading test cases that were supposed run common queries
  over both transports.

  The solution is to properly implement, at the VIO layer, the
  poll and is_connected methods. The is_connected method is
  implemented for every suppported transport and the poll one
  only where it makes sense. Furthermore, support for named pipe
  and shared memory connections is added to mysqltest as to
  enable testing of both transports using the test suite.
2009-11-10 17:36:38 -02:00
Alexander Nozdrin
b712dce3d5 Auto-merge from mysql-next-mr. 2009-11-10 10:31:33 +03:00
Alexander Nozdrin
dadf820743 Auto-merge from mysql-next-mr. 2009-11-10 10:31:33 +03:00
Alexander Nozdrin
49bb8cba8e Fix manual-merge (2nd attempt). 2009-11-10 00:08:17 +03:00
Alexander Nozdrin
516b39c683 Fix manual-merge (2nd attempt). 2009-11-10 00:08:17 +03:00
Alexander Nozdrin
831c8434a7 Fix manual-merge. 2009-11-09 18:13:11 +03:00
Alexander Nozdrin
72362ac7fa Fix manual-merge. 2009-11-09 18:13:11 +03:00
Alexander Nozdrin
7cd11f45be Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
Alexander Nozdrin
d476bbb0be Auto-merge from mysql-next-mr. 2009-11-05 15:08:37 +03:00
Alexander Nozdrin
411a6bfeb9 Auto-merge from mysql-next-mr. 2009-11-05 15:08:37 +03:00
Alexander Nozdrin
660043abaf Auto-merge from mysql-5.1. 2009-11-05 12:36:34 +03:00
Alexander Nozdrin
018358415f Auto-merge from mysql-5.1. 2009-11-05 12:36:34 +03:00
Alexander Nozdrin
b40aed07bf Auto-merge from mysql-5.1. 2009-11-05 12:14:01 +03:00
Alexander Nozdrin
8b78a6af01 Auto-merge from mysql-5.1. 2009-11-05 12:14:01 +03:00
Vladislav Vaintroub
2377eed362 Bug #47423 mtr connects to wrong database
The reason for the bug is that mysqtest as well as other client tools
running in test suite (mysqlbinlog, mysqldump) will first try to connect 
whatever database has created shared memory with default base name 
"MySQL" and use this. (Same effect could be seen on Unix if mtr would
not care to calculate "port" and "socket" parameter).
      
The fix ensures that all client tools and  running in mtr use unique  
per-database shared memory base parameters, so there is no possibility
to clash with already installed one. We use socket name for shared memory 
base (it's known to be unique). This shared-memory-base is written to the
MTR config file to the [client] and [mysqld] sections. Fix made also made 
sure all client tools understand and correctly handle --shared-memory-base.
Prior to this patch  it was not the case for  mysqltest, mysqlbinlog and 
mysql_client_test.
      
All new connections done from mtr scripts via connect() will by default 
set shared-memory-base. And finally, there is a possibility to force 
shared memory or pipe connection and overwrite shared memory/pipe base name
from within mtr scripts via optional PIPE or SHM modifier. This functionality
was manually backported from 6.0
(original patch  http://lists.mysql.com/commits/74749)
2009-11-03 01:19:37 +01:00
Vladislav Vaintroub
2f075a1e37 Bug #47423 mtr connects to wrong database
The reason for the bug is that mysqtest as well as other client tools
running in test suite (mysqlbinlog, mysqldump) will first try to connect 
whatever database has created shared memory with default base name 
"MySQL" and use this. (Same effect could be seen on Unix if mtr would
not care to calculate "port" and "socket" parameter).
      
The fix ensures that all client tools and  running in mtr use unique  
per-database shared memory base parameters, so there is no possibility
to clash with already installed one. We use socket name for shared memory 
base (it's known to be unique). This shared-memory-base is written to the
MTR config file to the [client] and [mysqld] sections. Fix made also made 
sure all client tools understand and correctly handle --shared-memory-base.
Prior to this patch  it was not the case for  mysqltest, mysqlbinlog and 
mysql_client_test.
      
All new connections done from mtr scripts via connect() will by default 
set shared-memory-base. And finally, there is a possibility to force 
shared memory or pipe connection and overwrite shared memory/pipe base name
from within mtr scripts via optional PIPE or SHM modifier. This functionality
was manually backported from 6.0
(original patch  http://lists.mysql.com/commits/74749)
2009-11-03 01:19:37 +01:00
Vladislav Vaintroub
b51777484f merge 2009-11-03 01:52:57 +01:00
Sergei Golubchik
319847a4ec backport of dbug extensions from 6.0:
function/ syntax
  glob(7) wildcards
  unit tests
2009-10-30 19:13:58 +01:00
Sergei Golubchik
6eaf0b5acb backport of dbug extensions from 6.0:
function/ syntax
  glob(7) wildcards
  unit tests
2009-10-30 19:13:58 +01:00
Georgi Kodinov
27c2af97f7 merge 2009-10-30 16:57:16 +02:00
Georgi Kodinov
04af81d7a2 merge 2009-10-30 16:57:16 +02:00
Vladislav Vaintroub
7d5e759907 merge 2009-11-03 01:52:57 +01:00
Alexander Nozdrin
2dc132b209 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Alexander Nozdrin
069d78c067 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Bjorn Munch
e26a2f3b61 new merge from next-mr 2009-10-22 09:36:39 +02:00
Bjorn Munch
23e557d48a new merge from next-mr 2009-10-22 09:36:39 +02:00
Bjorn Munch
3a2434d432 new merge from trunk 2009-10-22 09:13:44 +02:00
Bjorn Munch
6756d64b81 new merge from trunk 2009-10-22 09:13:44 +02:00
Bjorn Munch
cf7afa1164 merge from next-mr 2009-10-18 10:08:07 +02:00
Bjorn Munch
423dacf3c6 merge from next-mr 2009-10-18 10:08:07 +02:00
Bjorn Munch
72c96cbd0e merge from 5.1 main 2009-10-16 23:25:05 +02:00
Bjorn Munch
6c9cb9ba22 merge from 5.1 main 2009-10-16 23:25:05 +02:00
Alexander Nozdrin
b7c3a76cfe Pull from mysql-next-mr-runtime. 2009-10-16 20:30:20 +04:00
Alexander Nozdrin
519f1aee78 Pull from mysql-next-mr-runtime. 2009-10-16 20:30:20 +04:00
Alexander Nozdrin
2397e6593d Backporting patch for Bug#38992 from 6.0.
Original revision:
revno: 2617.55.2
committer: Alexander Nozdrin <alik@sun.com>
branch nick: azalea-bf-bug38992
timestamp: Fri 2009-06-19 16:41:16 +0400
message:
  Fix for Bug#38992: Server crashes sporadically with
  'waiting for initial ...' msg on windows.
  
  The problem is that connection timeout is too small
  for busy windows box.
  
  The fix is to
    - add support for connect_timeout command line argument
      to mysqltest;
    - set default value of the connect_timeout option to
      120 seconds.
2009-10-16 19:14:39 +04:00
Alexander Nozdrin
4ebb631f3a Backporting patch for Bug#38992 from 6.0.
Original revision:
revno: 2617.55.2
committer: Alexander Nozdrin <alik@sun.com>
branch nick: azalea-bf-bug38992
timestamp: Fri 2009-06-19 16:41:16 +0400
message:
  Fix for Bug#38992: Server crashes sporadically with
  'waiting for initial ...' msg on windows.
  
  The problem is that connection timeout is too small
  for busy windows box.
  
  The fix is to
    - add support for connect_timeout command line argument
      to mysqltest;
    - set default value of the connect_timeout option to
      120 seconds.
2009-10-16 19:14:39 +04:00
Konstantin Osipov
3138ee3be1 Backport of 2617.65.4 from 6.0-codebase.
A fix and a test case for Bug#34898 "mysql_info() reports 0 warnings
while mysql_warning_count() reports 1"

Review the patch by Chad Miller, implement review comments
(since Chad left) and push the patch.

This bug is actually not a bug. At least according to Monty.
See Bug#841 "wrong number of warnings" reported back in July 2003
and closed as "not a bug".
mysql_info() was printing the number of truncated columns, not
the number of warnings.
But since the message of mysql_info() was "Warnings: <number of truncated
columns>", people would expect to get the number
of warnings in it, not the number of truncated columns.

So a possible fix would be to change the message of mysql_info()
to say Rows changed: <n>, truncated: <m>.

Instead, put the number of warnings there. That is, remove the
feature that thd->cuted_fields (the number of truncated fields)
is exposed to the client. The number of truncated columns can be
calculated on the client, by analyzing SHOW WARNINGS output,
and in future we may remove thd->cuted_fields altogether.
So let's have one less thing to worry about.

client/mysqltest.cc:
  Fix a bug in mysqltest program which used to return
  a wrong number of affected rows in ps-protocol, and a wrong
  mysql_info() information in both protocols in presence of warnings.
mysql-test/r/insert.result:
  Update results (Bug#34898)
mysql-test/suite/rpl/r/rpl_udf.result:
  Update to the changed output of mysqltest: mysql_info() is now printed
  before warnings.
mysql-test/t/insert.test:
  Add a test case for Bug#34898.
sql/sql_table.cc:
  A fix for Bug#34898 - report statement warn count, not the
  number of truncated values in mysql_info().
sql/sql_update.cc:
  A fix for Bug#34898 - report statement warn count, not the
  number of truncated values in mysql_info().
2009-10-16 17:41:43 +04:00
Konstantin Osipov
8441517b52 Backport of 2617.65.4 from 6.0-codebase.
A fix and a test case for Bug#34898 "mysql_info() reports 0 warnings
while mysql_warning_count() reports 1"

Review the patch by Chad Miller, implement review comments
(since Chad left) and push the patch.

This bug is actually not a bug. At least according to Monty.
See Bug#841 "wrong number of warnings" reported back in July 2003
and closed as "not a bug".
mysql_info() was printing the number of truncated columns, not
the number of warnings.
But since the message of mysql_info() was "Warnings: <number of truncated
columns>", people would expect to get the number
of warnings in it, not the number of truncated columns.

So a possible fix would be to change the message of mysql_info()
to say Rows changed: <n>, truncated: <m>.

Instead, put the number of warnings there. That is, remove the
feature that thd->cuted_fields (the number of truncated fields)
is exposed to the client. The number of truncated columns can be
calculated on the client, by analyzing SHOW WARNINGS output,
and in future we may remove thd->cuted_fields altogether.
So let's have one less thing to worry about.
2009-10-16 17:41:43 +04:00
unknown
95270c9c43 Merge with latest MariaDB 5.1 trunk. 2009-10-15 23:52:31 +02:00
unknown
6aad537a6a Merge MySQL 5.1.39 into MariaDB 5.1. 2009-10-15 23:38:29 +02:00
Konstantin Osipov
3bb00f1946 Backport of:
------------------------------------------------------------
revno: 2476.657.208
committer: anozdrin/alik@station.
timestamp: Tue 2007-12-04 17:22:53 +0300
message:
Remove rpl_probe, enable_rpl_parse and disable_rpl_parse commands
from mysqltest, the corresponding funtctions have been removed from
MySQL C API



client/mysqltest.cc:
  Remove unused functions.
libmysql/CMakeLists.txt:
  Remove manager.c from Windows build.
sql-common/client.c:
  A post-merge fix.
2009-10-16 01:11:42 +04:00
Konstantin Osipov
88f7de578b Backport of:
------------------------------------------------------------
revno: 2476.657.208
committer: anozdrin/alik@station.
timestamp: Tue 2007-12-04 17:22:53 +0300
message:
Remove rpl_probe, enable_rpl_parse and disable_rpl_parse commands
from mysqltest, the corresponding funtctions have been removed from
MySQL C API
2009-10-16 01:11:42 +04:00
Konstantin Osipov
9b41c7532d Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Konstantin Osipov
64dbe379d7 Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Alexander Nozdrin
be8e397496 Backporting of Bug#40128 from 6.0 to next-mr.
Original revision in 6.0:
------------------------------------------------------------
revno: 2599.108.1
committer: Alexander Nozdrin <alik@sun.com>
branch nick: 6.0-rpl-bug40128
timestamp: Wed 2009-01-21 15:33:42 +0300
message:
  Fix for Bug#40128: drop-no_root fails under windows in 6.0-rpl.
  
  The problem was that directories with no permission (000) files
  are deleted differently on UNIX and on Windows.
  
  On UNIX, 000-permission file is deleted perfectly, but other files
  are left in the directory.
  
  On Windows, 000-permission file is not deleted, but other files
  are deleted.
  
  Also, the fix needed a change in mysqltest.c: 'chmod' directive
  should return a positive error code (in order to be handled).
  It's decided to return a constant '1' for all error codes
  just to be OS-independent.
------------------------------------------------------------
2009-10-09 18:52:49 +04:00
Alexander Nozdrin
a9f2b3484a Backporting of Bug#40128 from 6.0 to next-mr.
Original revision in 6.0:
------------------------------------------------------------
revno: 2599.108.1
committer: Alexander Nozdrin <alik@sun.com>
branch nick: 6.0-rpl-bug40128
timestamp: Wed 2009-01-21 15:33:42 +0300
message:
  Fix for Bug#40128: drop-no_root fails under windows in 6.0-rpl.
  
  The problem was that directories with no permission (000) files
  are deleted differently on UNIX and on Windows.
  
  On UNIX, 000-permission file is deleted perfectly, but other files
  are left in the directory.
  
  On Windows, 000-permission file is not deleted, but other files
  are deleted.
  
  Also, the fix needed a change in mysqltest.c: 'chmod' directive
  should return a positive error code (in order to be handled).
  It's decided to return a constant '1' for all error codes
  just to be OS-independent.
------------------------------------------------------------
2009-10-09 18:52:49 +04:00
Alexey Botchkov
760d42e7d0 Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
Alexey Botchkov
de7619823d Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
unknown
e702b70d67 Implement mysqltest --enable_prepare_warnings to properly fix some test failures.
The --enable_prepare_warnings allows to not discard warnings from autorepair
of crashed table in --ps-protocol mode.

Use this to properly fix the parts.partition_recover_myisam and
maria.maria-recover tests.

Add a test case for the new feature. This also adds missing test coverage
for the case where the same warning is thrown in both prepare and execute
phase.


client/mysqltest.cc:
  Implement new commands --enable-prepare_warnings and --disable_prepare_warnings.
mysql-test/r/mysqltest_ps.result:
  Add test case for new --enable_prepare_warning mysqltest command.
mysql-test/suite/maria/t/maria-recover.test:
  Better fix of test case using new --enable_prepare_warnings command.
mysql-test/suite/parts/t/partition_recover_myisam.test:
  Fix test failure in --ps-protocol mode.
mysql-test/t/mysqltest_ps.test:
  Add test case for new --enable_prepare_warning mysqltest command.
2009-10-09 10:09:24 +02:00
Frazer Clement
c7470df2fe Merge 5.0-bugteam-> 5.1-bugteam 2009-10-08 16:36:36 +01:00
Frazer Clement
5f8cfacf6c Merge 5.0-bugteam-> 5.1-bugteam 2009-10-08 16:36:36 +01:00
Bjorn Munch
9b61982f4d merge from mtr-51 2009-10-08 11:34:42 +02:00
Bjorn Munch
79a1ba30e1 merge from mtr-51 2009-10-08 11:34:42 +02:00
Bjorn Munch
9edd40c87e Bug #47218 mysqltest ignores "error" command inside if inside loop
This was affected by same problem as append_file etc.
Added Q_ERROR to special handling, and added small test
2009-10-08 11:30:03 +02:00
Bjorn Munch
9a3d3f4724 Bug #47218 mysqltest ignores "error" command inside if inside loop
This was affected by same problem as append_file etc.
Added Q_ERROR to special handling, and added small test
2009-10-08 11:30:03 +02:00
Frazer Clement
de985fc732 Merge 5.0-bugteam->5.1 bugteam 2009-10-05 13:57:59 +01:00
Frazer Clement
bbda071ed5 Merge 5.0-bugteam->5.1 bugteam 2009-10-05 13:57:59 +01:00
Joerg Bruehe
a6f7fbb850 Merge 5.1-build up into 5.4-build ("trunk-build"). 2009-09-28 11:39:36 +02:00
Joerg Bruehe
650e68b7dc Merge 5.1-build up into 5.4-build ("trunk-build"). 2009-09-28 11:39:36 +02:00
Joerg Bruehe
d609fdf98b Upmerge 5.0-build -> 5.1-build. 2009-09-28 11:07:31 +02:00
Joerg Bruehe
1d9c5686c3 Upmerge 5.0-build -> 5.1-build. 2009-09-28 11:07:31 +02:00
Georgi Kodinov
9910148c72 automerge 2009-09-23 11:31:18 +03:00
Georgi Kodinov
bafc15748b automerge 2009-09-23 11:31:18 +03:00
Bjorn Munch
f89b36fcbf new merge from trunk 2009-09-18 16:44:11 +02:00
Bjorn Munch
9d9ee64637 new merge from trunk 2009-09-18 16:44:11 +02:00
Georgi Kodinov
4ac694822b automerge 2009-09-18 16:35:40 +03:00
Georgi Kodinov
5d68d4a534 automerge 2009-09-18 16:35:40 +03:00
Alexander Nozdrin
70972926ab A patch for Bug#45118 (mysqld.exe crashed in debug mode
on Windows in dbug.c) -- part 2: a patch for the DBUG subsystem
to detect misuse of DBUG_ENTER / DBUG_RETURN macros.
5.1 version.
2009-09-10 11:40:57 +04:00
Alexander Nozdrin
96c8843514 A patch for Bug#45118 (mysqld.exe crashed in debug mode
on Windows in dbug.c) -- part 2: a patch for the DBUG subsystem
to detect misuse of DBUG_ENTER / DBUG_RETURN macros.
5.1 version.
2009-09-10 11:40:57 +04:00
Sergey Petrunya
29f0dcb563 Merge MySQL->MariaDB
* Finished Monty and Jani's merge
* Some InnoDB tests still fail (because it's old xtradb code run against
  newer testsuite). They are expected to go after mergning with the latest
  xtradb.
2009-09-08 00:50:10 +04:00
Bjorn Munch
29a142043e initial merge from 5.1-mtr 2009-09-04 15:20:58 +02:00
Bjorn Munch
b5dd609a55 initial merge from 5.1-mtr 2009-09-04 15:20:58 +02:00
Bjorn Munch
31f9d5fd16 second merge from main, with adaptions 2009-09-02 23:29:11 +02:00
Bjorn Munch
39fca129fb second merge from main, with adaptions 2009-09-02 23:29:11 +02:00
Bjorn Munch
a829604260 first merge from main 2009-09-02 18:58:17 +02:00
Bjorn Munch
588e9930b4 first merge from main 2009-09-02 18:58:17 +02:00
Bjorn Munch
fe3ea31d93 Bug #32296 mysqltest fails to parse "append_file" inside a "while", it works inside
a "if"
Bug #41913 mysqltest cannot source files from if inside while
Some commands require additional processing which only works first time
Keep content for write_file or append_file with the st_command struct
Add tests for those cases to mysqltest.test
2009-09-02 11:17:33 +02:00
Bjorn Munch
d65168fdda Bug #32296 mysqltest fails to parse "append_file" inside a "while", it works inside
a "if"
Bug #41913 mysqltest cannot source files from if inside while
Some commands require additional processing which only works first time
Keep content for write_file or append_file with the st_command struct
Add tests for those cases to mysqltest.test
2009-09-02 11:17:33 +02:00
Bjorn Munch
d4854d7494 merge 2009-09-01 19:31:28 +02:00
Bjorn Munch
5703baad97 merge 2009-09-01 19:31:28 +02:00
Staale Smedseng
5be4c38226 Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Bjorn Munch
d19eda4a9b Bug #39003 mtr's diff_files command failed in pushbuild without printing a result diff
diff was actually called but result never outputted before exiting
Added extra code to dump output *unless* failure was expected
2009-08-19 13:48:56 +02:00
Bjorn Munch
3efecb1626 Bug #39003 mtr's diff_files command failed in pushbuild without printing a result diff
diff was actually called but result never outputted before exiting
Added extra code to dump output *unless* failure was expected
2009-08-19 13:48:56 +02:00
Bjorn Munch
b9d1c04b79 Bug #46164 memory leak in mysqltest after parse error with --debug
Moved some dynstr_free() further up
2009-08-18 15:26:17 +02:00
Bjorn Munch
0211f76d14 Bug #46164 memory leak in mysqltest after parse error with --debug
Moved some dynstr_free() further up
2009-08-18 15:26:17 +02:00
Bjorn Munch
b742c771af Bug #44012 mtr: test cases that are not supposed to return output always fail
Output would match an empty result file but we don't check
Allow empty output IFF there is an empty result file.
2009-08-11 23:41:44 +02:00
Bjorn Munch
c32c55eef7 Bug #44012 mtr: test cases that are not supposed to return output always fail
Output would match an empty result file but we don't check
Allow empty output IFF there is an empty result file.
2009-08-11 23:41:44 +02:00
Davi Arnaut
55eee5208c Merge from 5.1 main. 2009-06-08 09:55:37 -03:00
Davi Arnaut
02a5dd38f3 Merge from 5.1 main. 2009-06-08 09:55:37 -03:00
Tatiana A. Nurnberg
d7d61f59dd manual merge 2009-06-06 18:41:40 +02:00
Tatiana A. Nurnberg
69e78274ae manual merge 2009-06-06 18:41:40 +02:00
Bjorn Munch
cf6aeea48c merge from 5.1 main 2009-05-29 13:04:02 +02:00
Bjorn Munch
524bd596e2 merge from 5.1 main 2009-05-29 13:04:02 +02:00
Bjorn Munch
444bbe56f5 cherry picking fix for Bug #39542 from 6.0-runtime 2009-05-27 22:54:40 +02:00