[Tritonn-commit 47] [svn] [57] bugfix: mysqld got sig11 while show senna status handled views.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 12月 14日 (金) 17:22:47 JST


Revision: 57
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=57
Author:   mir
Date:     2007-12-14 17:22:47 +0900 (Fri, 14 Dec 2007)

Log Message:
-----------
bugfix: mysqld got sig11 while show senna status handled views.

Modified Paths:
--------------
    mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result
    mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test
    mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc
    mysql-5.0.51-tritonn-1.0.8/sql/table.cc
    mysql-5.0.51-tritonn-1.0.8/sql/unireg.h

Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result
===================================================================
--- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result	2007-12-12 07:04:17 UTC (rev 56)
+++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/r/senna_create.result	2007-12-14 08:22:47 UTC (rev 57)
@@ -241,3 +241,10 @@
 t1	ft3	c5	utf8	DELIMITED	OFF	OFF	OFF	OFF	OFF	128	0	4268032	0	4268032	143360	36864
 t1	ft4	c5	utf8	NGRAM	OFF	ON	ON	ON	ON	48	0	4268032	0	4268032	135168	16384
 DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 TEXT, FULLTEXT INDEX ft (c2));
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW SENNA STATUS;
+Table	Key_name	Column_name	Encoding	Index_type	Sectionalize	Normalize	Split_alpha	Split_digit	Split_symbol	Initial_n_segments	Senna_keys_size	Senna_keys_file_size	Senna_lexicon_size	Senna_lexicon_file_size	Senna_inv_seg_size	Senna_inv_chunk_size
+t1	ft	c2	latin1	NGRAM	OFF	ON	OFF	OFF	OFF	512	0	4268032	0	4268032	167936	135168
+DROP VIEW v1;
+DROP TABLE t1;

Modified: mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test
===================================================================
--- mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test	2007-12-12 07:04:17 UTC (rev 56)
+++ mysql-5.0.51-tritonn-1.0.8/mysql-test/suite/senna/t/senna_create.test	2007-12-14 08:22:47 UTC (rev 57)
@@ -230,4 +230,9 @@
 SHOW SENNA STATUS;
 DROP TABLE t1;
 
-
+# bugfix: got sig11 when show senna status with view
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 TEXT, FULLTEXT INDEX ft (c2));
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW SENNA STATUS;
+DROP VIEW v1;
+DROP TABLE t1;

Modified: mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc
===================================================================
--- mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc	2007-12-12 07:04:17 UTC (rev 56)
+++ mysql-5.0.51-tritonn-1.0.8/sql/sql_show.cc	2007-12-14 08:22:47 UTC (rev 57)
@@ -4537,7 +4537,15 @@
   List_iterator_fast<char> it(files);
   while (file_name = it++)
   {
+    TABLE tmp_table;
     TABLE_LIST table_list;
+
+    /* to skip views */
+    (void) my_snprintf(path, FN_LEN, "%s/%s", db, file_name);
+    openfrm(thd, path, "", 0, SENNA_CHECK_VIEW, 0, &tmp_table);
+    if(!(tmp_table.file)) continue;
+    closefrm(&tmp_table);
+
     bzero((char*) &table_list, sizeof(table_list));
     table_list.db = db;
     table_list.table_name = file_name;

Modified: mysql-5.0.51-tritonn-1.0.8/sql/table.cc
===================================================================
--- mysql-5.0.51-tritonn-1.0.8/sql/table.cc	2007-12-12 07:04:17 UTC (rev 56)
+++ mysql-5.0.51-tritonn-1.0.8/sql/table.cc	2007-12-14 08:22:47 UTC (rev 57)
@@ -109,6 +109,18 @@
   if (my_read(file,(byte*) head,64,MYF(MY_NABP)))
     goto err;
 
+#ifdef ENABLE_SENNA
+  if (prgflag & SENNA_CHECK_VIEW)
+  {
+    if (memcmp(head, STRING_WITH_LEN("TYPE=VIEW")) == 0)
+    {
+      error_reported = TRUE;
+      error = 0;
+      goto err;
+    }
+  }
+#endif
+
   if (memcmp(head, STRING_WITH_LEN("TYPE=")) == 0)
   {
     // new .frm

Modified: mysql-5.0.51-tritonn-1.0.8/sql/unireg.h
===================================================================
--- mysql-5.0.51-tritonn-1.0.8/sql/unireg.h	2007-12-12 07:04:17 UTC (rev 56)
+++ mysql-5.0.51-tritonn-1.0.8/sql/unireg.h	2007-12-14 08:22:47 UTC (rev 57)
@@ -151,6 +151,10 @@
 #define NO_ERR_ON_NEW_FRM	8192	/* stop error sending on new format */
 #define OPEN_VIEW_NO_PARSE     16384    /* Open frm only if it's a view,
                                            but do not parse view itself */
+#ifdef ENABLE_SENNA
+#define SENNA_CHECK_VIEW       32768
+#endif
+
 #define SC_INFO_LENGTH 4		/* Form format constant */
 #define TE_INFO_LENGTH 3
 #define MTYP_NOEMPTY_BIT 128




Tritonn-commit メーリングリストの案内
Back to archive index