Added protocol::flush() for easier embedded-server code
Increase block allocation variables a bit as they where a bit too small for MySQL 4.1
Added option --silent to client_test
client/mysqltest.c:
Removed compiler warning
Fixed identation & comments from earlier push
Renamed variable 'disable_abort_on_error' to 'abort_on_error'
Ensure that '$mysql_errno' also with --ps-protocol
include/mysql_com.h:
Removed special handling of net_flush for embedded server
mysql-test/r/mysqltest.result:
Remove usage of !$ in tests
mysql-test/t/client_test.test:
Use --silent
mysql-test/t/comments.test:
Remove usage of !$ in tests
mysql-test/t/join_outer.test:
Remove usage of !$ in tests
mysql-test/t/key.test:
Remove usage of !$ in tests
mysql-test/t/mysqltest.test:
Remove usage of !$ in tests
mysql-test/t/show_check.test:
Remove usage of !$ in tests
mysql-test/t/temp_table.test:
Remove usage of !$ in tests
mysql-test/t/type_ranges.test:
Remove usage of !$ in tests
sql/mysqld.cc:
Increase block allocation variables a bit as they where a bit too small for MySQL 4.1
sql/net_serv.cc:
Remove special usage of net_flush in embedded server
sql/protocol.cc:
Added protocol::flush() for easier embedded-server code
sql/protocol.h:
Added protocol::flush() for easier embedded-server code
sql/sql_prepare.cc:
Added protocol::flush() for easier embedded-server code
Remove one extra flush() for prepared statements
sql/sql_show.cc:
Added protocol::flush() for easier embedded-server code
tests/client_test.c:
Added option --silent
Problem is that store_string_aux calls 'wrong' net_store_data
sql/protocol.h:
I tried not to do net_store_data virtual - it's going to work a bit slower -
using the fact that Protocol_simple and Protocol_prep have different
implementation for 'store' methods.
But now the store_string_aux method works for both.
Well we still can try to make separate versions for Protocol_prep and
Protocol_simple, but i prefer to make net_store_data virtual for
embedded server so we won't have similar problems in the future
is broken (prepared statements)": fixed date handling in many places
of prepared statements code.
libmysql/libmysql.c:
Fix for Bug#4026:
- now buffer_length is defined for any buffer type. Network buffer
preallocation cleaned up.
- added constants for maximum buffer sizes necessary for MYSQL_TYPE_DATE,
MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME types.
- TIME/DATETIME packing/unpacking functions fixed
- now result set metadata is always updated from fields sent to COM_EXECUTE.
This is necessary to make 'SELECT ?' queries work without conversions.
sql/item.cc:
- added implementatoin of Item_param::get_date
sql/item.h:
- added enum_field_types Item_param::param_type. First step for proper
handling of placeholders.
- added get_date() implementation to prevent date -> string -> date
conversions when MYSQL_TYPE_DATE/DATETIME parameter is used in temporal
context.
sql/protocol.cc:
Fix for Bug#4026:
- PACKET_BUFFET_EXTRA_ALLOC -> PACKET_BUFFER_EXTRA_ALLOC.
The define itself was moved to .cc as it's used only in protocol.cc
- fixed Protocol_prep::store_time() call.
sql/protocol.h:
- PACKET_BUFFER_EXTRA_ALLOC moved to protocol.cc
sql/sql_prepare.cc:
Fix for Bug#4026:
- MYSQL_TYPE_TIME/DATETIME handling fixed.
- added initialization for Item_param::param_type in
setup_one_conversion_function
tests/client_test.c:
Test case for Bug#4026
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
connection on the fly, because they first should be written to the binary
log.
To support efficient conversion we need to rewrite prepared statements
binlogging code first.
include/my_global.h:
Macro swap(a, b, c) was renamed to resolve name conflict with
String::swap() method.
include/my_sys.h:
Added declaration of escape_string_for_mysql()
include/mysql_com.h:
Removed and moved back: a macro which is visible to libmysql user but
has sence only in prepared statement protocol implementation.
isam/_search.c:
swap -> swap_variables
isam/test2.c:
swap -> swap_variables
libmysql/libmysql.c:
- sub_escape_string moved to mysys/charset.c to be visible in sql/
- few cleanups
myisam/mi_test2.c:
swap -> swap_variables
mysys/charset.c:
sub_escape_string was moved from libmysql.c to be able to use it in sql/
code.
mysys/my_chsize.c:
rename: swap -> swap_variables
mysys/my_compress.c:
swap -> swap_variables
mysys/my_handler.c:
swap -> swap_variables
sql/field.cc:
Field::store_time refactored to use TIME_to_string function from time.cc
sql/item.cc:
New implementation of Item_param class:
added support for character sets conversion.
sql/item.h:
Item_param:
- 'state' member introduced instead of many boolean variables.
- put ltime, int_value and real_value into union to save space.
- remove unimplemented members
- set_value renamed to set_str
sql/item_timefunc.cc:
Refactored to use functions from time.cc
sql/lock.cc:
rename: swap -> swap_variables
sql/mysql_priv.h:
- added declarations for TIME_to_ulonglong_*, TIME_to_string functions
- const specifiers for make_date, make_time, make_datetime arguments
sql/opt_range.cc:
rename: swap -> swap_variables
sql/protocol.cc:
- added character set conversion support to binary protocol.
- Protocol::convert changed to point at shared buffer in THD.
This lets us use one convert buffer for binary and simple protocol.
The same buffer is used for client->server conversions in prepared
statements code.
- string conversion code refactored to Protocol::store_string_aux function.
- few more comments
sql/protocol.h:
- Protocol::convert now points at THD::convert_buffer: we want to share one
buffer between all protocol implementations.
sql/sql_class.cc:
- implementation of THD::convert_string using THD::convert_buffer
(conversion of strings allocated in the system heap).
sql/sql_class.h:
- THD::convert_buffer is shared between THD and network Protocols and
used for character set conversion of strings.
- new function to convert String object from one charset to another using
THD::convert_buffer
sql/sql_insert.cc:
A little fix in a comment.
sql/sql_parse.cc:
Shrink convert buffer in the end of each statement.
sql/sql_prepare.cc:
Many changes:
- static specifier for set_param_* family of functions.
- FIELD_TYPE -> MYSQL_TYPE
- added set_param_binary as handler for BLOB types.
- added character set support
- added support for param typecode in mysql_stmt_get_longdata
(mysql_stmt_send_long_data handler)
- changes in Item_param deployed
- few cleanups
sql/sql_select.cc:
rename: swap -> swap_variables
sql/sql_string.cc:
- String::append rewritten to support character set conversion for
single-byte encodings.
- added String::swap method to efficiently exchange two string objects.
sql/sql_string.h:
Declraration for String::swap().
sql/time.cc:
- function TIME_to_string to convert TIME to String in default MySQL format
- family of functions TIME_to_ulonglong_*
tests/client_test.c:
Test for support for character set conversions in prepared statements
(binary and text data).
reviewed in Saint-Petersbourg (including post-review fixes).
include/my_sys.h:
Added clear_alloc_root (reset alloc root without freeing its memory)
sql/item.h:
- rename setup_param -> set_parap (function assigns parameter value to item)
sql/mysql_priv.h:
- all return values are void, because return value is never checked in
dispatch_command
- removed unused declaration of setup_param_functions
sql/protocol.h:
- unused declarations of setup_params_data* removed
sql/sql_class.cc:
Cleanup:
- bzero(mem_root) replaced with clear_alloc_root
- query_id and command members moved back to THD from Statement
Assignment of mem_root, free_list, query_id and command optimized
away from set_statement().
sql/sql_class.h:
- query_id and command moved back to THD from Statement
sql/sql_lex.h:
- better type for param_list
- param_count is the same thing as param_list.elements
sql/sql_parse.cc:
- comments for dispatch_command
sql/sql_prepare.cc:
Cleanup:
- added comments to many functions and removed trailing spaces in many
lines, some stale comments removed.
- it's faster to iterate using pointers, than classes
- Renames: error_in_prepare renamed to get_longdata_error (because it is set
when there is an error in mysql_send_longdata, rather than in
mysql_prepare), embedded versions of placeholder assignement functions
now have prefix emb_, setup_ functions renamed to set_, because they
perform assignment, not installation, setup_params_data now doesn't
call insert_params and was renamed to setup_set_param_functions,
- find_prepared_statement should not send error if called from no-reply
calls, like mysql_stmt_reset
- error reporting is checked up, to always report errors and not report
errors twice. send_prep_stmt can be done mostly in send_prepare_result,
rather than in test_* functions.
- now we don't need to reinit THD->mem_root/free_list in mysql_stmt_execute,
because it's not reset there.
tests/client_test.c:
- removed second call to test_subqueries
Fixed compiler warnings (a lot of hidden variables detected by the Forte compiler)
Added a lot of 'version_xxx' strings to 'show variables'
Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris)
Fixed problem with printing sub selects to debug log
Docs/mysqld_error.txt:
Updated error messages
Makefile.am:
Added missing SSL library (Should be in source distribution)
configure.in:
Added missing SSL library
include/sql_common.h:
Move duplicated prototypes
innobase/os/os0file.c:
Added comment for line that could be removed
innobase/srv/srv0srv.c:
Added comment for line that could be removed
innobase/srv/srv0start.c:
Added comment for line that could be removed
innobase/trx/trx0sys.c:
Added cast to remove compiler warning
isam/isamchk.c:
Fixed compiler warning
libmysql/conf_to_src.c:
Include files in proper order
myisam/mi_check.c:
Removed else part that caused compiler warning
myisam/mi_delete.c:
Added cast
myisam/mi_page.c:
Added cast
myisam/mi_preload.c:
Added cast
myisam/mi_write.c:
Added cast
myisam/myisampack.c:
changed 'byte' to 'current_byte' to avoid compiler warnings
mysql-test/mysql-test-run.sh:
Removed start-from as test '<' is not portable and this can easily be done from command line
mysys/hash.c:
Added cast
mysys/mf_wcomp.c:
Removed not reached line
mysys/my_append.c:
Fixed include file order to get this more portable
mysys/my_copy.c:
Fixed include file order to get this more portable
mysys/my_redel.c:
Fixed include file order to get this more portable
sql-common/client.c:
More DBUG_PRINT
sql-common/pack.c:
Added casts becasue Fortre compiler apparently compares (ulonglong) < (longlong) as signed
sql/ha_heap.cc:
Changed variable names to not cause hidden variables
sql/ha_innodb.cc:
Changed variable names to not cause hidden variables
sql/item.cc:
Changed variable names to not cause hidden variables
sql/item.h:
Changed variable names to not cause hidden variables
sql/item_cmpfunc.h:
Changed variable names to not cause hidden variables
sql/item_func.cc:
Changed variable names to not cause hidden variables
sql/item_subselect.cc:
Changed variable names to not cause hidden variables
sql/item_subselect.h:
Changed variable names to not cause hidden variables
sql/item_sum.cc:
Changed variable names to not cause hidden variables
sql/item_timefunc.cc:
Changed variable names to not cause hidden variables
sql/log.cc:
Changed variable names to not cause hidden variables
sql/protocol.cc:
Changed variable names to not cause hidden variables
sql/protocol.h:
Changed variable names to not cause hidden variables
Remove function not declared in protocol.cc
sql/protocol_cursor.cc:
Changed variable names to not cause hidden variables
sql/set_var.cc:
Added a lot of 'version_xxx' strings
Changed 'bdb_version' to 'version_bdb'
sql/sql_class.cc:
Changed variable names to not cause hidden variables
Add TMP_TABLE_PARAM::init() to allow one to initialize structure several times
sql/sql_class.h:
Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris)
sql/sql_derived.cc:
Avoid copying TMP_TABLE_PARAM (Use class version instead)
sql/sql_error.cc:
More DBUG
sql/sql_help.cc:
Fixed compiler warning
sql/sql_lex.cc:
Changed variable names to not cause hidden variables
sql/sql_list.h:
Changed variable names to not cause hidden variables
sql/sql_parse.cc:
Changed variable names to not cause hidden variables
sql/sql_select.cc:
Changed variable names to not cause hidden variables
Ensure that you don't send NULL to printf() for %s
Fixed problem with printing sub selects to debug log
sql/sql_select.h:
Changed variable names to not cause hidden variables
sql/sql_union.cc:
Changed variable names to not cause hidden variables
Don't use local copy of TMP_TABLE_PARAM (Caused core dump on Solaris)
sql/sql_update.cc:
Indentation cleanup
sql/sql_yacc.yy:
Remove warning
strings/conf_to_src.c:
Fixed include file order
prepared statements in embedded library
include/mysql_com.h:
to make net_flush() working in expressions
libmysqld/lib_sql.cc:
some bugs fixed
libmysqld/libmysqld.c:
we already have the define in client_settings.h
sql/protocol.cc:
net_store_data should work that way in Protocol_prep (embedded server)
sql/protocol.h:
definition for net_store_data
sql/sql_prepare.cc:
now it works in embedded library
prepared statements in embedded library
include/mysql.h:
Another 'virtual' method
libmysql/client_settings.h:
client implementation declared
libmysql/libmysql.c:
mysql_execute edited to work with embedded implementation
libmysqld/lib_sql.cc:
one error fixed (we do need parameter's buffer in embedded library)
embedded recordset transfer methods implementations added
sql-common/client.c:
method added to the table
sql/client_settings.h:
no prepared statements in mimiclient
sql/mysql_priv.h:
these functions became global
sql/protocol.cc:
the stub added
sql/protocol.h:
had to change Protocol's interface for embedded library
sql/sql_class.h:
i changed this only for embedded case, but i think it's better to do the
same for remote server also
sql/sql_prepare.cc:
parts of code #ifndef-ed
Now special 1-byte packet is used for request of old password
Fixed bug with --skip-grant-tables and acl_getroot
include/mysql.h:
removed scramble_323 member as now scramble_323 function does not count
on trailing zero for scramble
include/mysql_com.h:
updated declarations
libmysql/libmysql.c:
now server sends special 1-byte packet instead of old scramble
to re-request password.
mysql->scramble_323 replaced with mysql->scramble
sql-common/client.c:
now server sends special 1-byte packet instead of old scramble
to re-request password.
mysql->scramble_323 replaces with mysql->scramble
sql/password.c:
comments beautified
hash_password now accepts password length
sql/protocol.cc:
added send_old_password_request function
sql/protocol.h:
added send_old_password_request function
sql/sql_acl.cc:
style fixes, bug with --skip-grant-tables and acl_getroot
fixed
sql/sql_class.h:
thd->scramble_323 removed as now
old functions accept not null-terminated scrambles
sql/sql_crypt.cc:
fixed with new hash_password proto
sql/sql_parse.cc:
style fixes
few comments added
Class for sending data from server to client (Protocol)
This handles both the old ( <= 4.0 ) protocol and then new binary protocol that is used for prepared statements.
libmysql/libmysql.c:
Jump over reserved bits in the binary protocol
libmysqld/Makefile.am:
rename of net_pkg.cc to protocol.cc
mysql-test/r/case.result:
Fixed previously wrong test
mysql-test/r/cast.result:
Fixed previously wrong test
sql/Makefile.am:
Rename of net_pkg.cc to protocol.cc
sql/field.cc:
Binary protocol
Added key handling functions for new VARCHAR type
sql/field.h:
New protocol
sql/ha_berkeley.cc:
New protocol
sql/ha_berkeley.h:
New protocol
sql/ha_innodb.cc:
New protocol
sql/ha_myisam.cc:
New protocol
sql/item.cc:
New protocol
sql/item.h:
New protocol
sql/item_func.cc:
Removed old code from 3.23
sql/item_func.h:
Set cached_result_type as it was previosly used before set
sql/item_subselect.cc:
Standard make_field() is now good enough
sql/item_subselect.h:
Use default make_field()
sql/item_sum.cc:
Clean up Item_sum::make_field()
sql/item_sum.h:
Use standard make_field()
sql/item_timefunc.h:
return correct types for casts()
Use standard make_field()
sql/log_event.cc:
New protocol
sql/log_event.h:
New protocol
sql/mysql_priv.h:
Move things to protocol.h
sql/opt_range.cc:
Indentation cleanups + small optimization
sql/procedure.h:
Use MYSQL_TYPE instead of FIELD_TYPE
sql/protocol.cc:
Class for sending data from server to client.
This handles both the old ( <= 4.0 ) protocol and then new binary protocol that is used for prepared statements.
sql/repl_failsafe.cc:
New protocol
sql/slave.cc:
New protocol
sql/sql_acl.cc:
New protocol
sql/sql_base.cc:
Move send_fields() to protocol.cc
sql/sql_class.cc:
New protocol
sql/sql_class.h:
New protocol
sql/sql_db.cc:
New protocol
sql/sql_error.cc:
New protocol
sql/sql_handler.cc:
New protocol
sql/sql_help.cc:
New protocol
sql/sql_parse.cc:
Remove wrong assert (variable was not initalized at this point)
sql/sql_prepare.cc:
New protocol
sql/sql_repl.cc:
New protocol
sql/sql_select.cc:
New protocol
sql/sql_show.cc:
New protocol
sql/sql_string.h:
New functions used by the protocol functions
sql/sql_table.cc:
New protocol
sql/structs.h:
Make second_part ulong to prepare for ANSI sub-seconds
sql/time.cc:
New convert function needed by the new protocol functions