From cd81a719430d493bdffc8c2132fdad4c351c0f02 Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary Date: Tue, 24 Feb 2015 12:09:58 +0100 Subject: Raise version number after cloning 5.5.43 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dbfc5f823c9..fa5486099ce 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=43 +MYSQL_VERSION_PATCH=44 MYSQL_VERSION_EXTRA= -- cgit v1.2.1 From 2e3c2cd3625598d6de940b51675dd6a979676ed9 Mon Sep 17 00:00:00 2001 From: Mithun C Y Date: Wed, 25 Feb 2015 11:44:19 +0530 Subject: Bug #20049521: CRASH IN MERGE_BUFFERS FILESORT.C WHEN INNODB WITH ORDER BY. ISSUE: ------ There can be up to MERGEBUFF2 number of sorted merge chunks, We need enough buffer space for at least one record from each merge chunks. If estimates are wrong(very low) and we allocate buffer space for less than MERGEBUFF2, then we will have issue in merge_buffers, if actual number of rows to be sorted is bigger than estimate and external filesort is chosen. SOLUTION: --------- Set number of rows to sort to be at least MERGEBUFF2. --- sql/filesort.cc | 9 ++++++++- storage/innobase/handler/ha_innodb.cc | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index 1414be2af45..98900efb0d5 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -203,6 +203,13 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, const ulong min_sort_memory= max(MIN_SORT_MEMORY, ALIGN_SIZE(MERGEBUFF2 * (param.rec_length + sizeof(uchar*)))); + /* + Cannot depend on num_rows. For external sort, space for upto MERGEBUFF2 + rows is required. + */ + if (num_rows < MERGEBUFF2) + num_rows= MERGEBUFF2; + while (memory_available >= min_sort_memory) { ulong keys= memory_available / (param.rec_length + sizeof(char*)); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 676a20fa372..6ec7586779a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -7906,6 +7906,13 @@ ha_innobase::estimate_rows_upper_bound(void) estimate = 2 * local_data_file_length / dict_index_calc_min_rec_len(index); + /* Set num_rows less than MERGEBUFF to simulate the case where we do + not have enough space to merge the externally sorted file blocks. */ + DBUG_EXECUTE_IF("set_num_rows_lt_MERGEBUFF", + estimate = 2; + DBUG_SET("-d,set_num_rows_lt_MERGEBUFF"); + ); + prebuilt->trx->op_info = (char*)""; DBUG_RETURN((ha_rows) estimate); -- cgit v1.2.1 From 08763096cb8e8b1497d33a0bf29babfa67f6817a Mon Sep 17 00:00:00 2001 From: Chaithra Gopalareddy Date: Thu, 26 Feb 2015 09:59:00 +0530 Subject: Bug #19814337 - SERVER CRASHES IN ITEM_FUNC_GROUP_CONCAT::FIX_FIELDS ON 3RD EXECUTION OF PS Problem: When order by is by a column number for a group concat function which has an outer reference, server fails in case of prepared statements on the third execution Analysis: When a group concat function has order by, the fields in order by are not resolved until execution if the input is a column number. During execution they get resolved after the temp table gets created. As a result they will be pointing to temp table fields which are runtime created objects. This results in dangling pointers leading to server failure. Solution: Reset the pointers for the order by fields to point to the original arguments after execution as they are invalid. Done in Item_func_group_concat::cleanup. --- sql/item_sum.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index c9ef2505d3d..f491795c449 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. rights reserved. This program is free software; you can redistribute it and/or modify @@ -3174,6 +3174,19 @@ void Item_func_group_concat::cleanup() } DBUG_ASSERT(tree == 0); } + /* + As the ORDER structures pointed to by the elements of the + 'order' array may be modified in find_order_in_list() called + from Item_func_group_concat::setup() to point to runtime + created objects, we need to reset them back to the original + arguments of the function. + */ + ORDER **order_ptr= order; + for (uint i= 0; i < arg_count_order; i++) + { + (*order_ptr)->item= &args[arg_count_field + i]; + order_ptr++; + } DBUG_VOID_RETURN; } -- cgit v1.2.1 From 96348ab821d6e504fc56f0771af974d90d4d70d8 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Sun, 1 Mar 2015 17:56:49 +0100 Subject: BUG#20477758 CONFLICTS WHILE INSTALLING COMMUNITY PACKAGES Due to large version numbers used libmysqlclient-devel packages was not considered for install. Fixed by removing version check. --- packaging/rpm-sles/mysql.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in index 75ed42a1cae..883763412f2 100644 --- a/packaging/rpm-sles/mysql.spec.in +++ b/packaging/rpm-sles/mysql.spec.in @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -265,7 +265,7 @@ Requires: mysql-community-libs = %{version}-%{release} Obsoletes: MySQL-devel < %{version}-%{release} Obsoletes: mysql-devel < %{version}-%{release} Obsoletes: mariadb-devel -Obsoletes: libmysqlclient-devel < %{version}-%{release} +Obsoletes: libmysqlclient-devel Provides: mysql-devel = %{version}-%{release} Provides: libmysqlclient-devel = %{version}-%{release} -- cgit v1.2.1 From ffa7ae1c6ec228a90e666c2b303f4441009bd6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Terje=20R=C3=B8sten?= Date: Thu, 26 Feb 2015 18:58:36 +0100 Subject: BUG#19811871 VERSION NUMBR NOT SHOWN IN LOG WHEN [RE]STARTING 5.6.21 SERVICE WITH SLES11 REPO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log file directory had too strict access rights, server not able to write to log file. Signed-off-by: Terje Røsten --- packaging/rpm-sles/mysql.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in index 883763412f2..23c076332b0 100644 --- a/packaging/rpm-sles/mysql.spec.in +++ b/packaging/rpm-sles/mysql.spec.in @@ -420,7 +420,7 @@ MBD=$RPM_BUILD_DIR/%{src_dir} # Ensure that needed directories exists install -d -m 0755 %{buildroot}/var/lib/mysql install -d -m 0755 %{buildroot}/var/run/mysql -install -d -m 0660 %{buildroot}/var/log/mysql +install -d -m 0750 %{buildroot}/var/log/mysql # Install all binaries cd $MBD/release @@ -632,7 +632,7 @@ fi %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql %dir %attr(755, mysql, mysql) /var/lib/mysql %dir %attr(755, mysql, mysql) /var/run/mysql -%dir %attr(660, mysql, mysql) /var/log/mysql +%dir %attr(750, mysql, mysql) /var/log/mysql %files common %defattr(-, root, root, -) -- cgit v1.2.1 From 98b18c5971c78ecb18ad90e7d1a71d7108ce4074 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Tue, 3 Mar 2015 17:57:08 +0530 Subject: Bug #20442523 CRASH WHEN CREATE TABLE VIOLATES FOREIGN KEY CONSTRAINT Problem: This is a coding mistake during error handling. When the specified foreign key constraint is wrong because of data type mismatch, the resulting foreign key object will not have valid foreign->id (it will be NULL.) Solution: While removing the foreign key object from dictionary cache during error handling, ensure that foreign->id is not null before using it. rb#8204 approved by Sunny. --- storage/innobase/dict/dict0dict.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index c298f867ae3..56baceb7a4b 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2530,7 +2530,7 @@ dict_foreign_remove_from_cache( rbt = foreign->referenced_table->referenced_rbt; - if (rbt != NULL) { + if (rbt != NULL && foreign->id != NULL) { const ib_rbt_node_t* node = rbt_lookup(rbt, foreign->id); dict_foreign_t* val = *(dict_foreign_t**) node->value; @@ -2549,7 +2549,7 @@ dict_foreign_remove_from_cache( foreign); rbt = foreign->foreign_table->foreign_rbt; - if (rbt != NULL) { + if (rbt != NULL && foreign->id != NULL) { const ib_rbt_node_t* node = rbt_lookup(rbt, foreign->id); dict_foreign_t* val = *(dict_foreign_t**) node->value; -- cgit v1.2.1 From 69d5695c008142dd1f3e668cbeeea5916266f77e Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 4 Mar 2015 15:49:27 -0500 Subject: DB-823 fix lock tables + transaction accounting for subsequent operations --- storage/tokudb/ha_tokudb.cc | 67 ++++++++++++++++++++---------------- storage/tokudb/ha_tokudb_alter_56.cc | 15 ++++---- storage/tokudb/hatoku_defines.h | 1 + 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 7c24cc1da2f..a7c80f8bdbb 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -6167,6 +6167,12 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { if (error) { goto cleanup; } thd_set_ha_data(thd, tokudb_hton, trx); } + + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_HANDLER_TRACE("trx %p %p %p %p %u %u", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level, + trx->tokudb_lock_count, trx->create_lock_count); + } + if (trx->all == NULL) { trx->sp_level = NULL; } @@ -6175,22 +6181,16 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { if (lock_type == F_WRLCK) { use_write_locks = true; } - if (!trx->tokudb_lock_count++) { - if (trx->stmt) { - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("stmt already set %p %p %p %p", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level); - } - } else { - assert(trx->stmt == 0); - transaction = NULL; // Safety - error = create_txn(thd, trx); - if (error) { - trx->tokudb_lock_count--; // We didn't get the lock - goto cleanup; - } + if (!trx->stmt) { + transaction = NULL; // Safety + error = create_txn(thd, trx); + if (error) { + goto cleanup; } + trx->create_lock_count = trx->tokudb_lock_count; } transaction = trx->sub_sp_level; + trx->tokudb_lock_count++; } else { tokudb_pthread_mutex_lock(&share->mutex); @@ -6205,21 +6205,24 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { added_rows = 0; deleted_rows = 0; share->rows_from_locked_table = 0; - if (trx->tokudb_lock_count > 0 && !--trx->tokudb_lock_count) { - if (trx->stmt) { - /* - F_UNLCK is done without a transaction commit / rollback. - This happens if the thread didn't update any rows - We must in this case commit the work to keep the row locks - */ - DBUG_PRINT("trans", ("commiting non-updating transaction")); - reset_stmt_progress(&trx->stmt_progress); - commit_txn(trx->stmt, 0); - trx->stmt = NULL; - trx->sub_sp_level = NULL; + if (trx->tokudb_lock_count > 0) { + if (--trx->tokudb_lock_count <= trx->create_lock_count) { + trx->create_lock_count = 0; + if (trx->stmt) { + /* + F_UNLCK is done without a transaction commit / rollback. + This happens if the thread didn't update any rows + We must in this case commit the work to keep the row locks + */ + DBUG_PRINT("trans", ("commiting non-updating transaction")); + reset_stmt_progress(&trx->stmt_progress); + commit_txn(trx->stmt, 0); + trx->stmt = NULL; + trx->sub_sp_level = NULL; + } } + transaction = NULL; } - transaction = NULL; } cleanup: if (tokudb_debug & TOKUDB_DEBUG_LOCK) @@ -6234,8 +6237,9 @@ cleanup: */ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { TOKUDB_HANDLER_DBUG_ENTER("cmd %d lock %d %s", thd_sql_command(thd), lock_type, share->table_name); - if (0) + if (tokudb_debug & TOKUDB_DEBUG_LOCK) { TOKUDB_HANDLER_TRACE("q %s", thd->query()); + } int error = 0; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); @@ -6245,6 +6249,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { thd_set_ha_data(thd, tokudb_hton, trx); } + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_HANDLER_TRACE("trx %p %p %p %p %u %u", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level, + trx->tokudb_lock_count, trx->create_lock_count); + } + /* note that trx->stmt may have been already initialized as start_stmt() is called for *each table* not for each storage engine, @@ -6255,9 +6264,7 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { if (error) { goto cleanup; } - if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_HANDLER_TRACE("%p %p %p %p %u", trx->all, trx->stmt, trx->sp_level, trx->sub_sp_level, trx->tokudb_lock_count); - } + trx->create_lock_count = trx->tokudb_lock_count; } else { if (tokudb_debug & TOKUDB_DEBUG_TXN) { diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index cae50446fa0..213b58459bc 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -784,13 +784,16 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i assert(trx->tokudb_lock_count > 0); // for partitioned tables, we use a single transaction to do all of the partition changes. the tokudb_lock_count // is a reference count for each of the handlers to the same transaction. obviously, we want to only abort once. - if (!--trx->tokudb_lock_count) { - abort_txn(ctx->alter_txn); - ctx->alter_txn = NULL; - trx->stmt = NULL; - trx->sub_sp_level = NULL; + if (trx->tokudb_lock_count > 0) { + if (--trx->tokudb_lock_count <= trx->create_lock_count) { + trx->create_lock_count = 0; + abort_txn(ctx->alter_txn); + ctx->alter_txn = NULL; + trx->stmt = NULL; + trx->sub_sp_level = NULL; + } + transaction = NULL; } - transaction = NULL; if (ctx->add_index_changed) { restore_add_index(table, ha_alter_info->index_add_count, ctx->incremented_num_DBs, ctx->modified_DBs); diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index cf7d87431e0..7bc8ed5dd11 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -354,6 +354,7 @@ typedef struct st_tokudb_trx_data { DB_TXN *sp_level; DB_TXN *sub_sp_level; uint tokudb_lock_count; + uint create_lock_count; tokudb_stmt_progress stmt_progress; bool checkpoint_lock_taken; LIST *handlers; -- cgit v1.2.1 From d71c76041cde0e1abaa6a5ab437c8520029231c3 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 4 Mar 2015 15:50:39 -0500 Subject: DB-805 test case lock tables + alter table conversion from innodb to tokudb bug --- mysql-test/suite/tokudb.bugs/r/db805.result | 18 ++++++++++++++++++ mysql-test/suite/tokudb.bugs/t/db805.test | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db805.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db805.test diff --git a/mysql-test/suite/tokudb.bugs/r/db805.result b/mysql-test/suite/tokudb.bugs/r/db805.result new file mode 100644 index 00000000000..1bc0372f1b8 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db805.result @@ -0,0 +1,18 @@ +drop table if exists t1,t3; +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +f1 +1 +1 +1 +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +f1 +1 +1 +1 +unlock tables; +drop table t1,t3; diff --git a/mysql-test/suite/tokudb.bugs/t/db805.test b/mysql-test/suite/tokudb.bugs/t/db805.test new file mode 100644 index 00000000000..1114de6b325 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db805.test @@ -0,0 +1,17 @@ +# DB-805 test that conversion of t1 from innodb to tokudb can write rows +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +unlock tables; + +drop table t1,t3; -- cgit v1.2.1 From 7a340808681987b2c7e3969cddaee482c03f6161 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 4 Mar 2015 15:51:32 -0500 Subject: DB-806 test case lock tables + create select bug --- mysql-test/suite/tokudb.bugs/r/db806.result | 9 +++++++++ mysql-test/suite/tokudb.bugs/t/db806.test | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db806.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db806.test diff --git a/mysql-test/suite/tokudb.bugs/r/db806.result b/mysql-test/suite/tokudb.bugs/r/db806.result new file mode 100644 index 00000000000..ae87dbab281 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db806.result @@ -0,0 +1,9 @@ +drop table if exists t1,t3; +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +1 +1 +unlock tables; +drop table t1,t3; diff --git a/mysql-test/suite/tokudb.bugs/t/db806.test b/mysql-test/suite/tokudb.bugs/t/db806.test new file mode 100644 index 00000000000..3815e59f78c --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db806.test @@ -0,0 +1,13 @@ +# DB-806 test that lock tables and create select can write rows to the new table +source include/have_tokudb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +unlock tables; + +drop table t1,t3; \ No newline at end of file -- cgit v1.2.1 From ad974e3bedadeaeb2aa5f45b0619e198bd1a1819 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 4 Mar 2015 15:52:53 -0500 Subject: DB-811 test case for lock tables + add column schema mismatch bug --- mysql-test/suite/tokudb.bugs/r/db811.result | 14 ++++++++++++++ mysql-test/suite/tokudb.bugs/r/db811s.result | 14 ++++++++++++++ mysql-test/suite/tokudb.bugs/t/db811.test | 21 +++++++++++++++++++++ mysql-test/suite/tokudb.bugs/t/db811s.test | 21 +++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db811.result create mode 100644 mysql-test/suite/tokudb.bugs/r/db811s.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db811.test create mode 100644 mysql-test/suite/tokudb.bugs/t/db811s.test diff --git a/mysql-test/suite/tokudb.bugs/r/db811.result b/mysql-test/suite/tokudb.bugs/r/db811.result new file mode 100644 index 00000000000..1d26f43c9dd --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db811.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/mysql-test/suite/tokudb.bugs/r/db811s.result b/mysql-test/suite/tokudb.bugs/r/db811s.result new file mode 100644 index 00000000000..0a50e63e037 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db811s.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/mysql-test/suite/tokudb.bugs/t/db811.test b/mysql-test/suite/tokudb.bugs/t/db811.test new file mode 100644 index 00000000000..70267743e4e --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db811.test @@ -0,0 +1,21 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + diff --git a/mysql-test/suite/tokudb.bugs/t/db811s.test b/mysql-test/suite/tokudb.bugs/t/db811s.test new file mode 100644 index 00000000000..57acd21dbc4 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db811s.test @@ -0,0 +1,21 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + -- cgit v1.2.1 From 51b68e4379aac2ea5cfe02c4c8040daf51b949ec Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 4 Mar 2015 15:53:26 -0500 Subject: DB-823 test case for lock tables + alter table conversion from innodb to tokudb failure --- mysql-test/suite/tokudb.bugs/r/db823.result | 11 +++++++++++ mysql-test/suite/tokudb.bugs/t/db823.test | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db823.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db823.test diff --git a/mysql-test/suite/tokudb.bugs/r/db823.result b/mysql-test/suite/tokudb.bugs/r/db823.result new file mode 100644 index 00000000000..d94da5c0673 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db823.result @@ -0,0 +1,11 @@ +drop table if exists s,t; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +id +1 +unlock tables; +drop table s, t; diff --git a/mysql-test/suite/tokudb.bugs/t/db823.test b/mysql-test/suite/tokudb.bugs/t/db823.test new file mode 100644 index 00000000000..2e01c0e5797 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db823.test @@ -0,0 +1,16 @@ +# test DB-823 +# test that the conversion of table t from innodb to tokudb succeeds. +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists s,t; +enable_warnings; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +unlock tables; +drop table s, t; + -- cgit v1.2.1 From 54d23eceb704af2e56ee5d8d2bbfe1beba462ce9 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Wed, 11 Mar 2015 11:18:52 +0530 Subject: Bug #19573096: LOADING CORRUPTED GEOMETRY DATA INTO A MYISAM TABLE CAUSES THE SERVER TO CRASH Issue: ----- During index maintanence, R-tree node might need a split. In some cases the square of mbr could be calculated to infinite (as in this case) or to NaN. This is currently not handled. This is specific to MyISAM. SOLUTION: --------- If the calculated value in "mbr_join_square" is infinite or NaN, set it to max double value. Initialization of output parameters of "pick_seeds" is required if calculation is infinite (or negative infinite). Similar to the fix made for INNODB as part of Bug#19533996. --- storage/myisam/rt_split.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c index 48f9b82a0b5..d37084f79b8 100644 --- a/storage/myisam/rt_split.c +++ b/storage/myisam/rt_split.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,6 +68,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim) b += 2; }while (a != end); + /* Check for infinity or NaN */ + if (my_isinf(square) || isnan(square)) + square = DBL_MAX; + return square; } @@ -102,6 +106,9 @@ static void pick_seeds(SplitStruct *node, int n_entries, double max_d = -DBL_MAX; double d; + *seed_a = node; + *seed_b = node + 1; + for (cur1 = node; cur1 < lim1; ++cur1) { for (cur2=cur1 + 1; cur2 < lim2; ++cur2) -- cgit v1.2.1 From 48869fceba5b30ef359a1f1b660a50424ea2bfa2 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 11 Mar 2015 15:17:35 +0530 Subject: Bug #20417397 MYSQL SHOW ENGINE INNODB STATUS SHOWING NEGATIVE RESERVATION AND SIGNAL COUNT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Reservation and Signal count value shows negative value for show engine innodb statement. Solution: This is happening due to counter overflow error. Reservation and Signal count values are defined as unsigned long but these variables are converted to long while printing it. Change Reservation and Signal count values as unsigned long datatype while printing it. Reviewed-by: Marko Mäkelä Approved in bug page. --- storage/innobase/sync/sync0arr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index f7d1af24bca..901c1e9a706 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -1027,8 +1027,9 @@ sync_array_output_info( ulint i; fprintf(file, - "OS WAIT ARRAY INFO: reservation count %ld, signal count %ld\n", - (long) arr->res_count, (long) arr->sg_count); + "OS WAIT ARRAY INFO: reservation count " ULINTPF + ", signal count " ULINTPF "\n", + arr->res_count, arr->sg_count); i = 0; count = 0; -- cgit v1.2.1 From 96974ea7ca2539e342d5e732a80e919a59f1d162 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Wed, 11 Mar 2015 16:07:49 +0530 Subject: Revert "Bug #19573096: LOADING CORRUPTED GEOMETRY DATA INTO A" This reverts commit c7de768ec20f5167cff2c69a255d95ca2eded46a. --- storage/myisam/rt_split.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c index d37084f79b8..955a69c6588 100644 --- a/storage/myisam/rt_split.c +++ b/storage/myisam/rt_split.c @@ -68,10 +68,6 @@ static double mbr_join_square(const double *a, const double *b, int n_dim) b += 2; }while (a != end); - /* Check for infinity or NaN */ - if (my_isinf(square) || isnan(square)) - square = DBL_MAX; - return square; } @@ -106,9 +102,6 @@ static void pick_seeds(SplitStruct *node, int n_entries, double max_d = -DBL_MAX; double d; - *seed_a = node; - *seed_b = node + 1; - for (cur1 = node; cur1 < lim1; ++cur1) { for (cur2=cur1 + 1; cur2 < lim2; ++cur2) -- cgit v1.2.1 From 151b8ec4d11abbb3bf1fb55e10df3e3e7449fe1c Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 13 Mar 2015 12:32:44 +0530 Subject: Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS BINLOGGED INCORRECTLY - BREAKS A SLAVE Analysis: In row based replication, Master does not send temp table information to Slave. If there are any DDLs that involves in regular table that needs to be sent to Slave and a temp tables (which will not be available at Slave), the Master rewrites the query replacing temp table with it's defintion. Eg: create table regular_table like temptable. In rewrite logic, server is ignoring the database of regular table which can cause problems mentioned in this bug. Fix: dont ignore database information (if available) while rewriting the query --- mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result | 3 +++ mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test | 8 ++++++++ sql/sql_table.cc | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index 550b3f596e5..e66110af947 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -182,6 +182,9 @@ DROP USER test_3@localhost; ERROR HY000: Table 'user' was not locked with LOCK TABLES INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +DROP DATABASE db; DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index aa22b23925c..d253b7b7175 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -150,6 +150,14 @@ DROP USER test_3@localhost; INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; + +# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS +# BINLOGGED INCORRECTLY - BREAKS A SLAVE +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +DROP DATABASE db; +# end of Bug #20439913 test + DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 096e3d6be0f..b0547a16050 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4720,7 +4720,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, int result __attribute__((unused))= store_create_info(thd, table, &query, - create_info, FALSE /* show_database */); + create_info, + table->db ? TRUE : FALSE/* show_database */); DBUG_ASSERT(result == 0); // store_create_info() always return 0 if (write_bin_log(thd, TRUE, query.ptr(), query.length())) -- cgit v1.2.1 From 59142d9a279339f766a23e35a0f7b183406e43c0 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 13 Mar 2015 13:13:48 +0530 Subject: Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS BINLOGGED INCORRECTLY - BREAKS A SLAVE Submitted a incomplete patch with my previous push, re submitting the extra changes the required to make the patch complete. --- mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result | 2 ++ mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test | 2 ++ sql/sql_show.cc | 7 ++++++- sql/sql_table.cc | 3 +-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index e66110af947..0264c9421fc 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -184,6 +184,8 @@ INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; CREATE DATABASE db; CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; DROP DATABASE db; DROP USER test_3@localhost; DROP FUNCTION f2; diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index d253b7b7175..d722a15f255 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -155,6 +155,8 @@ UNLOCK TABLE; # BINLOGGED INCORRECTLY - BREAKS A SLAVE CREATE DATABASE db; CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; DROP DATABASE db; # end of Bug #20439913 test diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ccbf1f41126..24e7d92d1ad 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1139,6 +1139,11 @@ static bool get_field_default_value(THD *thd, Field *timestamp_field, to tailor the format of the statement. Can be NULL, in which case only SQL_MODE is considered when building the statement. + show_database If true, then print the database before the table + name. The database name is only printed in the event + that it is different from the current database. + If false, then do not print the database before + the table name. NOTE Currently always return 0, but might return error code in the diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b0547a16050..b8858cffce6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4720,8 +4720,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, int result __attribute__((unused))= store_create_info(thd, table, &query, - create_info, - table->db ? TRUE : FALSE/* show_database */); + create_info, TRUE /* show_database */); DBUG_ASSERT(result == 0); // store_create_info() always return 0 if (write_bin_log(thd, TRUE, query.ptr(), query.length())) -- cgit v1.2.1 From c7581bb5a11c4fef01da75e30153ee4260febbf3 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Thu, 22 Jan 2015 14:19:56 +0100 Subject: Bug#20730053: BACKPORT BUG#19770858 TO 5.1 Backport from mysql-5.5 to mysql-5.1 of: Bug19770858: MYSQLD CAN BE DRIVEN TO OOM WITH TWO SIMPLE SESSION VARS The problem was that the maximum value of the transaction_prealloc_size session system variable was ULONG_MAX which meant that it was possible to cause the server to allocate excessive amounts of memory. This patch fixes the problem by reducing the maxmimum value of transaction_prealloc_size and transaction_alloc_block_size down to 128K. Note that transactions will still be able to allocate more than 128K if needed, this patch just reduces the amount that can be preallocated - as well as the maximum size of the incremental allocation blocks. (cherry picked from commit 540c9f7ebb428bbf9ec028feabe1f7f919fdefd9) Conflicts: mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result mysql-test/suite/sys_vars/t/disabled.def mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test sql/sys_vars.cc --- .../inc/transaction_alloc_block_size_basic.inc | 240 --------------------- .../inc/transaction_prealloc_size_basic.inc | 229 -------------------- .../r/transaction_alloc_block_size_basic.result | 174 +++++++++++++++ .../r/transaction_alloc_block_size_basic_32.result | 186 ---------------- .../r/transaction_alloc_block_size_basic_64.result | 176 --------------- .../r/transaction_prealloc_size_basic.result | 164 ++++++++++++++ .../r/transaction_prealloc_size_basic_32.result | 172 --------------- .../r/transaction_prealloc_size_basic_64.result | 170 --------------- .../t/transaction_alloc_block_size_basic.test | 235 ++++++++++++++++++++ .../t/transaction_alloc_block_size_basic_32.test | 9 - .../t/transaction_alloc_block_size_basic_64.test | 9 - .../t/transaction_prealloc_size_basic.test | 222 +++++++++++++++++++ .../t/transaction_prealloc_size_basic_32.test | 9 - .../t/transaction_prealloc_size_basic_64.test | 9 - mysql-test/t/variables-big.test | 5 +- sql/mysqld.cc | 4 +- 16 files changed, 799 insertions(+), 1214 deletions(-) delete mode 100644 mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc delete mode 100644 mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result delete mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result delete mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result delete mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result delete mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test delete mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test delete mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test delete mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test diff --git a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc deleted file mode 100644 index c14383b86c6..00000000000 --- a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc +++ /dev/null @@ -1,240 +0,0 @@ -############## mysql-test\t\transaction_alloc_block_size_basic.test ########### -# # -# Variable Name: transaction_alloc_block_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 8192 # -# Range: 1024-4294967295 # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable # -# transaction_alloc_block_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF transaction_alloc_block_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of transaction_alloc_block_size # -######################################################################## - -SET @@global.transaction_alloc_block_size = 100; -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; - - -SET @@session.transaction_alloc_block_size = 200; -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; - - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of transaction_alloc_block_size # -######################################################################## - -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; - -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -######################################################################## -# Change the value of transaction_alloc_block_size to an invalid value # -######################################################################## - -SET @@global.transaction_alloc_block_size = 0; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = -1024; -SELECT @@global.transaction_alloc_block_size; - - -SET @@global.transaction_alloc_block_size = 123456789201; -SELECT @@global.transaction_alloc_block_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = ON; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = OFF; - - -SET @@global.transaction_alloc_block_size = True; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = False; -SELECT @@global.transaction_alloc_block_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = 65530.34; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size ="Test"; - -SET @@global.transaction_alloc_block_size = 1000; -SELECT @@global.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = 12345678901; -SELECT @@session.transaction_alloc_block_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = ON; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = OFF; - -SET @@session.transaction_alloc_block_size = True; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = False; -SELECT @@session.transaction_alloc_block_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = "Test"; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = 'test'; - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@transaction_alloc_block_size = 100; -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################ -# Check if variable can be accessed with and without @@ sign # -################################################################ - -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; - ---Error ER_UNKNOWN_TABLE -SELECT local.transaction_alloc_block_size; - ---Error ER_UNKNOWN_TABLE -SELECT session.transaction_alloc_block_size; - ---Error ER_BAD_FIELD_ERROR -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; - - -############################################################# -# END OF transaction_alloc_block_size TESTS # -############################################################# - diff --git a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc deleted file mode 100644 index 1ca302a19e0..00000000000 --- a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc +++ /dev/null @@ -1,229 +0,0 @@ -############## mysql-test\t\transaction_prealloc_size_basic.test ############## -# # -# Variable Name: transaction_prealloc_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 4096 # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable transaction_prealloc_size# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_transaction_prealloc_size # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF transaction_prealloc_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of transaction_prealloc_size # -######################################################################## - -SET @@global.transaction_prealloc_size = 100; -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; - - -SET @@session.transaction_prealloc_size = 200; -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of transaction_prealloc_size # -######################################################################## - -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; - -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; - -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -##################################################################### -# Change the value of transaction_prealloc_size to an invalid value # -##################################################################### - -SET @@global.transaction_prealloc_size = 0; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = -1024; -SELECT @@global.transaction_prealloc_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = OFF; - - -SET @@global.transaction_prealloc_size = True; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = False; -SELECT @@global.transaction_prealloc_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = 65530.34; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size ="Test"; - -SET @@global.transaction_prealloc_size = 1000; -SELECT @@global.transaction_prealloc_size; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = OFF; - -SET @@session.transaction_prealloc_size = True; -SELECT @@session.transaction_prealloc_size; - -SET @@session.transaction_prealloc_size = False; -SELECT @@session.transaction_prealloc_size; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = "Test"; - -SET @@session.transaction_prealloc_size = 123456789031; -SELECT @@session.transaction_prealloc_size; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; - - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; - -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@transaction_prealloc_size = 100; -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################### -# Check if transaction_prealloc_size can be accessed with and without @@ sign # -############################################################################### - -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; - ---Error ER_UNKNOWN_TABLE -SELECT local.transaction_prealloc_size; - ---Error ER_UNKNOWN_TABLE -SELECT session.transaction_prealloc_size; - ---Error ER_BAD_FIELD_ERROR -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; - -#################################### -# Restore initial value # -#################################### - -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; - - -############################################################# -# END OF transaction_prealloc_size TESTS # -############################################################# - diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result new file mode 100644 index 00000000000..008fa06d730 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result @@ -0,0 +1,174 @@ +SET @start_global_value = @@global.transaction_alloc_block_size; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.transaction_alloc_block_size; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.transaction_alloc_block_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +8192 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size = 8192; +@@global.transaction_alloc_block_size = 8192 +1 +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size = 8192; +@@session.transaction_alloc_block_size = 8192 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_alloc_block_size = 1024; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 60020; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +59392 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_alloc_block_size = 1024; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = 65535; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 135217728; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +131072 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = 135217728; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +131072 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@global.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@session.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_08----------------------#' +SET @@transaction_alloc_block_size = 1024; +SET @@global.transaction_alloc_block_size = 134217728; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '134217728' +SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@global.transaction_alloc_block_size +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@local.transaction_alloc_block_size +1 +SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; +@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET transaction_alloc_block_size = 1027; +SELECT @@transaction_alloc_block_size; +@@transaction_alloc_block_size +1024 +SELECT local.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; +ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' +SET @@global.transaction_alloc_block_size = @start_global_value; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result deleted file mode 100644 index 8c6a788862d..00000000000 --- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result +++ /dev/null @@ -1,186 +0,0 @@ -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.transaction_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; -@@global.transaction_alloc_block_size = 8192 -1 -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; -@@session.transaction_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -59392 -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size =4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -64512 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 123456789201; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = 12345678901; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@global.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@session.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@global.transaction_alloc_block_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@local.transaction_alloc_block_size -1 -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; -@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; -@@transaction_alloc_block_size -1024 -SELECT local.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; -ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result deleted file mode 100644 index 749df56c60b..00000000000 --- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result +++ /dev/null @@ -1,176 +0,0 @@ -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.transaction_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; -@@global.transaction_alloc_block_size = 8192 -1 -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; -@@session.transaction_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -59392 -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -64512 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 123456789201; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -123456788480 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = 12345678901; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -12345678848 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@global.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@session.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@global.transaction_alloc_block_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@local.transaction_alloc_block_size -1 -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; -@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; -@@transaction_alloc_block_size -1024 -SELECT local.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; -ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result new file mode 100644 index 00000000000..8efb979b592 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result @@ -0,0 +1,164 @@ +SET @start_global_value = @@global.transaction_prealloc_size; +SELECT @start_global_value; +@start_global_value +4096 +SET @start_session_value = @@session.transaction_prealloc_size; +SELECT @start_session_value; +@start_session_value +4096 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size = 4096; +@@global.transaction_prealloc_size = 4096 +1 +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size = 4096; +@@session.transaction_prealloc_size = 4096 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_prealloc_size = 1024; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 60020; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +59392 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_prealloc_size = 1024; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = 65535; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +64512 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '-1024' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = 135217728; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '135217728' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +131072 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@global.transaction_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@session.transaction_prealloc_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.transaction_prealloc_size = 1024; +SET @@global.transaction_prealloc_size = 10; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' +SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; +@@transaction_prealloc_size = @@global.transaction_prealloc_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; +@@transaction_prealloc_size = @@local.transaction_prealloc_size +1 +SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; +@@local.transaction_prealloc_size = @@session.transaction_prealloc_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET transaction_prealloc_size = 1027; +SELECT @@transaction_prealloc_size; +@@transaction_prealloc_size +1024 +SELECT local.transaction_prealloc_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_prealloc_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; +ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' +SET @@global.transaction_prealloc_size = @start_global_value; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = @start_session_value; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result deleted file mode 100644 index 4912653a8e5..00000000000 --- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result +++ /dev/null @@ -1,172 +0,0 @@ -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; -@start_session_value -4096 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; -@@global.transaction_prealloc_size = 4096 -1 -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; -@@session.transaction_prealloc_size = 4096 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -59392 -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4294966272 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -64512 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '-1024' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = 123456789031; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '123456789031' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@global.transaction_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@session.transaction_prealloc_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; -@@transaction_prealloc_size = @@global.transaction_prealloc_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -@@transaction_prealloc_size = @@local.transaction_prealloc_size -1 -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; -@@local.transaction_prealloc_size = @@session.transaction_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; -@@transaction_prealloc_size -1024 -SELECT local.transaction_prealloc_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_prealloc_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; -ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result deleted file mode 100644 index 3455b9479c0..00000000000 --- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result +++ /dev/null @@ -1,170 +0,0 @@ -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; -@start_session_value -4096 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; -@@global.transaction_prealloc_size = 4096 -1 -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; -@@session.transaction_prealloc_size = 4096 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -59392 -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4294966272 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -64512 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '-1024' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = 123456789031; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -123456788480 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@global.transaction_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@session.transaction_prealloc_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; -@@transaction_prealloc_size = @@global.transaction_prealloc_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -@@transaction_prealloc_size = @@local.transaction_prealloc_size -1 -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; -@@local.transaction_prealloc_size = @@session.transaction_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; -@@transaction_prealloc_size -1024 -SELECT local.transaction_prealloc_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_prealloc_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; -ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test new file mode 100644 index 00000000000..6f950e8724f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test @@ -0,0 +1,235 @@ +############## mysql-test\t\transaction_alloc_block_size_basic.test ########### +# # +# Variable Name: transaction_alloc_block_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 8192 # +# Range: 1024-134217728 # +# # +# # +# Creation Date: 2008-02-14 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable # +# transaction_alloc_block_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF transaction_alloc_block_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.transaction_alloc_block_size; +SELECT @start_global_value; +SET @start_session_value = @@session.transaction_alloc_block_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of transaction_alloc_block_size # +######################################################################## + +SET @@global.transaction_alloc_block_size = 100; +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size; + + +SET @@session.transaction_alloc_block_size = 200; +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size; + + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of transaction_alloc_block_size # +######################################################################## + +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size = 8192; + +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size = 8192; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################## +# Change the value of variable to a valid value for GLOBAL Scope # +################################################################## + +SET @@global.transaction_alloc_block_size = 1024; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = 60020; +SELECT @@global.transaction_alloc_block_size; + +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################### +# Change the value of variable to a valid value for SESSION Scope # +################################################################### + +SET @@session.transaction_alloc_block_size = 1024; +SELECT @@session.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = 65535; +SELECT @@session.transaction_alloc_block_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +######################################################################## +# Change the value of transaction_alloc_block_size to an invalid value # +######################################################################## + +SET @@global.transaction_alloc_block_size = 0; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = -1024; +SELECT @@global.transaction_alloc_block_size; + + +SET @@global.transaction_alloc_block_size = 135217728; +SELECT @@global.transaction_alloc_block_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = ON; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = OFF; + + +SET @@global.transaction_alloc_block_size = True; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = False; +SELECT @@global.transaction_alloc_block_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = 65530.34; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size ="Test"; + +SET @@global.transaction_alloc_block_size = 1000; +SELECT @@global.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = 135217728; +SELECT @@session.transaction_alloc_block_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = ON; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = OFF; + +SET @@session.transaction_alloc_block_size = True; +SELECT @@session.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = False; +SELECT @@session.transaction_alloc_block_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = "Test"; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = 'test'; + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; + + +--echo '#---------------------FN_DYNVARS_001_08----------------------#' +########################################################################### +# Check if global and session variable are independent of each other # +########################################################################### + +SET @@transaction_alloc_block_size = 1024; +SET @@global.transaction_alloc_block_size = 134217728; +SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +######################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +######################################################################## + +SET @@transaction_alloc_block_size = 100; +SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; +SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################ +# Check if variable can be accessed with and without @@ sign # +################################################################ + +SET transaction_alloc_block_size = 1027; +SELECT @@transaction_alloc_block_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.transaction_alloc_block_size; + +--Error ER_UNKNOWN_TABLE +SELECT session.transaction_alloc_block_size; + +--Error ER_BAD_FIELD_ERROR +SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.transaction_alloc_block_size = @start_global_value; +SELECT @@global.transaction_alloc_block_size; +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.transaction_alloc_block_size; + + +############################################################# +# END OF transaction_alloc_block_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test deleted file mode 100644 index b9fbf429220..00000000000 --- a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test deleted file mode 100644 index fb68245ee62..00000000000 --- a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test new file mode 100644 index 00000000000..718fe56a02f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test @@ -0,0 +1,222 @@ +############## mysql-test\t\transaction_prealloc_size_basic.test ############## +# # +# Variable Name: transaction_prealloc_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 4096 # +# Range: 1024-134217728 # +# # +# # +# Creation Date: 2008-02-14 # +# Author: Sharique Abdullah # +# # +# Description: Test Cases of Dynamic System Variable transaction_prealloc_size# +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_transaction_prealloc_size # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF transaction_prealloc_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.transaction_prealloc_size; +SELECT @start_global_value; +SET @start_session_value = @@session.transaction_prealloc_size; +SELECT @start_session_value; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of transaction_prealloc_size # +######################################################################## + +SET @@global.transaction_prealloc_size = 100; +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size; + + +SET @@session.transaction_prealloc_size = 200; +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size; + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of transaction_prealloc_size # +######################################################################## + +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size = 4096; + +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size = 4096; + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################## +# Change the value of variable to a valid value for GLOBAL Scope # +################################################################## + +SET @@global.transaction_prealloc_size = 1024; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = 60020; +SELECT @@global.transaction_prealloc_size; + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################### +# Change the value of variable to a valid value for SESSION Scope # +################################################################### + +SET @@session.transaction_prealloc_size = 1024; +SELECT @@session.transaction_prealloc_size; + +SET @@session.transaction_prealloc_size = 65535; +SELECT @@session.transaction_prealloc_size; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +##################################################################### +# Change the value of transaction_prealloc_size to an invalid value # +##################################################################### + +SET @@global.transaction_prealloc_size = 0; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = -1024; +SELECT @@global.transaction_prealloc_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = OFF; + + +SET @@global.transaction_prealloc_size = True; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = False; +SELECT @@global.transaction_prealloc_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = 65530.34; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size ="Test"; + +SET @@global.transaction_prealloc_size = 1000; +SELECT @@global.transaction_prealloc_size; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = OFF; + +SET @@session.transaction_prealloc_size = True; +SELECT @@session.transaction_prealloc_size; + +SET @@session.transaction_prealloc_size = False; +SELECT @@session.transaction_prealloc_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = "Test"; + +SET @@session.transaction_prealloc_size = 135217728; +SELECT @@session.transaction_prealloc_size; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; + + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +########################################################################### +# Check if global and session variable are independent of each other # +########################################################################### + +SET @@global.transaction_prealloc_size = 1024; +SET @@global.transaction_prealloc_size = 10; + +SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +######################################################################## + +SET @@transaction_prealloc_size = 100; +SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; +SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +############################################################################### +# Check if transaction_prealloc_size can be accessed with and without @@ sign # +############################################################################### + +SET transaction_prealloc_size = 1027; +SELECT @@transaction_prealloc_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.transaction_prealloc_size; + +--Error ER_UNKNOWN_TABLE +SELECT session.transaction_prealloc_size; + +--Error ER_BAD_FIELD_ERROR +SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; + +#################################### +# Restore initial value # +#################################### + +SET @@global.transaction_prealloc_size = @start_global_value; +SELECT @@global.transaction_prealloc_size; +SET @@session.transaction_prealloc_size = @start_session_value; +SELECT @@session.transaction_prealloc_size; + + +############################################################# +# END OF transaction_prealloc_size TESTS # +############################################################# diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test deleted file mode 100644 index 23ea53334ff..00000000000 --- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source suite/sys_vars/inc/transaction_prealloc_size_basic.inc - diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test deleted file mode 100644 index 79a18585e80..00000000000 --- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source suite/sys_vars/inc/transaction_prealloc_size_basic.inc - diff --git a/mysql-test/t/variables-big.test b/mysql-test/t/variables-big.test index 6c357bb6e54..024c5bae813 100644 --- a/mysql-test/t/variables-big.test +++ b/mysql-test/t/variables-big.test @@ -8,10 +8,9 @@ # Bug#27322 failure to allocate transaction_prealloc_size causes crash # # -# Manual (6.0): +# Manual (5.1): # Platform Bit Size Range Default -# 32 1024-4294967295 (4 Gi - 1) 4096 -# 64 1024-18446744073709547520 4096 +# 32/64 1024-128k 4096 # # Observation(mleich): # 1. - Linux 64 Bit, MySQL 64 Bit, 4 GiB RAM, 8 GiB swap diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 024ad659d89..77fdbe6b498 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7115,12 +7115,12 @@ thread is in the relay logs.", "Allocation block size for transactions to be stored in binary log.", &global_system_variables.trans_alloc_block_size, &max_system_variables.trans_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, + REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, 128 * 1024, 0, 1024, 0}, {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE, "Persistent buffer for transactions to be stored in binary log.", &global_system_variables.trans_prealloc_size, &max_system_variables.trans_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, + REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, 128 * 1024, 0, 1024, 0}, {"thread_handling", OPT_THREAD_HANDLING, "Define threads usage for handling queries: " "one-thread-per-connection or no-threads.", 0, 0, -- cgit v1.2.1 From b7bdea944d6336a810608d183ecb9c8f2100cd05 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Mon, 23 Mar 2015 08:49:26 +0530 Subject: Bug# 19573096: LOADING CORRUPTED GEOMETRY DATA INTO A MYISAM TABLE CAUSES THE SERVER TO CRASH Issue: ----- During index maintanence, R-tree node might need a split. In some cases the square of mbr could be calculated to infinite (as in this case) or to NaN. This is currently not handled. This is specific to MyISAM. SOLUTION: --------- If the calculated value in "mbr_join_square" is infinite or NaN, set it to max double value. Initialization of output parameters of "pick_seeds" is required if calculation is infinite (or negative infinite). Similar to the fix made for INNODB as part of Bug#19533996. --- storage/myisam/rt_split.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c index 955a69c6588..d37084f79b8 100644 --- a/storage/myisam/rt_split.c +++ b/storage/myisam/rt_split.c @@ -68,6 +68,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim) b += 2; }while (a != end); + /* Check for infinity or NaN */ + if (my_isinf(square) || isnan(square)) + square = DBL_MAX; + return square; } @@ -102,6 +106,9 @@ static void pick_seeds(SplitStruct *node, int n_entries, double max_d = -DBL_MAX; double d; + *seed_a = node; + *seed_b = node + 1; + for (cur1 = node; cur1 < lim1; ++cur1) { for (cur2=cur1 + 1; cur2 < lim2; ++cur2) -- cgit v1.2.1 From a2cd622f3aeeed7ae720b14fd1a51bd0798a3a27 Mon Sep 17 00:00:00 2001 From: Chaithra Gopalareddy Date: Mon, 23 Mar 2015 12:05:55 +0530 Subject: Bug #20730129: BACKPORT BUG#19612819 TO 5.1 Backport from mysql-5.5 to mysql-5.1 Bug #19612819 : FILESORT: ASSERTION FAILED: POS->FIELD != 0 || POS->ITEM != 0 Problem: While getting the temp table field for a REF_ITEM make_sortorder is using the real_item. As a result server fails later with an assert. Solution: Do not use real_item to get the temp table field. Instead use the REF_ITEM itself as temp table fields are created for REF_ITEM not the real_item. --- sql/sql_select.cc | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7507f430eb7..03054020d57 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14428,18 +14428,33 @@ SORT_FIELD *make_unireg_sortorder(ORDER *order, uint *length, for (;order;order=order->next,pos++) { - Item *item= order->item[0]->real_item(); + Item *const item= order->item[0], *const real_item= item->real_item(); pos->field= 0; pos->item= 0; - if (item->type() == Item::FIELD_ITEM) - pos->field= ((Item_field*) item)->field; - else if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item()) - pos->field= ((Item_sum*) item)->get_tmp_table_field(); - else if (item->type() == Item::COPY_STR_ITEM) - { // Blob patch - pos->item= ((Item_copy*) item)->get_item(); + if (real_item->type() == Item::FIELD_ITEM) + { + // Could be a field, or Item_direct_view_ref wrapping a field + DBUG_ASSERT(item->type() == Item::FIELD_ITEM || + (item->type() == Item::REF_ITEM && + static_cast(item)->ref_type() == + Item_ref::VIEW_REF)); + pos->field= static_cast(real_item)->field; + } + else if (real_item->type() == Item::SUM_FUNC_ITEM && + !real_item->const_item()) + { + // Aggregate, or Item_aggregate_ref + DBUG_ASSERT(item->type() == Item::SUM_FUNC_ITEM || + (item->type() == Item::REF_ITEM && + static_cast(item)->ref_type() == + Item_ref::AGGREGATE_REF)); + pos->field= item->get_tmp_table_field(); + } + else if (real_item->type() == Item::COPY_STR_ITEM) + {// Blob patch + pos->item= static_cast(real_item)->get_item(); } else - pos->item= *order->item; + pos->item= item; pos->reverse=! order->asc; } *length=count; -- cgit v1.2.1 From 044060fe164bfbe3666fc18351c2b6795267d2ea Mon Sep 17 00:00:00 2001 From: Chaithra Gopalareddy Date: Mon, 23 Mar 2015 14:31:28 +0530 Subject: Bug #20730220 : BACKPORT BUG#19880368 TO 5.1 Backport from mysql-5.5 to mysql-5.1 Bug#19880368 : GROUP_CONCAT CRASHES AFTER DUMP_LEAF_KEY Problem: find_order_by_list does not update the address of order_item correctly after resolving. Solution: Change the ref_by address for a order_by field if its SUM_FUNC_ITEM to the address of the field present in all_fields. --- sql/sql_select.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 03054020d57..21b84cbca54 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -14937,6 +14937,17 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, uint el= all_fields.elements; all_fields.push_front(order_item); /* Add new field to field list. */ ref_pointer_array[el]= order_item; + /* + If the order_item is a SUM_FUNC_ITEM, when fix_fields is called + ref_by is set to order->item which is the address of order_item. + But this needs to be address of order_item in the all_fields list. + As a result, when it gets replaced with Item_aggregate_ref + object in Item::split_sum_func2, we will be able to retrieve the + newly created object. + */ + if (order_item->type() == Item::SUM_FUNC_ITEM) + ((Item_sum *)order_item)->ref_by= all_fields.head_ref(); + order->item= ref_pointer_array + el; return FALSE; } -- cgit v1.2.1 From f8eacccf2a56e86ed5c6413481d5ea918b9eca1d Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 24 Mar 2015 14:09:18 +0530 Subject: Bug#20422680 BUF_POOL_WATCH_SET WOULD CRASH TRYING TO USE A SECOND WATCH PAGE PER INSTANCE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: BUF_POOL_WATCH_SIZE is also initialized to number of purge threads. so BUF_POOL_WATCH_SIZE will never be lesser than number of purge threads. From the code, there is no scope for purge thread to skip buf_pool_watch_unset. So there can be at most one buffer pool watch active per purge thread. In other words, there is no chance for purge thread instance to hold a watch when setting another watch. Solution: Adding code comments to clarify the issue. Reviewed-by: Marko Mäkelä Approved via Bug page. --- storage/innobase/buf/buf0buf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index b6bfcc3dbc0..4963f1c30c3 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -1528,6 +1528,9 @@ buf_pool_watch_set( return(NULL); } + /* The maximum number of purge threads should never exceed + BUF_POOL_WATCH_SIZE. So there is no way for purge thread + instance to hold a watch when setting another watch. */ for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) { bpage = &buf_pool->watch[i]; -- cgit v1.2.1 From 4409bc9d9ed20c9253263d8758a425bdfeecd965 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 24 Mar 2015 12:55:43 +0100 Subject: Bug#20734434 - SPELLING ERROR \"EMDEDDED\" IN RPM SPEC FILES - Updated emdedded to embedded --- packaging/rpm-oel/mysql.spec.in | 4 ++-- support-files/mysql.spec.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index d8cf49fe993..bb232fb404d 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -370,7 +370,7 @@ Obsoletes: mariadb-embedded Obsoletes: MySQL-embedded < %{version}-%{release} Obsoletes: mysql-embedded < %{version}-%{release} Provides: mysql-embedded = %{version}-%{release} -Provides: mysql-emdedded%{?_isa} = %{version}-%{release} +Provides: mysql-embedded%{?_isa} = %{version}-%{release} %description embedded This package contains the MySQL server as an embedded library. diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index e45573a6d77..aaeed444e2f 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -427,7 +427,7 @@ Obsoletes: MySQL-embedded-pro Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl Provides: mysql-embedded = %{version}-%{release} -Provides: mysql-emdedded%{?_isa} = %{version}-%{release} +Provides: mysql-embedded%{?_isa} = %{version}-%{release} %description -n MySQL-embedded%{product_suffix} This package contains the MySQL server as an embedded library. -- cgit v1.2.1 From 3c02e6ec2efdb03b055d317ae596fc0c2da31e04 Mon Sep 17 00:00:00 2001 From: Vamsikrishna Bhagi Date: Wed, 25 Mar 2015 15:28:55 +0530 Subject: Bug# 20730103 BACKPORT 19688008 TO 5.1 Problem: UDF doesn't handle the arguments properly when they are of string type due to a misplaced break. The length of arguments is also not set properly when the argument is NULL. Solution: Fixed the code by putting the break at right place and setting the argument length to zero when the argument is NULL. --- sql/item_func.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index fd098f347d1..2c3094596eb 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3029,8 +3029,12 @@ bool udf_handler::get_arguments() { f_args.args[i]= (char*) res->ptr(); f_args.lengths[i]= res->length(); - break; } + else + { + f_args.lengths[i]= 0; + } + break; } case INT_RESULT: *((longlong*) to) = args[i]->val_int(); -- cgit v1.2.1 From cfa745e1cbb45cb095d40e893250456243b87c6d Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Tue, 24 Mar 2015 04:01:16 -0400 Subject: dump the header in interactive mode --- tools/tokuftdump.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tokuftdump.cc b/tools/tokuftdump.cc index 1fab0f6206b..bf187c7dc81 100644 --- a/tools/tokuftdump.cc +++ b/tools/tokuftdump.cc @@ -936,6 +936,7 @@ static void run_iteractive_loop(int fd, FT ft, CACHEFILE cf) { } else if (strcmp(fields[0], "header") == 0) { toku_ft_free(ft); open_header(fd, &ft, cf); + dump_header(ft); } else if (strcmp(fields[0], "rn") == 0||strcmp(fields[0], "rootNode")==0||strcmp(fields[0], "rootnode") == 0) { printf("Root node :%d\n",root); } else if (strcmp(fields[0], "block") == 0 && nfields == 2) { -- cgit v1.2.1 From 988165a824c1038f5585662e73e080a33561cf13 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Tue, 24 Mar 2015 08:24:55 -0400 Subject: FT-646 improve verify error messages for errors in basement nodes --- ft/ft-verify.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ft/ft-verify.cc b/ft/ft-verify.cc index cbb5159e276..2c4de2df8ca 100644 --- a/ft/ft-verify.cc +++ b/ft/ft-verify.cc @@ -158,10 +158,14 @@ get_ith_key_dbt (BASEMENTNODE bn, int i) { #define VERIFY_ASSERTION(predicate, i, string) ({ \ if(!(predicate)) { \ - (void) verbose; \ - if (true) { \ - fprintf(stderr, "%s:%d: Looking at child %d of block %" PRId64 ": %s\n", __FILE__, __LINE__, i, blocknum.b, string); \ - } \ + fprintf(stderr, "%s:%d: Looking at child %d of block %" PRId64 ": %s\n", __FILE__, __LINE__, i, blocknum.b, string); \ + result = TOKUDB_NEEDS_REPAIR; \ + if (!keep_going_on_failure) goto done; \ + }}) + +#define VERIFY_ASSERTION_BASEMENT(predicate, bn, entry, string) ({ \ + if(!(predicate)) { \ + fprintf(stderr, "%s:%d: Looking at block %" PRId64 " bn %d entry %d: %s\n", __FILE__, __LINE__, blocknum.b, bn, entry, string); \ result = TOKUDB_NEEDS_REPAIR; \ if (!keep_going_on_failure) goto done; \ }}) @@ -199,7 +203,6 @@ struct verify_message_tree_extra { int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) __attribute__((nonnull(3))); int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) { - int verbose = e->verbose; BLOCKNUM blocknum = e->blocknum; int keep_going_on_failure = e->keep_going_on_failure; int result = 0; @@ -234,7 +237,6 @@ int error_on_iter(const int32_t &UU(offset), const uint32_t UU(idx), void *UU(e) int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) __attribute__((nonnull(3))); int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) { - int verbose = e->verbose; BLOCKNUM blocknum = e->blocknum; int keep_going_on_failure = e->keep_going_on_failure; int result = 0; @@ -460,16 +462,16 @@ toku_verify_ftnode_internal(FT_HANDLE ft_handle, DBT kdbt = get_ith_key_dbt(bn, j); if (curr_less_pivot) { int compare = compare_pairs(ft_handle, curr_less_pivot, &kdbt); - VERIFY_ASSERTION(compare < 0, j, "The leafentry is >= the lower-bound pivot"); + VERIFY_ASSERTION_BASEMENT(compare < 0, i, j, "The leafentry is >= the lower-bound pivot"); } if (curr_geq_pivot) { int compare = compare_pairs(ft_handle, curr_geq_pivot, &kdbt); - VERIFY_ASSERTION(compare >= 0, j, "The leafentry is < the upper-bound pivot"); + VERIFY_ASSERTION_BASEMENT(compare >= 0, i, j, "The leafentry is < the upper-bound pivot"); } if (0 < j) { DBT prev_key_dbt = get_ith_key_dbt(bn, j-1); int compare = compare_pairs(ft_handle, &prev_key_dbt, &kdbt); - VERIFY_ASSERTION(compare < 0, j, "Adjacent leafentries are out of order"); + VERIFY_ASSERTION_BASEMENT(compare < 0, i, j, "Adjacent leafentries are out of order"); } } } -- cgit v1.2.1 From b576414189f9058c5d345fb94a574fb5a402b214 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 25 Mar 2015 17:16:57 -0400 Subject: DB-829 ignore read uncommitted errors when querying tokudb_fractal_tree_info --- mysql-test/suite/tokudb.bugs/r/tokudb718.result | 5 +++-- mysql-test/suite/tokudb.bugs/t/tokudb718.test | 3 +-- storage/tokudb/hatoku_hton.cc | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/tokudb.bugs/r/tokudb718.result b/mysql-test/suite/tokudb.bugs/r/tokudb718.result index 8814f8ac8e7..0cf75d40847 100644 --- a/mysql-test/suite/tokudb.bugs/r/tokudb718.result +++ b/mysql-test/suite/tokudb.bugs/r/tokudb718.result @@ -3,7 +3,8 @@ drop table if exists t; create table t (id int primary key); begin; insert into t values (1),(2); -select * from information_schema.tokudb_fractal_tree_info; -ERROR HY000: Got error -30994 from storage engine +select dictionary_name from information_schema.tokudb_fractal_tree_info; +dictionary_name +./test/t-status commit; drop table t; diff --git a/mysql-test/suite/tokudb.bugs/t/tokudb718.test b/mysql-test/suite/tokudb.bugs/t/tokudb718.test index 415bb7a2332..735a88afed8 100644 --- a/mysql-test/suite/tokudb.bugs/t/tokudb718.test +++ b/mysql-test/suite/tokudb.bugs/t/tokudb718.test @@ -7,7 +7,6 @@ enable_warnings; create table t (id int primary key); begin; insert into t values (1),(2); ---error 1030 -select * from information_schema.tokudb_fractal_tree_info; +select dictionary_name from information_schema.tokudb_fractal_tree_info; commit; drop table t; diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index c3dcd7be221..b8d48b47e58 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -1711,6 +1711,8 @@ static int tokudb_fractal_tree_info(TABLE *table, THD *thd) { error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); if (!error) { error = tokudb_report_fractal_tree_info_for_db(&curr_key, &curr_val, table, thd); + if (error) + error = 0; // ignore read uncommitted errors } if (!error && thd_killed(thd)) error = ER_QUERY_INTERRUPTED; -- cgit v1.2.1 From c788e693e678c83e094cc4e80f265014287ec1a3 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Thu, 26 Mar 2015 07:40:35 +0530 Subject: Bug #20730155: BACKPORT BUG#19699237 TO 5.1 Backport from mysql-5.5 to mysql-5.1 Bug# 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT LEADS TO INCORRECT BEHAVIOR ISSUE: ------ When the following conditions are satisfied in a query, a server crash occurs: a) Two rows are compared using a NULL-safe equal-to operator. b) Each of these rows belong to different charsets. SOLUTION: --------- When one charset is converted to another for comparision, the constructor of "Item_func_conv_charset" is called. This will attempt to use the Item_cache if the string is a constant. This check succeeds because the "used_table_map" of the Item_cache class is never set to the correct value. Since it is mistakenly assumed to be a constant, it tries to fetch the relevant null value related fields which are yet to be initialized. This results in valgrind issues and wrong results. The fix is to update the "used_table_map" of "Item_cache". This will allow "Item_func_conv_charset" to realise that this is not a constant. --- sql/item.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/item.h b/sql/item.h index 1c7cf7e6db5..c82d23b6d5a 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3024,7 +3024,11 @@ public: collation.set(item->collation); unsigned_flag= item->unsigned_flag; if (item->type() == FIELD_ITEM) + { cached_field= ((Item_field *)item)->field; + if (cached_field->table) + used_table_map= cached_field->table->map; + } return 0; }; enum Type type() const { return CACHE_ITEM; } -- cgit v1.2.1 From 85b128985362b1c98bc9122cfe0ca645d97daf0a Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Mon, 30 Mar 2015 19:20:14 +0530 Subject: Bug #20767962 5.1 SSL TESTS FAILING , GENERATE NEW CERTIFICATES Description: SSL tests are failing in mysql-5.1 pb2 Analysis: The SSL certificates are ended by jan 2015. Hence the SSL tests are failing. Fix: We have generated new certificates with SHA1 algorithm. --- mysql-test/r/openssl_1.result | 4 +- mysql-test/std_data/cacert.pem | 35 +++--- mysql-test/std_data/client-cert.pem | 95 ++++++++++------- mysql-test/std_data/client-key.pem | 38 ++++--- mysql-test/std_data/server-cert.pem | 90 ++++++++++------ mysql-test/std_data/server-key.pem | 32 ++++-- mysql-test/std_data/server8k-cert.pem | 183 +++++++++++++++++++++++--------- mysql-test/std_data/server8k-key.pem | 194 +++++++++++++++++----------------- mysql-test/t/openssl_1.test | 4 +- 9 files changed, 423 insertions(+), 252 deletions(-) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index b95c4bb0e76..4eb865c763c 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,8 +3,8 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET); diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem index e44341384e4..b42a05dc87a 100644 --- a/mysql-test/std_data/cacert.pem +++ b/mysql-test/std_data/cacert.pem @@ -1,17 +1,22 @@ -----BEGIN CERTIFICATE----- -MIICrTCCAhagAwIBAgIJAMI7xZKjhrDbMA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV -BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD -VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkxMTQ3MTBaFw0xNTAxMjgxMTQ3MTBaMEQx -CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh -MREwDwYDVQQKEwhNeVNRTCBBQjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA -wQYsOEfrN4ESP3FjsI8cghE+tZVuyK2gck61lwieVxjgFMtBd65mI5a1y9pmlOI1 -yM4SB2Ppqcuw7/e1CdV1y7lvHrGNt5yqEHbN4QX1gvsN8TQauP/2WILturk4R4Hq -rKg0ZySu7f1Xhl0ed9a48LpaEHD17IcxWEGMMJwAxF0CAwEAAaOBpjCBozAMBgNV -HRMEBTADAQH/MB0GA1UdDgQWBBSvktYQ0ahLnyxyVKqty+WpBbBrDTB0BgNVHSME -bTBrgBSvktYQ0ahLnyxyVKqty+WpBbBrDaFIpEYwRDELMAkGA1UEBhMCU0UxEDAO -BgNVBAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FM -IEFCggkAwjvFkqOGsNswDQYJKoZIhvcNAQEEBQADgYEAdKN1PjwMHAKG2Ww1145g -JQGBnKxSFOUaoSvkBi/4ntTM+ysnViWh7WvxyWjR9zU9arfr7aqsDeQxm0XDOqzj -AQ/cQIla2/Li8tXyfc06bisH/IHRaSc2zWqioTKbEwMdVOdrvq4a8V8ic3xYyIWn -7F4WeS07J8LKardSvM0+hOA= +MIIDmTCCAoGgAwIBAgIJAMzY2iwSCa1lMA0GCSqGSIb3DQEBBQUAMGMxCzAJBgNV +BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP +MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN +MTUwMzI3MTM1MjMxWhcNMjUwMjAyMTM1MjMxWjBjMQswCQYDVQQGEwJTRTESMBAG +A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y +YWNsZTEOMAwGA1UECwwFTXlTUUwxCzAJBgNVBAMMAkNBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA1Ydrcrccp8ttYCX+/B/3R/6V30PoEVTpKmALa+P/ +8v26nhTc6Wufjyqxt0hxs65E5jBTk5EsLbJQR4gsjluzvFL/mTrHVefm0Pm/p6yM +EiEJYbn20Q2eR88WnxWUbXXz6SiTSb3u09TntFqvpqh5Ex8DvoSCHTMaEZ2wguro +HJMUrz5li+ToiimS8DZUBAQxJhikggwZX2h8bF4L+Jzd0RS1d1mrNCUnl6KZ6oYj +VEWSbLfmcMhUFQJdo/PXsJBl/SICWURP0pvRoZ/5Qic/VBdHmdltM+pfu15n0Wpd +7zAQo0Uo95i4lR2pDknPvD3EJjz5dRvPhq024pHo+n72DwIDAQABo1AwTjAdBgNV +HQ4EFgQUay8Rmt8Sh5YOKLDso0bNCBHnoHEwHwYDVR0jBBgwFoAUay8Rmt8Sh5YO +KLDso0bNCBHnoHEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAKLCl +4lVEQyBpWuzAPE6xsayrbmGyO5mEzL8B4MWIiPkjVEemjGMNTa8mV7VUl/rgttru +hz3VhlWpw6tQTrExTqVWOafVOva4XiJ54hnshkqU2KXc4eX7PIG/eyAAphnj6hnX +QSWzDx+PKvidrJmyAqylVva3ApOO+5Sh5f/qw57id/Vy8xjtjeW2uWLG84iEVlPp ++sBWPjrM0EXGCZ470g19D35/JY6Gy+7e0Bk4RZuXITP+V7CdrjkDGu6w/zip7ukA +32snXHeaUwrp8mbDY0c9t5SVM8RlaqrtzUYid2+5RBCo3LYIypCBOYM2BMVFoy16 +T4B8hWXZ/t+ylnp+Mw== -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem index ee7f2ab281e..af298005f17 100644 --- a/mysql-test/std_data/client-cert.pem +++ b/mysql-test/std_data/client-cert.pem @@ -1,46 +1,69 @@ Certificate: Data: Version: 1 (0x0) - Serial Number: 1048577 (0x100001) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA Validity - Not Before: Jan 29 11:50:22 2010 GMT - Not After : Jan 28 11:50:22 2015 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB + Not Before: Mar 27 13:59:18 2015 GMT + Not After : Feb 2 13:59:18 2025 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Client Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) + Public-Key: (2048 bit) Modulus: - 00:cc:9a:37:49:13:66:dc:cf:e3:0b:13:a1:23:ed: - 78:db:4e:bd:11:f6:8c:0d:76:f9:a3:32:56:9a:f8: - a1:21:6a:55:4e:4d:3f:e6:67:9d:26:99:b2:cd:a4: - 9a:d2:2b:59:5c:d7:8a:d3:60:68:f8:18:bd:c5:be: - 15:e1:2a:3c:a3:d4:61:cb:f5:11:94:17:81:81:f7: - 87:8c:f6:6a:d2:ee:d8:e6:77:f6:62:66:4d:2e:16: - 8d:08:81:4a:c9:c6:4b:31:e5:b9:c7:8a:84:96:48: - a7:47:8c:0d:26:90:56:4e:e6:a5:6e:8c:b3:f2:9f: - fc:3d:78:9b:49:6e:86:83:77 + 00:9d:39:e4:6d:ce:1c:e0:7c:77:aa:9a:2b:94:db: + 53:48:2d:b5:77:6c:d3:63:73:b6:ff:b0:31:89:56: + 56:dd:fb:ce:ed:d8:94:f5:72:3d:4d:bf:a6:8b:43: + 64:f6:2d:66:5d:5a:77:3f:ae:cd:55:f0:02:03:0d: + ac:72:bf:7c:b6:a9:12:d7:fe:66:d6:ca:53:4e:95: + 0c:f2:a2:c1:2d:b2:d5:b0:d8:01:4e:07:89:ee:c8: + 9a:16:f5:1f:0b:4f:04:e3:dc:00:3a:2f:c4:20:ab: + 0f:f4:81:f1:e3:2e:ba:8f:4b:3d:cc:b2:7f:62:3a: + 3e:e9:ef:dd:2b:40:99:b5:98:2d:8f:2a:00:20:34: + de:6a:7a:66:fa:c8:8c:b2:c3:ad:7d:4d:31:d0:ba: + 35:ee:9d:c7:e3:25:48:02:6d:72:07:d0:ce:db:3b: + 7d:83:60:07:39:1a:76:4f:69:23:f3:45:30:07:bd: + eb:c9:b9:ca:91:dd:21:65:ac:e4:53:ad:10:08:71: + bd:74:15:56:a7:d6:d7:d8:fc:91:ac:53:c3:50:86: + 9f:53:1e:a7:f3:c5:bd:17:bd:fd:0f:6c:b4:c0:c8: + 7b:e6:dd:69:c2:f6:07:09:e4:a1:6f:a7:c7:03:b9: + b8:d9:aa:eb:95:b5:37:2f:cb:8e:fc:55:f0:ad:c7: + 33:f3 Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 5e:1f:a3:53:5f:24:13:1c:f8:28:32:b0:7f:69:69:f3:0e:c0: - 34:87:10:03:7d:da:15:8b:bd:19:b8:1a:56:31:e7:85:49:81: - c9:7f:45:20:74:3e:89:c0:e0:26:84:51:cc:04:16:ce:69:99: - 01:e1:26:99:b3:e3:f5:bd:ec:5f:a0:84:e4:38:da:75:78:7b: - 89:9c:d2:cd:60:95:20:ba:8e:e3:7c:e6:df:76:3a:7c:89:77: - 02:94:86:11:3a:c4:61:7d:6f:71:83:21:8a:17:fb:17:e2:ee: - 02:6b:61:c1:b4:52:63:d7:d8:46:b2:c5:9c:6f:38:91:8a:35: - 32:0b + Signature Algorithm: sha1WithRSAEncryption + 2b:f5:95:a5:83:87:9b:c3:77:57:10:e0:64:0f:3a:6a:a6:5f: + 9a:dd:16:b3:71:b1:0c:d7:59:93:ff:89:9f:d0:50:de:cd:c8: + d5:a3:2a:1c:6e:e1:0b:82:e4:ae:57:1b:13:c9:c6:ea:09:21: + 7f:5b:ff:3d:8d:77:25:a8:ed:a8:7c:9d:95:b0:55:60:fc:19: + f3:4f:3f:73:1f:72:d8:2e:c7:c6:bb:16:1d:33:07:bf:ea:6b: + dc:5f:5d:d0:53:2e:b2:96:ad:ea:64:5f:cb:f4:8c:7a:16:bb: + cf:42:b8:f0:9e:33:cb:29:f5:a7:4e:af:b2:a2:a6:4f:8e:6d: + 85:a1:63:43:aa:dd:11:1d:b2:80:ae:22:6a:b2:4b:0c:27:3c: + b4:59:d1:b4:77:48:69:ff:3b:e0:48:e8:3c:3f:df:14:43:80: + 68:97:06:fa:56:d6:dd:a3:7c:d0:0d:06:3a:a3:13:6f:d0:09: + d2:2e:89:5b:b8:22:3f:d5:da:e7:4c:69:ea:55:03:ef:5e:55: + 49:18:a5:1a:b4:be:1b:68:b4:65:d0:64:ab:29:9d:81:5f:05: + 31:08:0f:12:b9:c9:6e:8e:2e:b5:8f:d4:e9:55:94:30:e5:13: + d4:84:ad:4e:15:62:79:32:36:e8:67:b0:12:14:73:c0:bc:99: + 44:cf:b2:fb -----BEGIN CERTIFICATE----- -MIIB5zCCAVACAxAAATANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G -A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg -QUIwHhcNMTAwMTI5MTE1MDIyWhcNMTUwMTI4MTE1MDIyWjAyMQswCQYDVQQGEwJT -RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBAMyaN0kTZtzP4wsToSPteNtOvRH2jA12+aMyVpr4 -oSFqVU5NP+ZnnSaZss2kmtIrWVzXitNgaPgYvcW+FeEqPKPUYcv1EZQXgYH3h4z2 -atLu2OZ39mJmTS4WjQiBSsnGSzHluceKhJZIp0eMDSaQVk7mpW6Ms/Kf/D14m0lu -hoN3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAXh+jU18kExz4KDKwf2lp8w7ANIcQ -A33aFYu9GbgaVjHnhUmByX9FIHQ+icDgJoRRzAQWzmmZAeEmmbPj9b3sX6CE5Dja -dXh7iZzSzWCVILqO43zm33Y6fIl3ApSGETrEYX1vcYMhihf7F+LuAmthwbRSY9fY -RrLFnG84kYo1Mgs= +MIIDPjCCAiYCAQEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCU0UxEjAQBgNV +BAgMCVN0b2NraG9sbTESMBAGA1UEBwwJU3RvY2tob2xtMQ8wDQYDVQQKDAZPcmFj +bGUxDjAMBgNVBAsMBU15U1FMMQswCQYDVQQDDAJDQTAeFw0xNTAzMjcxMzU5MTha +Fw0yNTAyMDIxMzU5MThaMGcxCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hv +bG0xEjAQBgNVBAcMCVN0b2NraG9sbTEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQL +DAVNeVNRTDEPMA0GA1UEAwwGQ2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAnTnkbc4c4Hx3qporlNtTSC21d2zTY3O2/7AxiVZW3fvO7diU9XI9 +Tb+mi0Nk9i1mXVp3P67NVfACAw2scr98tqkS1/5m1spTTpUM8qLBLbLVsNgBTgeJ +7siaFvUfC08E49wAOi/EIKsP9IHx4y66j0s9zLJ/Yjo+6e/dK0CZtZgtjyoAIDTe +anpm+siMssOtfU0x0Lo17p3H4yVIAm1yB9DO2zt9g2AHORp2T2kj80UwB73rybnK +kd0hZazkU60QCHG9dBVWp9bX2PyRrFPDUIafUx6n88W9F739D2y0wMh75t1pwvYH +CeShb6fHA7m42arrlbU3L8uO/FXwrccz8wIDAQABMA0GCSqGSIb3DQEBBQUAA4IB +AQAr9ZWlg4ebw3dXEOBkDzpqpl+a3RazcbEM11mT/4mf0FDezcjVoyocbuELguSu +VxsTycbqCSF/W/89jXclqO2ofJ2VsFVg/BnzTz9zH3LYLsfGuxYdMwe/6mvcX13Q +Uy6ylq3qZF/L9Ix6FrvPQrjwnjPLKfWnTq+yoqZPjm2FoWNDqt0RHbKAriJqsksM +Jzy0WdG0d0hp/zvgSOg8P98UQ4Bolwb6Vtbdo3zQDQY6oxNv0AnSLolbuCI/1drn +TGnqVQPvXlVJGKUatL4baLRl0GSrKZ2BXwUxCA8Sucluji61j9TpVZQw5RPUhK1O +FWJ5MjboZ7ASFHPAvJlEz7L7 -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem index 205b5f31cb9..116e5324e3d 100644 --- a/mysql-test/std_data/client-key.pem +++ b/mysql-test/std_data/client-key.pem @@ -1,15 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDMmjdJE2bcz+MLE6Ej7XjbTr0R9owNdvmjMlaa+KEhalVOTT/m -Z50mmbLNpJrSK1lc14rTYGj4GL3FvhXhKjyj1GHL9RGUF4GB94eM9mrS7tjmd/Zi -Zk0uFo0IgUrJxksx5bnHioSWSKdHjA0mkFZO5qVujLPyn/w9eJtJboaDdwIDAQAB -AoGASqk/4We2En+93y3jkIO4pXafIe3w/3zZ7caRue1ehx4RUQh5d+95djuB9u7J -HEZ7TpjM7QNyao5EueL6gvbxt0LXFvqAMni7yM9tt/HUYtHHPqYiRtUny9bKYFTm -l8szCCMal/wD9GZU9ByHDNHm7tHUMyMhARNTYSgx+SERFmECQQD/6jJocC4SXf6f -T3LqimWR02lbJ7qCoDgRglsUXh0zjrG+IIiAyE+QOCCx1GMe3Uw6bsIuYwdHT6as -WcdPs04xAkEAzKulvEvLVvN5zfa/DTYRTV7jh6aDleOxjsD5oN/oJXoACnPzVuUL -qQQMNtuAXm6Q1QItrRxpQsSKbY0UQka6JwJBAOSgoNoG5lIIYTKIMvzwGV+XBLeo -HYsXgh+6Wo4uql3mLErUG78ZtWL9kc/tE4R+ZdyKGLaCR/1gXmH5bwN4B/ECQEBb -uUH8k3REG4kojesZlVc+/00ojzgS4UKCa/yqa9VdB6ZBz8MDQydinnShkTwgiGpy -xOoqhO753o2UT0qH8wECQQC99IEJWUnwvExVMkLaZH5NjAFJkb22sjkmuT11tAgU -RQgOMoDOm6driojnOnDWOkx1r1Gy9NgMLooduja4v6cx +MIIEowIBAAKCAQEAnTnkbc4c4Hx3qporlNtTSC21d2zTY3O2/7AxiVZW3fvO7diU +9XI9Tb+mi0Nk9i1mXVp3P67NVfACAw2scr98tqkS1/5m1spTTpUM8qLBLbLVsNgB +TgeJ7siaFvUfC08E49wAOi/EIKsP9IHx4y66j0s9zLJ/Yjo+6e/dK0CZtZgtjyoA +IDTeanpm+siMssOtfU0x0Lo17p3H4yVIAm1yB9DO2zt9g2AHORp2T2kj80UwB73r +ybnKkd0hZazkU60QCHG9dBVWp9bX2PyRrFPDUIafUx6n88W9F739D2y0wMh75t1p +wvYHCeShb6fHA7m42arrlbU3L8uO/FXwrccz8wIDAQABAoIBAFC/2fUXRbd51Y/2 +TGnQVy6b4zZp2wuZ86PQXzC0+jpaSIXZlW+V86xJwQSHYYQZ/xf1DYfUhDsd4Dqn +PClW9XtuzHHIhBLOqQiT/qljM6n/zkZcOhdUQeA0gQdHb2FEfTN121wHCkjo8nHW +h1/xsPlFYIEQL+JIHeXSPponPIqJxq26I3rQZZfYzShh9E91mKB2l8/S0cgNso1R +mj6xcF38WrVs2ApT09Cc5YjkYw3ENmLZQrOPuCaSatP6UTh59B7HnVtd7f2WqpfR +6+4Seo9gWwNIAqt3fC+uey2FzaACJY6SW00Qf5rU2n9OB2ffLUG2Sp4aXoRmigca +vuMys6ECgYEA0AEsNeadECL3XEC9V4oMJMnlAJc+nWTQOb6cKPhgwRgqWVZC3CT+ +QOQHtBK4QW3dHfTYWAxO9tr+J6fdLIE/GbkWv5S33V8N88+4iBJWsJcChjH7i+nm +uP5EfZ84RkqTc1xigIfy/Sjup2ClfIo9UgXuI5DukcQjJcE9xlN76aMCgYEAwYE8 +7kqhdE1ZnRjNYC5qD87Q9WcRByQoJk9HSDbXhuN9qCb17UHJGNPyLrQV8S0WUs4u +mlAFe7yxUMcqUMgZhOsytf3DTbzfflY3XFgJWAtHIMK+IwByT3xhrYddQfo8cdIx +4dWm/zxiqN3dVFcDNDg8IOdEFvmrwRokAe+90XECgYAc9HzWCANHMsbiVbTF0da8 +7Envmh5CRL1jvG/6mBDH8Hg8tXBbOt8V42hbHdv+Z6/HMsVHBHedj4CfvpNgVaGW +EBjllGs/6rKDhR/3+S2OKYdVbPHKWUYf7G1WW2q3Bjyea3be0430xdTrAd4nhwrg +NykeVFeRfQ8ze0IBMK/oJwKBgQC/CJPavJsAcoyR5zZ6Sdgzmv34B7Rr1Go+x+2b +gWjtphEbvLr1bAjYFgX1zZwL6XMsdJjVh0KikfqLwNQpxCJNctUxjkENsfUCiKNG +6zLuVNP3p8qGS56OkkDsS8Lpq92YkObmCUNAn6DXDZG//dcP6qSR5z71X68MiH4b +208OQQKBgD4jDHG/+nZnxdv3cpzqzkkIZv51uShqa5S+0kiMOEM4ry35RMmdMtko +4yh+KNa5aZDMKRGZxBCRfTUQZd779YbRtRVzfoewXXrDyhIhD1E4O691+vTTj9sD +LdsbyJ03r+moqTtQVDXEZeueapLLGeMsQp9QtIviLclbJRDpiolR -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem index 5922fe7ded7..cf6a4e1ee80 100644 --- a/mysql-test/std_data/server-cert.pem +++ b/mysql-test/std_data/server-cert.pem @@ -1,41 +1,69 @@ Certificate: Data: Version: 1 (0x0) - Serial Number: 1048578 (0x100002) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA Validity - Not Before: Jan 29 11:56:49 2010 GMT - Not After : Jan 28 11:56:49 2015 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost + Not Before: Mar 27 13:57:20 2015 GMT + Not After : Feb 2 13:57:20 2025 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (512 bit) + Public-Key: (2048 bit) Modulus: - 00:cd:e4:87:51:9d:72:11:a0:d1:fa:f3:92:8b:13: - 1c:eb:f7:e2:9a:2f:72:a8:d6:65:48:d1:69:af:1b: - c0:4c:13:e5:60:60:51:41:e9:ab:a6:bc:13:bb:0c: - 5e:32:7c:d9:6c:9e:cd:05:24:84:78:db:80:91:2e: - d8:88:2b:c2:ed + 00:f0:b9:fc:2f:f1:39:66:9c:4a:cd:04:95:80:67: + 48:03:6b:af:04:51:a6:80:94:13:ff:24:98:e6:38: + 5a:37:da:70:26:1a:32:d2:0f:65:3f:79:82:a1:ad: + f8:79:02:e1:35:bc:2e:51:c5:f1:e6:21:5b:9f:74: + 67:5a:54:e2:f9:3f:8c:cd:67:ae:f4:d3:ba:13:24: + 7f:8b:45:09:df:25:a5:c1:31:e8:d4:a2:07:f3:3c: + 9c:9e:cb:fd:a4:1a:d2:ed:9f:de:c7:1e:e8:0b:d9: + 42:15:52:96:f8:1d:ca:bd:ab:92:e7:7c:15:23:af: + 82:2e:dd:d3:e6:66:96:6e:89:75:01:51:d8:28:73: + cb:9e:a1:25:2e:f1:fe:b4:d4:87:61:5e:96:14:22: + 05:6a:22:1d:02:30:e9:27:5d:85:a8:23:e2:88:52: + e8:3d:5a:7f:16:53:b9:7c:d9:58:bc:fb:fd:2a:2c: + 7c:68:0b:c2:3a:2e:0c:27:81:41:ce:66:cd:36:ac: + 11:2a:fb:cc:e1:a4:d4:1f:4e:0a:e5:7b:26:ef:4e: + 21:cd:ab:59:79:50:06:bb:54:a6:b1:37:1f:bd:87: + 5c:ab:eb:50:c0:b7:b9:60:a8:ce:1c:24:a1:47:51: + e9:1a:fa:72:1e:53:fe:ad:68:3b:a7:29:58:96:bb: + 24:1d Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 73:ce:9c:6e:39:46:b4:14:be:da:3f:f3:1b:ba:90:bc:23:43: - d7:82:2a:70:4e:a6:d9:5a:65:5c:b7:df:71:df:75:77:c5:80: - a4:af:fa:d2:59:e2:fd:c9:9c:f0:98:95:8e:69:a9:8c:7c:d8: - 6f:48:d2:e3:36:e0:cd:ff:3f:d1:a5:e6:ab:75:09:c4:50:10: - c4:96:dd:bf:3b:de:32:46:da:ca:4a:f1:d6:52:8a:33:2f:ab: - f5:2e:70:3f:d4:9c:be:00:c8:03:f9:39:8a:df:5b:70:3c:40: - ef:03:be:7c:3d:1d:32:32:f3:51:81:e2:83:30:6e:3d:38:9b: - fb:3c + Signature Algorithm: sha1WithRSAEncryption + 95:6f:51:cb:fe:5e:c5:bc:49:49:4f:c8:e9:db:35:80:34:b2: + 9c:e1:66:63:7b:48:19:b6:14:53:7d:fd:e4:80:f9:63:cd:a6: + 75:77:c4:80:6c:6b:8e:25:6f:be:d1:d1:1c:4b:6b:6e:3d:e2: + db:99:f5:0e:a9:df:59:1d:f9:9a:06:70:52:19:e8:b2:5f:95: + 3c:e3:75:f8:0c:1e:58:d5:ba:c0:99:9f:b1:ac:b8:74:8e:fd: + 95:85:0b:2d:29:e7:70:32:d8:b2:b8:e4:47:cd:b6:59:78:85: + e1:f0:ab:89:3e:c5:82:f2:b1:6e:e5:0f:90:3e:6e:9d:62:53: + b2:77:7e:54:62:fd:a5:0a:29:3c:65:3c:43:0c:49:95:a4:61: + ef:55:79:f3:72:0b:5d:0d:1f:a0:ac:04:4c:f5:38:34:6c:c3: + 9e:e4:e5:ef:56:01:29:b1:96:fe:fe:a1:9c:ea:88:84:ff:1f: + 26:d0:38:59:65:cf:33:86:11:10:51:5c:19:ef:c6:2a:39:91: + 5e:4c:d2:8c:30:cb:1f:07:f7:c5:c7:dc:1d:4b:4c:6e:c7:74: + 63:2f:a0:de:bf:13:b6:6b:bd:07:3e:60:62:5f:37:ed:f5:69: + 4a:4d:b1:80:02:1d:dc:b7:8a:b8:ba:14:f6:da:86:08:69:af: + 9f:d9:d8:1a -----BEGIN CERTIFICATE----- -MIIBtzCCASACAxAAAjANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G -A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg -QUIwHhcNMTAwMTI5MTE1NjQ5WhcNMTUwMTI4MTE1NjQ5WjBGMQswCQYDVQQGEwJT -RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNVBAMT -CWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDN5IdRnXIRoNH685KL -Exzr9+KaL3Ko1mVI0WmvG8BME+VgYFFB6aumvBO7DF4yfNlsns0FJIR424CRLtiI -K8LtAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAc86cbjlGtBS+2j/zG7qQvCND14Iq -cE6m2VplXLffcd91d8WApK/60lni/cmc8JiVjmmpjHzYb0jS4zbgzf8/0aXmq3UJ -xFAQxJbdvzveMkbaykrx1lKKMy+r9S5wP9ScvgDIA/k5it9bcDxA7wO+fD0dMjLz -UYHigzBuPTib+zw= +MIIDQTCCAikCAQEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCU0UxEjAQBgNV +BAgMCVN0b2NraG9sbTESMBAGA1UEBwwJU3RvY2tob2xtMQ8wDQYDVQQKDAZPcmFj +bGUxDjAMBgNVBAsMBU15U1FMMQswCQYDVQQDDAJDQTAeFw0xNTAzMjcxMzU3MjBa +Fw0yNTAyMDIxMzU3MjBaMGoxCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hv +bG0xEjAQBgNVBAcMCVN0b2NraG9sbTEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQL +DAVNeVNRTDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA8Ln8L/E5ZpxKzQSVgGdIA2uvBFGmgJQT/ySY5jhaN9pwJhoy +0g9lP3mCoa34eQLhNbwuUcXx5iFbn3RnWlTi+T+MzWeu9NO6EyR/i0UJ3yWlwTHo +1KIH8zycnsv9pBrS7Z/exx7oC9lCFVKW+B3KvauS53wVI6+CLt3T5maWbol1AVHY +KHPLnqElLvH+tNSHYV6WFCIFaiIdAjDpJ12FqCPiiFLoPVp/FlO5fNlYvPv9Kix8 +aAvCOi4MJ4FBzmbNNqwRKvvM4aTUH04K5Xsm704hzatZeVAGu1SmsTcfvYdcq+tQ +wLe5YKjOHCShR1HpGvpyHlP+rWg7pylYlrskHQIDAQABMA0GCSqGSIb3DQEBBQUA +A4IBAQCVb1HL/l7FvElJT8jp2zWANLKc4WZje0gZthRTff3kgPljzaZ1d8SAbGuO +JW++0dEcS2tuPeLbmfUOqd9ZHfmaBnBSGeiyX5U843X4DB5Y1brAmZ+xrLh0jv2V +hQstKedwMtiyuORHzbZZeIXh8KuJPsWC8rFu5Q+QPm6dYlOyd35UYv2lCik8ZTxD +DEmVpGHvVXnzcgtdDR+grARM9Tg0bMOe5OXvVgEpsZb+/qGc6oiE/x8m0DhZZc8z +hhEQUVwZ78YqOZFeTNKMMMsfB/fFx9wdS0xux3RjL6DevxO2a70HPmBiXzft9WlK +TbGAAh3ct4q4uhT22oYIaa+f2dga -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem index 1083495cb96..9f50d5479e1 100644 --- a/mysql-test/std_data/server-key.pem +++ b/mysql-test/std_data/server-key.pem @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAM3kh1GdchGg0frzkosTHOv34povcqjWZUjRaa8bwEwT5WBgUUHp -q6a8E7sMXjJ82WyezQUkhHjbgJEu2Igrwu0CAwEAAQJBAJuwhFbF3NzRpBbEmnqJ -4GPa1UJMQMLFJF+04tqj/HxJcAIVhOJhGmmtYNw1yjz/ZsPnfJCMz4eFOtdjvGtf -peECIQDmFFg2WLvYo+2m9w9V7z4ZIkg7ixYkI/ObUUctfZkPOQIhAOUWnrvjFrAX -bIvYT/YR50+3ZDLEc51XxNgJnWqWYl1VAiEAnTOFWgyivFC1DgF8PvDp8u5TgCt2 -A1d1GMgd490O+TECIC/WMl0/hTxOF9930vKqOGf//o9PUGkZq8QE9fcM4gtlAiAE -iOcFpnLjtWj57jrhuw214ucnB5rklkQQe+AtcARNkg== +MIIEowIBAAKCAQEA8Ln8L/E5ZpxKzQSVgGdIA2uvBFGmgJQT/ySY5jhaN9pwJhoy +0g9lP3mCoa34eQLhNbwuUcXx5iFbn3RnWlTi+T+MzWeu9NO6EyR/i0UJ3yWlwTHo +1KIH8zycnsv9pBrS7Z/exx7oC9lCFVKW+B3KvauS53wVI6+CLt3T5maWbol1AVHY +KHPLnqElLvH+tNSHYV6WFCIFaiIdAjDpJ12FqCPiiFLoPVp/FlO5fNlYvPv9Kix8 +aAvCOi4MJ4FBzmbNNqwRKvvM4aTUH04K5Xsm704hzatZeVAGu1SmsTcfvYdcq+tQ +wLe5YKjOHCShR1HpGvpyHlP+rWg7pylYlrskHQIDAQABAoIBAHAZvBW7WMau66pz +gwdLkV5+a/8v4sCntHQxX7596Y1u/KDRvG7T2otnk2ylLjt0GtpCKrPL4S0QxbEI +rQSE2TnG3VPd/7xlSJaXfYmmecVfq8O+8TTry5X62NieGByunSEpPL4vZ1H1N2/k +iQc8IGiZGI0R3GpE1fPrOz1k8pLAKvZo77JiRPzn8CVWysbv6ujnGv4Q6pDGAPbx +cjFHvVmv1gXfQq/IoG1dpCq50gtis3acG/r0A2O0JKwW5SjhpK5oqatetoa4gkkA +ZQ4aPqXm9MSpMFKVnc9GRPFOO5IKX4m3eXLCD9ilUMu5u4fC+D8TjMVJ3yuH3xy8 +4/yNncECgYEA+Ev54LkEMIaQzRs8zOK5CQdDlAOqcZ+s4sfWuQZHzunguX6F74TE +LYjQV9oYzQhZejlwW+oM5ThzkSOpFpJ1zK6HOVA1GEIfgjjvSX8iK0WG81OHntUM +FJB4bc6tqr4j6zlcm/+0s5B7ud/ChWYEXuPG9+XKcpZtr70xm2fDc60CgYEA+DHi +Y1SLKpkgJaLlKnVJM8Yaigkv2ChM7sJ0wJoPbP+yf+JKL6na1xOU3clja/IytMn3 +1nLoCT19cdhBJTRzz8VKh+GM+GeYo0/HdxFQT83eE2UPck23X3eAslD5iHS7UDIi +xgPT/CK5IibN51t5G7V4eu1Dsdd86StFHT3aADECgYBATgT4E1KncqJbzFsRwQIk ++XGiCtUAulbfINxWbO76Ao5F3CO55YudM1qp9f0IVMo/olKcK2CNmPItO6wWAXZq +vSSeTkyB7NYWNsKaKUfjJw2NRSvRkeGgDc5yud02ZCoPSHrYl//npVq1x+KsA8DM +BnfISgYFaTodEoWfdt8ivQKBgHnYk5nMMZ4yGpQfin3zooJmaTUHGZP3BP3aPVMo +zxXl2g3qXB1WN/eKx3Syn7qo5rfWx3NiagPPSjyPvDu1qn2AD/zxgDGbOlZCnlwY +BeOH39SJsrGc8b9OfcIM+tRA6oyOcH/h9To9GcJoZoGEaMpvprxCqw8uCUa3VXDr +opChAoGBANSzQ/rRwKhd7nMu5LyAFuP8AnpPQj99psWfIvsVtW7CCUm+lhaYAoKm +qffCX2FmXbiZVqF9oEwTTGkjmxQ0uwphiNowQqeWaf4P3khsA57Fon1EoZnYj/f+ +5j7FlBwBZLFEx66bW18B8YdiZ7r5ufmE4XlfG1pkYi8ki0rPRwZR -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem index e71ba5722b9..1634513c6c9 100644 --- a/mysql-test/std_data/server8k-cert.pem +++ b/mysql-test/std_data/server8k-cert.pem @@ -1,51 +1,136 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Validity + Not Before: Mar 30 07:11:43 2015 GMT + Not After : Feb 5 07:11:43 2025 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Server + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (8192 bit) + Modulus: + 00:cb:27:2b:78:87:51:ee:f3:8e:4f:f8:34:dc:08: + 72:4a:5b:6d:dd:85:9a:b9:12:47:4f:31:0f:00:78: + d6:a3:c8:1f:e4:fa:45:48:af:fc:12:0b:f0:0e:0f: + 34:d7:c9:2d:cb:db:20:a5:5c:9e:79:ea:56:bb:0f: + 28:11:8d:1e:a9:21:2e:0d:97:87:db:ac:e8:8d:78: + b9:67:c2:d6:2b:b0:3d:92:60:83:7f:05:1a:0c:f3: + 89:d7:73:46:3b:d4:db:76:0a:4b:d6:59:45:72:55: + 56:84:06:0c:59:bb:fe:7c:34:78:2f:9a:b3:06:50: + 96:26:ae:79:d5:28:2f:c2:01:c7:de:73:fc:51:42: + 7d:9f:3c:f1:88:d8:6c:23:c1:7f:e7:40:62:72:fa: + 9a:f9:49:b5:af:48:77:5e:7c:64:54:37:5f:1e:17: + 2e:42:4b:e1:77:4f:2e:38:ef:fc:d1:16:92:4f:18: + 39:7b:18:9b:a3:76:d0:59:7f:6c:0d:fc:d6:06:8b: + e4:dc:0a:11:5b:9b:da:02:d2:72:eb:5e:ae:e8:22: + 76:40:5e:18:ab:f9:28:09:3a:06:fa:1d:84:a1:50: + 17:04:5d:e2:c0:41:4e:3f:44:08:07:24:59:a8:6c: + 4e:e0:f5:32:a6:90:eb:75:80:a0:dd:f3:b7:02:9d: + ab:7a:58:03:db:4a:d7:86:9f:9f:7c:45:ea:20:df: + 25:4a:63:09:0d:12:95:53:d2:03:4a:02:80:62:5e: + 42:ec:3e:d5:b3:5d:d4:98:7b:22:a1:87:df:13:7f: + 77:c8:f7:35:db:e8:b9:39:f6:a0:75:83:8e:34:3f: + 3c:6f:37:3d:00:7d:bc:67:02:b1:76:ae:1e:ce:8b: + be:c6:ae:8e:dd:f5:f6:e4:f3:71:58:8d:1e:b9:8d: + 3d:15:79:a0:34:86:61:fb:f0:ca:14:05:44:c0:96: + b2:cc:26:61:4d:61:cb:d5:a4:62:fb:3e:30:04:9a: + ba:90:4e:78:2f:c4:25:98:be:56:f6:f9:72:3f:3a: + df:24:c0:d0:07:1a:51:94:31:8e:5f:0b:d9:56:5e: + f0:b0:59:2a:ee:31:b1:4e:f9:62:df:6a:2e:07:55: + 31:7c:54:76:31:c7:96:84:9b:91:6d:51:a0:2e:2c: + db:3a:9c:78:f3:28:db:90:4d:94:e5:d7:71:da:e4: + 6b:97:06:a3:9b:ae:09:a4:3d:2b:3c:c8:9d:d5:b9: + dd:88:e2:6f:70:7d:b7:b9:e2:e8:97:52:65:ea:96: + 25:50:c2:41:10:81:3c:2a:fd:05:66:70:e0:61:97: + 04:fd:b2:97:42:d0:5d:86:69:4d:7e:45:eb:7a:de: + 68:ba:81:10:08:e8:fe:cd:aa:28:7d:8d:7d:e1:88: + 62:6b:ae:f0:1e:1b:59:e8:73:2d:62:8c:8b:69:b7: + 32:d8:ed:53:10:c3:c0:1c:c6:ca:7a:80:48:7f:9e: + 43:96:8b:e6:44:3b:20:57:86:d0:43:c5:e5:d4:cd: + ae:48:34:1a:fe:92:4e:e1:d4:15:5e:e0:32:be:c3: + 6c:d6:e7:2d:40:b9:3f:30:f8:4f:2f:35:8a:69:9a: + 6e:58:0f:09:32:a1:e1:cb:10:87:e5:36:80:d6:b1: + 92:c7:d0:ff:3a:6e:c7:60:c7:05:f7:be:8a:f9:d7: + a1:7f:39:32:90:61:59:cf:56:49:94:aa:93:37:75: + 0a:80:9e:bd:aa:28:25:15:88:8c:4c:41:21:f9:e0: + ce:52:3d:79:4a:fe:a5:7f:33:09:0d:6d:d0:2b:26: + 44:5d:4f:84:88:1a:68:11:04:89:65:f3:89:7f:99: + a3:e8:00:bd:11:ac:28:20:7e:2b:c3:a4:7e:8c:97: + 44:f0:cf:fd:4d:ae:1c:6c:27:08:30:a6:5b:90:b8: + 97:a0:c0:6e:de:83:cf:1a:63:48:1b:9c:fb:98:51: + 04:77:86:86:d3:b8:8a:de:31:b9:62:7a:19:be:0a: + 26:4c:b8:d7:c8:f5:0d:37:2a:c5:c0:25:e0:36:5d: + f8:a2:78:05:ca:1b:cb:dd:79:e8:df:83:ff:ff:02: + ab:30:c6:2f:4c:ce:7e:00:e4:85:1a:b5:db:40:12: + 70:e2:24:f2:4c:8c:95:66:20:a4:25:b1:e5:1a:a2: + e3:4f:1b:09:9e:8c:02:24:af:ed:a5:97:f6:35:e4: + 76:85:c8:a3:36:b3:a3:b1:eb:da:94:0b:c9:40:3e: + 4e:79:04:08:c0:f5:01:a4:5a:91:3b:4a:48:42:c6: + 37:29:13:f6:22:8a:f7:50:7d:57:c4:72:c3:10:8a: + 9e:20:d7:96:c1:02:5e:59:00:a5:cf:85:b3:59:93: + 23:68:5d:a3:cc:a6:8f:6b:c8:16:e5:ba:6d:31:1e: + 1b:f4:3d:8a:10:3f:87:f8:73:8e:9a:9c:1f:74:18: + ab:96:ba:48:7c:25:5c:d5:71:42:48:ff:c5:96:d5: + 20:94:3f:f2:15:ad:a0:ae:de:7b:93:bb:45:e9:8e: + b8:da:10:64:8f:6b:c8:e4:68:6d:85:6d:d6:b1:09: + 7c:60:7d:dc:5f:ef:6a:f1:ea:c4:ee:28:33:be:45: + a1:d0:b3:f9:81:a9:39:e6:ac:c8:17:39:2a:51:3a: + b2:52:88:b7:10:38:ad:5d:58:ab:69:5a:6a:4e:f1: + 1f:13:e3:ce:0d:e8:cb:14:41:72:fd:eb:e7:58:53: + 5c:6f:c7:d0:1d + Exponent: 65537 (0x10001) + Signature Algorithm: sha1WithRSAEncryption + ac:c4:13:9a:ff:83:5c:31:27:b8:57:eb:20:7b:51:34:e9:91: + 6c:52:14:9d:91:1f:75:bc:e1:08:7c:7f:e0:ff:88:20:06:78: + 8c:84:2a:af:c4:85:9c:63:40:c2:3f:39:10:65:f3:41:a5:22: + f6:e2:ec:58:ff:cd:ab:60:cb:89:a9:6a:90:26:18:06:b9:85: + 9f:7c:99:f9:cf:6b:93:b7:d4:1d:89:6d:17:90:fa:b3:55:a6: + d0:9e:4e:51:e4:17:1f:6e:c3:fb:c3:a1:a2:15:35:77:f0:da: + 71:31:61:ee:1f:00:54:8d:2f:24:0a:cc:93:d2:9e:42:23:c6: + 5b:57:cb:39:b6:be:c0:dd:3a:8f:57:1a:10:b3:48:5a:1b:ea: + e7:7d:16:b2:1e:b5:86:be:c9:b5:8c:e8:a6:62:52:99:f5:86: + bf:e3:9e:12:32:dd:5a:21:c8:20:dc:58:e5:66:3c:c1:5e:33: + 1b:36:d7:fc:4b:48:08:21:2b:ab:c5:19:62:a4:46:90:55:6c: + 84:7d:20:a9:21:9c:ae:9a:1a:3f:1b:f8:1f:36:42:e3:43:89: + 61:c8:d2:c6:91:5b:75:24:97:ec:72:41:30:80:aa:d2:d1:37: + 60:a8:6c:2c:db:fe:4a:50:6d:8b:d5:da:86:4c:5a:f2:8a:cf: + fd:21:8a:94 -----BEGIN CERTIFICATE----- -MIIJFDCCBPwCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV -BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw -CQYDVQQDEwJDQTAeFw0xMDA3MjgxNDA3MjhaFw0xODEwMTQxNDA3MjhaMFIxCzAJ -BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQjEN -MAsGA1UECxMEVGVzdDEPMA0GA1UEAxMGc2VydmVyMIIEIjANBgkqhkiG9w0BAQEF -AAOCBA8AMIIECgKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSEC -PgxNNcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+Lr -hXIqCz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2 -DA7kvMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5 -hACbfU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09 -Gh/GwmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33 -aGsZ5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4 -PRd31qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2 -OaIwFjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83 -psQ6R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCc -HSFu07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs -+LFdt4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS -9+LB+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1P -sZi4UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUd -NhXxi/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfV -JTt8Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwx -UADgR0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1 -kOE7GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQ -uw4qVKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRY -nTIywUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PT -trohFSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFT -d33ZDke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABMA0GCSqGSIb3DQEB -BAUAA4IEAQCc9RBhRbuWlmRZPZkqIdi5/+enyjoMmOa6ryJPxFSP8D2jrlHgQsk1 -+GsJmPFT3rwWfoGAQu/aeSX4sp8OhKVJtqNA6MJrGYnZIMolgYa1wZPbkjJsdEfi -UsZdIB0n2+KA0xwEdGPdkGCfNPBtOg557DkcyEvsIZ9ELp4Pp2XzWRhyFGasJZc4 -YwgD/3K2rpOPZoMkBKeKqV19j41OfLKGBVyuaqzitbu9+KT4RU1ibr2a+UuFCwdT -oqyN7bfWXjcjXOMkxCsOmLfKmqQxs7TEOVrYPTdYjamDxLy/e5g5FgoCxGY8iil0 -+YFLZyH6eEx/Os9DlG/M3O1MeRD9U97CdsphbDVZIDyWw5xeX8qQHJe0KSprAgiG -TLhTZHeyrKujQCQS1oFFmNy4gSqXt0j1/6/9T80j6HeyjiiYEaEQK9YLTAjRoA7W -VN8wtHI5F3RlNOVQEJks/bjdlpLL3VhaWtfewGh/mXRGcow84cgcsejMexmhreHm -JfTUl9+X1IFFxGq2/606A9ROQ7kN/s4rXu7/TiMODXI/kZijoWd2SCc7Z0YWoNo7 -IRKkmZtrsflJbObEuK2Jk59uqzSxyQOBId8qtbPo8qJJyHGV5GCp34g4x67BxJBo -h1iyVMamBAS5Ip1ejghuROrB8Hit8NhAZApXju62btJeXLX+mQayXb/wC/IXNJJD -83tXiLfZgs6GzLAq7+KW/64sZSvj87CPiNtxkvjchAvyr+fhbBXCrf4rlOjJE6SH -Je2/Jon7uqijncARGLBeYUT0Aa6k1slpXuSKxDNt7EIkP21kDZ5/OJ0Y1u587KVB -dEhuDgNf2/8ij7gAQBwBoZMe1DrwddrxgLLBlyHpAZetNYFZNT+Cs/OlpqI0Jm59 -kK9pX0BY4AGOd23XM3K/uLawdmf67kkftim7aVaqXFHPiWsJVtlzmidKvNSmbmZe -dOmMXp6PBoqcdusFVUS7vjd3KAes5wUX/CaTyOOPRu0LMSnpwEnaL76IC9x4Jd6d -7QqY/OFTjpPH8nP57LwouiT6MgSUCWGaOkPuBJ9w9sENSbbINpgJJ42iAe2kE+R7 -qEIvf/2ETCTseeQUqm2nWiSPLkNagEh6kojmEoKrGyrv3YjrSXSOY1a70tDVy43+ -ueQDQzNZm3Q7inpke2ZKvWyY0LQmLzP2te+tnNBcdLyKJx7emPRTuMUlEdK7cLbt -V3Sy9IKtyAXqqd66fPFj4NhJygyncj8M6CSqhG5L0GhDbkA8UJ8yK/gfKm3h5xe2 -utULK5VMtAhQt6cVahO59A9t/OI17y45bmlIgdlEQISzVFe9ZbIUJW44zBfPx74k -/w8pMRr8gEuRqpL2WdJiKGG6lhMHLVFo +MIIGPjCCBSYCAQEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCU0UxEjAQBgNV +BAgMCVN0b2NraG9sbTESMBAGA1UEBwwJU3RvY2tob2xtMQ8wDQYDVQQKDAZPcmFj +bGUxDjAMBgNVBAsMBU15U1FMMQswCQYDVQQDDAJDQTAeFw0xNTAzMzAwNzExNDNa +Fw0yNTAyMDUwNzExNDNaMGcxCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hv +bG0xEjAQBgNVBAcMCVN0b2NraG9sbTEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQL +DAVNeVNRTDEPMA0GA1UEAwwGU2VydmVyMIIEIjANBgkqhkiG9w0BAQEFAAOCBA8A +MIIECgKCBAEAyycreIdR7vOOT/g03AhySltt3YWauRJHTzEPAHjWo8gf5PpFSK/8 +EgvwDg8018kty9sgpVyeeepWuw8oEY0eqSEuDZeH26zojXi5Z8LWK7A9kmCDfwUa +DPOJ13NGO9TbdgpL1llFclVWhAYMWbv+fDR4L5qzBlCWJq551SgvwgHH3nP8UUJ9 +nzzxiNhsI8F/50Bicvqa+Um1r0h3XnxkVDdfHhcuQkvhd08uOO/80RaSTxg5exib +o3bQWX9sDfzWBovk3AoRW5vaAtJy616u6CJ2QF4Yq/koCToG+h2EoVAXBF3iwEFO +P0QIByRZqGxO4PUyppDrdYCg3fO3Ap2relgD20rXhp+ffEXqIN8lSmMJDRKVU9ID +SgKAYl5C7D7Vs13UmHsioYffE393yPc12+i5OfagdYOOND88bzc9AH28ZwKxdq4e +zou+xq6O3fX25PNxWI0euY09FXmgNIZh+/DKFAVEwJayzCZhTWHL1aRi+z4wBJq6 +kE54L8QlmL5W9vlyPzrfJMDQBxpRlDGOXwvZVl7wsFkq7jGxTvli32ouB1UxfFR2 +MceWhJuRbVGgLizbOpx48yjbkE2U5ddx2uRrlwajm64JpD0rPMid1bndiOJvcH23 +ueLol1Jl6pYlUMJBEIE8Kv0FZnDgYZcE/bKXQtBdhmlNfkXret5ouoEQCOj+zaoo +fY194Yhia67wHhtZ6HMtYoyLabcy2O1TEMPAHMbKeoBIf55DlovmRDsgV4bQQ8Xl +1M2uSDQa/pJO4dQVXuAyvsNs1uctQLk/MPhPLzWKaZpuWA8JMqHhyxCH5TaA1rGS +x9D/Om7HYMcF976K+dehfzkykGFZz1ZJlKqTN3UKgJ69qiglFYiMTEEh+eDOUj15 +Sv6lfzMJDW3QKyZEXU+EiBpoEQSJZfOJf5mj6AC9EawoIH4rw6R+jJdE8M/9Ta4c +bCcIMKZbkLiXoMBu3oPPGmNIG5z7mFEEd4aG07iK3jG5YnoZvgomTLjXyPUNNyrF +wCXgNl34ongFyhvL3Xno34P//wKrMMYvTM5+AOSFGrXbQBJw4iTyTIyVZiCkJbHl +GqLjTxsJnowCJK/tpZf2NeR2hcijNrOjsevalAvJQD5OeQQIwPUBpFqRO0pIQsY3 +KRP2Ior3UH1XxHLDEIqeINeWwQJeWQClz4WzWZMjaF2jzKaPa8gW5bptMR4b9D2K +ED+H+HOOmpwfdBirlrpIfCVc1XFCSP/FltUglD/yFa2grt57k7tF6Y642hBkj2vI +5GhthW3WsQl8YH3cX+9q8erE7igzvkWh0LP5gak55qzIFzkqUTqyUoi3EDitXVir +aVpqTvEfE+PODejLFEFy/evnWFNcb8fQHQIDAQABMA0GCSqGSIb3DQEBBQUAA4IB +AQCsxBOa/4NcMSe4V+sge1E06ZFsUhSdkR91vOEIfH/g/4ggBniMhCqvxIWcY0DC +PzkQZfNBpSL24uxY/82rYMuJqWqQJhgGuYWffJn5z2uTt9QdiW0XkPqzVabQnk5R +5BcfbsP7w6GiFTV38NpxMWHuHwBUjS8kCsyT0p5CI8ZbV8s5tr7A3TqPVxoQs0ha +G+rnfRayHrWGvsm1jOimYlKZ9Ya/454SMt1aIcgg3FjlZjzBXjMbNtf8S0gIISur +xRlipEaQVWyEfSCpIZyumho/G/gfNkLjQ4lhyNLGkVt1JJfsckEwgKrS0TdgqGws +2/5KUG2L1dqGTFryis/9IYqU -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem index 99e7417733e..5e504c116e4 100644 --- a/mysql-test/std_data/server8k-key.pem +++ b/mysql-test/std_data/server8k-key.pem @@ -1,99 +1,99 @@ -----BEGIN RSA PRIVATE KEY----- -MIISKQIBAAKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSECPgxN -NcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+LrhXIq -Cz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2DA7k -vMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5hACb -fU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09Gh/G -wmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33aGsZ -5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4PRd3 -1qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2OaIw -FjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83psQ6 -R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCcHSFu -07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs+LFd -t4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS9+LB -+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1PsZi4 -UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUdNhXx -i/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfVJTt8 -Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwxUADg -R0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1kOE7 -GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQuw4q -VKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRYnTIy -wUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PTtroh -FSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFTd33Z -Dke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABAoIEAQCSt6YoZqigz/50 -XvYT6Uf6T6S1lBDFXNmY1qOuDkLBJTWRiwYMDViQEaWCaZgGTKDYeT3M8uR/Phyu -lRFi5vCEMufmcAeZ3hxptw7KU+R8ILJ207/zgit6YglTys9h5txTIack39+6FJmx -wbZ64HpETJZnpMO6+fuZaMXyLjuT8mmXjvHcOgXOvjWeFkZOveDhjJkAesUXuqyX -EI+ajoXuQiPXeKonkD2qd7NTjzfy4gw/ZF4NXs0ZVJeviqtIPo2xp33udOw2vRFh -bMvlF4cNLAbIKYVyOG0ruOfd2I7Unsc/CvD1u5vlRVuUd8OO0JZLIZR7hlRX+A58 -8O1g2H/wJZAsF1BnLnFzDGYCX2WjCCK3Zn85FkKGRa0lTdYDduad/C/N3Y2/pHFE -e7U/2D7IkEei59tD2HcsDBB3MJnckkn/hyiL9qWcxqWZ61vurE+XjU6tc6fnfhk9 -pJQ6yU3epPU7Vfsk0UGA7bbgKpsyzyH8Zl76YC2mN2ZVJjZekfhY+ibT9odEPdOl -yLB5iXA6/WhKkDWaOqZGOH+7MblWgT9wHINlcn+nKzOr00JHl26ac6aMlXXi9vbe -4jgJbFK1HYlFIndyX/BdqRTsFemDoDrVqrEYsaONoVYDd9c5qrqYOeh34DhOksQW -hNwWBfmMlfzgOGtCYhMeK+AajqTtUbMYQA6qp47KJd/Oa5Dvi3ZCpvZh3Ll5iIau -rqCtmojsWCqmpWSu7P+Wu4+O3XkUMPdQUuQ5rJFESEBB3yEJcxqk/RItTcKNElNC -PASrPrMD9cli7S/pJ+frbhu1Gna1ArXzXQE9pMozPaBpjCig7+15R0lL3pmOKO6e -WK3dgSwrnW6TQdLPlSD4lbRoiIdTHVBczztDeUqVvFiV3/cuaEi1nvaVdAYLqjuL -ogK4HwE/FQ54S0ijAsP52n25usoH6OTU3bSd/7NTp0vZCy3yf10x7HUdsh2DvhRO -3+TSK5t0yz0Nt7hNwcI6pLmWUIYcZgpFc/WsiiGscTfhy8rh3kRHI8ylGq53KNF+ -yCVmjqnBRWs91ArxmeF1ctX2t3w5p7gf65hJWqoX/2DiSi5FBsr6HLxa5sUi4wRZ -136aCNt5Wu7w+AzPDbQW6qKUGSyfHJAw4JZasZcaZLise5IWb1ks0DtFbWWdT3ux -8r2AM7IO1WopnekrYCnx/aBvBAv4NjWozVA517ztVttPERt3AGb4nm387nYt5R2U -NO2GBWcDyT8JQLKmffE1AkWolCR1GsvcNLQfLCbnNppgsnsLE/viTG4mq1wjnd8O -2Q8nH1SVTuyGFREMp/zsiAEaGfdd0hI2r1J7OdNPBBCtmhITsy9ZYHqm5vrGvy3s -vi2GuB2RAoICAQD/oWUsg4eTJxHifTJLz/tVSTXnw7DhfbFVa1K1rUV63/MRQAFW -pabN4T6Yfp3CpdRkljCA8KPJZj7euwhm4OEg1ulpOouA+cfWlE9RFE8wyOK5SYwM -k+nk31P9MUC866pZg/ghzBGDub91OW1+ZGEtqnLI/n/LhiAIWt0hJvgZclTc1cAL -xffHVlFwoSyNl/nc3ueZCC95nOLst2XcuxZLLbOFtZCmDYsp49q/Jn6EFjn4Ge2o -qp38z6eZgDMP1F4lb9nDqXPHfUSt2jxKlmpfXS+IPKdba67+EjhbtmUYzaR4EoPI -zh+o6SrVWT6Yve7KGiYv06fuRz1m/lLQO/Arbd9ntSjgn+ZEXGOkbhnHUX3DJ4ny -/6XEGB9NLQjern4uNTn0AaV+uvhncapFMaIBnVfq0Cw8eog0136PBYRaVX7T44j5 -HwIyGXWtYGA/SzDEQoksD0Y/T61BEGnLZaKeavNd82WwFvcYHZtE0J4aQGjCEE7N -+nijzCy+j5ETmme9KJvQHpEyXP3N4RBko1eWvyTwFZDdIXtoa6TTEI51lm+FXJ/b -Y+BzMr6KRo29FB+7//1ptUoMvn5hzL0PwOv2ZSTQuoG5hLDEbxWXLNhd1VHcfznF -3EZHwfD2F8aGQ3kz+fkMTNfK955KorDrmLgvmV9eZZ5yQxGZrs5H5YfKpwKCAgEA -6nSUbzfSdVFUH89NM5FmEJgkD06vqCgHl2mpyF+VmDGcay4K06eA4QbRO5kns13+ -n6PcBl/YVW/rNE8iFi+WxfqUpAjdR1HlShvTuTRVqtFTfuN8XhbYU6VMjKyuE0kd -LKe3KRdwubjVNhXRZLBknU+3Y/4hnIR7mcE3/M5Zv5hjb7XnwWg/SzxV9WojCKiu -vQ7cXhH5/o7EuKcl1d6vueGhWsRylCG9RimwgViR2H7zD9kpkOc0nNym9cSpb0Gv -Lui4cf/fVwIt2HfNEGBjbM/83e2MH6b8Xp1fFAy0aXCdRtOo4LVOzJVAxn5dERMX -4JJ4d5cSFbssDN1bITOKzuytfBqRIQGNkOfizgQNWUiaFI0MhEN/icymjm1ybOIh -Gc9tzqKI4wP2X9g+u3+Oof1QaBcZ4UbZEU9ITN87Pa6XVJmpNx7A81BafWoEPFeE -ahoO4XDwlHZazDuSlOseEShxXcVwaIiqySy7OBEPBVuYdEd2Qw/z3JTx9Kw8MKnf -hu+ar5tz5dPnJIsvLeYCcJDe/K6loiZuHTtPbWEy9p6It7qubQNPBvTSBN5eVDKc -Q2bTQNCx8SAAA9C5gJiwWoQKsXJzbRFRY77P9JjuGpua3YJ2nYBHEJmF+fp1R33c -uHIyMphPMkKC4GC3/43kkMr6tck8kZbXGSYsLsBr2GkCggIBAJvvrjILQianzKcm -zAmnI6AQ+ssYesvyyrxaraeZvSqJdlLtgmOCxVANuQt5IW9djUSWwZvGL4Np1aw0 -15k6UNqhftzsE7FnrVneOsww4WXXBUcV8FKz4Bf3i9qFswILmGzmrfSf8YczRfGS -SJKzVPxwX3jwlrBmbx/pnb7dcLbFIbNcyLvl1ZJJu4BDMVRmgssTRp/5eExtQZg4 -//A4SA8wH7TO3yAMXvn8vrGgH8kfbdlEp88d1SYk3g4rP/rGB3A63NIYikIEzmJn -ICQ3wUfPJnGq3kRMWgEuyCZaCy2oNE3yrWVPJ8z3/2MJ/79ZDVNHxEeki2o1FuW+ -+nGAPq+fZIp03iy4HdVRro7dgugtc9QaSHJtNId8V4vSjviX5Oz3FxUb9AJst58S -nVV8Q2FMxBa/SlzSOkhRtCg2q1gXkzhaMnIVUleRZFGQ2uWBToxKMjcoUifIyN1J -z999bkfI4hBLq5pRSAXz+YVu5SMKa10GaawIwJLat+i+1zboF6QyI2o/Wz8nrsNq -KX/ajFGu5C94WFgsVoWKNI90KBLe48Ssje9c68waBlV/WHMg1YLvU3yqVDOV+K5c -IHB9tPMnG+AgBYZPxSzuvnLrrkj/GeKx0WI7TrvzOLRGKJo6irMEJ8IzFegASRUq -TVZKYQDYRG7m+lKlSxU+pyMAh2c9AoICAE4kavCip1eIssQjYLTGSkFPo/0iGbOv -G9CgXAE3snFWX67tWphupKrbjdMSWcQTmPD2OTg6q6zWL4twsIi6dcMooHAHsFC7 -//LyUV/SDJdxSyXohiQJ8zH1zwy35RDydnHSuF5OvLh53T44iWDI1dAEqLgAFI3J -LjTxzEpLMGiGTuYFt+ejai0WQAQayvBw4ESM9m+4CB2K0hBFTXv5y5HlnNTW0uWC -VUZUUMrbjUieDz8B/zOXi9aYSGFzmZFGUDAPSqJcSMEELemPDF7f8WNr8vi42tIV -4tlaFD1nep4F9bWMiCXU6B2RxVQi+7vcJEIqL1KUnGd3ydfD00K+ng4Xnj7Vz/cz -QE7CqrpFaXmPlCMzW6+dm51/AyhHXDLkL2od05hiXcNkJ7KMLWRqwExHVIxM3shR -x7lYNl3ArUsCrNd6m4aOjnrKFk7kjeLavHxskPccoGKrC9o0JMfTkWLgmuBJFQ0S -N/HzIbcvIFWF0Ms4ojb50yp6ziXhXfJOO/0KUQEki71XIhvw89mVZszDzD5lqzjf -HCZMBU4MbmL6NdEevFIDH0zPPkx3HPNtJt3kIJbit9wI8VhUMe+ldGnGxpWb8tKw -SfM3vrHkYr+lizk26XfXMFhdAuVtT7dzQKSNEyP/1a2Hs307Xzgiv8JulJ8QIkrX -/nsYWPOAGLG5AoICABmdW9Ppkvuhb1AEcjTWb+XCyopoBc6vit/uQWD9uO+CeX7a -cfzq+iH01CAjyVMc4E1JDc5Lpi106U+GRGcAAaPJB2Sp5NznoxaOVrb71blu4Q4x -bNjtKM/P/DXpO+yJYoOPdKtaSDhtnfNDM7H/jztJ3XIrOltKA7CcRDohbBWIx8Q0 -0uEpvfFpZZBco3yVmjP0RLgIVYn/ZDj9wGhSvFWIJ5vv6GXmtDrcHGMLxcfv7t76 -UVcMW/Yy4mYJRCzGOrWagyVijJ6MTVNciqadWcH1KcbB3EGoMFYMn61or2qJABPM -xz89IlhnROU1Re3X/QRx5t86cw6oa+FqrWMOhSs31I0dNWSuS/xDympG27YIYSDd -mv5seT78GjFmMJC5pPOLoXsbTPB0HpsX2/UL/w/eRAfilTOef/Cf9VE5MP/C2YR7 -NBxUU7/+21D6WvdtBTcZbrXWGroAo8zPP+PwX0+c6WoAvqDJvCPndp8xZhSgEJN/ -0kScptezi8n3ZHI95EA9U5mAHxHz0IhDDVzWw/z1f1SBPxKVX3+By3zaa3lrD2ch -cHq7nBkX72veEevnHUY8Z2rHE2G2jdmRfOtwm4sjL0VBV9fRRoxzJWRduKyeOtDL -EhhBhUoTrT48UnfW9hxnbNLB9P/hh+UJu9HrS2uAwHoGE1+8gcyundupGDBn +MIISKAIBAAKCBAEAyycreIdR7vOOT/g03AhySltt3YWauRJHTzEPAHjWo8gf5PpF +SK/8EgvwDg8018kty9sgpVyeeepWuw8oEY0eqSEuDZeH26zojXi5Z8LWK7A9kmCD +fwUaDPOJ13NGO9TbdgpL1llFclVWhAYMWbv+fDR4L5qzBlCWJq551SgvwgHH3nP8 +UUJ9nzzxiNhsI8F/50Bicvqa+Um1r0h3XnxkVDdfHhcuQkvhd08uOO/80RaSTxg5 +exibo3bQWX9sDfzWBovk3AoRW5vaAtJy616u6CJ2QF4Yq/koCToG+h2EoVAXBF3i +wEFOP0QIByRZqGxO4PUyppDrdYCg3fO3Ap2relgD20rXhp+ffEXqIN8lSmMJDRKV +U9IDSgKAYl5C7D7Vs13UmHsioYffE393yPc12+i5OfagdYOOND88bzc9AH28ZwKx +dq4ezou+xq6O3fX25PNxWI0euY09FXmgNIZh+/DKFAVEwJayzCZhTWHL1aRi+z4w +BJq6kE54L8QlmL5W9vlyPzrfJMDQBxpRlDGOXwvZVl7wsFkq7jGxTvli32ouB1Ux +fFR2MceWhJuRbVGgLizbOpx48yjbkE2U5ddx2uRrlwajm64JpD0rPMid1bndiOJv +cH23ueLol1Jl6pYlUMJBEIE8Kv0FZnDgYZcE/bKXQtBdhmlNfkXret5ouoEQCOj+ +zaoofY194Yhia67wHhtZ6HMtYoyLabcy2O1TEMPAHMbKeoBIf55DlovmRDsgV4bQ +Q8Xl1M2uSDQa/pJO4dQVXuAyvsNs1uctQLk/MPhPLzWKaZpuWA8JMqHhyxCH5TaA +1rGSx9D/Om7HYMcF976K+dehfzkykGFZz1ZJlKqTN3UKgJ69qiglFYiMTEEh+eDO +Uj15Sv6lfzMJDW3QKyZEXU+EiBpoEQSJZfOJf5mj6AC9EawoIH4rw6R+jJdE8M/9 +Ta4cbCcIMKZbkLiXoMBu3oPPGmNIG5z7mFEEd4aG07iK3jG5YnoZvgomTLjXyPUN +NyrFwCXgNl34ongFyhvL3Xno34P//wKrMMYvTM5+AOSFGrXbQBJw4iTyTIyVZiCk +JbHlGqLjTxsJnowCJK/tpZf2NeR2hcijNrOjsevalAvJQD5OeQQIwPUBpFqRO0pI +QsY3KRP2Ior3UH1XxHLDEIqeINeWwQJeWQClz4WzWZMjaF2jzKaPa8gW5bptMR4b +9D2KED+H+HOOmpwfdBirlrpIfCVc1XFCSP/FltUglD/yFa2grt57k7tF6Y642hBk +j2vI5GhthW3WsQl8YH3cX+9q8erE7igzvkWh0LP5gak55qzIFzkqUTqyUoi3EDit +XViraVpqTvEfE+PODejLFEFy/evnWFNcb8fQHQIDAQABAoIEAA0I5VwlapdnXzE4 +XsPjctnche8ZvHS1fIfTQQApwLPfilRZzoo8aHML+wob5asWyG51D+IsUCrIY2o7 +Lbn6kQYPD/JlT51DueQh49uJf85rz3eN48IJpMNB+Q0u40nBfZdUT8tgDPmqChQM +g0xaqJh1kWSUi3oTP58ZwM1xd6b+EEHwtTbNilvmQCUkpcOhjcBbvDVeaQUnupWV +k7snRhS1PNAkcp5kWgIavX9/vnv388lJZ57DVHEnlXS4nUlEeMMQxM1tg/GZzWIy ++Jari5NvaqD0qKaYJP56j6oKrNDg36kzEPJ+/jNG/TDgHzSURndepDJVyBXQ/AFh +utNbJH6EGTM/2RZVNZl2rvAPAUiFlDYXhCdNqVJdWLl3DNo1qeaJVbO26uDsY97P +ZfMqEXWbuA7FCUSg/UXS7ODB7ZMTfjwpyxMvVuCvzLzYxGfveTj1ecdRvq/vJQU0 +uZfFK5JLv9uK/v9QbAZ3S/T4GmkJ1CQEuHYDK4dI0aNW9YaYZ+IO3Uq7T0f/axmZ +kbRtfZIRo49MJitafUutOpAzpilpmax0xekRTkghY0H87VbTTvDHhgV7trL7YyMe +JzicGz0NPO4CygqaHxo/pn+O67mj5Ff9F2NjXZ96tKvI6KslmR1WaXBSqnajp24M +Pglk9DgG9neeAPI33XYFrHdEv/l/YzEr2W0rMcyYGTCHPGefwVAMzwAWhNo/XNh7 +EdfjSIa2sI3mkWZONlGaidPeLkdr2CBwH65AUbysufUpEMEtgE5bssoAZJMF3z7x +oA5Q5ZGVkv6issuviMCGBn688Cr2yekqEPx9hsGsBmt0JlTLmJCs3Z8M8SRu8VtK +72vGtPZf0SnUx68+hH03bahbfeu54IrY5pzdq5ubZMhr15YucWoVklARD4WRy8WX +ky//wxaObP5isJIl9yJLaibHI67Fw7OjAshMAeAbuLSS0xjkZVplsI3mMIB45Vvx +ZcThXQaDGO88XYJH79QyYz0AGnEztalXaNb6VZ6vkC7z3jWHmX4j5Uo9EKlJRwHm +nssv9GeoOQ8DAfsTW0ILFAosRvP0tJudJWosCaDeugMZ2xYQmynQOnsQkIqIEXxe +CiuJ8DurPP7V/Zb1MytYTYZzkbudguRBexu56Zoe54KrdrNApDmJlvyeyExvHkLI +t29h34UOOUwrHNxsRHSQm2App2ugVwvEeFaUZo0Lh4SZd4vsM1Y51FU8jRqklA95 +grZJ/34BQHgxC1m+oRZ5H704UCPSjQRJ3JSczgZe0OBCMniZ58e9MBX5AD1NHhax +WCq9Gt9AdYnOS+FMLnNkIrzbsVKrFDmRCdZLHdQuD0ZjpaqMCxK8HwUBNsDH5pEg +Sl4klqECggIBAOQZMykuDTw/1T9crXFw0mmd50lg0sDqoh2DrRgi3eSt5C3zobaf +yRKMszj1I/npqV2W5Ca8iwJxP2zYhZagmoAdXW8vzFKh95sxlJv8s7RJehfr/VmF +/h5+yhTLn2evSD6IGXj+FemD7Vwlbu6946KxxhOGBEnKAnUSlgJTUZY1AMpr5TB8 +n76evlfdrCAdll2AUfnOQgHfwc0X41Hn6ephHNv5ryK12td2GaX7CZIJOh2U1bgd +zPtej/GAPSrb0EPkKhUQVwptJlkEuBVmYhGae6xDCMdKlZc7UEX93IKU8HSr4X5x +a6k+Q1gtkAtERY2VNeUK4WFF7g0Eoxsnzij6zn2U7jby3Z5I6vO6ZU2Ba41ShYUy +/K/NOJWxldL88GBLdfLAcL1k9WkHP0pubOMAoJz8GYu2Ti/HQioLxtMJqswFZct5 +i+ea/+GZP2GLHdgFvfIPAf3OKLFkpOxzLfX7K83oQuNMui8iAm3UTdidgG3Z9rMu +O/dfXkM8cByRYXpi4Sv9GN+do2bAQpwtVWAPWTdUhku3KL5DR600wxdNP9ZN/QBP +o5fVFptcXZCeO4x9DkGOQKIwydJX0Ys/twuebzc8ex/QgjBgEdfvdecciHx9CETv +qRWsXJeDY1W3grAUcoE47qxhI4lD7AEU7QrfyU1rKGLlVxMyCfeDWHUpAoICAQDk +ANClZ88mk7A4oudtADWJIWfuYekOmxdaXZzdtkvMgbnuTAWGAwqzMKi3kMkEjB48 ++24dmnfUaa0k4/X+yCCBw051nrhmFXahrwKh1CCUjg0/lyF03lrW4Hd73+QK8qFU +wEnEqWUZB1O2G7jvKkohkUC2h3SaC0r3EcaMtgd0yMFffo1ikVjPc+Ni71gNgDKS +/wpjajZ9u8gdZEpL74NQPG5SjiioCc/zgujkihZnVxxHoUvWFb/N86LUw8gZEYyX +Zfn08dyhXHpVaqppvIqfLjQFaun9e5UVN0/U8If+orc5KMu9i8uYr9v1KrnR5czp +033CyMxeobfNcK033JHvdHINEqU1tUDBV8BfYYMPemDECrjMRiClLyHPqwe3vXVU +7Mc+b1VB9FzCEY/B3xvxJqdgC/6nMJazkiw3cWrZsP381i7iYiLW2mVDqXBVNH8c +0qgTZ4Nd8SPJm5BcpLtal22GCepIufjVoxSA62JTA4Yh+0tIn13zujsXHJdB6D1E +nyV9/sTkzezC6J9AokHch3B1eOFaROow3LSe5JXxrmp2cj8Tc/lssAEXDFIefIjh +EIzzbbGoLrp5YqHpf8ndFcTeidlXWVXdzhtMZnJc/Oa081lSA5zi180KjiJ5/ROc +KSyrbAL638wB1HnxPMZTPEvTje5mm0/FDLnPMYlN1QKCAgEApamfvLLTrgR2bpRy +68cTKt4iEusdZjuDDoiJ+NOp8OJSrQUbWDXopW5G5IE2ZdXMykpC3ddl5po1hGol +a+atD4tERvKiJQm5eZ+i3T/FjJUo9aLR2Gk2zRMs1bmlxnpJsBDM31E6vOSySZBu +ZzrGz2zp/VgCWU08R6b+CCZXRQ6tylZemL6KjrlgaRR4ZMLYaIRABXxF+HJ4oOpO +kTgsbaumeCV5i24kyQPfUOtoYgYNjVqBdj0+mPpu9Ok8g5ouQoC+B5pcfRgVF+YT +hIddhod6dvwgrg1/Y90SSiM8OiLOGQ6UsW7S0JKF+s7spSIqmc/a2sTyN+HAKPhL +NffNBXpS6mZ2NLZjOwiei/G+jXIHmRZsHvePCme0RxQ5SommU2m6+lnGB+gBTQyU +bQySTLQx8pIuQ4hedNj1NvBisPd+crsg2Y0njUjHuyPAIqoVPMW+1MUNnzZR27TL +C2gD43lOsTeVDNy3BHBg7z+YYlDR6/a39B8KMnmzToXgrv7vmyGhhH9Hx3EIMiJE +voU2UpQTKdpbxzX5g2X98tA1OQFD8fOmYsl0eVusFZ4Z3mTtvvU8m2QjkSh6DCj3 +6XiXCvtArw9gJRUc2OGNVBV4vie9AR0WGmstlK4geXJVfPXRFu1i1HNy9QN/+bu4 +9ngqSRGLdIz1Qg5rFWfsUTW10zECggIASjbJs0067D+eWJEN6zjqNByfi8Rq68on +q85UxQYVXhfLwXkVQy2ySelIwZdrFwPUw9zDVvd0kbtkFGHvLGNP0W0VGMv1EaVi +2/XvUWWOxUwHm+9BgJzvzIl72uJhg/697Kw6Vr0cnyz3XotfgtmtD4gMHF2y4oFS +gWFT03Fcs/K0nrS+qJrO4ZfDJ+zoKFzWGWrSotFrszlwRcDjPhxUDcXd0xlauneX +LJgr3lfkOvbryZUC7kheCleHZOHlO+Ouc4lJ9yTSv+MuHqd9mLU6Gd4cKLdIOq4D +NMiwP4ubeJLWONDCoIvkVWrImeCyY1P9gw7IHKLngtX40fIfL9On3N12UjMDe5vn +3AcIIwPGeT9ISAeFZ1hcP+g7hTESbghJLL91iykKA1Ha74Bv3pcUrUX7rRO6bAkw +xHqL0fAk637k7Wt6D04KMQ0dcQyx98oCpgsbklVbOTTIhVMRhlZIdZBcogiQLeP6 +zu8qOVxkwMig3GbDdnwJRNAVc8xmn5lMeA2lUoGe7SrqKfc1/v/RmEqtnE8gaxWL +dSQh1qZo+CXhmXROe7KAOZSAhlQIVswKcdfFSWcnMKslH2WvdiWWO1RepGESUZBO +lsgDsraV+xaGsdeT91IduuirYQgqyLJLs8TjOVkLD0XRTbcvigpSM72ooM/ODa/4 +IxelU3+4RZECggIABs/TvVsFlwvVE1Ztf7WClCi7lZ3+y+6RNr3LpCDUwroEFkjj +lB0KHkJvXjvPYWiNswfw7fPpImvUdTxbZMp0ezjVf0rT/4fTyrPIt75jnJAGiV4L +A9+rjfRouItDfwnnpvFqx24u4kQb1LFKcH6kiMRhqj4g1ws/EkldXzFk9yVVW51I +ak3hNHHvfdlMITTJEUyePlNL/SqZAJPo8u6YZ4FBWh7xYmp20DCNmLzvLxDkSCUj +yNz54+d7Ca2wwrIARl8O2pSwjxC4s7QcdUTP36SGwmXx+aoIcUbpB1zm5oQrM11W +q+LlJHPHA4oDCfg+uUqPfQpVkvrEceSpZ+7wipzeo+dXfmjxAucOVVA0PIZ/n+2g +VVY7YiNlbHVnD4uN/IHgS08hlOZjYCPfmyX0S38oBjusjsX1541cLlzOraCIa3A2 +km93pWKSJa4+KztNdbmkNW8xXui65E1GWgKlCTv///hXU1JsPVQtQZtWXQyhLYCm +ceAWiJUOYnxd8uXQ7rbttAYFWy7AvcUo4RKsGi4q/H+Fw/kMUvMkjjfebJp4O1Xy +q07+bPveyxZauzpzOb7PcHMFqvmm03bY5Dt80hh2pfG6n0K1E2pFVNA8NY087j9Y +tZcG7uDHU2erOFP3h0B6iwhvDj3znu859BzBIW4oaz/RKepIpkFTL0wwPGs= -----END RSA PRIVATE KEY----- diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index d5fbde1d9d4..0e1277e5b82 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -15,8 +15,8 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; -- cgit v1.2.1 From dba93629b67984b03daeebe8b2867f74d685fc5f Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 1 Apr 2015 07:25:04 -0400 Subject: DB-834 check table reports the corrupt index name --- storage/tokudb/ha_tokudb_admin.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/storage/tokudb/ha_tokudb_admin.cc b/storage/tokudb/ha_tokudb_admin.cc index b109cd1b976..42205c6d6be 100644 --- a/storage/tokudb/ha_tokudb_admin.cc +++ b/storage/tokudb/ha_tokudb_admin.cc @@ -121,9 +121,10 @@ static int analyze_progress(void *v_extra, uint64_t rows) { progress_time = (float) (t_now - t_start) / (float) t_limit; char *write_status_msg = extra->write_status_msg; TABLE_SHARE *table_share = extra->table_share; - sprintf(write_status_msg, "%s.%s.%s %u of %u %.lf%% rows %.lf%% time", - table_share->db.str, table_share->table_name.str, extra->key_name, - extra->key_i, table_share->keys, progress_rows * 100.0, progress_time * 100.0); + sprintf(write_status_msg, "%.*s.%.*s.%s %u of %u %.lf%% rows %.lf%% time", + (int) table_share->db.length, table_share->db.str, + (int) table_share->table_name.length, table_share->table_name.str, + extra->key_name, extra->key_i, table_share->keys, progress_rows * 100.0, progress_time * 100.0); thd_proc_info(thd, write_status_msg); return 0; } @@ -338,8 +339,10 @@ static int ha_tokudb_check_progress(void *extra, float progress) { static void ha_tokudb_check_info(THD *thd, TABLE *table, const char *msg) { if (thd->vio_ok()) { - char tablename[256]; - snprintf(tablename, sizeof tablename, "%s.%s", table->s->db.str, table->s->table_name.str); + char tablename[table->s->db.length + 1 + table->s->table_name.length + 1]; + snprintf(tablename, sizeof tablename, "%.*s.%.*s", + (int) table->s->db.length, table->s->db.str, + (int) table->s->table_name.length, table->s->table_name.str); thd->protocol->prepare_for_resend(); thd->protocol->store(tablename, strlen(tablename), system_charset_info); thd->protocol->store("check", 5, system_charset_info); @@ -388,6 +391,11 @@ int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) { } struct check_context check_context = { thd }; r = db->verify_with_progress(db, ha_tokudb_check_progress, &check_context, (tokudb_debug & TOKUDB_DEBUG_CHECK) != 0, keep_going); + if (r != 0) { + char msg[32 + strlen(kname)]; + sprintf(msg, "Corrupt %s", kname); + ha_tokudb_check_info(thd, table, msg); + } snprintf(write_status_msg, sizeof write_status_msg, "%s key=%s %u result=%d", share->table_name, kname, i, r); thd_proc_info(thd, write_status_msg); if (tokudb_debug & TOKUDB_DEBUG_CHECK) { -- cgit v1.2.1 From 009c8a4bfd26d850bee44e5fb84eb688709c5e94 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 1 Apr 2015 08:15:22 -0400 Subject: FT-647 fix a race between the scoped malloc module destructor and the stack destructor --- util/scoped_malloc.cc | 25 ++++++-- util/scoped_malloc.h | 4 ++ util/tests/sm-basic.cc | 127 ++++++++++++++++++++++++++++++++++++ util/tests/sm-crash-double-free.cc | 128 +++++++++++++++++++++++++++++++++++++ 4 files changed, 278 insertions(+), 6 deletions(-) create mode 100644 util/tests/sm-basic.cc create mode 100644 util/tests/sm-crash-double-free.cc diff --git a/util/scoped_malloc.cc b/util/scoped_malloc.cc index 551bd944beb..15d4fb3e52e 100644 --- a/util/scoped_malloc.cc +++ b/util/scoped_malloc.cc @@ -145,6 +145,9 @@ namespace toku { } void destroy() { +#if TOKU_SCOPED_MALLOC_DEBUG + printf("%s %p %p\n", __FUNCTION__, this, m_stack); +#endif if (m_stack != NULL) { toku_free(m_stack); m_stack = NULL; @@ -167,13 +170,17 @@ namespace toku { static void destroy_and_deregister(void *key) { invariant_notnull(key); tl_stack *st = reinterpret_cast(key); - st->destroy(); + size_t n = 0; toku_mutex_lock(&global_stack_set_mutex); - invariant_notnull(global_stack_set); - size_t n = global_stack_set->erase(st); - invariant(n == 1); + if (global_stack_set) { + n = global_stack_set->erase(st); + } toku_mutex_unlock(&global_stack_set_mutex); + + if (n == 1) { + st->destroy(); // destroy the stack if this function erased it from the set. otherwise, somebody else destroyed it. + } } // Allocate 'size' bytes and return a pointer to the first byte @@ -244,6 +251,11 @@ void toku_scoped_malloc_init(void) { } void toku_scoped_malloc_destroy(void) { + toku_scoped_malloc_destroy_key(); + toku_scoped_malloc_destroy_set(); +} + +void toku_scoped_malloc_destroy_set(void) { toku_mutex_lock(&toku::global_stack_set_mutex); invariant_notnull(toku::global_stack_set); // Destroy any tl_stacks that were registered as thread locals but did not @@ -254,10 +266,11 @@ void toku_scoped_malloc_destroy(void) { (*i)->destroy(); } delete toku::global_stack_set; + toku::global_stack_set = nullptr; toku_mutex_unlock(&toku::global_stack_set_mutex); +} - // We're deregistering the destructor key here. When this thread exits, - // the tl_stack destructor won't get called, so we need to do that first. +void toku_scoped_malloc_destroy_key(void) { int r = pthread_key_delete(toku::tl_stack_destroy_pthread_key); invariant_zero(r); } diff --git a/util/scoped_malloc.h b/util/scoped_malloc.h index dbd919d155e..0233b0f1aa5 100644 --- a/util/scoped_malloc.h +++ b/util/scoped_malloc.h @@ -151,3 +151,7 @@ void toku_scoped_malloc_init(void); void toku_scoped_malloc_destroy(void); +void toku_scoped_malloc_destroy_set(void); + +void toku_scoped_malloc_destroy_key(void); + diff --git a/util/tests/sm-basic.cc b/util/tests/sm-basic.cc new file mode 100644 index 00000000000..5df64294721 --- /dev/null +++ b/util/tests/sm-basic.cc @@ -0,0 +1,127 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +// test that basic scoped malloc works with a thread + +#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." +#include +#include +#include +#include + +static void sm_test(void) { + toku::scoped_malloc a(1); + { + toku::scoped_malloc b(2); + { + toku::scoped_malloc c(3); + } + } +} + +static void *sm_test_f(void *arg) { + sm_test(); + return arg; +} + +int main(void) { + toku_scoped_malloc_init(); + + // run the test + toku_pthread_t tid; + int r; + r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); + assert_zero(r); + void *ret; + r = toku_pthread_join(tid, &ret); + assert_zero(r); + + toku_scoped_malloc_destroy(); + + return 0; +} diff --git a/util/tests/sm-crash-double-free.cc b/util/tests/sm-crash-double-free.cc new file mode 100644 index 00000000000..653d4148fd0 --- /dev/null +++ b/util/tests/sm-crash-double-free.cc @@ -0,0 +1,128 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +// force a race between the scoped malloc global destructor and a thread variable destructor + +#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." +#define TOKU_SCOPED_MALLOC_DEBUG 1 +#include +#include +#include +#include +#include + +volatile int state = 0; + +static void sm_test(void) { + toku::scoped_malloc a(1); +} + +static void *sm_test_f(void *arg) { + sm_test(); + state = 1; + while (state != 2) sleep(1); + return arg; +} + +int main(void) { + TOKU_VALGRIND_HG_DISABLE_CHECKING(&state, sizeof state); + state = 0; + toku_scoped_malloc_init(); + toku_pthread_t tid; + int r; + r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); + assert_zero(r); + void *ret; + while (state != 1) sleep(1); + toku_scoped_malloc_destroy_set(); + state = 2; + r = toku_pthread_join(tid, &ret); + assert_zero(r); + toku_scoped_malloc_destroy_key(); + return 0; +} -- cgit v1.2.1 From c8b7fd67e46ba46133011eba700ad13bb4385c0d Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Wed, 1 Apr 2015 15:05:03 -0400 Subject: DB-833 print recovery progress of commits and aborts --- ft/logger/recover.cc | 62 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/ft/logger/recover.cc b/ft/logger/recover.cc index cdd706cdce1..2714c9a7422 100644 --- a/ft/logger/recover.cc +++ b/ft/logger/recover.cc @@ -109,7 +109,8 @@ int tokuft_recovery_trace = 0; // turn on recovery tracing, d #endif // time in seconds between recovery progress reports -#define TOKUDB_RECOVERY_PROGRESS_TIME 15 +#define TOKUFT_RECOVERY_PROGRESS_TIME 15 +time_t tokuft_recovery_progress_time = TOKUFT_RECOVERY_PROGRESS_TIME; enum ss { BACKWARD_NEWER_CHECKPOINT_END = 1, @@ -323,14 +324,12 @@ static int recover_env_init (RECOVER_ENV renv, } static void recover_env_cleanup (RECOVER_ENV renv) { - int r; - invariant_zero(renv->fmap.filenums->size()); file_map_destroy(&renv->fmap); if (renv->destroy_logger_at_end) { toku_logger_close_rollback(renv->logger); - r = toku_logger_close(&renv->logger); + int r = toku_logger_close(&renv->logger); assert(r == 0); } else { toku_logger_write_log_files(renv->logger, true); @@ -747,6 +746,36 @@ static int toku_recover_backward_xbegin (struct logtype_xbegin *UU(l), RECOVER_E return 0; } +struct toku_txn_progress_extra { + time_t tlast; + LSN lsn; + const char *type; + TXNID_PAIR xid; + uint64_t last_total; +}; + +static void toku_recover_txn_progress(TOKU_TXN_PROGRESS txn_progress, void *extra) { + toku_txn_progress_extra *txn_progress_extra = static_cast(extra); + if (txn_progress_extra->last_total == 0) + txn_progress_extra->last_total = txn_progress->entries_total; + else + assert(txn_progress_extra->last_total == txn_progress->entries_total); + time_t tnow = time(NULL); + if (tnow - txn_progress_extra->tlast >= tokuft_recovery_progress_time) { + txn_progress_extra->tlast = tnow; + fprintf(stderr, "%.24s TokuFT ", ctime(&tnow)); + if (txn_progress_extra->lsn.lsn != 0) + fprintf(stderr, "lsn %" PRIu64 " ", txn_progress_extra->lsn.lsn); + fprintf(stderr, "%s xid %" PRIu64 ":%" PRIu64 " ", + txn_progress_extra->type, txn_progress_extra->xid.parent_id64, txn_progress_extra->xid.child_id64); + fprintf(stderr, "%" PRIu64 "/%" PRIu64 " ", + txn_progress->entries_processed, txn_progress->entries_total); + if (txn_progress->entries_total > 0) + fprintf(stderr, "%.0f%% ", ((double) txn_progress->entries_processed / (double) txn_progress->entries_total) * 100.0); + fprintf(stderr, "\n"); + } +} + static int toku_recover_xcommit (struct logtype_xcommit *l, RECOVER_ENV renv) { // find the transaction by transaction id TOKUTXN txn = NULL; @@ -754,8 +783,8 @@ static int toku_recover_xcommit (struct logtype_xcommit *l, RECOVER_ENV renv) { assert(txn!=NULL); // commit the transaction - int r = toku_txn_commit_with_lsn(txn, true, l->lsn, - NULL, NULL); + toku_txn_progress_extra extra = { time(NULL), l->lsn, "commit", l->xid }; + int r = toku_txn_commit_with_lsn(txn, true, l->lsn, toku_recover_txn_progress, &extra); assert(r == 0); // close the transaction @@ -797,7 +826,8 @@ static int toku_recover_xabort (struct logtype_xabort *l, RECOVER_ENV renv) { assert(txn!=NULL); // abort the transaction - r = toku_txn_abort_with_lsn(txn, l->lsn, NULL, NULL); + toku_txn_progress_extra extra = { time(NULL), l->lsn, "abort", l->xid }; + r = toku_txn_abort_with_lsn(txn, l->lsn, toku_recover_txn_progress, &extra); assert(r == 0); // close the transaction @@ -1299,7 +1329,6 @@ static int is_txn_unprepared(TOKUTXN txn, void* extra) { return 0; } - static int find_an_unprepared_txn (RECOVER_ENV renv, TOKUTXN *txnp) { TOKUTXN txn = nullptr; int r = toku_txn_manager_iter_over_live_root_txns( @@ -1324,6 +1353,7 @@ static int call_prepare_txn_callback_iter(TOKUTXN txn, void* extra) { } static void recover_abort_live_txn(TOKUTXN txn) { + fprintf(stderr, "%s %" PRIu64 "\n", __FUNCTION__, txn->txnid.parent_id64); // recursively abort all children first if (txn->child != NULL) { recover_abort_live_txn(txn->child); @@ -1331,7 +1361,8 @@ static void recover_abort_live_txn(TOKUTXN txn) { // sanity check that the recursive call successfully NULLs out txn->child invariant(txn->child == NULL); // abort the transaction - int r = toku_txn_abort_txn(txn, NULL, NULL); + toku_txn_progress_extra extra = { time(NULL), ZERO_LSN, "abort live", txn->txnid }; + int r = toku_txn_abort_txn(txn, toku_recover_txn_progress, &extra); assert(r == 0); // close the transaction @@ -1449,9 +1480,10 @@ static int do_recovery(RECOVER_ENV renv, const char *env_dir, const char *log_di // trace progress if ((i % 1000) == 0) { tnow = time(NULL); - if (tnow - tlast >= TOKUDB_RECOVERY_PROGRESS_TIME) { + if (tnow - tlast >= tokuft_recovery_progress_time) { thislsn = toku_log_entry_get_lsn(le); - fprintf(stderr, "%.24s TokuFT recovery scanning backward from %" PRIu64 " at %" PRIu64 " (%s)\n", ctime(&tnow), lastlsn.lsn, thislsn.lsn, recover_state(renv)); + fprintf(stderr, "%.24s TokuFT recovery scanning backward from %" PRIu64 " at %" PRIu64 " (%s)\n", + ctime(&tnow), lastlsn.lsn, thislsn.lsn, recover_state(renv)); tlast = tnow; } } @@ -1480,16 +1512,18 @@ static int do_recovery(RECOVER_ENV renv, const char *env_dir, const char *log_di assert(le); thislsn = toku_log_entry_get_lsn(le); tnow = time(NULL); - fprintf(stderr, "%.24s TokuFT recovery starts scanning forward to %" PRIu64 " from %" PRIu64 " left %" PRIu64 " (%s)\n", ctime(&tnow), lastlsn.lsn, thislsn.lsn, lastlsn.lsn - thislsn.lsn, recover_state(renv)); + fprintf(stderr, "%.24s TokuFT recovery starts scanning forward to %" PRIu64 " from %" PRIu64 " left %" PRIu64 " (%s)\n", + ctime(&tnow), lastlsn.lsn, thislsn.lsn, lastlsn.lsn - thislsn.lsn, recover_state(renv)); for (unsigned i=0; 1; i++) { // trace progress if ((i % 1000) == 0) { tnow = time(NULL); - if (tnow - tlast >= TOKUDB_RECOVERY_PROGRESS_TIME) { + if (tnow - tlast >= tokuft_recovery_progress_time) { thislsn = toku_log_entry_get_lsn(le); - fprintf(stderr, "%.24s TokuFT recovery scanning forward to %" PRIu64 " at %" PRIu64 " left %" PRIu64 " (%s)\n", ctime(&tnow), lastlsn.lsn, thislsn.lsn, lastlsn.lsn - thislsn.lsn, recover_state(renv)); + fprintf(stderr, "%.24s TokuFT recovery scanning forward to %" PRIu64 " at %" PRIu64 " left %" PRIu64 " (%s)\n", + ctime(&tnow), lastlsn.lsn, thislsn.lsn, lastlsn.lsn - thislsn.lsn, recover_state(renv)); tlast = tnow; } } -- cgit v1.2.1 From e1dc36248c4caaf7980240f22207deed5acae320 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Sun, 5 Apr 2015 15:15:40 -0400 Subject: DB-811 run tests on mariadb --- mysql-test/suite/tokudb.bugs/t/db811.test | 1 + mysql-test/suite/tokudb.bugs/t/db811s.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/tokudb.bugs/t/db811.test b/mysql-test/suite/tokudb.bugs/t/db811.test index 70267743e4e..509f482765e 100644 --- a/mysql-test/suite/tokudb.bugs/t/db811.test +++ b/mysql-test/suite/tokudb.bugs/t/db811.test @@ -2,6 +2,7 @@ source include/have_tokudb.inc; source include/have_innodb.inc; +source include/have_partition.inc; disable_warnings; drop table if exists t2,t3,t4; enable_warnings; diff --git a/mysql-test/suite/tokudb.bugs/t/db811s.test b/mysql-test/suite/tokudb.bugs/t/db811s.test index 57acd21dbc4..5b8c6ed79d3 100644 --- a/mysql-test/suite/tokudb.bugs/t/db811s.test +++ b/mysql-test/suite/tokudb.bugs/t/db811s.test @@ -2,6 +2,7 @@ source include/have_tokudb.inc; source include/have_innodb.inc; +source include/have_partition.inc; disable_warnings; drop table if exists t2,t3,t4; enable_warnings; -- cgit v1.2.1 From 232d8bbdb165260ba8eca51565067a93659bea6f Mon Sep 17 00:00:00 2001 From: aditya Date: Mon, 6 Apr 2015 12:27:12 +0530 Subject: Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE WRONG FOR PARTITIONED TABLES PROBLEM Create time is calculated as last status change time of .frm file. The first problem was that innodb was passing file name as "table_name#po#p0.frm" to the stat() call which calculates the create time. Since there is no frm file with this name create_time will be stored as NULL. The second problem is ha_partition::info() updates stats for create time when HA_STATUS_CONST flag was set ,where as innodb calculates this statistic when HA_STATUS_TIME is set,which causes create_time to be set as NULL. Fix Pass proper .frm name to stat() call and calculate create time when HA_STATUS_CONST flag is set. --- mysql-test/r/partition_innodb.result | 23 +++++++++++++++++------ mysql-test/t/partition_innodb.test | 24 ++++++++++++++++++------ storage/innobase/handler/ha_innodb.cc | 25 ++++++++++++++----------- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 516d824b343..f2f66a86c7d 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -365,33 +365,33 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by key (a) @@ -572,3 +572,14 @@ a b 1 2 0 1 DROP TABLE t1; +# +# Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +# WRONG FOR PARTITIONED TABLES +# +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; +COUNT(*) +1 +DROP TABLE t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index ceb06cb2f12..a290edf9094 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -387,7 +387,7 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status like 't1'; drop table t1; @@ -399,12 +399,12 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (0), (1), (2), (3); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -413,17 +413,17 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -660,3 +660,15 @@ ALTER TABLE t1 ADD UNIQUE KEY (b); SHOW CREATE TABLE t1; SELECT * FROM t1; DROP TABLE t1; +--echo # +--echo # Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +--echo # WRONG FOR PARTITIONED TABLES +--echo # + +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; + +DROP TABLE t1; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6ec7586779a..b8ec8f60f28 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8172,17 +8172,6 @@ ha_innobase::info_low( prebuilt->trx->op_info = "returning various info to MySQL"; } - my_snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, ib_table->name, reg_ext); - - unpack_filename(path,path); - - /* Note that we do not know the access time of the table, - nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ - - if (os_file_get_status(path,&stat_info)) { - stats.create_time = (ulong) stat_info.ctime; - } } if (flag & HA_STATUS_VARIABLE) { @@ -8379,6 +8368,20 @@ ha_innobase::info_low( } dict_table_stats_unlock(ib_table, RW_S_LATCH); + + my_snprintf(path, sizeof(path), "%s/%s%s", + mysql_data_home, + table->s->normalized_path.str, + reg_ext); + + unpack_filename(path,path); + + /* Note that we do not know the access time of the table, + nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ + + if (os_file_get_status(path,&stat_info)) { + stats.create_time = (ulong) stat_info.ctime; + } } if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { -- cgit v1.2.1 From e65f3f6f2e35d92fd1395f7c5b02184c739c5fc7 Mon Sep 17 00:00:00 2001 From: Nisha Date: Mon, 6 Apr 2015 14:12:15 +0530 Subject: BUG#20754369: BACKPORT BUG#20007583 TO 5.1 Backporting the patch to 5.1 and 5.5 --- sql/sql_show.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2ee074db884..970301f15a2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1828,7 +1828,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) Security_context *tmp_sctx= tmp->security_ctx; struct st_my_thread_var *mysys_var; if ((tmp->vio_ok() || tmp->system_thread) && - (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user)))) + (!user || (!tmp->system_thread && tmp_sctx->user && + !strcmp(tmp_sctx->user, user)))) { thread_info *thd_info= new thread_info; @@ -1940,7 +1941,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) const char *val, *db; if ((!tmp->vio_ok() && !tmp->system_thread) || - (user && (!tmp_sctx->user || strcmp(tmp_sctx->user, user)))) + (user && (tmp->system_thread || !tmp_sctx->user || + strcmp(tmp_sctx->user, user)))) continue; restore_record(table, s->default_values); -- cgit v1.2.1 From 868c587296f1e6a4f91eb7d8fa59fb41ff48077b Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Mon, 6 Apr 2015 16:06:47 -0400 Subject: DB-832 capture txn start time and make it available to the txn object and live txn iterator Conflicts: ft/txn/txn.cc --- buildheader/make_tdb.cc | 3 ++- ft/txn/txn.cc | 5 +++++ ft/txn/txn.h | 3 +++ src/tests/test_iterate_live_transactions.cc | 4 +++- src/tests/test_stress0.cc | 4 +++- src/ydb.cc | 3 +-- src/ydb_txn.cc | 6 ++++++ 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/buildheader/make_tdb.cc b/buildheader/make_tdb.cc index 3f9a721d9aa..53706649231 100644 --- a/buildheader/make_tdb.cc +++ b/buildheader/make_tdb.cc @@ -587,6 +587,7 @@ static void print_db_txn_struct (void) { "uint64_t (*get_client_id)(DB_TXN *)", "bool (*is_prepared)(DB_TXN *)", "DB_TXN *(*get_child)(DB_TXN *)", + "uint64_t (*get_start_time)(DB_TXN *)", NULL}; sort_and_dump_fields("db_txn", false, extra); } @@ -786,7 +787,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) { printf("typedef void (*lock_timeout_callback)(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid);\n"); printf("typedef int (*iterate_row_locks_callback)(DB **db, DBT *left_key, DBT *right_key, void *extra);\n"); - printf("typedef int (*iterate_transactions_callback)(uint64_t txnid, uint64_t client_id, iterate_row_locks_callback cb, void *locks_extra, void *extra);\n"); + printf("typedef int (*iterate_transactions_callback)(DB_TXN *dbtxn, iterate_row_locks_callback cb, void *locks_extra, void *extra);\n"); printf("typedef int (*iterate_requests_callback)(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid, uint64_t start_time, void *extra);\n"); print_db_env_struct(); print_db_key_range_struct(); diff --git a/ft/txn/txn.cc b/ft/txn/txn.cc index baff44a6ba1..f14dd04019f 100644 --- a/ft/txn/txn.cc +++ b/ft/txn/txn.cc @@ -342,6 +342,7 @@ static txn_child_manager tcm; .state = TOKUTXN_LIVE, .num_pin = 0, .client_id = 0, + .start_time = time(NULL), }; TOKUTXN result = NULL; @@ -785,6 +786,10 @@ void toku_txn_set_client_id(TOKUTXN txn, uint64_t client_id) { txn->client_id = client_id; } +time_t toku_txn_get_start_time(struct tokutxn *txn) { + return txn->start_time; +} + int toku_txn_reads_txnid(TXNID txnid, TOKUTXN txn) { int r = 0; TXNID oldest_live_in_snapshot = toku_get_oldest_in_live_root_txn_list(txn); diff --git a/ft/txn/txn.h b/ft/txn/txn.h index 6381b5a7779..4f2778bf858 100644 --- a/ft/txn/txn.h +++ b/ft/txn/txn.h @@ -253,6 +253,7 @@ struct tokutxn { uint32_t num_pin; // number of threads (all hot indexes) that want this // txn to not transition to commit or abort uint64_t client_id; + time_t start_time; }; typedef struct tokutxn *TOKUTXN; @@ -368,6 +369,8 @@ bool toku_txn_has_spilled_rollback(struct tokutxn *txn); uint64_t toku_txn_get_client_id(struct tokutxn *txn); void toku_txn_set_client_id(struct tokutxn *txn, uint64_t client_id); +time_t toku_txn_get_start_time(struct tokutxn *txn); + // // This function is used by the leafentry iterators. // returns TOKUDB_ACCEPT if live transaction context is allowed to read a value diff --git a/src/tests/test_iterate_live_transactions.cc b/src/tests/test_iterate_live_transactions.cc index dd00ddeeb9a..c104c5c8541 100644 --- a/src/tests/test_iterate_live_transactions.cc +++ b/src/tests/test_iterate_live_transactions.cc @@ -104,9 +104,11 @@ struct iterate_extra { bool visited_txn[3]; }; -static int iterate_callback(uint64_t txnid, uint64_t client_id, +static int iterate_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { + uint64_t txnid = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); iterate_extra *info = reinterpret_cast(extra); DB *db; DBT left_key, right_key; diff --git a/src/tests/test_stress0.cc b/src/tests/test_stress0.cc index 5dbca08db48..26192d851aa 100644 --- a/src/tests/test_stress0.cc +++ b/src/tests/test_stress0.cc @@ -140,9 +140,11 @@ static int UU() iterate_pending_lock_requests_op(DB_TXN *UU(txn), ARG arg, void return r; } -static int iterate_txns(uint64_t txnid, uint64_t client_id, +static int iterate_txns(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { + uint64_t txnid = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); invariant_null(extra); invariant(txnid > 0); invariant(client_id == 0); diff --git a/src/ydb.cc b/src/ydb.cc index e61bf940175..5c0f3a4d1f9 100644 --- a/src/ydb.cc +++ b/src/ydb.cc @@ -2500,8 +2500,7 @@ static int iter_txns_callback(TOKUTXN txn, void *extra) { toku_pthread_rwlock_rdlock(&info->env->i->open_dbs_rwlock); iter_txn_row_locks_callback_extra e(info->env, &db_txn_struct_i(dbtxn)->lt_map); - const int r = info->callback(toku_txn_get_txnid(txn).parent_id64, - toku_txn_get_client_id(txn), + const int r = info->callback(dbtxn, iter_txn_row_locks_callback, &e, info->extra); diff --git a/src/ydb_txn.cc b/src/ydb_txn.cc index 2fac7ea3eec..d06a4b321c3 100644 --- a/src/ydb_txn.cc +++ b/src/ydb_txn.cc @@ -432,6 +432,11 @@ static DB_TXN *toku_txn_get_child(DB_TXN *txn) { return db_txn_struct_i(txn)->child; } +static uint64_t toku_txn_get_start_time(DB_TXN *txn) { + TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn; + return toku_txn_get_start_time(ttxn); +} + static inline void txn_func_init(DB_TXN *txn) { #define STXN(name) txn->name = locked_txn_ ## name STXN(abort); @@ -450,6 +455,7 @@ static inline void txn_func_init(DB_TXN *txn) { txn->id64 = toku_txn_id64; txn->is_prepared = toku_txn_is_prepared; txn->get_child = toku_txn_get_child; + txn->get_start_time = toku_txn_get_start_time; } // -- cgit v1.2.1 From c2bfc5b2d9d05114852a79a7764bd4e09d9c238b Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Mon, 6 Apr 2015 16:17:09 -0400 Subject: DB-832 add start time to tokudb_trx information schema table --- .../suite/tokudb/r/i_s_tokudb_lock_waits_released.result | 10 +++++----- .../suite/tokudb/r/i_s_tokudb_lock_waits_timeout.result | 6 +++--- mysql-test/suite/tokudb/r/i_s_tokudb_trx.result | 10 +++++----- .../suite/tokudb/t/i_s_tokudb_lock_waits_released.test | 10 +++++----- .../suite/tokudb/t/i_s_tokudb_lock_waits_timeout.test | 6 +++--- mysql-test/suite/tokudb/t/i_s_tokudb_trx.test | 10 +++++----- storage/tokudb/hatoku_hton.cc | 16 +++++++++++++--- 7 files changed, 39 insertions(+), 29 deletions(-) diff --git a/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result index 018900c7b98..190581eddae 100644 --- a/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result +++ b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result @@ -2,7 +2,7 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; create table t (id int primary key); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -31,7 +31,7 @@ select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name ERROR 23000: Duplicate entry '1' for key 'PRIMARY' commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -48,7 +48,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -59,7 +59,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_timeout.result b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_timeout.result index b9fca50b507..13cdad7a438 100644 --- a/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_timeout.result +++ b/mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_timeout.result @@ -2,7 +2,7 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; create table t (id int primary key); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name @@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TRX_ID MYSQL_ID TRX_ID MYSQL_ID @@ -30,7 +30,7 @@ select * from information_schema.tokudb_lock_waits; requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id select * from information_schema.tokudb_locks; locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name diff --git a/mysql-test/suite/tokudb/r/i_s_tokudb_trx.result b/mysql-test/suite/tokudb/r/i_s_tokudb_trx.result index e4c1adcca19..63e4816e16e 100644 --- a/mysql-test/suite/tokudb/r/i_s_tokudb_trx.result +++ b/mysql-test/suite/tokudb/r/i_s_tokudb_trx.result @@ -1,23 +1,23 @@ set default_storage_engine='tokudb'; set tokudb_prelock_empty=false; drop table if exists t; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id set autocommit=0; create table t (id int primary key); insert into t values (1); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TXN_ID_DEFAULT CLIENT_ID_DEFAULT commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id set autocommit=0; insert into t values (2); -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id TXN_ID_A CLIENT_ID_A commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; trx_id trx_mysql_thread_id drop table t; diff --git a/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test index f259c5fe6bc..bd2257fbaed 100644 --- a/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test +++ b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test @@ -13,7 +13,7 @@ create table t (id int primary key); # verify that txn_a insert (1) blocks txn_b insert (1) and txn_b gets a duplicate key error # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -41,7 +41,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; @@ -63,7 +63,7 @@ disconnect conn_b; # verify that the lock on the 2nd transaction has been released # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -91,7 +91,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; @@ -110,7 +110,7 @@ disconnect conn_b; # verify that the lock on the 2nd transaction has been released # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; diff --git a/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_timeout.test b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_timeout.test index d7925733a0f..06923d4ca58 100644 --- a/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_timeout.test +++ b/mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_timeout.test @@ -10,7 +10,7 @@ enable_warnings; create table t (id int primary key); # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; @@ -38,7 +38,7 @@ select * from information_schema.tokudb_lock_waits; # should find the presence of two transactions replace_column 1 TRX_ID 2 MYSQL_ID; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; sleep 5; # sleep longer than the lock timer to force a lock timeout on txn_b @@ -59,7 +59,7 @@ disconnect conn_a; disconnect conn_b; # should be be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; select * from information_schema.tokudb_locks; select * from information_schema.tokudb_lock_waits; diff --git a/mysql-test/suite/tokudb/t/i_s_tokudb_trx.test b/mysql-test/suite/tokudb/t/i_s_tokudb_trx.test index b1d5c7e5009..d3c2636ba54 100644 --- a/mysql-test/suite/tokudb/t/i_s_tokudb_trx.test +++ b/mysql-test/suite/tokudb/t/i_s_tokudb_trx.test @@ -8,7 +8,7 @@ drop table if exists t; enable_warnings; # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; # should have my txn let $default_id=`select connection_id()`; @@ -16,11 +16,11 @@ set autocommit=0; create table t (id int primary key); insert into t values (1); replace_column 1 TXN_ID_DEFAULT 2 CLIENT_ID_DEFAULT; -eval select * from information_schema.tokudb_trx; +eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; # should be empty commit; -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connect(conn_a,localhost,root,,); let a_id=`select connection_id()`; @@ -29,13 +29,13 @@ insert into t values (2); connection default; replace_column 1 TXN_ID_A 2 CLIENT_ID_A; -eval select * from information_schema.tokudb_trx; +eval select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; connection conn_a; commit; connection default; # should be empty -select * from information_schema.tokudb_trx; +select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx; disconnect conn_a; diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index b8d48b47e58..740074bdf2f 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -1991,7 +1991,9 @@ struct tokudb_search_txn_extra { uint64_t match_client_id; }; -static int tokudb_search_txn_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { +static int tokudb_search_txn_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { + uint64_t txn_id = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); struct tokudb_search_txn_extra *e = reinterpret_cast(extra); if (e->match_txn_id == txn_id) { e->match_found = true; @@ -2123,6 +2125,7 @@ static struct st_mysql_information_schema tokudb_trx_information_schema = { MYSQ static ST_FIELD_INFO tokudb_trx_field_info[] = { {"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, + {"trx_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; @@ -2131,12 +2134,17 @@ struct tokudb_trx_extra { TABLE *table; }; -static int tokudb_trx_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { +static int tokudb_trx_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { + uint64_t txn_id = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); + uint64_t start_time = txn->get_start_time(txn); struct tokudb_trx_extra *e = reinterpret_cast(extra); THD *thd = e->thd; TABLE *table = e->table; table->field[0]->store(txn_id, false); table->field[1]->store(client_id, false); + uint64_t tnow = (uint64_t) time(NULL); + table->field[2]->store(tnow >= start_time ? tnow - start_time : 0, false); int error = schema_table_store_record(thd, table); if (!error && thd_killed(thd)) error = ER_QUERY_INTERRUPTED; @@ -2284,7 +2292,9 @@ struct tokudb_locks_extra { TABLE *table; }; -static int tokudb_locks_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { +static int tokudb_locks_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { + uint64_t txn_id = txn->id64(txn); + uint64_t client_id = txn->get_client_id(txn); struct tokudb_locks_extra *e = reinterpret_cast(extra); THD *thd = e->thd; TABLE *table = e->table; -- cgit v1.2.1 From 117f4c1276c03b4a99a67bbe6d2159895f820965 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Mon, 6 Apr 2015 19:52:46 -0400 Subject: DB-832 fix race with dbtxn initialization and live txn iterator --- src/ydb.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ydb.cc b/src/ydb.cc index 5c0f3a4d1f9..625c966b167 100644 --- a/src/ydb.cc +++ b/src/ydb.cc @@ -2490,23 +2490,21 @@ struct iter_txns_callback_extra { }; static int iter_txns_callback(TOKUTXN txn, void *extra) { + int r = 0; iter_txns_callback_extra *info = reinterpret_cast(extra); - DB_TXN *dbtxn = toku_txn_get_container_db_txn(txn); invariant_notnull(dbtxn); + if (db_txn_struct_i(dbtxn)->tokutxn == txn) { // make sure that the dbtxn is fully initialized + toku_mutex_lock(&db_txn_struct_i(dbtxn)->txn_mutex); + toku_pthread_rwlock_rdlock(&info->env->i->open_dbs_rwlock); - toku_mutex_lock(&db_txn_struct_i(dbtxn)->txn_mutex); - toku_pthread_rwlock_rdlock(&info->env->i->open_dbs_rwlock); - - iter_txn_row_locks_callback_extra e(info->env, &db_txn_struct_i(dbtxn)->lt_map); - const int r = info->callback(dbtxn, - iter_txn_row_locks_callback, - &e, - info->extra); + iter_txn_row_locks_callback_extra e(info->env, &db_txn_struct_i(dbtxn)->lt_map); + r = info->callback(dbtxn, iter_txn_row_locks_callback, &e, info->extra); - toku_pthread_rwlock_rdunlock(&info->env->i->open_dbs_rwlock); - toku_mutex_unlock(&db_txn_struct_i(dbtxn)->txn_mutex); + toku_pthread_rwlock_rdunlock(&info->env->i->open_dbs_rwlock); + toku_mutex_unlock(&db_txn_struct_i(dbtxn)->txn_mutex); + } return r; } -- cgit v1.2.1 From 981200b6ad5e8b0042cc51a7d4f53e491e57f8c8 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Mon, 6 Apr 2015 22:10:22 -0400 Subject: DB-831 rename to tokuft_logprint and install it --- tools/CMakeLists.txt | 9 ++-- tools/tdb_logprint.cc | 126 ----------------------------------------------- tools/tokuft_logprint.cc | 126 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+), 132 deletions(-) delete mode 100644 tools/tdb_logprint.cc create mode 100644 tools/tokuft_logprint.cc diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 50bc5b9e05a..f8b7e604bb1 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,6 +1,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO) -set(tools tokudb_dump tokuftdump tdb_logprint tdb-recover ftverify ba_replay) +set(tools tokudb_dump tokuftdump tokuft_logprint tdb-recover ftverify ba_replay) foreach(tool ${tools}) add_executable(${tool} ${tool}) add_dependencies(${tool} install_tdb_h) @@ -12,9 +12,6 @@ endforeach(tool) # link in math.h library just for this tool. target_link_libraries(ftverify m) -install( - TARGETS tokuftdump - DESTINATION bin - COMPONENT tokukv_tools - ) +install(TARGETS tokuftdump DESTINATION bin COMPONENT tokukv_tools) +install(TARGETS tokuft_logprint DESTINATION bin COMPONENT tokukv_tools) diff --git a/tools/tdb_logprint.cc b/tools/tdb_logprint.cc deleted file mode 100644 index 1dd7581b9f5..00000000000 --- a/tools/tdb_logprint.cc +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ident "$Id$" -/* -COPYING CONDITIONS NOTICE: - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation, and provided that the - following conditions are met: - - * Redistributions of source code must retain this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below). - - * Redistributions in binary form must reproduce this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below) in the documentation and/or other materials - provided with the distribution. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - -COPYRIGHT NOTICE: - - TokuFT, Tokutek Fractal Tree Indexing Library. - Copyright (C) 2007-2013 Tokutek, Inc. - -DISCLAIMER: - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -UNIVERSITY PATENT NOTICE: - - The technology is licensed by the Massachusetts Institute of - Technology, Rutgers State University of New Jersey, and the Research - Foundation of State University of New York at Stony Brook under - United States of America Serial No. 11/760379 and to the patents - and/or patent applications resulting from it. - -PATENT MARKING NOTICE: - - This software is covered by US Patent No. 8,185,551. - This software is covered by US Patent No. 8,489,638. - -PATENT RIGHTS GRANT: - - "THIS IMPLEMENTATION" means the copyrightable works distributed by - Tokutek as part of the Fractal Tree project. - - "PATENT CLAIMS" means the claims of patents that are owned or - licensable by Tokutek, both currently or in the future; and that in - the absence of this license would be infringed by THIS - IMPLEMENTATION or by using or running THIS IMPLEMENTATION. - - "PATENT CHALLENGE" shall mean a challenge to the validity, - patentability, enforceability and/or non-infringement of any of the - PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. - - Tokutek hereby grants to you, for the term and geographical scope of - the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, - irrevocable (except as stated in this section) patent license to - make, have made, use, offer to sell, sell, import, transfer, and - otherwise run, modify, and propagate the contents of THIS - IMPLEMENTATION, where such license applies only to the PATENT - CLAIMS. This grant does not include claims that would be infringed - only as a consequence of further modifications of THIS - IMPLEMENTATION. If you or your agent or licensee institute or order - or agree to the institution of patent litigation against any entity - (including a cross-claim or counterclaim in a lawsuit) alleging that - THIS IMPLEMENTATION constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any rights - granted to you under this License shall terminate as of the date - such litigation is filed. If you or your agent or exclusive - licensee institute or order or agree to the institution of a PATENT - CHALLENGE, then Tokutek may terminate any rights granted to you - under this License. -*/ - -#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved." -#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." - -/* Dump the log from stdin to stdout. */ - -#include "ft/log_header.h" -#include "ft/logger/logger.h" - -static void newmain (int count) { - int i; - uint32_t version; - int r = toku_read_and_print_logmagic(stdin, &version); - for (i=0; i!=count; i++) { - r = toku_logprint_one_record(stdout, stdin); - if (r==EOF) break; - if (r!=0) { - fflush(stdout); - fprintf(stderr, "Problem in log err=%d\n", r); - exit(1); - } - } -} - -int main (int argc, char *const argv[]) { - int count=-1; - while (argc>1) { - if (strcmp(argv[1], "--oldcode")==0) { - fprintf(stderr,"Old code no longer works.\n"); - exit(1); - } else { - count = atoi(argv[1]); - } - argc--; argv++; - } - newmain(count); - return 0; -} - diff --git a/tools/tokuft_logprint.cc b/tools/tokuft_logprint.cc new file mode 100644 index 00000000000..1dd7581b9f5 --- /dev/null +++ b/tools/tokuft_logprint.cc @@ -0,0 +1,126 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved." +#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." + +/* Dump the log from stdin to stdout. */ + +#include "ft/log_header.h" +#include "ft/logger/logger.h" + +static void newmain (int count) { + int i; + uint32_t version; + int r = toku_read_and_print_logmagic(stdin, &version); + for (i=0; i!=count; i++) { + r = toku_logprint_one_record(stdout, stdin); + if (r==EOF) break; + if (r!=0) { + fflush(stdout); + fprintf(stderr, "Problem in log err=%d\n", r); + exit(1); + } + } +} + +int main (int argc, char *const argv[]) { + int count=-1; + while (argc>1) { + if (strcmp(argv[1], "--oldcode")==0) { + fprintf(stderr,"Old code no longer works.\n"); + exit(1); + } else { + count = atoi(argv[1]); + } + argc--; argv++; + } + newmain(count); + return 0; +} + -- cgit v1.2.1 From 195062883527917fc50c6fba5aaed201b8fe4446 Mon Sep 17 00:00:00 2001 From: aditya Date: Tue, 7 Apr 2015 09:56:28 +0530 Subject: Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE WRONG FOR PARTITIONED TABLES Posty push fix for test case --- mysql-test/suite/parts/r/partition_debug_sync_innodb.result | 11 +++++++---- mysql-test/suite/parts/t/partition_debug_sync_innodb.test | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result index 268db30bda0..77129d6bebb 100644 --- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -58,7 +58,10 @@ t1.frm t1.par SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, +PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; SET DEBUG_SYNC = 'now WAIT_FOR parked'; # When waiting for the name lock in get_all_tables in sql_show.cc # this will not be concurrent any more, thus the TIMEOUT @@ -70,9 +73,9 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO PARTITION p10 VALUES LESS THAN MAXVALUE); Warnings: Warning 1639 debug sync point wait timed out -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL -def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS +test t1 p0 1 10 1 +test t1 p10 2 MAXVALUE 3 t1#P#p0.ibd t1#P#p10.ibd t1.frm diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test index fce26132030..df9c06011c2 100644 --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -62,7 +62,10 @@ SHOW CREATE TABLE t1; SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; send -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, + PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; connect (con1, localhost, root,,); SET DEBUG_SYNC = 'now WAIT_FOR parked'; -- cgit v1.2.1 From 7285b4c49558e79072907642df63290748e45667 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 8 Apr 2015 07:01:39 +0200 Subject: Bug#20788853 MUTEX ISSUE IN SQL/SQL_SHOW.CC RESULTING IN SIG6. SOURCE LIKELY FILL_VARIABLES Prevent mutexes used in SHOW VARIABLES from being locked twice. --- sql/sql_class.cc | 1 + sql/sql_class.h | 1 + sql/sql_show.cc | 12 ++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cc57ba726b4..cbdaca0fac5 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -802,6 +802,7 @@ THD::THD() rli_fake(0), rli_slave(NULL), user_time(0), in_sub_stmt(0), fill_status_recursion_level(0), + fill_variables_recursion_level(0), binlog_unsafe_warning_flags(0), binlog_table_maps(0), table_map_for_update(0), diff --git a/sql/sql_class.h b/sql/sql_class.h index 22b4eabac13..5a5e8b48754 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1603,6 +1603,7 @@ public: decremented each time before it returns from the function. */ uint fill_status_recursion_level; + uint fill_variables_recursion_level; /* container for handler's private per-connection data */ Ha_data ha_data[MAX_HA]; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 51f5d75e49b..4c9811cea2d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -6317,7 +6317,11 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond) Lock LOCK_plugin_delete to avoid deletion of any plugins while creating SHOW_VAR array and hold it until all variables are stored in the table. */ - mysql_mutex_lock(&LOCK_plugin_delete); + if (thd->fill_variables_recursion_level++ == 0) + { + mysql_mutex_lock(&LOCK_plugin_delete); + } + // Lock LOCK_system_variables_hash to prepare SHOW_VARs array. mysql_rwlock_rdlock(&LOCK_system_variables_hash); DEBUG_SYNC(thd, "acquired_LOCK_system_variables_hash"); @@ -6327,7 +6331,11 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond) res= show_status_array(thd, wild, sys_var_array, option_type, NULL, "", tables->table, upper_case_names, cond); - mysql_mutex_unlock(&LOCK_plugin_delete); + if (thd->fill_variables_recursion_level-- == 1) + { + mysql_mutex_unlock(&LOCK_plugin_delete); + } + DBUG_RETURN(res); } -- cgit v1.2.1 From 25323de2a4397d9ab37ebdfddf4442c8d0dd22c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 9 Apr 2015 08:13:07 +0300 Subject: Bug#20816223 InnoDB crash on shutdown if XA PREPARE transactions hold explicit locks. innobase_shutdown_for_mysql(): Call trx_sys_close() before lock_sys_close() (and dict_close()) so that trx_free_prepared() will see all locks intact. RB: 8561 Reviewed-by: Vasil Dimov --- mysql-test/suite/innodb/r/xa_recovery.result | 17 ++++++++++++ mysql-test/suite/innodb/t/xa_recovery.test | 41 ++++++++++++++++++++++++++++ storage/innobase/srv/srv0start.c | 4 +-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/innodb/r/xa_recovery.result create mode 100644 mysql-test/suite/innodb/t/xa_recovery.test diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result new file mode 100644 index 00000000000..84cb37ef7c9 --- /dev/null +++ b/mysql-test/suite/innodb/r/xa_recovery.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +XA START 'x'; +UPDATE t1 set a=2; +XA END 'x'; +XA PREPARE 'x'; +call mtr.add_suppression("Found 1 prepared XA transactions"); +SELECT * FROM t1 LOCK IN SHARE MODE; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +a +2 +XA ROLLBACK 'x'; +SELECT * FROM t1; +a +1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test new file mode 100644 index 00000000000..d62206d57bb --- /dev/null +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -0,0 +1,41 @@ +--source include/have_innodb.inc + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +connect (con1,localhost,root); +XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x'; +connection default; + +call mtr.add_suppression("Found 1 prepared XA transactions"); + +# Kill and restart the server. +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- shutdown_server 0 +-- source include/wait_until_disconnected.inc + +-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- enable_reconnect +-- source include/wait_until_connected_again.inc +-- disable_reconnect + +disconnect con1; +connect (con1,localhost,root); +--send SELECT * FROM t1 LOCK IN SHARE MODE + +connection default; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'Sending data' and + info = 'SELECT * FROM t1 LOCK IN SHARE MODE'; +--source include/wait_condition.inc + +--source include/restart_mysqld.inc + +disconnect con1; + +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +XA ROLLBACK 'x'; +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index d64f64fc934..45f8c6d53ab 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. @@ -2230,9 +2230,9 @@ innobase_shutdown_for_mysql(void) ibuf_close(); log_shutdown(); - lock_sys_close(); trx_sys_file_format_close(); trx_sys_close(); + lock_sys_close(); mutex_free(&srv_monitor_file_mutex); mutex_free(&srv_dict_tmpfile_mutex); -- cgit v1.2.1 From a3e80aeac83565b0f09c213258c2fb6e742e4b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 9 Apr 2015 16:43:33 +0300 Subject: Bug#20816223 test fix. Embedded server does not support restarting and needs to skip the test. --- mysql-test/suite/innodb/t/xa_recovery.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test index d62206d57bb..62683a2250b 100644 --- a/mysql-test/suite/innodb/t/xa_recovery.test +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -1,4 +1,6 @@ --source include/have_innodb.inc +# Embedded server does not support restarting. +--source include/not_embedded.inc CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); -- cgit v1.2.1 From d2a5d9716a675ea3e54aee807ba4f1f90eacc2eb Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Fri, 10 Apr 2015 08:45:57 +0530 Subject: Bug# 19573096: LOADING CORRUPTED GEOMETRY DATA INTO A MYISAM TABLE CAUSES THE SERVER TO CRASH Backport to mysql-5.1 --- storage/myisam/rt_split.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c index 60f6a199778..bd31621e0e0 100644 --- a/storage/myisam/rt_split.c +++ b/storage/myisam/rt_split.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,6 +70,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim) b += 2; }while (a != end); + /* Check for infinity or NaN */ + if (my_isinf(square) || isnan(square)) + square = DBL_MAX; + return square; } @@ -104,6 +108,9 @@ static void pick_seeds(SplitStruct *node, int n_entries, double max_d = -DBL_MAX; double d; + *seed_a = node; + *seed_b = node + 1; + for (cur1 = node; cur1 < lim1; ++cur1) { for (cur2=cur1 + 1; cur2 < lim2; ++cur2) -- cgit v1.2.1 From 3300823ca36810835c38389f3f8ea248d8895ebb Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Mon, 13 Apr 2015 13:34:27 +0200 Subject: Raised version after tagging 5.1.74 (some commits skipped) --- configure.in | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 90422026122..492821b0b57 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,23 @@ dnl -*- ksh -*- dnl Process this file with autoconf to produce a configure script. +# +# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + # Minimum Autoconf version required. AC_PREREQ(2.59) @@ -12,7 +29,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.74], [], [mysql]) +AC_INIT([MySQL Server], [5.1.75], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM -- cgit v1.2.1 From 51d04c4cd9b1c408dd503213963cfbf3520e3096 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 15 Apr 2015 13:17:43 +0200 Subject: Bug#20872436 MAKE DIST BY MISTAKE COPIES FILES WITH VARIABLE EXPANSION Fix typo: s/COPY_ONLY/COPYONLY/g (cherry picked from commit 034046b4dfe3e6f83e0cf73310884334e0507f06) Conflicts: cmake/make_dist.cmake.in --- cmake/make_dist.cmake.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in index 8b845b92f1e..768e08741d3 100644 --- a/cmake/make_dist.cmake.in +++ b/cmake/make_dist.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -93,9 +93,9 @@ IF(NOT GIT_EXECUTABLE) # Save bison output first. CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc - ${CMAKE_BINARY_DIR}/sql_yacc.cc COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql_yacc.cc COPYONLY) CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h - ${CMAKE_BINARY_DIR}/sql_yacc.h COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql_yacc.h COPYONLY) IF(CMAKE_GENERATOR MATCHES "Makefiles") # make clean @@ -107,9 +107,9 @@ IF(NOT GIT_EXECUTABLE) # Restore bison output CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.cc - ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPYONLY) CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.h - ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPYONLY) FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.cc) FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.h) ENDIF() -- cgit v1.2.1 From 30c14893c7f0e8a9086eccf74ca9534ac8f7c5db Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Fri, 17 Apr 2015 13:57:55 +0200 Subject: Bug#20814396 PB2 IS SECRET ABOUT WHAT UNIT TESTS IT RUN One can not see in PB2 test logs which unit tests have been run and passed. This patchs adds an option --unit-tests-report to mtr which include the ctest report in mtr output. It will also turn on unit testing if not explicitly turned off with --no-unit-tests or equivalent. In manual runs one can always look in the ctest.log file in mtr vardir. --unit-tests are replaced with --unit-tests-report in files under mysql-test/collections/ to activate report in PB2. --- mysql-test/mysql-test-run.pl | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f82e67ef5b6..02ff577c7bf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -201,6 +201,7 @@ our @opt_cases; # The test cases names in argv our $opt_embedded_server; # -1 indicates use default, override with env.var. our $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1); +our $opt_ctest_report; # Unit test report stored here for delayed printing my $ctest_report; @@ -1168,6 +1169,7 @@ sub command_line_setup { 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'unit-tests!' => \$opt_ctest, + 'unit-tests-report!' => \$opt_ctest_report, 'stress=s' => \$opt_stress, 'help|h' => \$opt_usage, @@ -1606,12 +1608,21 @@ sub command_line_setup { } # -------------------------------------------------------------------------- - # Don't run ctest if tests or suites named + # Set default values for opt_ctest (--unit-tests) # -------------------------------------------------------------------------- - $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases); - # Override: disable if running in the PB test environment - $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR}; + if ($opt_ctest == -1) { + if (defined $opt_ctest_report && $opt_ctest_report) { + # Turn on --unit-tests by default if --unit-tests-report is used + $opt_ctest= 1; + } elsif ($opt_suites || @opt_cases) { + # Don't run ctest if tests or suites named + $opt_ctest= 0; + } elsif (defined $ENV{PB2WORKDIR}) { + # Override: disable if running in the PB test environment + $opt_ctest= 0; + } + } # -------------------------------------------------------------------------- # Check use of wait-all @@ -6079,6 +6090,8 @@ sub run_ctest() { open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile"); + $ctest_report .= $ctest_out if $opt_ctest_report; + # Put ctest output in log file, while analyzing results for (split ('\n', $ctest_out)) { print CTEST "$_\n"; @@ -6335,6 +6348,7 @@ Misc options nounit-tests Do not run unit tests. Normally run if configured and if not running named tests/suites unit-tests Run unit tests even if they would otherwise not be run + unit-tests-report Include report of every test included in unit tests. stress=ARGS Run stress test, providing options to mysql-stress-test.pl. Options are separated by comma. -- cgit v1.2.1 From e7ad7f050e2d0887f2587e5801356ac411a67ed3 Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Mon, 20 Apr 2015 16:46:36 +0530 Subject: Bug #16861371 SSL_OP_NO_COMPRESSION NOT DEFINED Description: Can't build mysql-5.5 latest source with openssl 0.9.8e. Analysis: Older OpenSSL versions(prior to openssl 1.0) doesn't have 'SSL_OP_NO_COMPRESSION' defined. Hence the build is failing with SSL_OP_NO_COMPRESSION undeclared. Fix: Added a conditonal compilation for 'SSL_OP_NO_COMPRESSION'. i.e if 'SSL_OP_NO_COMPRESSION' is defined then have the SSL_set_options call for OpenSSL 1.0 versions. Have sk_SSL_COMP_zero() call for OpenSSL 0.9.8 version --- vio/viossl.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/vio/viossl.c b/vio/viossl.c index a7370d3cc58..5960ab9ad4c 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -171,8 +171,27 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, SSL_clear(ssl); SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); SSL_set_fd(ssl, vio->sd); -#ifndef HAVE_YASSL - SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); +#if !defined(HAVE_YASSL) && defined(SSL_OP_NO_COMPRESSION) + SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); /* OpenSSL >= 1.0 only */ +#elif OPENSSL_VERSION_NUMBER >= 0x00908000L /* workaround for OpenSSL 0.9.8 */ + sk_SSL_COMP_zero(SSL_COMP_get_compression_methods()); +#endif + +#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) + { + STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; + ssl_comp_methods = SSL_COMP_get_compression_methods(); + DBUG_PRINT("info", ("Available compression methods:\n")); + int j, n = sk_SSL_COMP_num(ssl_comp_methods); + if (n == 0) + fprintf(stderr, " NONE\n"); + else + for (j = 0; j < n; j++) + { + SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); + DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); + } + } #endif if ((r= connect_accept_func(ssl)) < 1) -- cgit v1.2.1 From f07d9957994c0c21f36511035215c83653097908 Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Mon, 20 Apr 2015 19:41:50 +0530 Subject: Bug #16861371 SSL_OP_NO_COMPRESSION NOT DEFINED post push change: missed the change in mysql-5.5 (Fixing compiler warning/error) --- vio/viossl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vio/viossl.c b/vio/viossl.c index 5960ab9ad4c..86bd94260e4 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -152,6 +152,10 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, SSL *ssl; my_bool unused; my_bool was_blocking; + /* Declared here to make compiler happy */ +#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) + int j, n; +#endif DBUG_ENTER("ssl_do"); DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d ctx: 0x%lx", @@ -181,8 +185,8 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, { STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; ssl_comp_methods = SSL_COMP_get_compression_methods(); + n= sk_SSL_COMP_num(ssl_comp_methods); DBUG_PRINT("info", ("Available compression methods:\n")); - int j, n = sk_SSL_COMP_num(ssl_comp_methods); if (n == 0) fprintf(stderr, " NONE\n"); else -- cgit v1.2.1 From 6c11fedb5e81bfdcc9e71475d265a4686daa917f Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Tue, 21 Apr 2015 09:24:41 +0530 Subject: Bug #16861371 SSL_OP_NO_COMPRESSION NOT DEFINED post push change: fixing valgrind failures --- vio/viossl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vio/viossl.c b/vio/viossl.c index 86bd94260e4..f68e20ff64c 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -188,7 +188,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, n= sk_SSL_COMP_num(ssl_comp_methods); DBUG_PRINT("info", ("Available compression methods:\n")); if (n == 0) - fprintf(stderr, " NONE\n"); + DBUG_PRINT("info", ("NONE\n")); else for (j = 0; j < n; j++) { -- cgit v1.2.1 From 0665ec1db97d3031152a69e3dc7b870f90cee779 Mon Sep 17 00:00:00 2001 From: Rik Prohaska Date: Tue, 21 Apr 2015 20:39:26 -0400 Subject: tokuftdump should print leaf entry index so that the dump is easier to work with --- tools/tokuftdump.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/tokuftdump.cc b/tools/tokuftdump.cc index bf187c7dc81..dee38b26793 100644 --- a/tools/tokuftdump.cc +++ b/tools/tokuftdump.cc @@ -248,6 +248,8 @@ static int64_t getRootNode(FT ft) { } static int print_le(const void* key, const uint32_t keylen, const LEAFENTRY &le, const uint32_t idx UU(), void *const ai UU()) { + unsigned int *le_index = (unsigned int *) ai; + printf("%u: ", *le_index); *le_index += 1; print_klpair(stdout, key, keylen, le); printf("\n"); return 0; @@ -537,7 +539,8 @@ ok: printf(" n_bytes_in_buffer= %" PRIu64 "", BLB_DATA(n, i)->get_disk_size()); printf(" items_in_buffer=%u\n", BLB_DATA(n, i)->num_klpairs()); if (do_dump_data) { - BLB_DATA(n, i)->iterate(NULL); + unsigned int le_index = 0; + BLB_DATA(n, i)->iterate(&le_index); } } } -- cgit v1.2.1 From eb79ead4f01c60456977a2d27909b4aca6c29336 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Fri, 24 Apr 2015 11:30:13 +0530 Subject: Bug#20318154 : NEGATIVE ARRAY INDEX WRITE V2 Description:- There is a possibility of negative array index write associated with the function "terminal_writec()". This is due to the assumption that there is a possibility of getting -1 return value from the function call "ct_visual_char()". Analysis:- The function "terminal_writec()" is called only from "em_delete_or_list()" and "vi_list_or_eof()" and both these functions deal with the "^D" (ctrl+D) signal. So the "size_t len" and "Char c" passed to "ct_visual_char()" (when called from "terminal_writec()") is always 8 (macro VISUAL_WIDTH_MAX is passed whose value is 8) and 4 (ASCII value for "^D"/"ctrl+D") respectively. Since the value of "c" is 4, "ct_chr_class()" returns -1 (macro CHTYPE_ASCIICTL is associated with -1 value). And since value of "len" is 8, "ct_visual_char()" will always return 2 when it is called from "terminal_writec()". So there is no possible case so that we encounter a negative array index write in "terminal_writec()". But since there is a rare posibility of using "terminal_writec()" in future enhancements, it is good handle the error case as well. Fix:- A condition is added in "terminal_writec()" to check whether "ct_visual_char()" is returning -1 or not. If the return value is -1, then value 0 is returned to its calling function "em_delete_or_list()" or "vi_list_or_eof()", which in turn will return CC_ERROR. NOTE:- No testcase is added since currently there is no possible scenario to encounter this error case. --- cmd-line-utils/libedit/el_terminal.h | 4 ++-- cmd-line-utils/libedit/emacs.c | 8 +++++--- cmd-line-utils/libedit/terminal.c | 15 ++++++++++----- cmd-line-utils/libedit/vi.c | 8 +++++--- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cmd-line-utils/libedit/el_terminal.h b/cmd-line-utils/libedit/el_terminal.h index 807c651783e..db0bb94fa93 100644 --- a/cmd-line-utils/libedit/el_terminal.h +++ b/cmd-line-utils/libedit/el_terminal.h @@ -1,7 +1,7 @@ /* $NetBSD: terminal.h,v 1.3 2011/07/29 23:44:45 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -103,7 +103,7 @@ protected int terminal_settc(EditLine *, int, const Char **); protected int terminal_gettc(EditLine *, int, char **); protected int terminal_telltc(EditLine *, int, const Char **); protected int terminal_echotc(EditLine *, int, const Char **); -protected void terminal_writec(EditLine *, Int); +protected int terminal_writec(EditLine *, Int); protected int terminal__putc(EditLine *, Int); protected void terminal__flush(EditLine *); diff --git a/cmd-line-utils/libedit/emacs.c b/cmd-line-utils/libedit/emacs.c index 554d3970485..1f1033a1cb7 100644 --- a/cmd-line-utils/libedit/emacs.c +++ b/cmd-line-utils/libedit/emacs.c @@ -1,7 +1,7 @@ /* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -58,8 +58,10 @@ em_delete_or_list(EditLine *el, Int c) /* if I'm at the end */ if (el->el_line.cursor == el->el_line.buffer) { /* and the beginning */ - terminal_writec(el, c); /* then do an EOF */ - return CC_EOF; + if(!(terminal_writec(el, c))) /* then do an EOF */ + return CC_EOF; + else + return CC_ERROR; } else { /* * Here we could list completions, but it is an diff --git a/cmd-line-utils/libedit/terminal.c b/cmd-line-utils/libedit/terminal.c index 8cfbeac7c52..e1f45ca1464 100644 --- a/cmd-line-utils/libedit/terminal.c +++ b/cmd-line-utils/libedit/terminal.c @@ -1,7 +1,7 @@ /* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -1271,14 +1271,19 @@ terminal__flush(EditLine *el) /* terminal_writec(): * Write the given character out, in a human readable form */ -protected void +protected int terminal_writec(EditLine *el, Int c) { Char visbuf[VISUAL_WIDTH_MAX +1]; ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c); - visbuf[vcnt] = '\0'; - terminal_overwrite(el, visbuf, (size_t)vcnt); - terminal__flush(el); + if(vcnt == -1) + return 1; /* Error due to insufficient space */ + else { + visbuf[vcnt] = '\0'; + terminal_overwrite(el, visbuf, (size_t)vcnt); + terminal__flush(el); + return 0; + } } diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c index 9a4b97a977e..41242030a98 100644 --- a/cmd-line-utils/libedit/vi.c +++ b/cmd-line-utils/libedit/vi.c @@ -1,7 +1,7 @@ /* $NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -607,8 +607,10 @@ vi_list_or_eof(EditLine *el, Int c) if (el->el_line.cursor == el->el_line.lastchar) { if (el->el_line.cursor == el->el_line.buffer) { - terminal_writec(el, c); /* then do a EOF */ - return CC_EOF; + if(!(terminal_writec(el, c))) /* then do a EOF */ + return CC_EOF; + else + return CC_ERROR; } else { /* * Here we could list completions, but it is an -- cgit v1.2.1 From c655515d1b52a16d5d074cd29a50c267c6c3db49 Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Mon, 27 Apr 2015 14:33:25 +0530 Subject: Bug #20683237 BACKPORT 19817663 TO 5.1 and 5.5 Restrict when user table hashes can be viewed. Require SUPER privileges. --- mysql-test/r/ps_grant.result | 6 ++--- mysql-test/suite/funcs_1/r/innodb_trig_03.result | 28 +++++++++++----------- mysql-test/suite/funcs_1/r/innodb_trig_03e.result | 6 ++--- mysql-test/suite/funcs_1/r/memory_trig_03.result | 28 +++++++++++----------- mysql-test/suite/funcs_1/r/memory_trig_03e.result | 6 ++--- mysql-test/suite/funcs_1/r/myisam_trig_03.result | 28 +++++++++++----------- mysql-test/suite/funcs_1/r/myisam_trig_03e.result | 6 ++--- .../funcs_1/r/processlist_priv_no_prot.result | 18 +++++++------- .../suite/funcs_1/r/processlist_priv_ps.result | 18 +++++++------- sql/sql_acl.cc | 23 +++++++++++------- 10 files changed, 87 insertions(+), 80 deletions(-) diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result index 672db74d9c0..fd1bcaa48c9 100644 --- a/mysql-test/r/ps_grant.result +++ b/mysql-test/r/ps_grant.result @@ -18,7 +18,7 @@ current_user() second_user@localhost show grants for current_user(); Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' prepare s_t9 from 'select c1 as my_col from t9 where c1= 1' ; @@ -42,7 +42,7 @@ GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' prepare s_t1 from 'select a as my_col from t1' ; @@ -63,7 +63,7 @@ GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result index a7fce94c91d..e89159f4da6 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result @@ -189,7 +189,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg4a_2 before INSERT on t1 for each row set new.f1 = 'trig 3.5.3.7-2a'; insert into t1 (f1) values ('insert 3.5.3.7-2b'); @@ -220,7 +220,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4b_1 before UPDATE on t1 for each row @@ -247,7 +247,7 @@ trig 3.5.3.7-2a drop trigger trg4b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4b_2 before UPDATE on t1 for each row @@ -292,7 +292,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4c_1 before INSERT on t1 for each row @@ -311,7 +311,7 @@ trig 3.5.3.7-2b drop trigger trg4c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4c_2 before INSERT on t1 for each row @@ -345,7 +345,7 @@ Grants for test_noprivs@% GRANT TRIGGER ON *.* TO 'test_noprivs'@'%' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4d_1 before INSERT on t1 for each row @@ -365,7 +365,7 @@ trig 3.5.3.7-2c drop trigger trg4d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4d_2 before INSERT on t1 for each row @@ -422,7 +422,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg5a_2 before INSERT on t1 for each row set @test_var= new.f1; set @test_var= 'before trig 3.5.3.8-2a'; @@ -454,7 +454,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5b_1 before UPDATE on t1 for each row @@ -472,7 +472,7 @@ before trig 3.5.3.8-1b drop trigger trg5b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5b_2 before UPDATE on t1 for each row @@ -507,7 +507,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5c_1 before INSERT on t1 for each row @@ -521,7 +521,7 @@ before trig 3.5.3.8-1c drop trigger trg5c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5c_2 before INSERT on t1 for each row @@ -551,7 +551,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5d_1 before INSERT on t1 for each row @@ -565,7 +565,7 @@ before trig 3.5.3.8-1d drop trigger trg5d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5d_2 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result index 5b760116801..7a4ac93f4f8 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result @@ -139,7 +139,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' drop trigger trg1_2; ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1' @@ -387,7 +387,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' drop trigger trg1_2; select current_user; @@ -1265,7 +1265,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' create definer=not_ex_user@localhost trigger trg1_3 diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result index 0d622915dca..2370b899b83 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_03.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result @@ -190,7 +190,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg4a_2 before INSERT on t1 for each row set new.f1 = 'trig 3.5.3.7-2a'; insert into t1 (f1) values ('insert 3.5.3.7-2b'); @@ -221,7 +221,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4b_1 before UPDATE on t1 for each row @@ -248,7 +248,7 @@ trig 3.5.3.7-2a drop trigger trg4b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4b_2 before UPDATE on t1 for each row @@ -293,7 +293,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4c_1 before INSERT on t1 for each row @@ -312,7 +312,7 @@ trig 3.5.3.7-2b drop trigger trg4c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4c_2 before INSERT on t1 for each row @@ -346,7 +346,7 @@ Grants for test_noprivs@% GRANT TRIGGER ON *.* TO 'test_noprivs'@'%' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4d_1 before INSERT on t1 for each row @@ -366,7 +366,7 @@ trig 3.5.3.7-2c drop trigger trg4d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4d_2 before INSERT on t1 for each row @@ -423,7 +423,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg5a_2 before INSERT on t1 for each row set @test_var= new.f1; set @test_var= 'before trig 3.5.3.8-2a'; @@ -455,7 +455,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5b_1 before UPDATE on t1 for each row @@ -473,7 +473,7 @@ before trig 3.5.3.8-1b drop trigger trg5b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5b_2 before UPDATE on t1 for each row @@ -508,7 +508,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5c_1 before INSERT on t1 for each row @@ -522,7 +522,7 @@ before trig 3.5.3.8-1c drop trigger trg5c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5c_2 before INSERT on t1 for each row @@ -552,7 +552,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5d_1 before INSERT on t1 for each row @@ -566,7 +566,7 @@ before trig 3.5.3.8-1d drop trigger trg5d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5d_2 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result index 95c833b90c3..4dc6395a42a 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result @@ -140,7 +140,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' drop trigger trg1_2; ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1' @@ -388,7 +388,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' drop trigger trg1_2; select current_user; @@ -1266,7 +1266,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' create definer=not_ex_user@localhost trigger trg1_3 diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result index 0d622915dca..2370b899b83 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result @@ -190,7 +190,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg4a_2 before INSERT on t1 for each row set new.f1 = 'trig 3.5.3.7-2a'; insert into t1 (f1) values ('insert 3.5.3.7-2b'); @@ -221,7 +221,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4b_1 before UPDATE on t1 for each row @@ -248,7 +248,7 @@ trig 3.5.3.7-2a drop trigger trg4b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4b_2 before UPDATE on t1 for each row @@ -293,7 +293,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4c_1 before INSERT on t1 for each row @@ -312,7 +312,7 @@ trig 3.5.3.7-2b drop trigger trg4c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4c_2 before INSERT on t1 for each row @@ -346,7 +346,7 @@ Grants for test_noprivs@% GRANT TRIGGER ON *.* TO 'test_noprivs'@'%' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg4d_1 before INSERT on t1 for each row @@ -366,7 +366,7 @@ trig 3.5.3.7-2c drop trigger trg4d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg4d_2 before INSERT on t1 for each row @@ -423,7 +423,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD create trigger trg5a_2 before INSERT on t1 for each row set @test_var= new.f1; set @test_var= 'before trig 3.5.3.8-2a'; @@ -455,7 +455,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5b_1 before UPDATE on t1 for each row @@ -473,7 +473,7 @@ before trig 3.5.3.8-1b drop trigger trg5b_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5b_2 before UPDATE on t1 for each row @@ -508,7 +508,7 @@ GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49 GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5c_1 before INSERT on t1 for each row @@ -522,7 +522,7 @@ before trig 3.5.3.8-1c drop trigger trg5c_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5c_2 before INSERT on t1 for each row @@ -552,7 +552,7 @@ GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C497 GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' show grants; Grants for test_noprivs@localhost -GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost' use priv_db; create trigger trg5d_1 before INSERT on t1 for each row @@ -566,7 +566,7 @@ before trig 3.5.3.8-1d drop trigger trg5d_1; show grants; Grants for test_yesprivs@localhost -GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' use priv_db; create trigger trg5d_2 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result index 9e0811d29fd..b4efd685506 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result @@ -140,7 +140,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' drop trigger trg1_2; ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1' @@ -388,7 +388,7 @@ current_user test_yesprivs@localhost show grants for test_yesprivs@localhost; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' drop trigger trg1_2; select current_user; @@ -1266,7 +1266,7 @@ current_user test_yesprivs@localhost show grants; Grants for test_yesprivs@localhost -GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576' +GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' create definer=not_ex_user@localhost trigger trg1_3 diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index 3d341292be1..a227070257c 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -131,7 +131,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD CREATE INDEX i_processlist ON processlist (user); ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP TABLE processlist; @@ -165,7 +165,7 @@ SHOW/SELECT shows only the processes (1) of the user. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist @@ -178,7 +178,7 @@ SHOW/SELECT shows all processes/threads. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Sleep TIME NULL @@ -226,7 +226,7 @@ ddicttestuser1 are visible. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL @@ -290,7 +290,7 @@ Only the processes of ddicttestuser1 are visible. #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL @@ -338,7 +338,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections #################################################################################### SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; Grants for ddicttestuser2@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Sleep TIME NULL @@ -376,7 +376,7 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects #################################################################################### SHOW GRANTS; Grants for ddicttestuser2@localhost -GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL @@ -397,7 +397,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2 #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) SHOW processlist; @@ -434,7 +434,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index 2932467be2a..d6e8fc94584 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -131,7 +131,7 @@ GRANT INSERT,UPDATE ON processlist TO current_user; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD CREATE INDEX i_processlist ON processlist (user); ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' DROP TABLE processlist; @@ -165,7 +165,7 @@ SHOW/SELECT shows only the processes (1) of the user. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Query TIME NULL SHOW processlist @@ -178,7 +178,7 @@ SHOW/SELECT shows all processes/threads. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Sleep TIME NULL @@ -226,7 +226,7 @@ ddicttestuser1 are visible. #################################################################################### SHOW GRANTS; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL @@ -290,7 +290,7 @@ Only the processes of ddicttestuser1 are visible. #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL @@ -338,7 +338,7 @@ ddicttestuser2 has now the PROCESS privilege and sees all connections #################################################################################### SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; Grants for ddicttestuser2@localhost -GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID root HOST_NAME information_schema Sleep TIME NULL @@ -376,7 +376,7 @@ ddicttestuser2 has no more the PROCESS privilege and can only see own connects #################################################################################### SHOW GRANTS; Grants for ddicttestuser2@localhost -GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL @@ -397,7 +397,7 @@ He is also unable to GRANT the PROCESS privilege to ddicttestuser2 #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) SHOW processlist; @@ -434,7 +434,7 @@ Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; Grants for ddicttestuser1@localhost -GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' +GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD SHOW processlist; Id User Host db Command Time State Info ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index cf150439391..05a31b85d00 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4698,14 +4698,21 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) global.append ('\''); if (acl_user->salt_len) { - char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1]; - if (acl_user->salt_len == SCRAMBLE_LENGTH) - make_password_from_salt(passwd_buff, acl_user->salt); + global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD")); + if ((thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL) + { + char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1]; + if (acl_user->salt_len == SCRAMBLE_LENGTH) + make_password_from_salt(passwd_buff, acl_user->salt); + else + make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt); + + global.append(" \'"); + global.append(passwd_buff); + global.append('\''); + } else - make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt); - global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD '")); - global.append(passwd_buff); - global.append('\''); + global.append(" "); } /* "show grants" SSL related stuff */ if (acl_user->ssl_type == SSL_TYPE_ANY) -- cgit v1.2.1 From c3870e089a0f9ba50adcf17c8795871132e81697 Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Mon, 27 Apr 2015 23:50:13 +0530 Subject: Bug #18592390 QUERY TO I_S.TABLES AND I_S.COLUMNS LEADS TO HUGE MEMORY USAGE Description: On an example MySQL instance with 28k empty InnoDB tables, a specific query to information_schema.tables and information_schema.columns leads to memory consumption over 38GB RSS. Analysis: In get_all_tables() call, we fill the I_S tables from frm files and storage engine. As part of that process we call make_table_name_list() and allocate memory for all the 28k frm file names in the THD mem_root through make_lex_string_root(). Since it has been called around 28k * 28k times there is a huge memory getting hogged in THD mem_root. This causes the RSS to grow to 38GB. Fix: As part of fix we are creating a temporary mem_root in get_all_tables and passing it to fill_fiels(). There we replace the THD mem_root with the temporary mem_root and allocates the file names in temporary mem_root and frees it once we fill the I_S tables in get_all_tables and re-assign the original mem_root back to THD mem_root. Note: Checked the massif out put with the fix now the memory growth is just around 580MB at peak. --- sql/sql_show.cc | 67 ++++++++++++++++++++++++++++++++++++++++++++++----------- sql/sql_show.h | 5 +++-- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4c9811cea2d..5da9f43d793 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -404,13 +404,14 @@ bool mysqld_show_privileges(THD *thd) find_files_result find_files(THD *thd, List *files, const char *db, - const char *path, const char *wild, bool dir) + const char *path, const char *wild, bool dir, MEM_ROOT *tmp_mem_root) { uint i; char *ext; MY_DIR *dirp; FILEINFO *file; LEX_STRING *file_name= 0; + MEM_ROOT **root_ptr= NULL, *old_root= NULL; uint file_name_len; #ifndef NO_EMBEDDED_ACCESS_CHECKS uint col_access=thd->col_access; @@ -440,6 +441,13 @@ find_files(THD *thd, List *files, const char *db, DBUG_RETURN(FIND_FILES_DIR); } + if (tmp_mem_root) + { + root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); + old_root= *root_ptr; + *root_ptr= tmp_mem_root; + } + for (i=0 ; i < (uint) dirp->number_off_files ; i++) { char uname[NAME_LEN + 1]; /* Unencoded name */ @@ -519,8 +527,11 @@ find_files(THD *thd, List *files, const char *db, continue; } #endif - if (!(file_name= - thd->make_lex_string(file_name, uname, file_name_len, TRUE)) || + if (!(file_name= tmp_mem_root ? + make_lex_string_root(tmp_mem_root, file_name, uname, + file_name_len, TRUE) : + thd->make_lex_string(file_name, uname, + file_name_len, TRUE)) || files->push_back(file_name)) { my_dirend(dirp); @@ -532,6 +543,9 @@ find_files(THD *thd, List *files, const char *db, (void) ha_find_files(thd, db, path, wild, dir, files); + if (tmp_mem_root) + *root_ptr= old_root; + DBUG_RETURN(FIND_FILES_OK); } @@ -2882,7 +2896,7 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table) int make_db_list(THD *thd, List *files, LOOKUP_FIELD_VALUES *lookup_field_vals, - bool *with_i_schema) + bool *with_i_schema, MEM_ROOT *tmp_mem_root) { LEX_STRING *i_s_name_copy= 0; i_s_name_copy= thd->make_lex_string(i_s_name_copy, @@ -2906,7 +2920,8 @@ int make_db_list(THD *thd, List *files, return 1; } return (find_files(thd, files, NullS, mysql_data_home, - lookup_field_vals->db_value.str, 1) != FIND_FILES_OK); + lookup_field_vals->db_value.str, 1, tmp_mem_root) != + FIND_FILES_OK); } @@ -2948,7 +2963,7 @@ int make_db_list(THD *thd, List *files, return 1; *with_i_schema= 1; return (find_files(thd, files, NullS, - mysql_data_home, NullS, 1) != FIND_FILES_OK); + mysql_data_home, NullS, 1, tmp_mem_root) != FIND_FILES_OK); } @@ -3056,7 +3071,8 @@ int schema_tables_add(THD *thd, List *files, const char *wild) static int make_table_name_list(THD *thd, List *table_names, LEX *lex, LOOKUP_FIELD_VALUES *lookup_field_vals, - bool with_i_schema, LEX_STRING *db_name) + bool with_i_schema, LEX_STRING *db_name, + MEM_ROOT *tmp_mem_root) { char path[FN_REFLEN + 1]; build_table_filename(path, sizeof(path) - 1, db_name->str, "", "", 0); @@ -3110,7 +3126,8 @@ make_table_name_list(THD *thd, List *table_names, LEX *lex, lookup_field_vals->table_value.str)); find_files_result res= find_files(thd, table_names, db_name->str, path, - lookup_field_vals->table_value.str, 0); + lookup_field_vals->table_value.str, 0, + tmp_mem_root); if (res != FIND_FILES_OK) { /* @@ -3776,6 +3793,9 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) bool can_deadlock; DBUG_ENTER("get_all_tables"); + MEM_ROOT tmp_mem_root; + init_sql_alloc(&tmp_mem_root, TABLE_ALLOC_BLOCK_SIZE, 0); + /* In cases when SELECT from I_S table being filled by this call is part of statement which also uses other tables or is being executed @@ -3867,7 +3887,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; } - if (make_db_list(thd, &db_names, &lookup_field_vals, &with_i_schema)) + if (make_db_list(thd, &db_names, &lookup_field_vals, &with_i_schema, &tmp_mem_root)) goto err; it.rewind(); /* To get access to new elements in basis list */ while ((db_name= it++)) @@ -3885,7 +3905,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) List table_names; int res= make_table_name_list(thd, &table_names, lex, &lookup_field_vals, - with_i_schema, db_name); + with_i_schema, db_name, &tmp_mem_root); if (res == 2) /* Not fatal error, continue */ continue; if (res) @@ -3972,9 +3992,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) with_i_schema= 0; } } - error= 0; err: + + free_root(&tmp_mem_root, MYF(0)); thd->restore_backup_open_tables_state(&open_tables_state_backup); DBUG_RETURN(error); @@ -4000,6 +4021,27 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) Returning error status in this case leads to client hangup. */ + /* + * A temporary class is created to free tmp_mem_root when we return from + * this function, since we have 'return' from this function from many + * places. This is just to avoid goto. + */ + class free_tmp_mem_root + { + public: + free_tmp_mem_root() + { + init_sql_alloc(&tmp_mem_root, TABLE_ALLOC_BLOCK_SIZE, 0); + } + ~free_tmp_mem_root() + { + free_root(&tmp_mem_root, MYF(0)); + } + MEM_ROOT tmp_mem_root; + }; + + free_tmp_mem_root dummy_member; + LOOKUP_FIELD_VALUES lookup_field_vals; List db_names; LEX_STRING *db_name; @@ -4013,11 +4055,12 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) if (get_lookup_field_values(thd, cond, tables, &lookup_field_vals)) DBUG_RETURN(0); + DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'", lookup_field_vals.db_value.str, lookup_field_vals.table_value.str)); if (make_db_list(thd, &db_names, &lookup_field_vals, - &with_i_schema)) + &with_i_schema, &dummy_member.tmp_mem_root)) DBUG_RETURN(1); /* diff --git a/sql/sql_show.h b/sql/sql_show.h index b6d520441c7..16bfc5cdb69 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -82,7 +82,8 @@ enum find_files_result { #define IS_FILES_EXTRA 37 find_files_result find_files(THD *thd, List *files, const char *db, - const char *path, const char *wild, bool dir); + const char *path, const char *wild, bool dir, + MEM_ROOT *tmp_mem_root); int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, HA_CREATE_INFO *create_info_arg, bool show_database); -- cgit v1.2.1 From fdae90dd11b6f1230f66d530f2d213599f58c760 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Tue, 28 Apr 2015 14:56:55 +0530 Subject: Bug #20181776 :- ACCESS CONTROL DOESN'T MATCH MOST SPECIFIC HOST WHEN IT CONTAINS WILDCARD Description :- Incorrect access privileges are provided to a user due to wrong sorting of users when wildcard characters is present in the hostname. Analysis :- Function "get_sorts()" is used to sort the strings of user name, hostname, database name. It is used to arrange the users in the access privilege matching order. When a user connects, it checks in the sorted user access privilege list and finds a corresponding matching entry for the user. Algorithm used in "get_sort()" sorts the strings inappropriately. As a result, when a user connects to the server, it is mapped to incorrect user access privileges. Algorithm used in "get_sort()" counts the number of characters before the first occurence of any one of the wildcard characters (single-wildcard character '_' or multi-wildcard character '%') and sorts in that order. As a result of inconnect sorting it treats hostname "%" and "%.mysql.com" as equally-specific values and therefore the order is indeterminate. Fix:- The "get_sort()" algorithm has been modified to treat "%" seperately. Now "get_sort()" returns a number which, if sorted in descending order, puts strings in the following order:- * strings with no wildcards * strings containg wildcards and non-wildcard characters * single muilt-wildcard character('%') * empty string. --- sql/sql_acl.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 05a31b85d00..b061a8bc2cf 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -801,7 +801,8 @@ static ulong get_access(TABLE *form, uint fieldnr, uint *next_field) /* Return a number which, if sorted 'desc', puts strings in this order: no wildcards - wildcards + strings containg wildcards and non-wildcard characters + single muilt-wildcard character('%') empty string */ @@ -818,7 +819,16 @@ static ulong get_sort(uint count,...) { char *start, *str= va_arg(args,char*); uint chars= 0; - uint wild_pos= 0; /* first wildcard position */ + uint wild_pos= 0; + + /* + wild_pos + 0 if string is empty + 1 if string is a single muilt-wildcard + character('%') + first wildcard position + 1 if string containg wildcards and + non-wildcard characters + */ if ((start= str)) { @@ -829,6 +839,8 @@ static ulong get_sort(uint count,...) else if (*str == wild_many || *str == wild_one) { wild_pos= (uint) (str - start) + 1; + if (!(wild_pos == 1 && *str == wild_many && *(++str) == '\0')) + wild_pos++; break; } chars= 128; // Marker that chars existed -- cgit v1.2.1 From 31c803e8d0543b330aa8e61ef878da43fe1f68f7 Mon Sep 17 00:00:00 2001 From: V S Murthy Sidagam Date: Wed, 29 Apr 2015 13:51:29 +0530 Subject: Bug #18592390 QUERY TO I_S.TABLES AND I_S.COLUMNS LEADS TO HUGE MEMORY USAGE As part of the fix find_files() prototype has been modified and mysql-cluster uses find_files() function. Hence modified find_files() call in ha_ndbcluster_binlog.cc file to make mysql-cluster build successful. --- sql/ha_ndbcluster_binlog.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 15e0b068826..b921a5a6747 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2542,7 +2542,8 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname) char path[FN_REFLEN + 1]; build_table_filename(path, sizeof(path) - 1, dbname, "", "", 0); - if (find_files(thd, &files, dbname, path, NullS, 0) != FIND_FILES_OK) + if (find_files(thd, &files, dbname, path, NullS, 0, NULL) != + FIND_FILES_OK) { DBUG_PRINT("info", ("Failed to find files")); DBUG_RETURN(true); -- cgit v1.2.1 From 1b07ba57a4f05b53db48d89c5954448bbe4e64a3 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 2 May 2015 15:36:33 +0200 Subject: Fix MDEV-8090 in tabmysql.cpp --- storage/connect/RelWithDebInfo/ha_connect.exp | Bin 0 -> 390776 bytes .../ha_connect.dll.intermediate.manifest | 10 ++++++++++ storage/connect/connect.dir/RelWithDebInfo/mt.dep | 1 + storage/connect/connect.dir/RelWithDebInfo/vc90.idb | Bin 0 -> 1002496 bytes .../connect.dir/RelWithDebInfo/versioninfo_dll.res | Bin 0 -> 392 bytes storage/connect/tabmysql.cpp | 11 +++++++++-- 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 storage/connect/RelWithDebInfo/ha_connect.exp create mode 100644 storage/connect/connect.dir/RelWithDebInfo/ha_connect.dll.intermediate.manifest create mode 100644 storage/connect/connect.dir/RelWithDebInfo/mt.dep create mode 100644 storage/connect/connect.dir/RelWithDebInfo/vc90.idb create mode 100644 storage/connect/connect.dir/RelWithDebInfo/versioninfo_dll.res diff --git a/storage/connect/RelWithDebInfo/ha_connect.exp b/storage/connect/RelWithDebInfo/ha_connect.exp new file mode 100644 index 00000000000..270a1ae0b18 Binary files /dev/null and b/storage/connect/RelWithDebInfo/ha_connect.exp differ diff --git a/storage/connect/connect.dir/RelWithDebInfo/ha_connect.dll.intermediate.manifest b/storage/connect/connect.dir/RelWithDebInfo/ha_connect.dll.intermediate.manifest new file mode 100644 index 00000000000..ecea6f7f567 --- /dev/null +++ b/storage/connect/connect.dir/RelWithDebInfo/ha_connect.dll.intermediate.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage/connect/connect.dir/RelWithDebInfo/mt.dep b/storage/connect/connect.dir/RelWithDebInfo/mt.dep new file mode 100644 index 00000000000..07d724edfa8 --- /dev/null +++ b/storage/connect/connect.dir/RelWithDebInfo/mt.dep @@ -0,0 +1 @@ +La ressource de manifeste a t mise jour pour la dernire fois 15:30:20,49 le 24/04/2015 diff --git a/storage/connect/connect.dir/RelWithDebInfo/vc90.idb b/storage/connect/connect.dir/RelWithDebInfo/vc90.idb new file mode 100644 index 00000000000..40b22184aad Binary files /dev/null and b/storage/connect/connect.dir/RelWithDebInfo/vc90.idb differ diff --git a/storage/connect/connect.dir/RelWithDebInfo/versioninfo_dll.res b/storage/connect/connect.dir/RelWithDebInfo/versioninfo_dll.res new file mode 100644 index 00000000000..1482ce4193a Binary files /dev/null and b/storage/connect/connect.dir/RelWithDebInfo/versioninfo_dll.res differ diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 66f275796b5..b18e4da2ec4 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -1060,9 +1060,16 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const void *key, int len) int oldlen = Query->GetLength(); if (!key || op == OP_NEXT || - Mode == MODE_UPDATE || Mode == MODE_DELETE) + Mode == MODE_UPDATE || Mode == MODE_DELETE) { + if (!key && Mode == MODE_READX) { + // This is a false indexed read + m_Rc = Myc.ExecSQL(g, Query->GetStr()); + Mode = MODE_READ; + return (m_Rc == RC_FX) ? true : false; + } // endif key + return false; - else if (op == OP_FIRST) { + } else if (op == OP_FIRST) { if (To_CondFil) { oom = Query->Append(" WHERE "); -- cgit v1.2.1 From 12bebceb8e37d7c8a57a56ea3391d2d76f74d5b4 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 5 May 2015 11:37:21 +0200 Subject: - Fix a regression bug on (XML) HTML tables. modified: tabxml.cpp added: xml_html.test xml_html.result beers.xml coffee.htm - Fix MDEV-7935 by suppressing error resetting code in delete_or_rename_table. However, the issue is that this code was added because without it an assertion was raised in some cases. Unfortunately I can't remember what were these cases. Therefore fixing it in this case will perhaps make a new crash happening on another cases. modified: ha_connect.cc - Add the UDF Json_Array_Delete. modified: jsonudf.cpp --- storage/connect/ha_connect.cc | 9 ++- storage/connect/jsonudf.cpp | 94 ++++++++++++++++++---- .../connect/mysql-test/connect/r/xml_html.result | 32 ++++++++ .../connect/mysql-test/connect/std_data/beers.xml | 16 ++++ .../connect/mysql-test/connect/std_data/coffee.htm | 24 ++++++ storage/connect/mysql-test/connect/t/xml_html.test | 39 +++++++++ storage/connect/tabxml.cpp | 5 +- 7 files changed, 201 insertions(+), 18 deletions(-) create mode 100644 storage/connect/mysql-test/connect/r/xml_html.result create mode 100644 storage/connect/mysql-test/connect/std_data/beers.xml create mode 100644 storage/connect/mysql-test/connect/std_data/coffee.htm create mode 100644 storage/connect/mysql-test/connect/t/xml_html.test diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 8b1ca3519ee..765c04bd2be 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4632,8 +4632,13 @@ int ha_connect::delete_or_rename_table(const char *name, const char *to) } // endif pos - } else // Avoid infamous DBUG_ASSERT - thd->get_stmt_da()->reset_diagnostics_area(); + } // endif open_table_def + +// This below was done to avoid DBUG_ASSERT in some case that +// we don't know anymore what they were. It was suppressed because +// it did cause assertion in other cases (see MDEV-7935) +// } else // Avoid infamous DBUG_ASSERT +// thd->get_stmt_da()->reset_diagnostics_area(); free_table_share(share); } else // Temporary file diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 194cb6defd6..1afd79bec05 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -17,40 +17,45 @@ #include "json.h" #define MEMFIX 512 +#define UDF_EXEC_ARGS \ + UDF_INIT*, UDF_ARGS*, char*, unsigned long*, char*, char* uint GetJsonGrpSize(void); extern "C" { DllExport my_bool Json_Value_init(UDF_INIT*, UDF_ARGS*, char*); -DllExport char *Json_Value(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Value(UDF_EXEC_ARGS); DllExport void Json_Value_deinit(UDF_INIT*); + DllExport my_bool Json_Array_init(UDF_INIT*, UDF_ARGS*, char*); -DllExport char *Json_Array(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Array(UDF_EXEC_ARGS); DllExport void Json_Array_deinit(UDF_INIT*); + DllExport my_bool Json_Array_Add_init(UDF_INIT*, UDF_ARGS*, char*); -DllExport char *Json_Array_Add(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Array_Add(UDF_EXEC_ARGS); DllExport void Json_Array_Add_deinit(UDF_INIT*); + +DllExport my_bool Json_Array_Delete_init(UDF_INIT*, UDF_ARGS*, char*); +DllExport char *Json_Array_Delete(UDF_EXEC_ARGS); +DllExport void Json_Array_Delete_deinit(UDF_INIT*); + DllExport my_bool Json_Object_init(UDF_INIT*, UDF_ARGS*, char*); -DllExport char *Json_Object(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Object(UDF_EXEC_ARGS); DllExport void Json_Object_deinit(UDF_INIT*); + DllExport my_bool Json_Object_Nonull_init(UDF_INIT*, UDF_ARGS*, char*); -DllExport char *Json_Object_Nonull(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Object_Nonull(UDF_EXEC_ARGS); DllExport void Json_Object_Nonull_deinit(UDF_INIT*); + DllExport my_bool Json_Array_Grp_init(UDF_INIT*, UDF_ARGS*, char*); DllExport void Json_Array_Grp_add(UDF_INIT *, UDF_ARGS *, char *, char *); -DllExport char *Json_Array_Grp(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Array_Grp(UDF_EXEC_ARGS); DllExport void Json_Array_Grp_clear(UDF_INIT *, char *, char *); DllExport void Json_Array_Grp_deinit(UDF_INIT*); + DllExport my_bool Json_Object_Grp_init(UDF_INIT*, UDF_ARGS*, char*); DllExport void Json_Object_Grp_add(UDF_INIT *, UDF_ARGS *, char *, char *); -DllExport char *Json_Object_Grp(UDF_INIT*, UDF_ARGS*, char*, - unsigned long*, char *, char *); +DllExport char *Json_Object_Grp(UDF_EXEC_ARGS); DllExport void Json_Object_Grp_clear(UDF_INIT *, char *, char *); DllExport void Json_Object_Grp_deinit(UDF_INIT*); } // extern "C" @@ -404,6 +409,67 @@ void Json_Array_Add_deinit(UDF_INIT* initid) PlugExit((PGLOBAL)initid->ptr); } // end of Json_Array_Add_deinit +/***********************************************************************/ +/* Add values to a Json array. */ +/***********************************************************************/ +my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + unsigned long reslen, memlen; + + if (args->arg_count != 2) { + strcpy(message, "Json_Value_Delete must have 2 arguments"); + return true; + } else if (!IsJson(args, 0)) { + strcpy(message, "Json_Value_Delete first argument must be a json item"); + return true; + } else + CalcLen(args, false, reslen, memlen); + + return JsonInit(initid, message, reslen, memlen); +} // end of Json_Array_Delete_init + +char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result, + unsigned long *res_length, char *is_null, char *error) +{ + char *str; + int n; + PJVAL jvp; + PJAR arp; + PGLOBAL g = (PGLOBAL)initid->ptr; + + PlugSubSet(g, g->Sarea, g->Sarea_Size); + jvp = MakeValue(g, args, 0); + + if (jvp->GetValType() != TYPE_JAR) { + push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, + "First argument is not an array"); + str = args->args[0]; + } else if (args->arg_type[1] != INT_RESULT) { + push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, + "Second argument is not an integer"); + str = args->args[0]; + } else { + n = *(int*)args->args[1]; + arp = jvp->GetArray(); + arp->DeleteValue(n - 1); + arp->InitArray(g); + + if (!(str = Serialize(g, arp, NULL, 0))) { + str = strcpy(result, g->Message); + push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, str); + } // endif str + + } // endif's + + *res_length = strlen(str); + return str; +} // end of Json_Array_Delete + +void Json_Array_Delete_deinit(UDF_INIT* initid) +{ + PlugExit((PGLOBAL)initid->ptr); +} // end of Json_Array_Delete_deinit + /***********************************************************************/ /* Make a Json Oject containing all the parameters. */ /***********************************************************************/ diff --git a/storage/connect/mysql-test/connect/r/xml_html.result b/storage/connect/mysql-test/connect/r/xml_html.result new file mode 100644 index 00000000000..7b5e0febe6e --- /dev/null +++ b/storage/connect/mysql-test/connect/r/xml_html.result @@ -0,0 +1,32 @@ +Warnings: +Warning 1105 No file name. Table will use t1.xml +SET NAMES utf8; +# +# Testing HTML like XML file +# +CREATE TABLE beers ( +`Name` CHAR(16) FIELD_FORMAT='brandName', +`Origin` CHAR(16) FIELD_FORMAT='origin', +`Description` CHAR(32) FIELD_FORMAT='details') +ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' +TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; +SELECT * FROM beers; +Name Origin Description +Huntsman Bath, UK Wonderful hop, light alcohol +Tuborg Danmark In small bottles +DROP TABLE beers; +# +# Testing HTML file +# +CREATE TABLE coffee ( +`Name` CHAR(16), +`Cups` INT(8), +`Type` CHAR(16), +`Sugar` CHAR(4)) +ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' +TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; +SELECT * FROM coffee; +Name Cups Type Sugar +T. Sexton 10 Espresso No +J. Dinnen 5 Decaf Yes +DROP TABLE coffee; diff --git a/storage/connect/mysql-test/connect/std_data/beers.xml b/storage/connect/mysql-test/connect/std_data/beers.xml new file mode 100644 index 00000000000..1abc77fe0f9 --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/beers.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + +
NameOriginDescription
HuntsmanBath, UK
Wonderful hop, light alcohol
TuborgDanmark
In small bottles
+
diff --git a/storage/connect/mysql-test/connect/std_data/coffee.htm b/storage/connect/mysql-test/connect/std_data/coffee.htm new file mode 100644 index 00000000000..95a23d5c0ad --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/coffee.htm @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + +
Cups of coffee consumed by each senator
NameCupsType of CoffeeSugar?
T. Sexton10EspressoNo
J. Dinnen5DecafYes
+ diff --git a/storage/connect/mysql-test/connect/t/xml_html.test b/storage/connect/mysql-test/connect/t/xml_html.test new file mode 100644 index 00000000000..1c84b46ec38 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/xml_html.test @@ -0,0 +1,39 @@ +--source have_libxml2.inc + +let $MYSQLD_DATADIR= `select @@datadir`; + +SET NAMES utf8; + +--copy_file $MTR_SUITE_DIR/std_data/beers.xml $MYSQLD_DATADIR/test/beers.xml +--copy_file $MTR_SUITE_DIR/std_data/coffee.htm $MYSQLD_DATADIR/test/coffee.htm + +--echo # +--echo # Testing HTML like XML file +--echo # +CREATE TABLE beers ( +`Name` CHAR(16) FIELD_FORMAT='brandName', +`Origin` CHAR(16) FIELD_FORMAT='origin', +`Description` CHAR(32) FIELD_FORMAT='details') +ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' +TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; +SELECT * FROM beers; +DROP TABLE beers; + +--echo # +--echo # Testing HTML file +--echo # +CREATE TABLE coffee ( +`Name` CHAR(16), +`Cups` INT(8), +`Type` CHAR(16), +`Sugar` CHAR(4)) +ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' +TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; +SELECT * FROM coffee; +DROP TABLE coffee; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/test/beers.xml +--remove_file $MYSQLD_DATADIR/test/coffee.htm diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 8ea44fed2be..1c1ff8a2ffe 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -1505,8 +1505,9 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) } else if (Type == 2) { // HTML like table, columns are retrieved by position new(this) XPOSCOL(Value); // Change the class of this column - Tdbp->Hasnod = true; - return false; + Inod = -1; +// Tdbp->Hasnod = true; +// return false; } else if (Type == 0 && !mode) { strcat(strcat(pbuf, "@"), Name); } else { // Type == 1 -- cgit v1.2.1 From 3a889b1f90271b64f9bd3e42ec7c1b05908d2b39 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 7 May 2015 16:59:25 +0200 Subject: Fix a bug in init_table_share that caused syntax error with Boolean options: oom|= sql->append(vull ? "ON" : "OFF"); replaced by: oom|= sql->append(vull ? "YES" : "NO"); modified: ha_connect.cc Make DBF tables to be usable in big-endian machines (test version) modified: filamdbf.cpp --- storage/connect/filamdbf.cpp | 25 ++++++++++++++++--------- storage/connect/ha_connect.cc | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 98b8bb6fd95..7acbba309b2 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -115,6 +115,7 @@ typedef struct _descriptor { /* Side effects: */ /* Moves file pointer to byte 32; fills buffer at buf with */ /* first 32 bytes of file. */ +/* Converts numeric values to platform byte ordering (LE in file) */ /****************************************************************************/ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) { @@ -142,6 +143,11 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) } else strcpy(g->Message, MSG(DBASE_FILE)); + // Convert numeric fields to have them in platform byte ordering + buf->Records = uint4korr(&buf->Records); + buf->Headlen = uint2korr(&buf->Headlen); + buf->Reclen = uint2korr(&buf->Reclen); + // Check last byte(s) of header if (fseek(file, buf->Headlen - dbc, SEEK_SET) != 0) { sprintf(g->Message, MSG(BAD_HEADER), fn); @@ -565,8 +571,8 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) header->Filedate[0] = datm->tm_year - 100; header->Filedate[1] = datm->tm_mon + 1; header->Filedate[2] = datm->tm_mday; - header->Headlen = (ushort)hlen; - header->Reclen = (ushort)reclen; + int2store(&header->Headlen, hlen); + int2store(&header->Reclen, reclen); descp = (DESCRIPTOR*)header; // Currently only standard Xbase types are supported @@ -729,7 +735,7 @@ bool DBFFAM::CopyHeader(PGLOBAL g) if (Headlen) { void *hdr = PlugSubAlloc(g, NULL, Headlen); size_t n, hlen = (size_t)Headlen; - int pos = ftell(Stream); + int pos = ftell(Stream); if (fseek(Stream, 0, SEEK_SET)) strcpy(g->Message, "Seek error in CopyHeader"); @@ -863,13 +869,14 @@ void DBFFAM::CloseTableFile(PGLOBAL g, bool abort) if (n > Records) { // Update the number of rows in the file header - char filename[_MAX_PATH]; + char filename[_MAX_PATH], nRecords[4]; + int4store(&nRecords, n); PlugSetPath(filename, To_File, Tdbp->GetPath()); if ((Stream= global_fopen(g, MSGID_OPEN_MODE_STRERROR, filename, "r+b"))) { fseek(Stream, 4, SEEK_SET); // Get header.Records position - fwrite(&n, sizeof(int), 1, Stream); + fwrite(nRecords, sizeof(nRecords), 1, Stream); fclose(Stream); Stream= NULL; Records= n; // Update Records value @@ -944,13 +951,13 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g) /************************************************************************/ DBFHEADER *hp = (DBFHEADER*)Memory; - if (Lrecl != (int)hp->Reclen) { - sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen); + if (Lrecl != (int)uint2korr(&hp->Reclen)) { + sprintf(g->Message, MSG(BAD_LRECL), Lrecl, uint2korr(&hp->Reclen)); return true; } // endif Lrecl - Records = (int)hp->Records; - Headlen = (int)hp->Headlen; + Records = (int)uint4korr(&hp->Records); + Headlen = (int)uint2korr(&hp->Headlen); } // endif Headlen /**************************************************************************/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 765c04bd2be..f2827f56cd8 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4901,7 +4901,7 @@ static int init_table_share(THD* thd, oom|= sql->append(' '); oom|= sql->append(opt->name); oom|= sql->append('='); - oom|= sql->append(vull ? "ON" : "OFF"); + oom|= sql->append(vull ? "YES" : "NO"); } // endif vull break; -- cgit v1.2.1 From c387e7d8e2b5d69aa05514ec9b08a8ea7fdf470c Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 7 May 2015 17:36:25 +0200 Subject: Heidi stuff --- win/packaging/heidisql.cmake | 46 ++++++------- win/packaging/heidisql.wxi.in | 154 +++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake index f9334f09570..5b0cd07cea4 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -1,23 +1,23 @@ -SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") -SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") -SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") -SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) - -IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) - MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) - MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") - FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} - ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} - ) -ENDIF() - -SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) -IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - # Use our libmysql if it is 32 bit. - IF(LIBMYSQL_LOCATION) - SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") - ENDIF() -ENDIF() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) +SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") +SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") +SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") +SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) + +IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) + MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) + MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") + FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} + ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} + ) +ENDIF() + +SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) +IF(CMAKE_SIZEOF_VOID_P EQUAL 4) + # Use our libmysql if it is 32 bit. + IF(LIBMYSQL_LOCATION) + SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") + ENDIF() +ENDIF() +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) diff --git a/win/packaging/heidisql.wxi.in b/win/packaging/heidisql.wxi.in index 6b1176921bc..4f07a07627c 100644 --- a/win/packaging/heidisql.wxi.in +++ b/win/packaging/heidisql.wxi.in @@ -1,77 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HEIDISQLINSTALLED - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HEIDISQLINSTALLED + + + + + + + + + + + + + + + + + + -- cgit v1.2.1 From 7704fde0c6fcb4d337d315c00ae366a7776a2f41 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 7 May 2015 18:01:49 +0200 Subject: Heidi stuff --- win/packaging/heidisql.cmake | 46 ++++++------- win/packaging/heidisql.wxi.in | 154 +++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake index f9334f09570..5b0cd07cea4 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -1,23 +1,23 @@ -SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") -SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") -SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") -SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) - -IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) - MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) - MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") - FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} - ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} - ) -ENDIF() - -SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) -IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - # Use our libmysql if it is 32 bit. - IF(LIBMYSQL_LOCATION) - SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") - ENDIF() -ENDIF() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) +SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") +SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") +SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") +SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) + +IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) + MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) + MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") + FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} + ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} + ) +ENDIF() + +SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) +IF(CMAKE_SIZEOF_VOID_P EQUAL 4) + # Use our libmysql if it is 32 bit. + IF(LIBMYSQL_LOCATION) + SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") + ENDIF() +ENDIF() +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) diff --git a/win/packaging/heidisql.wxi.in b/win/packaging/heidisql.wxi.in index 6b1176921bc..4f07a07627c 100644 --- a/win/packaging/heidisql.wxi.in +++ b/win/packaging/heidisql.wxi.in @@ -1,77 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HEIDISQLINSTALLED - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HEIDISQLINSTALLED + + + + + + + + + + + + + + + + + + -- cgit v1.2.1 From 6b56e8998b520371055f82f0d02eac779ba2d9bd Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 8 May 2015 13:21:42 +0200 Subject: Typo to check buildbot --- .gitignore | 5 +++ .../connect/mysql-test/connect/r/xml_html.result | 14 +++---- storage/connect/tabxml.cpp | 46 ---------------------- 3 files changed, 12 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index e3df21eb17b..85d68f2853d 100644 --- a/.gitignore +++ b/.gitignore @@ -245,6 +245,11 @@ storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset *.ko *.obj *.elf +*.exp +*.manifest +*.dep +*.idb +*.res # Precompiled Headers *.gch diff --git a/storage/connect/mysql-test/connect/r/xml_html.result b/storage/connect/mysql-test/connect/r/xml_html.result index 7b5e0febe6e..143f46529f6 100644 --- a/storage/connect/mysql-test/connect/r/xml_html.result +++ b/storage/connect/mysql-test/connect/r/xml_html.result @@ -1,5 +1,5 @@ Warnings: -Warning 1105 No file name. Table will use t1.xml +Warning 1105 No file name. Table will use t1.xml SET NAMES utf8; # # Testing HTML like XML file @@ -11,9 +11,9 @@ CREATE TABLE beers ( ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; SELECT * FROM beers; -Name Origin Description -Huntsman Bath, UK Wonderful hop, light alcohol -Tuborg Danmark In small bottles +Name Origin Description +Huntsman Bath, UK Wonderful hop, light alcohol +Tuborg Danmark In small bottles DROP TABLE beers; # # Testing HTML file @@ -26,7 +26,7 @@ CREATE TABLE coffee ( ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; SELECT * FROM coffee; -Name Cups Type Sugar -T. Sexton 10 Espresso No -J. Dinnen 5 Decaf Yes +Name Cups Type Sugar +T. Sexton 10 Espresso No +J. Dinnen 5 Decaf Yes DROP TABLE coffee; diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 1c1ff8a2ffe..4f7af638d0c 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -313,10 +313,6 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) pxcp = xcp; -// for (j = lvl - 1; j >= 0; j--) -// if (jrp[j] && (jrp[j] = jrp[j]->GetNext())) -// goto more; - if (vp->atp) vp->atp = vp->atp->GetNext(g); @@ -421,8 +417,6 @@ XMLDEF::XMLDEF(void) bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { char *defrow, *defcol, buf[10]; -//void *memp = Cat->GetDescp(); -//PSZ dbfile = Cat->GetDescFile(); Fn = GetStringCatInfo(g, "Filename", NULL); Encoding = GetStringCatInfo(g, "Encoding", "UTF-8"); @@ -479,12 +473,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Header = GetIntCatInfo("Header", 0); GetCharCatInfo("Xmlsup", "*", buf, sizeof(buf)); -//if (*buf == '*') // Try the old (deprecated) option -// GetCharCatInfo("Method", "*", buf, sizeof(buf)); - -//if (*buf == '*') // Is there a default for the database? -// GetCharCatInfo("Defxml", XMLSUP, buf, sizeof(buf)); - // Note that if no support is specified, the default is MS-DOM // on Windows and libxml2 otherwise if (*buf == '*') @@ -499,7 +487,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) // Get eventual table node attribute Attrib = GetStringCatInfo(g, "Attribute", ""); Hdattr = GetStringCatInfo(g, "HeadAttr", ""); - return false; } // end of DefineAM @@ -519,30 +506,6 @@ PTDB XMLDEF::GetTable(PGLOBAL g, MODE m) return tdbp; } // end of GetTable -#if 0 -/***********************************************************************/ -/* DeleteTableFile: Delete XML table files using platform API. */ -/***********************************************************************/ -bool XMLDEF::DeleteTableFile(PGLOBAL g) - { - char filename[_MAX_PATH]; - bool rc; - - // Delete the XML table file if not protected - if (!IsReadOnly()) { - PlugSetPath(filename, Fn, GetPath()); -#if defined(WIN32) - rc = !DeleteFile(filename); -#else // UNIX - rc = remove(filename); -#endif // UNIX - } else - rc =true; - - return rc; // Return true if error - } // end of DeleteTableFile -#endif // 0 - /* ------------------------- TDBXML Class ---------------------------- */ /***********************************************************************/ @@ -854,7 +817,6 @@ bool TDBXML::Initialize(PGLOBAL g) To_Xb = Docp->LinkXblock(g, Mode, rc, filename); // Add a CONNECT comment node -// sprintf(buf, " Created by CONNECT %s ", version); strcpy(buf, " Created by the MariaDB CONNECT Storage Engine"); Docp->AddComment(g, buf); @@ -1279,7 +1241,6 @@ void TDBXML::CloseDB(PGLOBAL g) if (Docp) { if (Changed) { char filename[_MAX_PATH]; -// PDBUSER dup = (PDBUSER)g->Activityp->Aptr; // We used the file name relative to recorded datapath PlugSetPath(filename, Xfile, GetPath()); @@ -1321,7 +1282,6 @@ void TDBXML::CloseDB(PGLOBAL g) NewRow = false; Hasnod = false; Write = false; -// Bufdone = false; Nodedone = false; Void = false; Nrow = -1; @@ -1413,8 +1373,6 @@ bool XMLCOL::AllocBuf(PGLOBAL g, bool mode) if (Valbuf) return false; // Already done -//Valbuf = (char*)PlugSubAlloc(g, NULL, Long + 1); -//Valbuf[Long] = '\0'; return ParseXpath(g, mode); } // end of AllocBuf @@ -1506,8 +1464,6 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) // HTML like table, columns are retrieved by position new(this) XPOSCOL(Value); // Change the class of this column Inod = -1; -// Tdbp->Hasnod = true; -// return false; } else if (Type == 0 && !mode) { strcat(strcat(pbuf, "@"), Name); } else { // Type == 1 @@ -1657,7 +1613,6 @@ void XMLCOL::WriteColumn(PGLOBAL g) int done = 0; int i, n, k = 0; PXNODE TopNode = NULL; -//PXATTR AttNode = NULL; if (trace > 1) htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n", @@ -1892,7 +1847,6 @@ void XMULCOL::WriteColumn(PGLOBAL g) int done = 0; int i, n, len, k = 0; PXNODE TopNode = NULL; -//PXATTR AttNode = NULL; if (trace) htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n", -- cgit v1.2.1 From 6ef3c7d93edcf342c8be947b3b8f9d1cdcca9a8e Mon Sep 17 00:00:00 2001 From: Vicentiu Ciorbaru Date: Fri, 8 May 2015 17:09:45 +0300 Subject: Updated .gitattributes --- .gitattributes | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitattributes b/.gitattributes index cdfedef671f..2e238207619 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,24 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.c text +*.ic text +*.cc text +*.cpp text +*.h text +*.test text + +# These files should be checked out as is +*.result -text -whitespace +storage/connect/mysql-test/connect/std_data/*.txt -text +storage/connect/mysql-test/connect/std_data/*.dat -text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary + *.c diff=cpp *.h diff=cpp *.cc diff=cpp -- cgit v1.2.1 From 23b2b95f8046aee8461c71926a049accbfcf0dd2 Mon Sep 17 00:00:00 2001 From: Vicentiu Ciorbaru Date: Fri, 8 May 2015 17:19:06 +0300 Subject: Update .gitattributes --- .gitattributes | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 2e238207619..60b9a3481aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,8 +12,6 @@ # These files should be checked out as is *.result -text -whitespace -storage/connect/mysql-test/connect/std_data/*.txt -text -storage/connect/mysql-test/connect/std_data/*.dat -text # Denote all files that are truly binary and should not be modified. *.png binary -- cgit v1.2.1 From 373d092b3a52ead7cc25f5f81a8a480a45a16025 Mon Sep 17 00:00:00 2001 From: Vicentiu Ciorbaru Date: Fri, 8 May 2015 17:19:48 +0300 Subject: Fix win/ files to be stored with LF in repository On Windows, the files get checked out with CRLF thanks to .gitattributes. --- win/packaging/COPYING.rtf | 122 +- win/packaging/CPackWixConfig.cmake | 230 +-- win/packaging/ca/CustomAction.cpp | 84 +- win/packaging/custom_ui.wxs | 364 ++--- win/packaging/extra.wxs.in | 1826 ++++++++++++------------ win/packaging/heidisql.cmake | 46 +- win/packaging/heidisql.wxi.in | 154 +- win/packaging/heidisql_feature.wxi.in | 20 +- win/packaging/mysql_server.wxs.in | 178 +-- win/upgrade_wizard/stdafx.h | 94 +- win/upgrade_wizard/targetver.h | 16 +- win/upgrade_wizard/upgrade.cpp | 114 +- win/upgrade_wizard/upgrade.h | 62 +- win/upgrade_wizard/upgrade.rc | 296 ++-- win/upgrade_wizard/upgradeDlg.h | 146 +- win/upgrade_wizard/upgrade_wizard.exe.manifest | 28 +- 16 files changed, 1890 insertions(+), 1890 deletions(-) diff --git a/win/packaging/COPYING.rtf b/win/packaging/COPYING.rtf index de1f0bbefde..9370fbcaa0c 100644 --- a/win/packaging/COPYING.rtf +++ b/win/packaging/COPYING.rtf @@ -1,61 +1,61 @@ -{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fcharset0 Arial;}} -{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}} -\viewkind4\uc1\pard\s2\sb100\sa100\b\f0\fs24 GNU GENERAL PUBLIC LICENSE\par -\pard\sb100\sa100\b0\fs20 Version 2, June 1991 \par -\pard Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\fs24 \par -\pard\s2\sb100\sa100\b Preamble\par -\pard\sb100\sa100\b0\fs20 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. \par -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. \par -To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. \par -For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. \par -We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. \par -Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. \par -Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. \par -The precise terms and conditions for copying, distribution and modification follow.\fs24 \par -\pard\s2\sb100\sa100\b TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par -\pard\sb100\sa100\b0\fs20 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". \par -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. \par -1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. \par -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. \par -2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: \par -\pard\fi-360\li720\sb100\sa100\tx720\f1\'b7\tab\f0 a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. \par -\pard\fi-360\li720\sb100\sa100\f1\'b7\tab\f0 b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. \par -\f1\'b7\tab\f0 c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) \par -\pard These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. \par -\pard\sb100\sa100 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. \par -In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. \par -3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: \par -\pard\fi-360\li720\sb100\sa100\tx720\f1\'b7\tab\f0 a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \par -\pard\fi-360\li720\sb100\sa100\f1\'b7\tab\f0 b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \par -\f1\'b7\tab\f0 c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) \par -\pard The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. \par -\pard\sb100\sa100 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. \par -4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. \par -5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. \par -6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. \par -7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. \par -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. \par -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. \par -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. \par -8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. \par -9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. \par -Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. \par -10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. \par -NO WARRANTY \par -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. \par -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \par -\pard\s2\sb100\sa100\b\fs24 END OF TERMS AND CONDITIONS \par -How to Apply These Terms to Your New Programs\fs20\par -\pard\sb100\sa100\b0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. \par -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. \par -\pard one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \par -\pard\sb100\sa100 Also add information on how to contact you by electronic and paper mail. \par -If the program is interactive, make it output a short notice like this when it starts in an interactive mode: \par -\pard Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. \par -\pard\sb100\sa100 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c' ; they could even be mouse-clicks or menu items--whatever suits your program. \par -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: \par -\pard Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon , 1 April 1989 Ty Coon, President of Vice \par -\pard\sb100\sa100 This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.\par -\pard\f2\par -} - +{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fcharset0 Arial;}} +{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}} +\viewkind4\uc1\pard\s2\sb100\sa100\b\f0\fs24 GNU GENERAL PUBLIC LICENSE\par +\pard\sb100\sa100\b0\fs20 Version 2, June 1991 \par +\pard Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\fs24 \par +\pard\s2\sb100\sa100\b Preamble\par +\pard\sb100\sa100\b0\fs20 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. \par +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. \par +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. \par +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. \par +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. \par +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. \par +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. \par +The precise terms and conditions for copying, distribution and modification follow.\fs24 \par +\pard\s2\sb100\sa100\b TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par +\pard\sb100\sa100\b0\fs20 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". \par +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. \par +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. \par +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. \par +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: \par +\pard\fi-360\li720\sb100\sa100\tx720\f1\'b7\tab\f0 a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. \par +\pard\fi-360\li720\sb100\sa100\f1\'b7\tab\f0 b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. \par +\f1\'b7\tab\f0 c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) \par +\pard These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. \par +\pard\sb100\sa100 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. \par +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. \par +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: \par +\pard\fi-360\li720\sb100\sa100\tx720\f1\'b7\tab\f0 a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \par +\pard\fi-360\li720\sb100\sa100\f1\'b7\tab\f0 b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, \par +\f1\'b7\tab\f0 c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) \par +\pard The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. \par +\pard\sb100\sa100 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. \par +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. \par +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. \par +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. \par +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. \par +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. \par +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. \par +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. \par +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. \par +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. \par +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. \par +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. \par +NO WARRANTY \par +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. \par +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \par +\pard\s2\sb100\sa100\b\fs24 END OF TERMS AND CONDITIONS \par +How to Apply These Terms to Your New Programs\fs20\par +\pard\sb100\sa100\b0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. \par +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. \par +\pard one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \par +\pard\sb100\sa100 Also add information on how to contact you by electronic and paper mail. \par +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: \par +\pard Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. \par +\pard\sb100\sa100 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c' ; they could even be mouse-clicks or menu items--whatever suits your program. \par +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: \par +\pard Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon , 1 April 1989 Ty Coon, President of Vice \par +\pard\sb100\sa100 This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.\par +\pard\f2\par +} + diff --git a/win/packaging/CPackWixConfig.cmake b/win/packaging/CPackWixConfig.cmake index 356d6ef4b89..33711125701 100644 --- a/win/packaging/CPackWixConfig.cmake +++ b/win/packaging/CPackWixConfig.cmake @@ -1,115 +1,115 @@ - -IF(ESSENTIALS) - SET(CPACK_COMPONENTS_USED "Server;Client") - SET(CPACK_WIX_UI "MyWixUI_Mondo") - IF(CMAKE_SIZEOF_VOID_P MATCHES 8) - SET(CPACK_PACKAGE_FILE_NAME "mariadb-essential-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-winx64") - ELSE() - SET(CPACK_PACKAGE_FILE_NAME "mariadb-essential-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-win32") - ENDIF() -ELSE() - SET(CPACK_COMPONENTS_USED - "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common") -ENDIF() - -SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents") -# Some components like Embedded are optional -# We will build MSI without embedded if it was not selected for build -#(need to modify CPACK_COMPONENTS_ALL for that) -SET(CPACK_ALL) -FOREACH(comp1 ${CPACK_COMPONENTS_USED}) - SET(found) - FOREACH(comp2 ${CPACK_COMPONENTS_ALL}) - IF(comp1 STREQUAL comp2) - SET(found 1) - BREAK() - ENDIF() - ENDFOREACH() - IF(found) - SET(CPACK_ALL ${CPACK_ALL} ${comp1}) - ENDIF() -ENDFOREACH() -SET(CPACK_COMPONENTS_ALL ${CPACK_ALL}) - -# Always install (hidden), includes Readme files -SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1) -SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall") -SET(CPACK_COMPONENT_COMMON_GROUP "AlwaysInstall") - -# Feature MySQL Server -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MariaDB Server") -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1") -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install server") - # Subfeature "Server" (hidden) - SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer") - SET(CPACK_COMPONENT_SERVER_HIDDEN 1) - # Subfeature "Client" - SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer") - SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs") - SET(CPACK_COMPONENT_CLIENT_DESCRIPTION - "Various helpful (commandline) tools including the mysql command line client" ) - # Subfeature "Debug binaries" - SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer") - SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries") - SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION - "Debug/trace versions of executables and libraries" ) - #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) - - - #Subfeature "Data Files" - SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") - SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files") - SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" ) - SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1) - - -#Feature "Devel" -SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components") -SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries") - #Subfeature "Development" - SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel") - SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1) - - #Subfeature "Shared libraries" - SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel") - SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)") - SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library") - - #Subfeature "Embedded" - SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel") - SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library") - SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library") - SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2) - -#Feature Debug Symbols -SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols") -SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols") -SET(CPACK_COMPONENT_DEBUGSYMBOLS_WIX_LEVEL 2) - SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols") - SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1) - -#Feature Documentation -SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") -SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation") -SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2) - -#Feature tests -SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests") -SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)") -SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2) - - -#Feature Misc (hidden, installs only if everything is installed) -SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1) -SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100) - SET(CPACK_COMPONENT_INIFILES_GROUP "Misc") - SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc") - -#Add Firewall exception for mysqld.exe -SET(bin.mysqld.exe.FILE_EXTRA " - - " -) - + +IF(ESSENTIALS) + SET(CPACK_COMPONENTS_USED "Server;Client") + SET(CPACK_WIX_UI "MyWixUI_Mondo") + IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + SET(CPACK_PACKAGE_FILE_NAME "mariadb-essential-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-winx64") + ELSE() + SET(CPACK_PACKAGE_FILE_NAME "mariadb-essential-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-win32") + ENDIF() +ELSE() + SET(CPACK_COMPONENTS_USED + "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common") +ENDIF() + +SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents") +# Some components like Embedded are optional +# We will build MSI without embedded if it was not selected for build +#(need to modify CPACK_COMPONENTS_ALL for that) +SET(CPACK_ALL) +FOREACH(comp1 ${CPACK_COMPONENTS_USED}) + SET(found) + FOREACH(comp2 ${CPACK_COMPONENTS_ALL}) + IF(comp1 STREQUAL comp2) + SET(found 1) + BREAK() + ENDIF() + ENDFOREACH() + IF(found) + SET(CPACK_ALL ${CPACK_ALL} ${comp1}) + ENDIF() +ENDFOREACH() +SET(CPACK_COMPONENTS_ALL ${CPACK_ALL}) + +# Always install (hidden), includes Readme files +SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1) +SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall") +SET(CPACK_COMPONENT_COMMON_GROUP "AlwaysInstall") + +# Feature MySQL Server +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MariaDB Server") +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1") +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install server") + # Subfeature "Server" (hidden) + SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer") + SET(CPACK_COMPONENT_SERVER_HIDDEN 1) + # Subfeature "Client" + SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer") + SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs") + SET(CPACK_COMPONENT_CLIENT_DESCRIPTION + "Various helpful (commandline) tools including the mysql command line client" ) + # Subfeature "Debug binaries" + SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer") + SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries") + SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION + "Debug/trace versions of executables and libraries" ) + #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) + + + #Subfeature "Data Files" + SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") + SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files") + SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" ) + SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1) + + +#Feature "Devel" +SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components") +SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries") + #Subfeature "Development" + SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel") + SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1) + + #Subfeature "Shared libraries" + SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel") + SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)") + SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library") + + #Subfeature "Embedded" + SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel") + SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library") + SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library") + SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2) + +#Feature Debug Symbols +SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols") +SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols") +SET(CPACK_COMPONENT_DEBUGSYMBOLS_WIX_LEVEL 2) + SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols") + SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1) + +#Feature Documentation +SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") +SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation") +SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2) + +#Feature tests +SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests") +SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)") +SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2) + + +#Feature Misc (hidden, installs only if everything is installed) +SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1) +SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100) + SET(CPACK_COMPONENT_INIFILES_GROUP "Misc") + SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc") + +#Add Firewall exception for mysqld.exe +SET(bin.mysqld.exe.FILE_EXTRA " + + " +) + diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 67a17c2cc19..17bfca1debb 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -104,48 +104,48 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen) } pos= 0; - for(int i = 0 ; ; i++) - { - size_t n_backslashes = 0; - wchar_t c; - while (in[i] == L'\\') - { - i++; - n_backslashes++; - } - - c= in[i]; - if (c == 0) - { - /* - Escape all backslashes, but let the terminating double quotation mark - that caller adds be interpreted as a metacharacter. - */ - for(size_t j= 0; j < 2*n_backslashes;j++) - { - out[pos++]=L'\\'; - } - break; - } - else if (c == L'"') - { - /* - Escape all backslashes and the following double quotation mark. - */ - for(size_t j= 0; j < 2*n_backslashes + 1; j++) - { - out[pos++]=L'\\'; - } - out[pos++]= L'"'; - } - else - { - /* Backslashes aren't special here. */ - for (size_t j=0; j < n_backslashes; j++) - out[pos++] = L'\\'; - - out[pos++]= c; - } + for(int i = 0 ; ; i++) + { + size_t n_backslashes = 0; + wchar_t c; + while (in[i] == L'\\') + { + i++; + n_backslashes++; + } + + c= in[i]; + if (c == 0) + { + /* + Escape all backslashes, but let the terminating double quotation mark + that caller adds be interpreted as a metacharacter. + */ + for(size_t j= 0; j < 2*n_backslashes;j++) + { + out[pos++]=L'\\'; + } + break; + } + else if (c == L'"') + { + /* + Escape all backslashes and the following double quotation mark. + */ + for(size_t j= 0; j < 2*n_backslashes + 1; j++) + { + out[pos++]=L'\\'; + } + out[pos++]= L'"'; + } + else + { + /* Backslashes aren't special here. */ + for (size_t j=0; j < n_backslashes; j++) + out[pos++] = L'\\'; + + out[pos++]= c; + } } out[pos++]= 0; } diff --git a/win/packaging/custom_ui.wxs b/win/packaging/custom_ui.wxs index 8a87fb4d246..70fa3ba3abd 100644 --- a/win/packaging/custom_ui.wxs +++ b/win/packaging/custom_ui.wxs @@ -1,183 +1,183 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - 1 - - - - Create default [ProductName] instance - - - - {\WixUI_Font_Title}Default instance properties - - - - - - - Service '[SERVICENAME]' will be removed - - - - Remove default database directory '[DATABASELOCATION]' - - - - - 1 - - - 1 - - - 1 - - - - Remove default [ProductName] database - - - - {\WixUI_Font_Title}Default instance properties - - - - - - - - - - 1 - 1 - - - - WixUI_InstallMode = "Change" - !DBInstance=3 - WixUI_InstallMode = "Remove" - - - - - - - - - - - - - - - - - - SERVICENAME - - - - - - - - - - - - Running mysql_install_db.exe - - - - - - - - - - - - - - - - - - - - - - - - CMDLINE_SERVICENAME - - CMDLINE_DATABASELOCATION - - - - CMDLINE_SERVICENAME - - CMDLINE_DATABASELOCATION - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + 1 + + + + Create default [ProductName] instance + + + + {\WixUI_Font_Title}Default instance properties + + + + + + + Service '[SERVICENAME]' will be removed + + + + Remove default database directory '[DATABASELOCATION]' + + + + + 1 + + + 1 + + + 1 + + + + Remove default [ProductName] database + + + + {\WixUI_Font_Title}Default instance properties + + + + + + + + + + 1 + 1 + + + + WixUI_InstallMode = "Change" + !DBInstance=3 + WixUI_InstallMode = "Remove" + + + + + + + + + + + + + + + + + + SERVICENAME + + + + + + + + + + + + Running mysql_install_db.exe + + + + + + + + + + + + + + + + + + + + + + + + CMDLINE_SERVICENAME + + CMDLINE_DATABASELOCATION + + + + CMDLINE_SERVICENAME + + CMDLINE_DATABASELOCATION + + \ No newline at end of file diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index da4ac6aa9ac..48d15cbf91c 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -1,913 +1,913 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake index f9334f09570..5b0cd07cea4 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -1,23 +1,23 @@ -SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") -SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") -SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") -SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) - -IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) - MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) - MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") - FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} - ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} - ) -ENDIF() - -SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) -IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - # Use our libmysql if it is 32 bit. - IF(LIBMYSQL_LOCATION) - SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") - ENDIF() -ENDIF() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) +SET(HEIDISQL_BASE_NAME "HeidiSQL_9.1_Portable") +SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") +SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") +SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) + +IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) + MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR}) + MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}") + FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR} + ${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} + ) +ENDIF() + +SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) +IF(CMAKE_SIZEOF_VOID_P EQUAL 4) + # Use our libmysql if it is 32 bit. + IF(LIBMYSQL_LOCATION) + SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") + ENDIF() +ENDIF() +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) diff --git a/win/packaging/heidisql.wxi.in b/win/packaging/heidisql.wxi.in index 6b1176921bc..4f07a07627c 100644 --- a/win/packaging/heidisql.wxi.in +++ b/win/packaging/heidisql.wxi.in @@ -1,77 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HEIDISQLINSTALLED - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HEIDISQLINSTALLED + + + + + + + + + + + + + + + + + + diff --git a/win/packaging/heidisql_feature.wxi.in b/win/packaging/heidisql_feature.wxi.in index 3f60fcd8f27..241554e035a 100644 --- a/win/packaging/heidisql_feature.wxi.in +++ b/win/packaging/heidisql_feature.wxi.in @@ -1,10 +1,10 @@ - - - HEIDISQLINSTALLED AND NOT REMOVE ~= ALL - - - + + + HEIDISQLINSTALLED AND NOT REMOVE ~= ALL + + + diff --git a/win/packaging/mysql_server.wxs.in b/win/packaging/mysql_server.wxs.in index 79fde801cf5..c10116830e7 100644 --- a/win/packaging/mysql_server.wxs.in +++ b/win/packaging/mysql_server.wxs.in @@ -1,89 +1,89 @@ - - - - - - - - - - - - - - - - NOT NEWERVERSIONDETECTED OR Installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @CPACK_WIX_FEATURES@ - - - @CPACK_WIX_DIRECTORIES@ - - - @CPACK_WIX_COMPONENTS@ - - - @CPACK_WIX_COMPONENT_GROUPS@ - - - @CPACK_WIX_INCLUDES@ - - - + + + + + + + + + + + + + + + + NOT NEWERVERSIONDETECTED OR Installed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @CPACK_WIX_FEATURES@ + + + @CPACK_WIX_DIRECTORIES@ + + + @CPACK_WIX_COMPONENTS@ + + + @CPACK_WIX_COMPONENT_GROUPS@ + + + @CPACK_WIX_INCLUDES@ + + + diff --git a/win/upgrade_wizard/stdafx.h b/win/upgrade_wizard/stdafx.h index 87db7036005..55f9e71ed70 100644 --- a/win/upgrade_wizard/stdafx.h +++ b/win/upgrade_wizard/stdafx.h @@ -1,47 +1,47 @@ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#ifndef _SECURE_ATL -#define _SECURE_ATL 1 -#endif - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include "targetver.h" - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off MFC's hiding of some common and often safely ignored warning messages -#define _AFX_ALL_WARNINGS - -#include // MFC core and standard components -#include // MFC extensions - - - - - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC support for Internet Explorer 4 Common Controls -#endif -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - - - - - - - - - - - - + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +// turns off MFC's hiding of some common and often safely ignored warning messages +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions + + + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC support for Internet Explorer 4 Common Controls +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + + + + + + + + + + + diff --git a/win/upgrade_wizard/targetver.h b/win/upgrade_wizard/targetver.h index 90e767bfce7..87c0086de75 100644 --- a/win/upgrade_wizard/targetver.h +++ b/win/upgrade_wizard/targetver.h @@ -1,8 +1,8 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/win/upgrade_wizard/upgrade.cpp b/win/upgrade_wizard/upgrade.cpp index aa9efa15ecc..ea2f894c73e 100644 --- a/win/upgrade_wizard/upgrade.cpp +++ b/win/upgrade_wizard/upgrade.cpp @@ -1,57 +1,57 @@ - -// upgrade.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "upgrade.h" -#include "upgradeDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CUpgradeApp - -BEGIN_MESSAGE_MAP(CUpgradeApp, CWinApp) - ON_COMMAND(ID_HELP, &CWinApp::OnHelp) -END_MESSAGE_MAP() - - -// CUpgradeApp construction - -CUpgradeApp::CUpgradeApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - - -// The one and only CUpgradeApp object - -CUpgradeApp theApp; - - -// CUpgradeApp initialization - -BOOL CUpgradeApp::InitInstance() -{ - // InitCommonControlsEx() is required on Windows XP if an application - // manifest specifies use of ComCtl32.dll version 6 or later to enable - // visual styles. Otherwise, any window creation will fail. - INITCOMMONCONTROLSEX InitCtrls; - InitCtrls.dwSize = sizeof(InitCtrls); - // Set this to include all the common control classes you want to use - // in your application. - InitCtrls.dwICC = ICC_WIN95_CLASSES; - - InitCommonControlsEx(&InitCtrls); - CWinApp::InitInstance(); - CUpgradeDlg dlg; - m_pMainWnd = &dlg; - dlg.DoModal(); - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} - + +// upgrade.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "upgrade.h" +#include "upgradeDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CUpgradeApp + +BEGIN_MESSAGE_MAP(CUpgradeApp, CWinApp) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CUpgradeApp construction + +CUpgradeApp::CUpgradeApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + + +// The one and only CUpgradeApp object + +CUpgradeApp theApp; + + +// CUpgradeApp initialization + +BOOL CUpgradeApp::InitInstance() +{ + // InitCommonControlsEx() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // Set this to include all the common control classes you want to use + // in your application. + InitCtrls.dwICC = ICC_WIN95_CLASSES; + + InitCommonControlsEx(&InitCtrls); + CWinApp::InitInstance(); + CUpgradeDlg dlg; + m_pMainWnd = &dlg; + dlg.DoModal(); + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} + diff --git a/win/upgrade_wizard/upgrade.h b/win/upgrade_wizard/upgrade.h index 26c107b6ee8..b5dd10e72e7 100644 --- a/win/upgrade_wizard/upgrade.h +++ b/win/upgrade_wizard/upgrade.h @@ -1,32 +1,32 @@ - -// zzz.h : main header file for the PROJECT_NAME application -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error "include 'stdafx.h' before including this file for PCH" -#endif - -#include "resource.h" // main symbols - - -// CzzzApp: -// See zzz.cpp for the implementation of this class -// - -class CUpgradeApp : public CWinApp -{ -public: - CUpgradeApp(); - -// Overrides -public: - virtual BOOL InitInstance(); - -// Implementation - - DECLARE_MESSAGE_MAP() -}; - + +// zzz.h : main header file for the PROJECT_NAME application +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + + +// CzzzApp: +// See zzz.cpp for the implementation of this class +// + +class CUpgradeApp : public CWinApp +{ +public: + CUpgradeApp(); + +// Overrides +public: + virtual BOOL InitInstance(); + +// Implementation + + DECLARE_MESSAGE_MAP() +}; + extern CUpgradeApp theApp; \ No newline at end of file diff --git a/win/upgrade_wizard/upgrade.rc b/win/upgrade_wizard/upgrade.rc index 30656651b79..dbba9f67e89 100644 --- a/win/upgrade_wizard/upgrade.rc +++ b/win/upgrade_wizard/upgrade.rc @@ -1,148 +1,148 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#ifndef APSTUDIO_INVOKED -#include "targetver.h" -#endif -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#ifndef APSTUDIO_INVOKED\r\n" - "#include ""targetver.h""\r\n" - "#endif\r\n" - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "LANGUAGE 9, 1\r\n" - "#include ""res\\upgrade.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\upgrade.ico" -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_UPGRADE_DIALOG DIALOGEX 0, 0, 320, 200 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "MariaDB Upgrade Wizard" -FONT 8, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,113,169,50,14 - PUSHBUTTON "Cancel",IDCANCEL,191,169,50,14 - LISTBOX IDC_LIST1,24,39,216,80,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,97,124,193,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT2,98,138,181,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,26,153,243,14 - EDITTEXT IDC_EDIT3,98,151,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT7,27,124,65,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT8,27,137,62,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT9,27,151,62,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - PUSHBUTTON "Select all",IDC_BUTTON1,245,61,50,14 - PUSHBUTTON "Clear all",IDC_BUTTON2,246,88,50,14 - LTEXT "Select services you want to upgrade and click on the [Upgrade] button.\nMake sure to backup data directories prior to upgrade.",IDC_STATIC,25,14,215,26 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_UPGRADE_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 313 - TOPMARGIN, 7 - BOTTOMMARGIN, 193 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#include "res\upgrade.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#include ""res\\upgrade.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON "res\\upgrade.ico" +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_UPGRADE_DIALOG DIALOGEX 0, 0, 320, 200 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "MariaDB Upgrade Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,113,169,50,14 + PUSHBUTTON "Cancel",IDCANCEL,191,169,50,14 + LISTBOX IDC_LIST1,24,39,216,80,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_EDIT1,97,124,193,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT2,98,138,181,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,26,153,243,14 + EDITTEXT IDC_EDIT3,98,151,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT7,27,124,65,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT8,27,137,62,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT9,27,151,62,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + PUSHBUTTON "Select all",IDC_BUTTON1,245,61,50,14 + PUSHBUTTON "Clear all",IDC_BUTTON2,246,88,50,14 + LTEXT "Select services you want to upgrade and click on the [Upgrade] button.\nMake sure to backup data directories prior to upgrade.",IDC_STATIC,25,14,215,26 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_UPGRADE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 313 + TOPMARGIN, 7 + BOTTOMMARGIN, 193 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#include "res\upgrade.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win/upgrade_wizard/upgradeDlg.h b/win/upgrade_wizard/upgradeDlg.h index 97243291748..636f94894a7 100644 --- a/win/upgrade_wizard/upgradeDlg.h +++ b/win/upgrade_wizard/upgradeDlg.h @@ -1,73 +1,73 @@ - -// upgradeDlg.h : header file -// - -#pragma once -#include "afxcmn.h" -#include "afxwin.h" -#include - - -// CUpgradeDlg dialog -class CUpgradeDlg : public CDialog -{ - // Construction -public: - CUpgradeDlg(CWnd* pParent = NULL); // standard constructor - - // Dialog Data - enum { IDD = IDD_UPGRADE_DIALOG }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - // job object for current process and children - HANDLE m_JobObject; - - // Services are being upgraded - BOOL m_UpgradeRunning; - - // ProgressBar related: number of services to upgrade - int m_ProgressTotal; - - //ProgressBar related: current service being upgraded - int m_ProgressCurrent; - -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL OnInitDialog(); - void PopulateServicesList(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - DECLARE_MESSAGE_MAP() -public: - void SelectService(int index); - void UpgradeServices(); - void UpgradeOneService(const std::string& name); - void ErrorExit(const char *); - std::string m_InstallDir; - CCheckListBox m_Services; - CProgressCtrl m_Progress; - CButton m_Ok; - CButton m_Cancel; - CButton m_SelectAll; - CButton m_ClearAll; - int m_MajorVersion; - int m_MinorVersion; - int m_PatchVersion; - - CEdit m_IniFilePath; - afx_msg void OnLbnSelchangeList1(); - afx_msg void OnChkChange(); - CEdit m_DataDir; - CEdit m_Version; - afx_msg void OnBnClickedOk(); - afx_msg void OnBnClickedCancel(); - afx_msg void OnBnSelectAll(); - afx_msg void OnBnClearAll(); - CEdit m_IniFileLabel; - CEdit m_DataDirLabel; - CEdit m_VersionLabel; -}; + +// upgradeDlg.h : header file +// + +#pragma once +#include "afxcmn.h" +#include "afxwin.h" +#include + + +// CUpgradeDlg dialog +class CUpgradeDlg : public CDialog +{ + // Construction +public: + CUpgradeDlg(CWnd* pParent = NULL); // standard constructor + + // Dialog Data + enum { IDD = IDD_UPGRADE_DIALOG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + // job object for current process and children + HANDLE m_JobObject; + + // Services are being upgraded + BOOL m_UpgradeRunning; + + // ProgressBar related: number of services to upgrade + int m_ProgressTotal; + + //ProgressBar related: current service being upgraded + int m_ProgressCurrent; + +protected: + HICON m_hIcon; + + // Generated message map functions + virtual BOOL OnInitDialog(); + void PopulateServicesList(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + void SelectService(int index); + void UpgradeServices(); + void UpgradeOneService(const std::string& name); + void ErrorExit(const char *); + std::string m_InstallDir; + CCheckListBox m_Services; + CProgressCtrl m_Progress; + CButton m_Ok; + CButton m_Cancel; + CButton m_SelectAll; + CButton m_ClearAll; + int m_MajorVersion; + int m_MinorVersion; + int m_PatchVersion; + + CEdit m_IniFilePath; + afx_msg void OnLbnSelchangeList1(); + afx_msg void OnChkChange(); + CEdit m_DataDir; + CEdit m_Version; + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnSelectAll(); + afx_msg void OnBnClearAll(); + CEdit m_IniFileLabel; + CEdit m_DataDirLabel; + CEdit m_VersionLabel; +}; diff --git a/win/upgrade_wizard/upgrade_wizard.exe.manifest b/win/upgrade_wizard/upgrade_wizard.exe.manifest index 6b40eebcbd9..ca89deae5c9 100644 --- a/win/upgrade_wizard/upgrade_wizard.exe.manifest +++ b/win/upgrade_wizard/upgrade_wizard.exe.manifest @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.1 From f5d0c7706214922e786369265bd1545c0341924d Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 9 May 2015 17:30:20 +0200 Subject: Get rid of GCC warnings about unused parameters modified: storage/connect/array.cpp modified: storage/connect/blkfil.cpp modified: storage/connect/block.h modified: storage/connect/catalog.h modified: storage/connect/colblk.cpp modified: storage/connect/colblk.h modified: storage/connect/connect.cc modified: storage/connect/filamap.cpp modified: storage/connect/filamdbf.cpp modified: storage/connect/filamfix.cpp modified: storage/connect/filamtxt.cpp modified: storage/connect/filamtxt.h modified: storage/connect/filamvct.cpp modified: storage/connect/filamzip.cpp modified: storage/connect/filter.h modified: storage/connect/ha_connect.c modified: storage/connect/jsonudf.cpp modified: storage/connect/mycat.h modified: storage/connect/myconn.cpp modified: storage/connect/plgdbutl.cpp modified: storage/connect/reldef.cpp modified: storage/connect/reldef.h modified: storage/connect/tabcol.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabfix.cpp modified: storage/connect/tabfmt.cpp modified: storage/connect/tabfmt.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/table.cpp modified: storage/connect/tabmul.cpp modified: storage/connect/tabmysql.cpp modified: storage/connect/tabmysql.h modified: storage/connect/taboccur.cpp modified: storage/connect/tabpivot.cpp modified: storage/connect/tabsys.cpp modified: storage/connect/tabtbl.cpp modified: storage/connect/tabtbl.h modified: storage/connect/tabutil.cpp modified: storage/connect/tabutil.h modified: storage/connect/tabvct.cpp modified: storage/connect/tabvir.cpp modified: storage/connect/tabvir.h modified: storage/connect/tabxcl.cpp modified: storage/connect/tabxcl.h modified: storage/connect/tabxml.cpp modified: storage/connect/tabxml.h modified: storage/connect/valblk.cpp modified: storage/connect/valblk.h modified: storage/connect/value.cpp modified: storage/connect/value.h modified: storage/connect/xindex.cpp modified: storage/connect/xindex.h modified: storage/connect/xobject.h modified: storage/connect/xtable.h --- storage/connect/array.cpp | 6 +- storage/connect/blkfil.cpp | 22 +- storage/connect/block.h | 2 +- storage/connect/catalog.h | 48 ++- storage/connect/colblk.cpp | 834 +++++++++++++++++++++--------------------- storage/connect/colblk.h | 6 +- storage/connect/connect.cc | 4 +- storage/connect/filamap.cpp | 14 +- storage/connect/filamdbf.cpp | 6 +- storage/connect/filamfix.cpp | 7 +- storage/connect/filamtxt.cpp | 12 +- storage/connect/filamtxt.h | 4 +- storage/connect/filamvct.cpp | 16 +- storage/connect/filamzip.cpp | 22 +- storage/connect/filter.h | 4 +- storage/connect/ha_connect.cc | 4 +- storage/connect/jsonudf.cpp | 30 +- storage/connect/mycat.h | 4 +- storage/connect/myconn.cpp | 4 +- storage/connect/plgdbutl.cpp | 2 +- storage/connect/reldef.cpp | 4 +- storage/connect/reldef.h | 4 +- storage/connect/tabcol.cpp | 8 +- storage/connect/tabdos.cpp | 25 +- storage/connect/tabdos.h | 12 +- storage/connect/tabfix.cpp | 4 +- storage/connect/tabfmt.cpp | 6 +- storage/connect/tabfmt.h | 4 +- storage/connect/tabjson.cpp | 18 +- storage/connect/tabjson.h | 2 +- storage/connect/table.cpp | 28 +- storage/connect/tabmul.cpp | 12 +- storage/connect/tabmysql.cpp | 24 +- storage/connect/tabmysql.h | 8 +- storage/connect/taboccur.cpp | 6 +- storage/connect/tabpivot.cpp | 8 +- storage/connect/tabsys.cpp | 56 +-- storage/connect/tabtbl.cpp | 8 +- storage/connect/tabtbl.h | 2 +- storage/connect/tabutil.cpp | 8 +- storage/connect/tabutil.h | 4 +- storage/connect/tabvct.cpp | 8 +- storage/connect/tabvir.cpp | 12 +- storage/connect/tabvir.h | 2 +- storage/connect/tabxcl.cpp | 8 +- storage/connect/tabxcl.h | 2 +- storage/connect/tabxml.cpp | 2 +- storage/connect/tabxml.h | 2 +- storage/connect/valblk.cpp | 6 +- storage/connect/valblk.h | 26 +- storage/connect/value.cpp | 18 +- storage/connect/value.h | 32 +- storage/connect/xindex.cpp | 40 +- storage/connect/xindex.h | 23 +- storage/connect/xobject.h | 4 +- storage/connect/xtable.h | 26 +- 56 files changed, 744 insertions(+), 769 deletions(-) diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index a2f537436c9..437e9af0bdd 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -1,7 +1,7 @@ /************* Array C++ Functions Source Code File (.CPP) *************/ /* Name: ARRAY.CPP Version 2.3 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* This file contains the XOBJECT derived class ARRAY functions. */ /* ARRAY is used for elaborate type of processing, such as sorting */ @@ -848,7 +848,7 @@ void *ARRAY::GetSortIndex(PGLOBAL g) /* the indication of whether the Find will be always true, always not */ /* true or other. */ /***********************************************************************/ -int ARRAY::BlockTest(PGLOBAL g, int opc, int opm, +int ARRAY::BlockTest(PGLOBAL, int opc, int opm, void *minp, void *maxp, bool s) { bool bin, bax, pin, pax, veq, all = (opm == 2); @@ -1038,7 +1038,7 @@ void ARRAY::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of ARRAY contents. */ /***********************************************************************/ -void ARRAY::Print(PGLOBAL g, char *ps, uint z) +void ARRAY::Print(PGLOBAL, char *ps, uint z) { if (z < 16) return; diff --git a/storage/connect/blkfil.cpp b/storage/connect/blkfil.cpp index 802231b24ec..c6fb528aa5f 100644 --- a/storage/connect/blkfil.cpp +++ b/storage/connect/blkfil.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -56,7 +56,7 @@ BLOCKFILTER::BLOCKFILTER(PTDBDOS tdbp, int op) /***********************************************************************/ /* Make file output of BLOCKFILTER contents. */ /***********************************************************************/ -void BLOCKFILTER::Print(PGLOBAL g, FILE *f, uint n) +void BLOCKFILTER::Print(PGLOBAL, FILE *f, uint n) { char m[64]; @@ -70,7 +70,7 @@ void BLOCKFILTER::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of BLOCKFILTER contents. */ /***********************************************************************/ -void BLOCKFILTER::Print(PGLOBAL g, char *ps, uint z) +void BLOCKFILTER::Print(PGLOBAL, char *ps, uint z) { strncat(ps, "BlockFilter(s)", z); } // end of Print @@ -186,7 +186,7 @@ void BLKFILARI::Reset(PGLOBAL g) /***********************************************************************/ /* Evaluate block filter for arithmetic operators. */ /***********************************************************************/ -int BLKFILARI::BlockEval(PGLOBAL g) +int BLKFILARI::BlockEval(PGLOBAL) { int mincmp, maxcmp, n; @@ -306,7 +306,7 @@ void BLKFILAR2::MakeValueBitmap(void) /***********************************************************************/ /* Evaluate XDB2 block filter for arithmetic operators. */ /***********************************************************************/ -int BLKFILAR2::BlockEval(PGLOBAL g) +int BLKFILAR2::BlockEval(PGLOBAL) { #if defined(_DEBUG) assert (Colp->IsClustered()); @@ -428,7 +428,7 @@ void BLKFILMR2::MakeValueBitmap(void) /***********************************************************************/ /* Evaluate XDB2 block filter for arithmetic operators. */ /***********************************************************************/ -int BLKFILMR2::BlockEval(PGLOBAL g) +int BLKFILMR2::BlockEval(PGLOBAL) { #if defined(_DEBUG) assert (Colp->IsClustered()); @@ -514,7 +514,7 @@ void BLKSPCARI::Reset(PGLOBAL g) /***********************************************************************/ /* Evaluate block filter for arithmetic operators (ROWID) */ /***********************************************************************/ -int BLKSPCARI::BlockEval(PGLOBAL g) +int BLKSPCARI::BlockEval(PGLOBAL) { int mincmp, maxcmp, n, m; @@ -605,7 +605,7 @@ BLKFILIN::BLKFILIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp) /***********************************************************************/ /* Reset: have the sorted array reset its Bot value to -1 (bottom). */ /***********************************************************************/ -void BLKFILIN::Reset(PGLOBAL g) +void BLKFILIN::Reset(PGLOBAL) { Arap->Reset(); // MakeValueBitmap(); // Does nothing for class BLKFILIN @@ -736,7 +736,7 @@ void BLKFILIN2::MakeValueBitmap(void) /* ended string in case of string argument. This is because the ARRAY */ /* can have a different width than the char column. */ /***********************************************************************/ -int BLKFILIN2::BlockEval(PGLOBAL g) +int BLKFILIN2::BlockEval(PGLOBAL) { if (N < 0) return Result; // Was set in MakeValueBitmap @@ -909,7 +909,7 @@ int BLKFILIN2::BlockEval(PGLOBAL g) /***********************************************************************/ /* BLKSPCIN constructor. */ /***********************************************************************/ -BLKSPCIN::BLKSPCIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, +BLKSPCIN::BLKSPCIN(PGLOBAL, PTDBDOS tdbp, int op, int opm, PXOB *xp, int bsize) : BLOCKFILTER(tdbp, op) { @@ -930,7 +930,7 @@ BLKSPCIN::BLKSPCIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, /***********************************************************************/ /* Reset: have the sorted array reset its Bot value to -1 (bottom). */ /***********************************************************************/ -void BLKSPCIN::Reset(PGLOBAL g) +void BLKSPCIN::Reset(PGLOBAL) { Arap->Reset(); } // end of Reset diff --git a/storage/connect/block.h b/storage/connect/block.h index d63a899d1f5..40529ffc81f 100644 --- a/storage/connect/block.h +++ b/storage/connect/block.h @@ -50,7 +50,7 @@ class DllExport BLOCK { #if !defined(__BORLANDC__) // Avoid warning C4291 by defining a matching dummy delete operator void operator delete(void *, PGLOBAL, void *) {} - void operator delete(void *ptr,size_t size) {} + void operator delete(void *, size_t) {} #endif virtual ~BLOCK() {} diff --git a/storage/connect/catalog.h b/storage/connect/catalog.h index 5baab294737..6488b513ba9 100644 --- a/storage/connect/catalog.h +++ b/storage/connect/catalog.h @@ -1,7 +1,7 @@ /*************** Catalog H Declares Source Code File (.H) **************/ /* Name: CATALOG.H Version 3.3 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2000-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */ /* */ /* This file contains the CATALOG PlugDB classes definitions. */ /***********************************************************************/ @@ -73,33 +73,29 @@ class DllExport CATALOG { // Methods virtual void Reset(void) {} //virtual void SetDataPath(PGLOBAL g, const char *path) {} - virtual bool CheckName(PGLOBAL g, char *name) {return true;} - virtual bool ClearName(PGLOBAL g, PSZ name) {return true;} - virtual PRELDEF MakeOneTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) {return NULL;} - virtual PRELDEF GetTableDescEx(PGLOBAL g, PTABLE tablep) {return NULL;} - virtual PRELDEF GetTableDesc(PGLOBAL g, LPCSTR name, LPCSTR type, - PRELDEF *prp = NULL) {return NULL;} - virtual PRELDEF GetFirstTable(PGLOBAL g) {return NULL;} - virtual PRELDEF GetNextTable(PGLOBAL g) {return NULL;} - virtual bool TestCond(PGLOBAL g, const char *name, const char *type) - {return true;} - virtual bool DropTable(PGLOBAL g, PSZ name, bool erase) {return true;} - virtual PTDB GetTable(PGLOBAL g, PTABLE tablep, - MODE mode = MODE_READ, LPCSTR type = NULL) - {return NULL;} - virtual void TableNames(PGLOBAL g, char *buffer, int maxbuf, int info[]) {} - virtual void ColumnNames(PGLOBAL g, char *tabname, char *buffer, - int maxbuf, int info[]) {} - virtual void ColumnDefs(PGLOBAL g, char *tabname, char *buffer, - int maxbuf, int info[]) {} - virtual void *DecodeValues(PGLOBAL g, char *tabname, char *colname, - char *buffer, int maxbuf, int info[]) {return NULL;} - virtual int ColumnType(PGLOBAL g, char *tabname, char *colname) {return 0;} - virtual void ClearDB(PGLOBAL g) {} + virtual bool CheckName(PGLOBAL, char*) {return true;} + virtual bool ClearName(PGLOBAL, PSZ) {return true;} + virtual PRELDEF MakeOneTableDesc(PGLOBAL, LPCSTR, LPCSTR) {return NULL;} + virtual PRELDEF GetTableDescEx(PGLOBAL, PTABLE) {return NULL;} + virtual PRELDEF GetTableDesc(PGLOBAL, LPCSTR, LPCSTR, + PRELDEF* = NULL) {return NULL;} + virtual PRELDEF GetFirstTable(PGLOBAL) {return NULL;} + virtual PRELDEF GetNextTable(PGLOBAL) {return NULL;} + virtual bool TestCond(PGLOBAL, const char*, const char*) {return true;} + virtual bool DropTable(PGLOBAL, PSZ, bool) {return true;} + virtual PTDB GetTable(PGLOBAL, PTABLE, + MODE = MODE_READ, LPCSTR = NULL) {return NULL;} + virtual void TableNames(PGLOBAL, char*, int, int[]) {} + virtual void ColumnNames(PGLOBAL, char*, char*, int, int[]) {} + virtual void ColumnDefs(PGLOBAL, char*, char*, int, int[]) {} + virtual void *DecodeValues(PGLOBAL, char*, char*, char*, + int, int[]) {return NULL;} + virtual int ColumnType(PGLOBAL, char*, char*) {return 0;} + virtual void ClearDB(PGLOBAL) {} protected: - virtual bool ClearSection(PGLOBAL g, const char *key, const char *section) {return true;} - virtual PRELDEF MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) {return NULL;} + virtual bool ClearSection(PGLOBAL, const char*, const char*) {return true;} + virtual PRELDEF MakeTableDesc(PGLOBAL, LPCSTR, LPCSTR) {return NULL;} // Members char *Cbuf; /* Buffer used for col section */ diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index 78aba7bc494..7166af8027b 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -1,417 +1,417 @@ -/************* Colblk C++ Functions Source Code File (.CPP) ************/ -/* Name: COLBLK.CPP Version 2.1 */ -/* */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ -/* */ -/* This file contains the COLBLK class functions. */ -/***********************************************************************/ - -/***********************************************************************/ -/* Include relevant MariaDB header file. */ -/***********************************************************************/ -#include "my_global.h" - -/***********************************************************************/ -/* Include required application header files */ -/* global.h is header containing all global Plug declarations. */ -/* plgdbsem.h is header containing the DB applic. declarations. */ -/***********************************************************************/ -#include "global.h" -#include "plgdbsem.h" -#include "tabcol.h" -#include "colblk.h" -#include "xindex.h" -#include "xtable.h" - -/***********************************************************************/ -/* COLBLK protected constructor. */ -/***********************************************************************/ -COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i) - { - Next = NULL; - Index = i; -//Number = 0; - ColUse = 0; - - if ((Cdp = cdp)) { - Name = cdp->Name; - Format = cdp->F; - Opt = cdp->Opt; - Long = cdp->Long; - Precision = cdp->Precision; - Freq = cdp->Freq; - Buf_Type = cdp->Buf_Type; - ColUse |= cdp->Flags; // Used by CONNECT - Nullable = !!(cdp->Flags & U_NULLS); - Unsigned = !!(cdp->Flags & U_UNSIGNED); - } else { - Name = NULL; - memset(&Format, 0, sizeof(FORMAT)); - Opt = 0; - Long = 0; - Precision = 0; - Freq = 0; - Buf_Type = TYPE_ERROR; - Nullable = false; - Unsigned = false; - } // endif cdp - - To_Tdb = tdbp; - Status = BUF_NO; -//Value = NULL; done in XOBJECT constructor - To_Kcol = NULL; - } // end of COLBLK constructor - -/***********************************************************************/ -/* COLBLK constructor used for copying columns. */ -/* tdbp is the pointer to the new table descriptor. */ -/***********************************************************************/ -COLBLK::COLBLK(PCOL col1, PTDB tdbp) - { - PCOL colp; - - // Copy the old column block to the new one - *this = *col1; - Next = NULL; -//To_Orig = col1; - To_Tdb = tdbp; - - if (trace > 1) - htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); - - if (tdbp) - // Attach the new column to the table block - if (!tdbp->GetColumns()) - tdbp->SetColumns(this); - else { - for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ; - - colp->Next = this; - } // endelse - - } // end of COLBLK copy constructor - -/***********************************************************************/ -/* Reset the column descriptor to non evaluated yet. */ -/***********************************************************************/ -void COLBLK::Reset(void) - { - Status &= ~BUF_READ; - } // end of Reset - -/***********************************************************************/ -/* Compare: compares itself to an (expression) object and returns */ -/* true if it is equivalent. */ -/***********************************************************************/ -bool COLBLK::Compare(PXOB xp) - { - return (this == xp); - } // end of Compare - -/***********************************************************************/ -/* SetFormat: function used to set SELECT output format. */ -/***********************************************************************/ -bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt) - { - fmt = Format; - - if (trace > 1) - htrc("COLBLK: %p format=%c(%d,%d)\n", - this, *fmt.Type, fmt.Length, fmt.Prec); - - return false; - } // end of SetFormat - -/***********************************************************************/ -/* Eval: get the column value from the last read record or from a */ -/* matching Index column if there is one. */ -/***********************************************************************/ -bool COLBLK::Eval(PGLOBAL g) - { - if (trace > 1) - htrc("Col Eval: %s status=%.4X\n", Name, Status); - - if (!GetStatus(BUF_READ)) { -// if (To_Tdb->IsNull()) -// Value->Reset(); - if (To_Kcol) - To_Kcol->FillValue(Value); - else - ReadColumn(g); - - AddStatus(BUF_READ); - } // endif - - return false; - } // end of Eval - -/***********************************************************************/ -/* InitValue: prepare a column block for read operation. */ -/* Now we use Format.Length for the len parameter to avoid strings */ -/* to be truncated when converting from string to coded string. */ -/* Added in version 1.5 is the arguments GetScale() and Domain */ -/* in calling AllocateValue. Domain is used for TYPE_DATE only. */ -/***********************************************************************/ -bool COLBLK::InitValue(PGLOBAL g) - { - if (Value) - return false; // Already done - - // Allocate a Value object - if (!(Value = AllocateValue(g, Buf_Type, Precision, - GetScale(), Unsigned, GetDomain()))) - return true; - - AddStatus(BUF_READY); - Value->SetNullable(Nullable); - - if (trace > 1) - htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n", - this, Buf_Type, Value, ColUse, Status); - - return false; - } // end of InitValue - -/***********************************************************************/ -/* SetBuffer: prepare a column block for write operation. */ -/***********************************************************************/ -bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer"); - return true; - } // end of SetBuffer - -/***********************************************************************/ -/* GetLength: returns an evaluation of the column string length. */ -/***********************************************************************/ -int COLBLK::GetLengthEx(void) - { - return Long; - } // end of GetLengthEx - -/***********************************************************************/ -/* ReadColumn: what this routine does is to access the last line */ -/* read from the corresponding table, extract from it the field */ -/* corresponding to this column and convert it to buffer type. */ -/***********************************************************************/ -void COLBLK::ReadColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn"); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of ReadColumn - -/***********************************************************************/ -/* WriteColumn: what this routine does is to access the last line */ -/* read from the corresponding table, and rewrite the field */ -/* corresponding to this column from the column buffer and type. */ -/***********************************************************************/ -void COLBLK::WriteColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn"); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of WriteColumn - -/***********************************************************************/ -/* Make file output of a column descriptor block. */ -/***********************************************************************/ -void COLBLK::Print(PGLOBAL g, FILE *f, uint n) - { - char m[64]; - int i; - PCOL colp; - - memset(m, ' ', n); // Make margin string - m[n] = '\0'; - - for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++) - if (colp == this) - break; - - fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(), - i, GetAmType(), Format.Type, Format.Length, Format.Prec); - fprintf(f, - " coluse=%04X status=%04X buftyp=%d value=%p name=%s\n", - ColUse, Status, Buf_Type, Value, Name); - } // end of Print - -/***********************************************************************/ -/* Make string output of a column descriptor block. */ -/***********************************************************************/ -void COLBLK::Print(PGLOBAL g, char *ps, uint z) - { - sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); - } // end of Print - - -/***********************************************************************/ -/* SPCBLK constructor. */ -/***********************************************************************/ -SPCBLK::SPCBLK(PCOLUMN cp) - : COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0) - { - Name = (char*)cp->GetName(); - Precision = Long = 0; - Buf_Type = TYPE_ERROR; - } // end of SPCBLK constructor - -/***********************************************************************/ -/* WriteColumn: what this routine does is to access the last line */ -/* read from the corresponding table, and rewrite the field */ -/* corresponding to this column from the column buffer and type. */ -/***********************************************************************/ -void SPCBLK::WriteColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(SPCOL_READONLY), Name); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of WriteColumn - -/***********************************************************************/ -/* RIDBLK constructor for the ROWID special column. */ -/***********************************************************************/ -RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp) - { - Precision = Long = 10; - Buf_Type = TYPE_INT; - Rnm = rnm; - *Format.Type = 'N'; - Format.Length = 10; - } // end of RIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the ordinal */ -/* number of the current row in the table (if Rnm is true) or in the */ -/* current file (if Rnm is false) the same except for multiple tables.*/ -/***********************************************************************/ -void RIDBLK::ReadColumn(PGLOBAL g) - { - Value->SetValue(To_Tdb->RowNumber(g, Rnm)); - } // end of ReadColumn - -/***********************************************************************/ -/* FIDBLK constructor for the FILEID special column. */ -/***********************************************************************/ -FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = _MAX_PATH; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; -#if defined(WIN32) - Format.Prec = 1; // Case insensitive -#endif // WIN32 - Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && - To_Tdb->GetAmType() != TYPE_AM_PLG && - To_Tdb->GetAmType() != TYPE_AM_PLM); - Fn = NULL; - } // end of FIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the current */ -/* file ID of the table (can change for Multiple tables). */ -/***********************************************************************/ -void FIDBLK::ReadColumn(PGLOBAL g) - { - if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) { - char filename[_MAX_PATH]; - - Fn = ((PTDBASE)To_Tdb)->GetFile(g); - PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath()); - - if (Op != OP_XX) { - char buff[_MAX_PATH]; - - Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op)); - } else - Value->SetValue_psz(filename); - - } // endif Fn - - } // end of ReadColumn - -/***********************************************************************/ -/* TIDBLK constructor for the TABID special column. */ -/***********************************************************************/ -TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); - Tname = NULL; - } // end of TIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the table ID. */ -/***********************************************************************/ -void TIDBLK::ReadColumn(PGLOBAL g) - { - if (Tname == NULL) { - Tname = (char*)To_Tdb->GetName(); - Value->SetValue_psz(Tname); - } // endif Tname - - } // end of ReadColumn - -/***********************************************************************/ -/* PRTBLK constructor for the PARTID special column. */ -/***********************************************************************/ -PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = true; // TODO: check whether this is true indeed - Pname = NULL; - } // end of PRTBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the partition ID. */ -/***********************************************************************/ -void PRTBLK::ReadColumn(PGLOBAL g) - { - if (Pname == NULL) { - char *p; - PTDBASE tdbp = (PTDBASE)To_Tdb; - - Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?"); - - p = strrchr(Pname, '#'); - Value->SetValue_psz((p) ? p + 1 : Pname); - } // endif Pname - - } // end of ReadColumn - -/***********************************************************************/ -/* SIDBLK constructor for the SERVID special column. */ -/***********************************************************************/ -SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); - Sname = NULL; - } // end of TIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the server ID. */ -/***********************************************************************/ -void SIDBLK::ReadColumn(PGLOBAL g) - { -//if (Sname == NULL) { - Sname = (char*)To_Tdb->GetServer(); - Value->SetValue_psz(Sname); -// } // endif Sname - - } // end of ReadColumn - +/************* Colblk C++ Functions Source Code File (.CPP) ************/ +/* Name: COLBLK.CPP Version 2.1 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ +/* */ +/* This file contains the COLBLK class functions. */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant MariaDB header file. */ +/***********************************************************************/ +#include "my_global.h" + +/***********************************************************************/ +/* Include required application header files */ +/* global.h is header containing all global Plug declarations. */ +/* plgdbsem.h is header containing the DB applic. declarations. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +#include "tabcol.h" +#include "colblk.h" +#include "xindex.h" +#include "xtable.h" + +/***********************************************************************/ +/* COLBLK protected constructor. */ +/***********************************************************************/ +COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i) + { + Next = NULL; + Index = i; +//Number = 0; + ColUse = 0; + + if ((Cdp = cdp)) { + Name = cdp->Name; + Format = cdp->F; + Opt = cdp->Opt; + Long = cdp->Long; + Precision = cdp->Precision; + Freq = cdp->Freq; + Buf_Type = cdp->Buf_Type; + ColUse |= cdp->Flags; // Used by CONNECT + Nullable = !!(cdp->Flags & U_NULLS); + Unsigned = !!(cdp->Flags & U_UNSIGNED); + } else { + Name = NULL; + memset(&Format, 0, sizeof(FORMAT)); + Opt = 0; + Long = 0; + Precision = 0; + Freq = 0; + Buf_Type = TYPE_ERROR; + Nullable = false; + Unsigned = false; + } // endif cdp + + To_Tdb = tdbp; + Status = BUF_NO; +//Value = NULL; done in XOBJECT constructor + To_Kcol = NULL; + } // end of COLBLK constructor + +/***********************************************************************/ +/* COLBLK constructor used for copying columns. */ +/* tdbp is the pointer to the new table descriptor. */ +/***********************************************************************/ +COLBLK::COLBLK(PCOL col1, PTDB tdbp) + { + PCOL colp; + + // Copy the old column block to the new one + *this = *col1; + Next = NULL; +//To_Orig = col1; + To_Tdb = tdbp; + + if (trace > 1) + htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); + + if (tdbp) + // Attach the new column to the table block + if (!tdbp->GetColumns()) + tdbp->SetColumns(this); + else { + for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ; + + colp->Next = this; + } // endelse + + } // end of COLBLK copy constructor + +/***********************************************************************/ +/* Reset the column descriptor to non evaluated yet. */ +/***********************************************************************/ +void COLBLK::Reset(void) + { + Status &= ~BUF_READ; + } // end of Reset + +/***********************************************************************/ +/* Compare: compares itself to an (expression) object and returns */ +/* true if it is equivalent. */ +/***********************************************************************/ +bool COLBLK::Compare(PXOB xp) + { + return (this == xp); + } // end of Compare + +/***********************************************************************/ +/* SetFormat: function used to set SELECT output format. */ +/***********************************************************************/ +bool COLBLK::SetFormat(PGLOBAL, FORMAT& fmt) + { + fmt = Format; + + if (trace > 1) + htrc("COLBLK: %p format=%c(%d,%d)\n", + this, *fmt.Type, fmt.Length, fmt.Prec); + + return false; + } // end of SetFormat + +/***********************************************************************/ +/* Eval: get the column value from the last read record or from a */ +/* matching Index column if there is one. */ +/***********************************************************************/ +bool COLBLK::Eval(PGLOBAL g) + { + if (trace > 1) + htrc("Col Eval: %s status=%.4X\n", Name, Status); + + if (!GetStatus(BUF_READ)) { +// if (To_Tdb->IsNull()) +// Value->Reset(); + if (To_Kcol) + To_Kcol->FillValue(Value); + else + ReadColumn(g); + + AddStatus(BUF_READ); + } // endif + + return false; + } // end of Eval + +/***********************************************************************/ +/* InitValue: prepare a column block for read operation. */ +/* Now we use Format.Length for the len parameter to avoid strings */ +/* to be truncated when converting from string to coded string. */ +/* Added in version 1.5 is the arguments GetScale() and Domain */ +/* in calling AllocateValue. Domain is used for TYPE_DATE only. */ +/***********************************************************************/ +bool COLBLK::InitValue(PGLOBAL g) + { + if (Value) + return false; // Already done + + // Allocate a Value object + if (!(Value = AllocateValue(g, Buf_Type, Precision, + GetScale(), Unsigned, GetDomain()))) + return true; + + AddStatus(BUF_READY); + Value->SetNullable(Nullable); + + if (trace > 1) + htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n", + this, Buf_Type, Value, ColUse, Status); + + return false; + } // end of InitValue + +/***********************************************************************/ +/* SetBuffer: prepare a column block for write operation. */ +/***********************************************************************/ +bool COLBLK::SetBuffer(PGLOBAL g, PVAL, bool, bool) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer"); + return true; + } // end of SetBuffer + +/***********************************************************************/ +/* GetLength: returns an evaluation of the column string length. */ +/***********************************************************************/ +int COLBLK::GetLengthEx(void) + { + return Long; + } // end of GetLengthEx + +/***********************************************************************/ +/* ReadColumn: what this routine does is to access the last line */ +/* read from the corresponding table, extract from it the field */ +/* corresponding to this column and convert it to buffer type. */ +/***********************************************************************/ +void COLBLK::ReadColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn"); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of ReadColumn + +/***********************************************************************/ +/* WriteColumn: what this routine does is to access the last line */ +/* read from the corresponding table, and rewrite the field */ +/* corresponding to this column from the column buffer and type. */ +/***********************************************************************/ +void COLBLK::WriteColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn"); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of WriteColumn + +/***********************************************************************/ +/* Make file output of a column descriptor block. */ +/***********************************************************************/ +void COLBLK::Print(PGLOBAL, FILE *f, uint n) + { + char m[64]; + int i; + PCOL colp; + + memset(m, ' ', n); // Make margin string + m[n] = '\0'; + + for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++) + if (colp == this) + break; + + fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(), + i, GetAmType(), Format.Type, Format.Length, Format.Prec); + fprintf(f, + " coluse=%04X status=%04X buftyp=%d value=%p name=%s\n", + ColUse, Status, Buf_Type, Value, Name); + } // end of Print + +/***********************************************************************/ +/* Make string output of a column descriptor block. */ +/***********************************************************************/ +void COLBLK::Print(PGLOBAL, char *ps, uint) + { + sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); + } // end of Print + + +/***********************************************************************/ +/* SPCBLK constructor. */ +/***********************************************************************/ +SPCBLK::SPCBLK(PCOLUMN cp) + : COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0) + { + Name = (char*)cp->GetName(); + Precision = Long = 0; + Buf_Type = TYPE_ERROR; + } // end of SPCBLK constructor + +/***********************************************************************/ +/* WriteColumn: what this routine does is to access the last line */ +/* read from the corresponding table, and rewrite the field */ +/* corresponding to this column from the column buffer and type. */ +/***********************************************************************/ +void SPCBLK::WriteColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(SPCOL_READONLY), Name); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of WriteColumn + +/***********************************************************************/ +/* RIDBLK constructor for the ROWID special column. */ +/***********************************************************************/ +RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp) + { + Precision = Long = 10; + Buf_Type = TYPE_INT; + Rnm = rnm; + *Format.Type = 'N'; + Format.Length = 10; + } // end of RIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the ordinal */ +/* number of the current row in the table (if Rnm is true) or in the */ +/* current file (if Rnm is false) the same except for multiple tables.*/ +/***********************************************************************/ +void RIDBLK::ReadColumn(PGLOBAL g) + { + Value->SetValue(To_Tdb->RowNumber(g, Rnm)); + } // end of ReadColumn + +/***********************************************************************/ +/* FIDBLK constructor for the FILEID special column. */ +/***********************************************************************/ +FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = _MAX_PATH; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; +#if defined(WIN32) + Format.Prec = 1; // Case insensitive +#endif // WIN32 + Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && + To_Tdb->GetAmType() != TYPE_AM_PLG && + To_Tdb->GetAmType() != TYPE_AM_PLM); + Fn = NULL; + } // end of FIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the current */ +/* file ID of the table (can change for Multiple tables). */ +/***********************************************************************/ +void FIDBLK::ReadColumn(PGLOBAL g) + { + if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) { + char filename[_MAX_PATH]; + + Fn = ((PTDBASE)To_Tdb)->GetFile(g); + PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath()); + + if (Op != OP_XX) { + char buff[_MAX_PATH]; + + Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op)); + } else + Value->SetValue_psz(filename); + + } // endif Fn + + } // end of ReadColumn + +/***********************************************************************/ +/* TIDBLK constructor for the TABID special column. */ +/***********************************************************************/ +TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); + Tname = NULL; + } // end of TIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the table ID. */ +/***********************************************************************/ +void TIDBLK::ReadColumn(PGLOBAL) + { + if (Tname == NULL) { + Tname = (char*)To_Tdb->GetName(); + Value->SetValue_psz(Tname); + } // endif Tname + + } // end of ReadColumn + +/***********************************************************************/ +/* PRTBLK constructor for the PARTID special column. */ +/***********************************************************************/ +PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = true; // TODO: check whether this is true indeed + Pname = NULL; + } // end of PRTBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the partition ID. */ +/***********************************************************************/ +void PRTBLK::ReadColumn(PGLOBAL g) + { + if (Pname == NULL) { + char *p; + PTDBASE tdbp = (PTDBASE)To_Tdb; + + Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?"); + + p = strrchr(Pname, '#'); + Value->SetValue_psz((p) ? p + 1 : Pname); + } // endif Pname + + } // end of ReadColumn + +/***********************************************************************/ +/* SIDBLK constructor for the SERVID special column. */ +/***********************************************************************/ +SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); + Sname = NULL; + } // end of TIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the server ID. */ +/***********************************************************************/ +void SIDBLK::ReadColumn(PGLOBAL) + { +//if (Sname == NULL) { + Sname = (char*)To_Tdb->GetServer(); + Value->SetValue_psz(Sname); +// } // endif Sname + + } // end of ReadColumn + diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h index 5e8dc77ff69..c64f9d95129 100644 --- a/storage/connect/colblk.h +++ b/storage/connect/colblk.h @@ -1,7 +1,7 @@ /*************** Colblk H Declares Source Code File (.H) ***************/ /* Name: COLBLK.H Version 1.7 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* This file contains the COLBLK and derived classes declares. */ /***********************************************************************/ @@ -23,7 +23,7 @@ class DllExport COLBLK : public XOBJECT { // Default constructors used by derived classes COLBLK(PCOLDEF cdp = NULL, PTDB tdbp = NULL, int i = 0); COLBLK(PCOL colp, PTDB tdbp = NULL); // Used in copy process - COLBLK(int n) {} // Used when changing a column class in TDBXML + COLBLK(int) {} // Used when changing a column class in TDBXML public: // Implementation @@ -69,7 +69,7 @@ class DllExport COLBLK : public XOBJECT { virtual bool IsSpecial(void) {return false;} virtual bool Eval(PGLOBAL g); virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); - virtual void SetTo_Val(PVAL valp) {} + virtual void SetTo_Val(PVAL) {} virtual void ReadColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g); virtual void Print(PGLOBAL g, FILE *, uint); diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 7c32c65226d..12b23878891 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2012 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -237,7 +237,7 @@ PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h) /* OPENTAB: Open a Table. */ /***********************************************************************/ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, - bool del, PHC h) + bool del, PHC) { char *p; int i, n, rc; diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp index 1e65fa2a413..cac34827b7a 100644 --- a/storage/connect/filamap.cpp +++ b/storage/connect/filamap.cpp @@ -276,7 +276,7 @@ bool MAPFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Record file position in case of UPDATE or DELETE. */ /***********************************************************************/ -bool MAPFAM::RecordPos(PGLOBAL g) +bool MAPFAM::RecordPos(PGLOBAL) { Fpos = Mempos; return false; @@ -285,7 +285,7 @@ bool MAPFAM::RecordPos(PGLOBAL g) /***********************************************************************/ /* Initialize Fpos and Mempos for indexed DELETE. */ /***********************************************************************/ -int MAPFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int MAPFAM::InitDelete(PGLOBAL, int fpos, int spos) { Fpos = Memory + (ptrdiff_t)fpos; Mempos = Memory + (ptrdiff_t)spos; @@ -371,7 +371,7 @@ int MAPFAM::ReadBuffer(PGLOBAL g) /***********************************************************************/ /* WriteBuffer: File write routine for MAP access method. */ /***********************************************************************/ -int MAPFAM::WriteBuffer(PGLOBAL g) +int MAPFAM::WriteBuffer(PGLOBAL g __attribute__((unused))) { #if defined(_DEBUG) // Insert mode is no more handled using file mapping @@ -495,7 +495,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Table file close routine for MAP access method. */ /***********************************************************************/ -void MAPFAM::CloseTableFile(PGLOBAL g, bool abort) +void MAPFAM::CloseTableFile(PGLOBAL g, bool) { PlugCloseFile(g, To_Fb); To_Fb = NULL; // To get correct file size in Cardinality @@ -551,7 +551,7 @@ int MBKFAM::Cardinality(PGLOBAL g) /***********************************************************************/ /* Skip one record in file. */ /***********************************************************************/ -int MBKFAM::SkipRecord(PGLOBAL g, bool header) +int MBKFAM::SkipRecord(PGLOBAL, bool) { return RC_OK; } // end of SkipRecord @@ -685,7 +685,7 @@ bool MPXFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Initialize CurBlk, CurNum, Mempos and Fpos for indexed DELETE. */ /***********************************************************************/ -int MPXFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int MPXFAM::InitDelete(PGLOBAL, int fpos, int) { Fpos = Memory + Headlen + (ptrdiff_t)fpos * Lrecl; Mempos = Fpos + Lrecl; @@ -740,7 +740,7 @@ int MPXFAM::ReadBuffer(PGLOBAL g) /***********************************************************************/ /* WriteBuffer: File write routine for MAP access method. */ /***********************************************************************/ -int MPXFAM::WriteBuffer(PGLOBAL g) +int MPXFAM::WriteBuffer(PGLOBAL g __attribute__((unused))) { #if defined(_DEBUG) // Insert mode is no more handled using file mapping diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 7acbba309b2..8a88b743a15 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -1,11 +1,11 @@ /*********** File AM Dbf C++ Program Source Code File (.CPP) ****************/ /* PROGRAM NAME: FILAMDBF */ /* ------------- */ -/* Version 1.7 */ +/* Version 1.8 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -1011,7 +1011,7 @@ int DBMFAM::ReadBuffer(PGLOBAL g) /* Data Base delete line routine for DBF access methods. */ /* Deleted lines are just flagged in the first buffer character. */ /****************************************************************************/ -int DBMFAM::DeleteRecords(PGLOBAL g, int irc) +int DBMFAM::DeleteRecords(PGLOBAL, int irc) { if (irc == RC_OK) *Fpos = '*'; diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index 980d558eee5..4dedd3375b0 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -102,7 +102,7 @@ bool FIXFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Initialize CurBlk and CurNum for indexed DELETE. */ /***********************************************************************/ -int FIXFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int FIXFAM::InitDelete(PGLOBAL, int fpos, int) { CurBlk = fpos / Nrec; CurNum = fpos % Nrec; @@ -690,7 +690,8 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) /***********************************************************************/ /* Read from a big file. */ /***********************************************************************/ -int BGXFAM::BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req) +int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)), + HANDLE h, void *inbuf, int req) { int rc; diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index eb4e026ee8a..cce9cec56bd 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -436,7 +436,7 @@ err: /* The purpose of this function is to deal with access methods that */ /* are not coherent regarding the use of SetPos and GetPos. */ /***********************************************************************/ -int TXTFAM::InitDelete(PGLOBAL g, int fpos, int spos) +int TXTFAM::InitDelete(PGLOBAL g, int, int) { strcpy(g->Message, "InitDelete should not be used by this table type"); return RC_FX; @@ -519,7 +519,7 @@ int DOSFAM::Cardinality(PGLOBAL g) /* Use BlockTest to reduce the table estimated size. */ /* Note: This function is not really implemented yet. */ /***********************************************************************/ -int DOSFAM::MaxBlkSize(PGLOBAL g, int s) +int DOSFAM::MaxBlkSize(PGLOBAL, int s) { return s; } // end of MaxBlkSize @@ -1272,7 +1272,7 @@ int BLKFAM::Cardinality(PGLOBAL g) /***********************************************************************/ /* Use BlockTest to reduce the table estimated size. */ /***********************************************************************/ -int BLKFAM::MaxBlkSize(PGLOBAL g, int s) +int BLKFAM::MaxBlkSize(PGLOBAL g, int) { int rc = RC_OK, savcur = CurBlk; int size; @@ -1343,7 +1343,7 @@ int BLKFAM::GetNextPos(void) /***********************************************************************/ /* SetPos: Replace the table at the specified position. */ /***********************************************************************/ -bool BLKFAM::SetPos(PGLOBAL g, int pos) +bool BLKFAM::SetPos(PGLOBAL g, int) { strcpy(g->Message, "Blocked variable tables cannot be used indexed"); return true; @@ -1353,7 +1353,7 @@ bool BLKFAM::SetPos(PGLOBAL g, int pos) /* Record file position in case of UPDATE or DELETE. */ /* Not used yet for blocked tables. */ /***********************************************************************/ -bool BLKFAM::RecordPos(PGLOBAL g) +bool BLKFAM::RecordPos(PGLOBAL) { Fpos = (CurNum + Nrec * CurBlk); // Computed file index return false; @@ -1362,7 +1362,7 @@ bool BLKFAM::RecordPos(PGLOBAL g) /***********************************************************************/ /* Skip one record in file. */ /***********************************************************************/ -int BLKFAM::SkipRecord(PGLOBAL g, bool header) +int BLKFAM::SkipRecord(PGLOBAL, bool header) { if (header) { // For Delete diff --git a/storage/connect/filamtxt.h b/storage/connect/filamtxt.h index 1c8ea1e3a6c..ae8f74a9830 100644 --- a/storage/connect/filamtxt.h +++ b/storage/connect/filamtxt.h @@ -57,8 +57,8 @@ class DllExport TXTFAM : public BLOCK { virtual int GetFileLength(PGLOBAL g); virtual int Cardinality(PGLOBAL g); virtual int MaxBlkSize(PGLOBAL g, int s); - virtual bool AllocateBuffer(PGLOBAL g) {return false;} - virtual void ResetBuffer(PGLOBAL g) {} + virtual bool AllocateBuffer(PGLOBAL) {return false;} + virtual void ResetBuffer(PGLOBAL) {} virtual int GetNerr(void) {return 0;} virtual int GetRowID(void) = 0; virtual bool RecordPos(PGLOBAL g) = 0; diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index e1f11bbf4cf..60a8875e015 100755 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -279,7 +279,7 @@ bool VCTFAM::SetBlockInfo(PGLOBAL g) /***********************************************************************/ /* Use BlockTest to reduce the table estimated size. */ /***********************************************************************/ -int VCTFAM::MaxBlkSize(PGLOBAL g, int s) +int VCTFAM::MaxBlkSize(PGLOBAL g, int) { int rc = RC_OK, savcur = CurBlk; int size; @@ -1716,7 +1716,7 @@ int VCMFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Move intermediate deleted or updated lines. */ /***********************************************************************/ -bool VCMFAM::MoveIntermediateLines(PGLOBAL g, bool *b) +bool VCMFAM::MoveIntermediateLines(PGLOBAL, bool *) { int i, m, n; @@ -1765,7 +1765,7 @@ bool VCMFAM::MoveIntermediateLines(PGLOBAL g, bool *b) /***********************************************************************/ /* Data Base close routine for VMP access method. */ /***********************************************************************/ -void VCMFAM::CloseTableFile(PGLOBAL g, bool abort) +void VCMFAM::CloseTableFile(PGLOBAL g, bool) { int wrc = RC_OK; MODE mode = Tdbp->GetMode(); @@ -1800,7 +1800,7 @@ void VCMFAM::CloseTableFile(PGLOBAL g, bool abort) /***********************************************************************/ /* ReadBlock: Read column values from current block. */ /***********************************************************************/ -bool VCMFAM::ReadBlock(PGLOBAL g, PVCTCOL colp) +bool VCMFAM::ReadBlock(PGLOBAL, PVCTCOL colp) { char *mempos; int i = colp->Index - 1; @@ -1830,7 +1830,7 @@ bool VCMFAM::ReadBlock(PGLOBAL g, PVCTCOL colp) /* the mapped file, except when checking for Update but in this case */ /* we do not want to write back the modifications either. */ /***********************************************************************/ -bool VCMFAM::WriteBlock(PGLOBAL g, PVCTCOL colp) +bool VCMFAM::WriteBlock(PGLOBAL, PVCTCOL colp __attribute__((unused))) { #if defined(_DEBUG) char *mempos; @@ -2124,7 +2124,7 @@ bool VECFAM::AllocateBuffer(PGLOBAL g) /***********************************************************************/ /* Do initial action when inserting. */ /***********************************************************************/ -bool VECFAM::InitInsert(PGLOBAL g) +bool VECFAM::InitInsert(PGLOBAL) { // We come here in MODE_INSERT only CurBlk = 0; @@ -2365,7 +2365,7 @@ bool VECFAM::MoveLines(PGLOBAL g) /***********************************************************************/ /* Move intermediate deleted or updated lines. */ /***********************************************************************/ -bool VECFAM::MoveIntermediateLines(PGLOBAL g, bool *bn) +bool VECFAM::MoveIntermediateLines(PGLOBAL g, bool *) { int i, n; bool b = false; @@ -3009,7 +3009,7 @@ int VMPFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for VMP access method. */ /***********************************************************************/ -void VMPFAM::CloseTableFile(PGLOBAL g, bool abort) +void VMPFAM::CloseTableFile(PGLOBAL g, bool) { if (Tdbp->GetMode() == MODE_DELETE) { // Set Block and Nrec values for TDBVCT::MakeBlockValues diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index 1288689325c..54af93e11fa 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -247,7 +247,7 @@ int ZIPFAM::GetNextPos(void) /***********************************************************************/ /* SetPos: Replace the table at the specified position. */ /***********************************************************************/ -bool ZIPFAM::SetPos(PGLOBAL g, int pos) +bool ZIPFAM::SetPos(PGLOBAL g, int pos __attribute__((unused))) { sprintf(g->Message, MSG(NO_SETPOS_YET), "ZIP"); return true; @@ -267,7 +267,7 @@ bool ZIPFAM::SetPos(PGLOBAL g, int pos) /***********************************************************************/ /* Record file position in case of UPDATE or DELETE. */ /***********************************************************************/ -bool ZIPFAM::RecordPos(PGLOBAL g) +bool ZIPFAM::RecordPos(PGLOBAL) { Zpos = gztell(Zfile); return false; @@ -376,7 +376,7 @@ int ZIPFAM::WriteBuffer(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for ZDOS access method. (NIY) */ /***********************************************************************/ -int ZIPFAM::DeleteRecords(PGLOBAL g, int irc) +int ZIPFAM::DeleteRecords(PGLOBAL g, int) { strcpy(g->Message, MSG(NO_ZIP_DELETE)); return RC_FX; @@ -385,7 +385,7 @@ int ZIPFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for DOS access method. */ /***********************************************************************/ -void ZIPFAM::CloseTableFile(PGLOBAL g, bool abort) +void ZIPFAM::CloseTableFile(PGLOBAL, bool) { int rc = gzclose(Zfile); @@ -431,7 +431,7 @@ ZBKFAM::ZBKFAM(PZBKFAM txfp) : ZIPFAM(txfp) /***********************************************************************/ /* Use BlockTest to reduce the table estimated size. */ /***********************************************************************/ -int ZBKFAM::MaxBlkSize(PGLOBAL g, int s) +int ZBKFAM::MaxBlkSize(PGLOBAL g, int) { int rc = RC_OK, savcur = CurBlk; int size; @@ -503,7 +503,7 @@ int ZBKFAM::GetPos(void) /* Record file position in case of UPDATE or DELETE. */ /* Not used yet for fixed tables. */ /***********************************************************************/ -bool ZBKFAM::RecordPos(PGLOBAL g) +bool ZBKFAM::RecordPos(PGLOBAL /*g*/) { //strcpy(g->Message, "RecordPos not implemented for zip blocked tables"); //return true; @@ -513,7 +513,7 @@ bool ZBKFAM::RecordPos(PGLOBAL g) /***********************************************************************/ /* Skip one record in file. */ /***********************************************************************/ -int ZBKFAM::SkipRecord(PGLOBAL g, bool header) +int ZBKFAM::SkipRecord(PGLOBAL /*g*/, bool) { //strcpy(g->Message, "SkipRecord not implemented for zip blocked tables"); //return RC_FX; @@ -668,7 +668,7 @@ int ZBKFAM::DeleteRecords(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for ZBK access method. */ /***********************************************************************/ -void ZBKFAM::CloseTableFile(PGLOBAL g, bool abort) +void ZBKFAM::CloseTableFile(PGLOBAL g, bool) { int rc = RC_OK; @@ -1060,7 +1060,7 @@ int ZLBFAM::GetNextPos(void) /***********************************************************************/ /* SetPos: Replace the table at the specified position. */ /***********************************************************************/ -bool ZLBFAM::SetPos(PGLOBAL g, int pos) +bool ZLBFAM::SetPos(PGLOBAL g, int pos __attribute__((unused))) { sprintf(g->Message, MSG(NO_SETPOS_YET), "ZIP"); return true; @@ -1350,7 +1350,7 @@ bool ZLBFAM::WriteCompressedBuffer(PGLOBAL g) /***********************************************************************/ /* Table file close routine for DOS access method. */ /***********************************************************************/ -void ZLBFAM::CloseTableFile(PGLOBAL g, bool abort) +void ZLBFAM::CloseTableFile(PGLOBAL g, bool) { int rc = RC_OK; diff --git a/storage/connect/filter.h b/storage/connect/filter.h index 78e066d9ab7..ab7c2139b68 100644 --- a/storage/connect/filter.h +++ b/storage/connect/filter.h @@ -1,7 +1,7 @@ /*************** Filter H Declares Source Code File (.H) ***************/ /* Name: FILTER.H Version 1.2 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2010-2012 */ +/* (C) Copyright to the author Olivier BERTRAND 2010-2015 */ /* */ /* This file contains the FILTER and derived classes declares. */ /***********************************************************************/ @@ -105,7 +105,7 @@ class FILTERX : public FILTER { virtual bool Eval(PGLOBAL) = 0; // just to prevent direct FILTERX use // Fake operator new used to change a filter into a derived filter - void * operator new(size_t size, PFIL filp) {return filp;} + void * operator new(size_t, PFIL filp) {return filp;} #if defined(WIN32) // Avoid warning C4291 by defining a matching dummy delete operator void operator delete(void *, PFIL) {} diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index f2827f56cd8..2449a1fdb97 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -193,7 +193,7 @@ extern "C" { /* Utility functions. */ /***********************************************************************/ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); -PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info); +PQRYRES VirColumns(PGLOBAL g, bool info); PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, int pretty, int lvl, int mxr, bool info); PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info); @@ -5337,7 +5337,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, break; #endif // PIVOT_SUPPORT case TAB_VIR: - qrp= VirColumns(g, tab, (char*)db, fnc == FNC_COL); + qrp= VirColumns(g, fnc == FNC_COL); break; case TAB_JSON: qrp= JSONColumns(g, (char*)db, fn, objn, pty, lrecl, lvl, fnc == FNC_COL); diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 1afd79bec05..1ad33d83068 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -296,7 +296,7 @@ my_bool Json_Value_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Value_init char *Json_Value(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; PJVAL jvp; @@ -329,7 +329,7 @@ my_bool Json_Array_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Array_init char *Json_Array(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; uint i; @@ -376,7 +376,7 @@ my_bool Json_Array_Add_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Array_Add_init char *Json_Array_Add(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; PJVAL jvp; @@ -429,7 +429,7 @@ my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Array_Delete_init char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; int n; @@ -482,7 +482,7 @@ my_bool Json_Object_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Object_init char *Json_Object(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; uint i; @@ -520,7 +520,7 @@ my_bool Json_Object_Nonull_init(UDF_INIT *initid, UDF_ARGS *args, } // end of Json_Object_Nonull_init char *Json_Object_Nonull(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) + unsigned long *res_length, char *, char *) { char *str; uint i; @@ -574,8 +574,7 @@ my_bool Json_Array_Grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message) return false; } // end of Json_Array_Grp_init -void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args, - char *is_null, char *error) +void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*) { PGLOBAL g = (PGLOBAL)initid->ptr; PJAR arp = (PJAR)g->Activityp; @@ -585,8 +584,8 @@ void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args, } // end of Json_Array_Grp_add -char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) +char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *, char *result, + unsigned long *res_length, char *, char *) { char *str; PGLOBAL g = (PGLOBAL)initid->ptr; @@ -605,7 +604,7 @@ char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result, return str; } // end of Json_Array_Grp -void Json_Array_Grp_clear(UDF_INIT *initid, char *is_null, char *error) +void Json_Array_Grp_clear(UDF_INIT *initid, char*, char*) { PGLOBAL g = (PGLOBAL)initid->ptr; @@ -646,8 +645,7 @@ my_bool Json_Object_Grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message) return false; } // end of Json_Object_Grp_init -void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args, - char *is_null, char *error) +void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*) { PGLOBAL g = (PGLOBAL)initid->ptr; PJOB objp = (PJOB)g->Activityp; @@ -657,8 +655,8 @@ void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args, } // end of Json_Object_Grp_add -char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result, - unsigned long *res_length, char *is_null, char *error) +char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *, char *result, + unsigned long *res_length, char *, char *) { char *str; PGLOBAL g = (PGLOBAL)initid->ptr; @@ -675,7 +673,7 @@ char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result, return str; } // end of Json_Object_Grp -void Json_Object_Grp_clear(UDF_INIT *initid, char *is_null, char *error) +void Json_Object_Grp_clear(UDF_INIT *initid, char*, char*) { PGLOBAL g = (PGLOBAL)initid->ptr; diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h index cdbe4e5bca9..f7c4c70eaf5 100644 --- a/storage/connect/mycat.h +++ b/storage/connect/mycat.h @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2013 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -98,7 +98,7 @@ class MYCAT : public CATALOG { void Reset(void); //void SetDataPath(PGLOBAL g, const char *path) // {SetPath(g, &DataPath, path);} - bool StoreIndex(PGLOBAL g, PTABDEF defp) {return false;} // Temporary + bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary PRELDEF GetTableDesc(PGLOBAL g, LPCSTR name, LPCSTR type, PRELDEF *prp = NULL); PTDB GetTable(PGLOBAL g, PTABLE tablep, diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 47d781d9ff6..2b958b512f3 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2007-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2007-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -720,7 +720,7 @@ int MYSQLC::ExecSQL(PGLOBAL g, const char *query, int *w) /***********************************************************************/ /* Get table size by executing "select count(*) from table_name". */ /***********************************************************************/ -int MYSQLC::GetTableSize(PGLOBAL g, PSZ query) +int MYSQLC::GetTableSize(PGLOBAL g __attribute__((unused)), PSZ query) { if (mysql_real_query(m_DB, query, strlen(query))) { #if defined(_DEBUG) diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index 32f6d6f8366..a2b1baf1249 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -888,7 +888,7 @@ FILE *PlugReopenFile(PGLOBAL g, PFBLOCK fp, LPCSTR md) /* Close file routine: the purpose of this routine is to avoid */ /* double closing that freeze the system on some Unix platforms. */ /***********************************************************************/ -int PlugCloseFile(PGLOBAL g, PFBLOCK fp, bool all) +int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all) { int rc = 0; diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 47f825e965d..d0483b5075d 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -548,7 +548,7 @@ bool OEMDEF::DeleteTableFile(PGLOBAL g) /***********************************************************************/ /* Define: initialize the table definition block from XDB file. */ /***********************************************************************/ -bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int) { Module = GetStringCatInfo(g, "Module", ""); Subtype = GetStringCatInfo(g, "Subtype", Module); @@ -715,7 +715,7 @@ COLDEF::COLDEF(void) : COLCRT() /***********************************************************************/ /* Define: initialize a column definition from a COLINFO structure. */ /***********************************************************************/ -int COLDEF::Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff) +int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff) { Name = (PSZ)PlugDup(g, cfp->Name); diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h index 13bd392b706..ec70f18e151 100644 --- a/storage/connect/reldef.h +++ b/storage/connect/reldef.h @@ -1,7 +1,7 @@ /*************** RelDef H Declares Source Code File (.H) ***************/ /* Name: RELDEF.H Version 1.5 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */ /* */ /* This file contains the DEF classes definitions. */ /***********************************************************************/ @@ -89,7 +89,7 @@ class DllExport TABDEF : public RELDEF { /* Logical table descriptor */ bool IsReadOnly(void) {return Read_Only;} virtual AMT GetDefType(void) {return TYPE_AM_TAB;} virtual PIXDEF GetIndx(void) {return NULL;} - virtual void SetIndx(PIXDEF xp) {} + virtual void SetIndx(PIXDEF) {} virtual bool IsHuge(void) {return false;} const CHARSET_INFO *data_charset() {return m_data_charset;} diff --git a/storage/connect/tabcol.cpp b/storage/connect/tabcol.cpp index 8f350c6f074..662c0b514cf 100644 --- a/storage/connect/tabcol.cpp +++ b/storage/connect/tabcol.cpp @@ -1,7 +1,7 @@ /************* TabCol C++ Functions Source Code File (.CPP) ************/ /* Name: TABCOL.CPP Version 2.7 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2013 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ /* */ /* This file contains the PlugDB++ XTAB, COLUMN and XORDER methods. */ /***********************************************************************/ @@ -91,7 +91,7 @@ void XTAB::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of XTAB contents. */ /***********************************************************************/ -void XTAB::Print(PGLOBAL g, char *ps, uint z) +void XTAB::Print(PGLOBAL, char *ps, uint z) { char buf[128]; int i, n = (int)z - 1; @@ -125,7 +125,7 @@ COLUMN::COLUMN(LPCSTR name) : Name(name) /***********************************************************************/ /* COLUMN SetFormat: should never be called. */ /***********************************************************************/ -bool COLUMN::SetFormat(PGLOBAL g, FORMAT& fmt) +bool COLUMN::SetFormat(PGLOBAL g, FORMAT&) { strcpy(g->Message, MSG(NO_FORMAT_COL)); return true; @@ -154,7 +154,7 @@ void COLUMN::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of COLUMN contents. */ /***********************************************************************/ -void COLUMN::Print(PGLOBAL g, char *ps, uint z) +void COLUMN::Print(PGLOBAL, char *ps, uint z) { char buf[80]; diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index ba22da52998..37bd94cf1bb 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -117,7 +117,7 @@ DOSDEF::DOSDEF(void) /***********************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /***********************************************************************/ -bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int) { char buf[8]; bool map = (am && (*am == 'M' || *am == 'm')); @@ -303,7 +303,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) /***********************************************************************/ /* InvalidateIndex: mark all indexes as invalid. */ /***********************************************************************/ -bool DOSDEF::InvalidateIndex(PGLOBAL g) +bool DOSDEF::InvalidateIndex(PGLOBAL) { if (To_Indx) for (PIXDEF xp = To_Indx; xp; xp = xp->Next) @@ -1736,15 +1736,16 @@ err: /***********************************************************************/ /* Make a dynamic index. */ /***********************************************************************/ -bool TDBDOS::InitialyzeIndex(PGLOBAL g, PIXDEF xdp, bool sorted) +bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted) { int k, rc; - bool brc, dynamic; + volatile bool dynamic; + bool brc; PCOL colp; PCOLDEF cdp; PVAL valp; PXLOAD pxp; - PKXBASE kxp; + volatile PKXBASE kxp; PKPDEF kdp; if (!xdp && !(xdp = To_Xdp)) { @@ -1864,7 +1865,7 @@ int TDBDOS::GetProgCur(void) /***********************************************************************/ /* RowNumber: return the ordinal number of the current row. */ /***********************************************************************/ -int TDBDOS::RowNumber(PGLOBAL g, bool b) +int TDBDOS::RowNumber(PGLOBAL g, bool) { if (To_Kindex) { /*******************************************************************/ @@ -1944,7 +1945,7 @@ int TDBDOS::Cardinality(PGLOBAL g) rec = ((PDOSDEF)To_Def)->Ending; if (AvgLen <= 0) // No given average estimate - rec += EstimatedLength(g); + rec += EstimatedLength(); else // An estimate was given for the average record length rec += AvgLen; @@ -1988,7 +1989,7 @@ int TDBDOS::GetMaxSize(PGLOBAL g) /* Estimate the number of lines in the table (if not known) by */ /* dividing the file length by minimum record length. */ /*****************************************************************/ - rec = EstimatedLength(g) + ((PDOSDEF)To_Def)->Ending; + rec = EstimatedLength() + ((PDOSDEF)To_Def)->Ending; MaxSize = (len + rec - 1) / rec; if (trace) @@ -2005,7 +2006,7 @@ int TDBDOS::GetMaxSize(PGLOBAL g) /***********************************************************************/ /* DOS EstimatedLength. Returns an estimated minimum line length. */ /***********************************************************************/ -int TDBDOS::EstimatedLength(PGLOBAL g) +int TDBDOS::EstimatedLength(void) { int dep = 0; PCOLDEF cdp = To_Def->GetCols(); @@ -2023,7 +2024,7 @@ int TDBDOS::EstimatedLength(PGLOBAL g) /***********************************************************************/ /* DOS tables favor the use temporary files for Update. */ /***********************************************************************/ -bool TDBDOS::IsUsingTemp(PGLOBAL g) +bool TDBDOS::IsUsingTemp(PGLOBAL) { USETEMP utp = UseTemp(); @@ -2183,7 +2184,7 @@ int TDBDOS::ReadDB(PGLOBAL g) /***********************************************************************/ /* PrepareWriting: Prepare the line to write. */ /***********************************************************************/ -bool TDBDOS::PrepareWriting(PGLOBAL g) +bool TDBDOS::PrepareWriting(PGLOBAL) { if (!Ftype && (Mode == MODE_INSERT || Txfp->GetUseTemp())) { char *p; diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index b7150294e9b..9115b1fae86 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -1,7 +1,7 @@ /*************** TabDos H Declares Source Code File (.H) ***************/ /* Name: TABDOS.H Version 3.3 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */ /* */ /* This file contains the DOS classes declares. */ /***********************************************************************/ @@ -123,11 +123,11 @@ class DllExport TDBDOS : public TDBASE { // Implementation virtual AMT GetAmType(void) {return Txfp->GetAmType();} - virtual PSZ GetFile(PGLOBAL g) {return Txfp->To_File;} - virtual void SetFile(PGLOBAL g, PSZ fn) {Txfp->To_File = fn;} + virtual PSZ GetFile(PGLOBAL) {return Txfp->To_File;} + virtual void SetFile(PGLOBAL, PSZ fn) {Txfp->To_File = fn;} virtual void SetAbort(bool b) {Abort = b;} virtual RECFM GetFtype(void) {return Ftype;} - virtual bool SkipHeader(PGLOBAL g) {return false;} + virtual bool SkipHeader(PGLOBAL) {return false;} virtual void RestoreNrec(void) {Txfp->SetNrec(1);} virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBDOS(g, this);} @@ -149,7 +149,7 @@ class DllExport TDBDOS : public TDBASE { // Database routines virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual char *GetOpenMode(PGLOBAL g, char *opmode) {return NULL;} + virtual char *GetOpenMode(PGLOBAL, char*) {return NULL;} virtual int GetFileLength(PGLOBAL g) {return Txfp->GetFileLength(g);} virtual int GetProgMax(PGLOBAL g); virtual int GetProgCur(void); @@ -168,7 +168,7 @@ class DllExport TDBDOS : public TDBASE { virtual int ReadBuffer(PGLOBAL g) {return Txfp->ReadBuffer(g);} // Specific routine - virtual int EstimatedLength(PGLOBAL g); + virtual int EstimatedLength(void); // Optimization routines virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 77e47e6f8dd..5cfd5a726ef 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -271,7 +271,7 @@ int TDBFIX::RowNumber(PGLOBAL g, bool b) /***********************************************************************/ /* FIX tables don't use temporary files except if specified as do it. */ /***********************************************************************/ -bool TDBFIX::IsUsingTemp(PGLOBAL g) +bool TDBFIX::IsUsingTemp(PGLOBAL) { // Not ready yet to handle using a temporary file with mapping // or while deleting from DBF files. diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index d5f8dc50a89..a5e14e1b81f 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2001 - 2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2001 - 2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -625,7 +625,7 @@ bool TDBCSV::CheckErr(void) /***********************************************************************/ /* CSV EstimatedLength. Returns an estimated minimum line length. */ /***********************************************************************/ -int TDBCSV::EstimatedLength(PGLOBAL g) +int TDBCSV::EstimatedLength(void) { int n = 0; PCOLDEF cdp; @@ -1118,7 +1118,7 @@ PCOL TDBFMT::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /* FMT EstimatedLength. Returns an estimated minimum line length. */ /* The big problem here is how can we astimated that minimum ? */ /***********************************************************************/ -int TDBFMT::EstimatedLength(PGLOBAL g) +int TDBFMT::EstimatedLength(void) { // This is rather stupid !!! return ((PDOSDEF)To_Def)->GetEnding() + (int)((Lrecl / 10) + 1); diff --git a/storage/connect/tabfmt.h b/storage/connect/tabfmt.h index 8a1e1f17561..ce80a276cdc 100644 --- a/storage/connect/tabfmt.h +++ b/storage/connect/tabfmt.h @@ -75,7 +75,7 @@ class TDBCSV : public TDBDOS { virtual int ReadBuffer(PGLOBAL g); // Physical file read // Specific routines - virtual int EstimatedLength(PGLOBAL g); + virtual int EstimatedLength(void); virtual bool SkipHeader(PGLOBAL g); virtual bool CheckErr(void); @@ -157,7 +157,7 @@ class TDBFMT : public TDBCSV { virtual int ReadBuffer(PGLOBAL g); // Physical file read // Specific routines - virtual int EstimatedLength(PGLOBAL g); + virtual int EstimatedLength(void); protected: virtual bool PrepareWriting(PGLOBAL g) diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 0231b369fc1..f22bdd15528 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -78,11 +78,13 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, PJVAL jvp; PJOB row; PJDEF tdp; - TDBJSN *tjnp; - PJTDB tjsp; + TDBJSN *tjnp = NULL; + PJTDB tjsp = NULL; PQRYRES qrp; PCOLRES crp; + jcol.Name = jcol.Fmt = NULL; + if (info) { length[0] = 128; length[7] = 256; @@ -362,7 +364,7 @@ JSONDEF::JSONDEF(void) /***********************************************************************/ /* DefineAM: define specific AM block values. */ /***********************************************************************/ -bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff) { Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT); Objname = GetStringCatInfo(g, "Object", NULL); @@ -506,7 +508,7 @@ PCOL TDBJSN::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /***********************************************************************/ /* InsertSpecialColumn: Put a special column ahead of the column list.*/ /***********************************************************************/ -PCOL TDBJSN::InsertSpecialColumn(PGLOBAL g, PCOL colp) +PCOL TDBJSN::InsertSpecialColumn(PCOL colp) { if (!colp->IsSpecial()) return NULL; @@ -1486,7 +1488,7 @@ int TDBJSON::MakeNewDoc(PGLOBAL g) /***********************************************************************/ int TDBJSON::MakeDocument(PGLOBAL g) { - char *p, *memory, *objpath, *key; + char *p, *memory, *objpath, *key = NULL; int len, i = 0; MODE mode = Mode; PJSON jsp; @@ -1646,7 +1648,7 @@ void TDBJSON::ResetSize(void) /***********************************************************************/ /* TDBJSON is not indexable. */ /***********************************************************************/ -int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) +int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool) { if (pxdf) { strcpy(g->Message, "JSON not indexable when pretty = 2"); @@ -1677,7 +1679,7 @@ int TDBJSON::GetRecpos(void) /***********************************************************************/ /* Set the position in the table. */ /***********************************************************************/ -bool TDBJSON::SetRecpos(PGLOBAL g, int recpos) +bool TDBJSON::SetRecpos(PGLOBAL, int recpos) { #if 0 union { @@ -1739,7 +1741,7 @@ bool TDBJSON::OpenDB(PGLOBAL g) /***********************************************************************/ /* ReadDB: Data Base read routine for JSON access method. */ /***********************************************************************/ -int TDBJSON::ReadDB(PGLOBAL g) +int TDBJSON::ReadDB(PGLOBAL) { int rc; diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index 10b9a9a9cc3..dc682e067e3 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -82,7 +82,7 @@ class TDBJSN : public TDBDOS { // Methods virtual PTDB CopyOne(PTABS t); virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp); + virtual PCOL InsertSpecialColumn(PCOL colp); virtual int RowNumber(PGLOBAL g, bool b = FALSE) {return (b) ? N : Fpos + 1;} diff --git a/storage/connect/table.cpp b/storage/connect/table.cpp index d163c443cd5..933e072c1bb 100644 --- a/storage/connect/table.cpp +++ b/storage/connect/table.cpp @@ -1,7 +1,7 @@ /************** Table C++ Functions Source Code File (.CPP) ************/ /* Name: TABLE.CPP Version 2.7 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */ /* */ /* This file contains the TBX, TDB and OPJOIN classes functions. */ /***********************************************************************/ @@ -74,7 +74,7 @@ TDB::TDB(PTDB tdbp) : Tdb_No(++Tnum) /***********************************************************************/ /* RowNumber: returns the current row ordinal number. */ /***********************************************************************/ -int TDB::RowNumber(PGLOBAL g, bool b) +int TDB::RowNumber(PGLOBAL g, bool) { sprintf(g->Message, MSG(ROWID_NOT_IMPL), GetAmName(g, GetAmType())); return 0; @@ -122,7 +122,7 @@ void TDB::Print(PGLOBAL g, FILE *f, uint n) } // end of Print -void TDB::Print(PGLOBAL g, char *ps, uint z) +void TDB::Print(PGLOBAL, char *ps, uint) { sprintf(ps, "R%d.%s", Tdb_No, Name); } // end of Print @@ -263,7 +263,7 @@ PCOL TDBASE::ColDB(PGLOBAL g, PSZ name, int num) /***********************************************************************/ /* InsertSpecialColumn: Put a special column ahead of the column list.*/ /***********************************************************************/ -PCOL TDBASE::InsertSpecialColumn(PGLOBAL g, PCOL colp) +PCOL TDBASE::InsertSpecialColumn(PCOL colp) { if (!colp->IsSpecial()) return NULL; @@ -327,7 +327,7 @@ PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp) return NULL; } // endif's name - if (!(colp = InsertSpecialColumn(g, colp))) { + if (!(colp = InsertSpecialColumn(colp))) { sprintf(g->Message, MSG(BAD_SPECIAL_COL), name); return NULL; } // endif Insert @@ -338,7 +338,7 @@ PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp) /***********************************************************************/ /* ResetTableOpt: Wrong for this table type. */ /***********************************************************************/ -int TDBASE::ResetTableOpt(PGLOBAL g, bool dop, bool dox) +int TDBASE::ResetTableOpt(PGLOBAL g, bool, bool) { strcpy(g->Message, "This table is not indexable"); return RC_INFO; @@ -365,7 +365,7 @@ void TDBASE::ResetKindex(PGLOBAL g, PKXBASE kxp) /***********************************************************************/ /* SetRecpos: Replace the table at the specified position. */ /***********************************************************************/ -bool TDBASE::SetRecpos(PGLOBAL g, int recpos) +bool TDBASE::SetRecpos(PGLOBAL g, int) { strcpy(g->Message, MSG(SETRECPOS_NIY)); return true; @@ -386,7 +386,7 @@ void TDBASE::PrintAM(FILE *f, char *m) /* Two questions here: exact meaning of U_J_INT ? */ /* Why is the eventual reference to To_Key_Col not marked U_J_EXT ? */ /***********************************************************************/ -void TDBASE::MarkDB(PGLOBAL g, PTDB tdb2) +void TDBASE::MarkDB(PGLOBAL, PTDB tdb2) { if (trace) htrc("DOS MarkDB: tdbp=%p tdb2=%p\n", this, tdb2); @@ -453,7 +453,7 @@ bool TDBCAT::Initialize(PGLOBAL g) /***********************************************************************/ /* CAT: Get the number of properties. */ /***********************************************************************/ -int TDBCAT::GetMaxSize(PGLOBAL g) +int TDBCAT::GetMaxSize(PGLOBAL g __attribute__((unused))) { if (MaxSize < 0) { // if (Initialize(g)) @@ -528,7 +528,7 @@ bool TDBCAT::InitCol(PGLOBAL g) /***********************************************************************/ /* SetRecpos: Replace the table at the specified position. */ /***********************************************************************/ -bool TDBCAT::SetRecpos(PGLOBAL g, int recpos) +bool TDBCAT::SetRecpos(PGLOBAL, int recpos) { N = recpos - 1; return false; @@ -537,7 +537,7 @@ bool TDBCAT::SetRecpos(PGLOBAL g, int recpos) /***********************************************************************/ /* Data Base read routine for CAT access method. */ /***********************************************************************/ -int TDBCAT::ReadDB(PGLOBAL g) +int TDBCAT::ReadDB(PGLOBAL) { return (++N < Qrp->Nblin) ? RC_OK : RC_EF; } // end of ReadDB @@ -554,7 +554,7 @@ int TDBCAT::WriteDB(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for CAT access methods. */ /***********************************************************************/ -int TDBCAT::DeleteDB(PGLOBAL g, int irc) +int TDBCAT::DeleteDB(PGLOBAL g, int) { strcpy(g->Message, "Delete not enabled for CAT tables"); return RC_FX; @@ -563,7 +563,7 @@ int TDBCAT::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for WMI access method. */ /***********************************************************************/ -void TDBCAT::CloseDB(PGLOBAL g) +void TDBCAT::CloseDB(PGLOBAL) { // Nothing to do } // end of CloseDB @@ -584,7 +584,7 @@ CATCOL::CATCOL(PCOLDEF cdp, PTDB tdbp, int n) /***********************************************************************/ /* Read the next Data Source elements. */ /***********************************************************************/ -void CATCOL::ReadColumn(PGLOBAL g) +void CATCOL::ReadColumn(PGLOBAL) { // Get the value of the Name or Description property if (Crp->Kdata) diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 94950584c9b..12e8de2c808 100644 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -561,7 +561,7 @@ int TDBMUL::WriteDB(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for MUL access method. */ /***********************************************************************/ -int TDBMUL::DeleteDB(PGLOBAL g, int irc) +int TDBMUL::DeleteDB(PGLOBAL g, int) { // When implementing DELETE_MODE InitFileNames must be updated to // eliminate CRLF under Windows if the file is read in binary. @@ -586,7 +586,7 @@ void TDBMUL::CloseDB(PGLOBAL g) /***********************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /***********************************************************************/ -bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR, int) { Desc = Fn = GetStringCatInfo(g, "Filename", NULL); Incl = (GetIntCatInfo("Subdir", 0) != 0); @@ -597,7 +597,7 @@ bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new Table Description Block. */ /***********************************************************************/ -PTDB DIRDEF::GetTable(PGLOBAL g, MODE m) +PTDB DIRDEF::GetTable(PGLOBAL g, MODE) { #if 0 if (Huge) @@ -865,7 +865,7 @@ int TDBDIR::WriteDB(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for DIR access method. */ /***********************************************************************/ -int TDBDIR::DeleteDB(PGLOBAL g, int irc) +int TDBDIR::DeleteDB(PGLOBAL g, int) { strcpy(g->Message, MSG(TABDIR_READONLY)); return RC_FX; // NIY @@ -874,7 +874,7 @@ int TDBDIR::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for MUL access method. */ /***********************************************************************/ -void TDBDIR::CloseDB(PGLOBAL g) +void TDBDIR::CloseDB(PGLOBAL) { #if defined(WIN32) // Close the search handle. @@ -895,7 +895,7 @@ void TDBDIR::CloseDB(PGLOBAL g) /***********************************************************************/ /* DIRCOL public constructor. */ /***********************************************************************/ -DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) +DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ) : COLBLK(cdp, tdbp, i) { if (cprec) { diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index b18e4da2ec4..cb7011822d8 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -5,7 +5,7 @@ /* */ /* AUTHOR: */ /* ------- */ -/* Olivier BERTRAND 2007-2014 */ +/* Olivier BERTRAND 2007-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -307,7 +307,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) /***********************************************************************/ /* DefineAM: define specific AM block values from XCV file. */ /***********************************************************************/ -bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int) { char *url; @@ -380,7 +380,7 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB MYSQLDEF::GetTable(PGLOBAL g, MODE m) +PTDB MYSQLDEF::GetTable(PGLOBAL g, MODE) { if (Xsrc) return new(g) TDBMYEXC(this); @@ -438,7 +438,7 @@ TDBMYSQL::TDBMYSQL(PMYDEF tdp) : TDBASE(tdp) Nparm = 0; } // end of TDBMYSQL constructor -TDBMYSQL::TDBMYSQL(PGLOBAL g, PTDBMY tdbp) : TDBASE(tdbp) +TDBMYSQL::TDBMYSQL(PTDBMY tdbp) : TDBASE(tdbp) { Host = tdbp->Host; Database = tdbp->Database; @@ -468,7 +468,7 @@ PTDB TDBMYSQL::CopyOne(PTABS t) PCOL cp1, cp2; PGLOBAL g = t->G; - tp = new(g) TDBMYSQL(g, this); + tp = new(g) TDBMYSQL(this); for (cp1 = Columns; cp1; cp1 = cp1->GetNext()) { cp2 = new(g) MYSQLCOL((PMYCOL)cp1, tp); @@ -816,7 +816,7 @@ int TDBMYSQL::GetMaxSize(PGLOBAL g) /***********************************************************************/ /* This a fake routine as ROWID does not exist in MySQL. */ /***********************************************************************/ -int TDBMYSQL::RowNumber(PGLOBAL g, bool b) +int TDBMYSQL::RowNumber(PGLOBAL, bool) { return N + 1; } // end of RowNumber @@ -832,7 +832,7 @@ int TDBMYSQL::GetProgMax(PGLOBAL g) /***********************************************************************/ /* MySQL Bind Parameter function. */ /***********************************************************************/ -int TDBMYSQL::BindColumns(PGLOBAL g) +int TDBMYSQL::BindColumns(PGLOBAL g __attribute__((unused))) { #if defined(MYSQL_PREPARED_STATEMENTS) if (Prep) { @@ -1425,7 +1425,7 @@ void MYSQLCOL::ReadColumn(PGLOBAL g) /***********************************************************************/ /* WriteColumn: make sure the bind buffer is updated. */ /***********************************************************************/ -void MYSQLCOL::WriteColumn(PGLOBAL g) +void MYSQLCOL::WriteColumn(PGLOBAL) { /*********************************************************************/ /* Do convert the column value if necessary. */ @@ -1463,7 +1463,7 @@ TDBMYEXC::TDBMYEXC(PMYDEF tdp) : TDBMYSQL(tdp) Nerr = 0; } // end of TDBMYEXC constructor -TDBMYEXC::TDBMYEXC(PGLOBAL g, PTDBMYX tdbp) : TDBMYSQL(g, tdbp) +TDBMYEXC::TDBMYEXC(PTDBMYX tdbp) : TDBMYSQL(tdbp) { Cmdlist = tdbp->Cmdlist; Cmdcol = tdbp->Cmdcol; @@ -1481,7 +1481,7 @@ PTDB TDBMYEXC::CopyOne(PTABS t) PCOL cp1, cp2; PGLOBAL g = t->G; - tp = new(g) TDBMYEXC(g, this); + tp = new(g) TDBMYEXC(this); for (cp1 = Columns; cp1; cp1 = cp1->GetNext()) { cp2 = new(g) MYXCOL((PMYXCOL)cp1, tp); @@ -1534,7 +1534,7 @@ PCMD TDBMYEXC::MakeCMD(PGLOBAL g) /***********************************************************************/ /* EXC GetMaxSize: returns the maximum number of rows in the table. */ /***********************************************************************/ -int TDBMYEXC::GetMaxSize(PGLOBAL g) +int TDBMYEXC::GetMaxSize(PGLOBAL) { if (MaxSize < 0) { MaxSize = 10; // a guess @@ -1711,7 +1711,7 @@ void MYXCOL::ReadColumn(PGLOBAL g) /***********************************************************************/ /* WriteColumn: should never be called. */ /***********************************************************************/ -void MYXCOL::WriteColumn(PGLOBAL g) +void MYXCOL::WriteColumn(PGLOBAL) { assert(false); } // end of WriteColumn diff --git a/storage/connect/tabmysql.h b/storage/connect/tabmysql.h index 99930d43a57..17d7b190340 100644 --- a/storage/connect/tabmysql.h +++ b/storage/connect/tabmysql.h @@ -73,11 +73,11 @@ class TDBMYSQL : public TDBASE { public: // Constructor TDBMYSQL(PMYDEF tdp); - TDBMYSQL(PGLOBAL g, PTDBMY tdbp); + TDBMYSQL(PTDBMY tdbp); // Implementation virtual AMT GetAmType(void) {return TYPE_AM_MYSQL;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYSQL(g, this);} + virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYSQL(this);} // Methods virtual PTDB CopyOne(PTABS t); @@ -180,11 +180,11 @@ class TDBMYEXC : public TDBMYSQL { public: // Constructors TDBMYEXC(PMYDEF tdp); - TDBMYEXC(PGLOBAL g, PTDBMYX tdbp); + TDBMYEXC(PTDBMYX tdbp); // Implementation virtual AMT GetAmType(void) {return TYPE_AM_MYX;} - virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(g, this);} + virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(this);} // Methods virtual PTDB CopyOne(PTABS t); diff --git a/storage/connect/taboccur.cpp b/storage/connect/taboccur.cpp index 7f7b1c5d50c..da3cafc3c8f 100644 --- a/storage/connect/taboccur.cpp +++ b/storage/connect/taboccur.cpp @@ -266,7 +266,7 @@ bool OCCURDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB OCCURDEF::GetTable(PGLOBAL g, MODE m) +PTDB OCCURDEF::GetTable(PGLOBAL g, MODE) { if (Catfunc != FNC_COL) return new(g) TDBOCCUR(this); @@ -432,7 +432,7 @@ int TDBOCCUR::GetMaxSize(PGLOBAL g) /* In this sample, ROWID will be the (virtual) row number, */ /* while ROWNUM will be the occurence rank in the multiple column. */ /***********************************************************************/ -int TDBOCCUR::RowNumber(PGLOBAL g, bool b) +int TDBOCCUR::RowNumber(PGLOBAL, bool b) { return (b) ? M : N; } // end of RowNumber @@ -567,7 +567,7 @@ void OCCURCOL::ReadColumn(PGLOBAL g) /* ReadColumn: what this routine does is to access the Mth columns of */ /* list, extract its name and set to it the rank column value. */ /***********************************************************************/ -void RANKCOL::ReadColumn(PGLOBAL g) +void RANKCOL::ReadColumn(PGLOBAL) { PTDBOCCUR tdbp = (PTDBOCCUR)To_Tdb; PCOL *col = tdbp->Col; diff --git a/storage/connect/tabpivot.cpp b/storage/connect/tabpivot.cpp index 401ffa3780e..b36dcbf94af 100644 --- a/storage/connect/tabpivot.cpp +++ b/storage/connect/tabpivot.cpp @@ -376,7 +376,7 @@ bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB PIVOTDEF::GetTable(PGLOBAL g, MODE m) +PTDB PIVOTDEF::GetTable(PGLOBAL g, MODE) { return new(g) TDBPIVOT(this); } // end of GetTable @@ -634,7 +634,7 @@ bool TDBPIVOT::MakeViewColumns(PGLOBAL g) /***********************************************************************/ /* PIVOT GetMaxSize: returns the maximum number of rows in the table. */ /***********************************************************************/ -int TDBPIVOT::GetMaxSize(PGLOBAL g) +int TDBPIVOT::GetMaxSize(PGLOBAL g __attribute__((unused))) { #if 0 if (MaxSize < 0) @@ -649,7 +649,7 @@ int TDBPIVOT::GetMaxSize(PGLOBAL g) /* In this sample, ROWID will be the (virtual) row number, */ /* while ROWNUM will be the occurence rank in the multiple column. */ /***********************************************************************/ -int TDBPIVOT::RowNumber(PGLOBAL g, bool b) +int TDBPIVOT::RowNumber(PGLOBAL, bool b) { return (b) ? M : N; } // end of RowNumber @@ -806,7 +806,7 @@ int TDBPIVOT::WriteDB(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for PIVOT access methods. */ /***********************************************************************/ -int TDBPIVOT::DeleteDB(PGLOBAL g, int irc) +int TDBPIVOT::DeleteDB(PGLOBAL g, int) { sprintf(g->Message, MSG(NO_TABLE_DEL), "PIVOT"); return RC_FX; diff --git a/storage/connect/tabsys.cpp b/storage/connect/tabsys.cpp index 3ed182c5e33..623aeca36fe 100644 --- a/storage/connect/tabsys.cpp +++ b/storage/connect/tabsys.cpp @@ -3,7 +3,7 @@ /* ------------- */ /* Version 2.3 */ /* */ -/* Author Olivier BERTRAND 2004-2014 */ +/* Author Olivier BERTRAND 2004-2015 */ /* */ /* This program are the INI/CFG tables classes. */ /***********************************************************************/ @@ -70,7 +70,7 @@ INIDEF::INIDEF(void) /***********************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /***********************************************************************/ -bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool INIDEF::DefineAM(PGLOBAL g, LPCSTR, int) { char buf[8]; @@ -96,7 +96,7 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB INIDEF::GetTable(PGLOBAL g, MODE m) +PTDB INIDEF::GetTable(PGLOBAL g, MODE) { PTDBASE tdbp; @@ -277,49 +277,27 @@ bool TDBINI::OpenDB(PGLOBAL g) /***********************************************************************/ /* Data Base read routine for INI access method. */ /***********************************************************************/ -int TDBINI::ReadDB(PGLOBAL g) +int TDBINI::ReadDB(PGLOBAL) { /*********************************************************************/ /* Now start the pseudo reading process. */ /*********************************************************************/ -#if 0 // INI tables are not indexable - if (To_Kindex) { - /*******************************************************************/ - /* Reading is by an index table. */ - /*******************************************************************/ - int recpos = To_Kindex->Fetch(g); - - switch (recpos) { - case -1: // End of file reached - return RC_EF; - case -2: // No match for join - return RC_NF; - case -3: // Same record as last non null one - return RC_OK; - default: - Section = (char*)recpos; // No good on 64 bit machines - } // endswitch recpos - - } else { -#endif // 0 - if (!Section) - Section = Seclist; - else - Section += (strlen(Section) + 1); - - if (trace > 1) - htrc("INI ReadDB: section=%s N=%d\n", Section, N); + if (!Section) + Section = Seclist; + else + Section += (strlen(Section) + 1); - N++; -//} // endif To_Kindex + if (trace > 1) + htrc("INI ReadDB: section=%s N=%d\n", Section, N); + N++; return (*Section) ? RC_OK : RC_EF; } // end of ReadDB /***********************************************************************/ /* WriteDB: Data Base write routine for INI access methods. */ /***********************************************************************/ -int TDBINI::WriteDB(PGLOBAL g) +int TDBINI::WriteDB(PGLOBAL) { // This is to check that section name was given when inserting if (Mode == MODE_INSERT) @@ -365,7 +343,7 @@ int TDBINI::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ /* Data Base close routine for INI access methods. */ /***********************************************************************/ -void TDBINI::CloseDB(PGLOBAL g) +void TDBINI::CloseDB(PGLOBAL) { #if !defined(WIN32) PROFILE_Close(Ifile); @@ -377,7 +355,7 @@ void TDBINI::CloseDB(PGLOBAL g) /***********************************************************************/ /* INICOL public constructor. */ /***********************************************************************/ -INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) +INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ) : COLBLK(cdp, tdbp, i) { if (cprec) { @@ -471,7 +449,7 @@ bool INICOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) /* from the corresponding section, extract from it the key value */ /* corresponding to this column name and convert it to buffer type. */ /***********************************************************************/ -void INICOL::ReadColumn(PGLOBAL g) +void INICOL::ReadColumn(PGLOBAL) { PTDBINI tdbp = (PTDBINI)To_Tdb; @@ -747,7 +725,7 @@ int TDBXIN::ReadDB(PGLOBAL g) /***********************************************************************/ /* WriteDB: Data Base write routine for XIN access methods. */ /***********************************************************************/ -int TDBXIN::WriteDB(PGLOBAL g) +int TDBXIN::WriteDB(PGLOBAL) { // To check that section and key names were given when inserting if (Mode == MODE_INSERT) { @@ -809,7 +787,7 @@ XINCOL::XINCOL(XINCOL *col1, PTDB tdbp) : INICOL(col1, tdbp) /* from the corresponding section, extract from it the key value */ /* corresponding to this column name and convert it to buffer type. */ /***********************************************************************/ -void XINCOL::ReadColumn(PGLOBAL g) +void XINCOL::ReadColumn(PGLOBAL) { PTDBXIN tdbp = (PTDBXIN)To_Tdb; diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 2bf26a5f183..f2affe75d2b 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -101,7 +101,7 @@ TBLDEF::TBLDEF(void) /**************************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /**************************************************************************/ -bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR, int) { char *tablist, *dbname, *def = NULL; @@ -161,7 +161,7 @@ bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new Table Description Block. */ /***********************************************************************/ -PTDB TBLDEF::GetTable(PGLOBAL g, MODE m) +PTDB TBLDEF::GetTable(PGLOBAL g, MODE) { if (Catfunc == FNC_COL) return new(g) TDBTBC(this); @@ -202,7 +202,7 @@ PCOL TDBTBL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /***********************************************************************/ /* InsertSpecialColumn: Put a special column ahead of the column list.*/ /***********************************************************************/ -PCOL TDBTBL::InsertSpecialColumn(PGLOBAL g, PCOL scp) +PCOL TDBTBL::InsertSpecialColumn(PCOL scp) { PCOL colp; @@ -548,7 +548,7 @@ int TDBTBL::ReadDB(PGLOBAL g) /***********************************************************************/ /* ReadColumn: */ /***********************************************************************/ -void TBTBLK::ReadColumn(PGLOBAL g) +void TBTBLK::ReadColumn(PGLOBAL) { if (trace) htrc("TBT ReadColumn: name=%s\n", Name); diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h index 8bf440985ea..9d3f297f9e7 100644 --- a/storage/connect/tabtbl.h +++ b/storage/connect/tabtbl.h @@ -81,7 +81,7 @@ class DllExport TDBTBL : public TDBPRX { virtual int Cardinality(PGLOBAL g); virtual int GetMaxSize(PGLOBAL g); virtual int RowNumber(PGLOBAL g, bool b = FALSE); - virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL scp); + virtual PCOL InsertSpecialColumn(PCOL scp); virtual bool OpenDB(PGLOBAL g); virtual int ReadDB(PGLOBAL g); diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index c26d766af01..5ed958b2f7a 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -292,7 +292,7 @@ PRXDEF::PRXDEF(void) /***********************************************************************/ /* DefineAM: define specific AM block values from XCOL file. */ /***********************************************************************/ -bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR, int) { char *pn, *db, *tab, *def = NULL; @@ -322,7 +322,7 @@ bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB PRXDEF::GetTable(PGLOBAL g, MODE mode) +PTDB PRXDEF::GetTable(PGLOBAL g, MODE) { if (Catfunc == FNC_COL) return new(g) TDBTBC(this); @@ -341,7 +341,7 @@ TDBPRX::TDBPRX(PPRXDEF tdp) : TDBASE(tdp) Tdbp = NULL; // The object table } // end of TDBPRX constructor -TDBPRX::TDBPRX(PGLOBAL g, PTDBPRX tdbp) : TDBASE(tdbp) +TDBPRX::TDBPRX(PTDBPRX tdbp) : TDBASE(tdbp) { Tdbp = tdbp->Tdbp; } // end of TDBPRX copy constructor @@ -353,7 +353,7 @@ PTDB TDBPRX::CopyOne(PTABS t) PPRXCOL cp1, cp2; PGLOBAL g = t->G; - tp = new(g) TDBPRX(g, this); + tp = new(g) TDBPRX(this); for (cp1 = (PPRXCOL)Columns; cp1; cp1 = (PPRXCOL)cp1->GetNext()) { cp2 = new(g) PRXCOL(cp1, tp); // Make a copy diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h index c5935d72184..b320d169b36 100644 --- a/storage/connect/tabutil.h +++ b/storage/connect/tabutil.h @@ -59,12 +59,12 @@ class DllExport TDBPRX : public TDBASE { public: // Constructors TDBPRX(PPRXDEF tdp); - TDBPRX(PGLOBAL g, PTDBPRX tdbp); + TDBPRX(PTDBPRX tdbp); // Implementation virtual AMT GetAmType(void) {return TYPE_AM_PRX;} virtual PTDB Duplicate(PGLOBAL g) - {return (PTDB)new(g) TDBPRX(g, this);} + {return (PTDB)new(g) TDBPRX(this);} // Methods virtual PTDB CopyOne(PTABS t); diff --git a/storage/connect/tabvct.cpp b/storage/connect/tabvct.cpp index 3ed40540395..6394ea5e2d6 100644 --- a/storage/connect/tabvct.cpp +++ b/storage/connect/tabvct.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -94,7 +94,7 @@ PVBLK AllocValBlock(PGLOBAL, void *, int, int, int, int, /***********************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /***********************************************************************/ -bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR, int poff) { DOSDEF::DefineAM(g, "BIN", poff); @@ -290,7 +290,7 @@ PCOL TDBVCT::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /***********************************************************************/ /* VEC tables are not ready yet to use temporary files. */ /***********************************************************************/ -bool TDBVCT::IsUsingTemp(PGLOBAL g) +bool TDBVCT::IsUsingTemp(PGLOBAL) { // For developpers return (UseTemp() == TMP_TEST); @@ -570,7 +570,7 @@ void VCTCOL::ReadColumn(PGLOBAL g) /* On each change of block the buffer is written back to file and */ /* in mode Insert the buffer is filled with the block to update. */ /***********************************************************************/ -void VCTCOL::WriteColumn(PGLOBAL g) +void VCTCOL::WriteColumn(PGLOBAL) { PTXF txfp = ((PTDBVCT)To_Tdb)->Txfp;; diff --git a/storage/connect/tabvir.cpp b/storage/connect/tabvir.cpp index b4c76f5ad56..356fc981357 100644 --- a/storage/connect/tabvir.cpp +++ b/storage/connect/tabvir.cpp @@ -29,7 +29,7 @@ /***********************************************************************/ /* Return the unique column definition to MariaDB. */ /***********************************************************************/ -PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info) +PQRYRES VirColumns(PGLOBAL g, bool info) { int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_STRING, TYPE_STRING}; @@ -95,7 +95,7 @@ PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info) /***********************************************************************/ /* GetTable: makes a new Table Description Block. */ /***********************************************************************/ -PTDB VIRDEF::GetTable(PGLOBAL g, MODE m) +PTDB VIRDEF::GetTable(PGLOBAL g, MODE) { // Column blocks will be allocated only when needed. if (Catfunc == FNC_COL) @@ -241,7 +241,7 @@ bool TDBVIR::OpenDB(PGLOBAL g) /***********************************************************************/ /* Data Base read routine for the VIR access method. */ /***********************************************************************/ -int TDBVIR::ReadDB(PGLOBAL g) +int TDBVIR::ReadDB(PGLOBAL) { return (++N >= Size) ? RC_EF : RC_OK; } // end of ReadDB @@ -258,7 +258,7 @@ int TDBVIR::WriteDB(PGLOBAL g) /***********************************************************************/ /* Data Base delete line routine for the VIR access methods. */ /***********************************************************************/ -int TDBVIR::DeleteDB(PGLOBAL g, int irc) +int TDBVIR::DeleteDB(PGLOBAL g, int) { sprintf(g->Message, MSG(VIR_NO_DELETE), To_Def->GetType()); return RC_FX; @@ -269,7 +269,7 @@ int TDBVIR::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ /* VIRCOL public constructor. */ /***********************************************************************/ -VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) +VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ) : COLBLK(cdp, tdbp, i) { if (cprec) { @@ -299,7 +299,7 @@ void VIRCOL::ReadColumn(PGLOBAL g) /***********************************************************************/ PQRYRES TDBVICL::GetResult(PGLOBAL g) { - return VirColumns(g, NULL, NULL, false); + return VirColumns(g, false); } // end of GetResult /* ------------------------- End of Virtual -------------------------- */ diff --git a/storage/connect/tabvir.h b/storage/connect/tabvir.h index 8d0caa257e7..a53aceaeceb 100644 --- a/storage/connect/tabvir.h +++ b/storage/connect/tabvir.h @@ -11,7 +11,7 @@ typedef class TDBVIR *PTDBVIR; /***********************************************************************/ /* Return the unique column definition to MariaDB. */ /***********************************************************************/ -PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info); +PQRYRES VirColumns(PGLOBAL g, bool info); /* --------------------------- VIR classes --------------------------- */ diff --git a/storage/connect/tabxcl.cpp b/storage/connect/tabxcl.cpp index dffbaf6e187..7d6d94d34c0 100644 --- a/storage/connect/tabxcl.cpp +++ b/storage/connect/tabxcl.cpp @@ -83,7 +83,7 @@ bool XCLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new TDB of the proper type. */ /***********************************************************************/ -PTDB XCLDEF::GetTable(PGLOBAL g, MODE mode) +PTDB XCLDEF::GetTable(PGLOBAL g, MODE) { if (Catfunc == FNC_COL) return new(g) TDBTBC(this); @@ -117,7 +117,7 @@ PCOL TDBXCL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) PCOL colp; if (!stricmp(cdp->GetName(), Xcolumn)) { - Xcolp = new(g) XCLCOL(g, cdp, this, cprec, n); + Xcolp = new(g) XCLCOL(cdp, this, cprec, n); colp = Xcolp; } else colp = new(g) PRXCOL(cdp, this, cprec, n); @@ -144,7 +144,7 @@ int TDBXCL::GetMaxSize(PGLOBAL g) /* For this table type, ROWID is the (virtual) row number, */ /* while ROWNUM is be the occurence rank in the multiple column. */ /***********************************************************************/ -int TDBXCL::RowNumber(PGLOBAL g, bool b) +int TDBXCL::RowNumber(PGLOBAL, bool b) { return (b) ? M : N; } // end of RowNumber @@ -232,7 +232,7 @@ int TDBXCL::ReadDB(PGLOBAL g) /***********************************************************************/ /* XCLCOL public constructor. */ /***********************************************************************/ -XCLCOL::XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i) +XCLCOL::XCLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i) : PRXCOL(cdp, tdbp, cprec, i, "XCL") { // Set additional XXL access method information for column. diff --git a/storage/connect/tabxcl.h b/storage/connect/tabxcl.h index ed15a67b629..291f0b4263a 100644 --- a/storage/connect/tabxcl.h +++ b/storage/connect/tabxcl.h @@ -85,7 +85,7 @@ class XCLCOL : public PRXCOL { friend class TDBXCL; public: // Constructors - XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i); + XCLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i); // Methods using PRXCOL::Init; diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 4f7af638d0c..c25c3d9ffb4 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -630,7 +630,7 @@ PCOL TDBXML::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /***********************************************************************/ /* InsertSpecialColumn: Put a special column ahead of the column list.*/ /***********************************************************************/ -PCOL TDBXML::InsertSpecialColumn(PGLOBAL g, PCOL colp) +PCOL TDBXML::InsertSpecialColumn(PCOL colp) { if (!colp->IsSpecial()) return NULL; diff --git a/storage/connect/tabxml.h b/storage/connect/tabxml.h index f6cfd3fb510..4eae5c082c1 100644 --- a/storage/connect/tabxml.h +++ b/storage/connect/tabxml.h @@ -84,7 +84,7 @@ class DllExport TDBXML : public TDBASE { // Database routines virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); - virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp); + virtual PCOL InsertSpecialColumn(PCOL colp); //virtual int GetMaxSame(PGLOBAL g) {return (Xpand) ? Limit : 1;} virtual int Cardinality(PGLOBAL g); virtual int GetMaxSize(PGLOBAL g); diff --git a/storage/connect/valblk.cpp b/storage/connect/valblk.cpp index e731ad156d9..94e09e1a85c 100644 --- a/storage/connect/valblk.cpp +++ b/storage/connect/valblk.cpp @@ -132,7 +132,7 @@ VALBLK::VALBLK(void *mp, int type, int nval, bool un) /***********************************************************************/ /* Raise error for numeric types. */ /***********************************************************************/ -PSZ VALBLK::GetCharValue(int n) +PSZ VALBLK::GetCharValue(int) { PGLOBAL& g = Global; @@ -145,7 +145,7 @@ PSZ VALBLK::GetCharValue(int n) /***********************************************************************/ /* Set format so formatted dates can be converted on input. */ /***********************************************************************/ -bool VALBLK::SetFormat(PGLOBAL g, PSZ fmt, int len, int year) +bool VALBLK::SetFormat(PGLOBAL g, PSZ, int, int) { sprintf(g->Message, MSG(NO_DATE_FMT), Type); return true; @@ -752,7 +752,7 @@ double CHRBLK::GetFloatValue(int n) /***********************************************************************/ /* STRING GetCharString: get string representation of a char value. */ /***********************************************************************/ -char *CHRBLK::GetCharString(char *p, int n) +char *CHRBLK::GetCharString(char *, int n) { return (char *)GetValPtrEx(n); } // end of GetCharString diff --git a/storage/connect/valblk.h b/storage/connect/valblk.h index 5a98257f98f..f6eb7258a77 100644 --- a/storage/connect/valblk.h +++ b/storage/connect/valblk.h @@ -95,17 +95,17 @@ class VALBLK : public BLOCK { virtual bool IsCi(void) {return false;} // Methods - virtual void SetValue(short sval, int n) {assert(false);} - virtual void SetValue(ushort sval, int n) {assert(false);} - virtual void SetValue(int lval, int n) {assert(false);} - virtual void SetValue(uint lval, int n) {assert(false);} - virtual void SetValue(longlong lval, int n) {assert(false);} - virtual void SetValue(ulonglong lval, int n) {assert(false);} - virtual void SetValue(double fval, int n) {assert(false);} - virtual void SetValue(char cval, int n) {assert(false);} - virtual void SetValue(uchar cval, int n) {assert(false);} - virtual void SetValue(PSZ sp, int n) {assert(false);} - virtual void SetValue(char *sp, uint len, int n) {assert(false);} + virtual void SetValue(short, int) {assert(false);} + virtual void SetValue(ushort, int) {assert(false);} + virtual void SetValue(int, int) {assert(false);} + virtual void SetValue(uint, int) {assert(false);} + virtual void SetValue(longlong, int) {assert(false);} + virtual void SetValue(ulonglong, int) {assert(false);} + virtual void SetValue(double, int) {assert(false);} + virtual void SetValue(char, int) {assert(false);} + virtual void SetValue(uchar, int) {assert(false);} + virtual void SetValue(PSZ, int) {assert(false);} + virtual void SetValue(char *, uint, int) {assert(false);} virtual void SetValue(PVAL valp, int n) = 0; virtual void SetValue(PVBLK pv, int n1, int n2) = 0; virtual void SetMin(PVAL valp, int n) = 0; @@ -271,7 +271,7 @@ class STRBLK : public VALBLK { // Implementation virtual void SetNull(int n, bool b) {if (b) {Strp[n] = NULL;}} virtual bool IsNull(int n) {return Strp[n] == NULL;} - virtual void SetNullable(bool b) {} // Always nullable + virtual void SetNullable(bool) {} // Always nullable virtual bool Init(PGLOBAL g, bool check); virtual int GetVlen(void) {return sizeof(PSZ);} virtual PSZ GetCharValue(int n) {return Strp[n];} @@ -284,7 +284,7 @@ class STRBLK : public VALBLK { virtual longlong GetBigintValue(int n); virtual ulonglong GetUBigintValue(int n); virtual double GetFloatValue(int n) {return atof(Strp[n]);} - virtual char *GetCharString(char *p, int n) {return Strp[n];} + virtual char *GetCharString(char *, int n) {return Strp[n];} virtual void Reset(int n) {Strp[n] = NULL;} // Methods diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index d14fc367cc7..5a8b1de326a 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -475,7 +475,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns) break; case TYPE_DATE: - vp = new(g) DTVAL(g, valp->GetIntValue()); + vp = new(g) DTVAL(valp->GetIntValue()); break; case TYPE_DOUBLE: vp = new(g) TYPVAL(valp->GetFloatValue(), TYPE_DOUBLE, @@ -551,7 +551,7 @@ BYTE VALUE::TestValue(PVAL vp) /***********************************************************************/ /* Compute a function on a string. */ /***********************************************************************/ -bool VALUE::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) +bool VALUE::Compute(PGLOBAL g, PVAL *, int, OPVAL) { strcpy(g->Message, "Compute not implemented for this value type"); return true; @@ -976,7 +976,7 @@ ulonglong TYPVAL::MinMaxVal(bool b) {return (b) ? 0xFFFFFFFFFFFFFFFFLL : 0;} template <> -double TYPVAL::MinMaxVal(bool b) +double TYPVAL::MinMaxVal(bool) {assert(false); return 0.0;} template <> @@ -1566,7 +1566,7 @@ bool TYPVAL::GetBinValue(void *buf, int buflen, bool go) /***********************************************************************/ /* STRING ShowValue: get string representation of a char value. */ /***********************************************************************/ -char *TYPVAL::ShowValue(char *buf, int len) +char *TYPVAL::ShowValue(char *, int) { return Strp; } // end of ShowValue @@ -1574,7 +1574,7 @@ char *TYPVAL::ShowValue(char *buf, int len) /***********************************************************************/ /* STRING GetCharString: get string representation of a char value. */ /***********************************************************************/ -char *TYPVAL::GetCharString(char *p) +char *TYPVAL::GetCharString(char *) { return Strp; } // end of GetCharString @@ -1681,7 +1681,7 @@ bool TYPVAL::FormatValue(PVAL vp, char *fmt) /***********************************************************************/ /* STRING SetFormat function (used to set SELECT output format). */ /***********************************************************************/ -bool TYPVAL::SetConstFormat(PGLOBAL g, FORMAT& fmt) +bool TYPVAL::SetConstFormat(PGLOBAL, FORMAT& fmt) { fmt.Type[0] = 'C'; fmt.Length = Len; @@ -2300,7 +2300,7 @@ char *BINVAL::ShowValue(char *buf, int len) /***********************************************************************/ /* BINVAL GetCharString: get string representation of a binary value. */ /***********************************************************************/ -char *BINVAL::GetCharString(char *p) +char *BINVAL::GetCharString(char *) { if (!Chrp) Chrp = (char*)PlugSubAlloc(Global, NULL, Clen * 2 + 1); @@ -2349,7 +2349,7 @@ bool BINVAL::FormatValue(PVAL vp, char *fmt) /***********************************************************************/ /* BINVAL SetFormat function (used to set SELECT output format). */ /***********************************************************************/ -bool BINVAL::SetConstFormat(PGLOBAL g, FORMAT& fmt) +bool BINVAL::SetConstFormat(PGLOBAL, FORMAT& fmt) { fmt.Type[0] = 'B'; fmt.Length = Clen; @@ -2379,7 +2379,7 @@ DTVAL::DTVAL(PGLOBAL g, int n, int prec, PSZ fmt) /***********************************************************************/ /* DTVAL public constructor from int. */ /***********************************************************************/ -DTVAL::DTVAL(PGLOBAL g, int n) : TYPVAL(n, TYPE_DATE) +DTVAL::DTVAL(int n) : TYPVAL(n, TYPE_DATE) { Pdtp = NULL; Len = 19; diff --git a/storage/connect/value.h b/storage/connect/value.h index c5aeb5c2a2f..207944594f1 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -94,18 +94,18 @@ class DllExport VALUE : public BLOCK { virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0; virtual bool SetValue_char(char *p, int n) = 0; virtual void SetValue_psz(PSZ s) = 0; - virtual void SetValue_bool(bool b) {assert(FALSE);} + virtual void SetValue_bool(bool) {assert(FALSE);} virtual int CompareValue(PVAL vp) = 0; virtual BYTE TestValue(PVAL vp); - virtual void SetValue(char c) {assert(false);} - virtual void SetValue(uchar c) {assert(false);} - virtual void SetValue(short i) {assert(false);} - virtual void SetValue(ushort i) {assert(false);} - virtual void SetValue(int n) {assert(false);} - virtual void SetValue(uint n) {assert(false);} - virtual void SetValue(longlong n) {assert(false);} - virtual void SetValue(ulonglong n) {assert(false);} - virtual void SetValue(double f) {assert(false);} + virtual void SetValue(char) {assert(false);} + virtual void SetValue(uchar) {assert(false);} + virtual void SetValue(short) {assert(false);} + virtual void SetValue(ushort) {assert(false);} + virtual void SetValue(int) {assert(false);} + virtual void SetValue(uint) {assert(false);} + virtual void SetValue(longlong) {assert(false);} + virtual void SetValue(ulonglong) {assert(false);} + virtual void SetValue(double) {assert(false);} virtual void SetValue_pvblk(PVBLK blk, int n) = 0; virtual void SetBinValue(void *p) = 0; virtual bool GetBinValue(void *buf, int buflen, bool go) = 0; @@ -338,7 +338,7 @@ class DllExport BINVAL: public VALUE { virtual void SetValue(double f); virtual void SetBinValue(void *p); virtual bool GetBinValue(void *buf, int buflen, bool go); - virtual int CompareValue(PVAL vp) {assert(false); return 0;} + virtual int CompareValue(PVAL) {assert(false); return 0;} virtual char *ShowValue(char *buf, int); virtual char *GetCharString(char *p); virtual bool IsEqual(PVAL vp, bool chktype); @@ -359,11 +359,11 @@ class DllExport DTVAL : public TYPVAL { public: // Constructors DTVAL(PGLOBAL g, int n, int p, PSZ fmt); - DTVAL(PGLOBAL g, PSZ s, int n); - DTVAL(PGLOBAL g, short i); - DTVAL(PGLOBAL g, int n); - DTVAL(PGLOBAL g, longlong n); - DTVAL(PGLOBAL g, double f); +//DTVAL(PGLOBAL g, PSZ s, int n); +//DTVAL(PGLOBAL g, short i); + DTVAL(int n); +//DTVAL(PGLOBAL g, longlong n); +//DTVAL(PGLOBAL g, double f); // Implementation virtual bool IsZero(void) {return Null;} diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index 024a9c081cd..ee8dc3ac4cb 100755 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -1,7 +1,7 @@ /***************** Xindex C++ Class Xindex Code (.CPP) *****************/ /* Name: XINDEX.CPP Version 2.9 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */ /* */ /* This file contains the class XINDEX implementation code. */ /***********************************************************************/ @@ -179,7 +179,7 @@ XXBASE::XXBASE(PTDBDOS tbxp, bool b) : CSORT(b), /***********************************************************************/ /* Make file output of XINDEX contents. */ /***********************************************************************/ -void XXBASE::Print(PGLOBAL g, FILE *f, uint n) +void XXBASE::Print(PGLOBAL, FILE *f, uint n) { char m[64]; @@ -191,7 +191,7 @@ void XXBASE::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of XINDEX contents. */ /***********************************************************************/ -void XXBASE::Print(PGLOBAL g, char *ps, uint z) +void XXBASE::Print(PGLOBAL, char *ps, uint z) { *ps = '\0'; strncat(ps, "Xindex", z); @@ -287,7 +287,7 @@ int XINDEX::Qcompare(int *i1, int *i2) /* Sure enough, it is done while records are read and permit to avoid */ /* reading the table while doing the join (Dynamic index only) */ /***********************************************************************/ -bool XINDEX::AddColumns(PIXDEF xdp) +bool XINDEX::AddColumns(void) { if (!Dynamic) return false; // Not applying to static index @@ -377,7 +377,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) To_LastCol = prev; - if (AddColumns(sxp)) { + if (AddColumns()) { PCOL kolp = To_Cols[0]; // Temporary while imposing Nk = 1 i = 0; @@ -733,7 +733,7 @@ int XINDEX::ColMaxSame(PXCOL kp) /* Reorder: use the sort index to reorder the data in storage so */ /* it will be physically sorted and sort index can be removed. */ /***********************************************************************/ -bool XINDEX::Reorder(PGLOBAL g) +bool XINDEX::Reorder(PGLOBAL g __attribute__((unused))) { register int i, j, k, n; bool sorted = true; @@ -1585,7 +1585,7 @@ int XINDEX::Range(PGLOBAL g, int limit, bool incl) if (++i == Nval) break; } // endfor kp - if ((k = FastFind(Nval)) < Num_K) + if ((k = FastFind()) < Num_K) n = k; // if (limit) // n = (Mul) ? k : kp->Val_K; @@ -1826,7 +1826,7 @@ int XINDEX::Fetch(PGLOBAL g) if (trace > 1) htrc("Fetch: Looking for new value\n"); - Cur_K = FastFind(Nval); + Cur_K = FastFind(); if (Cur_K >= Num_K) /*************************************************************/ @@ -1857,12 +1857,12 @@ int XINDEX::Fetch(PGLOBAL g) /* FastFind: Returns the index of matching record in a join using an */ /* optimized algorithm based on dichotomie and optimized comparing. */ /***********************************************************************/ -int XINDEX::FastFind(int nv) +int XINDEX::FastFind(void) { register int curk, sup, inf, i= 0, k, n = 2; register PXCOL kp, kcp; - assert((int)nv == Nval); +//assert((int)nv == Nval); if (Nblk && Op == OP_EQ) { // Look in block values to find in which block to search @@ -2018,7 +2018,7 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl) /*********************************************************************/ if (xp->GetType() == TYPE_CONST) { kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix); - k = FastFind(Nval); + k = FastFind(); if (k < Num_K || Op != OP_EQ) if (limit) @@ -2162,7 +2162,7 @@ int XINDXS::Fetch(PGLOBAL g) if (trace > 1) htrc("Fetch: Looking for new value\n"); - Cur_K = FastFind(1); + Cur_K = FastFind(); if (Cur_K >= Num_K) // Rank not whithin index table, signal record not found @@ -2190,7 +2190,7 @@ int XINDXS::Fetch(PGLOBAL g) /* FastFind: Returns the index of matching indexed record using an */ /* optimized algorithm based on dichotomie and optimized comparing. */ /***********************************************************************/ -int XINDXS::FastFind(int nk) +int XINDXS::FastFind(void) { register int sup, inf, i= 0, n = 2; register PXCOL kcp = To_KeyCol; @@ -2360,7 +2360,8 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) /***********************************************************************/ /* Move into an index file. */ /***********************************************************************/ -bool XFILE::Seek(PGLOBAL g, int low, int high, int origin) +bool XFILE::Seek(PGLOBAL g, int low, int high __attribute__((unused)), + int origin) { #if defined(_DEBUG) assert(high == 0); @@ -2371,7 +2372,6 @@ bool XFILE::Seek(PGLOBAL g, int low, int high, int origin) return true; } // endif -//ftell(Xfile); return false; } // end of Seek @@ -2819,7 +2819,7 @@ void XHUGE::Close(char *fn, int id) /***********************************************************************/ /* Don't know whether this is possible for huge files. */ /***********************************************************************/ -void *XHUGE::FileView(PGLOBAL g, char *fn) +void *XHUGE::FileView(PGLOBAL g, char *) { strcpy(g->Message, MSG(NO_PART_MAP)); return NULL; @@ -2879,7 +2879,7 @@ bool XXROW::Init(PGLOBAL g) /***********************************************************************/ /* RANGE: Tell how many record exist in a given value range. */ /***********************************************************************/ -int XXROW::Range(PGLOBAL g, int limit, bool incl) +int XXROW::Range(PGLOBAL, int limit, bool incl) { int n = Valp->GetIntValue(); @@ -2895,7 +2895,7 @@ int XXROW::Range(PGLOBAL g, int limit, bool incl) /***********************************************************************/ /* XXROW: Fetch a physical or logical record. */ /***********************************************************************/ -int XXROW::Fetch(PGLOBAL g) +int XXROW::Fetch(PGLOBAL) { if (Num_K == 0) return -1; // means end of file @@ -2904,7 +2904,7 @@ int XXROW::Fetch(PGLOBAL g) /* Look for a key equal to the link column of previous table, */ /* and return its rank whithin the index table. */ /*********************************************************************/ - Cur_K = FastFind(1); + Cur_K = FastFind(); if (Cur_K >= Num_K) /*******************************************************************/ @@ -2926,7 +2926,7 @@ int XXROW::Fetch(PGLOBAL g) /***********************************************************************/ /* FastFind: Returns the index of matching record in a join. */ /***********************************************************************/ -int XXROW::FastFind(int nk) +int XXROW::FastFind(void) { int n = Valp->GetIntValue(); diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index 6e40e9b160e..079412b32cf 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -1,7 +1,7 @@ /*************** Xindex H Declares Source Code File (.H) ***************/ /* Name: XINDEX.H Version 3.5 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2004 - 2013 */ +/* (C) Copyright to the author Olivier BERTRAND 2004 - 2015 */ /* */ /* This file contains the XINDEX class declares. */ /***********************************************************************/ @@ -205,12 +205,11 @@ class DllExport XXBASE : public CSORT, public BLOCK { #endif // XMAP virtual int MaxRange(void) {return 1;} virtual int Fetch(PGLOBAL g) = 0; - virtual bool NextVal(bool eq) {return true;} + virtual bool NextVal(bool) {return true;} virtual bool PrevVal(void) {return true;} - virtual int FastFind(int nk) = 0; - virtual bool Reorder(PGLOBAL g) {return true;} - virtual int Range(PGLOBAL g, int limit = 0, bool incl = true) - {return -1;} // Means error + virtual int FastFind(void) = 0; + virtual bool Reorder(PGLOBAL) {return true;} + virtual int Range(PGLOBAL, int = 0, bool = true) {return -1;} // Means error virtual int Qcompare(int *, int *) = 0; virtual int GroupSize(void) {return 1;} virtual void Close(void) = 0; @@ -266,7 +265,7 @@ class DllExport XINDEX : public XXBASE { #endif // XMAP virtual int Qcompare(int *, int *); virtual int Fetch(PGLOBAL g); - virtual int FastFind(int nk); + virtual int FastFind(void); virtual int GroupSize(void); virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); virtual int MaxRange(void) {return MaxSame;} @@ -280,7 +279,7 @@ class DllExport XINDEX : public XXBASE { bool GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk); protected: - bool AddColumns(PIXDEF xdp); + bool AddColumns(void); bool NextValDif(void); // Members @@ -312,7 +311,7 @@ class DllExport XINDXS : public XINDEX { // Methods virtual int Qcompare(int *, int *); virtual int Fetch(PGLOBAL g); - virtual int FastFind(int nk); + virtual int FastFind(void); virtual bool NextVal(bool eq); virtual bool PrevVal(void); virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); @@ -421,14 +420,14 @@ class DllExport XXROW : public XXBASE { // Methods virtual bool Init(PGLOBAL g); #if defined(XMAP) - virtual bool MapInit(PGLOBAL g) {return true;} + virtual bool MapInit(PGLOBAL) {return true;} #endif // XMAP virtual int Fetch(PGLOBAL g); - virtual int FastFind(int nk); + virtual int FastFind(void); virtual int MaxRange(void) {return 1;} virtual int Range(PGLOBAL g, int limit = 0, bool incl = true); virtual int Qcompare(int *, int *) {assert(false); return 0;} - virtual bool Make(PGLOBAL g, PIXDEF sxp) {return false;} + virtual bool Make(PGLOBAL, PIXDEF) {return false;} virtual void Close(void) {} protected: diff --git a/storage/connect/xobject.h b/storage/connect/xobject.h index 8e2358dd526..82ff9e21225 100644 --- a/storage/connect/xobject.h +++ b/storage/connect/xobject.h @@ -42,9 +42,9 @@ class DllExport XOBJECT : public BLOCK { virtual int GetResultType(void) {return TYPE_VOID;} virtual int GetKey(void) {return 0;} #if defined(_DEBUG) - virtual void SetKey(int k) {assert(false);} + virtual void SetKey(int) {assert(false);} #else // !_DEBUG - virtual void SetKey(int k) {} // Only defined for COLBLK + virtual void SetKey(int) {} // Only defined for COLBLK #endif // !_DEBUG virtual int GetLength(void) = 0; virtual int GetLengthEx(void) = 0; diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h index d1ea2b0d85f..1a75d97bafa 100644 --- a/storage/connect/xtable.h +++ b/storage/connect/xtable.h @@ -77,21 +77,21 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block. virtual int GetTdb_No(void) {return Tdb_No;} virtual PTDB GetNext(void) {return Next;} virtual PCATLG GetCat(void) {return NULL;} - virtual void SetAbort(bool b) {;} + virtual void SetAbort(bool) {;} // Methods virtual bool IsSame(PTDB tp) {return tp == this;} virtual bool IsSpecial(PSZ name) = 0; - virtual bool GetBlockValues(PGLOBAL g) {return false;} - virtual int Cardinality(PGLOBAL g) {return 0;} + virtual bool GetBlockValues(PGLOBAL) {return false;} + virtual int Cardinality(PGLOBAL) {return 0;} virtual int GetMaxSize(PGLOBAL) = 0; virtual int GetProgMax(PGLOBAL) = 0; virtual int GetProgCur(void) = 0; virtual int RowNumber(PGLOBAL g, bool b = false); virtual bool IsReadOnly(void) {return true;} virtual const CHARSET_INFO *data_charset() {return NULL;} - virtual PTDB Duplicate(PGLOBAL g) {return NULL;} - virtual PTDB CopyOne(PTABS t) {return this;} + virtual PTDB Duplicate(PGLOBAL) {return NULL;} + virtual PTDB CopyOne(PTABS) {return this;} virtual PTDB Copy(PTABS t); virtual void PrintAM(FILE *f, char *m) {fprintf(f, "%s AM(%d)\n", m, GetAmType());} @@ -108,7 +108,7 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block. virtual int WriteDB(PGLOBAL) = 0; virtual int DeleteDB(PGLOBAL, int) = 0; virtual void CloseDB(PGLOBAL) = 0; - virtual int CheckWrite(PGLOBAL g) {return 0;} + virtual int CheckWrite(PGLOBAL) {return 0;} virtual bool ReadKey(PGLOBAL, OPVAL, const void *, int) = 0; protected: @@ -155,7 +155,7 @@ class DllExport TDBASE : public TDB { PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;} // Methods - virtual bool IsUsingTemp(PGLOBAL g) {return false;} + virtual bool IsUsingTemp(PGLOBAL) {return false;} virtual bool IsIndexed(void) {return false;} virtual bool IsSpecial(PSZ name); virtual PCATLG GetCat(void); @@ -170,9 +170,9 @@ class DllExport TDBASE : public TDB { virtual CHARSET_INFO *data_charset(void); virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} virtual int GetProgCur(void) {return GetRecpos();} - virtual PSZ GetFile(PGLOBAL g) {return "Not a file";} + virtual PSZ GetFile(PGLOBAL) {return "Not a file";} virtual int GetRemote(void) {return 0;} - virtual void SetFile(PGLOBAL g, PSZ fn) {} + virtual void SetFile(PGLOBAL, PSZ) {} virtual void ResetDB(void) {} virtual void ResetSize(void) {MaxSize = -1;} virtual void RestoreNrec(void) {} @@ -183,12 +183,12 @@ class DllExport TDBASE : public TDB { virtual PCOL ColDB(PGLOBAL g, PSZ name, int num); virtual PCOL MakeCol(PGLOBAL, PCOLDEF, PCOL, int) {assert(false); return NULL;} - virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp); + virtual PCOL InsertSpecialColumn(PCOL colp); virtual PCOL InsertSpcBlk(PGLOBAL g, PCOLDEF cdp); virtual void MarkDB(PGLOBAL g, PTDB tdb2); - virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) + virtual int MakeIndex(PGLOBAL g, PIXDEF, bool) {strcpy(g->Message, "Remote index"); return RC_INFO;} - virtual bool ReadKey(PGLOBAL g, OPVAL op, const void *key, int len) + virtual bool ReadKey(PGLOBAL, OPVAL, const void *, int) {assert(false); return true;} protected: @@ -225,7 +225,7 @@ class DllExport TDBCAT : public TDBASE { // Methods virtual int GetRecpos(void) {return N;} virtual int GetProgCur(void) {return N;} - virtual int RowNumber(PGLOBAL g, bool b = false) {return N + 1;} + virtual int RowNumber(PGLOBAL, bool = false) {return N + 1;} virtual bool SetRecpos(PGLOBAL g, int recpos); // Database routines -- cgit v1.2.1 From c63bd866fd4ec4d129bd165d4da8d8d004ab3dbd Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 10 May 2015 12:14:21 +0200 Subject: Get rid of more GCC warnings about unused parameters modified: storage/connect/array.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/mycat.cc modified: storage/connect/tabxml.cpp modified: storage/connect/user_connect.cc modified: storage/connect/user_connect.h --- storage/connect/array.cpp | 4 ++-- storage/connect/ha_connect.cc | 39 +++++++++++++++++++-------------------- storage/connect/mycat.cc | 8 ++++---- storage/connect/tabxml.cpp | 26 +++++++++++++++++++++----- storage/connect/user_connect.cc | 6 +++--- storage/connect/user_connect.h | 2 +- 6 files changed, 50 insertions(+), 35 deletions(-) diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index 437e9af0bdd..0e8829d66a6 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -186,7 +186,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec) // The error message was built by PlgDBalloc Type = TYPE_ERROR; else if (type != TYPE_PCHAR) - Value = AllocateValue(g, type, Len, prec, NULL); + Value = AllocateValue(g, type, Len, prec); Constant = TRUE; } // end of ARRAY constructor @@ -610,7 +610,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp) // The error message was built by PlgDBalloc return TYPE_ERROR; else - Value = AllocateValue(g, Type, Len, prec, NULL); + Value = AllocateValue(g, Type, Len, prec); /*********************************************************************/ /* Converting STRING to DATE can be done according to date format. */ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 2449a1fdb97..72f48d72bb1 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -349,7 +349,7 @@ int GetConvSize(void) {return THDVAR(current_thd, conv_size);} TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);} uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);} uint GetWorkSize(void) {return THDVAR(current_thd, work_size);} -void SetWorkSize(uint n) +void SetWorkSize(uint) { // Changing the session variable value seems to be impossible here // and should be done in a check function @@ -664,7 +664,7 @@ static int connect_init_func(void *p) @brief Plugin clean up */ -static int connect_done_func(void *p) +static int connect_done_func(void *) { int error= 0; PCONNECT pc, pn; @@ -822,8 +822,6 @@ ha_connect::~ha_connect(void) /****************************************************************************/ static PCONNECT GetUser(THD *thd, PCONNECT xp) { - const char *dbn= NULL; - if (!thd) return NULL; @@ -835,7 +833,7 @@ static PCONNECT GetUser(THD *thd, PCONNECT xp) break; if (!xp) { - xp= new user_connect(thd, dbn); + xp= new user_connect(thd); if (xp->user_init()) { delete xp; @@ -908,7 +906,8 @@ const char *ha_connect::index_type(uint inx) If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ -ulong ha_connect::index_flags(uint inx, uint part, bool all_parts) const +//ong ha_connect::index_flags(uint inx, uint part, bool all_parts) const +ulong ha_connect::index_flags(uint, uint, bool) const { ulong flags= HA_READ_NEXT | HA_READ_RANGE | HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR; @@ -2008,7 +2007,7 @@ int ha_connect::MakeRecord(char *buf) /***********************************************************************/ /* Set row values from a MySQL pseudo record. Specific to MySQL. */ /***********************************************************************/ -int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) +int ha_connect::ScanRecord(PGLOBAL g, uchar *) { char attr_buffer[1024]; char data_buffer[1024]; @@ -2150,7 +2149,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) /* Check change in index column. Specific to MySQL. */ /* Should be elaborated to check for real changes. */ /***********************************************************************/ -int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf) +int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf) { return ScanRecord(g, newbuf); } // end of dummy CheckRecord @@ -2923,7 +2922,7 @@ bool ha_connect::get_error_message(int error, String* buf) &dummy_errors); if (trace) - htrc("GEM(%u): %s\n", len, g->Message); + htrc("GEM(%d): len=%u %s\n", error, len, g->Message); msg[len]= '\0'; buf->copy(msg, (uint)strlen(msg), system_charset_info); @@ -3019,7 +3018,7 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked) @brief Make the indexes for this table */ -int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt) +int ha_connect::optimize(THD* thd, HA_CHECK_OPT*) { int rc= 0; PGLOBAL& g= xp->g; @@ -3223,7 +3222,7 @@ int ha_connect::update_row(const uchar *old_data, uchar *new_data) @see sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc */ -int ha_connect::delete_row(const uchar *buf) +int ha_connect::delete_row(const uchar *) { int rc= 0; DBUG_ENTER("ha_connect::delete_row"); @@ -3503,7 +3502,8 @@ int ha_connect::index_last(uchar *buf) /****************************************************************************/ /* This is called to get more rows having the same index value. */ /****************************************************************************/ -int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen) +//t ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen) +int ha_connect::index_next_same(uchar *buf, const uchar *, uint) { int rc; DBUG_ENTER("ha_connect::index_next_same"); @@ -3693,7 +3693,7 @@ int ha_connect::rnd_next(uchar *buf) @see filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc */ -void ha_connect::position(const uchar *record) +void ha_connect::position(const uchar *) { DBUG_ENTER("ha_connect::position"); //if (((PTDBASE)tdbp)->GetDef()->Indexable()) @@ -3876,7 +3876,7 @@ int ha_connect::info(uint flag) @see ha_innodb.cc */ -int ha_connect::extra(enum ha_extra_function operation) +int ha_connect::extra(enum ha_extra_function /*operation*/) { DBUG_ENTER("ha_connect::extra"); DBUG_RETURN(0); @@ -4484,7 +4484,7 @@ int ha_connect::external_lock(THD *thd, int lock_type) @see get_lock_data() in lock.cc */ -THR_LOCK_DATA **ha_connect::store_lock(THD *thd, +THR_LOCK_DATA **ha_connect::store_lock(THD *, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { @@ -4955,7 +4955,7 @@ static int init_table_share(THD* thd, @note this function is no more called in case of CREATE .. SELECT */ -static int connect_assisted_discovery(handlerton *hton, THD* thd, +static int connect_assisted_discovery(handlerton *, THD* thd, TABLE_SHARE *table_s, HA_CREATE_INFO *create_info) { @@ -4967,8 +4967,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, #if defined(WIN32) char *nsp= NULL, *cls= NULL; #endif // WIN32 - int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0; - int cop __attribute__((unused))= 0, pty= 2, lrecl= 0, lvl= 0; + int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0; + int cop __attribute__((unused))= 0, pty= 2, lrecl= 0; #if defined(ODBC_SUPPORT) POPARM sop = NULL; char *ucnc = NULL; @@ -6464,8 +6464,7 @@ fin: @note: This function is no more called by check_if_supported_inplace_alter */ -bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) +bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint) { DBUG_ENTER("ha_connect::check_if_incompatible_data"); // TO DO: really implement and check it. diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index b15c8fa2322..0bc82cd80ce 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2014 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ /* ------------- */ /* Version 1.4 */ /* */ -/* Author: Olivier Bertrand 2012 - 2014 */ +/* Author: Olivier Bertrand 2012 - 2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -478,7 +478,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path) /* Look for a table descriptor matching the name and type. */ /***********************************************************************/ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name, - LPCSTR type, PRELDEF *prp) + LPCSTR type, PRELDEF *) { if (trace) printf("GetTableDesc: name=%s am=%s\n", name, SVP(type)); @@ -589,7 +589,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type) /***********************************************************************/ /* ClearDB: Terminates Database usage. */ /***********************************************************************/ -void MYCAT::ClearDB(PGLOBAL g) +void MYCAT::ClearDB(PGLOBAL) { } // end of ClearDB diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index c25c3d9ffb4..46f762efc35 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -118,7 +118,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT}; static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; char *op, colname[65], fmt[129], buf[512]; - int i, j, lvl, rc, n = 0; + int i, j, lvl, n = 0; int ncol = sizeof(buftyp) / sizeof(int); bool ok = true; PXCL xcol, xcp, fxcp = NULL, pxcp = NULL; @@ -164,7 +164,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) txmp = new(g) TDBXML(tdp); if (txmp->Initialize(g)) - return NULL; + goto err; xcol = new(g) XMCOL; colname[64] = 0; @@ -224,8 +224,16 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) if (vp->atp) { strncpy(colname, vp->atp->GetName(g), sizeof(colname)); strncat(xcol->Name, colname, 64); - rc = vp->atp->GetText(g, buf, sizeof(buf)); - strncat(fmt, "@", sizeof(fmt)); + + switch (vp->atp->GetText(g, buf, sizeof(buf))) { + case RC_INFO: + PushWarning(g, txmp); + case RC_OK: + strncat(fmt, "@", sizeof(fmt)); + break; + default: + goto err; + } // enswitch rc if (j) strncat(fmt, colname, sizeof(fmt)); @@ -273,7 +281,15 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) } else ok = true; - rc = node->GetContent(g, buf, sizeof(buf)); + switch (node->GetContent(g, buf, sizeof(buf))) { + case RC_INFO: + PushWarning(g, txmp); + case RC_OK: + break; + default: + goto err; + } // enswitch rc + } // endif atp; xcol->Len = strlen(buf); diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc index 4affe447b00..34d192361a5 100644 --- a/storage/connect/user_connect.cc +++ b/storage/connect/user_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2014 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ */ /****************************************************************************/ -/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2014 */ +/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */ /****************************************************************************/ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation @@ -63,7 +63,7 @@ void SetWorkSize(uint); /****************************************************************************/ /* Constructor. */ /****************************************************************************/ -user_connect::user_connect(THD *thd, const char *dbn) +user_connect::user_connect(THD *thd) { thdp= thd; next= NULL; diff --git a/storage/connect/user_connect.h b/storage/connect/user_connect.h index 44e4e94fa8a..7f37973f378 100644 --- a/storage/connect/user_connect.h +++ b/storage/connect/user_connect.h @@ -45,7 +45,7 @@ class user_connect friend int connect_done_func(void *); public: // Constructor - user_connect(THD *thd, const char *dbn); + user_connect(THD *thd); // Destructor virtual ~user_connect(); -- cgit v1.2.1 From 3b3f6cac8aa5897c5f690c30c853d8dbaa3ba73c Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 8 May 2015 13:21:42 +0200 Subject: Typo to check buildbot --- .gitignore | 5 +++ .../connect/mysql-test/connect/r/xml_html.result | 14 +++---- storage/connect/tabxml.cpp | 46 ---------------------- 3 files changed, 12 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index e3df21eb17b..85d68f2853d 100644 --- a/.gitignore +++ b/.gitignore @@ -245,6 +245,11 @@ storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset *.ko *.obj *.elf +*.exp +*.manifest +*.dep +*.idb +*.res # Precompiled Headers *.gch diff --git a/storage/connect/mysql-test/connect/r/xml_html.result b/storage/connect/mysql-test/connect/r/xml_html.result index 7b5e0febe6e..143f46529f6 100644 --- a/storage/connect/mysql-test/connect/r/xml_html.result +++ b/storage/connect/mysql-test/connect/r/xml_html.result @@ -1,5 +1,5 @@ Warnings: -Warning 1105 No file name. Table will use t1.xml +Warning 1105 No file name. Table will use t1.xml SET NAMES utf8; # # Testing HTML like XML file @@ -11,9 +11,9 @@ CREATE TABLE beers ( ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; SELECT * FROM beers; -Name Origin Description -Huntsman Bath, UK Wonderful hop, light alcohol -Tuborg Danmark In small bottles +Name Origin Description +Huntsman Bath, UK Wonderful hop, light alcohol +Tuborg Danmark In small bottles DROP TABLE beers; # # Testing HTML file @@ -26,7 +26,7 @@ CREATE TABLE coffee ( ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; SELECT * FROM coffee; -Name Cups Type Sugar -T. Sexton 10 Espresso No -J. Dinnen 5 Decaf Yes +Name Cups Type Sugar +T. Sexton 10 Espresso No +J. Dinnen 5 Decaf Yes DROP TABLE coffee; diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 1c1ff8a2ffe..4f7af638d0c 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -313,10 +313,6 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) pxcp = xcp; -// for (j = lvl - 1; j >= 0; j--) -// if (jrp[j] && (jrp[j] = jrp[j]->GetNext())) -// goto more; - if (vp->atp) vp->atp = vp->atp->GetNext(g); @@ -421,8 +417,6 @@ XMLDEF::XMLDEF(void) bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { char *defrow, *defcol, buf[10]; -//void *memp = Cat->GetDescp(); -//PSZ dbfile = Cat->GetDescFile(); Fn = GetStringCatInfo(g, "Filename", NULL); Encoding = GetStringCatInfo(g, "Encoding", "UTF-8"); @@ -479,12 +473,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Header = GetIntCatInfo("Header", 0); GetCharCatInfo("Xmlsup", "*", buf, sizeof(buf)); -//if (*buf == '*') // Try the old (deprecated) option -// GetCharCatInfo("Method", "*", buf, sizeof(buf)); - -//if (*buf == '*') // Is there a default for the database? -// GetCharCatInfo("Defxml", XMLSUP, buf, sizeof(buf)); - // Note that if no support is specified, the default is MS-DOM // on Windows and libxml2 otherwise if (*buf == '*') @@ -499,7 +487,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) // Get eventual table node attribute Attrib = GetStringCatInfo(g, "Attribute", ""); Hdattr = GetStringCatInfo(g, "HeadAttr", ""); - return false; } // end of DefineAM @@ -519,30 +506,6 @@ PTDB XMLDEF::GetTable(PGLOBAL g, MODE m) return tdbp; } // end of GetTable -#if 0 -/***********************************************************************/ -/* DeleteTableFile: Delete XML table files using platform API. */ -/***********************************************************************/ -bool XMLDEF::DeleteTableFile(PGLOBAL g) - { - char filename[_MAX_PATH]; - bool rc; - - // Delete the XML table file if not protected - if (!IsReadOnly()) { - PlugSetPath(filename, Fn, GetPath()); -#if defined(WIN32) - rc = !DeleteFile(filename); -#else // UNIX - rc = remove(filename); -#endif // UNIX - } else - rc =true; - - return rc; // Return true if error - } // end of DeleteTableFile -#endif // 0 - /* ------------------------- TDBXML Class ---------------------------- */ /***********************************************************************/ @@ -854,7 +817,6 @@ bool TDBXML::Initialize(PGLOBAL g) To_Xb = Docp->LinkXblock(g, Mode, rc, filename); // Add a CONNECT comment node -// sprintf(buf, " Created by CONNECT %s ", version); strcpy(buf, " Created by the MariaDB CONNECT Storage Engine"); Docp->AddComment(g, buf); @@ -1279,7 +1241,6 @@ void TDBXML::CloseDB(PGLOBAL g) if (Docp) { if (Changed) { char filename[_MAX_PATH]; -// PDBUSER dup = (PDBUSER)g->Activityp->Aptr; // We used the file name relative to recorded datapath PlugSetPath(filename, Xfile, GetPath()); @@ -1321,7 +1282,6 @@ void TDBXML::CloseDB(PGLOBAL g) NewRow = false; Hasnod = false; Write = false; -// Bufdone = false; Nodedone = false; Void = false; Nrow = -1; @@ -1413,8 +1373,6 @@ bool XMLCOL::AllocBuf(PGLOBAL g, bool mode) if (Valbuf) return false; // Already done -//Valbuf = (char*)PlugSubAlloc(g, NULL, Long + 1); -//Valbuf[Long] = '\0'; return ParseXpath(g, mode); } // end of AllocBuf @@ -1506,8 +1464,6 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) // HTML like table, columns are retrieved by position new(this) XPOSCOL(Value); // Change the class of this column Inod = -1; -// Tdbp->Hasnod = true; -// return false; } else if (Type == 0 && !mode) { strcat(strcat(pbuf, "@"), Name); } else { // Type == 1 @@ -1657,7 +1613,6 @@ void XMLCOL::WriteColumn(PGLOBAL g) int done = 0; int i, n, k = 0; PXNODE TopNode = NULL; -//PXATTR AttNode = NULL; if (trace > 1) htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n", @@ -1892,7 +1847,6 @@ void XMULCOL::WriteColumn(PGLOBAL g) int done = 0; int i, n, len, k = 0; PXNODE TopNode = NULL; -//PXATTR AttNode = NULL; if (trace) htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n", -- cgit v1.2.1 From 7c02f74cf8461934b39e2a5a769d4f36b434581b Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 10 May 2015 12:22:43 +0200 Subject: Get rid of more GCC warnings about unused parameters storage/connect/colblk.cpp --- storage/connect/colblk.cpp | 834 ++++++++++++++++++++++----------------------- 1 file changed, 417 insertions(+), 417 deletions(-) diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index 78aba7bc494..f5bd32db738 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -1,417 +1,417 @@ -/************* Colblk C++ Functions Source Code File (.CPP) ************/ -/* Name: COLBLK.CPP Version 2.1 */ -/* */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ -/* */ -/* This file contains the COLBLK class functions. */ -/***********************************************************************/ - -/***********************************************************************/ -/* Include relevant MariaDB header file. */ -/***********************************************************************/ -#include "my_global.h" - -/***********************************************************************/ -/* Include required application header files */ -/* global.h is header containing all global Plug declarations. */ -/* plgdbsem.h is header containing the DB applic. declarations. */ -/***********************************************************************/ -#include "global.h" -#include "plgdbsem.h" -#include "tabcol.h" -#include "colblk.h" -#include "xindex.h" -#include "xtable.h" - -/***********************************************************************/ -/* COLBLK protected constructor. */ -/***********************************************************************/ -COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i) - { - Next = NULL; - Index = i; -//Number = 0; - ColUse = 0; - - if ((Cdp = cdp)) { - Name = cdp->Name; - Format = cdp->F; - Opt = cdp->Opt; - Long = cdp->Long; - Precision = cdp->Precision; - Freq = cdp->Freq; - Buf_Type = cdp->Buf_Type; - ColUse |= cdp->Flags; // Used by CONNECT - Nullable = !!(cdp->Flags & U_NULLS); - Unsigned = !!(cdp->Flags & U_UNSIGNED); - } else { - Name = NULL; - memset(&Format, 0, sizeof(FORMAT)); - Opt = 0; - Long = 0; - Precision = 0; - Freq = 0; - Buf_Type = TYPE_ERROR; - Nullable = false; - Unsigned = false; - } // endif cdp - - To_Tdb = tdbp; - Status = BUF_NO; -//Value = NULL; done in XOBJECT constructor - To_Kcol = NULL; - } // end of COLBLK constructor - -/***********************************************************************/ -/* COLBLK constructor used for copying columns. */ -/* tdbp is the pointer to the new table descriptor. */ -/***********************************************************************/ -COLBLK::COLBLK(PCOL col1, PTDB tdbp) - { - PCOL colp; - - // Copy the old column block to the new one - *this = *col1; - Next = NULL; -//To_Orig = col1; - To_Tdb = tdbp; - - if (trace > 1) - htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); - - if (tdbp) - // Attach the new column to the table block - if (!tdbp->GetColumns()) - tdbp->SetColumns(this); - else { - for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ; - - colp->Next = this; - } // endelse - - } // end of COLBLK copy constructor - -/***********************************************************************/ -/* Reset the column descriptor to non evaluated yet. */ -/***********************************************************************/ -void COLBLK::Reset(void) - { - Status &= ~BUF_READ; - } // end of Reset - -/***********************************************************************/ -/* Compare: compares itself to an (expression) object and returns */ -/* true if it is equivalent. */ -/***********************************************************************/ -bool COLBLK::Compare(PXOB xp) - { - return (this == xp); - } // end of Compare - -/***********************************************************************/ -/* SetFormat: function used to set SELECT output format. */ -/***********************************************************************/ -bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt) - { - fmt = Format; - - if (trace > 1) - htrc("COLBLK: %p format=%c(%d,%d)\n", - this, *fmt.Type, fmt.Length, fmt.Prec); - - return false; - } // end of SetFormat - -/***********************************************************************/ -/* Eval: get the column value from the last read record or from a */ -/* matching Index column if there is one. */ -/***********************************************************************/ -bool COLBLK::Eval(PGLOBAL g) - { - if (trace > 1) - htrc("Col Eval: %s status=%.4X\n", Name, Status); - - if (!GetStatus(BUF_READ)) { -// if (To_Tdb->IsNull()) -// Value->Reset(); - if (To_Kcol) - To_Kcol->FillValue(Value); - else - ReadColumn(g); - - AddStatus(BUF_READ); - } // endif - - return false; - } // end of Eval - -/***********************************************************************/ -/* InitValue: prepare a column block for read operation. */ -/* Now we use Format.Length for the len parameter to avoid strings */ -/* to be truncated when converting from string to coded string. */ -/* Added in version 1.5 is the arguments GetScale() and Domain */ -/* in calling AllocateValue. Domain is used for TYPE_DATE only. */ -/***********************************************************************/ -bool COLBLK::InitValue(PGLOBAL g) - { - if (Value) - return false; // Already done - - // Allocate a Value object - if (!(Value = AllocateValue(g, Buf_Type, Precision, - GetScale(), Unsigned, GetDomain()))) - return true; - - AddStatus(BUF_READY); - Value->SetNullable(Nullable); - - if (trace > 1) - htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n", - this, Buf_Type, Value, ColUse, Status); - - return false; - } // end of InitValue - -/***********************************************************************/ -/* SetBuffer: prepare a column block for write operation. */ -/***********************************************************************/ -bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer"); - return true; - } // end of SetBuffer - -/***********************************************************************/ -/* GetLength: returns an evaluation of the column string length. */ -/***********************************************************************/ -int COLBLK::GetLengthEx(void) - { - return Long; - } // end of GetLengthEx - -/***********************************************************************/ -/* ReadColumn: what this routine does is to access the last line */ -/* read from the corresponding table, extract from it the field */ -/* corresponding to this column and convert it to buffer type. */ -/***********************************************************************/ -void COLBLK::ReadColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn"); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of ReadColumn - -/***********************************************************************/ -/* WriteColumn: what this routine does is to access the last line */ -/* read from the corresponding table, and rewrite the field */ -/* corresponding to this column from the column buffer and type. */ -/***********************************************************************/ -void COLBLK::WriteColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn"); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of WriteColumn - -/***********************************************************************/ -/* Make file output of a column descriptor block. */ -/***********************************************************************/ -void COLBLK::Print(PGLOBAL g, FILE *f, uint n) - { - char m[64]; - int i; - PCOL colp; - - memset(m, ' ', n); // Make margin string - m[n] = '\0'; - - for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++) - if (colp == this) - break; - - fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(), - i, GetAmType(), Format.Type, Format.Length, Format.Prec); - fprintf(f, - " coluse=%04X status=%04X buftyp=%d value=%p name=%s\n", - ColUse, Status, Buf_Type, Value, Name); - } // end of Print - -/***********************************************************************/ -/* Make string output of a column descriptor block. */ -/***********************************************************************/ -void COLBLK::Print(PGLOBAL g, char *ps, uint z) - { - sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); - } // end of Print - - -/***********************************************************************/ -/* SPCBLK constructor. */ -/***********************************************************************/ -SPCBLK::SPCBLK(PCOLUMN cp) - : COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0) - { - Name = (char*)cp->GetName(); - Precision = Long = 0; - Buf_Type = TYPE_ERROR; - } // end of SPCBLK constructor - -/***********************************************************************/ -/* WriteColumn: what this routine does is to access the last line */ -/* read from the corresponding table, and rewrite the field */ -/* corresponding to this column from the column buffer and type. */ -/***********************************************************************/ -void SPCBLK::WriteColumn(PGLOBAL g) - { - sprintf(g->Message, MSG(SPCOL_READONLY), Name); - longjmp(g->jumper[g->jump_level], TYPE_COLBLK); - } // end of WriteColumn - -/***********************************************************************/ -/* RIDBLK constructor for the ROWID special column. */ -/***********************************************************************/ -RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp) - { - Precision = Long = 10; - Buf_Type = TYPE_INT; - Rnm = rnm; - *Format.Type = 'N'; - Format.Length = 10; - } // end of RIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the ordinal */ -/* number of the current row in the table (if Rnm is true) or in the */ -/* current file (if Rnm is false) the same except for multiple tables.*/ -/***********************************************************************/ -void RIDBLK::ReadColumn(PGLOBAL g) - { - Value->SetValue(To_Tdb->RowNumber(g, Rnm)); - } // end of ReadColumn - -/***********************************************************************/ -/* FIDBLK constructor for the FILEID special column. */ -/***********************************************************************/ -FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = _MAX_PATH; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; -#if defined(WIN32) - Format.Prec = 1; // Case insensitive -#endif // WIN32 - Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && - To_Tdb->GetAmType() != TYPE_AM_PLG && - To_Tdb->GetAmType() != TYPE_AM_PLM); - Fn = NULL; - } // end of FIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the current */ -/* file ID of the table (can change for Multiple tables). */ -/***********************************************************************/ -void FIDBLK::ReadColumn(PGLOBAL g) - { - if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) { - char filename[_MAX_PATH]; - - Fn = ((PTDBASE)To_Tdb)->GetFile(g); - PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath()); - - if (Op != OP_XX) { - char buff[_MAX_PATH]; - - Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op)); - } else - Value->SetValue_psz(filename); - - } // endif Fn - - } // end of ReadColumn - -/***********************************************************************/ -/* TIDBLK constructor for the TABID special column. */ -/***********************************************************************/ -TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); - Tname = NULL; - } // end of TIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the table ID. */ -/***********************************************************************/ -void TIDBLK::ReadColumn(PGLOBAL g) - { - if (Tname == NULL) { - Tname = (char*)To_Tdb->GetName(); - Value->SetValue_psz(Tname); - } // endif Tname - - } // end of ReadColumn - -/***********************************************************************/ -/* PRTBLK constructor for the PARTID special column. */ -/***********************************************************************/ -PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = true; // TODO: check whether this is true indeed - Pname = NULL; - } // end of PRTBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the partition ID. */ -/***********************************************************************/ -void PRTBLK::ReadColumn(PGLOBAL g) - { - if (Pname == NULL) { - char *p; - PTDBASE tdbp = (PTDBASE)To_Tdb; - - Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?"); - - p = strrchr(Pname, '#'); - Value->SetValue_psz((p) ? p + 1 : Pname); - } // endif Pname - - } // end of ReadColumn - -/***********************************************************************/ -/* SIDBLK constructor for the SERVID special column. */ -/***********************************************************************/ -SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp) - { -//Is_Key = 2; for when the MUL table indexed reading will be implemented. - Precision = Long = 64; - Buf_Type = TYPE_STRING; - *Format.Type = 'C'; - Format.Length = Long; - Format.Prec = 1; // Case insensitive - Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); - Sname = NULL; - } // end of TIDBLK constructor - -/***********************************************************************/ -/* ReadColumn: what this routine does is to return the server ID. */ -/***********************************************************************/ -void SIDBLK::ReadColumn(PGLOBAL g) - { -//if (Sname == NULL) { - Sname = (char*)To_Tdb->GetServer(); - Value->SetValue_psz(Sname); -// } // endif Sname - - } // end of ReadColumn - +/************* Colblk C++ Functions Source Code File (.CPP) ************/ +/* Name: COLBLK.CPP Version 2.1 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ +/* */ +/* This file contains the COLBLK class functions. */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant MariaDB header file. */ +/***********************************************************************/ +#include "my_global.h" + +/***********************************************************************/ +/* Include required application header files */ +/* global.h is header containing all global Plug declarations. */ +/* plgdbsem.h is header containing the DB applic. declarations. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +#include "tabcol.h" +#include "colblk.h" +#include "xindex.h" +#include "xtable.h" + +/***********************************************************************/ +/* COLBLK protected constructor. */ +/***********************************************************************/ +COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i) + { + Next = NULL; + Index = i; +//Number = 0; + ColUse = 0; + + if ((Cdp = cdp)) { + Name = cdp->Name; + Format = cdp->F; + Opt = cdp->Opt; + Long = cdp->Long; + Precision = cdp->Precision; + Freq = cdp->Freq; + Buf_Type = cdp->Buf_Type; + ColUse |= cdp->Flags; // Used by CONNECT + Nullable = !!(cdp->Flags & U_NULLS); + Unsigned = !!(cdp->Flags & U_UNSIGNED); + } else { + Name = NULL; + memset(&Format, 0, sizeof(FORMAT)); + Opt = 0; + Long = 0; + Precision = 0; + Freq = 0; + Buf_Type = TYPE_ERROR; + Nullable = false; + Unsigned = false; + } // endif cdp + + To_Tdb = tdbp; + Status = BUF_NO; +//Value = NULL; done in XOBJECT constructor + To_Kcol = NULL; + } // end of COLBLK constructor + +/***********************************************************************/ +/* COLBLK constructor used for copying columns. */ +/* tdbp is the pointer to the new table descriptor. */ +/***********************************************************************/ +COLBLK::COLBLK(PCOL col1, PTDB tdbp) + { + PCOL colp; + + // Copy the old column block to the new one + *this = *col1; + Next = NULL; +//To_Orig = col1; + To_Tdb = tdbp; + + if (trace > 1) + htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); + + if (tdbp) + // Attach the new column to the table block + if (!tdbp->GetColumns()) + tdbp->SetColumns(this); + else { + for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ; + + colp->Next = this; + } // endelse + + } // end of COLBLK copy constructor + +/***********************************************************************/ +/* Reset the column descriptor to non evaluated yet. */ +/***********************************************************************/ +void COLBLK::Reset(void) + { + Status &= ~BUF_READ; + } // end of Reset + +/***********************************************************************/ +/* Compare: compares itself to an (expression) object and returns */ +/* true if it is equivalent. */ +/***********************************************************************/ +bool COLBLK::Compare(PXOB xp) + { + return (this == xp); + } // end of Compare + +/***********************************************************************/ +/* SetFormat: function used to set SELECT output format. */ +/***********************************************************************/ +bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt) + { + fmt = Format; + + if (trace > 1) + htrc("COLBLK: %p format=%c(%d,%d)\n", + this, *fmt.Type, fmt.Length, fmt.Prec); + + return false; + } // end of SetFormat + +/***********************************************************************/ +/* Eval: get the column value from the last read record or from a */ +/* matching Index column if there is one. */ +/***********************************************************************/ +bool COLBLK::Eval(PGLOBAL g) + { + if (trace > 1) + htrc("Col Eval: %s status=%.4X\n", Name, Status); + + if (!GetStatus(BUF_READ)) { +// if (To_Tdb->IsNull()) +// Value->Reset(); + if (To_Kcol) + To_Kcol->FillValue(Value); + else + ReadColumn(g); + + AddStatus(BUF_READ); + } // endif + + return false; + } // end of Eval + +/***********************************************************************/ +/* InitValue: prepare a column block for read operation. */ +/* Now we use Format.Length for the len parameter to avoid strings */ +/* to be truncated when converting from string to coded string. */ +/* Added in version 1.5 is the arguments GetScale() and Domain */ +/* in calling AllocateValue. Domain is used for TYPE_DATE only. */ +/***********************************************************************/ +bool COLBLK::InitValue(PGLOBAL g) + { + if (Value) + return false; // Already done + + // Allocate a Value object + if (!(Value = AllocateValue(g, Buf_Type, Precision, + GetScale(), Unsigned, GetDomain()))) + return true; + + AddStatus(BUF_READY); + Value->SetNullable(Nullable); + + if (trace > 1) + htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n", + this, Buf_Type, Value, ColUse, Status); + + return false; + } // end of InitValue + +/***********************************************************************/ +/* SetBuffer: prepare a column block for write operation. */ +/***********************************************************************/ +bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer"); + return true; + } // end of SetBuffer + +/***********************************************************************/ +/* GetLength: returns an evaluation of the column string length. */ +/***********************************************************************/ +int COLBLK::GetLengthEx(void) + { + return Long; + } // end of GetLengthEx + +/***********************************************************************/ +/* ReadColumn: what this routine does is to access the last line */ +/* read from the corresponding table, extract from it the field */ +/* corresponding to this column and convert it to buffer type. */ +/***********************************************************************/ +void COLBLK::ReadColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn"); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of ReadColumn + +/***********************************************************************/ +/* WriteColumn: what this routine does is to access the last line */ +/* read from the corresponding table, and rewrite the field */ +/* corresponding to this column from the column buffer and type. */ +/***********************************************************************/ +void COLBLK::WriteColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn"); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of WriteColumn + +/***********************************************************************/ +/* Make file output of a column descriptor block. */ +/***********************************************************************/ +void COLBLK::Print(PGLOBAL g, FILE *f, uint n) + { + char m[64]; + int i; + PCOL colp; + + memset(m, ' ', n); // Make margin string + m[n] = '\0'; + + for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++) + if (colp == this) + break; + + fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(), + i, GetAmType(), Format.Type, Format.Length, Format.Prec); + fprintf(f, + " coluse=%04X status=%04X buftyp=%d value=%p name=%s\n", + ColUse, Status, Buf_Type, Value, Name); + } // end of Print + +/***********************************************************************/ +/* Make string output of a column descriptor block. */ +/***********************************************************************/ +void COLBLK::Print(PGLOBAL g, char *ps, uint z) + { + sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); + } // end of Print + + +/***********************************************************************/ +/* SPCBLK constructor. */ +/***********************************************************************/ +SPCBLK::SPCBLK(PCOLUMN cp) + : COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0) + { + Name = (char*)cp->GetName(); + Precision = Long = 0; + Buf_Type = TYPE_ERROR; + } // end of SPCBLK constructor + +/***********************************************************************/ +/* WriteColumn: what this routine does is to access the last line */ +/* read from the corresponding table, and rewrite the field */ +/* corresponding to this column from the column buffer and type. */ +/***********************************************************************/ +void SPCBLK::WriteColumn(PGLOBAL g) + { + sprintf(g->Message, MSG(SPCOL_READONLY), Name); + longjmp(g->jumper[g->jump_level], TYPE_COLBLK); + } // end of WriteColumn + +/***********************************************************************/ +/* RIDBLK constructor for the ROWID special column. */ +/***********************************************************************/ +RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp) + { + Precision = Long = 10; + Buf_Type = TYPE_INT; + Rnm = rnm; + *Format.Type = 'N'; + Format.Length = 10; + } // end of RIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the ordinal */ +/* number of the current row in the table (if Rnm is true) or in the */ +/* current file (if Rnm is false) the same except for multiple tables.*/ +/***********************************************************************/ +void RIDBLK::ReadColumn(PGLOBAL g) + { + Value->SetValue(To_Tdb->RowNumber(g, Rnm)); + } // end of ReadColumn + +/***********************************************************************/ +/* FIDBLK constructor for the FILEID special column. */ +/***********************************************************************/ +FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = _MAX_PATH; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; +#if defined(WIN32) + Format.Prec = 1; // Case insensitive +#endif // WIN32 + Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && + To_Tdb->GetAmType() != TYPE_AM_PLG && + To_Tdb->GetAmType() != TYPE_AM_PLM); + Fn = NULL; + } // end of FIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the current */ +/* file ID of the table (can change for Multiple tables). */ +/***********************************************************************/ +void FIDBLK::ReadColumn(PGLOBAL g) + { + if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) { + char filename[_MAX_PATH]; + + Fn = ((PTDBASE)To_Tdb)->GetFile(g); + PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath()); + + if (Op != OP_XX) { + char buff[_MAX_PATH]; + + Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op)); + } else + Value->SetValue_psz(filename); + + } // endif Fn + + } // end of ReadColumn + +/***********************************************************************/ +/* TIDBLK constructor for the TABID special column. */ +/***********************************************************************/ +TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); + Tname = NULL; + } // end of TIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the table ID. */ +/***********************************************************************/ +void TIDBLK::ReadColumn(PGLOBAL g) + { + if (Tname == NULL) { + Tname = (char*)To_Tdb->GetName(); + Value->SetValue_psz(Tname); + } // endif Tname + + } // end of ReadColumn + +/***********************************************************************/ +/* PRTBLK constructor for the PARTID special column. */ +/***********************************************************************/ +PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = true; // TODO: check whether this is true indeed + Pname = NULL; + } // end of PRTBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the partition ID. */ +/***********************************************************************/ +void PRTBLK::ReadColumn(PGLOBAL g) + { + if (Pname == NULL) { + char *p; + PTDBASE tdbp = (PTDBASE)To_Tdb; + + Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?"); + + p = strrchr(Pname, '#'); + Value->SetValue_psz((p) ? p + 1 : Pname); + } // endif Pname + + } // end of ReadColumn + +/***********************************************************************/ +/* SIDBLK constructor for the SERVID special column. */ +/***********************************************************************/ +SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp) + { +//Is_Key = 2; for when the MUL table indexed reading will be implemented. + Precision = Long = 64; + Buf_Type = TYPE_STRING; + *Format.Type = 'C'; + Format.Length = Long; + Format.Prec = 1; // Case insensitive + Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL); + Sname = NULL; + } // end of TIDBLK constructor + +/***********************************************************************/ +/* ReadColumn: what this routine does is to return the server ID. */ +/***********************************************************************/ +void SIDBLK::ReadColumn(PGLOBAL g) + { +//if (Sname == NULL) { + Sname = (char*)To_Tdb->GetServer(); + Value->SetValue_psz(Sname); +// } // endif Sname + + } // end of ReadColumn + -- cgit v1.2.1 From 445fc77497f72ce600ef9faa9a51514e18c60d79 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 10 May 2015 12:14:21 +0200 Subject: Get rid of more GCC warnings about unused parameters modified: storage/connect/array.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/mycat.cc modified: storage/connect/tabxml.cpp modified: storage/connect/user_connect.cc modified: storage/connect/user_connect.h --- storage/connect/array.cpp | 4 ++-- storage/connect/ha_connect.cc | 39 +++++++++++++++++++-------------------- storage/connect/mycat.cc | 8 ++++---- storage/connect/tabxml.cpp | 26 +++++++++++++++++++++----- storage/connect/user_connect.cc | 6 +++--- storage/connect/user_connect.h | 2 +- 6 files changed, 50 insertions(+), 35 deletions(-) diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index a2f537436c9..6867bdbd43c 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -186,7 +186,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec) // The error message was built by PlgDBalloc Type = TYPE_ERROR; else if (type != TYPE_PCHAR) - Value = AllocateValue(g, type, Len, prec, NULL); + Value = AllocateValue(g, type, Len, prec); Constant = TRUE; } // end of ARRAY constructor @@ -610,7 +610,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp) // The error message was built by PlgDBalloc return TYPE_ERROR; else - Value = AllocateValue(g, Type, Len, prec, NULL); + Value = AllocateValue(g, Type, Len, prec); /*********************************************************************/ /* Converting STRING to DATE can be done according to date format. */ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index f2827f56cd8..185f0945d15 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -349,7 +349,7 @@ int GetConvSize(void) {return THDVAR(current_thd, conv_size);} TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);} uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);} uint GetWorkSize(void) {return THDVAR(current_thd, work_size);} -void SetWorkSize(uint n) +void SetWorkSize(uint) { // Changing the session variable value seems to be impossible here // and should be done in a check function @@ -664,7 +664,7 @@ static int connect_init_func(void *p) @brief Plugin clean up */ -static int connect_done_func(void *p) +static int connect_done_func(void *) { int error= 0; PCONNECT pc, pn; @@ -822,8 +822,6 @@ ha_connect::~ha_connect(void) /****************************************************************************/ static PCONNECT GetUser(THD *thd, PCONNECT xp) { - const char *dbn= NULL; - if (!thd) return NULL; @@ -835,7 +833,7 @@ static PCONNECT GetUser(THD *thd, PCONNECT xp) break; if (!xp) { - xp= new user_connect(thd, dbn); + xp= new user_connect(thd); if (xp->user_init()) { delete xp; @@ -908,7 +906,8 @@ const char *ha_connect::index_type(uint inx) If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ -ulong ha_connect::index_flags(uint inx, uint part, bool all_parts) const +//ong ha_connect::index_flags(uint inx, uint part, bool all_parts) const +ulong ha_connect::index_flags(uint, uint, bool) const { ulong flags= HA_READ_NEXT | HA_READ_RANGE | HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR; @@ -2008,7 +2007,7 @@ int ha_connect::MakeRecord(char *buf) /***********************************************************************/ /* Set row values from a MySQL pseudo record. Specific to MySQL. */ /***********************************************************************/ -int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) +int ha_connect::ScanRecord(PGLOBAL g, uchar *) { char attr_buffer[1024]; char data_buffer[1024]; @@ -2150,7 +2149,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) /* Check change in index column. Specific to MySQL. */ /* Should be elaborated to check for real changes. */ /***********************************************************************/ -int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf) +int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf) { return ScanRecord(g, newbuf); } // end of dummy CheckRecord @@ -2923,7 +2922,7 @@ bool ha_connect::get_error_message(int error, String* buf) &dummy_errors); if (trace) - htrc("GEM(%u): %s\n", len, g->Message); + htrc("GEM(%d): len=%u %s\n", error, len, g->Message); msg[len]= '\0'; buf->copy(msg, (uint)strlen(msg), system_charset_info); @@ -3019,7 +3018,7 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked) @brief Make the indexes for this table */ -int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt) +int ha_connect::optimize(THD* thd, HA_CHECK_OPT*) { int rc= 0; PGLOBAL& g= xp->g; @@ -3223,7 +3222,7 @@ int ha_connect::update_row(const uchar *old_data, uchar *new_data) @see sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc */ -int ha_connect::delete_row(const uchar *buf) +int ha_connect::delete_row(const uchar *) { int rc= 0; DBUG_ENTER("ha_connect::delete_row"); @@ -3503,7 +3502,8 @@ int ha_connect::index_last(uchar *buf) /****************************************************************************/ /* This is called to get more rows having the same index value. */ /****************************************************************************/ -int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen) +//t ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen) +int ha_connect::index_next_same(uchar *buf, const uchar *, uint) { int rc; DBUG_ENTER("ha_connect::index_next_same"); @@ -3693,7 +3693,7 @@ int ha_connect::rnd_next(uchar *buf) @see filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc */ -void ha_connect::position(const uchar *record) +void ha_connect::position(const uchar *) { DBUG_ENTER("ha_connect::position"); //if (((PTDBASE)tdbp)->GetDef()->Indexable()) @@ -3876,7 +3876,7 @@ int ha_connect::info(uint flag) @see ha_innodb.cc */ -int ha_connect::extra(enum ha_extra_function operation) +int ha_connect::extra(enum ha_extra_function /*operation*/) { DBUG_ENTER("ha_connect::extra"); DBUG_RETURN(0); @@ -4484,7 +4484,7 @@ int ha_connect::external_lock(THD *thd, int lock_type) @see get_lock_data() in lock.cc */ -THR_LOCK_DATA **ha_connect::store_lock(THD *thd, +THR_LOCK_DATA **ha_connect::store_lock(THD *, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { @@ -4955,7 +4955,7 @@ static int init_table_share(THD* thd, @note this function is no more called in case of CREATE .. SELECT */ -static int connect_assisted_discovery(handlerton *hton, THD* thd, +static int connect_assisted_discovery(handlerton *, THD* thd, TABLE_SHARE *table_s, HA_CREATE_INFO *create_info) { @@ -4967,8 +4967,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, #if defined(WIN32) char *nsp= NULL, *cls= NULL; #endif // WIN32 - int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0; - int cop __attribute__((unused))= 0, pty= 2, lrecl= 0, lvl= 0; + int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0; + int cop __attribute__((unused))= 0, pty= 2, lrecl= 0; #if defined(ODBC_SUPPORT) POPARM sop = NULL; char *ucnc = NULL; @@ -6464,8 +6464,7 @@ fin: @note: This function is no more called by check_if_supported_inplace_alter */ -bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) +bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint) { DBUG_ENTER("ha_connect::check_if_incompatible_data"); // TO DO: really implement and check it. diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index b15c8fa2322..0bc82cd80ce 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2014 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ /* ------------- */ /* Version 1.4 */ /* */ -/* Author: Olivier Bertrand 2012 - 2014 */ +/* Author: Olivier Bertrand 2012 - 2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -478,7 +478,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path) /* Look for a table descriptor matching the name and type. */ /***********************************************************************/ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name, - LPCSTR type, PRELDEF *prp) + LPCSTR type, PRELDEF *) { if (trace) printf("GetTableDesc: name=%s am=%s\n", name, SVP(type)); @@ -589,7 +589,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type) /***********************************************************************/ /* ClearDB: Terminates Database usage. */ /***********************************************************************/ -void MYCAT::ClearDB(PGLOBAL g) +void MYCAT::ClearDB(PGLOBAL) { } // end of ClearDB diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 4f7af638d0c..0717f37bf6f 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -118,7 +118,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT}; static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; char *op, colname[65], fmt[129], buf[512]; - int i, j, lvl, rc, n = 0; + int i, j, lvl, n = 0; int ncol = sizeof(buftyp) / sizeof(int); bool ok = true; PXCL xcol, xcp, fxcp = NULL, pxcp = NULL; @@ -164,7 +164,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) txmp = new(g) TDBXML(tdp); if (txmp->Initialize(g)) - return NULL; + goto err; xcol = new(g) XMCOL; colname[64] = 0; @@ -224,8 +224,16 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) if (vp->atp) { strncpy(colname, vp->atp->GetName(g), sizeof(colname)); strncat(xcol->Name, colname, 64); - rc = vp->atp->GetText(g, buf, sizeof(buf)); - strncat(fmt, "@", sizeof(fmt)); + + switch (vp->atp->GetText(g, buf, sizeof(buf))) { + case RC_INFO: + PushWarning(g, txmp); + case RC_OK: + strncat(fmt, "@", sizeof(fmt)); + break; + default: + goto err; + } // enswitch rc if (j) strncat(fmt, colname, sizeof(fmt)); @@ -273,7 +281,15 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) } else ok = true; - rc = node->GetContent(g, buf, sizeof(buf)); + switch (node->GetContent(g, buf, sizeof(buf))) { + case RC_INFO: + PushWarning(g, txmp); + case RC_OK: + break; + default: + goto err; + } // enswitch rc + } // endif atp; xcol->Len = strlen(buf); diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc index 4affe447b00..34d192361a5 100644 --- a/storage/connect/user_connect.cc +++ b/storage/connect/user_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2014 +/* Copyright (C) Olivier Bertrand 2004 - 2015 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ */ /****************************************************************************/ -/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2014 */ +/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */ /****************************************************************************/ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation @@ -63,7 +63,7 @@ void SetWorkSize(uint); /****************************************************************************/ /* Constructor. */ /****************************************************************************/ -user_connect::user_connect(THD *thd, const char *dbn) +user_connect::user_connect(THD *thd) { thdp= thd; next= NULL; diff --git a/storage/connect/user_connect.h b/storage/connect/user_connect.h index 44e4e94fa8a..7f37973f378 100644 --- a/storage/connect/user_connect.h +++ b/storage/connect/user_connect.h @@ -45,7 +45,7 @@ class user_connect friend int connect_done_func(void *); public: // Constructor - user_connect(THD *thd, const char *dbn); + user_connect(THD *thd); // Destructor virtual ~user_connect(); -- cgit v1.2.1 From f027bafc453c489748dfa85850e08428c1c1958b Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Tue, 12 May 2015 03:43:36 +0300 Subject: Increase the version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 17c4f1195fd..a4f16f9304a 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=0 -MYSQL_VERSION_PATCH=19 +MYSQL_VERSION_PATCH=20 -- cgit v1.2.1 From b3d3dd25ebf4b9ee426d567afabaa0b9c2318a26 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Tue, 12 May 2015 03:44:10 +0300 Subject: MDEV-8144 percona.innodb_sys_index test fails Restoring the line affected by 5.5=>10.0 merge --- mysql-test/suite/percona/innodb_sys_index.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result index 1f1bd814886..7573720f5ee 100644 --- a/mysql-test/suite/percona/innodb_sys_index.result +++ b/mysql-test/suite/percona/innodb_sys_index.result @@ -1,6 +1,6 @@ drop table if exists t1; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ; CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ; SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ; -- cgit v1.2.1 From 6f8558bbd4a0c700a135665707068877daa4391e Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 12 May 2015 14:19:30 -0400 Subject: Fix for debug build failure Do not use format function attribute for sql_print_xxx() family of functions as they use a MariaDB-specific extension of printf instead of one provided by the system. --- sql/log.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sql/log.h b/sql/log.h index 4eb23d4878f..e771be7953f 100644 --- a/sql/log.h +++ b/sql/log.h @@ -864,11 +864,9 @@ uint purge_log_get_error_code(int res); int vprint_msg_to_log(enum loglevel level, const char *format, va_list args); void sql_print_error(const char *format, ...); -void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); -void sql_print_information(const char *format, ...) - ATTRIBUTE_FORMAT(printf, 1, 2); -typedef void (*sql_print_message_func)(const char *format, ...) - ATTRIBUTE_FORMAT_FPTR(printf, 1, 2); +void sql_print_warning(const char *format, ...); +void sql_print_information(const char *format, ...); +typedef void (*sql_print_message_func)(const char *format, ...); extern sql_print_message_func sql_print_message_handlers[]; int error_log_print(enum loglevel level, const char *format, -- cgit v1.2.1 From 0b4231e9f19308c6b8b57e07e52c1cf711691ebd Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Wed, 13 May 2015 15:17:19 +0300 Subject: MDEV-8154 rpl.show_status_stop_slave_race-7126 sporadically causes internal check failure The test did not have a proper replication cleanup --- mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result | 2 ++ mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index e71bb2e29c9..c2a0498509b 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,2 +1,4 @@ include/master-slave.inc [connection master] +start slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index a79a1885a6c..38759c9b16a 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -10,3 +10,10 @@ --exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test # All done. + +--connection slave +start slave; + +--connection master +--source include/rpl_end.inc + -- cgit v1.2.1 From e6b60ee5af76a574a9c87733143e608a2bc648bb Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 13 May 2015 19:58:21 +0200 Subject: Make BIN table files more flexible with new column format. In particular enable to set length and endian setting. This should solve all problems on IBM390s machines. modified: storage/connect/ha_connect.cc modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix.h Make DBF tables to be usable in big-endian machines (test version) modified: storage/connect/filamdbf.cpp Ignore git files on storage/connect modified: .gitignore --- .gitignore | 1 + storage/connect/filamdbf.cpp | 74 ++++++++++++++++-------------- storage/connect/ha_connect.cc | 2 + storage/connect/tabfix.cpp | 104 ++++++++++++++++++++++++++++++++++++++---- storage/connect/tabfix.h | 11 ++++- 5 files changed, 148 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 85d68f2853d..d7264cb8e60 100644 --- a/.gitignore +++ b/.gitignore @@ -151,6 +151,7 @@ sql/mysqld sql/sql_builtin.cc sql/sql_yacc.cc sql/sql_yacc.h +storage/connect/.* storage/heap/hp_test1 storage/heap/hp_test2 storage/maria/aria_chk diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 8a88b743a15..4d66c2ab2ff 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -74,16 +74,28 @@ typedef struct _dbfheader { //uchar Dbfox :4; /* FoxPro if equal to 3 */ uchar Version; /* Version information flags */ char Filedate[3]; /* date, YYMMDD, binary. YY=year-1900 */ - uint Records; /* records in the file */ - ushort Headlen; /* bytes in the header */ - ushort Reclen; /* bytes in a record */ - ushort Fields; /* Reserved but used to store fields */ + private: + /* The following four members are stored in little-endian format on disk */ + char m_RecordsBuf[4]; /* records in the file */ + char m_HeadlenBuf[2]; /* bytes in the header */ + char m_ReclenBuf[2]; /* bytes in a record */ + char m_FieldsBuf[2]; /* Reserved but used to store fields */ + public: char Incompleteflag; /* 01 if incomplete, else 00 */ char Encryptflag; /* 01 if encrypted, else 00 */ char Reserved2[12]; /* for LAN use */ char Mdxflag; /* 01 if production .mdx, else 00 */ char Language; /* Codepage */ char Reserved3[2]; + + uint Records(void) const {return uint4korr(m_RecordsBuf);} + ushort Headlen(void) const {return uint2korr(m_HeadlenBuf);} + ushort Reclen(void) const {return uint2korr(m_ReclenBuf);} + ushort Fields(void) const {return uint2korr(m_FieldsBuf);} + + void SetHeadlen(ushort num) {int2store(m_HeadlenBuf, num);} + void SetReclen(ushort num) {int2store(m_ReclenBuf, num);} + void SetFields(ushort num) {int2store(m_FieldsBuf, num);} } DBFHEADER; /****************************************************************************/ @@ -115,7 +127,6 @@ typedef struct _descriptor { /* Side effects: */ /* Moves file pointer to byte 32; fills buffer at buf with */ /* first 32 bytes of file. */ -/* Converts numeric values to platform byte ordering (LE in file) */ /****************************************************************************/ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) { @@ -143,13 +154,8 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) } else strcpy(g->Message, MSG(DBASE_FILE)); - // Convert numeric fields to have them in platform byte ordering - buf->Records = uint4korr(&buf->Records); - buf->Headlen = uint2korr(&buf->Headlen); - buf->Reclen = uint2korr(&buf->Reclen); - // Check last byte(s) of header - if (fseek(file, buf->Headlen - dbc, SEEK_SET) != 0) { + if (fseek(file, buf->Headlen() - dbc, SEEK_SET) != 0) { sprintf(g->Message, MSG(BAD_HEADER), fn); return RC_FX; } // endif fseek @@ -169,7 +175,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) } // endif endmark // Calculate here the number of fields while we have the dbc info - buf->Fields = (buf->Headlen - dbc - 1) / 32; + buf->SetFields((buf->Headlen() - dbc - 1) / 32); fseek(file, HEADLEN, SEEK_SET); return rc; } // end of dbfhead @@ -225,7 +231,7 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info) /************************************************************************/ /* Allocate the structures used to refer to the result set. */ /************************************************************************/ - fields = mainhead.Fields; + fields = mainhead.Fields(); } else fields = 0; @@ -242,11 +248,11 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info) if (trace) { htrc("Structure of %s\n", filename); htrc("headlen=%hd reclen=%hd degree=%d\n", - mainhead.Headlen, mainhead.Reclen, fields); + mainhead.Headlen(), mainhead.Reclen(), fields); htrc("flags(iem)=%d,%d,%d cp=%d\n", mainhead.Incompleteflag, mainhead.Encryptflag, mainhead.Mdxflag, mainhead.Language); htrc("%hd records, last changed %02d/%02d/%d\n", - mainhead.Records, mainhead.Filedate[1], mainhead.Filedate[2], + mainhead.Records(), mainhead.Filedate[1], mainhead.Filedate[2], mainhead.Filedate[0] + (mainhead.Filedate[0] <= 30) ? 2000 : 1900); htrc("Field Type Offset Len Dec Set Mdx\n"); } // endif trace @@ -404,13 +410,13 @@ int DBFBASE::ScanHeader(PGLOBAL g, PSZ fname, int lrecl, char *defpath) } else if (rc == RC_FX) return -1; - if ((int)header.Reclen != lrecl) { - sprintf(g->Message, MSG(BAD_LRECL), lrecl, header.Reclen); + if ((int)header.Reclen() != lrecl) { + sprintf(g->Message, MSG(BAD_LRECL), lrecl, header.Reclen()); return -1; } // endif Lrecl - Records = (int)header.Records; - return (int)header.Headlen; + Records = (int)header.Records(); + return (int)header.Headlen(); } // end of ScanHeader /* ---------------------------- Class DBFFAM ------------------------------ */ @@ -571,8 +577,8 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) header->Filedate[0] = datm->tm_year - 100; header->Filedate[1] = datm->tm_mon + 1; header->Filedate[2] = datm->tm_mday; - int2store(&header->Headlen, hlen); - int2store(&header->Reclen, reclen); + header->SetHeadlen((ushort)hlen); + header->SetReclen((ushort)reclen); descp = (DESCRIPTOR*)header; // Currently only standard Xbase types are supported @@ -633,13 +639,13 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) DBFHEADER header; if ((rc = dbfhead(g, Stream, Tdbp->GetFile(g), &header)) == RC_OK) { - if (Lrecl != (int)header.Reclen) { - sprintf(g->Message, MSG(BAD_LRECL), Lrecl, header.Reclen); + if (Lrecl != (int)header.Reclen()) { + sprintf(g->Message, MSG(BAD_LRECL), Lrecl, header.Reclen()); return true; } // endif Lrecl - Records = (int)header.Records; - Headlen = (int)header.Headlen; + Records = (int)header.Records(); + Headlen = (int)header.Headlen(); } else if (rc == RC_NF) { Records = 0; Headlen = 0; @@ -735,7 +741,7 @@ bool DBFFAM::CopyHeader(PGLOBAL g) if (Headlen) { void *hdr = PlugSubAlloc(g, NULL, Headlen); size_t n, hlen = (size_t)Headlen; - int pos = ftell(Stream); + int pos = ftell(Stream); if (fseek(Stream, 0, SEEK_SET)) strcpy(g->Message, "Seek error in CopyHeader"); @@ -869,12 +875,14 @@ void DBFFAM::CloseTableFile(PGLOBAL g, bool abort) if (n > Records) { // Update the number of rows in the file header - char filename[_MAX_PATH], nRecords[4]; + char filename[_MAX_PATH]; - int4store(&nRecords, n); PlugSetPath(filename, To_File, Tdbp->GetPath()); if ((Stream= global_fopen(g, MSGID_OPEN_MODE_STRERROR, filename, "r+b"))) { + char nRecords[4]; + int4store(nRecords, n); + fseek(Stream, 4, SEEK_SET); // Get header.Records position fwrite(nRecords, sizeof(nRecords), 1, Stream); fclose(Stream); @@ -951,13 +959,13 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g) /************************************************************************/ DBFHEADER *hp = (DBFHEADER*)Memory; - if (Lrecl != (int)uint2korr(&hp->Reclen)) { - sprintf(g->Message, MSG(BAD_LRECL), Lrecl, uint2korr(&hp->Reclen)); + if (Lrecl != (int)hp->Reclen()) { + sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen()); return true; } // endif Lrecl - Records = (int)uint4korr(&hp->Records); - Headlen = (int)uint2korr(&hp->Headlen); + Records = (int)hp->Records(); + Headlen = (int)hp->Headlen(); } // endif Headlen /**************************************************************************/ @@ -1011,7 +1019,7 @@ int DBMFAM::ReadBuffer(PGLOBAL g) /* Data Base delete line routine for DBF access methods. */ /* Deleted lines are just flagged in the first buffer character. */ /****************************************************************************/ -int DBMFAM::DeleteRecords(PGLOBAL, int irc) +int DBMFAM::DeleteRecords(PGLOBAL g, int irc) { if (irc == RC_OK) *Fpos = '*'; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 72f48d72bb1..964185b1b27 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -153,6 +153,7 @@ #endif // LIBXML2_SUPPORT #include "taboccur.h" #include "tabpivot.h" +#include "tabfix.h" #define my_strupr(p) my_caseup_str(default_charset_info, (p)); #define my_strlwr(p) my_casedn_str(default_charset_info, (p)); @@ -656,6 +657,7 @@ static int connect_init_func(void *p) sql_print_information("connect_init: hton=%p", p); DTVAL::SetTimeShift(); // Initialize time zone shift once for all + BINCOL::SetEndian(); // Initialize host endian setting DBUG_RETURN(0); } // end of connect_init_func diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 5cfd5a726ef..724d8cfde75 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -54,6 +54,7 @@ extern int num_read, num_there, num_eq[2]; // Statistics static const longlong M2G = 0x80000000; static const longlong M4G = (longlong)2 * M2G; +char BINCOL::Endian = 'H'; /***********************************************************************/ /* External function. */ @@ -373,18 +374,88 @@ int TDBFIX::WriteDB(PGLOBAL g) BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) : DOSCOL(g, cdp, tp, cp, i, am) { - Fmt = (cdp->GetFmt()) ? toupper(*cdp->GetFmt()) : 'X'; + char *fmt = cdp->GetFmt(); + + Buff = NULL; + M = GetTypeSize(Buf_Type, Long); + Lim = M; + + if (fmt) { + Fmt = 'H'; + + for (N = 0, i = 0; fmt[i]; i++) + if (isdigit(fmt[i])) + N = (N * 10 + (fmt[i] - 48)); + else + Fmt = toupper(fmt[i]); + + if (N == GetTypeSize(Buf_Type, -1) && (Fmt == 'H' || Fmt == Endian)) { + // New format is a no op + N = 0; + Fmt = 'X'; + } else if (Fmt == 'L' || Fmt == 'B' || Fmt == 'H') { + // This is a new format + if (!N) + N = GetTypeSize(Buf_Type, 0); + + if (Fmt == 'H') + Fmt = Endian; + + Buff = (char*)PlugSubAlloc(g, NULL, M); + memset(Buff, 0, M); + Lim = MY_MIN(N, M); + } // endif Fmt + + } else { + N = 0; + Fmt = 'X'; + } // endif fmt + } // end of BINCOL constructor /***********************************************************************/ -/* FIXCOL constructor used for copying columns. */ +/* BINCOL constructor used for copying columns. */ /* tdbp is the pointer to the new table descriptor. */ /***********************************************************************/ BINCOL::BINCOL(BINCOL *col1, PTDB tdbp) : DOSCOL(col1, tdbp) { Fmt = col1->Fmt; + N = col1->N; + M = col1->M; + Lim = col1->Lim; } // end of BINCOL copy constructor +/***********************************************************************/ +/* Set Endian according to the host setting. */ +/***********************************************************************/ +void BINCOL::SetEndian(void) + { + union { + short S; + char C[sizeof(short)]; + }; + + S = 1; + Endian = (C[0] == 1) ? 'L' : 'B'; + } // end of SetEndian + +/***********************************************************************/ +/* Copy according to Endian settings and sizes. */ +/***********************************************************************/ +void BINCOL::NumCpy(char *from, char *to) + { + for (int i = 0; i < Lim; i++) + if (Fmt == 'B' && Endian == 'L') + to[i] = from[N - i - 1]; + else if (Fmt == 'L' && Endian == 'B') + to[N - i - 1] = from[i]; + else if (Endian == 'B') + to[M - i - 1] = from[N - i - 1]; + else + to[i] = from[i]; + + } // end of NumCpy + /***********************************************************************/ /* ReadColumn: what this routine does is to access the last line */ /* read from the corresponding table and extract from it the field */ @@ -416,19 +487,22 @@ void BINCOL::ReadColumn(PGLOBAL g) /*********************************************************************/ /* Set Value from the line field. */ /*********************************************************************/ - switch (Fmt) { + if (N) { + NumCpy(p, Buff); + Value->SetBinValue(Buff); + } else switch (Fmt) { case 'X': // Standard not converted values Value->SetBinValue(p); break; case 'S': // Short integer - Value->SetValue((int)*(short*)p); + Value->SetValue(*(short*)p); break; case 'T': // Tiny integer - Value->SetValue((int)*p); + Value->SetValue(*p); break; - case 'L': // Long Integer - strcpy(g->Message, "Format L is deprecated, use I"); - longjmp(g->jumper[g->jump_level], 11); +// case 'L': // Long Integer +// strcpy(g->Message, "Format L is deprecated, use I"); +// longjmp(g->jumper[g->jump_level], 11); case 'I': // Integer Value->SetValue(*(int*)p); break; @@ -490,14 +564,24 @@ void BINCOL::WriteColumn(PGLOBAL g) /* Updating will be done only during the second pass (Status=true) */ /* Conversion occurs if the external format Fmt is specified. */ /*********************************************************************/ - switch (Fmt) { + if (N) { + if (Value->GetBinValue(Buff, M, Status)) { + sprintf(g->Message, MSG(BIN_F_TOO_LONG), + Name, Value->GetSize(), M); + longjmp(g->jumper[g->jump_level], 31); + } // endif Buff + + if (Status) + NumCpy(Buff, p); + + } else switch (Fmt) { case 'X': // Standard not converted values if (Value->GetBinValue(p, Long, Status)) { sprintf(g->Message, MSG(BIN_F_TOO_LONG), Name, Value->GetSize(), Long); longjmp(g->jumper[g->jump_level], 31); - } // endif Fmt + } // endif p break; case 'S': // Short integer diff --git a/storage/connect/tabfix.h b/storage/connect/tabfix.h index 7d5b964da2a..2155077f11d 100644 --- a/storage/connect/tabfix.h +++ b/storage/connect/tabfix.h @@ -74,11 +74,20 @@ class DllExport BINCOL : public DOSCOL { virtual void ReadColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g); + // Static + static void SetEndian(void); + protected: + void NumCpy(char *from, char *to); BINCOL(void) {} // Default constructor not to be used // Members - char Fmt; // The column numeric format + static char Endian; // The host endian setting (L or B) + char *Buff; // Utility buffer + char Fmt; // The file endian setting or old format + int N; // The number of bytes in the file + int M; // The column type size + int Lim; // Used in NumCpy }; // end of class BINCOL /***********************************************************************/ -- cgit v1.2.1 From 46199c0e1d8b028c16d3b0547927a5c89aa3a741 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 14 May 2015 14:43:37 +0400 Subject: MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable We don't fix the bug itself, we just make regex functions display errors returned from pcre_exec() as MariaDB warnings. --- mysql-test/r/func_regexp_pcre.result | 29 +++++++++++++ mysql-test/r/func_regexp_pcre_debug.result | 10 +++++ mysql-test/t/func_regexp_pcre.test | 24 +++++++++++ mysql-test/t/func_regexp_pcre_debug.test | 6 +++ sql/item_cmpfunc.cc | 65 ++++++++++++++++++++++++++++-- sql/item_cmpfunc.h | 4 ++ 6 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 mysql-test/r/func_regexp_pcre_debug.result create mode 100644 mysql-test/t/func_regexp_pcre_debug.test diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result index 641c4fddbf7..aa090c9faf6 100644 --- a/mysql-test/r/func_regexp_pcre.result +++ b/mysql-test/r/func_regexp_pcre.result @@ -845,3 +845,32 @@ SET default_regex_flags=DEFAULT; SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that') 1 this and that +# +# MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +# +# Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Invalid utf8 byte sequence in the subject string' from regexp +# Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; +CAST(0xE001 AS BINARY) REGEXP @regCheck +1 diff --git a/mysql-test/r/func_regexp_pcre_debug.result b/mysql-test/r/func_regexp_pcre_debug.result new file mode 100644 index 00000000000..e44492fca72 --- /dev/null +++ b/mysql-test/r/func_regexp_pcre_debug.result @@ -0,0 +1,10 @@ +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Internal error (-123)' from regexp +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +1 diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index 6710f5cf096..c9b4c10007d 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -402,3 +402,27 @@ SET default_regex_flags=DEFAULT; --echo # MDEV-6965 non-captured group \2 in regexp_replace --echo # SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); + +--echo # +--echo # MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +--echo # + +--echo # Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; diff --git a/mysql-test/t/func_regexp_pcre_debug.test b/mysql-test/t/func_regexp_pcre_debug.test new file mode 100644 index 00000000000..c2581fa4110 --- /dev/null +++ b/mysql-test/t/func_regexp_pcre_debug.test @@ -0,0 +1,6 @@ +--source include/have_debug.inc + +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 1f1982ffb80..90eef1ea55c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5160,10 +5160,65 @@ bool Regexp_processor_pcre::compile(Item *item, bool send_error) } +/** + Send a warning explaining an error code returned by pcre_exec(). +*/ +void Regexp_processor_pcre::pcre_exec_warn(int rc) const +{ + char buf[64]; + const char *errmsg= NULL; + /* + Make a descriptive message only for those pcre_exec() error codes + that can actually happen in MariaDB. + */ + switch (rc) + { + case PCRE_ERROR_NOMEMORY: + errmsg= "pcre_exec: Out of memory"; + break; + case PCRE_ERROR_BADUTF8: + errmsg= "pcre_exec: Invalid utf8 byte sequence in the subject string"; + break; + case PCRE_ERROR_RECURSELOOP: + errmsg= "pcre_exec: Recursion loop detected"; + break; + default: + /* + As other error codes should normally not happen, + we just report the error code without textual description + of the code. + */ + my_snprintf(buf, sizeof(buf), "pcre_exec: Internal error (%d)", rc); + errmsg= buf; + } + push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN, + ER_REGEXP_ERROR, ER(ER_REGEXP_ERROR), errmsg); +} + + +/** + Call pcre_exec() and send a warning if pcre_exec() returned with an error. +*/ +int Regexp_processor_pcre::pcre_exec_with_warn(const pcre *code, + const pcre_extra *extra, + const char *subject, + int length, int startoffset, + int options, int *ovector, + int ovecsize) +{ + int rc= pcre_exec(code, extra, subject, length, + startoffset, options, ovector, ovecsize); + DBUG_EXECUTE_IF("pcre_exec_error_123", rc= -123;); + if (rc < PCRE_ERROR_NOMATCH) + pcre_exec_warn(rc); + return rc; +} + + bool Regexp_processor_pcre::exec(const char *str, int length, int offset) { - m_pcre_exec_rc= pcre_exec(m_pcre, NULL, str, length, - offset, 0, m_SubStrVec, m_subpatterns_needed * 3); + m_pcre_exec_rc= pcre_exec_with_warn(m_pcre, NULL, str, length, offset, 0, + m_SubStrVec, m_subpatterns_needed * 3); return false; } @@ -5173,8 +5228,10 @@ bool Regexp_processor_pcre::exec(String *str, int offset, { if (!(str= convert_if_needed(str, &subject_converter))) return true; - m_pcre_exec_rc= pcre_exec(m_pcre, NULL, str->c_ptr_safe(), str->length(), - offset, 0, m_SubStrVec, m_subpatterns_needed * 3); + m_pcre_exec_rc= pcre_exec_with_warn(m_pcre, NULL, + str->c_ptr_safe(), str->length(), + offset, 0, + m_SubStrVec, m_subpatterns_needed * 3); if (m_pcre_exec_rc > 0) { uint i; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 8611182f32d..c4933e6d7ed 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1549,6 +1549,10 @@ class Regexp_processor_pcre int m_pcre_exec_rc; int m_SubStrVec[30]; uint m_subpatterns_needed; + void pcre_exec_warn(int rc) const; + int pcre_exec_with_warn(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); public: String *convert_if_needed(String *src, String *converter); String subject_converter; -- cgit v1.2.1 From b9c910909c3e04ceab8d0d514ba6213015787c5a Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 15 May 2015 11:56:29 +0200 Subject: Fix a bug in BIN buffer initialisation (in FIXFAM::AllocateBuffer) modified: storage/connect/filamfix.cpp Second version of BIN table new field format (1st one was buggy) modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix.h Make bin.test not to fail in big-endian machines modified: storage/connect/mysql-test/connect/r/bin.result modified: storage/connect/mysql-test/connect/t/bin.test Fix a bug causing wrong default offset to be generated when virtual or special columns were placed beetween standard columns. Also calculate the good offset for BIN columns with new field format. modified: storage/connect/reldef.cpp --- storage/connect/filamfix.cpp | 33 +++-- storage/connect/mysql-test/connect/r/bin.result | 28 ++--- storage/connect/mysql-test/connect/t/bin.test | 154 ++++++++++++------------ storage/connect/reldef.cpp | 17 ++- storage/connect/tabfix.cpp | 56 +++++---- storage/connect/tabfix.h | 22 ++-- 6 files changed, 173 insertions(+), 137 deletions(-) diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index 4dedd3375b0..c352db47044 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -46,6 +46,7 @@ #include "plgdbsem.h" #include "filamfix.h" #include "tabdos.h" +#include "tabfix.h" #include "osutil.h" #ifndef INVALID_SET_FILE_POINTER @@ -133,18 +134,35 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g) if (Tdbp->GetFtype() == RECFM_BIN) { // The buffer must be prepared depending on column types int n = 0; + bool b = false; PDOSDEF defp = (PDOSDEF)Tdbp->GetDef(); - PCOLDEF cdp; +// PCOLDEF cdp; + PBINCOL colp; // Prepare the first line of the buffer memset(To_Buf, 0, Buflen); +#if 0 for (cdp = defp->GetCols(); cdp; cdp = cdp->GetNext()) { - if (IsTypeNum(cdp->GetType())) - memset(To_Buf + cdp->GetOffset(), ' ', cdp->GetClen()); + if (!IsTypeNum(cdp->GetType())) { + memset(To_Buf + cdp->GetOffset(), ' ', cdp->GetClen()); + b = true; + } // endif not num - n = MY_MAX(n, cdp->GetPoff() + cdp->GetClen()); + n = MY_MAX(n, cdp->GetOffset() + cdp->GetClen()); } // endfor cdp +#endif // 0 + + for (colp = (PBINCOL)Tdbp->GetColumns(); colp; + colp = (PBINCOL)colp->GetNext()) + if (!colp->IsSpecial()) { + if (!IsTypeNum(colp->GetResultType())) { + memset(To_Buf + colp->GetDeplac(), ' ', colp->GetLength()); + b = true; + } // endif not num + + n = MY_MAX(n, colp->GetDeplac() + colp->GetFileSize()); + } // endif !special // We do this for binary table because the lrecl can have been // specified with additional space to include line ending. @@ -156,9 +174,10 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g) } // endif n - // Now repeat this for the whole buffer - for (int len = Lrecl; len <= Buflen - Lrecl; len += Lrecl) - memcpy(To_Buf + len, To_Buf, Lrecl); + if (b) + // Now repeat this for the whole buffer + for (int len = Lrecl; len <= Buflen - Lrecl; len += Lrecl) + memcpy(To_Buf + len, To_Buf, Lrecl); } else { memset(To_Buf, ' ', Buflen); diff --git a/storage/connect/mysql-test/connect/r/bin.result b/storage/connect/mysql-test/connect/r/bin.result index bbf5614b555..69453d97534 100644 --- a/storage/connect/mysql-test/connect/r/bin.result +++ b/storage/connect/mysql-test/connect/r/bin.result @@ -14,11 +14,11 @@ SET time_zone='+00:00'; CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', -name CHAR(10) not null, -birth DATE NOT NULL, -id CHAR(5) NOT NULL FIELD_FORMAT='S', +name CHAR(10) NOT NULL, +birth DATE NOT NULL FIELD_FORMAT='L', +id CHAR(5) NOT NULL FIELD_FORMAT='L2', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', -dept INT(4) NOT NULL FIELD_FORMAT='S' +dept INT(4) NOT NULL FIELD_FORMAT='L2' ) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat'; SELECT * FROM t1; fig name birth id salary dept @@ -41,11 +41,11 @@ DROP TABLE t1; CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', -name CHAR(10) not null, -birth DATE NOT NULL, -id CHAR(5) NOT NULL FIELD_FORMAT='S', +name CHAR(10) NOT NULL, +birth DATE NOT NULL FIELD_FORMAT='L', +id CHAR(5) NOT NULL FIELD_FORMAT='L2', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', -dept INT(4) NOT NULL FIELD_FORMAT='S' +dept INT(4) NOT NULL FIELD_FORMAT='L2' ) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat'; INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); ERROR HY000: Table 't1' is read only @@ -55,10 +55,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `fig` int(4) NOT NULL `FIELD_FORMAT`='C', `name` char(10) NOT NULL, - `birth` date NOT NULL, - `id` char(5) NOT NULL `FIELD_FORMAT`='S', + `birth` date NOT NULL `FIELD_FORMAT`='L', + `id` char(5) NOT NULL `FIELD_FORMAT`='L2', `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', - `dept` int(4) NOT NULL `FIELD_FORMAT`='S' + `dept` int(4) NOT NULL `FIELD_FORMAT`='L2' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=NO INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); SELECT * FROM t1; @@ -74,10 +74,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `fig` int(4) NOT NULL `FIELD_FORMAT`='C', `name` char(10) NOT NULL, - `birth` date NOT NULL, - `id` char(5) NOT NULL `FIELD_FORMAT`='S', + `birth` date NOT NULL `FIELD_FORMAT`='L', + `id` char(5) NOT NULL `FIELD_FORMAT`='L2', `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', - `dept` int(4) NOT NULL `FIELD_FORMAT`='S' + `dept` int(4) NOT NULL `FIELD_FORMAT`='L2' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=YES INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); ERROR HY000: Table 't1' is read only diff --git a/storage/connect/mysql-test/connect/t/bin.test b/storage/connect/mysql-test/connect/t/bin.test index 6ef0ffc75ec..e9d1ad58c37 100644 --- a/storage/connect/mysql-test/connect/t/bin.test +++ b/storage/connect/mysql-test/connect/t/bin.test @@ -1,77 +1,77 @@ -let $MYSQLD_DATADIR= `select @@datadir`; - ---copy_file $MTR_SUITE_DIR/std_data/Testbal.dat $MYSQLD_DATADIR/test/Testbal.dat - ---echo # ---echo # Testing errors ---echo # -CREATE TABLE t1 -( - ID INT NOT NULL -) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt'; ---replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ -# TODO: check why this is needed for Windows ---replace_result Open(rt) Open(rb) -SELECT * FROM t1; -DROP TABLE t1; - -SET time_zone='+00:00'; -CREATE TABLE t1 -( - fig INT(4) NOT NULL FIELD_FORMAT='C', - name CHAR(10) not null, - birth DATE NOT NULL, - id CHAR(5) NOT NULL FIELD_FORMAT='S', - salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', - dept INT(4) NOT NULL FIELD_FORMAT='S' -) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat'; -SELECT * FROM t1; - ---error ER_GET_ERRMSG -INSERT INTO t1 VALUES (55555,'RONALD','1980-02-26','3333',4444.44,555); -INSERT INTO t1 VALUES (5555,'RONALD','1980-02-26','3333',4444.44,555); -SELECT * FROM t1; - -DROP TABLE t1; - ---echo # ---echo # Testing READONLY tables ---echo # -CREATE TABLE t1 -( - fig INT(4) NOT NULL FIELD_FORMAT='C', - name CHAR(10) not null, - birth DATE NOT NULL, - id CHAR(5) NOT NULL FIELD_FORMAT='S', - salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', - dept INT(4) NOT NULL FIELD_FORMAT='S' -) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat'; ---error ER_OPEN_AS_READONLY -INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); -ALTER TABLE t1 READONLY=NO; -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); -SELECT * FROM t1; -ALTER TABLE t1 READONLY=YES; -SHOW CREATE TABLE t1; ---error ER_OPEN_AS_READONLY -INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); -DROP TABLE t1; - - ---echo # ---echo # Testing that the underlying file is created ---echo # -CREATE TABLE t1 -( - c CHAR(4) NOT NULL FIELD_FORMAT='C' -) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='bin2.dat'; -INSERT INTO t1 VALUES (10),(20),(300),(4000); -SELECT * FROM t1; -DROP TABLE t1; - -# -# Clean up -# ---remove_file $MYSQLD_DATADIR/test/Testbal.dat ---remove_file $MYSQLD_DATADIR/test/bin2.dat +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file $MTR_SUITE_DIR/std_data/Testbal.dat $MYSQLD_DATADIR/test/Testbal.dat + +--echo # +--echo # Testing errors +--echo # +CREATE TABLE t1 +( + ID INT NOT NULL +) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt'; +--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ +# TODO: check why this is needed for Windows +--replace_result Open(rt) Open(rb) +SELECT * FROM t1; +DROP TABLE t1; + +SET time_zone='+00:00'; +CREATE TABLE t1 +( + fig INT(4) NOT NULL FIELD_FORMAT='C', + name CHAR(10) NOT NULL, + birth DATE NOT NULL FIELD_FORMAT='L', + id CHAR(5) NOT NULL FIELD_FORMAT='L2', + salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', + dept INT(4) NOT NULL FIELD_FORMAT='L2' +) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat'; +SELECT * FROM t1; + +--error ER_GET_ERRMSG +INSERT INTO t1 VALUES (55555,'RONALD','1980-02-26','3333',4444.44,555); +INSERT INTO t1 VALUES (5555,'RONALD','1980-02-26','3333',4444.44,555); +SELECT * FROM t1; + +DROP TABLE t1; + +--echo # +--echo # Testing READONLY tables +--echo # +CREATE TABLE t1 +( + fig INT(4) NOT NULL FIELD_FORMAT='C', + name CHAR(10) NOT NULL, + birth DATE NOT NULL FIELD_FORMAT='L', + id CHAR(5) NOT NULL FIELD_FORMAT='L2', + salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', + dept INT(4) NOT NULL FIELD_FORMAT='L2' +) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat'; +--error ER_OPEN_AS_READONLY +INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); +ALTER TABLE t1 READONLY=NO; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); +SELECT * FROM t1; +ALTER TABLE t1 READONLY=YES; +SHOW CREATE TABLE t1; +--error ER_OPEN_AS_READONLY +INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); +DROP TABLE t1; + + +--echo # +--echo # Testing that the underlying file is created +--echo # +CREATE TABLE t1 +( + c CHAR(4) NOT NULL FIELD_FORMAT='C' +) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='bin2.dat'; +INSERT INTO t1 VALUES (10),(20),(300),(4000); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/test/Testbal.dat +--remove_file $MYSQLD_DATADIR/test/bin2.dat diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index d0483b5075d..e3cea256227 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -322,7 +322,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) if ((nof= cdp->Define(g, NULL, pcf, poff)) < 0) return -1; // Error, probably unhandled type - else if (nof) + else loff= cdp->GetOffset(); switch (tc) { @@ -334,15 +334,23 @@ int TABDEF::GetColCatInfo(PGLOBAL g) // Field width is the internal representation width // that can also depend on the column format switch (cdp->Fmt ? *cdp->Fmt : 'X') { + case 'X': nof= cdp->Clen; case 'C': break; case 'R': case 'F': - case 'L': +// case 'L': case 'I': nof= 4; break; case 'D': nof= 8; break; case 'S': nof= 2; break; case 'T': nof= 1; break; - default: nof= cdp->Clen; + default: /* New format */ + for (nof= 0, i= 0; cdp->Fmt[i]; i++) + if (isdigit(cdp->Fmt[i])) + nof= (nof * 10 + (cdp->Fmt[i] - 48)); + + if (!nof) + nof= cdp->Clen; + } // endswitch Fmt default: @@ -745,7 +753,8 @@ int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff) if (cfp->Datefmt) Decode = (PSZ)PlugDup(g, cfp->Datefmt); - } // endif special + } else + Offset = poff; if (cfp->Fieldfmt) Fmt = (PSZ)PlugDup(g, cfp->Fieldfmt); diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 724d8cfde75..65295428d57 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -377,8 +377,8 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) char *fmt = cdp->GetFmt(); Buff = NULL; - M = GetTypeSize(Buf_Type, Long); - Lim = M; + M = GetTypeSize(Buf_Type, sizeof(longlong)); + Lim = 0; if (fmt) { Fmt = 'H'; @@ -396,7 +396,7 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) } else if (Fmt == 'L' || Fmt == 'B' || Fmt == 'H') { // This is a new format if (!N) - N = GetTypeSize(Buf_Type, 0); + N = GetTypeSize(Buf_Type, Long); if (Fmt == 'H') Fmt = Endian; @@ -439,23 +439,6 @@ void BINCOL::SetEndian(void) Endian = (C[0] == 1) ? 'L' : 'B'; } // end of SetEndian -/***********************************************************************/ -/* Copy according to Endian settings and sizes. */ -/***********************************************************************/ -void BINCOL::NumCpy(char *from, char *to) - { - for (int i = 0; i < Lim; i++) - if (Fmt == 'B' && Endian == 'L') - to[i] = from[N - i - 1]; - else if (Fmt == 'L' && Endian == 'B') - to[N - i - 1] = from[i]; - else if (Endian == 'B') - to[M - i - 1] = from[N - i - 1]; - else - to[i] = from[i]; - - } // end of NumCpy - /***********************************************************************/ /* ReadColumn: what this routine does is to access the last line */ /* read from the corresponding table and extract from it the field */ @@ -488,8 +471,21 @@ void BINCOL::ReadColumn(PGLOBAL g) /* Set Value from the line field. */ /*********************************************************************/ if (N) { - NumCpy(p, Buff); - Value->SetBinValue(Buff); + for (int i = 0; i < Lim; i++) + if (Fmt == 'B' && Endian == 'L') + Buff[i] = p[N - i - 1]; + else if (Fmt == 'L' && Endian == 'B') + Buff[M - i - 1] = p[i]; + else if (Endian == 'B') + Buff[M - i - 1] = p[N - i - 1]; + else + Buff[i] = p[i]; + + if (IsTypeChar(Buf_Type)) + Value->SetValue(*(longlong*)Buff); + else + Value->SetBinValue(Buff); + } else switch (Fmt) { case 'X': // Standard not converted values Value->SetBinValue(p); @@ -565,14 +561,24 @@ void BINCOL::WriteColumn(PGLOBAL g) /* Conversion occurs if the external format Fmt is specified. */ /*********************************************************************/ if (N) { - if (Value->GetBinValue(Buff, M, Status)) { + if (IsTypeChar(Buf_Type)) + *(longlong *)Buff = Value->GetBigintValue(); + else if (Value->GetBinValue(Buff, M, Status)) { sprintf(g->Message, MSG(BIN_F_TOO_LONG), Name, Value->GetSize(), M); longjmp(g->jumper[g->jump_level], 31); } // endif Buff if (Status) - NumCpy(Buff, p); + for (int i = 0; i < Lim; i++) + if (Fmt == 'B' && Endian == 'L') + p[N - i - 1] = Buff[i]; + else if (Fmt == 'L' && Endian == 'B') + p[i] = Buff[M - i - 1]; + else if (Endian == 'B') + p[N - i - 1] = Buff[M - i - 1]; + else + p[i] = Buff[i]; } else switch (Fmt) { case 'X': @@ -619,7 +625,7 @@ void BINCOL::WriteColumn(PGLOBAL g) break; case 'B': // Large (big) integer if (Status) - *(longlong *)p = (longlong)Value->GetBigintValue(); + *(longlong *)p = Value->GetBigintValue(); break; case 'F': // Float diff --git a/storage/connect/tabfix.h b/storage/connect/tabfix.h index 2155077f11d..b6307e8f60b 100644 --- a/storage/connect/tabfix.h +++ b/storage/connect/tabfix.h @@ -1,7 +1,7 @@ /*************** TabDos H Declares Source Code File (.H) ***************/ -/* Name: TABFIX.H Version 2.3 */ +/* Name: TABFIX.H Version 2.4 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1999-2012 */ +/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */ /* */ /* This file contains the TDBFIX and (FIX/BIN)COL classes declares. */ /***********************************************************************/ @@ -12,7 +12,7 @@ typedef class FIXCOL *PFIXCOL; typedef class BINCOL *PBINCOL; -typedef class TXTFAM *PTXF; +typedef class TXTFAM *PTXF; /***********************************************************************/ /* This is the DOS/UNIX Access Method class declaration for files */ @@ -68,17 +68,19 @@ class DllExport BINCOL : public DOSCOL { BINCOL(BINCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation - virtual int GetAmType(void) {return TYPE_AM_BIN;} + virtual int GetAmType(void) {return TYPE_AM_BIN;} + int GetDeplac(void) {return Deplac;} + int GetFileSize(void) + {return N ? N : GetTypeSize(Buf_Type, Long);} // Methods - virtual void ReadColumn(PGLOBAL g); - virtual void WriteColumn(PGLOBAL g); + virtual void ReadColumn(PGLOBAL g); + virtual void WriteColumn(PGLOBAL g); // Static - static void SetEndian(void); + static void SetEndian(void); protected: - void NumCpy(char *from, char *to); BINCOL(void) {} // Default constructor not to be used // Members @@ -86,8 +88,8 @@ class DllExport BINCOL : public DOSCOL { char *Buff; // Utility buffer char Fmt; // The file endian setting or old format int N; // The number of bytes in the file - int M; // The column type size - int Lim; // Used in NumCpy + int M; // The buffer type size + int Lim; // Min(N,M) }; // end of class BINCOL /***********************************************************************/ -- cgit v1.2.1 From 5d029288366866c7d40689aee552779ce8328b0b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 May 2015 10:26:34 +0200 Subject: remove second @ from CONFIGURE_FILE (... @ONLY@) --- libmysql/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 4ce4ab02e6d..e611efae65a 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -358,7 +358,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") CONFIGURE_FILE( ${VERSION_SCRIPT_TEMPLATE} ${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld - @ONLY@ + @ONLY ) SET(VERSION_SCRIPT_LINK_FLAGS "-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld") -- cgit v1.2.1 From a82171c9aa8a2edece5802e5e30ddace9c1a4a33 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 17 May 2015 15:22:42 +0200 Subject: In BIN table date_format now imply by default field_format='C'. modified: storage/connect/tabfix.cpp modified: storage/connect/reldef.cpp Json array index (position) is now 0 based by default. This corresponds to what all json applications and functions do. Also fix ROWNUM calculation. modified: storage/connect/jsonudf.cpp modified: storage/connect/mysql-test/connect/r/json.result modified: storage/connect/mysql-test/connect/t/json.test modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h --- storage/connect/jsonudf.cpp | 4 +- storage/connect/mysql-test/connect/r/json.result | 20 +- storage/connect/mysql-test/connect/t/json.test | 528 +++++++++++------------ storage/connect/reldef.cpp | 12 +- storage/connect/tabfix.cpp | 4 +- storage/connect/tabjson.cpp | 68 ++- storage/connect/tabjson.h | 6 +- 7 files changed, 318 insertions(+), 324 deletions(-) diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 1ad33d83068..ff4025ee0fb 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -410,7 +410,7 @@ void Json_Array_Add_deinit(UDF_INIT* initid) } // end of Json_Array_Add_deinit /***********************************************************************/ -/* Add values to a Json array. */ +/* Delete a value from a Json array. */ /***********************************************************************/ my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { @@ -451,7 +451,7 @@ char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result, } else { n = *(int*)args->args[1]; arp = jvp->GetArray(); - arp->DeleteValue(n - 1); + arp->DeleteValue(n); arp->InitArray(g); if (!(str = Serialize(g, arp, NULL, 0))) { diff --git a/storage/connect/mysql-test/connect/r/json.result b/storage/connect/mysql-test/connect/r/json.result index 80b0a2cbc18..acb74c38e26 100644 --- a/storage/connect/mysql-test/connect/r/json.result +++ b/storage/connect/mysql-test/connect/r/json.result @@ -97,7 +97,7 @@ ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher L CREATE TABLE t2 ( FIRSTNAME CHAR(32), LASTNAME CHAR(32)) -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[2]:AUTHOR'; +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[1]:AUTHOR'; SELECT * FROM t2; FIRSTNAME LASTNAME William J. Pardi @@ -252,9 +252,9 @@ DROP TABLE t1; # CREATE TABLE t2 ( WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') +WEEK INT(2) FIELD_FORMAT='WEEK:[0]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[0]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[0]:EXPENSE:[X]:AMOUNT') ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; SELECT * FROM t2; WHO WEEK WHAT AMOUNT @@ -268,9 +268,9 @@ Janet 3 Food 18.00 Janet 3 Beer 18.00 CREATE TABLE t3 ( WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') +WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; SELECT * FROM t3; WHO WEEK WHAT AMOUNT @@ -284,9 +284,9 @@ Beth 4 Beer 15.00 Janet 4 Car 17.00 CREATE TABLE t4 ( WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT') +WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; SELECT * FROM t4; WHO WEEK WHAT AMOUNT diff --git a/storage/connect/mysql-test/connect/t/json.test b/storage/connect/mysql-test/connect/t/json.test index 79588e9fe5b..1cc2c054db4 100644 --- a/storage/connect/mysql-test/connect/t/json.test +++ b/storage/connect/mysql-test/connect/t/json.test @@ -1,264 +1,264 @@ ---source include/not_embedded.inc ---source include/have_partition.inc - -let $MYSQLD_DATADIR= `select @@datadir`; - ---copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json ---copy_file $MTR_SUITE_DIR/std_data/expense.json $MYSQLD_DATADIR/test/expense.json ---copy_file $MTR_SUITE_DIR/std_data/mulexp3.json $MYSQLD_DATADIR/test/mulexp3.json ---copy_file $MTR_SUITE_DIR/std_data/mulexp4.json $MYSQLD_DATADIR/test/mulexp4.json ---copy_file $MTR_SUITE_DIR/std_data/mulexp5.json $MYSQLD_DATADIR/test/mulexp5.json - ---echo # ---echo # Testing doc samples ---echo # -CREATE TABLE t1 -( - ISBN CHAR(15), - LANG CHAR(2), - SUBJECT CHAR(32), - AUTHOR CHAR(64), - TITLE CHAR(32), - TRANSLATION CHAR(32), - TRANSLATOR CHAR(80), - PUBLISHER CHAR(32), - DATEPUB int(4) -) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; -SELECT * FROM t1; -DROP TABLE t1; - - ---echo # ---echo # Testing Jpath. Get the number of authors ---echo # -CREATE TABLE t1 -( - ISBN CHAR(15), - Language CHAR(2) FIELD_FORMAT='LANG', - Subject CHAR(32) FIELD_FORMAT='SUBJECT', - Authors INT(2) FIELD_FORMAT='AUTHOR:[#]', - Title CHAR(32) FIELD_FORMAT='TITLE', - Translation CHAR(32) FIELD_FORMAT='TRANSLATION', - Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', - Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', - Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', - Year int(4) FIELD_FORMAT='DATEPUB' -) -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # Concatenates the authors ---echo # -CREATE TABLE t1 -( - ISBN CHAR(15), - Language CHAR(2) FIELD_FORMAT='LANG', - Subject CHAR(32) FIELD_FORMAT='SUBJECT', - AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME', - AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME', - Title CHAR(32) FIELD_FORMAT='TITLE', - Translation CHAR(32) FIELD_FORMAT='TRANSLATION', - Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', - Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', - Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', - Year int(4) FIELD_FORMAT='DATEPUB' -) -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # Testing expanding authors ---echo # -CREATE TABLE t1 -( - ISBN CHAR(15), - Language CHAR(2) FIELD_FORMAT='LANG', - Subject CHAR(32) FIELD_FORMAT='SUBJECT', - AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME', - AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME', - Title CHAR(32) FIELD_FORMAT='TITLE', - Translation CHAR(32) FIELD_FORMAT='TRANSLATION', - Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', - Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', - Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', - Year int(4) FIELD_FORMAT='DATEPUB' -) -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; -SELECT * FROM t1; -UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab'; -SELECT * FROM t1 WHERE ISBN = '9782212090819'; - ---echo # ---echo # To add an author a new table must be created ---echo # -CREATE TABLE t2 ( -FIRSTNAME CHAR(32), -LASTNAME CHAR(32)) -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[2]:AUTHOR'; -SELECT * FROM t2; -INSERT INTO t2 VALUES('Charles','Dickens'); -SELECT * FROM t1; -DROP TABLE t1; -DROP TABLE t2; - ---echo # ---echo # Check the biblio file has the good format ---echo # -CREATE TABLE t1 -( - line char(255) -) -ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.json'; -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # A file with 2 arrays ---echo # -CREATE TABLE t1 ( -WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # Now it can be fully expanded ---echo # -CREATE TABLE t1 ( -WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -#--error ER_GET_ERRMSG -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # A table showing many calculated results ---echo # -CREATE TABLE t1 ( -WHO CHAR(12) NOT NULL, -WEEKS CHAR(12) NOT NULL FIELD_FORMAT='WEEK:[", "]:NUMBER', -SUMS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[+]:AMOUNT', -SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[+]:AMOUNT', -AVGS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[!]:AMOUNT', -SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[!]:AMOUNT', -AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[+]:AMOUNT', -AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[!]:AMOUNT', -AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -SELECT * FROM t1; -DROP TABLE t1; - ---echo # ---echo # Expand expense in 3 one week tables ---echo # -CREATE TABLE t2 ( -WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -SELECT * FROM t2; - -CREATE TABLE t3 ( -WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -SELECT * FROM t3; - -CREATE TABLE t4 ( -WHO CHAR(12), -WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER', -WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; -SELECT * FROM t4; - ---echo # ---echo # The expanded table is made as a TBL table ---echo # -CREATE TABLE t1 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32), -AMOUNT DOUBLE(8,2)) -ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4'; -SELECT * FROM t1; -DROP TABLE t1, t2, t3, t4; - ---echo # ---echo # Three partial JSON tables ---echo # -CREATE TABLE t2 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json'; -SELECT * FROM t2; - -CREATE TABLE t3 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json'; -SELECT * FROM t3; - -CREATE TABLE t4 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json'; -SELECT * FROM t4; - ---echo # ---echo # The complete table can be a multiple JSON table ---echo # -CREATE TABLE t1 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1; -SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; -DROP TABLE t1; - ---echo # ---echo # Or also a partition JSON table ---echo # -CREATE TABLE t1 ( -WHO CHAR(12), -WEEK INT(2), -WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', -AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') -ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json'; -ALTER TABLE t1 -PARTITION BY LIST COLUMNS(WEEK) ( -PARTITION `3` VALUES IN(3), -PARTITION `4` VALUES IN(4), -PARTITION `5` VALUES IN(5)); -SHOW WARNINGS; -SELECT * FROM t1; -SELECT * FROM t1 WHERE WEEK = 4; -DROP TABLE t1, t2, t3, t4; - -# -# Clean up -# ---remove_file $MYSQLD_DATADIR/test/biblio.json ---remove_file $MYSQLD_DATADIR/test/expense.json ---remove_file $MYSQLD_DATADIR/test/mulexp3.json ---remove_file $MYSQLD_DATADIR/test/mulexp4.json ---remove_file $MYSQLD_DATADIR/test/mulexp5.json +--source include/not_embedded.inc +--source include/have_partition.inc + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file $MTR_SUITE_DIR/std_data/biblio.json $MYSQLD_DATADIR/test/biblio.json +--copy_file $MTR_SUITE_DIR/std_data/expense.json $MYSQLD_DATADIR/test/expense.json +--copy_file $MTR_SUITE_DIR/std_data/mulexp3.json $MYSQLD_DATADIR/test/mulexp3.json +--copy_file $MTR_SUITE_DIR/std_data/mulexp4.json $MYSQLD_DATADIR/test/mulexp4.json +--copy_file $MTR_SUITE_DIR/std_data/mulexp5.json $MYSQLD_DATADIR/test/mulexp5.json + +--echo # +--echo # Testing doc samples +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + LANG CHAR(2), + SUBJECT CHAR(32), + AUTHOR CHAR(64), + TITLE CHAR(32), + TRANSLATION CHAR(32), + TRANSLATOR CHAR(80), + PUBLISHER CHAR(32), + DATEPUB int(4) +) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Testing Jpath. Get the number of authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + Authors INT(2) FIELD_FORMAT='AUTHOR:[#]', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Concatenates the authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME', + AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Testing expanding authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME', + AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; +SELECT * FROM t1; +UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab'; +SELECT * FROM t1 WHERE ISBN = '9782212090819'; + +--echo # +--echo # To add an author a new table must be created +--echo # +CREATE TABLE t2 ( +FIRSTNAME CHAR(32), +LASTNAME CHAR(32)) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json' OPTION_LIST='Object=[1]:AUTHOR'; +SELECT * FROM t2; +INSERT INTO t2 VALUES('Charles','Dickens'); +SELECT * FROM t1; +DROP TABLE t1; +DROP TABLE t2; + +--echo # +--echo # Check the biblio file has the good format +--echo # +CREATE TABLE t1 +( + line char(255) +) +ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.json'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # A file with 2 arrays +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Now it can be fully expanded +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +#--error ER_GET_ERRMSG +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # A table showing many calculated results +--echo # +CREATE TABLE t1 ( +WHO CHAR(12) NOT NULL, +WEEKS CHAR(12) NOT NULL FIELD_FORMAT='WEEK:[", "]:NUMBER', +SUMS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[+]:AMOUNT', +SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[+]:AMOUNT', +AVGS CHAR(64) NOT NULL FIELD_FORMAT='WEEK:["+"]:EXPENSE:[!]:AMOUNT', +SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[+]:EXPENSE:[!]:AMOUNT', +AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[+]:AMOUNT', +AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[!]:AMOUNT', +AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='WEEK:[!]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Expand expense in 3 one week tables +--echo # +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[0]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[0]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[0]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +SELECT * FROM t2; + +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +SELECT * FROM t3; + +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; +SELECT * FROM t4; + +--echo # +--echo # The expanded table is made as a TBL table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32), +AMOUNT DOUBLE(8,2)) +ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4'; +SELECT * FROM t1; +DROP TABLE t1, t2, t3, t4; + +--echo # +--echo # Three partial JSON tables +--echo # +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json'; +SELECT * FROM t2; + +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json'; +SELECT * FROM t3; + +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json'; +SELECT * FROM t4; + +--echo # +--echo # The complete table can be a multiple JSON table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1; +SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; +DROP TABLE t1; + +--echo # +--echo # Or also a partition JSON table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json'; +ALTER TABLE t1 +PARTITION BY LIST COLUMNS(WEEK) ( +PARTITION `3` VALUES IN(3), +PARTITION `4` VALUES IN(4), +PARTITION `5` VALUES IN(5)); +SHOW WARNINGS; +SELECT * FROM t1; +SELECT * FROM t1 WHERE WEEK = 4; +DROP TABLE t1, t2, t3, t4; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/test/biblio.json +--remove_file $MYSQLD_DATADIR/test/expense.json +--remove_file $MYSQLD_DATADIR/test/mulexp3.json +--remove_file $MYSQLD_DATADIR/test/mulexp4.json +--remove_file $MYSQLD_DATADIR/test/mulexp5.json diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index e3cea256227..0b3d4682cc7 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -333,7 +333,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) if (nof) // Field width is the internal representation width // that can also depend on the column format - switch (cdp->Fmt ? *cdp->Fmt : 'X') { + switch (cdp->Fmt ? *cdp->Fmt : cdp->Decode ? 'C' : 'X') { case 'X': nof= cdp->Clen; case 'C': break; case 'R': @@ -346,7 +346,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) default: /* New format */ for (nof= 0, i= 0; cdp->Fmt[i]; i++) if (isdigit(cdp->Fmt[i])) - nof= (nof * 10 + (cdp->Fmt[i] - 48)); + nof= (nof * 10 + (cdp->Fmt[i] - '0')); if (!nof) nof= cdp->Clen; @@ -377,20 +377,16 @@ int TABDEF::GetColCatInfo(PGLOBAL g) // not specified (for instance if quoted is specified) // if ((ending= Hc->GetIntegerOption("Ending")) < 0) { if ((ending= Hc->GetIntegerOption("Ending")) <= 0) { -#if defined(WIN32) - ending= 2; -#else - ending= 1; -#endif + ending= (tc == TAB_BIN || tc == TAB_VEC) ? 0 : CRLF; Hc->SetIntegerOption("Ending", ending); } // endif ending // Calculate the default record size switch (tc) { case TAB_FIX: + case TAB_BIN: recln= nlg + ending; // + length of line ending break; - case TAB_BIN: case TAB_VEC: recln= nlg; diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 65295428d57..af92ec0410a 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -385,7 +385,7 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) for (N = 0, i = 0; fmt[i]; i++) if (isdigit(fmt[i])) - N = (N * 10 + (fmt[i] - 48)); + N = (N * 10 + (fmt[i] - '0')); else Fmt = toupper(fmt[i]); @@ -408,7 +408,7 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) } else { N = 0; - Fmt = 'X'; + Fmt = GetDomain() ? 'C' : 'X'; } // endif fmt } // end of BINCOL constructor diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index f22bdd15528..0ce326f5c2a 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -372,6 +372,7 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff) Pretty = GetIntCatInfo("Pretty", 2); Level = GetIntCatInfo("Level", 0); Limit = GetIntCatInfo("Limit", 10); + Base = GetIntCatInfo("Base", 0); return DOSDEF::DefineAM(g, "DOS", poff); } // end of DefineAM @@ -440,6 +441,7 @@ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) Xcol = tdp->Xcol; Limit = tdp->Limit; Pretty = tdp->Pretty; + B = tdp->Base ? 1 : 0; Strict = tdp->Strict; } else { Jmode = MODE_OBJECT; @@ -447,11 +449,12 @@ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) Xcol = NULL; Limit = 1; Pretty = 0; + B = 1; Strict = false; } // endif tdp Fpos = -1; - N = 0; + N = M = 0; NextSame = 0; SameRow = 0; Xval = -1; @@ -469,6 +472,7 @@ TDBJSN::TDBJSN(TDBJSN *tdbp) : TDBDOS(NULL, tdbp) Xcol = tdbp->Xcol; Fpos = tdbp->Fpos; N = tdbp->N; + M = tdbp->M; Limit = tdbp->Limit; NextSame = tdbp->NextSame; SameRow = tdbp->SameRow; @@ -563,7 +567,7 @@ PJSON TDBJSN::FindRow(PGLOBAL g) jsp->GetObject()->GetValue(objpath) : NULL; } else if (objpath[strlen(objpath)-1] == ']') { val = (jsp->GetType() == TYPE_JAR) ? - jsp->GetArray()->GetValue(atoi(objpath+1) - 1) : NULL; + jsp->GetArray()->GetValue(atoi(objpath+1) - B) : NULL; } else val = NULL; @@ -649,6 +653,7 @@ int TDBJSN::ReadDB(PGLOBAL g) if (NextSame) { SameRow = NextSame; NextSame = 0; + M++; return RC_OK; } else if ((rc = TDBDOS::ReadDB(g)) == RC_OK) if (!IsRead() && ((rc = ReadBuffer(g)) != RC_OK)) { @@ -660,6 +665,7 @@ int TDBJSN::ReadDB(PGLOBAL g) Row = FindRow(g); SameRow = 0; Fpos++; + M = 1; rc = RC_OK; } // endif's @@ -708,7 +714,7 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp) val->SetValue(arp); val = new(g) JVALUE; - i = atoi(objpath+1) - 1; + i = atoi(objpath+1) - B; arp->SetValue(g, val, i); arp->InitArray(g); } else { @@ -856,8 +862,8 @@ bool JSONCOL::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) return true; else if (jnp->Op != OP_EXP) { if (b) { - // Return 1st value - jnp->Rank = 1; + // Return 1st value (B is the index base) + jnp->Rank = 1 - Tjp->B; jnp->Op = OP_EQ; } else if (!Value->IsTypeNum()) { jnp->CncVal = AllocateValue(g, (void*)", ", TYPE_STRING); @@ -868,13 +874,9 @@ bool JSONCOL::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) } // endif OP } else if (dg) { - if (atoi(p) > 0) { - // Return nth value - jnp->Rank = atoi(p); - jnp->Op = OP_EQ; - } else // Ignore array - jnp->Op = OP_NULL; - + // Return nth value + jnp->Rank = atoi(p) - Tjp->B; + jnp->Op = OP_EQ; } else if (n == 1) { // Set the Op value; switch (*p) { @@ -1118,16 +1120,12 @@ PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i) arp = (PJAR)row; if (!Nodes[i].Key) { - if (Nodes[i].Op != OP_NULL) { - if (Nodes[i].Rank) { - val = arp->GetValue(Nodes[i].Rank - 1); - } else if (Nodes[i].Op == OP_EXP) { - return ExpandArray(g, arp, i); - } else - return CalculateArray(g, arp, i); - - } else - val = NULL; + if (Nodes[i].Op == OP_EQ) + val = arp->GetValue(Nodes[i].Rank); + else if (Nodes[i].Op == OP_EXP) + return ExpandArray(g, arp, i); + else + return CalculateArray(g, arp, i); } else if (i < Nod-1) { strcpy(g->Message, "Unexpected array"); @@ -1289,16 +1287,12 @@ PJSON JSONCOL::GetRow(PGLOBAL g) break; case TYPE_JAR: if (!Nodes[i].Key) { - if (Nodes[i].Op != OP_NULL) { - arp = (PJAR)row; - - if (Nodes[i].Rank) - val = arp->GetValue(Nodes[i].Rank - 1); - else - val = arp->GetValue(Nodes[i].Rx); + arp = (PJAR)row; - } else - val = NULL; + if (Nodes[i].Op == OP_EQ) + val = arp->GetValue(Nodes[i].Rank); + else + val = arp->GetValue(Nodes[i].Rx); } else { strcpy(g->Message, "Unexpected array"); @@ -1390,8 +1384,8 @@ void JSONCOL::WriteColumn(PGLOBAL g) } // endif jsp if (arp) { - if (Nod > 1 && Nodes[Nod-2].Rank) - arp->SetValue(g, new(g) JVALUE(jsp), Nodes[Nod-2].Rank-1); + if (Nod > 1 && Nodes[Nod-2].Op == OP_EQ) + arp->SetValue(g, new(g) JVALUE(jsp), Nodes[Nod-2].Rank); else arp->AddValue(g, new(g) JVALUE(jsp)); @@ -1411,8 +1405,8 @@ void JSONCOL::WriteColumn(PGLOBAL g) case TYPE_INT: case TYPE_DOUBLE: if (arp) { - if (Nodes[Nod-1].Rank) - arp->SetValue(g, new(g) JVALUE(g, Value), Nodes[Nod-1].Rank-1); + if (Nodes[Nod-1].Op == OP_EQ) + arp->SetValue(g, new(g) JVALUE(g, Value), Nodes[Nod-1].Rank); else arp->AddValue(g, new(g) JVALUE(g, Value)); @@ -1562,7 +1556,7 @@ int TDBJSON::MakeDocument(PGLOBAL g) arp = jsp->GetArray(); objp = NULL; - i = atoi(objpath+1) - 1; + i = atoi(objpath+1) - B; val = arp->GetValue(i); if (!val) { @@ -1750,6 +1744,7 @@ int TDBJSON::ReadDB(PGLOBAL) if (NextSame) { SameRow = NextSame; NextSame = false; + M++; rc = RC_OK; } else if (++Fpos < (signed)Doc->size()) { Row = Doc->GetValue(Fpos); @@ -1758,6 +1753,7 @@ int TDBJSON::ReadDB(PGLOBAL) Row = ((PJVAL)Row)->GetJson(); SameRow = 0; + M = 1; rc = RC_OK; } else rc = RC_EF; diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index dc682e067e3..4e5f84b1190 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -57,6 +57,7 @@ class JSONDEF : public DOSDEF { /* Table description */ int Limit; /* Limit of multiple values */ int Pretty; /* Depends on file structure */ int Level; /* Used for catalog table */ + int Base; /* Tne array index base */ bool Strict; /* Strict syntax checking */ }; // end of JSONDEF @@ -84,7 +85,7 @@ class TDBJSN : public TDBDOS { virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); virtual PCOL InsertSpecialColumn(PCOL colp); virtual int RowNumber(PGLOBAL g, bool b = FALSE) - {return (b) ? N : Fpos + 1;} + {return (b) ? M : N;} // Database routines virtual int Cardinality(PGLOBAL g); @@ -106,13 +107,14 @@ class TDBJSN : public TDBDOS { char *Objname; // The table object name char *Xcol; // Name of expandable column int Fpos; // The current row index -//int Spos; // DELETE start index int N; // The current Rownum + int M; // Index of multiple value int Limit; // Limit of multiple values int Pretty; // Depends on file structure int NextSame; // Same next row int SameRow; // Same row nb int Xval; // Index of expandable array + int B; // Array index base bool Strict; // Strict syntax checking bool Comma; // Row has final comma }; // end of class TDBJSN -- cgit v1.2.1 From db33294fdc3733bfd4bd7b280e049a8a1663cfa5 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 17 May 2015 19:55:48 +0200 Subject: Json array index (position) was badly set for default array setting modified: storage/connect/tabjson.cpp --- storage/connect/tabjson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 0ce326f5c2a..6d3bbeaa56f 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -863,7 +863,7 @@ bool JSONCOL::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) else if (jnp->Op != OP_EXP) { if (b) { // Return 1st value (B is the index base) - jnp->Rank = 1 - Tjp->B; + jnp->Rank = Tjp->B; jnp->Op = OP_EQ; } else if (!Value->IsTypeNum()) { jnp->CncVal = AllocateValue(g, (void*)", ", TYPE_STRING); -- cgit v1.2.1 From 37840d5313213a6c704386c09090569935e97ecb Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 20 May 2015 11:19:44 +0200 Subject: Security: EOM modules must now be loaded from the plugin directory. modified: storage/connect/mycat.cc modified: storage/connect/reldef.cpp Json array index (position) always defaults to 0 modified: storage/connect/tabjson.cpp --- storage/connect/mycat.cc | 41 ++++++++++++++++++++++++++++++++++++----- storage/connect/reldef.cpp | 38 ++++++++++++++++++++++++++------------ storage/connect/tabjson.cpp | 3 ++- 3 files changed, 64 insertions(+), 18 deletions(-) diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 0bc82cd80ce..0ef43a245fa 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -99,6 +99,26 @@ extern "C" HINSTANCE s_hModule; // Saved module handle PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); +/***********************************************************************/ +/* Get the plugin directory. */ +/***********************************************************************/ +char *GetPluginDir(void) +{ + char *plugin_dir; + +#if defined(_WIN64) + plugin_dir = (char *)GetProcAddress(GetModuleHandle(NULL), + "?opt_plugin_dir@@3PADEA"); +#elif defined(_WIN32) + plugin_dir = (char*)GetProcAddress(GetModuleHandle(NULL), + "?opt_plugin_dir@@3PADA"); +#else + plugin_dir = opt_plugin_dir; +#endif + + return plugin_dir; +} // end of GetPluginDir + /***********************************************************************/ /* Get a unique enum table type ID. */ /***********************************************************************/ @@ -328,7 +348,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) { typedef PQRYRES (__stdcall *XCOLDEF) (PGLOBAL, void*, char*, char*, bool); const char *module, *subtype; - char c, getname[40] = "Col"; + char c, soname[_MAX_PATH], getname[40] = "Col"; #if defined(WIN32) HANDLE hdll; /* Handle to the external DLL */ #else // !WIN32 @@ -343,6 +363,17 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) if (!module || !subtype) return NULL; + /*********************************************************************/ + /* Ensure that the .dll doesn't have a path. */ + /* This is done to ensure that only approved dll from the system */ + /* directories are used (to make this even remotely secure). */ + /*********************************************************************/ + if (check_valid_path(module, strlen(module))) { + strcpy(g->Message, "Module cannot contain a path"); + return NULL; + } else + PlugSetPath(soname, module, GetPluginDir()); + // The exported name is always in uppercase for (int i = 0; ; i++) { c = subtype[i]; @@ -352,11 +383,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) #if defined(WIN32) // Load the Dll implementing the table - if (!(hdll = LoadLibrary(module))) { + if (!(hdll = LoadLibrary(soname))) { char buf[256]; DWORD rc = GetLastError(); - sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, module); + sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, (LPTSTR)buf, sizeof(buf), NULL); @@ -374,9 +405,9 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) const char *error = NULL; // Load the desired shared library - if (!(hdll = dlopen(module, RTLD_LAZY))) { + if (!(hdll = dlopen(soname, RTLD_LAZY))) { error = dlerror(); - sprintf(g->Message, MSG(SHARED_LIB_ERR), module, SVP(error)); + sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); return NULL; } // endif Hdll diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 0b3d4682cc7..4563500254b 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -56,6 +56,7 @@ extern handlerton *connect_hton; /* External function. */ /***********************************************************************/ USETEMP UseTemp(void); +char *GetPluginDir(void); /* --------------------------- Class RELDEF -------------------------- */ @@ -437,20 +438,31 @@ void TABDEF::SetIndexInfo(void) PTABDEF OEMDEF::GetXdef(PGLOBAL g) { typedef PTABDEF (__stdcall *XGETDEF) (PGLOBAL, void *); - char c, getname[40] = "Get"; + char c, soname[_MAX_PATH], getname[40] = "Get"; PTABDEF xdefp; XGETDEF getdef = NULL; PCATLG cat = Cat; + /*********************************************************************/ + /* Ensure that the .dll doesn't have a path. */ + /* This is done to ensure that only approved dll from the system */ + /* directories are used (to make this even remotely secure). */ + /*********************************************************************/ + if (check_valid_path(Module, strlen(Module))) { + strcpy(g->Message, "Module cannot contain a path"); + return NULL; + } else + PlugSetPath(soname, Module, GetPluginDir()); + #if defined(WIN32) // Is the DLL already loaded? - if (!Hdll && !(Hdll = GetModuleHandle(Module))) + if (!Hdll && !(Hdll = GetModuleHandle(soname))) // No, load the Dll implementing the function - if (!(Hdll = LoadLibrary(Module))) { + if (!(Hdll = LoadLibrary(soname))) { char buf[256]; DWORD rc = GetLastError(); - sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, Module); + sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, (LPTSTR)buf, sizeof(buf), NULL); @@ -474,7 +486,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) #else // !WIN32 const char *error = NULL; Dl_info dl_info; - + +#if 0 // Don't know what all this stuff does // The OEM lib must retrieve exported CONNECT variables if (dladdr(&connect_hton, &dl_info)) { if (dlopen(dl_info.dli_fname, RTLD_NOLOAD | RTLD_NOW | RTLD_GLOBAL) == 0) { @@ -488,15 +501,16 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) sprintf(g->Message, "dladdr failed: %s, OEM not supported", SVP(error)); return NULL; } // endif dladdr +#endif // 0 // Is the library already loaded? -// if (!Hdll && !(Hdll = ???)) - // Load the desired shared library - if (!(Hdll = dlopen(Module, RTLD_LAZY))) { - error = dlerror(); - sprintf(g->Message, MSG(SHARED_LIB_ERR), Module, SVP(error)); - return NULL; - } // endif Hdll + if (!Hdll && !(Hdll = dlopen(soname, RTLD_NOLOAD))) + // Load the desired shared library + if (!(Hdll = dlopen(soname, RTLD_LAZY))) { + error = dlerror(); + sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); + return NULL; + } // endif Hdll // The exported name is always in uppercase for (int i = 0; ; i++) { diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 6d3bbeaa56f..34d5827345f 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -449,7 +449,7 @@ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) Xcol = NULL; Limit = 1; Pretty = 0; - B = 1; + B = 0; Strict = false; } // endif tdp @@ -477,6 +477,7 @@ TDBJSN::TDBJSN(TDBJSN *tdbp) : TDBDOS(NULL, tdbp) NextSame = tdbp->NextSame; SameRow = tdbp->SameRow; Xval = tdbp->Xval; + B = tdbp->B; Pretty = tdbp->Pretty; Strict = tdbp->Strict; Comma = tdbp->Comma; -- cgit v1.2.1 From fb98632930cd320c55a8664f601c4082b3e14628 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 26 May 2015 01:02:33 +0200 Subject: JSONColumns and XMLColumns revisited. They can retrieve their parameters directly from the PTOS argument. For this to work, finding the table options is now split in HA_CONNECT functions and exported functions available from out of ha_connect. modified: storage/connect/ha_connect.cc modified: storage/connect/libdoc.cpp modified: storage/connect/mycat.h modified: storage/connect/plgdbsem.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/tabxml.cpp modified: storage/connect/tabxml.h The BIN table formats have been changed to handle the case of floating point values when used with Big Endian or Little Endian machines. modified: storage/connect/ha_connect.cc modified: storage/connect/mysql-test/connect/r/bin.result modified: storage/connect/mysql-test/connect/t/bin.test modified: storage/connect/reldef.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix. h --- storage/connect/ha_connect.cc | 238 ++++++++++++++---------- storage/connect/libdoc.cpp | 5 +- storage/connect/mycat.h | 2 +- storage/connect/mysql-test/connect/r/bin.result | 32 ++-- storage/connect/mysql-test/connect/t/bin.test | 16 +- storage/connect/plgdbsem.h | 4 + storage/connect/reldef.cpp | 65 +++++-- storage/connect/tabdos.cpp | 2 + storage/connect/tabdos.h | 1 + storage/connect/tabfix.cpp | 148 ++++++++------- storage/connect/tabfix.h | 6 +- storage/connect/tabjson.cpp | 63 +++---- storage/connect/tabjson.h | 12 +- storage/connect/tabxml.cpp | 62 +++--- storage/connect/tabxml.h | 5 +- 15 files changed, 369 insertions(+), 292 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 964185b1b27..bb7f0b4abcf 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -195,9 +195,8 @@ extern "C" { /***********************************************************************/ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); PQRYRES VirColumns(PGLOBAL g, bool info); -PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, - int pretty, int lvl, int mxr, bool info); -PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info); +PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info); +PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info); void PushWarning(PGLOBAL g, THD *thd, int level); bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, const char *db, char *tab, const char *src, int port); @@ -1017,6 +1016,117 @@ char *GetListOption(PGLOBAL g, const char *opname, return opval; } // end of GetListOption +/****************************************************************************/ +/* Return the value of a string option or NULL if not specified. */ +/****************************************************************************/ +char *GetStringTableOption(PGLOBAL g, PTOS options, char *opname, char *sdef) +{ + const char *opval= NULL; + + if (!options) + return sdef; + else if (!stricmp(opname, "Type")) + opval= options->type; + else if (!stricmp(opname, "Filename")) + opval= options->filename; + else if (!stricmp(opname, "Optname")) + opval= options->optname; + else if (!stricmp(opname, "Tabname")) + opval= options->tabname; + else if (!stricmp(opname, "Tablist")) + opval= options->tablist; + else if (!stricmp(opname, "Database") || + !stricmp(opname, "DBname")) + opval= options->dbname; + else if (!stricmp(opname, "Separator")) + opval= options->separator; + else if (!stricmp(opname, "Qchar")) + opval= options->qchar; + else if (!stricmp(opname, "Module")) + opval= options->module; + else if (!stricmp(opname, "Subtype")) + opval= options->subtype; + else if (!stricmp(opname, "Catfunc")) + opval= options->catfunc; + else if (!stricmp(opname, "Srcdef")) + opval= options->srcdef; + else if (!stricmp(opname, "Colist")) + opval= options->colist; + else if (!stricmp(opname, "Data_charset")) + opval= options->data_charset; + + if (!opval && options && options->oplist) + opval= GetListOption(g, opname, options->oplist); + + return opval ? (char*)opval : sdef; +} // end of GetStringTableOption + +/****************************************************************************/ +/* Return the value of a Boolean option or bdef if not specified. */ +/****************************************************************************/ +bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef) +{ + bool opval= bdef; + char *pv; + + if (!options) + return bdef; + else if (!stricmp(opname, "Mapped")) + opval= options->mapped; + else if (!stricmp(opname, "Huge")) + opval= options->huge; + else if (!stricmp(opname, "Split")) + opval= options->split; + else if (!stricmp(opname, "Readonly")) + opval= options->readonly; + else if (!stricmp(opname, "SepIndex")) + opval= options->sepindex; + else if (!stricmp(opname, "Header")) + opval= (options->header != 0); // Is Boolean for some table types + else if (options->oplist) + if ((pv= GetListOption(g, opname, options->oplist))) + opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0); + + return opval; +} // end of GetBooleanTableOption + +/****************************************************************************/ +/* Return the value of an integer option or NO_IVAL if not specified. */ +/****************************************************************************/ +int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef) +{ + ulonglong opval= NO_IVAL; + + if (!options) + return idef; + else if (!stricmp(opname, "Lrecl")) + opval= options->lrecl; + else if (!stricmp(opname, "Elements")) + opval= options->elements; + else if (!stricmp(opname, "Multiple")) + opval= options->multiple; + else if (!stricmp(opname, "Header")) + opval= options->header; + else if (!stricmp(opname, "Quoted")) + opval= options->quoted; + else if (!stricmp(opname, "Ending")) + opval= options->ending; + else if (!stricmp(opname, "Compressed")) + opval= (options->compressed); + + if (opval == NO_IVAL) { + char *pv; + + if ((pv= GetListOption(g, opname, options->oplist))) + opval= CharToNumber(pv, strlen(pv), ULONGLONG_MAX, true); + else + return idef; + + } // endif opval + + return (int)opval; +} // end of GetIntegerTableOption + /****************************************************************************/ /* Return the table option structure. */ /****************************************************************************/ @@ -1035,9 +1145,6 @@ char *ha_connect::GetRealString(const char *s) char *sv; if (IsPartitioned() && s) { -// sv= (char*)PlugSubAlloc(xp->g, NULL, strlen(s) + strlen(partname)); - // With wrong string pattern, the size of the constructed string - // can be more than strlen(s) + strlen(partname) sv= (char*)PlugSubAlloc(xp->g, NULL, 0); sprintf(sv, s, partname); PlugSubAlloc(xp->g, NULL, strlen(sv) + 1); @@ -1048,7 +1155,7 @@ char *ha_connect::GetRealString(const char *s) } // end of GetRealString /****************************************************************************/ -/* Return the value of a string option or NULL if not specified. */ +/* Return the value of a string option or sdef if not specified. */ /****************************************************************************/ char *ha_connect::GetStringOption(char *opname, char *sdef) { @@ -1066,37 +1173,6 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) opval= thd_query_string(table->in_use)->str; else if (!stricmp(opname, "Partname")) opval= partname; - else if (!options) - ; - else if (!stricmp(opname, "Type")) - opval= (char*)options->type; - else if (!stricmp(opname, "Filename")) - opval= GetRealString(options->filename); - else if (!stricmp(opname, "Optname")) - opval= (char*)options->optname; - else if (!stricmp(opname, "Tabname")) - opval= GetRealString(options->tabname); - else if (!stricmp(opname, "Tablist")) - opval= (char*)options->tablist; - else if (!stricmp(opname, "Database") || - !stricmp(opname, "DBname")) - opval= (char*)options->dbname; - else if (!stricmp(opname, "Separator")) - opval= (char*)options->separator; - else if (!stricmp(opname, "Qchar")) - opval= (char*)options->qchar; - else if (!stricmp(opname, "Module")) - opval= (char*)options->module; - else if (!stricmp(opname, "Subtype")) - opval= (char*)options->subtype; - else if (!stricmp(opname, "Catfunc")) - opval= (char*)options->catfunc; - else if (!stricmp(opname, "Srcdef")) - opval= (char*)options->srcdef; - else if (!stricmp(opname, "Colist")) - opval= (char*)options->colist; - else if (!stricmp(opname, "Data_charset")) - opval= (char*)options->data_charset; else if (!stricmp(opname, "Table_charset")) { const CHARSET_INFO *chif= (tshp) ? tshp->table_charset : table->s->table_charset; @@ -1104,17 +1180,13 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) if (chif) opval= (char*)chif->csname; - } // endif Table_charset - - if (!opval && options && options->oplist) { - opval= GetListOption(xp->g, opname, options->oplist); - - if (opval && (!stricmp(opname, "connect") - || !stricmp(opname, "tabname") - || !stricmp(opname, "filename"))) - opval = GetRealString(opval); + } else + opval= GetStringTableOption(xp->g, options, opname, NULL); - } // endif opval + if (opval && (!stricmp(opname, "connect") + || !stricmp(opname, "tabname") + || !stricmp(opname, "filename"))) + opval = GetRealString(opval); if (!opval) { if (sdef && !strcmp(sdef, "*")) { @@ -1145,31 +1217,13 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) /****************************************************************************/ bool ha_connect::GetBooleanOption(char *opname, bool bdef) { - bool opval= bdef; - char *pv; + bool opval; PTOS options= GetTableOptionStruct(); if (!stricmp(opname, "View")) opval= (tshp) ? tshp->is_view : table_share->is_view; - else if (!options) - ; - else if (!stricmp(opname, "Mapped")) - opval= options->mapped; - else if (!stricmp(opname, "Huge")) - opval= options->huge; -//else if (!stricmp(opname, "Compressed")) -// opval= options->compressed; - else if (!stricmp(opname, "Split")) - opval= options->split; - else if (!stricmp(opname, "Readonly")) - opval= options->readonly; - else if (!stricmp(opname, "SepIndex")) - opval= options->sepindex; - else if (!stricmp(opname, "Header")) - opval= (options->header != 0); // Is Boolean for some table types - else if (options->oplist) - if ((pv= GetListOption(xp->g, opname, options->oplist))) - opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0); + else + opval= GetBooleanTableOption(xp->g, options, opname, bdef); return opval; } // end of GetBooleanOption @@ -1198,37 +1252,18 @@ bool ha_connect::SetBooleanOption(char *opname, bool b) /****************************************************************************/ int ha_connect::GetIntegerOption(char *opname) { - ulonglong opval= NO_IVAL; - char *pv; + int opval; PTOS options= GetTableOptionStruct(); TABLE_SHARE *tsp= (tshp) ? tshp : table_share; if (!stricmp(opname, "Avglen")) - opval= (ulonglong)tsp->avg_row_length; + opval= (int)tsp->avg_row_length; else if (!stricmp(opname, "Estimate")) - opval= (ulonglong)tsp->max_rows; - else if (!options) - ; - else if (!stricmp(opname, "Lrecl")) - opval= options->lrecl; - else if (!stricmp(opname, "Elements")) - opval= options->elements; - else if (!stricmp(opname, "Multiple")) - opval= options->multiple; - else if (!stricmp(opname, "Header")) - opval= options->header; - else if (!stricmp(opname, "Quoted")) - opval= options->quoted; - else if (!stricmp(opname, "Ending")) - opval= options->ending; - else if (!stricmp(opname, "Compressed")) - opval= (options->compressed); - - if (opval == (ulonglong)NO_IVAL && options && options->oplist) - if ((pv= GetListOption(xp->g, opname, options->oplist))) - opval= CharToNumber(pv, strlen(pv), ULONGLONG_MAX, true); + opval= (int)tsp->max_rows; + else + opval= GetIntegerTableOption(xp->g, options, opname, NO_IVAL); - return (int)opval; + return opval; } // end of GetIntegerOption /****************************************************************************/ @@ -4965,12 +5000,12 @@ static int connect_assisted_discovery(handlerton *, THD* thd, const char *fncn= "?"; const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src; const char *col, *ocl, *rnk, *pic, *fcl, *skc; - char *tab, *dsn, *shm, *dpath, *objn; + char *tab, *dsn, *shm, *dpath; #if defined(WIN32) char *nsp= NULL, *cls= NULL; #endif // WIN32 - int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0; - int cop __attribute__((unused))= 0, pty= 2, lrecl= 0; + int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0; + int cop __attribute__((unused))= 0, lrecl= 0; #if defined(ODBC_SUPPORT) POPARM sop = NULL; char *ucnc = NULL; @@ -5000,7 +5035,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, if (!g) return HA_ERR_INTERNAL_ERROR; - user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= dsn= objn= NULL; + user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= dsn= NULL; // Get the useful create options ttp= GetTypeID(topt->type); @@ -5031,7 +5066,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd, skc= GetListOption(g, "skipcol", topt->oplist, NULL); rnk= GetListOption(g, "rankcol", topt->oplist, NULL); pwd= GetListOption(g, "password", topt->oplist); - objn= GetListOption(g, "Object", topt->oplist, NULL); #if defined(WIN32) nsp= GetListOption(g, "namespace", topt->oplist); cls= GetListOption(g, "class", topt->oplist); @@ -5049,8 +5083,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd, #if defined(PROMPT_OK) cop= atoi(GetListOption(g, "checkdsn", topt->oplist, "0")); #endif // PROMPT_OK - pty= atoi(GetListOption(g,"Pretty", topt->oplist, "2")); - lvl= atoi(GetListOption(g,"Level", topt->oplist, "0")); } else { host= "localhost"; user= (ttp == TAB_ODBC ? NULL : "root"); @@ -5342,7 +5374,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, qrp= VirColumns(g, fnc == FNC_COL); break; case TAB_JSON: - qrp= JSONColumns(g, (char*)db, fn, objn, pty, lrecl, lvl, fnc == FNC_COL); + qrp= JSONColumns(g, (char*)db, topt, fnc == FNC_COL); break; #if defined(LIBXML2_SUPPORT) || defined(DOMDOC_SUPPORT) case TAB_XML: @@ -6608,7 +6640,7 @@ maria_declare_plugin(connect) 0x0103, /* version number (1.03) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.03.0006", /* string version */ + "1.03.0007", /* string version */ MariaDB_PLUGIN_MATURITY_BETA /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp index 7d1d014c48b..c2882fc0d7c 100644 --- a/storage/connect/libdoc.cpp +++ b/storage/connect/libdoc.cpp @@ -533,8 +533,8 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn) // This function does not crash ( if (xmlSaveFormatFileEnc((const char *)ofn, Docp, Encoding, 0) < 0) { xmlErrorPtr err = xmlGetLastError(); - strcpy(g->Message, (err) ? err->message : "Error saving XML doc"); + xmlResetError(Xerr); rc = -1; } // endif Save // rc = xmlDocDump(of, Docp); @@ -569,6 +569,7 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) htrc("CloseDoc: xp=%p count=%d\n", xp, (xp) ? xp->Count : 0); //if (xp && xp->Count == 1) { + if (xp) { if (Nlist) { xmlXPathFreeNodeSet(Nlist); @@ -605,7 +606,7 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) Ctxp = NULL; } // endif Ctxp -// } // endif Count + } // endif xp CloseXML2File(g, xp, false); } // end of Close diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h index f7c4c70eaf5..d4024e6b6c3 100644 --- a/storage/connect/mycat.h +++ b/storage/connect/mycat.h @@ -24,7 +24,7 @@ #include "block.h" #include "catalog.h" -typedef struct ha_table_option_struct TOS, *PTOS; +//typedef struct ha_table_option_struct TOS, *PTOS; /** structure for CREATE TABLE options (table options) diff --git a/storage/connect/mysql-test/connect/r/bin.result b/storage/connect/mysql-test/connect/r/bin.result index 69453d97534..4ba353ac705 100644 --- a/storage/connect/mysql-test/connect/r/bin.result +++ b/storage/connect/mysql-test/connect/r/bin.result @@ -15,11 +15,11 @@ CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', name CHAR(10) NOT NULL, -birth DATE NOT NULL FIELD_FORMAT='L', -id CHAR(5) NOT NULL FIELD_FORMAT='L2', +birth DATE NOT NULL, +id CHAR(5) NOT NULL FIELD_FORMAT='S', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', -dept INT(4) NOT NULL FIELD_FORMAT='L2' -) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat'; +dept INT(4) NOT NULL FIELD_FORMAT='S' +) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat' OPTION_LIST='Endian=Little'; SELECT * FROM t1; fig name birth id salary dept 5500 ARCHIBALD 1980-01-25 3789 4380.50 318 @@ -42,11 +42,11 @@ CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', name CHAR(10) NOT NULL, -birth DATE NOT NULL FIELD_FORMAT='L', -id CHAR(5) NOT NULL FIELD_FORMAT='L2', +birth DATE NOT NULL, +id CHAR(5) NOT NULL FIELD_FORMAT='S', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', -dept INT(4) NOT NULL FIELD_FORMAT='L2' -) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat'; +dept INT(4) NOT NULL FIELD_FORMAT='S' +) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat' OPTION_LIST='Endian=Little'; INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); ERROR HY000: Table 't1' is read only ALTER TABLE t1 READONLY=NO; @@ -55,11 +55,11 @@ Table Create Table t1 CREATE TABLE `t1` ( `fig` int(4) NOT NULL `FIELD_FORMAT`='C', `name` char(10) NOT NULL, - `birth` date NOT NULL `FIELD_FORMAT`='L', - `id` char(5) NOT NULL `FIELD_FORMAT`='L2', + `birth` date NOT NULL, + `id` char(5) NOT NULL `FIELD_FORMAT`='S', `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', - `dept` int(4) NOT NULL `FIELD_FORMAT`='L2' -) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=NO + `dept` int(4) NOT NULL `FIELD_FORMAT`='S' +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=NO INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); SELECT * FROM t1; fig name birth id salary dept @@ -74,11 +74,11 @@ Table Create Table t1 CREATE TABLE `t1` ( `fig` int(4) NOT NULL `FIELD_FORMAT`='C', `name` char(10) NOT NULL, - `birth` date NOT NULL `FIELD_FORMAT`='L', - `id` char(5) NOT NULL `FIELD_FORMAT`='L2', + `birth` date NOT NULL, + `id` char(5) NOT NULL `FIELD_FORMAT`='S', `salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F', - `dept` int(4) NOT NULL `FIELD_FORMAT`='L2' -) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=YES + `dept` int(4) NOT NULL `FIELD_FORMAT`='S' +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=YES INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); ERROR HY000: Table 't1' is read only DROP TABLE t1; diff --git a/storage/connect/mysql-test/connect/t/bin.test b/storage/connect/mysql-test/connect/t/bin.test index e9d1ad58c37..1e45bcaf93a 100644 --- a/storage/connect/mysql-test/connect/t/bin.test +++ b/storage/connect/mysql-test/connect/t/bin.test @@ -20,11 +20,11 @@ CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', name CHAR(10) NOT NULL, - birth DATE NOT NULL FIELD_FORMAT='L', - id CHAR(5) NOT NULL FIELD_FORMAT='L2', + birth DATE NOT NULL, + id CHAR(5) NOT NULL FIELD_FORMAT='S', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', - dept INT(4) NOT NULL FIELD_FORMAT='L2' -) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat'; + dept INT(4) NOT NULL FIELD_FORMAT='S' +) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat' OPTION_LIST='Endian=Little'; SELECT * FROM t1; --error ER_GET_ERRMSG @@ -41,11 +41,11 @@ CREATE TABLE t1 ( fig INT(4) NOT NULL FIELD_FORMAT='C', name CHAR(10) NOT NULL, - birth DATE NOT NULL FIELD_FORMAT='L', - id CHAR(5) NOT NULL FIELD_FORMAT='L2', + birth DATE NOT NULL, + id CHAR(5) NOT NULL FIELD_FORMAT='S', salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F', - dept INT(4) NOT NULL FIELD_FORMAT='L2' -) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat'; + dept INT(4) NOT NULL FIELD_FORMAT='S' +) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat' OPTION_LIST='Endian=Little'; --error ER_OPEN_AS_READONLY INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777); ALTER TABLE t1 READONLY=NO; diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index 4dc8f293070..05dc59aec02 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -389,6 +389,7 @@ typedef struct _qryres *PQRYRES; typedef struct _colres *PCOLRES; typedef struct _datpar *PDTP; typedef struct indx_used *PXUSED; +typedef struct ha_table_option_struct TOS, *PTOS; /***********************************************************************/ /* Utility blocks for file and storage. */ @@ -593,6 +594,9 @@ DllExport void NewPointer(PTABS, void *, void *); DllExport void SetTrc(void); DllExport char *GetListOption(PGLOBAL, const char *, const char *, const char *def=NULL); +DllExport char *GetStringTableOption(PGLOBAL, PTOS, char *, char *); +DllExport bool GetBooleanTableOption(PGLOBAL, PTOS, char *, bool); +DllExport int GetIntegerTableOption(PGLOBAL, PTOS, char *, int); #define MSGID_NONE 0 #define MSGID_CANNOT_OPEN 1 diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 4563500254b..720ede8f225 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -247,7 +247,7 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am) /***********************************************************************/ PSZ TABDEF::GetPath(void) { - return (Database) ? (PSZ)Database : Hc->GetDataPath(); + return (Database) ? (PSZ)Database : (Hc) ? Hc->GetDataPath() : NULL; } // end of GetPath /***********************************************************************/ @@ -256,7 +256,8 @@ PSZ TABDEF::GetPath(void) int TABDEF::GetColCatInfo(PGLOBAL g) { char *type= GetStringCatInfo(g, "Type", "*"); - int i, loff, poff, nof, nlg; + char c, fty, eds; + int i, n, loff, poff, nof, nlg; void *field= NULL; TABTYPE tc; PCOLDEF cdp, lcdp= NULL, tocols= NULL; @@ -331,28 +332,52 @@ int TABDEF::GetColCatInfo(PGLOBAL g) cdp->SetOffset(0); // Not to have shift case TAB_BIN: // BIN/VEC are packed by default - if (nof) + if (nof) { // Field width is the internal representation width // that can also depend on the column format - switch (cdp->Fmt ? *cdp->Fmt : cdp->Decode ? 'C' : 'X') { - case 'X': nof= cdp->Clen; - case 'C': break; - case 'R': - case 'F': -// case 'L': - case 'I': nof= 4; break; - case 'D': nof= 8; break; - case 'S': nof= 2; break; - case 'T': nof= 1; break; - default: /* New format */ - for (nof= 0, i= 0; cdp->Fmt[i]; i++) - if (isdigit(cdp->Fmt[i])) - nof= (nof * 10 + (cdp->Fmt[i] - '0')); - - if (!nof) + fty = cdp->Decode ? 'C' : 'X'; + eds = 0; + n = 0; + + if (cdp->Fmt && !cdp->Decode) { + for (i = 0; cdp->Fmt[i]; i++) { + c = toupper(cdp->Fmt[i]); + + if (isdigit(c)) + n = (n * 10 + (c - '0')); + else if (c == 'L' || c == 'B' || c == 'H') + eds = c; + else + fty = c; + + } // endfor i + + } // endif Fmt + + if (n) + nof = n; + else switch (fty) { + case 'X': + if (eds && IsTypeChar(cdp->Buf_Type)) + nof = sizeof(longlong); + else nof= cdp->Clen; - } // endswitch Fmt + break; + case 'C': break; + case 'R': + case 'F': nof = sizeof(float); break; + case 'I': nof = sizeof(int); break; + case 'D': nof = sizeof(double); break; + case 'S': nof = sizeof(short); break; + case 'T': nof = sizeof(char); break; + case 'G': nof = sizeof(longlong); break; + default: /* Wrong format */ + sprintf(g->Message, "Invalid format %c", fty); + return -1; + } // endswitch fty + + } // endif nof default: break; diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index 37bd94cf1bb..bee56e31886 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -112,6 +112,7 @@ DOSDEF::DOSDEF(void) Maxerr = 0; ReadMode = 0; Ending = 0; + Teds = 0; } // end of DOSDEF constructor /***********************************************************************/ @@ -146,6 +147,7 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int) Padded = GetBoolCatInfo("Padded", false); Blksize = GetIntCatInfo("Blksize", 0); Eof = (GetIntCatInfo("EOF", 0) != 0); + Teds = toupper(*GetStringCatInfo(g, "Endian", "")); } else if (Recfm == RECFM_DBF) { Maxerr = GetIntCatInfo("Maxerr", 0); Accept = GetBoolCatInfo("Accept", false); diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 9115b1fae86..c098886f14b 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -91,6 +91,7 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ int Maxerr; /* Maximum number of bad records (DBF) */ int ReadMode; /* Specific to DBF */ int Ending; /* Length of end of lines */ + int Teds; /* Binary table default endian setting */ }; // end of DOSDEF /***********************************************************************/ diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index af92ec0410a..83fe14ca85c 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -68,10 +68,12 @@ USETEMP UseTemp(void); /***********************************************************************/ TDBFIX::TDBFIX(PDOSDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) { + Teds = tdp->Teds; // For BIN tables } // end of TDBFIX standard constructor TDBFIX::TDBFIX(PGLOBAL g, PTDBFIX tdbp) : TDBDOS(g, tdbp) { + Teds = tdbp->Teds; } // end of TDBFIX copy constructor // Method @@ -374,42 +376,63 @@ int TDBFIX::WriteDB(PGLOBAL g) BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) : DOSCOL(g, cdp, tp, cp, i, am) { - char *fmt = cdp->GetFmt(); + char c, *fmt = cdp->GetFmt(); + Fmt = GetDomain() ? 'C' : 'X'; Buff = NULL; + Eds = ((PTDBFIX)tp)->Teds; + N = 0; M = GetTypeSize(Buf_Type, sizeof(longlong)); Lim = 0; if (fmt) { - Fmt = 'H'; + for (N = 0, i = 0; fmt[i]; i++) { + c = toupper(fmt[i]); - for (N = 0, i = 0; fmt[i]; i++) - if (isdigit(fmt[i])) - N = (N * 10 + (fmt[i] - '0')); + if (isdigit(c)) + N = (N * 10 + (c - '0')); + else if (c == 'L' || c == 'B' || c == 'H') + Eds = c; else - Fmt = toupper(fmt[i]); - - if (N == GetTypeSize(Buf_Type, -1) && (Fmt == 'H' || Fmt == Endian)) { - // New format is a no op - N = 0; - Fmt = 'X'; - } else if (Fmt == 'L' || Fmt == 'B' || Fmt == 'H') { - // This is a new format - if (!N) - N = GetTypeSize(Buf_Type, Long); - - if (Fmt == 'H') - Fmt = Endian; - + Fmt = c; + + } // endfor i + + // M is the size of the source value + switch (Fmt) { + case 'C': Eds = 0; break; + case 'X': break; + case 'S': M = sizeof(short); break; + case 'T': M = sizeof(char); break; + case 'I': M = sizeof(int); break; + case 'G': M = sizeof(longlong); break; + case 'R': // Real + case 'F': M = sizeof(float); break; + case 'D': M = sizeof(double); break; + default: + sprintf(g->Message, MSG(BAD_BIN_FMT), Fmt, Name); + longjmp(g->jumper[g->jump_level], 11); + } // endswitch Fmt + + } else if (IsTypeChar(Buf_Type)) + Eds = 0; + + if (Eds) { + // This is a byte order specification + if (!N) + N = M; + + if (Eds != 'L' && Eds != 'B') + Eds = Endian; + + if (N != M || Eds != Endian || IsTypeChar(Buf_Type)) { Buff = (char*)PlugSubAlloc(g, NULL, M); memset(Buff, 0, M); Lim = MY_MIN(N, M); - } // endif Fmt + } else + Eds = 0; // New format is a no op - } else { - N = 0; - Fmt = GetDomain() ? 'C' : 'X'; - } // endif fmt + } // endif Eds } // end of BINCOL constructor @@ -419,6 +442,7 @@ BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) /***********************************************************************/ BINCOL::BINCOL(BINCOL *col1, PTDB tdbp) : DOSCOL(col1, tdbp) { + Eds = col1->Eds; Fmt = col1->Fmt; N = col1->N; M = col1->M; @@ -470,25 +494,27 @@ void BINCOL::ReadColumn(PGLOBAL g) /*********************************************************************/ /* Set Value from the line field. */ /*********************************************************************/ - if (N) { + if (Eds) { for (int i = 0; i < Lim; i++) - if (Fmt == 'B' && Endian == 'L') + if (Eds == 'B' && Endian == 'L') Buff[i] = p[N - i - 1]; - else if (Fmt == 'L' && Endian == 'B') + else if (Eds == 'L' && Endian == 'B') Buff[M - i - 1] = p[i]; else if (Endian == 'B') Buff[M - i - 1] = p[N - i - 1]; else Buff[i] = p[i]; - if (IsTypeChar(Buf_Type)) - Value->SetValue(*(longlong*)Buff); - else - Value->SetBinValue(Buff); + p = Buff; + } // endif Eds - } else switch (Fmt) { + switch (Fmt) { case 'X': // Standard not converted values - Value->SetBinValue(p); + if (Eds && IsTypeChar(Buf_Type)) + Value->SetValue(*(longlong*)p); + else + Value->SetBinValue(p); + break; case 'S': // Short integer Value->SetValue(*(short*)p); @@ -496,12 +522,12 @@ void BINCOL::ReadColumn(PGLOBAL g) case 'T': // Tiny integer Value->SetValue(*p); break; -// case 'L': // Long Integer -// strcpy(g->Message, "Format L is deprecated, use I"); -// longjmp(g->jumper[g->jump_level], 11); case 'I': // Integer Value->SetValue(*(int*)p); break; + case 'G': // Large (great) integer + Value->SetValue(*(longlong*)p); + break; case 'F': // Float case 'R': // Real Value->SetValue((double)*(float*)p); @@ -553,41 +579,23 @@ void BINCOL::WriteColumn(PGLOBAL g) if (Value != To_Val) Value->SetValue_pval(To_Val, false); // Convert the updated value - p = tdbp->To_Line + Deplac; + p = (Eds) ? Buff : tdbp->To_Line + Deplac; /*********************************************************************/ /* Check whether updating is Ok, meaning col value is not too long. */ /* Updating will be done only during the second pass (Status=true) */ /* Conversion occurs if the external format Fmt is specified. */ /*********************************************************************/ - if (N) { - if (IsTypeChar(Buf_Type)) - *(longlong *)Buff = Value->GetBigintValue(); - else if (Value->GetBinValue(Buff, M, Status)) { - sprintf(g->Message, MSG(BIN_F_TOO_LONG), - Name, Value->GetSize(), M); - longjmp(g->jumper[g->jump_level], 31); - } // endif Buff - - if (Status) - for (int i = 0; i < Lim; i++) - if (Fmt == 'B' && Endian == 'L') - p[N - i - 1] = Buff[i]; - else if (Fmt == 'L' && Endian == 'B') - p[i] = Buff[M - i - 1]; - else if (Endian == 'B') - p[N - i - 1] = Buff[M - i - 1]; - else - p[i] = Buff[i]; - - } else switch (Fmt) { + switch (Fmt) { case 'X': // Standard not converted values - if (Value->GetBinValue(p, Long, Status)) { + if (Eds && IsTypeChar(Buf_Type)) + *(longlong *)p = Value->GetBigintValue(); + else if (Value->GetBinValue(p, Long, Status)) { sprintf(g->Message, MSG(BIN_F_TOO_LONG), Name, Value->GetSize(), Long); longjmp(g->jumper[g->jump_level], 31); - } // endif p + } // endif p break; case 'S': // Short integer @@ -610,9 +618,6 @@ void BINCOL::WriteColumn(PGLOBAL g) *p = (char)n; break; - case 'L': // Long Integer - strcpy(g->Message, "Format L is deprecated, use I"); - longjmp(g->jumper[g->jump_level], 11); case 'I': // Integer n = Value->GetBigintValue(); @@ -623,7 +628,7 @@ void BINCOL::WriteColumn(PGLOBAL g) *(int *)p = Value->GetIntValue(); break; - case 'B': // Large (big) integer + case 'G': // Large (great) integer if (Status) *(longlong *)p = Value->GetBigintValue(); @@ -657,6 +662,21 @@ void BINCOL::WriteColumn(PGLOBAL g) longjmp(g->jumper[g->jump_level], 11); } // endswitch Fmt + if (Eds && Status) { + p = tdbp->To_Line + Deplac; + + for (int i = 0; i < Lim; i++) + if (Eds == 'B' && Endian == 'L') + p[N - i - 1] = Buff[i]; + else if (Eds == 'L' && Endian == 'B') + p[i] = Buff[M - i - 1]; + else if (Endian == 'B') + p[N - i - 1] = Buff[M - i - 1]; + else + p[i] = Buff[i]; + + } // endif Eds + } // end of WriteColumn /* ------------------------ End of TabFix ---------------------------- */ diff --git a/storage/connect/tabfix.h b/storage/connect/tabfix.h index b6307e8f60b..49956ba0711 100644 --- a/storage/connect/tabfix.h +++ b/storage/connect/tabfix.h @@ -53,7 +53,8 @@ class DllExport TDBFIX : public TDBDOS { protected: virtual bool PrepareWriting(PGLOBAL g) {return false;} - // Members are inherited from TDBDOS + // Members + char Teds; /* Binary table default endian setting */ }; // end of class TDBFIX /***********************************************************************/ @@ -86,7 +87,8 @@ class DllExport BINCOL : public DOSCOL { // Members static char Endian; // The host endian setting (L or B) char *Buff; // Utility buffer - char Fmt; // The file endian setting or old format + char Eds; // The file endian setting + char Fmt; // The converted value format int N; // The number of bytes in the file int M; // The buffer type size int Lim; // Min(N,M) diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 34d5827345f..cfc56212c40 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -59,16 +59,15 @@ typedef struct _jncol { /* JSONColumns: construct the result blocks containing the description */ /* of all the columns of a table contained inside a JSON file. */ /***********************************************************************/ -PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, - int pretty, int lrecl, int lvl, bool info) +PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info) { static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_SHORT, TYPE_SHORT, TYPE_STRING}; static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC, FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT}; static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; - char filename[_MAX_PATH], colname[65], fmt[129]; - int i, j, n = 0; + char *fn, colname[65], fmt[129]; + int i, j, lvl, n = 0; int ncol = sizeof(buftyp) / sizeof(int); PVAL valp; JCOL jcol; @@ -91,26 +90,29 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, goto skipit; } // endif info - if (trace) - htrc("File %s pretty=%d lvl=%d lrecl=%d\n", - SVP(fn), pretty, lvl, lrecl); - /*********************************************************************/ /* Open the input file. */ /*********************************************************************/ - if (!fn) { + if (!(fn = GetStringTableOption(g, topt, "Filename", NULL))) { strcpy(g->Message, MSG(MISSING_FNAME)); return NULL; - } else - PlugSetPath(filename, fn, dp); + } else { + lvl = GetIntegerTableOption(g, topt, "Level", 0); + lvl = (lvl < 0) ? 0 : (lvl > 16) ? 16 : lvl; + } // endif fn tdp = new(g) JSONDEF; - tdp->Database = dp; - tdp->Fn = filename; - tdp->Objname = objn; - tdp->Pretty = pretty; + tdp->Fn = fn; + tdp->Database = SetPath(g, db); + tdp->Objname = GetStringTableOption(g, topt, "Object", NULL); + tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0; + tdp->Pretty = GetIntegerTableOption(g, topt, "Pretty", 2); + + if (trace) + htrc("File %s objname=%s pretty=%d lvl=%d\n", + tdp->Fn, tdp->Objname, tdp->Pretty, lvl); - if (pretty == 2) { + if (tdp->Pretty == 2) { tjsp = new(g) TDBJSON(tdp, new(g) MAPFAM(tdp)); if (tjsp->MakeDocument(g)) @@ -118,13 +120,12 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL; } else { - if (!lrecl) { - sprintf(g->Message, "LRECL must be specified for pretty=%d", pretty); + if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0))) { + sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty); return NULL; } // endif lrecl - tdp->Lrecl = lrecl; - tdp->Ending = CRLF; + tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF); tjnp = new(g) TDBJSN(tdp, new(g) DOSFAM(tdp)); tjnp->SetMode(MODE_READ); @@ -265,7 +266,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, jcp->Found = false; } // endfor jcp - if (pretty != 2) { + if (tdp->Pretty != 2) { // Read next record switch (tjnp->ReadDB(g)) { case RC_EF: @@ -285,7 +286,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, } // endor i - if (pretty != 2) + if (tdp->Pretty != 2) tjnp->CloseDB(g); skipit: @@ -341,7 +342,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn, return qrp; err: - if (pretty != 2) + if (tdp->Pretty != 2) tjnp->CloseDB(g); return NULL; @@ -356,8 +357,7 @@ JSONDEF::JSONDEF(void) Xcol = NULL; Pretty = 2; Limit = 1; - Level = 0; - ReadMode = 0; + Base = 0; Strict = false; } // end of JSONDEF constructor @@ -370,9 +370,8 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff) Objname = GetStringCatInfo(g, "Object", NULL); Xcol = GetStringCatInfo(g, "Expand", NULL); Pretty = GetIntCatInfo("Pretty", 2); - Level = GetIntCatInfo("Level", 0); Limit = GetIntCatInfo("Limit", 10); - Base = GetIntCatInfo("Base", 0); + Base = GetIntCatInfo("Base", 0) ? 1 : 0; return DOSDEF::DefineAM(g, "DOS", poff); } // end of DefineAM @@ -1856,11 +1855,8 @@ void TDBJSON::CloseDB(PGLOBAL g) /***********************************************************************/ TDBJCL::TDBJCL(PJDEF tdp) : TDBCAT(tdp) { - Fn = tdp->GetFn(); - Objn = tdp->Objname; - Pretty = tdp->Pretty; - Lrecl = tdp->Lrecl; - lvl = tdp->Level; + Topt = tdp->GetTopt(); + Db = (char*)tdp->GetDB(); } // end of TDBJCL constructor /***********************************************************************/ @@ -1868,8 +1864,7 @@ TDBJCL::TDBJCL(PJDEF tdp) : TDBCAT(tdp) /***********************************************************************/ PQRYRES TDBJCL::GetResult(PGLOBAL g) { - return JSONColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, Objn, - Pretty, Lrecl, lvl, false); + return JSONColumns(g, Db, Topt, false); } // end of GetResult /* --------------------------- End of json --------------------------- */ diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index 4e5f84b1190..4505d30a21c 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -36,8 +36,7 @@ class JSONDEF : public DOSDEF { /* Table description */ friend class TDBJSON; friend class TDBJSN; friend class TDBJCL; - friend PQRYRES JSONColumns(PGLOBAL, char *, const char *, char *, - int, int, int, bool); + friend PQRYRES JSONColumns(PGLOBAL, char*, PTOS, bool); public: // Constructor JSONDEF(void); @@ -226,11 +225,6 @@ class TDBJCL : public TDBCAT { virtual PQRYRES GetResult(PGLOBAL g); // Members -//char *Dp; - const char *Fn; - char *Objn; - int Pretty; - int Lrecl; - int lvl; + PTOS Topt; + char *Db; }; // end of class TDBJCL - diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 46f762efc35..26e0f7630d6 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -110,14 +110,14 @@ typedef struct LVL { /* XMLColumns: construct the result blocks containing the description */ /* of all the columns of a table contained inside an XML file. */ /***********************************************************************/ -PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) +PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) { static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_SHORT, TYPE_SHORT, TYPE_STRING}; static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC, FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT}; static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; - char *op, colname[65], fmt[129], buf[512]; + char *fn, *op, colname[65], fmt[129], buf[512]; int i, j, lvl, n = 0; int ncol = sizeof(buftyp) / sizeof(int); bool ok = true; @@ -138,21 +138,23 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info) /*********************************************************************/ /* Open the input file. */ /*********************************************************************/ - if (!topt->filename) { + if (!(fn = GetStringTableOption(g, topt, "Filename", NULL))) { strcpy(g->Message, MSG(MISSING_FNAME)); return NULL; - } else - lvl = atoi(GetListOption(g, "Level", topt->oplist, "0")); + } else { + lvl = GetIntegerTableOption(g, topt, "Level", 0); + lvl = (lvl < 0) ? 0 : (lvl > 16) ? 16 : lvl; + } // endif fn if (trace) htrc("File %s lvl=%d\n", topt->filename, lvl); tdp = new(g) XMLDEF; - tdp->Database = dp; - tdp->Fn = (char*)topt->filename; + tdp->Fn = fn; + tdp->Database = SetPath(g, db); tdp->Tabname = tab; - if (!(op = GetListOption(g, "Xmlsup", topt->oplist, NULL))) + if (!(op = GetStringTableOption(g, topt, "Xmlsup", NULL))) #if defined(WIN32) tdp->Usedom = true; #else // !WIN32 @@ -432,7 +434,7 @@ XMLDEF::XMLDEF(void) /***********************************************************************/ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { - char *defrow, *defcol, buf[10]; + char *defrow, *defcol, buf[10]; Fn = GetStringCatInfo(g, "Filename", NULL); Encoding = GetStringCatInfo(g, "Encoding", "UTF-8"); @@ -447,7 +449,7 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) return true; } // endif flag - defrow = defcol = ""; + defrow = defcol = NULL; GetCharCatInfo("Coltype", "", buf, sizeof(buf)); switch (toupper(*buf)) { @@ -480,12 +482,12 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Tabname = GetStringCatInfo(g, "Tabname", Tabname); Rowname = GetStringCatInfo(g, "Rownode", defrow); Colname = GetStringCatInfo(g, "Colnode", defcol); - Mulnode = GetStringCatInfo(g, "Mulnode", ""); - XmlDB = GetStringCatInfo(g, "XmlDB", ""); - Nslist = GetStringCatInfo(g, "Nslist", ""); - DefNs = GetStringCatInfo(g, "DefNs", ""); + Mulnode = GetStringCatInfo(g, "Mulnode", NULL); + XmlDB = GetStringCatInfo(g, "XmlDB", NULL); + Nslist = GetStringCatInfo(g, "Nslist", NULL); + DefNs = GetStringCatInfo(g, "DefNs", NULL); Limit = GetIntCatInfo("Limit", 10); - Xpand = (GetIntCatInfo("Expand", 0) != 0); + Xpand = GetBoolCatInfo("Expand", false); Header = GetIntCatInfo("Header", 0); GetCharCatInfo("Xmlsup", "*", buf, sizeof(buf)); @@ -501,8 +503,8 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Usedom = (toupper(*buf) == 'M' || toupper(*buf) == 'D'); // Get eventual table node attribute - Attrib = GetStringCatInfo(g, "Attribute", ""); - Hdattr = GetStringCatInfo(g, "HeadAttr", ""); + Attrib = GetStringCatInfo(g, "Attribute", NULL); + Hdattr = GetStringCatInfo(g, "HeadAttr", NULL); return false; } // end of DefineAM @@ -543,14 +545,14 @@ TDBXML::TDBXML(PXMLDEF tdp) : TDBASE(tdp) Xfile = tdp->Fn; Enc = tdp->Encoding; Tabname = tdp->Tabname; - Rowname = (tdp->Rowname && *tdp->Rowname) ? tdp->Rowname : NULL; - Colname = (tdp->Colname && *tdp->Colname) ? tdp->Colname : NULL; - Mulnode = (tdp->Mulnode && *tdp->Mulnode) ? tdp->Mulnode : NULL; - XmlDB = (tdp->XmlDB && *tdp->XmlDB) ? tdp->XmlDB : NULL; - Nslist = (tdp->Nslist && *tdp->Nslist) ? tdp->Nslist : NULL; - DefNs = (tdp->DefNs && *tdp->DefNs) ? tdp->DefNs : NULL; - Attrib = (tdp->Attrib && *tdp->Attrib) ? tdp->Attrib : NULL; - Hdattr = (tdp->Hdattr && *tdp->Hdattr) ? tdp->Hdattr : NULL; + Rowname = (tdp->Rowname) ? tdp->Rowname : NULL; + Colname = (tdp->Colname) ? tdp->Colname : NULL; + Mulnode = (tdp->Mulnode) ? tdp->Mulnode : NULL; + XmlDB = (tdp->XmlDB) ? tdp->XmlDB : NULL; + Nslist = (tdp->Nslist) ? tdp->Nslist : NULL; + DefNs = (tdp->DefNs) ? tdp->DefNs : NULL; + Attrib = (tdp->Attrib) ? tdp->Attrib : NULL; + Hdattr = (tdp->Hdattr) ? tdp->Hdattr : NULL; Coltype = tdp->Coltype; Limit = tdp->Limit; Xpand = tdp->Xpand; @@ -1015,7 +1017,7 @@ int TDBXML::GetMaxSize(PGLOBAL g) else MaxSize = 10; - } // endif MaxSize + } // endif MaxSize return MaxSize; } // end of GetMaxSize @@ -1256,7 +1258,7 @@ void TDBXML::CloseDB(PGLOBAL g) { if (Docp) { if (Changed) { - char filename[_MAX_PATH]; + char filename[_MAX_PATH]; // We used the file name relative to recorded datapath PlugSetPath(filename, Xfile, GetPath()); @@ -1660,7 +1662,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) /*********************************************************************/ /* Null values are represented by no node. */ /*********************************************************************/ - if (Value->IsNull()) + if (Value->IsNull()) return; /*********************************************************************/ @@ -2160,7 +2162,7 @@ void XPOSCOL::WriteColumn(PGLOBAL g) TDBXCT::TDBXCT(PXMLDEF tdp) : TDBCAT(tdp) { Topt = tdp->GetTopt(); - Dp = tdp->GetPath(); + Db = (char*)tdp->GetDB(); Tabn = tdp->Tabname; } // end of TDBXCT constructor @@ -2169,7 +2171,7 @@ TDBXCT::TDBXCT(PXMLDEF tdp) : TDBCAT(tdp) /***********************************************************************/ PQRYRES TDBXCT::GetResult(PGLOBAL g) { - return XMLColumns(g, Dp, Tabn, Topt, false); + return XMLColumns(g, Db, Tabn, Topt, false); } // end of GetResult /* ------------------------ End of Tabxml ---------------------------- */ diff --git a/storage/connect/tabxml.h b/storage/connect/tabxml.h index 4eae5c082c1..7ba3166881d 100644 --- a/storage/connect/tabxml.h +++ b/storage/connect/tabxml.h @@ -1,7 +1,7 @@ /*************** Tabxml H Declares Source Code File (.H) ***************/ /* Name: TABXML.H Version 1.6 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2007-2013 */ +/* (C) Copyright to the author Olivier BERTRAND 2007-2015 */ /* */ /* This file contains the XML table classes declares. */ /***********************************************************************/ @@ -255,8 +255,7 @@ class TDBXCT : public TDBCAT { // Members PTOS Topt; - char *Dp; -//const char *Fn; + char *Db; char *Tabn; }; // end of class TDBXCT -- cgit v1.2.1 From 70bc0a3ef40b1b9348750c12ca5df8f0863b7cfd Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 26 May 2015 23:56:00 +0300 Subject: Fixes MDEV-7658: MDEV-7026 fix reintroduces MDEV-6615 on AArch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an addendum to the fix for MDEV-7026. The ARM memory model is similar to that of PowerPC and thus needs the same semantics with respect to memory barriers. That is, os_atomic_test_and_set_*_release() must be a store with a release barrier followed by a full barrier. Unlike x86 using __sync_lock_test_and_set() which is implemented as “exclusive load with acquire barriers + exclusive store” is insufficient in contexts where os_atomic_test_and_set_*_release() macros are used. --- storage/innobase/include/os0sync.h | 2 +- storage/xtradb/include/os0sync.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h index 6f090c4b1b4..7fd1fde5e76 100644 --- a/storage/innobase/include/os0sync.h +++ b/storage/innobase/include/os0sync.h @@ -324,7 +324,7 @@ amount of increment. */ /**********************************************************//** Returns the old value of *ptr, atomically sets *ptr to new_val */ -#ifdef __powerpc__ +#if defined(__powerpc__) || defined(__aarch64__) /* os_atomic_test_and_set_byte_release() should imply a release barrier before setting, and a full barrier after. But __sync_lock_test_and_set() is only diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h index 48b477d45a9..f0bdc76e0c9 100644 --- a/storage/xtradb/include/os0sync.h +++ b/storage/xtradb/include/os0sync.h @@ -331,7 +331,7 @@ amount of increment. */ /**********************************************************//** Returns the old value of *ptr, atomically sets *ptr to new_val */ -#ifdef __powerpc__ +#if defined(__powerpc__) || defined(__aarch64__) /* os_atomic_test_and_set_byte_release() should imply a release barrier before setting, and a full barrier after. But __sync_lock_test_and_set() is only -- cgit v1.2.1 From b6a56370d6e833f8033169ebb4e91cdce4d911aa Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 27 May 2015 16:23:38 +0200 Subject: Change all preprocessor compiler directives to use __WIN__ as the mean of specifying Windows or not Windows compile. This is what MariaDB does. modified: storage/connect/array.cpp modified: storage/connect/blkfil.cpp modified: storage/connect/block.h modified: storage/connect/colblk.cpp modified: storage/connect/domdoc.cpp modified: storage/connect/filamap.cpp modified: storage/connect/filamdbf.cpp modified: storage/connect/filamfix.cpp modified: storage/connect/filamtxt.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/filamzip.cpp modified: storage/connect/filter.cpp modified: storage/connect/filter.h modified: storage/connect/fmdlex.c modified: storage/connect/global.h modified: storage/connect/ha_connect.cc modified: storage/connect/json.cpp modified: storage/connect/macutil.cpp modified: storage/connect/macutil.h modified: storage/connect/maputil.cpp modified: storage/connect/mycat.cc modified: storage/connect/myconn.cpp modified: storage/connect/myconn.h modified: storage/connect/myutil.cpp modified: storage/connect/odbconn.cpp modified: storage/connect/odbconn.h modified: storage/connect/os.h modified: storage/connect/osutil.c modified: storage/connect/plgdbsem.h modified: storage/connect/plgdbutl.cpp modified: storage/connect/plugutil.c modified: storage/connect/rcmsg.c modified: storage/connect/reldef.cpp modified: storage/connect/reldef.h modified: storage/connect/tabdos.cpp modified: storage/connect/tabfix.cpp modified: storage/connect/tabfmt.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/tabmac.cpp modified: storage/connect/tabmac.h modified: storage/connect/tabmul.cpp modified: storage/connect/tabmul.h modified: storage/connect/tabmysql.cpp modified: storage/connect/taboccur.cpp modified: storage/connect/tabodbc.cpp modified: storage/connect/tabpivot.cpp modified: storage/connect/tabsys.cpp modified: storage/connect/tabtbl.cpp modified: storage/connect/tabutil.cpp modified: storage/connect/tabvct.cpp modified: storage/connect/tabwmi.cpp modified: storage/connect/tabxcl.cpp modified: storage/connect/tabxml.cpp modified: storage/connect/valblk.cpp modified: storage/connect/value.cpp modified: storage/connect/xindex.cpp modified: storage/connect/xindex.h --- storage/connect/array.cpp | 6 +- storage/connect/blkfil.cpp | 6 +- storage/connect/block.h | 6 +- storage/connect/colblk.cpp | 4 +- storage/connect/domdoc.cpp | 2 +- storage/connect/filamap.cpp | 16 ++--- storage/connect/filamdbf.cpp | 10 ++-- storage/connect/filamfix.cpp | 44 +++++++------- storage/connect/filamtxt.cpp | 46 +++++++------- storage/connect/filamvct.cpp | 74 +++++++++++------------ storage/connect/filamzip.cpp | 16 ++--- storage/connect/filter.cpp | 6 +- storage/connect/filter.h | 2 +- storage/connect/fmdlex.c | 5 +- storage/connect/global.h | 18 +++--- storage/connect/ha_connect.cc | 60 +++++++++---------- storage/connect/json.cpp | 2 +- storage/connect/macutil.cpp | 8 +-- storage/connect/macutil.h | 8 +-- storage/connect/maputil.cpp | 2 +- storage/connect/mycat.cc | 46 +++++++------- storage/connect/myconn.cpp | 12 ++-- storage/connect/myconn.h | 12 ++-- storage/connect/myutil.cpp | 6 +- storage/connect/odbconn.cpp | 16 ++--- storage/connect/odbconn.h | 4 +- storage/connect/os.h | 10 ++-- storage/connect/osutil.c | 2 +- storage/connect/plgdbsem.h | 6 +- storage/connect/plgdbutl.cpp | 46 +++++++------- storage/connect/plugutil.c | 26 ++++---- storage/connect/rcmsg.c | 136 +++++++++++++++++++++--------------------- storage/connect/reldef.cpp | 12 ++-- storage/connect/reldef.h | 6 +- storage/connect/tabdos.cpp | 18 +++--- storage/connect/tabfix.cpp | 6 +- storage/connect/tabfmt.cpp | 12 ++-- storage/connect/tabjson.cpp | 6 +- storage/connect/tabmac.cpp | 8 +-- storage/connect/tabmac.h | 8 +-- storage/connect/tabmul.cpp | 78 ++++++++++++------------ storage/connect/tabmul.h | 18 +++--- storage/connect/tabmysql.cpp | 6 +- storage/connect/taboccur.cpp | 2 +- storage/connect/tabodbc.cpp | 2 +- storage/connect/tabpivot.cpp | 2 +- storage/connect/tabsys.cpp | 20 +++---- storage/connect/tabtbl.cpp | 8 +-- storage/connect/tabutil.cpp | 2 +- storage/connect/tabvct.cpp | 6 +- storage/connect/tabwmi.cpp | 6 +- storage/connect/tabxcl.cpp | 2 +- storage/connect/tabxml.cpp | 28 ++++----- storage/connect/valblk.cpp | 2 +- storage/connect/value.cpp | 14 ++--- storage/connect/xindex.cpp | 28 ++++----- storage/connect/xindex.h | 2 +- 57 files changed, 483 insertions(+), 482 deletions(-) diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index 0e8829d66a6..193514eeb99 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -19,14 +19,14 @@ #include "sql_class.h" //#include "sql_time.h" -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include #include #include #include // for uintprt_h -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include required application header files */ diff --git a/storage/connect/blkfil.cpp b/storage/connect/blkfil.cpp index c6fb528aa5f..1f5a1a27ae5 100644 --- a/storage/connect/blkfil.cpp +++ b/storage/connect/blkfil.cpp @@ -20,13 +20,13 @@ #include "sql_class.h" //#include "sql_time.h" -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include #include #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ diff --git a/storage/connect/block.h b/storage/connect/block.h index 40529ffc81f..69cec39e8a5 100644 --- a/storage/connect/block.h +++ b/storage/connect/block.h @@ -24,11 +24,11 @@ #if !defined(BLOCK_DEFINED) #define BLOCK_DEFINED -#if defined(WIN32) && !defined(NOEX) +#if defined(__WIN__) && !defined(NOEX) #define DllExport __declspec( dllexport ) -#else // !WIN32 +#else // !__WIN__ #define DllExport -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Definition of class BLOCK with its method function new. */ diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index 7166af8027b..80b405be041 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -297,9 +297,9 @@ FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) Buf_Type = TYPE_STRING; *Format.Type = 'C'; Format.Length = Long; -#if defined(WIN32) +#if defined(__WIN__) Format.Prec = 1; // Case insensitive -#endif // WIN32 +#endif // __WIN__ Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && To_Tdb->GetAmType() != TYPE_AM_PLG && To_Tdb->GetAmType() != TYPE_AM_PLM); diff --git a/storage/connect/domdoc.cpp b/storage/connect/domdoc.cpp index 9e518775c0f..64a0a172956 100644 --- a/storage/connect/domdoc.cpp +++ b/storage/connect/domdoc.cpp @@ -4,7 +4,7 @@ /******************************************************************/ #include "my_global.h" #include -#if defined(WIN32) +#if defined(__WIN__) //#include #if defined(MSX2) #import "msxml2.dll" //Does not exist on Vista diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp index cac34827b7a..5cf9a4d945c 100644 --- a/storage/connect/filamap.cpp +++ b/storage/connect/filamap.cpp @@ -17,12 +17,12 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -30,7 +30,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -191,11 +191,11 @@ bool MAPFAM::OpenTableFile(PGLOBAL g) return true; } // endif Memory -#if defined(WIN32) +#if defined(__WIN__) if (mode != MODE_DELETE) { -#else // !WIN32 +#else // !__WIN__ if (mode == MODE_READ) { -#endif // !WIN32 +#endif // !__WIN__ CloseFileHandle(hFile); // Not used anymore hFile = INVALID_HANDLE_VALUE; // For Fblock } // endif Mode @@ -452,7 +452,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ n = Tpos - Memory; -#if defined(WIN32) +#if defined(__WIN__) DWORD drc = SetFilePointer(fp->Handle, n, NULL, FILE_BEGIN); if (drc == 0xFFFFFFFF) { @@ -482,7 +482,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) #endif // UNIX } // endif Abort -#if defined(WIN32) +#if defined(__WIN__) CloseHandle(fp->Handle); #else // UNIX close(fp->Handle); diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 4d66c2ab2ff..8afda723578 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -22,12 +22,12 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include //#include //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -35,7 +35,7 @@ //#include #endif // !UNIX //#include -#endif // !WIN32 +#endif // !__WIN__ #include #include #include @@ -528,7 +528,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) To_Buf = (char*)PlugSubAlloc(g, NULL, Buflen); if (mode == MODE_INSERT) { -#if defined(WIN32) +#if defined(__WIN__) /************************************************************************/ /* Now we can revert to binary mode in particular because the eventual */ /* writing of a new header must be done in binary mode to avoid */ @@ -538,7 +538,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) sprintf(g->Message, MSG(BIN_MODE_FAIL), strerror(errno)); return true; } // endif setmode -#endif // WIN32 +#endif // __WIN__ /************************************************************************/ /* If this is a new file, the header must be generated. */ diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index c352db47044..cd25429318a 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -17,7 +17,7 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include @@ -25,7 +25,7 @@ #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -34,7 +34,7 @@ #endif // !UNIX #include #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -338,10 +338,10 @@ int FIXFAM::ReadBuffer(PGLOBAL g) } else if (feof(Stream)) { rc = RC_EF; } else { -#if defined(UNIX) - sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); -#else +#if defined(__WIN__) sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); +#else + sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); #endif if (trace) @@ -678,7 +678,7 @@ BGXFAM::BGXFAM(PBGXFAM txfp) : FIXFAM(txfp) /***********************************************************************/ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) { -#if defined(WIN32) +#if defined(__WIN__) char buf[256]; DWORD drc; LARGE_INTEGER of; @@ -694,14 +694,14 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) sprintf(g->Message, MSG(SFP_ERROR), buf); return true; } // endif -#else // !WIN32 +#else // !__WIN__ if (lseek64(h, pos, org) < 0) { // sprintf(g->Message, MSG(ERROR_IN_LSK), errno); sprintf(g->Message, "lseek64: %s", strerror(errno)); printf("%s\n", g->Message); return true; } // endif -#endif // !WIN32 +#endif // !__WIN__ return false; } // end of BigSeek @@ -714,7 +714,7 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)), { int rc; -#if defined(WIN32) +#if defined(__WIN__) DWORD nbr, drc, len = (DWORD)req; bool brc = ReadFile(h, inbuf, len, &nbr, NULL); @@ -736,12 +736,12 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)), rc = -1; } else rc = (int)nbr; -#else // !WIN32 +#else // !__WIN__ size_t len = (size_t)req; ssize_t nbr = read(h, inbuf, len); rc = (int)nbr; -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of BigRead @@ -753,7 +753,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) { bool rc = false; -#if defined(WIN32) +#if defined(__WIN__) DWORD nbw, drc, len = (DWORD)req; bool brc = WriteFile(h, inbuf, len, &nbw, NULL); @@ -780,7 +780,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif brc || nbw -#else // !WIN32 +#else // !__WIN__ size_t len = (size_t)req; ssize_t nbw = write(h, inbuf, len); @@ -795,7 +795,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif nbr -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of BigWrite @@ -830,7 +830,7 @@ bool BGXFAM::OpenTableFile(PGLOBAL g) if (trace) htrc("OpenTableFile: filename=%s mode=%d\n", filename, mode); -#if defined(WIN32) +#if defined(__WIN__) DWORD rc, access, creation, share = 0; /*********************************************************************/ @@ -987,7 +987,7 @@ int BGXFAM::Cardinality(PGLOBAL g) PlugSetPath(filename, To_File, Tdbp->GetPath()); -#if defined(WIN32) // OB +#if defined(__WIN__) // OB LARGE_INTEGER len; DWORD rc = 0; @@ -1346,7 +1346,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ /* Remove extra records. */ /*****************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) if (BigSeek(g, Hfile, (BIGINT)Tpos * (BIGINT)Lrecl)) return RC_FX; @@ -1356,12 +1356,12 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) sprintf(g->Message, MSG(SETEOF_ERROR), drc); return RC_FX; } // endif error -#else // !WIN32 +#else // !__WIN__ if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) { sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno)); return RC_FX; } // endif -#endif // !WIN32 +#endif // !__WIN__ } // endif UseTemp @@ -1386,7 +1386,7 @@ bool BGXFAM::OpenTempFile(PGLOBAL g) strcat(PlugRemoveType(tempname, tempname), ".t"); remove(tempname); // Be sure it does not exist yet -#if defined(WIN32) +#if defined(__WIN__) Tfile = CreateFile(tempname, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); @@ -1526,7 +1526,7 @@ void BGXFAM::CloseTableFile(PGLOBAL g, bool abort) void BGXFAM::Rewind(void) { #if 0 // This is probably unuseful because file is accessed directly -#if defined(WIN32) //OB +#if defined(__WIN__) //OB SetFilePointer(Hfile, 0, NULL, FILE_BEGIN); #else // UNIX lseek64(Hfile, 0, SEEK_SET); diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index cce9cec56bd..e53cdcd9ba9 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -17,7 +17,7 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include @@ -25,7 +25,7 @@ #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) || defined(UNIV_LINUX) #include #include @@ -36,7 +36,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -716,10 +716,10 @@ int DOSFAM::SkipRecord(PGLOBAL g, bool header) if (feof(Stream)) return RC_EF; -#if defined(UNIX) || defined(UNIV_LINUX) - sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(0)); -#else +#if defined(__WIN__) sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); +#else + sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(0)); #endif return RC_FX; } // endif fgets @@ -799,12 +799,12 @@ int DOSFAM::ReadBuffer(PGLOBAL g) if (trace > 1) htrc(" Read: To_Buf=%p p=%c\n", To_Buf, To_Buf, p); -#if defined(UNIX) - if (true) { - // Data files can be imported from Windows (having CRLF) -#else +#if defined(__WIN__) if (Bin) { // Data file is read in binary so CRLF remains +#else + if (true) { + // Data files can be imported from Windows (having CRLF) #endif if (*p == '\n' || *p == '\r') { // is this enough for Unix ??? @@ -833,10 +833,10 @@ int DOSFAM::ReadBuffer(PGLOBAL g) } else if (feof(Stream)) { rc = RC_EF; } else { -#if defined(UNIX) - sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(0)); -#else +#if defined(__WIN__) sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); +#else + sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(0)); #endif if (trace) @@ -1028,15 +1028,15 @@ int DOSFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ /* Remove extra records. */ /*****************************************************************/ -#if defined(UNIX) - if (ftruncate(h, (off_t)Tpos)) { - sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno)); +#if defined(__WIN__) + if (chsize(h, Tpos)) { + sprintf(g->Message, MSG(CHSIZE_ERROR), strerror(errno)); close(h); return RC_FX; } // endif #else - if (chsize(h, Tpos)) { - sprintf(g->Message, MSG(CHSIZE_ERROR), strerror(errno)); + if (ftruncate(h, (off_t)Tpos)) { + sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno)); close(h); return RC_FX; } // endif @@ -1466,10 +1466,10 @@ int BLKFAM::ReadBuffer(PGLOBAL g) } else if (feof(Stream)) { rc = RC_EF; } else { -#if defined(UNIX) - sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); -#else +#if defined(__WIN__) sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); +#else + sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); #endif if (trace) @@ -1551,11 +1551,11 @@ int BLKFAM::WriteBuffer(PGLOBAL g) Spos = GetNextPos(); // New start position // Prepare the output buffer -#if defined(WIN32) +#if defined(__WIN__) crlf = "\r\n"; #else crlf = "\n"; -#endif // WIN32 +#endif // __WIN__ strcat(strcpy(OutBuf, Tdbp->GetLine()), crlf); len = strlen(OutBuf); } else { diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 60a8875e015..fdc5433f4a4 100755 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -21,7 +21,7 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) @@ -29,7 +29,7 @@ #endif // __BORLAND__ //#include #include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -40,7 +40,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -49,7 +49,7 @@ /* tabdos.h is header containing the TABDOS class declarations. */ /***********************************************************************/ #include "global.h" -#include "osutil.h" // Unuseful for WIN32 +#include "osutil.h" // Unuseful for WINDOWS #include "plgdbsem.h" #include "valblk.h" #include "filamfix.h" @@ -376,11 +376,11 @@ bool VCTFAM::MakeEmptyFile(PGLOBAL g, char *fn) int h, n; PlugSetPath(filename, fn, Tdbp->GetPath()); -#if defined(WIN32) +#if defined(__WIN__) h= global_open(g, MSGID_OPEN_EMPTY_FILE, filename, _O_CREAT | _O_WRONLY, S_IREAD | S_IWRITE); -#else // !WIN32 +#else // !__WIN__ h= global_open(g, MSGID_OPEN_EMPTY_FILE, filename, O_CREAT | O_WRONLY, S_IREAD | S_IWRITE); -#endif // !WIN32 +#endif // !__WIN__ if (h == -1) return true; @@ -1669,7 +1669,7 @@ int VCMFAM::DeleteRecords(PGLOBAL g, int irc) // Remove extra blocks n = Block * Blksize; -#if defined(WIN32) +#if defined(__WIN__) DWORD drc = SetFilePointer(fp->Handle, n, NULL, FILE_BEGIN); if (drc == 0xFFFFFFFF) { @@ -2574,11 +2574,11 @@ bool VECFAM::ReadBlock(PGLOBAL g, PVCTCOL colp) char fn[_MAX_PATH]; sprintf(fn, Colfn, colp->Index); -#if defined(WIN32) +#if defined(__WIN__) if (feof(Streams[i])) -#else // !WIN32 +#else // !__WIN__ if (errno == NO_ERROR) -#endif // !WIN32 +#endif // !__WIN__ sprintf(g->Message, MSG(BAD_READ_NUMBER), (int) n, fn); else sprintf(g->Message, MSG(READ_ERROR), @@ -2969,7 +2969,7 @@ int VMPFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ n = Tpos * Clens[i]; -#if defined(WIN32) +#if defined(__WIN__) DWORD drc = SetFilePointer(fp->Handle, n, NULL, FILE_BEGIN); if (drc == 0xFFFFFFFF) { @@ -3049,7 +3049,7 @@ BGVFAM::BGVFAM(PBGVFAM txfp) : VCTFAM(txfp) /***********************************************************************/ bool BGVFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b) { -#if defined(WIN32) +#if defined(__WIN__) char buf[256]; DWORD drc, m = (b) ? FILE_END : FILE_BEGIN; LARGE_INTEGER of; @@ -3065,12 +3065,12 @@ bool BGVFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b) sprintf(g->Message, MSG(SFP_ERROR), buf); return true; } // endif -#else // !WIN32 +#else // !__WIN__ if (lseek64(h, pos, (b) ? SEEK_END : SEEK_SET) < 0) { sprintf(g->Message, MSG(ERROR_IN_LSK), errno); return true; } // endif -#endif // !WIN32 +#endif // !__WIN__ return false; } // end of BigSeek @@ -3082,7 +3082,7 @@ bool BGVFAM::BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req) { bool rc = false; -#if defined(WIN32) +#if defined(__WIN__) DWORD nbr, drc, len = (DWORD)req; bool brc = ReadFile(h, inbuf, len, &nbr, NULL); @@ -3108,7 +3108,7 @@ bool BGVFAM::BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif brc || nbr -#else // !WIN32 +#else // !__WIN__ size_t len = (size_t)req; ssize_t nbr = read(h, inbuf, len); @@ -3123,7 +3123,7 @@ bool BGVFAM::BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif nbr -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of BigRead @@ -3135,7 +3135,7 @@ bool BGVFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) { bool rc = false; -#if defined(WIN32) +#if defined(__WIN__) DWORD nbw, drc, len = (DWORD)req; bool brc = WriteFile(h, inbuf, len, &nbw, NULL); @@ -3162,7 +3162,7 @@ bool BGVFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif brc || nbw -#else // !WIN32 +#else // !__WIN__ size_t len = (size_t)req; ssize_t nbw = write(h, inbuf, len); @@ -3177,7 +3177,7 @@ bool BGVFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif nbr -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of BigWrite @@ -3203,7 +3203,7 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) if (Header == 2) strcat(PlugRemoveType(filename, filename), ".blk"); -#if defined(WIN32) +#if defined(__WIN__) LARGE_INTEGER len; h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -3215,11 +3215,11 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) } // endif h if (h == INVALID_HANDLE_VALUE || !len.QuadPart) { -#else // !WIN32 +#else // !__WIN__ h = open64(filename, O_RDONLY, 0); if (h == INVALID_HANDLE_VALUE || !_filelength(h)) { -#endif // !WIN32 +#endif // !__WIN__ // Consider this is a void table if (trace) htrc("Void table h=%d\n", h); @@ -3280,17 +3280,17 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g) strcat(PlugRemoveType(filename, filename), ".blk"); if (h == INVALID_HANDLE_VALUE) { -#if defined(WIN32) +#if defined(__WIN__) DWORD creation = (b) ? OPEN_EXISTING : TRUNCATE_EXISTING; h = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, creation, FILE_ATTRIBUTE_NORMAL, NULL); -#else // !WIN32 +#else // !__WIN__ int oflag = (b) ? O_RDWR : O_RDWR | O_TRUNC; h = open64(filename, oflag, 0); -#endif // !WIN32 +#endif // !__WIN__ if (h == INVALID_HANDLE_VALUE) { sprintf(g->Message, "Error opening header file %s", filename); @@ -3328,7 +3328,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn) PlugSetPath(filename, fn, Tdbp->GetPath()); -#if defined(WIN32) +#if defined(__WIN__) char *p; DWORD rc; bool brc; @@ -3380,7 +3380,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn) CloseHandle(h); return true; -#else // !WIN32 +#else // !__WIN__ int h; BIGINT pos; @@ -3409,7 +3409,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn) sprintf(g->Message, MSG(MAKE_EMPTY_FILE), To_File, strerror(errno)); close(h); return true; -#endif // !WIN32 +#endif // !__WIN__ } // end of MakeEmptyFile /***********************************************************************/ @@ -3440,7 +3440,7 @@ bool BGVFAM::OpenTableFile(PGLOBAL g) htrc("OpenTableFile: filename=%s mode=%d Last=%d\n", filename, mode, Last); -#if defined(WIN32) +#if defined(__WIN__) DWORD access, creation, share = 0, rc = 0; /*********************************************************************/ @@ -3766,7 +3766,7 @@ int BGVFAM::WriteBuffer(PGLOBAL g) if (!Closing && !MaxBlk) { // Close the VCT file and reopen it in mode Insert -//#if defined(WIN32) //OB +//#if defined(__WIN__) //OB // CloseHandle(Hfile); //#else // UNIX // close(Hfile); @@ -3893,7 +3893,7 @@ int BGVFAM::DeleteRecords(PGLOBAL g, int irc) /***************************************************************/ /* Remove extra records. */ /***************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) BIGINT pos = (BIGINT)Block * (BIGINT)Blksize; if (BigSeek(g, Hfile, pos)) @@ -3905,12 +3905,12 @@ int BGVFAM::DeleteRecords(PGLOBAL g, int irc) sprintf(g->Message, MSG(SETEOF_ERROR), drc); return RC_FX; } // endif error -#else // !WIN32 +#else // !__WIN__ if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) { sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno)); return RC_FX; } // endif -#endif // !WIN32 +#endif // !__WIN__ } else // MaxBlk // Clean the unused space in the file, this is required when // inserting again with a partial column list. @@ -3947,7 +3947,7 @@ bool BGVFAM::OpenTempFile(PGLOBAL g) else if (MakeEmptyFile(g, tempname)) return true; -#if defined(WIN32) +#if defined(__WIN__) DWORD access = (MaxBlk) ? OPEN_EXISTING : CREATE_NEW; Tfile = CreateFile(tempname, GENERIC_WRITE, 0, NULL, @@ -4218,7 +4218,7 @@ void BGVFAM::Rewind(void) CurNum = Nrec - 1; #if 0 // This is probably unuseful as the file is directly accessed -#if defined(WIN32) //OB +#if defined(__WIN__) //OB SetFilePointer(Hfile, 0, NULL, FILE_BEGIN); #else // UNIX lseek64(Hfile, 0, SEEK_SET); diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index 54af93e11fa..56faa555069 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -17,21 +17,21 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) #define __MFC_COMPAT__ // To define min/max as macro #endif //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #else // !UNIX #include #endif #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -89,11 +89,11 @@ int ZIPFAM::Zerror(PGLOBAL g) strcpy(g->Message, gzerror(Zfile, &errnum)); if (errnum == Z_ERRNO) -#if defined(WIN32) +#if defined(__WIN__) sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(NULL)); -#else // !WIN32 +#else // !__WIN__ sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); -#endif // !WIN32 +#endif // !__WIN__ return (errnum == Z_STREAM_END) ? RC_EF : RC_FX; } // end of Zerror @@ -764,9 +764,9 @@ bool ZIXFAM::AllocateBuffer(PGLOBAL g) if (Tdbp->GetFtype() < 2) // if not binary, the file is physically a text file for (int len = Lrecl; len <= Buflen; len += Lrecl) { -#if defined(WIN32) +#if defined(__WIN__) To_Buf[len - 2] = '\r'; -#endif // WIN32 +#endif // __WIN__ To_Buf[len - 1] = '\n'; } // endfor len diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index 949d49c2943..262d6b58a70 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -13,13 +13,13 @@ #include "sql_class.h" //#include "sql_time.h" -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include #include #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ diff --git a/storage/connect/filter.h b/storage/connect/filter.h index ab7c2139b68..15730e2cc44 100644 --- a/storage/connect/filter.h +++ b/storage/connect/filter.h @@ -106,7 +106,7 @@ class FILTERX : public FILTER { // Fake operator new used to change a filter into a derived filter void * operator new(size_t, PFIL filp) {return filp;} -#if defined(WIN32) +#if defined(__WIN__) // Avoid warning C4291 by defining a matching dummy delete operator void operator delete(void *, PFIL) {} #else diff --git a/storage/connect/fmdlex.c b/storage/connect/fmdlex.c index a72a2b9b31e..22c3a1e79ad 100644 --- a/storage/connect/fmdlex.c +++ b/storage/connect/fmdlex.c @@ -20,11 +20,12 @@ */ #define FLEX_SCANNER -#if WIN32 +#ifdef __WIN__ #define __STDC__ 1 +#define isatty _isatty #endif #include -#ifndef WIN32 +#ifndef __WIN__ #include #endif diff --git a/storage/connect/global.h b/storage/connect/global.h index 10564d09815..4d01a3ff05b 100644 --- a/storage/connect/global.h +++ b/storage/connect/global.h @@ -13,11 +13,11 @@ #include /* time_t type declaration */ #include /* Long jump declarations */ -#if defined(WIN32) && !defined(NOEX) +#if defined(__WIN__) && !defined(NOEX) #define DllExport __declspec( dllexport ) -#else // !WIN32 +#else // !__WIN__ #define DllExport -#endif // !WIN32 +#endif // !__WIN__ #if defined(DOMDOC_SUPPORT) || defined(LIBXML2_SUPPORT) #define XML_SUPPORT 1 @@ -42,11 +42,11 @@ #define STEP(I) MSG_##I #endif // !XMSG and !NEWMSG -#if defined(WIN32) +#if defined(__WIN__) #define CRLF 2 -#else // !WIN32 +#else // !__WIN__ #define CRLF 1 -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Define access to the thread based trace value. */ @@ -104,7 +104,7 @@ #define SYS_STAMP "DOSR" #elif defined(WIN) #define SYS_STAMP "WIN1" -#elif defined(WIN32) +#elif defined(__WIN__) #define SYS_STAMP "WIN2" #else #define SYS_STAMP "XXXX" @@ -248,9 +248,9 @@ DllExport char *PlugReadMessage(PGLOBAL, int, char *); #elif defined(NEWMSG) DllExport char *PlugGetMessage(PGLOBAL, int); #endif // XMSG || NEWMSG -#if defined(WIN32) +#if defined(__WIN__) DllExport short GetLineLength(PGLOBAL); // Console line length -#endif // WIN32 +#endif // __WIN__ DllExport PGLOBAL PlugInit(LPCSTR, uint); // Plug global initialization DllExport int PlugExit(PGLOBAL); // Plug global termination DllExport LPSTR PlugRemoveType(LPSTR, LPCSTR); diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index bb7f0b4abcf..da357faa171 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -138,10 +138,10 @@ #include "reldef.h" #include "tabcol.h" #include "xindex.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include "tabwmi.h" -#endif // WIN32 +#endif // __WIN__ #include "connect.h" #include "user_connect.h" #include "ha_connect.h" @@ -170,12 +170,12 @@ extern "C" { char version[]= "Version 1.03.0007 April 30, 2015"; -#if defined(WIN32) +#if defined(__WIN__) char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__; char slash= '\\'; -#else // !WIN32 +#else // !__WIN__ char slash= '/'; -#endif // !WIN32 +#endif // !__WIN__ } // extern "C" #if defined(XMAP) @@ -629,11 +629,11 @@ static int connect_init_func(void *p) } #endif // 0 (LINUX) -#if defined(WIN32) +#if defined(__WIN__) sql_print_information("CONNECT: %s", compver); -#else // !WIN32 +#else // !__WIN__ sql_print_information("CONNECT: %s", version); -#endif // !WIN32 +#endif // !__WIN__ #ifdef LIBXML2_SUPPORT XmlInitParserLib(); @@ -675,9 +675,9 @@ static int connect_done_func(void *) XmlCleanupParserLib(); #endif // LIBXML2_SUPPORT -#if !defined(WIN32) +#if !defined(__WIN__) //PROFILE_End(); Causes signal 11 -#endif // !WIN32 +#endif // !__WIN__ for (pc= user_connect::to_users; pc; pc= pn) { if (pc->g) @@ -744,11 +744,11 @@ ha_connect::ha_connect(handlerton *hton, TABLE_SHARE *table_arg) xp= (table) ? GetUser(ha_thd(), NULL) : NULL; if (xp) xp->SetHandler(this); -#if defined(WIN32) +#if defined(__WIN__) datapath= ".\\"; -#else // !WIN32 +#else // !__WIN__ datapath= "./"; -#endif // !WIN32 +#endif // !__WIN__ tdbp= NULL; sdvalin1= sdvalin2= sdvalin3= sdvalin4= NULL; sdvalout= NULL; @@ -3992,11 +3992,11 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) case TAB_JSON: if (options->filename && *options->filename) { char *s, path[FN_REFLEN], dbpath[FN_REFLEN]; -#if defined(WIN32) +#if defined(__WIN__) s= "\\"; -#else // !WIN32 +#else // !__WIN__ s= "/"; -#endif // !WIN32 +#endif // !__WIN__ strcpy(dbpath, mysql_real_data_home); if (db) @@ -5001,9 +5001,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src; const char *col, *ocl, *rnk, *pic, *fcl, *skc; char *tab, *dsn, *shm, *dpath; -#if defined(WIN32) +#if defined(__WIN__) char *nsp= NULL, *cls= NULL; -#endif // WIN32 +#endif // __WIN__ int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0; int cop __attribute__((unused))= 0, lrecl= 0; #if defined(ODBC_SUPPORT) @@ -5066,10 +5066,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, skc= GetListOption(g, "skipcol", topt->oplist, NULL); rnk= GetListOption(g, "rankcol", topt->oplist, NULL); pwd= GetListOption(g, "password", topt->oplist); -#if defined(WIN32) +#if defined(__WIN__) nsp= GetListOption(g, "namespace", topt->oplist); cls= GetListOption(g, "class", topt->oplist); -#endif // WIN32 +#endif // __WIN__ port= atoi(GetListOption(g, "port", topt->oplist, "0")); #if defined(ODBC_SUPPORT) mxr= atoi(GetListOption(g,"maxres", topt->oplist, "0")); @@ -5226,11 +5226,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, ok= false; break; -#if defined(WIN32) +#if defined(__WIN__) case TAB_WMI: ok= true; break; -#endif // WIN32 +#endif // __WIN__ #if defined(PIVOT_SUPPORT) case TAB_PIVOT: supfnc= FNC_NO; @@ -5343,11 +5343,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_CSV: qrp= CSVColumns(g, dpath, fn, spc, qch, hdr, mxe, fnc == FNC_COL); break; -#if defined(WIN32) +#if defined(__WIN__) case TAB_WMI: qrp= WMIColumns(g, nsp, cls, fnc == FNC_COL); break; -#endif // WIN32 +#endif // __WIN__ case TAB_PRX: case TAB_TBL: case TAB_XCL: @@ -5801,11 +5801,11 @@ int ha_connect::create(const char *name, TABLE *table_arg, // on Windows and libxml2 otherwise switch (*xsup) { case '*': -#if defined(WIN32) +#if defined(__WIN__) dom= true; -#else // !WIN32 +#else // !__WIN__ dom= false; -#endif // !WIN32 +#endif // !__WIN__ break; case 'M': case 'D': @@ -6152,11 +6152,11 @@ bool ha_connect::FileExists(const char *fn, bool bf) NULL, NULL, 0, 0)) return true; -#if defined(WIN32) +#if defined(__WIN__) s= "\\"; -#else // !WIN32 +#else // !__WIN__ s= "/"; -#endif // !WIN32 +#endif // !__WIN__ if (IsPartitioned()) { sprintf(tfn, fn, GetPartName()); diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index 1e597f751ca..3d03bea5d00 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -23,7 +23,7 @@ #define ARGS MY_MIN(24,len-i),s+MY_MAX(i-3,0) -#if defined(WIN32) +#if defined(__WIN__) #define EL "\r\n" #else #define EL "\n" diff --git a/storage/connect/macutil.cpp b/storage/connect/macutil.cpp index 4d3022b91b6..f5d3bb11fe9 100644 --- a/storage/connect/macutil.cpp +++ b/storage/connect/macutil.cpp @@ -2,11 +2,11 @@ /* MACUTIL: Author Olivier Bertrand -- 2008-2012 */ /* From the article and sample code by Khalid Shaikh. */ /***********************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) #include "my_global.h" -#else // !WIN32 -#error This is WIN32 only DLL -#endif // !WIN32 +#else // !__WIN__ +#error This is WINDOWS only DLL +#endif // !__WIN__ #include "global.h" #include "plgdbsem.h" #include "macutil.h" diff --git a/storage/connect/macutil.h b/storage/connect/macutil.h index 8a3e97e12e1..c80bd58e20a 100644 --- a/storage/connect/macutil.h +++ b/storage/connect/macutil.h @@ -1,10 +1,10 @@ // MACUTIL.H Olivier Bertrand 2008-2012 // Get Mac Addresses via GetAdaptersInfo -#if defined(WIN32) +#if defined(__WIN__) #include -#else // !WIN32 -#error This is WIN32 only -#endif // !WIN32 +#else // !__WIN__ +#error This is WINDOWS only +#endif // !__WIN__ #include "block.h" typedef class MACINFO *MACIP; diff --git a/storage/connect/maputil.cpp b/storage/connect/maputil.cpp index 97c638b4254..c4e016f1511 100644 --- a/storage/connect/maputil.cpp +++ b/storage/connect/maputil.cpp @@ -14,7 +14,7 @@ #include "plgdbsem.h" #include "maputil.h" -#ifdef WIN32 +#ifdef __WIN__ /***********************************************************************/ /* In Insert mode, just open the file for append. Otherwise */ /* create the mapping file object. The map handle can be released */ diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 0ef43a245fa..9c72e9cd665 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -30,7 +30,7 @@ /***********************************************************************/ #include -#if defined(WIN32) +#if defined(__WIN__) //#include //#include #elif defined(UNIX) @@ -66,10 +66,10 @@ #include "tabfmt.h" #include "tabvct.h" #include "tabsys.h" -#if defined(WIN32) +#if defined(__WIN__) #include "tabmac.h" #include "tabwmi.h" -#endif // WIN32 +#endif // __WIN__ //#include "tabtbl.h" #include "tabxcl.h" #include "tabtbl.h" @@ -93,9 +93,9 @@ /***********************************************************************/ /* Extern static variables. */ /***********************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) extern "C" HINSTANCE s_hModule; // Saved module handle -#endif // !WIN32 +#endif // !__WIN__ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); @@ -142,7 +142,7 @@ TABTYPE GetTypeID(const char *type) : (!stricmp(type, "MYSQL")) ? TAB_MYSQL : (!stricmp(type, "MYPRX")) ? TAB_MYSQL : (!stricmp(type, "DIR")) ? TAB_DIR -#ifdef WIN32 +#ifdef __WIN__ : (!stricmp(type, "MAC")) ? TAB_MAC : (!stricmp(type, "WMI")) ? TAB_WMI #endif @@ -349,11 +349,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) typedef PQRYRES (__stdcall *XCOLDEF) (PGLOBAL, void*, char*, char*, bool); const char *module, *subtype; char c, soname[_MAX_PATH], getname[40] = "Col"; -#if defined(WIN32) +#if defined(__WIN__) HANDLE hdll; /* Handle to the external DLL */ -#else // !WIN32 +#else // !__WIN__ void *hdll; /* Handle for the loaded shared library */ -#endif // !WIN32 +#endif // !__WIN__ XCOLDEF coldef = NULL; PQRYRES qrp = NULL; @@ -381,7 +381,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) if (!c) break; } // endfor i -#if defined(WIN32) +#if defined(__WIN__) // Load the Dll implementing the table if (!(hdll = LoadLibrary(soname))) { char buf[256]; @@ -401,7 +401,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) FreeLibrary((HMODULE)hdll); return NULL; } // endif coldef -#else // !WIN32 +#else // !__WIN__ const char *error = NULL; // Load the desired shared library @@ -418,7 +418,7 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) dlclose(hdll); return NULL; } // endif coldef -#endif // !WIN32 +#endif // !__WIN__ // Just in case the external Get function does not set error messages sprintf(g->Message, "Error getting column info from %s", subtype); @@ -426,11 +426,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) // Get the table column definition qrp = coldef(g, topt, tab, db, info); -#if defined(WIN32) +#if defined(__WIN__) FreeLibrary((HMODULE)hdll); -#else // !WIN32 +#else // !__WIN__ dlclose(hdll); -#endif // !WIN32 +#endif // !__WIN__ return qrp; } // end of OEMColumns @@ -442,11 +442,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) /***********************************************************************/ CATALOG::CATALOG(void) { -#if defined(WIN32) +#if defined(__WIN__) //DataPath= ".\\"; -#else // !WIN32 +#else // !__WIN__ //DataPath= "./"; -#endif // !WIN32 +#endif // !__WIN__ memset(&Ctb, 0, sizeof(CURTAB)); Cbuf= NULL; Cblen= 0; @@ -489,11 +489,11 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path) } if (*path != '.') { -#if defined(WIN32) +#if defined(__WIN__) char *s= "\\"; -#else // !WIN32 +#else // !__WIN__ char *s= "/"; -#endif // !WIN32 +#endif // !__WIN__ strcat(strcat(strcat(strcpy(buf, "."), s), path), s); } else strcpy(buf, path); @@ -554,10 +554,10 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) #if defined(ODBC_SUPPORT) case TAB_ODBC: tdp= new(g) ODBCDEF; break; #endif // ODBC_SUPPORT -#if defined(WIN32) +#if defined(__WIN__) case TAB_MAC: tdp= new(g) MACDEF; break; case TAB_WMI: tdp= new(g) WMIDEF; break; -#endif // WIN32 +#endif // __WIN__ case TAB_OEM: tdp= new(g) OEMDEF; break; case TAB_TBL: tdp= new(g) TBLDEF; break; case TAB_XCL: tdp= new(g) XCLDEF; break; diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 2b958b512f3..ada0109a820 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -35,11 +35,11 @@ #include "my_sys.h" #include "mysqld_error.h" #endif // !MYSQL_PREPARED_STATEMENTS -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include "osutil.h" -#endif // !WIN32 +#endif // !__WIN__ #include "global.h" #include "plgdbsem.h" @@ -451,15 +451,15 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt); //mysql_options(m_DB, MYSQL_OPT_WRITE_TIMEOUT, ...); -#if defined(WIN32) +#if defined(__WIN__) if (!strcmp(host, ".")) { mysql_options(m_DB, MYSQL_OPT_NAMED_PIPE, NULL); pipe = mysqld_unix_port; } // endif host -#else // !WIN32 +#else // !__WIN__ if (!strcmp(host, "localhost")) pipe = mysqld_unix_port; -#endif // !WIN32 +#endif // !__WIN__ #if 0 if (pwd && !strcmp(pwd, "*")) { diff --git a/storage/connect/myconn.h b/storage/connect/myconn.h index 79b8a43fe5a..fa34edd804c 100644 --- a/storage/connect/myconn.h +++ b/storage/connect/myconn.h @@ -7,24 +7,24 @@ /* DO NOT define DLL_EXPORT in your application so these items are */ /* declared are imported from the Myconn DLL. */ /***********************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) #include -#else // !WIN32 +#else // !__WIN__ #include -#endif // !WIN32 +#endif // !__WIN__ #include #include #include "myutil.h" -#if defined(WIN32) && defined(MYCONN_EXPORTS) +#if defined(__WIN__) && defined(MYCONN_EXPORTS) #if defined(DLL_EXPORT) #define DllItem _declspec(dllexport) #else // !DLL_EXPORT #define DllItem _declspec(dllimport) #endif // !DLL_EXPORT -#else // !WIN32 || !MYCONN_EXPORTS +#else // !__WIN__ || !MYCONN_EXPORTS #define DllItem -#endif // !WIN32 +#endif // !__WIN__ #define MYSQL_ENABLED 0x00000001 #define MYSQL_LOGON 0x00000002 diff --git a/storage/connect/myutil.cpp b/storage/connect/myutil.cpp index fe504bbe422..d4416e188c8 100644 --- a/storage/connect/myutil.cpp +++ b/storage/connect/myutil.cpp @@ -13,11 +13,11 @@ /************************************************************************/ #include "my_global.h" #include -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include "osutil.h" -#endif // !WIN32 +#endif // !__WIN__ #include "global.h" #include "plgdbsem.h" diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 2f2f5f38c29..0c89f8404f6 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -11,7 +11,7 @@ /***********************************************************************/ #include #include -#if defined(WIN32) +#if defined(__WIN__) //nclude //nclude #include // for getcwd @@ -45,13 +45,13 @@ #include "osutil.h" -#if defined(WIN32) +#if defined(__WIN__) /***********************************************************************/ /* For dynamic load of ODBC32.DLL */ /***********************************************************************/ #pragma comment(lib, "odbc32.lib") extern "C" HINSTANCE s_hModule; // Saved module handle -#endif // WIN32 +#endif // __WIN__ int GetConvSize(); @@ -1201,15 +1201,15 @@ bool ODBConn::DriverConnect(DWORD Options) SWORD nResult; PUCHAR ConnOut = (PUCHAR)PlugSubAlloc(m_G, NULL, MAX_CONNECT_LEN); UWORD wConnectOption = SQL_DRIVER_COMPLETE; -#if defined(WIN32) +#if defined(__WIN__) HWND hWndTop = GetForegroundWindow(); HWND hWnd = GetParent(hWndTop); if (hWnd == NULL) hWnd = GetDesktopWindow(); -#else // !WIN32 +#else // !__WIN__ HWND hWnd = (HWND)1; -#endif // !WIN32 +#endif // !__WIN__ PGLOBAL& g = m_G; PDBUSER dup = PlgGetUser(g); @@ -1222,10 +1222,10 @@ bool ODBConn::DriverConnect(DWORD Options) SQL_NTS, ConnOut, MAX_CONNECT_LEN, &nResult, wConnectOption); -#if defined(WIN32) +#if defined(__WIN__) if (hWndTop) EnableWindow(hWndTop, true); -#endif // WIN32 +#endif // __WIN__ // If user hit 'Cancel' if (rc == SQL_NO_DATA_FOUND) { diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h index 41cc2439354..6a24334f08c 100644 --- a/storage/connect/odbconn.h +++ b/storage/connect/odbconn.h @@ -29,9 +29,9 @@ //efine MAX_CURSOR_NAME 18 // Max size of a cursor name #define DEFAULT_FIELD_TYPE SQL_TYPE_NULL // pick "C" data type to match SQL data type -#if !defined(WIN32) +#if !defined(__WIN__) typedef unsigned char *PUCHAR; -#endif // !WIN32 +#endif // !__WIN__ // Field Flags, used to indicate status of fields //efine SQL_FIELD_FLAG_DIRTY 0x1 diff --git a/storage/connect/os.h b/storage/connect/os.h index 8f77a0ad39f..2dc603fdcda 100644 --- a/storage/connect/os.h +++ b/storage/connect/os.h @@ -15,16 +15,16 @@ typedef off_t off64_t; #endif #endif -#if defined(WIN32) +#if defined(__WIN__) typedef __int64 BIGINT; -#else // !WIN32 +#else // !__WIN__ typedef longlong BIGINT; #define FILE_BEGIN SEEK_SET #define FILE_CURRENT SEEK_CUR #define FILE_END SEEK_END -#endif // !WIN32 +#endif // !__WIN__ -#if !defined(WIN32) +#if !defined(__WIN__) typedef const void *LPCVOID; typedef const char *LPCTSTR; typedef const char *LPCSTR; @@ -61,6 +61,6 @@ typedef int HANDLE; #define _MAX_EXT FN_EXTLEN #define INVALID_HANDLE_VALUE (-1) #define __stdcall -#endif /* !WIN32 */ +#endif /* !__WIN__ */ #endif /* _OS_H_INCLUDED */ diff --git a/storage/connect/osutil.c b/storage/connect/osutil.c index 66985847ce7..2e9e120b0c8 100644 --- a/storage/connect/osutil.c +++ b/storage/connect/osutil.c @@ -4,7 +4,7 @@ #include #include "osutil.h" -#ifdef WIN32 +#ifdef __WIN__ my_bool CloseFileHandle(HANDLE h) { return !CloseHandle(h); diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index 05dc59aec02..b57d9e20ceb 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -544,11 +544,11 @@ typedef struct _colres { char Var; /* Type added information */ } COLRES; -#if defined(WIN32) && !defined(NOEX) +#if defined(__WIN__) && !defined(NOEX) #define DllExport __declspec( dllexport ) -#else // !WIN32 +#else // !__WIN__ #define DllExport -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Utility routines. */ diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index a2b1baf1249..9e236da2d93 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -38,12 +38,12 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include #define BIGMEM 1048576 // 1 Megabyte -#else // !WIN32 +#else // !__WIN__ #include #include #if defined(THREAD) @@ -51,7 +51,7 @@ #endif // THREAD #include #define BIGMEM 2147483647 // Max int value -#endif // !WIN32 +#endif // !__WIN__ #include /***********************************************************************/ @@ -73,11 +73,11 @@ /* Macro or external routine definition */ /***********************************************************************/ #if defined(THREAD) -#if defined(WIN32) +#if defined(__WIN__) extern CRITICAL_SECTION parsec; // Used calling the Flex parser -#else // !WIN32 +#else // !__WIN__ extern pthread_mutex_t parmut; -#endif // !WIN32 +#endif // !__WIN__ #endif // THREAD /***********************************************************************/ @@ -403,11 +403,11 @@ char *SetPath(PGLOBAL g, const char *path) } // endif path if (*path != '.') { -#if defined(WIN32) +#if defined(__WIN__) char *s= "\\"; -#else // !WIN32 +#else // !__WIN__ char *s= "/"; -#endif // !WIN32 +#endif // !__WIN__ strcat(strcat(strcat(strcpy(buf, "."), s), path), s); } else strcpy(buf, path); @@ -426,7 +426,7 @@ char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op) char *drive = NULL, *direc = NULL, *fname = NULL, *ftype = NULL; switch (op) { // Determine which part to extract -#if !defined(UNIX) +#if defined(__WIN__) case OP_FDISK: drive = pBuff; break; #endif // !UNIX case OP_FPATH: direc = pBuff; break; @@ -702,19 +702,19 @@ PDTP MakeDateFormat(PGLOBAL g, PSZ dfmt, bool in, bool out, int flag) /* instruction is included in an Enter/LeaveCriticalSection bracket. */ /*********************************************************************/ #if defined(THREAD) -#if defined(WIN32) +#if defined(__WIN__) EnterCriticalSection((LPCRITICAL_SECTION)&parsec); -#else // !WIN32 +#else // !__WIN__ pthread_mutex_lock(&parmut); -#endif // !WIN32 +#endif // !__WIN__ #endif // THREAD /*int rc =*/ fmdflex(pdp); #if defined(THREAD) -#if defined(WIN32) +#if defined(__WIN__) LeaveCriticalSection((LPCRITICAL_SECTION)&parsec); -#else // !WIN32 +#else // !__WIN__ pthread_mutex_unlock(&parmut); -#endif // !WIN32 +#endif // !__WIN__ #endif // THREAD if (trace) @@ -1109,7 +1109,7 @@ char *GetAmName(PGLOBAL g, AMT am, void *memp) return amn; } // end of GetAmName -#if defined(WIN32) && !defined(NOCATCH) +#if defined(__WIN__) && !defined(NOCATCH) /***********************************************************************/ /* GetExceptionDesc: return the description of an exception code. */ /***********************************************************************/ @@ -1197,7 +1197,7 @@ char *GetExceptionDesc(PGLOBAL g, unsigned int e) return p; } // end of GetExceptionDesc -#endif // WIN32 && !NOCATCH +#endif // __WIN__ && !NOCATCH /***********************************************************************/ /* PlgDBalloc: allocates or suballocates memory conditionally. */ @@ -1239,7 +1239,7 @@ void *PlgDBalloc(PGLOBAL g, void *area, MBLOCK& mp) if (!mp.Sub) { // For allocations greater than one fourth of remaining storage // in the area, do allocate from virtual storage. -#if defined(WIN32) +#if defined(__WIN__) if (mp.Size >= BIGMEM) mp.Memp = VirtualAlloc(NULL, mp.Size, MEM_COMMIT, PAGE_READWRITE); else @@ -1336,7 +1336,7 @@ void PlgDBfree(MBLOCK& mp) htrc("PlgDBfree: %p sub=%d size=%d\n", mp.Memp, mp.Sub, mp.Size); if (!mp.Sub && mp.Memp) -#if defined(WIN32) +#if defined(__WIN__) if (mp.Size >= BIGMEM) VirtualFree(mp.Memp, 0, MEM_RELEASE); else @@ -1532,11 +1532,11 @@ int FileComp(PGLOBAL g, char *file1, char *file2) bp[0] = buff1; bp[1] = buff2; for (i = 0; i < 2; i++) { -#if defined(WIN32) +#if defined(__WIN__) h[i]= global_open(g, MSGID_NONE, fn[i], _O_RDONLY | _O_BINARY); -#else // !WIN32 +#else // !__WIN__ h[i]= global_open(g, MSGOD_NONE, fn[i], O_RDONLY); -#endif // !WIN32 +#endif // !__WIN__ if (h[i] == -1) { // if (errno != ENOENT) { diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 36d115e0096..63526f5fc48 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -44,7 +44,7 @@ /* */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) //#include #else #if defined(UNIX) || defined(UNIV_LINUX) @@ -80,9 +80,9 @@ #include "rcmsg.h" #endif // NEWMSG -#if defined(WIN32) +#if defined(__WIN__) extern HINSTANCE s_hModule; /* Saved module handle */ -#endif // WIN32 +#endif // __WIN__ #if defined(XMSG) extern char *msg_path; @@ -192,7 +192,7 @@ int PlugExit(PGLOBAL g) /***********************************************************************/ LPSTR PlugRemoveType(LPSTR pBuff, LPCSTR FileName) { -#if !defined(UNIX) && !defined(UNIV_LINUX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -220,7 +220,7 @@ LPSTR PlugRemoveType(LPSTR pBuff, LPCSTR FileName) BOOL PlugIsAbsolutePath(LPCSTR path) { -#if defined(WIN32) +#if defined(__WIN__) return ((path[0] >= 'a' && path[0] <= 'z') || (path[0] >= 'A' && path[0] <= 'Z')) && path[1] == ':'; #else @@ -238,7 +238,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) char direc[_MAX_DIR], defdir[_MAX_DIR], tmpdir[_MAX_DIR]; char fname[_MAX_FNAME]; char ftype[_MAX_EXT]; -#if !defined(UNIX) && !defined(UNIV_LINUX) +#if defined(__WIN__) char drive[_MAX_DRIVE], defdrv[_MAX_DRIVE]; #else char *drive = NULL, *defdrv = NULL; @@ -255,7 +255,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) return pBuff; } // endif -#if !defined(WIN32) +#if !defined(__WIN__) if (*FileName == '~') { if (_fullpath(pBuff, FileName, _MAX_PATH)) { if (trace > 1) @@ -266,7 +266,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) return FileName; // Error, return unchanged name } // endif FileName -#endif // !WIN32 +#endif // !__WIN__ if (prefix && strcmp(prefix, ".") && !PlugIsAbsolutePath(defpath)) { @@ -295,11 +295,11 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) if (trace > 1) { htrc("after _splitpath: FileName=%s\n", FileName); -#if defined(UNIX) || defined(UNIV_LINUX) - htrc("dir=%s fname=%s ext=%s\n", direc, fname, ftype); -#else +#if defined(__WIN__) htrc("drive=%s dir=%s fname=%s ext=%s\n", drive, direc, fname, ftype); htrc("defdrv=%s defdir=%s\n", defdrv, defdir); +#else + htrc("dir=%s fname=%s ext=%s\n", direc, fname, ftype); #endif } // endif trace @@ -427,7 +427,7 @@ char *PlugGetMessage(PGLOBAL g, int mid) } // end of PlugGetMessage #endif // NEWMSG -#if defined(WIN32) +#if defined(__WIN__) /***********************************************************************/ /* Return the line length of the console screen buffer. */ /***********************************************************************/ @@ -439,7 +439,7 @@ short GetLineLength(PGLOBAL g) return (b) ? coninfo.dwSize.X : 0; } // end of GetLineLength -#endif // WIN32 +#endif // __WIN__ /***********************************************************************/ /* Program for memory allocation of work and language areas. */ diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c index 9eea944c697..75759e03314 100644 --- a/storage/connect/rcmsg.c +++ b/storage/connect/rcmsg.c @@ -1,68 +1,68 @@ -/**************** RCMsg C Program Source Code File (.C) ****************/ -/* PROGRAM NAME: RCMSG */ -/* ------------- */ -/* Version 1.3 */ -/* */ -/* COPYRIGHT */ -/* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */ -/* */ -/* WHAT THIS PROGRAM DOES */ -/* ----------------------- */ -/* This program simulates LoadString. */ -/* */ -/***********************************************************************/ -#if !defined(XMSG) -#include -#include -#include "resource.h" -#include "rcmsg.h" -#if defined(NEWMSG) -#include "msgid.h" -#endif // NEWMSG - -#if !defined(WIN32) -#define stricmp strcasecmp -#endif // !WIN32 - -char *msglang(void); - -char *GetMsgid(int id) - { - char *p = NULL; - - // This conditional until a real fix is found for MDEV-7304 -#if defined(FRENCH) - if (!stricmp(msglang(), "french")) - switch (id) { -#include "frids.h" -#if defined(NEWMSG) -#include "frcas.h" -#endif // NEWMSG - } // endswitch(id) - - else // English -#endif // FRENCH - switch (id) { -#include "enids.h" -#if defined(NEWMSG) -#include "encas.h" -#endif // NEWMSG - } // endswitch(id) - - return p; - } // end of GetMsgid - -int GetRcString(int id, char *buf, int bufsize) - { - char *p = NULL, msg[32]; - - if (!(p = GetMsgid(id))) { - sprintf(msg, "ID=%d unknown", id); - p = msg; - } // endif p - - return sprintf(buf, "%.*s", bufsize-1, p); - } // end of GetRcString - -#endif // !XMSG +/**************** RCMsg C Program Source Code File (.C) ****************/ +/* PROGRAM NAME: RCMSG */ +/* ------------- */ +/* Version 1.3 */ +/* */ +/* COPYRIGHT */ +/* ---------- */ +/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */ +/* */ +/* WHAT THIS PROGRAM DOES */ +/* ----------------------- */ +/* This program simulates LoadString. */ +/* */ +/***********************************************************************/ +#if !defined(XMSG) +#include +#include +#include "resource.h" +#include "rcmsg.h" +#if defined(NEWMSG) +#include "msgid.h" +#endif // NEWMSG + +#if !defined(__WIN__) +#define stricmp strcasecmp +#endif // !__WIN__ + +char *msglang(void); + +char *GetMsgid(int id) + { + char *p = NULL; + + // This conditional until a real fix is found for MDEV-7304 +#if defined(FRENCH) + if (!stricmp(msglang(), "french")) + switch (id) { +#include "frids.h" +#if defined(NEWMSG) +#include "frcas.h" +#endif // NEWMSG + } // endswitch(id) + + else // English +#endif // FRENCH + switch (id) { +#include "enids.h" +#if defined(NEWMSG) +#include "encas.h" +#endif // NEWMSG + } // endswitch(id) + + return p; + } // end of GetMsgid + +int GetRcString(int id, char *buf, int bufsize) + { + char *p = NULL, msg[32]; + + if (!(p = GetMsgid(id))) { + sprintf(msg, "ID=%d unknown", id); + p = msg; + } // endif p + + return sprintf(buf, "%.*s", bufsize-1, p); + } // end of GetRcString + +#endif // !XMSG diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 720ede8f225..60d515a61ca 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -17,7 +17,7 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #else #include // dlopen(), dlclose(), dlsym() ... @@ -48,9 +48,9 @@ #include "tabmul.h" #include "ha_connect.h" -#if !defined(WIN32) +#if !defined(__WIN__) extern handlerton *connect_hton; -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* External function. */ @@ -479,7 +479,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) } else PlugSetPath(soname, Module, GetPluginDir()); -#if defined(WIN32) +#if defined(__WIN__) // Is the DLL already loaded? if (!Hdll && !(Hdll = GetModuleHandle(soname))) // No, load the Dll implementing the function @@ -508,7 +508,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) FreeLibrary((HMODULE)Hdll); return NULL; } // endif getdef -#else // !WIN32 +#else // !__WIN__ const char *error = NULL; Dl_info dl_info; @@ -551,7 +551,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) dlclose(Hdll); return NULL; } // endif getdef -#endif // !WIN32 +#endif // !__WIN__ // Just in case the external Get function does not set error messages sprintf(g->Message, MSG(DEF_ALLOC_ERROR), Subtype); diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h index ec70f18e151..4aa29037dfc 100644 --- a/storage/connect/reldef.h +++ b/storage/connect/reldef.h @@ -139,11 +139,11 @@ class DllExport OEMDEF : public TABDEF { /* OEM table */ PTABDEF GetXdef(PGLOBAL g); // Members -#if defined(WIN32) +#if defined(__WIN__) HANDLE Hdll; /* Handle to the external DLL */ -#else // !WIN32 +#else // !__WIN__ void *Hdll; /* Handle for the loaded shared library */ -#endif // !WIN32 +#endif // !__WIN__ PTABDEF Pxdef; /* Pointer to the external TABDEF class */ char *Module; /* Path/Name of the DLL implenting it */ char *Subtype; /* The name of the OEM table sub type */ diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index bee56e31886..a1e58ab3344 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -17,7 +17,7 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include // For testing only #include @@ -26,7 +26,7 @@ #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -34,7 +34,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -208,11 +208,11 @@ void DOSDEF::RemoveOptValues(PGLOBAL g) // Delete any eventually ill formed non matching optimization file if (!GetOptFileName(g, filename)) -#if defined(WIN32) +#if defined(__WIN__) DeleteFile(filename); #else // UNIX remove(filename); -#endif // WIN32 +#endif // __WIN__ Optimized = 0; } // end of RemoveOptValues @@ -253,7 +253,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) /*********************************************************************/ if (sep) { // Indexes are save in separate files -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -270,7 +270,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) strcat(strcat(fname, "_"), pxdf->GetName()); _makepath(filename, drive, direc, fname, ftype); PlugSetPath(filename, filename, GetPath()); -#if defined(WIN32) +#if defined(__WIN__) if (!DeleteFile(filename)) rc |= (GetLastError() != ERROR_FILE_NOT_FOUND); #else // UNIX @@ -287,7 +287,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) // Drop all indexes, delete the common file PlugSetPath(filename, Ofn, GetPath()); strcat(PlugRemoveType(filename, filename), ftype); -#if defined(WIN32) +#if defined(__WIN__) if (!DeleteFile(filename)) rc = (GetLastError() != ERROR_FILE_NOT_FOUND); #else // UNIX @@ -956,7 +956,7 @@ bool TDBDOS::GetBlockValues(PGLOBAL g) #if 0 if (Mode == MODE_INSERT && Txfp->GetAmType() == TYPE_AM_DOS) return false; -#endif // WIN32 +#endif // __WIN__ if (defp->Optimized) return false; // Already done or to be redone diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 83fe14ca85c..acd548c86ab 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -17,7 +17,7 @@ /* Include relevant section of system dependant header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include @@ -25,7 +25,7 @@ #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -35,7 +35,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index a5e14e1b81f..015f8d93b15 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -20,7 +20,7 @@ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include @@ -102,14 +102,14 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, const char *fn, char sep, } // endif info // num_max = atoi(p+1); // Max num of record to test -#if defined(WIN32) +#if defined(__WIN__) if (sep == ',' || strnicmp(setlocale(LC_NUMERIC, NULL), "French", 6)) dechar = '.'; else dechar = ','; -#else // !WIN32 +#else // !__WIN__ dechar = '.'; -#endif // !WIN32 +#endif // !__WIN__ if (trace) htrc("File %s sep=%c q=%c hdr=%d mxr=%d\n", @@ -147,7 +147,7 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, const char *fn, char sep, if (fgets(buf, sizeof(buf), infile)) { n = strlen(buf) + 1; buf[n - 2] = '\0'; -#if defined(UNIX) +#if !defined(__WIN__) // The file can be imported from Windows if (buf[n - 3] == '\r') buf[n - 3] = 0; @@ -204,7 +204,7 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, const char *fn, char sep, if (fgets(buf, sizeof(buf), infile)) { n = strlen(buf); buf[n - 1] = '\0'; -#if defined(UNIX) +#if !defined(__WIN__) // The file can be imported from Windows if (buf[n - 2] == '\r') buf[n - 2] = 0; diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index cfc56212c40..fafba6228b9 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -623,11 +623,11 @@ bool TDBJSN::SkipHeader(PGLOBAL g) return true; #endif // _DEBUG -#if defined(WIN32) +#if defined(__WIN__) #define Ending 2 -#else // !WIN32 +#else // !__WIN__ #define Ending 1 -#endif // !WIN32 +#endif // !__WIN__ if (Pretty == 1) { if (Mode == MODE_INSERT || Mode == MODE_DELETE) { diff --git a/storage/connect/tabmac.cpp b/storage/connect/tabmac.cpp index f072465ced5..e6e2abb54e2 100644 --- a/storage/connect/tabmac.cpp +++ b/storage/connect/tabmac.cpp @@ -3,12 +3,12 @@ /* From the article and sample code by Khalid Shaikh. */ /* TABMAC: virtual table to get the list of MAC addresses. */ /***********************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) #include "my_global.h" //#include -#else // !WIN32 -#error This is a WIN32 only table type -#endif // !WIN32 +#else // !__WIN__ +#error This is a WINDOWS only table type +#endif // !__WIN__ #include "global.h" #include "plgdbsem.h" //#include "catalog.h" diff --git a/storage/connect/tabmac.h b/storage/connect/tabmac.h index 5e6c98d68fb..f9a66e82eaa 100644 --- a/storage/connect/tabmac.h +++ b/storage/connect/tabmac.h @@ -1,11 +1,11 @@ // TABMAC.H Olivier Bertrand 2011-2012 // MAC: virtual table to Get Mac Addresses via GetAdaptersInfo -#if defined(WIN32) +#if defined(__WIN__) #include #include -#else // !WIN32 -#error This is a WIN32 only table TYPE -#endif // !WIN32 +#else // !__WIN__ +#error This is a WINDOWS only table TYPE +#endif // !__WIN__ /***********************************************************************/ /* Definitions. */ diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 12e8de2c808..3008ca1b8ca 100644 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -37,7 +37,7 @@ /* Include relevant section of system dependant header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) @@ -145,7 +145,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) /*******************************************************************/ /* To_File is a multiple name with special characters */ /*******************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) char drive[_MAX_DRIVE], direc[_MAX_DIR]; WIN32_FIND_DATA FileData; HANDLE hSearch; @@ -196,7 +196,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) return true; } // endif FindClose -#else // !WIN32 +#else // !__WIN__ struct stat fileinfo; char fn[FN_REFLEN], direc[FN_REFLEN], pattern[FN_HEADLEN], ftype[FN_EXTLEN]; DIR *dir; @@ -249,7 +249,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) // Close the dir handle. closedir(dir); -#endif // !WIN32 +#endif // !__WIN__ } else { /*******************************************************************/ @@ -269,7 +269,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) p = filename + strlen(filename) - 1; -#if defined(UNIX) +#if !defined(__WIN__) // Data files can be imported from Windows (having CRLF) if (*p == '\n' || *p == '\r') { // is this enough for Unix ??? @@ -297,7 +297,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) } // endif Mul -#if defined(WIN32) +#if defined(__WIN__) suite: #endif @@ -620,17 +620,17 @@ TDBDIR::TDBDIR(PDIRDEF tdp) : TDBASE(tdp) { To_File = tdp->Fn; iFile = 0; -#if defined(WIN32) +#if defined(__WIN__) memset(&FileData, 0, sizeof(_finddata_t)); Hsearch = -1; *Drive = '\0'; -#else // !WIN32 +#else // !__WIN__ memset(&Fileinfo, 0, sizeof(struct stat)); Entry = NULL; Dir = NULL; Done = false; *Pattern = '\0'; -#endif // !WIN32 +#endif // !__WIN__ *Fpath = '\0'; *Direc = '\0'; *Fname = '\0'; @@ -641,17 +641,17 @@ TDBDIR::TDBDIR(PTDBDIR tdbp) : TDBASE(tdbp) { To_File = tdbp->To_File; iFile = tdbp->iFile; -#if defined(WIN32) +#if defined(__WIN__) FileData = tdbp->FileData; Hsearch = tdbp->Hsearch; strcpy(Drive, tdbp->Drive); -#else // !WIN32 +#else // !__WIN__ Fileinfo = tdbp->Fileinfo; Entry = tdbp->Entry; Dir = tdbp->Dir; Done = tdbp->Done; strcpy(Pattern, tdbp->Pattern); -#endif // !WIN32 +#endif // !__WIN__ strcpy(Direc, tdbp->Direc); strcpy(Fname, tdbp->Fname); strcpy(Ftype, tdbp->Ftype); @@ -675,7 +675,7 @@ char* TDBDIR::Path(PGLOBAL g) { PCATLG cat = PlgGetCatalog(g); -#if defined(WIN32) +#if defined(__WIN__) if (!*Drive) { PlugSetPath(Fpath, To_File, ((PTABDEF)To_Def)->GetPath()); _splitpath(Fpath, Drive, Direc, Fname, Ftype); @@ -683,7 +683,7 @@ char* TDBDIR::Path(PGLOBAL g) _makepath(Fpath, Drive, Direc, Fname, Ftype); // Usefull ??? return Fpath; -#else // !WIN32 +#else // !__WIN__ if (!Done) { PlugSetPath(Fpath, To_File, ((PTABDEF)To_Def)->GetPath()); _splitpath(Fpath, NULL, Direc, Fname, Ftype); @@ -692,7 +692,7 @@ char* TDBDIR::Path(PGLOBAL g) } // endif Done return Pattern; -#endif // !WIN32 +#endif // !__WIN__ } // end of Path /***********************************************************************/ @@ -710,7 +710,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) { if (MaxSize < 0) { int n = -1; -#if defined(WIN32) +#if defined(__WIN__) int h; // Start searching files in the target directory. @@ -726,7 +726,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) } else n = 0; -#else // !WIN32 +#else // !__WIN__ Path(g); // Start searching files in the target directory. @@ -750,7 +750,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) // Close the DIR handle. closedir(Dir); -#endif // !WIN32 +#endif // !__WIN__ MaxSize = n; } // endif MaxSize @@ -776,10 +776,10 @@ bool TDBDIR::OpenDB(PGLOBAL g) } // endif use Use = USE_OPEN; -#if !defined(WIN32) +#if !defined(__WIN__) Path(g); // Be sure it is done Dir = NULL; // For ReadDB -#endif // !WIN32 +#endif // !__WIN__ return false; } // end of OpenDB @@ -790,7 +790,7 @@ int TDBDIR::ReadDB(PGLOBAL g) { int rc = RC_OK; -#if defined(WIN32) +#if defined(__WIN__) if (Hsearch == -1) { /*******************************************************************/ /* Start searching files in the target directory. The use of the */ @@ -848,7 +848,7 @@ int TDBDIR::ReadDB(PGLOBAL g) rc = RC_EF; } // endif Entry -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of ReadDB @@ -876,17 +876,17 @@ int TDBDIR::DeleteDB(PGLOBAL g, int) /***********************************************************************/ void TDBDIR::CloseDB(PGLOBAL) { -#if defined(WIN32) +#if defined(__WIN__) // Close the search handle. _findclose(Hsearch); Hsearch = -1; -#else // !WIN32 +#else // !__WIN__ // Close the DIR handle if (Dir) { closedir(Dir); Dir = NULL; } // endif dir -#endif // !WIN32 +#endif // !__WIN__ iFile = 0; } // end of CloseDB @@ -935,19 +935,19 @@ void DIRCOL::ReadColumn(PGLOBAL g) /* Retrieve the information corresponding to the column number. */ /*********************************************************************/ switch (N) { -#if defined(WIN32) +#if defined(__WIN__) case 0: Value->SetValue_psz(tdbp->Drive); break; -#endif // WIN32 +#endif // __WIN__ case 1: Value->SetValue_psz(tdbp->Direc); break; case 2: Value->SetValue_psz(tdbp->Fname); break; case 3: Value->SetValue_psz(tdbp->Ftype); break; -#if defined(WIN32) +#if defined(__WIN__) case 4: Value->SetValue((int)tdbp->FileData.attrib); break; case 5: Value->SetValue((int)tdbp->FileData.size); break; case 6: Value->SetValue((int)tdbp->FileData.time_write); break; case 7: Value->SetValue((int)tdbp->FileData.time_create); break; case 8: Value->SetValue((int)tdbp->FileData.time_access); break; -#else // !WIN32 +#else // !__WIN__ case 4: Value->SetValue((int)tdbp->Fileinfo.st_mode); break; case 5: Value->SetValue((int)tdbp->Fileinfo.st_size); break; case 6: Value->SetValue((int)tdbp->Fileinfo.st_mtime); break; @@ -955,7 +955,7 @@ void DIRCOL::ReadColumn(PGLOBAL g) case 8: Value->SetValue((int)tdbp->Fileinfo.st_atime); break; case 9: Value->SetValue((int)tdbp->Fileinfo.st_uid); break; case 10: Value->SetValue((int)tdbp->Fileinfo.st_gid); break; -#endif // !WIN32 +#endif // !__WIN__ default: sprintf(g->Message, MSG(INV_DIRCOL_OFST), N); longjmp(g->jumper[g->jump_level], GetAmType()); @@ -1006,7 +1006,7 @@ int TDBSDR::FindInDir(PGLOBAL g) size_t m = strlen(Direc); // Start searching files in the target directory. -#if defined(WIN32) +#if defined(__WIN__) int h = _findfirst(Path(g), &FileData); if (h != -1) { @@ -1039,7 +1039,7 @@ int TDBSDR::FindInDir(PGLOBAL g) // Close the search handle. _findclose(h); } // endif h -#else // !WIN32 +#else // !__WIN__ int k; DIR *dir = opendir(Direc); @@ -1073,7 +1073,7 @@ int TDBSDR::FindInDir(PGLOBAL g) // Close the DIR handle. closedir(dir); -#endif // !WIN32 +#endif // !__WIN__ return n; } // end of FindInDir @@ -1089,13 +1089,13 @@ bool TDBSDR::OpenDB(PGLOBAL g) Sub = (PSUBDIR)PlugSubAlloc(g, NULL, sizeof(SUBDIR)); Sub->Next = NULL; Sub->Prev = NULL; -#if defined(WIN32) +#if defined(__WIN__) Sub->H = -1; Sub->Len = strlen(Direc); -#else // !WIN32 +#else // !__WIN__ Sub->D = NULL; Sub->Len = 0; -#endif // !WIN32 +#endif // !__WIN__ } // endif To_Sub return TDBDIR::OpenDB(g); @@ -1108,7 +1108,7 @@ int TDBSDR::ReadDB(PGLOBAL g) { int rc; -#if defined(WIN32) +#if defined(__WIN__) again: rc = TDBDIR::ReadDB(g); @@ -1160,7 +1160,7 @@ int TDBSDR::ReadDB(PGLOBAL g) } // endif H } // endif rc -#else // !WIN32 +#else // !__WIN__ rc = RC_NF; again: @@ -1217,7 +1217,7 @@ int TDBSDR::ReadDB(PGLOBAL g) } // endif Entry -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of ReadDB diff --git a/storage/connect/tabmul.h b/storage/connect/tabmul.h index 379e8f88e93..433cc3a2ee3 100644 --- a/storage/connect/tabmul.h +++ b/storage/connect/tabmul.h @@ -6,14 +6,14 @@ /* */ /* This file contains the TDBMUL and TDBDIR classes declares. */ /***********************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) #include -#else // !WIN32 +#else // !__WIN__ #include #include #include #include -#endif // !WIN32 +#endif // !__WIN__ //#include "osutil.h" #include "block.h" @@ -132,17 +132,17 @@ class TDBDIR : public TDBASE { // Members PSZ To_File; // Points to file search pathname int iFile; // Index of currently retrieved file -#if defined(WIN32) +#if defined(__WIN__) _finddata_t FileData; // Find data structure int Hsearch; // Search handle char Drive[_MAX_DRIVE]; // Drive name -#else // !WIN32 +#else // !__WIN__ struct stat Fileinfo; // File info structure struct dirent *Entry; // Point to directory entry structure DIR *Dir; // To searched directory structure bool Done; // true when _splipath is done char Pattern[_MAX_FNAME+_MAX_EXT]; -#endif // !WIN32 +#endif // !__WIN__ char Fpath[_MAX_PATH]; // Absolute file search pattern char Direc[_MAX_DIR]; // Search path char Fname[_MAX_FNAME]; // File name @@ -183,11 +183,11 @@ class TDBSDR : public TDBDIR { typedef struct _Sub_Dir { struct _Sub_Dir *Next; struct _Sub_Dir *Prev; -#if defined(WIN32) +#if defined(__WIN__) int H; // Search handle -#else // !WIN32 +#else // !__WIN__ DIR *D; -#endif // !WIN32 +#endif // !__WIN__ size_t Len; // Initial directory name length } SUBDIR, *PSUBDIR; diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index cb7011822d8..19a5dfd758f 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -35,9 +35,9 @@ #include "my_global.h" #include "sql_class.h" #include "sql_servers.h" -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ //#include //#include #include @@ -46,7 +46,7 @@ #include "osutil.h" //#include //#include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ diff --git a/storage/connect/taboccur.cpp b/storage/connect/taboccur.cpp index da3cafc3c8f..07e260154e0 100644 --- a/storage/connect/taboccur.cpp +++ b/storage/connect/taboccur.cpp @@ -13,7 +13,7 @@ /***********************************************************************/ #include "my_global.h" #include "table.h" // MySQL table definitions -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index 3bf1238cebc..ad7892469cd 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -35,7 +35,7 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) diff --git a/storage/connect/tabpivot.cpp b/storage/connect/tabpivot.cpp index b36dcbf94af..b628e26d3c7 100644 --- a/storage/connect/tabpivot.cpp +++ b/storage/connect/tabpivot.cpp @@ -17,7 +17,7 @@ /***********************************************************************/ #include "my_global.h" #include "table.h" // MySQL table definitions -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define __MFC_COMPAT__ // To define min/max as macro #endif diff --git a/storage/connect/tabsys.cpp b/storage/connect/tabsys.cpp index 623aeca36fe..76890e84429 100644 --- a/storage/connect/tabsys.cpp +++ b/storage/connect/tabsys.cpp @@ -12,12 +12,12 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -25,7 +25,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include application header files: */ @@ -36,9 +36,9 @@ #include "global.h" #include "plgdbsem.h" #include "reldef.h" -#if !defined(WIN32) +#if !defined(__WIN__) #include "osutil.h" -#endif // !WIN32 +#endif // !__WIN__ #include "filamtxt.h" #include "tabdos.h" #include "tabsys.h" @@ -48,10 +48,10 @@ #define CSZ 36 // Column section name length #define CDZ 256 // Column definition length -#if !defined(WIN32) +#if !defined(__WIN__) #define GetPrivateProfileSectionNames(S,L,I) \ GetPrivateProfileString(NULL,NULL,"",S,L,I) -#endif // !WIN32 +#endif // !__WIN__ /* -------------- Implementation of the INI classes ------------------ */ @@ -123,7 +123,7 @@ bool INIDEF::DeleteTableFile(PGLOBAL g) // Delete the INI table file if not protected if (!IsReadOnly()) { PlugSetPath(filename, Fn, GetPath()); -#if defined(WIN32) +#if defined(__WIN__) rc = !DeleteFile(filename); #else // UNIX rc = remove(filename); @@ -345,9 +345,9 @@ int TDBINI::DeleteDB(PGLOBAL g, int irc) /***********************************************************************/ void TDBINI::CloseDB(PGLOBAL) { -#if !defined(WIN32) +#if !defined(__WIN__) PROFILE_Close(Ifile); -#endif // !WIN32 +#endif // !__WIN__ } // end of CloseDB // ------------------------ INICOL functions ---------------------------- diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index f2affe75d2b..7f979eaf4be 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -39,7 +39,7 @@ //#include "sql_base.h" #include "my_global.h" #include "table.h" // MySQL table definitions -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) @@ -73,15 +73,15 @@ #include "tabmysql.h" #include "ha_connect.h" -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define SYSEXIT void _USERENTRY #else #define SYSEXIT void #endif -#else // !WIN32 +#else // !__WIN__ #define SYSEXIT void * -#endif // !WIN32 +#endif // !__WIN__ /* ---------------------------- Class TBLDEF ---------------------------- */ diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 5ed958b2f7a..331a7f45d4d 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -14,7 +14,7 @@ #include "sql_class.h" #include "table.h" #include "field.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) diff --git a/storage/connect/tabvct.cpp b/storage/connect/tabvct.cpp index 6394ea5e2d6..e788529075f 100644 --- a/storage/connect/tabvct.cpp +++ b/storage/connect/tabvct.cpp @@ -35,7 +35,7 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) @@ -146,7 +146,7 @@ bool VCTDEF::Erase(char *filename) for (i = 1, cdp = To_Cols; cdp; i++, cdp = cdp->GetNext()) { sprintf(filename, fpat, i); -//#if defined(WIN32) +//#if defined(__WIN__) // rc |= !DeleteFile(filename); //#else // UNIX rc |= remove(filename); @@ -175,7 +175,7 @@ bool VCTDEF::Erase(char *filename) int VCTDEF::MakeFnPattern(char *fpat) { char pat[8]; -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp index 7c69426a066..98a44b9d635 100644 --- a/storage/connect/tabwmi.cpp +++ b/storage/connect/tabwmi.cpp @@ -2,9 +2,9 @@ /* TABWMI: Author Olivier Bertrand -- PlugDB -- 2012 - 2013 */ /* TABWMI: Virtual table to get WMI information. */ /***********************************************************************/ -#if !defined(WIN32) -#error This is a WIN32 only table type -#endif // !WIN32 +#if !defined(__WIN__) +#error This is a WINDOWS only table type +#endif // !__WIN__ #include "my_global.h" #include diff --git a/storage/connect/tabxcl.cpp b/storage/connect/tabxcl.cpp index 7d6d94d34c0..add61431493 100644 --- a/storage/connect/tabxcl.cpp +++ b/storage/connect/tabxcl.cpp @@ -17,7 +17,7 @@ /***********************************************************************/ #include "my_global.h" #include "table.h" // MySQL table definitions -#if defined(WIN32) +#if defined(__WIN__) #include #include #if defined(__BORLANDC__) diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 26e0f7630d6..49fa9a1c554 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -15,12 +15,12 @@ #include #include #include -#if defined(WIN32) +#if defined(__WIN__) #include #include //#include #include -#else // !WIN32 +#else // !__WIN__ #include #include #include @@ -28,7 +28,7 @@ //#include #include "osutil.h" #define _O_RDONLY O_RDONLY -#endif // !WIN32 +#endif // !__WIN__ #include "resource.h" // for IDS_COLUMNS #define INCLUDE_TDBXML @@ -53,11 +53,11 @@ extern "C" char version[]; -#if defined(WIN32) && defined(DOMDOC_SUPPORT) +#if defined(__WIN__) && defined(DOMDOC_SUPPORT) #define XMLSUP "MS-DOM" -#else // !WIN32 +#else // !__WIN__ #define XMLSUP "libxml2" -#endif // !WIN32 +#endif // !__WIN__ #define TYPE_UNKNOWN 12 /* Must be greater than other types */ @@ -155,11 +155,11 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) tdp->Tabname = tab; if (!(op = GetStringTableOption(g, topt, "Xmlsup", NULL))) -#if defined(WIN32) +#if defined(__WIN__) tdp->Usedom = true; -#else // !WIN32 +#else // !__WIN__ tdp->Usedom = false; -#endif // !WIN32 +#endif // !__WIN__ else tdp->Usedom = (toupper(*op) == 'M' || toupper(*op) == 'D'); @@ -494,11 +494,11 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) // Note that if no support is specified, the default is MS-DOM // on Windows and libxml2 otherwise if (*buf == '*') -#if defined(WIN32) +#if defined(__WIN__) Usedom = true; -#else // !WIN32 +#else // !__WIN__ Usedom = false; -#endif // !WIN32 +#endif // !__WIN__ else Usedom = (toupper(*buf) == 'M' || toupper(*buf) == 'D'); @@ -878,7 +878,7 @@ bool TDBXML::Initialize(PGLOBAL g) Nlist = TabNode->GetChildElements(g); Docp->SetNofree(true); // For libxml2 -#if defined(WIN32) +#if defined(__WIN__) } catch(_com_error e) { // We come here if a DOM command threw an error char buf[128]; @@ -892,7 +892,7 @@ bool TDBXML::Initialize(PGLOBAL g) sprintf(g->Message, "%s hr=%p", MSG(COM_ERROR), e.Error()); goto error; -#endif // WIN32 +#endif // __WIN__ #if !defined(UNIX) } catch(...) { // Other errors diff --git a/storage/connect/valblk.cpp b/storage/connect/valblk.cpp index 94e09e1a85c..5fefcba5856 100644 --- a/storage/connect/valblk.cpp +++ b/storage/connect/valblk.cpp @@ -23,7 +23,7 @@ /* Include relevant MariaDB header file. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) //#include #else #include "osutil.h" diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 5a8b1de326a..03ec0eb8e40 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -30,11 +30,11 @@ #include "sql_class.h" #include "sql_time.h" -#if defined(WIN32) +#if defined(__WIN__) //#include -#else // !WIN32 +#else // !__WIN__ #include -#endif // !WIN32 +#endif // !__WIN__ #include @@ -77,12 +77,12 @@ int DTVAL::Shift = 0; /***********************************************************************/ bool PlugEvalLike(PGLOBAL, LPCSTR, LPCSTR, bool); -#if !defined(WIN32) +#if !defined(__WIN__) extern "C" { PSZ strupr(PSZ s); PSZ strlwr(PSZ s); } -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Get a long long number from its character representation. */ @@ -1618,10 +1618,10 @@ int TYPVAL::CompareValue(PVAL vp) else n = strcmp(Strp, vp->GetCharValue()); -#if defined(WIN32) +#if defined(__WIN__) if (n == _NLSCMPERROR) return n; // Here we should raise an error -#endif // WIN32 +#endif // __WIN__ return (n > 0) ? 1 : (n < 0) ? -1 : 0; } // end of CompareValue diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index ee8dc3ac4cb..85b3fc9751c 100755 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -10,12 +10,12 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include #include #include //#include -#else // !WIN32 +#else // !__WIN__ #if defined(UNIX) #include #include @@ -25,7 +25,7 @@ #include #endif // !UNIX #include -#endif // !WIN32 +#endif // !__WIN__ /***********************************************************************/ /* Include required application header files */ @@ -835,7 +835,7 @@ bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp) if ((sep = defp->GetBoolCatInfo("SepIndex", false))) { // Index is saved in a separate file -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -988,7 +988,7 @@ bool XINDEX::Init(PGLOBAL g) if (defp->SepIndex()) { // Index was saved in a separate file -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -1241,7 +1241,7 @@ bool XINDEX::MapInit(PGLOBAL g) if (defp->SepIndex()) { // Index was save in a separate file -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -1454,7 +1454,7 @@ bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk) if (defp->SepIndex()) { // Index was saved in a separate file -#if !defined(UNIX) +#if defined(__WIN__) char drive[_MAX_DRIVE]; #else char *drive = NULL; @@ -2479,7 +2479,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) if (trace) htrc(" Xopen: filename=%s id=%d mode=%d\n", filename, id, mode); -#if defined(WIN32) +#if defined(__WIN__) LONG high = 0; DWORD rc, drc, access, share, creation; @@ -2655,7 +2655,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) /***********************************************************************/ bool XHUGE::Seek(PGLOBAL g, int low, int high, int origin) { -#if defined(WIN32) +#if defined(__WIN__) LONG hi = high; DWORD rc = SetFilePointer(Hfile, low, &hi, origin); @@ -2691,7 +2691,7 @@ bool XHUGE::Read(PGLOBAL g, void *buf, int n, int size) { bool rc = false; -#if defined(WIN32) +#if defined(__WIN__) bool brc; DWORD nbr, count = (DWORD)(n * size); @@ -2737,7 +2737,7 @@ bool XHUGE::Read(PGLOBAL g, void *buf, int n, int size) /***********************************************************************/ int XHUGE::Write(PGLOBAL g, void *buf, int n, int size, bool& rc) { -#if defined(WIN32) +#if defined(__WIN__) bool brc; DWORD nbw, count = (DWORD)n * (DWORD) size; @@ -2779,7 +2779,7 @@ void XHUGE::Close(char *fn, int id) if (trace) htrc("XHUGE::Close: fn=%s id=%d NewOff=%lld\n", fn, id, NewOff.Val); -#if defined(WIN32) +#if defined(__WIN__) if (id >= 0 && fn) { CloseFileHandle(Hfile); Hfile = CreateFile(fn, GENERIC_READ | GENERIC_WRITE, 0, NULL, @@ -2794,7 +2794,7 @@ void XHUGE::Close(char *fn, int id) } // endif SetFilePointer } // endif id -#else // !WIN32 +#else // !__WIN__ if (id >= 0 && fn) { if (Hfile != INVALID_HANDLE_VALUE) { if (lseek64(Hfile, id * sizeof(IOFF), SEEK_SET) >= 0) { @@ -2810,7 +2810,7 @@ void XHUGE::Close(char *fn, int id) htrc("(XHUGE)error reopening %s: %s\n", fn, strerror(errno)); } // endif id -#endif // !WIN32 +#endif // !__WIN__ XLOAD::Close(); } // end of Close diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index 079412b32cf..ad34259501f 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -346,7 +346,7 @@ class DllExport XLOAD : public BLOCK { protected: // Members -#if defined(WIN32) +#if defined(__WIN__) HANDLE Hfile; // Handle to file or map #else // UNIX int Hfile; // Descriptor to file or map -- cgit v1.2.1 From 514a7d8462aa4aa0a2acac54355b1d0cfb35695f Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 30 May 2015 10:59:34 +0200 Subject: Add unicode ODBC types to the types recognized by CONNECT. Was added in function TranslateSQLType. modified: storage/connect/ha_connect.cc modified: storage/connect/odbconn.cpp modified: storage/connect/value.h Add some trace in particular in indexing routines. modified: storage/connect/block.h modified: storage/connect/ha_connect.cc modified: storage/connect/plugutil.c modified: storage/connect/xindex.cpp modified: storage/connect/xindex.h --- storage/connect/block.h | 2 +- storage/connect/ha_connect.cc | 15 +++++++++-- storage/connect/odbconn.cpp | 14 +++++++--- storage/connect/plugutil.c | 4 +-- storage/connect/value.h | 5 ++-- storage/connect/xindex.cpp | 62 ++++++++++++++++++++++++++++++++++--------- storage/connect/xindex.h | 2 +- 7 files changed, 80 insertions(+), 24 deletions(-) diff --git a/storage/connect/block.h b/storage/connect/block.h index 69cec39e8a5..aa4edde5ec9 100644 --- a/storage/connect/block.h +++ b/storage/connect/block.h @@ -38,7 +38,7 @@ typedef class BLOCK *PBLOCK; class DllExport BLOCK { public: void * operator new(size_t size, PGLOBAL g, void *p = NULL) { -// if (trace > 2) +// if (trace > 3) // htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p); return (PlugSubAlloc(g, p, size)); diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index da357faa171..6769760c5fa 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4755,6 +4755,9 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key, else rows= HA_POS_ERROR; + if (trace) + htrc("records_in_range: rows=%llu\n", rows); + DBUG_RETURN(rows); } // end of records_in_range @@ -5523,10 +5526,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd, #if defined(ODBC_SUPPORT) if (ttp == TAB_ODBC) { - int plgtyp; + int plgtyp; + bool w= false; // Wide character type // typ must be PLG type, not SQL type - if (!(plgtyp= TranslateSQLType(typ, dec, prec, v))) { + if (!(plgtyp= TranslateSQLType(typ, dec, prec, v, w))) { if (GetTypeConv() == TPC_SKIP) { // Skip this column sprintf(g->Message, "Column %s skipped (unsupported type %d)", @@ -5543,6 +5547,13 @@ static int connect_assisted_discovery(handlerton *, THD* thd, typ= plgtyp; switch (typ) { + case TYPE_STRING: + if (w) { + sprintf(g->Message, "Column %s is wide characters", cnm); + push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message); + } // endif w + + break; case TYPE_DOUBLE: // Some data sources do not count dec in length (prec) prec += (dec + 2); // To be safe diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 0c89f8404f6..6aaa048de81 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -116,16 +116,24 @@ static int GetSQLCType(int type) /***********************************************************************/ /* TranslateSQLType: translate a SQL Type to a PLG type. */ /***********************************************************************/ -int TranslateSQLType(int stp, int prec, int& len, char& v) +int TranslateSQLType(int stp, int prec, int& len, char& v, bool& w) { int type; switch (stp) { + case SQL_WVARCHAR: // (-9) + w = true; case SQL_VARCHAR: // 12 v = 'V'; + type = TYPE_STRING; + break; + case SQL_WCHAR: // (-8) + w = true; case SQL_CHAR: // 1 type = TYPE_STRING; break; + case SQL_WLONGVARCHAR: // (-10) + w = true; case SQL_LONGVARCHAR: // (-1) v = 'V'; type = TYPE_STRING; @@ -180,7 +188,6 @@ int TranslateSQLType(int stp, int prec, int& len, char& v) case SQL_BINARY: // (-2) case SQL_VARBINARY: // (-3) case SQL_LONGVARBINARY: // (-4) -// case SQL_BIT: // (-7) case SQL_GUID: // (-11) default: type = TYPE_ERROR; @@ -410,6 +417,7 @@ PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop) PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info) { // int i, type, len, prec; + bool w = false; // PCOLRES crp, crpt, crpl, crpp; PQRYRES qrp; ODBConn *ocp; @@ -455,7 +463,7 @@ PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info) type = crpt->Kdata->GetIntValue(i); len = crpl->Kdata->GetIntValue(i); prec = crpp->Kdata->GetIntValue(i); - type = TranslateSQLType(type, prec, len); + type = TranslateSQLType(type, prec, len, w); crpt->Kdata->SetValue(type, i); // Some data sources do not count prec in length diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 63526f5fc48..c0e249adf12 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -502,7 +502,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) size = ((size + 7) / 8) * 8; /* Round up size to multiple of 8 */ pph = (PPOOLHEADER)memp; - if (trace > 2) + if (trace > 3) htrc("SubAlloc in %p size=%d used=%d free=%d\n", memp, size, pph->To_Free, pph->FreeBlk); @@ -526,7 +526,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) pph->To_Free += size; /* New offset of pool free block */ pph->FreeBlk -= size; /* New size of pool free block */ - if (trace > 2) + if (trace > 3) htrc("Done memp=%p used=%d free=%d\n", memp, pph->To_Free, pph->FreeBlk); diff --git a/storage/connect/value.h b/storage/connect/value.h index 207944594f1..f8cd1ba65a7 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -36,8 +36,9 @@ typedef struct _datpar *PDTP; // For DTVAL DllExport PSZ GetTypeName(int); DllExport int GetTypeSize(int, int); #ifdef ODBC_SUPPORT -/* This function is exported for use in EOM table type DLLs */ -DllExport int TranslateSQLType(int stp, int prec, int& len, char& v); +/* This function is exported for use in OEM table type DLLs */ +DllExport int TranslateSQLType(int stp, int prec, + int& len, char& v, bool& w); #endif DllExport char *GetFormatType(int); DllExport int GetFormatType(char); diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index 85b3fc9751c..a2d75cec8ab 100755 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -340,6 +340,9 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) } // endif n + if (trace) + htrc("XINDEX Make: n=%d\n", n); + // File position must be stored Record.Size = n * sizeof(int); @@ -477,6 +480,9 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) } else To_Rec[nkey] = Tdbp->GetRecpos(); + if (trace > 1) + htrc("Make: To_Rec[%d]=%d\n", nkey, To_Rec[nkey]); + /*******************************************************************/ /* Get the keys and place them in the key blocks. */ /*******************************************************************/ @@ -1759,6 +1765,9 @@ int XINDEX::Fetch(PGLOBAL g) if (Num_K == 0) return -1; // means end of file + if (trace > 1) + htrc("XINDEX Fetch: Op=%d\n", Op); + /*********************************************************************/ /* Table read through a sorted index. */ /*********************************************************************/ @@ -1776,9 +1785,6 @@ int XINDEX::Fetch(PGLOBAL g) break; case OP_SAME: // Read next same // Logically the key values should be the same as before - if (trace > 1) - htrc("looking for next same value\n"); - if (NextVal(true)) { Op = OP_EQ; return -2; // no more equal values @@ -1824,7 +1830,7 @@ int XINDEX::Fetch(PGLOBAL g) Nth++; if (trace > 1) - htrc("Fetch: Looking for new value\n"); + htrc("Fetch: Looking for new value Nth=%d\n", Nth); Cur_K = FastFind(); @@ -1896,6 +1902,10 @@ int XINDEX::FastFind(void) sup = To_KeyCol->Ndf; } // endif Nblk + if (trace > 2) + htrc("XINDEX FastFind: Nblk=%d Op=%d inf=%d sup=%d\n", + Nblk, Op, inf, sup); + for (k = 0, kcp = To_KeyCol; kcp; kcp = kcp->Next) { while (sup - inf > 1) { i = (inf + sup) >> 1; @@ -1970,6 +1980,9 @@ int XINDEX::FastFind(void) curk = (kcp->Kof) ? kcp->Kof[kcp->Val_K] : kcp->Val_K; } // endfor kcp + if (trace > 2) + htrc("XINDEX FastFind: curk=%d\n", curk); + return curk; } // end of FastFind @@ -2043,8 +2056,7 @@ int XINDXS::GroupSize(void) #if defined(_DEBUG) assert(To_KeyCol->Val_K >= 0 && To_KeyCol->Val_K < Ndif); #endif // _DEBUG - return (Pof) ? Pof[To_KeyCol->Val_K + 1] - Pof[To_KeyCol->Val_K] - : 1; + return (Pof) ? Pof[To_KeyCol->Val_K + 1] - Pof[To_KeyCol->Val_K] : 1; } // end of GroupSize /***********************************************************************/ @@ -2106,6 +2118,9 @@ int XINDXS::Fetch(PGLOBAL g) if (Num_K == 0) return -1; // means end of file + if (trace > 1) + htrc("XINDXS Fetch: Op=%d\n", Op); + /*********************************************************************/ /* Table read through a sorted index. */ /*********************************************************************/ @@ -2120,9 +2135,6 @@ int XINDXS::Fetch(PGLOBAL g) Op = OP_NEXT; break; case OP_SAME: // Read next same - if (trace > 1) - htrc("looking for next same value\n"); - if (!Mul || NextVal(true)) { Op = OP_EQ; return -2; // No more equal values @@ -2160,7 +2172,7 @@ int XINDXS::Fetch(PGLOBAL g) Nth++; if (trace > 1) - htrc("Fetch: Looking for new value\n"); + htrc("Fetch: Looking for new value Nth=%d\n", Nth); Cur_K = FastFind(); @@ -2192,7 +2204,7 @@ int XINDXS::Fetch(PGLOBAL g) /***********************************************************************/ int XINDXS::FastFind(void) { - register int sup, inf, i= 0, n = 2; + register int sup, inf, i= 0, n = 2; register PXCOL kcp = To_KeyCol; if (Nblk && Op == OP_EQ) { @@ -2215,7 +2227,6 @@ int XINDXS::FastFind(void) if (inf < 0) return Num_K; -// i = inf; inf *= Sblk; if ((sup = inf + Sblk) > Ndif) @@ -2227,6 +2238,10 @@ int XINDXS::FastFind(void) sup = Ndif; } // endif Nblk + if (trace > 2) + htrc("XINDXS FastFind: Nblk=%d Op=%d inf=%d sup=%d\n", + Nblk, Op, inf, sup); + while (sup - inf > 1) { i = (inf + sup) >> 1; @@ -2249,6 +2264,9 @@ int XINDXS::FastFind(void) n = 0; } // endif sup + if (trace > 2) + htrc("XINDXS FastFind: n=%d i=%d\n", n, i); + // Loop on kcp because of dynamic indexing for (; kcp; kcp = kcp->Next) kcp->Val_K = i; // Used by FillValue @@ -2330,6 +2348,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) } // endif NewOff.Low = (int)ftell(Xfile); + + if (trace) + htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); + } else if (mode == MODE_WRITE) { if (id >= 0) { // New not sep index file. Write the header. @@ -2337,6 +2359,10 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) Write(g, noff, sizeof(IOFF), MAX_INDX, rc); fseek(Xfile, 0, SEEK_END); NewOff.Low = (int)ftell(Xfile); + + if (trace) + htrc("XFILE Open: NewOff.Low=%d\n", NewOff.Low); + } // endif id } else if (mode == MODE_READ && id >= 0) { @@ -2346,6 +2372,9 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode) return true; } // endif MAX_INDX + if (trace) + htrc("XFILE Open: noff[%d].Low=%d\n", id, noff[id].Low); + // Position the cursor at the offset of this index if (fseek(Xfile, noff[id].Low, SEEK_SET)) { sprintf(g->Message, MSG(FUNC_ERRNO), errno, "Xseek"); @@ -3158,12 +3187,18 @@ bool KXYCOL::InitFind(PGLOBAL g, PXOB xp) xp->Reset(); xp->Eval(g); Valp->SetValue_pval(xp->GetValue(), false); -// Valp->SetValue_pval(xp->GetValue(), !Prefix); } // endif Type + if (trace > 1) { + char buf[32]; + + htrc("KCOL InitFind: value=%s\n", Valp->GetCharString(buf)); + } // endif trace + return false; } // end of InitFind +#if 0 /***********************************************************************/ /* InitBinFind: initialize Value to the value pointed by vp. */ /***********************************************************************/ @@ -3171,6 +3206,7 @@ void KXYCOL::InitBinFind(void *vp) { Valp->SetBinValue(vp); } // end of InitBinFind +#endif // 0 /***********************************************************************/ /* KXYCOL FillValue: called by COLBLK::Eval when a column value is */ diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index ad34259501f..a4e98075222 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -462,7 +462,7 @@ class KXYCOL: public BLOCK { virtual void FreeData(void); virtual void FillValue(PVAL valp); virtual int CompVal(int i); - void InitBinFind(void *vp); +// void InitBinFind(void *vp); bool MakeBlockArray(PGLOBAL g, int nb, int size); int Compare(int i1, int i2); int CompBval(int i); -- cgit v1.2.1 From af26c366e0e1a1dddcbec9f57706b7032768f29f Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 2 Jun 2015 12:28:42 +0200 Subject: Fix handling of NULL values when reading from tables. modified: storage/connect/tabodbc.cpp modified: storage/connect/value.h --- storage/connect/tabodbc.cpp | 6 +++++- storage/connect/value.h | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index ad7892469cd..307509848f4 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -1268,6 +1268,10 @@ void ODBCCOL::ReadColumn(PGLOBAL g) } // endif Buf_Type + // Handle null values + if (Value->IsZero()) + Value->SetNull(Nullable); + if (trace) { char buf[64]; @@ -1393,7 +1397,7 @@ void ODBCCOL::WriteColumn(PGLOBAL g) /* -------------------------- Class TDBXDBC -------------------------- */ /***********************************************************************/ -/* Implementation of the TDBODBC class. */ +/* Implementation of the TDBXDBC class. */ /***********************************************************************/ TDBXDBC::TDBXDBC(PODEF tdp) : TDBODBC(tdp) { diff --git a/storage/connect/value.h b/storage/connect/value.h index f8cd1ba65a7..780917c9962 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -360,14 +360,9 @@ class DllExport DTVAL : public TYPVAL { public: // Constructors DTVAL(PGLOBAL g, int n, int p, PSZ fmt); -//DTVAL(PGLOBAL g, PSZ s, int n); -//DTVAL(PGLOBAL g, short i); DTVAL(int n); -//DTVAL(PGLOBAL g, longlong n); -//DTVAL(PGLOBAL g, double f); // Implementation - virtual bool IsZero(void) {return Null;} virtual bool SetValue_pval(PVAL valp, bool chktype); virtual bool SetValue_char(char *p, int n); virtual void SetValue_psz(PSZ s); -- cgit v1.2.1 From 8e7d6652adda0eaa0ce095b5c2258d5be61487fd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 2 Jun 2015 22:07:47 +0200 Subject: CRLF->LF --- cmake/mysql_add_executable.cmake | 112 +-- cmake/versioninfo.rc.in | 76 +- debian/po/it.po | 10 +- debian/po/sv.po | 12 +- .../binlog/t/binlog_row_mysqlbinlog_options.test | 4 +- .../suite/optimizer_unfixed_bugs/t/bug42991.test | 496 ++++++------ mysql-test/t/aborted_clients.test | 56 +- mysql-test/t/auth_rpl.test | 132 +-- mysql-test/t/func_gconcat.test | 6 +- mysql-test/t/lowercase_table4.test | 214 ++--- mysys/my_gethwaddr.c | 2 +- mysys/my_init.c | 2 +- packaging/WiX/CPackWixConfig.cmake | 238 +++--- packaging/WiX/create_msi.cmake.in | 796 +++++++++--------- packaging/WiX/custom_ui.wxs | 230 +++--- packaging/WiX/extra.wxs.in | 162 ++-- packaging/WiX/mysql_server.wxs.in | 392 ++++----- sql-bench/limits/access_odbc.cfg | 894 ++++++++++----------- sql/message.h | 154 ++-- sql/message.rc | 4 +- sql/slave.cc | 4 +- sql/winservice.h | 80 +- storage/federatedx/CMakeLists.txt | 8 +- storage/federatedx/README.windows | 46 +- storage/maria/ma_test_force_start.pl | 2 +- 25 files changed, 2066 insertions(+), 2066 deletions(-) diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index b5f6b27abab..0c93fb179f5 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -1,56 +1,56 @@ -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Add executable plus some additional MySQL specific stuff -# Usage (same as for standard CMake's ADD_EXECUTABLE) -# -# MYSQL_ADD_EXECUTABLE(target source1...sourceN) -# -# MySQL specifics: -# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory -# On Windows : -# - add version resource -# - instruct CPack to do autenticode signing if SIGNCODE is set - -INCLUDE(cmake_parse_arguments) - -FUNCTION (MYSQL_ADD_EXECUTABLE) - # Pass-through arguments for ADD_EXECUTABLE - MYSQL_PARSE_ARGUMENTS(ARG - "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" - "" - ${ARGN} - ) - LIST(GET ARG_DEFAULT_ARGS 0 target) - LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) - - SET(sources ${ARG_DEFAULT_ARGS}) - ADD_VERSION_INFO(${target} EXECUTABLE sources) - ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) - # tell CPack where to install - IF(NOT ARG_EXCLUDE_FROM_ALL) - IF(NOT ARG_DESTINATION) - SET(ARG_DESTINATION ${INSTALL_BINDIR}) - ENDIF() - IF(ARG_COMPONENT) - SET(COMP COMPONENT ${ARG_COMPONENT}) - ELSEIF(MYSQL_INSTALL_COMPONENT) - SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT}) - ELSE() - SET(COMP COMPONENT Client) - ENDIF() - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) - ENDIF() -ENDFUNCTION() +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Add executable plus some additional MySQL specific stuff +# Usage (same as for standard CMake's ADD_EXECUTABLE) +# +# MYSQL_ADD_EXECUTABLE(target source1...sourceN) +# +# MySQL specifics: +# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory +# On Windows : +# - add version resource +# - instruct CPack to do autenticode signing if SIGNCODE is set + +INCLUDE(cmake_parse_arguments) + +FUNCTION (MYSQL_ADD_EXECUTABLE) + # Pass-through arguments for ADD_EXECUTABLE + MYSQL_PARSE_ARGUMENTS(ARG + "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" + "" + ${ARGN} + ) + LIST(GET ARG_DEFAULT_ARGS 0 target) + LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) + + SET(sources ${ARG_DEFAULT_ARGS}) + ADD_VERSION_INFO(${target} EXECUTABLE sources) + ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) + # tell CPack where to install + IF(NOT ARG_EXCLUDE_FROM_ALL) + IF(NOT ARG_DESTINATION) + SET(ARG_DESTINATION ${INSTALL_BINDIR}) + ENDIF() + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ELSEIF(MYSQL_INSTALL_COMPONENT) + SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT}) + ELSE() + SET(COMP COMPONENT Client) + ENDIF() + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) + ENDIF() +ENDFUNCTION() diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in index 6eb853936d2..cd880b917e0 100644 --- a/cmake/versioninfo.rc.in +++ b/cmake/versioninfo.rc.in @@ -1,38 +1,38 @@ -// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#include -VS_VERSION_INFO VERSIONINFO -FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@ -PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@ -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -FILEFLAGS 0 -FILEOS VOS__WINDOWS32 -FILETYPE @FILETYPE@ -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0" - VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END +// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#include +VS_VERSION_INFO VERSIONINFO +FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@ +PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@ +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE @FILETYPE@ +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0" + VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/debian/po/it.po b/debian/po/it.po index b377d9f9fb3..b1a3eba1836 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -1,8 +1,8 @@ -# Italian (it) translation of debconf templates for mysql-dfsg-5.1 -# Copyright (C) 2009 Software in the Public Interest -# This file is distributed under the same license as the mysql-dfsg-5.1 package. -# Luca Monducci , 2006 - 2009. -# +# Italian (it) translation of debconf templates for mysql-dfsg-5.1 +# Copyright (C) 2009 Software in the Public Interest +# This file is distributed under the same license as the mysql-dfsg-5.1 package. +# Luca Monducci , 2006 - 2009. +# msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37 italian debconf templates\n" diff --git a/debian/po/sv.po b/debian/po/sv.po index 297a2fb6d68..a05943fa719 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -1,9 +1,9 @@ -# Translation of mysql-dfsg-5.1 debconf template to Swedish -# Copyright (C) 2009 Martin Bagge -# This file is distributed under the same license as the mysql-dfsg-5.1 package. -# -# Andreas Henriksson , 2007 -# Martin Bagge , 2009 +# Translation of mysql-dfsg-5.1 debconf template to Swedish +# Copyright (C) 2009 Martin Bagge +# This file is distributed under the same license as the mysql-dfsg-5.1 package. +# +# Andreas Henriksson , 2007 +# Martin Bagge , 2009 msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n" diff --git a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_options.test b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_options.test index c1756b22eab..daf4969be85 100644 --- a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_options.test +++ b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_options.test @@ -45,8 +45,8 @@ INSERT INTO t3 VALUES (1),(2); INSERT INTO test1.t1 VALUES (3,3); USE test1; -LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE t1 - FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE t1 + FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; DELETE FROM test3.t3 WHERE a=1; flush logs; diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test index 6c6b416df8a..2b5864a3e69 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test +++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test @@ -1,248 +1,248 @@ ---source include/have_debug.inc -# Test for BUG#42991 "invalid memory access and/or crash when using -# index condition pushdown + InnoDB" -# Note that you need to run with --valgrind to see the warnings -# about invalid memory accesses. - ---source include/have_innodb.inc - -# Valgrind errors happen only with this: -set session debug_dbug="+d,optimizer_innodb_icp"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - - -DROP TABLE IF EXISTS `table5`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -CREATE TABLE `table5` ( - `col0` mediumtext, - `col1` varchar(90) DEFAULT NULL, - `col2` tinytext, - `col3` time DEFAULT NULL, - `col4` tinyint(1) DEFAULT NULL, - `col5` tinytext, - `col6` tinyint(1) DEFAULT NULL, - `col7` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `col8` tinyblob, - `col9` tinyint(4) DEFAULT NULL, - `col10` year(4) DEFAULT NULL, - `col11` set('test1','test2','test3') DEFAULT NULL, - `col12` text, - `col13` char(248) DEFAULT NULL, - `col14` bigint(20) DEFAULT NULL, - `col15` text, - `col16` tinyint(4) DEFAULT NULL, - `col17` decimal(10,0) DEFAULT NULL, - `col18` set('test1','test2','test3') DEFAULT NULL, - `col19` varchar(255) DEFAULT NULL, - `col20` float DEFAULT NULL, - `col21` int(11) DEFAULT NULL, - `col22` text, - `col23` tinyint(1) DEFAULT NULL, - `col24` decimal(10,0) NOT NULL DEFAULT '0', - `col25` double DEFAULT NULL, - `col26` float DEFAULT NULL, - `col27` tinyblob, - `col28` decimal(10,0) DEFAULT NULL, - `col29` mediumblob, - `col30` date DEFAULT NULL, - `col31` longtext, - `col32` date DEFAULT NULL, - `col33` float DEFAULT NULL, - `col34` bigint(20) DEFAULT NULL, - `col35` tinytext, - `col36` mediumtext, - `col37` time DEFAULT NULL, - `col38` int(11) DEFAULT NULL, - `col39` tinyint(4) DEFAULT NULL, - `col40` set('test1','test2','test3') DEFAULT NULL, - `col41` char(130) DEFAULT NULL, - `col42` smallint(6) DEFAULT NULL, - `col43` int(11) DEFAULT NULL, - `col44` mediumtext, - `col45` varchar(126) DEFAULT NULL, - `col46` int(11) DEFAULT NULL, - `col47` double DEFAULT NULL, - `col48` bigint(20) DEFAULT NULL, - `col49` mediumtext, - `col50` tinyblob, - `col51` mediumint(9) DEFAULT NULL, - `col52` text, - `col53` varchar(208) DEFAULT NULL, - `col54` varchar(207) DEFAULT NULL, - `col55` decimal(10,0) DEFAULT NULL, - `col56` datetime DEFAULT NULL, - `col57` enum('test1','test2','test3') DEFAULT NULL, - `col58` decimal(10,0) DEFAULT NULL, - `col59` tinyblob, - `col60` varchar(73) DEFAULT NULL, - `col61` mediumtext, - `col62` tinyblob, - `col63` datetime DEFAULT NULL, - `col64` decimal(10,0) DEFAULT NULL, - `col65` mediumint(9) DEFAULT NULL, - `col66` datetime DEFAULT NULL, - `col67` decimal(10,0) DEFAULT NULL, - `col68` tinyint(4) DEFAULT NULL, - `col69` varchar(58) DEFAULT NULL, - `col70` decimal(10,0) DEFAULT NULL, - `col71` mediumtext, - `col72` date DEFAULT NULL, - `col73` time DEFAULT NULL, - `col74` double DEFAULT NULL, - `col75` decimal(10,0) DEFAULT NULL, - `col76` mediumblob, - `col77` double DEFAULT NULL, - `col78` year(4) DEFAULT NULL, - `col79` year(4) DEFAULT NULL, - `col80` varchar(255) DEFAULT NULL, - `col81` blob, - `col82` bigint(20) DEFAULT NULL, - `col83` enum('test1','test2','test3') DEFAULT NULL, - `col84` decimal(10,0) DEFAULT NULL, - `col85` set('test1','test2','test3') DEFAULT NULL, - `col86` mediumtext, - `col87` varchar(255) DEFAULT NULL, - `col88` time DEFAULT NULL, - `col89` enum('test1','test2','test3') DEFAULT NULL, - `col90` decimal(10,0) DEFAULT NULL, - `col91` float DEFAULT NULL, - `col92` datetime DEFAULT NULL, - `col93` tinytext, - `col94` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `col95` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `col96` text, - `col97` double DEFAULT NULL, - `col98` varchar(198) DEFAULT NULL, - `col99` time DEFAULT NULL, - `col100` tinyint(4) DEFAULT NULL, - `col101` bigint(20) DEFAULT NULL, - `col102` varchar(255) DEFAULT NULL, - `col103` varchar(255) DEFAULT NULL, - `col104` mediumint(9) DEFAULT NULL, - `col105` mediumtext, - `col106` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `col107` smallint(6) DEFAULT NULL, - `col108` decimal(10,0) DEFAULT NULL, - `col109` decimal(10,0) DEFAULT NULL, - `col110` float DEFAULT NULL, - `col111` decimal(10,0) DEFAULT NULL, - `col112` double DEFAULT NULL, - `col113` tinytext, - `col114` float DEFAULT NULL, - `col115` varchar(7) DEFAULT NULL, - `col116` longtext, - `col117` date DEFAULT NULL, - `col118` bigint(20) DEFAULT NULL, - `col119` text, - `col120` bigint(20) DEFAULT NULL, - `col121` blob, - `col122` char(110) DEFAULT NULL, - `col123` decimal(10,0) DEFAULT NULL, - `col124` mediumblob, - `col125` decimal(10,0) DEFAULT NULL, - `col126` decimal(10,0) DEFAULT NULL, - `col127` tinyint(1) DEFAULT NULL, - `col128` time DEFAULT NULL, - `col129` tinyblob, - `col130` tinyblob, - `col131` date DEFAULT NULL, - `col132` int(11) DEFAULT NULL, - `col133` varchar(123) DEFAULT NULL, - `col134` char(238) DEFAULT NULL, - `col135` varchar(225) DEFAULT NULL, - `col136` longtext, - `col137` varchar(255) DEFAULT NULL, - `col138` double DEFAULT NULL, - `col139` tinyblob, - `col140` datetime DEFAULT NULL, - `col141` tinytext, - `col142` varchar(255) DEFAULT NULL, - `col143` bigint(20) DEFAULT NULL, - `col144` varchar(236) DEFAULT NULL, - `col145` text, - `col146` year(4) DEFAULT NULL, - `col147` decimal(10,0) DEFAULT NULL, - `col148` text, - `col149` mediumblob, - `col150` tinyint(4) DEFAULT NULL, - `col151` tinyint(1) DEFAULT NULL, - `col152` varchar(72) DEFAULT NULL, - `col153` int(11) DEFAULT NULL, - `col154` varchar(165) DEFAULT NULL, - `col155` tinyint(4) DEFAULT NULL, - `col156` mediumtext, - `col157` double DEFAULT NULL, - `col158` time DEFAULT NULL, - `col159` mediumblob, - `col160` varchar(255) DEFAULT NULL, - `col161` datetime DEFAULT NULL, - `col162` double DEFAULT NULL, - `col163` blob, - `col164` enum('test1','test2','test3') DEFAULT NULL, - `col165` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `col166` date DEFAULT NULL, - `col167` tinyblob, - `col168` tinyblob, - `col169` varchar(255) DEFAULT NULL, - `col170` datetime DEFAULT NULL, - `col171` bigint(20) DEFAULT NULL, - `col172` varchar(30) DEFAULT NULL, - `col173` longtext, - `col174` time DEFAULT NULL, - `col175` float DEFAULT NULL, - PRIMARY KEY (`col24`), - KEY `idx0` (`col16`,`col156`(139),`col97`,`col120`), - KEY `idx1` (`col24`,`col0`(108)), - KEY `idx2` (`col117`,`col173`(34),`col132`,`col82`), - KEY `idx3` (`col2`(86)), - KEY `idx4` (`col2`(43)), - KEY `idx5` (`col83`,`col35`(87),`col111`), - KEY `idx6` (`col6`,`col134`,`col92`), - KEY `idx7` (`col56`), - KEY `idx8` (`col30`,`col53`,`col129`(66)), - KEY `idx9` (`col53`,`col113`(211),`col32`,`col15`(75)), - KEY `idx10` (`col34`), - KEY `idx11` (`col126`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; - - -LOCK TABLES `table5` WRITE; -/*!40000 ALTER TABLE `table5` DISABLE KEYS */; -INSERT INTO `table5` VALUES ('referenda','hermaphroditism','superable','00:00:00',-128,NULL,-128,'0000-00-00 00:00:00',NULL,-128,1901,NULL,'blandly',NULL,6541,'unsuspectingly',NULL,'7250','',NULL,-31358,26248,'Kilmarnock\'s',127,'-27305',28987,NULL,NULL,'-30388','utilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitarians','0000-00-00','Agincourt','0000-00-00',-28063,27242,'readies',NULL,'00:00:00',NULL,-128,'',NULL,NULL,18719,NULL,NULL,14038,17275,NULL,'gait\'s','honeymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'sho',8860,NULL,'demigod','outpulling',NULL,'1904-01-17 09:51:06','test1','-18008','grotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'s','Oakleil\'s','Shostakovich','indiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscre','2076-10-05 02:05:43','29914',-18885,'2088-05-25 13:36:33','25',-128,'Bob','-14559','ammeter','0000-00-00','00:00:00',-29756,NULL,'digressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigression',-23894,1963,1915,'SadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadye',NULL,NULL,'','17512','','anaphylaxis\'s','chiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schise','50:11:25','test1','-13685',-18328,'2020-01-19 22:04:54',NULL,'1988-05-10 10:30:56','0000-00-00 00:00:00','Birdie\'s',-27746,NULL,'179:19:25',-128,24141,'radiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparen','ingroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'sing',18950,'Beaulieu','0000-00-00 00:00:00',-23421,'-2865',NULL,NULL,NULL,NULL,'vandalizes',-24683,'interop','Apis\'s','0000-00-00',19745,'Volgograd\'s',-15194,NULL,'Binni','4540','phylumphylumphylumphylum','-25781',NULL,-128,'406:37:03','posthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthastepos','manneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristman','0000-00-00',19774,'shariah',NULL,'aquarelle','homographic',NULL,-18959,'thoroughfarethoroughfarethoroughfarethoroughfarethoroughfarethoroughfare','2000-09-05 03:33:50','Baptlsta','Witt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'s',4727,NULL,'posting',2119,'32416',NULL,'charredcharredcharredcharredcharredcharredcharredcharredcharredcharred',-128,NULL,'Rollin\'s',NULL,NULL,127,'waviness\'s',11164,'424:28:18','FaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucher','stalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'s','1901-01-29 13:48:34',-31988,'Dyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'s','','2022-01-01 21:14:30','0000-00-00','conventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalist','mirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnesses','tessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stes','2028-05-21 04:56:16',NULL,'Hasid','Hardecanute','00:00:00',-3782); -INSERT INTO `table5` VALUES ('hemoglobin\'s','Toffey\'s','Juvenal','00:00:00',-128,'harmonicon',-128,'2004-02-13 09:45:46',NULL,NULL,1911,'','Tananarive\'s',NULL,30666,'spiniferous',127,'30675','','Frederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFr',30388,4769,'Erymanthus\'s',127,'-20972',NULL,-17111,'explosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosiveness','-28154','magnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'s','0000-00-00','removes','0000-00-00',16859,NULL,NULL,'Moishe\'s','00:00:00',NULL,NULL,NULL,'hyperform\'s',30540,-26603,'soporific',NULL,NULL,19264,-14618,NULL,'zootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszo',5654,'intermezzi','Atkins\'s','hieroglyphically','15885','2068-10-19 12:22:30','','4972','apatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapa','severeness','pleaders',NULL,'2070-09-15 17:21:46','15245',-18313,'1934-01-01 01:20:15','-3488',127,'Delawarian','14952','foregathers','0000-00-00','00:00:00',-27837,'7143','madhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'s',-17163,1951,2054,'raffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraf','REMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMs',3607,'','-17633','',NULL,NULL,'806:59:31','test1','-29600',20301,'1985-10-09 17:57:25',NULL,'0000-00-00 00:00:00','0000-00-00 00:00:00','Perseid',-32117,'constructer\'s','612:19:03',127,NULL,'overdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingove','Carlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCa',24868,'preamble','0000-00-00 00:00:00',-7582,'-865','-14488',6884,'-24713',NULL,'topknot\'s',18469,NULL,'histrionism\'s','0000-00-00',31715,'Dag',14543,'wooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'s','tightest',NULL,'aquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'s','15603',NULL,-128,'640:34:17','acetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumaceta','torridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridl','9323-05-13',-28292,'Barnaul\'s',NULL,'slanginesses','supernova',NULL,20804,NULL,'2020-10-05 12:00:38','rive',NULL,-31498,'considerateness\'s','nevus\'s',1901,'-12956','fashioner\'s','unfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'s',-128,127,'nephralgia\'s',13881,'sciatically',NULL,'Tuesday',21227,'00:00:00','halocarbons','duvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduv','2075-01-21 10:49:44',-19735,'snubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubs','test1','0000-00-00 00:00:00','0000-00-00','kiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkib',NULL,'connoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseurscon','1953-01-23 17:36:00',NULL,'Principal',NULL,'316:28:48',NULL); -INSERT INTO `table5` VALUES (NULL,'Annmarie','intangibleness\'s','00:00:00',-128,'transmogrify',127,'0000-00-00 00:00:00',NULL,127,2093,'','enamored','refired',-21296,'neglectful',127,'-9992','',NULL,NULL,3583,'Lockheed\'s',127,'-15717',-29743,-16280,'embouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembou','-24875',NULL,'0000-00-00',NULL,'0000-00-00',30124,20356,'drinkable','obscenity','00:00:00',NULL,127,'',NULL,-16664,NULL,'unmoor','Vaughan\'s',30457,-16509,-10049,'squeamishness','encirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencir',-16460,'abatement\'s',NULL,'expatriate','-28670','1925-05-15 11:44:20','','-3762','DelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDel','Skerl\'s','unmatched',NULL,'1980-01-11 16:02:04','25917',18187,'2001-07-26 13:48:08','-28706',127,'gimme','8807',NULL,'0000-00-00','00:00:00',7666,'21762','drawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacks',16131,2031,2077,'subjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysub','Argenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'s',NULL,'','-17090','','fobs','humiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliat','221:02:40','','-1107',4624,'1926-05-11 03:35:52',NULL,'2037-05-13 05:02:44','0000-00-00 00:00:00','Heddie\'s',-6554,NULL,'00:00:00',127,NULL,'lxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlx','RawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawley',6613,'Beaufort','0000-00-00 00:00:00',12214,NULL,'25469',-26474,'12062',NULL,'physiographer',26382,'cosmogo','deportment\'s','0000-00-00',17492,'propretor\'s',NULL,'zingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzing','Suzetta','25513','tearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkers','21613',NULL,-128,'108:58:18','sporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallyspo','Monera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'','0000-00-00',18776,'diffractometer',NULL,'crawls','Inglebert','unguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableun',18112,'melanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanis','1940-05-18 13:21:00','artlessly','blotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblots',6476,NULL,'Bartlett',2143,NULL,'thaumaturge\'s','Hazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'s',127,127,'Winthorpe',-29765,'idiocrasy\'s',NULL,'sandcastles',-9852,'281:41:52','Volny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'s','protagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagon','2076-01-04 15:01:57',NULL,'auscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultations','','0000-00-00 00:00:00','0000-00-00','limenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimen','accommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatingly',NULL,'2018-01-01 05:48:54',17404,NULL,NULL,'195:36:50',24658); -INSERT INTO `table5` VALUES ('caddishly',NULL,'Kotah','00:00:00',-128,'tailoring',127,'0000-00-00 00:00:00','trustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustie',-128,1967,NULL,NULL,'parallelisms',NULL,NULL,127,NULL,'',NULL,NULL,-513,NULL,NULL,'-14518',NULL,-22393,'AngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAng','32257','regalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregaling','0000-00-00','newspaperwoman','0000-00-00',24845,-17741,'impassiveness','Antillean','00:00:00',-13615,-128,'','gantries',-27983,-6070,'Benetton','aridest',NULL,21574,-25634,'McWilliams\'s','burrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowe',18947,NULL,NULL,'surrealistic',NULL,'1954-07-07 08:58:49','test1','-11714','ExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExEx','administrants','Oxycontin','interpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterper','1914-05-28 05:15:03','3942',NULL,'2046-09-07 18:16:36','3220',127,'arising','18472','anacolutha','0000-00-00','613:15:45',NULL,'-23969',NULL,18979,2031,1975,'AlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcesti','septicitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticities',-25058,'',NULL,'','Kulturkampf','pollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpol','00:00:00','','12283',2881,'1926-12-10 09:24:42','Darken\'s','2034-12-21 15:59:00','0000-00-00 00:00:00',NULL,NULL,NULL,'305:05:06',127,NULL,'feudalityfeudality','Merrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMer',-25733,'borak','0000-00-00 00:00:00',-11465,'877',NULL,-1029,'5107',NULL,'Balaton\'s',NULL,'Martian','miserliness','0000-00-00',14689,'catchment',18457,'billet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'s','humerus\'s','24741',NULL,NULL,'-19233',-128,'00:00:00','fashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfas','judiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjud','0000-00-00',15972,'Letrice\'s','hydrographer',NULL,'Federica','evidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevi',4115,'pshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspsh','1924-10-15 16:31:18','Hamlet','trowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'',-3485,'galvanized',NULL,1924,'-22877','unfired','inchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'s',-128,-128,'VHF',-5304,NULL,127,'glossator',16348,'213:10:59','',NULL,'1946-01-11 17:25:16',262,'DoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDouty','test1','0000-00-00 00:00:00','0000-00-00',NULL,'feasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasibl','contortionisticcontortionisticcontortionisticcontortionisticcontortionisticcontortionisticcontortionistic','2027-06-09 07:56:16',6909,'tessitura','indefensible','00:00:00',-6628); -INSERT INTO `table5` VALUES ('bassoonist\'s',NULL,'refastens','114:27:50',127,'unrestricted',127,'2032-01-13 11:11:22','abstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'s',NULL,1955,'','Hodosh','allocates',-5067,'Cenac\'s',-128,'31546',NULL,'impassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassab',-30347,292,'Sandi\'s',NULL,'-12402',8206,NULL,'encircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircl','6346','ArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentinians','0000-00-00','Riehl\'s','0000-00-00',NULL,5580,'planets',NULL,'58:35:07',317,127,'','gender',-19514,7112,'Pissaro','relevantly',28777,-21818,-17111,'shoddiness\'s',NULL,NULL,'flee','Boatwright\'s','restrict','12537','2096-04-25 08:45:21','test1','-4613','quagga','masterstroke\'s','overcheck\'s',NULL,'1981-10-14 18:30:02','21097',-26481,'2065-07-11 02:13:44',NULL,NULL,'bathroom','-29833','gracelessness\'s','0000-00-00','09:44:40',-7368,NULL,'applecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'s',-21077,2015,2039,'cascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scas','nervingnervingnervingnervingnervingnervingnervingnervingnervingnerving',22043,'','5740','','mustached','actin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'s','00:00:00','test1','13871',-22276,'1956-01-05 15:08:47','slimline','0000-00-00 00:00:00','0000-00-00 00:00:00','royally',NULL,'mako','51:54:53',NULL,NULL,'deliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'s','DOADOADOADOADOADOADOADOADOADOADOADOADOA',-16244,'Fayette\'s','2020-06-21 05:34:18',-24353,'24097','-28819',12278,'-2365',21322,'stumps',-61,NULL,'subpoena\'s','0000-00-00',31242,'knicker',23567,NULL,'Cathar','29557','thallusthallusthallusthallusthallusthallusthallusthallusthallusthallus','26114',NULL,-128,'00:00:00','salmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsal','shiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshive','0000-00-00',-3152,'syndesis','misbrands','Smiga','stagnation\'s','nonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricno',NULL,NULL,'1988-09-11 14:33:03',NULL,'provokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglypr',25510,'thunderpeal\'s','hierology',1932,'7729','Fahrenheit','metathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'s',NULL,-128,'sinfonia\'s',-6293,'proactive',127,NULL,-24751,'00:00:00','woodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopper','Constantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'','1997-01-01 22:40:48',NULL,'MatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlick','test1','2000-12-17 11:19:08','0000-00-00',NULL,'cosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmica','Loesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesc','2078-07-25 04:56:08',10472,NULL,NULL,'345:12:02',-13120); -INSERT INTO `table5` VALUES ('segmentation\'s','shapelessness\'s','coagulators','127:46:24',-128,NULL,127,'0000-00-00 00:00:00','seekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingsee',NULL,2085,'','indent','flyblown',NULL,'Alegre',-128,'-27917','','DesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDes',2473,NULL,'screwball\'s',NULL,'-4861',-7088,-30734,'tambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintam',NULL,NULL,'0000-00-00','Dorcia','0000-00-00',-25745,-1237,'Shoifet\'s','sarsaparillas','21:11:41',31612,-128,'','subway\'s',-5032,-30369,'preventives','lyre',7995,21283,13197,'chippies','rubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubig',19050,'orch','semiliterates','Gerome',NULL,'2058-12-26 21:29:19','',NULL,'dyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdya','Dukas\'s','Christiania','polyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvale','1920-05-23 14:07:00','672',NULL,'1956-06-27 12:15:00','-22658',NULL,'holograph\'s',NULL,'gutsy','0000-00-00','00:00:00',-9558,'1148','fainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfains',NULL,2023,2132,'Balmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBal','overdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdo',-24707,'test1','-13970','','tensility','BuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddie','00:00:00','','580',25115,'2000-07-01 09:01:36','apprentice','1992-01-01 08:55:38','0000-00-00 00:00:00','premunire',24664,NULL,'821:21:05',NULL,-29284,'rapidestrapidestrapidestrapidestrapidestrapidestrapidest','convectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorcon',-3808,'intuitively','0000-00-00 00:00:00',-22296,NULL,'2802',28786,NULL,NULL,'loanword',-12107,'deodori','strophe','0000-00-00',-11013,'undeclared',-8513,'sinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'s','peloria\'s','14940','blushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblush','30550','11566',127,'00:00:00','worktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'swo','looker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'s','5657-05-11',23094,'onerousness','bearer','censured','Shoemaker','mulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomul',5930,'ZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoust','1953-04-28 11:55:44','consulted','invalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinv',-27798,'carnauba\'s','Wilson',1963,NULL,'On\'s','leisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurely',NULL,-128,NULL,17674,'Queenstown\'s',-128,'convertors',1776,'576:20:59',NULL,'allegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriall','2097-10-02 08:41:26',31057,'AfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikaners','test1','0000-00-00 00:00:00','0000-00-00','backwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbac',NULL,NULL,'1932-10-01 18:49:04',12985,NULL,'leukocytes','603:54:26',-22488); -INSERT INTO `table5` VALUES ('Frasquito\'s','unsatisfactory','jetted','00:00:00',NULL,'Merlin\'s',127,'0000-00-00 00:00:00',NULL,NULL,1998,'','decomposer','Commons',-14813,'oversimplification\'s',NULL,'-5368','','engirdengirdengirdengirdengirdengirdengirdengirdengird',-13627,14305,'frontally',127,'18421',-32295,NULL,NULL,'21841',NULL,'0000-00-00','cytology','2424-00-17',-30542,-17621,'octarchy\'s','outfoxed','00:00:00',27469,-128,'','Kamat\'s',-24130,-5948,'riband','Betsy',NULL,-18769,NULL,NULL,'Serafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSeraf',NULL,'disconcerting',NULL,'whirly','-20343','2020-07-01 12:09:36','','-26975','antiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticant',NULL,'ecumenically','utilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilize','1952-08-01 17:53:28','7903',-5633,'2024-03-17 13:46:59','-5474',127,'Malmö\'s',NULL,NULL,'0000-00-00','571:58:00',17287,'26711','alphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetize',-15158,2001,1997,'hobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithob','Campinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'s',-5693,'test1','3741','','Audrye\'s','monstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymo','00:00:00','test1','-21023',4693,'1998-01-06 04:41:40','Silastic\'s','0000-00-00 00:00:00','0000-00-00 00:00:00','Hedelman\'s',-30080,'normalization\'s','00:00:00',NULL,8197,NULL,NULL,NULL,'nudism\'s','2005-04-13 00:31:55',29046,'8992','11992',NULL,'-1685',-11453,'mythology\'s',26185,'Pyrenea','Pedrick\'s','0000-00-00',27436,'shots',NULL,'discordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscords','bayonet','-7217','scriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscripts',NULL,'17182',NULL,'628:49:55','nunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenuncle',NULL,'0000-00-00',-17444,'celestite\'s','Adars','Hispaniola','Mesopotamians','agglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutin',31998,'electrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistriesele','2005-09-09 23:41:06','bastinaded',NULL,-10763,'impetuosity\'s','xenogenesis\'s',1947,'-29913',NULL,'taxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomies',NULL,NULL,'internees',28697,'Kharkov\'s',NULL,'Swabia',18366,'00:00:00','delayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayer','circusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycir','2066-02-13 14:27:00',-28405,NULL,'test1','0000-00-00 00:00:00','0000-00-00','heterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotr','enchondromaenchondromaenchondromaenchondromaenchondromaenchondromaenchondromaenchondroma','AryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAry','2090-10-13 10:03:05',NULL,NULL,'Yucatan','285:37:51',7627); -/*!40000 ALTER TABLE `table5` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - - -#explain select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; - -select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; - -drop table `table5`; +--source include/have_debug.inc +# Test for BUG#42991 "invalid memory access and/or crash when using +# index condition pushdown + InnoDB" +# Note that you need to run with --valgrind to see the warnings +# about invalid memory accesses. + +--source include/have_innodb.inc + +# Valgrind errors happen only with this: +set session debug_dbug="+d,optimizer_innodb_icp"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +DROP TABLE IF EXISTS `table5`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +CREATE TABLE `table5` ( + `col0` mediumtext, + `col1` varchar(90) DEFAULT NULL, + `col2` tinytext, + `col3` time DEFAULT NULL, + `col4` tinyint(1) DEFAULT NULL, + `col5` tinytext, + `col6` tinyint(1) DEFAULT NULL, + `col7` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `col8` tinyblob, + `col9` tinyint(4) DEFAULT NULL, + `col10` year(4) DEFAULT NULL, + `col11` set('test1','test2','test3') DEFAULT NULL, + `col12` text, + `col13` char(248) DEFAULT NULL, + `col14` bigint(20) DEFAULT NULL, + `col15` text, + `col16` tinyint(4) DEFAULT NULL, + `col17` decimal(10,0) DEFAULT NULL, + `col18` set('test1','test2','test3') DEFAULT NULL, + `col19` varchar(255) DEFAULT NULL, + `col20` float DEFAULT NULL, + `col21` int(11) DEFAULT NULL, + `col22` text, + `col23` tinyint(1) DEFAULT NULL, + `col24` decimal(10,0) NOT NULL DEFAULT '0', + `col25` double DEFAULT NULL, + `col26` float DEFAULT NULL, + `col27` tinyblob, + `col28` decimal(10,0) DEFAULT NULL, + `col29` mediumblob, + `col30` date DEFAULT NULL, + `col31` longtext, + `col32` date DEFAULT NULL, + `col33` float DEFAULT NULL, + `col34` bigint(20) DEFAULT NULL, + `col35` tinytext, + `col36` mediumtext, + `col37` time DEFAULT NULL, + `col38` int(11) DEFAULT NULL, + `col39` tinyint(4) DEFAULT NULL, + `col40` set('test1','test2','test3') DEFAULT NULL, + `col41` char(130) DEFAULT NULL, + `col42` smallint(6) DEFAULT NULL, + `col43` int(11) DEFAULT NULL, + `col44` mediumtext, + `col45` varchar(126) DEFAULT NULL, + `col46` int(11) DEFAULT NULL, + `col47` double DEFAULT NULL, + `col48` bigint(20) DEFAULT NULL, + `col49` mediumtext, + `col50` tinyblob, + `col51` mediumint(9) DEFAULT NULL, + `col52` text, + `col53` varchar(208) DEFAULT NULL, + `col54` varchar(207) DEFAULT NULL, + `col55` decimal(10,0) DEFAULT NULL, + `col56` datetime DEFAULT NULL, + `col57` enum('test1','test2','test3') DEFAULT NULL, + `col58` decimal(10,0) DEFAULT NULL, + `col59` tinyblob, + `col60` varchar(73) DEFAULT NULL, + `col61` mediumtext, + `col62` tinyblob, + `col63` datetime DEFAULT NULL, + `col64` decimal(10,0) DEFAULT NULL, + `col65` mediumint(9) DEFAULT NULL, + `col66` datetime DEFAULT NULL, + `col67` decimal(10,0) DEFAULT NULL, + `col68` tinyint(4) DEFAULT NULL, + `col69` varchar(58) DEFAULT NULL, + `col70` decimal(10,0) DEFAULT NULL, + `col71` mediumtext, + `col72` date DEFAULT NULL, + `col73` time DEFAULT NULL, + `col74` double DEFAULT NULL, + `col75` decimal(10,0) DEFAULT NULL, + `col76` mediumblob, + `col77` double DEFAULT NULL, + `col78` year(4) DEFAULT NULL, + `col79` year(4) DEFAULT NULL, + `col80` varchar(255) DEFAULT NULL, + `col81` blob, + `col82` bigint(20) DEFAULT NULL, + `col83` enum('test1','test2','test3') DEFAULT NULL, + `col84` decimal(10,0) DEFAULT NULL, + `col85` set('test1','test2','test3') DEFAULT NULL, + `col86` mediumtext, + `col87` varchar(255) DEFAULT NULL, + `col88` time DEFAULT NULL, + `col89` enum('test1','test2','test3') DEFAULT NULL, + `col90` decimal(10,0) DEFAULT NULL, + `col91` float DEFAULT NULL, + `col92` datetime DEFAULT NULL, + `col93` tinytext, + `col94` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `col95` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `col96` text, + `col97` double DEFAULT NULL, + `col98` varchar(198) DEFAULT NULL, + `col99` time DEFAULT NULL, + `col100` tinyint(4) DEFAULT NULL, + `col101` bigint(20) DEFAULT NULL, + `col102` varchar(255) DEFAULT NULL, + `col103` varchar(255) DEFAULT NULL, + `col104` mediumint(9) DEFAULT NULL, + `col105` mediumtext, + `col106` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `col107` smallint(6) DEFAULT NULL, + `col108` decimal(10,0) DEFAULT NULL, + `col109` decimal(10,0) DEFAULT NULL, + `col110` float DEFAULT NULL, + `col111` decimal(10,0) DEFAULT NULL, + `col112` double DEFAULT NULL, + `col113` tinytext, + `col114` float DEFAULT NULL, + `col115` varchar(7) DEFAULT NULL, + `col116` longtext, + `col117` date DEFAULT NULL, + `col118` bigint(20) DEFAULT NULL, + `col119` text, + `col120` bigint(20) DEFAULT NULL, + `col121` blob, + `col122` char(110) DEFAULT NULL, + `col123` decimal(10,0) DEFAULT NULL, + `col124` mediumblob, + `col125` decimal(10,0) DEFAULT NULL, + `col126` decimal(10,0) DEFAULT NULL, + `col127` tinyint(1) DEFAULT NULL, + `col128` time DEFAULT NULL, + `col129` tinyblob, + `col130` tinyblob, + `col131` date DEFAULT NULL, + `col132` int(11) DEFAULT NULL, + `col133` varchar(123) DEFAULT NULL, + `col134` char(238) DEFAULT NULL, + `col135` varchar(225) DEFAULT NULL, + `col136` longtext, + `col137` varchar(255) DEFAULT NULL, + `col138` double DEFAULT NULL, + `col139` tinyblob, + `col140` datetime DEFAULT NULL, + `col141` tinytext, + `col142` varchar(255) DEFAULT NULL, + `col143` bigint(20) DEFAULT NULL, + `col144` varchar(236) DEFAULT NULL, + `col145` text, + `col146` year(4) DEFAULT NULL, + `col147` decimal(10,0) DEFAULT NULL, + `col148` text, + `col149` mediumblob, + `col150` tinyint(4) DEFAULT NULL, + `col151` tinyint(1) DEFAULT NULL, + `col152` varchar(72) DEFAULT NULL, + `col153` int(11) DEFAULT NULL, + `col154` varchar(165) DEFAULT NULL, + `col155` tinyint(4) DEFAULT NULL, + `col156` mediumtext, + `col157` double DEFAULT NULL, + `col158` time DEFAULT NULL, + `col159` mediumblob, + `col160` varchar(255) DEFAULT NULL, + `col161` datetime DEFAULT NULL, + `col162` double DEFAULT NULL, + `col163` blob, + `col164` enum('test1','test2','test3') DEFAULT NULL, + `col165` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `col166` date DEFAULT NULL, + `col167` tinyblob, + `col168` tinyblob, + `col169` varchar(255) DEFAULT NULL, + `col170` datetime DEFAULT NULL, + `col171` bigint(20) DEFAULT NULL, + `col172` varchar(30) DEFAULT NULL, + `col173` longtext, + `col174` time DEFAULT NULL, + `col175` float DEFAULT NULL, + PRIMARY KEY (`col24`), + KEY `idx0` (`col16`,`col156`(139),`col97`,`col120`), + KEY `idx1` (`col24`,`col0`(108)), + KEY `idx2` (`col117`,`col173`(34),`col132`,`col82`), + KEY `idx3` (`col2`(86)), + KEY `idx4` (`col2`(43)), + KEY `idx5` (`col83`,`col35`(87),`col111`), + KEY `idx6` (`col6`,`col134`,`col92`), + KEY `idx7` (`col56`), + KEY `idx8` (`col30`,`col53`,`col129`(66)), + KEY `idx9` (`col53`,`col113`(211),`col32`,`col15`(75)), + KEY `idx10` (`col34`), + KEY `idx11` (`col126`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +SET character_set_client = @saved_cs_client; + + +LOCK TABLES `table5` WRITE; +/*!40000 ALTER TABLE `table5` DISABLE KEYS */; +INSERT INTO `table5` VALUES ('referenda','hermaphroditism','superable','00:00:00',-128,NULL,-128,'0000-00-00 00:00:00',NULL,-128,1901,NULL,'blandly',NULL,6541,'unsuspectingly',NULL,'7250','',NULL,-31358,26248,'Kilmarnock\'s',127,'-27305',28987,NULL,NULL,'-30388','utilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitarians','0000-00-00','Agincourt','0000-00-00',-28063,27242,'readies',NULL,'00:00:00',NULL,-128,'',NULL,NULL,18719,NULL,NULL,14038,17275,NULL,'gait\'s','honeymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'sho',8860,NULL,'demigod','outpulling',NULL,'1904-01-17 09:51:06','test1','-18008','grotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'s','Oakleil\'s','Shostakovich','indiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscre','2076-10-05 02:05:43','29914',-18885,'2088-05-25 13:36:33','25',-128,'Bob','-14559','ammeter','0000-00-00','00:00:00',-29756,NULL,'digressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigression',-23894,1963,1915,'SadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadye',NULL,NULL,'','17512','','anaphylaxis\'s','chiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schise','50:11:25','test1','-13685',-18328,'2020-01-19 22:04:54',NULL,'1988-05-10 10:30:56','0000-00-00 00:00:00','Birdie\'s',-27746,NULL,'179:19:25',-128,24141,'radiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparen','ingroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'sing',18950,'Beaulieu','0000-00-00 00:00:00',-23421,'-2865',NULL,NULL,NULL,NULL,'vandalizes',-24683,'interop','Apis\'s','0000-00-00',19745,'Volgograd\'s',-15194,NULL,'Binni','4540','phylumphylumphylumphylum','-25781',NULL,-128,'406:37:03','posthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthastepos','manneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristman','0000-00-00',19774,'shariah',NULL,'aquarelle','homographic',NULL,-18959,'thoroughfarethoroughfarethoroughfarethoroughfarethoroughfarethoroughfare','2000-09-05 03:33:50','Baptlsta','Witt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'s',4727,NULL,'posting',2119,'32416',NULL,'charredcharredcharredcharredcharredcharredcharredcharredcharredcharred',-128,NULL,'Rollin\'s',NULL,NULL,127,'waviness\'s',11164,'424:28:18','FaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucher','stalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'s','1901-01-29 13:48:34',-31988,'Dyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'s','','2022-01-01 21:14:30','0000-00-00','conventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalist','mirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnesses','tessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stes','2028-05-21 04:56:16',NULL,'Hasid','Hardecanute','00:00:00',-3782); +INSERT INTO `table5` VALUES ('hemoglobin\'s','Toffey\'s','Juvenal','00:00:00',-128,'harmonicon',-128,'2004-02-13 09:45:46',NULL,NULL,1911,'','Tananarive\'s',NULL,30666,'spiniferous',127,'30675','','Frederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFrederick\'sFr',30388,4769,'Erymanthus\'s',127,'-20972',NULL,-17111,'explosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosivenessexplosiveness','-28154','magnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'smagnitude\'s','0000-00-00','removes','0000-00-00',16859,NULL,NULL,'Moishe\'s','00:00:00',NULL,NULL,NULL,'hyperform\'s',30540,-26603,'soporific',NULL,NULL,19264,-14618,NULL,'zootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszootechnicszo',5654,'intermezzi','Atkins\'s','hieroglyphically','15885','2068-10-19 12:22:30','','4972','apatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapatosaurapa','severeness','pleaders',NULL,'2070-09-15 17:21:46','15245',-18313,'1934-01-01 01:20:15','-3488',127,'Delawarian','14952','foregathers','0000-00-00','00:00:00',-27837,'7143','madhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'smadhouse\'s',-17163,1951,2054,'raffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraffiaraf','REMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMsREMs',3607,'','-17633','',NULL,NULL,'806:59:31','test1','-29600',20301,'1985-10-09 17:57:25',NULL,'0000-00-00 00:00:00','0000-00-00 00:00:00','Perseid',-32117,'constructer\'s','612:19:03',127,NULL,'overdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingoverdressingove','Carlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCarlstrom\'sCa',24868,'preamble','0000-00-00 00:00:00',-7582,'-865','-14488',6884,'-24713',NULL,'topknot\'s',18469,NULL,'histrionism\'s','0000-00-00',31715,'Dag',14543,'wooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'swooziness\'s','tightest',NULL,'aquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'saquiculture\'s','15603',NULL,-128,'640:34:17','acetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumacetabulumaceta','torridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridlytorridl','9323-05-13',-28292,'Barnaul\'s',NULL,'slanginesses','supernova',NULL,20804,NULL,'2020-10-05 12:00:38','rive',NULL,-31498,'considerateness\'s','nevus\'s',1901,'-12956','fashioner\'s','unfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'sunfitness\'s',-128,127,'nephralgia\'s',13881,'sciatically',NULL,'Tuesday',21227,'00:00:00','halocarbons','duvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduvetynduv','2075-01-21 10:49:44',-19735,'snubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubssnubs','test1','0000-00-00 00:00:00','0000-00-00','kiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkiblahkib',NULL,'connoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseursconnoisseurscon','1953-01-23 17:36:00',NULL,'Principal',NULL,'316:28:48',NULL); +INSERT INTO `table5` VALUES (NULL,'Annmarie','intangibleness\'s','00:00:00',-128,'transmogrify',127,'0000-00-00 00:00:00',NULL,127,2093,'','enamored','refired',-21296,'neglectful',127,'-9992','',NULL,NULL,3583,'Lockheed\'s',127,'-15717',-29743,-16280,'embouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembouchureembou','-24875',NULL,'0000-00-00',NULL,'0000-00-00',30124,20356,'drinkable','obscenity','00:00:00',NULL,127,'',NULL,-16664,NULL,'unmoor','Vaughan\'s',30457,-16509,-10049,'squeamishness','encirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencirclingencir',-16460,'abatement\'s',NULL,'expatriate','-28670','1925-05-15 11:44:20','','-3762','DelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDelwynDel','Skerl\'s','unmatched',NULL,'1980-01-11 16:02:04','25917',18187,'2001-07-26 13:48:08','-28706',127,'gimme','8807',NULL,'0000-00-00','00:00:00',7666,'21762','drawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacksdrawbacks',16131,2031,2077,'subjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysubjectivitysub','Argenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'sArgenteuil\'s',NULL,'','-17090','','fobs','humiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliatinglyhumiliat','221:02:40','','-1107',4624,'1926-05-11 03:35:52',NULL,'2037-05-13 05:02:44','0000-00-00 00:00:00','Heddie\'s',-6554,NULL,'00:00:00',127,NULL,'lxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlxlx','RawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawleyRawley',6613,'Beaufort','0000-00-00 00:00:00',12214,NULL,'25469',-26474,'12062',NULL,'physiographer',26382,'cosmogo','deportment\'s','0000-00-00',17492,'propretor\'s',NULL,'zingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzingzing','Suzetta','25513','tearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkerstearjerkers','21613',NULL,-128,'108:58:18','sporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallysporadicallyspo','Monera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'sMonera\'','0000-00-00',18776,'diffractometer',NULL,'crawls','Inglebert','unguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableunguessableun',18112,'melanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanismmelanis','1940-05-18 13:21:00','artlessly','blotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblotsblots',6476,NULL,'Bartlett',2143,NULL,'thaumaturge\'s','Hazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'sHazelton\'s',127,127,'Winthorpe',-29765,'idiocrasy\'s',NULL,'sandcastles',-9852,'281:41:52','Volny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'sVolny\'s','protagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagonist\'sprotagon','2076-01-04 15:01:57',NULL,'auscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultationsauscultations','','0000-00-00 00:00:00','0000-00-00','limenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimenlimen','accommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatinglyaccommodatingly',NULL,'2018-01-01 05:48:54',17404,NULL,NULL,'195:36:50',24658); +INSERT INTO `table5` VALUES ('caddishly',NULL,'Kotah','00:00:00',-128,'tailoring',127,'0000-00-00 00:00:00','trustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustiestrustie',-128,1967,NULL,NULL,'parallelisms',NULL,NULL,127,NULL,'',NULL,NULL,-513,NULL,NULL,'-14518',NULL,-22393,'AngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAngeliAng','32257','regalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregalingregaling','0000-00-00','newspaperwoman','0000-00-00',24845,-17741,'impassiveness','Antillean','00:00:00',-13615,-128,'','gantries',-27983,-6070,'Benetton','aridest',NULL,21574,-25634,'McWilliams\'s','burrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowedburrowe',18947,NULL,NULL,'surrealistic',NULL,'1954-07-07 08:58:49','test1','-11714','ExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExExEx','administrants','Oxycontin','interpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterpersonalinterper','1914-05-28 05:15:03','3942',NULL,'2046-09-07 18:16:36','3220',127,'arising','18472','anacolutha','0000-00-00','613:15:45',NULL,'-23969',NULL,18979,2031,1975,'AlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcestisAlcesti','septicitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticitiessepticities',-25058,'',NULL,'','Kulturkampf','pollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpollutantpol','00:00:00','','12283',2881,'1926-12-10 09:24:42','Darken\'s','2034-12-21 15:59:00','0000-00-00 00:00:00',NULL,NULL,NULL,'305:05:06',127,NULL,'feudalityfeudality','Merrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMerrili\'sMer',-25733,'borak','0000-00-00 00:00:00',-11465,'877',NULL,-1029,'5107',NULL,'Balaton\'s',NULL,'Martian','miserliness','0000-00-00',14689,'catchment',18457,'billet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'sbillet\'s','humerus\'s','24741',NULL,NULL,'-19233',-128,'00:00:00','fashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfashfas','judiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjudiciaryjud','0000-00-00',15972,'Letrice\'s','hydrographer',NULL,'Federica','evidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevidentlyevi',4115,'pshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspshawspsh','1924-10-15 16:31:18','Hamlet','trowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'strowel\'',-3485,'galvanized',NULL,1924,'-22877','unfired','inchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'sinchworm\'s',-128,-128,'VHF',-5304,NULL,127,'glossator',16348,'213:10:59','',NULL,'1946-01-11 17:25:16',262,'DoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDoutyDouty','test1','0000-00-00 00:00:00','0000-00-00',NULL,'feasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasiblefeasibl','contortionisticcontortionisticcontortionisticcontortionisticcontortionisticcontortionisticcontortionistic','2027-06-09 07:56:16',6909,'tessitura','indefensible','00:00:00',-6628); +INSERT INTO `table5` VALUES ('bassoonist\'s',NULL,'refastens','114:27:50',127,'unrestricted',127,'2032-01-13 11:11:22','abstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'sabstainer\'s',NULL,1955,'','Hodosh','allocates',-5067,'Cenac\'s',-128,'31546',NULL,'impassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassabilityimpassab',-30347,292,'Sandi\'s',NULL,'-12402',8206,NULL,'encircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircleencircl','6346','ArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentiniansArgentinians','0000-00-00','Riehl\'s','0000-00-00',NULL,5580,'planets',NULL,'58:35:07',317,127,'','gender',-19514,7112,'Pissaro','relevantly',28777,-21818,-17111,'shoddiness\'s',NULL,NULL,'flee','Boatwright\'s','restrict','12537','2096-04-25 08:45:21','test1','-4613','quagga','masterstroke\'s','overcheck\'s',NULL,'1981-10-14 18:30:02','21097',-26481,'2065-07-11 02:13:44',NULL,NULL,'bathroom','-29833','gracelessness\'s','0000-00-00','09:44:40',-7368,NULL,'applecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'sapplecart\'s',-21077,2015,2039,'cascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scascara\'scas','nervingnervingnervingnervingnervingnervingnervingnervingnervingnerving',22043,'','5740','','mustached','actin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'sactin\'s','00:00:00','test1','13871',-22276,'1956-01-05 15:08:47','slimline','0000-00-00 00:00:00','0000-00-00 00:00:00','royally',NULL,'mako','51:54:53',NULL,NULL,'deliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'sdeliquescence\'s','DOADOADOADOADOADOADOADOADOADOADOADOADOA',-16244,'Fayette\'s','2020-06-21 05:34:18',-24353,'24097','-28819',12278,'-2365',21322,'stumps',-61,NULL,'subpoena\'s','0000-00-00',31242,'knicker',23567,NULL,'Cathar','29557','thallusthallusthallusthallusthallusthallusthallusthallusthallusthallus','26114',NULL,-128,'00:00:00','salmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsalmonoidsal','shiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshiveshive','0000-00-00',-3152,'syndesis','misbrands','Smiga','stagnation\'s','nonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricnonelectricno',NULL,NULL,'1988-09-11 14:33:03',NULL,'provokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglyprovokinglypr',25510,'thunderpeal\'s','hierology',1932,'7729','Fahrenheit','metathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'smetathesis\'s',NULL,-128,'sinfonia\'s',-6293,'proactive',127,NULL,-24751,'00:00:00','woodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopperwoodchopper','Constantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'sConstantinople\'','1997-01-01 22:40:48',NULL,'MatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlickMatlick','test1','2000-12-17 11:19:08','0000-00-00',NULL,'cosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmicalcosmica','Loesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesceke\'sLoesc','2078-07-25 04:56:08',10472,NULL,NULL,'345:12:02',-13120); +INSERT INTO `table5` VALUES ('segmentation\'s','shapelessness\'s','coagulators','127:46:24',-128,NULL,127,'0000-00-00 00:00:00','seekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingseekingsee',NULL,2085,'','indent','flyblown',NULL,'Alegre',-128,'-27917','','DesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDesiraeDes',2473,NULL,'screwball\'s',NULL,'-4861',-7088,-30734,'tambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintambourintam',NULL,NULL,'0000-00-00','Dorcia','0000-00-00',-25745,-1237,'Shoifet\'s','sarsaparillas','21:11:41',31612,-128,'','subway\'s',-5032,-30369,'preventives','lyre',7995,21283,13197,'chippies','rubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubiginousrubig',19050,'orch','semiliterates','Gerome',NULL,'2058-12-26 21:29:19','',NULL,'dyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdyad\'sdya','Dukas\'s','Christiania','polyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvalenciespolyvale','1920-05-23 14:07:00','672',NULL,'1956-06-27 12:15:00','-22658',NULL,'holograph\'s',NULL,'gutsy','0000-00-00','00:00:00',-9558,'1148','fainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfainsfains',NULL,2023,2132,'Balmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBalmung\'sBal','overdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdooverdo',-24707,'test1','-13970','','tensility','BuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddieBuddie','00:00:00','','580',25115,'2000-07-01 09:01:36','apprentice','1992-01-01 08:55:38','0000-00-00 00:00:00','premunire',24664,NULL,'821:21:05',NULL,-29284,'rapidestrapidestrapidestrapidestrapidestrapidestrapidest','convectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorconvectorcon',-3808,'intuitively','0000-00-00 00:00:00',-22296,NULL,'2802',28786,NULL,NULL,'loanword',-12107,'deodori','strophe','0000-00-00',-11013,'undeclared',-8513,'sinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'ssinuosity\'s','peloria\'s','14940','blushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblushblush','30550','11566',127,'00:00:00','worktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'sworktable\'swo','looker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'slooker\'s','5657-05-11',23094,'onerousness','bearer','censured','Shoemaker','mulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomulattomul',5930,'ZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoustZlatoust','1953-04-28 11:55:44','consulted','invalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinvalidity\'sinv',-27798,'carnauba\'s','Wilson',1963,NULL,'On\'s','leisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurelyleisurely',NULL,-128,NULL,17674,'Queenstown\'s',-128,'convertors',1776,'576:20:59',NULL,'allegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriallegriall','2097-10-02 08:41:26',31057,'AfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikanersAfrikaners','test1','0000-00-00 00:00:00','0000-00-00','backwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbackwardsbac',NULL,NULL,'1932-10-01 18:49:04',12985,NULL,'leukocytes','603:54:26',-22488); +INSERT INTO `table5` VALUES ('Frasquito\'s','unsatisfactory','jetted','00:00:00',NULL,'Merlin\'s',127,'0000-00-00 00:00:00',NULL,NULL,1998,'','decomposer','Commons',-14813,'oversimplification\'s',NULL,'-5368','','engirdengirdengirdengirdengirdengirdengirdengirdengird',-13627,14305,'frontally',127,'18421',-32295,NULL,NULL,'21841',NULL,'0000-00-00','cytology','2424-00-17',-30542,-17621,'octarchy\'s','outfoxed','00:00:00',27469,-128,'','Kamat\'s',-24130,-5948,'riband','Betsy',NULL,-18769,NULL,NULL,'Serafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSerafina\'sSeraf',NULL,'disconcerting',NULL,'whirly','-20343','2020-07-01 12:09:36','','-26975','antiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticantiphlogisticant',NULL,'ecumenically','utilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilizerutilize','1952-08-01 17:53:28','7903',-5633,'2024-03-17 13:46:59','-5474',127,'Malmö\'s',NULL,NULL,'0000-00-00','571:58:00',17287,'26711','alphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetizealphabetize',-15158,2001,1997,'hobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithobbithob','Campinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'sCampinas\'s',-5693,'test1','3741','','Audrye\'s','monstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymonstrouslymo','00:00:00','test1','-21023',4693,'1998-01-06 04:41:40','Silastic\'s','0000-00-00 00:00:00','0000-00-00 00:00:00','Hedelman\'s',-30080,'normalization\'s','00:00:00',NULL,8197,NULL,NULL,NULL,'nudism\'s','2005-04-13 00:31:55',29046,'8992','11992',NULL,'-1685',-11453,'mythology\'s',26185,'Pyrenea','Pedrick\'s','0000-00-00',27436,'shots',NULL,'discordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscordsdiscords','bayonet','-7217','scriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscriptsscripts',NULL,'17182',NULL,'628:49:55','nunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenunclenuncle',NULL,'0000-00-00',-17444,'celestite\'s','Adars','Hispaniola','Mesopotamians','agglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutinativeagglutin',31998,'electrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistrieselectrochemistriesele','2005-09-09 23:41:06','bastinaded',NULL,-10763,'impetuosity\'s','xenogenesis\'s',1947,'-29913',NULL,'taxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomiestaxonomies',NULL,NULL,'internees',28697,'Kharkov\'s',NULL,'Swabia',18366,'00:00:00','delayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayerdelayer','circusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycircusycir','2066-02-13 14:27:00',-28405,NULL,'test1','0000-00-00 00:00:00','0000-00-00','heterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotrophicheterotr','enchondromaenchondromaenchondromaenchondromaenchondromaenchondromaenchondromaenchondroma','AryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAryAry','2090-10-13 10:03:05',NULL,NULL,'Yucatan','285:37:51',7627); +/*!40000 ALTER TABLE `table5` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +#explain select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; + +select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; + +drop table `table5`; diff --git a/mysql-test/t/aborted_clients.test b/mysql-test/t/aborted_clients.test index fafcfb6b3e9..20ddc9991e6 100644 --- a/mysql-test/t/aborted_clients.test +++ b/mysql-test/t/aborted_clients.test @@ -1,28 +1,28 @@ -# Test case for MDEV-246, lp:992983 -# Check that ordinary connect/disconnect does not increase aborted_clients -# status variable, but KILL connection does - --- source include/not_embedded.inc --- source include/count_sessions.inc - -FLUSH STATUS; -# Connect/Disconnect look that aborted_clients stays 0 -connect (con1,localhost,root,,); -disconnect con1; -connection default; --- source include/wait_until_count_sessions.inc -# Check that there is 0 aborted clients so far -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients'; - -# Kill a connection, check that aborted_clients is incremented -connect(con2,localhost,root,,); ---disable_reconnect ---error ER_CONNECTION_KILLED -KILL CONNECTION_ID(); -disconnect con2; -connection default; --- source include/wait_until_count_sessions.inc - -# aborted clients must be 1 now -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients'; -FLUSH STATUS; +# Test case for MDEV-246, lp:992983 +# Check that ordinary connect/disconnect does not increase aborted_clients +# status variable, but KILL connection does + +-- source include/not_embedded.inc +-- source include/count_sessions.inc + +FLUSH STATUS; +# Connect/Disconnect look that aborted_clients stays 0 +connect (con1,localhost,root,,); +disconnect con1; +connection default; +-- source include/wait_until_count_sessions.inc +# Check that there is 0 aborted clients so far +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients'; + +# Kill a connection, check that aborted_clients is incremented +connect(con2,localhost,root,,); +--disable_reconnect +--error ER_CONNECTION_KILLED +KILL CONNECTION_ID(); +disconnect con2; +connection default; +-- source include/wait_until_count_sessions.inc + +# aborted clients must be 1 now +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients'; +FLUSH STATUS; diff --git a/mysql-test/t/auth_rpl.test b/mysql-test/t/auth_rpl.test index c413a84b53c..0ff024c73e7 100644 --- a/mysql-test/t/auth_rpl.test +++ b/mysql-test/t/auth_rpl.test @@ -1,66 +1,66 @@ ---source include/have_plugin_auth.inc ---source include/not_embedded.inc ---source include/master-slave.inc - -# -# Check that replication slave can connect to master using an account -# which authenticates with an external authentication plugin (bug#12897501). - -# -# First stop the slave to guarantee that nothing is replicated. -# ---connection slave ---echo [connection slave] ---source include/stop_slave.inc -# -# Create an replication account on the master. -# ---connection master ---echo [connection master] -CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user'; -GRANT REPLICATION SLAVE ON *.* TO plug_user; -FLUSH PRIVILEGES; - -# -# Now go to slave and change the replication user. -# ---connection slave ---echo [connection slave] ---let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1) -CHANGE MASTER TO - MASTER_USER= 'plug_user', - MASTER_PASSWORD= 'plug_user'; - -# -# Start slave with new replication account - this should trigger connection -# to the master server. -# ---source include/start_slave.inc - -# Replicate all statements executed on master, in this case, -# (creation of the plug_user account). -# ---connection master ---sync_slave_with_master ---echo # Slave in-sync with master now. - -SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user'; - -# -# Now we can stop the slave and clean up. -# -# Note: it is important that slave is stopped at this -# moment - otherwise master's cleanup statements -# would be replicated on slave! -# ---echo # Cleanup (on slave). ---source include/stop_slave.inc -eval CHANGE MASTER TO MASTER_USER='$master_user'; -DROP USER 'plug_user'; - ---echo # Cleanup (on master). ---connection master -DROP USER 'plug_user'; - ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc +--source include/have_plugin_auth.inc +--source include/not_embedded.inc +--source include/master-slave.inc + +# +# Check that replication slave can connect to master using an account +# which authenticates with an external authentication plugin (bug#12897501). + +# +# First stop the slave to guarantee that nothing is replicated. +# +--connection slave +--echo [connection slave] +--source include/stop_slave.inc +# +# Create an replication account on the master. +# +--connection master +--echo [connection master] +CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user'; +GRANT REPLICATION SLAVE ON *.* TO plug_user; +FLUSH PRIVILEGES; + +# +# Now go to slave and change the replication user. +# +--connection slave +--echo [connection slave] +--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1) +CHANGE MASTER TO + MASTER_USER= 'plug_user', + MASTER_PASSWORD= 'plug_user'; + +# +# Start slave with new replication account - this should trigger connection +# to the master server. +# +--source include/start_slave.inc + +# Replicate all statements executed on master, in this case, +# (creation of the plug_user account). +# +--connection master +--sync_slave_with_master +--echo # Slave in-sync with master now. + +SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user'; + +# +# Now we can stop the slave and clean up. +# +# Note: it is important that slave is stopped at this +# moment - otherwise master's cleanup statements +# would be replicated on slave! +# +--echo # Cleanup (on slave). +--source include/stop_slave.inc +eval CHANGE MASTER TO MASTER_USER='$master_user'; +DROP USER 'plug_user'; + +--echo # Cleanup (on master). +--connection master +DROP USER 'plug_user'; + +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 20fbed702e9..42a30760a86 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -49,9 +49,9 @@ select grp,group_concat(c order by grp desc) from t1 group by grp order by grp; # Test transfer to real values -select grp, group_concat(a separator "")+0 from t1 group by grp; -select grp, group_concat(a separator "")+0.0 from t1 group by grp; -select grp, ROUND(group_concat(a separator "")) from t1 group by grp; +select grp, group_concat(a separator "")+0 from t1 group by grp; +select grp, group_concat(a separator "")+0.0 from t1 group by grp; +select grp, ROUND(group_concat(a separator "")) from t1 group by grp; drop table t1; # Test NULL values diff --git a/mysql-test/t/lowercase_table4.test b/mysql-test/t/lowercase_table4.test index 783a4fcae51..0775d87fc9d 100644 --- a/mysql-test/t/lowercase_table4.test +++ b/mysql-test/t/lowercase_table4.test @@ -1,108 +1,108 @@ ---source include/have_case_insensitive_file_system.inc ---source include/have_innodb.inc - ---echo # ---echo # Bug#46941 crash with lower_case_table_names=2 and ---echo # foreign data dictionary confusion ---echo # - -CREATE DATABASE XY; -USE XY; - -# -# Logs are disabled, since the number of creates tables -# and subsequent select statements may vary between -# versions -# ---disable_query_log ---disable_result_log - +--source include/have_case_insensitive_file_system.inc +--source include/have_innodb.inc + +--echo # +--echo # Bug#46941 crash with lower_case_table_names=2 and +--echo # foreign data dictionary confusion +--echo # + +CREATE DATABASE XY; +USE XY; + +# +# Logs are disabled, since the number of creates tables +# and subsequent select statements may vary between +# versions +# +--disable_query_log +--disable_result_log + let $tcs = `SELECT @@table_open_cache + 1`; - -let $i = $tcs; - -while ($i) -{ - eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, - primary key(a, b), unique(b)) ENGINE=InnoDB; - dec $i; -} - -eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b), - ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b); - -eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b), - ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a); - -let $i = $tcs; -while ($i) -{ - eval SELECT * FROM XY.T_$i LIMIT 1; - dec $i; -} - -DROP DATABASE XY; -CREATE DATABASE XY; -USE XY; -eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, - PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB; -# -# The bug causes this SELECT to err -eval SELECT * FROM XY.T_$tcs LIMIT 1; - ---enable_query_log ---enable_result_log -DROP DATABASE XY; -USE TEST; - ---echo # ---echo # Bug55222 Mysqldump table names case bug in REFERENCES clause ---echo # InnoDB did not handle lower_case_table_names=2 for ---echo # foreign_table_names and referenced_table_names. ---echo # - -SHOW VARIABLES LIKE 'lower_case_table_names'; - ---disable_warnings -DROP TABLE IF EXISTS `Table2`; -DROP TABLE IF EXISTS `Table1`; ---disable_warnings - -CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1); -query_vertical SHOW CREATE TABLE `Table2`; -query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS; -DROP TABLE `Table2`; -DROP TABLE `Table1`; - ---disable_warnings -DROP TABLE IF EXISTS Product_Order; -DROP TABLE IF EXISTS Product; -DROP TABLE IF EXISTS Customer; ---enable_warnings - -CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL, - Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB; -CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB; -CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT, - Product_Category INT NOT NULL, - Product_Id INT NOT NULL, - Customer_Id INT NOT NULL, - PRIMARY KEY(No), - INDEX (Product_Category, Product_Id), - FOREIGN KEY (Product_Category, Product_Id) - REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT, - INDEX (Customer_Id), - FOREIGN KEY (Customer_Id) - REFERENCES Customer(Id) - ) ENGINE=INNODB; - -query_vertical SHOW CREATE TABLE Product_Order; -query_vertical SHOW CREATE TABLE Product; -query_vertical SHOW CREATE TABLE Customer; -query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS; -DROP TABLE Product_Order; -DROP TABLE Product; -DROP TABLE Customer; - + +let $i = $tcs; + +while ($i) +{ + eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, + primary key(a, b), unique(b)) ENGINE=InnoDB; + dec $i; +} + +eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b), + ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b); + +eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b), + ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a); + +let $i = $tcs; +while ($i) +{ + eval SELECT * FROM XY.T_$i LIMIT 1; + dec $i; +} + +DROP DATABASE XY; +CREATE DATABASE XY; +USE XY; +eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, + PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB; +# +# The bug causes this SELECT to err +eval SELECT * FROM XY.T_$tcs LIMIT 1; + +--enable_query_log +--enable_result_log +DROP DATABASE XY; +USE TEST; + +--echo # +--echo # Bug55222 Mysqldump table names case bug in REFERENCES clause +--echo # InnoDB did not handle lower_case_table_names=2 for +--echo # foreign_table_names and referenced_table_names. +--echo # + +SHOW VARIABLES LIKE 'lower_case_table_names'; + +--disable_warnings +DROP TABLE IF EXISTS `Table2`; +DROP TABLE IF EXISTS `Table1`; +--disable_warnings + +CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB; +ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1); +query_vertical SHOW CREATE TABLE `Table2`; +query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS; +DROP TABLE `Table2`; +DROP TABLE `Table1`; + +--disable_warnings +DROP TABLE IF EXISTS Product_Order; +DROP TABLE IF EXISTS Product; +DROP TABLE IF EXISTS Customer; +--enable_warnings + +CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL, + Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB; +CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB; +CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT, + Product_Category INT NOT NULL, + Product_Id INT NOT NULL, + Customer_Id INT NOT NULL, + PRIMARY KEY(No), + INDEX (Product_Category, Product_Id), + FOREIGN KEY (Product_Category, Product_Id) + REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT, + INDEX (Customer_Id), + FOREIGN KEY (Customer_Id) + REFERENCES Customer(Id) + ) ENGINE=INNODB; + +query_vertical SHOW CREATE TABLE Product_Order; +query_vertical SHOW CREATE TABLE Product; +query_vertical SHOW CREATE TABLE Customer; +query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS; +DROP TABLE Product_Order; +DROP TABLE Product; +DROP TABLE Customer; + diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c index 74dae29f235..db026c13700 100644 --- a/mysys/my_gethwaddr.c +++ b/mysys/my_gethwaddr.c @@ -130,7 +130,7 @@ err: #elif defined(_WIN32) #include #include -#pragma comment(lib, "iphlpapi.lib") +#pragma comment(lib, "iphlpapi.lib") #define ETHER_ADDR_LEN 6 diff --git a/mysys/my_init.c b/mysys/my_init.c index 193c8281577..99efba14a73 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -25,7 +25,7 @@ #ifdef _MSC_VER #include #include -/* WSAStartup needs winsock library*/ +/* WSAStartup needs winsock library*/ #pragma comment(lib, "ws2_32") #endif my_bool have_tcpip=0; diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake index c782b7cd17a..9caae8375d8 100644 --- a/packaging/WiX/CPackWixConfig.cmake +++ b/packaging/WiX/CPackWixConfig.cmake @@ -1,119 +1,119 @@ -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -IF(ESSENTIALS) - SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles") - SET(CPACK_WIX_UI "WixUI_InstallDir") - IF(CMAKE_SIZEOF_VOID_P MATCHES 8) - SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-winx64") - ELSE() - SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-win32") - ENDIF() -ELSE() - SET(CPACK_COMPONENTS_USED - "Server;Client;DataFiles;Development;SharedLibraries;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries") -ENDIF() - - -# Some components like Embedded are optional -# We will build MSI without embedded if it was not selected for build -#(need to modify CPACK_COMPONENTS_ALL for that) -SET(CPACK_ALL) -FOREACH(comp1 ${CPACK_COMPONENTS_USED}) - SET(found) - FOREACH(comp2 ${CPACK_COMPONENTS_ALL}) - IF(comp1 STREQUAL comp2) - SET(found 1) - BREAK() - ENDIF() - ENDFOREACH() - IF(found) - SET(CPACK_ALL ${CPACK_ALL} ${comp1}) - ENDIF() -ENDFOREACH() -SET(CPACK_COMPONENTS_ALL ${CPACK_ALL}) - -# Always install (hidden), includes Readme files -SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1) -SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall") - -# Feature MySQL Server -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server") -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1") -SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server") - # Subfeature "Server" (hidden) - SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer") - SET(CPACK_COMPONENT_SERVER_HIDDEN 1) - # Subfeature "Client" - SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer") - SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs") - SET(CPACK_COMPONENT_CLIENT_DESCRIPTION - "Various helpful (commandline) tools including the mysql command line client" ) - # Subfeature "Debug binaries" - SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer") - SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries") - SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION - "Debug/trace versions of executables and libraries" ) - #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) - - - #Subfeature "Data Files" - SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") - SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files") - SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" ) - SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1) - - -#Feature "Devel" -SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components") -SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries") - #Subfeature "Development" - SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel") - SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1) - - #Subfeature "Shared libraries" - SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel") - SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)") - SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library") - - #Subfeature "Embedded" - SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel") - SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library") - SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library") - SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2) - -#Feature Debug Symbols -SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols") -SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols") -SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2) - SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols") - SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1) - -#Feature Documentation -SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") -SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation") -SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2) - -#Feature tests -SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests") -SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)") -SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2) - - -#Feature Misc (hidden, installs only if everything is installed) -SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1) -SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100) - SET(CPACK_COMPONENT_INIFILES_GROUP "Misc") - SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc") +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +IF(ESSENTIALS) + SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles") + SET(CPACK_WIX_UI "WixUI_InstallDir") + IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-winx64") + ELSE() + SET(CPACK_PACKAGE_FILE_NAME "mysql-essential-${VERSION}-win32") + ENDIF() +ELSE() + SET(CPACK_COMPONENTS_USED + "Server;Client;DataFiles;Development;SharedLibraries;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries") +ENDIF() + + +# Some components like Embedded are optional +# We will build MSI without embedded if it was not selected for build +#(need to modify CPACK_COMPONENTS_ALL for that) +SET(CPACK_ALL) +FOREACH(comp1 ${CPACK_COMPONENTS_USED}) + SET(found) + FOREACH(comp2 ${CPACK_COMPONENTS_ALL}) + IF(comp1 STREQUAL comp2) + SET(found 1) + BREAK() + ENDIF() + ENDFOREACH() + IF(found) + SET(CPACK_ALL ${CPACK_ALL} ${comp1}) + ENDIF() +ENDFOREACH() +SET(CPACK_COMPONENTS_ALL ${CPACK_ALL}) + +# Always install (hidden), includes Readme files +SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1) +SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall") + +# Feature MySQL Server +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server") +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1") +SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server") + # Subfeature "Server" (hidden) + SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer") + SET(CPACK_COMPONENT_SERVER_HIDDEN 1) + # Subfeature "Client" + SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer") + SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs") + SET(CPACK_COMPONENT_CLIENT_DESCRIPTION + "Various helpful (commandline) tools including the mysql command line client" ) + # Subfeature "Debug binaries" + SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer") + SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries") + SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION + "Debug/trace versions of executables and libraries" ) + #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) + + + #Subfeature "Data Files" + SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") + SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files") + SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" ) + SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1) + + +#Feature "Devel" +SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components") +SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries") + #Subfeature "Development" + SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel") + SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1) + + #Subfeature "Shared libraries" + SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel") + SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)") + SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library") + + #Subfeature "Embedded" + SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel") + SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library") + SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library") + SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2) + +#Feature Debug Symbols +SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols") +SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols") +SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2) + SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols") + SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1) + +#Feature Documentation +SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") +SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation") +SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2) + +#Feature tests +SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests") +SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)") +SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2) + + +#Feature Misc (hidden, installs only if everything is installed) +SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1) +SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100) + SET(CPACK_COMPONENT_INIFILES_GROUP "Misc") + SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc") diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in index 8de271fc1cf..d0a8f0046cf 100644 --- a/packaging/WiX/create_msi.cmake.in +++ b/packaging/WiX/create_msi.cmake.in @@ -1,398 +1,398 @@ -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") -SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") -SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@") -SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@") -SET(CMAKE_COMMAND "@CMAKE_COMMAND@") -SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") -SET(VERSION "@VERSION@") -SET(MAJOR_VERSION "@MAJOR_VERSION@") -SET(MINOR_VERSION "@MINOR_VERSION@") -SET(PATCH_VERSION "@PATCH_VERSION@") -SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@) -SET(MANUFACTURER "@MANUFACTURER@") -SET(WIXCA_LOCATION "@WIXCA_LOCATION@") -SET(COPYING_RTF "@COPYING_RTF@") -SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@") -SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@") - -LIST(APPEND EXCLUDE_DIRS - bin/debug - data/test - lib/plugin/debug - mysql-test - scripts - sql-bench -) - -LIST(APPEND EXCLUDE_FILES - bin/echo.exe - bin/mysql_client_test_embedded.exe - bin/mysqld-debug.exe - bin/mysqltest_embedded.exe - bin/replace.exe - lib/debug/mysqlserver.lib - lib/libmysqld.dll - lib/libmysqld.lib - lib/mysqlserver.lib - lib/mysqlservices.lib -) - -IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(Win64 " Win64='yes'") - SET(Platform x64) - SET(PlatformProgramFilesFolder ProgramFiles64Folder) -ELSE() - SET(Platform x86) - SET(PlatformProgramFilesFolder ProgramFilesFolder) - SET(Win64) -ENDIF() - -SET(ENV{VS_UNICODE_OUTPUT}) - -# Switch off the monolithic install -EXECUTE_PROCESS( - COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR} - OUTPUT_QUIET -) - -INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake) - -IF(CPACK_WIX_CONFIG) - INCLUDE(${CPACK_WIX_CONFIG}) -ENDIF() - -IF(NOT CPACK_WIX_UI) - SET(CPACK_WIX_UI "WixUI_Mondo_Custom") -ENDIF() - -SET(WIX_FEATURES) -FOREACH(comp ${CPACK_COMPONENTS_ALL}) - STRING(TOUPPER "${comp}" comp_upper) - IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP) - SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}") - SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1) - SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME}) - SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION}) - SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL}) - SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper}) - ELSE() - SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP}) - SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME}) - LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp}) - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES WIX_FEATURES) - -SET(CPACK_WIX_FEATURES) - -FOREACH(f ${WIX_FEATURES}) - STRING(TOUPPER "${f}" f_upper) - STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper}) - IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) - SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME}) - ELSE() - SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) - ENDIF() - - IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) - SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION}) - ELSE() - SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) - ENDIF() - IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL) - SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL}) - ELSE() - SET(Level 1) - ENDIF() - IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN) - SET(DISPLAY "Display='hidden'") - SET(TITLE ${f_upper}) - SET(DESCRIPTION ${f_upper}) - ELSE() - SET(DISPLAY) - IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED) - SET(DISPLAY "Display='expand'") - ENDIF() - IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) - SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME}) - ELSE() - SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) - ENDIF() - IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) - SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION}) - ELSE() - SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) - ENDIF() - ENDIF() - - SET(CPACK_WIX_FEATURES - "${CPACK_WIX_FEATURES} - " - ) - FOREACH(c ${${f}_COMPONENTS}) - STRING(TOUPPER "${c}" c_upper) - IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME) - SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME}) - ELSE() - SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME) - ENDIF() - - IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION) - SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION}) - ELSE() - SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION) - ENDIF() - IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL) - SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL}) - ELSE() - SET(Level 1) - ENDIF() - IF(CPACK_COMPONENT_${c_upper}_HIDDEN) - SET(CPACK_WIX_FEATURES - "${CPACK_WIX_FEATURES} - ") - ELSE() - SET(CPACK_WIX_FEATURES - "${CPACK_WIX_FEATURES} - - - ") - ENDIF() - - ENDFOREACH() - SET(CPACK_WIX_FEATURES - "${CPACK_WIX_FEATURES} - - ") -ENDFOREACH() - - -IF(CMAKE_INSTALL_CONFIG_NAME) - STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" - WIXCA_LOCATION "${WIXCA_LOCATION}") - SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}") -ENDIF() - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) - - -FOREACH(comp ${CPACK_COMPONENTS_ALL}) - SET(ENV{DESTDIR} testinstall/${comp}) - SET(DIRS ${DIRS} testinstall/${comp}) - EXECUTE_PROCESS( - COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp} - -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake - OUTPUT_QUIET - ) -ENDFOREACH() - -MACRO(GENERATE_GUID VarName) - EXECUTE_PROCESS(COMMAND uuidgen -c - OUTPUT_VARIABLE ${VarName} - OUTPUT_STRIP_TRAILING_WHITESPACE) -ENDMACRO() - -SET(INC_VAR 0) -MACRO(MAKE_WIX_IDENTIFIER str varname) - STRING(REPLACE "/" "." ${varname} "${str}") - STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}") - STRING(LENGTH "${${varname}}" len) - # Identifier should be smaller than 72 character - # We have to cut down the length to 70 chars, since we add 2 char prefix - # pretty often - IF(len GREATER 70) - STRING(SUBSTRING "${${varname}}" 0 67 shortstr) - MATH(EXPR INC_VAR ${INC_VAR}+1) - SET(${varname} "${shortstr}${INC_VAR}") - ENDIF() -ENDMACRO() - - -FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root) - FILE(RELATIVE_PATH dir_rel ${topdir} ${dir}) - IF(dir_rel) - LIST(FIND EXCLUDE_DIRS ${dir_rel} TO_EXCLUDE) - IF(NOT TO_EXCLUDE EQUAL -1) - MESSAGE(STATUS "excluding directory: ${dir_rel}") - RETURN() - ENDIF() - ENDIF() - FILE(GLOB all_files ${dir}/*) - IF(NOT all_files) - RETURN() - ENDIF() - IF(dir_rel) - MAKE_DIRECTORY(${dir_root}/${dir_rel}) - MAKE_WIX_IDENTIFIER("${dir_rel}" id) - SET(DirectoryRefId "D.${id}") - ELSE() - SET(DirectoryRefId "INSTALLDIR") - ENDIF() - FILE(APPEND ${file} "\n") - - SET(NONEXEFILES) - FOREACH(f ${all_files}) - IF(NOT IS_DIRECTORY ${f}) - FILE(RELATIVE_PATH rel ${topdir} ${f}) - SET(TO_EXCLUDE) - IF(rel MATCHES "\\.pdb$") - SET(TO_EXCLUDE TRUE) - ELSE() - LIST(FIND EXCLUDE_FILES ${rel} RES) - IF(NOT RES EQUAL -1) - SET(TO_EXCLUDE TRUE) - ENDIF() - ENDIF() - IF(TO_EXCLUDE) - MESSAGE(STATUS "excluding file: ${rel}") - ELSE() - MAKE_WIX_IDENTIFIER("${rel}" id) - FILE(TO_NATIVE_PATH ${f} f_native) - GET_FILENAME_COMPONENT(f_ext "${f}" EXT) - # According to MSDN each DLL or EXE should be in the own component - IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll") - - FILE(APPEND ${file} " \n") - FILE(APPEND ${file} " \n") - FILE(APPEND ${file} " \n") - FILE(APPEND ${file_comp} " \n") - ELSE() - SET(NONEXEFILES "${NONEXEFILES}\n" ) - ENDIF() - ENDIF() - ENDIF() - ENDFOREACH() - FILE(APPEND ${file} "\n") - IF(NONEXEFILES) - GENERATE_GUID(guid) - SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}") - FILE(APPEND ${file} - "\n${NONEXEFILES}\n\n") - FILE(APPEND ${file_comp} " \n") - ENDIF() - FOREACH(f ${all_files}) - IF(IS_DIRECTORY ${f}) - TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root}) - ENDIF() - ENDFOREACH() -ENDFUNCTION() - -FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix) - FILE(RELATIVE_PATH rel ${topdir} ${dir}) - IF(rel) - MAKE_WIX_IDENTIFIER("${rel}" id) - GET_FILENAME_COMPONENT(name ${dir} NAME) - FILE(APPEND ${file} "${prefix}\n") - ENDIF() - FILE(GLOB all_files ${dir}/*) - FOREACH(f ${all_files}) - IF(IS_DIRECTORY ${f}) - TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ") - ENDIF() - ENDFOREACH() - IF(rel) - FILE(APPEND ${file} "${prefix}\n") - ENDIF() -ENDFUNCTION() - -SET(CPACK_WIX_COMPONENTS) -SET(CPACK_WIX_COMPONENT_GROUPS) -GET_FILENAME_COMPONENT(abs . ABSOLUTE) -FOREACH(d ${DIRS}) - GET_FILENAME_COMPONENT(d ${d} ABSOLUTE) - GET_FILENAME_COMPONENT(d_name ${d} NAME) - FILE(WRITE ${abs}/${d_name}_component_group.wxs "") - SET(COMP_NAME ${d_name}) - TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs") - FILE(APPEND ${abs}/${d_name}_component_group.wxs "") - IF(EXISTS ${d_name}.wxs) - FILE(READ ${d_name}.wxs WIX_TMP) - SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}") - FILE(REMOVE ${d_name}.wxs) - ENDIF() - - FILE(READ ${d_name}_component_group.wxs WIX_TMP) - - SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}") - FILE(REMOVE ${d_name}_component_group.wxs) -ENDFOREACH() - -FILE(WRITE directories.wxs "\n") -TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "") -FILE(APPEND directories.wxs "\n") - -FILE(READ directories.wxs CPACK_WIX_DIRECTORIES) -FILE(REMOVE directories.wxs) - - -FOREACH(src ${CPACK_WIX_INCLUDE}) -SET(CPACK_WIX_INCLUDES -"${CPACK_WIX_INCLUDES} - " -) -ENDFOREACH() - - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) - -SET(EXTRA_CANDLE_ARGS) -IF("$ENV{EXTRA_CANDLE_ARGS}") - SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}") -ENDIF() - -SET(EXTRA_LIGHT_ARGS) -IF("$ENV{EXTRA_LIGHT_ARGS}") - SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}") -ENDIF() - -FILE(REMOVE mysql_server.wixobj) -EXECUTE_PROCESS( - COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS} - RESULT_VARIABLE CANDLE_RESULT -) - -IF(CANDLE_RESULT) - MESSAGE(FATAL_ERROR "ERROR: can't run candle") -ENDIF() - -EXECUTE_PROCESS( - COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension - mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi - ${EXTRA_LIGHT_ARGS} - RESULT_VARIABLE LIGHT_RESULT -) - -IF(LIGHT_RESULT) - MESSAGE(FATAL_ERROR "ERROR: can't run light") -ENDIF() - -# Switch monolithic install on again -EXECUTE_PROCESS( - COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR} -) +# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") +SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") +SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@") +SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@") +SET(CMAKE_COMMAND "@CMAKE_COMMAND@") +SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") +SET(VERSION "@VERSION@") +SET(MAJOR_VERSION "@MAJOR_VERSION@") +SET(MINOR_VERSION "@MINOR_VERSION@") +SET(PATCH_VERSION "@PATCH_VERSION@") +SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@) +SET(MANUFACTURER "@MANUFACTURER@") +SET(WIXCA_LOCATION "@WIXCA_LOCATION@") +SET(COPYING_RTF "@COPYING_RTF@") +SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@") +SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@") + +LIST(APPEND EXCLUDE_DIRS + bin/debug + data/test + lib/plugin/debug + mysql-test + scripts + sql-bench +) + +LIST(APPEND EXCLUDE_FILES + bin/echo.exe + bin/mysql_client_test_embedded.exe + bin/mysqld-debug.exe + bin/mysqltest_embedded.exe + bin/replace.exe + lib/debug/mysqlserver.lib + lib/libmysqld.dll + lib/libmysqld.lib + lib/mysqlserver.lib + lib/mysqlservices.lib +) + +IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(Win64 " Win64='yes'") + SET(Platform x64) + SET(PlatformProgramFilesFolder ProgramFiles64Folder) +ELSE() + SET(Platform x86) + SET(PlatformProgramFilesFolder ProgramFilesFolder) + SET(Win64) +ENDIF() + +SET(ENV{VS_UNICODE_OUTPUT}) + +# Switch off the monolithic install +EXECUTE_PROCESS( + COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR} + OUTPUT_QUIET +) + +INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake) + +IF(CPACK_WIX_CONFIG) + INCLUDE(${CPACK_WIX_CONFIG}) +ENDIF() + +IF(NOT CPACK_WIX_UI) + SET(CPACK_WIX_UI "WixUI_Mondo_Custom") +ENDIF() + +SET(WIX_FEATURES) +FOREACH(comp ${CPACK_COMPONENTS_ALL}) + STRING(TOUPPER "${comp}" comp_upper) + IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP) + SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}") + SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1) + SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME}) + SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION}) + SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL}) + SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper}) + ELSE() + SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP}) + SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME}) + LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp}) + ENDIF() +ENDFOREACH() + +LIST(REMOVE_DUPLICATES WIX_FEATURES) + +SET(CPACK_WIX_FEATURES) + +FOREACH(f ${WIX_FEATURES}) + STRING(TOUPPER "${f}" f_upper) + STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper}) + IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) + SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME}) + ELSE() + SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) + ENDIF() + + IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) + SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION}) + ELSE() + SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) + ENDIF() + IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL) + SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL}) + ELSE() + SET(Level 1) + ENDIF() + IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN) + SET(DISPLAY "Display='hidden'") + SET(TITLE ${f_upper}) + SET(DESCRIPTION ${f_upper}) + ELSE() + SET(DISPLAY) + IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED) + SET(DISPLAY "Display='expand'") + ENDIF() + IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) + SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME}) + ELSE() + SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME) + ENDIF() + IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) + SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION}) + ELSE() + SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION) + ENDIF() + ENDIF() + + SET(CPACK_WIX_FEATURES + "${CPACK_WIX_FEATURES} + " + ) + FOREACH(c ${${f}_COMPONENTS}) + STRING(TOUPPER "${c}" c_upper) + IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME) + SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME}) + ELSE() + SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME) + ENDIF() + + IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION) + SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION}) + ELSE() + SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION) + ENDIF() + IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL) + SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL}) + ELSE() + SET(Level 1) + ENDIF() + IF(CPACK_COMPONENT_${c_upper}_HIDDEN) + SET(CPACK_WIX_FEATURES + "${CPACK_WIX_FEATURES} + ") + ELSE() + SET(CPACK_WIX_FEATURES + "${CPACK_WIX_FEATURES} + + + ") + ENDIF() + + ENDFOREACH() + SET(CPACK_WIX_FEATURES + "${CPACK_WIX_FEATURES} + + ") +ENDFOREACH() + + +IF(CMAKE_INSTALL_CONFIG_NAME) + STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" + WIXCA_LOCATION "${WIXCA_LOCATION}") + SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}") +ENDIF() + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) + + +FOREACH(comp ${CPACK_COMPONENTS_ALL}) + SET(ENV{DESTDIR} testinstall/${comp}) + SET(DIRS ${DIRS} testinstall/${comp}) + EXECUTE_PROCESS( + COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp} + -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + OUTPUT_QUIET + ) +ENDFOREACH() + +MACRO(GENERATE_GUID VarName) + EXECUTE_PROCESS(COMMAND uuidgen -c + OUTPUT_VARIABLE ${VarName} + OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDMACRO() + +SET(INC_VAR 0) +MACRO(MAKE_WIX_IDENTIFIER str varname) + STRING(REPLACE "/" "." ${varname} "${str}") + STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}") + STRING(LENGTH "${${varname}}" len) + # Identifier should be smaller than 72 character + # We have to cut down the length to 70 chars, since we add 2 char prefix + # pretty often + IF(len GREATER 70) + STRING(SUBSTRING "${${varname}}" 0 67 shortstr) + MATH(EXPR INC_VAR ${INC_VAR}+1) + SET(${varname} "${shortstr}${INC_VAR}") + ENDIF() +ENDMACRO() + + +FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root) + FILE(RELATIVE_PATH dir_rel ${topdir} ${dir}) + IF(dir_rel) + LIST(FIND EXCLUDE_DIRS ${dir_rel} TO_EXCLUDE) + IF(NOT TO_EXCLUDE EQUAL -1) + MESSAGE(STATUS "excluding directory: ${dir_rel}") + RETURN() + ENDIF() + ENDIF() + FILE(GLOB all_files ${dir}/*) + IF(NOT all_files) + RETURN() + ENDIF() + IF(dir_rel) + MAKE_DIRECTORY(${dir_root}/${dir_rel}) + MAKE_WIX_IDENTIFIER("${dir_rel}" id) + SET(DirectoryRefId "D.${id}") + ELSE() + SET(DirectoryRefId "INSTALLDIR") + ENDIF() + FILE(APPEND ${file} "\n") + + SET(NONEXEFILES) + FOREACH(f ${all_files}) + IF(NOT IS_DIRECTORY ${f}) + FILE(RELATIVE_PATH rel ${topdir} ${f}) + SET(TO_EXCLUDE) + IF(rel MATCHES "\\.pdb$") + SET(TO_EXCLUDE TRUE) + ELSE() + LIST(FIND EXCLUDE_FILES ${rel} RES) + IF(NOT RES EQUAL -1) + SET(TO_EXCLUDE TRUE) + ENDIF() + ENDIF() + IF(TO_EXCLUDE) + MESSAGE(STATUS "excluding file: ${rel}") + ELSE() + MAKE_WIX_IDENTIFIER("${rel}" id) + FILE(TO_NATIVE_PATH ${f} f_native) + GET_FILENAME_COMPONENT(f_ext "${f}" EXT) + # According to MSDN each DLL or EXE should be in the own component + IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll") + + FILE(APPEND ${file} " \n") + FILE(APPEND ${file} " \n") + FILE(APPEND ${file} " \n") + FILE(APPEND ${file_comp} " \n") + ELSE() + SET(NONEXEFILES "${NONEXEFILES}\n" ) + ENDIF() + ENDIF() + ENDIF() + ENDFOREACH() + FILE(APPEND ${file} "\n") + IF(NONEXEFILES) + GENERATE_GUID(guid) + SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}") + FILE(APPEND ${file} + "\n${NONEXEFILES}\n\n") + FILE(APPEND ${file_comp} " \n") + ENDIF() + FOREACH(f ${all_files}) + IF(IS_DIRECTORY ${f}) + TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root}) + ENDIF() + ENDFOREACH() +ENDFUNCTION() + +FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix) + FILE(RELATIVE_PATH rel ${topdir} ${dir}) + IF(rel) + MAKE_WIX_IDENTIFIER("${rel}" id) + GET_FILENAME_COMPONENT(name ${dir} NAME) + FILE(APPEND ${file} "${prefix}\n") + ENDIF() + FILE(GLOB all_files ${dir}/*) + FOREACH(f ${all_files}) + IF(IS_DIRECTORY ${f}) + TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ") + ENDIF() + ENDFOREACH() + IF(rel) + FILE(APPEND ${file} "${prefix}\n") + ENDIF() +ENDFUNCTION() + +SET(CPACK_WIX_COMPONENTS) +SET(CPACK_WIX_COMPONENT_GROUPS) +GET_FILENAME_COMPONENT(abs . ABSOLUTE) +FOREACH(d ${DIRS}) + GET_FILENAME_COMPONENT(d ${d} ABSOLUTE) + GET_FILENAME_COMPONENT(d_name ${d} NAME) + FILE(WRITE ${abs}/${d_name}_component_group.wxs "") + SET(COMP_NAME ${d_name}) + TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs") + FILE(APPEND ${abs}/${d_name}_component_group.wxs "") + IF(EXISTS ${d_name}.wxs) + FILE(READ ${d_name}.wxs WIX_TMP) + SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}") + FILE(REMOVE ${d_name}.wxs) + ENDIF() + + FILE(READ ${d_name}_component_group.wxs WIX_TMP) + + SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}") + FILE(REMOVE ${d_name}_component_group.wxs) +ENDFOREACH() + +FILE(WRITE directories.wxs "\n") +TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "") +FILE(APPEND directories.wxs "\n") + +FILE(READ directories.wxs CPACK_WIX_DIRECTORIES) +FILE(REMOVE directories.wxs) + + +FOREACH(src ${CPACK_WIX_INCLUDE}) +SET(CPACK_WIX_INCLUDES +"${CPACK_WIX_INCLUDES} + " +) +ENDFOREACH() + + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) + +SET(EXTRA_CANDLE_ARGS) +IF("$ENV{EXTRA_CANDLE_ARGS}") + SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}") +ENDIF() + +SET(EXTRA_LIGHT_ARGS) +IF("$ENV{EXTRA_LIGHT_ARGS}") + SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}") +ENDIF() + +FILE(REMOVE mysql_server.wixobj) +EXECUTE_PROCESS( + COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS} + RESULT_VARIABLE CANDLE_RESULT +) + +IF(CANDLE_RESULT) + MESSAGE(FATAL_ERROR "ERROR: can't run candle") +ENDIF() + +EXECUTE_PROCESS( + COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension + mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi + ${EXTRA_LIGHT_ARGS} + RESULT_VARIABLE LIGHT_RESULT +) + +IF(LIGHT_RESULT) + MESSAGE(FATAL_ERROR "ERROR: can't run light") +ENDIF() + +# Switch monolithic install on again +EXECUTE_PROCESS( + COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR} +) diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs index a28c3c9b8a1..0ccd30f6754 100644 --- a/packaging/WiX/custom_ui.wxs +++ b/packaging/WiX/custom_ui.wxs @@ -1,115 +1,115 @@ - - - - - - - - 1 - - - NOT OLDERVERSIONBEINGUPGRADED - OLDERVERSIONBEINGUPGRADED - - - - - - - - - - - - 1]]> - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST) - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" - OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" - (OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F") - - - 1 - - - WixUI_InstallMode = "Remove" - - - - - - - - - - - - - - - - - - - - - - 1 - - 1 - LicenseAccepted = "1" - - 1 - 1 - 1 - 1 - - WixUI_InstallMode = "Change" - WixUI_InstallMode = "InstallCustom" - 1 - - WixUI_InstallMode = "InstallCustom" - WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete" - WixUI_InstallMode = "Change" - WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove" - - 1 - - 1 - 1 - 1 - 1 - - 1 - - - NOT Installed - - - - - + + + + + + + + 1 + + + NOT OLDERVERSIONBEINGUPGRADED + OLDERVERSIONBEINGUPGRADED + + + + + + + + + + + + 1]]> + OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST) + OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" + OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D" + (OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F") + + + 1 + + + WixUI_InstallMode = "Remove" + + + + + + + + + + + + + + + + + + + + + + 1 + + 1 + LicenseAccepted = "1" + + 1 + 1 + 1 + 1 + + WixUI_InstallMode = "Change" + WixUI_InstallMode = "InstallCustom" + 1 + + WixUI_InstallMode = "InstallCustom" + WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete" + WixUI_InstallMode = "Change" + WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove" + + 1 + + 1 + 1 + 1 + 1 + + 1 + + + NOT Installed + + + + + diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in index 91bf3f64b8e..92a79064d54 100644 --- a/packaging/WiX/extra.wxs.in +++ b/packaging/WiX/extra.wxs.in @@ -1,81 +1,81 @@ - - - - - - - - - - - - - - - - - - - - - - @DATADIR_MYSQL_FILES@ - - - - - - - - @DATADIR_PERFORMANCE_SCHEMA_FILES@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @DATADIR_MYSQL_FILES@ + + + + + + + + @DATADIR_PERFORMANCE_SCHEMA_FILES@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index 1802baedf3b..1e7c20468ef 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -1,196 +1,196 @@ - - - - - - - - - - - - - - - - - NOT NEWERVERSIONDETECTED OR Installed - - - - - - - - - - NOT - Installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSTALLDIR2 - - - - - - - - - - - - - - - - - - - - - - - Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" - Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" - Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel>4 - Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel<=4 - - - - - - - - - - - - - - @CPACK_WIX_FEATURES@ - - - @CPACK_WIX_DIRECTORIES@ - - - @CPACK_WIX_COMPONENTS@ - - - @CPACK_WIX_COMPONENT_GROUPS@ - - - @CPACK_WIX_INCLUDES@ - - - + + + + + + + + + + + + + + + + + NOT NEWERVERSIONDETECTED OR Installed + + + + + + + + + + NOT + Installed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSTALLDIR2 + + + + + + + + + + + + + + + + + + + + + + + Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" + Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" + Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel>4 + Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel<=4 + + + + + + + + + + + + + + @CPACK_WIX_FEATURES@ + + + @CPACK_WIX_DIRECTORIES@ + + + @CPACK_WIX_COMPONENTS@ + + + @CPACK_WIX_COMPONENT_GROUPS@ + + + @CPACK_WIX_INCLUDES@ + + + diff --git a/sql-bench/limits/access_odbc.cfg b/sql-bench/limits/access_odbc.cfg index cc2e05c0154..8fd07fc71d7 100644 --- a/sql-bench/limits/access_odbc.cfg +++ b/sql-bench/limits/access_odbc.cfg @@ -1,448 +1,448 @@ -#This file is automaticly generated by crash-me 1.37 - -NEG=yes # update of column= -column -alter_add_col=yes # Alter table add column -alter_add_multi_col=without add # Alter table add many columns -alter_alter_col=no # Alter table alter column -alter_change_col=no # Alter table change column -alter_drop_col=yes # Alter table drop column -alter_modify_col=no # Alter table modify column -alter_rename_table=no # Alter table rename table -atomic_updates=no # atomic updates -binary_items=yes # binary items (0x41) -case_insensitive_strings=yes # case insensitive compare -char_is_space_filled=no # char are space filled -column_alias=yes # Column alias -columns_in_group_by=11 # number of columns in group by -columns_in_order_by=11 # number of columns in order by -comment_#=no # # as comment -comment_--=no # -- as comment -comment_/**/=no # /* */ as comment -comment_//=no # // as comment -compute=no # Compute -connections=64 # Simultaneous connections -constraint_check=no # CHECK constraint -constraint_null=yes # NULL constraint (SyBase style) -crash_me_safe=no # crash me safe -crash_me_version=1.37 # crash me version -create_default=no # default value for column -create_default_func=no # default value function for column -create_if_not_exists=no # create table if not exists -create_index=yes # create index -create_table_select=no # create table from select -cross_join=no # cross join (same as from a,b) -date_as_string=error # String functions on date columns -date_with_YY=yes # Supports YY-MM-DD 2000 compilant dates -date_zero=no # Supports 0000-00-00 dates -double_quotes=yes # Double '' as ' in strings -drop_if_exists=no # drop table if exists -drop_index=with 'ON' # drop index -end_colon=yes # allows end ';' -except=no # except -except_all=no # except all -float_int_expr=yes # mixing of integer and float in expression -foreign_key_syntax=no # foreign key syntax -full_outer_join=no # full outer join -func_extra_!=no # Function NOT as '!' in SELECT -func_extra_%=no # Function MOD as % -func_extra_&=error # Function & (bitwise and) -func_extra_&&=no # Function AND as '&&' -func_extra_<>=yes # Function <> in SELECT -func_extra_==yes # Function = -func_extra_add_months=no # Function ADD_MONTHS -func_extra_and_or=yes # Function AND and OR in SELECT -func_extra_atn2=no # Function ATN2 -func_extra_auto_num2string=no # Function automatic num->string convert -func_extra_auto_string2num=yes # Function automatic string->num convert -func_extra_between=yes # Function BETWEEN in SELECT -func_extra_binary_shifts=no # Function << and >> (bitwise shifts) -func_extra_bit_count=no # Function BIT_COUNT -func_extra_ceil=no # Function CEIL -func_extra_charindex=no # Function CHARINDEX -func_extra_chr=yes # Function CHR -func_extra_coalesce=no # Function COALESCE -func_extra_concat_as_+=yes # Function concatenation with + -func_extra_concat_list=no # Function CONCAT(list) -func_extra_convert=no # Function CONVERT -func_extra_cosh=no # Function COSH -func_extra_date_format=no # Function DATE_FORMAT -func_extra_dateadd=no # Function DATEADD -func_extra_datediff=no # Function DATEDIFF -func_extra_datename=no # Function DATENAME -func_extra_datepart=no # Function DATEPART -func_extra_elt=no # Function ELT -func_extra_encrypt=no # Function ENCRYPT -func_extra_field=no # Function FIELD -func_extra_format=error # Function FORMAT -func_extra_from_days=no # Function FROM_DAYS -func_extra_from_unixtime=no # Function FROM_UNIXTIME -func_extra_getdate=no # Function GETDATE -func_extra_greatest=no # Function GREATEST -func_extra_if=no # Function IF -func_extra_in_num=yes # Function IN on numbers in SELECT -func_extra_in_str=yes # Function IN on strings in SELECT -func_extra_initcap=no # Function INITCAP -func_extra_instr=yes # Function LOCATE as INSTR -func_extra_instr_oracle=no # Function INSTR (Oracle syntax) -func_extra_instrb=no # Function INSTRB -func_extra_interval=no # Function INTERVAL -func_extra_last_day=no # Function LAST_DAY -func_extra_last_insert_id=no # Function LAST_INSERT_ID -func_extra_least=no # Function LEAST -func_extra_lengthb=no # Function LENGTHB -func_extra_like=yes # Function LIKE in SELECT -func_extra_like_escape=no # Function LIKE ESCAPE in SELECT -func_extra_ln=no # Function LN -func_extra_log(m_n)=no # Function LOG(m,n) -func_extra_logn=no # Function LOGN -func_extra_lpad=no # Function LPAD -func_extra_mdy=no # Function MDY -func_extra_mid=yes # Function SUBSTRING as MID -func_extra_months_between=no # Function MONTHS_BETWEEN -func_extra_not=yes # Function NOT in SELECT -func_extra_not_between=yes # Function NOT BETWEEN in SELECT -func_extra_not_like=yes # Function NOT LIKE in SELECT -func_extra_odbc_convert=no # Function ODBC CONVERT -func_extra_password=no # Function PASSWORD -func_extra_patindex=no # Function PATINDEX -func_extra_period_add=no # Function PERIOD_ADD -func_extra_period_diff=no # Function PERIOD_DIFF -func_extra_pow=no # Function POW -func_extra_range=no # Function RANGE -func_extra_regexp=no # Function REGEXP in SELECT -func_extra_replicate=no # Function REPLICATE -func_extra_reverse=no # Function REVERSE -func_extra_root=no # Function ROOT -func_extra_round1=yes # Function ROUND(1 arg) -func_extra_rpad=no # Function RPAD -func_extra_sec_to_time=no # Function SEC_TO_TIME -func_extra_sinh=no # Function SINH -func_extra_str=no # Function STR -func_extra_strcmp=no # Function STRCMP -func_extra_stuff=no # Function STUFF -func_extra_substrb=no # Function SUBSTRB -func_extra_substring_index=no # Function SUBSTRING_INDEX -func_extra_sysdate=no # Function SYSDATE -func_extra_tanh=no # Function TANH -func_extra_time_to_sec=no # Function TIME_TO_SEC -func_extra_to_days=no # Function TO_DAYS -func_extra_translate=no # Function TRANSLATE -func_extra_trim_many_char=no # Function TRIM; Many char extension -func_extra_trim_substring=no # Function TRIM; Substring extension -func_extra_trunc=no # Function TRUNC -func_extra_uid=no # Function UID -func_extra_unix_timestamp=no # Function UNIX_TIMESTAMP -func_extra_userenv=no # Function USERENV -func_extra_version=no # Function VERSION -func_extra_weekday=error # Function WEEKDAY -func_extra_|=no # Function | (bitwise or) -func_extra_||=no # Function OR as '||' -func_odbc_abs=yes # Function ABS -func_odbc_acos=no # Function ACOS -func_odbc_ascii=no # Function ASCII -func_odbc_asin=no # Function ASIN -func_odbc_atan=no # Function ATAN -func_odbc_atan2=no # Function ATAN2 -func_odbc_ceiling=no # Function CEILING -func_odbc_char=no # Function CHAR -func_odbc_concat=no # Function CONCAT(2 arg) -func_odbc_cos=yes # Function COS -func_odbc_cot=no # Function COT -func_odbc_curdate=no # Function CURDATE -func_odbc_curtime=no # Function CURTIME -func_odbc_database=no # Function DATABASE -func_odbc_dayname=no # Function DAYNAME -func_odbc_dayofmonth=no # Function DAYOFMONTH -func_odbc_dayofweek=no # Function DAYOFWEEK -func_odbc_dayofyear=no # Function DAYOFYEAR -func_odbc_degrees=no # Function DEGREES -func_odbc_difference=no # Function DIFFERENCE() -func_odbc_exp=yes # Function EXP -func_odbc_extract=no # Function EXTRACT -func_odbc_floor=no # Function FLOOR -func_odbc_fn_left=yes # Function ODBC syntax LEFT & RIGHT -func_odbc_hour=yes # Function HOUR -func_odbc_hour_time=no # Function ANSI HOUR -func_odbc_ifnull=no # Function IFNULL -func_odbc_insert=no # Function INSERT -func_odbc_lcase=yes # Function LCASE -func_odbc_left=yes # Function LEFT -func_odbc_length=no # Function REAL LENGTH -func_odbc_length_without_space=no # Function ODBC LENGTH -func_odbc_locate_2=no # Function LOCATE(2 arg) -func_odbc_locate_3=no # Function LOCATE(3 arg) -func_odbc_log=yes # Function LOG -func_odbc_log10=no # Function LOG10 -func_odbc_ltrim=yes # Function LTRIM -func_odbc_minute=yes # Function MINUTE -func_odbc_mod=no # Function MOD -func_odbc_month=yes # Function MONTH -func_odbc_monthname=no # Function MONTHNAME -func_odbc_now=yes # Function NOW -func_odbc_pi=no # Function PI -func_odbc_power=no # Function POWER -func_odbc_quarter=no # Function QUARTER -func_odbc_radians=no # Function RADIANS -func_odbc_rand=no # Function RAND -func_odbc_repeat=no # Function REPEAT -func_odbc_replace=no # Function REPLACE -func_odbc_right=yes # Function RIGHT -func_odbc_round=yes # Function ROUND(2 arg) -func_odbc_rtrim=yes # Function RTRIM -func_odbc_second=yes # Function SECOND -func_odbc_sign=no # Function SIGN -func_odbc_sin=yes # Function SIN -func_odbc_soundex=no # Function SOUNDEX -func_odbc_space=yes # Function SPACE -func_odbc_sqrt=no # Function SQRT -func_odbc_substring=no # Function ODBC SUBSTRING -func_odbc_tan=yes # Function TAN -func_odbc_timestampadd=no # Function TIMESTAMPADD -func_odbc_timestampdiff=no # Function TIMESTAMPDIFF -func_odbc_truncate=no # Function TRUNCATE -func_odbc_ucase=yes # Function UCASE -func_odbc_user()=no # Function USER() -func_odbc_week=no # Function WEEK -func_odbc_year=yes # Function YEAR -func_sql_+=yes # Function +, -, * and / -func_sql_bit_length=no # Function BIT_LENGTH -func_sql_case=no # Function CASE -func_sql_cast=no # Function CAST -func_sql_char_length=no # Function CHAR_LENGTH -func_sql_char_length(constant)=no # Function CHAR_LENGTH(constant) -func_sql_character_length=no # Function CHARACTER_LENGTH -func_sql_concat_as_||=no # Function concatenation with || -func_sql_current_date=no # Function CURRENT_DATE -func_sql_current_time=no # Function CURRENT_TIME -func_sql_current_timestamp=no # Function CURRENT_TIMESTAMP -func_sql_current_user=no # Function CURRENT_USER -func_sql_lower=no # Function LOWER -func_sql_octet_length=no # Function OCTET_LENGTH -func_sql_position=no # Function POSITION -func_sql_session_user=no # Function SESSION_USER -func_sql_substring=no # Function ANSI SQL SUBSTRING -func_sql_system_user=no # Function SYSTEM_USER -func_sql_trim=no # Function TRIM -func_sql_upper=no # Function UPPER -func_sql_user=no # Function USER -func_where_between=yes # Function BETWEEN -func_where_eq_all=yes # Function = ALL -func_where_eq_any=yes # Function = ANY -func_where_eq_some=yes # Function = SOME -func_where_exists=yes # Function EXISTS -func_where_in_num=yes # Function IN on numbers -func_where_like=yes # Function LIKE -func_where_like_escape=no # Function LIKE ESCAPE -func_where_match=no # Function MATCH -func_where_match_unique=no # Function MATCH UNIQUE -func_where_matches=no # Function MATCHES -func_where_not_between=yes # Function NOT BETWEEN -func_where_not_exists=yes # Function NOT EXISTS -func_where_not_like=yes # Function NOT LIKE -func_where_not_unique=no # Function NOT UNIQUE -func_where_unique=no # Function UNIQUE -functions=yes # Functions -group_by=yes # Group by -group_by_alias=no # Group by alias -group_by_null=yes # group on column with null values -group_by_position=no # Group by position -group_distinct_functions=no # Group functions with distinct -group_func_extra_bit_and=no # Group function BIT_AND -group_func_extra_bit_or=no # Group function BIT_OR -group_func_extra_count_distinct_list=no # Group function COUNT(DISTINCT expr,expr,...) -group_func_extra_std=no # Group function STD -group_func_extra_stddev=no # Group function STDDEV -group_func_extra_variance=no # Group function VARIANCE -group_func_sql_avg=yes # Group function AVG -group_func_sql_count_*=yes # Group function COUNT (*) -group_func_sql_count_column=yes # Group function COUNT column name -group_func_sql_count_distinct=no # Group function COUNT(DISTINCT expr) -group_func_sql_max=yes # Group function MAX on numbers -group_func_sql_max_str=yes # Group function MAX on strings -group_func_sql_min=yes # Group function MIN on numbers -group_func_sql_min_str=yes # Group function MIN on strings -group_func_sql_sum=yes # Group function SUM -group_functions=yes # Group functions -having=yes # Having -having_with_alias=no # Having on alias -having_with_group=yes # Having with group function -ignore_end_space=yes # ignore end space in compare -index_in_create=no # index in create table -index_namespace=yes # different namespace for index -index_parts=no # index on column part (extension) -insert_empty_string=yes # insert empty string -insert_select=no # insert INTO ... SELECT ... -insert_with_set=no # INSERT with set syntax -intersect=no # intersect -intersect_all=no # intersect all -join_tables=32 # tables in join -left_outer_join=yes # left outer join -left_outer_join_using=no # left outer join using -like_with_column=yes # column LIKE column -like_with_number=yes # LIKE on numbers -lock_tables=no # lock table -logical_value=-1 # Value of logical operation (1=1) -max_big_expressions=1 # big expressions -max_char_size=255 # max char() size -max_column_name=59 # column name length -max_columns=255 # Columns in table -max_conditions=97 # OR and AND in WHERE -max_expressions=+10000 # simple expressions -max_index=32 # max index -max_index_length=2026 # index length -max_index_name=64 # index name length -max_index_part_length=255 # max index part length -max_index_parts=10 # index parts -max_index_varchar_part_length=85 # index varchar part length -max_row_length=2025 # max table row length (without blobs) -max_row_length_with_null=2025 # table row length with nulls (without blobs) -max_select_alias_name=64 # select alias name length -max_stack_expression=14 # stacked expressions -max_table_alias_name=253 # table alias name length -max_table_name=64 # table name length -max_text_size=17 # max text or blob size -max_unique_index=32 # unique indexes -max_varchar_size=85 # max varchar() size -minus=no # minus -minus_neg=yes # Calculate 1--1 -multi_drop=yes # many tables to drop table -multi_strings=no # Multiple line strings -multi_table_delete=yes # DELETE FROM table1,table2... -multi_table_update=yes # Update with many tables +#This file is automaticly generated by crash-me 1.37 + +NEG=yes # update of column= -column +alter_add_col=yes # Alter table add column +alter_add_multi_col=without add # Alter table add many columns +alter_alter_col=no # Alter table alter column +alter_change_col=no # Alter table change column +alter_drop_col=yes # Alter table drop column +alter_modify_col=no # Alter table modify column +alter_rename_table=no # Alter table rename table +atomic_updates=no # atomic updates +binary_items=yes # binary items (0x41) +case_insensitive_strings=yes # case insensitive compare +char_is_space_filled=no # char are space filled +column_alias=yes # Column alias +columns_in_group_by=11 # number of columns in group by +columns_in_order_by=11 # number of columns in order by +comment_#=no # # as comment +comment_--=no # -- as comment +comment_/**/=no # /* */ as comment +comment_//=no # // as comment +compute=no # Compute +connections=64 # Simultaneous connections +constraint_check=no # CHECK constraint +constraint_null=yes # NULL constraint (SyBase style) +crash_me_safe=no # crash me safe +crash_me_version=1.37 # crash me version +create_default=no # default value for column +create_default_func=no # default value function for column +create_if_not_exists=no # create table if not exists +create_index=yes # create index +create_table_select=no # create table from select +cross_join=no # cross join (same as from a,b) +date_as_string=error # String functions on date columns +date_with_YY=yes # Supports YY-MM-DD 2000 compilant dates +date_zero=no # Supports 0000-00-00 dates +double_quotes=yes # Double '' as ' in strings +drop_if_exists=no # drop table if exists +drop_index=with 'ON' # drop index +end_colon=yes # allows end ';' +except=no # except +except_all=no # except all +float_int_expr=yes # mixing of integer and float in expression +foreign_key_syntax=no # foreign key syntax +full_outer_join=no # full outer join +func_extra_!=no # Function NOT as '!' in SELECT +func_extra_%=no # Function MOD as % +func_extra_&=error # Function & (bitwise and) +func_extra_&&=no # Function AND as '&&' +func_extra_<>=yes # Function <> in SELECT +func_extra_==yes # Function = +func_extra_add_months=no # Function ADD_MONTHS +func_extra_and_or=yes # Function AND and OR in SELECT +func_extra_atn2=no # Function ATN2 +func_extra_auto_num2string=no # Function automatic num->string convert +func_extra_auto_string2num=yes # Function automatic string->num convert +func_extra_between=yes # Function BETWEEN in SELECT +func_extra_binary_shifts=no # Function << and >> (bitwise shifts) +func_extra_bit_count=no # Function BIT_COUNT +func_extra_ceil=no # Function CEIL +func_extra_charindex=no # Function CHARINDEX +func_extra_chr=yes # Function CHR +func_extra_coalesce=no # Function COALESCE +func_extra_concat_as_+=yes # Function concatenation with + +func_extra_concat_list=no # Function CONCAT(list) +func_extra_convert=no # Function CONVERT +func_extra_cosh=no # Function COSH +func_extra_date_format=no # Function DATE_FORMAT +func_extra_dateadd=no # Function DATEADD +func_extra_datediff=no # Function DATEDIFF +func_extra_datename=no # Function DATENAME +func_extra_datepart=no # Function DATEPART +func_extra_elt=no # Function ELT +func_extra_encrypt=no # Function ENCRYPT +func_extra_field=no # Function FIELD +func_extra_format=error # Function FORMAT +func_extra_from_days=no # Function FROM_DAYS +func_extra_from_unixtime=no # Function FROM_UNIXTIME +func_extra_getdate=no # Function GETDATE +func_extra_greatest=no # Function GREATEST +func_extra_if=no # Function IF +func_extra_in_num=yes # Function IN on numbers in SELECT +func_extra_in_str=yes # Function IN on strings in SELECT +func_extra_initcap=no # Function INITCAP +func_extra_instr=yes # Function LOCATE as INSTR +func_extra_instr_oracle=no # Function INSTR (Oracle syntax) +func_extra_instrb=no # Function INSTRB +func_extra_interval=no # Function INTERVAL +func_extra_last_day=no # Function LAST_DAY +func_extra_last_insert_id=no # Function LAST_INSERT_ID +func_extra_least=no # Function LEAST +func_extra_lengthb=no # Function LENGTHB +func_extra_like=yes # Function LIKE in SELECT +func_extra_like_escape=no # Function LIKE ESCAPE in SELECT +func_extra_ln=no # Function LN +func_extra_log(m_n)=no # Function LOG(m,n) +func_extra_logn=no # Function LOGN +func_extra_lpad=no # Function LPAD +func_extra_mdy=no # Function MDY +func_extra_mid=yes # Function SUBSTRING as MID +func_extra_months_between=no # Function MONTHS_BETWEEN +func_extra_not=yes # Function NOT in SELECT +func_extra_not_between=yes # Function NOT BETWEEN in SELECT +func_extra_not_like=yes # Function NOT LIKE in SELECT +func_extra_odbc_convert=no # Function ODBC CONVERT +func_extra_password=no # Function PASSWORD +func_extra_patindex=no # Function PATINDEX +func_extra_period_add=no # Function PERIOD_ADD +func_extra_period_diff=no # Function PERIOD_DIFF +func_extra_pow=no # Function POW +func_extra_range=no # Function RANGE +func_extra_regexp=no # Function REGEXP in SELECT +func_extra_replicate=no # Function REPLICATE +func_extra_reverse=no # Function REVERSE +func_extra_root=no # Function ROOT +func_extra_round1=yes # Function ROUND(1 arg) +func_extra_rpad=no # Function RPAD +func_extra_sec_to_time=no # Function SEC_TO_TIME +func_extra_sinh=no # Function SINH +func_extra_str=no # Function STR +func_extra_strcmp=no # Function STRCMP +func_extra_stuff=no # Function STUFF +func_extra_substrb=no # Function SUBSTRB +func_extra_substring_index=no # Function SUBSTRING_INDEX +func_extra_sysdate=no # Function SYSDATE +func_extra_tanh=no # Function TANH +func_extra_time_to_sec=no # Function TIME_TO_SEC +func_extra_to_days=no # Function TO_DAYS +func_extra_translate=no # Function TRANSLATE +func_extra_trim_many_char=no # Function TRIM; Many char extension +func_extra_trim_substring=no # Function TRIM; Substring extension +func_extra_trunc=no # Function TRUNC +func_extra_uid=no # Function UID +func_extra_unix_timestamp=no # Function UNIX_TIMESTAMP +func_extra_userenv=no # Function USERENV +func_extra_version=no # Function VERSION +func_extra_weekday=error # Function WEEKDAY +func_extra_|=no # Function | (bitwise or) +func_extra_||=no # Function OR as '||' +func_odbc_abs=yes # Function ABS +func_odbc_acos=no # Function ACOS +func_odbc_ascii=no # Function ASCII +func_odbc_asin=no # Function ASIN +func_odbc_atan=no # Function ATAN +func_odbc_atan2=no # Function ATAN2 +func_odbc_ceiling=no # Function CEILING +func_odbc_char=no # Function CHAR +func_odbc_concat=no # Function CONCAT(2 arg) +func_odbc_cos=yes # Function COS +func_odbc_cot=no # Function COT +func_odbc_curdate=no # Function CURDATE +func_odbc_curtime=no # Function CURTIME +func_odbc_database=no # Function DATABASE +func_odbc_dayname=no # Function DAYNAME +func_odbc_dayofmonth=no # Function DAYOFMONTH +func_odbc_dayofweek=no # Function DAYOFWEEK +func_odbc_dayofyear=no # Function DAYOFYEAR +func_odbc_degrees=no # Function DEGREES +func_odbc_difference=no # Function DIFFERENCE() +func_odbc_exp=yes # Function EXP +func_odbc_extract=no # Function EXTRACT +func_odbc_floor=no # Function FLOOR +func_odbc_fn_left=yes # Function ODBC syntax LEFT & RIGHT +func_odbc_hour=yes # Function HOUR +func_odbc_hour_time=no # Function ANSI HOUR +func_odbc_ifnull=no # Function IFNULL +func_odbc_insert=no # Function INSERT +func_odbc_lcase=yes # Function LCASE +func_odbc_left=yes # Function LEFT +func_odbc_length=no # Function REAL LENGTH +func_odbc_length_without_space=no # Function ODBC LENGTH +func_odbc_locate_2=no # Function LOCATE(2 arg) +func_odbc_locate_3=no # Function LOCATE(3 arg) +func_odbc_log=yes # Function LOG +func_odbc_log10=no # Function LOG10 +func_odbc_ltrim=yes # Function LTRIM +func_odbc_minute=yes # Function MINUTE +func_odbc_mod=no # Function MOD +func_odbc_month=yes # Function MONTH +func_odbc_monthname=no # Function MONTHNAME +func_odbc_now=yes # Function NOW +func_odbc_pi=no # Function PI +func_odbc_power=no # Function POWER +func_odbc_quarter=no # Function QUARTER +func_odbc_radians=no # Function RADIANS +func_odbc_rand=no # Function RAND +func_odbc_repeat=no # Function REPEAT +func_odbc_replace=no # Function REPLACE +func_odbc_right=yes # Function RIGHT +func_odbc_round=yes # Function ROUND(2 arg) +func_odbc_rtrim=yes # Function RTRIM +func_odbc_second=yes # Function SECOND +func_odbc_sign=no # Function SIGN +func_odbc_sin=yes # Function SIN +func_odbc_soundex=no # Function SOUNDEX +func_odbc_space=yes # Function SPACE +func_odbc_sqrt=no # Function SQRT +func_odbc_substring=no # Function ODBC SUBSTRING +func_odbc_tan=yes # Function TAN +func_odbc_timestampadd=no # Function TIMESTAMPADD +func_odbc_timestampdiff=no # Function TIMESTAMPDIFF +func_odbc_truncate=no # Function TRUNCATE +func_odbc_ucase=yes # Function UCASE +func_odbc_user()=no # Function USER() +func_odbc_week=no # Function WEEK +func_odbc_year=yes # Function YEAR +func_sql_+=yes # Function +, -, * and / +func_sql_bit_length=no # Function BIT_LENGTH +func_sql_case=no # Function CASE +func_sql_cast=no # Function CAST +func_sql_char_length=no # Function CHAR_LENGTH +func_sql_char_length(constant)=no # Function CHAR_LENGTH(constant) +func_sql_character_length=no # Function CHARACTER_LENGTH +func_sql_concat_as_||=no # Function concatenation with || +func_sql_current_date=no # Function CURRENT_DATE +func_sql_current_time=no # Function CURRENT_TIME +func_sql_current_timestamp=no # Function CURRENT_TIMESTAMP +func_sql_current_user=no # Function CURRENT_USER +func_sql_lower=no # Function LOWER +func_sql_octet_length=no # Function OCTET_LENGTH +func_sql_position=no # Function POSITION +func_sql_session_user=no # Function SESSION_USER +func_sql_substring=no # Function ANSI SQL SUBSTRING +func_sql_system_user=no # Function SYSTEM_USER +func_sql_trim=no # Function TRIM +func_sql_upper=no # Function UPPER +func_sql_user=no # Function USER +func_where_between=yes # Function BETWEEN +func_where_eq_all=yes # Function = ALL +func_where_eq_any=yes # Function = ANY +func_where_eq_some=yes # Function = SOME +func_where_exists=yes # Function EXISTS +func_where_in_num=yes # Function IN on numbers +func_where_like=yes # Function LIKE +func_where_like_escape=no # Function LIKE ESCAPE +func_where_match=no # Function MATCH +func_where_match_unique=no # Function MATCH UNIQUE +func_where_matches=no # Function MATCHES +func_where_not_between=yes # Function NOT BETWEEN +func_where_not_exists=yes # Function NOT EXISTS +func_where_not_like=yes # Function NOT LIKE +func_where_not_unique=no # Function NOT UNIQUE +func_where_unique=no # Function UNIQUE +functions=yes # Functions +group_by=yes # Group by +group_by_alias=no # Group by alias +group_by_null=yes # group on column with null values +group_by_position=no # Group by position +group_distinct_functions=no # Group functions with distinct +group_func_extra_bit_and=no # Group function BIT_AND +group_func_extra_bit_or=no # Group function BIT_OR +group_func_extra_count_distinct_list=no # Group function COUNT(DISTINCT expr,expr,...) +group_func_extra_std=no # Group function STD +group_func_extra_stddev=no # Group function STDDEV +group_func_extra_variance=no # Group function VARIANCE +group_func_sql_avg=yes # Group function AVG +group_func_sql_count_*=yes # Group function COUNT (*) +group_func_sql_count_column=yes # Group function COUNT column name +group_func_sql_count_distinct=no # Group function COUNT(DISTINCT expr) +group_func_sql_max=yes # Group function MAX on numbers +group_func_sql_max_str=yes # Group function MAX on strings +group_func_sql_min=yes # Group function MIN on numbers +group_func_sql_min_str=yes # Group function MIN on strings +group_func_sql_sum=yes # Group function SUM +group_functions=yes # Group functions +having=yes # Having +having_with_alias=no # Having on alias +having_with_group=yes # Having with group function +ignore_end_space=yes # ignore end space in compare +index_in_create=no # index in create table +index_namespace=yes # different namespace for index +index_parts=no # index on column part (extension) +insert_empty_string=yes # insert empty string +insert_select=no # insert INTO ... SELECT ... +insert_with_set=no # INSERT with set syntax +intersect=no # intersect +intersect_all=no # intersect all +join_tables=32 # tables in join +left_outer_join=yes # left outer join +left_outer_join_using=no # left outer join using +like_with_column=yes # column LIKE column +like_with_number=yes # LIKE on numbers +lock_tables=no # lock table +logical_value=-1 # Value of logical operation (1=1) +max_big_expressions=1 # big expressions +max_char_size=255 # max char() size +max_column_name=59 # column name length +max_columns=255 # Columns in table +max_conditions=97 # OR and AND in WHERE +max_expressions=+10000 # simple expressions +max_index=32 # max index +max_index_length=2026 # index length +max_index_name=64 # index name length +max_index_part_length=255 # max index part length +max_index_parts=10 # index parts +max_index_varchar_part_length=85 # index varchar part length +max_row_length=2025 # max table row length (without blobs) +max_row_length_with_null=2025 # table row length with nulls (without blobs) +max_select_alias_name=64 # select alias name length +max_stack_expression=14 # stacked expressions +max_table_alias_name=253 # table alias name length +max_table_name=64 # table name length +max_text_size=17 # max text or blob size +max_unique_index=32 # unique indexes +max_varchar_size=85 # max varchar() size +minus=no # minus +minus_neg=yes # Calculate 1--1 +multi_drop=yes # many tables to drop table +multi_strings=no # Multiple line strings +multi_table_delete=yes # DELETE FROM table1,table2... +multi_table_update=yes # Update with many tables insert_multi_value=no # Value lists in INSERT -natural_join=no # natural join -natural_left_outer_join=no # natural left outer join -no_primary_key=yes # Tables without primary key -null_in_index=yes # null in index -null_in_unique=yes # null in unique -odbc_left_outer_join=yes # left outer join odbc style -operating_system=Windows 98 [Version 4.10.1998] # crash-me tested on -order_by=yes # Order by -order_by_alias=no # Order by alias -order_by_function=yes # Order by function -order_by_position=yes # Order by position -order_by_remember_desc=no # Order by DESC is remembered -primary_key_in_create=yes # primary key in create table -query_size=16777216 # query size -quote_ident_with_"=yes # " as identifier quote (ANSI SQL) -quote_ident_with_[=yes # [] as identifier quote -quote_ident_with_`=yes # ` as identifier quote -quote_with_"=no # Allows ' and " as string markers -recursive_subqueries=49 # recursive subqueries -remember_end_space=no # Remembers end space in char() -remember_end_space_varchar=yes # Remembers end space in varchar() -right_outer_join=yes # right outer join -rowid=no # Type for row id -select_constants=yes # Select constants -select_limit=no # SELECT with LIMIT -select_limit2=no # SELECT with LIMIT #,# -select_string_size=516076 # constant string size in SELECT -select_table_update=no # Update with sub select -select_without_from=yes # SELECT without FROM -server_version=Access 2000 # server version -simple_joins=yes # ANSI SQL simple joins -subqueries=yes # subqueries -table_alias=yes # Table alias -table_name_case=yes # case independent table names -table_wildcard=yes # Select table_name.* -tempoary_table=no # temporary tables -transactions=yes # transactions -type_extra_abstime=no # Type abstime -type_extra_bfile=no # Type bfile -type_extra_blob=no # Type blob -type_extra_bool=no # Type bool -type_extra_box=no # Type box -type_extra_byte=yes # Type byte -type_extra_char(1_arg)_binary=no # Type char(1 arg) binary -type_extra_circle=no # Type circle -type_extra_clob=no # Type clob -type_extra_datetime=yes # Type datetime -type_extra_double=yes # Type double -type_extra_enum(1_arg)=no # Type enum(1 arg) -type_extra_float(2_arg)=no # Type float(2 arg) -type_extra_float4=yes # Type float4 -type_extra_float8=yes # Type float8 -type_extra_image=yes # Type image -type_extra_int(1_arg)_zerofill=no # Type int(1 arg) zerofill -type_extra_int1=no # Type int1 -type_extra_int2=no # Type int2 -type_extra_int3=no # Type int3 -type_extra_int4=no # Type int4 -type_extra_int8=no # Type int8 -type_extra_int_auto_increment=no # Type int not null auto_increment -type_extra_int_unsigned=no # Type int unsigned -type_extra_interval=no # Type interval -type_extra_line=no # Type line -type_extra_long=yes # Type long -type_extra_long_raw=no # Type long raw -type_extra_long_varbinary=no # Type long varbinary -type_extra_long_varchar(1_arg)=no # Type long varchar(1 arg) -type_extra_lseg=no # Type lseg -type_extra_mediumint=no # Type mediumint -type_extra_mediumtext=no # Type mediumtext -type_extra_middleint=no # Type middleint -type_extra_mlslabel=no # Type mlslabel -type_extra_money=yes # Type money -type_extra_nclob=no # Type nclob -type_extra_number=yes # Type number -type_extra_number(1_arg)=no # Type number(1 arg) -type_extra_number(2_arg)=no # Type number(2 arg) -type_extra_nvarchar2(1_arg)=no # Type nvarchar2(1 arg) -type_extra_path=no # Type path -type_extra_point=no # Type point -type_extra_polygon=no # Type polygon -type_extra_raw(1_arg)=no # Type raw(1 arg) -type_extra_reltime=no # Type reltime -type_extra_rowid=no # Type rowid -type_extra_serial=no # Type serial -type_extra_set(1_arg)=no # Type set(1 arg) -type_extra_smalldatetime=no # Type smalldatetime -type_extra_smallfloat=no # Type smallfloat -type_extra_smallmoney=no # Type smallmoney -type_extra_text=yes # Type text -type_extra_text(1_arg)=yes # Type text(1 arg) -type_extra_timespan=no # Type timespan -type_extra_uint=no # Type uint -type_extra_varchar2(1_arg)=no # Type varchar2(1 arg) -type_extra_year=no # Type year -type_odbc_bigint=no # Type bigint -type_odbc_binary(1_arg)=yes # Type binary(1 arg) -type_odbc_datetime=yes # Type datetime -type_odbc_tinyint=no # Type tinyint -type_odbc_varbinary(1_arg)=yes # Type varbinary(1 arg) -type_sql_bit=yes # Type bit -type_sql_bit(1_arg)=no # Type bit(1 arg) -type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg) -type_sql_char(1_arg)=yes # Type char(1 arg) -type_sql_char_varying(1_arg)=no # Type char varying(1 arg) -type_sql_character(1_arg)=no # Type character(1 arg) -type_sql_character_varying(1_arg)=no # Type character varying(1 arg) -type_sql_date=yes # Type date -type_sql_dec(2_arg)=no # Type dec(2 arg) -type_sql_decimal(2_arg)=no # Type decimal(2 arg) -type_sql_double_precision=no # Type double precision -type_sql_float=yes # Type float -type_sql_float(1_arg)=no # Type float(1 arg) -type_sql_int=yes # Type int -type_sql_integer=yes # Type integer -type_sql_interval_day_to_second=no # Type interval day to second -type_sql_interval_year=no # Type interval year -type_sql_interval_year_to_month=no # Type interval year to month -type_sql_national_char_varying(1_arg)=no # Type national char varying(1 arg) -type_sql_national_character(1_arg)=no # Type national character(1 arg) -type_sql_national_character_varying(1_arg)=no # Type national character varying(1 arg) -type_sql_nchar(1_arg)=no # Type nchar(1 arg) -type_sql_nchar_varying(1_arg)=no # Type nchar varying(1 arg) -type_sql_numeric(2_arg)=no # Type numeric(2 arg) -type_sql_real=yes # Type real -type_sql_smallint=yes # Type smallint -type_sql_time=yes # Type time -type_sql_timestamp=yes # Type timestamp -type_sql_timestamp_with_time_zone=no # Type timestamp with time zone -type_sql_varchar(1_arg)=yes # Type varchar(1 arg) -union=yes # union -union_all=yes # union all -unique_in_create=yes # unique in create table -unique_null_in_create=yes # unique null in create -views=no # views -where_string_size=258035 # constant string size in where +natural_join=no # natural join +natural_left_outer_join=no # natural left outer join +no_primary_key=yes # Tables without primary key +null_in_index=yes # null in index +null_in_unique=yes # null in unique +odbc_left_outer_join=yes # left outer join odbc style +operating_system=Windows 98 [Version 4.10.1998] # crash-me tested on +order_by=yes # Order by +order_by_alias=no # Order by alias +order_by_function=yes # Order by function +order_by_position=yes # Order by position +order_by_remember_desc=no # Order by DESC is remembered +primary_key_in_create=yes # primary key in create table +query_size=16777216 # query size +quote_ident_with_"=yes # " as identifier quote (ANSI SQL) +quote_ident_with_[=yes # [] as identifier quote +quote_ident_with_`=yes # ` as identifier quote +quote_with_"=no # Allows ' and " as string markers +recursive_subqueries=49 # recursive subqueries +remember_end_space=no # Remembers end space in char() +remember_end_space_varchar=yes # Remembers end space in varchar() +right_outer_join=yes # right outer join +rowid=no # Type for row id +select_constants=yes # Select constants +select_limit=no # SELECT with LIMIT +select_limit2=no # SELECT with LIMIT #,# +select_string_size=516076 # constant string size in SELECT +select_table_update=no # Update with sub select +select_without_from=yes # SELECT without FROM +server_version=Access 2000 # server version +simple_joins=yes # ANSI SQL simple joins +subqueries=yes # subqueries +table_alias=yes # Table alias +table_name_case=yes # case independent table names +table_wildcard=yes # Select table_name.* +tempoary_table=no # temporary tables +transactions=yes # transactions +type_extra_abstime=no # Type abstime +type_extra_bfile=no # Type bfile +type_extra_blob=no # Type blob +type_extra_bool=no # Type bool +type_extra_box=no # Type box +type_extra_byte=yes # Type byte +type_extra_char(1_arg)_binary=no # Type char(1 arg) binary +type_extra_circle=no # Type circle +type_extra_clob=no # Type clob +type_extra_datetime=yes # Type datetime +type_extra_double=yes # Type double +type_extra_enum(1_arg)=no # Type enum(1 arg) +type_extra_float(2_arg)=no # Type float(2 arg) +type_extra_float4=yes # Type float4 +type_extra_float8=yes # Type float8 +type_extra_image=yes # Type image +type_extra_int(1_arg)_zerofill=no # Type int(1 arg) zerofill +type_extra_int1=no # Type int1 +type_extra_int2=no # Type int2 +type_extra_int3=no # Type int3 +type_extra_int4=no # Type int4 +type_extra_int8=no # Type int8 +type_extra_int_auto_increment=no # Type int not null auto_increment +type_extra_int_unsigned=no # Type int unsigned +type_extra_interval=no # Type interval +type_extra_line=no # Type line +type_extra_long=yes # Type long +type_extra_long_raw=no # Type long raw +type_extra_long_varbinary=no # Type long varbinary +type_extra_long_varchar(1_arg)=no # Type long varchar(1 arg) +type_extra_lseg=no # Type lseg +type_extra_mediumint=no # Type mediumint +type_extra_mediumtext=no # Type mediumtext +type_extra_middleint=no # Type middleint +type_extra_mlslabel=no # Type mlslabel +type_extra_money=yes # Type money +type_extra_nclob=no # Type nclob +type_extra_number=yes # Type number +type_extra_number(1_arg)=no # Type number(1 arg) +type_extra_number(2_arg)=no # Type number(2 arg) +type_extra_nvarchar2(1_arg)=no # Type nvarchar2(1 arg) +type_extra_path=no # Type path +type_extra_point=no # Type point +type_extra_polygon=no # Type polygon +type_extra_raw(1_arg)=no # Type raw(1 arg) +type_extra_reltime=no # Type reltime +type_extra_rowid=no # Type rowid +type_extra_serial=no # Type serial +type_extra_set(1_arg)=no # Type set(1 arg) +type_extra_smalldatetime=no # Type smalldatetime +type_extra_smallfloat=no # Type smallfloat +type_extra_smallmoney=no # Type smallmoney +type_extra_text=yes # Type text +type_extra_text(1_arg)=yes # Type text(1 arg) +type_extra_timespan=no # Type timespan +type_extra_uint=no # Type uint +type_extra_varchar2(1_arg)=no # Type varchar2(1 arg) +type_extra_year=no # Type year +type_odbc_bigint=no # Type bigint +type_odbc_binary(1_arg)=yes # Type binary(1 arg) +type_odbc_datetime=yes # Type datetime +type_odbc_tinyint=no # Type tinyint +type_odbc_varbinary(1_arg)=yes # Type varbinary(1 arg) +type_sql_bit=yes # Type bit +type_sql_bit(1_arg)=no # Type bit(1 arg) +type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg) +type_sql_char(1_arg)=yes # Type char(1 arg) +type_sql_char_varying(1_arg)=no # Type char varying(1 arg) +type_sql_character(1_arg)=no # Type character(1 arg) +type_sql_character_varying(1_arg)=no # Type character varying(1 arg) +type_sql_date=yes # Type date +type_sql_dec(2_arg)=no # Type dec(2 arg) +type_sql_decimal(2_arg)=no # Type decimal(2 arg) +type_sql_double_precision=no # Type double precision +type_sql_float=yes # Type float +type_sql_float(1_arg)=no # Type float(1 arg) +type_sql_int=yes # Type int +type_sql_integer=yes # Type integer +type_sql_interval_day_to_second=no # Type interval day to second +type_sql_interval_year=no # Type interval year +type_sql_interval_year_to_month=no # Type interval year to month +type_sql_national_char_varying(1_arg)=no # Type national char varying(1 arg) +type_sql_national_character(1_arg)=no # Type national character(1 arg) +type_sql_national_character_varying(1_arg)=no # Type national character varying(1 arg) +type_sql_nchar(1_arg)=no # Type nchar(1 arg) +type_sql_nchar_varying(1_arg)=no # Type nchar varying(1 arg) +type_sql_numeric(2_arg)=no # Type numeric(2 arg) +type_sql_real=yes # Type real +type_sql_smallint=yes # Type smallint +type_sql_time=yes # Type time +type_sql_timestamp=yes # Type timestamp +type_sql_timestamp_with_time_zone=no # Type timestamp with time zone +type_sql_varchar(1_arg)=yes # Type varchar(1 arg) +union=yes # union +union_all=yes # union all +unique_in_create=yes # unique in create table +unique_null_in_create=yes # unique null in create +views=no # views +where_string_size=258035 # constant string size in where diff --git a/sql/message.h b/sql/message.h index dac0576d0c4..6641453a965 100644 --- a/sql/message.h +++ b/sql/message.h @@ -1,77 +1,77 @@ -#ifndef MESSAGE_INCLUDED -#define MESSAGE_INCLUDED -/* Copyright (c) 2008, 2009 Sun Microsystems, Inc. - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -/* - To change or add messages mysqld writes to the Windows error log, run - mc.exe message.mc - and checkin generated messages.h, messages.rc and msg000001.bin under the - source control. - mc.exe can be installed with Windows SDK, some Visual Studio distributions - do not include it. -*/ - - -// -// Values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// - - -// -// Define the severity codes -// - - -// -// MessageId: MSG_DEFAULT -// -// MessageText: -// -// %1For more information, see Help and Support Center at http://www.mysql.com. -// -// -// -#define MSG_DEFAULT 0xC0000064L - -#endif /* MESSAGE_INCLUDED */ - +#ifndef MESSAGE_INCLUDED +#define MESSAGE_INCLUDED +/* Copyright (c) 2008, 2009 Sun Microsystems, Inc. + Use is subject to license terms. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/* + To change or add messages mysqld writes to the Windows error log, run + mc.exe message.mc + and checkin generated messages.h, messages.rc and msg000001.bin under the + source control. + mc.exe can be installed with Windows SDK, some Visual Studio distributions + do not include it. +*/ + + +// +// Values are 32 bit values layed out as follows: +// +// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +// +---+-+-+-----------------------+-------------------------------+ +// |Sev|C|R| Facility | Code | +// +---+-+-+-----------------------+-------------------------------+ +// +// where +// +// Sev - is the severity code +// +// 00 - Success +// 01 - Informational +// 10 - Warning +// 11 - Error +// +// C - is the Customer code flag +// +// R - is a reserved bit +// +// Facility - is the facility code +// +// Code - is the facility's status code +// +// +// Define the facility codes +// + + +// +// Define the severity codes +// + + +// +// MessageId: MSG_DEFAULT +// +// MessageText: +// +// %1For more information, see Help and Support Center at http://www.mysql.com. +// +// +// +#define MSG_DEFAULT 0xC0000064L + +#endif /* MESSAGE_INCLUDED */ + diff --git a/sql/message.rc b/sql/message.rc index 116522b7d48..0885a897e6f 100644 --- a/sql/message.rc +++ b/sql/message.rc @@ -1,2 +1,2 @@ -LANGUAGE 0x9,0x1 -1 11 MSG00001.bin +LANGUAGE 0x9,0x1 +1 11 MSG00001.bin diff --git a/sql/slave.cc b/sql/slave.cc index a03deb1e793..2fe7ebb575d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4738,8 +4738,8 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir); /* Set MYSQL_PLUGIN_DIR in case master asks for an external authentication plugin */ - if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr) - mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr); + if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr); /* we disallow empty users */ if (mi->user == NULL || mi->user[0] == 0) diff --git a/sql/winservice.h b/sql/winservice.h index fca7b129de5..c3e2bfe1b20 100644 --- a/sql/winservice.h +++ b/sql/winservice.h @@ -1,40 +1,40 @@ -/* - Copyright (c) 2011, 2012, Monty Program Ab - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - Extract properties of a windows service binary path -*/ -#ifdef __cplusplus -extern "C" { -#endif - -#include -typedef struct mysqld_service_properties_st -{ - char mysqld_exe[MAX_PATH]; - char inifile[MAX_PATH]; - char datadir[MAX_PATH]; - int version_major; - int version_minor; - int version_patch; -} mysqld_service_properties; - -extern int get_mysql_service_properties(const wchar_t *bin_path, - mysqld_service_properties *props); - -#ifdef __cplusplus -} -#endif +/* + Copyright (c) 2011, 2012, Monty Program Ab + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Extract properties of a windows service binary path +*/ +#ifdef __cplusplus +extern "C" { +#endif + +#include +typedef struct mysqld_service_properties_st +{ + char mysqld_exe[MAX_PATH]; + char inifile[MAX_PATH]; + char datadir[MAX_PATH]; + int version_major; + int version_minor; + int version_patch; +} mysqld_service_properties; + +extern int get_mysql_service_properties(const wchar_t *bin_path, + mysqld_service_properties *props); + +#ifdef __cplusplus +} +#endif diff --git a/storage/federatedx/CMakeLists.txt b/storage/federatedx/CMakeLists.txt index 24d64585ddb..67b6c1c96bb 100644 --- a/storage/federatedx/CMakeLists.txt +++ b/storage/federatedx/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(FEDERATEDX_PLUGIN_STATIC "federatedx") -SET(FEDERATEDX_PLUGIN_DYNAMIC "ha_federatedx") -SET(FEDERATEDX_SOURCES ha_federatedx.cc federatedx_txn.cc federatedx_io.cc federatedx_io_null.cc federatedx_io_mysql.cc) -MYSQL_ADD_PLUGIN(federatedx ${FEDERATEDX_SOURCES} STORAGE_ENGINE) +SET(FEDERATEDX_PLUGIN_STATIC "federatedx") +SET(FEDERATEDX_PLUGIN_DYNAMIC "ha_federatedx") +SET(FEDERATEDX_SOURCES ha_federatedx.cc federatedx_txn.cc federatedx_io.cc federatedx_io_null.cc federatedx_io_mysql.cc) +MYSQL_ADD_PLUGIN(federatedx ${FEDERATEDX_SOURCES} STORAGE_ENGINE) diff --git a/storage/federatedx/README.windows b/storage/federatedx/README.windows index 3f1f2a3c79a..74de15c6521 100644 --- a/storage/federatedx/README.windows +++ b/storage/federatedx/README.windows @@ -1,23 +1,23 @@ -The following files are changed in order to build a new engine on Windows: - -- Update win\configure.js with -case "WITH_FEDERATEDX_STORAGE_ENGINE": -to make sure it will pass WITH_FEDERATEDX_STORAGE_ENGINE in. - -- Update CMakeFiles.txt under mysql root: - IF(WITH_FEDERATEDX_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_FEDERATEDX_STORAGE_ENGINE) - SET (mysql_plugin_defs - "${mysql_plugin_defs},builtin_skeleton_plugin") - ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) - - and, - - IF(WITH_FEDERATEDX_STORAGE_ENGINE) - ADD_SUBDIRECTORY(storage/skeleton/src) - ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) - - - Update CMakeFiles.txt under sql: - IF(WITH_FEDERATEDX_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld skeleton) - ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) +The following files are changed in order to build a new engine on Windows: + +- Update win\configure.js with +case "WITH_FEDERATEDX_STORAGE_ENGINE": +to make sure it will pass WITH_FEDERATEDX_STORAGE_ENGINE in. + +- Update CMakeFiles.txt under mysql root: + IF(WITH_FEDERATEDX_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_FEDERATEDX_STORAGE_ENGINE) + SET (mysql_plugin_defs + "${mysql_plugin_defs},builtin_skeleton_plugin") + ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) + + and, + + IF(WITH_FEDERATEDX_STORAGE_ENGINE) + ADD_SUBDIRECTORY(storage/skeleton/src) + ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) + + - Update CMakeFiles.txt under sql: + IF(WITH_FEDERATEDX_STORAGE_ENGINE) + TARGET_LINK_LIBRARIES(mysqld skeleton) + ENDIF(WITH_FEDERATEDX_STORAGE_ENGINE) diff --git a/storage/maria/ma_test_force_start.pl b/storage/maria/ma_test_force_start.pl index 8148b2f212b..8e56d6edeed 100755 --- a/storage/maria/ma_test_force_start.pl +++ b/storage/maria/ma_test_force_start.pl @@ -43,7 +43,7 @@ my $error_log_name= "./var/log/master.err"; my @cmd_output; my $whatever; # garbage data $ENV{MTR_VERSION} = 1; # MTR2 does not have --start-and-exit -my $base_server_cmd= "perl mysql-test-run.pl --mysqld=--aria-force-start-after-recovery-failures=$force_after --suite=maria maria.maria-recover "; +my $base_server_cmd= "perl mysql-test-run.pl --mysqld=--aria-force-start-after-recovery-failures=$force_after --suite=maria maria.maria-recover "; if ($^O =~ /^mswin/i) { print < Date: Wed, 3 Jun 2015 02:02:21 +0200 Subject: Fix swapping key numeric values on Big Endian machines. modified: storage/connect/connect.cc --- storage/connect/connect.cc | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 12b23878891..fd5cb164e05 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -709,6 +709,28 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) return (tdbp->To_Kindex->IsMul()) ? 2 : 1; } // end of CntIndexInit +#if defined(BIG_ENDIAN_ORDER) +/***********************************************************************/ +/* Swap bytes of the key that are written in little endian order. */ +/***********************************************************************/ +static void SetSwapValue(PVAL valp, char *kp) +{ + if (valp->IsTypeNum() && valp->GetType() != TYPE_DECIM) { + uchar buf[8]; + int i, k= valp->GetClen(); + + for (i = 0; k > 0;) + buf[i++]= kp[--k]; + + + + valp->SetBinValue((void*)buf); + } else + valp->SetBinValue((void*)kp); + +} // end of SetSwapValue +#endif //LITTLE ENDIAN + /***********************************************************************/ /* IndexRead: fetch a record having the index value. */ /***********************************************************************/ @@ -797,7 +819,11 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, } // endif b } else +#if defined(BIG_ENDIAN_ORDER) + SetSwapValue(valp, kp); +#else // LITTLE ENDIAN valp->SetBinValue((void*)kp); +#endif //LITTLE ENDIAN kp+= valp->GetClen(); @@ -912,7 +938,11 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, } // endif b } else - valp->SetBinValue((void*)p); +#if defined(BIG_ENDIAN_ORDER) + SetSwapValue(valp, (char*)kp); +#else // LITTLE ENDIAN + valp->SetBinValue((void*)kp); +#endif //LITTLE ENDIAN if (trace) { char bf[32]; -- cgit v1.2.1 From 0ffef5d2a72bad8fe0cb72b78e426f4f50a29bf2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 09:54:56 +0200 Subject: MDEV-8052 abi detection incorrect with clang don't include #include directives into .pp files --- cmake/do_abi_check.cmake | 2 +- include/mysql.h.pp | 7 ------- include/mysql/client_plugin.h.pp | 2 -- include/mysql/plugin_audit.h.pp | 12 ------------ include/mysql/plugin_auth.h.pp | 13 ------------- include/mysql/plugin_ftparser.h.pp | 11 ----------- include/mysql/psi/psi_abi_v1.h.pp | 1 - include/mysql/psi/psi_abi_v2.h.pp | 1 - 8 files changed, 1 insertion(+), 48 deletions(-) diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake index c831aaf8b52..c0ffce353f3 100644 --- a/cmake/do_abi_check.cmake +++ b/cmake/do_abi_check.cmake @@ -58,7 +58,7 @@ FOREACH(file ${ABI_HEADERS}) EXECUTE_PROCESS( COMMAND ${COMPILER} - -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include + -E -nostdinc -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql ${file} ERROR_QUIET OUTPUT_FILE ${tmpfile}) diff --git a/include/mysql.h.pp b/include/mysql.h.pp index f6be582c0da..4f7407095c9 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -1,7 +1,5 @@ typedef char my_bool; typedef int my_socket; -#include "mysql_version.h" -#include "mysql_com.h" enum enum_server_command { COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, @@ -142,7 +140,6 @@ void get_tty_password_buff(const char *opt_message, char *to, size_t length); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); my_bool my_thread_init(void); void my_thread_end(void); -#include "mysql_time.h" enum enum_mysql_timestamp_type { MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, @@ -155,7 +152,6 @@ typedef struct st_mysql_time my_bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; -#include "my_list.h" typedef struct st_list { struct st_list *prev,*next; void *data; @@ -197,8 +193,6 @@ typedef struct st_mysql_field { typedef char **MYSQL_ROW; typedef unsigned int MYSQL_FIELD_OFFSET; typedef unsigned long long my_ulonglong; -#include "typelib.h" -#include "my_alloc.h" typedef struct st_used_mem { struct st_used_mem *next; @@ -242,7 +236,6 @@ typedef struct st_mysql_rows { unsigned long length; } MYSQL_ROWS; typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; -#include "my_alloc.h" typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; typedef struct st_mysql_data { MYSQL_ROWS *data; diff --git a/include/mysql/client_plugin.h.pp b/include/mysql/client_plugin.h.pp index f3a0b5769df..b6ba9cf08ad 100644 --- a/include/mysql/client_plugin.h.pp +++ b/include/mysql/client_plugin.h.pp @@ -3,7 +3,6 @@ struct st_mysql_client_plugin int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); }; struct st_mysql; -#include typedef struct st_plugin_vio_info { enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, @@ -24,7 +23,6 @@ struct st_mysql_client_plugin_AUTHENTICATION int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); }; -#include struct st_mysql; typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, int type, const char *prompt, char *buf, int buf_len); diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp index b0ace08cdaa..74903fd74e3 100644 --- a/include/mysql/plugin_audit.h.pp +++ b/include/mysql/plugin_audit.h.pp @@ -1,13 +1,9 @@ -#include "plugin.h" -#include -#include extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; size_t my_snprintf(char* to, size_t n, const char* fmt, ...); size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); -#include struct st_mysql_lex_string { char *str; @@ -31,7 +27,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size); MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, const char *str, unsigned int size, int allocate_lex_string); -#include typedef enum _thd_wait_type_e { THD_WAIT_SLEEP= 1, THD_WAIT_DISKIO= 2, @@ -51,7 +46,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include struct scheduler_functions; extern struct my_thread_scheduler_service { int (*set)(struct scheduler_functions *scheduler); @@ -59,7 +53,6 @@ extern struct my_thread_scheduler_service { } *my_thread_scheduler_service; int my_thread_scheduler_set(struct scheduler_functions *scheduler); int my_thread_scheduler_reset(); -#include extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); void (*thd_progress_report_func)(void* thd, @@ -80,9 +73,7 @@ void thd_progress_next_stage(void* thd); void thd_progress_end(void* thd); const char *set_thd_proc_info(void*, const char * info, const char *func, const char *file, unsigned int line); -#include extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t); -#include enum thd_kill_levels { THD_IS_NOT_KILLED=0, THD_ABORT_SOFTLY=50, @@ -92,7 +83,6 @@ extern struct kill_statement_service_st { enum thd_kill_levels (*thd_kill_level_func)(const void*); } *thd_kill_statement_service; enum thd_kill_levels thd_kill_level(const void*); -#include typedef struct logger_handle_st LOGGER_HANDLE; extern struct logger_service_st { void (*logger_init_mutexes)(); @@ -175,8 +165,6 @@ struct st_maria_plugin const char *version_info; unsigned int maturity; }; -#include "plugin_ftparser.h" -#include "plugin.h" enum enum_ftparser_mode { MYSQL_FTPARSER_SIMPLE_MODE= 0, diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp index 7a01a337647..84b2434a125 100644 --- a/include/mysql/plugin_auth.h.pp +++ b/include/mysql/plugin_auth.h.pp @@ -1,13 +1,9 @@ -#include -#include -#include extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; size_t my_snprintf(char* to, size_t n, const char* fmt, ...); size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); -#include struct st_mysql_lex_string { char *str; @@ -31,7 +27,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size); MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, const char *str, unsigned int size, int allocate_lex_string); -#include typedef enum _thd_wait_type_e { THD_WAIT_SLEEP= 1, THD_WAIT_DISKIO= 2, @@ -51,7 +46,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include struct scheduler_functions; extern struct my_thread_scheduler_service { int (*set)(struct scheduler_functions *scheduler); @@ -59,7 +53,6 @@ extern struct my_thread_scheduler_service { } *my_thread_scheduler_service; int my_thread_scheduler_set(struct scheduler_functions *scheduler); int my_thread_scheduler_reset(); -#include extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); void (*thd_progress_report_func)(void* thd, @@ -80,9 +73,7 @@ void thd_progress_next_stage(void* thd); void thd_progress_end(void* thd); const char *set_thd_proc_info(void*, const char * info, const char *func, const char *file, unsigned int line); -#include extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t); -#include enum thd_kill_levels { THD_IS_NOT_KILLED=0, THD_ABORT_SOFTLY=50, @@ -92,7 +83,6 @@ extern struct kill_statement_service_st { enum thd_kill_levels (*thd_kill_level_func)(const void*); } *thd_kill_statement_service; enum thd_kill_levels thd_kill_level(const void*); -#include typedef struct logger_handle_st LOGGER_HANDLE; extern struct logger_service_st { void (*logger_init_mutexes)(); @@ -175,8 +165,6 @@ struct st_maria_plugin const char *version_info; unsigned int maturity; }; -#include "plugin_ftparser.h" -#include "plugin.h" enum enum_ftparser_mode { MYSQL_FTPARSER_SIMPLE_MODE= 0, @@ -266,7 +254,6 @@ void mysql_query_cache_invalidate4(void* thd, void *thd_get_ha_data(const void* thd, const struct handlerton *hton); void thd_set_ha_data(void* thd, const struct handlerton *hton, const void *ha_data); -#include typedef struct st_plugin_vio_info { enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp index a41c4788af2..8cb6348b24d 100644 --- a/include/mysql/plugin_ftparser.h.pp +++ b/include/mysql/plugin_ftparser.h.pp @@ -1,13 +1,9 @@ -#include "plugin.h" -#include -#include extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; size_t my_snprintf(char* to, size_t n, const char* fmt, ...); size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); -#include struct st_mysql_lex_string { char *str; @@ -31,7 +27,6 @@ void *thd_memdup(void* thd, const void* str, unsigned int size); MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, const char *str, unsigned int size, int allocate_lex_string); -#include typedef enum _thd_wait_type_e { THD_WAIT_SLEEP= 1, THD_WAIT_DISKIO= 2, @@ -51,7 +46,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include struct scheduler_functions; extern struct my_thread_scheduler_service { int (*set)(struct scheduler_functions *scheduler); @@ -59,7 +53,6 @@ extern struct my_thread_scheduler_service { } *my_thread_scheduler_service; int my_thread_scheduler_set(struct scheduler_functions *scheduler); int my_thread_scheduler_reset(); -#include extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); void (*thd_progress_report_func)(void* thd, @@ -80,9 +73,7 @@ void thd_progress_next_stage(void* thd); void thd_progress_end(void* thd); const char *set_thd_proc_info(void*, const char * info, const char *func, const char *file, unsigned int line); -#include extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t); -#include enum thd_kill_levels { THD_IS_NOT_KILLED=0, THD_ABORT_SOFTLY=50, @@ -92,7 +83,6 @@ extern struct kill_statement_service_st { enum thd_kill_levels (*thd_kill_level_func)(const void*); } *thd_kill_statement_service; enum thd_kill_levels thd_kill_level(const void*); -#include typedef struct logger_handle_st LOGGER_HANDLE; extern struct logger_service_st { void (*logger_init_mutexes)(); @@ -175,7 +165,6 @@ struct st_maria_plugin const char *version_info; unsigned int maturity; }; -#include "plugin_ftparser.h" struct st_mysql_daemon { int interface_version; diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp index adb3010469b..9f8252473a6 100644 --- a/include/mysql/psi/psi_abi_v1.h.pp +++ b/include/mysql/psi/psi_abi_v1.h.pp @@ -1,4 +1,3 @@ -#include "mysql/psi/psi.h" C_MODE_START struct PSI_mutex; struct PSI_rwlock; diff --git a/include/mysql/psi/psi_abi_v2.h.pp b/include/mysql/psi/psi_abi_v2.h.pp index 63f8c52c50a..9da270e6f8c 100644 --- a/include/mysql/psi/psi_abi_v2.h.pp +++ b/include/mysql/psi/psi_abi_v2.h.pp @@ -1,4 +1,3 @@ -#include "mysql/psi/psi.h" C_MODE_START struct PSI_mutex; struct PSI_rwlock; -- cgit v1.2.1 From 65ed25446807efc0fe4482b69f6d76bf830c29f8 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 3 Jun 2015 10:07:33 +0200 Subject: Fix swapping key numeric values on Big Endian machines. Change the preprocessor variable used from BIG_ENDIAN_ORDER (only used by taoscript) to WORDS_BIGENDIAN. modified: storage/connect/connect.cc --- storage/connect/connect.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index fd5cb164e05..cc95ff0cacc 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -709,7 +709,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) return (tdbp->To_Kindex->IsMul()) ? 2 : 1; } // end of CntIndexInit -#if defined(BIG_ENDIAN_ORDER) +#if defined(WORDS_BIGENDIAN) /***********************************************************************/ /* Swap bytes of the key that are written in little endian order. */ /***********************************************************************/ @@ -729,7 +729,7 @@ static void SetSwapValue(PVAL valp, char *kp) valp->SetBinValue((void*)kp); } // end of SetSwapValue -#endif //LITTLE ENDIAN +#endif // WORDS_BIGENDIAN /***********************************************************************/ /* IndexRead: fetch a record having the index value. */ @@ -819,11 +819,11 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, } // endif b } else -#if defined(BIG_ENDIAN_ORDER) +#if defined(WORDS_BIGENDIAN) SetSwapValue(valp, kp); -#else // LITTLE ENDIAN +#else // !WORDS_BIGENDIAN valp->SetBinValue((void*)kp); -#endif //LITTLE ENDIAN +#endif //!WORDS_BIGENDIAN kp+= valp->GetClen(); @@ -938,11 +938,11 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, } // endif b } else -#if defined(BIG_ENDIAN_ORDER) +#if defined(WORDS_BIGENDIAN) SetSwapValue(valp, (char*)kp); -#else // LITTLE ENDIAN +#else // !WORDS_BIGENDIAN valp->SetBinValue((void*)kp); -#endif //LITTLE ENDIAN +#endif // !WORDS_BIGENDIAN if (trace) { char bf[32]; -- cgit v1.2.1 From 37a803c80520974c1c97661d7d578b056824ecdc Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 3 Jun 2015 11:31:18 +0200 Subject: Fix swapping key numeric values on Big Endian machines. Swap the key length when WORDS_BIGENDIAN is defined Make the IOFF structure depending on WORDS_BIGENDIAN modified: storage/connect/connect.cc modified: storage/connect/xindex.h --- storage/connect/connect.cc | 10 ++++++++++ storage/connect/xindex.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index cc95ff0cacc..d7b8b466d50 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -801,7 +801,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, if (!valp->IsTypeNum()) { if (colp->GetColUse(U_VAR)) { +#if defined(WORDS_BIGENDIAN) + ((char*)&lg)[0]= ((char*)kp)[1]; + ((char*)&lg)[1]= ((char*)kp)[0]; +#else // !WORDS_BIGENDIAN lg= *(short*)kp; +#endif //!WORDS_BIGENDIAN kp+= sizeof(short); rcb= valp->SetValue_char(kp, (int)lg); } else @@ -919,7 +924,12 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, if (!valp->IsTypeNum()) { if (colp->GetColUse(U_VAR)) { +#if defined(WORDS_BIGENDIAN) + ((char*)&lg)[0]= ((char*)kp)[1]; + ((char*)&lg)[1]= ((char*)kp)[0]; +#else // !WORDS_BIGENDIAN lg= *(short*)p; +#endif //!WORDS_BIGENDIAN p+= sizeof(short); rcb= valp->SetValue_char((char*)p, (int)lg); } else diff --git a/storage/connect/xindex.h b/storage/connect/xindex.h index a4e98075222..51b678992ea 100644 --- a/storage/connect/xindex.h +++ b/storage/connect/xindex.h @@ -65,7 +65,11 @@ typedef struct index_def : public BLOCK { typedef struct index_off { union { +#if defined(WORDS_BIGENDIAN) + struct {int High; int Low;}; +#else // !WORDS_BIGENDIAN struct {int Low; int High;}; +#endif //!WORDS_BIGENDIAN longlong Val; // File position }; // end of union } IOFF; -- cgit v1.2.1 From 4821cd949e7760c833773b8c10533187c1ae075d Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 3 Jun 2015 11:38:34 +0200 Subject: Fix swapping key numeric values on Big Endian machines. Fix typo error in CntIndexRange for big endian swapping modified: storage/connect/connect.cc --- storage/connect/connect.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index d7b8b466d50..7b7144dacbb 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -925,8 +925,8 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, if (!valp->IsTypeNum()) { if (colp->GetColUse(U_VAR)) { #if defined(WORDS_BIGENDIAN) - ((char*)&lg)[0]= ((char*)kp)[1]; - ((char*)&lg)[1]= ((char*)kp)[0]; + ((char*)&lg)[0]= ((char*)p)[1]; + ((char*)&lg)[1]= ((char*)p)[0]; #else // !WORDS_BIGENDIAN lg= *(short*)p; #endif //!WORDS_BIGENDIAN -- cgit v1.2.1 From 64569fa81de811b2c355c8d51bf4d3daa6b56444 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 11:11:53 +0200 Subject: parser: better error messages for CHECK/REPAIR VIEW remove the code that checks for correct options for for CHECK/REPAIR VIEW. Rewrite the grammar for the parser to check that. This changes error messages as -ERROR 42000: You have an error ... near '' at line 1 +ERROR 42000: You have an error ... near 'quick' at line 1 --- mysql-test/r/mysql_upgrade_view.result | 35 ++++++++++++++++++++ mysql-test/t/mysql_upgrade_view.test | 29 ++++++++++++++++ sql/sql_lex.cc | 1 + sql/sql_yacc.yy | 60 +++++++++++++++------------------- 4 files changed, 92 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result index 0e71d7f2c4b..fa0ea5e3e64 100644 --- a/mysql-test/r/mysql_upgrade_view.result +++ b/mysql-test/r/mysql_upgrade_view.result @@ -3,6 +3,41 @@ drop table if exists t1,v1,v2,v3,v4,v1badcheck; drop view if exists t1,v1,v2,v3,v4,v1badcheck; create table t1(a int); create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; +repair table t1 quick; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 extended; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 from mysql; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from mysql' at line 1 +repair view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +repair view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +repair view v1 use_frm; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'use_frm' at line 1 +repair view v1 from mysql; +Table Op Msg_type Msg_text +test.v1 repair status OK +check view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +check view v1 fast; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'fast' at line 1 +check view v1 medium; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'medium' at line 1 +check view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +check view v1 changed; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'changed' at line 1 +check view v1 for upgrade; +Table Op Msg_type Msg_text +test.v1 check status OK +drop view v1; flush tables; check view v1; Table Op Msg_type Msg_text diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test index 3ecf66d70a5..7a098aa701b 100644 --- a/mysql-test/t/mysql_upgrade_view.test +++ b/mysql-test/t/mysql_upgrade_view.test @@ -8,6 +8,35 @@ drop view if exists t1,v1,v2,v3,v4,v1badcheck; create table t1(a int); create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; + +repair table t1 quick; +repair table t1 extended; +repair table t1 use_frm; +--error ER_PARSE_ERROR +repair table t1 from mysql; + +--error ER_PARSE_ERROR +repair view v1 quick; +--error ER_PARSE_ERROR +repair view v1 extended; +--error ER_PARSE_ERROR +repair view v1 use_frm; +repair view v1 from mysql; + +--error ER_PARSE_ERROR +check view v1 quick; +--error ER_PARSE_ERROR +check view v1 fast; +--error ER_PARSE_ERROR +check view v1 medium; +--error ER_PARSE_ERROR +check view v1 extended; +--error ER_PARSE_ERROR +check view v1 changed; +check view v1 for upgrade; + +drop view v1; let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 74591b5371e..a71051e801b 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -533,6 +533,7 @@ void lex_start(THD *thd) lex->is_lex_started= TRUE; lex->used_tables= 0; + lex->only_view= FALSE; lex->reset_slave_info.all= false; lex->limit_rows_examined= 0; lex->limit_rows_examined_cnt= ULONGLONG_MAX; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index cc16101c38b..5b2f10b278c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7191,8 +7191,13 @@ opt_checksum_type: | EXTENDED_SYM { Lex->check_opt.flags= T_EXTEND; } ; +repair_table_or_view: + table_or_tables table_list opt_mi_repair_type + | VIEW_SYM { Lex->only_view= TRUE; } table_list opt_view_repair_type + ; + repair: - REPAIR opt_no_write_to_binlog table_or_view + REPAIR opt_no_write_to_binlog { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; @@ -7202,18 +7207,9 @@ repair: /* Will be overriden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } - table_list opt_mi_repair_type + repair_table_or_view { LEX* lex= thd->lex; - if ((lex->only_view && - ((lex->check_opt.flags & (T_QUICK | T_EXTEND)) || - (lex->check_opt.sql_flags & TT_USEFRM))) || - (!lex->only_view && - (lex->check_opt.sql_flags & TT_FROM_MYSQL))) - { - my_parse_error(ER(ER_SYNTAX_ERROR)); - MYSQL_YYABORT; - } DBUG_ASSERT(!lex->m_stmt); lex->m_stmt= new (thd->mem_root) Repair_table_statement(lex); if (lex->m_stmt == NULL) @@ -7235,6 +7231,10 @@ mi_repair_type: QUICK { Lex->check_opt.flags|= T_QUICK; } | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; } | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; } + ; + +opt_view_repair_type: + /* empty */ { } | FROM MYSQL_SYM { Lex->check_opt.sql_flags|= TT_FROM_MYSQL; } ; @@ -7267,30 +7267,27 @@ binlog_base64_event: } ; -check: - CHECK_SYM table_or_view +check_view_or_table: + table_or_tables table_list opt_mi_check_type + | VIEW_SYM { Lex->only_view= TRUE; } table_list opt_view_check_type + ; + +check: CHECK_SYM { LEX *lex=Lex; - if (lex->sphead) - { - my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK"); - MYSQL_YYABORT; - } lex->sql_command = SQLCOM_CHECK; lex->check_opt.init(); lex->alter_info.reset(); /* Will be overriden during execution. */ YYPS->m_lock_type= TL_UNLOCK; } - table_list opt_mi_check_type + check_view_or_table { LEX* lex= thd->lex; - if (lex->only_view && - (lex->check_opt.flags & (T_QUICK | T_FAST | T_EXTEND | - T_CHECK_ONLY_CHANGED))) + if (lex->sphead) { - my_parse_error(ER(ER_SYNTAX_ERROR)); + my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK"); MYSQL_YYABORT; } DBUG_ASSERT(!lex->m_stmt); @@ -7319,6 +7316,11 @@ mi_check_type: | FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } ; +opt_view_check_type: + /* empty */ { } + | FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } + ; + optimize: OPTIMIZE opt_no_write_to_binlog table_or_tables { @@ -7400,7 +7402,6 @@ keycache: LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; lex->ident= $6; - lex->only_view= FALSE; } ; @@ -7445,7 +7446,6 @@ preload: LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; lex->alter_info.reset(); - lex->only_view= FALSE; } preload_list_or_parts {} @@ -11610,7 +11610,6 @@ show_param: lex->sql_command = SQLCOM_SHOW_CREATE; if (!lex->select_lex.add_table_to_list(thd, $3, NULL,0)) MYSQL_YYABORT; - lex->only_view= 0; lex->create_info.storage_media= HA_SM_DEFAULT; } | CREATE VIEW_SYM table_ident @@ -13806,13 +13805,8 @@ lock: ; table_or_tables: - TABLE_SYM { Lex->only_view= FALSE; } - | TABLES { Lex->only_view= FALSE; } - ; - -table_or_view: - table_or_tables - | VIEW_SYM { Lex->only_view= TRUE; } + TABLE_SYM { } + | TABLES { } ; table_lock_list: -- cgit v1.2.1 From 535b514e4bfc6bec2cdf046bc2bfebf770a37b7d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 10:35:34 +0200 Subject: MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such --- client/mysqlcheck.c | 18 +++++++++++++----- mysql-test/r/mysqlcheck.result | 14 ++++++++++++++ mysql-test/t/mysqlcheck.test | 21 +++++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 021b89ed4b9..8e76433935e 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -861,11 +861,19 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view) switch (what_to_do) { case DO_CHECK: op = "CHECK"; - if (opt_quick) end = strmov(end, " QUICK"); - if (opt_fast) end = strmov(end, " FAST"); - if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */ - if (opt_extended) end = strmov(end, " EXTENDED"); - if (opt_check_only_changed) end = strmov(end, " CHANGED"); + if (view) + { + if (opt_fast || opt_check_only_changed) + DBUG_RETURN(0); + } + else + { + if (opt_quick) end = strmov(end, " QUICK"); + if (opt_fast) end = strmov(end, " FAST"); + if (opt_extended) end = strmov(end, " EXTENDED"); + if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */ + if (opt_check_only_changed) end = strmov(end, " CHANGED"); + } if (opt_upgrade) end = strmov(end, " FOR UPGRADE"); break; case DO_REPAIR: diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 40ac4d82461..f57216310af 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -316,3 +316,17 @@ CREATE TABLE test.`t.1` (id int); mysqlcheck test t.1 test.t.1 OK drop table test.`t.1`; +create view v1 as select 1; +mysqlcheck --process-views test +test.v1 OK +mysqlcheck --process-views --extended test +test.v1 OK +mysqlcheck --process-views --fast test +mysqlcheck --process-views --quick test +test.v1 OK +mysqlcheck --process-views --check-only-changed test +mysqlcheck --process-views --medium-check test +test.v1 OK +mysqlcheck --process-views --check-upgrade test +test.v1 OK +drop view v1; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 7c55bb73c1f..daec0d1f907 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -323,3 +323,24 @@ CREATE TABLE test.`t.1` (id int); --exec $MYSQL_CHECK test t.1 drop table test.`t.1`; + +# +# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +# +create view v1 as select 1; +--echo mysqlcheck --process-views test +--exec $MYSQL_CHECK --process-views test +--echo mysqlcheck --process-views --extended test +--exec $MYSQL_CHECK --process-views --extended test +--echo mysqlcheck --process-views --fast test +--exec $MYSQL_CHECK --process-views --fast test +--echo mysqlcheck --process-views --quick test +--exec $MYSQL_CHECK --process-views --quick test +--echo mysqlcheck --process-views --check-only-changed test +--exec $MYSQL_CHECK --process-views --check-only-changed test +--echo mysqlcheck --process-views --medium-check test +--exec $MYSQL_CHECK --process-views --medium-check test +--echo mysqlcheck --process-views --check-upgrade test +--exec $MYSQL_CHECK --process-views --check-upgrade test +drop view v1; + -- cgit v1.2.1 From f806b4d44bc49efd4386c263d19e91f9fa8fef7a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 12:13:43 +0200 Subject: MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views create a separate list of views to repair, and repair them in a separate loop. --- client/mysqlcheck.c | 22 +++++++++++++++++++--- mysql-test/r/mysqlcheck.result | 9 +++++++++ mysql-test/t/mysqlcheck.test | 24 +++++++++++++++--------- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 8e76433935e..37ede5cac30 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -53,6 +53,7 @@ static char *opt_password = 0, *current_user = 0, static char *opt_plugin_dir= 0, *opt_default_auth= 0; static int first_error = 0; DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds; +DYNAMIC_ARRAY views4repair; static char *shared_memory_base_name=0; static uint opt_protocol=0; @@ -956,6 +957,7 @@ static void print_result() uint length_of_db; uint i; my_bool found_error=0, table_rebuild=0; + DYNAMIC_ARRAY *array4repair= &tables4repair; DBUG_ENTER("print_result"); res = mysql_use_result(sock); @@ -992,9 +994,10 @@ static void print_result() else { char *table_name= prev + (length_of_db+1); - insert_dynamic(&tables4repair, (uchar*) table_name); + insert_dynamic(array4repair, (uchar*) table_name); } } + array4repair= &tables4repair; found_error=0; table_rebuild=0; prev_alter[0]= 0; @@ -1010,8 +1013,11 @@ static void print_result() we have to run upgrade on it. In this case we write a nicer message than "Please do "REPAIR TABLE""... */ - if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE")) + if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR ")) + { printf("%-50s %s", row[0], "Needs upgrade"); + array4repair= strstr(row[3], "VIEW") ? &views4repair : &tables4repair; + } else printf("%s\n%-9s: %s", row[0], row[2], row[3]); if (opt_auto_repair && strcmp(row[2],"note")) @@ -1061,7 +1067,7 @@ static void print_result() else { char *table_name= prev + (length_of_db+1); - insert_dynamic(&tables4repair, (uchar*) table_name); + insert_dynamic(array4repair, (uchar*) table_name); } } mysql_free_result(res); @@ -1173,6 +1179,7 @@ int main(int argc, char **argv) if (opt_auto_repair && (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) || + my_init_dynamic_array(&views4repair, sizeof(char)*(NAME_LEN*2+2),16,64) || my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64) || my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1))) goto end; @@ -1201,6 +1208,13 @@ int main(int argc, char **argv) rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i)); for (i = 0; i < alter_table_cmds.elements ; i++) run_query((char*) dynamic_array_ptr(&alter_table_cmds, i)); + if (!opt_silent && views4repair.elements) + puts("\nRepairing views"); + for (i = 0; i < views4repair.elements ; i++) + { + char *name= (char*) dynamic_array_ptr(&views4repair, i); + handle_request_for_tables(name, fixed_name_length(name), TRUE); + } } ret= test(first_error); @@ -1208,8 +1222,10 @@ int main(int argc, char **argv) dbDisconnect(current_host); if (opt_auto_repair) { + delete_dynamic(&views4repair); delete_dynamic(&tables4repair); delete_dynamic(&tables4rebuild); + delete_dynamic(&alter_table_cmds); } end1: my_free(opt_password); diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index f57216310af..c5ba3e7dc79 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -330,3 +330,12 @@ test.v1 OK mysqlcheck --process-views --check-upgrade test test.v1 OK drop view v1; +create table t1(a int); +mysqlcheck --process-views --check-upgrade --auto-repair test +test.t1 OK +test.v1 Needs upgrade + +Repairing views +test.v1 OK +drop view v1; +drop table t1; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index daec0d1f907..ac42e1e184d 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -7,6 +7,7 @@ # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc +let $MYSQLD_DATADIR= `select @@datadir`; # # Clean up after previous tests @@ -65,7 +66,6 @@ create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; -let $MYSQLD_DATADIR= `select @@datadir`; --echo removing and creating --remove_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI --write_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI @@ -117,7 +117,6 @@ DROP TABLE t1, t2; create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; -let $MYSQLD_DATADIR= `select @@datadir`; --copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm show tables; --exec $MYSQL_CHECK --check-upgrade --databases test @@ -162,24 +161,23 @@ CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers -let $MYSQLTEST_VARDIR= `select @@datadir`; ---write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG +--write_file $MYSQLD_DATADIR/a@b/c@d.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN +--write_file $MYSQLD_DATADIR/a@b/tr1.TRN TYPE=TRIGGERNAME trigger_table=c@d EOF ---write_file $MYSQLTEST_VARDIR/a@b/t1.TRG +--write_file $MYSQLD_DATADIR/a@b/t1.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN +--write_file $MYSQLD_DATADIR/a@b/tr2.TRN TYPE=TRIGGERNAME trigger_table=t1 EOF @@ -253,7 +251,6 @@ INSERT INTO bug47205 VALUES ("foobar"); FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -280,7 +277,6 @@ CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -344,3 +340,13 @@ create view v1 as select 1; --exec $MYSQL_CHECK --process-views --check-upgrade test drop view v1; + +# +# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +# +create table t1(a int); +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--echo mysqlcheck --process-views --check-upgrade --auto-repair test +--exec $MYSQL_CHECK --process-views --check-upgrade --auto-repair test +drop view v1; +drop table t1; -- cgit v1.2.1 From 33d480f8b75bb6188fc48d17196ab8d95223ade4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 16:33:10 +0200 Subject: MDEV-4608 deb packages for jessie jessie has newer automake so build-depends could not be satisfied. refresh build-depends, remove automake, libtool, doxygen, texlive-latex-base, ghostscript. --- debian/dist/Debian/control | 7 ++++++- debian/dist/Ubuntu/control | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 104917d8e2d..e83ac1ffa5d 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -4,7 +4,12 @@ Priority: optional Maintainer: MariaDB Developers XSBC-Original-Maintainer: Maria Developers Uploaders: MariaDB Developers -Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev, libjemalloc-dev (>= 3.0.0) +Build-Depends: procps | hurd, debhelper, libncurses5-dev (>= 5.0-6), + perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), + zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, + libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, + dpatch, gawk, bison, lsb-release, hardening-wrapper, + ${CMAKE_DEP}libaio-dev, libjemalloc-dev (>= 3.0.0) Standards-Version: 3.8.3 Homepage: http://mariadb.org/ Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index 0c331638880..94424f38db8 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -4,7 +4,12 @@ Priority: optional Maintainer: MariaDB Developers XSBC-Original-Maintainer: Maria Developers Uploaders: MariaDB Developers -Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev, libjemalloc-dev (>= 3.0.0) +Build-Depends: procps | hurd, debhelper, libncurses5-dev (>= 5.0-6), + perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), + zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, + libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, + dpatch, gawk, bison, lsb-release, hardening-wrapper, + ${CMAKE_DEP}libaio-dev, libjemalloc-dev (>= 3.0.0) Standards-Version: 3.8.2 Homepage: http://mariadb.org/ Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files -- cgit v1.2.1 From 5d8cee44073025e5e9da44d7643583b0448c2b85 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 17:11:07 +0200 Subject: MDEV-8224 Server crashes in get_server_from_table_to_cache on empty name --- mysql-test/r/empty_server_name-8224.result | 1 + mysql-test/t/empty_server_name-8224.test | 5 +++++ sql/sql_servers.cc | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/empty_server_name-8224.result create mode 100644 mysql-test/t/empty_server_name-8224.test diff --git a/mysql-test/r/empty_server_name-8224.result b/mysql-test/r/empty_server_name-8224.result new file mode 100644 index 00000000000..6423114470d --- /dev/null +++ b/mysql-test/r/empty_server_name-8224.result @@ -0,0 +1 @@ +create server '' foreign data wrapper w2 options (host '127.0.0.1'); diff --git a/mysql-test/t/empty_server_name-8224.test b/mysql-test/t/empty_server_name-8224.test new file mode 100644 index 00000000000..e85e35b28b8 --- /dev/null +++ b/mysql-test/t/empty_server_name-8224.test @@ -0,0 +1,5 @@ +create server '' foreign data wrapper w2 options (host '127.0.0.1'); +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index dce679a883f..dad7ab152ed 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -326,7 +326,8 @@ get_server_from_table_to_cache(TABLE *table) table->use_all_columns(); /* get each field into the server struct ptr */ - server->server_name= get_field(&mem, table->field[0]); + ptr= get_field(&mem, table->field[0]); + server->server_name= ptr ? ptr : blank; server->server_name_length= (uint) strlen(server->server_name); ptr= get_field(&mem, table->field[1]); server->host= ptr ? ptr : blank; -- cgit v1.2.1 From 0599d80fccc000b3b4068f7acbb705f49188c55a Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 3 Jun 2015 17:37:51 +0200 Subject: Fix swapping key numeric values on Big Endian machines. Fix typo error in CntIndexRange (kp instead of p) Change version date modified: storage/connect/connect.cc modified: storage/connect/ha_connect.cc --- storage/connect/connect.cc | 6 +++--- storage/connect/ha_connect.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 7b7144dacbb..4e554b16638 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /***********************************************************************/ -/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2012 */ +/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -949,9 +949,9 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, } else #if defined(WORDS_BIGENDIAN) - SetSwapValue(valp, (char*)kp); + SetSwapValue(valp, (char*)p); #else // !WORDS_BIGENDIAN - valp->SetBinValue((void*)kp); + valp->SetBinValue((void*)p); #endif // !WORDS_BIGENDIAN if (trace) { diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 6769760c5fa..c2fb6481cb0 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -169,7 +169,7 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.03.0007 April 30, 2015"; + char version[]= "Version 1.03.0007 June 03, 2015"; #if defined(__WIN__) char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__; char slash= '\\'; -- cgit v1.2.1 From c79e98e4918635da126231224088c054a21917be Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 18:45:08 +0200 Subject: MDEV-8085 main.group_by failed in buildbot change the test case to be deterministic (while still sufficient to test a bug) --- mysql-test/r/group_by.result | 2 +- mysql-test/t/group_by.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 1518a2f8982..0b4973cc35b 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2342,7 +2342,7 @@ DROP TABLE t1; create table t1 (a int, b int); insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); create table t2 (c int, d int); -insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +insert into t2 values (1,11), (2,22), (4,44); select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); a sum(b) (select d from t2 where c=a order by max(b) limit 1) 1 23 11 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index e5beeef17fe..c94d27b1d16 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1523,7 +1523,7 @@ DROP TABLE t1; create table t1 (a int, b int); insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); create table t2 (c int, d int); -insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +insert into t2 values (1,11), (2,22), (4,44); select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); drop table t1, t2; -- cgit v1.2.1 From 934a18daece8f503e60886d3e4c5d84307f453c7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 Jun 2015 19:42:34 +0200 Subject: .gitattributes: *.dat files should not be CRLF converted --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 60b9a3481aa..0b51237e6d6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,6 +12,7 @@ # These files should be checked out as is *.result -text -whitespace +*.dat -text -whitespace # Denote all files that are truly binary and should not be modified. *.png binary -- cgit v1.2.1 From a8b8544a03f56a6a2c6357a7ea137cbb17a6372b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 4 Jun 2015 13:00:53 +0300 Subject: MDEV-7906: InnoDB: Failing assertion: prebuilt->sql_stat_start || trx->state == 1 on concurrent multi-table update Analysis: Problem is that SQL-layer calls handler API after storage engine has already returned error state. InnoDB does internal rollback when it notices transaction error (e.g. lock wait timeout, deadlock, etc.) and after this transaction is not naturally in correct state to continue. Fix: Do not continue fetch operations if transaction is not started. --- storage/innobase/handler/ha_innodb.cc | 6 +++++- storage/xtradb/handler/ha_innodb.cc | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a7854af7014..401a14e62da 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -93,7 +93,6 @@ extern "C" { #include "ibuf0ibuf.h" enum_tx_isolation thd_get_trx_isolation(const THD* thd); - } #include "ha_innodb.h" @@ -6299,6 +6298,11 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); + /* If transaction is not startted do not continue, instead return a error code. */ + if(!(prebuilt->sql_stat_start || (prebuilt->trx && prebuilt->trx->conc_state == 1))) { + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + ut_a(prebuilt->trx == thd_to_trx(user_thd)); innodb_srv_conc_enter_innodb(prebuilt->trx); diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index ac883e9ee6b..5034e7e70e1 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -102,7 +102,6 @@ extern "C" { #include "ibuf0ibuf.h" enum_tx_isolation thd_get_trx_isolation(const THD* thd); - } #include "ha_innodb.h" @@ -7327,6 +7326,11 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); + /* If transaction is not startted do not continue, instead return a error code. */ + if(!(prebuilt->sql_stat_start || (prebuilt->trx && prebuilt->trx->state == 1))) { + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + if (UNIV_UNLIKELY(share->ib_table->is_corrupt && srv_pass_corrupt_table <= 1)) { DBUG_RETURN(HA_ERR_CRASHED); -- cgit v1.2.1 From 9da8a8f94690704e069b2cc99218384b6bbbd95a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 4 Jun 2015 18:49:12 +0400 Subject: MDEV-7269 mysqlbinlog Don't know how to handle column type=0 meta=0 (0000)# MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL --- mysql-test/r/type_decimal.result | 21 +++++++ mysql-test/std_data/old_decimal/t1dec102.MYD | 1 + mysql-test/std_data/old_decimal/t1dec102.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/old_decimal/t1dec102.frm | Bin 0 -> 8554 bytes .../suite/binlog/r/binlog_mysqlbinlog_row.result | 65 +++++++++++++++++++++ .../suite/binlog/t/binlog_mysqlbinlog_row.test | 13 ++++- mysql-test/t/type_decimal.test | 24 ++++++++ sql/field.cc | 2 +- sql/log_event.cc | 6 ++ 9 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 mysql-test/std_data/old_decimal/t1dec102.MYD create mode 100644 mysql-test/std_data/old_decimal/t1dec102.MYI create mode 100644 mysql-test/std_data/old_decimal/t1dec102.frm diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index f8649f030bb..cde8816dee4 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -994,3 +994,24 @@ GROUP BY t2.col0 WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); 1 DROP TABLE t1, t2; +# +# Start of 5.5 tests +# +# +# MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +# +SHOW CREATE TABLE t1dec102; +Table Create Table +t1dec102 CREATE TABLE `t1dec102` ( + `a` decimal(10,2)/*old*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1dec102; +Field Type Null Key Default Extra +a decimal(10,2)/*old*/ YES NULL +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +COLUMN_NAME DATA_TYPE COLUMN_TYPE +a decimal decimal(10,2)/*old*/ +DROP TABLE t1dec102; +# +# End of 5.5 tests +# diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYD b/mysql-test/std_data/old_decimal/t1dec102.MYD new file mode 100644 index 00000000000..59e43854d4a --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.MYD @@ -0,0 +1 @@ + 123.45 123.46 123.47 \ No newline at end of file diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYI b/mysql-test/std_data/old_decimal/t1dec102.MYI new file mode 100644 index 00000000000..e0b2d4a003c Binary files /dev/null and b/mysql-test/std_data/old_decimal/t1dec102.MYI differ diff --git a/mysql-test/std_data/old_decimal/t1dec102.frm b/mysql-test/std_data/old_decimal/t1dec102.frm new file mode 100644 index 00000000000..652cfc3bbac Binary files /dev/null and b/mysql-test/std_data/old_decimal/t1dec102.frm differ diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index fc22085496d..469e670ae9d 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -327,6 +327,18 @@ INSERT INTO t2 SET a=1; INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +a +-999.99 +0.00 +123.45 +123.46 +123.47 +999.99 +DROP TABLE t1dec102; flush logs; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -4131,6 +4143,59 @@ SET TIMESTAMP=1000000000/*!*/; DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1dec102` /* generated by server */ +/*!*/; +# at # #010909 4:46:40 server id 1 end_log_pos # Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test index 9b41c63d195..9609a9af384 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test @@ -438,9 +438,20 @@ INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +DROP TABLE t1dec102; + flush logs; -let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ --exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001 diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 1d4ef345747..659e75270ca 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -583,3 +583,27 @@ JOIN WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); DROP TABLE t1, t2; + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +--echo # + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +SHOW CREATE TABLE t1dec102; +SHOW COLUMNS FROM t1dec102; +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +DROP TABLE t1dec102; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/sql/field.cc b/sql/field.cc index 52a490921b8..68daba3922d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2483,7 +2483,7 @@ void Field_decimal::sql_type(String &res) const if (dec) tmp--; res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(), - "decimal(%d,%d)",tmp,dec)); + "decimal(%d,%d)/*old*/",tmp,dec)); add_zerofill_and_unsigned(res); } diff --git a/sql/log_event.cc b/sql/log_event.cc index d04ac1e1a44..e63884eaeab 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2192,6 +2192,12 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr, my_snprintf(typestr, typestr_length, "STRING(%d)", length); return my_b_write_quoted_with_length(file, ptr, length); + case MYSQL_TYPE_DECIMAL: + my_b_printf(file, + "!! Old DECIMAL (mysql-4.1 or earlier). " + "Not enough metadata to display the value. "); + break; + default: { char tmp[5]; -- cgit v1.2.1 From 08fa02cf227a632ed787357357d6116b72c6d5e6 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 4 Jun 2015 18:51:30 +0400 Subject: Some MYD files (e.g. in mysql-test/std_data) could erroneously be treated by git as text files. Marking all MyISAM files as binary in .gitattributes: (*.frm, *.MYD, *.MYI) --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index 60b9a3481aa..342dad5646b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,6 +16,9 @@ # Denote all files that are truly binary and should not be modified. *.png binary *.jpg binary +*.frm binary +*.MYD binary +*.MYI binary *.c diff=cpp *.h diff=cpp -- cgit v1.2.1 From a477cd175476b26e5bc0090b580e9b590b17e29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 3 Jun 2015 23:31:05 +0300 Subject: MDEV-6500: Stale data returned after TRUNCATE PARTITION operation When truncating a table's partition, we also need to invalidate the query cache for it. --- mysql-test/r/truncate-stale-6500.result | 33 +++++++++++++++++++++++++++++++++ mysql-test/t/truncate-stale-6500.test | 32 ++++++++++++++++++++++++++++++++ sql/sql_partition_admin.cc | 11 +++++++++-- 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/truncate-stale-6500.result create mode 100644 mysql-test/t/truncate-stale-6500.test diff --git a/mysql-test/r/truncate-stale-6500.result b/mysql-test/r/truncate-stale-6500.result new file mode 100644 index 00000000000..b6222716953 --- /dev/null +++ b/mysql-test/r/truncate-stale-6500.result @@ -0,0 +1,33 @@ +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( +`uniqueId` INT NOT NULL, +`partitionId` INT NOT NULL, +PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( +PARTITION p01 VALUES IN (1), +PARTITION p02 VALUES IN (2) +); +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); +SELECT * FROM `test`; +uniqueId partitionId +407237055 2 +#Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 1 +ALTER TABLE `test` TRUNCATE PARTITION `p02`; +#Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 0 +#Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +uniqueId partitionId +SELECT SQL_CACHE * FROM `test`; +uniqueId partitionId +SELECT SQL_NO_CACHE * FROM `test`; +uniqueId partitionId +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/mysql-test/t/truncate-stale-6500.test b/mysql-test/t/truncate-stale-6500.test new file mode 100644 index 00000000000..47dffb1966d --- /dev/null +++ b/mysql-test/t/truncate-stale-6500.test @@ -0,0 +1,32 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( + `uniqueId` INT NOT NULL, + `partitionId` INT NOT NULL, + PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( + PARTITION p01 VALUES IN (1), + PARTITION p02 VALUES IN (2) +); + + +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); + +SELECT * FROM `test`; + +--echo #Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +ALTER TABLE `test` TRUNCATE PARTITION `p02`; + +--echo #Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; + +--echo #Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +SELECT SQL_CACHE * FROM `test`; +SELECT SQL_NO_CACHE * FROM `test`; + +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index a03dcc5c16e..a104676a3ff 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -174,9 +174,16 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd) log. The exception is a unimplemented truncate method or failure before any call to handler::truncate() is done. Also, it is logged in statement format, regardless of the binlog format. + + Since we've changed data within the table, we also have to invalidate + the query cache for it. */ - if (error != HA_ERR_WRONG_COMMAND && binlog_stmt) - error|= write_bin_log(thd, !error, thd->query(), thd->query_length()); + if (error != HA_ERR_WRONG_COMMAND) + { + query_cache_invalidate3(thd, first_table, FALSE); + if (binlog_stmt) + error|= write_bin_log(thd, !error, thd->query(), thd->query_length()); + } /* A locked table ticket was upgraded to a exclusive lock. After the -- cgit v1.2.1 From 980bdc3d64425e329f7742fad04e4bc8547ba6b8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 4 Jun 2015 17:39:05 +0200 Subject: followup: CREATE SERVER tests should not be run for embedded --- mysql-test/t/empty_server_name-8224.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/t/empty_server_name-8224.test b/mysql-test/t/empty_server_name-8224.test index e85e35b28b8..528bce5dac5 100644 --- a/mysql-test/t/empty_server_name-8224.test +++ b/mysql-test/t/empty_server_name-8224.test @@ -1,3 +1,7 @@ +# +# MDEV-8224 Server crashes in get_server_from_table_to_cache on empty name +# +--source include/not_embedded.inc create server '' foreign data wrapper w2 options (host '127.0.0.1'); --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --shutdown_server 10 -- cgit v1.2.1 From 750aa8b09d018d7bd44ed83aad4d26a16b1873bc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 4 Jun 2015 18:58:12 +0200 Subject: 5.5.43-37.2 --- storage/xtradb/include/univ.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 50606b7001f..13ada8f1068 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */ (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 37.1 +#define PERCONA_INNODB_VERSION 37.2 #endif #define INNODB_VERSION_STR MYSQL_SERVER_VERSION -- cgit v1.2.1 From 1ff423dfc089058d10945e728028f89c8b37b32f Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 4 Jun 2015 21:12:29 +0400 Subject: MDEV-8243 configure defines to empty string, not 1 --- config.h.cmake | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config.h.cmake b/config.h.cmake index 34f77dba050..73dc918bc3c 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -203,7 +203,7 @@ #cmakedefine HAVE_MADVISE 1 #cmakedefine HAVE_DECL_MADVISE 1 #cmakedefine HAVE_DECL_TGOTO 1 -#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA +#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA 1 #cmakedefine HAVE_MALLINFO 1 #cmakedefine HAVE_MEMCPY 1 #cmakedefine HAVE_MEMMOVE 1 @@ -396,7 +396,7 @@ #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ -#cmakedefine HAVE_MBSTATE_T +#cmakedefine HAVE_MBSTATE_T 1 #define MAX_INDEXES 64 @@ -431,15 +431,15 @@ #cmakedefine HAVE_WCTYPE_H 1 #cmakedefine HAVE_WCHAR_H 1 #cmakedefine HAVE_LANGINFO_H 1 -#cmakedefine HAVE_MBRLEN -#cmakedefine HAVE_MBSCMP -#cmakedefine HAVE_MBSRTOWCS -#cmakedefine HAVE_WCRTOMB -#cmakedefine HAVE_MBRTOWC -#cmakedefine HAVE_WCSCOLL -#cmakedefine HAVE_WCSDUP -#cmakedefine HAVE_WCWIDTH -#cmakedefine HAVE_WCTYPE +#cmakedefine HAVE_MBRLEN 1 +#cmakedefine HAVE_MBSCMP 1 +#cmakedefine HAVE_MBSRTOWCS 1 +#cmakedefine HAVE_WCRTOMB 1 +#cmakedefine HAVE_MBRTOWC 1 +#cmakedefine HAVE_WCSCOLL 1 +#cmakedefine HAVE_WCSDUP 1 +#cmakedefine HAVE_WCWIDTH 1 +#cmakedefine HAVE_WCTYPE 1 #cmakedefine HAVE_ISWLOWER 1 #cmakedefine HAVE_ISWUPPER 1 #cmakedefine HAVE_TOWLOWER 1 @@ -453,7 +453,7 @@ #cmakedefine HAVE_STRCASECMP 1 #cmakedefine HAVE_STRNCASECMP 1 #cmakedefine HAVE_STRDUP 1 -#cmakedefine HAVE_LANGINFO_CODESET +#cmakedefine HAVE_LANGINFO_CODESET 1 #cmakedefine HAVE_TCGETATTR 1 #cmakedefine HAVE_FLOCKFILE 1 -- cgit v1.2.1 From f07b3463e7a4ff32316e1cc94d553b5009ac51f2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 5 Jun 2015 02:04:32 +0200 Subject: do not re-populate I_S tables in subqueries --- mysql-test/r/information_schema2.result | 12 ++++++++++++ mysql-test/t/information_schema2.test | 13 +++++++++++++ sql/sql_show.cc | 7 ++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result index 60a20944839..3f7f3ecd4e1 100644 --- a/mysql-test/r/information_schema2.result +++ b/mysql-test/r/information_schema2.result @@ -6,3 +6,15 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); variable_name BASEDIR +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +a exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) +a 0 +t 1 +z 0 +show status like 'created_tmp_tables'; +Variable_name Value +Created_tmp_tables 38 +drop table t1; diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test index c2479087f47..06bc6d1bf55 100644 --- a/mysql-test/t/information_schema2.test +++ b/mysql-test/t/information_schema2.test @@ -7,3 +7,16 @@ select variable_name from information_schema.session_status where variable_name select variable_name from information_schema.session_variables where variable_name = (select variable_name from information_schema.session_variables where variable_name = 'basedir'); +# +# information_schema tables inside subqueries, they should not be re-populated +# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s +# table. if it's re-populated, it'll do that multiple times) +# +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +# fix the result in ps-protocol +--replace_result 39 38 +show status like 'created_tmp_tables'; +drop table t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f6ed5702ce5..a3b8428f462 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7720,15 +7720,20 @@ bool get_schema_tables_result(JOIN *join, TABLE_LIST *table_list= tab->table->pos_in_table_list; if (table_list->schema_table && thd->fill_information_schema_tables()) { +#if MYSQL_VERSION_ID > 100105 +#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields bool is_subselect= (&lex->unit != lex->current_select->master_unit() && lex->current_select->master_unit()->item); +#else +#define is_subselect false +#endif /* A value of 0 indicates a dummy implementation */ if (table_list->schema_table->fill_table == 0) continue; /* skip I_S optimizations specific to get_all_tables */ - if (thd->lex->describe && + if (lex->describe && (table_list->schema_table->fill_table != get_all_tables)) continue; -- cgit v1.2.1 From af2256ff72c21a63ca0d786fa161386202a0150a Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 3 Jun 2015 13:59:58 +0400 Subject: MDEV-7207 - ALTER VIEW does not change ALGORITM Fixed that ALTER VIEW ALGORITHM=UNDEFINED behaved as if algorithm was not specified. --- mysql-test/r/view.result | 18 ++++++++++++++++++ mysql-test/t/view.test | 13 +++++++++++++ sql/sql_view.cc | 2 +- sql/sql_yacc.yy | 2 +- sql/table.h | 2 ++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index ee9779a2c23..cbacb2c1ef8 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -5411,6 +5411,24 @@ create view v2 as select t2.* from (t2 left join v1 using (id)); update t3 left join v2 using (id) set flag=flag+1; drop view v2, v1; drop table t1, t2, t3; +# +# MDEV-7207 - ALTER VIEW does not change ALGORITM +# +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +drop view v2; +drop table t1; # ----------------------------------------------------------------- # -- End of 5.5 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index b96799215fe..0432db0ba31 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5367,6 +5367,19 @@ update t3 left join v2 using (id) set flag=flag+1; drop view v2, v1; drop table t1, t2, t3; +--echo # +--echo # MDEV-7207 - ALTER VIEW does not change ALGORITM +--echo # +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +drop view v2; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 47b238715ac..255f876e02a 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -228,7 +228,7 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view) view->definer.user= decoy.definer.user; lex->definer= &view->definer; } - if (lex->create_view_algorithm == DTYPE_ALGORITHM_UNDEFINED) + if (lex->create_view_algorithm == VIEW_ALGORITHM_INHERIT) lex->create_view_algorithm= (uint8) decoy.algorithm; if (lex->create_view_suid == VIEW_SUID_DEFAULT) lex->create_view_suid= decoy.view_suid ? diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5b2f10b278c..ec246ae8079 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6552,7 +6552,7 @@ alter: my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW"); MYSQL_YYABORT; } - lex->create_view_algorithm= DTYPE_ALGORITHM_UNDEFINED; + lex->create_view_algorithm= VIEW_ALGORITHM_INHERIT; lex->create_view_mode= VIEW_ALTER; } view_tail diff --git a/sql/table.h b/sql/table.h index 832445486ab..17fdd4aba15 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1446,6 +1446,8 @@ typedef struct st_schema_table #define DT_PHASES_MATERIALIZE (DT_COMMON | DT_MATERIALIZE) #define VIEW_ALGORITHM_UNDEFINED 0 +/* Special value for ALTER VIEW: inherit original algorithm. */ +#define VIEW_ALGORITHM_INHERIT DTYPE_VIEW #define VIEW_ALGORITHM_MERGE (DTYPE_VIEW | DTYPE_MERGE) #define VIEW_ALGORITHM_TMPTABLE (DTYPE_VIEW | DTYPE_MATERIALIZE) -- cgit v1.2.1 From b611ac06a736a5d8d4fcf0d81316343745d4113d Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 3 Jun 2015 14:30:09 +0400 Subject: MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL Factory timezone is supposed "For companies who don't want to put time zone specification in their installation procedures. When users run date, they'll get the message. Also useful for the "comp.sources" version." This "message" is exposed as timezone abbreviation, which is supposed to be short and thus may cause generated INSERT statements to fail. Do not attempt to load Factory timezone. --- mysql-test/r/mysql_tzinfo_to_sql_symlink.result | 9 +++++++++ mysql-test/t/mysql_tzinfo_to_sql_symlink.test | 11 +++++++++++ sql/tztime.cc | 3 ++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result index dda732937ee..f127e756987 100644 --- a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result @@ -60,3 +60,12 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, # TRUNCATE TABLE time_zone_leap_second; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +# +# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +# +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; diff --git a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test index 1ba4e91be3c..8ca82b87e30 100644 --- a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test @@ -37,3 +37,14 @@ # --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo + +--echo # +--echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +--echo # +--exec mkdir $MYSQLTEST_VARDIR/zoneinfo +--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 + +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo diff --git a/sql/tztime.cc b/sql/tztime.cc index da23d6fc8c2..079611504cc 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -2521,7 +2521,8 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose) for (i= 0; i < cur_dir->number_off_files; i++) { - if (cur_dir->dir_entry[i].name[0] != '.') + if (cur_dir->dir_entry[i].name[0] != '.' && + strcmp(cur_dir->dir_entry[i].name, "Factory")) { name_end_tmp= strmake(name_end, cur_dir->dir_entry[i].name, FN_REFLEN - (name_end - fullname)); -- cgit v1.2.1 From a2bb9d263993783923ba8fc83d5b9ddd36dbe09d Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 4 Jun 2015 16:04:05 +0400 Subject: MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes mysqld Server may crash if sanity checks of COLUMN_GET() fail. COLUMN_GET() description generator expects parent CAST item, which may not have been created due to failure of sanity checks. Then further attempt to report an error may crash the server. Fixed COLUMN_GET() description generator to handle such case. --- mysql-test/r/dyncol.result | 6 ++++++ mysql-test/t/dyncol.test | 6 ++++++ sql/item_strfunc.cc | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index aacb5363717..ca6908f449c 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1444,3 +1444,9 @@ column_get(column_create(1, "18446744073709552001" as char), 1 as int) Warnings: Warning 1918 Encountered illegal value '18446744073709552001' when converting to INT Note 1105 Cast to signed converted positive out-of-range integer to it's negative complement +# +# MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +# mysqld +# +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); +ERROR 42000: Too big scale 34 specified for ''y''. Maximum is 30. diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 68e10a5fffe..f0d9467420a 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -643,3 +643,9 @@ SELECT # select column_get(column_create(1, "18446744073709552001" as char), 1 as int); +--echo # +--echo # MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +--echo # mysqld +--echo # +--error ER_TOO_BIG_SCALE +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index eedf1499403..aca66fc29e0 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -4467,6 +4467,16 @@ null: void Item_dyncol_get::print(String *str, enum_query_type query_type) { + /* + Parent cast doesn't exist yet, only print dynamic column name. This happens + when called from create_func_cast() / wrong_precision_error(). + */ + if (!str->length()) + { + args[1]->print(str, query_type); + return; + } + /* see create_func_dyncol_get */ DBUG_ASSERT(str->length() >= 5); DBUG_ASSERT(strncmp(str->ptr() + str->length() - 5, "cast(", 5) == 0); -- cgit v1.2.1 From 88998cfaac83e2267f427c551c1f350fa1a505be Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 5 Jun 2015 16:10:50 +0200 Subject: Commit merge resolved files --- storage/connect/colblk.cpp | 34 -------------------------- storage/connect/filamdbf.cpp | 58 -------------------------------------------- storage/connect/jsonudf.cpp | 12 --------- storage/connect/rcmsg.c | 6 ----- storage/connect/tabxml.cpp | 5 ---- 5 files changed, 115 deletions(-) diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index 3b206f0743a..80b405be041 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -1,11 +1,7 @@ /************* Colblk C++ Functions Source Code File (.CPP) ************/ /* Name: COLBLK.CPP Version 2.1 */ /* */ -<<<<<<< HEAD /* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ -======= -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ ->>>>>>> MariaDB/10.0 /* */ /* This file contains the COLBLK class functions. */ /***********************************************************************/ @@ -115,11 +111,7 @@ bool COLBLK::Compare(PXOB xp) /***********************************************************************/ /* SetFormat: function used to set SELECT output format. */ /***********************************************************************/ -<<<<<<< HEAD bool COLBLK::SetFormat(PGLOBAL, FORMAT& fmt) -======= -bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt) ->>>>>>> MariaDB/10.0 { fmt = Format; @@ -183,11 +175,7 @@ bool COLBLK::InitValue(PGLOBAL g) /***********************************************************************/ /* SetBuffer: prepare a column block for write operation. */ /***********************************************************************/ -<<<<<<< HEAD bool COLBLK::SetBuffer(PGLOBAL g, PVAL, bool, bool) -======= -bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ->>>>>>> MariaDB/10.0 { sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer"); return true; @@ -226,11 +214,7 @@ void COLBLK::WriteColumn(PGLOBAL g) /***********************************************************************/ /* Make file output of a column descriptor block. */ /***********************************************************************/ -<<<<<<< HEAD void COLBLK::Print(PGLOBAL, FILE *f, uint n) -======= -void COLBLK::Print(PGLOBAL g, FILE *f, uint n) ->>>>>>> MariaDB/10.0 { char m[64]; int i; @@ -253,11 +237,7 @@ void COLBLK::Print(PGLOBAL g, FILE *f, uint n) /***********************************************************************/ /* Make string output of a column descriptor block. */ /***********************************************************************/ -<<<<<<< HEAD void COLBLK::Print(PGLOBAL, char *ps, uint) -======= -void COLBLK::Print(PGLOBAL g, char *ps, uint z) ->>>>>>> MariaDB/10.0 { sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); } // end of Print @@ -317,15 +297,9 @@ FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op) Buf_Type = TYPE_STRING; *Format.Type = 'C'; Format.Length = Long; -<<<<<<< HEAD #if defined(__WIN__) Format.Prec = 1; // Case insensitive #endif // __WIN__ -======= -#if defined(WIN32) - Format.Prec = 1; // Case insensitive -#endif // WIN32 ->>>>>>> MariaDB/10.0 Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() && To_Tdb->GetAmType() != TYPE_AM_PLG && To_Tdb->GetAmType() != TYPE_AM_PLM); @@ -373,11 +347,7 @@ TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp) /***********************************************************************/ /* ReadColumn: what this routine does is to return the table ID. */ /***********************************************************************/ -<<<<<<< HEAD void TIDBLK::ReadColumn(PGLOBAL) -======= -void TIDBLK::ReadColumn(PGLOBAL g) ->>>>>>> MariaDB/10.0 { if (Tname == NULL) { Tname = (char*)To_Tdb->GetName(); @@ -436,11 +406,7 @@ SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp) /***********************************************************************/ /* ReadColumn: what this routine does is to return the server ID. */ /***********************************************************************/ -<<<<<<< HEAD void SIDBLK::ReadColumn(PGLOBAL) -======= -void SIDBLK::ReadColumn(PGLOBAL g) ->>>>>>> MariaDB/10.0 { //if (Sname == NULL) { Sname = (char*)To_Tdb->GetServer(); diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp index 8774dbbfd2a..8afda723578 100644 --- a/storage/connect/filamdbf.cpp +++ b/storage/connect/filamdbf.cpp @@ -74,28 +74,19 @@ typedef struct _dbfheader { //uchar Dbfox :4; /* FoxPro if equal to 3 */ uchar Version; /* Version information flags */ char Filedate[3]; /* date, YYMMDD, binary. YY=year-1900 */ -<<<<<<< HEAD private: -======= -private: ->>>>>>> MariaDB/10.0 /* The following four members are stored in little-endian format on disk */ char m_RecordsBuf[4]; /* records in the file */ char m_HeadlenBuf[2]; /* bytes in the header */ char m_ReclenBuf[2]; /* bytes in a record */ char m_FieldsBuf[2]; /* Reserved but used to store fields */ -<<<<<<< HEAD public: -======= -public: ->>>>>>> MariaDB/10.0 char Incompleteflag; /* 01 if incomplete, else 00 */ char Encryptflag; /* 01 if encrypted, else 00 */ char Reserved2[12]; /* for LAN use */ char Mdxflag; /* 01 if production .mdx, else 00 */ char Language; /* Codepage */ char Reserved3[2]; -<<<<<<< HEAD uint Records(void) const {return uint4korr(m_RecordsBuf);} ushort Headlen(void) const {return uint2korr(m_HeadlenBuf);} @@ -105,17 +96,6 @@ public: void SetHeadlen(ushort num) {int2store(m_HeadlenBuf, num);} void SetReclen(ushort num) {int2store(m_ReclenBuf, num);} void SetFields(ushort num) {int2store(m_FieldsBuf, num);} -======= - - uint Records() const { return uint4korr(m_RecordsBuf); } - ushort Headlen() const { return uint2korr(m_HeadlenBuf); } - ushort Reclen() const { return uint2korr(m_ReclenBuf); } - ushort Fields() const { return uint2korr(m_FieldsBuf); } - - void SetHeadlen(ushort num) { int2store(m_HeadlenBuf, num); } - void SetReclen(ushort num) { int2store(m_ReclenBuf, num); } - void SetFields(ushort num) { int2store(m_FieldsBuf, num); } ->>>>>>> MariaDB/10.0 } DBFHEADER; /****************************************************************************/ @@ -430,22 +410,13 @@ int DBFBASE::ScanHeader(PGLOBAL g, PSZ fname, int lrecl, char *defpath) } else if (rc == RC_FX) return -1; -<<<<<<< HEAD if ((int)header.Reclen() != lrecl) { -======= - if ((int) header.Reclen() != lrecl) { ->>>>>>> MariaDB/10.0 sprintf(g->Message, MSG(BAD_LRECL), lrecl, header.Reclen()); return -1; } // endif Lrecl -<<<<<<< HEAD Records = (int)header.Records(); return (int)header.Headlen(); -======= - Records = (int) header.Records(); - return (int) header.Headlen(); ->>>>>>> MariaDB/10.0 } // end of ScanHeader /* ---------------------------- Class DBFFAM ------------------------------ */ @@ -606,13 +577,8 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) header->Filedate[0] = datm->tm_year - 100; header->Filedate[1] = datm->tm_mon + 1; header->Filedate[2] = datm->tm_mday; -<<<<<<< HEAD header->SetHeadlen((ushort)hlen); header->SetReclen((ushort)reclen); -======= - header->SetHeadlen((ushort) hlen); - header->SetReclen((ushort) reclen); ->>>>>>> MariaDB/10.0 descp = (DESCRIPTOR*)header; // Currently only standard Xbase types are supported @@ -673,22 +639,13 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) DBFHEADER header; if ((rc = dbfhead(g, Stream, Tdbp->GetFile(g), &header)) == RC_OK) { -<<<<<<< HEAD if (Lrecl != (int)header.Reclen()) { -======= - if (Lrecl != (int) header.Reclen()) { ->>>>>>> MariaDB/10.0 sprintf(g->Message, MSG(BAD_LRECL), Lrecl, header.Reclen()); return true; } // endif Lrecl -<<<<<<< HEAD Records = (int)header.Records(); Headlen = (int)header.Headlen(); -======= - Records = (int) header.Records(); - Headlen = (int) header.Headlen(); ->>>>>>> MariaDB/10.0 } else if (rc == RC_NF) { Records = 0; Headlen = 0; @@ -924,16 +881,10 @@ void DBFFAM::CloseTableFile(PGLOBAL g, bool abort) if ((Stream= global_fopen(g, MSGID_OPEN_MODE_STRERROR, filename, "r+b"))) { char nRecords[4]; -<<<<<<< HEAD int4store(nRecords, n); fseek(Stream, 4, SEEK_SET); // Get header.Records position fwrite(nRecords, sizeof(nRecords), 1, Stream); -======= - int4store(&nRecords, n); - fseek(Stream, 4, SEEK_SET); // Get header.Records position - fwrite(&nRecords, sizeof(nRecords), 1, Stream); ->>>>>>> MariaDB/10.0 fclose(Stream); Stream= NULL; Records= n; // Update Records value @@ -1008,22 +959,13 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g) /************************************************************************/ DBFHEADER *hp = (DBFHEADER*)Memory; -<<<<<<< HEAD if (Lrecl != (int)hp->Reclen()) { -======= - if (Lrecl != (int) hp->Reclen()) { ->>>>>>> MariaDB/10.0 sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen()); return true; } // endif Lrecl -<<<<<<< HEAD Records = (int)hp->Records(); Headlen = (int)hp->Headlen(); -======= - Records = (int) hp->Records(); - Headlen = (int) hp->Headlen(); ->>>>>>> MariaDB/10.0 } // endif Headlen /**************************************************************************/ diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 0cd1e3a46f0..ff4025ee0fb 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -410,11 +410,7 @@ void Json_Array_Add_deinit(UDF_INIT* initid) } // end of Json_Array_Add_deinit /***********************************************************************/ -<<<<<<< HEAD /* Delete a value from a Json array. */ -======= -/* Add values to a Json array. */ ->>>>>>> MariaDB/10.0 /***********************************************************************/ my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { @@ -433,11 +429,7 @@ my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // end of Json_Array_Delete_init char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result, -<<<<<<< HEAD unsigned long *res_length, char *, char *) -======= - unsigned long *res_length, char *is_null, char *error) ->>>>>>> MariaDB/10.0 { char *str; int n; @@ -459,11 +451,7 @@ char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result, } else { n = *(int*)args->args[1]; arp = jvp->GetArray(); -<<<<<<< HEAD arp->DeleteValue(n); -======= - arp->DeleteValue(n - 1); ->>>>>>> MariaDB/10.0 arp->InitArray(g); if (!(str = Serialize(g, arp, NULL, 0))) { diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c index 1b32b718c5e..75759e03314 100644 --- a/storage/connect/rcmsg.c +++ b/storage/connect/rcmsg.c @@ -21,15 +21,9 @@ #include "msgid.h" #endif // NEWMSG -<<<<<<< HEAD #if !defined(__WIN__) #define stricmp strcasecmp #endif // !__WIN__ -======= -#if !defined(WIN32) -#define stricmp strcasecmp -#endif // !WIN32 ->>>>>>> MariaDB/10.0 char *msglang(void); diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 4d6f5933cbf..49fa9a1c554 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -1482,11 +1482,6 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) // HTML like table, columns are retrieved by position new(this) XPOSCOL(Value); // Change the class of this column Inod = -1; -<<<<<<< HEAD -======= -// Tdbp->Hasnod = true; -// return false; ->>>>>>> MariaDB/10.0 } else if (Type == 0 && !mode) { strcat(strcat(pbuf, "@"), Name); } else { // Type == 1 -- cgit v1.2.1 From 4728b515f3394165f3d75669e676277ae708c44d Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 5 Jun 2015 16:20:23 +0200 Subject: Commit win packaging & upgrade_wizard files --- win/packaging/ca/CustomAction.cpp | 84 +- win/packaging/custom_ui.wxs | 364 ++--- win/packaging/extra.wxs.in | 1826 ++++++++++++------------ win/packaging/heidisql_feature.wxi.in | 20 +- win/packaging/mysql_server.wxs.in | 178 +-- win/upgrade_wizard/stdafx.h | 94 +- win/upgrade_wizard/targetver.h | 16 +- win/upgrade_wizard/upgrade.cpp | 114 +- win/upgrade_wizard/upgrade.h | 62 +- win/upgrade_wizard/upgrade.rc | 296 ++-- win/upgrade_wizard/upgradeDlg.h | 146 +- win/upgrade_wizard/upgrade_wizard.exe.manifest | 28 +- 12 files changed, 1614 insertions(+), 1614 deletions(-) diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 67a17c2cc19..17bfca1debb 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -104,48 +104,48 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen) } pos= 0; - for(int i = 0 ; ; i++) - { - size_t n_backslashes = 0; - wchar_t c; - while (in[i] == L'\\') - { - i++; - n_backslashes++; - } - - c= in[i]; - if (c == 0) - { - /* - Escape all backslashes, but let the terminating double quotation mark - that caller adds be interpreted as a metacharacter. - */ - for(size_t j= 0; j < 2*n_backslashes;j++) - { - out[pos++]=L'\\'; - } - break; - } - else if (c == L'"') - { - /* - Escape all backslashes and the following double quotation mark. - */ - for(size_t j= 0; j < 2*n_backslashes + 1; j++) - { - out[pos++]=L'\\'; - } - out[pos++]= L'"'; - } - else - { - /* Backslashes aren't special here. */ - for (size_t j=0; j < n_backslashes; j++) - out[pos++] = L'\\'; - - out[pos++]= c; - } + for(int i = 0 ; ; i++) + { + size_t n_backslashes = 0; + wchar_t c; + while (in[i] == L'\\') + { + i++; + n_backslashes++; + } + + c= in[i]; + if (c == 0) + { + /* + Escape all backslashes, but let the terminating double quotation mark + that caller adds be interpreted as a metacharacter. + */ + for(size_t j= 0; j < 2*n_backslashes;j++) + { + out[pos++]=L'\\'; + } + break; + } + else if (c == L'"') + { + /* + Escape all backslashes and the following double quotation mark. + */ + for(size_t j= 0; j < 2*n_backslashes + 1; j++) + { + out[pos++]=L'\\'; + } + out[pos++]= L'"'; + } + else + { + /* Backslashes aren't special here. */ + for (size_t j=0; j < n_backslashes; j++) + out[pos++] = L'\\'; + + out[pos++]= c; + } } out[pos++]= 0; } diff --git a/win/packaging/custom_ui.wxs b/win/packaging/custom_ui.wxs index 8a87fb4d246..70fa3ba3abd 100644 --- a/win/packaging/custom_ui.wxs +++ b/win/packaging/custom_ui.wxs @@ -1,183 +1,183 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - 1 - - - - Create default [ProductName] instance - - - - {\WixUI_Font_Title}Default instance properties - - - - - - - Service '[SERVICENAME]' will be removed - - - - Remove default database directory '[DATABASELOCATION]' - - - - - 1 - - - 1 - - - 1 - - - - Remove default [ProductName] database - - - - {\WixUI_Font_Title}Default instance properties - - - - - - - - - - 1 - 1 - - - - WixUI_InstallMode = "Change" - !DBInstance=3 - WixUI_InstallMode = "Remove" - - - - - - - - - - - - - - - - - - SERVICENAME - - - - - - - - - - - - Running mysql_install_db.exe - - - - - - - - - - - - - - - - - - - - - - - - CMDLINE_SERVICENAME - - CMDLINE_DATABASELOCATION - - - - CMDLINE_SERVICENAME - - CMDLINE_DATABASELOCATION - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + 1 + + + + Create default [ProductName] instance + + + + {\WixUI_Font_Title}Default instance properties + + + + + + + Service '[SERVICENAME]' will be removed + + + + Remove default database directory '[DATABASELOCATION]' + + + + + 1 + + + 1 + + + 1 + + + + Remove default [ProductName] database + + + + {\WixUI_Font_Title}Default instance properties + + + + + + + + + + 1 + 1 + + + + WixUI_InstallMode = "Change" + !DBInstance=3 + WixUI_InstallMode = "Remove" + + + + + + + + + + + + + + + + + + SERVICENAME + + + + + + + + + + + + Running mysql_install_db.exe + + + + + + + + + + + + + + + + + + + + + + + + CMDLINE_SERVICENAME + + CMDLINE_DATABASELOCATION + + + + CMDLINE_SERVICENAME + + CMDLINE_DATABASELOCATION + + \ No newline at end of file diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index d8c89f005b2..3425a76427b 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -1,913 +1,913 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win/packaging/heidisql_feature.wxi.in b/win/packaging/heidisql_feature.wxi.in index 3f60fcd8f27..241554e035a 100644 --- a/win/packaging/heidisql_feature.wxi.in +++ b/win/packaging/heidisql_feature.wxi.in @@ -1,10 +1,10 @@ - - - HEIDISQLINSTALLED AND NOT REMOVE ~= ALL - - - + + + HEIDISQLINSTALLED AND NOT REMOVE ~= ALL + + + diff --git a/win/packaging/mysql_server.wxs.in b/win/packaging/mysql_server.wxs.in index 79fde801cf5..c10116830e7 100644 --- a/win/packaging/mysql_server.wxs.in +++ b/win/packaging/mysql_server.wxs.in @@ -1,89 +1,89 @@ - - - - - - - - - - - - - - - - NOT NEWERVERSIONDETECTED OR Installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @CPACK_WIX_FEATURES@ - - - @CPACK_WIX_DIRECTORIES@ - - - @CPACK_WIX_COMPONENTS@ - - - @CPACK_WIX_COMPONENT_GROUPS@ - - - @CPACK_WIX_INCLUDES@ - - - + + + + + + + + + + + + + + + + NOT NEWERVERSIONDETECTED OR Installed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @CPACK_WIX_FEATURES@ + + + @CPACK_WIX_DIRECTORIES@ + + + @CPACK_WIX_COMPONENTS@ + + + @CPACK_WIX_COMPONENT_GROUPS@ + + + @CPACK_WIX_INCLUDES@ + + + diff --git a/win/upgrade_wizard/stdafx.h b/win/upgrade_wizard/stdafx.h index 87db7036005..55f9e71ed70 100644 --- a/win/upgrade_wizard/stdafx.h +++ b/win/upgrade_wizard/stdafx.h @@ -1,47 +1,47 @@ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#ifndef _SECURE_ATL -#define _SECURE_ATL 1 -#endif - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - -#include "targetver.h" - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off MFC's hiding of some common and often safely ignored warning messages -#define _AFX_ALL_WARNINGS - -#include // MFC core and standard components -#include // MFC extensions - - - - - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC support for Internet Explorer 4 Common Controls -#endif -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - - - - - - - - - - - - + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +// turns off MFC's hiding of some common and often safely ignored warning messages +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions + + + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC support for Internet Explorer 4 Common Controls +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + + + + + + + + + + + diff --git a/win/upgrade_wizard/targetver.h b/win/upgrade_wizard/targetver.h index 90e767bfce7..87c0086de75 100644 --- a/win/upgrade_wizard/targetver.h +++ b/win/upgrade_wizard/targetver.h @@ -1,8 +1,8 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/win/upgrade_wizard/upgrade.cpp b/win/upgrade_wizard/upgrade.cpp index aa9efa15ecc..ea2f894c73e 100644 --- a/win/upgrade_wizard/upgrade.cpp +++ b/win/upgrade_wizard/upgrade.cpp @@ -1,57 +1,57 @@ - -// upgrade.cpp : Defines the class behaviors for the application. -// - -#include "stdafx.h" -#include "upgrade.h" -#include "upgradeDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#endif - - -// CUpgradeApp - -BEGIN_MESSAGE_MAP(CUpgradeApp, CWinApp) - ON_COMMAND(ID_HELP, &CWinApp::OnHelp) -END_MESSAGE_MAP() - - -// CUpgradeApp construction - -CUpgradeApp::CUpgradeApp() -{ - // TODO: add construction code here, - // Place all significant initialization in InitInstance -} - - -// The one and only CUpgradeApp object - -CUpgradeApp theApp; - - -// CUpgradeApp initialization - -BOOL CUpgradeApp::InitInstance() -{ - // InitCommonControlsEx() is required on Windows XP if an application - // manifest specifies use of ComCtl32.dll version 6 or later to enable - // visual styles. Otherwise, any window creation will fail. - INITCOMMONCONTROLSEX InitCtrls; - InitCtrls.dwSize = sizeof(InitCtrls); - // Set this to include all the common control classes you want to use - // in your application. - InitCtrls.dwICC = ICC_WIN95_CLASSES; - - InitCommonControlsEx(&InitCtrls); - CWinApp::InitInstance(); - CUpgradeDlg dlg; - m_pMainWnd = &dlg; - dlg.DoModal(); - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; -} - + +// upgrade.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "upgrade.h" +#include "upgradeDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CUpgradeApp + +BEGIN_MESSAGE_MAP(CUpgradeApp, CWinApp) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CUpgradeApp construction + +CUpgradeApp::CUpgradeApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + + +// The one and only CUpgradeApp object + +CUpgradeApp theApp; + + +// CUpgradeApp initialization + +BOOL CUpgradeApp::InitInstance() +{ + // InitCommonControlsEx() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // Set this to include all the common control classes you want to use + // in your application. + InitCtrls.dwICC = ICC_WIN95_CLASSES; + + InitCommonControlsEx(&InitCtrls); + CWinApp::InitInstance(); + CUpgradeDlg dlg; + m_pMainWnd = &dlg; + dlg.DoModal(); + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} + diff --git a/win/upgrade_wizard/upgrade.h b/win/upgrade_wizard/upgrade.h index 26c107b6ee8..b5dd10e72e7 100644 --- a/win/upgrade_wizard/upgrade.h +++ b/win/upgrade_wizard/upgrade.h @@ -1,32 +1,32 @@ - -// zzz.h : main header file for the PROJECT_NAME application -// - -#pragma once - -#ifndef __AFXWIN_H__ - #error "include 'stdafx.h' before including this file for PCH" -#endif - -#include "resource.h" // main symbols - - -// CzzzApp: -// See zzz.cpp for the implementation of this class -// - -class CUpgradeApp : public CWinApp -{ -public: - CUpgradeApp(); - -// Overrides -public: - virtual BOOL InitInstance(); - -// Implementation - - DECLARE_MESSAGE_MAP() -}; - + +// zzz.h : main header file for the PROJECT_NAME application +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + + +// CzzzApp: +// See zzz.cpp for the implementation of this class +// + +class CUpgradeApp : public CWinApp +{ +public: + CUpgradeApp(); + +// Overrides +public: + virtual BOOL InitInstance(); + +// Implementation + + DECLARE_MESSAGE_MAP() +}; + extern CUpgradeApp theApp; \ No newline at end of file diff --git a/win/upgrade_wizard/upgrade.rc b/win/upgrade_wizard/upgrade.rc index 30656651b79..dbba9f67e89 100644 --- a/win/upgrade_wizard/upgrade.rc +++ b/win/upgrade_wizard/upgrade.rc @@ -1,148 +1,148 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#ifndef APSTUDIO_INVOKED -#include "targetver.h" -#endif -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#ifndef APSTUDIO_INVOKED\r\n" - "#include ""targetver.h""\r\n" - "#endif\r\n" - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "LANGUAGE 9, 1\r\n" - "#include ""res\\upgrade.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\upgrade.ico" -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_UPGRADE_DIALOG DIALOGEX 0, 0, 320, 200 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "MariaDB Upgrade Wizard" -FONT 8, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,113,169,50,14 - PUSHBUTTON "Cancel",IDCANCEL,191,169,50,14 - LISTBOX IDC_LIST1,24,39,216,80,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_EDIT1,97,124,193,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT2,98,138,181,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,26,153,243,14 - EDITTEXT IDC_EDIT3,98,151,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT7,27,124,65,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT8,27,137,62,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT9,27,151,62,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - PUSHBUTTON "Select all",IDC_BUTTON1,245,61,50,14 - PUSHBUTTON "Clear all",IDC_BUTTON2,246,88,50,14 - LTEXT "Select services you want to upgrade and click on the [Upgrade] button.\nMake sure to backup data directories prior to upgrade.",IDC_STATIC,25,14,215,26 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_UPGRADE_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 313 - TOPMARGIN, 7 - BOTTOMMARGIN, 193 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#include "res\upgrade.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#include ""res\\upgrade.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON "res\\upgrade.ico" +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_UPGRADE_DIALOG DIALOGEX 0, 0, 320, 200 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "MariaDB Upgrade Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,113,169,50,14 + PUSHBUTTON "Cancel",IDCANCEL,191,169,50,14 + LISTBOX IDC_LIST1,24,39,216,80,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_EDIT1,97,124,193,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT2,98,138,181,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,26,153,243,14 + EDITTEXT IDC_EDIT3,98,151,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT7,27,124,65,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT8,27,137,62,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_EDIT9,27,151,62,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + PUSHBUTTON "Select all",IDC_BUTTON1,245,61,50,14 + PUSHBUTTON "Clear all",IDC_BUTTON2,246,88,50,14 + LTEXT "Select services you want to upgrade and click on the [Upgrade] button.\nMake sure to backup data directories prior to upgrade.",IDC_STATIC,25,14,215,26 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_UPGRADE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 313 + TOPMARGIN, 7 + BOTTOMMARGIN, 193 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#include "res\upgrade.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win/upgrade_wizard/upgradeDlg.h b/win/upgrade_wizard/upgradeDlg.h index 97243291748..636f94894a7 100644 --- a/win/upgrade_wizard/upgradeDlg.h +++ b/win/upgrade_wizard/upgradeDlg.h @@ -1,73 +1,73 @@ - -// upgradeDlg.h : header file -// - -#pragma once -#include "afxcmn.h" -#include "afxwin.h" -#include - - -// CUpgradeDlg dialog -class CUpgradeDlg : public CDialog -{ - // Construction -public: - CUpgradeDlg(CWnd* pParent = NULL); // standard constructor - - // Dialog Data - enum { IDD = IDD_UPGRADE_DIALOG }; - -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - - // job object for current process and children - HANDLE m_JobObject; - - // Services are being upgraded - BOOL m_UpgradeRunning; - - // ProgressBar related: number of services to upgrade - int m_ProgressTotal; - - //ProgressBar related: current service being upgraded - int m_ProgressCurrent; - -protected: - HICON m_hIcon; - - // Generated message map functions - virtual BOOL OnInitDialog(); - void PopulateServicesList(); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - DECLARE_MESSAGE_MAP() -public: - void SelectService(int index); - void UpgradeServices(); - void UpgradeOneService(const std::string& name); - void ErrorExit(const char *); - std::string m_InstallDir; - CCheckListBox m_Services; - CProgressCtrl m_Progress; - CButton m_Ok; - CButton m_Cancel; - CButton m_SelectAll; - CButton m_ClearAll; - int m_MajorVersion; - int m_MinorVersion; - int m_PatchVersion; - - CEdit m_IniFilePath; - afx_msg void OnLbnSelchangeList1(); - afx_msg void OnChkChange(); - CEdit m_DataDir; - CEdit m_Version; - afx_msg void OnBnClickedOk(); - afx_msg void OnBnClickedCancel(); - afx_msg void OnBnSelectAll(); - afx_msg void OnBnClearAll(); - CEdit m_IniFileLabel; - CEdit m_DataDirLabel; - CEdit m_VersionLabel; -}; + +// upgradeDlg.h : header file +// + +#pragma once +#include "afxcmn.h" +#include "afxwin.h" +#include + + +// CUpgradeDlg dialog +class CUpgradeDlg : public CDialog +{ + // Construction +public: + CUpgradeDlg(CWnd* pParent = NULL); // standard constructor + + // Dialog Data + enum { IDD = IDD_UPGRADE_DIALOG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + // job object for current process and children + HANDLE m_JobObject; + + // Services are being upgraded + BOOL m_UpgradeRunning; + + // ProgressBar related: number of services to upgrade + int m_ProgressTotal; + + //ProgressBar related: current service being upgraded + int m_ProgressCurrent; + +protected: + HICON m_hIcon; + + // Generated message map functions + virtual BOOL OnInitDialog(); + void PopulateServicesList(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + void SelectService(int index); + void UpgradeServices(); + void UpgradeOneService(const std::string& name); + void ErrorExit(const char *); + std::string m_InstallDir; + CCheckListBox m_Services; + CProgressCtrl m_Progress; + CButton m_Ok; + CButton m_Cancel; + CButton m_SelectAll; + CButton m_ClearAll; + int m_MajorVersion; + int m_MinorVersion; + int m_PatchVersion; + + CEdit m_IniFilePath; + afx_msg void OnLbnSelchangeList1(); + afx_msg void OnChkChange(); + CEdit m_DataDir; + CEdit m_Version; + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnSelectAll(); + afx_msg void OnBnClearAll(); + CEdit m_IniFileLabel; + CEdit m_DataDirLabel; + CEdit m_VersionLabel; +}; diff --git a/win/upgrade_wizard/upgrade_wizard.exe.manifest b/win/upgrade_wizard/upgrade_wizard.exe.manifest index 6b40eebcbd9..ca89deae5c9 100644 --- a/win/upgrade_wizard/upgrade_wizard.exe.manifest +++ b/win/upgrade_wizard/upgrade_wizard.exe.manifest @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.1 From 6264451f25143c43e1ad8e045054b720effaf8cb Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Sat, 6 Jun 2015 16:13:51 +0200 Subject: MDEV-8114: server crash on updates with joins still on 10.0.18 Check that leaf table list is really built before storing it. --- mysql-test/r/update_innodb.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/update_innodb.test | 39 +++++++++++++++++++++++++++++++++++++++ sql/sql_base.cc | 3 ++- sql/sql_lex.cc | 14 ++++++++++++-- sql/sql_lex.h | 3 ++- 5 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 mysql-test/r/update_innodb.result create mode 100644 mysql-test/t/update_innodb.test diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result new file mode 100644 index 00000000000..88c86c50625 --- /dev/null +++ b/mysql-test/r/update_innodb.result @@ -0,0 +1,31 @@ +CREATE TABLE `t1` ( +`c1` int(11) NOT NULL, +`c2` datetime DEFAULT NULL, +PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( +`c0` varchar(10) NOT NULL, +`c1` int(11) NOT NULL, +`c2` int(11) NOT NULL, +PRIMARY KEY (`c0`,`c1`), +KEY `c1` (`c1`), +KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t3` ( +`id` int(11) unsigned NOT NULL AUTO_INCREMENT, +`c1` datetime NOT NULL, +`c2` bigint(20) NOT NULL, +`c3` int(4) unsigned NOT NULL, +PRIMARY KEY (`id`), +KEY `c2` (`c2`), +KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t4` ( +`c1` int(11) NOT NULL, +`c2` bigint(20) DEFAULT NULL, +`c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; +UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; +drop view v1; +drop table t1,t2,t3,t4; diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test new file mode 100644 index 00000000000..67c356c4e2e --- /dev/null +++ b/mysql-test/t/update_innodb.test @@ -0,0 +1,39 @@ +--source include/have_innodb.inc + +CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` datetime DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( + `c0` varchar(10) NOT NULL, + `c1` int(11) NOT NULL, + `c2` int(11) NOT NULL, + PRIMARY KEY (`c0`,`c1`), + KEY `c1` (`c1`), + KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t3` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `c1` datetime NOT NULL, + `c2` bigint(20) NOT NULL, + `c3` int(4) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `c2` (`c2`), + KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t4` ( + `c1` int(11) NOT NULL, + `c2` bigint(20) DEFAULT NULL, + `c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; + +UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; + +drop view v1; +drop table t1,t2,t3,t4; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 592215da4d0..fcd17b25b2d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8291,9 +8291,10 @@ bool setup_tables(THD *thd, Name_resolution_context *context, if (select_lex->first_cond_optimization) { leaves.empty(); - if (!select_lex->is_prep_leaf_list_saved) + if (select_lex->prep_leaf_list_state != SELECT_LEX::SAVED) { make_leaves_list(leaves, tables, full_table_list, first_select_table); + select_lex->prep_leaf_list_state= SELECT_LEX::READY; select_lex->leaf_tables_exec.empty(); } else diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a71051e801b..1d62acdbe4b 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1882,7 +1882,7 @@ void st_select_lex::init_query() exclude_from_table_unique_test= no_wrap_view_item= FALSE; nest_level= 0; link_next= 0; - is_prep_leaf_list_saved= FALSE; + prep_leaf_list_state= UNINIT; bzero((char*) expr_cache_may_be_used, sizeof(expr_cache_may_be_used)); m_non_agg_field_used= false; m_agg_func_used= false; @@ -4129,12 +4129,22 @@ bool st_select_lex::save_prep_leaf_tables(THD *thd) { List_iterator_fast li(leaf_tables); TABLE_LIST *table; + + /* + Check that the SELECT_LEX was really prepared and so tables are setup. + + It can be subquery in SET clause of UPDATE which was not prepared yet, so + its tables are not yet setup and ready for storing. + */ + if (prep_leaf_list_state != READY) + return FALSE; + while ((table= li++)) { if (leaf_tables_prep.push_back(table)) return TRUE; } - is_prep_leaf_list_saved= TRUE; + prep_leaf_list_state= SAVED; for (SELECT_LEX_UNIT *u= first_inner_unit(); u; u= u->next_unit()) { for (SELECT_LEX *sl= u->first_select(); sl; sl= sl->next_select()) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 69ee5cc9be0..a0f8e456800 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -789,7 +789,8 @@ public: List leaf_tables; List leaf_tables_exec; List leaf_tables_prep; - bool is_prep_leaf_list_saved; + enum leaf_list_state {UNINIT, READY, SAVED}; + enum leaf_list_state prep_leaf_list_state; uint insert_tables; st_select_lex *merged_into; /* select which this select is merged into */ /* (not 0 only for views/derived tables) */ -- cgit v1.2.1 From db0ecf2662c54b1382305908413b45c75f2dfd19 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sat, 6 Jun 2015 19:12:44 +0500 Subject: MDEV-8032 [PATCH] audit plugin - csv output broken. Symbols like TAB or NEWLINE should be escaped, which was forgotten in one place. --- mysql-test/suite/plugins/r/server_audit.result | 6 ++++++ mysql-test/suite/plugins/t/server_audit.test | 3 +++ plugin/server_audit/server_audit.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index c9ec79dbafe..d0649a1fc1f 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -45,6 +45,11 @@ id 2 alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 insert into t2 values (1), (2); select * from t2; id @@ -244,6 +249,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1, TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 3c9544d61f4..c126b845def 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -35,6 +35,9 @@ insert into t2 values (1), (2); select * from t2; alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, + 2, + 3; insert into t2 values (1), (2); select * from t2; --error ER_NO_SUCH_TABLE diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index a4d726b0c7d..4aa8652de52 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -1118,6 +1118,8 @@ static size_t escape_string(const char *str, unsigned int len, *(result++)= '\\'; *(result++)= '\\'; } + else if (is_space(*str)) + *(result++)= ' '; else *(result++)= *str; str++; -- cgit v1.2.1 From 1ae05db49c433b6cd3d0172fa1f4421632b6f2ac Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 7 Jun 2015 15:40:42 +0500 Subject: MDEV-8078 Memory disclosure/buffer overread on audit plugin. If the SET PASSWORD query doesn't have the password string, the parsing of it can fail. It manifested first in MySQL 5.6 as it started to hide password lines sent to the plugins. Fixed by checking for that case. --- mysql-test/suite/plugins/r/server_audit.result | 3 +++ mysql-test/suite/plugins/t/server_audit.test | 2 ++ plugin/server_audit/server_audit.c | 12 +++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index d0649a1fc1f..69c9bc3a4be 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -162,6 +162,8 @@ id CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; @@ -324,6 +326,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=',ID TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index c126b845def..87c667adb09 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -105,6 +105,8 @@ select * from t1; CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=; CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 4aa8652de52..bede4c9545d 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -1175,9 +1175,15 @@ static size_t escape_string_hide_passwords(const char *str, unsigned int len, for (c=0; c Date: Mon, 8 Jun 2015 12:09:13 +0500 Subject: MDEV-7500 thread_handling option in my.cnf is not passing "connect events" to audit plugin. The MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT() call moved to the login_connection() function. So that it'll be invoked in any thread handling mode. --- .../plugins/r/thread_pool_server_audit.result | 356 +++++++++++++++++++++ .../suite/plugins/t/thread_pool_server_audit.opt | 2 + .../suite/plugins/t/thread_pool_server_audit.test | 142 ++++++++ sql/sql_connect.cc | 13 +- 4 files changed, 508 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/plugins/r/thread_pool_server_audit.result create mode 100644 mysql-test/suite/plugins/t/thread_pool_server_audit.opt create mode 100644 mysql-test/suite/plugins/t/thread_pool_server_audit.test diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result new file mode 100644 index 00000000000..69c9bc3a4be --- /dev/null +++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result @@ -0,0 +1,356 @@ +install plugin server_audit soname 'server_audit'; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users +server_audit_logging OFF +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO) +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +Warnings: +Warning 1 User 'odin' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'dva' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'tri' is in the server_audit_incl_users, so wasn't added. +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +1 +2 +select * from t_doesnt_exist; +ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist +syntax_error_query; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'syntax_error_query' at line 1 +drop table renamed_t1, t2; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events CONNECT,QUERY +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +id2 +1 +2 +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=' at line 1 +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events=''; +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +1 2 3 4 +1 2 3 4 +select 'A', 'B', 'C', 'D'; +A B C D +A B C D +set global server_audit_query_log_limit= 1024; +drop database sa_db; +set global server_audit_file_path='.'; +show status like 'server_audit_current_log'; +Variable_name Value +server_audit_current_log HOME_DIR/server_audit.log +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +Variable_name Value +server_audit_current_log server_audit.log +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +Variable_name Value +server_audit_current_log server_audit.log +set global server_audit_file_path='nonexisting_dir/'; +Warnings: +Warning 1 SERVER AUDIT plugin can't create file 'nonexisting_dir/'. +show status like 'server_audit_current_log'; +Variable_name Value +server_audit_current_log server_audit.log +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 1 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +uninstall plugin server_audit; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,mysql,,0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,mysql,,0 +TIME,HOSTNAME,no_such_user,localhost,ID,0,FAILED_CONNECT,,,ID +TIME,HOSTNAME,no_such_user,localhost,ID,0,DISCONNECT,,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t2 (id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_excl_users=\'odin, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'syntax_error_query',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table renamed_t1, t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_mode=1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,test,,0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t1 (id2 int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,DROP,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table sa_t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into sa_t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,DROP,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table sa_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0 diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.opt b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt new file mode 100644 index 00000000000..30953d0c574 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt @@ -0,0 +1,2 @@ +--thread_handling=pool-of-threads + diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test new file mode 100644 index 00000000000..1a2d72999c5 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -0,0 +1,142 @@ +--source include/not_embedded.inc +--source include/have_pool_of_threads.inc + +if (!$SERVER_AUDIT_SO) { + skip No SERVER_AUDIT plugin; +} + +install plugin server_audit soname 'server_audit'; + +show variables like 'server_audit%'; +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +connect (con1,localhost,root,,mysql); +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (con1,localhost,no_such_user,,mysql); +connection default; +--sleep 2 +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +insert into t1 values (1), (2); +select * from t1; +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, + 2, + 3; +insert into t2 values (1), (2); +select * from t2; +--error ER_NO_SUCH_TABLE +select * from t_doesnt_exist; +--error 1064 +syntax_error_query; +drop table renamed_t1, t2; +show variables like 'server_audit%'; +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +connect (con1,localhost,root,,test); +connection con1; +--sleep 2 +--sleep 2 +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; + +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=; +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events=''; + +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +select 'A', 'B', 'C', 'D'; +set global server_audit_query_log_limit= 1024; +drop database sa_db; + +set global server_audit_file_path='.'; +--replace_regex /\.[\\\/]/HOME_DIR\// +show status like 'server_audit_current_log'; +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +set global server_audit_file_path='nonexisting_dir/'; +show status like 'server_audit_current_log'; +show variables like 'server_audit%'; +uninstall plugin server_audit; + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +# replace the timestamp and the hostname with constant values +--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/ +cat_file $MYSQLD_DATADIR/server_audit.log; +remove_file $MYSQLD_DATADIR/server_audit.log; + diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 041d2a545df..16b53da1ebd 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1017,7 +1017,7 @@ bool setup_connection_thread_globals(THD *thd) bool login_connection(THD *thd) { NET *net= &thd->net; - int error; + int error= 0; DBUG_ENTER("login_connection"); DBUG_PRINT("info", ("login_connection called by thread %lu", thd->thread_id)); @@ -1036,7 +1036,8 @@ bool login_connection(THD *thd) my_sleep(1000); /* must wait after eof() */ #endif statistic_increment(aborted_connects,&LOCK_status); - DBUG_RETURN(1); + error=1; + goto exit; } /* Connect completed, set read/write timeouts back to default */ my_net_set_read_timeout(net, thd->variables.net_read_timeout); @@ -1046,10 +1047,13 @@ bool login_connection(THD *thd) if (increment_connection_count(thd, TRUE)) { my_error(ER_OUTOFMEMORY, MYF(0), 2*sizeof(USER_STATS)); - DBUG_RETURN(1); + error= 1; + goto exit; } - DBUG_RETURN(0); +exit: + MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd); + DBUG_RETURN(error); } @@ -1187,7 +1191,6 @@ bool thd_prepare_connection(THD *thd) bool rc; lex_start(thd); rc= login_connection(thd); - MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd); if (rc) return rc; -- cgit v1.2.1 From b37b52a3a2c21ed87d92e7c0d3c292f4bd1c52dc Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 8 Jun 2015 13:47:07 +0500 Subject: MDEV-4922 Stored Procedure - Geometry parameter not working. Fhe GEOMETRY field should be handled just as the BLOB field. So that was fiexed in field_conv. One additional bug was found and fixed meanwhile - thet the geometry field subtypes should also be merged for UNION command. --- mysql-test/r/gis.result | 2 +- sql/field.cc | 8 ++++++++ sql/field.h | 1 + sql/field_conv.cc | 5 +++-- sql/item.cc | 5 +++++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index c2de65ee999..02e121b8513 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -934,7 +934,7 @@ LINESTRING(0 0,1 1,2 2) create table t2 as select f2 as a from t1 union select f3 from t1; desc t2; Field Type Null Key Default Extra -a point YES NULL +a geometry YES NULL select AsText(a) from t2; AsText(a) POINT(1 1) diff --git a/sql/field.cc b/sql/field.cc index 68daba3922d..a24ffe28600 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7629,6 +7629,14 @@ err_exit: return -1; } +Field::geometry_type Field_geom::geometry_type_merge(geometry_type a, + geometry_type b) +{ + if (a == b) + return a; + return Field::GEOM_GEOMETRY; +} + #endif /*HAVE_SPATIAL*/ /**************************************************************************** diff --git a/sql/field.h b/sql/field.h index a43b3b59460..130d33e46c4 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1998,6 +1998,7 @@ public: int reset(void) { return Field_blob::reset() || !maybe_null(); } geometry_type get_geometry_type() { return geom_type; }; + static geometry_type geometry_type_merge(geometry_type, geometry_type); }; #endif /*HAVE_SPATIAL*/ diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 6c3fcc0d355..d6a53a9a2fc 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -828,8 +828,9 @@ Copy_field::get_copy_func(Field *to,Field *from) int field_conv(Field *to,Field *from) { + bool blob_type_dest= to->flags & BLOB_FLAG; if (to->real_type() == from->real_type() && - !(to->type() == MYSQL_TYPE_BLOB && to->table->copy_blobs)) + !(blob_type_dest && to->table->copy_blobs)) { if (to->pack_length() == from->pack_length() && !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) && @@ -858,7 +859,7 @@ int field_conv(Field *to,Field *from) return 0; } } - if (to->type() == MYSQL_TYPE_BLOB) + if (blob_type_dest) { // Be sure the value is stored Field_blob *blob=(Field_blob*) to; from->val_str(&blob->value); diff --git a/sql/item.cc b/sql/item.cc index 87336dcc1c5..6f782e69b89 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -9486,6 +9486,11 @@ bool Item_type_holder::join_types(THD *thd, Item *item) item_decimals= 0; decimals= max(decimals, item_decimals); } + + if (fld_type == FIELD_TYPE_GEOMETRY) + geometry_type= + Field_geom::geometry_type_merge(geometry_type, item->get_geometry_type()); + if (Field::result_merge_type(fld_type) == DECIMAL_RESULT) { decimals= min(max(decimals, item->decimals), DECIMAL_MAX_SCALE); -- cgit v1.2.1 From a765cca69fb054ebf389565bfebb506768bf300d Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 8 Jun 2015 20:50:40 +0400 Subject: MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT --- mysql-test/r/ctype_utf8.result | 15 +++++++++++++++ mysql-test/t/ctype_utf8.test | 16 ++++++++++++++++ sql/item.cc | 30 ++++++++++++++++++++++++++++++ sql/item.h | 1 + 4 files changed, 62 insertions(+) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index b8ecc055347..a964384336a 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5762,5 +5762,20 @@ DROP TABLE t1; # End of ctype_utf8_ilseq.inc # # +# MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +(SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2) +1 +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1, t2; +# # End of 5.5 tests # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index f4b16c95135..bed026ac8ce 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1616,6 +1616,22 @@ SET NAMES utf8 COLLATE utf8_general_ci; --let ENGINE=HEAP --source include/ctype_utf8_ilseq.inc +--echo # +--echo # MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +# Running the below query crashed with two rows +--error ER_SUBQUERY_NO_1_ROW +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +DROP TABLE t1, t2; + + --echo # --echo # End of 5.5 tests --echo # diff --git a/sql/item.cc b/sql/item.cc index 6f782e69b89..f8d1c85f447 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1135,6 +1135,36 @@ Item *Item::safe_charset_converter(CHARSET_INFO *tocs) } +/** + Some pieces of the code do not support changing of + Item_cache to other Item types. + + Example: + Item_singlerow_subselect has "Item_cache **row". + Creating of Item_func_conv_charset followed by THD::change_item_tree() + should not change row[i] from Item_cache directly to Item_func_conv_charset, because Item_singlerow_subselect + because Item_singlerow_subselect later calls Item_cache-specific methods, + e.g. row[i]->store() and row[i]->cache_value(). + + Let's wrap Item_func_conv_charset to a new Item_cache, + so the Item_cache-specific methods can still be used for + Item_singlerow_subselect::row[i] safely. + + TODO: we should eventually check all other use cases of change_item_tree(). + Perhaps some more potentially dangerous substitution examples exist. +*/ +Item *Item_cache::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_func_conv_charset *conv= new Item_func_conv_charset(example, tocs, 1); + Item_cache *cache; + if (!conv || !conv->safe || !(cache= new Item_cache_str(conv))) + return NULL; // Safe conversion is not possible, or OEM + cache->setup(conv); + cache->fixed= false; // Make Item::fix_fields() happy + return cache; +} + + /** @details Created mostly for mysql_prepare_table(). Important diff --git a/sql/item.h b/sql/item.h index ac4fa866349..8bd5751c6e4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4161,6 +4161,7 @@ public: return TRUE; return (this->*processor)(arg); } + virtual Item *safe_charset_converter(CHARSET_INFO *tocs); }; -- cgit v1.2.1 From 96b37035e4045a27f64810c2d946bad2d1453a80 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 8 Jun 2015 21:40:17 +0500 Subject: MDEV-8211 plugins.server_audit fails sporadically in buildbot. Connection event can happen before the query ends. Added a delay to confirm the order. --- mysql-test/suite/plugins/t/server_audit.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 87c667adb09..9839019a3e6 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -13,6 +13,7 @@ set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; +--sleep 2 connect (con1,localhost,root,,mysql); connection default; disconnect con1; -- cgit v1.2.1 From 87088b91f7dfa49a1946454d347d823dab643569 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 8 Jun 2015 21:44:13 +0500 Subject: MDEV-8211 plugins.server_audit fails sporadically in buildbot. This test also should be fixed - delay added so the connection event doesn't happen before the query. --- mysql-test/suite/plugins/t/thread_pool_server_audit.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test index 1a2d72999c5..2c749e23480 100644 --- a/mysql-test/suite/plugins/t/thread_pool_server_audit.test +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -13,6 +13,7 @@ set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; +--sleep 2 connect (con1,localhost,root,,mysql); connection default; disconnect con1; -- cgit v1.2.1 From 1707cfc9efb7b8371aaa4e8da3ada129e32ca092 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 8 Jun 2015 21:55:52 +0500 Subject: MDEV-8211 plugins.server_audit fails sporadically in buildbot. More fixes to assure the order of queries in the log. --- mysql-test/suite/plugins/t/server_audit.test | 1 + mysql-test/suite/plugins/t/thread_pool_server_audit.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 9839019a3e6..52428909c3b 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -50,6 +50,7 @@ show variables like 'server_audit%'; set global server_audit_mode=1; set global server_audit_events=''; create database sa_db; +--sleep 2 connect (con1,localhost,root,,test); connection con1; --sleep 2 diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test index 2c749e23480..626d4136c47 100644 --- a/mysql-test/suite/plugins/t/thread_pool_server_audit.test +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -50,6 +50,7 @@ show variables like 'server_audit%'; set global server_audit_mode=1; set global server_audit_events=''; create database sa_db; +--sleep 2 connect (con1,localhost,root,,test); connection con1; --sleep 2 -- cgit v1.2.1 From b41ad55265972d11778843868252953e6ba8a1b5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 8 Jun 2015 15:09:20 +0200 Subject: update tokudb version --- storage/tokudb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index e8667c1937f..2052d448a43 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -25,7 +25,7 @@ IF (HAVE_WVLA) ENDIF() ############################################ -SET(TOKUDB_VERSION "tokudb-7.5.6") +SET(TOKUDB_VERSION "tokudb-7.5.7") SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-5.5/README-TOKUDB\nusr/share/doc/mariadb-server-5.5/README.md" PARENT_SCOPE) SET(USE_BDB OFF CACHE BOOL "") MARK_AS_ADVANCED(BUILDNAME) -- cgit v1.2.1 From a4d93e07cc885fbdcef9797b44ddb096d841883f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 5 Jun 2015 20:05:08 +0200 Subject: MDEV-8050 sphinx test cases cannot run with sphinxsearch-2.2.6 remove/replace deprecated options --- mysql-test/suite/sphinx/my.cnf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/suite/sphinx/my.cnf b/mysql-test/suite/sphinx/my.cnf index a3789a065bf..f60380b7171 100644 --- a/mysql-test/suite/sphinx/my.cnf +++ b/mysql-test/suite/sphinx/my.cnf @@ -16,7 +16,6 @@ mem_limit = 32M [searchd] read_timeout = 5 max_children = 30 -max_matches = 1000 seamless_rotate = 1 preopen_indexes = 0 unlink_old = 1 @@ -24,7 +23,7 @@ log = @ENV.MYSQLTEST_VARDIR/searchd/sphinx-searchd.log query_log = @ENV.MYSQLTEST_VARDIR/searchd/sphinx-query.log #log-error = @ENV.MYSQLTEST_VARDIR/searchd/sphinx.log pid_file = @ENV.MYSQLTEST_VARDIR/run/searchd.pid -port = @ENV.SPHINXSEARCH_PORT +listen = @ENV.SPHINXSEARCH_PORT [ENV] SPHINXSEARCH_PORT = @OPT.port -- cgit v1.2.1 From b1e10399f4ec7a37f432c33e1c94e21c1f74f30b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 9 Jun 2015 07:36:24 +0400 Subject: MDEV-8286 Likely a redundant declaration of Item_cache::used_table_map Removing Item_cache::used_table_map, Item_cache::used_tables() and Item_cache::set_used_tables(). Using the same inherited from Item_basic_constant implementations instead. --- sql/item.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sql/item.h b/sql/item.h index 8bd5751c6e4..4aaa67d9a1d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4056,7 +4056,6 @@ class Item_cache: public Item_basic_constant { protected: Item *example; - table_map used_table_map; /** Field that this object will get value from. This is used by index-based subquery engines to detect and remove the equality injected @@ -4074,7 +4073,7 @@ protected: bool value_cached; public: Item_cache(): - example(0), used_table_map(0), cached_field(0), + example(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING), value_cached(0) { @@ -4083,7 +4082,7 @@ public: null_value= 1; } Item_cache(enum_field_types field_type_arg): - example(0), used_table_map(0), cached_field(0), + example(0), cached_field(0), cached_field_type(field_type_arg), value_cached(0) { @@ -4092,8 +4091,6 @@ public: null_value= 1; } - void set_used_tables(table_map map) { used_table_map= map; } - virtual bool allocate(uint i) { return 0; } virtual bool setup(Item *item) { @@ -4110,7 +4107,6 @@ public: enum_field_types field_type() const { return cached_field_type; } static Item_cache* get_cache(const Item *item); static Item_cache* get_cache(const Item* item, const Item_result type); - table_map used_tables() const { return used_table_map; } virtual void keep_array() {} virtual void print(String *str, enum_query_type query_type); bool eq_def(Field *field) -- cgit v1.2.1 From 92b365981bbb5c36e6605295ca24fd266a90a937 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 9 Jun 2015 12:05:06 +0400 Subject: MDEV-7268 Column of table cannot be converted from type 'decimal(0,?)' to type ' 'decimal(10,7)' Changing the error message to: "...from type 'decimal(0,?)/*old*/' to type ' 'decimal(10,7)'..." So it's now clear that the master data type is OLD decimal. --- mysql-test/suite/rpl/r/rpl_old_decimal.result | 9 +++++++++ mysql-test/suite/rpl/t/rpl_old_decimal.test | 25 +++++++++++++++++++++++++ sql/rpl_utility.cc | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/rpl/r/rpl_old_decimal.result create mode 100644 mysql-test/suite/rpl/t/rpl_old_decimal.test diff --git a/mysql-test/suite/rpl/r/rpl_old_decimal.result b/mysql-test/suite/rpl/r/rpl_old_decimal.result new file mode 100644 index 00000000000..3e2fa3bf241 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_old_decimal.result @@ -0,0 +1,9 @@ +include/master-slave.inc +[connection master] +CREATE TABLE t1dec102 (a DECIMAL(10,2)); +INSERT INTO t1dec102 VALUES(999.99); +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +include/wait_for_slave_sql_error_and_skip.inc [errno=1677] +Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)'' +DROP TABLE t1dec102; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_old_decimal.test b/mysql-test/suite/rpl/t/rpl_old_decimal.test new file mode 100644 index 00000000000..79fd2754079 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_old_decimal.test @@ -0,0 +1,25 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + + +--connection slave +CREATE TABLE t1dec102 (a DECIMAL(10,2)); + +--connection master +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI +INSERT INTO t1dec102 VALUES(999.99); + +--let $slave_sql_errno=1677 +--let $show_slave_sql_error= 1 +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +--source include/wait_for_slave_sql_error_and_skip.inc + +--connection master +DROP TABLE t1dec102; +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 22241da1348..e05ad5a8d43 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -417,7 +417,7 @@ void show_sql_type(enum_field_types type, uint16 metadata, String *str, CHARSET_ CHARSET_INFO *cs= str->charset(); uint32 length= cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), - "decimal(%d,?)", metadata); + "decimal(%d,?)/*old*/", metadata); str->length(length); } break; -- cgit v1.2.1 From 56e2d8318bf37fc12702cc788033cf763e911c90 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 2 May 2015 08:45:10 +0200 Subject: MDEV-7695 MariaDB - ssl - fips: can not connect with --ssl-cipher=DHE-RSA-AES256-SHA - handshake failure Change 512bit DH key to 1024bit to meet FIPS requirements --- vio/viosslfactories.c | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 41c1dbbd0e4..78916f843e0 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -21,33 +21,33 @@ static my_bool ssl_algorithms_added = FALSE; static my_bool ssl_error_strings_loaded= FALSE; -static unsigned char dh512_p[]= -{ - 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75, - 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F, - 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3, - 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12, - 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C, - 0x47,0x74,0xE8,0x33, -}; - -static unsigned char dh512_g[]={ - 0x02, -}; - -static DH *get_dh512(void) +/* the function below was generated with "openssl dhparam -2 -C 1024" */ +static +DH *get_dh1024() { + static unsigned char dh1024_p[]={ + 0xEC,0x46,0x7E,0xF9,0x4E,0x10,0x29,0xDC,0x44,0x97,0x71,0xFD, + 0x71,0xC6,0x9F,0x0D,0xD1,0x09,0xF6,0x58,0x6F,0xAD,0xCA,0xF4, + 0x37,0xD5,0xC3,0xBD,0xC3,0x9A,0x51,0x66,0x2C,0x58,0xBD,0x02, + 0xBD,0xBA,0xBA,0xFC,0xE7,0x0E,0x5A,0xE5,0x97,0x81,0xC3,0xF3, + 0x28,0x2D,0xAD,0x00,0x91,0xEF,0xF8,0xF0,0x5D,0xE9,0xE7,0x18, + 0xE2,0xAD,0xC4,0x70,0xC5,0x3C,0x12,0x8A,0x80,0x6A,0x9F,0x3B, + 0x00,0xA2,0x8F,0xA9,0x26,0xB0,0x0E,0x7F,0xED,0xF6,0xC2,0x03, + 0x81,0xB5,0xC5,0x41,0xD0,0x00,0x2B,0x21,0xD4,0x4B,0x74,0xA6, + 0xD7,0x1A,0x0E,0x82,0xC8,0xEE,0xD4,0xB1,0x6F,0xB4,0x79,0x01, + 0x8A,0xF1,0x12,0xD7,0x3C,0xFD,0xCB,0x9B,0xAE,0x1C,0xA9,0x0F, + 0x3D,0x0F,0xF8,0xD6,0x7D,0xDE,0xD6,0x0B, + }; + static unsigned char dh1024_g[]={ + 0x02, + }; DH *dh; - if ((dh=DH_new())) - { - dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL); - dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL); - if (! dh->p || ! dh->g) - { - DH_free(dh); - dh=0; - } - } + + if ((dh=DH_new()) == NULL) return(NULL); + dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL); + dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL); + if ((dh->p == NULL) || (dh->g == NULL)) + { DH_free(dh); return(NULL); } return(dh); } @@ -259,7 +259,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, } /* DH stuff */ - dh=get_dh512(); + dh=get_dh1024(); SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh); DH_free(dh); -- cgit v1.2.1 From 4ef74979969ac9339d0d42c11a6f26632e6776f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 9 Jun 2015 14:08:44 +0300 Subject: MDEV-7937: Enforce SSL when --ssl client option is used Using --ssl-verify-server-cert and --ssl[-*] implies that the ssl connection is required. The mysql client will now print an error if ssl is required, but the server can not handle a ssl connection. --- sql-common/client.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sql-common/client.c b/sql-common/client.c index ac372a437ba..01f73974f61 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1801,6 +1801,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , mysql->options.ssl_ca= strdup_if_not_null(ca); mysql->options.ssl_capath= strdup_if_not_null(capath); mysql->options.ssl_cipher= strdup_if_not_null(cipher); + mysql->options.use_ssl= TRUE; #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ DBUG_RETURN(0); } @@ -2491,13 +2492,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio, mysql->client_flag|= CLIENT_MULTI_RESULTS; #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) - if (mysql->options.ssl_key || mysql->options.ssl_cert || - mysql->options.ssl_ca || mysql->options.ssl_capath || - mysql->options.ssl_cipher) - mysql->options.use_ssl= 1; if (mysql->options.use_ssl) mysql->client_flag|= CLIENT_SSL; #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY*/ + if (mpvio->db) mysql->client_flag|= CLIENT_CONNECT_WITH_DB; @@ -2526,6 +2524,23 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio, end= buff+5; } #ifdef HAVE_OPENSSL + + /* + If client uses ssl and client also has to verify the server + certificate, a ssl connection is required. + If the server does not support ssl, we abort the connection. + */ + if (mysql->options.use_ssl && + (mysql->client_flag & CLIENT_SSL_VERIFY_SERVER_CERT) && + !(mysql->server_capabilities & CLIENT_SSL)) + { + set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate, + ER(CR_SSL_CONNECTION_ERROR), + "SSL is required, but the server does not " + "support it"); + goto error; + } + if (mysql->client_flag & CLIENT_SSL) { /* Do the SSL layering. */ -- cgit v1.2.1 From be5035b4f4e45806c55deac962e1e413e32289ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 9 Jun 2015 15:59:29 +0300 Subject: Added tests for MDEV-7937 --- mysql-test/include/have_ssl_disabled.inc | 4 ++++ mysql-test/r/have_ssl_disabled.require | 2 ++ mysql-test/r/ssl_7937.result | 13 +++++++++++++ mysql-test/r/ssl_without_7937.result | 10 ++++++++++ mysql-test/t/ssl_7937.test | 21 +++++++++++++++++++++ mysql-test/t/ssl_without_7937.test | 22 ++++++++++++++++++++++ 6 files changed, 72 insertions(+) create mode 100644 mysql-test/include/have_ssl_disabled.inc create mode 100644 mysql-test/r/have_ssl_disabled.require create mode 100644 mysql-test/r/ssl_7937.result create mode 100644 mysql-test/r/ssl_without_7937.result create mode 100644 mysql-test/t/ssl_7937.test create mode 100644 mysql-test/t/ssl_without_7937.test diff --git a/mysql-test/include/have_ssl_disabled.inc b/mysql-test/include/have_ssl_disabled.inc new file mode 100644 index 00000000000..a99ad2c9970 --- /dev/null +++ b/mysql-test/include/have_ssl_disabled.inc @@ -0,0 +1,4 @@ +-- require r/have_ssl_disabled.require +disable_query_log; +show variables like 'have_ssl'; +enable_query_log; diff --git a/mysql-test/r/have_ssl_disabled.require b/mysql-test/r/have_ssl_disabled.require new file mode 100644 index 00000000000..29ebc019711 --- /dev/null +++ b/mysql-test/r/have_ssl_disabled.require @@ -0,0 +1,2 @@ +Variable_name Value +have_ssl DISABLED diff --git a/mysql-test/r/ssl_7937.result b/mysql-test/r/ssl_7937.result new file mode 100644 index 00000000000..148da0047f4 --- /dev/null +++ b/mysql-test/r/ssl_7937.result @@ -0,0 +1,13 @@ +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-GCM-SHA384 +# +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-GCM-SHA384 +# +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +# +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate diff --git a/mysql-test/r/ssl_without_7937.result b/mysql-test/r/ssl_without_7937.result new file mode 100644 index 00000000000..efc457b7cb4 --- /dev/null +++ b/mysql-test/r/ssl_without_7937.result @@ -0,0 +1,10 @@ +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +Variable_name Value +Ssl_cipher +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +Variable_name Value +Ssl_cipher +/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it diff --git a/mysql-test/t/ssl_7937.test b/mysql-test/t/ssl_7937.test new file mode 100644 index 00000000000..e1a07c5659a --- /dev/null +++ b/mysql-test/t/ssl_7937.test @@ -0,0 +1,21 @@ +source include/have_ssl_communication.inc; + +let $mysql_ssl_cert=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +let $mysql_ssl_no_cert=$MYSQL --ssl -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +let $mysql_ssl_no_cert_ver=$MYSQL --ssl --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; + +--echo $mysql_ssl_cert; +--exec $mysql_ssl_cert; +--echo # +--echo $mysql_ssl_no_cert; +--exec $mysql_ssl_no_cert; +--echo # +--echo $mysql_ssl_no_cert_ver; +--error 1 +--exec $mysql_ssl_no_cert_ver; +--echo # +--echo $mysql_ssl_cert_ver; +--error 1 +--exec $mysql_ssl_cert_ver; + diff --git a/mysql-test/t/ssl_without_7937.test b/mysql-test/t/ssl_without_7937.test new file mode 100644 index 00000000000..9b5cb096981 --- /dev/null +++ b/mysql-test/t/ssl_without_7937.test @@ -0,0 +1,22 @@ +source include/have_ssl_disabled.inc; + +# SSL not mandatory here. +let $mysql_ssl_cert=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +# SSL mandatory with verify server cert +let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +--echo $mysql_ssl_cert; +--exec $mysql_ssl_cert; +--echo $mysql_ssl_cert_ver; +--error 1 +--exec $mysql_ssl_cert_ver; + +# SSL not mandatory again +let $mysql_no_ssl_but_ver=$MYSQL --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +--echo $mysql_no_ssl_but_ver; +--exec $mysql_no_ssl_but_ver; + +# SSL mandatory but no specifications for ssl parameters +let $mysql_ssl_no_spec_ver=$MYSQL --ssl --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +--echo $mysql_ssl_no_spec_ver +--error 1 +--exec $mysql_ssl_no_spec_ver -- cgit v1.2.1 From 5d57e2d8cd02fd2dad3e798d89d14cbd03877cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 9 Jun 2015 16:46:45 +0300 Subject: Fix tests for 7937 --- mysql-test/include/have_ssl_disabled.inc | 8 ++++---- mysql-test/r/have_ssl_disabled.require | 2 -- mysql-test/r/ssl_7937.result | 4 ---- mysql-test/r/ssl_without_7937.result | 4 ---- mysql-test/t/ssl_7937.test | 4 ---- mysql-test/t/ssl_without_7937.test | 4 ---- 6 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 mysql-test/r/have_ssl_disabled.require diff --git a/mysql-test/include/have_ssl_disabled.inc b/mysql-test/include/have_ssl_disabled.inc index a99ad2c9970..6c672794146 100644 --- a/mysql-test/include/have_ssl_disabled.inc +++ b/mysql-test/include/have_ssl_disabled.inc @@ -1,4 +1,4 @@ --- require r/have_ssl_disabled.require -disable_query_log; -show variables like 'have_ssl'; -enable_query_log; +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME like 'have_ssl' and VARIABLE_VALUE like 'DISABLED'`) +{ + --skip Test requires ssl to be disabled. +} diff --git a/mysql-test/r/have_ssl_disabled.require b/mysql-test/r/have_ssl_disabled.require deleted file mode 100644 index 29ebc019711..00000000000 --- a/mysql-test/r/have_ssl_disabled.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_ssl DISABLED diff --git a/mysql-test/r/ssl_7937.result b/mysql-test/r/ssl_7937.result index 148da0047f4..19522f08981 100644 --- a/mysql-test/r/ssl_7937.result +++ b/mysql-test/r/ssl_7937.result @@ -1,13 +1,9 @@ -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; Variable_name Value Ssl_cipher DHE-RSA-AES256-GCM-SHA384 # -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; Variable_name Value Ssl_cipher DHE-RSA-AES256-GCM-SHA384 # -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate # -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate diff --git a/mysql-test/r/ssl_without_7937.result b/mysql-test/r/ssl_without_7937.result index efc457b7cb4..191f98fb1a5 100644 --- a/mysql-test/r/ssl_without_7937.result +++ b/mysql-test/r/ssl_without_7937.result @@ -1,10 +1,6 @@ -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; Variable_name Value Ssl_cipher -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl-key=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-key.pem --ssl-cert=/home/vicentiu/Workspace/MariaDB/server/mysql-test/std_data/client-cert.pem --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; Variable_name Value Ssl_cipher -/home/vicentiu/Workspace/MariaDB/server/client/mysql --defaults-file=/home/vicentiu/Workspace/MariaDB/server/mysql-test/var/my.cnf --ssl --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it diff --git a/mysql-test/t/ssl_7937.test b/mysql-test/t/ssl_7937.test index e1a07c5659a..ff190ce7fdc 100644 --- a/mysql-test/t/ssl_7937.test +++ b/mysql-test/t/ssl_7937.test @@ -5,17 +5,13 @@ let $mysql_ssl_no_cert=$MYSQL --ssl -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; let $mysql_ssl_no_cert_ver=$MYSQL --ssl --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---echo $mysql_ssl_cert; --exec $mysql_ssl_cert; --echo # ---echo $mysql_ssl_no_cert; --exec $mysql_ssl_no_cert; --echo # ---echo $mysql_ssl_no_cert_ver; --error 1 --exec $mysql_ssl_no_cert_ver; --echo # ---echo $mysql_ssl_cert_ver; --error 1 --exec $mysql_ssl_cert_ver; diff --git a/mysql-test/t/ssl_without_7937.test b/mysql-test/t/ssl_without_7937.test index 9b5cb096981..7519373540f 100644 --- a/mysql-test/t/ssl_without_7937.test +++ b/mysql-test/t/ssl_without_7937.test @@ -4,19 +4,15 @@ source include/have_ssl_disabled.inc; let $mysql_ssl_cert=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; # SSL mandatory with verify server cert let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---echo $mysql_ssl_cert; --exec $mysql_ssl_cert; ---echo $mysql_ssl_cert_ver; --error 1 --exec $mysql_ssl_cert_ver; # SSL not mandatory again let $mysql_no_ssl_but_ver=$MYSQL --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---echo $mysql_no_ssl_but_ver; --exec $mysql_no_ssl_but_ver; # SSL mandatory but no specifications for ssl parameters let $mysql_ssl_no_spec_ver=$MYSQL --ssl --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---echo $mysql_ssl_no_spec_ver --error 1 --exec $mysql_ssl_no_spec_ver -- cgit v1.2.1 From 992d782d784fb960a705a3532562224d16c6a6d0 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 9 Jun 2015 18:56:09 +0300 Subject: MDEV-6735: Range checked for each record used with key (also MDEV-7786, MDEV-7923) "Range Checked for Each Record" should be only employed when the other option would be cross-product join (i.e. the other option is so bad that we hardly risk anything). Previous logic was: use RCfER if there are no possible quick selects, or quick select would read > 100 rows. Also, it didn't always work as expected due to range optimizer changing table->quick_keys and us looking at sel->quick_keys. Another angle is that recent versions have enabled use of Join Buffering in e.g. outer joins. This further reduces the range of cases where RCfER should be used. We are still unable to estimate the cost of RCfER with any precision, so now changing the condition of "no quick select or quick->records> 100" to a hopefully better condition "no quick select or quick would cost more than full table scan". --- mysql-test/r/range_innodb.result | 39 +++++++++++++++++++++++++++++++++ mysql-test/t/range_innodb.test | 47 ++++++++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 18 +++++++++++++-- 3 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/range_innodb.result create mode 100644 mysql-test/t/range_innodb.test diff --git a/mysql-test/r/range_innodb.result b/mysql-test/r/range_innodb.result new file mode 100644 index 00000000000..794e6c7b3cc --- /dev/null +++ b/mysql-test/r/range_innodb.result @@ -0,0 +1,39 @@ +# +# Range optimizer (and related) tests that need InnoDB. +# +drop table if exists t0, t1, t2; +# +# MDEV-6735: Range checked for each record used with key +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000 +from t0 A, t0 B, t0 C, t0 D; +create table t2 ( +a int, +b int, +filler1 char(100), +filler2 char(100), +filler3 char(100), +filler4 char(100), +key(a), +key(b) +) engine=innodb; +insert into t2 +select +a,a, +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10) +from t1; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +# The following must not use "Range checked for each record": +explain select * from t0 left join t2 on t2.a quick_keys.is_subset(tab->checked_keys) || !sel->needed_reg.is_subset(tab->checked_keys)) { + /* + "Range checked for each record" is a "last resort" access method + that should only be used when the other option is a cross-product + join. + + We use the following condition (it's approximate): + 1. There are potential keys for (sel->needed_reg) + 2. There were no possible ways to construct a quick select, or + the quick select would be more expensive than the full table + scan. + */ tab->use_quick= (!sel->needed_reg.is_clear_all() && (sel->quick_keys.is_clear_all() || - (sel->quick && - (sel->quick->records >= 100L)))) ? + (sel->quick && + sel->quick->read_time > + tab->table->file->scan_time() + + tab->table->file->stats.records/TIME_FOR_COMPARE + ))) ? 2 : 1; sel->read_tables= used_tables & ~current_map; sel->quick_keys.clear_all(); -- cgit v1.2.1 From e5005cedd1b9299b5449eecdce5f9b2f683760ef Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Jun 2015 18:06:41 +0200 Subject: disable ssl for ssl-disabled tests instead of running them only when ssl is not compiled in --- mysql-test/include/have_ssl_disabled.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/include/have_ssl_disabled.opt diff --git a/mysql-test/include/have_ssl_disabled.opt b/mysql-test/include/have_ssl_disabled.opt new file mode 100644 index 00000000000..a72d58c7839 --- /dev/null +++ b/mysql-test/include/have_ssl_disabled.opt @@ -0,0 +1 @@ +--loose-disable-ssl -- cgit v1.2.1 From 49a3392441c1e44385516185a239addf8e0421d7 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 9 Jun 2015 11:57:31 +0400 Subject: MDEV-363 - Server crashes in intern_plugin_lock on concurrent installing semisync plugin and setting rpl_semi_sync_master_enabled Cleanup: Removed my_intern_plugin_lock() and my_intern_plugin_lock_ci() wrappers. They were obsoleted by revision f56dd32bf. --- sql/sql_plugin.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index d1838bab4c9..6503910079d 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -310,8 +310,6 @@ static void plugin_vars_free_values(sys_var *vars); static void restore_pluginvar_names(sys_var *first); static void plugin_opt_set_limits(struct my_option *, const struct st_mysql_sys_var *); -#define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B) -#define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B) static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin); static void intern_plugin_unlock(LEX *lex, plugin_ref plugin); static void reap_plugins(void); @@ -990,7 +988,7 @@ plugin_ref plugin_lock(THD *thd, plugin_ref ptr) #endif mysql_mutex_lock(&LOCK_plugin); plugin_ref_to_int(ptr)->locks_total++; - rc= my_intern_plugin_lock_ci(lex, ptr); + rc= intern_plugin_lock(lex, ptr); mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(rc); } @@ -1004,7 +1002,7 @@ plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type) DBUG_ENTER("plugin_lock_by_name"); mysql_mutex_lock(&LOCK_plugin); if ((plugin= plugin_find_internal(name, type))) - rc= my_intern_plugin_lock_ci(lex, plugin_int_to_ref(plugin)); + rc= intern_plugin_lock(lex, plugin_int_to_ref(plugin)); mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(rc); } @@ -1625,7 +1623,7 @@ int plugin_init(int *argc, char **argv, int flags) { DBUG_ASSERT(!global_system_variables.table_plugin); global_system_variables.table_plugin= - my_intern_plugin_lock(NULL, plugin_int_to_ref(plugin_ptr)); + intern_plugin_lock(NULL, plugin_int_to_ref(plugin_ptr)); DBUG_ASSERT(plugin_ptr->ref_count == 1); } } @@ -2711,7 +2709,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length) { mysql_rwlock_unlock(&LOCK_system_variables_hash); LEX *lex= thd ? thd->lex : 0; - if (!(plugin= my_intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin)))) + if (!(plugin= intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin)))) var= NULL; /* failed to lock it, it must be uninstalling */ else if (!(plugin_state(plugin) & PLUGIN_IS_READY)) @@ -3046,7 +3044,7 @@ void plugin_thdvar_init(THD *thd) mysql_mutex_lock(&LOCK_plugin); thd->variables.table_plugin= - my_intern_plugin_lock(NULL, global_system_variables.table_plugin); + intern_plugin_lock(NULL, global_system_variables.table_plugin); intern_plugin_unlock(NULL, old_table_plugin); mysql_mutex_unlock(&LOCK_plugin); DBUG_VOID_RETURN; -- cgit v1.2.1 From 3a50a8c9bed9163beb3373cee8e2a51b3550b72e Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 9 Jun 2015 13:50:43 +0400 Subject: MDEV-363 - Server crashes in intern_plugin_lock on concurrent installing semisync plugin and setting rpl_semi_sync_master_enabled There was race condition between INSTALL PLUGIN and SET. It was caused by a gap in INSTALL PLUGIN when plugin variables were registered but not fully initialized. Accessing such variables concurrently may reference uninitialized memory, specifically sys_var_pluginvar::plugin. Fixed by initializing sys_var_pluginvar::plugin early, before variable is registered. --- sql/sql_plugin.cc | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 6503910079d..dbbc2622866 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -271,13 +271,15 @@ public: { TRASH(ptr_arg, size); } sys_var_pluginvar(sys_var_chain *chain, const char *name_arg, - struct st_mysql_sys_var *plugin_var_arg) + struct st_mysql_sys_var *plugin_var_arg, + struct st_plugin_int *plugin_arg) :sys_var(chain, name_arg, plugin_var_arg->comment, (plugin_var_arg->flags & PLUGIN_VAR_THDLOCAL ? SESSION : GLOBAL) | (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0), 0, -1, NO_ARG, pluginvar_show_type(plugin_var_arg), 0, 0, VARIABLE_NOT_IN_BINLOG, NULL, NULL, NULL), - plugin_var(plugin_var_arg), orig_pluginvar_name(plugin_var_arg->name) + plugin(plugin_arg), plugin_var(plugin_var_arg), + orig_pluginvar_name(plugin_var_arg->name) { plugin_var->name= name_arg; } sys_var_pluginvar *cast_pluginvar() { return this; } bool check_update_type(Item_result type); @@ -1407,22 +1409,6 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin, #endif /* FIX_LATER */ } - /* - set the plugin attribute of plugin's sys vars so they are pointing - to the active plugin - */ - if (plugin->system_vars) - { - sys_var_pluginvar *var= plugin->system_vars->cast_pluginvar(); - for (;;) - { - var->plugin= plugin; - if (!var->next) - break; - var= var->next->cast_pluginvar(); - } - } - ret= 0; err: @@ -3925,7 +3911,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (o->flags & PLUGIN_VAR_NOSYSVAR) continue; if ((var= find_bookmark(plugin_name.str, o->name, o->flags))) - v= new (mem_root) sys_var_pluginvar(&chain, var->key + 1, o); + v= new (mem_root) sys_var_pluginvar(&chain, var->key + 1, o, tmp); else { len= plugin_name.length + strlen(o->name) + 2; @@ -3933,7 +3919,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, strxmov(varname, plugin_name.str, "-", o->name, NullS); my_casedn_str(&my_charset_latin1, varname); convert_dash_to_underscore(varname, len-1); - v= new (mem_root) sys_var_pluginvar(&chain, varname, o); + v= new (mem_root) sys_var_pluginvar(&chain, varname, o, tmp); } DBUG_ASSERT(v); /* check that an object was actually constructed */ } /* end for */ -- cgit v1.2.1 From 80f6b2259330f2bc4de1692b671ab553dc5b4353 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 9 Jun 2015 16:08:09 +0400 Subject: MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with disabled keys Fixed that OPTIMIZE TABLE against MyISAM/Aria table may write uninitialized key root position for disabled keys. --- mysql-test/r/myisam.result | 11 +++++++++++ mysql-test/suite/maria/optimize.result | 11 +++++++++++ mysql-test/suite/maria/optimize.test | 10 ++++++++++ mysql-test/t/myisam.test | 10 ++++++++++ storage/maria/ma_check.c | 6 ++---- storage/myisam/mi_check.c | 6 ++---- 6 files changed, 46 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index c969b237293..85af643387e 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2522,6 +2522,17 @@ test.t1 check error Size of indexfile is: 1024 Should be: 2048 test.t1 check warning Size of datafile is: 14 Should be: 7 test.t1 check error Corrupt DROP TABLE t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; show variables like 'myisam_block_size'; Variable_name Value myisam_block_size 1024 diff --git a/mysql-test/suite/maria/optimize.result b/mysql-test/suite/maria/optimize.result index 9cce55d6199..a78e8e469aa 100644 --- a/mysql-test/suite/maria/optimize.result +++ b/mysql-test/suite/maria/optimize.result @@ -6,3 +6,14 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/maria/optimize.test b/mysql-test/suite/maria/optimize.test index 6b310b1d1a6..b1fc250cd29 100644 --- a/mysql-test/suite/maria/optimize.test +++ b/mysql-test/suite/maria/optimize.test @@ -160,3 +160,13 @@ INSERT /*! IGNORE */ INTO t1 VALUES ('urxjxqvwabikpugvexxbxdpxjkeqiuhhuadbcuhoz check table t1; OPTIMIZE TABLE t1; drop table t1; + +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 8323890b028..43c12b42bc9 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1749,6 +1749,16 @@ CHECK TABLE t1; DROP TABLE t1; +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; + # # Check some variables # diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 3be4465c71e..ecdc512ef69 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -3119,10 +3119,8 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name) for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; key++,keyinfo++) { - if (! maria_is_key_active(share->state.key_map, key)) - continue; - - if (share->state.key_root[key] != HA_OFFSET_ERROR) + if (maria_is_key_active(share->state.key_map, key) && + share->state.key_root[key] != HA_OFFSET_ERROR) { index_pos[key]=param->new_file_pos; /* Write first block here */ if (sort_one_index(param,info,keyinfo,share->state.key_root[key], diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 73558ce77b3..ff9ea4b82cb 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1944,10 +1944,8 @@ int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name) for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; key++,keyinfo++) { - if (! mi_is_key_active(info->s->state.key_map, key)) - continue; - - if (share->state.key_root[key] != HA_OFFSET_ERROR) + if (mi_is_key_active(info->s->state.key_map, key) && + share->state.key_root[key] != HA_OFFSET_ERROR) { index_pos[key]=param->new_file_pos; /* Write first block here */ if (sort_one_index(param,info,keyinfo,share->state.key_root[key], -- cgit v1.2.1 From 5a44e1a4024f1760021e5c6fd65773584d60513a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Jun 2015 22:11:22 +0200 Subject: tests for MDEV-7937: Enforce SSL when --ssl client option is used * add a test when server certificate is verified successfully * one test with two combinations (instead of two tests) * verbose tets: make it print what it is doing * fix the test to work with yassl and no-ssl builds --- mysql-test/include/have_ssl_disabled.inc | 4 --- mysql-test/include/have_ssl_disabled.opt | 1 - mysql-test/r/ssl_7937,nossl.result | 15 +++++++++++ mysql-test/r/ssl_7937.result | 23 ++++++++++------ mysql-test/r/ssl_without_7937.result | 6 ----- mysql-test/t/ssl_7937.combinations | 5 ++++ mysql-test/t/ssl_7937.test | 46 ++++++++++++++++++++++---------- mysql-test/t/ssl_without_7937.test | 18 ------------- 8 files changed, 67 insertions(+), 51 deletions(-) delete mode 100644 mysql-test/include/have_ssl_disabled.inc delete mode 100644 mysql-test/include/have_ssl_disabled.opt create mode 100644 mysql-test/r/ssl_7937,nossl.result delete mode 100644 mysql-test/r/ssl_without_7937.result create mode 100644 mysql-test/t/ssl_7937.combinations delete mode 100644 mysql-test/t/ssl_without_7937.test diff --git a/mysql-test/include/have_ssl_disabled.inc b/mysql-test/include/have_ssl_disabled.inc deleted file mode 100644 index 6c672794146..00000000000 --- a/mysql-test/include/have_ssl_disabled.inc +++ /dev/null @@ -1,4 +0,0 @@ -if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME like 'have_ssl' and VARIABLE_VALUE like 'DISABLED'`) -{ - --skip Test requires ssl to be disabled. -} diff --git a/mysql-test/include/have_ssl_disabled.opt b/mysql-test/include/have_ssl_disabled.opt deleted file mode 100644 index a72d58c7839..00000000000 --- a/mysql-test/include/have_ssl_disabled.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-disable-ssl diff --git a/mysql-test/r/ssl_7937,nossl.result b/mysql-test/r/ssl_7937,nossl.result new file mode 100644 index 00000000000..72693233bc8 --- /dev/null +++ b/mysql-test/r/ssl_7937,nossl.result @@ -0,0 +1,15 @@ +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +no +mysql --ssl -e "call test.have_ssl()" +have_ssl +no +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +drop procedure have_ssl; diff --git a/mysql-test/r/ssl_7937.result b/mysql-test/r/ssl_7937.result index 19522f08981..a94ca3b3529 100644 --- a/mysql-test/r/ssl_7937.result +++ b/mysql-test/r/ssl_7937.result @@ -1,9 +1,16 @@ -Variable_name Value -Ssl_cipher DHE-RSA-AES256-GCM-SHA384 -# -Variable_name Value -Ssl_cipher DHE-RSA-AES256-GCM-SHA384 -# -ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate -# +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +drop procedure have_ssl; diff --git a/mysql-test/r/ssl_without_7937.result b/mysql-test/r/ssl_without_7937.result deleted file mode 100644 index 191f98fb1a5..00000000000 --- a/mysql-test/r/ssl_without_7937.result +++ /dev/null @@ -1,6 +0,0 @@ -Variable_name Value -Ssl_cipher -ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it -Variable_name Value -Ssl_cipher -ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it diff --git a/mysql-test/t/ssl_7937.combinations b/mysql-test/t/ssl_7937.combinations new file mode 100644 index 00000000000..46a45686a9b --- /dev/null +++ b/mysql-test/t/ssl_7937.combinations @@ -0,0 +1,5 @@ +[ssl] +--loose-enable-ssl + +[nossl] +--loose-disable-ssl diff --git a/mysql-test/t/ssl_7937.test b/mysql-test/t/ssl_7937.test index ff190ce7fdc..d593b9d936d 100644 --- a/mysql-test/t/ssl_7937.test +++ b/mysql-test/t/ssl_7937.test @@ -1,17 +1,35 @@ -source include/have_ssl_communication.inc; +# +# MDEV-7937: Enforce SSL when --ssl client option is used +# -let $mysql_ssl_cert=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; -let $mysql_ssl_no_cert=$MYSQL --ssl -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; -let $mysql_ssl_no_cert_ver=$MYSQL --ssl --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; -let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-verify-server-cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; +source include/have_ssl_crypto_functs.inc; ---exec $mysql_ssl_cert; ---echo # ---exec $mysql_ssl_no_cert; ---echo # ---error 1 ---exec $mysql_ssl_no_cert_ver; ---echo # ---error 1 ---exec $mysql_ssl_cert_ver; +# create a procedure instead of SHOW STATUS LIKE 'ssl_cipher' +# because the cipher depends on openssl (or yassl) version, +# and it's actual value doesn't matter here anyway +create procedure have_ssl() + select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status + where variable_name='ssl_cipher'; +--disable_abort_on_error +--echo mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl -e "call test.have_ssl()" +--exec $MYSQL --ssl -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 + +--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +# this is the test where certificate verification fails. +# but yassl doesn't support certificate verification, so +# we fake the test result for yassl +let yassl=`select variable_value='Unknown' from information_schema.session_status where variable_name='Ssl_session_cache_mode'`; +if (!$yassl) { + --exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 +} +if ($yassl) { + --echo ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +} + +drop procedure have_ssl; diff --git a/mysql-test/t/ssl_without_7937.test b/mysql-test/t/ssl_without_7937.test deleted file mode 100644 index 7519373540f..00000000000 --- a/mysql-test/t/ssl_without_7937.test +++ /dev/null @@ -1,18 +0,0 @@ -source include/have_ssl_disabled.inc; - -# SSL not mandatory here. -let $mysql_ssl_cert=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; -# SSL mandatory with verify server cert -let $mysql_ssl_cert_ver=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---exec $mysql_ssl_cert; ---error 1 ---exec $mysql_ssl_cert_ver; - -# SSL not mandatory again -let $mysql_no_ssl_but_ver=$MYSQL --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---exec $mysql_no_ssl_but_ver; - -# SSL mandatory but no specifications for ssl parameters -let $mysql_ssl_no_spec_ver=$MYSQL --ssl --ssl_verify_server_cert -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; ---error 1 ---exec $mysql_ssl_no_spec_ver -- cgit v1.2.1 From 7c98e8a31b48c76a519eeff802d29ad9a8f7b1fc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Jun 2015 16:43:56 +0200 Subject: fix after the tokudb ft-index merge --- storage/tokudb/ft-index/util/tests/sm-basic.cc | 127 ++++++++++++++++++++ .../ft-index/util/tests/sm-crash-double-free.cc | 128 +++++++++++++++++++++ util/tests/sm-basic.cc | 127 -------------------- util/tests/sm-crash-double-free.cc | 128 --------------------- 4 files changed, 255 insertions(+), 255 deletions(-) create mode 100644 storage/tokudb/ft-index/util/tests/sm-basic.cc create mode 100644 storage/tokudb/ft-index/util/tests/sm-crash-double-free.cc delete mode 100644 util/tests/sm-basic.cc delete mode 100644 util/tests/sm-crash-double-free.cc diff --git a/storage/tokudb/ft-index/util/tests/sm-basic.cc b/storage/tokudb/ft-index/util/tests/sm-basic.cc new file mode 100644 index 00000000000..5df64294721 --- /dev/null +++ b/storage/tokudb/ft-index/util/tests/sm-basic.cc @@ -0,0 +1,127 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +// test that basic scoped malloc works with a thread + +#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." +#include +#include +#include +#include + +static void sm_test(void) { + toku::scoped_malloc a(1); + { + toku::scoped_malloc b(2); + { + toku::scoped_malloc c(3); + } + } +} + +static void *sm_test_f(void *arg) { + sm_test(); + return arg; +} + +int main(void) { + toku_scoped_malloc_init(); + + // run the test + toku_pthread_t tid; + int r; + r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); + assert_zero(r); + void *ret; + r = toku_pthread_join(tid, &ret); + assert_zero(r); + + toku_scoped_malloc_destroy(); + + return 0; +} diff --git a/storage/tokudb/ft-index/util/tests/sm-crash-double-free.cc b/storage/tokudb/ft-index/util/tests/sm-crash-double-free.cc new file mode 100644 index 00000000000..653d4148fd0 --- /dev/null +++ b/storage/tokudb/ft-index/util/tests/sm-crash-double-free.cc @@ -0,0 +1,128 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +// force a race between the scoped malloc global destructor and a thread variable destructor + +#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." +#define TOKU_SCOPED_MALLOC_DEBUG 1 +#include +#include +#include +#include +#include + +volatile int state = 0; + +static void sm_test(void) { + toku::scoped_malloc a(1); +} + +static void *sm_test_f(void *arg) { + sm_test(); + state = 1; + while (state != 2) sleep(1); + return arg; +} + +int main(void) { + TOKU_VALGRIND_HG_DISABLE_CHECKING(&state, sizeof state); + state = 0; + toku_scoped_malloc_init(); + toku_pthread_t tid; + int r; + r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); + assert_zero(r); + void *ret; + while (state != 1) sleep(1); + toku_scoped_malloc_destroy_set(); + state = 2; + r = toku_pthread_join(tid, &ret); + assert_zero(r); + toku_scoped_malloc_destroy_key(); + return 0; +} diff --git a/util/tests/sm-basic.cc b/util/tests/sm-basic.cc deleted file mode 100644 index 5df64294721..00000000000 --- a/util/tests/sm-basic.cc +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ident "$Id$" -/* -COPYING CONDITIONS NOTICE: - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation, and provided that the - following conditions are met: - - * Redistributions of source code must retain this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below). - - * Redistributions in binary form must reproduce this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below) in the documentation and/or other materials - provided with the distribution. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - -COPYRIGHT NOTICE: - - TokuFT, Tokutek Fractal Tree Indexing Library. - Copyright (C) 2007-2013 Tokutek, Inc. - -DISCLAIMER: - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -UNIVERSITY PATENT NOTICE: - - The technology is licensed by the Massachusetts Institute of - Technology, Rutgers State University of New Jersey, and the Research - Foundation of State University of New York at Stony Brook under - United States of America Serial No. 11/760379 and to the patents - and/or patent applications resulting from it. - -PATENT MARKING NOTICE: - - This software is covered by US Patent No. 8,185,551. - This software is covered by US Patent No. 8,489,638. - -PATENT RIGHTS GRANT: - - "THIS IMPLEMENTATION" means the copyrightable works distributed by - Tokutek as part of the Fractal Tree project. - - "PATENT CLAIMS" means the claims of patents that are owned or - licensable by Tokutek, both currently or in the future; and that in - the absence of this license would be infringed by THIS - IMPLEMENTATION or by using or running THIS IMPLEMENTATION. - - "PATENT CHALLENGE" shall mean a challenge to the validity, - patentability, enforceability and/or non-infringement of any of the - PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. - - Tokutek hereby grants to you, for the term and geographical scope of - the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, - irrevocable (except as stated in this section) patent license to - make, have made, use, offer to sell, sell, import, transfer, and - otherwise run, modify, and propagate the contents of THIS - IMPLEMENTATION, where such license applies only to the PATENT - CLAIMS. This grant does not include claims that would be infringed - only as a consequence of further modifications of THIS - IMPLEMENTATION. If you or your agent or licensee institute or order - or agree to the institution of patent litigation against any entity - (including a cross-claim or counterclaim in a lawsuit) alleging that - THIS IMPLEMENTATION constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any rights - granted to you under this License shall terminate as of the date - such litigation is filed. If you or your agent or exclusive - licensee institute or order or agree to the institution of a PATENT - CHALLENGE, then Tokutek may terminate any rights granted to you - under this License. -*/ - -// test that basic scoped malloc works with a thread - -#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." -#include -#include -#include -#include - -static void sm_test(void) { - toku::scoped_malloc a(1); - { - toku::scoped_malloc b(2); - { - toku::scoped_malloc c(3); - } - } -} - -static void *sm_test_f(void *arg) { - sm_test(); - return arg; -} - -int main(void) { - toku_scoped_malloc_init(); - - // run the test - toku_pthread_t tid; - int r; - r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); - assert_zero(r); - void *ret; - r = toku_pthread_join(tid, &ret); - assert_zero(r); - - toku_scoped_malloc_destroy(); - - return 0; -} diff --git a/util/tests/sm-crash-double-free.cc b/util/tests/sm-crash-double-free.cc deleted file mode 100644 index 653d4148fd0..00000000000 --- a/util/tests/sm-crash-double-free.cc +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: -#ident "$Id$" -/* -COPYING CONDITIONS NOTICE: - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation, and provided that the - following conditions are met: - - * Redistributions of source code must retain this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below). - - * Redistributions in binary form must reproduce this COPYING - CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the - DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the - PATENT MARKING NOTICE (below), and the PATENT RIGHTS - GRANT (below) in the documentation and/or other materials - provided with the distribution. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - -COPYRIGHT NOTICE: - - TokuFT, Tokutek Fractal Tree Indexing Library. - Copyright (C) 2007-2013 Tokutek, Inc. - -DISCLAIMER: - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -UNIVERSITY PATENT NOTICE: - - The technology is licensed by the Massachusetts Institute of - Technology, Rutgers State University of New Jersey, and the Research - Foundation of State University of New York at Stony Brook under - United States of America Serial No. 11/760379 and to the patents - and/or patent applications resulting from it. - -PATENT MARKING NOTICE: - - This software is covered by US Patent No. 8,185,551. - This software is covered by US Patent No. 8,489,638. - -PATENT RIGHTS GRANT: - - "THIS IMPLEMENTATION" means the copyrightable works distributed by - Tokutek as part of the Fractal Tree project. - - "PATENT CLAIMS" means the claims of patents that are owned or - licensable by Tokutek, both currently or in the future; and that in - the absence of this license would be infringed by THIS - IMPLEMENTATION or by using or running THIS IMPLEMENTATION. - - "PATENT CHALLENGE" shall mean a challenge to the validity, - patentability, enforceability and/or non-infringement of any of the - PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. - - Tokutek hereby grants to you, for the term and geographical scope of - the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, - irrevocable (except as stated in this section) patent license to - make, have made, use, offer to sell, sell, import, transfer, and - otherwise run, modify, and propagate the contents of THIS - IMPLEMENTATION, where such license applies only to the PATENT - CLAIMS. This grant does not include claims that would be infringed - only as a consequence of further modifications of THIS - IMPLEMENTATION. If you or your agent or licensee institute or order - or agree to the institution of patent litigation against any entity - (including a cross-claim or counterclaim in a lawsuit) alleging that - THIS IMPLEMENTATION constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any rights - granted to you under this License shall terminate as of the date - such litigation is filed. If you or your agent or exclusive - licensee institute or order or agree to the institution of a PATENT - CHALLENGE, then Tokutek may terminate any rights granted to you - under this License. -*/ - -// force a race between the scoped malloc global destructor and a thread variable destructor - -#ident "Copyright (c) 2015 Tokutek Inc. All rights reserved." -#define TOKU_SCOPED_MALLOC_DEBUG 1 -#include -#include -#include -#include -#include - -volatile int state = 0; - -static void sm_test(void) { - toku::scoped_malloc a(1); -} - -static void *sm_test_f(void *arg) { - sm_test(); - state = 1; - while (state != 2) sleep(1); - return arg; -} - -int main(void) { - TOKU_VALGRIND_HG_DISABLE_CHECKING(&state, sizeof state); - state = 0; - toku_scoped_malloc_init(); - toku_pthread_t tid; - int r; - r = toku_pthread_create(&tid, NULL, sm_test_f, NULL); - assert_zero(r); - void *ret; - while (state != 1) sleep(1); - toku_scoped_malloc_destroy_set(); - state = 2; - r = toku_pthread_join(tid, &ret); - assert_zero(r); - toku_scoped_malloc_destroy_key(); - return 0; -} -- cgit v1.2.1 From b96c196f1cd5d77e524cbf952539bdd33c65ffc1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Jun 2015 16:48:10 +0200 Subject: Item_cache::safe_charset_converter() fixes * take into account that example may be NULL * use example->safe_charset_converter(), copy-paste from Item::safe_charset_converter() (example might have its own implementation) * handle the case when the charset doesn't need conversion (and return this). --- sql/item.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index f8d1c85f447..dbcf1b4cbe1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1146,18 +1146,24 @@ Item *Item::safe_charset_converter(CHARSET_INFO *tocs) because Item_singlerow_subselect later calls Item_cache-specific methods, e.g. row[i]->store() and row[i]->cache_value(). - Let's wrap Item_func_conv_charset to a new Item_cache, + Let's wrap Item_func_conv_charset in a new Item_cache, so the Item_cache-specific methods can still be used for Item_singlerow_subselect::row[i] safely. + As a bonus we cache the converted value, instead of converting every time + TODO: we should eventually check all other use cases of change_item_tree(). Perhaps some more potentially dangerous substitution examples exist. */ Item *Item_cache::safe_charset_converter(CHARSET_INFO *tocs) { - Item_func_conv_charset *conv= new Item_func_conv_charset(example, tocs, 1); + if (!example) + return Item::safe_charset_converter(tocs); + Item *conv= example->safe_charset_converter(tocs); + if (conv == example) + return this; Item_cache *cache; - if (!conv || !conv->safe || !(cache= new Item_cache_str(conv))) + if (!conv || !(cache= new Item_cache_str(conv))) return NULL; // Safe conversion is not possible, or OEM cache->setup(conv); cache->fixed= false; // Make Item::fix_fields() happy -- cgit v1.2.1 From d199a0ffb0aac86881ea2db7dd78bc07b438dc67 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Jun 2015 17:47:52 +0200 Subject: more renames after tokudb merge --- mysql-test/suite/tokudb.bugs/r/db805.result | 18 ------------------ mysql-test/suite/tokudb.bugs/r/db806.result | 9 --------- mysql-test/suite/tokudb.bugs/r/db811.result | 14 -------------- mysql-test/suite/tokudb.bugs/r/db811s.result | 14 -------------- mysql-test/suite/tokudb.bugs/r/db823.result | 11 ----------- mysql-test/suite/tokudb.bugs/t/db805.test | 17 ----------------- mysql-test/suite/tokudb.bugs/t/db806.test | 13 ------------- mysql-test/suite/tokudb.bugs/t/db811.test | 22 ---------------------- mysql-test/suite/tokudb.bugs/t/db811s.test | 22 ---------------------- mysql-test/suite/tokudb.bugs/t/db823.test | 16 ---------------- .../tokudb/mysql-test/tokudb_bugs/r/db805.result | 18 ++++++++++++++++++ .../tokudb/mysql-test/tokudb_bugs/r/db806.result | 9 +++++++++ .../tokudb/mysql-test/tokudb_bugs/r/db811.result | 14 ++++++++++++++ .../tokudb/mysql-test/tokudb_bugs/r/db811s.result | 14 ++++++++++++++ .../tokudb/mysql-test/tokudb_bugs/r/db823.result | 11 +++++++++++ storage/tokudb/mysql-test/tokudb_bugs/t/db805.test | 17 +++++++++++++++++ storage/tokudb/mysql-test/tokudb_bugs/t/db806.test | 13 +++++++++++++ storage/tokudb/mysql-test/tokudb_bugs/t/db811.test | 22 ++++++++++++++++++++++ .../tokudb/mysql-test/tokudb_bugs/t/db811s.test | 22 ++++++++++++++++++++++ storage/tokudb/mysql-test/tokudb_bugs/t/db823.test | 16 ++++++++++++++++ 20 files changed, 156 insertions(+), 156 deletions(-) delete mode 100644 mysql-test/suite/tokudb.bugs/r/db805.result delete mode 100644 mysql-test/suite/tokudb.bugs/r/db806.result delete mode 100644 mysql-test/suite/tokudb.bugs/r/db811.result delete mode 100644 mysql-test/suite/tokudb.bugs/r/db811s.result delete mode 100644 mysql-test/suite/tokudb.bugs/r/db823.result delete mode 100644 mysql-test/suite/tokudb.bugs/t/db805.test delete mode 100644 mysql-test/suite/tokudb.bugs/t/db806.test delete mode 100644 mysql-test/suite/tokudb.bugs/t/db811.test delete mode 100644 mysql-test/suite/tokudb.bugs/t/db811s.test delete mode 100644 mysql-test/suite/tokudb.bugs/t/db823.test create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/r/db805.result create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/r/db806.result create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/r/db811.result create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/r/db823.result create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/t/db805.test create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/t/db806.test create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/t/db811.test create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test create mode 100644 storage/tokudb/mysql-test/tokudb_bugs/t/db823.test diff --git a/mysql-test/suite/tokudb.bugs/r/db805.result b/mysql-test/suite/tokudb.bugs/r/db805.result deleted file mode 100644 index 1bc0372f1b8..00000000000 --- a/mysql-test/suite/tokudb.bugs/r/db805.result +++ /dev/null @@ -1,18 +0,0 @@ -drop table if exists t1,t3; -create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; -LOCK TABLES t3 WRITE; -create temporary table t1(f1 int,index(f1)) engine=innodb; -INSERT INTO t1 VALUES(1),(1),(1); -select * from t1; -f1 -1 -1 -1 -ALTER TABLE t1 engine=TOKUDB; -select * from t1; -f1 -1 -1 -1 -unlock tables; -drop table t1,t3; diff --git a/mysql-test/suite/tokudb.bugs/r/db806.result b/mysql-test/suite/tokudb.bugs/r/db806.result deleted file mode 100644 index ae87dbab281..00000000000 --- a/mysql-test/suite/tokudb.bugs/r/db806.result +++ /dev/null @@ -1,9 +0,0 @@ -drop table if exists t1,t3; -CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; -lock table t3 read; -create temporary table t1 engine=tokudb as SELECT 1; -select * from t1; -1 -1 -unlock tables; -drop table t1,t3; diff --git a/mysql-test/suite/tokudb.bugs/r/db811.result b/mysql-test/suite/tokudb.bugs/r/db811.result deleted file mode 100644 index 1d26f43c9dd..00000000000 --- a/mysql-test/suite/tokudb.bugs/r/db811.result +++ /dev/null @@ -1,14 +0,0 @@ -drop table if exists t2,t3,t4; -CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; -CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; -CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; -LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; -INSERT INTO t2(a)VALUES (REPEAT(0,1)); -ALTER TABLE t2 ADD COLUMN(c INT); -alter table t4 add column c int; -UPDATE t2 SET a=1; -select * from t2; -a b c -1 NULL NULL -unlock tables; -drop table t2,t3,t4; diff --git a/mysql-test/suite/tokudb.bugs/r/db811s.result b/mysql-test/suite/tokudb.bugs/r/db811s.result deleted file mode 100644 index 0a50e63e037..00000000000 --- a/mysql-test/suite/tokudb.bugs/r/db811s.result +++ /dev/null @@ -1,14 +0,0 @@ -drop table if exists t2,t3,t4; -CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; -CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; -CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; -LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; -INSERT INTO t2(a)VALUES (REPEAT(0,1)); -ALTER TABLE t2 ADD COLUMN(c INT); -alter table t4 add column c int; -UPDATE t2 SET a=1; -select * from t2; -a b c -1 NULL NULL -unlock tables; -drop table t2,t3,t4; diff --git a/mysql-test/suite/tokudb.bugs/r/db823.result b/mysql-test/suite/tokudb.bugs/r/db823.result deleted file mode 100644 index d94da5c0673..00000000000 --- a/mysql-test/suite/tokudb.bugs/r/db823.result +++ /dev/null @@ -1,11 +0,0 @@ -drop table if exists s,t; -create table s (id int) engine=tokudb; -lock tables s write; -create temporary table t (id int, key(id)) engine=innodb; -insert into t values (1); -alter table t engine=tokudb; -select * from t; -id -1 -unlock tables; -drop table s, t; diff --git a/mysql-test/suite/tokudb.bugs/t/db805.test b/mysql-test/suite/tokudb.bugs/t/db805.test deleted file mode 100644 index 1114de6b325..00000000000 --- a/mysql-test/suite/tokudb.bugs/t/db805.test +++ /dev/null @@ -1,17 +0,0 @@ -# DB-805 test that conversion of t1 from innodb to tokudb can write rows -source include/have_tokudb.inc; -source include/have_innodb.inc; -disable_warnings; -drop table if exists t1,t3; -enable_warnings; - -create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; -LOCK TABLES t3 WRITE; -create temporary table t1(f1 int,index(f1)) engine=innodb; -INSERT INTO t1 VALUES(1),(1),(1); -select * from t1; -ALTER TABLE t1 engine=TOKUDB; -select * from t1; -unlock tables; - -drop table t1,t3; diff --git a/mysql-test/suite/tokudb.bugs/t/db806.test b/mysql-test/suite/tokudb.bugs/t/db806.test deleted file mode 100644 index 3815e59f78c..00000000000 --- a/mysql-test/suite/tokudb.bugs/t/db806.test +++ /dev/null @@ -1,13 +0,0 @@ -# DB-806 test that lock tables and create select can write rows to the new table -source include/have_tokudb.inc; -disable_warnings; -drop table if exists t1,t3; -enable_warnings; - -CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; -lock table t3 read; -create temporary table t1 engine=tokudb as SELECT 1; -select * from t1; -unlock tables; - -drop table t1,t3; \ No newline at end of file diff --git a/mysql-test/suite/tokudb.bugs/t/db811.test b/mysql-test/suite/tokudb.bugs/t/db811.test deleted file mode 100644 index 509f482765e..00000000000 --- a/mysql-test/suite/tokudb.bugs/t/db811.test +++ /dev/null @@ -1,22 +0,0 @@ -# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) - -source include/have_tokudb.inc; -source include/have_innodb.inc; -source include/have_partition.inc; -disable_warnings; -drop table if exists t2,t3,t4; -enable_warnings; - -CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; -CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; -CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; -LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; -INSERT INTO t2(a)VALUES (REPEAT(0,1)); -ALTER TABLE t2 ADD COLUMN(c INT); -alter table t4 add column c int; -UPDATE t2 SET a=1; -select * from t2; -unlock tables; - -drop table t2,t3,t4; - diff --git a/mysql-test/suite/tokudb.bugs/t/db811s.test b/mysql-test/suite/tokudb.bugs/t/db811s.test deleted file mode 100644 index 5b8c6ed79d3..00000000000 --- a/mysql-test/suite/tokudb.bugs/t/db811s.test +++ /dev/null @@ -1,22 +0,0 @@ -# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) - -source include/have_tokudb.inc; -source include/have_innodb.inc; -source include/have_partition.inc; -disable_warnings; -drop table if exists t2,t3,t4; -enable_warnings; - -CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; -CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; -CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; -LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; -INSERT INTO t2(a)VALUES (REPEAT(0,1)); -ALTER TABLE t2 ADD COLUMN(c INT); -alter table t4 add column c int; -UPDATE t2 SET a=1; -select * from t2; -unlock tables; - -drop table t2,t3,t4; - diff --git a/mysql-test/suite/tokudb.bugs/t/db823.test b/mysql-test/suite/tokudb.bugs/t/db823.test deleted file mode 100644 index 2e01c0e5797..00000000000 --- a/mysql-test/suite/tokudb.bugs/t/db823.test +++ /dev/null @@ -1,16 +0,0 @@ -# test DB-823 -# test that the conversion of table t from innodb to tokudb succeeds. -source include/have_tokudb.inc; -source include/have_innodb.inc; -disable_warnings; -drop table if exists s,t; -enable_warnings; -create table s (id int) engine=tokudb; -lock tables s write; -create temporary table t (id int, key(id)) engine=innodb; -insert into t values (1); -alter table t engine=tokudb; -select * from t; -unlock tables; -drop table s, t; - diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result new file mode 100644 index 00000000000..1bc0372f1b8 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db805.result @@ -0,0 +1,18 @@ +drop table if exists t1,t3; +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +f1 +1 +1 +1 +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +f1 +1 +1 +1 +unlock tables; +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result new file mode 100644 index 00000000000..ae87dbab281 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result @@ -0,0 +1,9 @@ +drop table if exists t1,t3; +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +1 +1 +unlock tables; +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result new file mode 100644 index 00000000000..1d26f43c9dd --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db811.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result new file mode 100644 index 00000000000..0a50e63e037 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db811s.result @@ -0,0 +1,14 @@ +drop table if exists t2,t3,t4; +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +a b c +1 NULL NULL +unlock tables; +drop table t2,t3,t4; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result new file mode 100644 index 00000000000..d94da5c0673 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db823.result @@ -0,0 +1,11 @@ +drop table if exists s,t; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +id +1 +unlock tables; +drop table s, t; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test new file mode 100644 index 00000000000..1114de6b325 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db805.test @@ -0,0 +1,17 @@ +# DB-805 test that conversion of t1 from innodb to tokudb can write rows +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB; +LOCK TABLES t3 WRITE; +create temporary table t1(f1 int,index(f1)) engine=innodb; +INSERT INTO t1 VALUES(1),(1),(1); +select * from t1; +ALTER TABLE t1 engine=TOKUDB; +select * from t1; +unlock tables; + +drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test new file mode 100644 index 00000000000..3815e59f78c --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test @@ -0,0 +1,13 @@ +# DB-806 test that lock tables and create select can write rows to the new table +source include/have_tokudb.inc; +disable_warnings; +drop table if exists t1,t3; +enable_warnings; + +CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; +lock table t3 read; +create temporary table t1 engine=tokudb as SELECT 1; +select * from t1; +unlock tables; + +drop table t1,t3; \ No newline at end of file diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test new file mode 100644 index 00000000000..509f482765e --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db811.test @@ -0,0 +1,22 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +source include/have_partition.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test new file mode 100644 index 00000000000..5b8c6ed79d3 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db811s.test @@ -0,0 +1,22 @@ +# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files) + +source include/have_tokudb.inc; +source include/have_innodb.inc; +source include/have_partition.inc; +disable_warnings; +drop table if exists t2,t3,t4; +enable_warnings; + +CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB; +CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb; +CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1; +LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE; +INSERT INTO t2(a)VALUES (REPEAT(0,1)); +ALTER TABLE t2 ADD COLUMN(c INT); +alter table t4 add column c int; +UPDATE t2 SET a=1; +select * from t2; +unlock tables; + +drop table t2,t3,t4; + diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test new file mode 100644 index 00000000000..2e01c0e5797 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db823.test @@ -0,0 +1,16 @@ +# test DB-823 +# test that the conversion of table t from innodb to tokudb succeeds. +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists s,t; +enable_warnings; +create table s (id int) engine=tokudb; +lock tables s write; +create temporary table t (id int, key(id)) engine=innodb; +insert into t values (1); +alter table t engine=tokudb; +select * from t; +unlock tables; +drop table s, t; + -- cgit v1.2.1 From 6d49d3b2cc277997de10254ecd5fdb2e80802db7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Jun 2015 20:20:45 +0200 Subject: compiler warnings --- mysys/psi_noop.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c index 2a351b5dd8d..6eecf56f797 100644 --- a/mysys/psi_noop.c +++ b/mysys/psi_noop.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -629,18 +629,17 @@ digest_start_noop(PSI_statement_locker *locker NNN) return NULL; } -static PSI_digest_locker* -digest_add_token_noop(PSI_digest_locker *locker NNN, - uint token NNN, - struct OPAQUE_LEX_YYSTYPE *yylval NNN) +static void +digest_end_noop(PSI_digest_locker *locker NNN, + const struct sql_digest_storage *digest NNN) { - return NULL; + return; } static int -set_thread_connect_attrs_noop(const char *buffer __attribute__((unused)), - uint length __attribute__((unused)), - const void *from_cs __attribute__((unused))) +set_thread_connect_attrs_noop(const char *buffer NNN, + uint length NNN, + const void *from_cs NNN) { return 0; } @@ -742,7 +741,7 @@ static PSI PSI_noop= set_socket_info_noop, set_socket_thread_owner_noop, digest_start_noop, - digest_add_token_noop, + digest_end_noop, set_thread_connect_attrs_noop }; -- cgit v1.2.1 From b9eb7f12db89cb6c3b2e88120f8234659a9a2b60 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Jun 2015 20:20:52 +0200 Subject: CRLF --- pcre/RunTest.bat | 1232 +++++++++++++++++++++++++++--------------------------- 1 file changed, 616 insertions(+), 616 deletions(-) diff --git a/pcre/RunTest.bat b/pcre/RunTest.bat index 35d7f71f9e8..8f290f59130 100644 --- a/pcre/RunTest.bat +++ b/pcre/RunTest.bat @@ -1,616 +1,616 @@ -@echo off -@rem This file must use CRLF linebreaks to function properly -@rem and requires both pcretest and pcregrep -@rem This file was originally contributed by Ralf Junker, and touched up by -@rem Daniel Richard G. Tests 10-12 added by Philip H. -@rem Philip H also changed test 3 to use "wintest" files. -@rem -@rem Updated by Tom Fortmann to support explicit test numbers on the command line. -@rem Added argument validation and added error reporting. -@rem -@rem MS Windows batch file to run pcretest on testfiles with the correct -@rem options. -@rem -@rem Sheri Pierce added logic to skip feature dependent tests -@rem tests 4 5 9 15 and 18 require utf support -@rem tests 6 7 10 16 and 19 require ucp support -@rem 11 requires ucp and link size 2 -@rem 12 requires presence of jit support -@rem 13 requires absence of jit support -@rem Sheri P also added override tests for study and jit testing -@rem Zoltan Herczeg added libpcre16 support -@rem Zoltan Herczeg added libpcre32 support - -setlocal enabledelayedexpansion -if [%srcdir%]==[] ( -if exist testdata\ set srcdir=.) -if [%srcdir%]==[] ( -if exist ..\testdata\ set srcdir=..) -if [%srcdir%]==[] ( -if exist ..\..\testdata\ set srcdir=..\..) -if NOT exist %srcdir%\testdata\ ( -Error: echo distribution testdata folder not found! -call :conferror -exit /b 1 -goto :eof -) - -if [%pcretest%]==[] set pcretest=.\pcretest.exe - -echo source dir is %srcdir% -echo pcretest=%pcretest% - -if NOT exist %pcretest% ( -echo Error: %pcretest% not found! -echo. -call :conferror -exit /b 1 -) - -%pcretest% -C linksize >NUL -set link_size=%ERRORLEVEL% -%pcretest% -C pcre8 >NUL -set support8=%ERRORLEVEL% -%pcretest% -C pcre16 >NUL -set support16=%ERRORLEVEL% -%pcretest% -C pcre32 >NUL -set support32=%ERRORLEVEL% -%pcretest% -C utf >NUL -set utf=%ERRORLEVEL% -%pcretest% -C ucp >NUL -set ucp=%ERRORLEVEL% -%pcretest% -C jit >NUL -set jit=%ERRORLEVEL% - -if %support8% EQU 1 ( -if not exist testout8 md testout8 -if not exist testoutstudy8 md testoutstudy8 -if not exist testoutjit8 md testoutjit8 -) - -if %support16% EQU 1 ( -if not exist testout16 md testout16 -if not exist testoutstudy16 md testoutstudy16 -if not exist testoutjit16 md testoutjit16 -) - -if %support16% EQU 1 ( -if not exist testout32 md testout32 -if not exist testoutstudy32 md testoutstudy32 -if not exist testoutjit32 md testoutjit32 -) - -set do1=no -set do2=no -set do3=no -set do4=no -set do5=no -set do6=no -set do7=no -set do8=no -set do9=no -set do10=no -set do11=no -set do12=no -set do13=no -set do14=no -set do15=no -set do16=no -set do17=no -set do18=no -set do19=no -set do20=no -set do21=no -set do22=no -set do23=no -set do24=no -set do25=no -set do26=no -set all=yes - -for %%a in (%*) do ( - set valid=no - for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) do if %%v == %%a set valid=yes - if "!valid!" == "yes" ( - set do%%a=yes - set all=no -) else ( - echo Invalid test number - %%a! - echo Usage %0 [ test_number ] ... - echo Where test_number is one or more optional test numbers 1 through 26, default is all tests. - exit /b 1 -) -) -set failed="no" - -if "%all%" == "yes" ( - set do1=yes - set do2=yes - set do3=yes - set do4=yes - set do5=yes - set do6=yes - set do7=yes - set do8=yes - set do9=yes - set do10=yes - set do11=yes - set do12=yes - set do13=yes - set do14=yes - set do15=yes - set do16=yes - set do17=yes - set do18=yes - set do19=yes - set do20=yes - set do21=yes - set do22=yes - set do23=yes - set do24=yes - set do25=yes - set do26=yes -) - -@echo RunTest.bat's pcretest output is written to newly created subfolders named -@echo testout, testoutstudy and testoutjit. -@echo. - -set mode= -set bits=8 - -:nextMode -if "%mode%" == "" ( - if %support8% EQU 0 goto modeSkip - echo. - echo ---- Testing 8-bit library ---- - echo. -) -if "%mode%" == "-16" ( - if %support16% EQU 0 goto modeSkip - echo. - echo ---- Testing 16-bit library ---- - echo. -) -if "%mode%" == "-32" ( - if %support32% EQU 0 goto modeSkip - echo. - echo ---- Testing 32-bit library ---- - echo. -) -if "%do1%" == "yes" call :do1 -if "%do2%" == "yes" call :do2 -if "%do3%" == "yes" call :do3 -if "%do4%" == "yes" call :do4 -if "%do5%" == "yes" call :do5 -if "%do6%" == "yes" call :do6 -if "%do7%" == "yes" call :do7 -if "%do8%" == "yes" call :do8 -if "%do9%" == "yes" call :do9 -if "%do10%" == "yes" call :do10 -if "%do11%" == "yes" call :do11 -if "%do12%" == "yes" call :do12 -if "%do13%" == "yes" call :do13 -if "%do14%" == "yes" call :do14 -if "%do15%" == "yes" call :do15 -if "%do16%" == "yes" call :do16 -if "%do17%" == "yes" call :do17 -if "%do18%" == "yes" call :do18 -if "%do19%" == "yes" call :do19 -if "%do20%" == "yes" call :do20 -if "%do21%" == "yes" call :do21 -if "%do22%" == "yes" call :do22 -if "%do23%" == "yes" call :do23 -if "%do24%" == "yes" call :do24 -if "%do25%" == "yes" call :do25 -if "%do26%" == "yes" call :do26 -:modeSkip -if "%mode%" == "" ( - set mode=-16 - set bits=16 - goto nextMode -) -if "%mode%" == "-16" ( - set mode=-32 - set bits=32 - goto nextMode -) - -@rem If mode is -32, testing is finished -if %failed% == "yes" ( -echo In above output, one or more of the various tests failed! -exit /b 1 -) -echo All OK -goto :eof - -:runsub -@rem Function to execute pcretest and compare the output -@rem Arguments are as follows: -@rem -@rem 1 = test number -@rem 2 = outputdir -@rem 3 = test name use double quotes -@rem 4 - 9 = pcretest options - -if [%1] == [] ( - echo Missing test number argument! - exit /b 1 -) - -if [%2] == [] ( - echo Missing outputdir! - exit /b 1 -) - -if [%3] == [] ( - echo Missing test name argument! - exit /b 1 -) - -set testinput=testinput%1 -set testoutput=testoutput%1 -if exist %srcdir%\testdata\win%testinput% ( - set testinput=wintestinput%1 - set testoutput=wintestoutput%1 -) - -echo Test %1: %3 -%pcretest% %mode% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput% >%2%bits%\%testoutput% -if errorlevel 1 ( - echo. failed executing command-line: - echo. %pcretest% %mode% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput% ^>%2%bits%\%testoutput% - set failed="yes" - goto :eof -) - -set type= -if [%1]==[11] ( - set type=-%bits% -) -if [%1]==[18] ( - set type=-%bits% -) -if [%1]==[21] ( - set type=-%bits% -) -if [%1]==[22] ( - set type=-%bits% -) - -fc /n %srcdir%\testdata\%testoutput%%type% %2%bits%\%testoutput% >NUL - -if errorlevel 1 ( - echo. failed comparison: fc /n %srcdir%\testdata\%testoutput% %2%bits%\%testoutput% - if [%1]==[2] ( - echo. - echo ** Test 2 requires a lot of stack. PCRE can be configured to - echo ** use heap for recursion. Otherwise, to pass Test 2 - echo ** you generally need to allocate 8 mb stack to PCRE. - echo ** See the 'pcrestack' page for a discussion of PCRE's - echo ** stack usage. - echo. -) - if [%1]==[3] ( - echo. - echo ** Test 3 failure usually means french locale is not - echo ** available on the system, rather than a bug or problem with PCRE. - echo. - goto :eof -) - - set failed="yes" - goto :eof -) - -echo. Passed. -goto :eof - -:do1 -call :runsub 1 testout "Main functionality (Compatible with Perl >= 5.10)" -q -call :runsub 1 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 1 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do2 - call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q - call :runsub 2 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do3 - call :runsub 3 testout "Locale-specific features" -q - call :runsub 3 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 3 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do4 -if %utf% EQU 0 ( - echo Test 4 Skipped due to absence of UTF-%bits% support. - goto :eof -) - call :runsub 4 testout "UTF-%bits% support - (Compatible with Perl >= 5.10)" -q - call :runsub 4 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 4 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do5 -if %utf% EQU 0 ( - echo Test 5 Skipped due to absence of UTF-%bits% support. - goto :eof -) - call :runsub 5 testout "API, internals, and non-Perl stuff for UTF-%bits%" -q - call :runsub 5 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 5 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do6 -if %ucp% EQU 0 ( - echo Test 6 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 6 testout "Unicode property support (Compatible with Perl >= 5.10)" -q - call :runsub 6 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 6 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do7 -if %ucp% EQU 0 ( - echo Test 7 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 7 testout "API, internals, and non-Perl stuff for Unicode property support" -q - call :runsub 7 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 7 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do8 - call :runsub 8 testout "DFA matching main functionality" -q -dfa - call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s -goto :eof - -:do9 -if %utf% EQU 0 ( - echo Test 9 Skipped due to absence of UTF-%bits% support. - goto :eof -) - call :runsub 9 testout "DFA matching with UTF-%bits%" -q -dfa - call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s - goto :eof - -:do10 -if %ucp% EQU 0 ( - echo Test 10 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 10 testout "DFA matching with Unicode properties" -q -dfa - call :runsub 10 testoutstudy "Test with Study Override" -q -dfa -s -goto :eof - -:do11 -if NOT %link_size% EQU 2 ( - echo Test 11 Skipped because link size is not 2. - goto :eof -) -if %ucp% EQU 0 ( - echo Test 11 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 11 testout "Internal offsets and code size tests" -q - call :runsub 11 testoutstudy "Test with Study Override" -q -s -goto :eof - -:do12 -if %jit% EQU 0 ( - echo Test 12 Skipped due to absence of JIT support. - goto :eof -) - call :runsub 12 testout "JIT-specific features (JIT available)" -q -goto :eof - -:do13 -if %jit% EQU 1 ( - echo Test 13 Skipped due to presence of JIT support. - goto :eof -) - call :runsub 13 testout "JIT-specific features (JIT not available)" -q -goto :eof - -:do14 -if NOT %bits% EQU 8 ( - echo Test 14 Skipped when running 16/32-bit tests. - goto :eof -) - copy /Y %srcdir%\testdata\saved16 testsaved16 - copy /Y %srcdir%\testdata\saved32 testsaved32 - call :runsub 14 testout "Specials for the basic 8-bit library" -q - call :runsub 14 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 14 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do15 -if NOT %bits% EQU 8 ( - echo Test 15 Skipped when running 16/32-bit tests. - goto :eof -) -if %utf% EQU 0 ( - echo Test 15 Skipped due to absence of UTF-%bits% support. - goto :eof -) - call :runsub 15 testout "Specials for the 8-bit library with UTF-%bits% support" -q - call :runsub 15 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 15 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do16 -if NOT %bits% EQU 8 ( - echo Test 16 Skipped when running 16/32-bit tests. - goto :eof -) -if %ucp% EQU 0 ( - echo Test 16 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 16 testout "Specials for the 8-bit library with Unicode propery support" -q - call :runsub 16 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 16 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do17 -if %bits% EQU 8 ( - echo Test 17 Skipped when running 8-bit tests. - goto :eof -) - call :runsub 17 testout "Specials for the basic 16/32-bit library" -q - call :runsub 17 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 17 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do18 -if %bits% EQU 8 ( - echo Test 18 Skipped when running 8-bit tests. - goto :eof -) -if %utf% EQU 0 ( - echo Test 18 Skipped due to absence of UTF-%bits% support. - goto :eof -) - call :runsub 18 testout "Specials for the 16/32-bit library with UTF-%bits% support" -q - call :runsub 18 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 18 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do19 -if %bits% EQU 8 ( - echo Test 19 Skipped when running 8-bit tests. - goto :eof -) -if %ucp% EQU 0 ( - echo Test 19 Skipped due to absence of Unicode property support. - goto :eof -) - call :runsub 19 testout "Specials for the 16/32-bit library with Unicode property support" -q - call :runsub 19 testoutstudy "Test with Study Override" -q -s - if %jit% EQU 1 call :runsub 19 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do20 -if %bits% EQU 8 ( - echo Test 20 Skipped when running 8-bit tests. - goto :eof -) - call :runsub 20 testout "DFA specials for the basic 16/32-bit library" -q -dfa - call :runsub 20 testoutstudy "Test with Study Override" -q -dfa -s -goto :eof - -:do21 -if %bits% EQU 8 ( - echo Test 21 Skipped when running 8-bit tests. - goto :eof -) -if NOT %link_size% EQU 2 ( - echo Test 21 Skipped because link size is not 2. - goto :eof -) -copy /Y %srcdir%\testdata\saved8 testsaved8 -copy /Y %srcdir%\testdata\saved16LE-1 testsaved16LE-1 -copy /Y %srcdir%\testdata\saved16BE-1 testsaved16BE-1 -copy /Y %srcdir%\testdata\saved32LE-1 testsaved32LE-1 -copy /Y %srcdir%\testdata\saved32BE-1 testsaved32BE-1 -call :runsub 21 testout "Reloads for the basic 16/32-bit library" -q -call :runsub 21 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 21 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do22 -if %bits% EQU 8 ( - echo Test 22 Skipped when running 8-bit tests. - goto :eof -) -if %utf% EQU 0 ( - echo Test 22 Skipped due to absence of UTF-%bits% support. - goto :eof -) -if NOT %link_size% EQU 2 ( - echo Test 22 Skipped because link size is not 2. - goto :eof -) -copy /Y %srcdir%\testdata\saved16LE-2 testsaved16LE-2 -copy /Y %srcdir%\testdata\saved16BE-2 testsaved16BE-2 -copy /Y %srcdir%\testdata\saved32LE-2 testsaved32LE-2 -copy /Y %srcdir%\testdata\saved32BE-2 testsaved32BE-2 -call :runsub 22 testout "Reloads for the 16/32-bit library with UTF-16/32 support" -q -call :runsub 22 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 22 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do23 -if NOT %bits% EQU 16 ( - echo Test 23 Skipped when running 8/32-bit tests. - goto :eof -) -call :runsub 23 testout "Specials for the 16-bit library" -q -call :runsub 23 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 23 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do24 -if NOT %bits% EQU 16 ( - echo Test 24 Skipped when running 8/32-bit tests. - goto :eof -) -if %utf% EQU 0 ( - echo Test 24 Skipped due to absence of UTF-%bits% support. - goto :eof -) -call :runsub 24 testout "Specials for the 16-bit library with UTF-16 support" -q -call :runsub 24 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 24 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do25 -if NOT %bits% EQU 32 ( - echo Test 25 Skipped when running 8/16-bit tests. - goto :eof -) -call :runsub 25 testout "Specials for the 32-bit library" -q -call :runsub 25 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 25 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:do26 -if NOT %bits% EQU 32 ( - echo Test 26 Skipped when running 8/16-bit tests. - goto :eof -) -if %utf% EQU 0 ( - echo Test 26 Skipped due to absence of UTF-%bits% support. - goto :eof -) -call :runsub 26 testout "Specials for the 32-bit library with UTF-32 support" -q -call :runsub 26 testoutstudy "Test with Study Override" -q -s -if %jit% EQU 1 call :runsub 26 testoutjit "Test with JIT Override" -q -s+ -goto :eof - -:conferror -@echo. -@echo Either your build is incomplete or you have a configuration error. -@echo. -@echo If configured with cmake and executed via "make test" or the MSVC "RUN_TESTS" -@echo project, pcre_test.bat defines variables and automatically calls RunTest.bat. -@echo For manual testing of all available features, after configuring with cmake -@echo and building, you can run the built pcre_test.bat. For best results with -@echo cmake builds and tests avoid directories with full path names that include -@echo spaces for source or build. -@echo. -@echo Otherwise, if the build dir is in a subdir of the source dir, testdata needed -@echo for input and verification should be found automatically when (from the -@echo location of the the built exes) you call RunTest.bat. By default RunTest.bat -@echo runs all tests compatible with the linked pcre library but it can be given -@echo a test number as an argument. -@echo. -@echo If the build dir is not under the source dir you can either copy your exes -@echo to the source folder or copy RunTest.bat and the testdata folder to the -@echo location of your built exes and then run RunTest.bat. -@echo. -goto :eof +@echo off +@rem This file must use CRLF linebreaks to function properly +@rem and requires both pcretest and pcregrep +@rem This file was originally contributed by Ralf Junker, and touched up by +@rem Daniel Richard G. Tests 10-12 added by Philip H. +@rem Philip H also changed test 3 to use "wintest" files. +@rem +@rem Updated by Tom Fortmann to support explicit test numbers on the command line. +@rem Added argument validation and added error reporting. +@rem +@rem MS Windows batch file to run pcretest on testfiles with the correct +@rem options. +@rem +@rem Sheri Pierce added logic to skip feature dependent tests +@rem tests 4 5 9 15 and 18 require utf support +@rem tests 6 7 10 16 and 19 require ucp support +@rem 11 requires ucp and link size 2 +@rem 12 requires presence of jit support +@rem 13 requires absence of jit support +@rem Sheri P also added override tests for study and jit testing +@rem Zoltan Herczeg added libpcre16 support +@rem Zoltan Herczeg added libpcre32 support + +setlocal enabledelayedexpansion +if [%srcdir%]==[] ( +if exist testdata\ set srcdir=.) +if [%srcdir%]==[] ( +if exist ..\testdata\ set srcdir=..) +if [%srcdir%]==[] ( +if exist ..\..\testdata\ set srcdir=..\..) +if NOT exist %srcdir%\testdata\ ( +Error: echo distribution testdata folder not found! +call :conferror +exit /b 1 +goto :eof +) + +if [%pcretest%]==[] set pcretest=.\pcretest.exe + +echo source dir is %srcdir% +echo pcretest=%pcretest% + +if NOT exist %pcretest% ( +echo Error: %pcretest% not found! +echo. +call :conferror +exit /b 1 +) + +%pcretest% -C linksize >NUL +set link_size=%ERRORLEVEL% +%pcretest% -C pcre8 >NUL +set support8=%ERRORLEVEL% +%pcretest% -C pcre16 >NUL +set support16=%ERRORLEVEL% +%pcretest% -C pcre32 >NUL +set support32=%ERRORLEVEL% +%pcretest% -C utf >NUL +set utf=%ERRORLEVEL% +%pcretest% -C ucp >NUL +set ucp=%ERRORLEVEL% +%pcretest% -C jit >NUL +set jit=%ERRORLEVEL% + +if %support8% EQU 1 ( +if not exist testout8 md testout8 +if not exist testoutstudy8 md testoutstudy8 +if not exist testoutjit8 md testoutjit8 +) + +if %support16% EQU 1 ( +if not exist testout16 md testout16 +if not exist testoutstudy16 md testoutstudy16 +if not exist testoutjit16 md testoutjit16 +) + +if %support16% EQU 1 ( +if not exist testout32 md testout32 +if not exist testoutstudy32 md testoutstudy32 +if not exist testoutjit32 md testoutjit32 +) + +set do1=no +set do2=no +set do3=no +set do4=no +set do5=no +set do6=no +set do7=no +set do8=no +set do9=no +set do10=no +set do11=no +set do12=no +set do13=no +set do14=no +set do15=no +set do16=no +set do17=no +set do18=no +set do19=no +set do20=no +set do21=no +set do22=no +set do23=no +set do24=no +set do25=no +set do26=no +set all=yes + +for %%a in (%*) do ( + set valid=no + for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) do if %%v == %%a set valid=yes + if "!valid!" == "yes" ( + set do%%a=yes + set all=no +) else ( + echo Invalid test number - %%a! + echo Usage %0 [ test_number ] ... + echo Where test_number is one or more optional test numbers 1 through 26, default is all tests. + exit /b 1 +) +) +set failed="no" + +if "%all%" == "yes" ( + set do1=yes + set do2=yes + set do3=yes + set do4=yes + set do5=yes + set do6=yes + set do7=yes + set do8=yes + set do9=yes + set do10=yes + set do11=yes + set do12=yes + set do13=yes + set do14=yes + set do15=yes + set do16=yes + set do17=yes + set do18=yes + set do19=yes + set do20=yes + set do21=yes + set do22=yes + set do23=yes + set do24=yes + set do25=yes + set do26=yes +) + +@echo RunTest.bat's pcretest output is written to newly created subfolders named +@echo testout, testoutstudy and testoutjit. +@echo. + +set mode= +set bits=8 + +:nextMode +if "%mode%" == "" ( + if %support8% EQU 0 goto modeSkip + echo. + echo ---- Testing 8-bit library ---- + echo. +) +if "%mode%" == "-16" ( + if %support16% EQU 0 goto modeSkip + echo. + echo ---- Testing 16-bit library ---- + echo. +) +if "%mode%" == "-32" ( + if %support32% EQU 0 goto modeSkip + echo. + echo ---- Testing 32-bit library ---- + echo. +) +if "%do1%" == "yes" call :do1 +if "%do2%" == "yes" call :do2 +if "%do3%" == "yes" call :do3 +if "%do4%" == "yes" call :do4 +if "%do5%" == "yes" call :do5 +if "%do6%" == "yes" call :do6 +if "%do7%" == "yes" call :do7 +if "%do8%" == "yes" call :do8 +if "%do9%" == "yes" call :do9 +if "%do10%" == "yes" call :do10 +if "%do11%" == "yes" call :do11 +if "%do12%" == "yes" call :do12 +if "%do13%" == "yes" call :do13 +if "%do14%" == "yes" call :do14 +if "%do15%" == "yes" call :do15 +if "%do16%" == "yes" call :do16 +if "%do17%" == "yes" call :do17 +if "%do18%" == "yes" call :do18 +if "%do19%" == "yes" call :do19 +if "%do20%" == "yes" call :do20 +if "%do21%" == "yes" call :do21 +if "%do22%" == "yes" call :do22 +if "%do23%" == "yes" call :do23 +if "%do24%" == "yes" call :do24 +if "%do25%" == "yes" call :do25 +if "%do26%" == "yes" call :do26 +:modeSkip +if "%mode%" == "" ( + set mode=-16 + set bits=16 + goto nextMode +) +if "%mode%" == "-16" ( + set mode=-32 + set bits=32 + goto nextMode +) + +@rem If mode is -32, testing is finished +if %failed% == "yes" ( +echo In above output, one or more of the various tests failed! +exit /b 1 +) +echo All OK +goto :eof + +:runsub +@rem Function to execute pcretest and compare the output +@rem Arguments are as follows: +@rem +@rem 1 = test number +@rem 2 = outputdir +@rem 3 = test name use double quotes +@rem 4 - 9 = pcretest options + +if [%1] == [] ( + echo Missing test number argument! + exit /b 1 +) + +if [%2] == [] ( + echo Missing outputdir! + exit /b 1 +) + +if [%3] == [] ( + echo Missing test name argument! + exit /b 1 +) + +set testinput=testinput%1 +set testoutput=testoutput%1 +if exist %srcdir%\testdata\win%testinput% ( + set testinput=wintestinput%1 + set testoutput=wintestoutput%1 +) + +echo Test %1: %3 +%pcretest% %mode% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput% >%2%bits%\%testoutput% +if errorlevel 1 ( + echo. failed executing command-line: + echo. %pcretest% %mode% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput% ^>%2%bits%\%testoutput% + set failed="yes" + goto :eof +) + +set type= +if [%1]==[11] ( + set type=-%bits% +) +if [%1]==[18] ( + set type=-%bits% +) +if [%1]==[21] ( + set type=-%bits% +) +if [%1]==[22] ( + set type=-%bits% +) + +fc /n %srcdir%\testdata\%testoutput%%type% %2%bits%\%testoutput% >NUL + +if errorlevel 1 ( + echo. failed comparison: fc /n %srcdir%\testdata\%testoutput% %2%bits%\%testoutput% + if [%1]==[2] ( + echo. + echo ** Test 2 requires a lot of stack. PCRE can be configured to + echo ** use heap for recursion. Otherwise, to pass Test 2 + echo ** you generally need to allocate 8 mb stack to PCRE. + echo ** See the 'pcrestack' page for a discussion of PCRE's + echo ** stack usage. + echo. +) + if [%1]==[3] ( + echo. + echo ** Test 3 failure usually means french locale is not + echo ** available on the system, rather than a bug or problem with PCRE. + echo. + goto :eof +) + + set failed="yes" + goto :eof +) + +echo. Passed. +goto :eof + +:do1 +call :runsub 1 testout "Main functionality (Compatible with Perl >= 5.10)" -q +call :runsub 1 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 1 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do2 + call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q + call :runsub 2 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do3 + call :runsub 3 testout "Locale-specific features" -q + call :runsub 3 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 3 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do4 +if %utf% EQU 0 ( + echo Test 4 Skipped due to absence of UTF-%bits% support. + goto :eof +) + call :runsub 4 testout "UTF-%bits% support - (Compatible with Perl >= 5.10)" -q + call :runsub 4 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 4 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do5 +if %utf% EQU 0 ( + echo Test 5 Skipped due to absence of UTF-%bits% support. + goto :eof +) + call :runsub 5 testout "API, internals, and non-Perl stuff for UTF-%bits%" -q + call :runsub 5 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 5 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do6 +if %ucp% EQU 0 ( + echo Test 6 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 6 testout "Unicode property support (Compatible with Perl >= 5.10)" -q + call :runsub 6 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 6 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do7 +if %ucp% EQU 0 ( + echo Test 7 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 7 testout "API, internals, and non-Perl stuff for Unicode property support" -q + call :runsub 7 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 7 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do8 + call :runsub 8 testout "DFA matching main functionality" -q -dfa + call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s +goto :eof + +:do9 +if %utf% EQU 0 ( + echo Test 9 Skipped due to absence of UTF-%bits% support. + goto :eof +) + call :runsub 9 testout "DFA matching with UTF-%bits%" -q -dfa + call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s + goto :eof + +:do10 +if %ucp% EQU 0 ( + echo Test 10 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 10 testout "DFA matching with Unicode properties" -q -dfa + call :runsub 10 testoutstudy "Test with Study Override" -q -dfa -s +goto :eof + +:do11 +if NOT %link_size% EQU 2 ( + echo Test 11 Skipped because link size is not 2. + goto :eof +) +if %ucp% EQU 0 ( + echo Test 11 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 11 testout "Internal offsets and code size tests" -q + call :runsub 11 testoutstudy "Test with Study Override" -q -s +goto :eof + +:do12 +if %jit% EQU 0 ( + echo Test 12 Skipped due to absence of JIT support. + goto :eof +) + call :runsub 12 testout "JIT-specific features (JIT available)" -q +goto :eof + +:do13 +if %jit% EQU 1 ( + echo Test 13 Skipped due to presence of JIT support. + goto :eof +) + call :runsub 13 testout "JIT-specific features (JIT not available)" -q +goto :eof + +:do14 +if NOT %bits% EQU 8 ( + echo Test 14 Skipped when running 16/32-bit tests. + goto :eof +) + copy /Y %srcdir%\testdata\saved16 testsaved16 + copy /Y %srcdir%\testdata\saved32 testsaved32 + call :runsub 14 testout "Specials for the basic 8-bit library" -q + call :runsub 14 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 14 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do15 +if NOT %bits% EQU 8 ( + echo Test 15 Skipped when running 16/32-bit tests. + goto :eof +) +if %utf% EQU 0 ( + echo Test 15 Skipped due to absence of UTF-%bits% support. + goto :eof +) + call :runsub 15 testout "Specials for the 8-bit library with UTF-%bits% support" -q + call :runsub 15 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 15 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do16 +if NOT %bits% EQU 8 ( + echo Test 16 Skipped when running 16/32-bit tests. + goto :eof +) +if %ucp% EQU 0 ( + echo Test 16 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 16 testout "Specials for the 8-bit library with Unicode propery support" -q + call :runsub 16 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 16 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do17 +if %bits% EQU 8 ( + echo Test 17 Skipped when running 8-bit tests. + goto :eof +) + call :runsub 17 testout "Specials for the basic 16/32-bit library" -q + call :runsub 17 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 17 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do18 +if %bits% EQU 8 ( + echo Test 18 Skipped when running 8-bit tests. + goto :eof +) +if %utf% EQU 0 ( + echo Test 18 Skipped due to absence of UTF-%bits% support. + goto :eof +) + call :runsub 18 testout "Specials for the 16/32-bit library with UTF-%bits% support" -q + call :runsub 18 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 18 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do19 +if %bits% EQU 8 ( + echo Test 19 Skipped when running 8-bit tests. + goto :eof +) +if %ucp% EQU 0 ( + echo Test 19 Skipped due to absence of Unicode property support. + goto :eof +) + call :runsub 19 testout "Specials for the 16/32-bit library with Unicode property support" -q + call :runsub 19 testoutstudy "Test with Study Override" -q -s + if %jit% EQU 1 call :runsub 19 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do20 +if %bits% EQU 8 ( + echo Test 20 Skipped when running 8-bit tests. + goto :eof +) + call :runsub 20 testout "DFA specials for the basic 16/32-bit library" -q -dfa + call :runsub 20 testoutstudy "Test with Study Override" -q -dfa -s +goto :eof + +:do21 +if %bits% EQU 8 ( + echo Test 21 Skipped when running 8-bit tests. + goto :eof +) +if NOT %link_size% EQU 2 ( + echo Test 21 Skipped because link size is not 2. + goto :eof +) +copy /Y %srcdir%\testdata\saved8 testsaved8 +copy /Y %srcdir%\testdata\saved16LE-1 testsaved16LE-1 +copy /Y %srcdir%\testdata\saved16BE-1 testsaved16BE-1 +copy /Y %srcdir%\testdata\saved32LE-1 testsaved32LE-1 +copy /Y %srcdir%\testdata\saved32BE-1 testsaved32BE-1 +call :runsub 21 testout "Reloads for the basic 16/32-bit library" -q +call :runsub 21 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 21 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do22 +if %bits% EQU 8 ( + echo Test 22 Skipped when running 8-bit tests. + goto :eof +) +if %utf% EQU 0 ( + echo Test 22 Skipped due to absence of UTF-%bits% support. + goto :eof +) +if NOT %link_size% EQU 2 ( + echo Test 22 Skipped because link size is not 2. + goto :eof +) +copy /Y %srcdir%\testdata\saved16LE-2 testsaved16LE-2 +copy /Y %srcdir%\testdata\saved16BE-2 testsaved16BE-2 +copy /Y %srcdir%\testdata\saved32LE-2 testsaved32LE-2 +copy /Y %srcdir%\testdata\saved32BE-2 testsaved32BE-2 +call :runsub 22 testout "Reloads for the 16/32-bit library with UTF-16/32 support" -q +call :runsub 22 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 22 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do23 +if NOT %bits% EQU 16 ( + echo Test 23 Skipped when running 8/32-bit tests. + goto :eof +) +call :runsub 23 testout "Specials for the 16-bit library" -q +call :runsub 23 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 23 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do24 +if NOT %bits% EQU 16 ( + echo Test 24 Skipped when running 8/32-bit tests. + goto :eof +) +if %utf% EQU 0 ( + echo Test 24 Skipped due to absence of UTF-%bits% support. + goto :eof +) +call :runsub 24 testout "Specials for the 16-bit library with UTF-16 support" -q +call :runsub 24 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 24 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do25 +if NOT %bits% EQU 32 ( + echo Test 25 Skipped when running 8/16-bit tests. + goto :eof +) +call :runsub 25 testout "Specials for the 32-bit library" -q +call :runsub 25 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 25 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:do26 +if NOT %bits% EQU 32 ( + echo Test 26 Skipped when running 8/16-bit tests. + goto :eof +) +if %utf% EQU 0 ( + echo Test 26 Skipped due to absence of UTF-%bits% support. + goto :eof +) +call :runsub 26 testout "Specials for the 32-bit library with UTF-32 support" -q +call :runsub 26 testoutstudy "Test with Study Override" -q -s +if %jit% EQU 1 call :runsub 26 testoutjit "Test with JIT Override" -q -s+ +goto :eof + +:conferror +@echo. +@echo Either your build is incomplete or you have a configuration error. +@echo. +@echo If configured with cmake and executed via "make test" or the MSVC "RUN_TESTS" +@echo project, pcre_test.bat defines variables and automatically calls RunTest.bat. +@echo For manual testing of all available features, after configuring with cmake +@echo and building, you can run the built pcre_test.bat. For best results with +@echo cmake builds and tests avoid directories with full path names that include +@echo spaces for source or build. +@echo. +@echo Otherwise, if the build dir is in a subdir of the source dir, testdata needed +@echo for input and verification should be found automatically when (from the +@echo location of the the built exes) you call RunTest.bat. By default RunTest.bat +@echo runs all tests compatible with the linked pcre library but it can be given +@echo a test number as an argument. +@echo. +@echo If the build dir is not under the source dir you can either copy your exes +@echo to the source folder or copy RunTest.bat and the testdata folder to the +@echo location of your built exes and then run RunTest.bat. +@echo. +goto :eof -- cgit v1.2.1 From d437c35d9748d33281d270ba2258fef9d90601b8 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 11 Jun 2015 22:54:03 +0400 Subject: Adding a few warning related protected methods in Field and reducing some duplicate code. --- sql/field.cc | 202 +++++++++++++++++++++++++++-------------------------------- sql/field.h | 22 +++++++ 2 files changed, 115 insertions(+), 109 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 31d8b46e587..41213e23bd0 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1307,18 +1307,13 @@ int Field_num::check_int(CHARSET_INFO *cs, const char *str, int length, if (str == int_end || error == MY_ERRNO_EDOM) { ErrConvString err(str, length, cs); - push_warning_printf(get_thd(), Sql_condition::WARN_LEVEL_WARN, - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, - ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - "integer", err.ptr(), field_name, - (ulong) table->in_use->get_stmt_da()-> - current_row_for_warning()); + set_warning_truncated_wrong_value("integer", err.ptr()); return 1; } /* Test if we have garbage at the end of the given string. */ if (test_if_important_data(cs, int_end, str + length)) { - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); return 2; } return 0; @@ -1387,7 +1382,7 @@ bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len, return 0; out_of_range: - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } @@ -1408,12 +1403,12 @@ int Field::warn_if_overflow(int op_result) { if (op_result == E_DEC_OVERFLOW) { - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } if (op_result == E_DEC_TRUNCATED) { - set_warning(Sql_condition::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1); + set_note(WARN_DATA_TRUNCATED, 1); /* We return 0 here as this is not a critical issue */ } return 0; @@ -1739,7 +1734,7 @@ longlong Field::convert_decimal2longlong(const my_decimal *val, { if (val->sign()) { - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); i= 0; *err= 1; } @@ -2047,7 +2042,7 @@ void Field_decimal::overflow(bool negative) uint len=field_length; uchar *to=ptr, filler= '9'; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); if (negative) { if (!unsigned_flag) @@ -2155,7 +2150,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) from++; if (from == end) { - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); is_cuted_fields_incr=1; } else if (*from == '+' || *from == '-') // Found some sign ? @@ -2231,7 +2226,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) for (;from != end && my_isspace(&my_charset_bin, *from); from++) ; if (from != end) // If still something left, warn { - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); is_cuted_fields_incr=1; } } @@ -2409,8 +2404,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) if (tmp_char != '0') // Losing a non zero digit ? { if (!is_cuted_fields_incr) - set_warning(Sql_condition::WARN_LEVEL_WARN, - WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); return 0; } continue; @@ -2432,7 +2426,7 @@ int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs) This is a note, not a warning, as we don't want to abort when we cut decimals in strict mode */ - set_warning(Sql_condition::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1); + set_note(WARN_DATA_TRUNCATED, 1); } return 0; } @@ -2782,7 +2776,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) if (unsigned_flag && decimal_value->sign()) { DBUG_PRINT("info", ("unsigned overflow")); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; decimal_value= &decimal_zero; } @@ -2826,32 +2820,22 @@ int Field_new_decimal::store(const char *from, uint length, thd->abort_on_warning) { ErrConvString errmsg(from, length, charset_arg); - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, - ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - "decimal", errmsg.ptr(), field_name, - static_cast(thd->get_stmt_da()-> - current_row_for_warning())); + set_warning_truncated_wrong_value("decimal", errmsg.ptr()); DBUG_RETURN(err); } switch (err) { case E_DEC_TRUNCATED: - set_warning(Sql_condition::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1); + set_note(WARN_DATA_TRUNCATED, 1); break; case E_DEC_OVERFLOW: - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); set_value_on_overflow(&decimal_value, decimal_value.sign()); break; case E_DEC_BAD_NUM: { ErrConvString errmsg(from, length, charset_arg); - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, - ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - "decimal", errmsg.ptr(), field_name, - static_cast(thd->get_stmt_da()-> - current_row_for_warning())); + set_warning_truncated_wrong_value("decimal", errmsg.ptr()); my_decimal_set_zero(&decimal_value); break; } @@ -3158,13 +3142,13 @@ int Field_tiny::store(double nr) if (nr < 0.0) { *ptr=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 255.0) { *ptr= (uchar) 255; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3175,13 +3159,13 @@ int Field_tiny::store(double nr) if (nr < -128.0) { *ptr= (uchar) -128; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 127.0) { *ptr=127; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3201,13 +3185,13 @@ int Field_tiny::store(longlong nr, bool unsigned_val) if (nr < 0 && !unsigned_val) { *ptr= 0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if ((ulonglong) nr > (ulonglong) 255) { *ptr= (char) 255; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3220,13 +3204,13 @@ int Field_tiny::store(longlong nr, bool unsigned_val) if (nr < -128) { *ptr= (char) -128; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 127) { *ptr=127; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3337,13 +3321,13 @@ int Field_short::store(double nr) if (nr < 0) { res=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) UINT_MAX16) { res=(int16) UINT_MAX16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3354,13 +3338,13 @@ int Field_short::store(double nr) if (nr < (double) INT_MIN16) { res=INT_MIN16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX16) { res=INT_MAX16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3382,13 +3366,13 @@ int Field_short::store(longlong nr, bool unsigned_val) if (nr < 0L && !unsigned_val) { res=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if ((ulonglong) nr > (ulonglong) UINT_MAX16) { res=(int16) UINT_MAX16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3402,13 +3386,13 @@ int Field_short::store(longlong nr, bool unsigned_val) if (nr < INT_MIN16) { res=INT_MIN16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (longlong) INT_MAX16) { res=INT_MAX16; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3525,14 +3509,14 @@ int Field_medium::store(double nr) if (nr < 0) { int3store(ptr,0); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (double) (long) (1L << 24)) { uint32 tmp=(uint32) (1L << 24)-1L; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3544,14 +3528,14 @@ int Field_medium::store(double nr) { long tmp=(long) INT_MIN24; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX24) { long tmp=(long) INT_MAX24; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3571,14 +3555,14 @@ int Field_medium::store(longlong nr, bool unsigned_val) if (nr < 0 && !unsigned_val) { int3store(ptr,0); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if ((ulonglong) nr >= (ulonglong) (long) (1L << 24)) { long tmp= (long) (1L << 24)-1L; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3593,14 +3577,14 @@ int Field_medium::store(longlong nr, bool unsigned_val) { long tmp= (long) INT_MIN24; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (longlong) INT_MAX24) { long tmp=(long) INT_MAX24; int3store(ptr,tmp); - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3722,7 +3706,7 @@ int Field_long::store(double nr) else if (nr > (double) UINT_MAX32) { res= UINT_MAX32; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -3744,7 +3728,7 @@ int Field_long::store(double nr) res=(int32) (longlong) nr; } if (error) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); int4store(ptr,res); return error; @@ -3790,7 +3774,7 @@ int Field_long::store(longlong nr, bool unsigned_val) res=(int32) nr; } if (error) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); int4store(ptr,res); return error; @@ -3889,7 +3873,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) tmp= cs->cset->strntoull10rnd(cs,from,len,unsigned_flag,&end,&error); if (error == MY_ERRNO_ERANGE) { - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (get_thd()->count_cuted_fields && @@ -3911,7 +3895,7 @@ int Field_longlong::store(double nr) res= double_to_longlong(nr, unsigned_flag, &error); if (error) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); int8store(ptr,res); return error; @@ -3932,7 +3916,7 @@ int Field_longlong::store(longlong nr, bool unsigned_val) if (unsigned_flag != unsigned_val) { nr= unsigned_flag ? (ulonglong) 0 : (ulonglong) LONGLONG_MAX; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } } @@ -4046,8 +4030,7 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs) if (error || (!len || ((uint) (end-from) != len && get_thd()->count_cuted_fields))) { - set_warning(Sql_condition::WARN_LEVEL_WARN, - (error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1); + set_warning(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED, 1); error= error ? 1 : 2; } Field_float::store(nr); @@ -4063,7 +4046,7 @@ int Field_float::store(double nr) unsigned_flag, FLT_MAX); if (error) { - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); if (error < 0) // Wrong double value { error= 1; @@ -4234,8 +4217,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs) if (error || (!len || ((uint) (end-from) != len && get_thd()->count_cuted_fields))) { - set_warning(Sql_condition::WARN_LEVEL_WARN, - (error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1); + set_warning(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED, 1); error= error ? 1 : 2; } Field_double::store(nr); @@ -4251,7 +4233,7 @@ int Field_double::store(double nr) unsigned_flag, DBL_MAX); if (error) { - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); if (error < 0) // Wrong double value { error= 1; @@ -4612,7 +4594,7 @@ int Field_timestamp::store_TIME_with_warning(THD *thd, MYSQL_TIME *l_time, if (MYSQL_TIME_WARN_HAVE_WARNINGS(was_cut) || !have_smth_to_conv) { error= 1; - set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, + set_datetime_warning(WARN_DATA_TRUNCATED, str, MYSQL_TIMESTAMP_DATETIME, 1); } else if (MYSQL_TIME_WARN_HAVE_NOTES(was_cut)) @@ -4630,7 +4612,7 @@ int Field_timestamp::store_TIME_with_warning(THD *thd, MYSQL_TIME *l_time, conversion_error= ER_WARN_DATA_OUT_OF_RANGE; if (conversion_error) { - set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, conversion_error, + set_datetime_warning(conversion_error, str, MYSQL_TIMESTAMP_DATETIME, !error); error= 1; } @@ -5128,7 +5110,7 @@ void Field_temporal::set_warnings(Sql_condition::enum_warning_level trunc_level, set_datetime_warning(trunc_level, WARN_DATA_TRUNCATED, str, mysql_type_to_time_type(type()), 1); if (was_cut & MYSQL_TIME_WARN_OUT_OF_RANGE) - set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, + set_datetime_warning(ER_WARN_DATA_OUT_OF_RANGE, str, mysql_type_to_time_type(type()), 1); } @@ -5656,7 +5638,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs) error == MY_ERRNO_ERANGE) { *ptr=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } if (get_thd()->count_cuted_fields && @@ -5699,7 +5681,7 @@ int Field_year::store(longlong nr, bool unsigned_val) if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155) { *ptr= 0; - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } if (nr != 0 || field_length != 4) // 0000 -> 0; 00 -> 2000 @@ -5720,8 +5702,7 @@ int Field_year::store_time_dec(MYSQL_TIME *ltime, uint dec) if (Field_year::store(ltime->year, 0)) return 1; - set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, - &str, ltime->time_type, 1); + set_datetime_warning(WARN_DATA_TRUNCATED, &str, ltime->time_type, 1); return 0; } @@ -6281,31 +6262,21 @@ bool Field_datetimef::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) TRUE - If an error happened */ -static bool -check_string_copy_error(Field_str *field, - const char *well_formed_error_pos, - const char *cannot_convert_error_pos, - const char *end, - CHARSET_INFO *cs) +bool +Field_longstr::check_string_copy_error(const char *well_formed_error_pos, + const char *cannot_convert_error_pos, + const char *end, + CHARSET_INFO *cs) { const char *pos; char tmp[32]; - THD *thd; - - thd= field->get_thd(); if (!(pos= well_formed_error_pos) && !(pos= cannot_convert_error_pos)) return FALSE; convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6); - - push_warning_printf(thd, - Sql_condition::WARN_LEVEL_WARN, - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, - ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), - "string", tmp, field->field_name, - thd->get_stmt_da()->current_row_for_warning()); + set_warning_truncated_wrong_value("string", tmp); return TRUE; } @@ -6340,14 +6311,14 @@ Field_longstr::report_if_important_data(const char *pstr, const char *end, if (test_if_important_data(field_charset, pstr, end)) { if (thd->abort_on_warning) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1); + set_warning(ER_DATA_TOO_LONG, 1); else - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); return 2; } else if (count_spaces) { /* If we lost only spaces then produce a NOTE, not a WARNING */ - set_warning(Sql_condition::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1); + set_note(WARN_DATA_TRUNCATED, 1); return 2; } } @@ -6382,7 +6353,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) field_length-copy_length, field_charset->pad_char); - if (check_string_copy_error(this, well_formed_error_pos, + if (check_string_copy_error(well_formed_error_pos, cannot_convert_error_pos, from + length, cs)) return 2; @@ -6413,9 +6384,9 @@ int Field_str::store(double nr) if (error) { if (get_thd()->abort_on_warning) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1); + set_warning(ER_DATA_TOO_LONG, 1); else - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); } return store(buff, length, &my_charset_numeric); } @@ -6891,7 +6862,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) else int2store(ptr, copy_length); - if (check_string_copy_error(this, well_formed_error_pos, + if (check_string_copy_error(well_formed_error_pos, cannot_convert_error_pos, from + length, cs)) return 2; @@ -7417,7 +7388,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) tmp= value.ptr(); bmove(ptr+packlength,(uchar*) &tmp,sizeof(char*)); - if (check_string_copy_error(this, well_formed_error_pos, + if (check_string_copy_error(well_formed_error_pos, cannot_convert_error_pos, from + length, cs)) return 2; @@ -7983,13 +7954,13 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) if (err || end != from+length || tmp > typelib->count) { tmp=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); } if (!get_thd()->count_cuted_fields) err= 0; } else - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); } store_type((ulonglong) tmp); return err; @@ -8008,7 +7979,7 @@ int Field_enum::store(longlong nr, bool unsigned_val) int error= 0; if ((ulonglong) nr > typelib->count || nr == 0) { - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); if (nr != 0 || get_thd()->count_cuted_fields) { nr= 0; @@ -8161,11 +8132,11 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs) tmp > (ulonglong) (((longlong) 1 << typelib->count) - (longlong) 1)) { tmp=0; - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); } } else if (got_warning) - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); store_type(tmp); return err; } @@ -8185,7 +8156,7 @@ int Field_set::store(longlong nr, bool unsigned_val) if ((ulonglong) nr > max_nr) { nr&= max_nr; - set_warning(Sql_condition::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + set_warning(WARN_DATA_TRUNCATED, 1); error=1; } store_type((ulonglong) nr); @@ -8537,9 +8508,9 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) set_rec_bits((1 << bit_len) - 1, bit_ptr, bit_ofs, bit_len); memset(ptr, 0xff, bytes_in_rec); if (get_thd()->really_abort_on_warning()) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1); + set_warning(ER_DATA_TOO_LONG, 1); else - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } /* delta is >= -1 here */ @@ -8974,9 +8945,9 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) if (bits) *ptr&= ((1 << bits) - 1); /* set first uchar */ if (get_thd()->really_abort_on_warning()) - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1); + set_warning(ER_DATA_TOO_LONG, 1); else - set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } bzero(ptr, delta); @@ -10119,6 +10090,19 @@ void Field::set_datetime_warning(Sql_condition::enum_warning_level level, } +void Field::set_warning_truncated_wrong_value(const char *type, + const char *value) +{ + THD *thd= get_thd(); + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, + ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), + type, value, field_name, + static_cast(thd->get_stmt_da()-> + current_row_for_warning())); +} + + /* @brief Return possible keys for a field diff --git a/sql/field.h b/sql/field.h index a52bd01395a..8352bf14def 100644 --- a/sql/field.h +++ b/sql/field.h @@ -885,14 +885,32 @@ public: virtual int set_time() { return 1; } bool set_warning(Sql_condition::enum_warning_level, unsigned int code, int cuted_increment) const; +protected: + bool set_warning(unsigned int code, int cuted_increment) const + { + return set_warning(Sql_condition::WARN_LEVEL_WARN, code, cuted_increment); + } + bool set_note(unsigned int code, int cuted_increment) const + { + return set_warning(Sql_condition::WARN_LEVEL_NOTE, code, cuted_increment); + } void set_datetime_warning(Sql_condition::enum_warning_level, uint code, const ErrConv *str, timestamp_type ts_type, int cuted_increment); + void set_datetime_warning(uint code, + const ErrConv *str, timestamp_type ts_type, + int cuted_increment) + { + set_datetime_warning(Sql_condition::WARN_LEVEL_WARN, code, str, ts_type, + cuted_increment); + } + void set_warning_truncated_wrong_value(const char *type, const char *value); inline bool check_overflow(int op_result) { return (op_result == E_DEC_OVERFLOW); } int warn_if_overflow(int op_result); +public: void set_table_name(String *alias) { table_name= &alias->Ptr; @@ -1139,6 +1157,10 @@ class Field_longstr :public Field_str protected: int report_if_important_data(const char *ptr, const char *end, bool count_spaces); + bool check_string_copy_error(const char *well_formed_error_pos, + const char *cannot_convert_error_pos, + const char *end, + CHARSET_INFO *cs); public: Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, -- cgit v1.2.1 From e2879ac52654253a41b16c3b174b03dda5742886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sun, 14 Jun 2015 08:14:28 +0300 Subject: MDEV-7881: InnoDB Logfile size - misleading error message Added test case to show that correct error message is printed when log file size is too small for big blob. --- .../r/innodb_blob_unrecoverable_crash.result | 23 +++++++++ .../innodb/t/innodb_blob_unrecoverable_crash.test | 55 ++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result create mode 100644 mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result new file mode 100644 index 00000000000..9f6b7ca6a23 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result @@ -0,0 +1,23 @@ +call mtr.add_suppression("InnoDB: The total blob data length"); +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a FROM t1; +a +1 +2 +3 +4 +5 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test new file mode 100644 index 00000000000..16fb570737d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test @@ -0,0 +1,55 @@ +--source include/not_embedded.inc +--source include/not_crashrep.inc +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: The total blob data length"); + +let $old_max_allowed_packet = `select @@max_allowed_packet`; +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); +connection big_packets; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; + +# Insert a few rows (it doesn't really matter how many). These transactions +# are committed once they are acked, so they should not be lost. +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); + +# The BLOB insert will fail, and should disappear. However all data committed +# up to this point should not be lost. +start transaction; +--replace_regex /\(> [0-9]*\)/(> ####)/ +--error ER_TOO_BIG_ROWSIZE +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Connection default: +connection default; + +# We should see (1,2,3,4,5) here. +SELECT a FROM t1; + +# Clean up. +DROP TABLE t1; + +--disable_query_log +eval set global max_allowed_packet = $old_max_allowed_packet; +--enable_query_log -- cgit v1.2.1 From 36bf482db10bb8418e3f59a7fd078e929e7916de Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 14 Jun 2015 15:51:34 +0200 Subject: MDEV-8285 compile fails under Mac OS X 10.6.8 due to use of strnlen #include where strnlen() is used --- storage/connect/xobject.cpp | 1 + strings/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/connect/xobject.cpp b/storage/connect/xobject.cpp index 92bf039c07c..a6faebf3c2b 100644 --- a/storage/connect/xobject.cpp +++ b/storage/connect/xobject.cpp @@ -11,6 +11,7 @@ /* Include mariaDB header file. */ /***********************************************************************/ #include "my_global.h" +#include "m_string.h" /***********************************************************************/ /* Include required application header files */ diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 6291d107d90..1e364bc951b 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -26,7 +26,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c my_strchr.c strcont.c strappend.c) IF(NOT HAVE_STRNLEN) - # OSX does not have strnlen + # OSX below 10.7 did not have strnlen SET(STRINGS_SOURCES ${STRINGS_SOURCES} strnlen.c) ENDIF() # Avoid dependencies on perschema data defined in mysys -- cgit v1.2.1 From fc31e3114b2538d152194d17ff0f0439db565634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sun, 14 Jun 2015 17:29:58 +0300 Subject: MDEV-8179: Absent progress report for operations on InnoDB tables Add progress info on InnoDB/XtraDB row0merge phase. Note that we do not know exact number of rounds merge sort needs at start thus also progress report might not be accurate. --- storage/innobase/row/row0merge.cc | 13 +++++++++++++ storage/xtradb/row/row0merge.cc | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 88600256a2a..284081d4b0c 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -2216,6 +2216,7 @@ row_merge( /* Copy the last blocks, if there are any. */ while (foffs0 < ihalf) { + if (UNIV_UNLIKELY(trx_is_interrupted(trx))) { return(DB_INTERRUPTED); } @@ -2232,6 +2233,7 @@ row_merge( ut_ad(foffs0 == ihalf); while (foffs1 < file->offset) { + if (trx_is_interrupted(trx)) { return(DB_INTERRUPTED); } @@ -2291,6 +2293,7 @@ row_merge_sort( { const ulint half = file->offset / 2; ulint num_runs; + ulint cur_run = 0; ulint* run_offset; dberr_t error = DB_SUCCESS; DBUG_ENTER("row_merge_sort"); @@ -2314,11 +2317,19 @@ row_merge_sort( of file marker). Thus, it must be at least one block. */ ut_ad(file->offset > 0); + thd_progress_init(trx->mysql_thd, num_runs); + /* Merge the runs until we have one big run */ do { + cur_run++; + error = row_merge(trx, dup, file, block, tmpfd, &num_runs, run_offset); + /* Report progress of merge sort to MySQL for + show processlist progress field */ + thd_progress_report(trx->mysql_thd, cur_run, num_runs); + if (error != DB_SUCCESS) { break; } @@ -2328,6 +2339,8 @@ row_merge_sort( mem_free(run_offset); + thd_progress_end(trx->mysql_thd); + DBUG_RETURN(error); } diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index ccecf22bf61..2d378eba119 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -2105,6 +2105,7 @@ row_merge( /* Copy the last blocks, if there are any. */ while (foffs0 < ihalf) { + if (UNIV_UNLIKELY(trx_is_interrupted(trx))) { return(DB_INTERRUPTED); } @@ -2121,6 +2122,7 @@ row_merge( ut_ad(foffs0 == ihalf); while (foffs1 < file->offset) { + if (trx_is_interrupted(trx)) { return(DB_INTERRUPTED); } @@ -2180,6 +2182,7 @@ row_merge_sort( { const ulint half = file->offset / 2; ulint num_runs; + ulint cur_run = 0; ulint* run_offset; dberr_t error = DB_SUCCESS; DBUG_ENTER("row_merge_sort"); @@ -2203,11 +2206,19 @@ row_merge_sort( of file marker). Thus, it must be at least one block. */ ut_ad(file->offset > 0); + thd_progress_init(trx->mysql_thd, num_runs); + /* Merge the runs until we have one big run */ do { + cur_run++; + error = row_merge(trx, dup, file, block, tmpfd, &num_runs, run_offset); + /* Report progress of merge sort to MySQL for + show processlist progress field */ + thd_progress_report(trx->mysql_thd, cur_run, num_runs); + if (error != DB_SUCCESS) { break; } @@ -2217,6 +2228,8 @@ row_merge_sort( mem_free(run_offset); + thd_progress_end(trx->mysql_thd); + DBUG_RETURN(error); } -- cgit v1.2.1 From 196528eb42c843ca800b81be27a79c7c4806a057 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 14 Jun 2015 18:54:13 +0500 Subject: MDEV-8212 alter table - failing to ADD PRIMARY KEY IF NOT EXISTS when existing index of same as column name. The default name for the primary key is rather 'PRIMARY' instead of the indexed column name. --- mysql-test/r/alter_table.result | 11 +++++++++++ mysql-test/t/alter_table.test | 8 ++++++++ sql/sql_table.cc | 17 +++++++++++------ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 4ae7c7aea93..0975a5aa101 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1488,6 +1488,17 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( +`transaction_id` int(11) NOT NULL DEFAULT '0', +KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`transaction_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't # identify correct column name. # diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 416c73009e6..cbb73bbb3d4 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1326,6 +1326,14 @@ SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; + +DROP TABLE t1; + --echo # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't --echo # identify correct column name. --echo # diff --git a/sql/sql_table.cc b/sql/sql_table.cc index da2a220d3f1..6ee0e9bc871 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5859,12 +5859,17 @@ drop_create_field: /* let us check the name of the first key part. */ if ((keyname= key->name.str) == NULL) { - List_iterator part_it(key->columns); - Key_part_spec *kp; - if ((kp= part_it++)) - keyname= kp->field_name.str; - if (keyname == NULL) - continue; + if (key->type == Key::PRIMARY) + keyname= primary_key_name; + else + { + List_iterator part_it(key->columns); + Key_part_spec *kp; + if ((kp= part_it++)) + keyname= kp->field_name.str; + if (keyname == NULL) + continue; + } } if (key->type != Key::FOREIGN_KEY) { -- cgit v1.2.1 From 4c251af97b5d9fa733fd29434f89c08552098e60 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Mon, 15 Jun 2015 08:23:26 +0200 Subject: MDEV-8316: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "any_slave_sql_running" Fix a handful of "return" that should be DBUG_RETURN in sql/rpl_mi.cc. --- sql/rpl_mi.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index ddc502210ce..47490648a43 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -966,7 +966,7 @@ bool Master_info_index::init_all_master_info() { /* Master_info is not in HASH; Add it */ if (master_info_index->add_master_info(mi, FALSE)) - return 1; + DBUG_RETURN(1); succ_num++; unlock_slave_threads(mi); } @@ -999,7 +999,7 @@ bool Master_info_index::init_all_master_info() /* Master_info was not registered; add it */ if (master_info_index->add_master_info(mi, FALSE)) - return 1; + DBUG_RETURN(1); succ_num++; unlock_slave_threads(mi); @@ -1096,7 +1096,7 @@ Master_info_index::get_master_info(LEX_STRING *connection_name, mysql_mutex_assert_owner(&LOCK_active_mi); if (!this) // master_info_index is set to NULL on server shutdown - return NULL; + DBUG_RETURN(NULL); /* Make name lower case for comparison */ res= strmake(buff, connection_name->str, connection_name->length); @@ -1251,7 +1251,7 @@ bool Master_info_index::give_error_if_slave_running() DBUG_ENTER("give_error_if_slave_running"); mysql_mutex_assert_owner(&LOCK_active_mi); if (!this) // master_info_index is set to NULL on server shutdown - return TRUE; + DBUG_RETURN(TRUE); for (uint i= 0; i< master_info_hash.records; ++i) { @@ -1282,7 +1282,7 @@ bool Master_info_index::any_slave_sql_running() { DBUG_ENTER("any_slave_sql_running"); if (!this) // master_info_index is set to NULL on server shutdown - return TRUE; + DBUG_RETURN(TRUE); for (uint i= 0; i< master_info_hash.records; ++i) { -- cgit v1.2.1 From 43e45226722d69c3a1e6fa59381f068fe7418253 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 15 Jun 2015 11:04:06 +0400 Subject: MDEV-8205 timediff returns null when comparing decimal time to time string value --- mysql-test/r/func_time.result | 42 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/func_time.test | 41 +++++++++++++++++++++++++++++++++++++++++ sql-common/my_time.c | 12 ++---------- 3 files changed, 85 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 950d2e72666..b660df15fed 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -2701,3 +2701,45 @@ id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10 17 NULL NULL NULL NULL 18 2010-10-13 2010-10-03 2010-10-03 734413 DROP TABLE t1; +# +# Start of 10.0 tests +# +# +# MDEV-8205 timediff returns null when comparing decimal time to time string value +# +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-01:00:00 -01:00:00.000 -01:00:00.000 -01:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-25:00:00 -25:00:00.000 -25:00:00.000 -25:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-769:00:00 -769:00:00.000 -769:00:00.000 -769:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-838:59:59 -838:59:59.999 -838:59:59.999 -838:59:59.999 +Warnings: +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +# +# End of 10.0 tests +# diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2b189765bbc..3fb87e91b17 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1649,3 +1649,44 @@ INSERT INTO t1 VALUES (17, NULL); INSERT INTO t1 VALUES (18, '2010-10-13'); SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; DROP TABLE t1; + + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-8205 timediff returns null when comparing decimal time to time string value +--echo # + +# 1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; + +# 1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; + +# 1M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; + +# 2M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 6a011df795a..28757a2c96c 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1314,16 +1314,8 @@ int number_to_time(my_bool neg, ulonglong nr, ulong sec_part, MYSQL_TIME *ltime, int *was_cut) { if (nr > 9999999 && nr < 99991231235959ULL && neg == 0) - { - if (number_to_datetime(nr, sec_part, ltime, - TIME_INVALID_DATES, was_cut) < 0) - return -1; - - ltime->year= ltime->month= ltime->day= 0; - ltime->time_type= MYSQL_TIMESTAMP_TIME; - *was_cut= MYSQL_TIME_NOTE_TRUNCATED; - return 0; - } + return number_to_datetime(nr, sec_part, ltime, + TIME_INVALID_DATES, was_cut) < 0 ? -1 : 0; *was_cut= 0; ltime->year= ltime->month= ltime->day= 0; -- cgit v1.2.1 From aad8667f8a4e2a26652494b29ee6c12824865ac8 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 15 Jun 2015 11:11:42 +0400 Subject: Committing a change into r/type_time_hires.result forgotten in the previous commit for MDEV-8205. --- mysql-test/r/type_time_hires.result | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mysql-test/r/type_time_hires.result b/mysql-test/r/type_time_hires.result index 8096785dcc1..2620dac0794 100644 --- a/mysql-test/r/type_time_hires.result +++ b/mysql-test/r/type_time_hires.result @@ -115,7 +115,6 @@ NULL delete from t1 where a < 20110101; select * from t1; a -01:02:13.3332 NULL create table t2 select * from t1; create table t3 like t1; @@ -135,12 +134,11 @@ Warnings: Note 1265 Data truncated for column 'a' at row 1 select a, a+0, a-1, a*1, a/2 from t1; a a+0 a-1 a*1 a/2 -01:02:13.3332 10213.3332 10212.3332 10213.3332 5106.66660000 NULL NULL NULL NULL NULL 14:15:16.2222 141516.2222 141515.2222 141516.2222 70758.11110000 select max(a), min(a), sum(a), avg(a) from t1; max(a) min(a) sum(a) avg(a) -14:15:16.2222 01:02:13.3332 151729.5554 75864.77770000 +14:15:16.2222 14:15:16.2222 141516.2222 141516.22220000 create table t2 select a, a+0, a-1, a*1, a/2 from t1; create table t3 select max(a), min(a), sum(a), avg(a) from t1; show create table t2; -- cgit v1.2.1 From a453a280403faef3377db0441560c57b4ae1235b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 14 Jun 2015 17:34:08 +0200 Subject: MDEV-8083 MTR is broken on systems with IPv6 disabled disable IPv6 globally in mysql-test, only use it in dedicated IPv6 tests (where it is enabled per-test) --- mysql-test/include/default_mysqld.cnf | 1 + mysql-test/suite/perfschema/t/socket_instances_func-master.opt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 33881666b57..04321475691 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -31,6 +31,7 @@ debug-no-sync # Retry bind as this may fail on busy server port-open-timeout=10 +bind-address=127.0.0.1 log-bin-trust-function-creators=1 key_buffer_size= 1M diff --git a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt index ab6ca1731f5..b12a8b3b70e 100644 --- a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt +++ b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt @@ -1 +1 @@ ---skip-name-resolve +--skip-name-resolve --bind-address=* -- cgit v1.2.1 From 2a0f086728888e1f6a5e137412cb2e62e544c68c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 14 Jun 2015 17:38:30 +0200 Subject: don't scream when auto-selected IPv6 is not available when --bind-address is not specificed explicitly (or set to '*') MariaDB tries all wildcard addresses. Print a warning (not an error) if a socket cannot be created for some of them. Still print an error if a socket cannot be created for an address that a user has specified expicitly with --bind-address. --- sql/mysqld.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e05c0b60f77..a9fc94eadbb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2423,10 +2423,11 @@ static MYSQL_SOCKET activate_tcp_port(uint port) if (mysql_socket_getfd(ip_sock) == INVALID_SOCKET) { - sql_print_error("Failed to create a socket for %s '%s': errno: %d.", - (a->ai_family == AF_INET) ? "IPv4" : "IPv6", - (const char *) ip_addr, - (int) socket_errno); + sql_print_message_func func= real_bind_addr_str ? sql_print_error + : sql_print_warning; + func("Failed to create a socket for %s '%s': errno: %d.", + (a->ai_family == AF_INET) ? "IPv4" : "IPv6", + (const char *) ip_addr, (int) socket_errno); } else { -- cgit v1.2.1 From 3288f2667a9be08df77b139f5b538a32f2972b63 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 14 Jun 2015 20:19:05 +0200 Subject: include the correct IPv6 check in perfschema tests --- mysql-test/include/have_ipv6.inc | 20 -------------------- .../t/hostcache_ipv6_addrinfo_again_allow.test | 2 +- .../t/hostcache_ipv6_addrinfo_again_deny.test | 2 +- .../t/hostcache_ipv6_addrinfo_bad_allow.test | 2 +- .../t/hostcache_ipv6_addrinfo_bad_deny.test | 2 +- .../t/hostcache_ipv6_addrinfo_good_allow.test | 2 +- .../t/hostcache_ipv6_addrinfo_good_deny.test | 2 +- .../t/hostcache_ipv6_addrinfo_noname_allow.test | 2 +- .../t/hostcache_ipv6_addrinfo_noname_deny.test | 2 +- .../perfschema/t/hostcache_ipv6_auth_plugin.test | 2 +- .../suite/perfschema/t/hostcache_ipv6_blocked.test | 2 +- .../suite/perfschema/t/hostcache_ipv6_max_con.test | 2 +- .../t/hostcache_ipv6_nameinfo_again_allow.test | 2 +- .../t/hostcache_ipv6_nameinfo_again_deny.test | 2 +- .../t/hostcache_ipv6_nameinfo_noname_allow.test | 2 +- .../t/hostcache_ipv6_nameinfo_noname_deny.test | 2 +- .../suite/perfschema/t/hostcache_ipv6_passwd.test | 2 +- .../suite/perfschema/t/hostcache_ipv6_ssl.test | 2 +- 18 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 mysql-test/include/have_ipv6.inc diff --git a/mysql-test/include/have_ipv6.inc b/mysql-test/include/have_ipv6.inc deleted file mode 100644 index 752dd0db53e..00000000000 --- a/mysql-test/include/have_ipv6.inc +++ /dev/null @@ -1,20 +0,0 @@ -# Check if ipv6 is available. -# ---disable_query_log ---disable_result_log ---disable_abort_on_error -connect (checkcon123456789,::1,root,,test); -if($mysql_errno) -{ - skip No IPv6 support; -} -connection default; -if(!$mysql_errno) -{ - disconnect checkcon123456789; -} ---enable_abort_on_error ---enable_result_log ---enable_query_log -# end check - diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test index ae58f4089ed..c1af8516b79 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test index 8c408b160a6..a5ac18a8818 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test index ccd0ae383ee..ae1de4f032e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test index 72d5d693a1b..361a3ce6bd1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test index c253e4b77d5..9dbd682681e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '192.0.2.4' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test index 096b4b11eb4..4836dfc2d36 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test index 575dab9a337..b675b5089a8 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test index f6e5fa118df..9ce4fb926e6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test index 0e0e900405a..9c8168e573a 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc --source include/have_plugin_auth.inc diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test index 9d4707dc027..cd78087dad1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test index d4adc3e0d00..0ced79544a3 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test index e396dbbad3c..983a6e80ff7 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test index cc7eb0b566f..3cdd87e4cf9 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test index 80f07989212..3a30030413f 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test index 0d11e433b58..054940e4a02 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test index 6dd33b9bb5b..811c5c51c26 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test index 2b30a4eaf41..c11922624c6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state -- cgit v1.2.1 From a1170303772cd083290fd09ebbd3f0d6dd305299 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 14 Jun 2015 18:46:02 +0200 Subject: MDEV-8131 MariaDB does not build on hurd-i386: plugin/auth_dialog/dialog.c:172:20: error: 'RTLD_DEFAULT' undeclared define _GNU_SORUCE before including dlfcn.h --- plugin/auth_dialog/dialog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/auth_dialog/dialog.c b/plugin/auth_dialog/dialog.c index 0fa5ab93a35..da937ea6e91 100644 --- a/plugin/auth_dialog/dialog.c +++ b/plugin/auth_dialog/dialog.c @@ -25,6 +25,8 @@ the answer back to the server. No encryption is involved, the answers are sent in clear text. */ +#define _GNU_SOURCE 1 /* for RTLD_DEFAULT */ + #include #include #include -- cgit v1.2.1 From 02421aa284bf3ff2c56c0e8d58defe2846824d19 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 15 Jun 2015 18:07:41 +0500 Subject: MDEV-7871 Tests fail massively on "Assertion `status_var.memory_used == 0'" when run with --ps --embedded. As the MF_THREAD_SPECIFIC was introduced to the alloc_root's and the prealloc added to the statement::mem_root and statement::result.alloc, we have to adjust the embedded server to it. The preallocation was removed for the embedded server as it makes no sence for it. The msyqltest should free the statement inside the proper thead to make the memory statistics happy. --- client/mysqltest.cc | 29 +++++++++++++++++++++++------ libmysql/libmysql.c | 14 ++++++++++++-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 697229f9439..e28d56e9187 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -839,6 +839,7 @@ static void handle_no_active_connection(struct st_command* command, #define EMB_END_CONNECTION 3 #define EMB_PREPARE_STMT 4 #define EMB_EXECUTE_STMT 5 +#define EMB_CLOSE_STMT 6 /* workaround for MySQL BUG#57491 */ #undef MY_WME @@ -887,6 +888,9 @@ pthread_handler_t connection_thread(void *arg) case EMB_EXECUTE_STMT: cn->result= mysql_stmt_execute(cn->stmt); break; + case EMB_CLOSE_STMT: + cn->result= mysql_stmt_close(cn->stmt); + break; default: DBUG_ASSERT(0); } @@ -984,6 +988,17 @@ static int do_stmt_execute(struct st_connection *cn) } +static int do_stmt_close(struct st_connection *cn) +{ + /* The cn->stmt is already set. */ + if (!cn->has_thread) + return mysql_stmt_close(cn->stmt); + signal_connection_thd(cn, EMB_CLOSE_STMT); + wait_query_thread_done(cn); + return cn->result; +} + + static void emb_close_connection(struct st_connection *cn) { if (!cn->has_thread) @@ -1019,6 +1034,7 @@ static void init_connection_thd(struct st_connection *cn) #define do_read_query_result(cn) mysql_read_query_result(cn->mysql) #define do_stmt_prepare(cn, q, q_len) mysql_stmt_prepare(cn->stmt, q, q_len) #define do_stmt_execute(cn) mysql_stmt_execute(cn->stmt) +#define do_stmt_close(cn) mysql_stmt_close(cn->stmt) #endif /*EMBEDDED_LIBRARY*/ @@ -1378,11 +1394,11 @@ void close_connections() DBUG_ENTER("close_connections"); for (--next_con; next_con >= connections; --next_con) { + if (next_con->stmt) + do_stmt_close(next_con); #ifdef EMBEDDED_LIBRARY emb_close_connection(next_con); #endif - if (next_con->stmt) - mysql_stmt_close(next_con->stmt); next_con->stmt= 0; mysql_close(next_con->mysql); next_con->mysql= 0; @@ -5635,7 +5651,11 @@ void do_close_connection(struct st_command *command) con->mysql->net.vio = 0; } } -#else +#endif /*!EMBEDDED_LIBRARY*/ + if (con->stmt) + do_stmt_close(con); + con->stmt= 0; +#ifdef EMBEDDED_LIBRARY /* As query could be still executed in a separate theread we need to check if the query's thread was finished and probably wait @@ -5643,9 +5663,6 @@ void do_close_connection(struct st_command *command) */ emb_close_connection(con); #endif /*EMBEDDED_LIBRARY*/ - if (con->stmt) - mysql_stmt_close(con->stmt); - con->stmt= 0; mysql_close(con->mysql); con->mysql= 0; diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e0919deae60..3af4a032e5b 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1508,6 +1508,12 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) memory */ +#ifdef EMBEDDED_LIBRARY +#define STMT_INIT_PREALLOC(S) 0 +#else +#define STMT_INIT_PREALLOC(S) S +#endif /*EMBEDDED_LIBRARY*/ + MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql) { @@ -1526,8 +1532,10 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(NULL); } - init_alloc_root(&stmt->mem_root, 2048, 2048, MYF(MY_THREAD_SPECIFIC)); - init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&stmt->mem_root, 2048, STMT_INIT_PREALLOC(2048), + MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&stmt->result.alloc, 4096, STMT_INIT_PREALLOC(4096), + MYF(MY_THREAD_SPECIFIC)); stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS); mysql->stmts= list_add(mysql->stmts, &stmt->list); stmt->list.data= stmt; @@ -1544,6 +1552,8 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(stmt); } +#undef STMT_INIT_PREALLOC + /* Prepare server side statement with query. -- cgit v1.2.1 From b988553c527d0fb55a561dc3a1308052d94ae2a4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 15 Jun 2015 15:42:14 +0200 Subject: MDEV-7771 missing client plugins when mariadb-shared is not installed Put client plugins into -common rpm, not -shared. Because they're needed for * all clients that link with shared libmysqlclient (-shared) * our clients from -client rpm, they're statically linked (-client) * the server that acts as a replication slave (-server) --- cmake/cpack_rpm.cmake | 3 ++- plugin/auth_dialog/CMakeLists.txt | 2 +- plugin/auth_examples/CMakeLists.txt | 2 +- plugin/win_auth_client/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index bd8d96154b2..b936e2c0983 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -21,11 +21,12 @@ SET(CPACK_COMPONENT_MANPAGESCLIENT_GROUP "client") SET(CPACK_COMPONENT_README_GROUP "server") SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared") SET(CPACK_COMPONENT_COMMON_GROUP "common") +SET(CPACK_COMPONENT_CLIENTPLUGINS_GROUP "common") SET(CPACK_COMPONENT_COMPAT_GROUP "compat") SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts SupportFiles Development ManPagesDevelopment ManPagesTest Readme ManPagesClient Test - Common Client SharedLibraries) + Common Client SharedLibraries ClientPlugins) SET(CPACK_RPM_PACKAGE_NAME "MariaDB") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}") diff --git a/plugin/auth_dialog/CMakeLists.txt b/plugin/auth_dialog/CMakeLists.txt index 9b4dcfd99bf..a23518060be 100644 --- a/plugin/auth_dialog/CMakeLists.txt +++ b/plugin/auth_dialog/CMakeLists.txt @@ -15,4 +15,4 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(dialog dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c - MODULE_ONLY COMPONENT SharedLibraries) + MODULE_ONLY COMPONENT ClientPlugins) diff --git a/plugin/auth_examples/CMakeLists.txt b/plugin/auth_examples/CMakeLists.txt index f6c2b637067..c7b7e5be62d 100644 --- a/plugin/auth_examples/CMakeLists.txt +++ b/plugin/auth_examples/CMakeLists.txt @@ -30,4 +30,4 @@ MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY COMPONENT Test) MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c - MODULE_ONLY COMPONENT SharedLibraries) + MODULE_ONLY COMPONENT ClientPlugins) diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt index 75ee55117bd..5d72d24d6ad 100644 --- a/plugin/win_auth_client/CMakeLists.txt +++ b/plugin/win_auth_client/CMakeLists.txt @@ -29,7 +29,7 @@ IF(WIN32) MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS} LINK_LIBRARIES Secur32 - MODULE_ONLY COMPONENT SharedLibraries) + MODULE_ONLY COMPONENT ClientPlugins) #IF(MSVC) # INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) -- cgit v1.2.1 From 909f7607018e644754a2c41b791b44b25a05e8fb Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 15 Jun 2015 15:37:14 +0400 Subject: MDEV-5309 - RENAME TABLE does not check for existence of the table's engine When RENAME TABLE is executed, it apparently does not check whether the engine is available (unlike ALTER TABLE .. RENAME, which does). It means that if the engine in question was not loaded on some reason, the table might become unusable, since the engine won't know about the change. With this patch RENAME TABLE fails if storage engine is not available. --- mysql-test/r/plugin.result | 10 ++++++++++ mysql-test/t/plugin.test | 11 +++++++++++ sql/sql_rename.cc | 9 ++------- sql/sql_table.cc | 4 ++-- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 630f0141d18..3a2bb32b13d 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -321,3 +321,13 @@ UNUSABLE uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; plugin_name +# +# MDEV-5309 - RENAME TABLE does not check for existence of the table's +# engine +# +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +UNINSTALL PLUGIN example; +RENAME TABLE t1 TO t2; +ERROR 42S02: Table 'test.t1' doesn't exist +DROP TABLE t1; diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 0655aff9fc9..9c2a408b612 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -252,3 +252,14 @@ select plugin_name from information_schema.plugins where plugin_library like 'ha uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; + +--echo # +--echo # MDEV-5309 - RENAME TABLE does not check for existence of the table's +--echo # engine +--echo # +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +UNINSTALL PLUGIN example; +--error ER_NO_SUCH_TABLE +RENAME TABLE t1 TO t2; +DROP TABLE t1; diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 2c17898f07c..6496e1895fb 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -238,7 +238,6 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name, { int rc= 1; handlerton *hton; - bool new_exists, old_exists; const char *new_alias, *old_alias; DBUG_ENTER("do_rename"); @@ -254,17 +253,13 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name, } DBUG_ASSERT(new_alias); - new_exists= ha_table_exists(thd, new_db, new_alias); - - if (new_exists) + if (ha_table_exists(thd, new_db, new_alias)) { my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias); DBUG_RETURN(1); // This can't be skipped } - old_exists= ha_table_exists(thd, ren_table->db, old_alias, &hton); - - if (old_exists) + if (ha_table_exists(thd, ren_table->db, old_alias, &hton) && hton) { DBUG_ASSERT(!thd->locked_tables_mode); tdc_remove_table(thd, TDC_RT_REMOVE_ALL, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6ee0e9bc871..c31a6fd6474 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5149,6 +5149,7 @@ mysql_rename_table(handlerton *base, const char *old_db, ulonglong save_bits= thd->variables.option_bits; int length; DBUG_ENTER("mysql_rename_table"); + DBUG_ASSERT(base); DBUG_PRINT("enter", ("old: '%s'.'%s' new: '%s'.'%s'", old_db, old_name, new_db, new_name)); @@ -5156,8 +5157,7 @@ mysql_rename_table(handlerton *base, const char *old_db, if (flags & NO_FK_CHECKS) thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS; - file= (base == NULL ? 0 : - get_new_handler((TABLE_SHARE*) 0, thd->mem_root, base)); + file= get_new_handler((TABLE_SHARE*) 0, thd->mem_root, base); build_table_filename(from, sizeof(from) - 1, old_db, old_name, "", flags & FN_FROM_IS_TMP); -- cgit v1.2.1 From 139ba26dbacc37858d7746b8ef53a7330f9a8fcc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 10:57:05 +0200 Subject: 5.6.25 --- storage/innobase/api/api0api.cc | 15 ++ storage/innobase/buf/buf0buf.cc | 277 ++++++++++++++++++++-------------- storage/innobase/buf/buf0checksum.cc | 11 +- storage/innobase/handler/ha_innodb.cc | 37 +++-- storage/innobase/include/api0api.h | 10 +- storage/innobase/include/os0file.h | 8 +- storage/innobase/include/page0page.h | 16 +- storage/innobase/os/os0file.cc | 11 +- storage/innobase/page/page0page.cc | 44 +++++- storage/innobase/page/page0zip.cc | 97 ++++++++++-- storage/innobase/row/row0mysql.cc | 95 ++++-------- storage/innobase/srv/srv0start.cc | 34 ++++- storage/innobase/sync/sync0arr.cc | 8 +- storage/innobase/trx/trx0sys.cc | 4 - storage/innobase/trx/trx0trx.cc | 5 +- 15 files changed, 436 insertions(+), 236 deletions(-) diff --git a/storage/innobase/api/api0api.cc b/storage/innobase/api/api0api.cc index d5dd9ca0081..ad8a29d7439 100644 --- a/storage/innobase/api/api0api.cc +++ b/storage/innobase/api/api0api.cc @@ -595,6 +595,21 @@ ib_trx_begin( return(static_cast(trx)); } + +/*****************************************************************//** +Check if transaction is read_only +@return transaction read_only status */ +UNIV_INTERN +ib_u32_t +ib_trx_read_only( +/*=============*/ + ib_trx_t ib_trx) /*!< in: trx handle */ +{ + trx_t* trx = (trx_t*) ib_trx; + + return(trx->read_only); +} + /*****************************************************************//** Get the transaction's state. @return transaction state */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index a676d70a992..311e3326f2b 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -486,6 +486,79 @@ buf_page_is_zeroes( return(true); } +/** Checks if the page is in crc32 checksum format. +@param[in] read_buf database page +@param[in] checksum_field1 new checksum field +@param[in] checksum_field2 old checksum field +@return true if the page is in crc32 checksum format */ +UNIV_INLINE +bool +buf_page_is_checksum_valid_crc32( + const byte* read_buf, + ulint checksum_field1, + ulint checksum_field2) +{ + ib_uint32_t crc32 = buf_calc_page_crc32(read_buf); + + return(checksum_field1 == crc32 && checksum_field2 == crc32); +} + +/** Checks if the page is in innodb checksum format. +@param[in] read_buf database page +@param[in] checksum_field1 new checksum field +@param[in] checksum_field2 old checksum field +@return true if the page is in innodb checksum format */ +UNIV_INLINE +bool +buf_page_is_checksum_valid_innodb( + const byte* read_buf, + ulint checksum_field1, + ulint checksum_field2) +{ + /* There are 2 valid formulas for + checksum_field2 (old checksum field) which algo=innodb could have + written to the page: + + 1. Very old versions of InnoDB only stored 8 byte lsn to the + start and the end of the page. + + 2. Newer InnoDB versions store the old formula checksum + (buf_calc_page_old_checksum()). */ + + if (checksum_field2 != mach_read_from_4(read_buf + FIL_PAGE_LSN) + && checksum_field2 != buf_calc_page_old_checksum(read_buf)) { + return(false); + } + + /* old field is fine, check the new field */ + + /* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id + (always equal to 0), to FIL_PAGE_SPACE_OR_CHKSUM */ + + if (checksum_field1 != 0 + && checksum_field1 != buf_calc_page_new_checksum(read_buf)) { + return(false); + } + + return(true); +} + +/** Checks if the page is in none checksum format. +@param[in] read_buf database page +@param[in] checksum_field1 new checksum field +@param[in] checksum_field2 old checksum field +@return true if the page is in none checksum format */ +UNIV_INLINE +bool +buf_page_is_checksum_valid_none( + const byte* read_buf, + ulint checksum_field1, + ulint checksum_field2) +{ + return(checksum_field1 == checksum_field2 + && checksum_field1 == BUF_NO_CHECKSUM_MAGIC); +} + /********************************************************************//** Checks if a page is corrupt. @return TRUE if corrupted */ @@ -501,8 +574,6 @@ buf_page_is_corrupted( { ulint checksum_field1; ulint checksum_field2; - ibool crc32_inited = FALSE; - ib_uint32_t crc32 = ULINT32_UNDEFINED; if (!zip_size && memcmp(read_buf + FIL_PAGE_LSN + 4, @@ -582,148 +653,121 @@ buf_page_is_corrupted( return(FALSE); } - switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) { - case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: - - crc32 = buf_calc_page_crc32(read_buf); - - return(checksum_field1 != crc32 || checksum_field2 != crc32); - - case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: - - return(checksum_field1 - != buf_calc_page_new_checksum(read_buf) - || checksum_field2 - != buf_calc_page_old_checksum(read_buf)); - - case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: + DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); ); - return(checksum_field1 != BUF_NO_CHECKSUM_MAGIC - || checksum_field2 != BUF_NO_CHECKSUM_MAGIC); + ulint page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET); + ulint space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID); + const srv_checksum_algorithm_t curr_algo = + static_cast(srv_checksum_algorithm); + switch (curr_algo) { case SRV_CHECKSUM_ALGORITHM_CRC32: - case SRV_CHECKSUM_ALGORITHM_INNODB: - /* There are 3 valid formulas for - checksum_field2 (old checksum field): - - 1. Very old versions of InnoDB only stored 8 byte lsn to the - start and the end of the page. - - 2. InnoDB versions before MySQL 5.6.3 store the old formula - checksum (buf_calc_page_old_checksum()). - - 3. InnoDB versions 5.6.3 and newer with - innodb_checksum_algorithm=strict_crc32|crc32 store CRC32. */ - - /* since innodb_checksum_algorithm is not strict_* allow - any of the algos to match for the old field */ - - if (checksum_field2 - != mach_read_from_4(read_buf + FIL_PAGE_LSN) - && checksum_field2 != BUF_NO_CHECKSUM_MAGIC) { - - /* The checksum does not match any of the - fast to check. First check the selected algorithm - for writing checksums because we assume that the - chance of it matching is higher. */ - - if (srv_checksum_algorithm - == SRV_CHECKSUM_ALGORITHM_CRC32) { - - crc32 = buf_calc_page_crc32(read_buf); - crc32_inited = TRUE; - - if (checksum_field2 != crc32 - && checksum_field2 - != buf_calc_page_old_checksum(read_buf)) { + case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: - return(TRUE); - } - } else { - ut_ad(srv_checksum_algorithm - == SRV_CHECKSUM_ALGORITHM_INNODB); + if (buf_page_is_checksum_valid_crc32(read_buf, + checksum_field1, checksum_field2)) { + return(FALSE); + } - if (checksum_field2 - != buf_calc_page_old_checksum(read_buf)) { + if (buf_page_is_checksum_valid_none(read_buf, + checksum_field1, checksum_field2)) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_NONE, + space_id, page_no); + } - crc32 = buf_calc_page_crc32(read_buf); - crc32_inited = TRUE; + return(FALSE); + } - if (checksum_field2 != crc32) { - return(TRUE); - } - } + if (buf_page_is_checksum_valid_innodb(read_buf, + checksum_field1, checksum_field2)) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_INNODB, + space_id, page_no); } - } - /* old field is fine, check the new field */ + return(FALSE); + } - /* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id - (always equal to 0), to FIL_PAGE_SPACE_OR_CHKSUM */ + return(TRUE); - if (checksum_field1 != 0 - && checksum_field1 != BUF_NO_CHECKSUM_MAGIC) { + case SRV_CHECKSUM_ALGORITHM_INNODB: + case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: - /* The checksum does not match any of the - fast to check. First check the selected algorithm - for writing checksums because we assume that the - chance of it matching is higher. */ + if (buf_page_is_checksum_valid_innodb(read_buf, + checksum_field1, checksum_field2)) { + return(FALSE); + } - if (srv_checksum_algorithm - == SRV_CHECKSUM_ALGORITHM_CRC32) { + if (buf_page_is_checksum_valid_none(read_buf, + checksum_field1, checksum_field2)) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_NONE, + space_id, page_no); + } - if (!crc32_inited) { - crc32 = buf_calc_page_crc32(read_buf); - crc32_inited = TRUE; - } + return(FALSE); + } - if (checksum_field1 != crc32 - && checksum_field1 - != buf_calc_page_new_checksum(read_buf)) { + if (buf_page_is_checksum_valid_crc32(read_buf, + checksum_field1, checksum_field2)) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_CRC32, + space_id, page_no); + } - return(TRUE); - } - } else { - ut_ad(srv_checksum_algorithm - == SRV_CHECKSUM_ALGORITHM_INNODB); + return(FALSE); + } - if (checksum_field1 - != buf_calc_page_new_checksum(read_buf)) { + return(TRUE); - if (!crc32_inited) { - crc32 = buf_calc_page_crc32( - read_buf); - crc32_inited = TRUE; - } + case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: - if (checksum_field1 != crc32) { - return(TRUE); - } - } - } + if (buf_page_is_checksum_valid_none(read_buf, + checksum_field1, checksum_field2)) { + return(FALSE); } - /* If CRC32 is stored in at least one of the fields, then the - other field must also be CRC32 */ - if (crc32_inited - && ((checksum_field1 == crc32 - && checksum_field2 != crc32) - || (checksum_field1 != crc32 - && checksum_field2 == crc32))) { + if (buf_page_is_checksum_valid_crc32(read_buf, + checksum_field1, checksum_field2)) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_CRC32, + space_id, page_no); + return(FALSE); + } - return(TRUE); + if (buf_page_is_checksum_valid_innodb(read_buf, + checksum_field1, checksum_field2)) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_INNODB, + space_id, page_no); + return(FALSE); } - break; + return(TRUE); + case SRV_CHECKSUM_ALGORITHM_NONE: /* should have returned FALSE earlier */ - ut_error; + break; /* no default so the compiler will emit a warning if new enum is added and not handled here */ } - DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); ); - + ut_error; return(FALSE); } @@ -1673,6 +1717,9 @@ page_found: goto page_found; } + /* The maximum number of purge threads should never exceed + BUF_POOL_WATCH_SIZE. So there is no way for purge thread + instance to hold a watch when setting another watch. */ for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) { bpage = &buf_pool->watch[i]; diff --git a/storage/innobase/buf/buf0checksum.cc b/storage/innobase/buf/buf0checksum.cc index ec79bbe6be9..5289cd8cef2 100644 --- a/storage/innobase/buf/buf0checksum.cc +++ b/storage/innobase/buf/buf0checksum.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -138,14 +138,17 @@ buf_checksum_algorithm_name( { switch (algo) { case SRV_CHECKSUM_ALGORITHM_CRC32: - case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: return("crc32"); + case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: + return("strict_crc32"); case SRV_CHECKSUM_ALGORITHM_INNODB: - case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: return("innodb"); + case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: + return("strict_innodb"); case SRV_CHECKSUM_ALGORITHM_NONE: - case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: return("none"); + case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: + return("strict_none"); } ut_error; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 691d4373054..ed9317f5a5d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -482,7 +482,8 @@ ib_cb_t innodb_api_cb[] = { (ib_cb_t) ib_get_idx_field_name, (ib_cb_t) ib_trx_get_start_time, (ib_cb_t) ib_cfg_bk_commit_interval, - (ib_cb_t) ib_cursor_stmt_begin + (ib_cb_t) ib_cursor_stmt_begin, + (ib_cb_t) ib_trx_read_only }; /*************************************************************//** @@ -10509,6 +10510,13 @@ ha_innobase::estimate_rows_upper_bound() prebuilt->trx->op_info = ""; + /* Set num_rows less than MERGEBUFF to simulate the case where we do + not have enough space to merge the externally sorted file blocks. */ + DBUG_EXECUTE_IF("set_num_rows_lt_MERGEBUFF", + estimate = 2; + DBUG_SET("-d,set_num_rows_lt_MERGEBUFF"); + ); + DBUG_RETURN((ha_rows) estimate); } @@ -10779,7 +10787,6 @@ ha_innobase::info_low( dict_table_t* ib_table; ha_rows rec_per_key; ib_uint64_t n_rows; - char path[FN_REFLEN]; os_file_stat_t stat_info; DBUG_ENTER("info"); @@ -10837,17 +10844,6 @@ ha_innobase::info_low( "returning various info to MySQL"; } - my_snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, ib_table->name, reg_ext); - - unpack_filename(path,path); - - /* Note that we do not know the access time of the table, - nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ - - if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) { - stats.create_time = (ulong) stat_info.ctime; - } } if (flag & HA_STATUS_VARIABLE) { @@ -10982,6 +10978,7 @@ ha_innobase::info_low( if (flag & HA_STATUS_CONST) { ulong i; + char path[FN_REFLEN]; /* Verify the number of index in InnoDB and MySQL matches up. If prebuilt->clust_index_was_generated holds, InnoDB defines GEN_CLUST_INDEX internally */ @@ -11105,6 +11102,20 @@ ha_innobase::info_low( if (!(flag & HA_STATUS_NO_LOCK)) { dict_table_stats_unlock(ib_table, RW_S_LATCH); } + + my_snprintf(path, sizeof(path), "%s/%s%s", + mysql_data_home, + table->s->normalized_path.str, + reg_ext); + + unpack_filename(path,path); + + /* Note that we do not know the access time of the table, + nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ + + if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) { + stats.create_time = (ulong) stat_info.ctime; + } } if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { diff --git a/storage/innobase/include/api0api.h b/storage/innobase/include/api0api.h index d77d691becc..e4c9c941de5 100644 --- a/storage/innobase/include/api0api.h +++ b/storage/innobase/include/api0api.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -494,6 +494,14 @@ ib_trx_state( /*=========*/ ib_trx_t ib_trx); /*!< in: trx handle */ + +/*****************************************************************//** +Check if the transaction is read_only */ +ib_u32_t +ib_trx_read_only( +/*=============*/ + ib_trx_t ib_trx); /*!< in: trx handle */ + /*****************************************************************//** Release the resources of the transaction. If the transaction was selected as a victim by InnoDB and rolled back then use this function diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index ad9b6a9ac10..246a4f277e2 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -383,10 +383,10 @@ to original un-instrumented file I/O APIs */ enum os_file_type_t { OS_FILE_TYPE_UNKNOWN = 0, - OS_FILE_TYPE_FILE, /* regular file */ + OS_FILE_TYPE_FILE, /* regular file + (or a character/block device) */ OS_FILE_TYPE_DIR, /* directory */ - OS_FILE_TYPE_LINK, /* symbolic link */ - OS_FILE_TYPE_BLOCK /* block device */ + OS_FILE_TYPE_LINK /* symbolic link */ }; /* Maximum path string length in bytes when referring to tables with in the diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index b572f7abb49..0bd0a009cae 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1110,6 +1110,20 @@ page_find_rec_with_heap_no( const rec_t* page_find_rec_max_not_deleted( const page_t* page); + +/** Issue a warning when the checksum that is stored in the page is valid, +but different than the global setting innodb_checksum_algorithm. +@param[in] current_algo current checksum algorithm +@param[in] page_checksum page valid checksum +@param[in] space_id tablespace id +@param[in] page_no page number */ +void +page_warn_strict_checksum( + srv_checksum_algorithm_t curr_algo, + srv_checksum_algorithm_t page_checksum, + ulint space_id, + ulint page_no); + #ifdef UNIV_MATERIALIZE #undef UNIV_INLINE #define UNIV_INLINE UNIV_INLINE_ORIGINAL diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index fb7e8ca1eb7..8c8b033a39a 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -3187,8 +3187,9 @@ os_file_get_status( stat_info->type = OS_FILE_TYPE_LINK; break; case S_IFBLK: - stat_info->type = OS_FILE_TYPE_BLOCK; - break; + /* Handle block device as regular file. */ + case S_IFCHR: + /* Handle character device as regular file. */ case S_IFREG: stat_info->type = OS_FILE_TYPE_FILE; break; @@ -3197,8 +3198,8 @@ os_file_get_status( } - if (check_rw_perm && (stat_info->type == OS_FILE_TYPE_FILE - || stat_info->type == OS_FILE_TYPE_BLOCK)) { + if (check_rw_perm && stat_info->type == OS_FILE_TYPE_FILE) { + int fh; int access; diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index bd5fb36af8f..cb2381df48c 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -2811,3 +2811,45 @@ page_find_rec_max_not_deleted( } return(prev_rec); } + +/** Issue a warning when the checksum that is stored in the page is valid, +but different than the global setting innodb_checksum_algorithm. +@param[in] current_algo current checksum algorithm +@param[in] page_checksum page valid checksum +@param[in] space_id tablespace id +@param[in] page_no page number */ +void +page_warn_strict_checksum( + srv_checksum_algorithm_t curr_algo, + srv_checksum_algorithm_t page_checksum, + ulint space_id, + ulint page_no) +{ + srv_checksum_algorithm_t curr_algo_nonstrict; + switch (curr_algo) { + case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: + curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_CRC32; + break; + case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: + curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_INNODB; + break; + case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: + curr_algo_nonstrict = SRV_CHECKSUM_ALGORITHM_NONE; + break; + default: + ut_error; + } + + ib_logf(IB_LOG_LEVEL_WARN, + "innodb_checksum_algorithm is set to \"%s\"" + " but the page [page id: space=" ULINTPF "," + " page number=" ULINTPF "] contains a valid checksum \"%s\"." + " Accepting the page as valid. Change innodb_checksum_algorithm" + " to \"%s\" to silently accept such pages or rewrite all pages" + " so that they contain \"%s\" checksum.", + buf_checksum_algorithm_name(curr_algo), + space_id, page_no, + buf_checksum_algorithm_name(page_checksum), + buf_checksum_algorithm_name(curr_algo_nonstrict), + buf_checksum_algorithm_name(curr_algo_nonstrict)); +} diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index dd1dc763b90..e5176148edd 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4889,6 +4889,10 @@ page_zip_verify_checksum( stored = static_cast(mach_read_from_4( static_cast(data) + FIL_PAGE_SPACE_OR_CHKSUM)); + ulint page_no = mach_read_from_4(static_cast (data) + FIL_PAGE_OFFSET); + ulint space_id = mach_read_from_4(static_cast + (data) + FIL_PAGE_SPACE_ID); + #if FIL_PAGE_LSN % 8 #error "FIL_PAGE_LSN must be 64 bit aligned" #endif @@ -4909,40 +4913,113 @@ page_zip_verify_checksum( return(TRUE); } + const srv_checksum_algorithm_t curr_algo = + static_cast(srv_checksum_algorithm); + + if (curr_algo == SRV_CHECKSUM_ALGORITHM_NONE) { + return(TRUE); + } + calc = static_cast(page_zip_calc_checksum( - data, size, static_cast( - srv_checksum_algorithm))); + data, size, curr_algo)); if (stored == calc) { return(TRUE); } - switch ((srv_checksum_algorithm_t) srv_checksum_algorithm) { + switch (curr_algo) { case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: - case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: - case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: - return(stored == calc); case SRV_CHECKSUM_ALGORITHM_CRC32: + if (stored == BUF_NO_CHECKSUM_MAGIC) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_NONE, + space_id, page_no); + } + return(TRUE); } - crc32 = calc; + innodb = static_cast(page_zip_calc_checksum( data, size, SRV_CHECKSUM_ALGORITHM_INNODB)); + + if (stored == innodb) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_INNODB, + space_id, page_no); + } + + return(TRUE); + } + break; + case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: case SRV_CHECKSUM_ALGORITHM_INNODB: + if (stored == BUF_NO_CHECKSUM_MAGIC) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_NONE, + space_id, page_no); + } + + return(TRUE); + } + + crc32 = static_cast(page_zip_calc_checksum( + data, size, SRV_CHECKSUM_ALGORITHM_CRC32)); + + if (stored == crc32) { + if (curr_algo + == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_CRC32, + space_id, page_no); + } + return(TRUE); } + + break; + case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: + crc32 = static_cast(page_zip_calc_checksum( data, size, SRV_CHECKSUM_ALGORITHM_CRC32)); - innodb = calc; + + if (stored == crc32) { + page_warn_strict_checksum( + curr_algo, SRV_CHECKSUM_ALGORITHM_CRC32, + space_id, page_no); + + return(TRUE); + } + + innodb = static_cast(page_zip_calc_checksum( + data, size, SRV_CHECKSUM_ALGORITHM_INNODB)); + + if (stored == innodb) { + page_warn_strict_checksum( + curr_algo, + SRV_CHECKSUM_ALGORITHM_INNODB, + space_id, page_no); + return(TRUE); + } + break; case SRV_CHECKSUM_ALGORITHM_NONE: - return(TRUE); + ut_error; /* no default so the compiler will emit a warning if new enum is added and not handled here */ } - return(stored == crc32 || stored == innodb); + return(FALSE); } diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index c53fa530b42..3140e18a0b1 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1322,18 +1322,14 @@ row_insert_for_mysql( mem_analyze_corruption(prebuilt); ut_error; - } else if (srv_created_new_raw || srv_force_recovery) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" + } else if (srv_force_recovery) { + fputs("InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" "InnoDB: mysqld and edit my.cnf so that" - " newraw is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", + "InnoDB: innodb_force_... is removed.\n", stderr); - if(srv_force_recovery) { - return(DB_READ_ONLY); - } - return(DB_ERROR); + + return(DB_READ_ONLY); } trx->op_info = "inserting"; @@ -1715,18 +1711,14 @@ row_update_for_mysql( ut_error; } - if (UNIV_UNLIKELY(srv_created_new_raw || srv_force_recovery)) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" + if (UNIV_UNLIKELY(srv_force_recovery)) { + fputs("InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", + "InnoDB: mysqld and edit my.cnf so that" + "InnoDB: innodb_force_... is removed.\n", stderr); - if(srv_force_recovery) { - return(DB_READ_ONLY); - } - return(DB_ERROR); + + return(DB_READ_ONLY); } DEBUG_SYNC_C("innodb_row_update_for_mysql_begin"); @@ -2204,22 +2196,6 @@ row_create_table_for_mysql( goto err_exit; ); - if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized:\n" - "InnoDB: we do not allow database modifications" - " by the user.\n" - "InnoDB: Shut down mysqld and edit my.cnf so that newraw" - " is replaced with raw.\n", stderr); -err_exit: - dict_mem_table_free(table); - - if (commit) { - trx_commit_for_mysql(trx); - } - - return(DB_ERROR); - } - trx->op_info = "creating table"; if (row_mysql_is_system_table(table->name)) { @@ -2230,7 +2206,19 @@ err_exit: "InnoDB: MySQL system tables must be" " of the MyISAM type!\n", table->name); - goto err_exit; + +#ifndef DBUG_OFF +err_exit: +#endif /* !DBUG_OFF */ + dict_mem_table_free(table); + + if (commit) { + trx_commit_for_mysql(trx); + } + + trx->op_info = ""; + + return(DB_ERROR); } trx_start_if_not_started_xa(trx); @@ -3280,16 +3268,6 @@ row_truncate_table_for_mysql( ut_ad(table); - if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized:\n" - "InnoDB: we do not allow database modifications" - " by the user.\n" - "InnoDB: Shut down mysqld and edit my.cnf so that newraw" - " is replaced with raw.\n", stderr); - - return(DB_ERROR); - } - if (dict_table_is_discarded(table)) { return(DB_TABLESPACE_DELETED); } else if (table->ibd_file_missing) { @@ -3769,16 +3747,6 @@ row_drop_table_for_mysql( ut_a(name != NULL); - if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized:\n" - "InnoDB: we do not allow database modifications" - " by the user.\n" - "InnoDB: Shut down mysqld and edit my.cnf so that newraw" - " is replaced with raw.\n", stderr); - - DBUG_RETURN(DB_ERROR); - } - /* The table name is prefixed with the database name and a '/'. Certain table names starting with 'innodb_' have their special meaning regardless of the database name. Thus, we need to @@ -4791,19 +4759,16 @@ row_rename_table_for_mysql( ut_a(new_name != NULL); ut_ad(trx->state == TRX_STATE_ACTIVE); - if (srv_created_new_raw || srv_force_recovery) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" + if (srv_force_recovery) { + fputs("InnoDB: innodb_force_recovery is on: we do not allow\n" "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", + "InnoDB: mysqld and edit my.cnf so that" + "InnoDB: innodb_force_... is removed.\n", stderr); - if(srv_force_recovery) { - err = DB_READ_ONLY; - } + err = DB_READ_ONLY; goto funct_exit; + } else if (row_mysql_is_system_table(new_name)) { fprintf(stderr, diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index fde0d1552be..d888d13d863 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. @@ -222,8 +222,8 @@ srv_file_check_mode( /* Note: stat.rw_perm is only valid of files */ - if (stat.type == OS_FILE_TYPE_FILE - || stat.type == OS_FILE_TYPE_BLOCK) { + if (stat.type == OS_FILE_TYPE_FILE) { + if (!stat.rw_perm) { ib_logf(IB_LOG_LEVEL_ERROR, @@ -420,14 +420,18 @@ srv_parse_data_file_paths_and_sizes( && *(str + 1) == 'e' && *(str + 2) == 'w') { str += 3; - (srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW; + /* Initialize new raw device only during bootstrap */ + (srv_data_file_is_raw_partition)[i] = + opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW; } if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') { str += 3; + /* Initialize new raw device only during bootstrap */ if ((srv_data_file_is_raw_partition)[i] == 0) { - (srv_data_file_is_raw_partition)[i] = SRV_OLD_RAW; + (srv_data_file_is_raw_partition)[i] = + opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW; } } @@ -880,6 +884,24 @@ open_or_create_data_files( return(DB_ERROR); } + + const char* check_msg; + check_msg = fil_read_first_page( + files[i], FALSE, &flags, &space, +#ifdef UNIV_LOG_ARCHIVE + min_arch_log_no, max_arch_log_no, +#endif /* UNIV_LOG_ARCHIVE */ + min_flushed_lsn, max_flushed_lsn); + + /* If first page is valid, don't overwrite DB. + It prevents overwriting DB when mysql_install_db + starts mysqld multiple times during bootstrap. */ + if (check_msg == NULL) { + + srv_created_new_raw = FALSE; + ret = FALSE; + } + } else if (srv_data_file_is_raw_partition[i] == SRV_OLD_RAW) { srv_start_raw_disk_in_use = TRUE; @@ -3025,9 +3047,9 @@ innobase_shutdown_for_mysql(void) ibuf_close(); log_shutdown(); - lock_sys_close(); trx_sys_file_format_close(); trx_sys_close(); + lock_sys_close(); /* We don't create these mutexes in RO mode because we don't create the temp files that the cover. */ diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index d56d328d8c3..4feea36a253 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -1036,8 +1036,8 @@ sync_array_print_info_low( ulint count = 0; fprintf(file, - "OS WAIT ARRAY INFO: reservation count %ld\n", - (long) arr->res_count); + "OS WAIT ARRAY INFO: reservation count " ULINTPF "\n", + arr->res_count); for (i = 0; count < arr->n_reserved; ++i) { sync_cell_t* cell; @@ -1132,7 +1132,7 @@ sync_array_print( } fprintf(file, - "OS WAIT ARRAY INFO: signal count %ld\n", (long) sg_count); + "OS WAIT ARRAY INFO: signal count " ULINTPF "\n", sg_count); } diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 52830a77b12..5eb3cef46c1 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -1187,8 +1187,6 @@ trx_sys_close(void) /* Free the double write data structures. */ buf_dblwr_free(); - mutex_enter(&trx_sys->mutex); - ut_a(UT_LIST_GET_LEN(trx_sys->ro_trx_list) == 0); /* Only prepared transactions may be left in the system. Free them. */ @@ -1228,8 +1226,6 @@ trx_sys_close(void) ut_a(UT_LIST_GET_LEN(trx_sys->rw_trx_list) == 0); ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0); - mutex_exit(&trx_sys->mutex); - mutex_free(&trx_sys->mutex); mem_free(trx_sys); diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index c2d5c1f7c7f..937a64a0e46 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -303,11 +303,10 @@ trx_free_prepared( /*==============*/ trx_t* trx) /*!< in, own: trx object */ { - ut_ad(mutex_own(&trx_sys->mutex)); - ut_a(trx_state_eq(trx, TRX_STATE_PREPARED)); ut_a(trx->magic_n == TRX_MAGIC_N); + lock_trx_release_locks(trx); trx_undo_free_prepared(trx); assert_trx_in_rw_list(trx); -- cgit v1.2.1 From 3c3724991e4ce802f79a8dbee2f72e3073729f2f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 11:00:33 +0200 Subject: 5.6.25 --- mysql-test/suite/perfschema/include/connection_setup.inc | 2 +- mysql-test/suite/perfschema/include/digest_setup.inc | 2 +- mysql-test/suite/perfschema/include/event_aggregate_setup.inc | 2 +- mysql-test/suite/perfschema/include/no_protocol.inc | 10 ---------- mysql-test/suite/perfschema/include/stage_setup.inc | 2 +- mysql-test/suite/perfschema/include/table_aggregate_setup.inc | 2 +- mysql-test/suite/perfschema/r/threads_mysql.result | 2 +- mysql-test/suite/perfschema/t/digest_null_literal.test | 2 +- mysql-test/suite/perfschema/t/nesting.test | 2 +- mysql-test/suite/perfschema/t/rpl_gtid_func.test | 2 +- mysql-test/suite/perfschema/t/rpl_statements.test | 2 +- .../suite/perfschema/t/socket_summary_by_event_name_func.test | 2 +- .../suite/perfschema/t/socket_summary_by_instance_func.test | 2 +- .../perfschema/t/socket_summary_by_instance_func_win.test | 2 +- mysql-test/suite/perfschema/t/start_server_low_digest.test | 2 +- mysql-test/suite/perfschema/t/statement_digest_long_query.test | 2 +- mysql-test/suite/perfschema/t/unary_digest.test | 2 +- 17 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 mysql-test/suite/perfschema/include/no_protocol.inc diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc index da57b6dd388..a661d43d063 100644 --- a/mysql-test/suite/perfschema/include/connection_setup.inc +++ b/mysql-test/suite/perfschema/include/connection_setup.inc @@ -48,7 +48,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc index ed463f58d04..6efab880d32 100644 --- a/mysql-test/suite/perfschema/include/digest_setup.inc +++ b/mysql-test/suite/perfschema/include/digest_setup.inc @@ -1,5 +1,5 @@ # Making sure not to run when ps-protocol is set. ---source ../include/no_protocol.inc +--source include/no_protocol.inc --echo #################################### --echo # SETUP diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc index 769ba5f8607..ec35e60d463 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc @@ -62,7 +62,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-test/suite/perfschema/include/no_protocol.inc deleted file mode 100644 index 451c22f62e3..00000000000 --- a/mysql-test/suite/perfschema/include/no_protocol.inc +++ /dev/null @@ -1,10 +0,0 @@ -# Tests for the performance schema - -# The file with expected results fits only to a run without -# ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} - diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc index 3558e43652e..639b1df8c02 100644 --- a/mysql-test/suite/perfschema/include/stage_setup.inc +++ b/mysql-test/suite/perfschema/include/stage_setup.inc @@ -24,7 +24,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc index 8efdc8d2f24..522cdb9346d 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc @@ -67,7 +67,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result index 4da857f83fc..6ab0b0641b0 100644 --- a/mysql-test/suite/perfschema/r/threads_mysql.result +++ b/mysql-test/suite/perfschema/r/threads_mysql.result @@ -13,7 +13,7 @@ processlist_user NULL processlist_host NULL processlist_db NULL processlist_command NULL -processlist_info INTERNAL DDL LOG RECOVER IN PROGRESS +processlist_info NULL unified_parent_thread_id NULL role NULL instrumented YES diff --git a/mysql-test/suite/perfschema/t/digest_null_literal.test b/mysql-test/suite/perfschema/t/digest_null_literal.test index a3007ced1e2..91f1eec1f95 100644 --- a/mysql-test/suite/perfschema/t/digest_null_literal.test +++ b/mysql-test/suite/perfschema/t/digest_null_literal.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test index 4535e0e04f7..ea55284c804 100644 --- a/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-test/suite/perfschema/t/nesting.test @@ -5,7 +5,7 @@ # On windows, the socket instrumentation collects an extra "opt" # event, which changes the test output. --source include/not_windows.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --source include/have_QC_Disabled.inc diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test index cdee1be6475..3258425124a 100644 --- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test +++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test @@ -1,6 +1,6 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc -- source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test index 8e719610ba9..09e85dfc30f 100644 --- a/mysql-test/suite/perfschema/t/rpl_statements.test +++ b/mysql-test/suite/perfschema/t/rpl_statements.test @@ -3,7 +3,7 @@ # --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source include/have_binlog_format_mixed.inc --source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test index 1c317cedcf5..095ff30d4f1 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test @@ -26,7 +26,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc # Set this to enable debugging output let $my_socket_debug= 0; diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test index cad6d5cf998..b523b2fe224 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test @@ -36,7 +36,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test index c7ca254d5bb..5b02dccc9e6 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test @@ -38,7 +38,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest.test b/mysql-test/suite/perfschema/t/start_server_low_digest.test index 953f4d31656..6f06def169b 100644 --- a/mysql-test/suite/perfschema/t/start_server_low_digest.test +++ b/mysql-test/suite/perfschema/t/start_server_low_digest.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc USE performance_schema; truncate table events_statements_history_long; diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test index 3969383a6fb..b7ba18ef2cb 100644 --- a/mysql-test/suite/perfschema/t/statement_digest_long_query.test +++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc USE performance_schema; truncate table events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-test/suite/perfschema/t/unary_digest.test index c4583484f36..d8daea70d38 100644 --- a/mysql-test/suite/perfschema/t/unary_digest.test +++ b/mysql-test/suite/perfschema/t/unary_digest.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; -- cgit v1.2.1 From 90849456d794aa6df32554a588da5db8cb15f5aa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 11:04:40 +0200 Subject: 5.6.24-72.2 --- storage/xtradb/api/api0api.cc | 208 +------------------------------- storage/xtradb/dict/dict0boot.cc | 12 +- storage/xtradb/dict/dict0dict.cc | 94 ++++++++++++--- storage/xtradb/dict/dict0load.cc | 3 +- storage/xtradb/dict/dict0mem.cc | 31 ++--- storage/xtradb/fsp/fsp0fsp.cc | 40 +----- storage/xtradb/fts/fts0fts.cc | 111 ++++------------- storage/xtradb/fts/fts0opt.cc | 9 +- storage/xtradb/fts/fts0que.cc | 5 +- storage/xtradb/handler/ha_innodb.cc | 21 +--- storage/xtradb/handler/handler0alter.cc | 2 +- storage/xtradb/handler/i_s.cc | 11 +- storage/xtradb/ibuf/ibuf0ibuf.cc | 5 +- storage/xtradb/include/dict0mem.h | 136 ++++++++++++++++++--- storage/xtradb/include/univ.i | 2 +- storage/xtradb/lock/lock0lock.cc | 4 +- storage/xtradb/log/log0recv.cc | 4 +- storage/xtradb/mtr/mtr0log.cc | 2 +- storage/xtradb/os/os0sync.cc | 20 +-- storage/xtradb/page/page0zip.cc | 6 +- storage/xtradb/pars/pars0pars.cc | 2 +- storage/xtradb/que/que0que.cc | 28 +---- storage/xtradb/row/row0log.cc | 23 +++- storage/xtradb/row/row0merge.cc | 149 ++++++++++++++++++++--- storage/xtradb/row/row0mysql.cc | 71 ++++++----- storage/xtradb/sync/sync0sync.cc | 6 +- 26 files changed, 463 insertions(+), 542 deletions(-) diff --git a/storage/xtradb/api/api0api.cc b/storage/xtradb/api/api0api.cc index 2f5999e9a3a..d5dd9ca0081 100644 --- a/storage/xtradb/api/api0api.cc +++ b/storage/xtradb/api/api0api.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2008, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2008, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -318,35 +318,6 @@ ib_wake_master_thread(void) } } -/*********************************************************************//** -Calculate the max row size of the columns in a cluster index. -@return max row length */ -UNIV_INLINE -ulint -ib_get_max_row_len( -/*===============*/ - dict_index_t* cluster) /*!< in: cluster index */ -{ - ulint i; - ulint max_len = 0; - ulint n_fields = cluster->n_fields; - - /* Add the size of the ordering columns in the - clustered index. */ - for (i = 0; i < n_fields; ++i) { - const dict_col_t* col; - - col = dict_index_get_nth_col(cluster, i); - - /* Use the maximum output size of - mach_write_compressed(), although the encoded - length should always fit in 2 bytes. */ - max_len += dict_col_get_max_size(col); - } - - return(max_len); -} - /*****************************************************************//** Read the columns from a rec into a tuple. */ static @@ -710,120 +681,6 @@ ib_trx_rollback( return(err); } -/*****************************************************************//** -Find an index definition from the index vector using index name. -@return index def. if found else NULL */ -UNIV_INLINE -const ib_index_def_t* -ib_table_find_index( -/*================*/ - ib_vector_t* indexes, /*!< in: vector of indexes */ - const char* name) /*!< in: index name */ -{ - ulint i; - - for (i = 0; i < ib_vector_size(indexes); ++i) { - const ib_index_def_t* index_def; - - index_def = (ib_index_def_t*) ib_vector_get(indexes, i); - - if (innobase_strcasecmp(name, index_def->name) == 0) { - return(index_def); - } - } - - return(NULL); -} - -/*****************************************************************//** -Get the InnoDB internal precise type from the schema column definition. -@return precise type in api format */ -UNIV_INLINE -ulint -ib_col_get_prtype( -/*==============*/ - const ib_col_t* ib_col) /*!< in: column definition */ -{ - ulint prtype = 0; - - if (ib_col->ib_col_attr & IB_COL_UNSIGNED) { - prtype |= DATA_UNSIGNED; - - ut_a(ib_col->ib_col_type == IB_INT); - } - - if (ib_col->ib_col_attr & IB_COL_NOT_NULL) { - prtype |= DATA_NOT_NULL; - } - - return(prtype); -} - -/*****************************************************************//** -Get the InnoDB internal main type from the schema column definition. -@return column main type */ -UNIV_INLINE -ulint -ib_col_get_mtype( -/*==============*/ - const ib_col_t* ib_col) /*!< in: column definition */ -{ - /* Note: The api0api.h types should map directly to - the internal numeric codes. */ - return(ib_col->ib_col_type); -} - -/*****************************************************************//** -Find a column in the the column vector with the same name. -@return col. def. if found else NULL */ -UNIV_INLINE -const ib_col_t* -ib_table_find_col( -/*==============*/ - const ib_vector_t* cols, /*!< in: column list head */ - const char* name) /*!< in: column name to find */ -{ - ulint i; - - for (i = 0; i < ib_vector_size(cols); ++i) { - const ib_col_t* ib_col; - - ib_col = static_cast( - ib_vector_get((ib_vector_t*) cols, i)); - - if (innobase_strcasecmp(ib_col->name, name) == 0) { - return(ib_col); - } - } - - return(NULL); -} - -/*****************************************************************//** -Find a column in the the column list with the same name. -@return col. def. if found else NULL */ -UNIV_INLINE -const ib_key_col_t* -ib_index_find_col( -/*==============*/ - ib_vector_t* cols, /*!< in: column list head */ - const char* name) /*!< in: column name to find */ -{ - ulint i; - - for (i = 0; i < ib_vector_size(cols); ++i) { - const ib_key_col_t* ib_col; - - ib_col = static_cast(ib_vector_get(cols, i)); - - if (innobase_strcasecmp(ib_col->name, name) == 0) { - return(ib_col); - } - } - - return(NULL); -} - #ifdef __WIN__ /*****************************************************************//** Convert a string to lower case. */ @@ -946,34 +803,6 @@ ib_table_name_check( -/*****************************************************************//** -Get an index definition that is tagged as a clustered index. -@return cluster index schema */ -UNIV_INLINE -ib_index_def_t* -ib_find_clustered_index( -/*====================*/ - ib_vector_t* indexes) /*!< in: index defs. to search */ -{ - ulint i; - ulint n_indexes; - - n_indexes = ib_vector_size(indexes); - - for (i = 0; i < n_indexes; ++i) { - ib_index_def_t* ib_index_def; - - ib_index_def = static_cast( - ib_vector_get(indexes, i)); - - if (ib_index_def->clustered) { - return(ib_index_def); - } - } - - return(NULL); -} - /*****************************************************************//** Get a table id. The caller must have acquired the dictionary mutex. @return DB_SUCCESS if found */ @@ -3552,41 +3381,6 @@ ib_cursor_set_cluster_access( prebuilt->need_to_access_clustered = TRUE; } -/*************************************************************//** -Convert and write an INT column value to an InnoDB tuple. -@return DB_SUCCESS or error */ -UNIV_INLINE -ib_err_t -ib_tuple_write_int( -/*===============*/ - ib_tpl_t ib_tpl, /*!< in/out: tuple to write to */ - ulint col_no, /*!< in: column number */ - const void* value, /*!< in: integer value */ - ulint value_len) /*!< in: sizeof value type */ -{ - const dfield_t* dfield; - ulint data_len; - ulint type_len; - ib_tuple_t* tuple = (ib_tuple_t*) ib_tpl; - - ut_a(col_no < ib_tuple_get_n_cols(ib_tpl)); - - dfield = ib_col_get_dfield(tuple, col_no); - - data_len = dfield_get_len(dfield); - type_len = dtype_get_len(dfield_get_type(dfield)); - - if (dtype_get_mtype(dfield_get_type(dfield)) != DATA_INT - || value_len != data_len) { - - return(DB_DATA_MISMATCH); - } - - return(ib_col_set_value( - ib_tpl, static_cast(col_no), - value, static_cast(type_len), true)); -} - /*****************************************************************//** Write an integer value to a column. Integers are stored in big-endian format and will need to be converted from the host format. diff --git a/storage/xtradb/dict/dict0boot.cc b/storage/xtradb/dict/dict0boot.cc index b57a8873bd5..94a3af2852b 100644 --- a/storage/xtradb/dict/dict0boot.cc +++ b/storage/xtradb/dict/dict0boot.cc @@ -302,8 +302,7 @@ dict_boot(void) /* Insert into the dictionary cache the descriptions of the basic system tables */ /*-------------------------*/ - table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0, 0, - false); + table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0, 0); dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); @@ -357,8 +356,7 @@ dict_boot(void) ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0, 0, - false); + table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0, 0); dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); @@ -391,8 +389,7 @@ dict_boot(void) ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0, 0, - false); + table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0, 0); dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); @@ -425,8 +422,7 @@ dict_boot(void) ut_a(error == DB_SUCCESS); /*-------------------------*/ - table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0, 0, - false); + table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0, 0); dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc index 99e49fda615..fbf9bd22e20 100644 --- a/storage/xtradb/dict/dict0dict.cc +++ b/storage/xtradb/dict/dict0dict.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -644,6 +644,33 @@ dict_table_get_col_name( } #ifndef UNIV_HOTBACKUP +/** Allocate and init the autoinc latch of a given table. +This function must not be called concurrently on the same table object. +@param[in,out] table_void table whose autoinc latch to create */ +void +dict_table_autoinc_alloc( + void* table_void) +{ + dict_table_t* table = static_cast(table_void); + table->autoinc_mutex = new (std::nothrow) ib_mutex_t(); + ut_a(table->autoinc_mutex != NULL); + mutex_create(autoinc_mutex_key, + table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); +} + +/** Allocate and init the zip_pad_mutex of a given index. +This function must not be called concurrently on the same index object. +@param[in,out] index_void index whose zip_pad_mutex to create */ +void +dict_index_zip_pad_alloc( + void* index_void) +{ + dict_index_t* index = static_cast(index_void); + index->zip_pad.mutex = new (std::nothrow) os_fast_mutex_t; + ut_a(index->zip_pad.mutex != NULL); + os_fast_mutex_init(zip_pad_mutex_key, index->zip_pad.mutex); +} + /********************************************************************//** Acquire the autoinc lock. */ UNIV_INTERN @@ -652,7 +679,32 @@ dict_table_autoinc_lock( /*====================*/ dict_table_t* table) /*!< in/out: table */ { - mutex_enter(&table->autoinc_mutex); +#ifdef HAVE_ATOMIC_BUILTINS + os_once::do_or_wait_for_done( + &table->autoinc_mutex_created, + dict_table_autoinc_alloc, table); +#else /* HAVE_ATOMIC_BUILTINS */ + ut_ad(table->autoinc_mutex_created == os_once::DONE); +#endif /* HAVE_ATOMIC_BUILTINS */ + + mutex_enter(table->autoinc_mutex); +} + +/** Acquire the zip_pad_mutex latch. +@param[in,out] index the index whose zip_pad_mutex to acquire.*/ +void +dict_index_zip_pad_lock( + dict_index_t* index) +{ +#ifdef HAVE_ATOMIC_BUILTINS + os_once::do_or_wait_for_done( + &index->zip_pad.mutex_created, + dict_index_zip_pad_alloc, index); +#else /* HAVE_ATOMIC_BUILTINS */ + ut_ad(index->zip_pad.mutex_created == os_once::DONE); +#endif /* HAVE_ATOMIC_BUILTINS */ + + os_fast_mutex_lock(index->zip_pad.mutex); } /********************************************************************//** @@ -664,7 +716,7 @@ dict_table_autoinc_initialize( dict_table_t* table, /*!< in/out: table */ ib_uint64_t value) /*!< in: next value to assign to a row */ { - ut_ad(mutex_own(&table->autoinc_mutex)); + ut_ad(dict_table_autoinc_own(table)); table->autoinc = value; } @@ -706,7 +758,7 @@ dict_table_autoinc_read( /*====================*/ const dict_table_t* table) /*!< in: table */ { - ut_ad(mutex_own(&table->autoinc_mutex)); + ut_ad(dict_table_autoinc_own(table)); return(table->autoinc); } @@ -722,7 +774,7 @@ dict_table_autoinc_update_if_greater( dict_table_t* table, /*!< in/out: table */ ib_uint64_t value) /*!< in: value which was assigned to a row */ { - ut_ad(mutex_own(&table->autoinc_mutex)); + ut_ad(dict_table_autoinc_own(table)); if (value > table->autoinc) { @@ -738,7 +790,7 @@ dict_table_autoinc_unlock( /*======================*/ dict_table_t* table) /*!< in/out: table */ { - mutex_exit(&table->autoinc_mutex); + mutex_exit(table->autoinc_mutex); } #endif /* !UNIV_HOTBACKUP */ @@ -1578,15 +1630,18 @@ dict_table_rename_in_cache( } else if (table->space != TRX_SYS_SPACE) { char* new_path = NULL; - if (table->dir_path_of_temp_table != NULL) { + if (DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: trying to rename a" " TEMPORARY TABLE ", stderr); ut_print_name(stderr, NULL, TRUE, old_name); - fputs(" (", stderr); - ut_print_filename(stderr, - table->dir_path_of_temp_table); - fputs(" )\n", stderr); + if (table->dir_path_of_temp_table != NULL) { + fputs(" (", stderr); + ut_print_filename( + stderr, table->dir_path_of_temp_table); + fputs(" )\n", stderr); + } + return(DB_ERROR); } else if (DICT_TF_HAS_DATA_DIR(table->flags)) { @@ -5821,8 +5876,7 @@ dict_ind_init(void) dict_table_t* table; /* create dummy table and index for REDUNDANT infimum and supremum */ - table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0, 0, - true); + table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0, 0); dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); @@ -5835,7 +5889,7 @@ dict_ind_init(void) /* create dummy table and index for COMPACT infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY2", DICT_HDR_SPACE, 1, - DICT_TF_COMPACT, 0, true); + DICT_TF_COMPACT, 0); dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); dict_ind_compact = dict_mem_index_create("SYS_DUMMY2", "SYS_DUMMY2", @@ -6651,10 +6705,10 @@ dict_index_zip_success( return; } - os_fast_mutex_lock(&index->zip_pad.mutex); + dict_index_zip_pad_lock(index); ++index->zip_pad.success; dict_index_zip_pad_update(&index->zip_pad, zip_threshold); - os_fast_mutex_unlock(&index->zip_pad.mutex); + dict_index_zip_pad_unlock(index); } /*********************************************************************//** @@ -6674,10 +6728,10 @@ dict_index_zip_failure( return; } - os_fast_mutex_lock(&index->zip_pad.mutex); + dict_index_zip_pad_lock(index); ++index->zip_pad.failure; dict_index_zip_pad_update(&index->zip_pad, zip_threshold); - os_fast_mutex_unlock(&index->zip_pad.mutex); + dict_index_zip_pad_unlock(index); } @@ -6709,9 +6763,9 @@ dict_index_zip_pad_optimal_page_size( #ifdef HAVE_ATOMIC_BUILTINS pad = os_atomic_increment_ulint(&index->zip_pad.pad, 0); #else /* HAVE_ATOMIC_BUILTINS */ - os_fast_mutex_lock(&index->zip_pad.mutex); + dict_index_zip_pad_lock(index); pad = index->zip_pad.pad; - os_fast_mutex_unlock(&index->zip_pad.mutex); + dict_index_zip_pad_unlock(index); #endif /* HAVE_ATOMIC_BUILTINS */ ut_ad(pad < UNIV_PAGE_SIZE); diff --git a/storage/xtradb/dict/dict0load.cc b/storage/xtradb/dict/dict0load.cc index 874614bfb5c..ef8a2896b28 100644 --- a/storage/xtradb/dict/dict0load.cc +++ b/storage/xtradb/dict/dict0load.cc @@ -2176,8 +2176,7 @@ err_len: /* See if the tablespace is available. */ *table = dict_mem_table_create( - name, space, n_cols & ~DICT_N_COLS_COMPACT, flags, flags2, - false); + name, space, n_cols & ~DICT_N_COLS_COMPACT, flags, flags2); field = rec_get_nth_field_old(rec, DICT_FLD__SYS_TABLES__ID, &len); ut_ad(len == 8); /* this was checked earlier */ diff --git a/storage/xtradb/dict/dict0mem.cc b/storage/xtradb/dict/dict0mem.cc index 05d11ebb72b..58876d15f1d 100644 --- a/storage/xtradb/dict/dict0mem.cc +++ b/storage/xtradb/dict/dict0mem.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -71,10 +71,7 @@ dict_mem_table_create( the table is placed */ ulint n_cols, /*!< in: number of columns */ ulint flags, /*!< in: table flags */ - ulint flags2, /*!< in: table flags2 */ - bool nonshared)/*!< in: whether the table object is a dummy - one that does not need the initialization of - locking-related fields. */ + ulint flags2) /*!< in: table flags2 */ { dict_table_t* table; mem_heap_t* heap; @@ -109,18 +106,10 @@ dict_mem_table_create( dict_table_stats_latch_create(table, true); #ifndef UNIV_HOTBACKUP + table->autoinc_lock = static_cast( + mem_heap_alloc(heap, lock_get_size())); - if (!nonshared) { - - table->autoinc_lock = static_cast( - mem_heap_alloc(heap, lock_get_size())); - - mutex_create(autoinc_mutex_key, - &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); - } else { - - table->autoinc_lock = NULL; - } + dict_table_autoinc_create_lazy(table); table->autoinc = 0; @@ -173,10 +162,7 @@ dict_mem_table_free( } } #ifndef UNIV_HOTBACKUP - if (table->autoinc_lock) { - - mutex_free(&(table->autoinc_mutex)); - } + dict_table_autoinc_destroy(table); #endif /* UNIV_HOTBACKUP */ dict_table_stats_latch_destroy(table); @@ -541,8 +527,7 @@ dict_mem_index_create( dict_mem_fill_index_struct(index, heap, table_name, index_name, space, type, n_fields); - os_fast_mutex_init(zip_pad_mutex_key, &index->zip_pad.mutex); - + dict_index_zip_pad_mutex_create_lazy(index); return(index); } @@ -675,7 +660,7 @@ dict_mem_index_free( } #endif /* UNIV_BLOB_DEBUG */ - os_fast_mutex_free(&index->zip_pad.mutex); + dict_index_zip_pad_mutex_destroy(index); mem_heap_free(index->heap); } diff --git a/storage/xtradb/fsp/fsp0fsp.cc b/storage/xtradb/fsp/fsp0fsp.cc index 1993cdf2b7c..b96f2c1bb7a 100644 --- a/storage/xtradb/fsp/fsp0fsp.cc +++ b/storage/xtradb/fsp/fsp0fsp.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -303,44 +303,6 @@ xdes_find_bit( return(ULINT_UNDEFINED); } -/**********************************************************************//** -Looks for a descriptor bit having the desired value. Scans the extent in -a direction opposite to xdes_find_bit. -@return bit index of the bit, ULINT_UNDEFINED if not found */ -UNIV_INLINE -ulint -xdes_find_bit_downward( -/*===================*/ - xdes_t* descr, /*!< in: descriptor */ - ulint bit, /*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */ - ibool val, /*!< in: desired bit value */ - ulint hint, /*!< in: hint of which bit position would - be desirable */ - mtr_t* mtr) /*!< in/out: mini-transaction */ -{ - ulint i; - - ut_ad(descr && mtr); - ut_ad(val <= TRUE); - ut_ad(hint < FSP_EXTENT_SIZE); - ut_ad(mtr_memo_contains_page(mtr, descr, MTR_MEMO_PAGE_X_FIX)); - for (i = hint + 1; i > 0; i--) { - if (val == xdes_mtr_get_bit(descr, bit, i - 1, mtr)) { - - return(i - 1); - } - } - - for (i = FSP_EXTENT_SIZE - 1; i > hint; i--) { - if (val == xdes_mtr_get_bit(descr, bit, i, mtr)) { - - return(i); - } - } - - return(ULINT_UNDEFINED); -} - /**********************************************************************//** Returns the number of used pages in a descriptor. @return number of pages used */ diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc index c2d3f154075..5d6d5ae7cf9 100644 --- a/storage/xtradb/fts/fts0fts.cc +++ b/storage/xtradb/fts/fts0fts.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -81,11 +81,13 @@ ulint n_nodes = 0; /** Error condition reported by fts_utf8_decode() */ const ulint UTF8_ERROR = 0xFFFFFFFF; +#ifdef FTS_CACHE_SIZE_DEBUG /** The cache size permissible lower limit (1K) */ static const ulint FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB = 1; /** The cache size permissible upper limit (1G) */ static const ulint FTS_CACHE_SIZE_UPPER_LIMIT_IN_MB = 1024; +#endif /* FTS_CACHE_SIZE_DEBUG */ /** Time to sleep after DEADLOCK error before retrying operation. */ static const ulint FTS_DEADLOCK_RETRY_WAIT = 100000; @@ -191,7 +193,7 @@ static const char* fts_create_common_tables_sql = { "" "CREATE TABLE \"%s_CONFIG\" (\n" " key CHAR(50),\n" - " value CHAR(50) NOT NULL\n" + " value CHAR(200) NOT NULL\n" ") COMPACT;\n" "CREATE UNIQUE CLUSTERED INDEX IND ON \"%s_CONFIG\"(key);\n" }; @@ -329,27 +331,6 @@ fts_update_sync_doc_id( doc_id_t doc_id, /*!< in: last document id */ trx_t* trx) /*!< in: update trx, or NULL */ __attribute__((nonnull(1))); -/******************************************************************** -Check if we should stop. */ -UNIV_INLINE -ibool -fts_is_stop_signalled( -/*==================*/ - fts_t* fts) /*!< in: fts instance */ -{ - ibool stop_signalled = FALSE; - - mutex_enter(&fts->bg_threads_mutex); - - if (fts->fts_status & BG_THREAD_STOP) { - - stop_signalled = TRUE; - } - - mutex_exit(&fts->bg_threads_mutex); - - return(stop_signalled); -} /****************************************************************//** This function loads the default InnoDB stopword list */ @@ -1971,7 +1952,7 @@ fts_create_one_index_table( flags2 = DICT_TF2_USE_TABLESPACE; } - new_table = dict_mem_table_create(table_name, 0, 5, 1, flags2, false); + new_table = dict_mem_table_create(table_name, 0, 5, 1, flags2); field = dict_index_get_nth_field(index, 0); charset = innobase_get_fts_charset( @@ -3408,7 +3389,7 @@ fts_fetch_doc_from_rec( doc->charset = get_doc->index_cache->charset; /* Null Field */ - if (doc->text.f_len == UNIV_SQL_NULL) { + if (doc->text.f_len == UNIV_SQL_NULL || doc->text.f_len == 0) { continue; } @@ -5544,7 +5525,7 @@ fts_savepoint_lookup( /*********************************************************************//** Release the savepoint data identified by name. All savepoints created -after the named savepoint are also released. +after the named savepoint are kept. @return DB_SUCCESS or error code */ UNIV_INTERN void @@ -5553,81 +5534,37 @@ fts_savepoint_release( trx_t* trx, /*!< in: transaction */ const char* name) /*!< in: savepoint name */ { - ulint i; - ib_vector_t* savepoints; - ulint top_of_stack = 0; - ut_a(name != NULL); - savepoints = trx->fts_trx->savepoints; + ib_vector_t* savepoints = trx->fts_trx->savepoints; ut_a(ib_vector_size(savepoints) > 0); - /* Skip the implied savepoint (first element). */ - for (i = 1; i < ib_vector_size(savepoints); ++i) { - fts_savepoint_t* savepoint; + ulint i = fts_savepoint_lookup(savepoints, name); + if (i != ULINT_UNDEFINED) { + ut_a(i >= 1); + fts_savepoint_t* savepoint; savepoint = static_cast( ib_vector_get(savepoints, i)); - /* Even though we release the resources that are part - of the savepoint, we don't (always) actually delete the - entry. We simply set the savepoint name to NULL. Therefore - we have to skip deleted/released entries. */ - if (savepoint->name != NULL - && strcmp(name, savepoint->name) == 0) { - break; + if (i == ib_vector_size(savepoints) - 1) { + /* If the savepoint is the last, we save its + tables to the previous savepoint. */ + fts_savepoint_t* prev_savepoint; + prev_savepoint = static_cast( + ib_vector_get(savepoints, i - 1)); - /* Track the previous savepoint instance that will - be at the top of the stack after the release. */ - } else if (savepoint->name != NULL) { - /* We need to delete all entries - greater than this element. */ - top_of_stack = i; + ib_rbt_t* tables = savepoint->tables; + savepoint->tables = prev_savepoint->tables; + prev_savepoint->tables = tables; } - } - - /* Only if we found and element to release. */ - if (i < ib_vector_size(savepoints)) { - fts_savepoint_t* last_savepoint; - fts_savepoint_t* top_savepoint; - ib_rbt_t* tables; - - ut_a(top_of_stack < ib_vector_size(savepoints)); - /* Exchange tables between last savepoint and top savepoint */ - last_savepoint = static_cast( - ib_vector_last(trx->fts_trx->savepoints)); - top_savepoint = static_cast( - ib_vector_get(savepoints, top_of_stack)); - tables = top_savepoint->tables; - top_savepoint->tables = last_savepoint->tables; - last_savepoint->tables = tables; - - /* Skip the implied savepoint. */ - for (i = ib_vector_size(savepoints) - 1; - i > top_of_stack; - --i) { - - fts_savepoint_t* savepoint; - - savepoint = static_cast( - ib_vector_get(savepoints, i)); - - /* Skip savepoints that were released earlier. */ - if (savepoint->name != NULL) { - savepoint->name = NULL; - fts_savepoint_free(savepoint); - } - - ib_vector_pop(savepoints); - } + fts_savepoint_free(savepoint); + ib_vector_remove(savepoints, *(void**)savepoint); /* Make sure we don't delete the implied savepoint. */ ut_a(ib_vector_size(savepoints) > 0); - - /* This must hold. */ - ut_a(ib_vector_size(savepoints) == (top_of_stack + 1)); } } @@ -6329,7 +6266,7 @@ fts_fake_hex_to_dec( { ib_id_t dec_id = 0; char tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH]; - int ret; + int ret __attribute__((unused)); ret = sprintf(tmp_id, UINT64PFx, id); ut_ad(ret == 16); diff --git a/storage/xtradb/fts/fts0opt.cc b/storage/xtradb/fts/fts0opt.cc index 5891b53a6e2..e096b8bf6d6 100644 --- a/storage/xtradb/fts/fts0opt.cc +++ b/storage/xtradb/fts/fts0opt.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -42,9 +42,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang /** The FTS optimize thread's work queue. */ static ib_wqueue_t* fts_optimize_wq; -/** The number of document ids to delete in one statement. */ -static const ulint FTS_MAX_DELETE_DOC_IDS = 1000; - /** Time to wait for a message. */ static const ulint FTS_QUEUE_WAIT_IN_USECS = 5000000; @@ -1154,6 +1151,7 @@ fts_optimize_encode_node( } /* Calculate the space required to store the ilist. */ + ut_ad(doc_id > node->last_doc_id); doc_id_delta = doc_id - node->last_doc_id; enc_len = fts_get_encoded_len(static_cast(doc_id_delta)); @@ -1396,7 +1394,8 @@ fts_optimize_word( src_node = (fts_node_t*) ib_vector_get(word->nodes, i); - if (!dst_node) { + if (dst_node == NULL + || dst_node->last_doc_id > src_node->first_doc_id) { dst_node = static_cast( ib_vector_push(nodes, NULL)); diff --git a/storage/xtradb/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc index 4629e3b7e91..fcae6561764 100644 --- a/storage/xtradb/fts/fts0que.cc +++ b/storage/xtradb/fts/fts0que.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -57,9 +57,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang /*Initial byte length for 'words' in fts_ranking_t */ #define RANKING_WORDS_INIT_LEN 4 -/* Coeffecient to use for normalize relevance ranking. */ -static const double FTS_NORMALIZE_COEFF = 0.0115F; - // FIXME: Need to have a generic iterator that traverses the ilist. typedef std::vector word_vector_t; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 9591c58fbe4..84f33db6832 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2012, Facebook Inc. @@ -3068,19 +3068,6 @@ trx_is_strict( return(trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode)); } -/**********************************************************************//** -Determines if the current MySQL thread is running in strict mode. -If thd==NULL, THDVAR returns the global value of innodb-strict-mode. -@return TRUE if strict */ -UNIV_INLINE -ibool -thd_is_strict( -/*==========*/ - THD* thd) /*!< in: MySQL thread descriptor */ -{ - return(THDVAR(thd, strict_mode)); -} - /**************************************************************//** Resets some fields of a prebuilt struct. The template is used in fast retrieval of just those column values MySQL needs in its processing. */ @@ -9284,18 +9271,18 @@ create_table_def( /* Adjust for the FTS hidden field */ if (!has_doc_id_col) { table = dict_mem_table_create(table_name, 0, n_cols + 1, - flags, flags2, false); + flags, flags2); /* Set the hidden doc_id column. */ table->fts->doc_col = n_cols; } else { table = dict_mem_table_create(table_name, 0, n_cols, - flags, flags2, false); + flags, flags2); table->fts->doc_col = doc_id_col; } } else { table = dict_mem_table_create(table_name, 0, n_cols, - flags, flags2, false); + flags, flags2); } if (flags2 & DICT_TF2_TEMPORARY) { diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index c9847d2c24e..ad81b0ce938 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -2740,7 +2740,7 @@ prepare_inplace_alter_table_dict( /* The initial space id 0 may be overridden later. */ ctx->new_table = dict_mem_table_create( - new_table_name, 0, n_cols, flags, flags2, false); + new_table_name, 0, n_cols, flags, flags2); /* The rebuilt indexed_table will use the renamed column names. */ ctx->col_names = NULL; diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index 2f9d123f1d6..4bc834479fe 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -3324,8 +3324,6 @@ i_s_fts_index_cache_fill_one_index( for (rbt_node = rbt_first(index_cache->words); rbt_node; rbt_node = rbt_next(index_cache->words, rbt_node)) { - doc_id_t doc_id = 0; - fts_tokenizer_word_t* word; word = rbt_value(fts_tokenizer_word_t, rbt_node); @@ -3351,6 +3349,7 @@ i_s_fts_index_cache_fill_one_index( fts_node_t* node; byte* ptr; ulint decoded = 0; + doc_id_t doc_id = 0; node = static_cast (ib_vector_get( word->nodes, i)); @@ -4031,11 +4030,15 @@ i_s_fts_config_fill( fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE); if (!user_table) { + DBUG_RETURN(0); + } else if (!dict_table_has_fts_index(user_table)) { + dict_table_close(user_table, FALSE, FALSE); + DBUG_RETURN(0); } trx = trx_allocate_for_background(); - trx->op_info = "Select for FTS DELETE TABLE"; + trx->op_info = "Select for FTS CONFIG TABLE"; FTS_INIT_FTS_TABLE(&fts_table, "CONFIG", FTS_COMMON_TABLE, user_table); diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index e4122287d2c..0695aa69652 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -611,8 +611,7 @@ ibuf_init_at_db_start(void) heap = mem_heap_create(450); /* Use old-style record format for the insert buffer. */ - table = dict_mem_table_create(IBUF_TABLE_NAME, IBUF_SPACE_ID, 1, 0, 0, - false); + table = dict_mem_table_create(IBUF_TABLE_NAME, IBUF_SPACE_ID, 1, 0, 0); dict_mem_table_add_col(table, heap, "DUMMY_COLUMN", DATA_BINARY, 0, 0); @@ -1573,7 +1572,7 @@ ibuf_dummy_index_create( table = dict_mem_table_create("IBUF_DUMMY", DICT_HDR_SPACE, n, - comp ? DICT_TF_COMPACT : 0, 0, true); + comp ? DICT_TF_COMPACT : 0, 0); index = dict_mem_index_create("IBUF_DUMMY", "IBUF_DUMMY", DICT_HDR_SPACE, 0, n); diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h index 500bd3dfc18..754c3810a84 100644 --- a/storage/xtradb/include/dict0mem.h +++ b/storage/xtradb/include/dict0mem.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -263,10 +263,7 @@ dict_mem_table_create( of the table is placed */ ulint n_cols, /*!< in: number of columns */ ulint flags, /*!< in: table flags */ - ulint flags2, /*!< in: table flags2 */ - bool nonshared);/*!< in: whether the table object is a dummy - one that does not need the initialization of - locking-related fields. */ + ulint flags2); /*!< in: table flags2 */ /****************************************************************//** Free a table memory object. */ UNIV_INTERN @@ -550,11 +547,12 @@ extern ulong zip_failure_threshold_pct; compression failures */ extern ulong zip_pad_max; -/** Data structure to hold information about about how much space in +/** Data structure to hold information about how much space in an uncompressed page should be left as padding to avoid compression failures. This estimate is based on a self-adapting heuristic. */ struct zip_pad_info_t { - os_fast_mutex_t mutex; /*!< mutex protecting the info */ + os_fast_mutex_t* + mutex; /*!< mutex protecting the info */ ulint pad; /*!< number of bytes used as pad */ ulint success;/*!< successful compression ops during current round */ @@ -562,6 +560,9 @@ struct zip_pad_info_t { current round */ ulint n_rounds;/*!< number of currently successful rounds */ + volatile os_once::state_t + mutex_created; + /*!< Creation state of mutex member */ }; /** Data structure for an index. Most fields will be @@ -1033,8 +1034,7 @@ struct dict_table_t{ dict_table_t::indexes*::stat_index_size dict_table_t::indexes*::stat_n_leaf_pages (*) those are not always protected for - performance reasons. NULL for dumy table - objects. */ + performance reasons. */ unsigned stat_initialized:1; /*!< TRUE if statistics have been calculated the first time after database startup or table creation */ @@ -1156,12 +1156,15 @@ struct dict_table_t{ and release it without a need to allocate space from the lock heap of the trx: otherwise the lock heap would grow rapidly - if we do a large insert from a select. NULL - for dummy table objects. */ - ib_mutex_t autoinc_mutex; + if we do a large insert from a select */ + ib_mutex_t* autoinc_mutex; /*!< mutex protecting the autoincrement - counter. Not initialized for dummy table - objects */ + counter */ + + /** Creation state of autoinc_mutex member */ + volatile os_once::state_t + autoinc_mutex_created; + ib_uint64_t autoinc;/*!< autoinc counter value to give to the next inserted row */ ulong n_waiting_or_granted_auto_inc_locks; @@ -1225,6 +1228,111 @@ struct dict_foreign_add_to_referenced_table { } }; +/** Destroy the autoinc latch of the given table. +This function is only called from either single threaded environment +or from a thread that has not shared the table object with other threads. +@param[in,out] table table whose stats latch to destroy */ +inline +void +dict_table_autoinc_destroy( + dict_table_t* table) +{ + if (table->autoinc_mutex_created == os_once::DONE + && table->autoinc_mutex != NULL) { + mutex_free(table->autoinc_mutex); + delete table->autoinc_mutex; + } +} + +/** Allocate and init the autoinc latch of a given table. +This function must not be called concurrently on the same table object. +@param[in,out] table_void table whose autoinc latch to create */ +void +dict_table_autoinc_alloc( + void* table_void); + +/** Allocate and init the zip_pad_mutex of a given index. +This function must not be called concurrently on the same index object. +@param[in,out] index_void index whose zip_pad_mutex to create */ +void +dict_index_zip_pad_alloc( + void* index_void); + +/** Request for lazy creation of the autoinc latch of a given table. +This function is only called from either single threaded environment +or from a thread that has not shared the table object with other threads. +@param[in,out] table table whose autoinc latch is to be created. */ +inline +void +dict_table_autoinc_create_lazy( + dict_table_t* table) +{ +#ifdef HAVE_ATOMIC_BUILTINS + table->autoinc_mutex = NULL; + table->autoinc_mutex_created = os_once::NEVER_DONE; +#else /* HAVE_ATOMIC_BUILTINS */ + dict_table_autoinc_alloc(table); + table->autoinc_mutex_created = os_once::DONE; +#endif /* HAVE_ATOMIC_BUILTINS */ +} + +/** Request a lazy creation of dict_index_t::zip_pad::mutex. +This function is only called from either single threaded environment +or from a thread that has not shared the table object with other threads. +@param[in,out] index index whose zip_pad mutex is to be created */ +inline +void +dict_index_zip_pad_mutex_create_lazy( + dict_index_t* index) +{ +#ifdef HAVE_ATOMIC_BUILTINS + index->zip_pad.mutex = NULL; + index->zip_pad.mutex_created = os_once::NEVER_DONE; +#else /* HAVE_ATOMIC_BUILTINS */ + dict_index_zip_pad_alloc(index); + index->zip_pad.mutex_created = os_once::DONE; +#endif /* HAVE_ATOMIC_BUILTINS */ +} + +/** Destroy the zip_pad_mutex of the given index. +This function is only called from either single threaded environment +or from a thread that has not shared the table object with other threads. +@param[in,out] table table whose stats latch to destroy */ +inline +void +dict_index_zip_pad_mutex_destroy( + dict_index_t* index) +{ + if (index->zip_pad.mutex_created == os_once::DONE + && index->zip_pad.mutex != NULL) { + os_fast_mutex_free(index->zip_pad.mutex); + delete index->zip_pad.mutex; + } +} + +/** Release the zip_pad_mutex of a given index. +@param[in,out] index index whose zip_pad_mutex is to be released */ +inline +void +dict_index_zip_pad_unlock( + dict_index_t* index) +{ + os_fast_mutex_unlock(index->zip_pad.mutex); +} + +#ifdef UNIV_DEBUG +/** Check if the current thread owns the autoinc_mutex of a given table. +@param[in] table the autoinc_mutex belongs to this table +@return true, if the current thread owns the autoinc_mutex, false otherwise.*/ +inline +bool +dict_table_autoinc_own( + const dict_table_t* table) +{ + return(mutex_own(table->autoinc_mutex)); +} +#endif /* UNIV_DEBUG */ + #ifndef UNIV_NONINL #include "dict0mem.ic" #endif diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index db187f15a5f..9ec58cf1e42 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 72.1 +#define PERCONA_INNODB_VERSION 72.2 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index d3e6666cb2c..f03bd04b92e 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -378,8 +378,10 @@ because there is no parallel deadlock check. This stack is protected by the lock_sys_t::mutex. */ static lock_stack_t* lock_stack; +#ifdef UNIV_DEBUG /** The count of the types of locks. */ static const ulint lock_types = UT_ARR_SIZE(lock_compatibility_matrix); +#endif /* UNIV_DEBUG */ #ifdef UNIV_PFS_MUTEX /* Key to register mutex with performance schema */ diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc index a77e7439b5d..38d9215ce39 100644 --- a/storage/xtradb/log/log0recv.cc +++ b/storage/xtradb/log/log0recv.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -1926,7 +1926,7 @@ loop: goto loop; } - ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex)); + ut_ad((!allow_ibuf) == mutex_own(&log_sys->mutex)); if (!allow_ibuf) { recv_no_ibuf_operations = TRUE; diff --git a/storage/xtradb/mtr/mtr0log.cc b/storage/xtradb/mtr/mtr0log.cc index 0660c819240..5335cb4c9ef 100644 --- a/storage/xtradb/mtr/mtr0log.cc +++ b/storage/xtradb/mtr/mtr0log.cc @@ -560,7 +560,7 @@ mlog_parse_index( n = n_uniq = 1; } table = dict_mem_table_create("LOG_DUMMY", DICT_HDR_SPACE, n, - comp ? DICT_TF_COMPACT : 0, 0, true); + comp ? DICT_TF_COMPACT : 0, 0); ind = dict_mem_index_create("LOG_DUMMY", "LOG_DUMMY", DICT_HDR_SPACE, 0, n); ind->table = table; diff --git a/storage/xtradb/os/os0sync.cc b/storage/xtradb/os/os0sync.cc index e42c5900c0c..cd57abd0623 100644 --- a/storage/xtradb/os/os0sync.cc +++ b/storage/xtradb/os/os0sync.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -233,24 +233,6 @@ os_cond_broadcast( #endif } -/*********************************************************//** -Wakes one thread waiting for condition variable */ -UNIV_INLINE -void -os_cond_signal( -/*==========*/ - os_cond_t* cond) /*!< in: condition variable. */ -{ - ut_a(cond); - -#ifdef __WIN__ - ut_a(wake_condition_variable != NULL); - wake_condition_variable(cond); -#else - ut_a(pthread_cond_signal(cond) == 0); -#endif -} - /*********************************************************//** Destroys condition variable */ UNIV_INLINE diff --git a/storage/xtradb/page/page0zip.cc b/storage/xtradb/page/page0zip.cc index 67dca183c6d..aa5c99339e2 100644 --- a/storage/xtradb/page/page0zip.cc +++ b/storage/xtradb/page/page0zip.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -1576,7 +1576,7 @@ page_zip_fields_free( { if (index) { dict_table_t* table = index->table; - os_fast_mutex_free(&index->zip_pad.mutex); + dict_index_zip_pad_mutex_destroy(index); mem_heap_free(index->heap); dict_mem_table_free(table); @@ -1627,7 +1627,7 @@ page_zip_fields_decode( } table = dict_mem_table_create("ZIP_DUMMY", DICT_HDR_SPACE, n, - DICT_TF_COMPACT, 0, true); + DICT_TF_COMPACT, 0); index = dict_mem_index_create("ZIP_DUMMY", "ZIP_DUMMY", DICT_HDR_SPACE, 0, n); index->table = table; diff --git a/storage/xtradb/pars/pars0pars.cc b/storage/xtradb/pars/pars0pars.cc index f051481184b..655e5ba1324 100644 --- a/storage/xtradb/pars/pars0pars.cc +++ b/storage/xtradb/pars/pars0pars.cc @@ -1997,7 +1997,7 @@ pars_create_table( n_cols = que_node_list_get_len(column_defs); table = dict_mem_table_create( - table_sym->name, 0, n_cols, flags, flags2, false); + table_sym->name, 0, n_cols, flags, flags2); #ifdef UNIV_DEBUG if (not_fit_in_memory != NULL) { diff --git a/storage/xtradb/que/que0que.cc b/storage/xtradb/que/que0que.cc index 8d9b8fac776..e2dc0239e13 100644 --- a/storage/xtradb/que/que0que.cc +++ b/storage/xtradb/que/que0que.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -390,32 +390,6 @@ que_fork_start_command( return(thr); } -/****************************************************************//** -Tests if all the query threads in the same fork have a given state. -@return TRUE if all the query threads in the same fork were in the -given state */ -UNIV_INLINE -ibool -que_fork_all_thrs_in_state( -/*=======================*/ - que_fork_t* fork, /*!< in: query fork */ - ulint state) /*!< in: state */ -{ - que_thr_t* thr_node; - - for (thr_node = UT_LIST_GET_FIRST(fork->thrs); - thr_node != NULL; - thr_node = UT_LIST_GET_NEXT(thrs, thr_node)) { - - if (thr_node->state != state) { - - return(FALSE); - } - } - - return(TRUE); -} - /**********************************************************************//** Calls que_graph_free_recursive for statements in a statement list. */ static diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc index 1240cf7fcc5..609c166c77b 100644 --- a/storage/xtradb/row/row0log.cc +++ b/storage/xtradb/row/row0log.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1382,6 +1382,27 @@ blob_done: dfield_set_data(dfield, data, len); } + if (len != UNIV_SQL_NULL && col->mtype == DATA_MYSQL + && col->len != len && !dict_table_is_comp(log->table)) { + + ut_ad(col->len >= len); + if (dict_table_is_comp(index->table)) { + byte* buf = (byte*) mem_heap_alloc(heap, + col->len); + memcpy(buf, dfield->data, len); + memset(buf + len, 0x20, col->len - len); + + dfield_set_data(dfield, buf, col->len); + } else { + /* field length mismatch should not happen + when rebuilding the redundant row format + table. */ + ut_ad(0); + *error = DB_CORRUPTION; + return(NULL); + } + } + /* See if any columns were changed to NULL or NOT NULL. */ const dict_col_t* new_col = dict_table_get_nth_col(log->table, col_no); diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 53a144c47a7..ab97a514282 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -235,22 +235,86 @@ row_merge_buf_free( mem_heap_free(buf->heap); } -/******************************************************//** -Insert a data tuple into a sort buffer. -@return number of rows added, 0 if out of space */ +/** Convert the field data from compact to redundant format. +@param[in] row_field field to copy from +@param[out] field field to copy to +@param[in] len length of the field data +@param[in] zip_size compressed BLOB page size, + zero for uncompressed BLOBs +@param[in,out] heap memory heap where to allocate data when + converting to ROW_FORMAT=REDUNDANT, or NULL + when not to invoke + row_merge_buf_redundant_convert(). */ +static +void +row_merge_buf_redundant_convert( + const dfield_t* row_field, + dfield_t* field, + ulint len, + ulint zip_size, + mem_heap_t* heap) +{ + ut_ad(DATA_MBMINLEN(field->type.mbminmaxlen) == 1); + ut_ad(DATA_MBMAXLEN(field->type.mbminmaxlen) > 1); + + byte* buf = (byte*) mem_heap_alloc(heap, len); + ulint field_len = row_field->len; + ut_ad(field_len <= len); + + if (row_field->ext) { + const byte* field_data = static_cast( + dfield_get_data(row_field)); + ulint ext_len; + + ut_a(field_len >= BTR_EXTERN_FIELD_REF_SIZE); + ut_a(memcmp(field_data + field_len - BTR_EXTERN_FIELD_REF_SIZE, + field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)); + + byte* data = btr_copy_externally_stored_field( + &ext_len, field_data, zip_size, field_len, heap); + + ut_ad(ext_len < len); + + memcpy(buf, data, ext_len); + field_len = ext_len; + } else { + memcpy(buf, row_field->data, field_len); + } + + memset(buf + field_len, 0x20, len - field_len); + + dfield_set_data(field, buf, len); +} + +/** Insert a data tuple into a sort buffer. +@param[in,out] buf sort buffer +@param[in] fts_index fts index to be created +@param[in] old_table original table +@param[in,out] psort_info parallel sort info +@param[in] row table row +@param[in] ext cache of externally stored + column prefixes, or NULL +@param[in,out] doc_id Doc ID if we are creating + FTS index +@param[in,out] conv_heap memory heap where to allocate data when + converting to ROW_FORMAT=REDUNDANT, or NULL + when not to invoke + row_merge_buf_redundant_convert() +@param[in,out] exceed_page set if the record size exceeds the page size + when converting to ROW_FORMAT=REDUNDANT +@return number of rows added, 0 if out of space */ static ulint row_merge_buf_add( -/*==============*/ - row_merge_buf_t* buf, /*!< in/out: sort buffer */ - dict_index_t* fts_index,/*!< in: fts index to be created */ - const dict_table_t* old_table,/*!< in: original table */ - fts_psort_t* psort_info, /*!< in: parallel sort info */ - const dtuple_t* row, /*!< in: table row */ - const row_ext_t* ext, /*!< in: cache of externally stored - column prefixes, or NULL */ - doc_id_t* doc_id) /*!< in/out: Doc ID if we are - creating FTS index */ + row_merge_buf_t* buf, + dict_index_t* fts_index, + const dict_table_t* old_table, + fts_psort_t* psort_info, + const dtuple_t* row, + const row_ext_t* ext, + doc_id_t* doc_id, + mem_heap_t* conv_heap, + bool* exceed_page) { ulint i; const dict_index_t* index; @@ -400,6 +464,23 @@ row_merge_buf_add( n_row_added = 1; continue; } + + if (field->len != UNIV_SQL_NULL + && col->mtype == DATA_MYSQL + && col->len != field->len) { + + if (conv_heap != NULL) { + row_merge_buf_redundant_convert( + row_field, field, col->len, + dict_table_zip_size(old_table), + conv_heap); + } else { + /* Field length mismatch should not + happen when rebuilding redundant row + format table. */ + ut_ad(dict_table_is_comp(index->table)); + } + } } len = dfield_get_len(field); @@ -508,6 +589,14 @@ row_merge_buf_add( of extra_size. */ data_size += (extra_size + 1) + ((extra_size + 1) >= 0x80); + /* Record size can exceed page size while converting to + redundant row format. But there is assert + ut_ad(size < UNIV_PAGE_SIZE) in rec_offs_data_size(). + It may hit the assert before attempting to insert the row. */ + if (conv_heap != NULL && data_size > UNIV_PAGE_SIZE) { + *exceed_page = true; + } + ut_ad(data_size < srv_sort_buf_size); /* Reserve one byte for the end marker of row_merge_block_t. */ @@ -527,6 +616,10 @@ row_merge_buf_add( dfield_dup(field++, buf->heap); } while (--n_fields); + if (conv_heap != NULL) { + mem_heap_empty(conv_heap); + } + DBUG_RETURN(n_row_added); } @@ -1208,6 +1301,7 @@ row_merge_read_clustered_index( os_event_t fts_parallel_sort_event = NULL; ibool fts_pll_sort = FALSE; ib_int64_t sig_count = 0; + mem_heap_t* conv_heap = NULL; DBUG_ENTER("row_merge_read_clustered_index"); ut_ad((old_table == new_table) == !col_map); @@ -1303,6 +1397,11 @@ row_merge_read_clustered_index( row_heap = mem_heap_create(sizeof(mrec_buf_t)); + if (dict_table_is_comp(old_table) + && !dict_table_is_comp(new_table)) { + conv_heap = mem_heap_create(sizeof(mrec_buf_t)); + } + /* Scan the clustered index. */ for (;;) { const rec_t* rec; @@ -1587,16 +1686,24 @@ write_buffers: row_merge_buf_t* buf = merge_buf[i]; merge_file_t* file = &files[i]; ulint rows_added = 0; + bool exceed_page = false; if (UNIV_LIKELY (row && (rows_added = row_merge_buf_add( buf, fts_index, old_table, - psort_info, row, ext, &doc_id)))) { + psort_info, row, ext, &doc_id, + conv_heap, &exceed_page)))) { /* If we are creating FTS index, a single row can generate more records for tokenized word */ file->n_rec += rows_added; + + if (exceed_page) { + err = DB_TOO_BIG_RECORD; + break; + } + if (doc_id > max_doc_id) { max_doc_id = doc_id; } @@ -1697,12 +1804,18 @@ write_buffers: (!(rows_added = row_merge_buf_add( buf, fts_index, old_table, psort_info, row, ext, - &doc_id)))) { + &doc_id, conv_heap, + &exceed_page)))) { /* An empty buffer should have enough room for at least one record. */ ut_error; } + if (exceed_page) { + err = DB_TOO_BIG_RECORD; + break; + } + file->n_rec += rows_added; } } @@ -1727,6 +1840,10 @@ func_exit: } all_done: + if (conv_heap != NULL) { + mem_heap_free(conv_heap); + } + #ifdef FTS_INTERNAL_DIAG_PRINT DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Scan Table\n"); #endif diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 0168928c9f0..e167bb45d96 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -3427,13 +3427,11 @@ row_truncate_table_for_mysql( goto funct_exit; } - if (table->space && !table->dir_path_of_temp_table) { + if (table->space && !DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)) { /* Discard and create the single-table tablespace. */ ulint space = table->space; ulint flags = fil_space_get_flags(space); - ut_a(!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)); - dict_get_and_save_data_dir_path(table, true); if (flags != ULINT_UNDEFINED @@ -4233,8 +4231,9 @@ row_drop_table_for_mysql( is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY); /* If there is a temp path then the temp flag is set. - However, during recovery, we might have a temp flag but - not know the temp path */ + However, during recovery or reloading the table object + after eviction from data dictionary cache, we might + have a temp flag but not know the temp path */ ut_a(table->dir_path_of_temp_table == NULL || is_temp); if (dict_table_is_discarded(table) || table->ibd_file_missing) { @@ -4802,6 +4801,7 @@ row_rename_table_for_mysql( ibool old_is_tmp, new_is_tmp; pars_info_t* info = NULL; int retry; + bool aux_fts_rename = false; ut_a(old_name != NULL); ut_a(new_name != NULL); @@ -5088,34 +5088,8 @@ row_rename_table_for_mysql( if (dict_table_has_fts_index(table) && !dict_tables_have_same_db(old_name, new_name)) { err = fts_rename_aux_tables(table, new_name, trx); - - if (err != DB_SUCCESS && (table->space != 0)) { - char* orig_name = table->name; - trx_t* trx_bg = trx_allocate_for_background(); - - /* If the first fts_rename fails, the trx would - be rolled back and committed, we can't use it any more, - so we have to start a new background trx here. */ - ut_a(trx_state_eq(trx, TRX_STATE_NOT_STARTED)); - trx_bg->op_info = "Revert the failing rename " - "for fts aux tables"; - trx_bg->dict_operation_lock_mode = RW_X_LATCH; - trx_start_for_ddl(trx_bg, TRX_DICT_OP_TABLE); - - /* If rename fails and table has its own tablespace, - we need to call fts_rename_aux_tables again to - revert the ibd file rename, which is not under the - control of trx. Also notice the parent table name - in cache is not changed yet. If the reverting fails, - the ibd data may be left in the new database, which - can be fixed only manually. */ - table->name = const_cast(new_name); - fts_rename_aux_tables(table, old_name, trx_bg); - table->name = orig_name; - - trx_bg->dict_operation_lock_mode = 0; - trx_commit_for_mysql(trx_bg); - trx_free_for_background(trx_bg); + if (err != DB_TABLE_NOT_FOUND) { + aux_fts_rename = true; } } @@ -5216,6 +5190,37 @@ end: } funct_exit: + if (aux_fts_rename && err != DB_SUCCESS + && table != NULL && (table->space != 0)) { + + char* orig_name = table->name; + trx_t* trx_bg = trx_allocate_for_background(); + + /* If the first fts_rename fails, the trx would + be rolled back and committed, we can't use it any more, + so we have to start a new background trx here. */ + ut_a(trx_state_eq(trx_bg, TRX_STATE_NOT_STARTED)); + trx_bg->op_info = "Revert the failing rename " + "for fts aux tables"; + trx_bg->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_bg, TRX_DICT_OP_TABLE); + + /* If rename fails and table has its own tablespace, + we need to call fts_rename_aux_tables again to + revert the ibd file rename, which is not under the + control of trx. Also notice the parent table name + in cache is not changed yet. If the reverting fails, + the ibd data may be left in the new database, which + can be fixed only manually. */ + table->name = const_cast(new_name); + fts_rename_aux_tables(table, old_name, trx_bg); + table->name = orig_name; + + trx_bg->dict_operation_lock_mode = 0; + trx_commit_for_mysql(trx_bg); + trx_free_for_background(trx_bg); + } + if (table != NULL) { dict_table_close(table, dict_locked, FALSE); } diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc index 35e96908f6a..d6a7f569b4a 100644 --- a/storage/xtradb/sync/sync0sync.cc +++ b/storage/xtradb/sync/sync0sync.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -305,9 +305,9 @@ mutex_create_func( /* NOTE! The very first mutexes are not put to the mutex list */ - if ((mutex == &mutex_list_mutex) + if (mutex == &mutex_list_mutex #ifdef UNIV_SYNC_DEBUG - || (mutex == &sync_thread_mutex) + || mutex == &sync_thread_mutex #endif /* UNIV_SYNC_DEBUG */ ) { -- cgit v1.2.1 From 5355972b716f9b913d62c264e8b98bab54a4fd6f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 12:49:00 +0200 Subject: after merge fixes: InnoDB and XtraDB --- storage/innobase/page/page0zip.cc | 2 ++ storage/xtradb/row/row0merge.cc | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index c892763bc0d..68a8bb1532f 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -47,6 +47,8 @@ using namespace std; #include "btr0cur.h" #include "page0types.h" #include "log0recv.h" +#else +#define page_warn_strict_checksum(A,B,C,D) #endif /* !UNIV_INNOCHECKSUM */ #include "zlib.h" #ifndef UNIV_HOTBACKUP diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 8d2e3645eec..0a5eb4374f1 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -252,7 +252,8 @@ row_merge_buf_redundant_convert( dfield_t* field, ulint len, ulint zip_size, - mem_heap_t* heap) + mem_heap_t* heap, + trx_t* trx) { ut_ad(DATA_MBMINLEN(field->type.mbminmaxlen) == 1); ut_ad(DATA_MBMAXLEN(field->type.mbminmaxlen) > 1); @@ -271,7 +272,7 @@ row_merge_buf_redundant_convert( field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)); byte* data = btr_copy_externally_stored_field( - &ext_len, field_data, zip_size, field_len, heap); + &ext_len, field_data, zip_size, field_len, heap, trx); ut_ad(ext_len < len); @@ -314,7 +315,8 @@ row_merge_buf_add( const row_ext_t* ext, doc_id_t* doc_id, mem_heap_t* conv_heap, - bool* exceed_page) + bool* exceed_page, + trx_t* trx) { ulint i; const dict_index_t* index; @@ -473,7 +475,7 @@ row_merge_buf_add( row_merge_buf_redundant_convert( row_field, field, col->len, dict_table_zip_size(old_table), - conv_heap); + conv_heap, trx); } else { /* Field length mismatch should not happen when rebuilding redundant row @@ -1692,7 +1694,7 @@ write_buffers: (row && (rows_added = row_merge_buf_add( buf, fts_index, old_table, psort_info, row, ext, &doc_id, - conv_heap, &exceed_page)))) { + conv_heap, &exceed_page, trx)))) { /* If we are creating FTS index, a single row can generate more @@ -1805,7 +1807,7 @@ write_buffers: buf, fts_index, old_table, psort_info, row, ext, &doc_id, conv_heap, - &exceed_page)))) { + &exceed_page, trx)))) { /* An empty buffer should have enough room for at least one record. */ ut_error; -- cgit v1.2.1 From b83855a1c7578775aa288125db22d5731bf2b43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Jun 2015 14:55:21 +0300 Subject: Fix innochecksum build failure. --- storage/innobase/include/page0zip.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 6fe6934e35c..0c2abef4b09 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -545,6 +545,21 @@ from outside the buffer pool. # define UNIV_INLINE UNIV_INLINE_ORIGINAL #endif +#ifdef UNIV_INNOCHECKSUM +/** Issue a warning when the checksum that is stored in the page is valid, +but different than the global setting innodb_checksum_algorithm. +@param[in] current_algo current checksum algorithm +@param[in] page_checksum page valid checksum +@param[in] space_id tablespace id +@param[in] page_no page number */ +void +page_warn_strict_checksum( + srv_checksum_algorithm_t curr_algo, + srv_checksum_algorithm_t page_checksum, + ulint space_id, + ulint page_no); +#endif /* UNIV_INNOCHECKSUM */ + #ifndef UNIV_INNOCHECKSUM #ifndef UNIV_NONINL # include "page0zip.ic" -- cgit v1.2.1 From ababe047f801350495f6e9f25ecf1186981e73e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Jun 2015 15:16:53 +0300 Subject: Fix crash on test innodb.innodb-virtual-columns. We should create only columns really stored to database. --- storage/xtradb/handler/ha_innodb.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 235d0cd95b9..b9baf5ce28f 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -7902,7 +7902,8 @@ calc_row_difference( } } } - innodb_idx++; + if (field->stored_in_db) + innodb_idx++; } /* If the update changes a column with an FTS index on it, we @@ -9600,18 +9601,18 @@ create_table_def( if (flags2 & DICT_TF2_FTS) { /* Adjust for the FTS hidden field */ if (!has_doc_id_col) { - table = dict_mem_table_create(table_name, 0, n_cols + 1, + table = dict_mem_table_create(table_name, 0, s_cols + 1, flags, flags2); /* Set the hidden doc_id column. */ table->fts->doc_col = s_cols; } else { - table = dict_mem_table_create(table_name, 0, n_cols, + table = dict_mem_table_create(table_name, 0, s_cols, flags, flags2); table->fts->doc_col = doc_id_col; } } else { - table = dict_mem_table_create(table_name, 0, n_cols, + table = dict_mem_table_create(table_name, 0, s_cols, flags, flags2); } -- cgit v1.2.1 From 96806025ebff018380f9cf585f80cc93e8cab528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Jun 2015 16:20:55 +0300 Subject: Fix test failure on main.partition_innodb. --- storage/xtradb/handler/ha_innodb.cc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index b9baf5ce28f..0bb72ada5af 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -10550,7 +10550,7 @@ ha_innobase::create( DBUG_ASSERT(thd != NULL); DBUG_ASSERT(create_info != NULL); - if (form->s->fields > REC_MAX_N_USER_FIELDS) { + if (form->s->stored_fields > REC_MAX_N_USER_FIELDS) { DBUG_RETURN(HA_ERR_TOO_MANY_FIELDS); } else if (srv_read_only_mode) { DBUG_RETURN(HA_ERR_TABLE_READONLY); @@ -11931,18 +11931,6 @@ ha_innobase::info_low( prebuilt->trx->op_info = "returning various info to MySQL"; } - - my_snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, ib_table->name, reg_ext); - - unpack_filename(path,path); - - /* Note that we do not know the access time of the table, - nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ - - if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) { - stats.create_time = (ulong) stat_info.ctime; - } } if (flag & HA_STATUS_VARIABLE) { @@ -12228,6 +12216,20 @@ ha_innobase::info_low( if (!(flag & HA_STATUS_NO_LOCK)) { dict_table_stats_unlock(ib_table, RW_S_LATCH); } + + my_snprintf(path, sizeof(path), "%s/%s%s", + mysql_data_home, + table->s->normalized_path.str, + reg_ext); + + unpack_filename(path,path); + + /* Note that we do not know the access time of the table, + nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ + + if (os_file_get_status(path, &stat_info, false) == DB_SUCCESS) { + stats.create_time = (ulong) stat_info.ctime; + } } if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { -- cgit v1.2.1 From 27f0bd7d959fa490ab724ab5bfef9aaa80b1b703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 16 Jun 2015 17:33:21 +0300 Subject: Fix test case innodb.xa_recovery crash on xtradb. --- storage/xtradb/srv/srv0start.cc | 2 +- storage/xtradb/trx/trx0trx.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index a53e22fa3f1..73866520ef0 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -3197,9 +3197,9 @@ innobase_shutdown_for_mysql(void) ibuf_close(); log_shutdown(); - lock_sys_close(); trx_sys_file_format_close(); trx_sys_close(); + lock_sys_close(); /* We don't create these mutexes in RO mode because we don't create the temp files that the cover. */ diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 5ea63295792..4986ee201f8 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -473,11 +473,12 @@ trx_free_prepared( /*==============*/ trx_t* trx) /*!< in, own: trx object */ { - ut_ad(mutex_own(&trx_sys->mutex)); - ut_a(trx_state_eq(trx, TRX_STATE_PREPARED)); ut_a(trx->magic_n == TRX_MAGIC_N); + mutex_exit(&trx_sys->mutex); + lock_trx_release_locks(trx); + mutex_enter(&trx_sys->mutex); trx_undo_free_prepared(trx); assert_trx_in_rw_list(trx); -- cgit v1.2.1 From 985e430c0f1c99cbd0854aae649f8aefff98adc0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 23:55:56 +0200 Subject: after-merge fixes in innobase: compilation error on windows other changes: perfschema merge followup --- mysql-test/include/no_protocol.inc | 8 ++++++++ mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test | 6 +----- mysql-test/suite/funcs_1/t/processlist_val_no_prot.test | 6 +----- mysql-test/suite/stress/t/ddl_archive.test | 5 +---- mysql-test/suite/stress/t/ddl_csv.test | 5 +---- mysql-test/suite/stress/t/ddl_innodb.test | 5 +---- mysql-test/suite/stress/t/ddl_memory.test | 5 +---- mysql-test/suite/stress/t/ddl_myisam.test | 5 +---- mysql-test/t/partition_innodb.test | 2 +- mysql-test/t/query_cache_ps_no_prot.test | 7 +------ sql/mysqld.cc | 2 ++ sql/sql_table.cc | 1 + storage/innobase/srv/srv0start.cc | 6 ++---- 13 files changed, 22 insertions(+), 41 deletions(-) create mode 100644 mysql-test/include/no_protocol.inc diff --git a/mysql-test/include/no_protocol.inc b/mysql-test/include/no_protocol.inc new file mode 100644 index 00000000000..8ffd3509afc --- /dev/null +++ b/mysql-test/include/no_protocol.inc @@ -0,0 +1,8 @@ +# The file with expected results fits only to a run without +# ps-protocol/sp-protocol/cursor-protocol/view-protocol. +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} + diff --git a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test index d6746d92250..88563b046df 100644 --- a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test @@ -25,10 +25,6 @@ let $fixed_bug_30395= 0; # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_priv.inc diff --git a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test index b92c963c79c..a03d3774484 100644 --- a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test @@ -20,10 +20,6 @@ # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_val.inc diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test index 0c47b5fcdd5..c688ae192d0 100644 --- a/mysql-test/suite/stress/t/ddl_archive.test +++ b/mysql-test/suite/stress/t/ddl_archive.test @@ -12,11 +12,8 @@ --source include/have_archive.inc let $engine_type= ARCHIVE; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test index 9f6185c76be..3e0f8acb1d8 100644 --- a/mysql-test/suite/stress/t/ddl_csv.test +++ b/mysql-test/suite/stress/t/ddl_csv.test @@ -12,11 +12,8 @@ --source include/have_csv.inc let $engine_type= CSV; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test index 784ba8ff003..083ec43e7d7 100644 --- a/mysql-test/suite/stress/t/ddl_innodb.test +++ b/mysql-test/suite/stress/t/ddl_innodb.test @@ -12,11 +12,8 @@ --source include/have_innodb.inc let $engine_type= InnoDB; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test index 5178439bff1..bcca77a74d9 100644 --- a/mysql-test/suite/stress/t/ddl_memory.test +++ b/mysql-test/suite/stress/t/ddl_memory.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MEMORY; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test index 8d6226e573b..a9b14690c42 100644 --- a/mysql-test/suite/stress/t/ddl_myisam.test +++ b/mysql-test/suite/stress/t/ddl_myisam.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MyISAM; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index af140611c91..2d90764da0d 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1,4 +1,4 @@ -if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins where plugin_name='innodb'`) +if (`select plugin_auth_version < "5.6.25" from information_schema.plugins where plugin_name='innodb'`) { --skip Not fixed in InnoDB as of 5.6.24 or earlier } diff --git a/mysql-test/t/query_cache_ps_no_prot.test b/mysql-test/t/query_cache_ps_no_prot.test index 16533c7194e..4b2bb842e34 100644 --- a/mysql-test/t/query_cache_ps_no_prot.test +++ b/mysql-test/t/query_cache_ps_no_prot.test @@ -16,12 +16,7 @@ let collation=utf8_unicode_ci; --source include/have_collation.inc # The file with expected results fits only to a run without -# ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc # The main testing script --source include/query_cache_sql_prepare.inc diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a9fc94eadbb..c9682e15eae 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5557,6 +5557,8 @@ int mysqld_main(int argc, char **argv) mysql_cond_signal(&COND_server_started); mysql_mutex_unlock(&LOCK_server_started); + MYSQL_SET_STAGE(0 ,__FILE__, __LINE__); + #if defined(_WIN32) || defined(HAVE_SMEM) handle_connections_methods(); #else diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c31a6fd6474..3a7930f6963 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1672,6 +1672,7 @@ void execute_ddl_log_recovery() (void) mysql_file_delete(key_file_global_ddl_log, file_name, MYF(0)); global_ddl_log.recovery_phase= FALSE; mysql_mutex_unlock(&LOCK_gdl); + thd->reset_query(); delete thd; /* Remember that we don't have a THD */ set_current_thd(0); diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 1b9a1e1a237..7048a44ae97 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -432,8 +432,7 @@ srv_parse_data_file_paths_and_sizes( && *(str + 2) == 'w') { str += 3; /* Initialize new raw device only during bootstrap */ - (srv_data_file_is_raw_partition)[i] = - opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW; + (srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW; } if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') { @@ -441,8 +440,7 @@ srv_parse_data_file_paths_and_sizes( /* Initialize new raw device only during bootstrap */ if ((srv_data_file_is_raw_partition)[i] == 0) { - (srv_data_file_is_raw_partition)[i] = - opt_bootstrap ? SRV_NEW_RAW : SRV_OLD_RAW; + (srv_data_file_is_raw_partition)[i] = SRV_NEW_RAW; } } -- cgit v1.2.1 From 26b0cf4d3f0f7c94da9eb21b899e4ba0359dedfe Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 21:18:59 +0200 Subject: MDEV-8183 Adding option mysqldump --no-data-med * new mysqldump option * add more engines to the "external data engines" list * redo the check to be able to print the list of engines in --help --- client/mysqldump.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index e1181985499..e4683ab79c4 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -97,7 +97,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, static char *alloc_query_str(ulong size); static void field_escape(DYNAMIC_STRING* in, const char *from); -static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, +static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_med= 1, quick= 1, extended_insert= 1, lock_tables=1,ignore_errors=0,flush_logs=0,flush_privileges=0, opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, @@ -203,6 +203,8 @@ const char *compatible_mode_names[]= TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, "", compatible_mode_names, NULL}; +#define MED_ENGINES "MRG_MyISAM, MRG_ISAM, CONNECT, OQGRAPH, SPIDER, VP, FEDERATED" + HASH ignore_table; static struct my_option my_long_options[] = @@ -429,6 +431,9 @@ static struct my_option my_long_options[] = NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-data", 'd', "No row information.", &opt_no_data, &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"no-data-med", 0, "No row information for engines that " + "Manage External Data (" MED_ENGINES ").", &opt_no_data_med, + &opt_no_data_med, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"no-set-names", 'N', "Same as --skip-set-charset.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"opt", OPT_OPTIMIZE, @@ -5406,12 +5411,12 @@ char check_if_ignore_table(const char *table_name, char *table_type) /* If these two types, we do want to skip dumping the table */ - if (!opt_no_data && - (!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") || - !strcmp(table_type,"MRG_ISAM") || - !strcmp(table_type,"CONNECT") || - !strcmp(table_type,"FEDERATED"))) - result= IGNORE_DATA; + if (!opt_no_data && opt_no_data_med) + { + const char *found= strstr(" " MED_ENGINES ",", table_type); + if (found && found[-1] == ' ' && found[strlen(table_type)] == ',') + result= IGNORE_DATA; + } } mysql_free_result(res); DBUG_RETURN(result); -- cgit v1.2.1 From 7bfda275a1b9a4759fcb3dbef4736b1094c892d2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 23:46:22 +0200 Subject: MDEV-8128 cmake fails to detect boost libraries --- storage/oqgraph/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 1a59ae0f0dc..512fa0eb76c 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -24,6 +24,7 @@ IF(MSVC) # ENDIF() ELSE() # See if that works. On old gcc it'll fail because of -fno-rtti +SET(CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIRS}") CHECK_CXX_SOURCE_COMPILES( " #define BOOST_NO_RTTI 1 -- cgit v1.2.1 From 66fd45afce1ba5e1032c32cc891c09d64fa38d9e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 8 Jun 2015 21:06:56 +0200 Subject: MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4 in cmake tests let's treat clang like gcc (same options, same builtins) in many cases. * don't check the compiler when * testing for -fvisibility=hidden support * testing for HAVE_ABI_CXA_DEMANGLE * testing for HAVE_GCC_ATOMIC_BUILTINS * when removing options with string(replace) * when running ${CC} --version (ignore the error instead) * run ABI checks for clang * use "canonical" gcc flags for clang * fix groonga too Also: * add cmake detection for gcc __atomic_* builtins. they might be supported (__ATOMIC_SEQ_CST is defined), but not for all operand sizes. In particular, 64-bit atomic load is problematic on i386 * cache check results for Windows * remove the test for HAVE_CXXABI_H (HAVE_ABI_CXA_DEMANGLE is suffifient) --- cmake/abi_check.cmake | 2 +- cmake/libutils.cmake | 8 +++----- cmake/maintainer.cmake | 4 ++-- cmake/os/WindowsCache.cmake | 5 ++++- config.h.cmake | 2 +- configure.cmake | 15 ++++++++++----- extra/yassl/CMakeLists.txt | 9 +++------ include/atomic/gcc_builtins.h | 4 ++-- include/my_stacktrace.h | 3 +-- plugin/handler_socket/CMakeLists.txt | 4 +--- scripts/CMakeLists.txt | 26 ++++++++++---------------- storage/mroonga/vendor/groonga/CMakeLists.txt | 4 ++-- 12 files changed, 40 insertions(+), 46 deletions(-) diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake index cca595c5635..e8d2737f116 100644 --- a/cmake/abi_check.cmake +++ b/cmake/abi_check.cmake @@ -28,7 +28,7 @@ ELSE() SET(RUN_ABI_CHECK 0) ENDIF() -IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK) +IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND RUN_ABI_CHECK) IF(CMAKE_C_COMPILER MATCHES "ccache$") SET(COMPILER ${CMAKE_C_COMPILER_ARG1}) STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER}) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 8fcfe294f17..636737b2083 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -308,17 +308,15 @@ INCLUDE(CheckCCompilerFlag) SET(VISIBILITY_HIDDEN_FLAG) -IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX) +IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden") +ELSEIF(UNIX) CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN) IF(HAVE_VISIBILITY_HIDDEN) SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden") ENDIF() ENDIF() -IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") - SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden") -ENDIF() - # We try to hide the symbols in yassl/zlib to avoid name clashes with # other libraries like openssl. FUNCTION(RESTRICT_SYMBOL_EXPORTS target) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 625ecb5a221..4fe2546d709 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -41,11 +41,11 @@ IF(MYSQL_MAINTAINER_MODE MATCHES "ERR") ENDIF() # Set warning flags for GCC/Clang -IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") +IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") SET(MY_MAINTAINER_C_WARNINGS "${MY_C_WARNING_FLAGS}") ENDIF() # Set warning flags for G++/Clang++ -IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") +IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") SET(MY_MAINTAINER_CXX_WARNINGS "${MY_CXX_WARNING_FLAGS}") ENDIF() diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index c75f2e45bf6..b805ec4fb43 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -351,7 +351,6 @@ SET(C_HAS___inline 1 CACHE INTERNAL "") SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "") SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "") SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "") -SET(HAVE_CXXABI_H CACHE INTERNAL "") SET(HAVE_NDIR_H CACHE INTERNAL "") SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") @@ -371,4 +370,8 @@ SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "") SET(HAVE_UCONTEXT_H CACHE INTERNAL "") SET(HAVE_SOCKPEERCRED CACHE INTERNAL "") SET(HAVE_GGDB3 CACHE INTERNAL "") +SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "") +SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "") +SET(HAVE_GCC_C11_ATOMICS CACHE INTERNAL "") +SET(HAVE_VISIBILITY_HIDDEN CACHE INTERNAL "") ENDIF(MSVC) diff --git a/config.h.cmake b/config.h.cmake index 9651a833a57..46eed79dfa5 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -27,7 +27,6 @@ #cmakedefine HAVE_BSEARCH 1 #cmakedefine HAVE_CRYPT_H 1 #cmakedefine HAVE_CURSES_H 1 -#cmakedefine HAVE_CXXABI_H 1 #cmakedefine HAVE_BFD_H 1 #cmakedefine HAVE_NCURSES_H 1 #cmakedefine HAVE_NDIR_H 1 @@ -471,6 +470,7 @@ #cmakedefine MY_ATOMIC_MODE_DUMMY 1 #cmakedefine MY_ATOMIC_MODE_RWLOCKS 1 #cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1 +#cmakedefine HAVE_GCC_C11_ATOMICS 1 #cmakedefine HAVE_SOLARIS_ATOMIC 1 #cmakedefine HAVE_DECL_SHM_HUGETLB 1 #cmakedefine HAVE_LARGE_PAGES 1 diff --git a/configure.cmake b/configure.cmake index 215b0dc32b4..fb127688bd2 100644 --- a/configure.cmake +++ b/configure.cmake @@ -52,7 +52,7 @@ IF(NOT SYSTEM_TYPE) ENDIF() ENDIF() -IF(CMAKE_COMPILER_IS_GNUCXX) +IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") # MySQL "canonical" GCC flags. At least -fno-rtti flag affects # ABI and cannot be simply removed. SET(CMAKE_CXX_FLAGS @@ -175,7 +175,6 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) -CHECK_INCLUDE_FILE_CXX (cxxabi.h HAVE_CXXABI_H) CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) @@ -874,7 +873,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf SET(SPRINTFS_RETURNS_INT 1) -IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H) +IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") CHECK_CXX_SOURCE_COMPILES(" #include int main(int argc, char **argv) @@ -946,7 +945,6 @@ SET(SIGNAL_WITH_VIO_CLOSE 1) MARK_AS_ADVANCED(NO_ALARM) -IF(CMAKE_COMPILER_IS_GNUCXX) IF(WITH_ATOMIC_OPS STREQUAL "up") SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency") ELSEIF(WITH_ATOMIC_OPS STREQUAL "rwlocks") @@ -977,10 +975,17 @@ ELSEIF(NOT WITH_ATOMIC_OPS) return 0; }" HAVE_GCC_ATOMIC_BUILTINS) + CHECK_CXX_SOURCE_COMPILES(" + int main() + { + long long int var= 1; + long long int *ptr= &var; + return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); + }" + HAVE_GCC_C11_ATOMICS) ELSE() MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!") ENDIF() -ENDIF() SET(WITH_ATOMIC_OPS "${WITH_ATOMIC_OPS}" CACHE STRING "Implement atomic operations using pthread rwlocks (rwlocks); or atomic CPU diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt index 23404a661d6..f3232896c6a 100644 --- a/extra/yassl/CMakeLists.txt +++ b/extra/yassl/CMakeLists.txt @@ -20,12 +20,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL) ADD_DEFINITIONS(${SSL_DEFINES}) -IF(CMAKE_COMPILER_IS_GNUXX) - #Remove -fno-implicit-templates - #(yassl sources cannot be compiled with it) - STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS -${CMAKE_CXX_FLAGS}) -ENDIF() +#Remove -fno-implicit-templates +#(yassl sources cannot be compiled with it) +STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp src/yassl_imp.cpp src/yassl_int.cpp) diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h index 6e807b3c51c..56a0323aedf 100644 --- a/include/atomic/gcc_builtins.h +++ b/include/atomic/gcc_builtins.h @@ -31,8 +31,8 @@ #define make_atomic_store_body(S) *a= v #define MY_ATOMIC_MODE "gcc-builtins-up" -#elif defined(__ATOMIC_SEQ_CST) -#define MY_ATOMIC_MODE "gcc-builtins-smp" +#elif defined(HAVE_GCC_C11_ATOMICS) +#define MY_ATOMIC_MODE "gcc-atomics-smp" #define make_atomic_load_body(S) \ ret= __atomic_load_n(a, __ATOMIC_SEQ_CST) #define make_atomic_store_body(S) \ diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h index ad05a7df9ab..fb2525e3a12 100644 --- a/include/my_stacktrace.h +++ b/include/my_stacktrace.h @@ -35,8 +35,7 @@ #define HAVE_WRITE_CORE -#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \ - HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \ +#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_ABI_CXA_DEMANGLE && \ HAVE_WEAK_SYMBOL #define BACKTRACE_DEMANGLE 1 #endif diff --git a/plugin/handler_socket/CMakeLists.txt b/plugin/handler_socket/CMakeLists.txt index 358139eda1e..2e7caa80897 100644 --- a/plugin/handler_socket/CMakeLists.txt +++ b/plugin/handler_socket/CMakeLists.txt @@ -6,9 +6,7 @@ IF(WIN32) ENDIF() #Remove -fno-implicit-templates from compiler flags(handlersocket would not work with it) -IF(CMAKE_COMPILER_IS_GNUCXX) - STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -ENDIF() +STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) INCLUDE_DIRECTORIES(libhsclient) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index eadd6ae5af0..79d87fcf6be 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -147,22 +147,16 @@ SET(CONFIGURE_LINE "Built using CMake") # Also required for mysqlbug, autoconf only supports --version so for now we # just explicitly require GNU -IF(CMAKE_COMPILER_IS_GNUCC) - EXECUTE_PROCESS( - COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version - COMMAND sed 1q - OUTPUT_VARIABLE CC_VERSION) -ELSE() - SET(CC_VERSION "") -ENDIF() -IF(CMAKE_COMPILER_IS_GNUCXX) - EXECUTE_PROCESS( - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version - COMMAND sed 1q - OUTPUT_VARIABLE CXX_VERSION) -ELSE() - SET(CXX_VERSION "") -ENDIF() +EXECUTE_PROCESS( + COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version + COMMAND sed 1q + ERROR_QUIET + OUTPUT_VARIABLE CC_VERSION) +EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version + COMMAND sed 1q + ERROR_QUIET + OUTPUT_VARIABLE CXX_VERSION) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index 85a84f91ef0..f1ca174ed50 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -168,7 +168,7 @@ macro(check_build_flag flag) check_cxxflag(${flag}) endmacro() -if(CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) check_build_flag("-Wall") check_build_flag("-Wextra") check_build_flag("-Wno-unused-but-set-variable") @@ -201,7 +201,7 @@ endif() option(GRN_WITH_DEBUG "enable debug build." OFF) if(GRN_WITH_DEBUG) - if(CMAKE_COMPILER_IS_GNUCXX) + if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX) set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} -g3 -O0") set(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} -g3 -O0") endif() -- cgit v1.2.1 From b56ad494b47c19fef98101c224ed764664691b72 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 16 Jun 2015 17:27:53 +0200 Subject: MDEV-8287 DROP TABLE suppresses all engine errors in ha_delete_table() * only convert ENOENT and HA_ERR_NO_SUCH_TABLE to warnings * only return real error codes (that is, not ENOENT and not HA_ERR_NO_SUCH_TABLE) * intercept HA_ERR_ROW_IS_REFERENCED to generate backward compatible ER_ROW_IS_REFERENCED in mysql_rm_table_no_locks() * no special code to handle HA_ERR_ROW_IS_REFERENCED * no special code to handle ENOENT and HA_ERR_NO_SUCH_TABLE * return multi-table error ER_BAD_TABLE_ERROR only when there were many errors, not when there were many tables to drop (but only one table generated an error) --- mysql-test/r/partition_myisam.result | 2 +- mysql-test/r/partition_not_blackhole.result | 2 +- .../percona/percona_innodb_fake_changes.result | 2 +- .../suite/percona/percona_innodb_fake_changes.test | 2 +- mysql-test/t/partition_myisam.test | 2 +- mysql-test/t/partition_not_blackhole.test | 2 +- sql/handler.cc | 85 ++++++++++++++-------- sql/sql_table.cc | 28 +++---- 8 files changed, 68 insertions(+), 57 deletions(-) diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index 80b3a9511ea..bb1a7b19a9d 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -90,7 +90,7 @@ ERROR HY000: Failed to read from the .par file # Note that it is currently impossible to drop a partitioned table # without the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition # # Bug#50392: insert_id is not reset for partitioned tables # auto_increment on duplicate entry diff --git a/mysql-test/r/partition_not_blackhole.result b/mysql-test/r/partition_not_blackhole.result index 923d70c0ad6..7759f947c32 100644 --- a/mysql-test/r/partition_not_blackhole.result +++ b/mysql-test/r/partition_not_blackhole.result @@ -11,6 +11,6 @@ t1 SHOW CREATE TABLE t1; ERROR HY000: Incorrect information in file: './test/t1.frm' DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition t1.frm t1.par diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result index 95f0c07cd11..1b870fdbb92 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.result +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.result @@ -45,7 +45,7 @@ BEGIN; CREATE TABLE t2 (a INT) ENGINE=InnoDB; ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database") DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option TRUNCATE TABLE t1; ERROR HY000: Got error 131 "Command not supported by database" during COMMIT ALTER TABLE t1 ENGINE=MyISAM; diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.test b/mysql-test/suite/percona/percona_innodb_fake_changes.test index 5fa3ecc7b63..67f5450ba45 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.test +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.test @@ -38,7 +38,7 @@ SET innodb_fake_changes=1; BEGIN; --error 1005 CREATE TABLE t2 (a INT) ENGINE=InnoDB; ---error 1051 +--error 1031 DROP TABLE t1; --error 1180 TRUNCATE TABLE t1; diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test index a33b9e19fbf..bce0c6f009c 100644 --- a/mysql-test/t/partition_myisam.test +++ b/mysql-test/t/partition_myisam.test @@ -123,7 +123,7 @@ CHECK TABLE t1; SELECT * FROM t1; --echo # Note that it is currently impossible to drop a partitioned table --echo # without the .par file ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --remove_file $MYSQLD_DATADIR/test/t1.frm --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI diff --git a/mysql-test/t/partition_not_blackhole.test b/mysql-test/t/partition_not_blackhole.test index 7352aeaa230..3731d659ad0 100644 --- a/mysql-test/t/partition_not_blackhole.test +++ b/mysql-test/t/partition_not_blackhole.test @@ -19,7 +19,7 @@ SHOW TABLES; --replace_result $MYSQLD_DATADIR ./ --error ER_NOT_FORM_FILE SHOW CREATE TABLE t1; ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --list_files $MYSQLD_DATADIR/test t1* --remove_file $MYSQLD_DATADIR/test/t1.frm diff --git a/sql/handler.cc b/sql/handler.cc index 70bce6f3963..1f8daf3927b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2298,9 +2298,11 @@ handle_condition(THD *, } -/** @brief - This should return ENOENT if the file doesn't exists. - The .frm file will be deleted only if we return 0 or ENOENT +/** delete a table in the engine + + @note + ENOENT and HA_ERR_NO_SUCH_TABLE are not considered errors. + The .frm file will be deleted only if we return 0. */ int ha_delete_table(THD *thd, handlerton *table_type, const char *path, const char *db, const char *alias, bool generate_warning) @@ -2315,47 +2317,66 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path, /* table_type is NULL in ALTER TABLE when renaming only .frm files */ if (table_type == NULL || table_type == view_pseudo_hton || ! (file=get_new_handler((TABLE_SHARE*)0, thd->mem_root, table_type))) - DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); + DBUG_RETURN(0); bzero((char*) &dummy_table, sizeof(dummy_table)); bzero((char*) &dummy_share, sizeof(dummy_share)); dummy_table.s= &dummy_share; path= get_canonical_filename(file, path, tmp_path); - if ((error= file->ha_delete_table(path)) && generate_warning) + if ((error= file->ha_delete_table(path))) { /* - Because file->print_error() use my_error() to generate the error message - we use an internal error handler to intercept it and store the text - in a temporary buffer. Later the message will be presented to user - as a warning. + it's not an error if the table doesn't exist in the engine. + warn the user, but still report DROP being a success */ - Ha_delete_table_error_handler ha_delete_table_error_handler; - - /* Fill up strucutures that print_error may need */ - dummy_share.path.str= (char*) path; - dummy_share.path.length= strlen(path); - dummy_share.normalized_path= dummy_share.path; - dummy_share.db.str= (char*) db; - dummy_share.db.length= strlen(db); - dummy_share.table_name.str= (char*) alias; - dummy_share.table_name.length= strlen(alias); - dummy_table.alias.set(alias, dummy_share.table_name.length, - table_alias_charset); + bool intercept= error == ENOENT || error == HA_ERR_NO_SUCH_TABLE; - file->change_table_ptr(&dummy_table, &dummy_share); - - thd->push_internal_handler(&ha_delete_table_error_handler); - file->print_error(error, 0); + if (!intercept || generate_warning) + { + /* + Because file->print_error() use my_error() to generate the error message + we use an internal error handler to intercept it and store the text + in a temporary buffer. Later the message will be presented to user + as a warning. + */ + Ha_delete_table_error_handler ha_delete_table_error_handler; + + /* Fill up strucutures that print_error may need */ + dummy_share.path.str= (char*) path; + dummy_share.path.length= strlen(path); + dummy_share.normalized_path= dummy_share.path; + dummy_share.db.str= (char*) db; + dummy_share.db.length= strlen(db); + dummy_share.table_name.str= (char*) alias; + dummy_share.table_name.length= strlen(alias); + dummy_table.alias.set(alias, dummy_share.table_name.length, + table_alias_charset); + + file->change_table_ptr(&dummy_table, &dummy_share); + +#if MYSQL_VERSION_ID > 100105 + // XXX as an ugly 10.0-only hack we intercept HA_ERR_ROW_IS_REFERENCED, + // to report it under the old historical error number. +#error remove HA_ERR_ROW_IS_REFERENCED, use ME_JUST_WARNING instead of a handler +#endif + if (intercept || error == HA_ERR_ROW_IS_REFERENCED) + thd->push_internal_handler(&ha_delete_table_error_handler); - thd->pop_internal_handler(); + file->print_error(error, 0); - /* - XXX: should we convert *all* errors to warnings here? - What if the error is fatal? - */ - push_warning(thd, Sql_condition::WARN_LEVEL_WARN, error, - ha_delete_table_error_handler.buff); + if (intercept || error == HA_ERR_ROW_IS_REFERENCED) + { + thd->pop_internal_handler(); + if (error == HA_ERR_ROW_IS_REFERENCED) + my_message(ER_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED), MYF(0)); + else + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, error, + ha_delete_table_error_handler.buff); + } + } + if (intercept) + error= 0; } delete file; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3a7930f6963..20cfccaa3d9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2201,15 +2201,13 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, char path[FN_REFLEN + 1], wrong_tables_buff[160], *alias= NULL; String wrong_tables(wrong_tables_buff, sizeof(wrong_tables_buff)-1, system_charset_info); - uint path_length= 0; + uint path_length= 0, errors= 0; int error= 0; int non_temp_tables_count= 0; - bool foreign_key_error=0; bool non_tmp_error= 0; bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0; bool non_tmp_table_deleted= 0; bool is_drop_tmp_if_exists_added= 0; - bool one_table= tables->next_local == 0; bool was_view= 0; String built_query; String built_trans_tmp_query, built_non_trans_tmp_query; @@ -2495,12 +2493,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, error= ha_delete_table(thd, table_type, path, db, table->table_name, !dont_log_query); - if (error == HA_ERR_ROW_IS_REFERENCED) - { - /* the table is referenced by a foreign key constraint */ - foreign_key_error= 1; - } - if (!error || error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) + if (!error) { int frm_delete_error, trigger_drop_error= 0; /* Delete the table definition file */ @@ -2518,11 +2511,8 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, if (trigger_drop_error || (frm_delete_error && frm_delete_error != ENOENT)) error= 1; - else if (!frm_delete_error || !error || if_exists) - { - error= 0; + else if (frm_delete_error && if_exists) thd->clear_error(); - } } non_tmp_error= error ? TRUE : non_tmp_error; } @@ -2533,6 +2523,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, wrong_tables.append(db); wrong_tables.append('.'); wrong_tables.append(table->table_name); + errors++; } else { @@ -2556,14 +2547,13 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, err: if (wrong_tables.length()) { - if (one_table && was_view) + DBUG_ASSERT(errors); + if (errors == 1 && was_view) my_printf_error(ER_IT_IS_A_VIEW, ER(ER_IT_IS_A_VIEW), MYF(0), wrong_tables.c_ptr_safe()); - else if (!foreign_key_error) + else if (errors > 1 || !thd->is_error()) my_printf_error(ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR), MYF(0), wrong_tables.c_ptr_safe()); - else - my_message(ER_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED), MYF(0)); error= 1; } @@ -2614,8 +2604,8 @@ err: /* Chop of the last comma */ built_query.chop(); built_query.append(" /* generated by server */"); - int error_code = (non_tmp_error ? - (foreign_key_error ? ER_ROW_IS_REFERENCED : ER_BAD_TABLE_ERROR) : 0); + int error_code = non_tmp_error ? thd->get_stmt_da()->sql_errno() + : 0; error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_query.ptr(), built_query.length(), -- cgit v1.2.1 From 5a4c5fa211e72fc6d32c2c2afcfb596e5949213a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 17 Jun 2015 14:18:16 +0200 Subject: MDEV-5977 MariaDB 10.0 is not installable on Trusty when "trusty-updates universe" is in sources.list fix upgrade[2] tests on trusty and utopic: add missing conflicts/replaces, client-10.0 should conflict/replace client-5.5. reformat other conflicts/replaces lines to make them easier to read and merge --- debian/dist/Debian/control | 59 ++++++++++++++++++++++++++++------------------ debian/dist/Ubuntu/control | 51 ++++++++++++++++++++++++++------------- 2 files changed, 71 insertions(+), 39 deletions(-) diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 8c236dae897..b3027b3f463 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -21,7 +21,9 @@ Architecture: any Depends: mariadb-common, libmysqlclient18 (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: mariadb-server-10.0 (<< 10.0.5), mariadb-galera-server-10.0 (<< 10.0.5), mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33), - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3 + mariadb-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3 Description: MariaDB database client library MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -110,13 +112,15 @@ Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Description: MariaDB database core client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -136,11 +140,16 @@ Provides: virtual-mysql-client, mysql-client, mysql-client-4.1, mysql-client-5.1, mysql-client-5.5 Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mysql-client-5.5 + mariadb-client-5.1, + mariadb-client-5.2, + mariadb-client-5.3, + mariadb-client-5.5, mysql-client-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, - mysql-client-5.5, mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3 + mariadb-client-5.1, + mariadb-client-5.2, + mariadb-client-5.3, + mariadb-client-5.5, mysql-client-5.5 Description: MariaDB database client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -154,18 +163,16 @@ Package: mariadb-server-core-10.0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}) Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5 -Conflicts: mariadb-server-5.1 (<< 5.1.60), - mariadb-server-5.2 (<< 5.2.10), - mariadb-server-5.3 (<< 5.3.3), - mysql-server-5.0, - mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, - mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5 -Replaces: mariadb-server-5.1 (<< 5.1.60), - mariadb-server-5.2 (<< 5.2.10), - mariadb-server-5.3 (<< 5.3.3), - mysql-server-5.0, - mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, - mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5 +Conflicts: mysql-server-5.0, mysql-server-core-5.0, + mariadb-server-core-5.1, mysql-server-core-5.1, + mariadb-server-core-5.2, + mariadb-server-core-5.3, + mariadb-server-core-5.5, mysql-server-core-5.5 +Replaces: mysql-server-5.0, mysql-server-core-5.0, + mariadb-server-core-5.1, mysql-server-core-5.1, + mariadb-server-core-5.2, + mariadb-server-core-5.3, + mariadb-server-core-5.5, mysql-server-core-5.5 Description: MariaDB database core server files MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -178,10 +185,10 @@ Package: mariadb-test-10.0 Section: database Architecture: any Depends: mariadb-server-10.0 (= ${source:Version}), mariadb-client-10.0 (= ${source:Version}) +Suggests: patch Conflicts: mariadb-test (<< ${source:Version}), mariadb-test-5.1, mariadb-test-5.2, mariadb-test-5.3, mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33) -Suggests: patch Replaces: mariadb-test (<< ${source:Version}), mariadb-test-5.1, mariadb-test-5.2, mariadb-test-5.3 Description: MariaDB database regression test suite @@ -203,12 +210,18 @@ Depends: mariadb-client-10.0 (>= ${source:Version}), libdbi-perl, mariadb-server-core-10.0 (>= ${binary:Version}) Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), - mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mysql-server-4.1, mysql-server-5.0, + mariadb-server-5.1, mysql-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3, + mariadb-server-5.5, mysql-server-5.5, mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), - mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mysql-server-4.1, mysql-server-5.0, + mariadb-server-5.1, mysql-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3, + mariadb-server-5.5, mysql-server-5.5, libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0), mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Description: MariaDB database server binaries diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index 37c1fc29e00..7133074b4ec 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -21,7 +21,9 @@ Architecture: any Depends: mariadb-common, libmysqlclient18 (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: mariadb-server-10.0 (<< 10.0.5), mariadb-galera-server-10.0 (<< 10.0.5), mariadb-server-5.5 (<< 5.5.33), mariadb-galera-server-5.5 (<< 5.5.33), - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3 + mariadb-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3 Description: MariaDB database client library MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -110,13 +112,15 @@ Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Description: MariaDB database core client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -136,11 +140,16 @@ Provides: virtual-mysql-client, mysql-client, mysql-client-4.1, mysql-client-5.1, mysql-client-5.5 Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mysql-client-5.5 + mariadb-client-5.1, + mariadb-client-5.2, + mariadb-client-5.3, + mariadb-client-5.5, mysql-client-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, - mysql-client-5.5, mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3 + mariadb-client-5.1, + mariadb-client-5.2, + mariadb-client-5.3, + mariadb-client-5.5, mysql-client-5.5 Description: MariaDB database client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -154,12 +163,16 @@ Package: mariadb-server-core-10.0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}) Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5 -Conflicts: mysql-server-5.0, - mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, - mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5 -Replaces: mysql-server-5.0, - mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, - mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5 +Conflicts: mysql-server-5.0, mysql-server-core-5.0, + mariadb-server-core-5.1, mysql-server-core-5.1, + mariadb-server-core-5.2, + mariadb-server-core-5.3, + mariadb-server-core-5.5, mysql-server-core-5.5 +Replaces: mysql-server-5.0, mysql-server-core-5.0, + mariadb-server-core-5.1, mysql-server-core-5.1, + mariadb-server-core-5.2, + mariadb-server-core-5.3, + mariadb-server-core-5.5, mysql-server-core-5.5 Description: MariaDB database core server files MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -197,12 +210,18 @@ Depends: mariadb-client-10.0 (>= ${source:Version}), libdbi-perl, mariadb-server-core-10.0 (>= ${binary:Version}) Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), - mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mysql-server-4.1, mysql-server-5.0, + mariadb-server-5.1, mysql-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3, + mariadb-server-5.5, mysql-server-5.5, mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), - mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mysql-server-4.1, mysql-server-5.0, + mariadb-server-5.1, mysql-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3, + mariadb-server-5.5, mysql-server-5.5, libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0), mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Description: MariaDB database server binaries -- cgit v1.2.1 From a6087e7dc1ef3561d8189c8db15e9591d0f9b520 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 17 Jun 2015 16:13:02 +0200 Subject: MDEV-5309 - RENAME TABLE does not check for existence of the table's engine fix the test case for ps-protocol --- mysql-test/r/plugin.result | 3 +++ mysql-test/t/plugin.test | 2 ++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 3a2bb32b13d..510c812a30f 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -327,6 +327,9 @@ plugin_name # INSTALL PLUGIN example SONAME 'ha_example'; CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +a +FLUSH TABLES; UNINSTALL PLUGIN example; RENAME TABLE t1 TO t2; ERROR 42S02: Table 'test.t1' doesn't exist diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 9c2a408b612..13e2c71fbc4 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -259,6 +259,8 @@ select plugin_name from information_schema.plugins where plugin_library like 'ha --echo # INSTALL PLUGIN example SONAME 'ha_example'; CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +FLUSH TABLES; UNINSTALL PLUGIN example; --error ER_NO_SUCH_TABLE RENAME TABLE t1 TO t2; -- cgit v1.2.1