Commit graph

112 commits

Author SHA1 Message Date
Oleksandr Byelkin
cb4da5da74 MDEV-20604: Duplicate key value is silently truncated to 64 characters in print_keydup_error
Added indication of truncated string for "s" and "M" formats
2020-04-01 11:34:32 +02:00
Marko Mäkelä
a6585d5ce9 Merge 10.0 into 10.1 2019-03-27 11:56:08 +02:00
chriscalender
f00e25b4c4 Fix for MDEV-15538, '-N' Produce html output wrong 2019-03-22 01:01:59 +04:00
Marko Mäkelä
213ece2f2e Merge 10.1 into 10.1
This is joint work with Oleksandr Byelkin.
2019-02-02 13:00:15 +02:00
Sergei Golubchik
2175bfce3e Crude "auto-load-data-local-infile" mode
Disable LOAD DATA LOCAL INFILE suport by default and
auto-enable it for the duration of one query, if the query
string starts with the word "load". In all other cases the application
should enable LOAD DATA LOCAL INFILE support explicitly.
2019-01-27 18:54:12 +01:00
Vladislav Vaintroub
68eb9b1a78 MDEV-16220 Do not pass UTF8 to mysql in command line parameters, on Windows
Moved parts of mysql.test to mysql_not_windows.test
2018-08-14 22:42:46 +02:00
Sergei Golubchik
d3cc15eb82 Merge branch '10.0' into 10.1 2017-06-30 13:28:39 +02:00
Sergei Golubchik
d5cd334504 MDEV-13187 incorrect backslash parsing in clients
cover ANSI_QUOTES and NO_BACKSLASH_ESCAPES in mysqltest
2017-06-27 14:00:37 +02:00
Sergei Golubchik
39385ff7b2 MDEV-13187 incorrect backslash parsing in clients
don't do backslash escapes inside backticks
2017-06-27 13:25:50 +02:00
Sergei Golubchik
a98c85bb50 Merge branch '10.0-galera' into 10.1 2016-11-02 13:44:07 +01:00
Sergei Golubchik
383007c75d mysql cli: fix USE command quoting
* use proper sql quoting rules for USE, while preserving
  as much of historical behavior as possible
* short commands (\u) behave as before
2016-10-13 21:38:32 +02:00
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