Created
June 21, 2012 09:57
-
-
Save ericliang/2964943 to your computer and use it in GitHub Desktop.
SysBench patch for MemSQL benchmark, which skips the storage engine detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 81ac1ad630b4d466bdeec58fe367dbf2de595fc2 Mon Sep 17 00:00:00 2001 | |
From: Eric Liang <[email protected]> | |
Date: Thu, 21 Jun 2012 17:44:20 +0800 | |
Subject: [PATCH] memsql would not satisfy the engine test, so skip the detection and use innodb as default | |
--- | |
sysbench/drivers/mysql/drv_mysql.c | 29 ++++++++++++++++++----------- | |
1 files changed, 18 insertions(+), 11 deletions(-) | |
diff --git a/sysbench/drivers/mysql/drv_mysql.c b/sysbench/drivers/mysql/drv_mysql.c | |
index a48e6f6..0f578d8 100644 | |
--- a/sysbench/drivers/mysql/drv_mysql.c | |
+++ b/sysbench/drivers/mysql/drv_mysql.c | |
@@ -318,19 +318,26 @@ int mysql_drv_describe(drv_caps_t *caps, const char * table_name) | |
DEBUG("mysql_num_fields(%p) = %d", res, num_fields); | |
fields = mysql_fetch_fields(res); | |
DEBUG("mysql_fetch_fields(%p) = %p", res, fields); | |
- for (i = 0; i < num_fields; i++) | |
- if (!strcasecmp(fields[i].name, "type") || | |
- !strcasecmp(fields[i].name, "engine")) | |
- break; | |
- if (i >= num_fields) | |
- goto error; | |
- | |
- row = mysql_fetch_row(res); | |
- DEBUG("mysql_fetch_row(%p) = %p", res, row); | |
- if (row == NULL || row[i] == NULL) | |
- goto error; | |
+ | |
+ if ( 3 == num_fields ){ //memsql | |
+ rc = parse_table_engine("InnoDB"); | |
+ }else{ | |
+ for (i = 0; i < num_fields; i++) | |
+ if (!strcasecmp(fields[i].name, "type") || | |
+ !strcasecmp(fields[i].name, "engine")) | |
+ break; | |
+ | |
+ if (i >= num_fields) | |
+ goto error; | |
+ | |
+ row = mysql_fetch_row(res); | |
+ DEBUG("mysql_fetch_row(%p) = %p", res, row); | |
+ if (row == NULL || row[i] == NULL) | |
+ goto error; | |
+ | |
+ rc = parse_table_engine(row[i]); | |
+ } | |
- rc = parse_table_engine(row[i]); | |
*caps = mysql_drv_caps; | |
goto exit; | |
-- | |
1.7.0.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment