Commit graph

1660 commits

Author SHA1 Message Date
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
eb415e4920 fix for bug #19690: ORDER BY eliminates rows from the result
Depending on the queries we use different data processing methods
and can lose some data in case of double (and decimal in 4.1) fields.

The fix consists of two parts:
1. double comparison changed, now double a is equal to double b 
if (a-b) is less than 5*0.1^(1 + max(a->decimals, b->decimals)). 
For example, if a->decimals==1, b->decimals==2, a==b if (a-b)<0.005
2. if we use a temporary table, store double values there as is 
to avoid any data conversion (rounding).
2007-01-31 09:51:05 +04:00
mtaylor@qualinost.(none)
c4db290104 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  qualinost.(none):/home/mtaylor/src/mysql-5.1-new-maint
2007-01-29 12:30:48 -05:00
msvensson@pilot.mysql.com
5c717b080f Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my41-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/mysql-4.1-maint
2007-01-29 16:19:59 +01:00
msvensson@pilot.mysql.com
07df8fd469 Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
2007-01-29 16:12:12 +01:00
msvensson@pilot.mysql.com
719a8f5896 Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/bug22943/my51-bug22943
2007-01-29 14:35:09 +01:00
msvensson@pilot.mysql.com
007d170ad2 Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my41-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
2007-01-29 14:33:53 +01:00
msvensson@pilot.mysql.com
7eaa82ea38 Bug#22943 syscall pruning in libmysql
- Set the timeout values only where needed
2007-01-29 14:31:48 +01:00
serg@janus.mylan
a07fd5fa8f WL#3700: Handler API change: all index search methods - that is,
index_read(), index_read_idx(), index_read_last(), and
records_in_range() - instead of 'uint keylen' argument take
'ulonglong keypart_map', a bitmap showing which keyparts are
present in the key value.
Fallback method is provided for handlers that are lagging behind.
2007-01-29 10:40:26 +01:00
monty@narttu.mysql.fi
bb464613ce Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-01-29 01:57:07 +02: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
mtaylor@qualinost.(none)
b7a7d3f7c6 Merge qualinost.(none):/home/mtaylor/src/mysql-5.0-maint
into  qualinost.(none):/home/mtaylor/src/mysql-5.1-new-maint
2007-01-26 13:11:10 -08:00
cmiller@zippy.cornsilk.net
f74992258a Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-m,c-gca
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-01-26 14:47:35 -05:00
cmiller@zippy.cornsilk.net
41179e6a8f Bug #25879: THD::options isn't set with ulonglong values and \
variables

Bits higher than 2**31 were impossible to set on THD::options.  It's
probably a remnant from a time when options was a 32-bit integer.

Now, use unsigned long-long constants and variables to set and clear
THD::options.
---
Pulled comments back to column 49.
2007-01-26 14:47:12 -05:00
sergefp@pylon.mylan
5bc7d596cc Merge mysql.com:/home/psergey/mysql-5.0-bug8804-r12
into  mysql.com:/home/psergey/mysql-5.1-bug8804-r12-merge
2007-01-24 22:28:28 +03:00
sergefp@mysql.com
e2f0f4dbd3 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug8804-r12
2007-01-24 19:13:28 +03:00
gluh@eagle.(none)
7b291e36cf Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-01-24 19:54:40 +04:00
gkodinov/kgeorge@macbook.gmz
17a0207ece Merge macbook.gmz:/Users/kgeorge/mysql/work/mysql-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/merge-5.1-opt
2007-01-23 12:34:50 +02:00
gluh@mysql.com/eagle.(none)
e34b0056f2 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-01-23 14:08:58 +04: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
igor@olga.mysql.com
3c814f2243 Fixed bug #25219: crash for a query that contains an EXIST subquery with
UNION over correlated and uncorrelated SELECTS.
In such subqueries each uncorrelated SELECT should be considered as
uncacheable. Otherwise join_free is called for it and in many cases
it causes some problems.
2007-01-19 00:17:28 -08:00
cbell/Chuck@mysql_cab_desk.
38802b7185 Merge mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.1_BUG_21490
2007-01-18 18:23:25 -05:00
cbell/Chuck@mysql_cab_desk.
ab8200aed8 Merge mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.0_BUG_21490
2007-01-18 17:29:40 -05:00
cbell/Chuck@mysql_cab_desk.
fc0adebe0e BUG#21490 - No warning issued for deprecated replication parameters
This patch deprecates the replication startup options in the configuration
file and on the command line. The options deprecated include:

MASTER_HOST, MASTER_USER, MASTER_PASSWORD, MASTER_PORT, MASTER_CONNECT_RETRY,
MASTER_SSL, MASTER_SSL_CA, MASTER_SSL_CAPATH, MASTER_SSL_CERT, MASTER_SSL_KEY,
and MASTER_SSL_CIPHER

The code is designed to print the warning message once.
2007-01-18 13:35:49 -05:00
cbell/Chuck@mysql_cab_desk.
6ace488920 BUG#21490 - No warning issued for deprecated replication parameters
This patch deprecates the replication startup options in the configuration
file and on the command line. The options deprecated include:

MASTER_HOST, MASTER_USER, MASTER_PASSWORD, MASTER_PORT, MASTER_CONNECT_RETRY,
MASTER_SSL, MASTER_SSL_CA, MASTER_SSL_CAPATH, MASTER_SSL_CERT, MASTER_SSL_KEY,
and MASTER_SSL_CIPHER

The code is designed to print the warning message once.
2007-01-18 13:20:38 -05:00
lars/lthalmann@dl145j.mysql.com
5810ca92c9 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-01-17 19:32:14 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
b25079d61a Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-01-17 19:30:05 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
bbaf32754f Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-4.1-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-4.1-merge
2007-01-17 19:28:55 +01:00
kostja@bodhi.local
d7a63c0f6a Manual merge. 2007-01-15 13:10:07 +03:00
kostja@bodhi.local
d53072d190 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  bodhi.local:/opt/local/work/mysql-4.1-4968-to-push
2007-01-15 13:03:21 +03:00
sergefp@mysql.com
c3f46e1f26 BUG#24127: (a,b) IN (SELECT c,d ...) can produce wrong results if a and/or b are NULLs:
- Make the code produce correct result: use an array of triggers to turn on/off equalities for each
  compared column. Also turn on/off optimizations based on those equalities.
- Make EXPLAIN output show "Full scan on NULL key" for tables for which we switch between
  ref/unique_subquery/index_subquery and ALL access.
- index_subquery engine now has HAVING clause when it is needed, and it is
  displayed in EXPLAIN EXTENDED
- Fix incorrect presense of "Using index" for index/unique-based subqueries (BUG#22930)
// bk trigger note: this commit refers to BUG#24127
2007-01-12 23:22:41 +03:00
kostja@bodhi.local
16d53afcd2 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-01-12 22:06:46 +03:00
malff/marcsql@weblab.(none)
b73101af15 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-22687
2007-01-12 08:11:52 -07:00
lars/lthalmann@dl145j.mysql.com
1e356251a0 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-01-12 12:31:44 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
c380de50ef Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-01-12 12:22:54 +01:00
malff/marcsql@weblab.(none)
9655f5fb03 Bug#22687 (Functions UNIQUE_USERS, GROUP_UNIQUE_USERS)
According to some internal communication, these two functions are place
holders for future enhancements. Because they use a variable number of
parameters, the implementation defined a reserved keyword for them in the
parser grammar.

Unfortunately, doing so creates a bug similar to Bug 21114 reported for the
function FORMAT.

In the 5.1 code base, due to improvements in the code implemented with bug
21114, having a reserved keyword for functions with a variable number of
arguments is not needed any more by the implementation.

As a result, this fix removes the place-holder implementation, and removes
the unnecessary reserved keywords. Should the functions UNIQUE_USERS and
GROUP_UNIQUE_USERS be finally implemented in a later release, the
implementation should sub class Create_native_func in sql/item_create.cc.
For example, see the class Create_func_concat.
2007-01-11 14:58:05 -07:00
evgen@moonbone.local
19ee0a94fe Bug#23417: Too strict checks against GROUP BY in the ONLY_FULL_GROUP_BY mode.
Currently in the ONLY_FULL_GROUP_BY mode no hidden fields are allowed in the
select list. To ensure this each expression in the select list is checked
to be a constant, an aggregate function or to occur in the GROUP BY list.
The last two requirements are wrong and doesn't allow valid expressions like
"MAX(b) - MIN(b)" or "a + 1" in a query with grouping by a.

The correct check implemented by the patch will ensure that:
any field reference in the [sub]expressions of the select list 
  is under an aggregate function or
  is mentioned as member of the group list or
  is an outer reference or
  is part of the select list element that coincide with a grouping element.

The Item_field objects now can contain the position of the select list
expression which they belong to. The position is saved during the
field's Item_field::fix_fields() call.

The non_agg_fields list for non-aggregated fields is added to the SELECT_LEX
class. The SELECT_LEX::cur_pos_in_select_list now contains the position in the
select list of the expression being currently fixed.
2007-01-11 23:18:01 +03:00
gluh@eagle.(none)
42e49682b7 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-01-10 14:14:22 +04:00
gluh@mysql.com/eagle.(none)
9da22c73d0 Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-01-10 13:04:58 +04:00
gluh@mysql.com/eagle.(none)
b61f3545f5 Fix for bug#20867 InnoDB Bug - create temporary table+crash => mysqld needs to clean up
2nd version
During tmp tables cleanup we get the handler for temporary table
and delete table using handler method.
2007-01-10 12:57:03 +04:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
mats@romeo.(none)
8d4bddefd0 Merge romeo.(none):/home/bk/b22864-mysql-5.1-new-rpl
into  romeo.(none):/home/bk/merge-b22864-myql-5.1-new-rpl
2006-12-21 19:36:28 +01:00
mats@romeo.(none)
be9ffb12da BUG#22864 (Rollback following CREATE... SELECT discards 'CREATE TABLE'
from log):
When row-based logging is used, the CREATE-SELECT is written as two
parts: as a CREATE TABLE statement and as the rows for the table. For
both transactional and non-transactional tables, the CREATE TABLE
statement was written to the transaction cache, as were the rows, and
on statement end, the entire transaction cache was written to the binary
log if the table was non-transactional. For transactional tables, the
events were kept in the transaction cache until end of transaction (or
statement that were not part of a transaction).

For the case when AUTOCOMMIT=0 and we are creating a transactional table
using a create select, we would then keep the CREATE TABLE statement and
the rows for the CREATE-SELECT, while executing the following statements.
On a rollback, the transaction cache would then be cleared, which would
also remove the CREATE TABLE statement. Hence no table would be created
on the slave, while there is an empty table on the master.

This relates to BUG#22865 where the table being created exists on the
master, but not on the slave during insertion of rows into the newly
created table. This occurs since the CREATE TABLE statement were still
in the transaction cache until the statement finished executing, and
possibly longer if the table was transactional.

This patch changes the behaviour of the CREATE-SELECT statement by
adding an implicit commit at the end of the statement when creating
non-temporary tables. Hence, non-temporary tables will be written to the
binary log on completion, and in the even of AUTOCOMMIT=0, a new
transaction will be started. Temporary tables do not commit an ongoing
transaction: neither as a pre- not a post-commit.

The events for both transactional and non-transactional tables are
saved in the transaction cache, and written to the binary log at end
of the statement.
2006-12-21 09:29:02 +01:00
monty@mysql.com/narttu.mysql.fi
a6481aa4c7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-12-15 01:01:52 +02:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
kostja@bodhi.local
758404b238 Merge bodhi.local:/opt/local/work/mysql-4.1-4968
into  bodhi.local:/opt/local/work/mysql-5.0-4968-pull-from-4.1
2006-12-12 01:23:30 +03:00
patg@govinda.patg.net
f9097b86af Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.1-arch
into  govinda.patg.net:/home/patg/mysql-build/mysql-5.1-arch-wl3031-merge
2006-12-08 22:30:18 -05:00
lars@black.(none)
d85ca0dc1d Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-12-08 23:41:29 +01:00
lars@mysql.com/black.(none)
e2e3f0e5c3 Merge mysql.com:/home/bkroot/mysql-5.0-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.0-merge
2006-12-08 23:33:39 +01:00
rafal@quant.(none)
fe2d5c59c2 Merge quant.(none):/ext/mysql/bkroot/mysql-5.0-rpl
into  quant.(none):/ext/mysql/bk/mysql-5.0-bug24507
2006-12-08 11:47:48 +01:00
kostja@bodhi.local
90072e69b3 A fix and test cases for
Bug#4968 "Stored procedure crash if cursor opened on altered table"
Bug#19733 "Repeated alter, or repeated create/drop, fails"
Bug#19182 "CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work from 
stored procedure."
Bug#6895 "Prepared Statements: ALTER TABLE DROP COLUMN does nothing"
Bug#22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"

Test cases for bugs 4968, 19733, 6895 will be added in 5.0.

Re-execution of CREATE DATABASE, CREATE TABLE and ALTER TABLE 
statements in stored routines or as prepared statements caused
incorrect results (and crashes in versions prior to 5.0.25).
In 5.1 the problem occured only for CREATE DATABASE, CREATE TABLE
SELECT and CREATE TABLE with INDEX/DATA DIRECTOY options).

The problem of bugs 4968, 19733, 19282 and 6895 was that functions
mysql_prepare_table, mysql_create_table and mysql_alter_table were not
re-execution friendly: during their operation they used to modify contents
of LEX (members create_info, alter_info, key_list, create_list),
thus making the LEX unusable for the next execution.
In particular, these functions removed processed columns and keys from
create_list, key_list and drop_list. Search the code in sql_table.cc 
for drop_it.remove() and similar patterns to find evidence.

The fix is to supply to these functions a usable copy of each of the
above structures at every re-execution of an SQL statement. 

To simplify memory management, LEX::key_list and LEX::create_list
were added to LEX::alter_info, a fresh copy of which is created for
every execution.

The problem of crashing bug 22060 stemmed from the fact that the above 
metnioned functions were not only modifying HA_CREATE_INFO structure in 
LEX, but also were changing it to point to areas in volatile memory of 
the execution memory root.
 
The patch solves this problem by creating and using an on-stack
copy of HA_CREATE_INFO (note that code in 5.1 already creates and
uses a copy of this structure in mysql_create_table()/alter_table(),
but this approach didn't work well for CREATE TABLE SELECT statement).
2006-12-08 02:20:09 +03:00
cbell/Chuck@suse.vabb.com
ab2d6dcd65 Merge suse.vabb.com:/home/Chuck/development/mysql-5.1-new-rpl
into  suse.vabb.com:/home/Chuck/development/mysql-5.1_WL_3618
2006-12-07 09:19:56 -05:00
cbell/Chuck@suse.vabb.com
9f36c1c286 WL#3618 - Remove HAVE_ROW_BASED_REPLICATION from source code.
Please see worklog for details on files changed.
2006-12-07 09:18:35 -05:00
bar@bar.intranet.mysql.r18.ru
293a356277 Merge mysql.com:/usr/home/bar/mysql-5.0.b22645
into  mysql.com:/usr/home/bar/mysql-5.1.b22645
2006-12-05 16:09:27 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
7c1b675e72 Merging bug#22645 "LC_TIME_NAMES: Statement not replicated" from 4.1. 2006-12-05 16:01:21 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
58149eaf61 Merge mysql.com:/usr/home/bar/mysql-4.1.b22645
into  mysql.com:/usr/home/bar/mysql-5.0.b22645
2006-12-05 14:08:19 +04:00
msvensson@neptunus.(none)
23a059b224 Merge bk-internal:/home/bk/mysql-5.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-12-05 10:54:17 +01:00
bar@mysql.com/bar.intranet.mysql.r18.ru
224660d14a Bug#22645 LC_TIME_NAMES: Statement not replicated
Problem: replication of LC_TIME_NAMES didn't work.
Thus, INSERTS or UPDATES using date_format() always
worked with en_US on the slave side.
Fix: adding ONE_SHOT implementation for LC_TIME_NAMES.
2006-12-05 13:45:21 +04:00
msvensson@neptunus.(none)
128b73fc36 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-12-04 19:28:38 +01:00
msvensson@neptunus.(none)
971c783f7d Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-12-04 19:11:55 +01:00
andrey@example.com
44656a234c Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  example.com:/work/bug22369-v2/my51
2006-12-04 18:31:24 +01:00
andrey@example.com
e6a4727779 Fix for bug#22369: Alter table rename combined
with other alterations causes lost tables

Using RENAME clause combined with other clauses of ALTER TABLE led to
data loss (the data was there but not accessible). This could happen if the
changes do not change the table much. Adding and droppping of fields and
indices was safe. Renaming a column with MODIFY or CHANGE was unsafe operation,
if the actual column didn't change (changing from int to int, which is a noop)
  
Depending on the storage engine (SE) the behavior is different:
1)MyISAM/MEMORY - the ALTER TABLE statement completes
  without any error but next SELECT against the new table fails.
2)InnoDB (and every other transactional table) - The ALTER TABLE statement
  fails. There are the the following files in the db dir -
  `new_table_name.frm` and a temporary table's frm. If the SE is file
  based, then the data and index files will be present but with the old
  names. What happens is that for InnoDB the table is not renamed in the
  internal DDIC.

Fixed by adding additional call to mysql_rename_table() method, which should
not include FRM file rename, because it has been already done during file
names juggling.
2006-12-04 18:22:38 +01:00
patg@radha.tangent.org
a3e85cce4e WL# 3031
Backport of functionality in private 5.2 tree. 

Added new language to parser, new mysql.servers table and associated code
to be used by the federated storage engine to allow central connection information
per WL entry.
2006-12-01 19:47:45 -05:00
monty@narttu.mysql.fi
693b906f6e Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-11-30 23:27:16 +02:00
monty@mysql.com/narttu.mysql.fi
908ff4b1d1 After merge fixes
Marked some functions as noreturn
2006-11-30 23:23:23 +02:00
monty@mysql.com/narttu.mysql.fi
3d40956039 Fixed portability issue in my_thr_init.c (was added in my last push)
Fixed compiler warnings (detected by VC++):
- Removed not used variables
- Added casts
- Fixed wrong assignments to bool
- Fixed wrong calls with bool arguments
- Added missing argument to store(longlong), which caused wrong store method to be called.
2006-11-30 18:25:05 +02:00
monty@mysql.com/narttu.mysql.fi
3a35c30027 Fixed compiler warnings (Mostly VC++):
- Removed not used variables
- Changed some ulong parameters/variables to ulonglong (possible serious bug)
- Added casts to get rid of safe assignment from longlong to long (and similar)
- Added casts to function parameters
- Fixed signed/unsigned compares
- Added some constructores to structures
- Removed some not portable constructs

Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
(Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
2006-11-30 03:40:42 +02:00
baker@bk-internal.mysql.com
94dc5d5379 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-11-29 18:31:13 +01:00
msvensson@shellback.(none)
7ddc43e305 Merge shellback.(none):/home/msvensson/mysql/mysql-5.1
into  shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-11-29 15:44:09 +01:00
baker@bk-internal.mysql.com
f175a892ab Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-11-28 22:22:52 +01:00
msvensson@neptunus.(none)
04d5a42bbf Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-11-28 20:59:57 +01:00
gkodinov@dl145s.mysql.com
32c9e11df9 Merge bk-internal:/home/bk/mysql-5.1
into  dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-11-28 17:14:16 +01:00
ramil/ram@myoffice.izhnet.ru
2469ca2144 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/usr/home/ram/work/bug21587/my51-bug21587
2006-11-28 13:54:55 +04:00
ramil/ram@myoffice.izhnet.ru
25b5024571 Merge mysql.com:/usr/home/ram/work/bug21587/my50-bug21587
into  mysql.com:/usr/home/ram/work/bug21587/my51-bug21587
2006-11-28 13:49:43 +04:00
monty@nosik.monty.fi
313f23a93a Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into  mysql.com:/home/my/mysql-5.1
2006-11-27 14:07:52 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
55aa6e04bd Fix for bug #21587: FLUSH TABLES causes server crash when used with HANDLER statements
Problems (appear only under some circumstances): 
  1. we get a reference to a deleted table searching in the 
     thd->handler_tables_hash in the mysql_ha_read().

  2. DBUG_ASSERT(table->file->inited == handler::NONE); assert fails in the
     close_thread_table().

Fix: end open index scans and table scans and remove references to the 
tables from the handler tables hash. After this preparation it is safe 
to close the tables. The close can no longer fail on open index/table 
scans and the closed table will not be used again by handler functions.
2006-11-27 13:24:24 +04:00
baker@bk-internal.mysql.com
098571df33 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-11-22 05:54:30 +01:00
monty@nosik.monty.fi
38a92caeb7 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-11-21 23:12:45 +02:00
monty@mysql.com/nosik.monty.fi
f6682e2743 Added --debug-info to most clients to detect memory leaks in mysql-test-run
Moved .progress files into the log directory
Moved 'cluster' database tables into the MySQL database, to not have 'cluster' beeing a reserved database name
Fixed bug where mysqld got a core dump when trying to use a table created by MySQL 3.23
Fixed some compiler warnings
Fixed small memory leak in libmysql
Note that this doesn't changeset doesn't include the new mysqldump.c code required to run some tests. This will be added when I merge 5.0 to 5.1
2006-11-21 22:32:58 +02:00
brian@zim.(none)
39458a6e1b This straightens up usage of have_ variables, and removes dead -skip-isam option. 2006-11-20 14:04:07 -08:00
holyfoot/hf@deer.(none)
7d190dd6b1 Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/mysql-5.1-mrg
2006-11-17 19:01:35 +04:00
holyfoot/hf@mysql.com/deer.(none)
e95e23b0f3 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mysql-5.0-0mrg
2006-11-17 10:30:16 +04:00
jani@ua141d10.elisa.omakaista.fi
596f64d91a Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-lex-string
2006-11-16 14:38:45 +02:00
lars@black.(none)
63c906f749 Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-11-13 12:45:31 +01:00
lars@mysql.com/black.(none)
c5d56416ba Merge mysql.com:/home/bkroot/mysql-5.0-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.0-merge
2006-11-13 12:44:53 +01:00
bar@bar.intranet.mysql.r18.ru
da0a0ad20a Merge mysql.com:/usr/home/bar/mysql-5.0.b21505
into  mysql.com:/usr/home/bar/mysql-5.1.b21505
2006-11-09 14:46:01 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
aa1c8a5826 Bug#21505 Create view - illegal mix of collation for operation 'UNION'
The problem was that any VIEW columns had always implicit derivation.
  Fix: derivation is now copied from the original expression
  given in VIEW definition.
  For example:
  - a VIEW column which comes from a string constant
    in CREATE VIEW definition have now coercible derivation.
  - a VIEW column having COLLATE clause
    in CREATE VIEW definition have now explicit derivation.
2006-11-09 14:41:34 +04:00
holyfoot/hf@deer.(none)
938ba3e11e Merge mysql.com:/home/hf/work/mysql-5.0.clean
into  mysql.com:/home/hf/work/mysql-5.1.clean
2006-11-08 19:09:39 +04:00
petr/cps@outpost.site
b28b07f09f Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  outpost.site:/home/cps/mysql/trees/5.1-runtime-bug9191
2006-11-06 00:19:55 +03:00
petr/cps@outpost.site
bfbf1cdee9 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  outpost.site:/home/cps/mysql/trees/5.0-runtime-bug9191
2006-11-06 00:11:34 +03:00
petr/cps@outpost.site
8de747b0c7 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
2006-11-06 00:05:02 +03:00
malff/marcsql@weblab.(none)
48a87f8ae0 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-21114_b
2006-11-02 11:13:04 -07:00
malff/marcsql@weblab.(none)
62c242cc75 Bug#21114 (Foreign key creation fails to table with name format)
Due to the complexity of this change, everything is documented in WL#3565

This patch is the third iteration, it takes into account the comments
received to date.
2006-11-02 11:01:53 -07:00
kostja@bodhi.local
965669d1f9 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-11-02 03:24:11 +03:00
igor@rurik.mysql.com
79abdb38f8 Merge rurik.mysql.com:/home/igor/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug21727
2006-11-01 14:50:14 -08:00
kostja@bodhi.local
6a28c436f7 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  bodhi.local:/opt/local/work/mysql-4.1-runtime
2006-11-02 01:08:39 +03:00
petr/cps@owlet.local
3df8165cf9 Merge mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191
into  mysql.com:/home/cps/mysql/trees/5.1-runtime-bug9191
2006-11-01 18:18:01 +03:00
petr/cps@mysql.com/owlet.local
7974bf90aa Merge mysql.com:/home/cps/mysql/trees/4.1-runtime-bug9191
into  mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191
2006-11-01 17:35:35 +03:00
petr/cps@mysql.com/owlet.local
3ec542dfbd Fix Bug #9191 "TIMESTAMP/from_unixtime() no longer accepts 2^31-1"
(4.1 version, with post-review fixes)
  
  The fix for another Bug (6439) limited FROM_UNIXTIME() to
  TIMESTAMP_MAX_VALUE which is 2145916799 or 2037-12-01 23:59:59 GMT,
  however unix timestamp in general is not considered to be limited 
  by this value. All dates up to power(2,31)-1 are valid.
  
  This patch extends allowed TIMESTAMP range so, that max
  TIMESTAMP value is power(2,31)-1. It also corrects
  FROM_UNIXTIME() and UNIX_TIMESTAMP() functions, so that
  max allowed UNIX_TIMESTAMP() is power(2,31)-1. FROM_UNIXTIME()
  is fixed accordingly to allow conversion of dates up to
  2038-01-19 03:14:07 UTC. The patch also fixes CONVERT_TZ()
  function to allow extended range of dates.
  
  The main problem solved in the patch is possible overflows
  of variables, used in broken-time representation to time_t
  conversion (required for UNIX_TIMESTAMP).
2006-11-01 16:47:40 +03:00
igor@rurik.mysql.com
2a7acba7e1 Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Allocation of memory for the sort buffer at each evaluation of a
subquery may take a significant amount of time if the buffer is rather big.
With the fix we allocate the buffer at the first evaluation of the
subquery and reuse it at each subsequent evaluation.
2006-10-31 17:31:56 -08:00
kroki/tomash@moonlight.intranet
75881599e5 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21915
2006-10-30 17:59:23 +03:00
kroki/tomash@moonlight.intranet
cf99db484e Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21915
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug21915
2006-10-30 17:57:45 +03:00
kroki/tomash@moonlight.intranet
1c87434699 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug21915
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21915
2006-10-30 17:51:36 +03:00
kroki/tomash@moonlight.intranet
1bfe00e0da BUG#21915: Changing limits of table_cache when setting max_connections
If the user has specified --max-connections=N or --table-open-cache=M
options to the server, a warning could be given that some values were
recalculated, and table-open-cache could be assigned greater value.

Note that both warning and increase of table-open-cache were totally
harmless.

This patch fixes recalculation code to ensure that table-open-cache will
be never increased automatically and that a warning will be given only if
some values had to be decreased due to operating system limits.

No test case is provided because we neither can't predict nor control
operating system limits for maximal number of open files.
2006-10-30 17:47:02 +03:00
jonas@perch.ndb.mysql.com
f6fcb302ab Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2006-10-28 00:01:24 +02:00
petr/cps@owlet.local
eda71e24c3 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-rename-bug
2006-10-24 17:00:23 +04:00
kostja@bodhi.local
4cb57ac048 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-10-23 12:06:59 +04:00
gkodinov@dl145s.mysql.com
bb0422a0b0 Merge bk-internal:/home/bk/mysql-5.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-10-20 11:12:35 +02:00
gkodinov@dl145s.mysql.com
a93cc1b70b Merge bk-internal:/home/bk/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-10-20 11:02:56 +02:00
gkodinov@dl145s.mysql.com
aaed398254 Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-10-19 16:43:46 +02:00
gkodinov@dl145s.mysql.com
892495acaf Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-10-19 14:37:49 +02:00
istruewing@chilla.local
9b3e7bd02f Bug#21476 - Lost Database Connection During Query
Backport from 5.1.
Raised STACK_MIN_SIZE for Debian GNU/Linux Sid,
Linux kernel 2.6.16,
gcc version 3.3.6 (Debian 1:3.3.6-13),
libc6-dbg 2.3.6.ds1-4,
Pentium4 (x86),
BUILD/compile-pentium-debug-max
Raised about 100 Bytes above the required minimum.
2006-10-19 13:42:26 +02:00
jani@ua141d10.elisa.omakaista.fi
8dd0b2d0ae Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-lex-string
2006-10-17 19:54:44 +03:00
gkodinov/kgeorge@macbook.gmz
a64ae1844d Merge bk-internal:/home/bk/mysql-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21798-5.0-opt-merge
2006-10-17 16:36:44 +03:00
gkodinov/kgeorge@macbook.gmz
f7b8937661 Bug#21798: memory leak during query execution with subquery in column
list using a function
When executing dependent subqueries they are re-inited and re-exec() for 
each row of the outer context.
The cause for the bug is that during subquery reinitialization/re-execution,
the optimizer reallocates JOIN::join_tab, JOIN::table in make_simple_join()
and the local variable in 'sortorder' in create_sort_index(), which is
allocated by make_unireg_sortorder().
Care must be taken not to allocate anything into the thread's memory pool
while re-initializing query plan structures between subquery re-executions.
All such items mush be cached and reused because the thread's memory pool
is freed at the end of the whole query.
Note that they must be cached and reused even for queries that are not 
otherwise cacheable because otherwise it will grow the thread's memory 
pool every time a cacheable query is re-executed. 
We provide additional members to the JOIN structure to store references 
to the items that need to be cached.
2006-10-17 16:20:26 +03:00
stewart@willster.(none)
4de3c4bf1e Merge willster.(none):/home/stewart/Documents/MySQL/5.1/ndb
into  willster.(none):/home/stewart/Documents/MySQL/5.1/ndb-is_files_refactor
2006-10-17 14:27:26 +10:00
jani@ua141d10.elisa.omakaista.fi
02f29377fd Changed several char* to LEX_STRING*. 2006-10-16 19:57:33 +03:00
evgen@moonbone.local
2b474898dc Bug#14959: ALTER TABLE isn't able to rename a view
The mysql_alter_table() was able to rename only a table.

The view/table renaming code is moved from the function rename_tables 
to the new function called do_rename().
The mysql_alter_table() function calls it when it needs to rename a view.
2006-10-13 21:59:52 +04:00
petr/cps@mysql.com/owlet.local
6846f8d9c4 Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
            tables"

According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).

Here is a sample:

use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;

The rules for Rename of the log tables are following:
      IF   1. Log tables are enabled
      AND  2. Rename operates on the log table and nothing is being
              renamed to the log table.
      DO   3. Throw an error message.
      ELSE 4. Perform rename.
 
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.

Other problems, which are solved by the patch are:

1) Now REPAIR of the log table is exclusive operation (as it should be), this
   also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
   then name lock, which is too restrictive. This way we get rid of another
   log table-related warning, which occured because of the above fact
   (as a side-effect, name lock resulted in a warning).
2006-10-13 17:26:46 +04:00
andrey@example.com
da2130e690 fix build failure on Solaris10 2006-10-10 21:19:34 +02:00
istruewing@chilla.local
01f11289ed Bug#21476 - Lost Database Connection During Query
Raised STACK_MIN_SIZE for Debian GNU/Linux Sid,
Linux kernel 2.6.16,
gcc version 3.3.6 (Debian 1:3.3.6-13),
libc6-dbg 2.3.6.ds1-4,
Pentium4 (x86),
BUILD/compile-pentium-debug-max
Raised about 100 Bytes above the required minimum.
2006-10-10 20:30:33 +02:00
andrey@example.com
5fd8554a77 Remove direct mapping of enum interval_type to mysql.event.interval_field
This decoupling allows in further versions of MySQL enum interval_type to
  be reordered without this affecting any backward compatibility in the
  events code.
  This changeset doesn't change any exposed behavior but makes events' code
  more durable to changes outside of their code base.
  
  To the reviewer: There is no regression test included as it is impossible
  to construct one with the current infrastructure which can test it. To test
  the code one has create and event, then change the order of
  enum interval_type in my_time.h, update sql/time.cc, recompile the server
  and run it with scheduler running.
2006-10-10 17:59:46 +02:00
stewart@willster.(none)
163f272d24 BUG#23013 make INFORMATION_SCHEMA.FILES easily usable by other engines 2006-10-06 00:39:22 +10:00
msvensson@neptunus.(none)
4f46f3bde7 Merge bk-internal:/home/bk/mysql-5.0-runtime
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-03 14:26:11 +02:00
msvensson@neptunus.(none)
48d99634f3 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-10-03 13:27:48 +02:00
msvensson@neptunus.(none)
ca21b57992 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-10-03 09:28:44 +02:00
dlenev@mockturtle.local
8eb4401c59 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-rt-merge
2006-10-02 22:53:10 +04:00
dlenev@mockturtle.local
0868629129 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mockturtle.local:/home/dlenev/src/mysql-5.1-rt-merge
2006-10-02 21:41:35 +04:00
baker@bk-internal.mysql.com
8a5fef1419 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-10-01 22:31:04 +02:00
brian@zim.(none)
8096f1c4b2 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-arch
into  zim.(none):/home/brian/mysql/merge-5.1
2006-09-30 19:12:50 -07:00
brian@zim.(none)
4117860ec6 Merge zim.(none):/home/brian/mysql/merge-5.1
into  zim.(none):/home/brian/mysql/arch-5.1
2006-09-30 18:44:42 -07:00
brian@zim.(none)
56505c01f9 This patch updates to remove most global hton needs. Cleans up wrong message in partition. 2006-09-30 18:31:13 -07:00
brian@zim.(none)
46ae2113ba This patch adds handlerton passing to functions. NDB and Innodb still require a global hanlderton in the main code due to the nature of the sql_cache call back function (should be solveable... another patch).
Partitioning now has a flag to allow disabling of engines from being compatible with partitioning. Cleaned up heap naming convention on panic call.
2006-09-30 12:49:46 -07:00
dlenev@mockturtle.local
79bf51461e Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg20670-2
2006-09-30 11:35:34 +04:00
tsmith/tim@siva.hindu.god
44f0e55ca4 Merge siva.hindu.god:/usr/home/tim/m/bk/50
into  siva.hindu.god:/usr/home/tim/m/bk/mrg/51
2006-09-29 18:04:34 -06:00
tsmith/tim@siva.hindu.god
ca1f99bdb8 Merge siva.hindu.god:/usr/home/tim/m/bk/g51
into  siva.hindu.god:/usr/home/tim/m/bk/mrg/51
2006-09-29 17:01:16 -06:00
dlenev@mockturtle.local
93fed182eb Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.1-bg20670
2006-09-30 00:31:33 +04:00
cmiller@zippy.cornsilk.net
5275e2437a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-09-29 16:24:21 -04:00
gkodinov@dl145s.mysql.com
0293b69ac7 Merge bk-internal:/home/bk/mysql-5.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-09-29 11:21:40 +02:00
dlenev@mockturtle.local
a4ee7ec153 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-rt-merge
2006-09-29 10:55:03 +04:00
jimw@rama.(none)
7a23b1baf7 Merge rama.(none):/home/jimw/my/mysql-5.0-clean
into  rama.(none):/home/jimw/my/mysql-5.1-clean
2006-09-28 20:20:33 -07:00
jimw@rama.(none)
2961966b3b Merge bk-internal:/home/bk/mysql-5.0-maint
into  rama.(none):/home/jimw/my/mysql-5.0-clean
2006-09-28 20:17:17 -07:00
jimw@rama.(none)
caf4392f71 Merge bk-internal:/home/bk/mysql-4.1-maint
into  rama.(none):/home/jimw/my/mysql-4.1-clean
2006-09-28 18:11:29 -07:00
jimw@rama.(none)
68eadc8a79 Merge rama.(none):/home/jimw/my/mysql-4.1-clean
into  rama.(none):/home/jimw/my/mysql-5.0-clean
2006-09-28 18:09:10 -07:00
cmiller@zippy.cornsilk.net
e72bc63906 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2006-09-28 10:15:32 -04:00
cmiller@zippy.cornsilk.net
b2ee81a6ec Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-09-28 10:09:57 -04:00
gluh@gluh.(none)
12b3672a69 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1
2006-09-28 18:03:00 +05:00
gkodinov@dl145s.mysql.com
41a2631cb3 Merge bk-internal:/home/bk/mysql-5.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-09-28 14:53:31 +02:00
gluh@gluh.(none)
b7e59b7085 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.1
2006-09-28 14:09:31 +05:00
gkodinov@dl145s.mysql.com
3abb604333 Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-5.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt
2006-09-28 10:41:42 +02:00
gkodinov@dl145s.mysql.com
b0167d265f Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-09-28 10:36:04 +02:00
petr/cps@owlet.local
64c2c0cb19 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/cps/mysql/trees/5.1-runtime-new
2006-09-28 04:44:55 +04:00
cmiller@zippy.cornsilk.net
d34940c909 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug21476/my50-bug21476
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug21476/my51-bug21476
2006-09-27 15:48:40 -04:00
cmiller@zippy.cornsilk.net
c0ab40d390 Bug#21476: (Thread stack overrun not caught, causing SEGV)
The STACK_MIN_SIZE is currently set to 8192, when we actually need 
(emperically discovered) 9236 bytes to raise an fatal error, on Ubuntu 
Dapper Drake, libc6 2.3.6-0ubuntu2, Linux kernel 2.6.15-27-686, on x86.

I'm taking that as a new lower bound, plus 100B of wiggle-room for sundry
word sizes and stack behaviors.

The added test verifies in a cross-platform way that there are no gaps 
between the space that we think we need and what we actually need to report 
an error.

DOCUMENTERS:  This also adds "let" to the mysqltest commands that evaluate
an argument to expand variables therein.  (Only right of the "=", of course.)
2006-09-27 14:42:56 -04:00
gluh@mysql.com/gluh.(none)
4aaf7e34ff additional 'after merge' fix 2006-09-27 20:11:11 +05:00
gkodinov/kgeorge@macbook.gmz
a01e7b12ce Merge macbook.gmz:/Users/kgeorge/mysql/work/B21174-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21174-5.1-opt
2006-09-27 13:03:41 +03:00
kroki/tomash@moonlight.intranet
a53e628181 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug21414
2006-09-27 12:22:16 +04:00
kroki/tomash@moonlight.intranet
18dda5abaf Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21414
2006-09-27 11:46:29 +04:00
igor@rurik.mysql.com
a661bdda19 Fixed bug #21646.
Presence of a subquery in the ON expression of a join 
should not block merging the view that contains this join.
Before this patch the such views were converted into 
into temporary table views.
2006-09-25 06:15:14 -07:00
brian@zim.(none)
0a0f1aa386 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1
into  zim.(none):/home/brian/mysql/merge-5.1
2006-09-23 12:13:30 -07:00
brian@zim.(none)
48381342d8 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1
into  zim.(none):/home/brian/mysql/merge-5.1
2006-09-22 23:33:08 -07:00
dlenev@mockturtle.local
5f149dde09 Fix for bug#20670 "UPDATE using key and invoking trigger that modifies
this key does not stop" (5.1 version).

UPDATE statement which WHERE clause used key and which invoked trigger
that modified field in this key worked indefinetely.

This problem occured because in cases when UPDATE statement was
executed in update-on-the-fly mode (in which row is updated right
during evaluation of select for WHERE clause) the new version of
the row became visible to select representing WHERE clause and was
updated again and again.
We already solve this problem for UPDATE statements which does not
invoke triggers by detecting the fact that we are going to update
field in key used for scanning and performing update in two steps,
during the first step we gather information about the rows to be
updated and then doing actual updates. We also do this for
MULTI-UPDATE and in its case we even detect situation when such
fields are updated in triggers (actually we simply assume that
we always update fields used in key if we have before update
trigger).

The fix simply extends this check which is done with help of
check_if_key_used()/QUICK_SELECT_I::check_if_keys_used()
routine/method in such way that it also detects cases when
field used in key is updated in trigger. We do this by
changing check_if_key_used() to take field bitmap instead
field list as argument and passing TABLE::write_set
to it (we also have to add info about fields used in
triggers to this bitmap a bit earlier).
As nice side-effect we have more precise and thus more optimal
perfomance-wise check for the MULTI-UPDATE.
Also check_if_key_used() routine and similar method were renamed
to is_key_used()/is_keys_used() in order to better reflect that
it is simple boolean predicate.
Finally, partition_key_modified() routine now also takes field
bitmap instead of field list as argument.
2006-09-21 13:39:29 +04:00
dlenev@mockturtle.local
091ed9fb38 Fix for bug#20670 "UPDATE using key and invoking trigger that modifies
this key does not stop" (version for 5.0 only).

UPDATE statement which WHERE clause used key and which invoked trigger
that modified field in this key worked indefinetely.

This problem occured because in cases when UPDATE statement was
executed in update-on-the-fly mode (in which row is updated right
during evaluation of select for WHERE clause) the new version of
the row became visible to select representing WHERE clause and was
updated again and again.
We already solve this problem for UPDATE statements which does not
invoke triggers by detecting the fact that we are going to update
field in key used for scanning and performing update in two steps,
during the first step we gather information about the rows to be
updated and then doing actual updates. We also do this for
MULTI-UPDATE and in its case we even detect situation when such
fields are updated in triggers (actually we simply assume that
we always update fields used in key if we have before update
trigger).

The fix simply extends this check which is done in check_if_key_used()/
QUICK_SELECT_I::check_if_keys_used() routine/method in such way that
it also detects cases when field used in key is updated in trigger.
As nice side-effect we have more precise and thus more optimal
perfomance-wise check for the MULTI-UPDATE.
Also check_if_key_used()/QUICK_SELECT_I::check_if_keys_used() were
renamed to is_key_used()/QUICK_SELECT_I::is_keys_used() in order to
better reflect that boolean predicate.

Note that this check is implemented in much more elegant way in 5.1
2006-09-21 11:35:38 +04:00
lars/lthalmann@dl145j.mysql.com
57a74ea4af Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-21 00:23:20 +02:00
brian@zim.(none)
63d78a7659 Removed ifdef need.
Cleaned up test to no longer need have_
2006-09-19 13:58:12 -07:00
gkodinov@dl145s.mysql.com
ce8ed889d7 Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1
2006-09-18 12:57:20 +02:00
brian@zim.(none)
f79ddec1f2 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1
into  zim.(none):/home/brian/mysql/merge-5.1
2006-09-15 10:48:30 -07:00
brian@zim.(none)
7194b6d75a This changes the order of the universe, black is now the new white.
In practice this means that handlerton is now created by the server and is passed to the engine. Plugin startups can now also control how plugins are inited (and can optionally pass values). Bit more flexibility to those who want to write plugin interfaces to the database.
2006-09-15 10:28:00 -07:00
gkodinov@dl145s.mysql.com
b1e087a717 Merge dl145s.mysql.com:/data/bk/team_tree_merge/CLEAN/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-09-15 11:52:49 +02:00
tsmith@maint2.mysql.com
6a31ec2cad Merge maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/50
into  maint2.mysql.com:/data/localhome/tsmith/bk/mrg50/51
2006-09-13 09:03:52 +02:00
kroki/tomash@moonlight.intranet
ed0cb3e4ba BUG#21414: SP: Procedure undroppable, to some extent
The problem was that if after FLUSH TABLES WITH READ LOCK the user
issued DROP/ALTER PROCEDURE/FUNCTION the operation would fail (as
expected), but after UNLOCK TABLE any attempt to execute the same
operation would lead to the error 1305 "PROCEDURE/FUNCTION does not
exist", and an attempt to execute any stored function will also fail.

This happened because under FLUSH TABLES WITH READ LOCK we couldn't open
and lock mysql.proc table for update, and this fact was erroneously
remembered by setting mysql_proc_table_exists to false, so subsequent
statements believed that mysql.proc doesn't exist, and thus that there
are no functions and procedures in the database.

As a solution, we remove mysql_proc_table_exists flag completely.  The
reason is that this optimization didn't work most of the time anyway.
Even if open of mysql.proc failed for some reason when we were trying to
call a function or a procedure, we were setting mysql_proc_table_exists
back to true to force table reopen for the sake of producing the same
error message (the open can fail for number of reasons).  The solution
could have been to remember the reason why open failed, but that's a lot
of code for optimization of a rare case.  Hence we simply remove this
optimization.
2006-09-12 14:56:25 +04:00
lars/lthalmann@dl145j.mysql.com
1dfc84986e Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-11 13:34:44 +02:00
gluh@mysql.com/gluh.(none)
a3300c3983 after merge fix 2006-09-08 16:16:39 +05:00
gkodinov/kgeorge@macbook.gmz
4c1db01833 Merge macbook.gmz:/Users/kgeorge/mysql/work/B21392-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21392-5.0-opt
2006-09-04 18:45:48 +03:00
gkodinov/kgeorge@macbook.gmz
3758b975f8 Bug #21392: multi-table delete with alias table name fails with
1003: Incorrect table name
in multi-table DELETE the set of tables to delete from actually 
references then tables in the other list, e.g:
DELETE alias_of_t1 FROM t1 alias_of_t1 WHERE ....
is a valid statement.
So we must turn off table name syntactical validity check for alias_of_t1 
because it's not a table name (even if it looks like one).
In order to do that we add a special flag (TL_OPTION_ALIAS) to 
disable the name checking for the aliases in multi-table DELETE.
2006-09-04 18:40:30 +03:00
evgen@moonbone.local
e1c245bff3 Merge moonbone.local:/home/evgen/bk-trees/mysql-5.1-opt
into  moonbone.local:/work/tmp_merge-5.1-mysql
2006-09-01 14:08:38 +04:00
kostja@bodhi.local
ebb7070430 Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-30 03:00:19 +04:00
kostja@bodhi.local
f8d34e1030 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-14897
2006-08-30 00:45:33 +04:00
evgen@moonbone.local
8cf9781717 Merge moonbone.local:/work/tmp_merge-5.0-mysql
into  moonbone.local:/work/tmp_merge-5.1-opt-mysql
2006-08-29 18:58:50 +04:00
anozdrin/alik@alik.
9af756efd3 Fix for BUG#16899: Possible buffer overflow in handling of DEFINER-clause
User name (host name) has limit on length. The server code relies on these
limits when storing the names. The problem was that sometimes these limits
were not checked properly, so that could lead to buffer overflow.

The fix is to check length of user/host name in parser and if string is too
long, throw an error.
2006-08-23 21:31:00 +04:00
petr/cps@owlet.local
2763504be4 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/cps/mysql/trees/mysql-5.1-virgin
2006-08-23 16:48:39 +04:00
sergefp@mysql.com
f57738751d Fix compile errors in VC++ 7.0: fix typo made in previous cset 2006-08-22 15:03:13 +04:00
kent@mysql.com/g4-2.local
b329f2c3ef Many files:
Deleted config/ac-macros/ha_berkeley.m4
  Removed more referenses to bdb
2006-08-21 15:34:29 +02:00
sergefp@mysql.com
8ed86cb168 Fix compile errors in VC++ 7.0 2006-08-21 16:21:48 +04:00
mats@romeo.(none)
c2d7f7c392 Merge romeo.(none):/home/bkroot/mysql-5.1-wl3228
into  romeo.(none):/home/bk/w3259-mysql-5.1-new-rpl
2006-08-21 10:54:41 +02:00
malff/marcsql@weblab.(none)
b8a1ba1215 WL#3432 (Compile the Parser with a --debug --verbose option)
Corrected build issues : the build can not be conditional.
to keep a unique source .tar.gz distribution.
2006-08-18 19:16:07 -07:00
jimw@rama.(none)
cb6a084076 Bug #2717: include/my_global.h mis-defines __attribute__
Fix when __attribute__() is stubbed out, add ATTRIBUTE_FORMAT() for specifying
  __attribute__((format(...))) safely, make more use of the format attribute,
  and fix some of the warnings that this turns up (plus a bonus unrelated one).
2006-08-17 12:25:40 -07:00
andrey@example.com
30b4a45998 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  example.com:/work/mysql-5.1-runtime
2006-08-17 19:09:55 +02:00
andrey@example.com
081b865936 Cleanup patch.
There is an existing macros for initializing LEX_STRINGs
with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
(char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
2006-08-17 18:13:45 +02:00
evgen@sunlight.local
dd9a07706b Fixed bug#21261: Wrong access rights was required for an insert into a view
SELECT right instead of INSERT right was required for an insert into to a view.
This wrong behaviour appeared after the fix for bug #20989. Its intention was
to ask only SELECT right for all tables except the very first for a complex
INSERT query. But that patch has done it in a wrong way and lead to asking 
a wrong access right for an insert into a view.

The setup_tables_and_check_access() function now accepts two want_access
parameters. One will be used for the first table and the second for other
tables.
2006-08-15 21:45:24 +04:00
brian@zim.(none)
41f920b013 Merge zim.(none):/home/brian/mysql/dep-5.1
into  zim.(none):/home/brian/mysql/remove-bdb-5.1
2006-08-14 21:26:33 -07:00
kostja@bodhi.local
9b05865be4 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-14 16:30:57 +04:00
kostja@bodhi.local
04c97488f9 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-12 21:06:51 +04:00
patg@govinda.patg.net
4371749996 Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.1
into  govinda.patg.net:/home/patg/mysql-build/mysql-5.1-engines-merge
2006-08-10 14:28:39 -07:00
brian@zim.(none)
65e9ae97b0 This is the second patch for bdb removeal. This takes care of all options and variables that rely on bdb. 2006-08-10 01:50:37 -07:00
tsmith@maint1.mysql.com
8e0cc34af4 Merge maint1.mysql.com:/data/localhome/tsmith/bk/mrg50-c
into  maint1.mysql.com:/data/localhome/tsmith/bk/mrg51-c
2006-08-03 10:41:14 +02:00
kostja@bodhi.local
1b145118b9 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
2006-08-02 21:54:10 +04:00
ingo/istruewing@chilla.local
c20030ef26 Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  chilla.local:/home/mydev/mysql-5.1-bug18775
2006-08-02 18:10:51 +02:00
ingo/istruewing@chilla.local
8e4c36ad4a Bug#18775 - Temporary table from alter table visible to other threads
Continued implementation of WL#1324 (table name to filename encoding)

The intermediate (not temporary) files of the new table
during ALTER TABLE was visible for SHOW TABLES. These
intermediate files are copies of the original table with
the changes done by ALTER TABLE. After all the data is
copied over from the original table, these files are renamed 
to the original tables file names. So they are not temporary 
files. They persist after ALTER TABLE, but just with another 
name.

In 5.0 the intermediate files are invisible for SHOW TABLES
because all file names beginning with "#sql" were suppressed.

This failed since 5.1.6 because even temporary table names were
converted when making file names from them. The prefix became
converted to "@0023sql". Converting the prefix during SHOW TABLES
would suppress the listing of user tables that start with "#sql".

The solution of the problem is to continue the implementation of
the table name to file name conversion feature. One requirement
is to suppress the conversion for temporary table names.

This change is straightforward for real temporary tables as there
is a function that creates temporary file names.

But the generated path names are located in TMPDIR and have no
relation to the internal table name. This cannot be used for
ALTER TABLE. Its intermediate files need to be in the same
directory as the old table files. And it is necessary to be
able to deduce the same path from the same table name repeatedly.

Consequently the intermediate table files must be handled like normal
tables. Their internal names shall start with tmp_file_prefix
(#sql) and they shall not be converted like normal table names.

I added a flags parameter to all relevant functions that are
called from ALTER TABLE. It is used to suppress the conversion
for the intermediate table files.

The outcome is that the suppression of #sql in SHOW TABLES
works again. It does not suppress user tables as these are
converted to @0023sql on file level.

This patch does also fix ALTER TABLE ... RENAME, which could not 
rename a table with non-ASCII characters in its name.

It does also fix the problem that a user could create a table like
`#sql-xxxx-yyyy`, where xxxx is mysqld's pid and yyyy is the thread
ID of some other thread, which prevented this thread from running 
ALTER TABLE.

Some of the above problems are mentioned in Bug 1405, which can
be closed with this patch.

This patch does also contain some minor fixes for other forgotten
conversions. Still known problems are reported as bugs 21370,
21373, and 21387.
2006-08-02 17:57:06 +02:00
evgen@moonbone.local
67c85a170a Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
2006-08-02 16:44:56 +04:00