4569 magnus.blaudd@stripped 2012-06-13 [merge]
Merge 7.0 -> 7.1
modified:
sql/ha_ndbcluster.cc
4568 magnus.blaudd@stripped 2012-06-13 [merge]
Merge 7.0 -> 7.1
renamed:
mysql-test/include/rpl_multi_engine2.inc => mysql-test/suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc
modified:
mysql-test/suite/ndb/r/ndb_alter_table_online.result
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/t/ndb_alter_table_online.test
mysql-test/suite/ndb_rpl/r/ndb_rpl_dd_advance.result
mysql-test/suite/ndb_rpl/t/ndb_rpl_2multi_basic.inc
mysql-test/suite/ndb_rpl/t/ndb_rpl_dd_advance.test
sql/ha_ndbcluster.cc
storage/ndb/include/ndb_version.h.in
storage/ndb/include/ndbapi/NdbScanOperation.hpp
storage/ndb/src/common/util/version.cpp
4567 Craig L Russell 2012-06-11
QueryUniqueKeyTest is still causing ndbd to crash in 7.1 but not in 7.2
modified:
storage/ndb/clusterj/clusterj-test/Makefile.am
=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online.result 2012-03-19 09:44:55 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online.result 2012-06-08 07:53:18 +0000
@@ -266,7 +266,7 @@ ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
-ALTER TABLE t1 ADD c TIMESTAMP;
+ALTER TABLE t1 ADD c TIMESTAMP DEFAULT 0;
INSERT INTO t1 values (2,2,'2007-09-19 18:46:02');
SELECT * FROM t1 ORDER BY a;
a b c
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result 2012-03-21 06:28:31 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result 2012-06-11 10:23:01 +0000
@@ -131,6 +131,8 @@ ndb_table_temporary #
ndb_use_copying_alter_table #
ndb_use_exact_count #
ndb_use_transactions #
+ndb_version #
+ndb_version_string #
ndb_wait_connected #
ndb_wait_setup #
CREATE TABLE t1 (
=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table_online.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online.test 2012-03-19 09:44:55 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online.test 2012-06-08 07:53:18 +0000
@@ -234,7 +234,7 @@ ALTER ONLINE TABLE t1 ADD c TIMESTAMP;
--source ndb_show_tables_result.inc
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
-ALTER TABLE t1 ADD c TIMESTAMP;
+ALTER TABLE t1 ADD c TIMESTAMP DEFAULT 0;
INSERT INTO t1 values (2,2,'2007-09-19 18:46:02');
SELECT * FROM t1 ORDER BY a;
=== modified file 'mysql-test/suite/ndb_rpl/r/ndb_rpl_dd_advance.result'
--- a/mysql-test/suite/ndb_rpl/r/ndb_rpl_dd_advance.result 2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/r/ndb_rpl_dd_advance.result 2012-06-12 16:10:00 +0000
@@ -143,9 +143,9 @@ SELECT * FROM t1 ORDER BY c1 LIMIT 5;
c1 c2 c3 c5
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
2 4.00 b1b1b1b1b1b1b1b1b1b1 NULL
-3 6.00 0000-00-00 00:00:00 NULL
-4 8.00 0000-00-00 00:00:00 NULL
-5 10.00 0000-00-00 00:00:00 NULL
+3 6.00 <c4_timestamp_value> NULL
+4 8.00 <c4_timestamp_value> NULL
+5 10.00 <c4_timestamp_value> NULL
**** Show last set of ALTERs on SLAVE ****
SHOW CREATE TABLE t1;
Table Create Table
@@ -162,9 +162,9 @@ SELECT * FROM t1 ORDER BY c1 LIMIT 5;
c1 c2 c3 c5
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
2 4.00 b1b1b1b1b1b1b1b1b1b1 NULL
-3 6.00 0000-00-00 00:00:00 NULL
-4 8.00 0000-00-00 00:00:00 NULL
-5 10.00 0000-00-00 00:00:00 NULL
+3 6.00 <c4_timestamp_value> NULL
+4 8.00 <c4_timestamp_value> NULL
+5 10.00 <c4_timestamp_value> NULL
SELECT * FROM t1 where c1 = 1;
c1 c2 c3 c5
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_2multi_basic.inc'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_2multi_basic.inc 2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_2multi_basic.inc 2012-06-12 18:23:54 +0000
@@ -38,7 +38,7 @@ SHOW CREATE TABLE t1;
sync_slave_with_master;
SHOW CREATE TABLE t1;
---source include/rpl_multi_engine2.inc
+--source suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc
#################################################
# Okay lets see how it holds up to table changes
@@ -58,7 +58,7 @@ SHOW CREATE TABLE t1;
sync_slave_with_master;
SHOW CREATE TABLE t1;
---source include/rpl_multi_engine2.inc
+--source suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc
#################################################
--echo --- Check that replication works when slave has more columns than master
@@ -89,7 +89,7 @@ SELECT *
FROM t1
ORDER BY id;
---source include/rpl_multi_engine2.inc
+--source suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc
TRUNCATE TABLE t1;
#################################################
@@ -107,7 +107,7 @@ ALTER TABLE t1 DROP COLUMN y;
SHOW CREATE TABLE t1;
---source include/rpl_multi_engine2.inc
+--source suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc
TRUNCATE TABLE t1;
#################################################
=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_dd_advance.test'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_dd_advance.test 2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_dd_advance.test 2012-06-12 16:10:00 +0000
@@ -91,6 +91,8 @@ CREATE INDEX t1_i ON t1(c2, c3);
#Bug 18039
CREATE UNIQUE INDEX t1_i2 ON t1(c2);
ALTER TABLE t1 ADD c4 TIMESTAMP;
+# Save the TIMESTAMP value of c4 for later masking of .result file
+let $c4_timestamp_value=`select c4 FROM t1 WHERE c1 = 1`;
ALTER TABLE t1 ADD c5 DOUBLE;
ALTER TABLE t1 ADD INDEX (c5);
SHOW CREATE TABLE t1;
@@ -154,12 +156,14 @@ UPDATE t1 SET c3=@b1 where c1 = 2;
--echo **** Show last set of ALTERs on MASTER ****
SHOW CREATE TABLE t1;
+--replace_result $c4_timestamp_value <c4_timestamp_value>
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
--echo **** Show last set of ALTERs on SLAVE ****
--sync_slave_with_master
connection slave;
SHOW CREATE TABLE t1;
+--replace_result $c4_timestamp_value <c4_timestamp_value>
# Bug 18094
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
SELECT * FROM t1 where c1 = 1;
=== renamed file 'mysql-test/include/rpl_multi_engine2.inc' => 'mysql-test/suite/ndb_rpl/t/ndb_rpl_multi_engine2.inc'
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2012-06-07 10:58:14 +0000
+++ b/sql/ha_ndbcluster.cc 2012-06-13 19:10:06 +0000
@@ -31,7 +31,6 @@
#include "ha_ndbcluster.h"
#include <ndbapi/NdbApi.hpp>
#include "ha_ndbcluster_cond.h"
-#include <util/Bitmask.hpp>
#include <ndbapi/NdbIndexStat.hpp>
#include <ndbapi/NdbInterpretedCode.hpp>
@@ -42,6 +41,7 @@
#include <mysql/plugin.h>
#include <ndb_version.h>
+#include <ndb_global.h>
#include "ndb_mi.h"
#include "ndb_conflict.h"
#include "ndb_component.h"
@@ -7275,23 +7275,6 @@ int ha_ndbcluster::start_statement(THD *
else if (thd->slave_thread)
thd_ndb->m_slow_path= TRUE;
}
- /*
- If this is the start of a LOCK TABLE, a table look
- should be taken on the table in NDB
-
- Check if it should be read or write lock
- */
- if (thd_options(thd) & (OPTION_TABLE_LOCK))
- {
- /* This is currently dead code in wait for implementation in NDB */
- /* lockThisTable(); */
- DBUG_PRINT("info", ("Locking the table..." ));
-#ifdef NOT_YET
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG), 0,
- "Table only locked locally in this mysqld", "NDB");
-#endif
- }
DBUG_RETURN(0);
}
@@ -11717,6 +11700,34 @@ static int ndb_wait_setup_func_impl(ulon
int(*ndb_wait_setup_func)(ulong) = 0;
#endif
+
+/* Version in composite numerical format */
+static Uint32 ndb_version = NDB_VERSION_D;
+static MYSQL_SYSVAR_UINT(
+ version, /* name */
+ ndb_version, /* var */
+ PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
+ "Compile version for ndbcluster",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ 0, /* default */
+ 0, /* min */
+ 0, /* max */
+ 0 /* block */
+);
+
+/* Version in ndb-Y.Y.Y[-status] format */
+static char* ndb_version_string = (char*)NDB_NDB_VERSION_STRING;
+static MYSQL_SYSVAR_STR(
+ version_string, /* name */
+ ndb_version_string, /* var */
+ PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
+ "Compile version string for ndbcluster",
+ NULL, /* check func. */
+ NULL, /* update func. */
+ NULL /* default */
+);
+
extern int ndb_dictionary_is_mysqld;
static int ndbcluster_init(void *p)
@@ -16792,6 +16803,8 @@ static struct st_mysql_sys_var* system_v
#ifndef DBUG_OFF
MYSQL_SYSVAR(dbg_check_shares),
#endif
+ MYSQL_SYSVAR(version),
+ MYSQL_SYSVAR(version_string),
NULL
};
=== modified file 'storage/ndb/include/ndb_version.h.in'
--- a/storage/ndb/include/ndb_version.h.in 2012-02-03 13:27:51 +0000
+++ b/storage/ndb/include/ndb_version.h.in 2012-06-13 18:36:43 +0000
@@ -27,6 +27,13 @@
*/
#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
+/*
+ Creates a stringified version from major, minor and build
+ ex: NDB_MAKE_STRING_VERSION(7,0,22) => "7.0.22"
+*/
+#define NDB_MAKE_QUOTED_VERSION(A,B,C) #A "." #B "." #C
+#define NDB_MAKE_STRING_VERSION(A,B,C) NDB_MAKE_QUOTED_VERSION(A,B,C)
+
/* NDB version numbers and status */
#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@
#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@
@@ -37,6 +44,12 @@
#define NDB_VERSION_D \
NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
+/* Version string for NDB, ex: "ndb-7.0.22" */
+#define NDB_NDB_VERSION_STRING \
+ "ndb-" NDB_MAKE_STRING_VERSION(NDB_VERSION_MAJOR, \
+ NDB_VERSION_MINOR, \
+ NDB_VERSION_BUILD) NDB_VERSION_STATUS
+
/*
The version number of the MySQL Server that NDB is built
with. Extracted from MYSQL_VERSION_ID
=== modified file 'storage/ndb/include/ndbapi/NdbScanOperation.hpp'
--- a/storage/ndb/include/ndbapi/NdbScanOperation.hpp 2012-01-19 18:13:07 +0000
+++ b/storage/ndb/include/ndbapi/NdbScanOperation.hpp 2012-06-13 18:36:43 +0000
@@ -41,19 +41,46 @@ class NdbScanOperation : public NdbOpera
public:
/**
- * Scan flags. OR-ed together and passed as second argument to
- * readTuples. Note that SF_MultiRange has to be set if several
- * ranges (bounds) are to be passed.
+ * Scan flags. OR-ed together and passed as argument to
+ * readTuples, scanIndex, and scanTable. Note that SF_MultiRange
+ * has to be set if several ranges (bounds) are to be passed.
*/
enum ScanFlag {
- /* Scan TUP order */
+ /* Scan in TUP order (the order of rows in memory). Table scan only. */
SF_TupScan = (1 << 16),
- /* Scan in DISK order */
+ /* Scan in DISK order (the order of rows on disk). Table scan only. */
SF_DiskScan = (2 << 16),
/*
Return rows from an index scan sorted, ordered on the index key.
+ Both ascending order or descending order scans are affected by this flag.
This flag makes the API perform a merge-sort among the ordered scans of
each fragment, to get a single sorted result set.
+ Note that :
+ 1) Ordered indexes are distributed - there is one for each fragment of a
+ table.
+ 2) Range scans are often parallel - across all index fragments.
+ Occasionally they can be pruned to one index fragment.
+ 3) Each index fragment range scan will return results in either ascending
+ or descending order. Ascending is the default, but descending is
+ chosen if SF_Descending is set.
+ 4) Where multiple index fragments are scanned in parallel, the results
+ are sent back to NdbApi where they can optionally be merge-sorted
+ before being returned to the user. This merge sorting is controlled
+ via the SF_OrderBy and SF_OrderByFull flags.
+ 5) Without SF_OrderBy* flags, the results from each index fragment will
+ be in-order (ascending or descending), but results from different
+ fragments may be interleaved.
+ 6) With SF_OrderBy* flags, some extra constraints are imposed internally:
+ i) If the range scan is not pruned to one index fragment then all
+ index fragments must be scanned in parallel. (Non SF_OrderBy* flag
+ scans can be executed with lower than full-parallelism)
+ ii) Results from every index fragment must be available before returning
+ any row, to ensure a correct merge sort. This serialises the
+ 'scrolling' of the scan, potentially resulting in lower row
+ throughput.
+ iii) Non SF_OrderBy* flag scans can return rows to the Api before all
+ index fragments have returned a batch, and can overlap next-batch
+ requests with Api row processing.
*/
SF_OrderBy = (1 << 24),
/**
@@ -70,6 +97,9 @@ public:
called to read back the range_no defined in
NdbIndexScanOperation::setBound(). See @ref setBound() for
explanation.
+ Additionally, when this flag is set and SF_OrderBy* is also set, results
+ from ranges are returned in their entirety before any results are returned
+ from subsequent ranges.
*/
SF_ReadRangeNo = (4 << 24),
/* Scan is part of multi-range scan. */
=== modified file 'storage/ndb/src/common/util/version.cpp'
--- a/storage/ndb/src/common/util/version.cpp 2012-04-11 09:26:01 +0000
+++ b/storage/ndb/src/common/util/version.cpp 2012-06-13 18:36:43 +0000
@@ -330,6 +330,8 @@ TAPTEST(ndb_version)
printf(" NDB_VERSION_MINOR: %d\n", NDB_VERSION_MINOR);
printf(" NDB_VERSION_BUILD: %d\n", NDB_VERSION_BUILD);
printf(" NDB_VERSION_STATUS: '%s'\n\n", NDB_VERSION_STATUS);
+ printf(" NDB_VERSION_STRING: '%s'\n", NDB_VERSION_STRING);
+ printf(" NDB_NDB_VERSION_STRING: '%s'\n\n", NDB_NDB_VERSION_STRING);
/*
Parse the VERSION string as X.X.X-status */
@@ -422,6 +424,7 @@ TAPTEST(ndb_version)
/* ndbGetOwnVersionString */
printf("ndbGetOwnVersionString: '%s'\n",
ndbGetOwnVersionString());
+ OK(strcmp(NDB_VERSION_STRING, ndbGetOwnVersionString()) == 0); // should match
/* ndbGetOwnVersion */
OK(ndbGetOwnVersion() == ndbMakeVersion(NDB_VERSION_MAJOR,
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (magnus.blaudd:4567 to 4569) | magnus.blaudd | 14 Jun |