Commit 543440a8 authored by casualet's avatar casualet

able to handle decimal value

parent 8df5dd1c
...@@ -574,6 +574,8 @@ isUnique(const std::string &name, ...@@ -574,6 +574,8 @@ isUnique(const std::string &name,
return unique; return unique;
} }
//from one filed to multiple fields. the fields are automatically transformed to unsigned. This is called in createHandler.
List<Create_field> List<Create_field>
createAndRewriteField(Analysis &a, Create_field * const cf, createAndRewriteField(Analysis &a, Create_field * const cf,
TableMeta *const tm, bool new_table, TableMeta *const tm, bool new_table,
...@@ -583,7 +585,19 @@ createAndRewriteField(Analysis &a, Create_field * const cf, ...@@ -583,7 +585,19 @@ createAndRewriteField(Analysis &a, Create_field * const cf,
List<Create_field> &rewritten_cfield_list) List<Create_field> &rewritten_cfield_list)
{ {
// we only support the creation of UNSIGNED fields // we only support the creation of UNSIGNED fields
cf->flags = cf->flags | UNSIGNED_FLAG; //add this to support plaintext data and decimal
if(cf->sql_type != enum_field_types::MYSQL_TYPE_DECIMAL &&
cf->sql_type != enum_field_types::MYSQL_TYPE_FLOAT &&
cf->sql_type != enum_field_types::MYSQL_TYPE_DOUBLE &&
cf->sql_type != enum_field_types::MYSQL_TYPE_TIMESTAMP &&
cf->sql_type != enum_field_types::MYSQL_TYPE_DATE &&
cf->sql_type != enum_field_types::MYSQL_TYPE_TIME &&
cf->sql_type != enum_field_types::MYSQL_TYPE_DATETIME &&
cf->sql_type != enum_field_types::MYSQL_TYPE_YEAR &&
cf->sql_type != enum_field_types::MYSQL_TYPE_NEWDATE &&
cf->sql_type != enum_field_types::MYSQL_TYPE_NEWDECIMAL
)
cf->flags = cf->flags | UNSIGNED_FLAG;
const std::string &name = std::string(cf->field_name); const std::string &name = std::string(cf->field_name);
std::unique_ptr<FieldMeta> std::unique_ptr<FieldMeta>
......
...@@ -266,6 +266,7 @@ rewrite(lua_State *const L) { ...@@ -266,6 +266,7 @@ rewrite(lua_State *const L) {
const std::string &query = xlua_tolstring(L, 2); const std::string &query = xlua_tolstring(L, 2);
const unsigned long long _thread_id = const unsigned long long _thread_id =
strtoull(xlua_tolstring(L, 3).c_str(), NULL, 10); strtoull(xlua_tolstring(L, 3).c_str(), NULL, 10);
std::cout<<query<<std::endl;
//this is not used?? //this is not used??
c_wrapper->last_query = query; c_wrapper->last_query = query;
if (EXECUTE_QUERIES) { if (EXECUTE_QUERIES) {
......
###start gdb
sudo gdb `which mysql-proxy` `ps aux | grep 'mysql-proxy.cnf' |grep -v grep | awk '{print $2}'`
###stop gdb
ps aux|grep gdb|grep -v grep|awk '{print $2}'| while read line;do sudo kill -9 $line;done
...@@ -7,6 +7,6 @@ mysql -uroot -pletmein -h127.0.0.1 tpcc1000 < create_table.sql ...@@ -7,6 +7,6 @@ mysql -uroot -pletmein -h127.0.0.1 tpcc1000 < create_table.sql
./tpcc_load -h127.0.0.1 -uroot -pletmein -d tpcc1000 -w $1 ./tpcc_load -h127.0.0.1 -uroot -pletmein -d tpcc1000 -w $1
# mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --no-create-info --hex-blob --compact tpcc1000 > all$1.sql # mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --no-create-info --hex-blob --compact tpcc1000 > all$1.sql
mysqldump -uroot -pletmein -h127.0.0.1 --hex-blob --compact tpcc1000 > all$1.sql mysqldump --skip-extended-insert -uroot -pletmein -h127.0.0.1 --hex-blob --compact tpcc1000 > all$1.sql
mysql -uroot -pletmein -h127.0.0.1 -e "drop database if exists tpcc1000" mysql -uroot -pletmein -h127.0.0.1 -e "drop database if exists tpcc1000"
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