summaryrefslogtreecommitdiff
path: root/client
Commit message (Collapse)AuthorAgeFilesLines
* Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-06-1010-399/+413
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Bug #50407 mysqlbinlog --database=X produces bad output for SAVEPOINTs2010-03-281-3/+1
| | | | | | | | | | | | | | | | | When mysqlbinlog was given the --database=X flag, it always printed 'ROLLBACK TO', but the corresponding 'SAVEPOINT' statement was not printed. The replicated filter(replicated-do/ignore-db) and binlog filter (binlog-do/ignore-db) has the same problem. They are solved in this patch together. After this patch, We always check whether the query is 'SAVEPOINT' statement or not. Because this is a literal check, 'SAVEPOINT' and 'ROLLBACK TO' statements are also binlogged in uppercase with no any comments. The binlog before this patch can be handled correctly except one case that any comments are in front of the keywords. for example: /* bla bla */ SAVEPOINT a; /* bla bla */ ROLLBACK TO a;
* Bug #44178: mysql cli does not comply with GPLv2 clause 2cGeorgi Kodinov2010-03-111-9/+11
| | | | Applied a path from Jim Winstead : Added a GPL notice. Added the missing '(c)' and 'v2'.
* mergeGeorgi Kodinov2010-03-101-2/+3
|\
| * Bug #41057: mysql_update fails FATAL ERROR: Failed to create temporary file ↵Georgi Kodinov2010-03-091-2/+3
| | | | | | | | | | | | | | | | | | | | for defaults mysql_upgrade was passing an non-initialized non-null tmpdir to create_temp_file() if no --tmpdir was specified. This prevents create_temp_file() from taking the system temporary file path and as a result mysql_upgrade was trying to open a file in a directory that it may not have write access to. Fixed by making sure mysql_upgrade will pass a zero length temp dir string to create_temp_file() if no --tmpdir is specified.
* | Bug#37316: Anonymous error messages noticed sometimes, while running tests ↵Davi Arnaut2010-03-081-1/+1
|/ | | | | | | | | | 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.
* Automerge: BUG 48993 bundle from bug report --> mysql-5.1-bugteam.Luis Soares2010-03-081-3/+8
|\
| * BUG#48993: valgrind errors in mysqlbinlogLuis Soares2010-02-171-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found three issues during the analysis: 1. Memory leak caused by temp_buf not being freed; 2. Memory leak caused when handling argv; 3. Conditional jump that depended on unitialized values. Issue #1 -------- DESCRIPTION: when mysqlbinlog is reading from a remote location the event temp_buf references the incoming stream (in NET object), which is not freed by mysqlbinlog explicitly. On the other hand, when it is reading local binary log, it points to a temporary buffer that needs to be explicitly freed. For both cases, the temp_buf was not freed by mysqlbinlog, instead was set to 0. This clearly disregards the free required in the second case, thence creating a memory leak. FIX: we make temp_buf to be conditionally freed depending on the value of remote_opt. Found out that similar fix is already in most recent codebases. Issue #2 -------- DESCRIPTION: load_defaults is called by parse_args, and it reads default options from configuration files and put them BEFORE the arguments that are already in argc and argv. This is done resorting to MEM_ROOT. However, parse_args calls handle_options immediately after which changes argv. Later when freeing the defaults, pointers to MEM_ROOT won't match, causing the memory not to be freed: void free_defaults(char **argv) { MEM_ROOT ptr memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr)); free_root(&ptr,MYF(0)); } FIX: we remove load_defaults from parse_args and call it before. Then we save argv with defaults in defaults_argv BEFORE calling parse_args (which inside can then call handle_options at will). Actually, found out that this is in fact kind of a backport for BUG#38468 into 5.1, so I merged in the test case as well and added error check for load_defaults call. Fix based on: revid:zhenxing.he@sun.com-20091002081840-uv26f0flw4uvo33y Issue #3 -------- DESCRIPTION: the structure st_print_event_info constructor would not initialize the sql_mode member, although it did for sql_mode_inited (set to false). This would later raise the warning in valgrind when printing the sql_mode in the event header, as this print out is protected by a check against sql_mode_inited and sql_mode variables. Given that sql_mode was not initialized valgrind would output the warning. FIX: we add initialization of sql_mode to the st_print_event_info constructor.
* | merge from 5.1-mtrBjorn Munch2010-02-221-61/+233
|\ \ | |/ |/|
| * Bug #51135 Please increase the maximum number of connections allowed in ↵Bjorn Munch2010-02-171-10/+21
| | | | | | | | | | | | | | mysqltest Added --max-connections= argument to mysqltest and mtr Small fix to first patch: forgot to check before free'ing connections array
| * Bug #50618 Please allow 'sleep $variable' in mtrBjorn Munch2010-02-091-5/+17
| | | | | | | | | | Made mtr's sleep function understand $variables A few fixes since previous patch, added tests
| * merge from 5.1 mainBjorn Munch2010-02-076-19/+59
| |\
| * | Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be ↵Bjorn Munch2010-02-041-1/+78
| | | | | | | | | | | | | | | | | | | | | documented Added remove_files_wildcard that allows to remove multiple files at once. This is a port of original patch to Windows.
| * | merge 49837Bjorn Munch2010-01-201-0/+4
| |\ \
| | * | Bug #49837 mysqltest exec cannot handle multi-line command correctlyBjorn Munch2010-01-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Since the exec command line is passed on externally, it cannot take newlines Simply replace \n with space Now also added test case
| * | | merge 48888Bjorn Munch2010-01-201-2/+2
| |\ \ \
| | * | | Bug #48888 mysqltest crashes on --replace_result if 'from' is longer than ↵Bjorn Munch2010-01-201-2/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~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
| * | | Bug #49878 delimiter under false 'if' makes mysqltest test fail with ↵Bjorn Munch2010-01-201-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 'Missing end of block' delimiter not executed so does not recognize end of block Always execute delimiter command, revert after false if() block.
| * | | exporting server version and other as env var (bug#50471)Bernd Ocklin2010-01-201-1/+8
| |/ /
| * | Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'Bjorn Munch2010-01-071-4/+3
| | | | | | | | | | | | | | | Undid amendment allowing pending reap after switching connections Moved check for pending reap earlier; failed if running with ps-protocol
| * | Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'Bjorn Munch2010-01-061-0/+1
| | | | | | | | | | | | Small amendment: ignore pending reap when switching connection, add test
| * | Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'Bjorn Munch2010-01-061-2/+12
| | | | | | | | | | | | Set a flag after send to trap the case
| * | Bug #48863 mysql test: enable and disable case insensitive compare modeBjorn Munch2010-01-061-2/+24
| | | | | | | | | | | | Implemented --lowercase_result which lower cases next result
| * | Merge from 5.1 mainBjorn Munch2009-12-163-44/+128
| |\ \
| * | | backport mysqltest send_eval from 42520Bjorn Munch2009-12-161-2/+4
| | | |
| * | | Bug #48250 mysqtest_embedded can lock destroyed mutexBjorn Munch2009-11-261-4/+4
| | | | | | | | | | | | | | | | | | | | As suggested, replaced relevant uses of my_fopen with fopen (and close) Tested on HPUX where it was reproducable with test innodb_bug30919
| * | | Bug #48671 mysqltest fails on 'perl' in file sourced inside 'while'Bjorn Munch2009-11-111-32/+41
| | | | | | | | | | | | | | | | | | | | Actually, fails on 'perl' in any while Fixed essentially the same way as for append_file
* | | | Recommit of Bug#49447.Staale Smedseng2010-02-0410-144/+171
| |_|/ |/| |
* | | Bug #49223 Change help description for mysqldumpStaale Smedseng2010-01-271-1/+1
| | | | | | | | | | | | | | | | | | --extended-insert Help message changed to the same as in the 5.1 online documentation.
* | | WL#5182 Remove more deprecated 4.1/5.0 featuresMagne Mahre2010-01-273-5/+9
| | | | | | | | | | | | | | | WL#5182 is a follow-up to WL#5154, deprecating a few more options and system variables.
* | | WL#5154 Remove deprecated 4.1 featuresMagne Mahre2010-01-215-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several items said to be deprecated in the 4.1 manual have never been removed. This worklog adds deprecation warnings when these items are used, and warns the user that the items will be removed in MySQL 5.6. A couple of previously deprecation decision have been reversed (see single file comments)
* | | mergeGeorgi Kodinov2009-12-241-1/+1
|\ \ \
| * | | Bug #48866: mysql.test fails under Fedora 12Georgi Kodinov2009-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strmov() is not guaranteed to work correctly on overlapping source and destination buffers. On some OSes it may work, but Fedora 12 has a stpcpy() that's not working correctly on overlapping buffers. Fixed to use the overlap-safe version of strmov instead. Re-vitalized the overlap-safe version of strmov.
* | | | Manual merge.Davi Arnaut2009-12-181-2/+2
|\ \ \ \ | |/ / /
| * | | Bug#48983: Bad strmake calls (length one too long)Davi Arnaut2009-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is a somewhat common misusage of the strmake function. The strmake(dst, src, len) function writes at most /len/ bytes to the string pointed to by src, not including the trailing null byte. Hence, if /len/ is the exact length of the destination buffer, a one byte buffer overflow can occur if the length of the source string is equal to or greater than /len/.
| * | | Backport fix for Bug #27884.Jim Winstead2009-11-231-4/+7
| | | |
* | | | Merge approved bug fixJim Winstead2009-12-171-1/+2
|\ \ \ \
| * | | | The mysql command line client ignored the --skip-column-names optionJim Winstead2009-09-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | when used in conjunction with --vertical. (Bug #47147, patch by Harrison Fisk)
* | | | | This is a patch for bug#41569.lars-erik.bjork@sun.com2009-12-031-0/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table but does not set values". mysql_upgrade (ver 5.1) adds 3 fields (character_set_client, collation_connection and db_collation) to the mysql.proc table, but does not set any values. When we run stored procedures, which were created with mysql 5.0, a warning is logged into the error log. The solution to this is for mysql_upgrade to set default best guess values for these fields. A warning is also written during upgrade, to make the user aware that default values are set.
* | | | merge to mysql-5.1-bugteamSatya B2009-11-261-3/+1
|\ \ \ \
| * \ \ \ auto-mergeTatiana A. Nurnberg2009-11-241-3/+1
| |\ \ \ \
| | * | | | Bug#47655: Memory free error when connecting to 4.1 server from 5.1+ clientTatiana A. Nurnberg2009-11-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting the (5.1+) mysql command-line client, we try to get "select @@version_comment" from the server to present it to the user. Recent clients are aware that older servers do not have that variable and fall back on other info to be able to present *something* at least. This fallback string was allocated through the POSIX interface, but released through the my*() suite, which rightfully complained about the imbalance in calls when compiled with --debug. While this wasn't as bad as it looked (no double-free, use of uninitialized or freed buffer, etc.), it did look funky. Using my_strdup() now for what will be my_free()d later.
* | | | | | Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39Satya B2009-11-251-2/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql client displays wrong character-set of server. When a user changes the charset of a server, mysql client 'status' command displays wrong charset but the command "SHOW VARIABLES LIKE "%charset%" displayed correct charset results. The problem is only with the mysql client's 'status' command output. In mysql client, the method mysql_store_lazy_result() returns 0 for success and non-zero for failure. The method com_status() was using this method wrongly. Fixed all such instances according to return value of the method mysql_store_lazy_result().
* | | | | Post-merge fixes: fix typo and remove unused variables.Davi Arnaut2009-11-211-4/+1
| | | | |
* | | | | mergeVladislav Vaintroub2009-11-033-38/+57
|\ \ \ \ \
| * \ \ \ \ mergeGeorgi Kodinov2009-10-301-24/+28
| |\ \ \ \ \ | | | |_|/ / | | |/| | |
| | * | | | merge from 5.0-mainGeorgi Kodinov2009-10-301-24/+28
| | |\ \ \ \
| | | * \ \ \ Merge from mysql-5.0.87-releasekaren.langford@sun.com2009-10-261-24/+28
| | | |\ \ \ \
| | | | * | | | Added make targets 'test-bt-fast' and 'test-bt-debug-fast'Hery Ramilison2009-10-151-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put variable declaration at the beginning of a block
| * | | | | | | Bug #34777 mysqlbinlog: --help output for --base64-output is hard to ↵2009-10-281-5/+7
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | understand Append the description of the 'decode-rows' value for --base64-output argument.