Loading mysql-test/r/ndb_read_multi_range.result +24 −0 Original line number Diff line number Diff line Loading @@ -381,3 +381,27 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila'); id tag doc type sakila 1 Some text goes here text DROP TABLE t1; CREATE TABLE t1 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TABLE t2 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TRIGGER testtrigger AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END| INSERT INTO t1 VALUES (1,1),(2,2),(3,3); UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3); DROP TRIGGER testtrigger; DROP TABLE t1, t2; create table t2 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster; insert into t2 values (1,1), (10,10); select * from t2 use index (ab) where a in(1,10) order by a; a b 1 1 10 10 drop table t2; mysql-test/t/ndb_read_multi_range.test +38 −0 Original line number Diff line number Diff line Loading @@ -253,3 +253,41 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka'); SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila'); DROP TABLE t1; #bug#25522 CREATE TABLE t1 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TABLE t2 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1; DELIMITER |; CREATE TRIGGER testtrigger AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END| DELIMITER ;| INSERT INTO t1 VALUES (1,1),(2,2),(3,3); UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3); DROP TRIGGER testtrigger; DROP TABLE t1, t2; #bug#25821 create table t2 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster; insert into t2 values (1,1), (10,10); select * from t2 use index (ab) where a in(1,10) order by a; drop table t2; ndb/include/ndbapi/NdbIndexScanOperation.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -63,12 +63,14 @@ public: bool order_by, bool order_desc = false, bool read_range_no = false, bool keyinfo = false) { bool keyinfo = false, bool multi_range = false) { Uint32 scan_flags = (SF_OrderBy & -(Int32)order_by) | (SF_Descending & -(Int32)order_desc) | (SF_ReadRangeNo & -(Int32)read_range_no) | (SF_KeyInfo & -(Int32)keyinfo); (SF_KeyInfo & -(Int32)keyinfo) | (SF_MultiRange & -(Int32)multi_range); return readTuples(lock_mode, scan_flags, parallel, batch); } Loading ndb/include/ndbapi/NdbScanOperation.hpp +6 −2 Original line number Diff line number Diff line Loading @@ -37,13 +37,15 @@ class NdbScanOperation : public NdbOperation { public: /** * Scan flags. OR-ed together and passed as second argument to * readTuples. * readTuples. Note that SF_MultiRange has to be set if several * ranges (bounds) are to be passed. */ enum ScanFlag { SF_TupScan = (1 << 16), // scan TUP SF_OrderBy = (1 << 24), // index scan in order SF_Descending = (2 << 24), // index scan in descending order SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no SF_MultiRange = (8 << 24), // scan is part of multi-range scan SF_KeyInfo = 1 // request KeyInfo to be sent back }; Loading @@ -70,7 +72,8 @@ public: */ #ifdef ndb_readtuples_impossible_overload int readTuples(LockMode lock_mode = LM_Read, Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false); Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false, bool multi_range = false); #endif inline int readTuples(int parallell){ Loading Loading @@ -262,6 +265,7 @@ protected: bool m_descending; Uint32 m_read_range_no; NdbRecAttr *m_curr_row; // Pointer to last returned row bool m_multi_range; // Mark if operation is part of multi-range scan }; inline Loading ndb/src/mgmclient/CommandInterpreter.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -2120,6 +2120,18 @@ CommandInterpreter::executeStatus(int processId, ndbout << processId << ": Node not found" << endl; return -1; } if (cl->node_states[i].node_type != NDB_MGM_NODE_TYPE_NDB){ if (cl->node_states[i].version != 0){ ndbout << "Node "<< cl->node_states[i].node_id <<": connected" ; ndbout_c(" (Version %d.%d.%d)", getMajor(version) , getMinor(version), getBuild(version)); }else ndbout << "Node "<< cl->node_states[i].node_id <<": not connected" << endl; return 0; } status = cl->node_states[i].node_status; startPhase = cl->node_states[i].start_phase; version = cl->node_states[i].version; Loading Loading
mysql-test/r/ndb_read_multi_range.result +24 −0 Original line number Diff line number Diff line Loading @@ -381,3 +381,27 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila'); id tag doc type sakila 1 Some text goes here text DROP TABLE t1; CREATE TABLE t1 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TABLE t2 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TRIGGER testtrigger AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END| INSERT INTO t1 VALUES (1,1),(2,2),(3,3); UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3); DROP TRIGGER testtrigger; DROP TABLE t1, t2; create table t2 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster; insert into t2 values (1,1), (10,10); select * from t2 use index (ab) where a in(1,10) order by a; a b 1 1 10 10 drop table t2;
mysql-test/t/ndb_read_multi_range.test +38 −0 Original line number Diff line number Diff line Loading @@ -253,3 +253,41 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka'); SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila'); DROP TABLE t1; #bug#25522 CREATE TABLE t1 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1; CREATE TABLE t2 ( var1 int(2) NOT NULL, var2 int(2) NOT NULL, PRIMARY KEY (var1) ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1; DELIMITER |; CREATE TRIGGER testtrigger AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END| DELIMITER ;| INSERT INTO t1 VALUES (1,1),(2,2),(3,3); UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3); DROP TRIGGER testtrigger; DROP TABLE t1, t2; #bug#25821 create table t2 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster; insert into t2 values (1,1), (10,10); select * from t2 use index (ab) where a in(1,10) order by a; drop table t2;
ndb/include/ndbapi/NdbIndexScanOperation.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -63,12 +63,14 @@ public: bool order_by, bool order_desc = false, bool read_range_no = false, bool keyinfo = false) { bool keyinfo = false, bool multi_range = false) { Uint32 scan_flags = (SF_OrderBy & -(Int32)order_by) | (SF_Descending & -(Int32)order_desc) | (SF_ReadRangeNo & -(Int32)read_range_no) | (SF_KeyInfo & -(Int32)keyinfo); (SF_KeyInfo & -(Int32)keyinfo) | (SF_MultiRange & -(Int32)multi_range); return readTuples(lock_mode, scan_flags, parallel, batch); } Loading
ndb/include/ndbapi/NdbScanOperation.hpp +6 −2 Original line number Diff line number Diff line Loading @@ -37,13 +37,15 @@ class NdbScanOperation : public NdbOperation { public: /** * Scan flags. OR-ed together and passed as second argument to * readTuples. * readTuples. Note that SF_MultiRange has to be set if several * ranges (bounds) are to be passed. */ enum ScanFlag { SF_TupScan = (1 << 16), // scan TUP SF_OrderBy = (1 << 24), // index scan in order SF_Descending = (2 << 24), // index scan in descending order SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no SF_MultiRange = (8 << 24), // scan is part of multi-range scan SF_KeyInfo = 1 // request KeyInfo to be sent back }; Loading @@ -70,7 +72,8 @@ public: */ #ifdef ndb_readtuples_impossible_overload int readTuples(LockMode lock_mode = LM_Read, Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false); Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false, bool multi_range = false); #endif inline int readTuples(int parallell){ Loading Loading @@ -262,6 +265,7 @@ protected: bool m_descending; Uint32 m_read_range_no; NdbRecAttr *m_curr_row; // Pointer to last returned row bool m_multi_range; // Mark if operation is part of multi-range scan }; inline Loading
ndb/src/mgmclient/CommandInterpreter.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -2120,6 +2120,18 @@ CommandInterpreter::executeStatus(int processId, ndbout << processId << ": Node not found" << endl; return -1; } if (cl->node_states[i].node_type != NDB_MGM_NODE_TYPE_NDB){ if (cl->node_states[i].version != 0){ ndbout << "Node "<< cl->node_states[i].node_id <<": connected" ; ndbout_c(" (Version %d.%d.%d)", getMajor(version) , getMinor(version), getBuild(version)); }else ndbout << "Node "<< cl->node_states[i].node_id <<": not connected" << endl; return 0; } status = cl->node_states[i].node_status; startPhase = cl->node_states[i].start_phase; version = cl->node_states[i].version; Loading