Commit graph

101 commits

Author SHA1 Message Date
Oleksandr Byelkin
e3982cead2 MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
Alexander Barkov
e6f67c64cd MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database 2015-03-16 21:55:10 +04:00
Sergei Golubchik
b718dc449b mysql --skip-column-names flag should not affect alignment of field values,
set num_flag[] unconditionally, not under "if (column_names)"

http://ronaldbradford.com/blog/unexplained-trivial-mysql-behavior-2013-08-02/
2013-08-08 13:33:15 +02:00
Sergei Golubchik
8161c6772d merge with mysql-5.5.30 minus few incorrect or not applicable changesets 2013-02-28 18:42:49 +01:00
Sergei Golubchik
aca8e7ed6b 5.3 merge 2013-01-15 19:07:46 +01:00
Sergei Golubchik
4f67a14700 5.2->5.3 merge 2013-01-10 15:40:21 +01:00
Sergei Golubchik
2e11ca36f2 mysql-5.1.67 merge 2013-01-09 23:51:51 +01:00
Sergei Golubchik
2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00
Sergei Golubchik
d2755a2c9c 5.3->5.5 merge 2011-11-22 18:04:38 +01:00
Michael Widenius
fa36a7426b Fixed lp:879939 "assertion in ha_maria::enable_indexes with derived_with_keys=on"
Honor unique/not unique when creating keys for internal tempory tables.
Added new variables to be used to limit how keys are created for internal temporary tables.


include/maria.h:
  Added maria_max_key_length() and maria_max_key_segments()
include/myisam.h:
  Added myisam_max_key_length() and myisam_max_key_segments()
mysql-test/r/mysql.result:
  Drop all used tables
mysql-test/r/subselect4.result:
  Added test case for lp:879939
mysql-test/t/mysql.test:
  Drop all used tables
mysql-test/t/subselect4.test:
  Added test case for lp:879939
sql/mysql_priv.h:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/mysqld.cc:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/share/errmsg.txt:
  Added new error message for internal errors
sql/sql_select.cc:
  Give error if we try to create a wrong key (this error should never happen)
  Honor unique/not unique when creating keys for internal tempory tables.
storage/maria/ha_maria.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/maria/ha_maria.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
storage/maria/ma_check.c:
  Fixed bug in Duplicate key error printing (now row position is printed correctly)
storage/maria/ma_create.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/ma_info.c:
  Added extern function maria_max_key_length() to calculate the max key length based on current block size.
storage/maria/ma_open.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/maria_def.h:
  maria_max_key_length() -> _ma_max_key_length()
storage/myisam/ha_myisam.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/myisam/ha_myisam.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
2011-10-26 20:25:18 +03:00
Michael Widenius
282c303746 Added MariaDB executable comment syntax: /*M!##### */
client/mysql.cc:
  Don't remove MariaDB executable comments.
mysql-test/r/comments.result:
  Test MariaDB executable comments.
mysql-test/r/mysql.result:
  Test MariaDB executable comments.
mysql-test/t/comments.test:
  Test MariaDB executable comments.
mysql-test/t/mysql.test:
  Test MariaDB executable comments.
sql/sql_cache.cc:
  Don't delete MariaDB executable comments.
sql/sql_lex.cc:
  Handle MariaDB executable comments
2011-08-29 18:14:14 +03:00
Nirbhay Choubey
45e17739d4 Merging from mysql-5.1-bugteam 2010-12-01 12:28:21 +05:30
Nirbhay Choubey
2d81ad5be5 Additional fix for bug#54899
Fixing the testcase to use the database name
as connected_db instead of 'test' database.

mysql-test/r/mysql.result:
  Additional fix in the test for bug#54899.
mysql-test/t/mysql.test:
  Additional fix in the test for bug#54899.
2010-12-01 12:25:31 +05:30
Alexander Barkov
f826970656 Merging from mysql-5.1-bugteam 2010-11-26 17:22:06 +03:00
Nirbhay Choubey
e1b773cb53 Bug #54899 : --one-database option cannot handle DROP/CREATE DATABASE commands
After dropping and recreating the database specified along with --one-database
option at command line, mysql client keeps filtering the statements even after
the execution of a 'USE' command on the same database.

--one-database option enables the filtering of statements when the current
database is not the one specified at the command line. However, when the same
database is dropped and recreated the variable (current_db) that holds the
inital database name gets altered. This bug exploits the fact that current_db
initially gets set to null value (0) when a 'use db_name' follows the recreation
of same database db_name (speficied at the command line) and hence skip_updates
gets set to 1, which inturn triggers the further filtering of statements.

Fixed by making get_current_db() a no-op function when one_database is set,
and hence, under that condition current_db will not get altered.
Note, however the value of current_db can change when we execute 'connect'
command with a differnet database to reconnect to the server, in which case,
the behavior of --one-database will be formulated using this new database.


client/mysql.cc:
  Bug #54899 : --one-database option cannot handle DROP/CREATE DATABASE commands
  
  Added an if statement at the beginnning of get_current_db() , which makes it
  a no-op function if one-database option is specified, and hence current_db
  remains unchanged.
  
  Changed the help message for one-database option to a more appropriate message
  as specified in mysql documentation.
mysql-test/r/mysql.result:
  Added a test case for bug#54899 and some more test cases to
  check other one-database option related behaviors.
mysql-test/t/mysql.test:
  Added a test case for bug#54899 and some more test cases to
  check other one-database option related behaviors.
2010-11-26 19:27:59 +05:30
Alexander Nozdrin
40271e4f5e Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_plugin.cc
2010-01-18 23:19:19 +03:00
Alexander Nozdrin
0ae23cd69d Auto-merge from mysql-trunk-merge. 2009-12-24 10:56:13 +03:00
Alexey Kopytov
930a08784c Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

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/instance_map.cc
Contents conflict in server-tools/instance-manager/listener.cc
Contents conflict in server-tools/instance-manager/options.cc
Contents conflict in server-tools/instance-manager/user_map.cc
2009-12-23 16:42:05 +03:00
Sergei Golubchik
bb865442a4 minimal changes to errmst-utf8.txt (mostly whitespace) to match 6.0-codebase better 2009-12-22 12:02:52 +01:00
Jim Winstead
dd1378c8ff Merge approved bug fix 2009-12-17 12:06:36 -08:00
Alexander Nozdrin
aceea2342f Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Alexander Nozdrin
5676713687 Manual merge from mysql-trunk.
Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
2009-12-11 12:39:38 +03:00
Georgi Kodinov
14b9f46db4 merge 2009-11-27 16:41:45 +02:00
Jim Winstead
84c5abbd33 Backport fix for Bug #27884. 2009-11-23 14:38:08 -08:00
Magne Mahre
77b8e5d9b5 Bug#26780: automatic vertical output for wide results
Feature from Eric Bergen, CLA signed 2007-06-27.
  
Adds new mysql client option "--auto-vertical-output", which causes
the client to test whether a result table is too wide for the current
window (where available) and emit vertical results in that case.
Otherwise, it sends normal tabular results.


client/client_priv.h:
  Add another enum value to client options, for automatic vertical output.
client/mysql.cc:
  Add another command-line option, "auto-vertical-output".
      
  Add functions to get the terminal width and functions to get the widths of fields.
      
  Use them together to emit vertical output when some output table is too wide to
  fit in the terminal.  If the terminal doesn't support reading its width, then assume
  80-positions wide.
mysql-test/r/mysql.result:
  Show that various select statements do work as expected.  Wide tables become vertical
  and narrow ones do not.
mysql-test/t/mysql.test:
  Show that various select statements do work as expected.
      
  These should be suitable for a wide range of window capabilities and sizes.  Under
  extreme circumstances, the results could be arbitrary.
2009-11-04 13:20:02 +01:00
Sergey Glukhov
d8c3f2263f WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
Jim Winstead
8f4d1026de The mysql command line client ignored the --skip-column-names option
when used in conjunction with --vertical. (Bug #47147, patch by
Harrison Fisk)
2009-09-21 15:20:14 -07:00
Jim Winstead
ba1f513f1b Fix incorrectly-committed changes to mysql.result 2009-07-31 16:43:46 -07:00
Jim Winstead
a90bcde091 Merge bug fix. 2009-07-30 17:51:25 -07:00
Jim Winstead
c754b00a1f The handling of NUL bytes in column data in the various output formats
supported by the mysql client was inconsistent. (Bug #28203)
2009-07-14 17:03:51 -07:00
Jim Winstead
1286d0f3f9 Merge in bug fixes for client tools 2009-07-14 10:08:38 -07:00
Sergey Glukhov
b4a725c4f3 5.0-bugteam->5.1-bugteam merge 2009-05-28 16:21:41 +05:00
Sergey Glukhov
4cfc9d771a test case fix 2009-05-28 16:19:49 +05:00
Sergey Glukhov
0aa26d39aa 5.0-bugteam->5.1-bugteam merge 2009-05-28 13:40:09 +05:00
Sergey Glukhov
1b91400ac6 Bug#37268 'binary' character set makes CLI-internal commands case sensitive
The fix is to use case insensitive collation
for mysql client command search.



client/mysql.cc:
  The fix is to use case insensitive collation
  for mysql client command search.
mysql-test/r/mysql.result:
  test result
mysql-test/t/mysql.test:
  test case
2009-05-28 13:34:30 +05:00
Jim Winstead
1e9a02c943 The mysql command-line client would include superfluous spaces at the end of
some result set lines. (Bug #29622)
2009-05-20 17:04:44 -07:00
Jim Winstead
4161dc49b3 Merge from 5.0-bugteam 2009-05-13 08:48:00 -07:00
Jim Winstead
3fe1d299ec Fix support for -i (--ignore-spaces) in the mysql command line application,
which didn't actually do anything. (Bug #39101)
2009-05-07 10:28:29 -07:00
Jim Winstead
fb2d75cb75 Bug #27884: 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
Alexey Kopytov
938f094804 Manuel merge. 2009-03-24 23:48:31 +03:00
Alexey Kopytov
8d4d3e1301 Fix for bug #43801: mysql.test takes too long, fails due to
expired timeout on debx86-b in PB 

Moved the resource-intensive test case for bug #41486 into 
a separate test file to reduce execution time for mysql.test. 


mysql-test/include/wait_until_disconnected.inc:
  Used in mysql-bug41486.test.
mysql-test/r/mysql-bug41486.result:
  Moved the resource-intensive test case for bug #41486 into 
  a separate test file to reduce execution time for mysql.test.
mysql-test/r/mysql.result:
  Moved the resource-intensive test case for bug #41486 into 
  a separate test file to reduce execution time for mysql.test.
mysql-test/t/mysql-bug41486.test:
  Moved the resource-intensive test case for bug #41486 into 
  a separate test file to reduce execution time for mysql.test.
mysql-test/t/mysql.test:
  Moved the resource-intensive test case for bug #41486 into 
  a separate test file to reduce execution time for mysql.test.
2009-03-24 23:44:38 +03:00
Alexey Kopytov
bd1bbd10c8 Automerge. 2009-03-19 13:04:20 +03:00
Alexey Kopytov
afcfe81fea Fixed test failures in 5.1/6.0 introduced by the patch
for bug #41486. Session max_allowed_packet is read-only
as of MySQL 5.1.31. In addition, the global variable
now has no effect on the current session.
2009-03-19 13:02:23 +03:00
Alexey Kopytov
2b2533955f Manual merge. 2009-03-18 11:27:49 +03:00
Alexey Kopytov
73a7d99331 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(). 

client/my_readline.h:
  Changed the interface of batch_readline().
client/mysql.cc:
  Honor the truncated flag returned by batch_readline() and do  
  not append the newline character if it was set. Since we can't 
  change the interfaces for readline()/fgets() used in the  
  interactive mode, always assume the returned string was not  
  truncated. In addition, always set the batch_readline()  
  internal buffer to 1 MB, independently from the client's  
  max_allowed_packet.
client/readline.cc:
  Added the 'truncated' argument do batch_readline() to signal 
  truncated string to a caller. 
  Fixed fill_buffer() to set the EOF flag correctly. 
  Fixed checks in intern_read_line() to not allow the internal  
  buffer grow past the specified limit.
mysql-test/r/mysql.result:
  Added a test case for bug #41486.
mysql-test/t/mysql.test:
  Added a test case for bug #41486.
2009-03-18 11:18:24 +03:00
Georgi Kodinov
dc69c3439f merged bug 31060 to 5.1-bugteam 2009-02-25 11:09:41 +02:00
Georgi Kodinov
4b05db5cfd Bug #31060: MySQL CLI parser bug 2
There was a problem when a DELIMITER COMMAND is not the first 
command on the line. I this case an extra line feed was added
to the glob buffer and this was causing subsequent attempts 
to enter this delimiter to fail.
Fixed by not adding a new line to the glob buffer if the 
command being added is a DELIMITER

client/mysql.cc:
  Bug #31060: Don't add a new line if DELIMTER is added to
  the glob buffer
mysql-test/r/mysql.result:
  Bug #31060: test case
mysql-test/t/mysql.test:
  Bug #31060: test case
2009-02-24 15:06:28 +02:00
Georgi Kodinov
85ea3740ff Bug #31060: MySQL CLI parser bug 2
There was a problem when a DELIMITER COMMAND is not the first 
command on the line. I this case an extra line feed was added
to the glob buffer and this was causing subsequent attempts 
to enter this delimiter to fail.
Fixed by not adding a new line to the glob buffer if the 
command being added is a DELIMITER

client/mysql.cc:
  Bug #31060: Don't add a new line if DELIMTER is added to
  the glob buffer
mysql-test/r/mysql.result:
  Bug #31060: test case
mysql-test/t/mysql.test:
  Bug #31060: test case
2009-02-24 15:06:28 +02:00
Georgi Kodinov
d09185fafa merged 41437 to 5.1-bugteam 2009-01-09 19:51:52 +02:00
Georgi Kodinov
ac885d5dfb Bug #41437: Value stored in 'case' lacks charset, causes segfault
When substituting system constant functions with a constant result
the server was not expecting that the function may return NULL.
Fixed by checking for NULL and returning Item_null (in the relevant
collation) if the result of the system constant function was NULL.

mysql-test/r/mysql.result:
  Bug #41437: test case
mysql-test/t/mysql.test:
  Bug #41437: test case.
  Relies on database() returning NULL if no database is
  selected.
sql/item_strfunc.cc:
  Bug #41437: Check for NULL result on evaluating the system
  constant function and return a constant NULL item.
2009-01-09 13:50:18 +02:00