Commit ee740746 authored by unknown's avatar unknown

Import ndb varsize


BitKeeper/deleted/.del-MetaData.cpp~146ae9865dd35829:
  Delete: storage/ndb/src/kernel/vm/MetaData.cpp
BitKeeper/deleted/.del-MetaData.hpp~538342afcd8ac53c:
  Delete: storage/ndb/src/kernel/vm/MetaData.hpp
BitKeeper/deleted/.del-DbtupLCP.cpp~855b1ed3fbc86a42:
  Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp
BitKeeper/deleted/.del-DbtupSystemRestart.cpp~15b54d7e4e75d2d:
  Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp
BitKeeper/deleted/.del-DbtupUndoLog.cpp~5a2ef6e86b1404e9:
  Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp''
storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp''
storage/ndb/include/kernel/signaldata/CreateObj.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateObj.hpp''
storage/ndb/include/kernel/signaldata/DictObjOp.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/DictObjOp.hpp''
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropFilegroup.hpp''
storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp''
storage/ndb/include/kernel/signaldata/DropObj.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropObj.hpp''
storage/ndb/include/kernel/signaldata/Extent.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/Extent.hpp''
storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp''
storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp''
storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp''
storage/ndb/include/kernel/signaldata/RestoreImpl.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/RestoreImpl.hpp''
storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp''
storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp''
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp''
storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp''
storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.cpp''
storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.hpp''
storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp''
storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp''
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp''
storage/ndb/src/kernel/blocks/diskpage.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/diskpage.cpp''
storage/ndb/src/kernel/blocks/diskpage.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/diskpage.hpp''
storage/ndb/src/kernel/blocks/lgman.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/lgman.cpp''
storage/ndb/src/kernel/blocks/lgman.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/lgman.hpp''
storage/ndb/src/kernel/blocks/pgman.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/pgman.cpp''
storage/ndb/src/kernel/blocks/pgman.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/pgman.hpp''
storage/ndb/src/kernel/blocks/print_file.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/print_file.cpp''
storage/ndb/src/kernel/blocks/restore.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/restore.cpp''
storage/ndb/src/kernel/blocks/restore.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/restore.hpp''
storage/ndb/src/kernel/blocks/tsman.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/tsman.cpp''
storage/ndb/src/kernel/blocks/tsman.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/blocks/tsman.hpp''
storage/ndb/src/kernel/vm/DLCFifoList.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/vm/DLCFifoList.hpp''
storage/ndb/src/kernel/vm/DLCHashTable.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/vm/DLCHashTable.hpp''
storage/ndb/src/kernel/vm/KeyTable2Ref.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/vm/KeyTable2Ref.hpp''
storage/ndb/src/kernel/vm/Rope.cpp:
  New BitKeeper file ``storage/ndb/src/kernel/vm/Rope.cpp''
storage/ndb/src/kernel/vm/Rope.hpp:
  New BitKeeper file ``storage/ndb/src/kernel/vm/Rope.hpp''
parent 8a224ed8
...@@ -1864,7 +1864,8 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ ...@@ -1864,7 +1864,8 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
sighold sigset sigthreadmask \ sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr strtol \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate)
# #
# #
......
...@@ -181,7 +181,7 @@ fi ...@@ -181,7 +181,7 @@ fi
# Edit file system path and ports in config file # Edit file system path and ports in config file
if [ $initial_ndb ] ; then if [ $initial_ndb ] ; then
rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null rm -rf $fs_ndb/ndb_* 2>&1 | cat > /dev/null
sed \ sed \
-e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
-e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
......
...@@ -34,13 +34,13 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, ...@@ -34,13 +34,13 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int) ENGINE=ndbcluster; col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
show table status; 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 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 NDBCLUSTER 10 Dynamic 0 0 # # 0 # 1 # # # latin1_swedish_ci NULL # t1 NDBCLUSTER 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
show table status; 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 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 NDBCLUSTER 10 Dynamic 9 96 # # 0 # 102 # # # latin1_swedish_ci NULL # t1 NDBCLUSTER 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col1 col2 col3 col4 col5 col6 to_be_deleted col1 col2 col3 col4 col5 col6 to_be_deleted
0 4 3 5 PENDING 1 7 0 4 3 5 PENDING 1 7
...@@ -60,7 +60,7 @@ change column col2 fourth varchar(30) not null after col3, ...@@ -60,7 +60,7 @@ change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first; modify column col6 int not null first;
show table status; 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 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 NDBCLUSTER 10 Dynamic 9 152 # # 0 # 102 # # # latin1_swedish_ci NULL # t1 NDBCLUSTER 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 0 3 4 5 PENDING 0000-00-00 00:00:00 1 0 3 4 5 PENDING 0000-00-00 00:00:00
...@@ -75,7 +75,7 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 ...@@ -75,7 +75,7 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
show table status; 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 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 NDBCLUSTER 10 Dynamic 10 152 # # 0 # 103 # # # latin1_swedish_ci NULL # t1 NDBCLUSTER 10 Dynamic 10 # # # 0 # 103 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 0 3 4 5 PENDING 0000-00-00 00:00:00 1 0 3 4 5 PENDING 0000-00-00 00:00:00
......
...@@ -146,8 +146,8 @@ Handler_discover 1 ...@@ -146,8 +146,8 @@ Handler_discover 1
flush tables; flush tables;
show table status; 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 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
t6 MyISAM 10 Fixed 1 260 # # # 0 NULL # # NULL # NULL # t6 MyISAM 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
t7 NDBCLUSTER 10 Fixed 1 276 # # # 0 NULL # # NULL # NULL # t7 NDBCLUSTER 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
show status like 'handler_discover%'; show status like 'handler_discover%';
Variable_name Value Variable_name Value
Handler_discover 2 Handler_discover 2
......
...@@ -57,10 +57,10 @@ Number of primary keys: 3 ...@@ -57,10 +57,10 @@ Number of primary keys: 3
Length of frm data: # Length of frm data: #
TableStatus: Retrieved TableStatus: Retrieved
-- Attributes -- -- Attributes --
a Int PRIMARY KEY a Int PRIMARY KEY AT=FIXED ST=MEMORY
b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
c Int PRIMARY KEY c Int PRIMARY KEY AT=FIXED ST=MEMORY
d Int NULL d Int NULL AT=FIXED ST=MEMORY
-- Indexes -- -- Indexes --
PRIMARY KEY(a, b, c) - UniqueHashIndex PRIMARY KEY(a, b, c) - UniqueHashIndex
......
...@@ -126,26 +126,6 @@ create table t7 engine=myisam as select * from t7_c; ...@@ -126,26 +126,6 @@ create table t7 engine=myisam as select * from t7_c;
create table t8 engine=myisam as select * from t8_c; create table t8 engine=myisam as select * from t8_c;
create table t9 engine=myisam as select * from t9_c; create table t9 engine=myisam as select * from t9_c;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
show tables;
Tables_in_test
t1
t2
t3
t4
t5
t6
t7
t8
t9
t8_c
t9_c
t1_c
t7_c
t6_c
t5_c
t4_c
t3_c
t2_c
select count(*) from t1; select count(*) from t1;
count(*) count(*)
5 5
......
...@@ -56,12 +56,12 @@ col3 varchar (20) not null, ...@@ -56,12 +56,12 @@ col3 varchar (20) not null,
col4 varchar(4) not null, col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int) ENGINE=ndbcluster; col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 # --replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 # --replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
alter table t1 alter table t1
...@@ -70,11 +70,11 @@ add column col7 varchar(30) not null after col5, ...@@ -70,11 +70,11 @@ add column col7 varchar(30) not null after col5,
add column col8 datetime not null, drop column to_be_deleted, add column col8 datetime not null, drop column to_be_deleted,
change column col2 fourth varchar(30) not null after col3, change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first; modify column col6 int not null first;
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 # --replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 # --replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
delete from t1; delete from t1;
......
...@@ -177,7 +177,7 @@ show status like 'handler_discover%'; ...@@ -177,7 +177,7 @@ show status like 'handler_discover%';
flush tables; flush tables;
system rm var/master-data/test/t7.frm ; system rm var/master-data/test/t7.frm ;
--replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 # --replace_column 6 # 7 # 8 # 9 # 12 # 13 # 15 # 18 #
show table status; show table status;
show status like 'handler_discover%'; show status like 'handler_discover%';
...@@ -543,6 +543,6 @@ create table t10 ( ...@@ -543,6 +543,6 @@ create table t10 (
insert into t10 values (1, 'kalle'); insert into t10 values (1, 'kalle');
--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` >> $NDB_TOOLS_OUTPUT 2>&1 || true --exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB | while read a b c d e f g; do echo $g; done` >> $NDB_TOOLS_OUTPUT 2>&1 || true
# End of 4.1 tests # End of 4.1 tests
...@@ -148,7 +148,8 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; ...@@ -148,7 +148,8 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT
show tables; # random output order??
#show tables;
select count(*) from t1; select count(*) from t1;
select count(*) from t1_c; select count(*) from t1_c;
......
This diff is collapsed.
...@@ -23,16 +23,19 @@ class AttributeDescriptor { ...@@ -23,16 +23,19 @@ class AttributeDescriptor {
friend class Dbacc; friend class Dbacc;
friend class Dbtup; friend class Dbtup;
friend class Dbtux; friend class Dbtux;
friend class Dblqh;
friend class SimulatedBlock; friend class SimulatedBlock;
private: public:
static void setType(Uint32 &, Uint32 type); static void setType(Uint32 &, Uint32 type);
static void setSize(Uint32 &, Uint32 size); static void setSize(Uint32 &, Uint32 size);
static void setArray(Uint32 &, Uint32 arraySize); static void setArrayType(Uint32 &, Uint32 arrayType);
static void setArraySize(Uint32 &, Uint32 arraySize);
static void setNullable(Uint32 &, Uint32 nullable); static void setNullable(Uint32 &, Uint32 nullable);
static void setDKey(Uint32 &, Uint32 dkey); static void setDKey(Uint32 &, Uint32 dkey);
static void setPrimaryKey(Uint32 &, Uint32 dkey); static void setPrimaryKey(Uint32 &, Uint32 dkey);
static void setDynamic(Uint32 &, Uint32 dynamicInd); static void setDynamic(Uint32 &, Uint32 dynamicInd);
static void setDiskBased(Uint32 &, Uint32 val);
static Uint32 getType(const Uint32 &); static Uint32 getType(const Uint32 &);
static Uint32 getSize(const Uint32 &); static Uint32 getSize(const Uint32 &);
...@@ -44,6 +47,9 @@ private: ...@@ -44,6 +47,9 @@ private:
static Uint32 getDKey(const Uint32 &); static Uint32 getDKey(const Uint32 &);
static Uint32 getPrimaryKey(const Uint32 &); static Uint32 getPrimaryKey(const Uint32 &);
static Uint32 getDynamic(const Uint32 &); static Uint32 getDynamic(const Uint32 &);
static Uint32 getDiskBased(const Uint32 &);
Uint32 m_data;
}; };
/** /**
...@@ -78,6 +84,7 @@ private: ...@@ -78,6 +84,7 @@ private:
#define AD_SIZE_IN_WORDS_OFFSET (31) #define AD_SIZE_IN_WORDS_OFFSET (31)
#define AD_SIZE_IN_WORDS_SHIFT (5) #define AD_SIZE_IN_WORDS_SHIFT (5)
#define AD_DISK_SHIFT (11)
#define AD_NULLABLE_SHIFT (12) #define AD_NULLABLE_SHIFT (12)
#define AD_DISTR_KEY_SHIFT (13) #define AD_DISTR_KEY_SHIFT (13)
#define AD_PRIMARY_KEY (14) #define AD_PRIMARY_KEY (14)
...@@ -89,57 +96,67 @@ private: ...@@ -89,57 +96,67 @@ private:
inline inline
void void
AttributeDescriptor::setType(Uint32 & desc, Uint32 type){ AttributeDescriptor::setType(Uint32 & desc, Uint32 type){
ASSERT_MAX(type, AD_TYPE_MASK, "AttributeDescriptor::setType"); assert(type <= AD_TYPE_MASK);
desc |= (type << AD_TYPE_SHIFT); desc |= (type << AD_TYPE_SHIFT);
} }
inline inline
void void
AttributeDescriptor::setSize(Uint32 & desc, Uint32 size){ AttributeDescriptor::setSize(Uint32 & desc, Uint32 size){
ASSERT_MAX(size, AD_SIZE_MASK, "AttributeDescriptor::setSize"); assert(size <= AD_SIZE_MASK);
desc |= (size << AD_SIZE_SHIFT); desc |= (size << AD_SIZE_SHIFT);
} }
inline inline
void void
AttributeDescriptor::setArray(Uint32 & desc, Uint32 size){ AttributeDescriptor::setArrayType(Uint32 & desc, Uint32 arrayType){
ASSERT_MAX(size, AD_ARRAY_SIZE_MASK, "AttributeDescriptor::setArray"); assert(arrayType <= AD_ARRAY_TYPE_MASK);
desc |= (size << AD_ARRAY_SIZE_SHIFT); desc |= (arrayType << AD_ARRAY_TYPE_SHIFT);
if(size <= 1){ }
desc |= (size << AD_ARRAY_TYPE_SHIFT);
} else { inline
desc |= (2 << AD_ARRAY_TYPE_SHIFT); void
} AttributeDescriptor::setArraySize(Uint32 & desc, Uint32 arraySize){
assert(arraySize <= AD_ARRAY_SIZE_MASK);
desc |= (arraySize << AD_ARRAY_SIZE_SHIFT);
} }
inline inline
void void
AttributeDescriptor::setNullable(Uint32 & desc, Uint32 nullable){ AttributeDescriptor::setNullable(Uint32 & desc, Uint32 nullable){
ASSERT_BOOL(nullable, "AttributeDescriptor::setNullable"); assert(nullable <= 1);
desc |= (nullable << AD_NULLABLE_SHIFT); desc |= (nullable << AD_NULLABLE_SHIFT);
} }
inline inline
void void
AttributeDescriptor::setDKey(Uint32 & desc, Uint32 dkey){ AttributeDescriptor::setDKey(Uint32 & desc, Uint32 dkey){
ASSERT_BOOL(dkey, "AttributeDescriptor::setDKey"); assert(dkey <= 1);
desc |= (dkey << AD_DISTR_KEY_SHIFT); desc |= (dkey << AD_DISTR_KEY_SHIFT);
} }
inline inline
void void
AttributeDescriptor::setPrimaryKey(Uint32 & desc, Uint32 dkey){ AttributeDescriptor::setPrimaryKey(Uint32 & desc, Uint32 dkey){
ASSERT_BOOL(dkey, "AttributeDescriptor::setPrimaryKey"); assert(dkey <= 1);
desc |= (dkey << AD_PRIMARY_KEY); desc |= (dkey << AD_PRIMARY_KEY);
} }
inline inline
void void
AttributeDescriptor::setDynamic(Uint32 & desc, Uint32 dynamic){ AttributeDescriptor::setDynamic(Uint32 & desc, Uint32 dynamic){
ASSERT_BOOL(dynamic, "AttributeDescriptor::setDynamic"); assert(dynamic <= 1);
desc |= (dynamic << AD_DYNAMIC); desc |= (dynamic << AD_DYNAMIC);
} }
inline
void
AttributeDescriptor::setDiskBased(Uint32 & desc, Uint32 val)
{
assert(val <= 1);
desc |= (val << AD_DISK_SHIFT);
}
/** /**
* Getters * Getters
*/ */
...@@ -206,4 +223,14 @@ AttributeDescriptor::getDynamic(const Uint32 & desc){ ...@@ -206,4 +223,14 @@ AttributeDescriptor::getDynamic(const Uint32 & desc){
return (desc >> AD_DYNAMIC) & 1; return (desc >> AD_DYNAMIC) & 1;
} }
inline
Uint32
AttributeDescriptor::getDiskBased(const Uint32 & desc)
{
return (desc >> AD_DISK_SHIFT) & 1;
}
class NdbOut&
operator<<(class NdbOut&, const AttributeDescriptor&);
#endif #endif
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 ); STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 );
STATIC_CONST( RECORDS_IN_RANGE = 0xFFF8 ); STATIC_CONST( RECORDS_IN_RANGE = 0xFFF8 );
STATIC_CONST( DISK_REF = 0xFFF7 );
// NOTE: in 5.1 ctors and init take size in bytes // NOTE: in 5.1 ctors and init take size in bytes
......
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
#define DBUTIL 0x100 #define DBUTIL 0x100
#define SUMA 0x101 #define SUMA 0x101
#define DBTUX 0x102 #define DBTUX 0x102
#define TSMAN 0x103
#define LGMAN 0x104
#define PGMAN 0x105
#define RESTORE 0x106
const BlockReference BACKUP_REF = numberToRef(BACKUP, 0); const BlockReference BACKUP_REF = numberToRef(BACKUP, 0);
const BlockReference DBTC_REF = numberToRef(DBTC, 0); const BlockReference DBTC_REF = numberToRef(DBTC, 0);
...@@ -61,9 +65,13 @@ const BlockReference TRIX_REF = numberToRef(TRIX, 0); ...@@ -61,9 +65,13 @@ const BlockReference TRIX_REF = numberToRef(TRIX, 0);
const BlockReference DBUTIL_REF = numberToRef(DBUTIL, 0); const BlockReference DBUTIL_REF = numberToRef(DBUTIL, 0);
const BlockReference SUMA_REF = numberToRef(SUMA, 0); const BlockReference SUMA_REF = numberToRef(SUMA, 0);
const BlockReference DBTUX_REF = numberToRef(DBTUX, 0); const BlockReference DBTUX_REF = numberToRef(DBTUX, 0);
const BlockReference TSMAN_REF = numberToRef(TSMAN, 0);
const BlockReference LGMAN_REF = numberToRef(LGMAN, 0);
const BlockReference PGMAN_REF = numberToRef(PGMAN, 0);
const BlockReference RESTORE_REF = numberToRef(RESTORE, 0);
const BlockNumber MIN_BLOCK_NO = BACKUP; const BlockNumber MIN_BLOCK_NO = BACKUP;
const BlockNumber MAX_BLOCK_NO = DBTUX; const BlockNumber MAX_BLOCK_NO = RESTORE;
const BlockNumber NO_OF_BLOCKS = (MAX_BLOCK_NO - MIN_BLOCK_NO + 1); const BlockNumber NO_OF_BLOCKS = (MAX_BLOCK_NO - MIN_BLOCK_NO + 1);
/** /**
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* *
* When adding a new signal, remember to update MAX_GSN and SignalNames.cpp * When adding a new signal, remember to update MAX_GSN and SignalNames.cpp
*/ */
const GlobalSignalNumber MAX_GSN = 712; const GlobalSignalNumber MAX_GSN = 730;
struct GsnName { struct GsnName {
GlobalSignalNumber gsn; GlobalSignalNumber gsn;
...@@ -124,30 +124,34 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -124,30 +124,34 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
*/ */
#define GSN_ACC_ABORTCONF 67 #define GSN_ACC_ABORTCONF 67
/* 68 unused */ /* 68 not unused */
/* 69 unused */ /* 69 not unused */
/* 70 unused */ /* 70 unused */
#define GSN_ACC_ABORTREQ 71 #define GSN_ACC_ABORTREQ 71
#define GSN_ACC_CHECK_SCAN 72 #define GSN_ACC_CHECK_SCAN 72
#define GSN_ACC_COMMITCONF 73 #define GSN_ACC_COMMITCONF 73
#define GSN_ACC_COMMITREQ 74 #define GSN_ACC_COMMITREQ 74
#define GSN_ACC_CONTOPCONF 75 /* 75 unused */
#define GSN_ACC_CONTOPREQ 76 /* 76 unused */
#define GSN_ACC_LCPCONF 77
#define GSN_ACC_LCPREF 78 /* 79 unused */
#define GSN_ACC_LCPREQ 79 /* 78 unused */
#define GSN_ACC_LCPSTARTED 80 /* 77 unused */
/* 80 unused */
#define GSN_ACC_OVER_REC 81 #define GSN_ACC_OVER_REC 81
#define GSN_ACC_SAVE_PAGES 83 /* 83 unused */
#define GSN_ACC_SCAN_INFO 84 #define GSN_ACC_SCAN_INFO 84
#define GSN_ACC_SCAN_INFO24 85 #define GSN_ACC_SCAN_INFO24 85
#define GSN_ACC_SCANCONF 86 #define GSN_ACC_SCANCONF 86
#define GSN_ACC_SCANREF 87 #define GSN_ACC_SCANREF 87
#define GSN_ACC_SCANREQ 88 #define GSN_ACC_SCANREQ 88
#define GSN_ACC_SRCONF 89
#define GSN_ACC_SRREF 90 #define GSN_RESTORE_LCP_REQ 91
#define GSN_ACC_SRREQ 91 #define GSN_RESTORE_LCP_REF 90
#define GSN_RESTORE_LCP_CONF 89
#define GSN_ACC_TO_CONF 92 #define GSN_ACC_TO_CONF 92
#define GSN_ACC_TO_REF 93 #define GSN_ACC_TO_REF 93
#define GSN_ACC_TO_REQ 94 #define GSN_ACC_TO_REQ 94
...@@ -331,7 +335,9 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -331,7 +335,9 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_DIVERIFYREQ 241 #define GSN_DIVERIFYREQ 241
#define GSN_ENABLE_COMORD 242 #define GSN_ENABLE_COMORD 242
#define GSN_END_LCPCONF 243 #define GSN_END_LCPCONF 243
#define GSN_END_LCP_CONF 243
#define GSN_END_LCPREQ 244 #define GSN_END_LCPREQ 244
#define GSN_END_LCP_REQ 244
#define GSN_END_TOCONF 245 #define GSN_END_TOCONF 245
#define GSN_END_TOREQ 246 #define GSN_END_TOREQ 246
#define GSN_EVENT_REP 247 #define GSN_EVENT_REP 247
...@@ -372,21 +378,24 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -372,21 +378,24 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_GCP_SAVEREF 282 #define GSN_GCP_SAVEREF 282
#define GSN_GCP_SAVEREQ 283 #define GSN_GCP_SAVEREQ 283
#define GSN_GCP_TCFINISHED 284 #define GSN_GCP_TCFINISHED 284
#define GSN_SR_FRAGIDCONF 285
#define GSN_SR_FRAGIDREF 286 /* 285 unused */
#define GSN_SR_FRAGIDREQ 287 /* 286 unused */
/* 287 unused */
#define GSN_GETGCICONF 288 #define GSN_GETGCICONF 288
#define GSN_GETGCIREQ 289 #define GSN_GETGCIREQ 289
#define GSN_HOT_SPAREREP 290 #define GSN_HOT_SPAREREP 290
#define GSN_INCL_NODECONF 291 #define GSN_INCL_NODECONF 291
#define GSN_INCL_NODEREF 292 #define GSN_INCL_NODEREF 292
#define GSN_INCL_NODEREQ 293 #define GSN_INCL_NODEREQ 293
#define GSN_LCP_FRAGIDCONF 294
#define GSN_LCP_FRAGIDREF 295 #define GSN_LCP_PREPARE_REQ 296
#define GSN_LCP_FRAGIDREQ 296 #define GSN_LCP_PREPARE_REF 295
#define GSN_LCP_HOLDOPCONF 297 #define GSN_LCP_PREPARE_CONF 294
#define GSN_LCP_HOLDOPREF 298
#define GSN_LCP_HOLDOPREQ 299 /* 297 unused */
/* 298 unused */
/* 299 unused */
#define GSN_SHRINKCHECK2 301 #define GSN_SHRINKCHECK2 301
#define GSN_GET_SCHEMA_INFOREQ 302 #define GSN_GET_SCHEMA_INFOREQ 302
/* 303 not unused */ /* 303 not unused */
...@@ -518,16 +527,18 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -518,16 +527,18 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_TUP_ATTRINFO 418 #define GSN_TUP_ATTRINFO 418
#define GSN_TUP_COMMITREQ 419 #define GSN_TUP_COMMITREQ 419
/* 420 unused */ /* 420 unused */
#define GSN_TUP_LCPCONF 421
#define GSN_TUP_LCPREF 422 /* 421 unused */
#define GSN_TUP_LCPREQ 423 /* 422 unused */
#define GSN_TUP_LCPSTARTED 424 /* 423 unused */
#define GSN_TUP_PREPLCPCONF 425
#define GSN_TUP_PREPLCPREF 426 /* 424 unused */
#define GSN_TUP_PREPLCPREQ 427 /* 425 unused */
#define GSN_TUP_SRCONF 428 /* 426 unused */
#define GSN_TUP_SRREF 429 /* 427 unused */
#define GSN_TUP_SRREQ 430 /* 428 unused */
/* 429 unused */
/* 430 unused */
#define GSN_TUPFRAGCONF 431 #define GSN_TUPFRAGCONF 431
#define GSN_TUPFRAGREF 432 #define GSN_TUPFRAGREF 432
#define GSN_TUPFRAGREQ 433 #define GSN_TUPFRAGREQ 433
...@@ -850,12 +861,12 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -850,12 +861,12 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_CREATE_SUBID_REF 662 #define GSN_CREATE_SUBID_REF 662
#define GSN_CREATE_SUBID_CONF 663 #define GSN_CREATE_SUBID_CONF 663
#define GSN_664 /* used 664 */
#define GSN_665 /* used 665 */
#define GSN_666 /* used 666 */
#define GSN_667 /* used 667 */
#define GSN_668 /* used 668 */
#define GSN_669 /* used 669 */
/* /*
* TUX * TUX
...@@ -932,4 +943,42 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -932,4 +943,42 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_ACC_LOCKREQ 711 #define GSN_ACC_LOCKREQ 711
#define GSN_READ_PSEUDO_REQ 712 #define GSN_READ_PSEUDO_REQ 712
/**
* Filegroup
*/
#define GSN_CREATE_FILEGROUP_REQ 713
#define GSN_CREATE_FILEGROUP_REF 714
#define GSN_CREATE_FILEGROUP_CONF 715
#define GSN_CREATE_FILE_REQ 716
#define GSN_CREATE_FILE_REF 717
#define GSN_CREATE_FILE_CONF 718
#define GSN_DROP_FILEGROUP_REQ 719
#define GSN_DROP_FILEGROUP_REF 720
#define GSN_DROP_FILEGROUP_CONF 721
#define GSN_DROP_FILE_REQ 722
#define GSN_DROP_FILE_REF 723
#define GSN_DROP_FILE_CONF 724
#define GSN_CREATE_OBJ_REQ 725
#define GSN_CREATE_OBJ_REF 726
#define GSN_CREATE_OBJ_CONF 727
#define GSN_DROP_OBJ_REQ 728
#define GSN_DROP_OBJ_REF 729
#define GSN_DROP_OBJ_CONF 730
#define GSN_ALLOC_EXTENT_REQ 68
#define GSN_FREE_EXTENT_REQ 69
#define GSN_DICT_COMMIT_REQ 664
#define GSN_DICT_COMMIT_REF 665
#define GSN_DICT_COMMIT_CONF 666
#define GSN_DICT_ABORT_REQ 667
#define GSN_DICT_ABORT_REF 668
#define GSN_DICT_ABORT_CONF 669
#endif #endif
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define NDB_KERNEL_TYPES_H #define NDB_KERNEL_TYPES_H
#include <ndb_types.h> #include <ndb_types.h>
#include "ndb_limits.h"
typedef Uint16 NodeId; typedef Uint16 NodeId;
typedef Uint16 BlockNumber; typedef Uint16 BlockNumber;
...@@ -36,6 +37,37 @@ enum Operation_t { ...@@ -36,6 +37,37 @@ enum Operation_t {
#endif #endif
}; };
/**
* 32k page
*/
struct GlobalPage {
union {
Uint32 data[GLOBAL_PAGE_SIZE/sizeof(Uint32)];
Uint32 nextPool;
};
};
struct Local_key
{
Uint32 m_page_no;
Uint16 m_page_idx;
Uint16 m_file_no;
bool isNull() const { return m_page_no == RNIL; }
void setNull() { m_page_no= RNIL; m_file_no= m_page_idx= ~0;}
Uint32 ref() const { return (m_page_no << MAX_TUPLES_BITS) | m_page_idx ;}
Local_key& operator= (Uint32 ref) {
m_page_no =ref >> MAX_TUPLES_BITS;
m_page_idx = ref & MAX_TUPLES_PER_PAGE;
return *this;
}
};
class NdbOut&
operator<<(class NdbOut&, const struct Local_key&);
inline inline
Uint32 Uint32
table_version_major(Uint32 ver) table_version_major(Uint32 ver)
......
...@@ -125,6 +125,17 @@ ...@@ -125,6 +125,17 @@
*/ */
#define MAX_XFRM_MULTIPLY 8 /* max expansion when normalizing */ #define MAX_XFRM_MULTIPLY 8 /* max expansion when normalizing */
/**
* Disk data
*/
#define MAX_FILES_PER_FILEGROUP 1024
/**
* Page size in global page pool
*/
#define GLOBAL_PAGE_SIZE 32768
#define GLOBAL_PAGE_SIZE_WORDS 8192
/* /*
* Long signals * Long signals
*/ */
......
...@@ -62,18 +62,22 @@ private: ...@@ -62,18 +62,22 @@ private:
/* /*
n = Changed name n = Changed name
f = Changed frm
1111111111222222222233 1111111111222222222233
01234567890123456789012345678901 01234567890123456789012345678901
n------------------------------- nf------------------------------
*/ */
#define NAME_SHIFT (0) #define NAME_SHIFT (0)
#define FRM_SHIFT (1)
/** /**
* Getters and setters * Getters and setters
*/ */
static Uint8 getNameFlag(const UintR & changeMask); static Uint8 getNameFlag(const UintR & changeMask);
static void setNameFlag(UintR & changeMask, Uint32 nameFlg); static void setNameFlag(UintR & changeMask, Uint32 nameFlg);
static Uint8 getFrmFlag(const UintR & changeMask);
static void setFrmFlag(UintR & changeMask, Uint32 frmFlg);
}; };
inline inline
...@@ -88,6 +92,18 @@ AlterTableReq::setNameFlag(UintR & changeMask, Uint32 nameFlg){ ...@@ -88,6 +92,18 @@ AlterTableReq::setNameFlag(UintR & changeMask, Uint32 nameFlg){
changeMask |= (nameFlg << NAME_SHIFT); changeMask |= (nameFlg << NAME_SHIFT);
} }
inline
Uint8
AlterTableReq::getFrmFlag(const UintR & changeMask){
return (Uint8)((changeMask >> FRM_SHIFT) & 1);
}
inline
void
AlterTableReq::setFrmFlag(UintR & changeMask, Uint32 frmFlg){
changeMask |= (frmFlg << FRM_SHIFT);
}
class AlterTableRef { class AlterTableRef {
/** /**
......
...@@ -36,6 +36,7 @@ class AttrInfo { ...@@ -36,6 +36,7 @@ class AttrInfo {
friend class Dbtc; friend class Dbtc;
friend class Dblqh; friend class Dblqh;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class Restore;
friend bool printATTRINFO(FILE *, const Uint32 *, Uint32, Uint16); friend bool printATTRINFO(FILE *, const Uint32 *, Uint32, Uint16);
......
...@@ -30,6 +30,7 @@ class DefineBackupReq { ...@@ -30,6 +30,7 @@ class DefineBackupReq {
* Reciver(s) * Reciver(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
friend bool printDEFINE_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); friend bool printDEFINE_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16);
public: public:
...@@ -74,6 +75,7 @@ class DefineBackupRef { ...@@ -74,6 +75,7 @@ class DefineBackupRef {
* Sender(s) * Sender(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
/** /**
* Reciver(s) * Reciver(s)
...@@ -107,6 +109,7 @@ class DefineBackupConf { ...@@ -107,6 +109,7 @@ class DefineBackupConf {
* Sender(s) * Sender(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
/** /**
* Reciver(s) * Reciver(s)
...@@ -210,6 +213,7 @@ class BackupFragmentReq { ...@@ -210,6 +213,7 @@ class BackupFragmentReq {
* Reciver(s) * Reciver(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
friend bool printBACKUP_FRAGMENT_REQ(FILE *, const Uint32 *, Uint32, Uint16); friend bool printBACKUP_FRAGMENT_REQ(FILE *, const Uint32 *, Uint32, Uint16);
public: public:
...@@ -228,6 +232,7 @@ class BackupFragmentRef { ...@@ -228,6 +232,7 @@ class BackupFragmentRef {
* Sender(s) * Sender(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
/** /**
* Reciver(s) * Reciver(s)
...@@ -250,6 +255,7 @@ class BackupFragmentConf { ...@@ -250,6 +255,7 @@ class BackupFragmentConf {
* Sender(s) * Sender(s)
*/ */
friend class Backup; friend class Backup;
friend class Dblqh;
/** /**
* Reciver(s) * Reciver(s)
......
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef CREATE_FILEGROUP_HPP
#define CREATE_FILEGROUP_HPP
#include "SignalData.hpp"
struct CreateFilegroupReq {
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
friend class Dbdict;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 3 );
Uint32 senderData;
Uint32 senderRef;
Uint32 objType;
SECTION( FILEGROUP_INFO = 0 );
};
struct CreateFilegroupRef {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 7 );
enum ErrorCode {
NoError = 0,
Busy = 701,
NotMaster = 702,
NoMoreObjectRecords = 710,
InvalidFormat = 740,
OutOfFilegroupRecords = 765,
InvalidExtentSize = 764,
InvalidUndoBufferSize = 763,
NoSuchLogfileGroup = 767,
InvalidFilegroupVersion = 768
};
Uint32 senderData;
Uint32 senderRef;
Uint32 masterNodeId;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorKey;
Uint32 status;
};
struct CreateFilegroupConf {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
Uint32 senderData;
Uint32 senderRef;
Uint32 filegroupId;
Uint32 filegroupVersion;
};
struct CreateFileReq {
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
friend class Dbdict;
friend class Tsman;
/**
* For printing
*/
friend bool printCREATE_FILE_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
Uint32 senderData;
Uint32 senderRef;
Uint32 objType;
Uint32 requestInfo;
enum RequstInfo
{
ForceCreateFile = 0x1
};
SECTION( FILE_INFO = 0 );
};
struct CreateFileRef {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printCREATE_FILE_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 7 );
enum ErrorCode {
NoError = 0,
Busy = 701,
NotMaster = 702,
NoMoreObjectRecords = 710,
InvalidFormat = 752,
NoSuchFilegroup = 753,
InvalidFilegroupVersion = 754,
FilenameAlreadyExists = 760,
OutOfFileRecords = 751,
InvalidFileType = 750
};
Uint32 senderData;
Uint32 senderRef;
Uint32 masterNodeId;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorKey;
Uint32 status;
};
struct CreateFileConf {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printCREATE_FILE_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
Uint32 senderData;
Uint32 senderRef;
Uint32 fileId;
};
#endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef CREATE_FILEGROUP_IMPL_HPP
#define CREATE_FILEGROUP_IMPL_HPP
#include "SignalData.hpp"
struct CreateFilegroupImplReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( TablespaceLength = 6 );
STATIC_CONST( LogfileGroupLength = 5 );
Uint32 senderData;
Uint32 senderRef;
Uint32 filegroup_id;
Uint32 filegroup_version;
union {
struct {
Uint32 extent_size;
Uint32 logfile_group_id;
} tablespace;
struct {
Uint32 buffer_size; // In pages
} logfile_group;
};
};
struct CreateFilegroupImplRef {
/**
* Sender(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 3 );
enum ErrorCode {
NoError = 0,
FilegroupAlreadyExists = 1,
OutOfFilegroupRecords = 2,
OutOfLogBufferMemory = 3
};
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
};
struct CreateFilegroupImplConf {
/**
* Sender(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILEGROUP_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 2 );
Uint32 senderData;
Uint32 senderRef;
};
struct CreateFileImplReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILE_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( DatafileLength = 9 );
STATIC_CONST( UndofileLength = 8 );
STATIC_CONST( CommitLength = 6 );
STATIC_CONST( AbortLength = 6 );
SECTION( FILENAME = 0 );
enum RequestInfo {
Create = 0x1,
CreateForce = 0x2,
Open = 0x4,
Commit = 0x8,
Abort = 0x10
};
Uint32 senderData;
Uint32 senderRef;
Uint32 requestInfo;
Uint32 file_id;
Uint32 filegroup_id;
Uint32 filegroup_version;
Uint32 file_size_hi;
Uint32 file_size_lo;
union {
struct {
Uint32 extent_size;
} tablespace;
};
};
struct CreateFileImplRef {
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILE_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 5 );
enum ErrorCode {
NoError = 0,
InvalidFilegroup = 1,
InvalidFilegroupVersion = 2,
FileNoAlreadyExists = 3,
OutOfFileRecords = 4,
FileError = 5,
InvalidFileMetadata = 6,
OutOfMemory = 7,
FileReadError = 8,
FilegroupNotOnline = 9
};
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
Uint32 fsErrCode;
Uint32 osErrCode;
};
struct CreateFileImplConf {
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printCREATE_FILE_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
Uint32 senderData;
Uint32 senderRef;
};
#endif
...@@ -193,6 +193,7 @@ public: ...@@ -193,6 +193,7 @@ public:
NoError = 0, NoError = 0,
Busy = 701, Busy = 701,
NotMaster = 702, NotMaster = 702,
IndexOnDiskAttributeError = 756,
TriggerNotFound = 4238, TriggerNotFound = 4238,
TriggerExists = 4239, TriggerExists = 4239,
IndexNameTooLong = 4241, IndexNameTooLong = 4241,
......
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef CREATE_OBJ_HPP
#define CREATE_OBJ_HPP
#include "DictObjOp.hpp"
#include "SignalData.hpp"
/**
* CreateObj
*
* Implemenatation of CreateObj
*/
struct CreateObjReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
/**
* For printing
*/
friend bool printCREATE_OBJ_REQ(FILE*, const Uint32*, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 10 );
STATIC_CONST( GSN = GSN_CREATE_OBJ_REQ );
private:
Uint32 op_key;
Uint32 senderRef;
Uint32 senderData;
Uint32 requestInfo;
Uint32 clientRef;
Uint32 clientData;
Uint32 objId;
Uint32 objType;
Uint32 objVersion;
Uint32 gci;
SECTION( DICT_OBJ_INFO = 0 );
};
struct CreateObjRef {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
friend class SafeCounter;
/**
* For printing
*/
friend bool printCREATE_OBJ_REF(FILE *, const Uint32 *, Uint32, Uint16);
STATIC_CONST( SignalLength = 6 );
STATIC_CONST( GSN = GSN_CREATE_OBJ_REF );
enum ErrorCode {
NF_FakeErrorREF = 255
};
Uint32 senderRef;
Uint32 senderData;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorKey;
Uint32 errorStatus;
};
struct CreateObjConf {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
/**
* For printing
*/
friend bool printCREATE_OBJ_CONF(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 2 );
private:
Uint32 senderRef;
Uint32 senderData;
};
#endif
...@@ -91,7 +91,11 @@ public: ...@@ -91,7 +91,11 @@ public:
RecordTooBig = 738, RecordTooBig = 738,
InvalidPrimaryKeySize = 739, InvalidPrimaryKeySize = 739,
NullablePrimaryKey = 740, NullablePrimaryKey = 740,
InvalidCharset = 743 InvalidCharset = 743,
InvalidTablespace = 755,
VarsizeBitfieldNotSupported = 757,
NotATablespace = 758,
InvalidTablespaceVersion = 759
}; };
private: private:
......
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef DICT_OBJ_OP_HPP
#define DICT_OBJ_OP_HPP
struct DictObjOp {
enum RequestType {
Prepare = 0, // Prepare create obj
Commit = 1, // Commit create obj
Abort = 2 // Prepare failed, drop instead
};
enum State {
Defined = 0,
Preparing = 1,
Prepared = 2,
Committing = 3,
Committed = 4,
Aborting = 5,
Aborted = 6
};
};
struct DictCommitReq
{
Uint32 senderData;
Uint32 senderRef;
Uint32 op_key;
STATIC_CONST( SignalLength = 3 );
STATIC_CONST( GSN = GSN_DICT_COMMIT_REQ );
};
struct DictCommitRef
{
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
enum ErrorCode
{
NF_FakeErrorREF = 1
};
STATIC_CONST( SignalLength = 3 );
STATIC_CONST( GSN = GSN_DICT_COMMIT_REF );
};
struct DictCommitConf
{
Uint32 senderData;
Uint32 senderRef;
STATIC_CONST( SignalLength = 2 );
STATIC_CONST( GSN = GSN_DICT_COMMIT_CONF );
};
struct DictAbortReq
{
Uint32 senderData;
Uint32 senderRef;
Uint32 op_key;
STATIC_CONST( SignalLength = 3 );
STATIC_CONST( GSN = GSN_DICT_ABORT_REQ );
};
struct DictAbortRef
{
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
enum ErrorCode
{
NF_FakeErrorREF = 1
};
STATIC_CONST( SignalLength = 3 );
STATIC_CONST( GSN = GSN_DICT_ABORT_REF );
};
struct DictAbortConf
{
Uint32 senderData;
Uint32 senderRef;
STATIC_CONST( SignalLength = 2 );
STATIC_CONST( GSN = GSN_DICT_ABORT_CONF );
};
#endif
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <AttributeDescriptor.hpp> #include <AttributeDescriptor.hpp>
#include <SimpleProperties.hpp> #include <SimpleProperties.hpp>
#include <ndb_limits.h> #include <ndb_limits.h>
#include <trigger_definitions.h>
#include <NdbSqlUtil.hpp> #include <NdbSqlUtil.hpp>
#include <ndb_global.h>
#ifndef my_decimal_h #ifndef my_decimal_h
...@@ -120,6 +120,8 @@ public: ...@@ -120,6 +120,8 @@ public:
FragmentCount = 128, // No of fragments in table (!fragment replicas) FragmentCount = 128, // No of fragments in table (!fragment replicas)
FragmentDataLen = 129, FragmentDataLen = 129,
FragmentData = 130, // CREATE_FRAGMENTATION reply FragmentData = 130, // CREATE_FRAGMENTATION reply
TablespaceId = 131,
TablespaceVersion = 132,
TableEnd = 999, TableEnd = 999,
AttributeName = 1000, // String, Mandatory AttributeName = 1000, // String, Mandatory
...@@ -128,7 +130,7 @@ public: ...@@ -128,7 +130,7 @@ public:
AttributeSize = 1003, //Default DictTabInfo::a32Bit AttributeSize = 1003, //Default DictTabInfo::a32Bit
AttributeArraySize = 1005, //Default 1 AttributeArraySize = 1005, //Default 1
AttributeKeyFlag = 1006, //Default noKey AttributeKeyFlag = 1006, //Default noKey
AttributeStorage = 1007, //Default MainMemory AttributeStorageType = 1007, //Default NDB_STORAGETYPE_MEMORY
AttributeNullableFlag = 1008, //Default NotNullable AttributeNullableFlag = 1008, //Default NotNullable
AttributeDKey = 1010, //Default NotDKey AttributeDKey = 1010, //Default NotDKey
AttributeExtType = 1013, //Default ExtUnsigned AttributeExtType = 1013, //Default ExtUnsigned
...@@ -136,7 +138,8 @@ public: ...@@ -136,7 +138,8 @@ public:
AttributeExtScale = 1015, //Default 0 AttributeExtScale = 1015, //Default 0
AttributeExtLength = 1016, //Default 0 AttributeExtLength = 1016, //Default 0
AttributeAutoIncrement = 1017, //Default false AttributeAutoIncrement = 1017, //Default false
AttributeDefaultValue = 1018, //Default value (printable string) AttributeDefaultValue = 1018, //Default value (printable string),
AttributeArrayType = 1019, //Default NDB_ARRAYTYPE_FIXED
AttributeEnd = 1999 // AttributeEnd = 1999 //
}; };
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
...@@ -169,11 +172,17 @@ public: ...@@ -169,11 +172,17 @@ public:
UniqueOrderedIndex = 5, UniqueOrderedIndex = 5,
OrderedIndex = 6, OrderedIndex = 6,
// constant 10 hardcoded in Dbdict.cpp // constant 10 hardcoded in Dbdict.cpp
HashIndexTrigger = 10 + TriggerType::SECONDARY_INDEX, HashIndexTrigger = 11,
SubscriptionTrigger = 10 + TriggerType::SUBSCRIPTION, SubscriptionTrigger = 16,
ReadOnlyConstraint = 10 + TriggerType::READ_ONLY_CONSTRAINT, ReadOnlyConstraint = 17,
IndexTrigger = 10 + TriggerType::ORDERED_INDEX IndexTrigger = 18,
Tablespace = 20, ///< Tablespace
LogfileGroup = 21, ///< Logfile group
Datafile = 22, ///< Datafile
Undofile = 23 ///< Undofile
}; };
static inline bool static inline bool
isTable(int tableType) { isTable(int tableType) {
return return
...@@ -212,6 +221,27 @@ public: ...@@ -212,6 +221,27 @@ public:
tableType == UniqueOrderedIndex || tableType == UniqueOrderedIndex ||
tableType == OrderedIndex; tableType == OrderedIndex;
} }
static inline bool
isTrigger(int tableType) {
return
tableType == HashIndexTrigger ||
tableType == SubscriptionTrigger ||
tableType == ReadOnlyConstraint ||
tableType == IndexTrigger;
}
static inline bool
isFilegroup(int tableType) {
return
tableType == Tablespace ||
tableType == LogfileGroup;
}
static inline bool
isFile(int tableType) {
return
tableType == Datafile||
tableType == Undofile;
}
// Object state for translating from/to API // Object state for translating from/to API
enum ObjectState { enum ObjectState {
...@@ -255,7 +285,6 @@ public: ...@@ -255,7 +285,6 @@ public:
Uint32 MaxLoadFactor; Uint32 MaxLoadFactor;
Uint32 KeyLength; Uint32 KeyLength;
Uint32 FragmentType; Uint32 FragmentType;
Uint32 TableStorage;
Uint32 TableType; Uint32 TableType;
Uint32 TableVersion; Uint32 TableVersion;
Uint32 IndexState; Uint32 IndexState;
...@@ -263,6 +292,8 @@ public: ...@@ -263,6 +292,8 @@ public:
Uint32 UpdateTriggerId; Uint32 UpdateTriggerId;
Uint32 DeleteTriggerId; Uint32 DeleteTriggerId;
Uint32 CustomTriggerId; Uint32 CustomTriggerId;
Uint32 TablespaceId;
Uint32 TablespaceVersion;
Uint32 FrmLen; Uint32 FrmLen;
char FrmData[MAX_FRM_DATA_SIZE]; char FrmData[MAX_FRM_DATA_SIZE];
Uint32 FragmentCount; Uint32 FragmentCount;
...@@ -319,6 +350,7 @@ public: ...@@ -319,6 +350,7 @@ public:
Uint32 AttributeType; // for osu 4.1->5.0.x Uint32 AttributeType; // for osu 4.1->5.0.x
Uint32 AttributeSize; Uint32 AttributeSize;
Uint32 AttributeArraySize; Uint32 AttributeArraySize;
Uint32 AttributeArrayType;
Uint32 AttributeKeyFlag; Uint32 AttributeKeyFlag;
Uint32 AttributeNullableFlag; Uint32 AttributeNullableFlag;
Uint32 AttributeDKey; Uint32 AttributeDKey;
...@@ -327,6 +359,7 @@ public: ...@@ -327,6 +359,7 @@ public:
Uint32 AttributeExtScale; Uint32 AttributeExtScale;
Uint32 AttributeExtLength; Uint32 AttributeExtLength;
Uint32 AttributeAutoIncrement; Uint32 AttributeAutoIncrement;
Uint32 AttributeStorageType;
char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE]; char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE];
void init(); void init();
...@@ -463,8 +496,9 @@ public: ...@@ -463,8 +496,9 @@ public:
fprintf(out, "AttributeType = %d\n", AttributeType); fprintf(out, "AttributeType = %d\n", AttributeType);
fprintf(out, "AttributeSize = %d\n", AttributeSize); fprintf(out, "AttributeSize = %d\n", AttributeSize);
fprintf(out, "AttributeArraySize = %d\n", AttributeArraySize); fprintf(out, "AttributeArraySize = %d\n", AttributeArraySize);
fprintf(out, "AttributeArrayType = %d\n", AttributeArrayType);
fprintf(out, "AttributeKeyFlag = %d\n", AttributeKeyFlag); fprintf(out, "AttributeKeyFlag = %d\n", AttributeKeyFlag);
fprintf(out, "AttributeStorage = %d\n", AttributeStorage); fprintf(out, "AttributeStorageType = %d\n", AttributeStorageType);
fprintf(out, "AttributeNullableFlag = %d\n", AttributeNullableFlag); fprintf(out, "AttributeNullableFlag = %d\n", AttributeNullableFlag);
fprintf(out, "AttributeDKey = %d\n", AttributeDKey); fprintf(out, "AttributeDKey = %d\n", AttributeDKey);
fprintf(out, "AttributeGroup = %d\n", AttributeGroup); fprintf(out, "AttributeGroup = %d\n", AttributeGroup);
...@@ -506,16 +540,130 @@ public: ...@@ -506,16 +540,130 @@ public:
{ {
AttributeDGroup = 1009, //Default NotDGroup AttributeDGroup = 1009, //Default NotDGroup
AttributeStoredInd = 1011, //Default NotStored AttributeStoredInd = 1011, //Default NotStored
TableStorageVal = 14, //Disk storage specified per attribute
SecondTableId = 17, //Mandatory between DICT's otherwise not allowed SecondTableId = 17, //Mandatory between DICT's otherwise not allowed
FragmentKeyTypeVal = 16 //Default PrimaryKey FragmentKeyTypeVal = 16 //Default PrimaryKey
}; };
enum Unimplemented enum Unimplemented
{ {
TableStorageVal = 14, //Default StorageType::MainMemory
ScanOptimised = 15, //Default updateOptimised ScanOptimised = 15, //Default updateOptimised
AttributeGroup = 1012 //Default 0 AttributeGroup = 1012 //Default 0
}; };
}; };
#define DFGIMAP(x, y, z) \
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
#define DFGIMAP2(x, y, z, u, v) \
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
#define DFGIMAPS(x, y, z, u, v) \
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
#define DFGIMAPB(x, y, z, u, v, l) \
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
offsetof(x, l) }
#define DFGIBREAK(x) \
{ DictFilegroupInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }
struct DictFilegroupInfo {
enum KeyValues {
FilegroupName = 1,
FilegroupType = 2,
FilegroupId = 3,
FilegroupVersion = 4,
/**
* File parameters
*/
FileName = 100,
FileType = 101,
FileId = 102,
FileNo = 103, // Per Filegroup
FileFGroupId = 104,
FileFGroupVersion = 105,
FileSizeHi = 106,
FileSizeLo = 107,
FileFreeExtents = 108,
FileEnd = 199, //
/**
* Tablespace parameters
*/
TS_ExtentSize = 1000, // specified in bytes
TS_LogfileGroupId = 1001,
TS_LogfileGroupVersion = 1002,
TS_GrowLimit = 1003, // In bytes
TS_GrowSizeHi = 1004,
TS_GrowSizeLo = 1005,
TS_GrowPattern = 1006,
TS_GrowMaxSize = 1007,
/**
* Logfile group parameters
*/
LF_UndoBufferSize = 2005, // In bytes
LF_UndoGrowLimit = 2000, // In bytes
LF_UndoGrowSizeHi = 2001,
LF_UndoGrowSizeLo = 2002,
LF_UndoGrowPattern = 2003,
LF_UndoGrowMaxSize = 2004
};
// FragmentType constants
enum FileTypeValues {
Datafile = 0,
Undofile = 1
//, Redofile
};
struct GrowSpec {
Uint32 GrowLimit;
Uint32 GrowSizeHi;
Uint32 GrowSizeLo;
char GrowPattern[PATH_MAX];
Uint32 GrowMaxSize;
};
// Table data interpretation
struct Filegroup {
char FilegroupName[MAX_TAB_NAME_SIZE];
Uint32 FilegroupType; // ObjType
Uint32 FilegroupId;
Uint32 FilegroupVersion;
union {
Uint32 TS_ExtentSize;
Uint32 LF_UndoBufferSize;
};
Uint32 TS_LogfileGroupId;
Uint32 TS_LogfileGroupVersion;
union {
GrowSpec TS_DataGrow;
GrowSpec LF_UndoGrow;
};
//GrowSpec LF_RedoGrow;
void init();
};
static const Uint32 MappingSize;
static const SimpleProperties::SP2StructMapping Mapping[];
struct File {
char FileName[PATH_MAX];
Uint32 FileType;
Uint32 FileNo;
Uint32 FileId;
Uint32 FilegroupId;
Uint32 FilegroupVersion;
Uint32 FileSizeHi;
Uint32 FileSizeLo;
Uint32 FileFreeExtents;
void init();
};
static const Uint32 FileMappingSize;
static const SimpleProperties::SP2StructMapping FileMapping[];
};
#endif #endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef DROP_FILEGROUP_HPP
#define DROP_FILEGROUP_HPP
#include "SignalData.hpp"
struct DropFilegroupReq {
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
friend class Dbdict;
friend class Tsman;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
STATIC_CONST( GSN = GSN_DROP_FILEGROUP_REQ );
Uint32 senderData;
Uint32 senderRef;
Uint32 filegroup_id;
Uint32 filegroup_version;
};
struct DropFilegroupRef {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 7 );
STATIC_CONST( GSN = GSN_DROP_FILEGROUP_REF );
enum ErrorCode {
NoError = 0,
Busy = 701,
NotMaster = 702,
NoSuchFilegroup = 767,
FilegroupInUse = 768
};
Uint32 senderData;
Uint32 senderRef;
Uint32 masterNodeId;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorKey;
};
struct DropFilegroupConf {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
STATIC_CONST( GSN = GSN_DROP_FILEGROUP_CONF );
Uint32 senderData;
Uint32 senderRef;
Uint32 filegroupId;
Uint32 filegroupVersion;
};
struct DropFileReq {
/**
* Sender(s) / Reciver(s)
*/
friend class NdbDictInterface;
friend class Dbdict;
friend class Tsman;
/**
* For printing
*/
friend bool printDROP_FILE_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
STATIC_CONST( GSN = GSN_DROP_FILE_REQ );
Uint32 senderData;
Uint32 senderRef;
Uint32 file_id;
Uint32 file_version;
};
struct DropFileRef {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printDROP_FILE_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 7 );
STATIC_CONST( GSN = GSN_DROP_FILE_REF );
enum ErrorCode {
NoError = 0,
Busy = 701,
NoSuchFile = 766,
DropUndoFileNotSupported = 769
};
Uint32 senderData;
Uint32 senderRef;
Uint32 masterNodeId;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorKey;
};
struct DropFileConf {
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend class NdbDictInterface;
/**
* For printing
*/
friend bool printDROP_FILE_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 4 );
STATIC_CONST( GSN = GSN_DROP_FILE_CONF );
Uint32 senderData;
Uint32 senderRef;
Uint32 fileId;
Uint32 fileVersion;
};
#endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef DROP_FILEGROUP_IMPL_HPP
#define DROP_FILEGROUP_IMPL_HPP
#include "SignalData.hpp"
struct DropFilegroupImplReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 5 );
enum RequestInfo {
Prepare = 0x1,
Commit = 0x2,
Abort = 0x4
};
Uint32 senderData;
Uint32 senderRef;
Uint32 requestInfo;
Uint32 filegroup_id;
Uint32 filegroup_version;
};
struct DropFilegroupImplRef {
/**
* Sender(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 3 );
enum ErrorCode {
NoError = 0,
NoSuchFilegroup = 767,
InvalidFilegroupVersion = 767,
FilegroupInUse = 768
};
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
};
struct DropFilegroupImplConf {
/**
* Sender(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILEGROUP_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 2 );
Uint32 senderData;
Uint32 senderRef;
};
struct DropFileImplReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILE_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 6 );
enum RequestInfo {
Prepare = 0x1,
Commit = 0x2,
Abort = 0x4
};
Uint32 senderData;
Uint32 senderRef;
Uint32 requestInfo;
Uint32 file_id;
Uint32 filegroup_id;
Uint32 filegroup_version;
};
struct DropFileImplRef {
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILE_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 5 );
enum ErrorCode {
NoError = 0,
InvalidFilegroup = 767,
InvalidFilegroupVersion = 767,
NoSuchFile = 766,
FileInUse = 770
};
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
Uint32 fsErrCode;
Uint32 osErrCode;
};
struct DropFileImplConf {
friend class Dbdict;
friend class Tsman;
friend class Lgman;
/**
* For printing
*/
friend bool printDROP_FILE_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 2 );
Uint32 senderData;
Uint32 senderRef;
};
#endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef DROP_OBJ_HPP
#define DROP_OBJ_HPP
#include "DictObjOp.hpp"
#include "SignalData.hpp"
struct DropObjReq
{
/**
* Sender(s)
*/
friend class Dbdict;
/**
* Receiver(s)
*/
friend class Dbtc;
friend class Dblqh;
friend class Dbacc;
friend class Dbtup;
friend class Dbtux;
friend class Dbdih;
friend bool printDROP_OBJ_REQ(FILE *, const Uint32 *, Uint32, Uint16);
STATIC_CONST( SignalLength = 9 );
Uint32 op_key;
Uint32 objId;
Uint32 objType;
Uint32 objVersion;
Uint32 senderRef;
Uint32 senderData;
Uint32 requestInfo;
Uint32 clientRef;
Uint32 clientData;
};
class DropObjConf {
/**
* Sender(s)
*/
friend class Dbtc;
friend class Dblqh;
friend class Dbacc;
friend class Dbtup;
friend class Dbtux;
friend class Dbdih;
/**
* Receiver(s)
*/
friend class Dbdict;
friend bool printDROP_OBJ_CONF(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 3 );
private:
Uint32 senderRef;
Uint32 senderData;
Uint32 objId;
};
class DropObjRef {
/**
* Sender(s)
*/
friend class Dbtc;
friend class Dblqh;
friend class Dbacc;
friend class Dbtup;
friend class Dbtux;
friend class Dbdih;
/**
* Receiver(s)
*/
friend class Dbdict;
friend bool printDROP_OBJ_REF(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 4 );
enum ErrorCode {
NoSuchObj = 1,
DropWoPrep = 2, // Calling Drop with first calling PrepDrop
PrepDropInProgress = 3,
DropInProgress = 4,
NF_FakeErrorREF = 5
};
private:
Uint32 senderRef;
Uint32 senderData;
Uint32 objId;
Uint32 errorCode;
};
#endif
...@@ -104,6 +104,8 @@ public: ...@@ -104,6 +104,8 @@ public:
CmvmiDumpLongSignalMemory = 2601, CmvmiDumpLongSignalMemory = 2601,
CmvmiSetRestartOnErrorInsert = 2602, CmvmiSetRestartOnErrorInsert = 2602,
CmvmiTestLongSigWithDelay = 2603, CmvmiTestLongSigWithDelay = 2603,
LCPContinue = 5900,
// 7000 DIH // 7000 DIH
// 7001 DIH // 7001 DIH
// 7002 DIH // 7002 DIH
...@@ -130,7 +132,11 @@ public: ...@@ -130,7 +132,11 @@ public:
// 12000 Tux // 12000 Tux
TuxLogToFile = 12001, TuxLogToFile = 12001,
TuxSetLogFlags = 12002, TuxSetLogFlags = 12002,
TuxMetaDataJunk = 12009 TuxMetaDataJunk = 12009,
DumpTsman = 9000,
DumpLgman = 10000,
DumpPgman = 11000
}; };
public: public:
......
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef NDB_EXTENT_HPP
#define NDB_EXTENT_HPP
#include "SignalData.hpp"
struct AllocExtentReq {
/**
* Sender(s) / Reciver(s)
*/
/**
* For printing
*/
STATIC_CONST( SignalLength = 3 );
enum ErrorCode {
UnmappedExtentPageIsNotImplemented = 1,
NoExtentAvailable = 2
};
union
{
struct
{
Uint32 tablespace_id;
Uint32 table_id;
Uint32 fragment_id;
} request;
struct
{
Uint32 errorCode;
Local_key page_id;
Uint32 page_count;
} reply;
};
};
struct FreeExtentReq {
/**
* Sender(s) / Reciver(s)
*/
/**
* For printing
*/
STATIC_CONST( SignalLength = 4 );
enum ErrorCode {
UnmappedExtentPageIsNotImplemented = 1
};
union
{
struct
{
Local_key key;
Uint32 table_id;
Uint32 tablespace_id;
} request;
struct
{
Uint32 errorCode;
} reply;
};
};
struct AllocPageReq {
/**
* Sender(s) / Reciver(s)
*/
/**
* For printing
*/
STATIC_CONST( SignalLength = 3 );
enum ErrorCode {
UnmappedExtentPageIsNotImplemented = 1,
NoPageFree= 2
};
Local_key key; // in out
Uint32 bits; // in out
union
{
struct
{
Uint32 table_id;
Uint32 fragment_id;
Uint32 tablespace_id;
} request;
struct
{
Uint32 errorCode;
} reply;
};
};
#endif
...@@ -30,12 +30,15 @@ class FsCloseReq { ...@@ -30,12 +30,15 @@ class FsCloseReq {
*/ */
friend class Ndbfs; // Reciver friend class Ndbfs; // Reciver
friend class VoidFs; friend class VoidFs;
friend class Lgman;
friend class Tsman;
/** /**
* Sender(s) * Sender(s)
*/ */
friend class Backup; friend class Backup;
friend class Dbdict; friend class Dbdict;
friend class Restore;
/** /**
* For printing * For printing
......
...@@ -38,7 +38,10 @@ class FsConf { ...@@ -38,7 +38,10 @@ class FsConf {
friend class Dbacc; friend class Dbacc;
friend class Dbtup; friend class Dbtup;
friend class Dbdict; friend class Dbdict;
friend class Lgman;
friend class Tsman;
friend class Pgman;
friend class Restore;
/** /**
* Sender(s) * Sender(s)
*/ */
...@@ -66,10 +69,11 @@ private: ...@@ -66,10 +69,11 @@ private:
*/ */
UintR userPointer; // DATA 0 UintR userPointer; // DATA 0
/** // Data 1
* Only used if FSOPENCONF union {
*/ UintR filePointer; // FSOPENCONF
UintR filePointer; // DATA 1 Uint32 bytes_read; // FSREADCONF (when allow partial read)
};
}; };
......
...@@ -40,6 +40,9 @@ class FsOpenReq { ...@@ -40,6 +40,9 @@ class FsOpenReq {
friend class Dbdict; friend class Dbdict;
friend class Ndbcntr; // For initial start... friend class Ndbcntr; // For initial start...
friend class Dbdih; friend class Dbdih;
friend class Lgman;
friend class Tsman;
friend class Restore;
/** /**
* For printing * For printing
...@@ -50,7 +53,8 @@ public: ...@@ -50,7 +53,8 @@ public:
/** /**
* Length of signal * Length of signal
*/ */
STATIC_CONST( SignalLength = 7 ); STATIC_CONST( SignalLength = 10 );
SECTION( FILENAME = 0 );
private: private:
...@@ -62,6 +66,9 @@ private: ...@@ -62,6 +66,9 @@ private:
UintR userPointer; // DATA 1 UintR userPointer; // DATA 1
UintR fileNumber[4]; // DATA 2 - 5 UintR fileNumber[4]; // DATA 2 - 5
UintR fileFlags; // DATA 6 UintR fileFlags; // DATA 6
Uint32 page_size;
Uint32 file_size_hi;
Uint32 file_size_lo;
STATIC_CONST( OM_READONLY = 0 ); STATIC_CONST( OM_READONLY = 0 );
STATIC_CONST( OM_WRITEONLY = 1 ); STATIC_CONST( OM_WRITEONLY = 1 );
...@@ -71,6 +78,12 @@ private: ...@@ -71,6 +78,12 @@ private:
STATIC_CONST( OM_SYNC = 0x10 ); STATIC_CONST( OM_SYNC = 0x10 );
STATIC_CONST( OM_CREATE = 0x100 ); STATIC_CONST( OM_CREATE = 0x100 );
STATIC_CONST( OM_TRUNCATE = 0x200 ); STATIC_CONST( OM_TRUNCATE = 0x200 );
STATIC_CONST( OM_AUTOSYNC = 0x400 );
STATIC_CONST( OM_CREATE_IF_NONE = 0x0400 );
STATIC_CONST( OM_INIT = 0x0800 ); //
STATIC_CONST( OM_CHECK_SIZE = 0x1000 );
STATIC_CONST( OM_DIRECT = 0x2000 );
enum Suffixes { enum Suffixes {
S_DATA = 0, S_DATA = 0,
...@@ -115,6 +128,15 @@ private: ...@@ -115,6 +128,15 @@ private:
static void v2_setSequence(Uint32 fileNumber[], Uint32 no); static void v2_setSequence(Uint32 fileNumber[], Uint32 no);
static void v2_setNodeId(Uint32 fileNumber[], Uint32 no); static void v2_setNodeId(Uint32 fileNumber[], Uint32 no);
static void v2_setCount(Uint32 fileNumber[], Uint32 no); static void v2_setCount(Uint32 fileNumber[], Uint32 no);
/**
* V4 - LCP
*/
static Uint32 v5_getLcpNo(const Uint32 fileNumber[]);
static Uint32 v5_getTableId(const Uint32 fileNumber[]);
static void v5_setLcpNo(Uint32 fileNumber[], Uint32 no);
static void v5_setTableId(Uint32 fileNumber[], Uint32 no);
}; };
/** /**
...@@ -154,8 +176,19 @@ private: ...@@ -154,8 +176,19 @@ private:
* *
* 1111111111222222222233 * 1111111111222222222233
* 01234567890123456789012345678901 * 01234567890123456789012345678901
* ppppppppddddddddssssssssvvvvvvvv * ssssssssvvvvvvvv
* *
* -- v3 --
* File number[0] = Table
* File number[1] = LcpNo
* File number[2] =
* File number[3] =
* v = version 24 - 31
* s = v1_suffix 16 - 23
*
* 1111111111222222222233
* 01234567890123456789012345678901
* ssssssssvvvvvvvv
*/ */
inline inline
Uint32 FsOpenReq::getVersion(const Uint32 fileNumber[]){ Uint32 FsOpenReq::getVersion(const Uint32 fileNumber[]){
...@@ -262,6 +295,26 @@ void FsOpenReq::v2_setCount(Uint32 fileNumber[], Uint32 val){ ...@@ -262,6 +295,26 @@ void FsOpenReq::v2_setCount(Uint32 fileNumber[], Uint32 val){
fileNumber[2] = val; fileNumber[2] = val;
} }
/****************/
inline
Uint32 FsOpenReq::v5_getTableId(const Uint32 fileNumber[]){
return fileNumber[0];
}
inline
void FsOpenReq::v5_setTableId(Uint32 fileNumber[], Uint32 val){
fileNumber[0] = val;
}
inline
Uint32 FsOpenReq::v5_getLcpNo(const Uint32 fileNumber[]){
return fileNumber[1];
}
inline
void FsOpenReq::v5_setLcpNo(Uint32 fileNumber[], Uint32 val){
fileNumber[1] = val;
}
#endif #endif
...@@ -35,12 +35,16 @@ class FsReadWriteReq { ...@@ -35,12 +35,16 @@ class FsReadWriteReq {
*/ */
friend class Ndbfs; friend class Ndbfs;
friend class VoidFs; friend class VoidFs;
friend class AsyncFile;
/** /**
* Sender(s) * Sender(s)
*/ */
friend class Dbdict; friend class Dbdict;
friend class Lgman;
friend class Tsman;
friend class Pgman;
friend class Restore;
/** /**
* For printing * For printing
...@@ -55,12 +59,14 @@ public: ...@@ -55,12 +59,14 @@ public:
fsFormatListOfPairs=0, fsFormatListOfPairs=0,
fsFormatArrayOfPages=1, fsFormatArrayOfPages=1,
fsFormatListOfMemPages=2, fsFormatListOfMemPages=2,
fsFormatGlobalPage=3,
fsFormatMax fsFormatMax
}; };
/** /**
* Length of signal * Length of signal
*/ */
STATIC_CONST( FixedLength = 6 );
private: private:
...@@ -100,6 +106,8 @@ private: ...@@ -100,6 +106,8 @@ private:
static NdbfsFormatType getFormatFlag(const UintR & opFlag); static NdbfsFormatType getFormatFlag(const UintR & opFlag);
static void setFormatFlag(UintR & opFlag, Uint8 flag); static void setFormatFlag(UintR & opFlag, Uint8 flag);
static Uint32 getPartialReadFlag(UintR opFlag);
static void setPartialReadFlag(UintR & opFlag, Uint32 flag);
}; };
/** /**
...@@ -118,6 +126,7 @@ private: ...@@ -118,6 +126,7 @@ private:
#define FORMAT_MASK (0x0F) #define FORMAT_MASK (0x0F)
#define PARTIAL_READ_SHIFT (5)
inline inline
Uint8 Uint8
...@@ -145,8 +154,18 @@ FsReadWriteReq::setFormatFlag(UintR & opFlag, Uint8 flag){ ...@@ -145,8 +154,18 @@ FsReadWriteReq::setFormatFlag(UintR & opFlag, Uint8 flag){
opFlag |= flag; opFlag |= flag;
} }
inline
void
FsReadWriteReq::setPartialReadFlag(UintR & opFlag, Uint32 flag){
ASSERT_BOOL(flag, "FsReadWriteReq::setSyncFlag");
opFlag |= (flag << PARTIAL_READ_SHIFT);
}
inline
Uint32
FsReadWriteReq::getPartialReadFlag(UintR opFlag){
return (opFlag >> PARTIAL_READ_SHIFT) & 1;
}
#endif #endif
...@@ -33,9 +33,14 @@ ...@@ -33,9 +33,14 @@
* RECIVER: * RECIVER:
*/ */
struct FsRef { struct FsRef {
friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
/** /**
* Enum type for errorCode * Enum type for errorCode
*/ */
STATIC_CONST( FS_ERR_BIT = 0x8000 );
enum NdbfsErrorCodeType { enum NdbfsErrorCodeType {
fsErrNone=0, fsErrNone=0,
fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT, fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT,
...@@ -47,6 +52,9 @@ struct FsRef { ...@@ -47,6 +52,9 @@ struct FsRef {
fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES, fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES,
fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE, fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE,
fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW, fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW,
fsErrFileExists = FS_ERR_BIT | 12,
fsErrInvalidFileSize = FS_ERR_BIT | 13,
fsErrOutOfMemory = FS_ERR_BIT | 14,
fsErrMax fsErrMax
}; };
/** /**
...@@ -89,7 +97,4 @@ FsRef::setErrorCode(UintR & errorcode, UintR errorcodetype){ ...@@ -89,7 +97,4 @@ FsRef::setErrorCode(UintR & errorcode, UintR errorcodetype){
errorcode = errorcodetype; errorcode = errorcodetype;
} }
#endif #endif
...@@ -86,6 +86,7 @@ public: ...@@ -86,6 +86,7 @@ public:
InvalidTableId = 709, InvalidTableId = 709,
TableNotDefined = 723, TableNotDefined = 723,
TableNameTooLong = 702, TableNameTooLong = 702,
NoFetchByName = 710,
Busy = 701 Busy = 701
}; };
}; };
...@@ -105,14 +106,19 @@ class GetTabInfoConf { ...@@ -105,14 +106,19 @@ class GetTabInfoConf {
friend bool printGET_TABINFO_CONF(FILE *, const Uint32 *, Uint32, Uint16); friend bool printGET_TABINFO_CONF(FILE *, const Uint32 *, Uint32, Uint16);
public: public:
STATIC_CONST( SignalLength = 4 ); STATIC_CONST( SignalLength = 6 );
SECTION( DICT_TAB_INFO = 0 ); SECTION( DICT_TAB_INFO = 0 );
public: public:
Uint32 senderData; Uint32 senderData;
Uint32 tableId; Uint32 tableId;
Uint32 gci; // For table Uint32 gci; // For table
union {
Uint32 totalLen; // In words Uint32 totalLen; // In words
Uint32 freeExtents;
};
Uint32 tableType;
Uint32 senderRef;
}; };
#endif #endif
...@@ -27,6 +27,7 @@ class KeyInfo { ...@@ -27,6 +27,7 @@ class KeyInfo {
friend class NdbOperation; friend class NdbOperation;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class NdbIndexScanOperation; friend class NdbIndexScanOperation;
friend class Restore;
/** /**
* Reciver(s) * Reciver(s)
......
...@@ -81,6 +81,9 @@ class LcpFragOrd { ...@@ -81,6 +81,9 @@ class LcpFragOrd {
* Sender(s) * Sender(s)
*/ */
friend class Dbdih; friend class Dbdih;
friend class Lgman;
friend class Pgman;
friend class Dbtup;
/** /**
* Sender(s) / Receiver(s) * Sender(s) / Receiver(s)
...@@ -151,4 +154,66 @@ private: ...@@ -151,4 +154,66 @@ private:
Uint32 lcpId; Uint32 lcpId;
}; };
struct LcpPrepareReq
{
Uint32 senderData;
Uint32 senderRef;
Uint32 lcpNo;
Uint32 tableId;
Uint32 fragmentId;
Uint32 lcpId;
Uint32 backupPtr;
Uint32 backupId;
STATIC_CONST( SignalLength = 8 );
};
struct LcpPrepareRef
{
Uint32 senderData;
Uint32 senderRef;
Uint32 tableId;
Uint32 fragmentId;
Uint32 errorCode;
STATIC_CONST( SignalLength = 5 );
};
struct LcpPrepareConf
{
Uint32 senderData;
Uint32 senderRef;
Uint32 tableId;
Uint32 fragmentId;
STATIC_CONST( SignalLength = 4 );
};
struct EndLcpReq
{
Uint32 senderData;
Uint32 senderRef;
Uint32 backupPtr;
Uint32 backupId;
STATIC_CONST( SignalLength = 4 );
};
struct EndLcpRef
{
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
STATIC_CONST( SignalLength = 3 );
};
struct EndLcpConf
{
Uint32 senderData;
Uint32 senderRef;
STATIC_CONST( SignalLength = 2 );
};
#endif #endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef LGMAN_CONTINUEB_H
#define LGMAN_CONTINUEB_H
#include "SignalData.hpp"
struct LgmanContinueB {
enum {
CUT_LOG_TAIL = 0
,FILTER_LOG = 1
,FLUSH_LOG = 2
,PROCESS_LOG_BUFFER_WAITERS = 3
,FIND_LOG_HEAD = 4
,EXECUTE_UNDO_RECORD = 5
,READ_UNDO_LOG = 6
,STOP_UNDO_LOG = 7
,PROCESS_LOG_SYNC_WAITERS = 8
,FORCE_LOG_SYNC = 9
,DROP_FILEGROUP = 10
};
};
#endif
...@@ -104,7 +104,7 @@ class LqhFragReq { ...@@ -104,7 +104,7 @@ class LqhFragReq {
friend bool printLQH_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16); friend bool printLQH_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
public: public:
STATIC_CONST( SignalLength = 25 ); STATIC_CONST( SignalLength = 19 );
enum RequestInfo { enum RequestInfo {
CreateInRunning = 0x8000000, CreateInRunning = 0x8000000,
...@@ -116,27 +116,27 @@ private: ...@@ -116,27 +116,27 @@ private:
Uint32 senderRef; Uint32 senderRef;
Uint32 fragmentId; Uint32 fragmentId;
Uint32 requestInfo; Uint32 requestInfo;
Uint32 tableId;
Uint32 localKeyLength;
Uint32 maxLoadFactor; Uint32 maxLoadFactor;
Uint32 minLoadFactor; Uint32 minLoadFactor;
Uint32 kValue; Uint32 kValue;
Uint32 lh3DistrBits;
Uint32 lh3PageBits;
Uint32 noOfAttributes;
Uint32 noOfNullAttributes;
Uint32 noOfPagesToPreAllocate;
Uint32 schemaVersion; Uint32 schemaVersion;
Uint32 keyLength;
Uint32 nextLCP; Uint32 nextLCP;
Uint32 noOfKeyAttr;
Uint32 noOfNewAttr; // noOfCharsets in upper half Uint32 noOfNewAttr; // noOfCharsets in upper half
Uint32 checksumIndicator;
Uint32 noOfAttributeGroups;
Uint32 GCPIndicator;
Uint32 startGci; Uint32 startGci;
Uint32 tableType; // DictTabInfo::TableType Uint32 tableType; // DictTabInfo::TableType
Uint32 primaryTableId; // table of index or RNIL Uint32 primaryTableId; // table of index or RNIL
Uint32 tablespace_id; // RNIL for MM table
Uint16 tableId;
Uint16 localKeyLength;
Uint16 lh3DistrBits;
Uint16 lh3PageBits;
Uint16 noOfAttributes;
Uint16 noOfNullAttributes;
Uint16 noOfPagesToPreAllocate;
Uint16 keyLength;
Uint16 noOfKeyAttr;
Uint8 checksumIndicator;
Uint8 GCPIndicator;
}; };
class LqhFragConf { class LqhFragConf {
......
...@@ -29,6 +29,7 @@ class LqhKeyReq { ...@@ -29,6 +29,7 @@ class LqhKeyReq {
* Sender(s) * Sender(s)
*/ */
friend class Dbtc; friend class Dbtc;
friend class Restore;
/** /**
* For printing * For printing
...@@ -95,6 +96,7 @@ private: ...@@ -95,6 +96,7 @@ private:
static UintR getReturnedReadLenAIFlag(const UintR & requestInfo); static UintR getReturnedReadLenAIFlag(const UintR & requestInfo);
static UintR getApplicationAddressFlag(const UintR & requestInfo); static UintR getApplicationAddressFlag(const UintR & requestInfo);
static UintR getMarkerFlag(const UintR & requestInfo); static UintR getMarkerFlag(const UintR & requestInfo);
static UintR getNoDiskFlag(const UintR & requestInfo);
/** /**
* Setters * Setters
...@@ -124,6 +126,7 @@ private: ...@@ -124,6 +126,7 @@ private:
static void setReturnedReadLenAIFlag(UintR & requestInfo, UintR val); static void setReturnedReadLenAIFlag(UintR & requestInfo, UintR val);
static void setApplicationAddressFlag(UintR & requestInfo, UintR val); static void setApplicationAddressFlag(UintR & requestInfo, UintR val);
static void setMarkerFlag(UintR & requestInfo, UintR val); static void setMarkerFlag(UintR & requestInfo, UintR val);
static void setNoDiskFlag(UintR & requestInfo, UintR val);
}; };
/** /**
...@@ -142,11 +145,12 @@ private: ...@@ -142,11 +145,12 @@ private:
* c = Same client and tc - 1 Bit (27) * c = Same client and tc - 1 Bit (27)
* u = Read Len Return Ind - 1 Bit (28) * u = Read Len Return Ind - 1 Bit (28)
* m = Commit ack marker - 1 Bit (29) * m = Commit ack marker - 1 Bit (29)
* - = Unused - 2 Bits (30-31) * x = No disk usage - 1 Bit (30)
* - = Unused - 2 Bit (31)
* *
* 1111111111222222222233 * 1111111111222222222233
* 01234567890123456789012345678901 * 01234567890123456789012345678901
* kkkkkkkkkklltttpdisooorraaacum-- * kkkkkkkkkklltttpdisooorraaacumx-
*/ */
#define RI_KEYLEN_SHIFT (0) #define RI_KEYLEN_SHIFT (0)
...@@ -168,6 +172,7 @@ private: ...@@ -168,6 +172,7 @@ private:
#define RI_SAME_CLIENT_SHIFT (27) #define RI_SAME_CLIENT_SHIFT (27)
#define RI_RETURN_AI_SHIFT (28) #define RI_RETURN_AI_SHIFT (28)
#define RI_MARKER_SHIFT (29) #define RI_MARKER_SHIFT (29)
#define RI_NODISK_SHIFT (30)
/** /**
* Scan Info * Scan Info
...@@ -464,11 +469,25 @@ LqhKeyReq::getMarkerFlag(const UintR & requestInfo){ ...@@ -464,11 +469,25 @@ LqhKeyReq::getMarkerFlag(const UintR & requestInfo){
return (requestInfo >> RI_MARKER_SHIFT) & 1; return (requestInfo >> RI_MARKER_SHIFT) & 1;
} }
inline
void
LqhKeyReq::setNoDiskFlag(UintR & requestInfo, UintR val){
ASSERT_BOOL(val, "LqhKeyReq::setNoDiskFlag");
requestInfo |= (val << RI_NODISK_SHIFT);
}
inline
UintR
LqhKeyReq::getNoDiskFlag(const UintR & requestInfo){
return (requestInfo >> RI_NODISK_SHIFT) & 1;
}
class LqhKeyConf { class LqhKeyConf {
/** /**
* Reciver(s) * Reciver(s)
*/ */
friend class Dbtc; friend class Dbtc;
friend class Restore;
/** /**
* Sender(s) * Sender(s)
......
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef PGMAN_CONTINUEB_H
#define PGMAN_CONTINUEB_H
#include "SignalData.hpp"
class PgmanContinueB {
/**
* Sender(s)/Reciver(s)
*/
friend class Pgman;
private:
enum {
STATS_LOOP = 0,
BUSY_LOOP = 1,
CLEANUP_LOOP = 2,
LCP_LOOP = 3
};
};
#endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef RESTORE_CONTINUEB_H
#define RESTORE_CONTINUEB_H
#include "SignalData.hpp"
class RestoreContinueB {
/**
* Sender(s)/Reciver(s)
*/
friend class Restore;
friend bool printCONTINUEB_RESTORE(FILE * output, const Uint32 * theData, Uint32 len);
private:
enum {
START_FILE_THREAD = 0,
BUFFER_UNDERFLOW = 1,
BUFFER_FULL_SCAN = 2,
BUFFER_FULL_FRAG_COMPLETE = 3,
BUFFER_FULL_META = 4
};
};
#endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef RESTORE_SIGNAL_DATA_HPP
#define RESTORE_SIGNAL_DATA_HPP
#include "SignalData.hpp"
struct RestoreLcpReq
{
Uint32 senderData;
Uint32 senderRef;
Uint32 lcpNo;
Uint32 tableId;
Uint32 fragmentId;
Uint32 lcpId;
STATIC_CONST( SignalLength = 6 );
};
struct RestoreLcpRef
{
Uint32 senderData;
Uint32 senderRef;
Uint32 errorCode;
Uint32 extra[1];
STATIC_CONST( SignalLength = 3 );
enum ErrorCode
{
OK = 0,
NoFileRecord = 1,
OutOfDataBuffer = 2,
OutOfReadBufferPages = 3,
InvalidFileFormat = 4
};
};
struct RestoreLcpConf
{
Uint32 senderData;
Uint32 senderRef;
STATIC_CONST( SignalLength = 2 );
};
struct RestoreContinueB {
enum {
RESTORE_NEXT = 0,
READ_FILE = 1
};
};
#endif
...@@ -60,6 +60,7 @@ public: ...@@ -60,6 +60,7 @@ public:
static Uint32 getTupScanFlag(const Uint32 & requestInfo); static Uint32 getTupScanFlag(const Uint32 & requestInfo);
static Uint32 getAttrLen(const Uint32 & requestInfo); static Uint32 getAttrLen(const Uint32 & requestInfo);
static Uint32 getScanPrio(const Uint32 & requestInfo); static Uint32 getScanPrio(const Uint32 & requestInfo);
static Uint32 getNoDiskFlag(const Uint32 & requestInfo);
static void setLockMode(Uint32 & requestInfo, Uint32 lockMode); static void setLockMode(Uint32 & requestInfo, Uint32 lockMode);
static void setHoldLockFlag(Uint32 & requestInfo, Uint32 holdLock); static void setHoldLockFlag(Uint32 & requestInfo, Uint32 holdLock);
...@@ -70,6 +71,7 @@ public: ...@@ -70,6 +71,7 @@ public:
static void setTupScanFlag(Uint32 & requestInfo, Uint32 tupScan); static void setTupScanFlag(Uint32 & requestInfo, Uint32 tupScan);
static void setAttrLen(Uint32 & requestInfo, Uint32 attrLen); static void setAttrLen(Uint32 & requestInfo, Uint32 attrLen);
static void setScanPrio(Uint32& requestInfo, Uint32 prio); static void setScanPrio(Uint32& requestInfo, Uint32 prio);
static void setNoDiskFlag(Uint32& requestInfo, Uint32 val);
}; };
class KeyInfo20 { class KeyInfo20 {
...@@ -196,6 +198,7 @@ public: ...@@ -196,6 +198,7 @@ public:
* Request Info * Request Info
* *
* a = Length of attrinfo - 16 Bits (16-31) * a = Length of attrinfo - 16 Bits (16-31)
* d = No disk - 1 Bit 4
* l = Lock Mode - 1 Bit 5 * l = Lock Mode - 1 Bit 5
* h = Hold lock - 1 Bit 7 * h = Hold lock - 1 Bit 7
* k = Keyinfo - 1 Bit 8 * k = Keyinfo - 1 Bit 8
...@@ -207,11 +210,12 @@ public: ...@@ -207,11 +210,12 @@ public:
* *
* 1111111111222222222233 * 1111111111222222222233
* 01234567890123456789012345678901 * 01234567890123456789012345678901
* lxhkrztppppaaaaaaaaaaaaaaaa * dlxhkrztppppaaaaaaaaaaaaaaaa
*/ */
#define SF_LOCK_MODE_SHIFT (5) #define SF_LOCK_MODE_SHIFT (5)
#define SF_LOCK_MODE_MASK (1) #define SF_LOCK_MODE_MASK (1)
#define SF_NO_DISK_SHIFT (4)
#define SF_HOLD_LOCK_SHIFT (7) #define SF_HOLD_LOCK_SHIFT (7)
#define SF_KEYINFO_SHIFT (8) #define SF_KEYINFO_SHIFT (8)
#define SF_READ_COMMITTED_SHIFT (9) #define SF_READ_COMMITTED_SHIFT (9)
...@@ -342,6 +346,19 @@ ScanFragReq::setAttrLen(UintR & requestInfo, UintR val){ ...@@ -342,6 +346,19 @@ ScanFragReq::setAttrLen(UintR & requestInfo, UintR val){
requestInfo |= (val << SF_ATTR_LEN_SHIFT); requestInfo |= (val << SF_ATTR_LEN_SHIFT);
} }
inline
Uint32
ScanFragReq::getNoDiskFlag(const Uint32 & requestInfo){
return (requestInfo >> SF_NO_DISK_SHIFT) & 1;
}
inline
void
ScanFragReq::setNoDiskFlag(UintR & requestInfo, UintR val){
ASSERT_BOOL(val, "ScanFragReq::setNoDiskFlag");
requestInfo |= (val << SF_NO_DISK_SHIFT);
}
inline inline
Uint32 Uint32
KeyInfo20::setScanInfo(Uint32 opNo, Uint32 scanNo){ KeyInfo20::setScanInfo(Uint32 opNo, Uint32 scanNo){
......
...@@ -85,6 +85,7 @@ private: ...@@ -85,6 +85,7 @@ private:
static Uint8 getKeyinfoFlag(const UintR & requestInfo); static Uint8 getKeyinfoFlag(const UintR & requestInfo);
static Uint16 getScanBatch(const UintR & requestInfo); static Uint16 getScanBatch(const UintR & requestInfo);
static Uint8 getDistributionKeyFlag(const UintR & requestInfo); static Uint8 getDistributionKeyFlag(const UintR & requestInfo);
static UintR getNoDiskFlag(const UintR & requestInfo);
/** /**
* Set:ers for requestInfo * Set:ers for requestInfo
...@@ -100,6 +101,7 @@ private: ...@@ -100,6 +101,7 @@ private:
static void setKeyinfoFlag(UintR & requestInfo, Uint32 flag); static void setKeyinfoFlag(UintR & requestInfo, Uint32 flag);
static void setScanBatch(Uint32& requestInfo, Uint32 sz); static void setScanBatch(Uint32& requestInfo, Uint32 sz);
static void setDistributionKeyFlag(Uint32& requestInfo, Uint32 flag); static void setDistributionKeyFlag(Uint32& requestInfo, Uint32 flag);
static void setNoDiskFlag(UintR & requestInfo, UintR val);
}; };
/** /**
...@@ -115,10 +117,11 @@ private: ...@@ -115,10 +117,11 @@ private:
x = Range Scan (TUX) - 1 Bit 15 x = Range Scan (TUX) - 1 Bit 15
b = Scan batch - 10 Bit 16-25 (max 1023) b = Scan batch - 10 Bit 16-25 (max 1023)
d = Distribution key flag d = Distribution key flag
n = No disk flag
1111111111222222222233 1111111111222222222233
01234567890123456789012345678901 01234567890123456789012345678901
ppppppppl hcktzxbbbbbbbbbb pppppppplnhcktzxbbbbbbbbbb
*/ */
#define PARALLELL_SHIFT (0) #define PARALLELL_SHIFT (0)
...@@ -150,6 +153,8 @@ private: ...@@ -150,6 +153,8 @@ private:
#define SCAN_DISTR_KEY_SHIFT (26) #define SCAN_DISTR_KEY_SHIFT (26)
#define SCAN_NODISK_SHIFT (9)
inline inline
Uint8 Uint8
ScanTabReq::getParallelism(const UintR & requestInfo){ ScanTabReq::getParallelism(const UintR & requestInfo){
...@@ -287,6 +292,19 @@ ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ ...@@ -287,6 +292,19 @@ ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){
requestInfo |= (flag << SCAN_DISTR_KEY_SHIFT); requestInfo |= (flag << SCAN_DISTR_KEY_SHIFT);
} }
inline
UintR
ScanTabReq::getNoDiskFlag(const UintR & requestInfo){
return (requestInfo >> SCAN_NODISK_SHIFT) & 1;
}
inline
void
ScanTabReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "TcKeyReq::setNoDiskFlag");
requestInfo |= (flag << SCAN_NODISK_SHIFT);
}
/** /**
* *
* SENDER: Dbtc * SENDER: Dbtc
......
...@@ -34,7 +34,6 @@ public: ...@@ -34,7 +34,6 @@ public:
friend bool printSTART_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16); friend bool printSTART_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
private:
Uint32 userPtr; Uint32 userPtr;
Uint32 userRef; Uint32 userRef;
Uint32 lcpNo; Uint32 lcpNo;
......
...@@ -127,8 +127,6 @@ private: ...@@ -127,8 +127,6 @@ private:
static Uint8 getSimpleFlag(const UintR & requestInfo); static Uint8 getSimpleFlag(const UintR & requestInfo);
static Uint8 getDirtyFlag(const UintR & requestInfo); static Uint8 getDirtyFlag(const UintR & requestInfo);
static Uint8 getInterpretedFlag(const UintR & requestInfo); static Uint8 getInterpretedFlag(const UintR & requestInfo);
static Uint8 getDistributionGroupFlag(const UintR & requestInfo);
static Uint8 getDistributionGroupTypeFlag(const UintR & requestInfo);
static Uint8 getDistributionKeyFlag(const UintR & requestInfo); static Uint8 getDistributionKeyFlag(const UintR & requestInfo);
static Uint8 getScanIndFlag(const UintR & requestInfo); static Uint8 getScanIndFlag(const UintR & requestInfo);
static Uint8 getOperationType(const UintR & requestInfo); static Uint8 getOperationType(const UintR & requestInfo);
...@@ -137,6 +135,7 @@ private: ...@@ -137,6 +135,7 @@ private:
static Uint16 getKeyLength(const UintR & requestInfo); static Uint16 getKeyLength(const UintR & requestInfo);
static Uint8 getAIInTcKeyReq(const UintR & requestInfo); static Uint8 getAIInTcKeyReq(const UintR & requestInfo);
static Uint8 getExecutingTrigger(const UintR & requestInfo); static Uint8 getExecutingTrigger(const UintR & requestInfo);
static UintR getNoDiskFlag(const UintR & requestInfo);
/** /**
* Get:ers for scanInfo * Get:ers for scanInfo
...@@ -156,8 +155,6 @@ private: ...@@ -156,8 +155,6 @@ private:
static void setSimpleFlag(UintR & requestInfo, Uint32 flag); static void setSimpleFlag(UintR & requestInfo, Uint32 flag);
static void setDirtyFlag(UintR & requestInfo, Uint32 flag); static void setDirtyFlag(UintR & requestInfo, Uint32 flag);
static void setInterpretedFlag(UintR & requestInfo, Uint32 flag); static void setInterpretedFlag(UintR & requestInfo, Uint32 flag);
static void setDistributionGroupFlag(UintR & requestInfo, Uint32 flag);
static void setDistributionGroupTypeFlag(UintR & requestInfo, Uint32 flag);
static void setDistributionKeyFlag(UintR & requestInfo, Uint32 flag); static void setDistributionKeyFlag(UintR & requestInfo, Uint32 flag);
static void setScanIndFlag(UintR & requestInfo, Uint32 flag); static void setScanIndFlag(UintR & requestInfo, Uint32 flag);
static void setExecuteFlag(UintR & requestInfo, Uint32 flag); static void setExecuteFlag(UintR & requestInfo, Uint32 flag);
...@@ -166,6 +163,7 @@ private: ...@@ -166,6 +163,7 @@ private:
static void setKeyLength(UintR & requestInfo, Uint32 len); static void setKeyLength(UintR & requestInfo, Uint32 len);
static void setAIInTcKeyReq(UintR & requestInfo, Uint32 len); static void setAIInTcKeyReq(UintR & requestInfo, Uint32 len);
static void setExecutingTrigger(UintR & requestInfo, Uint32 flag); static void setExecutingTrigger(UintR & requestInfo, Uint32 flag);
static void setNoDiskFlag(UintR & requestInfo, UintR val);
/** /**
* Set:ers for scanInfo * Set:ers for scanInfo
...@@ -184,29 +182,27 @@ private: ...@@ -184,29 +182,27 @@ private:
d = Dirty Indicator - 1 Bit 0 d = Dirty Indicator - 1 Bit 0
e = Scan Indicator - 1 Bit 14 e = Scan Indicator - 1 Bit 14
f = Execute fired trigger - 1 Bit 19 f = Execute fired trigger - 1 Bit 19
g = Distribution Group Ind- 1 Bit 1
i = Interpreted Indicator - 1 Bit 15 i = Interpreted Indicator - 1 Bit 15
k = Key length - 12 Bits -> Max 4095 (Bit 20 - 31) k = Key length - 12 Bits -> Max 4095 (Bit 20 - 31)
o = Operation Type - 3 Bits -> Max 7 (Bit 5-7) o = Operation Type - 3 Bits -> Max 7 (Bit 5-7)
l = Execute - 1 Bit 10 l = Execute - 1 Bit 10
p = Simple Indicator - 1 Bit 8 p = Simple Indicator - 1 Bit 8
s = Start Indicator - 1 Bit 11 s = Start Indicator - 1 Bit 11
t = Distribution GroupType- 1 Bit 3
y = Commit Type - 2 Bit 12-13 y = Commit Type - 2 Bit 12-13
n = No disk flag - 1 Bit 1
1111111111222222222233 1111111111222222222233
01234567890123456789012345678901 01234567890123456789012345678901
dgbtcooop lsyyeiaaafkkkkkkkkkkkk dnb cooop lsyyeiaaafkkkkkkkkkkkk
*/ */
#define TCKEY_NODISK_SHIFT (1)
#define COMMIT_SHIFT (4) #define COMMIT_SHIFT (4)
#define START_SHIFT (11) #define START_SHIFT (11)
#define SIMPLE_SHIFT (8) #define SIMPLE_SHIFT (8)
#define DIRTY_SHIFT (0) #define DIRTY_SHIFT (0)
#define EXECUTE_SHIFT (10) #define EXECUTE_SHIFT (10)
#define INTERPRETED_SHIFT (15) #define INTERPRETED_SHIFT (15)
#define DISTR_GROUP_SHIFT (1)
#define DISTR_GROUP_TYPE_SHIFT (3)
#define DISTR_KEY_SHIFT (2) #define DISTR_KEY_SHIFT (2)
#define SCAN_SHIFT (14) #define SCAN_SHIFT (14)
...@@ -303,18 +299,6 @@ TcKeyReq::getInterpretedFlag(const UintR & requestInfo){ ...@@ -303,18 +299,6 @@ TcKeyReq::getInterpretedFlag(const UintR & requestInfo){
return (Uint8)((requestInfo >> INTERPRETED_SHIFT) & 1); return (Uint8)((requestInfo >> INTERPRETED_SHIFT) & 1);
} }
inline
Uint8
TcKeyReq::getDistributionGroupFlag(const UintR & requestInfo){
return (Uint8)((requestInfo >> DISTR_GROUP_SHIFT) & 1);
}
inline
Uint8
TcKeyReq::getDistributionGroupTypeFlag(const UintR & requestInfo){
return (Uint8)((requestInfo >> DISTR_GROUP_TYPE_SHIFT) & 1);
}
inline inline
Uint8 Uint8
TcKeyReq::getDistributionKeyFlag(const UintR & requestInfo){ TcKeyReq::getDistributionKeyFlag(const UintR & requestInfo){
...@@ -413,22 +397,6 @@ TcKeyReq::setInterpretedFlag(UintR & requestInfo, Uint32 flag){ ...@@ -413,22 +397,6 @@ TcKeyReq::setInterpretedFlag(UintR & requestInfo, Uint32 flag){
requestInfo |= (flag << INTERPRETED_SHIFT); requestInfo |= (flag << INTERPRETED_SHIFT);
} }
inline
void
TcKeyReq::setDistributionGroupTypeFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "TcKeyReq::setDistributionGroupTypeFlag");
requestInfo &= ~(1 << DISTR_GROUP_TYPE_SHIFT);
requestInfo |= (flag << DISTR_GROUP_TYPE_SHIFT);
}
inline
void
TcKeyReq::setDistributionGroupFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "TcKeyReq::setDistributionGroupFlag");
requestInfo &= ~(1 << DISTR_GROUP_SHIFT);
requestInfo |= (flag << DISTR_GROUP_SHIFT);
}
inline inline
void void
TcKeyReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ TcKeyReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){
...@@ -544,5 +512,18 @@ TcKeyReq::setAttrinfoLen(UintR & anAttrLen, Uint16 aiLen){ ...@@ -544,5 +512,18 @@ TcKeyReq::setAttrinfoLen(UintR & anAttrLen, Uint16 aiLen){
anAttrLen |= aiLen; anAttrLen |= aiLen;
} }
inline
UintR
TcKeyReq::getNoDiskFlag(const UintR & requestInfo){
return (requestInfo >> TCKEY_NODISK_SHIFT) & 1;
}
inline
void
TcKeyReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){
ASSERT_BOOL(flag, "TcKeyReq::setNoDiskFlag");
requestInfo &= ~(1 << TCKEY_NODISK_SHIFT);
requestInfo |= (flag << TCKEY_NODISK_SHIFT);
}
#endif #endif
/* Copyright (C) 2003 MySQL 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; 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 */
#ifndef TSMAN_CONTINUEB_H
#define TSMAN_CONTINUEB_H
#include "SignalData.hpp"
class TsmanContinueB {
/**
* Sender(s)/Reciver(s)
*/
friend class Tsman;
private:
enum {
LOAD_EXTENT_PAGES = 0,
SCAN_TABLESPACE_EXTENT_HEADERS = 1,
SCAN_DATAFILE_EXTENT_HEADERS = 2,
END_LCP = 3,
RELEASE_EXTENT_PAGES = 4
};
};
#endif
...@@ -30,7 +30,7 @@ class TupFragReq { ...@@ -30,7 +30,7 @@ class TupFragReq {
friend class Dblqh; friend class Dblqh;
friend class Dbtup; friend class Dbtup;
public: public:
STATIC_CONST( SignalLength = 14 ); STATIC_CONST( SignalLength = 15 );
private: private:
Uint32 userPtr; Uint32 userPtr;
Uint32 userRef; Uint32 userRef;
...@@ -39,6 +39,7 @@ private: ...@@ -39,6 +39,7 @@ private:
Uint32 noOfAttr; Uint32 noOfAttr;
Uint32 fragId; Uint32 fragId;
Uint32 todo[8]; Uint32 todo[8];
Uint32 tablespaceid;
}; };
class TupFragConf { class TupFragConf {
......
...@@ -36,7 +36,7 @@ class TupKeyReq { ...@@ -36,7 +36,7 @@ class TupKeyReq {
friend bool printTUPKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); friend bool printTUPKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
public: public:
STATIC_CONST( SignalLength = 18 ); STATIC_CONST( SignalLength = 16 );
private: private:
...@@ -45,14 +45,11 @@ private: ...@@ -45,14 +45,11 @@ private:
*/ */
Uint32 connectPtr; Uint32 connectPtr;
Uint32 request; Uint32 request;
Uint32 tableRef;
Uint32 fragId;
Uint32 keyRef1; Uint32 keyRef1;
Uint32 keyRef2; Uint32 keyRef2;
Uint32 attrBufLen; Uint32 attrBufLen;
Uint32 opRef; Uint32 opRef;
Uint32 applRef; Uint32 applRef;
Uint32 schemaVersion;
Uint32 storedProcedure; Uint32 storedProcedure;
Uint32 transId1; Uint32 transId1;
Uint32 transId2; Uint32 transId2;
...@@ -61,6 +58,7 @@ private: ...@@ -61,6 +58,7 @@ private:
Uint32 coordinatorTC; Uint32 coordinatorTC;
Uint32 tcOpIndex; Uint32 tcOpIndex;
Uint32 savePointId; Uint32 savePointId;
Uint32 disk_page;
}; };
class TupKeyConf { class TupKeyConf {
......
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
NoMemError = 902 NoMemError = 902
}; };
STATIC_CONST( SignalLength = 8 ); STATIC_CONST( SignalLength = 8 );
private:
/* /*
* Error code set by TUX. Zero means no error. * Error code set by TUX. Zero means no error.
*/ */
...@@ -56,12 +56,15 @@ private: ...@@ -56,12 +56,15 @@ private:
* and version number. * and version number.
*/ */
Uint32 pageId; Uint32 pageId;
Uint32 pageOffset; Uint32 pageIndex;
Uint32 tupVersion; Uint32 tupVersion;
/* /*
* Operation code and flags. * Operation code and flags.
*/ */
Uint32 opInfo; Uint32 opInfo;
Uint32 tupFragPtrI;
Uint32 fragPageId;
}; };
#endif #endif
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <ndb_global.h> #include <ndb_global.h>
#include "ndb_limits.h" #include "ndb_limits.h"
#include <signaldata/DictTabInfo.hpp>
#ifndef MIN #ifndef MIN
#define MIN(x,y) (((x)<(y))?(x):(y)) #define MIN(x,y) (((x)<(y))?(x):(y))
...@@ -32,16 +33,17 @@ ...@@ -32,16 +33,17 @@
struct TriggerType { struct TriggerType {
enum Value { enum Value {
CONSTRAINT = 0, //CONSTRAINT = 0,
SECONDARY_INDEX = 1, SECONDARY_INDEX = DictTabInfo::HashIndexTrigger,
FOREIGN_KEY = 2, //FOREIGN_KEY = 2,
SCHEMA_UPGRADE = 3, //SCHEMA_UPGRADE = 3,
API_TRIGGER = 4, //API_TRIGGER = 4,
SQL_TRIGGER = 5, //SQL_TRIGGER = 5,
SUBSCRIPTION = 6, SUBSCRIPTION = DictTabInfo::SubscriptionTrigger,
READ_ONLY_CONSTRAINT = 7, READ_ONLY_CONSTRAINT = DictTabInfo::ReadOnlyConstraint,
ORDERED_INDEX = 8, ORDERED_INDEX = DictTabInfo::IndexTrigger,
SUBSCRIPTION_BEFORE = 9
SUBSCRIPTION_BEFORE = 9 // Only used by TUP/SUMA, should be REMOVED!!
}; };
}; };
......
...@@ -69,4 +69,20 @@ ...@@ -69,4 +69,20 @@
#define NDB_TYPE_MAX 31 #define NDB_TYPE_MAX 31
/*
* Attribute array type.
*/
#define NDB_ARRAYTYPE_FIXED 0 /* 0 length bytes */
#define NDB_ARRAYTYPE_SHORT_VAR 1 /* 1 length bytes */
#define NDB_ARRAYTYPE_MEDIUM_VAR 2 /* 2 length bytes */
/*
* Attribute storage type.
*/
#define NDB_STORAGETYPE_MEMORY 0
#define NDB_STORAGETYPE_DISK 1
#endif #endif
...@@ -106,7 +106,11 @@ public: ...@@ -106,7 +106,11 @@ public:
HashIndexTrigger = 7, ///< Index maintenance, internal HashIndexTrigger = 7, ///< Index maintenance, internal
IndexTrigger = 8, ///< Index maintenance, internal IndexTrigger = 8, ///< Index maintenance, internal
SubscriptionTrigger = 9,///< Backup or replication, internal SubscriptionTrigger = 9,///< Backup or replication, internal
ReadOnlyConstraint = 10 ///< Trigger, internal ReadOnlyConstraint = 10,///< Trigger, internal
Tablespace = 20, ///< Tablespace
LogfileGroup = 21, ///< Logfile group
Datafile = 22, ///< Datafile
Undofile = 23 ///< Undofile
}; };
/** /**
...@@ -155,6 +159,7 @@ public: ...@@ -155,6 +159,7 @@ public:
}; };
class Table; // forward declaration class Table; // forward declaration
class Tablespace; // forward declaration
/** /**
* @class Column * @class Column
...@@ -212,6 +217,34 @@ public: ...@@ -212,6 +217,34 @@ public:
Timestamp = NDB_TYPE_TIMESTAMP ///< Unix time Timestamp = NDB_TYPE_TIMESTAMP ///< Unix time
}; };
/*
* Array type specifies internal attribute format.
*
* - ArrayTypeFixed is stored as fixed number of bytes. This type
* is fastest to access but can waste space.
*
* - ArrayTypeVar is stored as variable number of bytes with a fixed
* overhead of 2 bytes.
*
* Default is ArrayTypeVar for Var* types and ArrayTypeFixed for
* others. The default is normally ok.
*/
enum ArrayType {
ArrayTypeFixed = NDB_ARRAYTYPE_FIXED, // 0 length bytes
ArrayTypeShortVar = NDB_ARRAYTYPE_SHORT_VAR, // 1 length bytes
ArrayTypeMediumVar = NDB_ARRAYTYPE_MEDIUM_VAR // 2 length bytes
};
/*
* Storage type specifies whether attribute is stored in memory or
* on disk. Default is memory. Disk attributes are potentially
* much slower to access and cannot be indexed in version 5.1.
*/
enum StorageType {
StorageTypeMemory = NDB_STORAGETYPE_MEMORY,
StorageTypeDisk = NDB_STORAGETYPE_DISK
};
/** /**
* @name General * @name General
* @{ * @{
...@@ -238,6 +271,10 @@ public: ...@@ -238,6 +271,10 @@ public:
*/ */
int getColumnNo() const; int getColumnNo() const;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
int getAttrId() const;
#endif
/** /**
* Check if column is equal to some other column * Check if column is equal to some other column
* @param column Column to compare with * @param column Column to compare with
...@@ -331,6 +368,9 @@ public: ...@@ -331,6 +368,9 @@ public:
inline bool getDistributionKey() const { return getPartitionKey(); }; inline bool getDistributionKey() const { return getPartitionKey(); };
#endif #endif
ArrayType getArrayType() const;
StorageType getStorageType() const;
/** @} *******************************************************************/ /** @} *******************************************************************/
...@@ -439,6 +479,9 @@ public: ...@@ -439,6 +479,9 @@ public:
{ setPartitionKey(enable); }; { setPartitionKey(enable); };
#endif #endif
void setArrayType(ArrayType type);
void setStorageType(StorageType type);
/** @} *******************************************************************/ /** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
...@@ -456,6 +499,7 @@ public: ...@@ -456,6 +499,7 @@ public:
static const Column * COMMIT_COUNT; static const Column * COMMIT_COUNT;
static const Column * ROW_SIZE; static const Column * ROW_SIZE;
static const Column * RANGE_NO; static const Column * RANGE_NO;
static const Column * DISK_REF;
static const Column * RECORDS_IN_RANGE; static const Column * RECORDS_IN_RANGE;
int getSizeInBytes() const; int getSizeInBytes() const;
...@@ -704,6 +748,10 @@ public: ...@@ -704,6 +748,10 @@ public:
*/ */
void setMaxLoadFactor(int); void setMaxLoadFactor(int);
void setTablespace(const char * name);
void setTablespace(const class Tablespace &);
const char * getTablespace() const;
/** /**
* Get table object type * Get table object type
*/ */
...@@ -1122,6 +1170,158 @@ public: ...@@ -1122,6 +1170,158 @@ public:
Event(NdbEventImpl&); Event(NdbEventImpl&);
}; };
struct AutoGrowSpecification {
Uint32 min_free;
Uint64 max_size;
Uint64 file_size;
const char * filename_pattern;
};
/**
* @class LogfileGroup
*/
class LogfileGroup : public Object {
public:
LogfileGroup();
virtual ~LogfileGroup();
void setName(const char * name);
const char* getName() const;
void setUndoBufferSize(Uint32 sz);
Uint32 getUndoBufferSize() const;
void setAutoGrowSpecification(const AutoGrowSpecification&);
const AutoGrowSpecification& getAutoGrowSpecification() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
private:
friend class NdbDictionaryImpl;
friend class NdbLogfileGroupImpl;
class NdbLogfileGroupImpl & m_impl;
LogfileGroup(NdbLogfileGroupImpl&);
};
/**
* @class Tablespace
*/
class Tablespace : public Object {
public:
Tablespace();
virtual ~Tablespace();
void setName(const char * name);
const char* getName() const;
void setExtentSize(Uint32 sz);
Uint32 getExtentSize() const;
void setAutoGrowSpecification(const AutoGrowSpecification&);
const AutoGrowSpecification& getAutoGrowSpecification() const;
void setDefaultLogfileGroup(const char * name);
void setDefaultLogfileGroup(const class LogfileGroup&);
const char * getDefaultLogfileGroup() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
private:
friend class NdbTablespaceImpl;
class NdbTablespaceImpl & m_impl;
Tablespace(NdbTablespaceImpl&);
};
class Datafile : public Object {
public:
Datafile();
virtual ~Datafile();
void setPath(const char * name);
const char* getPath() const;
void setSize(Uint64);
Uint64 getSize() const;
Uint64 getFree() const;
void setTablespace(const char * name);
void setTablespace(const class Tablespace &);
const char * getTablespace() const;
void setNode(Uint32 nodeId);
Uint32 getNode() const;
Uint32 getFileNo() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
private:
friend class NdbDatafileImpl;
class NdbDatafileImpl & m_impl;
Datafile(NdbDatafileImpl&);
};
class Undofile : public Object {
public:
Undofile();
virtual ~Undofile();
void setPath(const char * path);
const char* getPath() const;
void setSize(Uint64);
Uint64 getSize() const;
Uint64 getFree() const;
void setLogfileGroup(const char * name);
void setLogfileGroup(const class LogfileGroup &);
const char * getLogfileGroup() const;
void setNode(Uint32 nodeId);
Uint32 getNode() const;
Uint32 getFileNo() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
private:
friend class NdbUndofileImpl;
class NdbUndofileImpl & m_impl;
Undofile(NdbUndofileImpl&);
};
/** /**
* @class Dictionary * @class Dictionary
* @brief Dictionary for defining and retreiving meta data * @brief Dictionary for defining and retreiving meta data
...@@ -1356,6 +1556,30 @@ public: ...@@ -1356,6 +1556,30 @@ public:
/** @} *******************************************************************/ /** @} *******************************************************************/
/** @} *******************************************************************/
/**
* @name Disk data objects
* @{
*/
int createLogfileGroup(const LogfileGroup &);
int dropLogfileGroup(const LogfileGroup&);
LogfileGroup getLogfileGroup(const char * name);
int createTablespace(const Tablespace &);
int dropTablespace(const Tablespace&);
Tablespace getTablespace(const char * name);
int createDatafile(const Datafile &, bool overwrite_existing = false);
int dropDatafile(const Datafile&);
Datafile getDatafile(Uint32 node, const char * path);
int createUndofile(const Undofile &, bool overwrite_existing = false);
int dropUndofile(const Undofile&);
Undofile getUndofile(Uint32 node, const char * path);
/** @} *******************************************************************/
protected: protected:
Dictionary(Ndb & ndb); Dictionary(Ndb & ndb);
~Dictionary(); ~Dictionary();
......
...@@ -112,17 +112,23 @@ public: ...@@ -112,17 +112,23 @@ public:
* @param attr Attribute name, alternatively: * @param attr Attribute name, alternatively:
* @param type Type of bound * @param type Type of bound
* @param value Pointer to bound value, 0 for NULL * @param value Pointer to bound value, 0 for NULL
* @param len Value length in bytes.
* Fixed per datatype and can be omitted
* @return 0 if successful otherwise -1 * @return 0 if successful otherwise -1
*
* @note See comment under equal() about data format and length.
*/ */
int setBound(const char* attr, int type, const void* value, Uint32 len = 0); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int setBound(const char* attr, int type, const void* value, Uint32 len);
#endif
int setBound(const char* attr, int type, const void* value);
/** /**
* Define bound on index key in range scan using index column id. * Define bound on index key in range scan using index column id.
* See the other setBound() method for details. * See the other setBound() method for details.
*/ */
int setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len = 0); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len);
#endif
int setBound(Uint32 anAttrId, int type, const void* aValue);
/** /**
* Reset bounds and put operation in list that will be * Reset bounds and put operation in list that will be
...@@ -155,11 +161,11 @@ private: ...@@ -155,11 +161,11 @@ private:
NdbIndexScanOperation(Ndb* aNdb); NdbIndexScanOperation(Ndb* aNdb);
virtual ~NdbIndexScanOperation(); virtual ~NdbIndexScanOperation();
int setBound(const NdbColumnImpl*, int type, const void* aValue, Uint32 len); int setBound(const NdbColumnImpl*, int type, const void* aValue);
int insertBOUNDS(Uint32 * data, Uint32 sz); int insertBOUNDS(Uint32 * data, Uint32 sz);
Uint32 getKeyFromSCANTABREQ(Uint32* data, Uint32 size); Uint32 getKeyFromSCANTABREQ(Uint32* data, Uint32 size);
virtual int equal_impl(const NdbColumnImpl*, const char*, Uint32); virtual int equal_impl(const NdbColumnImpl*, const char*);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char*); virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char*);
void fix_get_values(); void fix_get_values();
...@@ -174,4 +180,20 @@ private: ...@@ -174,4 +180,20 @@ private:
friend struct Ndb_free_list_t<NdbIndexScanOperation>; friend struct Ndb_free_list_t<NdbIndexScanOperation>;
}; };
inline
int
NdbIndexScanOperation::setBound(const char* attr, int type, const void* value,
Uint32 len)
{
return setBound(attr, type, value);
}
inline
int
NdbIndexScanOperation::setBound(Uint32 anAttrId, int type, const void* value,
Uint32 len)
{
return setBound(anAttrId, type, value);
}
#endif #endif
...@@ -251,28 +251,27 @@ public: ...@@ -251,28 +251,27 @@ public:
* @note There are 10 versions of equal() with * @note There are 10 versions of equal() with
* slightly different parameters. * slightly different parameters.
* *
* @note When using equal() with a string (char *) as * @note If attribute has fixed size, value must include all bytes.
* second argument, the string needs to be padded with * In particular a Char must be native-blank padded.
* zeros in the following sense: * If attribute has variable size, value must start with
* @code * 1 or 2 little-endian length bytes (2 if Long*).
* // Equal needs strings to be padded with zeros
* strncpy(buf, str, sizeof(buf));
* NdbOperation->equal("Attr1", buf);
* @endcode
*
*
* *
* @param anAttrName Attribute name * @param anAttrName Attribute name
* @param aValue Attribute value. * @param aValue Attribute value.
* @param len Attribute length expressed in bytes.
* @return -1 if unsuccessful. * @return -1 if unsuccessful.
*/ */
int equal(const char* anAttrName, const char* aValue, Uint32 len = 0); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int equal(const char* anAttrName, Uint32 aValue); int equal(const char* anAttrName, const char* aValue, Uint32 len);
#endif
int equal(const char* anAttrName, const char* aValue);
int equal(const char* anAttrName, Int32 aValue); int equal(const char* anAttrName, Int32 aValue);
int equal(const char* anAttrName, Uint32 aValue);
int equal(const char* anAttrName, Int64 aValue); int equal(const char* anAttrName, Int64 aValue);
int equal(const char* anAttrName, Uint64 aValue); int equal(const char* anAttrName, Uint64 aValue);
int equal(Uint32 anAttrId, const char* aValue, Uint32 len = 0); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int equal(Uint32 anAttrId, const char* aValue, Uint32 len);
#endif
int equal(Uint32 anAttrId, const char* aValue);
int equal(Uint32 anAttrId, Int32 aValue); int equal(Uint32 anAttrId, Int32 aValue);
int equal(Uint32 anAttrId, Uint32 aValue); int equal(Uint32 anAttrId, Uint32 aValue);
int equal(Uint32 anAttrId, Int64 aValue); int equal(Uint32 anAttrId, Int64 aValue);
...@@ -350,27 +349,33 @@ public: ...@@ -350,27 +349,33 @@ public:
* @note There are 14 versions of NdbOperation::setValue with * @note There are 14 versions of NdbOperation::setValue with
* slightly different parameters. * slightly different parameters.
* *
* @note See note under equal() about value format and length.
*
* @param anAttrName Name (or Id) of attribute. * @param anAttrName Name (or Id) of attribute.
* @param aValue Attribute value to set. * @param aValue Attribute value to set.
* @param len Attribute length expressed in bytes.
* @return -1 if unsuccessful. * @return -1 if unsuccessful.
*/ */
virtual int setValue(const char* anAttrName, const char* aValue, #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
Uint32 len = 0); int setValue(const char* anAttrName, const char* aValue, Uint32 len);
virtual int setValue(const char* anAttrName, Int32 aValue); #endif
virtual int setValue(const char* anAttrName, Uint32 aValue); int setValue(const char* anAttrName, const char* aValue);
virtual int setValue(const char* anAttrName, Uint64 aValue); int setValue(const char* anAttrName, Int32 aValue);
virtual int setValue(const char* anAttrName, Int64 aValue); int setValue(const char* anAttrName, Uint32 aValue);
virtual int setValue(const char* anAttrName, float aValue); int setValue(const char* anAttrName, Int64 aValue);
virtual int setValue(const char* anAttrName, double aValue); int setValue(const char* anAttrName, Uint64 aValue);
int setValue(const char* anAttrName, float aValue);
virtual int setValue(Uint32 anAttrId, const char* aValue, Uint32 len = 0); int setValue(const char* anAttrName, double aValue);
virtual int setValue(Uint32 anAttrId, Int32 aValue);
virtual int setValue(Uint32 anAttrId, Uint32 aValue); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
virtual int setValue(Uint32 anAttrId, Uint64 aValue); int setValue(Uint32 anAttrId, const char* aValue, Uint32 len);
virtual int setValue(Uint32 anAttrId, Int64 aValue); #endif
virtual int setValue(Uint32 anAttrId, float aValue); int setValue(Uint32 anAttrId, const char* aValue);
virtual int setValue(Uint32 anAttrId, double aValue); int setValue(Uint32 anAttrId, Int32 aValue);
int setValue(Uint32 anAttrId, Uint32 aValue);
int setValue(Uint32 anAttrId, Int64 aValue);
int setValue(Uint32 anAttrId, Uint64 aValue);
int setValue(Uint32 anAttrId, float aValue);
int setValue(Uint32 anAttrId, double aValue);
/** /**
* This method replaces getValue/setValue for blobs. It creates * This method replaces getValue/setValue for blobs. It creates
...@@ -835,9 +840,9 @@ protected: ...@@ -835,9 +840,9 @@ protected:
* These are support methods only used locally in this class. * These are support methods only used locally in this class.
******************************************************************************/ ******************************************************************************/
virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len); virtual int equal_impl(const NdbColumnImpl*,const char* aValue);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0); virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue);
NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject); NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
...@@ -856,6 +861,7 @@ protected: ...@@ -856,6 +861,7 @@ protected:
int insertKEYINFO(const char* aValue, int insertKEYINFO(const char* aValue,
Uint32 aStartPosition, Uint32 aStartPosition,
Uint32 aKeyLenInByte); Uint32 aKeyLenInByte);
void reorderKEYINFO();
virtual void setErrorCode(int aErrorCode); virtual void setErrorCode(int aErrorCode);
virtual void setErrorCodeAbort(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode);
...@@ -951,6 +957,7 @@ protected: ...@@ -951,6 +957,7 @@ protected:
Uint8 theDirtyIndicator; // Indicator of whether dirty operation Uint8 theDirtyIndicator; // Indicator of whether dirty operation
Uint8 theInterpretIndicator; // Indicator of whether interpreted operation Uint8 theInterpretIndicator; // Indicator of whether interpreted operation
Int8 theDistrKeyIndicator_; // Indicates whether distr. key is used Int8 theDistrKeyIndicator_; // Indicates whether distr. key is used
Uint8 m_no_disk_flag;
Uint16 m_tcReqGSN; Uint16 m_tcReqGSN;
Uint16 m_keyInfoGSN; Uint16 m_keyInfoGSN;
...@@ -1084,6 +1091,13 @@ NdbOperation::NdbCon(NdbTransaction* aNdbCon) ...@@ -1084,6 +1091,13 @@ NdbOperation::NdbCon(NdbTransaction* aNdbCon)
theNdbCon = aNdbCon; theNdbCon = aNdbCon;
} }
inline
int
NdbOperation::equal(const char* anAttrName, const char* aValue, Uint32 len)
{
return equal(anAttrName, aValue);
}
inline inline
int int
NdbOperation::equal(const char* anAttrName, Int32 aPar) NdbOperation::equal(const char* anAttrName, Int32 aPar)
...@@ -1112,6 +1126,13 @@ NdbOperation::equal(const char* anAttrName, Uint64 aPar) ...@@ -1112,6 +1126,13 @@ NdbOperation::equal(const char* anAttrName, Uint64 aPar)
return equal(anAttrName, (const char*)&aPar, (Uint32)8); return equal(anAttrName, (const char*)&aPar, (Uint32)8);
} }
inline
int
NdbOperation::equal(Uint32 anAttrId, const char* aValue, Uint32 len)
{
return equal(anAttrId, aValue);
}
inline inline
int int
NdbOperation::equal(Uint32 anAttrId, Int32 aPar) NdbOperation::equal(Uint32 anAttrId, Int32 aPar)
...@@ -1140,6 +1161,13 @@ NdbOperation::equal(Uint32 anAttrId, Uint64 aPar) ...@@ -1140,6 +1161,13 @@ NdbOperation::equal(Uint32 anAttrId, Uint64 aPar)
return equal(anAttrId, (const char*)&aPar, (Uint32)8); return equal(anAttrId, (const char*)&aPar, (Uint32)8);
} }
inline
int
NdbOperation::setValue(const char* anAttrName, const char* aValue, Uint32 len)
{
return setValue(anAttrName, aValue);
}
inline inline
int int
NdbOperation::setValue(const char* anAttrName, Int32 aPar) NdbOperation::setValue(const char* anAttrName, Int32 aPar)
...@@ -1182,6 +1210,13 @@ NdbOperation::setValue(const char* anAttrName, double aPar) ...@@ -1182,6 +1210,13 @@ NdbOperation::setValue(const char* anAttrName, double aPar)
return setValue(anAttrName, (const char*)&aPar, (Uint32)8); return setValue(anAttrName, (const char*)&aPar, (Uint32)8);
} }
inline
int
NdbOperation::setValue(Uint32 anAttrId, const char* aValue, Uint32 len)
{
return setValue(anAttrId, aValue);
}
inline inline
int int
NdbOperation::setValue(Uint32 anAttrId, Int32 aPar) NdbOperation::setValue(Uint32 anAttrId, Int32 aPar)
......
...@@ -97,24 +97,8 @@ public: ...@@ -97,24 +97,8 @@ public:
/** /**
* Get attribute (element) size in bytes. * Get attribute (element) size in bytes.
* *
* @note For arrays, the method only gives the size of an element.
* The total attribute size is calculated by
* multiplying this value with the value
* returned by NdbRecAttr::arraySize.
*
* @return Attribute size in 32 bit unsigned int.
*/
Uint32 attrSize() const ;
/**
* Get array size of attribute.
* For variable-sized arrays this method returns the
* size of the attribute read.
*
* @return array size in 32 unsigned int.
*/ */
Uint32 arraySize() const ; Uint32 get_size_in_bytes() const { return m_size_in_bytes; }
Uint32 getLength() const ;
/** @} *********************************************************************/ /** @} *********************************************************************/
/** /**
...@@ -252,7 +236,8 @@ private: ...@@ -252,7 +236,8 @@ private:
Uint32 attrId() const; /* Get attribute id */ Uint32 attrId() const; /* Get attribute id */
bool setNULL(); /* Set NULL indicator */ bool setNULL(); /* Set NULL indicator */
void setUNDEFINED(); /* Set UNDEFINED indicator */ void setUNDEFINED(); //
bool receive_data(const Uint32*, Uint32); bool receive_data(const Uint32*, Uint32);
void release(); /* Release memory if allocated */ void release(); /* Release memory if allocated */
...@@ -276,10 +261,7 @@ private: ...@@ -276,10 +261,7 @@ private:
NdbRecAttr* theNext; /* Next pointer */ NdbRecAttr* theNext; /* Next pointer */
Uint32 theAttrId; /* The attribute id */ Uint32 theAttrId; /* The attribute id */
int theNULLind; Int32 m_size_in_bytes;
bool m_nullable;
Uint32 theAttrSize;
Uint32 theArraySize;
const NdbDictionary::Column* m_column; const NdbDictionary::Column* m_column;
friend struct Ndb_free_list_t<NdbRecAttr>; friend struct Ndb_free_list_t<NdbRecAttr>;
...@@ -299,19 +281,6 @@ NdbRecAttr::getColumn() const { ...@@ -299,19 +281,6 @@ NdbRecAttr::getColumn() const {
return m_column; return m_column;
} }
inline
Uint32
NdbRecAttr::attrSize() const {
return theAttrSize;
}
inline
Uint32
NdbRecAttr::arraySize() const
{
return theArraySize;
}
inline inline
Int32 Int32
NdbRecAttr::int32_value() const NdbRecAttr::int32_value() const
...@@ -373,7 +342,6 @@ NdbRecAttr::init() ...@@ -373,7 +342,6 @@ NdbRecAttr::init()
theRef = 0; theRef = 0;
theNext = 0; theNext = 0;
theAttrId = 0xFFFF; theAttrId = 0xFFFF;
theNULLind = -1;
} }
inline inline
...@@ -422,22 +390,22 @@ inline ...@@ -422,22 +390,22 @@ inline
bool bool
NdbRecAttr::setNULL() NdbRecAttr::setNULL()
{ {
theNULLind = 1; m_size_in_bytes= 0;
return m_nullable; return true;
} }
inline inline
void int
NdbRecAttr::setUNDEFINED() NdbRecAttr::isNULL() const
{ {
theNULLind = -1; return m_size_in_bytes == 0 ? 1 : (m_size_in_bytes > 0 ? 0 : -1);
} }
inline inline
int void
NdbRecAttr::isNULL() const NdbRecAttr::setUNDEFINED()
{ {
return theNULLind; m_size_in_bytes= -1;
} }
class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &); class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &);
......
...@@ -47,6 +47,9 @@ public: ...@@ -47,6 +47,9 @@ public:
/** @brief Checks if the string is empty */ /** @brief Checks if the string is empty */
bool empty() const; bool empty() const;
/** @brief Clear a string */
void clear();
/** @brief Convert to uppercase */ /** @brief Convert to uppercase */
BaseString& ndb_toupper(); BaseString& ndb_toupper();
...@@ -206,6 +209,15 @@ BaseString::empty() const ...@@ -206,6 +209,15 @@ BaseString::empty() const
return m_len == 0; return m_len == 0;
} }
inline void
BaseString::clear()
{
delete[] m_chr;
m_chr = new char[1];
m_chr[0] = 0;
m_len = 0;
}
inline BaseString& inline BaseString&
BaseString::ndb_toupper() { BaseString::ndb_toupper() {
for(unsigned i = 0; i < length(); i++) for(unsigned i = 0; i < length(); i++)
......
...@@ -62,6 +62,9 @@ public: ...@@ -62,6 +62,9 @@ public:
*/ */
static void clear(unsigned size, Uint32 data[]); static void clear(unsigned size, Uint32 data[]);
static Uint32 getWord(unsigned size, Uint32 data[], unsigned word_pos);
static void setWord(unsigned size, Uint32 data[],
unsigned word_pos, Uint32 new_word);
/** /**
* isclear - Check if all bits are clear. This is faster * isclear - Check if all bits are clear. This is faster
* than checking count() == 0. * than checking count() == 0.
...@@ -204,6 +207,21 @@ BitmaskImpl::clear(unsigned size, Uint32 data[]) ...@@ -204,6 +207,21 @@ BitmaskImpl::clear(unsigned size, Uint32 data[])
} }
} }
inline
Uint32
BitmaskImpl::getWord(unsigned size, Uint32 data[], unsigned word_pos)
{
return data[word_pos];
}
inline void
BitmaskImpl::setWord(unsigned size, Uint32 data[],
unsigned word_pos, Uint32 new_word)
{
data[word_pos] = new_word;
return;
}
inline bool inline bool
BitmaskImpl::isclear(unsigned size, const Uint32 data[]) BitmaskImpl::isclear(unsigned size, const Uint32 data[])
{ {
...@@ -430,6 +448,12 @@ public: ...@@ -430,6 +448,12 @@ public:
static void clear(Uint32 data[]); static void clear(Uint32 data[]);
void clear(); void clear();
/**
* Get and set words of bits
*/
Uint32 getWord(unsigned word_pos);
void setWord(unsigned word_pos, Uint32 new_word);
/** /**
* isclear - Check if all bits are clear. This is faster * isclear - Check if all bits are clear. This is faster
* than checking count() == 0. * than checking count() == 0.
...@@ -631,6 +655,20 @@ BitmaskPOD<size>::clear() ...@@ -631,6 +655,20 @@ BitmaskPOD<size>::clear()
BitmaskPOD<size>::clear(rep.data); BitmaskPOD<size>::clear(rep.data);
} }
template <unsigned size>
inline Uint32
BitmaskPOD<size>::getWord(unsigned word_pos)
{
return BitmaskImpl::getWord(size, rep.data, word_pos);
}
template <unsigned size>
inline void
BitmaskPOD<size>::setWord(unsigned word_pos, Uint32 new_word)
{
BitmaskImpl::setWord(size, rep.data, word_pos, new_word);
}
template <unsigned size> template <unsigned size>
inline bool inline bool
BitmaskPOD<size>::isclear(const Uint32 data[]) BitmaskPOD<size>::isclear(const Uint32 data[])
......
...@@ -84,9 +84,11 @@ public: ...@@ -84,9 +84,11 @@ public:
len = 0; len = 0;
} }
int length() const { return len; }; int length() const { return len; }
void *get_data() const { return data; }; void *get_data() const { return data; }
bool empty () const { return len == 0; }
private: private:
void *data; /* Pointer to data storage */ void *data; /* Pointer to data storage */
size_t len; /* Size of the stored data */ size_t len; /* Size of the stored data */
......
...@@ -33,6 +33,10 @@ const BlockName BlockNames[] = { ...@@ -33,6 +33,10 @@ const BlockName BlockNames[] = {
{ "DBUTIL", DBUTIL }, { "DBUTIL", DBUTIL },
{ "SUMA", SUMA }, { "SUMA", SUMA },
{ "DBTUX", DBTUX } { "DBTUX", DBTUX }
,{ "TSMAN", TSMAN}
,{ "LGMAN", LGMAN }
,{ "PGMAN", PGMAN }
,{ "RESTORE", RESTORE }
}; };
const BlockNumber NO_OF_BLOCK_NAMES = sizeof(BlockNames) / sizeof(BlockName); const BlockNumber NO_OF_BLOCK_NAMES = sizeof(BlockNames) / sizeof(BlockName);
...@@ -30,7 +30,6 @@ DictTabInfo::TableMapping[] = { ...@@ -30,7 +30,6 @@ DictTabInfo::TableMapping[] = {
DTIMAP2(Table, MinLoadFactor, MinLoadFactor, 0, 90), DTIMAP2(Table, MinLoadFactor, MinLoadFactor, 0, 90),
DTIMAP2(Table, MaxLoadFactor, MaxLoadFactor, 25, 110), DTIMAP2(Table, MaxLoadFactor, MaxLoadFactor, 25, 110),
DTIMAP2(Table, FragmentTypeVal, FragmentType, 0, 3), DTIMAP2(Table, FragmentTypeVal, FragmentType, 0, 3),
DTIMAP2(Table, TableStorageVal, TableStorage, 0, 0),
DTIMAP2(Table, TableTypeVal, TableType, 1, 3), DTIMAP2(Table, TableTypeVal, TableType, 1, 3),
DTIMAP(Table, NoOfKeyAttr, NoOfKeyAttr), DTIMAP(Table, NoOfKeyAttr, NoOfKeyAttr),
DTIMAP2(Table, NoOfAttributes, NoOfAttributes, 1, MAX_ATTRIBUTES_IN_TABLE), DTIMAP2(Table, NoOfAttributes, NoOfAttributes, 1, MAX_ATTRIBUTES_IN_TABLE),
...@@ -48,6 +47,8 @@ DictTabInfo::TableMapping[] = { ...@@ -48,6 +47,8 @@ DictTabInfo::TableMapping[] = {
DTIMAP(Table, FragmentCount, FragmentCount), DTIMAP(Table, FragmentCount, FragmentCount),
DTIMAP2(Table, FragmentDataLen, FragmentDataLen, 0, MAX_FRAGMENT_DATA_BYTES), DTIMAP2(Table, FragmentDataLen, FragmentDataLen, 0, MAX_FRAGMENT_DATA_BYTES),
DTIMAPB(Table, FragmentData, FragmentData, 0, MAX_FRAGMENT_DATA_BYTES, FragmentDataLen), DTIMAPB(Table, FragmentData, FragmentData, 0, MAX_FRAGMENT_DATA_BYTES, FragmentDataLen),
DTIMAP(Table, TablespaceId, TablespaceId),
DTIMAP(Table, TablespaceVersion, TablespaceVersion),
DTIBREAK(AttributeName) DTIBREAK(AttributeName)
}; };
...@@ -64,9 +65,11 @@ DictTabInfo::AttributeMapping[] = { ...@@ -64,9 +65,11 @@ DictTabInfo::AttributeMapping[] = {
DTIMAP(Attribute, AttributeType, AttributeType), DTIMAP(Attribute, AttributeType, AttributeType),
DTIMAP2(Attribute, AttributeSize, AttributeSize, 3, 7), DTIMAP2(Attribute, AttributeSize, AttributeSize, 3, 7),
DTIMAP2(Attribute, AttributeArraySize, AttributeArraySize, 0, 65535), DTIMAP2(Attribute, AttributeArraySize, AttributeArraySize, 0, 65535),
DTIMAP2(Attribute, AttributeArrayType, AttributeArrayType, 0, 3),
DTIMAP2(Attribute, AttributeKeyFlag, AttributeKeyFlag, 0, 1), DTIMAP2(Attribute, AttributeKeyFlag, AttributeKeyFlag, 0, 1),
DTIMAP2(Attribute, AttributeNullableFlag, AttributeNullableFlag, 0, 1), DTIMAP2(Attribute, AttributeNullableFlag, AttributeNullableFlag, 0, 1),
DTIMAP2(Attribute, AttributeDKey, AttributeDKey, 0, 1), DTIMAP2(Attribute, AttributeDKey, AttributeDKey, 0, 1),
DTIMAP2(Attribute, AttributeStorageType, AttributeStorageType, 0, 1),
DTIMAP(Attribute, AttributeExtType, AttributeExtType), DTIMAP(Attribute, AttributeExtType, AttributeExtType),
DTIMAP(Attribute, AttributeExtPrecision, AttributeExtPrecision), DTIMAP(Attribute, AttributeExtPrecision, AttributeExtPrecision),
DTIMAP(Attribute, AttributeExtScale, AttributeExtScale), DTIMAP(Attribute, AttributeExtScale, AttributeExtScale),
...@@ -111,7 +114,6 @@ DictTabInfo::Table::init(){ ...@@ -111,7 +114,6 @@ DictTabInfo::Table::init(){
MaxLoadFactor = 80; MaxLoadFactor = 80;
KeyLength = 0; KeyLength = 0;
FragmentType = DictTabInfo::AllNodesSmallTable; FragmentType = DictTabInfo::AllNodesSmallTable;
TableStorage = 0;
TableType = DictTabInfo::UndefTableType; TableType = DictTabInfo::UndefTableType;
TableVersion = 0; TableVersion = 0;
IndexState = ~0; IndexState = ~0;
...@@ -124,15 +126,18 @@ DictTabInfo::Table::init(){ ...@@ -124,15 +126,18 @@ DictTabInfo::Table::init(){
FragmentCount = 0; FragmentCount = 0;
FragmentDataLen = 0; FragmentDataLen = 0;
memset(FragmentData, 0, sizeof(FragmentData)); memset(FragmentData, 0, sizeof(FragmentData));
TablespaceId = RNIL;
TablespaceVersion = ~0;
} }
void void
DictTabInfo::Attribute::init(){ DictTabInfo::Attribute::init(){
memset(AttributeName, 0, sizeof(AttributeName));//AttributeName[0] = 0; memset(AttributeName, 0, sizeof(AttributeName));//AttributeName[0] = 0;
AttributeId = 0; AttributeId = 0xFFFF; // ZNIL
AttributeType = ~0, // deprecated AttributeType = ~0, // deprecated
AttributeSize = DictTabInfo::a32Bit; AttributeSize = DictTabInfo::a32Bit;
AttributeArraySize = 1; AttributeArraySize = 1;
AttributeArrayType = NDB_ARRAYTYPE_FIXED;
AttributeKeyFlag = 0; AttributeKeyFlag = 0;
AttributeNullableFlag = 0; AttributeNullableFlag = 0;
AttributeDKey = 0; AttributeDKey = 0;
...@@ -141,5 +146,89 @@ DictTabInfo::Attribute::init(){ ...@@ -141,5 +146,89 @@ DictTabInfo::Attribute::init(){
AttributeExtScale = 0, AttributeExtScale = 0,
AttributeExtLength = 0, AttributeExtLength = 0,
AttributeAutoIncrement = false; AttributeAutoIncrement = false;
AttributeStorageType = 0;
memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0; memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0;
} }
//static
const
SimpleProperties::SP2StructMapping
DictFilegroupInfo::Mapping[] = {
DFGIMAPS(Filegroup, FilegroupName, FilegroupName, 0, MAX_TAB_NAME_SIZE),
DFGIMAP2(Filegroup, FilegroupType, FilegroupType, 0, 1),
DFGIMAP(Filegroup, FilegroupId, FilegroupId),
DFGIMAP(Filegroup, FilegroupVersion, FilegroupVersion),
DFGIMAP(Filegroup, TS_ExtentSize, TS_ExtentSize),
DFGIMAP(Filegroup, TS_LogfileGroupId, TS_LogfileGroupId),
DFGIMAP(Filegroup, TS_LogfileGroupVersion, TS_LogfileGroupVersion),
DFGIMAP(Filegroup, TS_GrowLimit, TS_DataGrow.GrowLimit),
DFGIMAP(Filegroup, TS_GrowSizeHi, TS_DataGrow.GrowSizeHi),
DFGIMAP(Filegroup, TS_GrowSizeLo, TS_DataGrow.GrowSizeLo),
DFGIMAPS(Filegroup, TS_GrowPattern, TS_DataGrow.GrowPattern, 0, PATH_MAX),
DFGIMAP(Filegroup, TS_GrowMaxSize, TS_DataGrow.GrowMaxSize),
DFGIMAP(Filegroup, LF_UndoBufferSize, LF_UndoBufferSize),
DFGIMAP(Filegroup, LF_UndoGrowLimit, LF_UndoGrow.GrowLimit),
DFGIMAP(Filegroup, LF_UndoGrowSizeHi, LF_UndoGrow.GrowSizeHi),
DFGIMAP(Filegroup, LF_UndoGrowSizeLo, LF_UndoGrow.GrowSizeLo),
DFGIMAPS(Filegroup, LF_UndoGrowPattern, LF_UndoGrow.GrowPattern, 0,PATH_MAX),
DFGIMAP(Filegroup, LF_UndoGrowMaxSize, LF_UndoGrow.GrowMaxSize),
DFGIBREAK(FileName)
};
//static
const Uint32 DictFilegroupInfo::MappingSize =
sizeof(DictFilegroupInfo::Mapping) / sizeof(SimpleProperties::SP2StructMapping);
//static
const
SimpleProperties::SP2StructMapping
DictFilegroupInfo::FileMapping[] = {
DFGIMAPS(File, FileName, FileName, 0, PATH_MAX),
DFGIMAP2(File, FileType, FileType, 0, 1),
DFGIMAP(File, FileNo, FileNo),
DFGIMAP(File, FileId, FileId),
DFGIMAP(File, FileFGroupId, FilegroupId),
DFGIMAP(File, FileFGroupVersion, FilegroupVersion),
DFGIMAP(File, FileSizeHi, FileSizeHi),
DFGIMAP(File, FileSizeLo, FileSizeLo),
DFGIMAP(File, FileFreeExtents, FileFreeExtents),
DFGIBREAK(FileEnd)
};
//static
const Uint32 DictFilegroupInfo::FileMappingSize =
sizeof(DictFilegroupInfo::FileMapping) /
sizeof(SimpleProperties::SP2StructMapping);
void
DictFilegroupInfo::Filegroup::init(){
memset(FilegroupName, sizeof(FilegroupName), 0);
FilegroupType = ~0;
FilegroupId = ~0;
FilegroupVersion = ~0;
TS_ExtentSize = 0;
TS_LogfileGroupId = ~0;
TS_LogfileGroupVersion = ~0;
TS_DataGrow.GrowLimit = 0;
TS_DataGrow.GrowSizeHi = 0;
TS_DataGrow.GrowSizeLo = 0;
memset(TS_DataGrow.GrowPattern, sizeof(TS_DataGrow.GrowPattern), 0);
TS_DataGrow.GrowMaxSize = 0;
}
void
DictFilegroupInfo::File::init(){
memset(FileName, sizeof(FileName), 0);
FileType = ~0;
FileNo = ~0;
FileId = ~0;
FilegroupId = ~0;
FilegroupVersion = ~0;
FileSizeHi = 0;
FileSizeLo = 0;
FileFreeExtents = 0;
}
...@@ -47,6 +47,9 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, ...@@ -47,6 +47,9 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
case FsReadWriteReq::fsFormatListOfMemPages: case FsReadWriteReq::fsFormatListOfMemPages:
fprintf(output, "List of mem pages)\n"); fprintf(output, "List of mem pages)\n");
break; break;
case FsReadWriteReq::fsFormatGlobalPage:
fprintf(output, "List of global pages)\n");
break;
default: default:
fprintf(output, "fsFormatMax not handled\n"); fprintf(output, "fsFormatMax not handled\n");
ret = false; ret = false;
...@@ -76,6 +79,11 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, ...@@ -76,6 +79,11 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
fprintf(output, " H\'%.8x, ", sig->data.pageData[i]); fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
} }
break; break;
case FsReadWriteReq::fsFormatGlobalPage:
for (i= 0; i < sig->numberOfPages; i++){
fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
}
break;
default: default:
fprintf(output, "Impossible event\n"); fprintf(output, "Impossible event\n");
} }
......
...@@ -49,6 +49,8 @@ printLQHKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receive ...@@ -49,6 +49,8 @@ printLQHKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receive
fprintf(output, "ScanTakeOver "); fprintf(output, "ScanTakeOver ");
if(LqhKeyReq::getMarkerFlag(reqInfo)) if(LqhKeyReq::getMarkerFlag(reqInfo))
fprintf(output, "CommitAckMarker "); fprintf(output, "CommitAckMarker ");
if(LqhKeyReq::getNoDiskFlag(reqInfo))
fprintf(output, "NoDisk ");
fprintf(output, "ScanInfo/noFiredTriggers: H\'%x\n", sig->scanInfo); fprintf(output, "ScanInfo/noFiredTriggers: H\'%x\n", sig->scanInfo);
......
...@@ -30,7 +30,7 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv ...@@ -30,7 +30,7 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv
fprintf(output, " apiConnectPtr: H\'%.8x", fprintf(output, " apiConnectPtr: H\'%.8x",
sig->apiConnectPtr); sig->apiConnectPtr);
fprintf(output, " requestInfo: H\'%.8x:\n", requestInfo); fprintf(output, " requestInfo: H\'%.8x:\n", requestInfo);
fprintf(output, " Parallellism: %u Batch: %u LockMode: %u Keyinfo: %u Holdlock: %u RangeScan: %u Descending: %u TupScan: %u\n ReadCommitted: %u DistributionKeyFlag: %u", fprintf(output, " Parallellism: %u Batch: %u LockMode: %u Keyinfo: %u Holdlock: %u RangeScan: %u Descending: %u TupScan: %u\n ReadCommitted: %u DistributionKeyFlag: %u NoDisk: %u",
sig->getParallelism(requestInfo), sig->getParallelism(requestInfo),
sig->getScanBatch(requestInfo), sig->getScanBatch(requestInfo),
sig->getLockMode(requestInfo), sig->getLockMode(requestInfo),
...@@ -40,7 +40,8 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv ...@@ -40,7 +40,8 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv
sig->getDescendingFlag(requestInfo), sig->getDescendingFlag(requestInfo),
sig->getTupScanFlag(requestInfo), sig->getTupScanFlag(requestInfo),
sig->getReadCommittedFlag(requestInfo), sig->getReadCommittedFlag(requestInfo),
sig->getDistributionKeyFlag(requestInfo)); sig->getDistributionKeyFlag(requestInfo),
sig->getNoDiskFlag(requestInfo));
if(sig->getDistributionKeyFlag(requestInfo)) if(sig->getDistributionKeyFlag(requestInfo))
fprintf(output, " DKey: %x", sig->distributionKey); fprintf(output, " DKey: %x", sig->distributionKey);
......
...@@ -145,6 +145,7 @@ SignalDataPrintFunctions[] = { ...@@ -145,6 +145,7 @@ SignalDataPrintFunctions[] = {
{ GSN_SYSTEM_ERROR, printSYSTEM_ERROR }, { GSN_SYSTEM_ERROR, printSYSTEM_ERROR },
{ GSN_START_RECREQ, printSTART_REC_REQ }, { GSN_START_RECREQ, printSTART_REC_REQ },
{ GSN_START_RECCONF, printSTART_REC_CONF }, { GSN_START_RECCONF, printSTART_REC_CONF },
{ GSN_START_FRAGREQ, printSTART_FRAG_REQ },
{ GSN_NF_COMPLETEREP, printNF_COMPLETE_REP }, { GSN_NF_COMPLETEREP, printNF_COMPLETE_REP },
{ GSN_SIGNAL_DROPPED_REP, printSIGNAL_DROPPED_REP }, { GSN_SIGNAL_DROPPED_REP, printSIGNAL_DROPPED_REP },
{ GSN_FAIL_REP, printFAIL_REP }, { GSN_FAIL_REP, printFAIL_REP },
......
...@@ -63,22 +63,12 @@ const GsnName SignalNames [] = { ...@@ -63,22 +63,12 @@ const GsnName SignalNames [] = {
,{ GSN_ACC_CHECK_SCAN, "ACC_CHECK_SCAN" } ,{ GSN_ACC_CHECK_SCAN, "ACC_CHECK_SCAN" }
,{ GSN_ACC_COMMITCONF, "ACC_COMMITCONF" } ,{ GSN_ACC_COMMITCONF, "ACC_COMMITCONF" }
,{ GSN_ACC_COMMITREQ, "ACC_COMMITREQ" } ,{ GSN_ACC_COMMITREQ, "ACC_COMMITREQ" }
,{ GSN_ACC_CONTOPCONF, "ACC_CONTOPCONF" }
,{ GSN_ACC_CONTOPREQ, "ACC_CONTOPREQ" }
,{ GSN_ACC_LCPCONF, "ACC_LCPCONF" }
,{ GSN_ACC_LCPREF, "ACC_LCPREF" }
,{ GSN_ACC_LCPREQ, "ACC_LCPREQ" }
,{ GSN_ACC_LCPSTARTED, "ACC_LCPSTARTED" }
,{ GSN_ACC_OVER_REC, "ACC_OVER_REC" } ,{ GSN_ACC_OVER_REC, "ACC_OVER_REC" }
,{ GSN_ACC_SAVE_PAGES, "ACC_SAVE_PAGES" }
,{ GSN_ACC_SCAN_INFO, "ACC_SCAN_INFO" } ,{ GSN_ACC_SCAN_INFO, "ACC_SCAN_INFO" }
,{ GSN_ACC_SCAN_INFO24, "ACC_SCAN_INFO24" } ,{ GSN_ACC_SCAN_INFO24, "ACC_SCAN_INFO24" }
,{ GSN_ACC_SCANCONF, "ACC_SCANCONF" } ,{ GSN_ACC_SCANCONF, "ACC_SCANCONF" }
,{ GSN_ACC_SCANREF, "ACC_SCANREF" } ,{ GSN_ACC_SCANREF, "ACC_SCANREF" }
,{ GSN_ACC_SCANREQ, "ACC_SCANREQ" } ,{ GSN_ACC_SCANREQ, "ACC_SCANREQ" }
,{ GSN_ACC_SRCONF, "ACC_SRCONF" }
,{ GSN_ACC_SRREF, "ACC_SRREF" }
,{ GSN_ACC_SRREQ, "ACC_SRREQ" }
,{ GSN_ACC_TO_CONF, "ACC_TO_CONF" } ,{ GSN_ACC_TO_CONF, "ACC_TO_CONF" }
,{ GSN_ACC_TO_REF, "ACC_TO_REF" } ,{ GSN_ACC_TO_REF, "ACC_TO_REF" }
,{ GSN_ACC_TO_REQ, "ACC_TO_REQ" } ,{ GSN_ACC_TO_REQ, "ACC_TO_REQ" }
...@@ -238,13 +228,6 @@ const GsnName SignalNames [] = { ...@@ -238,13 +228,6 @@ const GsnName SignalNames [] = {
,{ GSN_INCL_NODECONF, "INCL_NODECONF" } ,{ GSN_INCL_NODECONF, "INCL_NODECONF" }
,{ GSN_INCL_NODEREF, "INCL_NODEREF" } ,{ GSN_INCL_NODEREF, "INCL_NODEREF" }
,{ GSN_INCL_NODEREQ, "INCL_NODEREQ" } ,{ GSN_INCL_NODEREQ, "INCL_NODEREQ" }
,{ GSN_LCP_FRAGIDCONF, "LCP_FRAGIDCONF" }
,{ GSN_LCP_FRAGIDREF, "LCP_FRAGIDREF" }
,{ GSN_LCP_FRAGIDREQ, "LCP_FRAGIDREQ" }
,{ GSN_LCP_HOLDOPCONF, "LCP_HOLDOPCONF" }
,{ GSN_LCP_HOLDOPREF, "LCP_HOLDOPREF" }
,{ GSN_LCP_HOLDOPREQ, "LCP_HOLDOPREQ" }
,{ GSN_LQH_RESTART_OP, "LQH_RESTART_OP" }
,{ GSN_LQH_TRANSCONF, "LQH_TRANSCONF" } ,{ GSN_LQH_TRANSCONF, "LQH_TRANSCONF" }
,{ GSN_LQH_TRANSREQ, "LQH_TRANSREQ" } ,{ GSN_LQH_TRANSREQ, "LQH_TRANSREQ" }
,{ GSN_LQHADDATTCONF, "LQHADDATTCONF" } ,{ GSN_LQHADDATTCONF, "LQHADDATTCONF" }
...@@ -299,9 +282,6 @@ const GsnName SignalNames [] = { ...@@ -299,9 +282,6 @@ const GsnName SignalNames [] = {
,{ GSN_SHRINKCHECK2, "SHRINKCHECK2" } ,{ GSN_SHRINKCHECK2, "SHRINKCHECK2" }
,{ GSN_READ_CONFIG_REQ, "READ_CONFIG_REQ" } ,{ GSN_READ_CONFIG_REQ, "READ_CONFIG_REQ" }
,{ GSN_READ_CONFIG_CONF, "READ_CONFIG_CONF" } ,{ GSN_READ_CONFIG_CONF, "READ_CONFIG_CONF" }
,{ GSN_SR_FRAGIDCONF, "SR_FRAGIDCONF" }
,{ GSN_SR_FRAGIDREF, "SR_FRAGIDREF" }
,{ GSN_SR_FRAGIDREQ, "SR_FRAGIDREQ" }
,{ GSN_START_COPYCONF, "START_COPYCONF" } ,{ GSN_START_COPYCONF, "START_COPYCONF" }
,{ GSN_START_COPYREF, "START_COPYREF" } ,{ GSN_START_COPYREF, "START_COPYREF" }
,{ GSN_START_COPYREQ, "START_COPYREQ" } ,{ GSN_START_COPYREQ, "START_COPYREQ" }
...@@ -348,16 +328,6 @@ const GsnName SignalNames [] = { ...@@ -348,16 +328,6 @@ const GsnName SignalNames [] = {
,{ GSN_TUP_ADD_ATTRREQ, "TUP_ADD_ATTRREQ" } ,{ GSN_TUP_ADD_ATTRREQ, "TUP_ADD_ATTRREQ" }
,{ GSN_TUP_ATTRINFO, "TUP_ATTRINFO" } ,{ GSN_TUP_ATTRINFO, "TUP_ATTRINFO" }
,{ GSN_TUP_COMMITREQ, "TUP_COMMITREQ" } ,{ GSN_TUP_COMMITREQ, "TUP_COMMITREQ" }
,{ GSN_TUP_LCPCONF, "TUP_LCPCONF" }
,{ GSN_TUP_LCPREF, "TUP_LCPREF" }
,{ GSN_TUP_LCPREQ, "TUP_LCPREQ" }
,{ GSN_TUP_LCPSTARTED, "TUP_LCPSTARTED" }
,{ GSN_TUP_PREPLCPCONF, "TUP_PREPLCPCONF" }
,{ GSN_TUP_PREPLCPREF, "TUP_PREPLCPREF" }
,{ GSN_TUP_PREPLCPREQ, "TUP_PREPLCPREQ" }
,{ GSN_TUP_SRCONF, "TUP_SRCONF" }
,{ GSN_TUP_SRREF, "TUP_SRREF" }
,{ GSN_TUP_SRREQ, "TUP_SRREQ" }
,{ GSN_TUPFRAGCONF, "TUPFRAGCONF" } ,{ GSN_TUPFRAGCONF, "TUPFRAGCONF" }
,{ GSN_TUPFRAGREF, "TUPFRAGREF" } ,{ GSN_TUPFRAGREF, "TUPFRAGREF" }
,{ GSN_TUPFRAGREQ, "TUPFRAGREQ" } ,{ GSN_TUPFRAGREQ, "TUPFRAGREQ" }
...@@ -632,5 +602,32 @@ const GsnName SignalNames [] = { ...@@ -632,5 +602,32 @@ const GsnName SignalNames [] = {
,{ GSN_TUX_BOUND_INFO, "TUX_BOUND_INFO" } ,{ GSN_TUX_BOUND_INFO, "TUX_BOUND_INFO" }
,{ GSN_ACC_LOCKREQ, "ACC_LOCKREQ" } ,{ GSN_ACC_LOCKREQ, "ACC_LOCKREQ" }
,{ GSN_CREATE_FILEGROUP_REQ, "CREATE_FILEGROUP_REQ" }
,{ GSN_CREATE_FILEGROUP_REF, "CREATE_FILEGROUP_REF" }
,{ GSN_CREATE_FILEGROUP_CONF, "CREATE_FILEGROUP_CONF" }
,{ GSN_CREATE_FILE_REQ, "CREATE_FILE_REQ" }
,{ GSN_CREATE_FILE_REF, "CREATE_FILE_REF" }
,{ GSN_CREATE_FILE_CONF, "CREATE_FILE_CONF" }
,{ GSN_DROP_FILEGROUP_REQ, "DROP_FILEGROUP_REQ" }
,{ GSN_DROP_FILEGROUP_REF, "DROP_FILEGROUP_REF" }
,{ GSN_DROP_FILEGROUP_CONF, "DROP_FILEGROUP_CONF" }
,{ GSN_DROP_FILE_REQ, "DROP_FILE_REQ" }
,{ GSN_DROP_FILE_REF, "DROP_FILE_REF" }
,{ GSN_DROP_FILE_CONF, "DROP_FILE_CONF" }
,{ GSN_CREATE_OBJ_REQ, "CREATE_OBJ_REQ" }
,{ GSN_CREATE_OBJ_REF, "CREATE_OBJ_REF" }
,{ GSN_CREATE_OBJ_CONF, "CREATE_OBJ_CONF" }
,{ GSN_DROP_OBJ_REQ, "DROP_OBJ_REQ" }
,{ GSN_DROP_OBJ_REF, "DROP_OBJ_REF" }
,{ GSN_DROP_OBJ_CONF, "DROP_OBJ_CONF" }
,{ GSN_LCP_PREPARE_REQ, "LCP_PREPARE_REQ" }
,{ GSN_LCP_PREPARE_REF, "LCP_PREPARE_REF" }
,{ GSN_LCP_PREPARE_CONF, "LCP_PREPARE_CONF" }
}; };
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName); const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
...@@ -52,6 +52,10 @@ printTCKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiver ...@@ -52,6 +52,10 @@ printTCKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiver
fprintf(output, "Trigger "); fprintf(output, "Trigger ");
} }
if (sig->getNoDiskFlag(requestInfo)) {
fprintf(output, "NoDisk ");
}
UintR TcommitType = sig->getAbortOption(requestInfo); UintR TcommitType = sig->getAbortOption(requestInfo);
if (TcommitType == TcKeyReq::AbortOnError) { if (TcommitType == TcKeyReq::AbortOnError) {
fprintf(output, "AbortOnError "); fprintf(output, "AbortOnError ");
......
...@@ -27,7 +27,7 @@ printTUX_MAINT_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn) ...@@ -27,7 +27,7 @@ printTUX_MAINT_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
fprintf(output, " table: id=%u", sig->tableId); fprintf(output, " table: id=%u", sig->tableId);
fprintf(output, " index: id=%u", sig->indexId); fprintf(output, " index: id=%u", sig->indexId);
fprintf(output, " fragment: id=%u\n", sig->fragId); fprintf(output, " fragment: id=%u\n", sig->fragId);
fprintf(output, " tuple: loc=%u.%u version=%u\n", sig->pageId, sig->pageOffset, sig->tupVersion); fprintf(output, " tuple: loc=%u.%u version=%u\n", sig->pageId, sig->pageIndex, sig->tupVersion);
const Uint32 opCode = sig->opInfo & 0xFF; const Uint32 opCode = sig->opInfo & 0xFF;
const Uint32 opFlag = sig->opInfo >> 8; const Uint32 opFlag = sig->opInfo >> 8;
switch (opCode ) { switch (opCode ) {
......
SUBDIRS = error blocks vm SUBDIRS = vm error blocks
include $(top_srcdir)/storage/ndb/config/common.mk.am include $(top_srcdir)/storage/ndb/config/common.mk.am
...@@ -23,7 +23,8 @@ INCLUDES += \ ...@@ -23,7 +23,8 @@ INCLUDES += \
-Iblocks/backup \ -Iblocks/backup \
-Iblocks/dbutil \ -Iblocks/dbutil \
-Iblocks/suma \ -Iblocks/suma \
-Iblocks/dbtux -Iblocks/dbtux \
-Iblocks
LDADD += \ LDADD += \
blocks/cmvmi/libcmvmi.a \ blocks/cmvmi/libcmvmi.a \
...@@ -41,6 +42,7 @@ LDADD += \ ...@@ -41,6 +42,7 @@ LDADD += \
blocks/dbutil/libdbutil.a \ blocks/dbutil/libdbutil.a \
blocks/suma/libsuma.a \ blocks/suma/libsuma.a \
blocks/dbtux/libdbtux.a \ blocks/dbtux/libdbtux.a \
blocks/libblocks.a \
vm/libkernel.a \ vm/libkernel.a \
error/liberror.a \ error/liberror.a \
$(top_builddir)/storage/ndb/src/common/transporter/libtransporter.la \ $(top_builddir)/storage/ndb/src/common/transporter/libtransporter.la \
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#include <DbUtil.hpp> #include <DbUtil.hpp>
#include <Suma.hpp> #include <Suma.hpp>
#include <Dbtux.hpp> #include <Dbtux.hpp>
#include <tsman.hpp>
#include <lgman.hpp>
#include <pgman.hpp>
#include <restore.hpp>
#include <NdbEnv.h> #include <NdbEnv.h>
#ifndef VM_TRACE #ifndef VM_TRACE
...@@ -66,10 +70,13 @@ void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){ ...@@ -66,10 +70,13 @@ void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){
void void
SimBlockList::load(const Configuration & conf){ SimBlockList::load(const Configuration & conf){
noOfBlocks = 15; noOfBlocks = NO_OF_BLOCKS;
theList = new SimulatedBlock * [noOfBlocks]; theList = new SimulatedBlock * [noOfBlocks];
Dbdict* dbdict = 0; Dbdict* dbdict = 0;
Dbdih* dbdih = 0; Dbdih* dbdih = 0;
Pgman* pg = 0;
Lgman* lg = 0;
Tsman* ts = 0;
SimulatedBlock * fs = 0; SimulatedBlock * fs = 0;
{ {
...@@ -82,27 +89,26 @@ SimBlockList::load(const Configuration & conf){ ...@@ -82,27 +89,26 @@ SimBlockList::load(const Configuration & conf){
} }
} }
theList[0] = NEW_BLOCK(Dbacc)(conf); theList[0] = pg = NEW_BLOCK(Pgman)(conf);
theList[1] = NEW_BLOCK(Cmvmi)(conf); theList[1] = lg = NEW_BLOCK(Lgman)(conf);
theList[2] = fs; theList[2] = ts = NEW_BLOCK(Tsman)(conf, pg, lg);
theList[3] = dbdict = NEW_BLOCK(Dbdict)(conf); theList[3] = NEW_BLOCK(Dbacc)(conf);
theList[4] = dbdih = NEW_BLOCK(Dbdih)(conf); theList[4] = NEW_BLOCK(Cmvmi)(conf);
theList[5] = NEW_BLOCK(Dblqh)(conf); theList[5] = fs;
theList[6] = NEW_BLOCK(Dbtc)(conf); theList[6] = dbdict = NEW_BLOCK(Dbdict)(conf);
theList[7] = NEW_BLOCK(Dbtup)(conf); theList[7] = dbdih = NEW_BLOCK(Dbdih)(conf);
theList[8] = NEW_BLOCK(Ndbcntr)(conf); theList[8] = NEW_BLOCK(Dblqh)(conf);
theList[9] = NEW_BLOCK(Qmgr)(conf); theList[9] = NEW_BLOCK(Dbtc)(conf);
theList[10] = NEW_BLOCK(Trix)(conf); theList[10] = NEW_BLOCK(Dbtup)(conf, pg);
theList[11] = NEW_BLOCK(Backup)(conf); theList[11] = NEW_BLOCK(Ndbcntr)(conf);
theList[12] = NEW_BLOCK(DbUtil)(conf); theList[12] = NEW_BLOCK(Qmgr)(conf);
theList[13] = NEW_BLOCK(Suma)(conf); theList[13] = NEW_BLOCK(Trix)(conf);
theList[14] = NEW_BLOCK(Dbtux)(conf); theList[14] = NEW_BLOCK(Backup)(conf);
theList[15] = NEW_BLOCK(DbUtil)(conf);
// Metadata common part shared by block instances theList[16] = NEW_BLOCK(Suma)(conf);
ptrMetaDataCommon = new MetaData::Common(*dbdict, *dbdih); theList[17] = NEW_BLOCK(Dbtux)(conf);
for (int i = 0; i < noOfBlocks; i++) theList[18] = NEW_BLOCK(Restore)(conf);
if(theList[i]) assert(NO_OF_BLOCKS == 19);
theList[i]->setMetaDataCommon(ptrMetaDataCommon);
} }
void void
...@@ -116,9 +122,7 @@ SimBlockList::unload(){ ...@@ -116,9 +122,7 @@ SimBlockList::unload(){
} }
} }
delete [] theList; delete [] theList;
delete ptrMetaDataCommon;
theList = 0; theList = 0;
noOfBlocks = 0; noOfBlocks = 0;
ptrMetaDataCommon = 0;
} }
} }
...@@ -15,4 +15,23 @@ SUBDIRS = \ ...@@ -15,4 +15,23 @@ SUBDIRS = \
suma \ suma \
dbtux dbtux
noinst_LIBRARIES = libblocks.a
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/kernel/blocks/dblqh
libblocks_a_SOURCES = tsman.cpp lgman.cpp pgman.cpp diskpage.cpp restore.cpp
ndbtools_PROGRAMS = ndb_print_file
ndb_print_file_SOURCES = print_file.cpp diskpage.cpp dbtup/tuppage.cpp
ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/storage/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: windoze-dsp:
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <SLList.hpp> #include <SLList.hpp>
#include <ArrayList.hpp> #include <ArrayList.hpp>
#include <DLFifoList.hpp>
#include <SignalCounter.hpp> #include <SignalCounter.hpp>
#include <blocks/mutexes.hpp> #include <blocks/mutexes.hpp>
...@@ -147,7 +148,9 @@ protected: ...@@ -147,7 +148,9 @@ protected:
void execWAIT_GCP_REF(Signal* signal); void execWAIT_GCP_REF(Signal* signal);
void execWAIT_GCP_CONF(Signal* signal); void execWAIT_GCP_CONF(Signal* signal);
void execLCP_PREPARE_REQ(Signal* signal);
void execLCP_FRAGMENT_REQ(Signal*);
void execEND_LCPREQ(Signal* signal);
private: private:
void defineBackupMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal); void defineBackupMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal);
void dictCommitTableMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal); void dictCommitTableMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal);
...@@ -169,24 +172,33 @@ public: ...@@ -169,24 +172,33 @@ public:
typedef Ptr<Page32> Page32Ptr; typedef Ptr<Page32> Page32Ptr;
struct Attribute { struct Attribute {
enum Flags {
COL_NULLABLE = 0x1,
COL_FIXED = 0x2,
COL_DISK = 0x4
};
struct Data { struct Data {
Uint8 nullable; Uint16 m_flags;
Uint8 fixed; Uint16 attrId;
Uint8 unused;
Uint8 unused2;
Uint32 sz32; // No of 32 bit words Uint32 sz32; // No of 32 bit words
Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys
Uint32 offsetNull; // In NullBitmask Uint32 offsetNull; // In NullBitmask
} data; } data;
union {
Uint32 nextPool; Uint32 nextPool;
Uint32 nextList;
};
Uint32 prevList;
}; };
typedef Ptr<Attribute> AttributePtr; typedef Ptr<Attribute> AttributePtr;
struct Fragment { struct Fragment {
Uint32 tableId; Uint32 tableId;
Uint32 node; Uint16 node;
Uint16 scanned; // 0 = not scanned x = scanned by node x Uint16 fragmentId;
Uint16 scanning; // 0 = not scanning x = scanning on node x Uint8 scanned; // 0 = not scanned x = scanned by node x
Uint8 scanning; // 0 = not scanning x = scanning on node x
Uint8 lcp_no;
Uint32 nextPool; Uint32 nextPool;
}; };
typedef Ptr<Fragment> FragmentPtr; typedef Ptr<Fragment> FragmentPtr;
...@@ -204,7 +216,7 @@ public: ...@@ -204,7 +216,7 @@ public:
Uint32 triggerIds[3]; Uint32 triggerIds[3];
bool triggerAllocated[3]; bool triggerAllocated[3];
Array<Attribute> attributes; DLFifoList<Attribute> attributes;
Array<Fragment> fragments; Array<Fragment> fragments;
Uint32 nextList; Uint32 nextList;
...@@ -243,6 +255,7 @@ public: ...@@ -243,6 +255,7 @@ public:
/** /**
* Per attribute * Per attribute
*/ */
void nullVariable();
void nullAttribute(Uint32 nullOffset); void nullAttribute(Uint32 nullOffset);
Uint32 * newNullable(Uint32 attrId, Uint32 sz); Uint32 * newNullable(Uint32 attrId, Uint32 sz);
Uint32 * newAttrib(Uint32 offset, Uint32 sz); Uint32 * newAttrib(Uint32 offset, Uint32 sz);
...@@ -264,7 +277,6 @@ public: ...@@ -264,7 +277,6 @@ public:
public: public:
Uint32* dst; Uint32* dst;
Uint32 attrSzLeft; // No of words missing for current attribute
Uint32 attrSzTotal; // No of AI words received Uint32 attrSzTotal; // No of AI words received
Uint32 tablePtr; // Ptr.i to current table Uint32 tablePtr; // Ptr.i to current table
...@@ -486,6 +498,10 @@ public: ...@@ -486,6 +498,10 @@ public:
return errorCode != 0; return errorCode != 0;
} }
bool is_lcp() const {
return backupDataLen == ~(Uint32)0;
}
Backup & backup; Backup & backup;
BlockNumber number() const { return backup.number(); } BlockNumber number() const { return backup.number(); }
void progError(int line, int cause, const char * extra) { void progError(int line, int cause, const char * extra) {
...@@ -500,6 +516,7 @@ public: ...@@ -500,6 +516,7 @@ public:
Uint32 m_logBufferSize; Uint32 m_logBufferSize;
Uint32 m_minWriteSize; Uint32 m_minWriteSize;
Uint32 m_maxWriteSize; Uint32 m_maxWriteSize;
Uint32 m_lcp_buffer_size;
}; };
/** /**
...@@ -604,6 +621,11 @@ public: ...@@ -604,6 +621,11 @@ public:
void sendSTTORRY(Signal*); void sendSTTORRY(Signal*);
void createSequence(Signal* signal); void createSequence(Signal* signal);
void createSequenceReply(Signal*, class UtilSequenceConf *); void createSequenceReply(Signal*, class UtilSequenceConf *);
void lcp_open_file(Signal* signal, BackupRecordPtr ptr);
void lcp_open_file_done(Signal*, BackupRecordPtr);
void lcp_close_file_conf(Signal* signal, BackupRecordPtr);
void lcp_send_end_lcp_conf(Signal* signal, BackupRecordPtr);
}; };
inline inline
...@@ -616,14 +638,13 @@ Backup::OperationRecord::newRecord(Uint32 * p){ ...@@ -616,14 +638,13 @@ Backup::OperationRecord::newRecord(Uint32 * p){
dst_VariableData = (BackupFormat::DataFile::VariableData*)p; dst_VariableData = (BackupFormat::DataFile::VariableData*)p;
BitmaskImpl::clear(sz_Bitmask, dst_Bitmask); BitmaskImpl::clear(sz_Bitmask, dst_Bitmask);
attrLeft = noOfAttributes; attrLeft = noOfAttributes;
attrSzLeft = attrSzTotal = 0; attrSzTotal = 0;
} }
inline inline
Uint32 * Uint32 *
Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){
attrLeft--; attrLeft--;
attrSzLeft = sz;
dst = dst_FixedAttribs + offset; dst = dst_FixedAttribs + offset;
return dst; return dst;
} }
...@@ -635,17 +656,25 @@ Backup::OperationRecord::nullAttribute(Uint32 offsetNull){ ...@@ -635,17 +656,25 @@ Backup::OperationRecord::nullAttribute(Uint32 offsetNull){
BitmaskImpl::set(sz_Bitmask, dst_Bitmask, offsetNull); BitmaskImpl::set(sz_Bitmask, dst_Bitmask, offsetNull);
} }
inline
void
Backup::OperationRecord::nullVariable()
{
attrLeft --;
}
inline inline
Uint32 * Uint32 *
Backup::OperationRecord::newNullable(Uint32 id, Uint32 sz){ Backup::OperationRecord::newNullable(Uint32 id, Uint32 sz){
Uint32 sz32 = (sz + 3) >> 2;
attrLeft--; attrLeft--;
attrSzLeft = sz;
dst = &dst_VariableData->Data[0]; dst = &dst_VariableData->Data[0];
dst_VariableData->Sz = htonl(sz); dst_VariableData->Sz = htonl(sz);
dst_VariableData->Id = htonl(id); dst_VariableData->Id = htonl(id);
dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz); dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz32);
// Clear all bits on newRecord -> dont need to clear this // Clear all bits on newRecord -> dont need to clear this
// BitmaskImpl::clear(sz_Bitmask, dst_Bitmask, offsetNull); // BitmaskImpl::clear(sz_Bitmask, dst_Bitmask, offsetNull);
...@@ -655,21 +684,22 @@ Backup::OperationRecord::newNullable(Uint32 id, Uint32 sz){ ...@@ -655,21 +684,22 @@ Backup::OperationRecord::newNullable(Uint32 id, Uint32 sz){
inline inline
Uint32 * Uint32 *
Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){
Uint32 sz32 = (sz + 3) >> 2;
attrLeft--; attrLeft--;
attrSzLeft = sz;
dst = &dst_VariableData->Data[0]; dst = &dst_VariableData->Data[0];
dst_VariableData->Sz = htonl(sz); dst_VariableData->Sz = htonl(sz);
dst_VariableData->Id = htonl(id); dst_VariableData->Id = htonl(id);
dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz); dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz32);
return dst; return dst;
} }
inline inline
bool bool
Backup::OperationRecord::finished(){ Backup::OperationRecord::finished(){
if(attrLeft != 0 || attrSzLeft != 0){ if(attrLeft != 0){
return false; return false;
} }
......
...@@ -366,3 +366,65 @@ NF_COMPLETE_REP ...@@ -366,3 +366,65 @@ NF_COMPLETE_REP
master dies master dies
slave elects self as master and sets only itself as participant slave elects self as master and sets only itself as participant
DATA FORMATS
------------
Note: api-restore must be able to read all old formats.
Todo: header formats
4.1.x
-----
Todo
5.0.x
-----
Producers: backup, Consumers: api-restore
In 5.0
1) attrs have fixed size
2) external attr id (column_no) is same as internal attr id (attr_id).
3) no disk attributes
Format:
Part 0: null-bit mask for all nullable rounded to word
Part 1: fixed + non-nullable in column_no order
Part 2: fixed + nullable in column_no order
Part 1:
plain value rounded to words [value]
Part 2:
not-null => clear null bit, data words [len_in_words attr_id value]
null => set only null bit in null-bit mask
Note: redundancy in null-bit mask vs 2 word header
5.1.x
-----
Producers: backup, Consumers: api-restore lcp-restore
In 5.1
1) attrs can have var size, length encoded in value
2) column_no need not equal attr_id
3) disk attributes
Null-bit mask (5.0) is dropped.
Length encoded in value is not used.
In "lcp backup" disk attributes are replaced by 64-bit DISK_REF.
Format:
Part 1: fixed + non-nullable in column_no order
Part 2: other attributes
Part 1:
plain value rounded to words [value]
Part 2:
not-null => data words [len_in_bytes attr_id value]
null => not present
...@@ -54,7 +54,8 @@ struct BackupFormat { ...@@ -54,7 +54,8 @@ struct BackupFormat {
enum FileType { enum FileType {
CTL_FILE = 1, CTL_FILE = 1,
LOG_FILE = 2, LOG_FILE = 2,
DATA_FILE = 3 DATA_FILE = 3,
LCP_FILE = 4
}; };
/** /**
...@@ -144,6 +145,17 @@ struct BackupFormat { ...@@ -144,6 +145,17 @@ struct BackupFormat {
Uint32 Data[1]; // Len = Length - 2 Uint32 Data[1]; // Len = Length - 2
}; };
}; };
/**
* LCP file format
*/
struct LcpFile {
CtlFile::TableList TableList;
CtlFile::TableDescription TableDescription;
DataFile::FragmentHeader FragmentHeader;
DataFile::Record Record;
DataFile::FragmentFooter FragmentFooter;
};
}; };
#endif #endif
...@@ -109,6 +109,10 @@ public: ...@@ -109,6 +109,10 @@ public:
Uint32 getFreeSize() const { return m_free; } Uint32 getFreeSize() const { return m_free; }
/**
* reset
*/
void reset();
private: private:
...@@ -204,6 +208,17 @@ FsBuffer::setup(Uint32 * Buffer, ...@@ -204,6 +208,17 @@ FsBuffer::setup(Uint32 * Buffer,
return valid(); return valid();
} }
inline
void
FsBuffer::reset()
{
assert(m_free = m_size);
assert(m_readIndex == m_writeIndex);
m_readIndex = m_writeIndex = 0;
m_free = m_size;
m_eof = 0;
}
inline inline
const char * const char *
FsBuffer::valid() const { FsBuffer::valid() const {
......
...@@ -3,6 +3,14 @@ noinst_LIBRARIES = libbackup.a ...@@ -3,6 +3,14 @@ noinst_LIBRARIES = libbackup.a
libbackup_a_SOURCES = Backup.cpp BackupInit.cpp libbackup_a_SOURCES = Backup.cpp BackupInit.cpp
ndbtools_PROGRAMS = ndb_print_backup_file
ndb_print_backup_file_SOURCES = read.cpp
ndb_print_backup_file_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/storage/ndb/src/libndbclient.la \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
include $(top_srcdir)/storage/ndb/config/common.mk.am include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment