Fix crush with show pool_status when there many (more than 18) DB nodes.
authorTatsuo Ishii <ishii at sraoss.co.jp>
Fri, 18 Dec 2009 00:30:53 +0000 (00:30 +0000)
committerTatsuo Ishii <ishii at sraoss.co.jp>
Fri, 18 Dec 2009 00:30:53 +0000 (00:30 +0000)
pool_process_reporting.c

index 34ab9c83c83b2009ee4cbc225b38af3e5b652cac..f8b5f450e5b416650d0e2e8b8e4557082ca6f022 100644 (file)
@@ -52,9 +52,15 @@ void process_reporting(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend)
                char desc[POOLCONFIG_MAXDESCLEN+1];
        } POOL_REPORT_STATUS;
 
-#define MAXITEMS 128
+/*
+ * Report data buffer.
+ * 128 is the max number of configuration items.
+ * In addition, we need MAX_NUM_BACKENDS*4
+ * for backend descriptions.
+ */
+#define MAXITEMS (128 + MAX_NUM_BACKENDS*4)            
 
-       POOL_REPORT_STATUS status[MAXITEMS];
+       static POOL_REPORT_STATUS status[MAXITEMS];
 
        short nrows;
        int size;