summaryrefslogtreecommitdiff
path: root/ndb/examples
diff options
context:
space:
mode:
authorunknown <pekka@mysql.com>2004-09-15 14:52:39 +0200
committerunknown <pekka@mysql.com>2004-09-15 14:52:39 +0200
commitf0f29d338396aa6687d52fdc3a88cda0774cac81 (patch)
tree3f97690b85dbc32ed13e691302d550ef707e0552 /ndb/examples
parentd3f031e97b9815e0401a23626289c4e894e7d1fd (diff)
downloadmariadb-git-f0f29d338396aa6687d52fdc3a88cda0774cac81.tar.gz
ndb: set column type sets column defaults
Diffstat (limited to 'ndb/examples')
-rw-r--r--ndb/examples/ndbapi_async_example/ndbapi_async.cpp10
-rw-r--r--ndb/examples/ndbapi_example1/ndbapi_example1.cpp4
-rw-r--r--ndb/examples/ndbapi_example4/ndbapi_example4.cpp4
-rw-r--r--ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp9
4 files changed, 12 insertions, 15 deletions
diff --git a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
index c34d8de9ec5..76ce1a8efe3 100644
--- a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
+++ b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
@@ -46,9 +46,9 @@
*
* NdbDictionary::Column
* setName()
- * setPrimaryKey()
* setType()
* setLength()
+ * setPrimaryKey()
* setNullable()
*
* NdbDictionary::Table
@@ -234,9 +234,9 @@ int create_table(Ndb * myNdb)
* Column REG_NO
*/
myColumn.setName("REG_NO");
- myColumn.setPrimaryKey(true);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(true);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
@@ -244,9 +244,9 @@ int create_table(Ndb * myNdb)
* Column BRAND
*/
myColumn.setName("BRAND");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Char);
myColumn.setLength(20);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
@@ -254,9 +254,9 @@ int create_table(Ndb * myNdb)
* Column COLOR
*/
myColumn.setName("COLOR");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Char);
myColumn.setLength(20);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
@@ -494,5 +494,3 @@ int main()
std::cout << "Number of temporary errors: " << tempErrors << std::endl;
delete myNdb;
}
-
-
diff --git a/ndb/examples/ndbapi_example1/ndbapi_example1.cpp b/ndb/examples/ndbapi_example1/ndbapi_example1.cpp
index 53d23dd7133..03a84aa249b 100644
--- a/ndb/examples/ndbapi_example1/ndbapi_example1.cpp
+++ b/ndb/examples/ndbapi_example1/ndbapi_example1.cpp
@@ -79,16 +79,16 @@ int main()
myTable.setName("MYTABLENAME");
myColumn.setName("ATTR1");
- myColumn.setPrimaryKey(true);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(true);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
myColumn.setName("ATTR2");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
diff --git a/ndb/examples/ndbapi_example4/ndbapi_example4.cpp b/ndb/examples/ndbapi_example4/ndbapi_example4.cpp
index a37822dbf0c..fcb770d49e9 100644
--- a/ndb/examples/ndbapi_example4/ndbapi_example4.cpp
+++ b/ndb/examples/ndbapi_example4/ndbapi_example4.cpp
@@ -80,16 +80,16 @@ int main()
myTable.setName("MYTABLENAME");
myColumn.setName("ATTR1");
- myColumn.setPrimaryKey(true);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(true);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
myColumn.setName("ATTR2");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
diff --git a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
index 98cfd1ef0d5..22641bc5b57 100644
--- a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
+++ b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
@@ -47,9 +47,9 @@
*
* NdbDictionary::Column
* setName()
- * setPrimaryKey()
* setType()
* setLength()
+ * setPrimaryKey()
* setNullable()
*
* NdbDictionary::Table
@@ -165,24 +165,24 @@ int create_table(Ndb * myNdb)
myTable.setName("GARAGE");
myColumn.setName("REG_NO");
- myColumn.setPrimaryKey(true);
myColumn.setType(NdbDictionary::Column::Unsigned);
myColumn.setLength(1);
+ myColumn.setPrimaryKey(true);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
myColumn.setName("BRAND");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Char);
myColumn.setLength(20);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
myColumn.setName("COLOR");
- myColumn.setPrimaryKey(false);
myColumn.setType(NdbDictionary::Column::Char);
myColumn.setLength(20);
+ myColumn.setPrimaryKey(false);
myColumn.setNullable(false);
myTable.addColumn(myColumn);
@@ -814,4 +814,3 @@ int main()
delete myNdb;
}
-