Commit a6614fec authored by yiwenshao's avatar yiwenshao

special bug in makefile

parent 0966083b
This diff is collapsed.
This diff is collapsed.
OBJDIRS += wrapper OBJDIRS += wrapper
WRAPPER_SRCS := common.cc WRAPPER_SRCS := common.cc reuse.cc
all: $(OBJDIR)/libwrapper.so all: $(OBJDIR)/libwrapper.so
......
...@@ -59,3 +59,10 @@ public: ...@@ -59,3 +59,10 @@ public:
}; };
#include "wrapper/reuse.hh"
using std::cout;
using std::cin;
using std::endl;
void rawMySQLReturnValue::show(){
cout<<"rowvalues:"<<endl;
for(auto item_vec:rowValues){
for(auto item:item_vec){
cout<<item.size()<<"\t";
}
cout<<endl;
}
cout<<"types:"<<endl;
for(auto item:fieldTypes){
cout<<IS_NUM(item)<<"\t";
}
cout<<endl;
cout<<"fieldNames:"<<endl;
for(auto item:fieldNames){
cout<<item<<"\t";
}
cout<<endl;
cout<<"lengths:"<<endl;
for(auto item:lengths){
cout<<item<<"\t";
}
cout<<endl;
cout<<"maxlengths:"<<endl;
for(auto item:maxlengths){
cout<<item<<"\t";
}
cout<<endl;
}
/*no default argument allowed???*/
/*Item_null *
make_null(const std::string &name){
char *const n = current_thd->strdup(name.c_str());
return new Item_null(n);
}*/
/*
std::vector<Item *>
itemNullVector(unsigned int count)
{
std::vector<Item *> out;
for (unsigned int i = 0; i < count; ++i) {
out.push_back(make_null(""));
}
return out;
}
*/
#pragma once
#include <main/rewrite_main.hh>
#include <main/rewrite_util.hh>
class WrapperState {
WrapperState(const WrapperState &other);
WrapperState &operator=(const WrapperState &rhs);
KillZone kill_zone;
public:
std::string last_query;
std::string default_db;
WrapperState() {}
~WrapperState() {}
const std::unique_ptr<QueryRewrite> &getQueryRewrite() const {
assert(this->qr);
return this->qr;
}
void setQueryRewrite(std::unique_ptr<QueryRewrite> &&in_qr) {
this->qr = std::move(in_qr);
}
void selfKill(KillZone::Where where) {
kill_zone.die(where);
}
void setKillZone(const KillZone &kz) {
kill_zone = kz;
}
std::unique_ptr<ProxyState> ps;
std::vector<SchemaInfoRef> schema_info_refs;
private:
std::unique_ptr<QueryRewrite> qr;
};
/*Raw return value from mysql*/
struct rawMySQLReturnValue {
std::vector<std::vector<std::string>> rowValues;/*data tuples*/
std::vector<std::string> fieldNames;
std::vector<enum_field_types> fieldTypes;
std::vector<int> lengths;
std::vector<int> maxlengths;/*what's the difference between length and maxlength?*/
std::vector<int> choosen_onions;
void show();
};
//Item_null*
//make_null(const std::string &name);
//std::vector<Item *>
//itemNullVector(unsigned int count);
//ResType MygetResTypeFromLuaTable(bool isNULL,rawMySQLReturnValue *inRow = NULL,int in_last_insert_id = 0);
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