Commit graph

221 commits

Author SHA1 Message Date
unknown
8c391e7c2c A test case for Bug#6046: no fix is needed (the bug is already
fixed in the main tree).
2004-10-22 15:59:59 +04:00
unknown
c8ad5215ea Manual merge.
sql/sql_class.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
tests/client_test.c:
  Manual merge
2004-10-21 18:44:40 +04:00
unknown
506f648b3a A fix and test case 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).


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"
2004-10-21 18:33:53 +04:00
unknown
7c20b13288 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
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
2004-10-20 16:45:09 +04:00
unknown
8fe8912f4c A fix and test case 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.


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.
2004-10-20 16:43:36 +04:00
unknown
4736d0fe99 Review of all code pushed since last review
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)
2004-10-20 01:28:42 +03:00
unknown
9aefc403f9 A fix and test case for Bug#6049 "Loss of sign when using prepared
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.
2004-10-16 00:12:59 +04:00
unknown
ba48e6f9aa tests/client_test.c:
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();
2004-10-13 19:27:07 +04:00
unknown
69b6adbd58 Makefile.am, client_test.test, mysql-test-run.sh:
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
2004-10-08 01:39:20 +02:00
unknown
8fa6f37a29 A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
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.
2004-10-08 02:21:19 +04:00
unknown
656bcff63e client_test.test:
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
2004-09-28 16:27:50 +02:00
unknown
542096df9e Merge
tests/client_test.c:
  SCCS merged
2004-09-25 10:34:54 +02:00
unknown
c14ec245ee 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().
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().
2004-09-25 10:30:36 +02:00
unknown
f2821fa13c fix client_test to be a bit faster under valgrind. 2004-09-23 20:38:18 +04:00
unknown
ccf52b4fd5 A fix and test case for Bug#5315 "mysql_change_user() doesn't free
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".
2004-09-22 15:50:07 +04:00
unknown
a7ad88a41a Fix the test case for bug#4231 (which before was passing just by occasion) 2004-09-15 02:43:17 +04:00
unknown
7226dc5155 Syntax correction for bug#5560.
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).
2004-09-14 09:46:05 +02:00
unknown
50f9e2f581 client_test.c:
fix typos noticed while poking around in test program.


tests/client_test.c:
  fix typos noticed while poking around in test program.
2004-09-08 20:13:27 -05:00
unknown
d7a230677c A fix and test case for Bug#5194 "Bulk Insert Failures with Prepared
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".
2004-09-08 23:07:11 +04:00
unknown
e5af92b0d2 A fix and test case for bug#5399 "Wrong statement executed by MySQL
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.
2004-09-08 12:33:05 +04:00
unknown
c91fb13641 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1


sql/sql_prepare.cc:
  Auto merged
tests/client_test.c:
  Auto merged
2004-09-03 02:26:00 +03:00
unknown
0c58737ad6 A fix and test case 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.


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"
2004-09-02 20:16:01 +04:00
unknown
a88ab457e3 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1


sql/sql_select.cc:
  Auto merged
tests/client_test.c:
  Auto merged
2004-09-02 16:58:01 +03:00
unknown
762bee96d2 After merge fixes
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
2004-09-02 16:57:26 +03:00
unknown
acd1321956 Make client_test pass on 64-bit HP-UX11: long is 64 bit,
replace all (mis)uses of it with int32.
2004-09-01 12:50:23 +04:00
unknown
ce91cbb867 A short fix and test case for Bug#5126
"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
2004-08-26 22:47:34 +04:00
unknown
82257f94f4 after merge
sql/item_row.cc:
  ds20 compat fix
2004-08-26 18:22:22 +02:00
unknown
f47a0b9f29 Cleanup in libmysql.
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.
2004-08-05 02:43:18 -07:00
unknown
13b09b10df Type of MYSQL_BIND::buffer changed to void * 2004-06-25 17:04:33 +04:00
unknown
57ee2443ea - fixed test_frm_bug test to work with increased number of columns in
result of SHOW TABLE STATUS


BitKeeper/etc/ignore:
  added libmysqld/my_time.c
2004-06-24 20:08:42 +04:00
unknown
9dde418895 Fix for Bug#4030 "Client side conversion string -> date type doesn't
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)"
2004-06-24 19:08:36 +04:00
unknown
83698bab08 Fixes to make client_test run on 64 bit Sun: a bug in libmysql and
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
2004-06-22 23:07:08 +04:00
unknown
cca9bcd6d7 - automatic dependency tracking for client_test enabled 2004-06-22 14:47:41 +04:00
unknown
8efd5089c0 Fix for bug#4236 "Server crash on attempt to execute non-prepared
statement": check that statement is not null when accessing it's name.


tests/client_test.c:
  A test case for bug#4236
2004-06-22 11:04:41 +04:00
unknown
95325f1354 Compilation error on AIX (IBM C Compiler Version 6) fixed. 2004-06-16 11:29:22 +04:00
unknown
4047b5ade3 Fix for Bug#4079 "error checking in prepared statements":
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
2004-06-11 13:12:29 +04:00
unknown
27eda71204 Proposed fix for Bug#4026 "Microseconds part of TIME/DATETIME types
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
2004-06-09 03:21:50 +04:00
unknown
5cc410bb70 mysql_stmt_field_count()
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()
2004-06-06 02:27:05 +04:00
unknown
0fc147494a Few more cleanups in client_test:
No need for mysql_commit, especially after DDL statements.


tests/client_test.c:
  No need for mysql_commit, especially after DDL statements.
2004-06-05 03:09:53 +04:00
unknown
cfdb7ae67c The comment is not true any more.
Is there a way to sefely use MYSQL_BIND structure without bzero?
2004-06-05 02:56:50 +04:00
unknown
1407f2f0a8 HAVE_DEPRECATED_411_API macro removed.
include/mysql.h:
  Removed obsolete define.
tests/client_test.c:
  Rewritten to use new API.
  Few cleanups.
  A lot of valgrind warnings/errors removed.
2004-06-04 18:38:18 +04:00
unknown
7f1303329d Fix for Bug#3796 "Prepared statement, select concat(<parameter>,<column>), 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.
2004-05-31 14:21:48 +04:00
unknown
093d62922b Support for character set conversion in binary protocol: another go
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).
2004-05-25 02:03:49 +04:00
unknown
e9aa3e361a assigning max_length parameter for Item_param (Bug #3811)
sql/item.cc:
  assigning max_length/decimal parameter for Item_param
tests/client_test.c:
  layout fixed
  test suite for bug
2004-05-20 19:08:34 +03:00
unknown
c907e6fd5c Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.ps


sql/sql_parse.cc:
  Auto merged
tests/client_test.c:
  Auto merged
2004-05-19 10:28:24 +05:00
unknown
a41883facf Portability fixes
Fixed wrong number of warnings/duplicates for machines with high-byte-first


client/mysql.cc:
  Remove not used variables
client/mysqltest.c:
  Remove double ;
myisam/ft_nlq_search.c:
  Fix valgrind error (not fatal)
myisam/rt_test.c:
  Portability fix
mysql-test/r/rpl_trunc_binlog.result:
  Portability fix
mysql-test/t/rpl_trunc_binlog.test:
  Portability fix
  (Column 23 was different on openbsd)
sql/sql_insert.cc:
  Fixed wrong number of warnings/duplicates for machines with high-byte-first
strings/ctype-big5.c:
  Portability fix
strings/ctype-gbk.c:
  Portability fix
strings/ctype-mb.c:
  Portability fix
strings/ctype-uca.c:
  Portability fix
tests/client_test.c:
  Portability fixes
2004-05-19 05:09:10 +03:00
unknown
84cf2d8f78 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.ps


sql/sql_parse.cc:
  Auto merged
tests/client_test.c:
  Auto merged
2004-05-17 18:45:50 +05:00
unknown
05cd698f54 Fixes for #3371, #3372, #3374, #3375, #3376
libmysql/libmysql.c:
  code to fix #3772
  counting of field->max_length moved to mysql_store_stmt_result so
  it will work in libmysqld also
libmysqld/lib_sql.cc:
  to fix #3771 and #3775
  stmt->affected_rows specifying added
  code getting default values changed so it will add terminating /0 to
  values
sql/sql_parse.cc:
  to fix #3773
  silly mistake here :\
sql/sql_prepare.cc:
  to fix #3774 and #3776
  special function for datetime values in embedded server added
  unsigned flag now specified for values in embedded server
tests/client_test.c:
  this test fails if privilege-checking pars are disabled
  (it's the default for libmysqld)
2004-05-15 17:07:44 +05:00
unknown
c9667f1146 Better fix for bug #3749 (bug in deleting automatic generated foreign keys)
mysql-test/r/func_encrypt.result:
  Update tests (left after sanjas last push)
mysql-test/r/innodb.result:
  Added test for bug #3749 (bug in deleting automatic generated foreign keys)
mysql-test/t/innodb.test:
  Added test for bug #3749 (bug in deleting automatic generated foreign keys)
sql/sql_class.cc:
  Updated comment
tests/client_test.c:
  Added missing mysql_stmt_close()
2004-05-15 11:57:40 +03:00
unknown
f71f59731b treat parameter as constant in ORDER BY check of fields in SELECT list(Bug #3686)
sql/sql_select.cc:
  treat parameter as constant in ORDER BY check of fields in SELECT list
tests/client_test.c:
  test of using parameters in SELECT list with ORDER BY
2004-05-10 13:29:02 +03:00