18 #include "consumer.hpp"
22 BackupConsumer::create_table_string(
const TableS &
table,
29 pos += sprintf(buf+pos,
"%s%s",
"CREATE TABLE ", tableName);
30 pos += sprintf(buf+pos,
"%s",
"(");
31 pos2 += sprintf(buf2+pos2,
"%s",
" primary key(");
33 for (
int j = 0; j < table.getNoOfAttributes(); j++)
37 pos += sprintf(buf+pos,
"%s%s", desc->m_column->
getName(),
" ");
38 switch(desc->m_column->
getType()){
40 pos += sprintf(buf+pos,
"%s",
"int");
43 pos += sprintf(buf+pos,
"%s",
"int unsigned");
46 pos += sprintf(buf+pos,
"%s",
"float");
50 pos += sprintf(buf+pos,
"%s",
"decimal");
52 case NdbDictionary::Column::Olddecimalunsigned:
53 case NdbDictionary::Column::Decimalunsigned:
54 pos += sprintf(buf+pos,
"%s",
"decimal unsigned");
57 pos += sprintf(buf+pos,
"%s",
"char");
60 pos += sprintf(buf+pos,
"%s",
"varchar");
63 pos += sprintf(buf+pos,
"%s",
"binary");
66 pos += sprintf(buf+pos,
"%s",
"varchar binary");
69 pos += sprintf(buf+pos,
"%s",
"bigint");
72 pos += sprintf(buf+pos,
"%s",
"bigint unsigned");
75 pos += sprintf(buf+pos,
"%s",
"double");
78 pos += sprintf(buf+pos,
"%s",
"datetime");
81 pos += sprintf(buf+pos,
"%s",
"date");
84 pos += sprintf(buf+pos,
"%s",
"time");
94 if (desc->arraySize > 1) {
95 int attrSize = desc->arraySize;
96 pos += sprintf(buf+pos,
"%s%u%s",
102 pos += sprintf(buf+pos,
"%s",
" not null");
103 pos2 += sprintf(buf2+pos2,
"%s%s", desc->m_column->
getName(),
",");
105 pos += sprintf(buf+pos,
"%s",
",");
108 pos2 += sprintf(buf2+pos2,
"%s",
")");
111 pos += sprintf(buf+pos,
"%s", buf2);
112 pos += sprintf(buf+pos,
"%s",
") type=ndbcluster");