Commit graph

305 commits

Author SHA1 Message Date
Sergei Golubchik
eb29a63e45 SET STATEMENT timestamp=xxx ....
fix sys_var->is_default() method (that was using default_val property
in a global sys_var object to track per-session state):
* move timestamp to a dedicated Sys_var_timestamp class
  (in fact, rename Sys_var_session_special_double to Sys_var_timestamp)
* make session_is_default a virtual method with a special implementation
  for timestamps
* other variables don't have a special behavior for default values
  and can have session_is_default() to be always false.
2015-04-09 19:41:59 +02:00
Sergei Golubchik
ba80708f66 MDEV-6960 Server crashes in check_alter_user on setting a default role via PS
There were two issues:

* set_var_default_role::user was overwritten with a new value,
  allocated in the thd->mem_root, which is reset between executions.
  That was causing the crash. Solved by introducing set_var_default_role::real_user

* when privilege tables were opened on EXECUTE, the reprepare_observer
  would abort the statement (as privilege tables are opened using
  the local TABLE_LIST that doesn't preserve metadata from PREPARE, so
  reprepare_observer thought they're changed). This issue also applied
  to SET PASSWORD. Solved by disabling reprepare_observer.
2015-02-28 19:48:22 +01:00
Sergei Golubchik
b814046719 validate SET PASSWORD 2014-12-04 10:41:55 +01:00
Oleksandr Byelkin
1827d9e6d1 MDEV-5231: Per query variables from Percona Server (rewritten) 2014-11-11 11:48:50 +01:00
Sergei Golubchik
f62c12b405 Merge 10.0.14 into 10.1 2014-10-15 12:59:13 +02:00
Sergei Golubchik
2a4e8813f6 GLOBAL_VALUE_ORIGIN=AUTO 2014-10-11 10:23:21 +02:00
Sergei Golubchik
3fa8c279d5 INFORMATION_SCHEMA.SYSTEM_VARIABLES.GLOBAL_VALUE_ORIGIN 2014-10-11 10:23:20 +02:00
Sergei Golubchik
513f5840f8 MDEV-6138 show sysvar's help in I_S tables
INFORMATION_SCHEMA.SYSTEM_VARIABLES
2014-10-11 10:23:20 +02:00
Sergei Golubchik
a7b2c95a40 bugs in sys_var::val_* code
1. @@boolean_var differs from SHOW VARIABLES
2. @@str_var ignored variable charset (which is wrong
   for path variables that use filesystem charset)
3. @@signed_int_var in the string context was printed
   as unsigned
2014-10-10 22:27:42 +02:00
Sergei Golubchik
b969a69021 cleanup: simplify sys_var::val* methods, introduce val_str_nolock() 2014-10-10 22:27:42 +02:00
Sergei Golubchik
d508ef7898 cleanup: more 'const' qualifiers 2014-10-10 22:27:41 +02:00
Sergei Golubchik
28ebc2a724 cleanup: sysvar, only one common check_update_type() 2014-10-10 22:27:41 +02:00
Sergei Golubchik
051c132635 cleanup: sysvar, SHOW_VALUE_IN_HELP->GETOPT_ONLY_HELP
replace flag SHOW_VALUE_IN_HELP (that's not really an
independendent flag, as it should only be used for
NO_CMD_LINE sysvars) with a special getopt.id type.
2014-10-10 22:27:40 +02:00
Sergei Golubchik
3620910eea cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
Alexander Barkov
c9d3b27d29 Using more Item_string_sys 2014-09-04 12:15:05 +04:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Vicentiu Ciorbaru
64b27c734e Added default role implementation 2014-07-23 14:48:12 +02:00
Alexander Barkov
f9e5f237f0 MDEV-6027 RLIKE: "." no longer matching new line
Added a new system variable:
default_regex_flags='DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY'
2014-04-23 10:57:25 +04:00
Sergei Golubchik
0dc23679c8 10.0-base merge 2014-02-26 15:28:07 +01:00
Sergei Golubchik
0b9a0a3517 5.5 merge 2014-02-25 16:04:35 +01:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Michael Widenius
10001c8e4f Automatic merge 2014-02-05 19:23:11 +02:00
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Sergei Golubchik
59d9d08e2b 5.5 merge 2014-02-01 00:54:03 +01:00
Sergei Golubchik
92eafe1ab1 MDEV-5521 SET ROLE as prepared statement crashes the server
set_role::light_check() was incorrect
2014-01-28 21:02:17 +01:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Michael Widenius
273078c5fa Fixes to get valgrind to work with jemalloc
- Added MALLOC_LIBRARY variable to hold name of malloc library
- Back ported valgrind related fixes from jemalloc 3.4.1 to the included jemalloc 3.3.1
- Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1
- Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc
- Show version related variables in mysqld --help
  -- Added SHOW_VALUE_IN_HELP marker

Increased back_log to 150 as the original value was a bit too small


CMakeLists.txt:
  Added MALLOC_LIBRARY variable to hold name of malloc library
cmake/jemalloc.cmake:
  Added MALLOC_LIBRARY variable to hold name of malloc library
config.h.cmake:
  Added MALLOC_LIBRARY variable to hold name of malloc library
extra/jemalloc/ChangeLog:
  Updates changelog
extra/jemalloc/include/jemalloc/internal/arena.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/private_namespace.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/include/jemalloc/internal/tcache.h:
  Backported valgrind fixes from jemalloc 3.4.1
extra/jemalloc/src/arena.c:
  Backported valgrind fixes from jemalloc 3.4.1
include/my_bitmap.h:
  Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free() to avoid clash with jemalloc 3.4.1
mysql-test/mysql-test-run.pl:
  Use option --soname-synonyms=somalloc=NON to valgrind when using jemalloc
mysql-test/valgrind.supp:
  Supression of memory leak in OpenSuse 12.3
mysys/my_bitmap.c:
  Renamed bitmap_init() and bitmap_free() to my_bitmap_init() and my_bitmap_free()
sql/ha_ndbcluster_binlog.cc:
  Renames
sql/ha_ndbcluster_cond.h:
  Renames
sql/ha_partition.cc:
  Renames
sql/handler.cc:
  Renames
sql/item_subselect.cc:
  Renames
sql/log_event.cc:
  Renames
sql/log_event_old.cc:
  Renames
sql/mysqld.cc:
  Renames
  Show version related variables in mysqld --help
sql/opt_range.cc:
  Renames
sql/opt_table_elimination.cc:
  Renames
sql/partition_info.cc:
  Renames
sql/rpl_injector.h:
  Renames
sql/set_var.h:
  Renames
sql/slave.cc:
  Renames
sql/sql_bitmap.h:
  Renames
sql/sql_insert.cc:
  Renames
sql/sql_lex.h:
  Renames
sql/sql_parse.cc:
  Renames
sql/sql_partition.cc:
  Renames
sql/sql_select.cc:
  Renames
sql/sql_show.cc:
  Renames
sql/sql_update.cc:
  Renames
sql/sys_vars.cc:
  Show version related variables in mysqld --help
sql/sys_vars.h:
  Added SHOW_VALUE_IN_HELP marker for variables that should be shown in --help
sql/table.cc:
  Renames
sql/table.h:
  Removed not used bitmap_init_value
storage/connect/ha_connect.cc:
  Removed compiler warning
storage/maria/ma_open.c:
  Renames
unittest/mysys/bitmap-t.c:
  Renames
2014-01-02 11:19:19 +02:00
Vicențiu Ciorbaru
db25d8f977 Modified set_role_var to implement both a role check in the check() function,
as well as only set privileges in the update() function.
2013-10-17 20:39:23 -07:00
Vicențiu Ciorbaru
6062e87f54 Created new set_var_role class to handle the SET ROLE command 2013-10-17 15:11:21 -07:00
Nisha Gopalakrishnan
14976fbe8a BUG#16032946 - PLEASE GIVE A MESSAGE FOR "THREAD_CONCURRENCY DOESN'T
DO WHAT YOU EXPECT"

Fix info:
--------

Backport of the deprecation bug fix (WL#5265) for global variable
'THREAD_CONCURRENCY' from mysql-5.6 to mysql-5.5

Note: With this backport, certain additional deprecation warnings
      would be reported under error conditions while setting the
      global/session variables.
2013-09-05 13:40:27 +05:30
Sergei Golubchik
97e640b9ae 5.5 merge 2013-07-17 21:24:29 +02:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Sergei Golubchik
7d3288129f create sys_var::val_str(), sys_var::val_int(), sys_var::val_real().
Change Item_func_get_system_var::val_xxx functions to use that.

mysql-test/t/variables.test:
  @@GLOBAL.INIT_CONNECT is never NULL anymore. Nor it ever was.
  It was a bug that empty string system variables appeared as NULL
  in the *integer context* (but not in a string, real, or decimal context!)
2013-04-09 23:27:19 +02:00
Murthy Narkedimilli
8afe262ae5 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Annamalai Gurusami
436d8402a1 Bug #16044655 CRASH: SETTING DEFAULT VALUE FOR SOME VARIABLES
Problem:

When a system variable is being set to the DEFAULT value, the server
segfaults if there is no 'default' defined for that system variable.
For example, for the following statements server segfaults.

set session rand_seed1=DEFAULT;
set session rand_seed2=DEFAULT;

Analysis:

The class sys_var represents one system variable.  The class set_var represents
one system variable that is to be updated.   The class set_var contains two 
pieces of information, the system variable to object (set_var::var) member
and the value to be updated (set_var::value).

When the given value is 'default', the set_var::value will be NULL.

To update a system variable the member set_var::update() will be called, 
which in turn will call sys_var::update() or sys_var::set_default() depending
on whether a value has been provided or not.  

If the sys_var::set_default() is called, then the default value is obtained
either from the session scope or the global scope.  This default value is
stored in a local temporary set_var object and then passed on to the 
sys_var::update() call.  A local temporary set_var object is needed because
sys_var::set_default() does not take set_var as an argument.

In the given scenario, the set_var::update() called sys_var::set_default().
And this sys_var::set_default() obtains the default value and then calls
sys_var::update().  To pass this value to sys_var::update() a local set_var
object is being created.   While creating this local set_var object, its member
set_var::var was incorrectly left as 0.  

Solution:

Instead of creating a local set_var object, the sys_var::set_default() can take
the set_var object as an argument just like sys_var::update().

rb://1996 approved by Nirbhay and Ramil.
2013-02-25 10:28:25 +05:30
Annamalai Gurusami
64c5c5cbfc Merge from mysql-5.1 to mysql-5.5 2013-02-22 15:15:14 +05:30
Annamalai Gurusami
dc6969734a Bug #14211565 CRASH WHEN ATTEMPTING TO SET SYSTEM VARIABLE TO RESULT OF VALUES()
Problem:

When the VALUES() function is inappropriately used in the SET stmt the server
exits.  

set port = values(v);

This happens because the values(v) will be parsed as an Item_insert_value by
the parser.  Both Item_field and Item_insert_value return the type as
FIELD_ITEM.  But for Item_insert_value the field_name member is NULL.  In
set_var constructor, when the type of the item is FIELD_ITEM we try to access
the non-existent field_name. 

The class hierarchy is as follows:
Item -> Item_ident -> Item_field -> Item_insert_value

The Item_ident::field_name is NULL for Item_insert_value.  

Solution:

In the parsing stage, in the set_var constructor if the item type is
FIELD_ITEM and if the field_name is non-existent, then it is probably
the Item_insert_value.  So leave it as it is for later evaluation.

rb://2004 approved by Roy and Norvald.
2013-02-22 14:56:17 +05:30
Sergei Golubchik
6a742fc3b1 MDEV-3927 Add variable "have yassl"
have_openssl variable was ON even when OpenSSL was not used (but YaSSL was).
fix that, so that have_openssl really corresponds to OpenSSL

rename not_openssl.inc to not_ssl.inc and fix the test accordingly.
2012-12-18 11:56:00 +01:00
Igor Babaev
7760efad74 Merge mariadb-5.5 -> 10.0-base. 2012-12-16 16:49:19 -08:00
Sergei Golubchik
ee9afef271 mysql-5.5.28 2012-10-16 13:04:42 +02:00
Michael Widenius
8ac1b41cf3 Made max_relay_log_size depending on master connection.
Changed names of multi-source log files so that original suffixes are kept.


include/my_sys.h:
  Added fn_ext2(), which returns pointer to last '.' in file name
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
  Updated test
mysql-test/suite/multi_source/info_logs-master.opt:
  Test with strange file names
mysql-test/suite/multi_source/info_logs.result:
  Updated results
mysql-test/suite/multi_source/info_logs.test:
  Changed to test with complex names to be able to verify the filename generator code
mysql-test/suite/multi_source/relaylog_events.result:
  Updated results
mysql-test/suite/multi_source/reset_slave.result:
  Updated results
mysql-test/suite/multi_source/skip_counter.result:
  Updated results
mysql-test/suite/multi_source/skip_counter.test:
  Added testing of max_relay_log_size
mysql-test/suite/rpl/r/rpl_row_max_relay_size.result:
  Updated results
mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result:
  Updated results
mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result:
  Updated results
mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test:
  Updated results
mysys/mf_fn_ext.c:
  Added fn_ext2(), which returns pointer to last '.' in file name
sql/log.cc:
  Removed some wrong casts
sql/log.h:
  Updated comment to reflect new code
sql/log_event.cc:
  Updated DBUG_PRINT
sql/mysqld.cc:
  Added that max_relay_log_size copies it's values from max_binlog_size
sql/mysqld.h:
  Removed max_relay_log_size
sql/rpl_mi.cc:
  Changed names of multi-source log files so that original suffixes are kept.
sql/rpl_mi.h:
  Updated prototype
sql/rpl_rli.cc:
  Updated comment to reflect new code
  Made max_relay_log_size depending on master connection.
sql/rpl_rli.h:
  Made max_relay_log_size depending on master connection.
sql/set_var.h:
  Made option global so that one can check and change min & max values (sorry Sergei)
sql/sql_class.h:
  Made max_relay_log_size depending on master connection.
sql/sql_repl.cc:
  Updated calls to create_signed_file_name()
sql/sys_vars.cc:
  Made max_relay_log_size depending on master connection.
  Made old code more reusable
sql/sys_vars.h:
  Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size
  Made old code more reusable
2012-10-01 02:30:44 +03:00
Martin Hansson
df2bdd6063 Bug#14498355: DEPRECATION WARNINGS SHOULD NOT CONTAIN MYSQL VERSION
NUMBERS

If a system variable was declared as deprecated without mention of an
alternative, the message would look funny, e.g. for @@delayed_insert_limit:

Warning 1287 '@@delayed_insert_limit' is deprecated and
will be removed in MySQL .

The message was meant to display the version number, but it's not
possible to give one when declaring a system variable.

The fix does two things:

1) The definition of the message
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT is changed so that it does
not display a version number. I.e. in English the message now reads:

Warning 1287 The syntax '@@delayed_insert_limit' is deprecated and
will be removed in a future version.

2) The message ER_WARN_DEPRECATED_SYNTAX_WITH_VER is discontinued in
favor of ER_WARN_DEPRECATED_SYNTAX for system variables. This change
was already done in versions 5.6 and above as part of wl#5265. This
part is simply back-ported from the worklog.
2012-08-24 10:17:08 +02:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
unknown
22a504f897 Merge MWL#234: @@skip_replication feature to MariaDB 5.5. 2012-03-01 12:41:49 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Tor Didriksen
b522a6ce78 Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS
handle_segfault is the signal handler code of mysqld.  however, it makes
calls to potentially unsafe functions localtime_r, fprintf, fflush.



include/my_stacktrace.h:
  Add safe versions of itoa() write() and snprintf().
libmysqld/CMakeLists.txt:
  Move signal handler to separate file.
mysys/stacktrace.c:
  Remove unsafe function calls.
sql/CMakeLists.txt:
  Move signal handler to separate file.
sql/mysqld.cc:
  Move signal handler to separate file.
sql/set_var.h:
  Add missing #include dependency.
sql/sys_vars.cc:
  Cleanup .h and .cc files.
sql/sys_vars.h:
  Cleanup .h and .cc files.
2011-12-02 14:16:48 +01:00