aboutsummaryrefslogtreecommitdiff
path: root/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine.cpp')
-rw-r--r--engine.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/engine.cpp b/engine.cpp
index 608d641..e99576c 100644
--- a/engine.cpp
+++ b/engine.cpp
@@ -46,7 +46,7 @@ int main(int argc,char **argv){
row.items[0].rh_int32=UINT_MAX;
row.items[1].rh_uint32=UINT_MAX;
row.items[2].rh_bytes=new unsigned char[10];
- strcpy((char*)row.items[2].rh_bytes,"hallo daar");
+ memcpy((char*)row.items[2].rh_bytes,"hallo daar",10);
InsertQuery iqu(move(row));
iqu.tablename="hoi";
@@ -56,12 +56,20 @@ int main(int argc,char **argv){
cout<<"Insert, Result: "<<res.res<<": (msg=\""<<res.msg<<"\")"<<endl;
for(const Row &r : res.rows)cout<<"- "<<r<<endl;
+ iqu.row.items[0].rh_int32=42;
+ memcpy((char*)iqu.row.items[2].rh_bytes,"doei!\0\0\0\0",10);
+
+ res=iqu.execute(tables);
+
+ cout<<"Insert, Result: "<<res.res<<": (msg=\""<<res.msg<<"\")"<<endl;
+ for(const Row &r : res.rows)cout<<"- "<<r<<endl;
+
cout<<"hoitb has "<<hoitb->rows.size()<<" row"<<(hoitb->rows.size()==1?"":"s")<<'.'<<endl;
FindQuery fqu;
fqu.tablename="hoi";
- RowItem ri; ri.rh_int32=-1;
- fqu.where.emplace_back(0,ri);
+ RowItem ri; ri.rh_uint32=UINT_MAX;
+ fqu.where.emplace_back(1,ri);
res=fqu.execute(tables);