Commit graph

2951 commits

Author SHA1 Message Date
unknown
b920ab261e 4 small items in this:
- when we don't have in_addr_t, use uint32.
- a forgotten initialization of slave_proxy_id in sql/log_event.cc (was not really "forgot", was
"we needn't init it there", but there was one case where we needed...).
- made slave_proxy_id always meaningful in THD and Log_event, so we can
rely more on it (no need to test if it's meaningful). THD::slave_proxy_id
is equal to THD::thread_id except for the slave SQL thread.
- clean up the slave's temporary table (i.e. free their memory) when slave
server shuts down.


extra/resolveip.c:
  removed #define as it is simpler to put it in my_net.h
  (because we need the #define elsewhere)
include/my_net.h:
  When in_addr_t is not defined, use uint32.
libmysql/libmysql.c:
  using in_addr_t is more generic.
libmysql/manager.c:
  using in_addr_t is more generic.
mysql-test/t/rpl_chain_temp_table.test:
  comments
sql/log_event.cc:
  * Had forgot to initialize slave_proxy_id in the event constructor (char* buf...).
  Initializing is in fact only needed for Create_file_log_event, because
  it uses slave_proxy_id even if it does not write an event to the binlog
  (it uses slave_proxy_id to write it to SQL-LOAD.info).
  * When we write events we now always write slave_proxy_id, which is now always
  meaningful (as thd->slave_proxy_id is now always meaningful, see change in
  sql_class.cc).
sql/mini_client.cc:
  in_addr_t is more generic.
sql/slave.cc:
  A RELAY_LOG_INFO method to free the slave's temporary tables from memory
  at slave's server shutdown.
  It is called by end_slave(), which is called by close_connections(),
  which is called when the server terminates
  (close_connections() is just before clean_up(); putting the call in 
  clean_up() was buggy, as active_mi is already deleted by close_connections().
sql/slave.h:
  new method
sql/sql_class.cc:
  By default we set THD::slave_proxy_id to THD::thread_id,
  so THD::slave_proxy_id is always meaningful (not 0).
  It's always the same as the thread id except for the slave
  SQL thread.
2003-10-31 23:20:23 +01:00
unknown
9396db013a thd->query assignment moved out
of lock scope
2003-10-31 17:03:08 +03:00
unknown
116cf01024 Merge kosipov@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/kostja/mysql/mysql-4.0-root
2003-10-30 21:31:15 +03:00
unknown
1d1bdcc6fe comments about designation of thd->where and
thd->proc_info added


sql/sql_class.h:
  comments about thd->where and thd->proc_info
  added
2003-10-30 21:30:20 +03:00
unknown
8a66a844ce Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
2003-10-30 16:13:38 +01:00
unknown
cee3ddb401 Safety fix for adding service name to search config groups 2003-10-30 01:20:38 +02:00
unknown
7da08881a3 Change back service name to MySQL
Don't add service name to read config file segments if it's "MySQL"
Fixed possible memory leak when CHANGE USER failed.


include/mysql_com.h:
  Change back service name to MySQL (With new, better spelling)
myisam/myisamchk.c:
  Improved --help
sql/mysqld.cc:
  Don't add service name to read config file segments if it's "MySQL"
sql/sql_parse.cc:
  Fixed possible memory leak when CHANGE USER failed.
2003-10-30 01:01:53 +02:00
unknown
03dbf8ccbb Fix for BUG#1686
"If 2 master threads with same-name temp table, slave makes bad binlog"
and (two birds with one stone) for
BUG#1240 "slave of slave breaks when STOP SLAVE was issud on parent slave
and temp tables".

Here is the design change:
in a slave running with --log-slave-updates, events are now logged with the
thread id they had on the master. So no more id conflicts between master threads,
but introduces id conflicts between one master thread and one normal 
client thread connected to the slave. This is solved by storing the server id
in the temp table's name.

New test which requires mysql-test-run to be run with --manager,
otherwise it will be skipped.

Undoing a Monty's change (hum, a chill runs down my spine ;) which was
"Cleanup temporary tables when slave ends" in ChangeSet 1.1572.1.1.


mysql-test/mysql-test-run.sh:
  One new test which needs more than one slave so must be hardcoded in mysql-test-run.sh.
sql/log_event.cc:
  The event needs to carry a slave_proxy_id (which is set at event's creation
  and used at event's logging).
  This is used for events created by ::exec_event() in the slave SQL thread:
  now we want to log these events with the thread id they had on the master.
  This is so that several same-name temp tables simultaneously created on
  the master end up with not the same thread id in the slave's binlog.
sql/log_event.h:
  Query and Load need to carry a slave_proxy_id, like they carried a thread_id
  (to replicate temp tables well).
sql/slave.cc:
  Do not free temp tables in the slave SQL thread. Or they will be lost when
  one does STOP SLAVE / START SLAVE.
  We even save them in rli->save_temporary_tables and set thd->temporary_tables=0
  to prevent them to be freed.
sql/sql_base.cc:
  Put the server id in the table cache key name for temp tables
  (we already put the slave_proxy_id, but we also need the server id
  in case normal clients (not slave threads) are using temp tables
  on the slave).
sql/unireg.h:
  4 more bytes, to store the server id.
2003-10-29 14:23:35 +01:00
unknown
a483fd2191 Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
2003-10-29 14:01:14 +01:00
unknown
5f2611d318 followup to max_user_connections fix, keep the count more accurate 2003-10-29 08:33:31 +01:00
unknown
b11f9c1053 Fix for problem of installing MySQL as a service with
mysql --install mysql --defualts-file=path-to-file
(Bug #1643)


include/mysql_com.h:
  MySQL should install as default service "mysqld"
sql/mysqld.cc:
  Fix for problem of installing MySQL as a service with
  mysql --install mysql --defualts-file=path-to-file
2003-10-28 18:36:41 +02:00
unknown
8507b00b34 fixes for max_user_connections (connections are now counted even if
max_user_connections is not set - that is no limit - so that when
max_user_connections is set (with SET) old connections are also
taken into account
mutexes are added where appropriate
2003-10-27 15:14:03 +01:00
unknown
033a038296 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.0
into gluh.mysql.r18.ru:/home/gluh/mysql-4.0.pass
2003-10-22 15:38:20 +05:00
unknown
77c89711d2 Bug#1271 - RAND_TABLE_BIT in expression and only const_tables in join 2003-10-21 17:34:40 +02:00
unknown
42de9a3ed9 Fix for bug #1271: Undefined variable in PASSWORD() function is not
handled correctly
2003-10-21 15:14:06 +05:00
unknown
14affe7e2f thr0loc.c, srv0start.c, srv0srv.c, srv0srv.h, os0thread.h, ha_innodb.cc:
Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB


sql/ha_innodb.cc:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
innobase/include/os0thread.h:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
innobase/include/srv0srv.h:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
innobase/srv/srv0srv.c:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
innobase/srv/srv0start.c:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
innobase/thr/thr0loc.c:
  Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
2003-10-17 23:44:34 +03:00
unknown
629ced9d81 Merge oak.local:/home/kostja/mysql/mysql-4.0-root
into oak.local:/home/kostja/mysql/mysql-4.0-1274
2003-10-17 18:44:13 +04:00
unknown
0b8743c1b2 A fix for a random test failure rpl_trunc_binlog: don't RESET MASTER
while the slave is connected.


mysql-test/t/rpl_trunc_binlog.test:
  don't RESET MASTER while the slave is connected; this could confuse the master or slave.
  (In replication you don't RESET MASTER while a slave is connected!)
sql/slave.cc:
  typo
2003-10-17 00:00:25 +02:00
unknown
f1fc5c54eb Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-qc_crash-4.0
2003-10-16 21:17:45 +03:00
unknown
4f936a69a7 Safety fix to detect multiple calls to my_thread_end()
Portability fix (For Mac OS X)


configure.in:
  Added detection of malloc / sys/malloc
include/my_pthread.h:
  Safety fix to detect multiple calls to my_thread_end()
libmysqld/lib_sql.cc:
  Remove duplicate call to my_thread_end()
mysys/charset.c:
  Cleanup indentation
  Remove some short variable names
mysys/my_thr_init.c:
  Safety fix to detect multiple calls to my_thread_end()
sql/sql_test.cc:
  Portability fix (For Mac OS X)
2003-10-16 20:55:15 +03:00
unknown
ca5383cfe5 fix for one of the bugs spotted by #1274
sql/sql_select.cc:
  back to the bug #1274:
  the following query
  EXPLAIN SELECT SQL_CALC_FOUND_ROWS race_name 
  FROM races WHERE race_name LIKE '%Madison%' ORDER BY race_date DESC LIMIT 0,100
  
  +-------+------+---------------+------+---------+------+--------+-----------------------------+
  | table | type | possible_keys | key  | key_len | ref  | rows   | Extra                       |
  +-------+------+---------------+------+---------+------+--------+-----------------------------+
  | races | ALL  | NULL          | NULL |    NULL | NULL | 505821 | Using where; Using filesort |
  +-------+------+---------------+------+---------+------+--------+-----------------------------+
  
  The query returns no rows.
  
  There are two problems with it: 
  - wrong access plan is chosed  (sequential index scan in reverse order,
  which is VERY SLOW in case of MyISAM table + packed keys)
  It's wrong, because it doesn't take into account that SQL_CALC_FOUND_ROWS 
  is present, in other words, is based on assumtion that LIMIT
  clause decrease number of rows to access significantly, which is
  not true as all rows are accessed.
  - the access plan is not shown in the EXPLAIN (bug #1560). I'm not
  fixing it here
2003-10-16 17:00:09 +04:00
unknown
0b45b5c632 Changing max_insert_delayed_threads now also changes the size of thread alarm buffer. 2003-10-16 07:44:18 +03:00
unknown
b06eb4d81a Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
Fixed chsize() problem on windows
Extend default timeout on windows clients to 1 year (to avoid timeout problems)


include/mysql.h:
  Added client timeouts (for TCP/IP)
libmysql/libmysql.c:
  Added client timeouts (for TCP/IP)
mysql-test/r/create.result:
  More tests for CREATE TABLE IF NOT EXISTS ... SELECT
mysql-test/t/create.test:
  More tests for CREATE TABLE IF NOT EXISTS ... SELECT
mysys/my_chsize.c:
  Fix for windows
sql/handler.h:
  Remove not used field 'if_not_exists'
  Ordered fields to be more optimized for new CPU's
  Added field 'table_existed'
sql/slave.cc:
  Cleanup temporary tables when slave ends
sql/sql_class.h:
  Remove not used 'do_not_drop' field
sql/sql_insert.cc:
  Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
sql/sql_table.cc:
  Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
2003-10-15 21:41:13 +03:00
unknown
60fb31ddec Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mashka.mysql.fi:/home/my/mysql-4.0


sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2003-10-15 16:23:01 +03:00
unknown
4f5887b22d Add more information about memory usage to debug log
sql/sql_test.cc:
  Add more information about memory usage
2003-10-15 15:21:50 +03:00
unknown
d1ed51db82 Fixed bug in SET enum_system_variable=NULL
BitKeeper/etc/ignore:
  added scripts/make_sharedlib_distribution
mysql-test/r/variables.result:
  Add test for enum_system_variable=NULL
mysql-test/t/variables.test:
  Add test for enum_system_variable=NULL
sql/set_var.cc:
  Fixed bug in SET enum_system_variable=NULL
  Moved some array elements to get result sorted
2003-10-14 16:30:42 +03:00
unknown
aa22ba81fc make LOCK TABLES to work when Lock_tables_priv is granted on the DB level and Select_priv is granted on the table level. 2003-10-14 13:10:41 +02:00
unknown
83f5a6a34f Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0


sql/slave.cc:
  Auto merged
2003-10-14 00:27:04 +02:00
unknown
74ea459412 Add new user variables for tuning memory usage:
query_alloc_block_size, query_prealloc_size, range_alloc_block_size,transaction_alloc_block_size and transaction_prealloc_size
Add more checks for "out of memory" detection in range optimization


configure.in:
  Added detection of mallinfo
mysql-test/r/variables.result:
  Test of new variables
mysql-test/t/variables.test:
  Test of new variables
sql/ha_berkeley.cc:
  Use init_sql_alloc instead of init_alloc_root for better OOM detection
sql/log_event.cc:
  Add new user variables for tuning memory usage
sql/mysql_priv.h:
  Add new user variables for tuning memory usage
sql/mysqld.cc:
  Add new user variables for tuning memory usage
sql/opt_ft.cc:
  Add new user variables for tuning memory usage
sql/opt_ft.h:
  Add new user variables for tuning memory usage
sql/opt_range.cc:
  Add new user variables for tuning memory usage
  Add more checks for out of memory conditions
sql/opt_range.h:
  Add new user variables for tuning memory usage
sql/set_var.cc:
  Add new user variables for tuning memory usage
sql/sql_acl.cc:
  Add new user variables for tuning memory usage
sql/sql_class.h:
  Add new user variables for tuning memory usage
sql/sql_delete.cc:
  Add new user variables for tuning memory usage
sql/sql_parse.cc:
  Add new user variables for tuning memory usage
sql/sql_select.cc:
  Add new user variables for tuning memory usage
sql/sql_test.cc:
  Add information about memory useage if system supports mallinfo()
sql/sql_udf.cc:
  Add new user variables for tuning memory usage
sql/sql_update.cc:
  Add new user variables for tuning memory usage
sql/table.cc:
  Add new user variables for tuning memory usage
2003-10-11 22:00:24 +03:00
unknown
7e1a1032e8 Make the slave die if master is 5.0. Indeed, 5.0 masters send
a Format_description_log_event (or maybe it will be named
Description_log_event) which is not recognized by 4.0, so
a 4.0 can't be a slave of 5.0. We detect it early to produce
a helpful message instead of "corrupted relay log" later.


sql/slave.cc:
  Make the slave die if master is 5.0.
2003-10-09 17:40:38 +02:00
unknown
08bb033b53 merged
mysql-test/r/create.result:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2003-10-07 20:41:07 +02:00
unknown
cd6dc42fdf Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_1323/mysql-4.0
2003-10-07 14:41:04 -04:00
unknown
bc4a57f01a After merge fixes
extra/resolveip.c:
  After merge fix
mysql-test/mysql-test-run.sh:
  Fixed comment
mysql-test/r/rpl_trunc_binlog.result:
  Updated results
sql/log_event.cc:
  Better (shorter) error message
2003-10-07 00:23:29 +03:00
unknown
e86fc82cf2 bug #1434 (and related issues) 2003-10-06 20:02:27 +02:00
unknown
08a08a67db fix_max_connections to resize alarm_queue (Bug #1435)
include/queues.h:
  resize_queue()
include/thr_alarm.h:
  resize_thr_alarm() to resize alarm_queue
mysys/queues.c:
  resize_queue()
mysys/thr_alarm.c:
  resize_thr_alarm() to resize alarm_queue
2003-10-06 14:11:16 +02:00
unknown
08504cfe27 Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0


scripts/mysql_config.sh:
  Auto merged
sql/mysqld.cc:
  Auto merged
2003-10-06 09:24:12 +02:00
unknown
63ed77ca1d Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_1323/mysql-4.0
2003-10-03 17:55:57 -04:00
unknown
496bc77694 Fixed bug #1323 (varchar fields becoming char fields adter create ... select) 2003-10-03 17:54:32 -04:00
unknown
179700e3f3 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
2003-10-03 22:18:34 +02:00
unknown
1bd7662b89 When the I/O thread was stopped while copying a long transaction, and restarted,
Rotate_log_event::exec_event() believed that the relay log was corrupted. Fixed it
by moving the test for corruption to Start_log_event::exec_event(). 
Changed Rotate_log_event::exec_event() to not increment positions when the
event is seen in the middle of a transaction.
I did a separate commit in 4.1 (so this should not be merged to 4.0) because
code is a bit different in 4.1.
A test to see if the slave detects when the master died while writing a 
transaction to the binlog (uses a forged truncated binlog I made).


sql/log_event.cc:
  When the I/O thread was stopped while copying a long transaction, and restarted,
  Rotate_log_event::exec_event() believed that the relay log was corrupted. Fixed it
  by moving the test for corruption to Start_log_event::exec_event(). 
  Changed Rotate_log_event::exec_event() to not increment positions when the
  event is seen in the middle of a transaction.
2003-10-03 22:13:01 +02:00
unknown
0adf47e67a Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mishka.mysql.fi:/home/my/mysql-4.0
2003-10-03 00:42:47 +03:00
unknown
2985e91acd Optimized code for setting user variables with := and fixed some bugs in old code (Bug #1194)
Use forced close of socket to make mysqld shutdown faster when used under valgrind


mysql-test/mysql-test-run.sh:
  Added --skip-bdb for valgrind
mysql-test/r/user_var.result:
  Extended test for user variables
mysql-test/t/user_var.test:
  Extended test for user variables
sql/item_func.cc:
  Optimized code for setting user variables with := and fixed some bugs in old code
sql/item_func.h:
  Optimized code for setting user variables
sql/log.cc:
  Fixed comments
sql/mysqld.cc:
  Use forced close of socket to make mysqld shutdown faster when used under valgrind
sql/sql_class.h:
  Optimized code for setting user variables
2003-10-03 00:40:27 +03:00
unknown
7a58bfee61 Reverting changeset 1.1590
sql/slave.h:
  Reverting changeset 1.1590.
2003-10-02 16:25:47 +02:00
unknown
fd9031547e Merge laptop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.0
into laptop.sanja.is.com.ua:/home/bell/mysql/bk/work-qc_crash-4.0
2003-10-02 16:33:50 +03:00
unknown
904dee7a97 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
2003-10-01 18:46:24 +02:00
unknown
3258587258 Follow-up of an IRC discussion today. Declaring ignore_log_space_limit volatile,
and a comment to explain why.


sql/slave.h:
  Declaring ignore_log_space_limit volatile,
  and a comment to explain why.
2003-10-01 18:40:27 +02:00
unknown
866a3ada7b Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_1194/mysql-4.0
2003-10-01 12:22:30 -04:00
unknown
d7e308c667 turn Item_func_set_user_var
::native_val, ::native_val_int and native_val_str into inline
2003-10-01 12:00:08 -04:00
unknown
de6a1085eb rewrite Item_func_set_user_var ::val, ::val_str, ::val_int, ::update
with less code duplication
2003-09-30 12:32:48 -04:00
unknown
ad0a7a3034 - enable changing the number of table bits for JOINs to be increased
from ulong to ulonglong by defining -DBIG_JOINS


sql/mysql_priv.h:
   - enable changing the number of table bits for JOINs to be increased
     from ulong to ulonglong by defining BIG_JOINS
2003-09-29 12:01:10 +02:00