summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix for bug #6266 "Invalid DATETIME value is not handled properly".unknown2004-11-151-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In server we assume that datetime values stored in MYSQL_TIME struct are normalized (and year is not greater than 9999), so we should perform range checks in all places then we convert something to MYSQL_TIME. include/my_time.h: Added one more argument to set_zero_time() function to make it more convinient. Added comment clarifying why MAX_DATE_STRING_REP_LENGTH value is 30. include/mysql_time.h: Documented MySQL's internal assumptions for members of MYSQL_TIME structure. libmysql/libmysql.c: It does not make sense to set MYSQL_TIME::time_type twice in case of errors. mysql-test/r/type_datetime.result: Added test for bug #6266 "Invalid DATETIME value not handled properly". mysql-test/t/type_datetime.test: Added test for bug #6266 "Invalid DATETIME value not handled properly". sql-common/my_time.c: str_to_datetime(): Added missing check for too big year values. set_zero_time(): added time_type argument, since MYSQL_TIMESTAMP_NONE is not the value that we want in most cases. sql/field.cc: Field_datetime::store_time(): clarified why we don't perform any range checks here. sql/item.cc: Item_param::set_time(): Added comment describing this method and range checking for TIME values. sql/sql_prepare.cc: Removed comments about range checking for TIME values in prepared statements, which are no longer true. set_zero_time() has one more argument now. tests/client_test.c: Added test for bug #6266 "Invalid DATETIME value not handled properly"
* bad automerge (?) fixedunknown2004-11-021-1/+0
|
* Remove usage of !$ from mysql-testsunknown2004-11-021-417/+690
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* A fix and test case for Bug#6096 "field.max_length is always zero for unknown2004-10-271-0/+101
| | | | | | | | | | | | | | | | | numeric columns (stmt_resultset_metadata)" libmysql/libmysql.c: A fix for Bug#6096 "field.max_length is always zero for numeric columns (stmt_resultset_metadata)": set field->max_lenght for numeric columns when we set up skip_result functions. A minor drawback for this approach is that field->max_length can be not zero even if STMT_ATTR_UPDATE_MAX_LENGTH is not set. sql-common/my_time.c: Fix valgrind warning. tests/client_test.c: A test case for Bug#6096 "field.max_length is always zero for numeric columns (stmt_resultset_metadata)
* Playing with test_bug5399() to make it work on HPUX 64 bit: no unknown2004-10-261-18/+19
| | | | | | | | reason for the failure was found, so the guess is that it is a compiler bug.
* Manual merge of fix for bug #6081 "Call to deprecated mysql_create_db() ↵unknown2004-10-221-0/+26
|\ | | | | | | | | | | | | | | | | | | function crashes server" with main tree. sql/sql_parse.cc: Auto merged
| * Fix for bug #6081 "Call to deprecated mysql_create_db() function crashesunknown2004-10-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | server". Altough mysql_create_db()/mysql_drop_db() API calls are deprecated since 4.0, they should not crash server and should not stall connection in case of errors. sql/sql_parse.cc: Handling of COM_CREATE_DB, COM_DROP_DB: mysql_create_db() requires from its second parameter to be non-zero. We also should call send_error() if mysql_create_db or mysql_drop_db return error (like we do it for SQL versions of these commands). tests/client_test.c: Added test for bug #6081 "Execution of deprecated mysql_create_db() crashes server".
* | A test case for Bug#6046: no fix is needed (the bug is alreadyunknown2004-10-221-0/+48
| | | | | | | | | | | | | | fixed in the main tree).
* | Manual merge.unknown2004-10-211-0/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_class.h: Auto merged sql/sql_prepare.cc: Auto merged tests/client_test.c: Manual merge
| * | A fix and test case for bug#6059 "mysql_stmt_field_count returns unknown2004-10-211-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | positive numbers when no resultset is available": when sending result set metadata we need to use virtual select_result::send_fields, and not address protocol directly, because select_result descendents may intercept result set (it's the case for example for SELECT INTO OUTFILE). sql/sql_class.h: A fix for bug#6059 "mysql_stmt_field_count returns positive numbers when no resultset is available": introducing select_result::field_count() method to report actual number of fields in a result set, if any result set is sent to client. sql/sql_prepare.cc: A fix for bug#6059 "mysql_stmt_field_count returns positive numbers when no resultset is available": when sending result set metadata we need to use virtual select_result::send_fields, and not address protocol directly, because select_result descendents may intercept result set (it's the case for example for SELECT INTO OUTFILE). Now we need to always have lex->result set if we're in prepared statements. tests/client_test.c: A test case for Bug#6059 "mysql_stmt_field_count returns positive numbers when no resultset is available"
* | Merge bk-internal.mysql.com:/home/bk/mysql-4.1unknown2004-10-201-3/+98
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/kostja/work/mysql-4.1-6049 libmysql/libmysql.c: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged tests/client_test.c: Auto merged
| * | A fix and test case for bug#6058 "Prepared statements return '0000-00-00' unknown2004-10-201-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (date) as empty string": preserve time type (date, time, or datetime) for zero dates, times, and datetimes. libmysql/libmysql.c: A fix for bug#6058 "Prepared statements return '0000-00-00' (date) as empty string": preserve time type (date, time, or datetime) for zero dates, times, and datetimes. tests/client_test.c: A test case for Bug#6058, the existing tests required some adjustments too.
| * | A fix and test case for Bug#6049 "Loss of sign when using prepared unknown2004-10-161-0/+47
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | statements and negative time/date values". The bug was in wrong sprintf format used in the client library. The fix moves TIME -> string conversion functions to sql-common and utilized them in the client library. include/my_time.h: Declarations for new functions shared between the client and server. libmysql/libmysql.c: Fix for Bug#6049 "Loss of sign when using prepared statements and negative time/date values": use the same function as the server to convert date/time/datetime values to strings. sql-common/my_time.c: Implementation of my_{time,datetime,date,TIME}_to_str: it's needed by the client library, so it should be shared. sql/field.cc: Don't create String object if it's not needed. sql/item.cc: Don't create String object if it's not needed: TIME_to_string was moved to my_TIME_to_str, with different arguments. sql/item_timefunc.cc: Don't create String object if it's not needed. sql/mysql_priv.h: TIME_to_string and MAX_DATE_REP_LENGTH moved to the client library. MAX_DATE_REP_LENGTH was renamed to MAX_DATE_STRING_REP_LENGTH to not conflict with the same name in libmysql.c sql/protocol.cc: Don't create String object if it's not needed. sql/time.cc: Implementation of my_{time,date,datetime,TIME}_to_str moved to my_time.c shared between the client and the server. tests/client_test.c: A test case for Bug#6049.
* | Review of all code pushed since last reviewunknown2004-10-201-11/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple optimzations and cleanups Removed compiler warnings and fixed portability issues Added client functions 'mysql_embedded()' to allow client to check if we are using embedded server Fixes for purify client/mysqlimport.c: Remove not used variable client/mysqltest.c: Remove usage of MAXPATHLEN (all MySQL code uses FN_REFLEN) Simplified code Remove usage of sprintf("%llu") as this is not portable include/mysql.h: Added mysql_embedded() to be able to easily check if we are using the embedded server innobase/srv/srv0start.c: Don't use memcmp() when using purify (to avoid false warnings) libmysql/libmysql.c: Added mysql_embedded() to be able to easily check if we are using the embedded server libmysql/libmysql.def: Added mysql_embedded() to be able to easily check if we are using the embedded server myisam/myisam_ftdump.c: Remove compiler warning myisam/myisamchk.c: Remove compiler warning myisam/rt_test.c: #ifdef not used code mysys/hash.c: Remove compiler warning (from last push) mysys/my_gethwaddr.c: Remove compiler warning ndb/src/ndbapi/ndberror.c: #ifdef not used code regex/regcomp.c: Remove not used code regex/regcomp.ih: Remove not used code (to remove compiler warnings) sql-common/client.c: Remove compiler warnings sql/field.cc: Simple optimization sql/ha_innodb.cc: Rename mysql_embedded -> mysqld_embedded sql/item.cc: Fix comments Move variables first on block Remove else after return Simple optimizations (no logic changes) sql/item_cmpfunc.cc: Added comment sql/mysql_priv.h: Rename mysql_embedded -> mysqld_embedded sql/mysqld.cc: Rename mysql_embedded -> mysqld_embedded sql/sql_acl.cc: Added comments simple optimization Fixed 'very unlikely' bug when doing REVOKE ALL PRIVILEGES sql/sql_select.cc: More comments Simple optimization sql/sql_show.cc: Simple changes to make similar code similar More comments sql/sql_string.cc: Trivial optimization and better code layout strings/Makefile.am: Change xml.c to use bcmp to avoid warnings from purify strings/xml.c: Change xml.c to use bcmp to avoid warnings from purify tests/client_test.c: Remove usage of MAXPATHLEN (all MySQL code uses FN_REFLEN)
* tests/client_test.c:unknown2004-10-131-482/+596
| | | | | | | | | | Make checks (asserts) performed in client_test.c work in non-debug builds. tests/client_test.c: Make checks (asserts) performed in client_test.c work in non-debug builds: all asserts/DBUG_ASSERTs replaced with if (!(expr)) abort();
* Makefile.am, client_test.test, mysql-test-run.sh:unknown2004-10-081-1/+2
| | | | | | | | | | | | To make client_test work as mysql-test-run test case, needs to install it mysql-test/mysql-test-run.sh: To make client_test work as mysql-test-run test case, needs to install it mysql-test/t/client_test.test: To make client_test work as mysql-test-run test case, needs to install it tests/Makefile.am: To make client_test work as mysql-test-run test case, needs to install it
* A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values unknown2004-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes mysqld": implementation for a generic item tree modifications registry. Every item tree modification which should be rolled back for subsequent execution of a prepared statement or stored procedure should be saved in the registry. All such modifications are rolled back at once during cleanup stage of PS. Actual fix for the bug just adds a call to register modifications to convert_constant_item. Post review fixes implemented. mysql-test/r/ps.result: A fix for bug#5748, test results fixed. mysql-test/t/ps.test: A test case for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld" sql/item.cc: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": First step in removing up item-specific cleanups: now all such tree modifications should be done using the genericm mechanism implemented in this changeset. sql/item.h: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": no need for an item-specific change record any more. sql/item_cmpfunc.cc: A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": register item tree transformation performed by convert_constant_item. sql/sql_class.cc: Implementation for item tree transformations registry. sql/sql_class.h: Declarations, necessary for the tree transformations registry. sql/sql_parse.cc: Assert that the item tree transformations registry is not used for conventional execution. sql/sql_prepare.cc: Use of the item tree modifications registry in prepared statements: rollback all modifications in the end of statement prepare and execute. Also we now always set thd->current_arena to be able to determine that this is an execution of prepared statement inside the registry code. tests/client_test.c: A typo fixed.
* client_test.test:unknown2004-09-281-8/+6
| | | | | | | | | | | | | | | | | | | | | | | Run client_test as a testcase new file mysql-test-run.sh: More clearly report failure if --force, also exit 1 client_test.c: Use MAXPATHLEN in test_frm_bug() Renable test cases disabled for running from mysql-test-run mysqltest.c: Don't check errno from popen, may not be set client/mysqltest.c: Don't check errno from popen, may not be set tests/client_test.c: Use MAXPATHLEN in test_frm_bug() Renable test cases disabled for running from mysql-test-run mysql-test/mysql-test-run.sh: More clearly report failure if --force, also exit 1 mysql-test/t/client_test.test: Run client_test as a testcase
* Mergeunknown2004-09-251-30/+44
|\ | | | | | | | | tests/client_test.c: SCCS merged
| * client_test.c:unknown2004-09-251-30/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return exit(1) instead of exit(0) on failure. Allow longer path names using MAXPATHLEN. Added option --testcase that skips some failing tests. Replaced 'return' with exit(1) in test_frm_bug(). mysqltest.c: Let --exec fail if command fails client/mysqltest.c: Let --exec fail if command fails tests/client_test.c: Return exit(1) instead of exit(0) on failure. Allow longer path names using MAXPATHLEN. Added option --testcase that skips some failing tests. Replaced 'return' with exit(1) in test_frm_bug().
* | fix client_test to be a bit faster under valgrind.unknown2004-09-231-1/+1
| |
* | A fix and test case for Bug#5315 "mysql_change_user() doesn't freeunknown2004-09-221-0/+30
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prepared statements." include/hash.h: New declaration for hash_reset() function. The old version was not used. libmysql/client_settings.h: Declaration for mysql_detach_stmt_list(). libmysql/libmysql.c: Fix for bug#5315 "mysql_change_user() doesn't free prepared statements": add call to mysql_detach_stmt_list(prepared statements) to mysql_change_user(): all statements are freed by server, so client counterparts need to be marked as not usable. mysys/hash.c: Fix for bug#5315 "mysql_change_user() doesn't free prepared statements": implementation of hash_reset(), which frees all hash elements and prepares the hash for reuse. sql-common/client.c: Fix for bug#5315 "mysql_change_user() doesn't free prepared statements": implementation of mysql_detach_stmt_list(): zero connection pointer in given statement list, thus marking given statements as not usable. sql/sql_class.cc: Fix for bug#5315 "mysql_change_user() doesn't free prepared statements": reset prepared statements map in THD::change_user(). sql/sql_class.h: Fix for bug#5315 "mysql_change_user() doesn't free prepared statements": implementation of Statement_map::reset(). A little cleanup of ~Statement_map(): first empty names_hash, as st_hash has a free function, which will delete statements. tests/client_test.c: A test case for bug #5315 "mysql_change_user() doesn't free prepared statements".
* Fix the test case for bug#4231 (which before was passing just by occasion)unknown2004-09-151-3/+3
|
* Syntax correction for bug#5560.unknown2004-09-141-2/+2
| | | | | | tests/client_test.c: Pointer arithmetic on array names is not allowed in all compilers, rather use array elements and the address operator (bug#5560).
* client_test.c:unknown2004-09-081-19/+19
| | | | | | | | fix typos noticed while poking around in test program. tests/client_test.c: fix typos noticed while poking around in test program.
* A fix and test case for Bug#5194 "Bulk Insert Failures with Prepared unknown2004-09-081-0/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Statements": - fix a couple of net->buff overruns in libmysql, - check in the server that statement parameter count is less than 65535 (maximum value supported by prepared statements protocol). libmysql/libmysql.c: Bug#5194 "Bulk Insert Failures with Prepared Statements": - clean up my_realloc_str() - ensure that net buffer has space when storing null bits and parameter typecodes. sql/net_serv.cc: - set net->last_errno if packet is too big, even on client (Why was it ifdefed before?) sql/sql_prepare.cc: Bug#5194 "Bulk Insert Failures with Prepared Statements": - if placeholder count is bigger than 65535, give error. We have only 2 bytes reserved for transferring placeholder count in 4.1 protocol. - can't add a proper error code and message in 4.1 because of possible merge difficulties." tests/client_test.c: A test case for Bug#5194 "Bulk Insert Failures with Prepared Statements".
* A fix and test case for bug#5399 "Wrong statement executed by MySQLunknown2004-09-081-0/+48
| | | | | | | | | | | | | server" (use my_charset_bin for stmt id hash). sql/sql_class.cc: Fix for bug#5399 "Wrong statement executed by MySQL server": we hash stmt ids bytewise, need to use binary collation for it. tests/client_test.c: Test case for bug#5399 "Wrong statement executed by MySQL server": create number of statements returning different results, execute them one by one.
* Merge bk-internal.mysql.com:/home/bk/mysql-4.1unknown2004-09-031-1/+1
|\ | | | | | | | | | | | | | | | | | | into mysql.com:/home/my/mysql-4.1 sql/sql_prepare.cc: Auto merged tests/client_test.c: Auto merged
| * Merge bk-internal.mysql.com:/home/bk/mysql-4.1unknown2004-09-021-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/my/mysql-4.1 sql/sql_select.cc: Auto merged tests/client_test.c: Auto merged
| | * After merge fixesunknown2004-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | mysql-test/mysql-test-run.sh: Export MASTER_MYSOCK (used in some tests) mysql-test/t/alter_table.test: Use MASTER_MYSOCK instead of master.sock
* | | A fix and test case for Bug#4231 "Wrong result with MYSQL_TIMEunknown2004-09-021-0/+74
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parameters": when unpacking binary time recieved from client, handle the case when length is 0: it means all MYSQL_TIME members are zero. include/my_time.h: Declaration for set_zero_time: a tiny piece of code, which I see no reason to not reuse. libmysql/libmysql.c: set_zero_time implementation is now shared between client and server. sql-common/my_time.c: set_zero_time implementation added. sql/sql_prepare.cc: A fix for Bug#4231 "Wrong result with MYSQL_TIME parameters": when unpacking binary time recieved from client, handle the case when length is 0: it means all MYSQL_TIME members are zero. tests/client_test.c: Test case for bug#4231 "Wrong result with MYSQL_TIME parameters"
* | Make client_test pass on 64-bit HP-UX11: long is 64 bit,unknown2004-09-011-33/+33
|/ | | | | | | replace all (mis)uses of it with int32.
* A short fix and test case for Bug#5126 unknown2004-08-261-0/+48
| | | | | | | | | | | "Mediumint and PS problem": just treat mediumint as long. libmysql/libmysql.c: A short fix for bug #5126 "Mediumint and PS problem": just treat mediumint as long, as it's sent just like long. tests/client_test.c: A test case for bug#5126
* after mergeunknown2004-08-261-1/+1
| | | | | sql/item_row.cc: ds20 compat fix
* Cleanup in libmysql.unknown2004-08-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | libmysql/libmysql.c: Cleanup of conversion part of libmysql (prepared statements protocol): - now we have basic support for any conversion sequence: when we don't implement direct conversion of given value to requested buffer type (i.e. time -> double, or the other way around) we first convert i.e. time -> string and then call string -> double conversion. param->offset is now handled only in one place. - conversion functions renamed from send_data_{string, long, double} to fetch_{string,long,double}_with_conversion. Don't be confused with strange diff for send_data_long: I had to move send_data_string before all other sends as it's used inside thesm. (Shall we have a forward declaration instead?-) - a little cleanup in read_binary_{date,time,datetime} - now type of date value is set inside these functions, so we can be sure that we always return fully filled MYSQL_TIME structure to the user - float -> string conversion is fixed to honor param->precision. This is a step forward in fixing bug#4172 tests/client_test.c: test fix: now libmysql always sets MYSQL_TIME::time_type field. We need to set these fields in the test as later _in values are compared with canonical by plain memcmp.
* Type of MYSQL_BIND::buffer changed to void *unknown2004-06-251-168/+168
|
* - fixed test_frm_bug test to work with increased number of columns inunknown2004-06-241-2/+2
| | | | | | | | result of SHOW TABLE STATUS BitKeeper/etc/ignore: added libmysqld/my_time.c
* Fix for Bug#4030 "Client side conversion string -> date type doesn't unknown2004-06-241-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | work (prepared statements)" and after-review fixes: - str_to_TIME renamed to str_to_datetime to pair with str_to_time - functions str_to_time and str_to_TIME moved to sql-common - send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE, MYSQL_TIME_DATETIME types of user input buffers. - few more comments in the client library - a test case added. VC++Files/libmysql/libmysql.dsp: new file: my_time.c VC++Files/libmysqld/libmysqld.dsp: new file: my_time.c VC++Files/sql/mysqld.dsp: new file: my_time.c include/Makefile.am: - mysql_time.h added to the list of installed client library headers include/mysql.h: - declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to mysql_time.h, which is in shared use of client library and mysys. libmysql/Makefile.shared: - my_time.lo added to the list of libmysql objects libmysql/libmysql.c: Fix for bug#4030 "Client side conversion string -> date type doesn't work (prepared statements)" and cleanup. - added case labels for TIME/DATE/DATETIME types to send_data_str - comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results. libmysqld/Makefile.am: - my_time.c added sql-common/Makefile.am: - my_time.c added to the list of files included into source distribution. sql/Makefile.am: my_time.c added to the list of mysqld sources. sql/field.cc: - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} sql/item.cc: - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} sql/item_timefunc.cc: - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} sql/mysql_priv.h: - added typedefs for TIME and timestamp_type - removed declarations for str_to_time and str_to_TIME (now this functions reside in mysys) sql/mysqld.cc: - log_10_int moved to mysys (it's used by str_to_TIME and str_to_time) - enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to MYSQL_TIMESTAMP_{TIME,DATE,DATETIME} sql/set_var.cc: - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} sql/set_var.h: - fixed timestamp_type usage to be compatible with typedef. sql/sql_prepare.cc: - TIMESTAMP_{TIME,DATE,DATETIME} were renamed to MYSQL_TIMESTAMP_{TIME,DATE,DATETIME} - embedded library implementation of set_param_{time,date,datetime} is much simplier now, as MYSQL_TIME is the same as TIME. sql/sql_yacc.yy: - s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc sql/structs.h: - declarations for TIME and timestamp_type replaced with typedefs - str_to_datetime arguments moved to mysys headers sql/time.cc: - str_to_time and str_to_TIME moved to mysys - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now exported to client. - str_to_TIME renamed to str_to_datetime to pair with str_to_time - str_to_TIME_with_warn renamed accordingly sql/tztime.cc: - TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} tests/client_test.c: - a test case for Bug#4030 "Client side conversion string -> date type doesn't work (prepared statements)"
* Fixes to make client_test run on 64 bit Sun: a bug in libmysql and unknown2004-06-221-21/+44
| | | | | | | | | | | | | test suite fixed. libmysql/libmysql.c: - fixed a bug in protocol -> host integer conversions in send_data_str tests/client_test.c: Fixes to make client_test run on 64 bit Sun: - strlen() doesn't accept NULL input - Sun is high byte first, so we can't store bind 32-bit variables to 16-bit to MYSQL_TYPE_SHORT/TINY
* - automatic dependency tracking for client_test enabledunknown2004-06-221-1/+0
|
* Fix for bug#4236 "Server crash on attempt to execute non-preparedunknown2004-06-221-0/+30
| | | | | | | | statement": check that statement is not null when accessing it's name. tests/client_test.c: A test case for bug#4236
* Compilation error on AIX (IBM C Compiler Version 6) fixed.unknown2004-06-161-1/+1
|
* Fix for Bug#4079 "error checking in prepared statements": unknown2004-06-111-0/+44
| | | | | | | | | | reset mysql->status if there was an error in row reading. libmysql/libmysql.c: Fix for bug#4079 tests/client_test.c: Test for bug #4079
* Proposed fix for Bug#4026 "Microseconds part of TIME/DATETIME types unknown2004-06-091-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* mysql_stmt_field_count()unknown2004-06-061-0/+1
| | | | | | | | | | | | include/mysql.h: mysql_stmt_field_count() declaration libmysql/libmysql.c: added mysql_stmt_field_count(): we need this function to ease use of mysql_stmt_result_metadata: if mysql_stmt_field_count() != 0 mysql_stmt_result_metadata fails only if OOM. libmysql/libmysql.def: declaration for mysql_stmt_field_count()
* Few more cleanups in client_test:unknown2004-06-051-264/+13
| | | | | | | | No need for mysql_commit, especially after DDL statements. tests/client_test.c: No need for mysql_commit, especially after DDL statements.
* The comment is not true any more. unknown2004-06-051-6/+0
| | | | | | | Is there a way to sefely use MYSQL_BIND structure without bzero?
* HAVE_DEPRECATED_411_API macro removed.unknown2004-06-041-3275/+3382
| | | | | | | | | include/mysql.h: Removed obsolete define. tests/client_test.c: Rewritten to use new API. Few cleanups. A lot of valgrind warnings/errors removed.
* Fix for Bug#3796 "Prepared statement, select concat(<parameter>,<column>), ↵unknown2004-05-311-3/+87
| | | | | | | | | | | | | | | | | | wrong result": new Item_param member for use in val_str() sql/item.cc: Fix for Bug#3796: - return str_value_ptr from val_str to prevent modifications of parameter value. sql/item.h: Fix for bug#3796: - Item::val_str() method semantics documented - new member of Item_param tests/client_test.c: Test case for bug #3796 added. A few compile-time warnings removed.
* Support for character set conversion in binary protocol: another gounknown2004-05-251-7/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).