Commit graph

278 commits

Author SHA1 Message Date
kaa@kaamos.(none)
0a7052e4d3 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-03-12 11:19:46 +03:00
davi@mysql.com/endora.local
41545137ef Bug#34655 Compile error
Rename client_last_error to last_error and client_last_errno to last_errno
to not break connectors which use the internal net structure for error handling.
2008-02-28 14:55:46 -03:00
holyfoot/hf@hfmain.(none)
2356e0df6e Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/25097/my51-25097
2008-02-27 13:54:34 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
fbc4562331 merging 2008-02-27 13:30:49 +04:00
holyfoot/hf@hfmain.(none)
b727a22d97 Merge mysql.com:/home/hf/work/25097/my50-25097
into  mysql.com:/home/hf/work/25097/my51-25097
2008-02-27 13:00:59 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
140ca59538 Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
There was no way to return an error from the client library
if no MYSQL connections was established.
So here i added variables to store that king of errors and
made functions like mysql_error(NULL) to return these.
2008-02-27 12:42:43 +04:00
serg@janus.mylan
d9ca7b670e Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-12-20 22:11:37 +01:00
cmiller@zippy.cornsilk.net
edbacd3a99 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2007-12-14 13:42:09 -05:00
cmiller@zippy.cornsilk.net
79bb729e54 Add profiling support for embedded server. 2007-12-14 09:39:57 -05:00
anozdrin/alik@station.
151444c626 Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt
2007-12-14 16:30:22 +03:00
kostja@bodhi.(none)
5b80d6a11b Fix broken embedded build (broken by the patch for Bug#12713, first part). 2007-12-13 23:58:55 +03:00
kostja@bodhi.(none)
ebb9c5d983 Bug#12713 "Error in a stored function called from a SELECT doesn't
cause ROLLBACK of statement", part 1. Review fixes.

Do not send OK/EOF packets to the client until we reached the end of 
the current statement.
This is a consolidation, to keep the functionality that is shared by all 
SQL statements in one place in the server.
Currently this functionality includes:
- close_thread_tables()
- log_slow_statement().

After this patch and the subsequent patch for Bug#12713, it shall also include:
- ha_autocommit_or_rollback()
- net_end_statement()
- query_cache_end_of_result().

In future it may also include:
- mysql_reset_thd_for_next_command().
2007-12-12 18:21:01 +03:00
holyfoot/hf@hfmain.(none)
901dc028f9 Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/26921/my51-26921
2007-12-07 10:10:02 +04:00
holyfoot/hf@hfmain.(none)
d26de7bee0 Merge mysql.com:/home/hf/work/26921/my50-26921
into  mysql.com:/home/hf/work/26921/my51-26921
2007-12-07 09:39:31 +04:00
holyfoot/hf@hfmain.(none)
34de307073 Merge mysql.com:/home/hf/work/mrg/my50-mrg
into  mysql.com:/home/hf/work/mrg/my51-mrg
2007-12-01 00:46:44 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
5a6161dea4 Bug #26921 Problem in mysql_insert_id() Embedded C API function.
client library only sets mysql->insert_id when query returned
no recordset. So the embedded library should behave the same way
2007-11-30 19:16:13 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
9786ccd0a0 Bug #32624 Error with multi queries in MySQL embedded server 5.1.22.
server status wasn't properly sent to the client after the error
by the embedded server. Wasn't noticed before as one usually stopped
retrieving results after he gets an error.
2007-11-29 10:37:07 +04:00
holyfoot/hf@hfmain.(none)
7435683dbf Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/31868/my51-31868
2007-11-20 14:35:49 +04:00
istruewing@stella.local
5f206cb372 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  stella.local:/home2/mydev/mysql-5.1-bug31210
2007-11-13 10:33:50 +01:00
holyfoot/hf@mysql.com/hfmain.(none)
18f832a708 Bug #31868 mysql_server_init crash when language path is not correctly set.
When mysql_server_init() interrupts on some error (wrong errmsg file
for example) in the middle of it's execution, it doesn't call
execute_ddl_log_recovery() so LOCK_gdl mutex isn't init-ed.
In this case we shouldn't execute release_ddl_log during cleanup
as it uses that mutex inside.
2007-11-13 13:09:59 +04:00
mattiasj@mattiasj-laptop.(none)
32d7dd8679 Merge mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-main
into  mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-last_with_main
2007-11-12 21:09:48 +01:00
istruewing@stella.local
b05471de73 Bug#31210 - INSERT DELAYED crashes server when used on
partitioned table
    
Post-pushbuild fix
    
Pushbuild detected yet another need for lex initialization in
embedded server.
2007-11-12 13:07:54 +01:00
istruewing@stella.local
e2cc172d35 Bug#31210 - INSERT DELAYED crashes server when used on
partitioned table
  
Post-pushbuild fix
  
Pushbuild detected a new need for lex initialization in
embedded server.

Fixed test for INSERT DELAYED in partitions_hash.test so that
it works with embedded server.
2007-11-11 20:38:28 +01:00
kostja@bodhi.(none)
96f8d086f8 Cleanup: use helper functions to set an error in MYSQL or MYSQL_STMT.
No functionality added or changed.
This is a pre-requisite for the fix for Bug#12713 Error in a stored 
function called from a SELECT doesn't cause ROLLBACK of statem

Address post-review comments.
2007-10-31 17:16:53 +03:00
malff@lambda.hsd1.co.comcast.net.
190bb6bf4c Fixed packet length for embedded tests 2007-10-09 18:12:13 -06:00
tsmith@ramayana.hindu.god
2c44def1ee Bug #30389: connection_id() always return 0 in embedded server
Initialize thd->variables.pseudo_thread_id when a new embedded
thd is created.
2007-08-27 14:31:27 -06:00
monty@mysql.com/narttu.mysql.fi
9b6b53f0d0 Fixed errors found by pushbuild:
Fixed failing func_misc test for embedded server
Added casts to avoid compiler warnings
Removed Table_locks_immediate as it's depending on log file cacheing
Changed type of get_time() to avoid warnings
Removed testing if purger master logs succeded as this is not deterministic
2007-08-16 16:47:31 +03:00
kent@mysql.com/kent-amd64.(none)
10778d6fe2 Makefile.am:
Add CMakeLists.txt to source distribution
CMakeLists.txt:
  Added missing '${MYSQLD_EXE_SUFFIX}' to "mysqld" targets new in 5.1
  Manual merge from 5.0 (bug#30118)
CMakeLists.txt, mysqlbinlog.cc, lib_sql.cc:
  No need to test on USING_CMAKE, it is the only Windows build
2007-08-02 15:37:33 +02:00
joerg@trift2.
36adff6d0d Merge trift2.:/MySQL/M41/tmp-4.1
into  trift2.:/MySQL/M50/merge-5.0
2007-06-13 13:55:42 +02:00
joerg@trift2.
2d718ff1c2 Add a cast, needed by some platforms.
Still part of the fix for bug#27078.
2007-06-08 17:02:48 +02:00
joerg@trift2.
ab64b2f8f3 Do not use the "thd" pointer to identify a thread in the embedded lib,
but rather use the "thread_id" counter.

Fixes bug#27078:
Compile error: lib_sql.cc cast from 'THD*' to 'pthread_t' loses precision
2007-06-07 23:05:18 +02:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
guilhem@gbichot3.local
8efe1b1fae manual merge 2007-03-09 16:06:08 +01:00
holyfoot/hf@mysql.com/hfmain.(none)
e46972348a bug #25492 (Invalid deallocation in mysql_stmt_fetch())
Additional patch.
mysql_flush_use_result() fixed.
2007-03-05 11:35:04 +04:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
holyfoot/hf@mysql.com/hfmain.(none)
0004fa3c5b bug #25492 (Invalid deallocation in mysql_stmt_fetch) 2007-02-13 00:55:45 +04:00
jani@a88-113-38-195.elisa-laajakaista.fi
cd75806b61 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1
2007-02-03 00:58:09 +02:00
guilhem@gbichot3.local
be389f62de Mechanical class renaming:
Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary
and also THD::protocol_simple->THD::protocol_text,
THD::protocol_prep->THD::protocol_binary.
Reason: the binary protocol is not bound to be used only with
prepared statements long term (see WL#3559 "Decouple binary protocol
from prepared statements"). Renaming now is pressing because
the fix for BUG#735 "Prepared Statements: there is
no support for Query Cache" will introduce a new member
in class Query_cache_flags telling about the protocol's nature.
Other reason: "simple" is less accurate than "text".
Future patches for BUG#735 will rely on this cset.
2007-01-30 22:48:05 +01:00
holyfoot/hf@mysql.com/hfmain.(none)
e3f4f02b64 bug #25492 (Invalid deallocation in mysql_stmt_fetch)
Operating with the prepared statements we don't alloc MYSQL_DATA structure,
but use MYSQL_STMT's field instead (to increase performance by reducing
malloc calls).
So we shouldn't free this structure as we did before.
2007-01-29 11:48:31 +04:00
df@kahlann.erinye.com
a4208cdc1c BUG#25890 put previous fix in better place 2007-01-27 21:26:28 +01:00
df@kahlann.erinye.com
26c6d2d231 BUG#25895 compiling the server with embedded fails on several 64-bit platforms
temporary fix
2007-01-27 20:16:15 +01:00
df@kahlann.erinye.com
508d7da976 BUG#25890 mysqltest_embedded crashes on start
very temporary fix
2007-01-27 13:12:59 +01:00
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
holyfoot/hf@hfmain.(none)
f95e387212 Merge mysql.com:/d2/hf/common/my50-common
into  mysql.com:/d2/hf/common/my51-common
2007-01-03 02:43:59 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
988e2e4cad Merge mysql.com:/d2/hf/common/my41-common
into  mysql.com:/d2/hf/common/my50-common
2007-01-03 02:43:27 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
12cd7c7b3e warning count for embedded prepared statements added 2007-01-03 02:41:14 +04:00
holyfoot/hf@hfmain.(none)
e6b3a71cc0 Merge mysql.com:/d2/hf/common/my50-common
into  mysql.com:/d2/hf/common/my51-common
2007-01-02 17:55:18 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
429b82bed3 Merge mysql.com:/d2/hf/common/my41-common
into  mysql.com:/d2/hf/common/my50-common
2007-01-02 17:54:38 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
e7130631cb merging fix 2007-01-02 17:53:55 +04:00