[Tritonn-commit 146] [svn] [160] upgraded tritonn:: info now set correct number of records to stats.records

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2008年 6月 26日 (木) 11:26:01 JST


Revision: 160
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=160
Author:   mir
Date:     2008-06-26 11:26:00 +0900 (Thu, 26 Jun 2008)

Log Message:
-----------
upgraded tritonn::info now set correct number of records to stats.records

Modified Paths:
--------------
    trunk/src/ha_tritonn.cc


-------------- next part --------------
Modified: trunk/src/ha_tritonn.cc
===================================================================
--- trunk/src/ha_tritonn.cc	2008-06-25 09:23:52 UTC (rev 159)
+++ trunk/src/ha_tritonn.cc	2008-06-26 02:26:00 UTC (rev 160)
@@ -345,7 +345,21 @@
 {
   DBUG_ENTER("ha_tritonn::info");
   DBTN;
-  stats.records=100;
+  char buf[1024];
+  char *res;
+  unsigned int res_len;
+  int res_flag;
+  int i;
+  my_snprintf(buf,1024,"(<%s> ::nrecords)", share->short_name);
+  call_senna_ql(ctx,buf,false);
+  sen_ctx_recv(ctx,&res,&res_len,&res_flag);
+  char *res2 = (char*) sql_alloc(res_len+1);
+  for (i=0; i<res_len; i++) {
+    *(res2+i) = *(res+i);
+  }
+  *(res2+res_len) = '\0';
+  stats.records=atoi(res2);
+  printf("[SennaQL] returned nrecords = %d\n",stats.records);
   DBUG_RETURN(0);
 }
 


Tritonn-commit メーリングリストの案内
アーカイブの一覧に戻る