Prepared statements in embedded server
Several changes in library code with two goals:
to make mysql_prepare_stmt working in embedded server
to get rid of #define mysql_interface_func mysql->methods->interface_func
in user's interface
include/mysql.h:
modifications of interface
two goals: to implement prepared statements and to get rid
of #define mysql_proc (mysql->smth) in interface
include/sql_common.h:
read_rows function got 'virtual'
libmysql/client_settings.h:
interface of some functions declared in client.c moved here
libmysql/libmysql.c:
several functions changed with declared goals
libmysqld/embedded_priv.h:
libmysqld.c <--> lib_sql.cc interface moved here
libmysqld/lib_sql.cc:
all embedded 'virtual' functions moved here so they can be static
libmysqld/libmysqld.c:
embedded 'virtual' function was moved out of here
sql-common/client.c:
several changes with the declared goal
sql/sql_class.h:
place to store statement data added to THD
sql/sql_prepare.cc:
storing of prepare_statement result for embedded server added
CREATE TABLE t1(a NVARCHAR(10))
This is for compatibility with MSSQL, DB2, Informix and some other DBMSs.
Note, standard SQL doesn't have "NVARCHAR" syntax.
There are only these syntaxes in SQL2003:
NATIONAL VARCHAR
NCHAR VARCHAR
NATIONAL CHARACTER VARYING
NCHAR VARYING
- Tests were added for all the above syntaxes.
sql/lex.h:
New syntax:
CREATE TABLE t1(a NVARCHAR(10))
This is for compatibility with MSSQL, DB2, Informix and some other DBMSs.
Note, standard SQL doesn't have "NVARCHAR" syntax.
There are only these syntaxes in SQL2003:
NATIONAL VARCHAR
NCHAR VARCHAR
NATIONAL CHARACTER VARYING
NCHAR VARYING
sql/sql_yacc.yy:
New syntax:
CREATE TABLE t1(a NVARCHAR(10))
This is for compatibility with MSSQL, DB2, Informix and some other DBMSs.
Note, standard SQL doesn't have "NVARCHAR" syntax.
There are only these syntaxes in SQL2003:
NATIONAL VARCHAR
NCHAR VARCHAR
NATIONAL CHARACTER VARYING
NCHAR VARYING
to SHOW SLAVE STATUS.
mysql-test/r/rpl000015.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_empty_master_crash.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_error_ignored_table.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_flush_log_loop.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_loaddata.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_log.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_log_pos.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_max_relay_size.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_openssl.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_redirect.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_replicate_do.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_reset_slave.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_rotate_logs.result:
Fixed test after adding UNTIL conditions to SHOW SLAVE STATUS
mysql-test/r/rpl_until.result:
Post merge fix
mysql-test/t/rpl_until.test:
Post merge fix
include/mysqld_error.h:
Added error codes for warnings and error messages for START SLAVE UNTIL
mysql-test/r/rpl000015.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_empty_master_crash.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_flush_log_loop.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_log.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_log_pos.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_redirect.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_replicate_do.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
mysql-test/r/rpl_rotate_logs.result:
Fixed test because 3 new columns to SHOW SLAVE STATUS output were added
sql/lex.h:
Added UNTIL symbol
sql/log.cc:
Invalidating until_log_name comparison result if group_relay_log_name is changed
sql/log_event.cc:
Invalidating until_log_name comparison result if group_master_log_name is changed
sql/repl_failsafe.cc:
Cancel until condition if LOAD MASTER DATA is executed
sql/share/czech/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/danish/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/dutch/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/english/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/estonian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/french/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/german/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/greek/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/hungarian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/italian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/japanese/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/korean/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/norwegian-ny/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/norwegian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/polish/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/portuguese/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/romanian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/russian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/serbian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/slovak/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/spanish/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/swedish/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/share/ukrainian/errmsg.txt:
Added error and warning message for START SLAVE UNTIL
sql/slave.cc:
Fixed wrong locking order in init_relay_log_pos()
Added until condition fields to SHOW SLAVE STATUS
Added checking if UNTIL condition is reached
(added proper method, added its invocation, reorganized locking
in exec_relay_log_event() and next_event())
sql/slave.h:
Members in RELAY_LOG_INFO for storing UNTIL condition. Also
methods for for invalidation of cached UNTIL condition comparison
results
sql/sql_repl.cc:
Now honoring UNTIL clause then starting slave thread. Proper
errors and warnings.
sql/sql_yacc.yy:
Added support for UNTIL clause in START SLAVE. This involved
extraction of some of master_defs to separate master_file_def
non-terminal.
mysql-test/r/subselect.result:
A warning added to subselect test due to the recent changes.
UNION in sub-select returns the empty set, which is why this warning is
a mistery to me.
mysql-test/r/union.result:
two changes.
First one is due to the proper handling of LIMIT offset, limit in
UNION without all.
Second is a change in behaviour due to the fact that ORDER by in a
UNION without braces is not now applicable to the last SELECT node.
It can not be applied until one bug is fixed (after my vacation).
Should be documented.
bad merge fixed
mysql-test/t/isam.test:
bad merge fixed
mysql-test/t/lock_tables_lost_commit.test:
"normal" warning in test suite disabled
mysql-test/t/subselect.test:
"normal" warning in test suite disabled
bug#1269
sql/share/czech/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/danish/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/dutch/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/estonian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/french/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/german/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/greek/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/hungarian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/italian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/japanese/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/korean/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/norwegian-ny/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/norwegian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/polish/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/portuguese/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/romanian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/russian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/serbian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/slovak/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/spanish/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/swedish/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
sql/share/ukrainian/errmsg.txt:
error messages from english/errmsg.txt added to other languages.
bug##1269
#977 Prepared statements in embedded library
include/mysql.h:
read_prepare_result function moved to 'virtual'
libmysql/client_settings.h:
declare proper function for libmysql
libmysql/libmysql.c:
some code moved from implementation of read_prepare_result to
mysql_prepare_result to make creating separate (remote and embedded-server)
versions easier
libmysqld/libmysqld.c:
emb_read_prepare_result prototype
sql-common/client.c:
cli_read_prepare_result added to the client_methods
sql/client_settings.h:
we don't need prepared statements in mini_client
sql/sql_prepare.cc:
embedded send_prep_stmt added
Optimize calls to current_thd
mysql-test/r/mix_innodb_myisam_binlog.result:
updated results
mysql-test/t/mix_innodb_myisam_binlog.test:
Fix for 4.1
sql/ha_innodb.cc:
Don't call current_thd in an assert that is not deleted in release version
(Because current_thd is slow)
Remove sel000xxxx tests
After merge fixes
BitKeeper/deleted/.del-sel000033.test~3971fbe746eec069:
Delete: mysql-test/t/sel000033.test
BitKeeper/deleted/.del-sel000033.result~56d1d02d72b94602:
Delete: mysql-test/r/sel000033.result
BitKeeper/deleted/.del-sel000100.result~84ed46856cb3a69f:
Delete: mysql-test/r/sel000100.result
BitKeeper/deleted/.del-sel000100.test~548501cad19a1a59:
Delete: mysql-test/t/sel000100.test
mysql-test/r/distinct.result:
Merge test with sel000100
mysql-test/r/grant.result:
Update result after merge
mysql-test/r/range.result:
After merge fix
Merge test with sel000033
mysql-test/t/distinct.test:
Merge test with sel000100
mysql-test/t/range.test:
Merge test with sel000033
sql/log_event.cc:
Remove duplicate allocation
sql/sql_select.cc:
After merge fixes
strings/ctype-tis620.c:
Remove usage of strnlen
Optimize code and make it \0 safe
client/mysqltest.c:
Auto merged
include/mysql.h:
Auto merged
libmysql/errmsg.c:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/share/portuguese/errmsg.txt:
Auto merged
sql/share/spanish/errmsg.txt:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/client_test.c:
Auto merged
BitKeeper/etc/logging_ok:
auto-union
BitKeeper/deleted/.del-mysql_fix_privilege_tables.sql:
Delete: scripts/mysql_fix_privilege_tables.sql
include/mysql.h:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_update.c:
Auto merged
myisam/myisampack.c:
Auto merged
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/t/bdb.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
mysql-test/t/range.test:
Auto merged
scripts/make_win_src_distribution.sh:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
Note that mix_innodb_myisam_binlog and union fails after this patch (Will be fixed shortly by maintaners of this code)
client/mysql.cc:
After merge fix
include/mysql.h:
Some additions to MYSQL_BIND for cleaner prepared statement code
libmysql/libmysql.c:
mysql_prepare_result -> mysql_get_metadata()
Added test for offset overflow when using mysql_fetch_column()
Cleaned up mysql_fetch_column()
Optimized fetch_result() usage
mysql-test/r/func_group.result:
Updated results after merge
mysql-test/r/func_test.result:
Updated results after merge
mysql-test/r/grant.result:
Updated results after merge
mysql-test/r/loaddata.result:
Updated results after merge
mysql-test/r/lowercase_table.result:
Updated results after merge
mysql-test/r/mix_innodb_myisam_binlog.result:
Updated results after merge (note that this is still not correct; Need patch to mysqld to fix this properly)
mysql-test/r/myisam.result:
Updated results after merge
mysql-test/r/range.result:
Updated results after merge
mysql-test/r/rpl_loaddata.result:
Updated results after merge
mysql-test/r/rpl_loaddata_rule_m.result:
Updated results after merge
mysql-test/r/rpl_loaddata_rule_s.result:
Updated results after merge
mysql-test/r/rpl_log.result:
Updated results after merge
mysql-test/r/union.result:
Updated results after merge
mysql-test/t/lowercase_table.test:
Update after merge
mysql-test/t/myisam.test:
Update after merge
mysql-test/t/union.test:
Update after merge
sql-bench/compare-results.sh:
Fix for now output format
sql/field.h:
Added is_null_in_record() to make ha_innodb.cc code more general
sql/ha_innodb.cc:
Removed some functions that uses inernal (private) MySQL information
sql/item_cmpfunc.cc:
After merge fix
sql/log_event.cc:
After merge fix; (Some code should be checked by Guilhem)
sql/opt_range.cc:
Simple optimzation and after merge fixes
sql/slave.cc:
After merge fix
sql/sql_acl.cc:
After merge fix + code cleanup
sql/sql_select.cc:
After merge fix
sql/sql_show.cc:
After merge fix
sql/sql_table.cc:
After merge fix
Cleanup of mysql_checksum_table()
sql/sql_union.cc:
After merge fixes.
Note that after this the union test still fails; Will be fixed shortly...
tests/client_test.c:
mysql_prepare_result() -> mysql_get_metadata()
embedded&client library
some fixes: zero at the end of the data added
mysql_list_fields became 'virtual'
include/mysql.h:
mysql_list_fields became 'virtual'
libmysql/client_settings.h:
in client library we need proper implementation for list_fields
libmysql/libmysql.c:
implementation for remote server
libmysqld/lib_sql.cc:
we still need zero at the end of the data in client (see mysql.cc).
I feel it should be changed
libmysqld/libmysqld.c:
implementation for embedded server
sql-common/client.c:
cli_list_fields member set for client library
sql/client_settings.h:
we don't need mysql_list_fields in mini_client code
use the local machine's IP address instead of the host name when
building the initial grant tables if "skip-name-resolve" has been
specified in my.cnf. This can be helpful on FreeBSD to avoid
thread-safety problems with the FreeBSD resolver libraries.
(Thanks to Jeremy Zawodny for the patch)
scripts/mysql_install_db.sh:
- Added option "--skip-name-resolve" to use the local machine's IP address
instead of the host name when building the initial grant tables if
"skip-name-resolve" has been specified in my.cnf (Thanks to Jeremy
Zawodny for the patch)