1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-20 21:01:21 +03:00
Commit Graph

663 Commits

Author SHA1 Message Date
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
cbfdc588e9 Bug : mysql cli does not comply with GPLv2 clause 2c
Applied a path from Jim Winstead : Added a GPL notice.
Added the missing '(c)' and 'v2'.
2010-03-11 15:16:54 +02:00
e3c1c83a16 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
e17fe14c81 WL#5182 Remove more deprecated 4.1/5.0 features
WL#5182 is a follow-up to WL#5154, deprecating a few more options
and system variables.
2010-01-27 13:23:28 +01:00
0482b6ebca WL#5154 Remove deprecated 4.1 features
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)
2010-01-21 09:10:05 +01:00
b90ecd4bae merge 2009-12-24 11:00:04 +02:00
a8e039a2c8 Merge approved bug fix 2009-12-17 12:06:36 -08:00
b640b8f036 Bug : mysql.test fails under Fedora 12
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.
2009-12-16 19:31:19 +02:00
8e53e7e415 merge to mysql-5.1-bugteam 2009-11-26 13:12:16 +05:30
dacd32f955 Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
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().
2009-11-25 12:25:49 +05:30
531d32a5bb Backport fix for Bug . 2009-11-23 14:38:08 -08:00
a0d5521f06 Bug#47655: Memory free error when connecting to 4.1 server from 5.1+ client
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.
2009-11-02 00:46:00 -08:00
cf7e2e1db4 manual merge of 28141 2009-10-20 11:00:07 -07:00
3f42e4bd24 Bug#28141: Control C on query waiting on lock causes ERROR 1053 (server shutdown)
If a thread is killed in the server, we throw "shutdown" only if one is actually in
progress; otherwise, we throw "query interrupted".

Control-C in the mysql command-line client is "incremental" now.
First Control-C sends KILL QUERY (when connected to 5.0+ server, otherwise, see next)
Next  Control-C sends KILL CONNECTION
Next  Control-C aborts client.

As the first two steps only pertain to an existing query,
Control-C will abort the client right away if no query is running.

client will give more detailed/consistent feedback on Control-C now.
2009-10-19 21:42:10 -07:00
9449be5868 merge 2009-10-14 17:36:11 +03:00
60132409f8 "MySQL Network" => "MySQL Enterprise" 2009-10-08 22:55:28 +02:00
8b9843408d Bug Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
fecdb6a384 The mysql command line client ignored the --skip-column-names option
when used in conjunction with --vertical. (Bug , patch by
Harrison Fisk)
2009-09-21 15:20:14 -07:00
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
2217de2513 Bug Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.
2009-08-28 17:51:31 +02:00
a0e44ec1e8 Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
207584e4d4 Merge bug fix. 2009-07-30 17:51:25 -07:00
49404d101b The handling of NUL bytes in column data in the various output formats
supported by the mysql client was inconsistent. (Bug )
2009-07-14 17:03:51 -07:00
bd0a44fba2 Merge in bug fixes for client tools 2009-07-14 10:08:38 -07:00
6455c5689d Bug#37274 client 'status' command doesn't print all info after losing connection to
server

If the server connection was lost during repeated status commands,
the client would fail to detect this and the client output would be inconsistent.

This patch fixes this issue by making sure that the server is online
before the client attempts to execute the status command.
2009-07-03 13:55:45 +02:00
db1591a7a2 Merge from 5.0 2009-06-29 16:00:47 +02:00
19dfaa5824 Merge from 5.0-bt 2009-06-29 15:17:01 +02:00
c92abdc2a0 Bug#44834 strxnmov is expected to behave as you'd expect
The problem: described in the bug report.
The fix:
--increase buffers where it's necessary
  (buffers which are used in stxnmov)
--decrease buffer lengths which are used
2009-06-19 13:24:43 +05:00
8297782e32 Automerge. 2009-06-17 15:50:50 +04:00
08410f34dd Bug : large blob inserts from mysqldump fail, possible
memory issue ? 
 
The mysql command line client could misinterpret some character 
sequences as commands under some circumstances. 
 
The upper limit for internal readline buffer was raised to 1 GB 
(the same as for server's max_allowed_packet) so that any input 
line is processed by add_line() as a whole rather than in 
chunks.
2009-06-10 11:24:47 +04:00
871ea8a735 5.0-bugteam->5.1-bugteam merge 2009-05-28 13:40:09 +05:00
394f6ba478 Bug#37268 'binary' character set makes CLI-internal commands case sensitive
The fix is to use case insensitive collation
for mysql client command search.
2009-05-28 13:34:30 +05:00
66f12372c1 The mysql command-line client would include superfluous spaces at the end of
some result set lines. (Bug )
2009-05-20 17:04:44 -07:00
00920ce29b The mysql command-line client didn't implement the readline magic-space
command, which bash does, which could result in a user accidentally disabling
the use of the space key in the mysql command-line client. (Bug )
2009-05-19 10:17:05 -07:00
2e7cdfd3e7 Merge from 5.0-bugteam 2009-05-13 08:48:00 -07:00
337a20a800 The mysql command-line client did not properly handle MYSQL_HISTFILE being set
to an empty string, or to /dev/null, as we suggest and have suggested in the
documentation. (Bug )
2009-05-07 17:48:20 -07:00
0ba8aa103e Fix support for -i (--ignore-spaces) in the mysql command line application,
which didn't actually do anything. (Bug )
2009-05-07 10:28:29 -07:00
8a43356fac Remove extraneous space in --debug-check usage info. 2009-04-28 11:30:21 -07:00
345040a025 Bug : mysql --html does not quote HTML special characters in output
Fix encoding of field values and names in HTML output from mysql client.
2009-04-28 10:54:26 -07:00
04ee3f2ffa Bug#41268 Help Text for \c is misleading in client command line interface(addon)
fixed message for 'help' command
2009-04-14 19:16:30 +05:00
c0db307e28 5.0-bugteam->5.1-bugteam merge 2009-04-14 19:17:44 +05:00
8aff42f6a0 auto-merge 2009-03-23 05:21:45 +01:00
deb566d6b3 auto-merge 2009-03-23 05:09:51 +01:00
e5a599bd73 Bug#43254: SQL_SELECT_LIMIT=0 crashes command line client
When asking what database is selected, client expected
to *always* get an answer from the server.

We now handle failure more gracefully.

See comments in ticket for a discussion of what happens,
and how things interlock.
2009-03-23 05:08:32 +01:00
dc1e9bfb56 Bug#43153: Version comment is too long
mysql-client used static buffer to concatenate server-
version and version_comment. Sufficiently long comments
could get cut off. This was harmless, but looked daft.

Now using a dynamic buffer instead.
2009-03-19 18:42:43 +01:00
5d13d4f34e auto-merge 2009-03-19 09:58:56 -04:00
e82390130e auto-merge 2009-03-19 09:44:58 -04:00
e55b1424af 5.0-bugteam->5.1-bugteam merge 2009-03-19 13:26:12 +04:00
28d6b77c23 Bug#41268 Help Text for \c is misleading in client command line interface
fixed help message
2009-03-19 12:37:34 +04:00
a3e5737abd Fix for bug#41486: extra character appears in BLOB for every
~40Mb after mysqldump/import 
        
When the input string exceeds the maximum allowed size for the 
internal buffer, batch_readline() returns a truncated string. 
Since there was no way for a caller to determine whether the 
string was truncated or not, the command line client assumed 
batch_readline() to always return the whole input string and 
appended a newline character. This resulted in garbled data 
when importing dumps containing strings longer than the 
maximum input buffer size. 
  
Fixed by adding a flag to the batch_readline() interface to 
signal a truncated string to the caller. 
  
Other minor problems fixed during patch implementation: 
 
- The maximum allowed buffer size for batch_readline() was set 
up depending on the client's max_allowed_packet value. It does 
not actully make any sense, as those variables are not 
related. The input buffer size limit is now always set to 1 
MB. 
  
- fill_buffer() did not always set the EOF flag. 
 
- The input buffer could actually grow twice as the specified 
limit due to insufficient checks in intern_read_line().
2009-03-18 11:18:24 +03:00