List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:September 20 2007 1:32pm
Subject:Rev 162: Added drop/create table to lua test program. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 162
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Thu 2007-09-20 15:32:31 +0200
message:
  Added drop/create table to lua test program.
modified:
  lua/test.lua                   test.lua-20070920131233-idnreujp7bwxsxre-1
=== modified file 'lua/test.lua'
--- a/lua/test.lua	2007-09-20 13:12:36 +0000
+++ b/lua/test.lua	2007-09-20 13:32:31 +0000
@@ -1,5 +1,28 @@
 require("ndbapi")
-
+require("luasql.mysql")
+
+env=luasql.mysql()
+num_iter=1000
+INSERT_NUM=1000
+BATCH_SIZE=1000
+
+db = env:connect("test","root")
+
+print "Dropping and recreating schema\n"
+
+db:execute("drop table if exists mytablename")
+
+db:execute("CREATE TABLE if not exists"
+  .. " mytablename "
+  .. " (ATTR1 INT UNSIGNED not null auto_increment, "
+  .. " ATTR2 INT UNSIGNED NOT NULL, "
+  .. " PRIMARY KEY USING HASH (ATTR1)) "
+  .. " ENGINE=NDBCLUSTER")
+
+
+-- Connect to cluster
+
+print "connecting to cluster\n"
 
 ndbapi.ndb_init()
 

Thread
Rev 162: Added drop/create table to lua test program. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmergeMonty Taylor20 Sep