Skip to content

Instantly share code, notes, and snippets.

View nirbhayc's full-sized avatar

Nirbhay Choubey nirbhayc

  • Bloomberg LP
  • New York
View GitHub Profile
List #1 : 5.7.14 vs 5.6.32 vs 10.2.2
------------------------------------
MariaDB [test]> SELECT _57.name Variable, _57.value _57, _56.value _56, _102.value _102
-> FROM sysvars_mysql_5_7_14 _57, sysvars_mysql_5_6_32 _56, sysvars_maria_10_2_2 _102
-> WHERE _57.name = _56.name
-> AND _57.name = _102.name
-> AND _57.value != _56.value
-> AND _57.name NOT IN ('sql_mode', 'optimizer_switch', 'log_error', 'version', 'timestamp');
+------------------------------------------+-----------------+-----------+-------------+
| Variable | _57 | _56 | _102 |
innodb_buffer_pool_dump_at_shutdown = ON
innodb_buffer_pool_dump_pct = 25
innodb_buffer_pool_load_at_startup = ON
innodb_checksum_algorithm = CRC32
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda (Antelope?)
innodb_large_prefix = ON
innodb_log_compressed_pages = ON (It was turned back off in 10.1.2)
innodb_log_file_size = 128M (Current default: 48M)
innodb_purge_threads = 4
diff --git a/sql/log.cc b/sql/log.cc
index b77a6b3..be24bcd 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -3138,6 +3138,22 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
}
+/*
+ Print some additional information about addition/removal of
diff --git a/sql/log_event.cc b/sql/log_event.cc
index afa58af..66e7c60 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6022,7 +6022,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi,
new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length);
thd->set_db(new_db.str, new_db.length);
DBUG_ASSERT(thd->query() == 0);
- thd->reset_query_inner(); // Should not be needed
+ if (thd->query()) thd->reset_query(); // Should not be needed
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 33c8ed2..4b42d14 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3765,7 +3765,7 @@ class THD :public Statement,
void set_query(const CSET_STRING &string_arg)
{
mysql_mutex_lock(&LOCK_thd_data);
- set_query_inner(string_arg);
+ Statement::set_query_inner(string_arg);
diff --git a/.gitmodules b/.gitmodules
index c49f2ca..6419657 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -3,4 +3,4 @@
url = https://github.com/MariaDB/mariadb-connector-c
[submodule "storage/rocksdb/rocksdb"]
path = storage/rocksdb/rocksdb
- url = [email protected]:facebook/rocksdb.git
+ url = https://github.com/facebook/rocksdb.git
@nirbhayc
nirbhayc / building-myrocks
Created October 26, 2016 21:27
Building mariadb-myrocks from source.
1) Patch (ssh to https) : https://gist.github.com/nirbhayc/b5487506f53a66cc087c52c631b05d6a
2) sudo apt-get install g++ cmake libbz2-dev libaio-dev bison zlib1g-dev libsnappy-dev libgflags-dev \
libreadline6-dev libncurses5-dev libssl-dev liblz4-dev gdb git
3) git submodule init
4) git submodule update
5) mkdir b install
6) cd b
7) cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=system -DWITH_ZLIB=bundled -DMYSQL_MAINTAINER_MODE=1 \
-DENABLE_DTRACE=0 -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 -DCMAKE_INSTALL_PREFIX=../install && make -j2 install
** Note: -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 added to avoid MDEV-10788
@nirbhayc
nirbhayc / error_warning_inconsistency
Created November 3, 2016 03:26
Error vs warning inconsistency with 'STRICT_TRANS_TABLES,NO_ZERO_DATE'
MariaDB [test]> show create table t1;
+-------+-------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@nirbhayc
nirbhayc / STRICT_TRANS_TABLES_and_SET
Created November 3, 2016 17:26
sql_mode='STRICT_TRANS_TABLES' & SET @@var=<out-of-range>
MariaDB [test]> select @@version;
+----------------------+
| @@version |
+----------------------+
| 10.2.3-MariaDB-debug |
+----------------------+
1 row in set (0.00 sec)
MariaDB [test]> select @@sql_mode;
+---------------------+
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 5169b7c..b214a17 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2649,13 +2649,16 @@ mysql_execute_command(THD *thd)
}
/*
- Bail out if DB snapshot has not been installed. We however, allow SET,
- SHOW and SELECT queries (only if wsrep_dirty_reads is set).