svnno****@sourc*****
svnno****@sourc*****
2008年 6月 18日 (水) 17:22:22 JST
Revision: 151 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=151 Author: mir Date: 2008-06-18 17:22:22 +0900 (Wed, 18 Jun 2008) Log Message: ----------- prototype Modified Paths: -------------- trunk/src/ha_tritonn.cc trunk/src/ha_tritonn.h -------------- next part -------------- Modified: trunk/src/ha_tritonn.cc =================================================================== --- trunk/src/ha_tritonn.cc 2008-06-18 04:55:51 UTC (rev 150) +++ trunk/src/ha_tritonn.cc 2008-06-18 08:22:22 UTC (rev 151) @@ -18,14 +18,7 @@ #include "ha_tritonn.h" #include <mysql/plugin.h> -#include <senna/senna.h> -char *dbpath="tritonn.db"; -sen_db *db; -int dbcreate_flag = 0; -sen_encoding db_encoding = sen_enc_utf8; -int ctx_flag = SEN_CTX_USEQL; - /* create ha_tritonn instance */ static handler *tritonn_create_handler(handlerton *hton, TABLE_SHARE *table, @@ -79,6 +72,8 @@ hton->flush_logs = tritonn_flush_logs; hton->show_status = tritonn_show_status; hton->flags = tritonn_hton_flags; + + sen_init(); DBUG_RETURN(0); } @@ -93,6 +88,7 @@ hash_free(&tritonn_open_tables); pthread_mutex_destroy(&tritonn_mutex); + sen_fin(); DBUG_RETURN(0); } @@ -272,6 +268,8 @@ DBUG_RETURN(HA_ERR_OUT_OF_MEM); thr_lock_data_init(&share->lock,&lock,NULL); + + DBUG_RETURN(0); } @@ -333,7 +331,13 @@ { DBUG_ENTER("ha_tritonn::create"); DBTN; - dump_create(name,table_arg,create_info); + //dump_create(name,table_arg,create_info); + char buf[200]; + my_snprintf(buf,200,"%s/tritonn.db",table_arg->s->db); + db = sen_db_open(buf); + if (!db) { + db = sen_db_create(buf,0,sen_enc_utf8); + } DBUG_RETURN(0); } Modified: trunk/src/ha_tritonn.h =================================================================== --- trunk/src/ha_tritonn.h 2008-06-18 04:55:51 UTC (rev 150) +++ trunk/src/ha_tritonn.h 2008-06-18 08:22:22 UTC (rev 151) @@ -2,6 +2,8 @@ #pragma interface /* gcc class implementation */ #endif +#include <senna/senna.h> + /** @brief TRITONN_SHARE is a structure that will be shared among all open handlers. This implements the minimum of what you will probably need. @@ -18,6 +20,9 @@ THR_LOCK_DATA lock; // MySQL lock TRITONN_SHARE *share; // Shared lock info + sen_db *db; + sen_ctx *ctx; + public: /* constructor */ ha_tritonn(handlerton *hton, TABLE_SHARE *table_arg);