Commit 88516bcb authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/data0/bk/mysql-5.1

into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch


client/mysqlslap.c:
  Auto merged
storage/example/ha_example.cc:
  Auto merged
parents 98fd2f64 7cf95c33
...@@ -1416,15 +1416,15 @@ get_options(int *argc,char ***argv) ...@@ -1416,15 +1416,15 @@ get_options(int *argc,char ***argv)
tmp_string[sbuf.st_size]= '\0'; tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0)); my_close(data_file,MYF(0));
if (user_supplied_pre_statements) if (user_supplied_pre_statements)
actual_queries= parse_delimiter(tmp_string, &pre_statements, (void)parse_delimiter(tmp_string, &pre_statements,
delimiter[0]); delimiter[0]);
my_free(tmp_string, MYF(0)); my_free(tmp_string, MYF(0));
} }
else if (user_supplied_pre_statements) else if (user_supplied_pre_statements)
{ {
actual_queries= parse_delimiter(user_supplied_pre_statements, (void)parse_delimiter(user_supplied_pre_statements,
&pre_statements, &pre_statements,
delimiter[0]); delimiter[0]);
} }
if (user_supplied_post_statements && my_stat(user_supplied_post_statements, &sbuf, MYF(0))) if (user_supplied_post_statements && my_stat(user_supplied_post_statements, &sbuf, MYF(0)))
...@@ -1447,14 +1447,14 @@ get_options(int *argc,char ***argv) ...@@ -1447,14 +1447,14 @@ get_options(int *argc,char ***argv)
tmp_string[sbuf.st_size]= '\0'; tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0)); my_close(data_file,MYF(0));
if (user_supplied_post_statements) if (user_supplied_post_statements)
parse_delimiter(tmp_string, &post_statements, (void)parse_delimiter(tmp_string, &post_statements,
delimiter[0]); delimiter[0]);
my_free(tmp_string, MYF(0)); my_free(tmp_string, MYF(0));
} }
else if (user_supplied_post_statements) else if (user_supplied_post_statements)
{ {
parse_delimiter(user_supplied_post_statements, &post_statements, (void)parse_delimiter(user_supplied_post_statements, &post_statements,
delimiter[0]); delimiter[0]);
} }
if (verbose >= 2) if (verbose >= 2)
...@@ -1813,6 +1813,13 @@ pthread_handler_t run_task(void *p) ...@@ -1813,6 +1813,13 @@ pthread_handler_t run_task(void *p)
{ {
mysql_close(mysql); mysql_close(mysql);
if (!(mysql= mysql_init(NULL)))
{
fprintf(stderr,"%s: mysql_init() failed ERROR : %s\n",
my_progname, mysql_error(mysql));
exit(0);
}
if (slap_connect(mysql)) if (slap_connect(mysql))
goto end; goto end;
} }
...@@ -2002,7 +2009,6 @@ parse_delimiter(const char *script, statement **stmt, char delm) ...@@ -2002,7 +2009,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
ptr+= retstr - ptr + 1; ptr+= retstr - ptr + 1;
if (isspace(*ptr)) if (isspace(*ptr))
ptr++; ptr++;
count++;
} }
if (ptr != script+length) if (ptr != script+length)
......
...@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
select * from t1; select * from t1;
select * from t2; select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`; CREATE SCHEMA `mysqlslap`;
...@@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
select * from t1; select * from t1;
select * from t2; select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`; CREATE SCHEMA `mysqlslap`;
...@@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
SHOW TABLES; SHOW TABLES;
select * from t1; select * from t1;
select * from t2;
SHOW TABLES; SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
...@@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); ...@@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2'); insert into t2 values ('test', 'test2');
SHOW TABLES; SHOW TABLES;
select * from t1; select * from t1;
select * from t2;
SHOW TABLES; SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`;
......
...@@ -38,3 +38,5 @@ ...@@ -38,3 +38,5 @@
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES"; --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES";
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1; --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1;
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
ha_example::open() would also have been necessary. Calls to ha_example::open() would also have been necessary. Calls to
ha_example::extra() are hints as to what will be occuring to the request. ha_example::extra() are hints as to what will be occuring to the request.
A Longer Example can be found called the "Skeleton Engine" which can be
found on TangentOrg. It has both an engine and a full build environment
for building a pluggable storage engine.
Happy coding!<br> Happy coding!<br>
-Brian -Brian
*/ */
...@@ -132,7 +136,6 @@ static int example_init_func(void *p) ...@@ -132,7 +136,6 @@ static int example_init_func(void *p)
(hash_get_key) example_get_key,0,0); (hash_get_key) example_get_key,0,0);
example_hton->state= SHOW_OPTION_YES; example_hton->state= SHOW_OPTION_YES;
example_hton->db_type= DB_TYPE_EXAMPLE_DB;
example_hton->create= example_create_handler; example_hton->create= example_create_handler;
example_hton->flags= HTON_CAN_RECREATE; example_hton->flags= HTON_CAN_RECREATE;
......
MYSQL_STORAGE_ENGINE(example,, [Example Storage Engine], MYSQL_STORAGE_ENGINE(example,, [Example Storage Engine],
[Skeleton for Storage Engines for developers], [max,max-no-ndb]) [Example for Storage Engines for developers], [max,max-no-ndb])
MYSQL_PLUGIN_DYNAMIC(example, [ha_example.la]) MYSQL_PLUGIN_DYNAMIC(example, [ha_example.la])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment