Commit 83bb61d8 authored by joerg@trift2's avatar joerg@trift2

Merge trift2.:/MySQL/M51/mysql-5.1

into  trift2.:/MySQL/M51/push-5.1
parents 53303665 52ae4496
......@@ -1416,15 +1416,15 @@ get_options(int *argc,char ***argv)
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_pre_statements)
actual_queries= parse_delimiter(tmp_string, &pre_statements,
delimiter[0]);
(void)parse_delimiter(tmp_string, &pre_statements,
delimiter[0]);
my_free(tmp_string, MYF(0));
}
else if (user_supplied_pre_statements)
{
actual_queries= parse_delimiter(user_supplied_pre_statements,
&pre_statements,
delimiter[0]);
(void)parse_delimiter(user_supplied_pre_statements,
&pre_statements,
delimiter[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)
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_post_statements)
parse_delimiter(tmp_string, &post_statements,
delimiter[0]);
(void)parse_delimiter(tmp_string, &post_statements,
delimiter[0]);
my_free(tmp_string, MYF(0));
}
else if (user_supplied_post_statements)
{
parse_delimiter(user_supplied_post_statements, &post_statements,
delimiter[0]);
(void)parse_delimiter(user_supplied_post_statements, &post_statements,
delimiter[0]);
}
if (verbose >= 2)
......@@ -1813,6 +1813,13 @@ pthread_handler_t run_task(void *p)
{
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))
goto end;
}
......@@ -2002,7 +2009,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
ptr+= retstr - ptr + 1;
if (isspace(*ptr))
ptr++;
count++;
}
if (ptr != script+length)
......
......@@ -35,7 +35,7 @@ eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--error ER_CANT_FIND_DL_ENTRY
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
--disable_info
save_master_pos;
......@@ -46,7 +46,7 @@ sync_with_master;
--echo "Running on the slave"
--enable_info
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
--disable_info
connection master;
......@@ -81,7 +81,7 @@ connection master;
--enable_info
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_int;
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
--disable_info
sync_slave_with_master;
......@@ -89,7 +89,7 @@ sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
--echo "Running on the slave"
--enable_info
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
--disable_info
connection master;
......@@ -108,7 +108,7 @@ DROP TABLE t1;
--enable_info
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
......@@ -116,7 +116,7 @@ sync_slave_with_master;
# Check to see that UDF CREATE statements were replicated
--echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
connection master;
......@@ -147,7 +147,7 @@ connection master;
--enable_info
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
......@@ -155,7 +155,7 @@ sync_slave_with_master;
# Check to see if data was replicated
--echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
# Check to see that the functions are available for execution on the slave
SELECT myfuncsql_int(25);
......@@ -169,7 +169,7 @@ connection master;
--enable_info
DROP FUNCTION myfuncsql_double;
DROP FUNCTION myfuncsql_int;
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
......@@ -177,7 +177,7 @@ sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
--echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
connection master;
......
......@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
select * from t1;
select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`;
......@@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
select * from t1;
select * from t2;
select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`;
......@@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
SHOW TABLES;
select * from t1;
select * from t2;
SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
......@@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
SHOW TABLES;
select * from t1;
select * from t2;
SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
......
......@@ -14,13 +14,13 @@ CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
affected rows: 0
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
affected rows: 2
"Running on the slave"
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
......@@ -64,11 +64,11 @@ DROP FUNCTION myfunc_double;
affected rows: 0
DROP FUNCTION myfunc_int;
affected rows: 0
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
"Running on the slave"
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
"Running on the master"
......@@ -80,13 +80,13 @@ CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
affected rows: 0
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
affected rows: 2
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
......@@ -122,13 +122,13 @@ ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
affected rows: 0
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
test myfuncsql_int FUNCTION i INT RETURN i This was altered.
affected rows: 2
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
test myfuncsql_int FUNCTION i INT RETURN i This was altered.
......@@ -146,11 +146,11 @@ DROP FUNCTION myfuncsql_double;
affected rows: 0
DROP FUNCTION myfuncsql_int;
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
"Running on the master"
......@@ -166,16 +166,16 @@ CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
affected rows: 0
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
myfunc_int 2 UDF_LIB function
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
affected rows: 2
"Running on the slave"
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
myfunc_int 2 UDF_LIB function
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
affected rows: 2
"Running on the master"
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
......@@ -224,11 +224,11 @@ DROP FUNCTION myfunc_double;
affected rows: 0
DROP FUNCTION myfunc_int;
affected rows: 0
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
"Running on the slave"
SELECT * FROM mysql.func;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
"Running on the master"
......@@ -240,13 +240,13 @@ CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
affected rows: 0
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
affected rows: 2
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
......@@ -282,13 +282,13 @@ ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
affected rows: 0
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
test myfuncsql_int FUNCTION i INT RETURN i This was altered.
affected rows: 2
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
test myfuncsql_int FUNCTION i INT RETURN i This was altered.
......@@ -306,11 +306,11 @@ DROP FUNCTION myfuncsql_double;
affected rows: 0
DROP FUNCTION myfuncsql_int;
affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
"Running on the slave"
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
"Running on the master"
......
......@@ -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" --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 @@
ha_example::open() would also have been necessary. Calls to
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>
-Brian
*/
......@@ -132,7 +136,6 @@ static int example_init_func(void *p)
(hash_get_key) example_get_key,0,0);
example_hton->state= SHOW_OPTION_YES;
example_hton->db_type= DB_TYPE_EXAMPLE_DB;
example_hton->create= example_create_handler;
example_hton->flags= HTON_CAN_RECREATE;
......
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])
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