Commit graph

15778 commits

Author SHA1 Message Date
msvensson@neptunus.(none)
4c26bf9c1d Bug#19371 VARBINARY() have trailing zeros after upgrade from 4.1
- Detect if a table has field of type MYSQL_TYPE_VAR_STRING while running
   "CHECK TABLE t FOR UPGRADE" and indicate it need to be fixed
   with "REPAIR TABLE t".
 - When running a "REPAIR TABLE t" or "ALTER TABLE t FORCE" on the above
   table, install a special copy function to trim off the trailing spaces
   which we safely can say that the pre 5.0 mysqld didn't put there.
2006-11-09 12:00:27 +01: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
tsmith@quadxeon.mysql.com
f663ba45e5 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/g50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
2006-11-09 00:26:22 +01:00
bar@mysql.com/bar.intranet.mysql.r18.ru
9870d87f25 after merge fix for bug 23451. 2006-11-08 22:08:50 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
bd2529d0a1 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1-rpl
into  mysql.com:/usr/home/bar/mysql-4.1.b23451v2
2006-11-08 22:03:08 +04:00
cmiller@zippy.cornsilk.net
c6b028404d Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug10963/my50-bug10963
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-11-08 10:18:16 -05:00
cmiller@zippy.cornsilk.net
6260e12b99 Bug#10963: LEFT/RIGHT/SUBSTR/.. string functions returns wrong result \
on large length
  
Problem:  Most (all) of the numeric inputs were being coerced into
int (32 bit) sized variables.  Works OK for sane inputs; any input
larger than 2^32 (or 2^31 for signed vars) exihibited predictable
wrapping behavior (up to about 10^18) and then started having really
strange behaviour past that point (since the conversion to 64 bit int
from the DECIMAL type can do weird things on out of range numbers).

Solution: 1)  Add many tests.  2)  Convert input from (u)long type to
(u)longlong.  3)  Do (sometimes multiple) sanity checks on input,
keeping in mind that sometimes a negative longlong is not a negative
longlong (if the unsigned_flag is set).  4) Emulate existing behavior
w/rt negative and "small" out-of-bounds values.
2006-11-08 10:11:02 -05:00
bar@mysql.com/bar.intranet.mysql.r18.ru
ac3ce653b4 Merge mysql.com:/usr/home/bar/mysql-4.1.b23451v2
into  mysql.com:/usr/home/bar/mysql-5.0.b23451
2006-11-08 17:03:37 +04:00
sergefp@mysql.com
4a00e76e7a Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug8804-pfix
2006-11-08 14:43:17 +03:00
msvensson@neptunus.(none)
1717e280e0 Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-11-08 11:40:33 +01:00
aelkin/elkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi
7425499e8e Merge dsl-hkibras-fe30f900-107.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed
into  dsl-hkibras-fe30f900-107.dhcp.inet.fi:/home/elkin/MySQL/TEAM/BARE/mysql-4.1-rpl
2006-11-08 09:57:20 +02:00
sergefp@mysql.com
26c30f2f7d BUG#24056: Crash in subquery:
Don't assume that condition that was pushed down into subquery has 
produced exactly one KEY_FIELD element - it could produce several or
none at all, handle all of those cases.
2006-11-08 02:26:50 +03:00
gkodinov/kgeorge@rakia.gmz
edf194ab1f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B11032-5.0-opt
2006-11-07 21:25:49 +02:00
holyfoot/hf@mysql.com/deer.(none)
1e36f348e6 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/mysql-5.0.clean
2006-11-07 21:03:45 +04:00
holyfoot/hf@mysql.com/deer.(none)
9c9bf04650 bug fixed 2006-11-07 21:02:41 +04:00
gkodinov/kgeorge@macbook.gmz
299a0fe65d Merge macbook.gmz:/Users/kgeorge/mysql/work/B11032-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B11032-5.0-opt
2006-11-07 18:44:37 +02:00
gkodinov/kgeorge@macbook.gmz
cf1ca923fc Bug #11032: getObject() returns a String for a sub-query of type datetime
- When returning metadata for scalar subqueries the actual type of the
   column was calculated based on the value type, which limits the actual
   type of a scalar subselect to the set of (currently) 3 basic types : 
   integer, double precision or string. This is the reason that columns
   of types other then the basic ones (e.g. date/time) are reported as
   being of the corresponding basic type.
   Fixed by storing/returning information for the column type in addition
   to the result type.
2006-11-07 18:16:17 +02:00
mskold/marty@mysql.com/linux.site
f293350725 bug#21507 I can't create a unique hash index in NDB: Added possibillity to create hash only indexes with NULL valued attributes, but any NULL valued access will become full table scan with pushed condition on index attribute values 2006-11-07 16:38:37 +01:00
gkodinov@dl145s.mysql.com
28faf5e468 item.cc:
merge fixes
2006-11-07 14:39:20 +01:00
svoj@mysql.com/april.(none)
c7776b8a49 Merge mysql.com:/home/svoj/devel/mysql/BUG23312/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG23312/mysql-5.0-engines
2006-11-07 17:14:22 +04:00
svoj@mysql.com/april.(none)
24c7b22b4d Merge mysql.com:/home/svoj/devel/bk/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG23312/mysql-4.1-engines
2006-11-07 17:01:34 +04:00
lars/lthalmann@mysql.com/dl145h.mysql.com
aea1e14ef8 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
2006-11-07 12:02:53 +01:00
gkodinov@dl145s.mysql.com
ccf17e71b0 Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-4.1-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-11-07 11:53:48 +01:00
anozdrin/alik@alik.
7cf65fd309 Merge alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  alik.:/mnt/raid/alik/MySQL/devel/5.0-merged-5.0-rt
2006-11-07 13:45:56 +03:00
bar@mysql.com/bar.intranet.mysql.r18.ru
599b731660 Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character
Problem: GROUP_CONCAT on a multi-byte column can truncate
  in the middle of a multibyte character when applying
  group_concat_max_len limit. It produces an invalid
  multi-byte character in the result string.
  
The second, easier version - reusing old "warning_for_row" flag,
instead of introducing of "result_is_full" - which was
added in the previous commit.
2006-11-07 12:45:48 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
28abd4dd0d Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug19736/my50-bug19736
2006-11-07 11:49:09 +04:00
holyfoot/hf@mysql.com/deer.(none)
2942ab3f28 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663
2006-11-07 09:41:08 +04:00
cmiller@zippy.cornsilk.net
19cb3d3bf7 Fix after merge. 2006-11-06 20:41:18 -05:00
cmiller@zippy.cornsilk.net
40170fbf58 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my41-bug23411
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my50-bug23411
2006-11-06 17:45:47 -05:00
cmiller@zippy.cornsilk.net
87a5134b7c Bug#23411: ... MOD-ing zero returns strange result
The Item_func_mod objects never had maybe_null set, so users had no reason 
to expect that they can be NULL, and may therefore deduce wrong results.
Now, set maybe_null.
2006-11-06 17:13:19 -05:00
holyfoot/hf@mysql.com/deer.(none)
7ddb8b68fa bug #19491 (5.0-related additional fixes) 2006-11-06 22:33:18 +04:00
holyfoot/hf@mysql.com/deer.(none)
aa7a27d28b Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663
2006-11-06 15:04:58 +04:00
holyfoot/hf@mysql.com/deer.(none)
fca6f71435 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663
2006-11-06 14:57:47 +04:00
holyfoot/hf@mysql.com/deer.(none)
0d10dbe332 Merge abotchkov@production.mysql.com:mysql-5.0-opt
into  mysql.com:/home/hf/work/21790/my50-21790
2006-11-06 11:16:13 +04:00
holyfoot/hf@mysql.com/deer.(none)
50d199848b Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/19491/my50-19491
2006-11-06 11:10:08 +04: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
petr/cps@outpost.site
660c2f0cde Merge outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
into  outpost.site:/home/cps/mysql/trees/5.0-runtime-bug9191
2006-11-05 23:31:42 +03:00
petr/cps@outpost.site
51ff0db079 Add missing DBUG_RETURN() 2006-11-05 23:25:34 +03:00
gkodinov/kgeorge@macbook.gmz
77acba320d Bug #22457: Column alias in ORDER BY works, but not if in an expression
The parser is allocating Item_field for references by name in ORDER BY
 expressions. Such expressions however may point not only to Item_field 
 in the select list (or to a table column) but also to an arbitrary Item. 
 This causes Item_field::fix_fields to throw an error about missing 
 column.
 The fix substitutes Item_field for the reference with an Item_ref when 
 not pointing to Item_field.
2006-11-03 18:48:16 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
afffedc0e3 Fix for bug #19736 VIEW: column names not quoted properly when view is replicated
When we write 'query=...' string to a frm file for views on a slave, 
indentifiers are not properly quoted due to missing OPTION_QUOTE_SHOW_CREATE 
flag in the thd->options.

Fix: properly set thd->options for the slave thread.
2006-11-03 15:27:37 +04:00
cmiller@zippy.cornsilk.net
af5acac047 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-11-02 17:39:52 -05:00
cmiller@zippy.cornsilk.net
c34f3219b3 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2006-11-02 17:27:42 -05: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
b471ea50f7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
2006-11-02 01:21:37 +03: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
svoj@mysql.com/april.(none)
c71395ce25 BUG#23312 - server hangs 'closing tables' with insert delayed,flush
tables,alter table
Deadlock could happen if there are delayed insert + flush tables + alter table
running concurrently.

This is fixed by removing a redundant mutex lock when killing a delayed thread.
2006-11-02 00:05:02 +04: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
dlenev@mockturtle.local
5961d4721f Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-hash-2
2006-11-01 16:20:15 +03:00
dlenev@mockturtle.local
bd1b57f930 Small cleanup in code handling stored routines/table prelocking.
Use lazy initialization for Query_tables_list::sroutines hash.
This step should significantly decrease amount of memory consumed
by stored routines as we no longer will allocate chunk of memory
required for this HASH for each statement in routine.
2006-11-01 15:41:48 +03:00
holyfoot/hf@mysql.com/deer.(none)
5f42ec19b7 Merge mysql.com:/home/hf/work/19491/my50-19491
into  mysql.com:/home/hf/work/mysql-5.0.19491
2006-11-01 15:41:51 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
c378d3a1ec Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b22877
2006-11-01 12:34:42 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
ac9e3db9a7 Bug#22877 replication character sets get out of
sync using replicate-wild-ignore-table
Problem: changes in character set variables
before an action on an replication-ignored table
makes slave to forget new variable values.
Fix: initialize one_shot variables only when
4.1 -> 5.x replication is running.
2006-11-01 12:30:01 +04: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
sergefp@mysql.com
d778401633 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug8804-r4
2006-11-01 00:54:49 +03:00
sergefp@mysql.com
e59f19177e BUG#8804: Incorrect results for NULL IN (SELECT ...): review fixes:
- Better comments
- Remove redundant and dead code.
2006-11-01 00:27:51 +03:00
sergefp@mysql.com
cc05fbd7b0 BUG#8804: Better comment + TODO section with suggestion how to speedup
the fix.
2006-10-31 21:30:40 +03:00
sergefp@mysql.com
54a713aac5 BUG#8804: wrong results for NULL IN (SELECT ...)
Evaluate "NULL IN (SELECT ...)" in a special way: Disable pushed-down 
conditions and their "consequences": 
 = Do full table scans instead of unique_[index_subquery] lookups.
 = Change appropriate "ref_or_null" accesses to full table scans in
   subquery's joins.
Also cache value of NULL IN (SELECT ...) if the SELECT is not correlated 
wrt any upper select.
2006-10-31 20:51:09 +03:00
holyfoot/abotchkov@mysql.com/production.mysql.com
f07e4b996e Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/usersnfs/abotchkov/mysql-5.0-opt1
2006-10-31 18:47:53 +01:00
gkodinov/kgeorge@rakia.gmz
1c6ede6aac Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B21809-5.0-opt
2006-10-31 16:15:35 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
b1e77ed1fd Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22723/my50-bug22723
2006-10-31 13:28:44 +04:00
gkodinov/kgeorge@rakia.gmz
ece8a99ff4 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B23184-5.0-opt
2006-10-31 11:07:27 +02:00
gkodinov/kgeorge@macbook.gmz
6cd1f7b2e5 Bug #23184: SELECT causes server crash
Item::val_xxx() may be called by the server several times at execute time 
 for a single query. Calls to val_xxx() may be very expensive and sometimes
 (count(distinct), sum(distinct), avg(distinct)) not possible.
 To avoid that problem the results of calculation for these aggregate 
 functions are cached so that val_xxx() methods just return the calculated 
 value for the second and subsequent calls.
2006-10-31 11:01:27 +02:00
msvensson@shellback.(none)
1d5abe60ff Bug#22958 Com_create_user missing within 5.0
- Add Com_create_user to SHOW STATUS command
2006-10-30 15:59:47 +01: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
77f1d01fbb Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-runtime
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug21915
2006-10-30 17:58:56 +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
msvensson@shellback.(none)
e8c7f19179 Improve comments around FLUSH STATUS
It's not possible to flush the global status variables in 5.0
Update test case so it works by recording the value of handle_rollback
before and compare it to the value after
2006-10-30 13:35:57 +01:00
bar@mysql.com/bar.intranet.mysql.r18.ru
d18fcb3a0f Bug#20404: SHOW CREATE TABLE fails with Turkish I
Problem: SHOW CREATE TABLE printed garbage in table
  name for tables having TURKISH I
  (i.e. LATIN CAPITABLE LETTER I WITH DOT ABOVE)
  when lower-case-table-name=1.
  
  Reason: In some cases during lower/upper conversion in utf8,
  the result string can be shorter the original string
  (including the above letter). Old implementation of caseup_str()
  and casedn_str() didn't handle the result length properly,
  assuming that length cannot change.
  
  This fix changes the result type of cs->cset->casedn_str()
  and cs->cset->caseup_str() from VOID to UINT, to return
  the result length, as well as put '\0' terminator on a 
  proper place.
  
  Also, my_caseup_str_utf8() and my_casedn_str_utf8() were 
  rewritten not to use strlen() for performance purposes.
  It was done with help of adding of new functions - my_utf8_uni_no_range()
  and my_uni_utf8_no_range() - for null terminated strings.
2006-10-30 14:40:15 +04:00
kostja@bodhi.local
dfc4dd423c A cleanup. 2006-10-30 12:03:42 +03:00
kostja@bodhi.local
8143148bc1 Cleanup. 2006-10-30 11:36:30 +03:00
bar@mysql.com/bar.intranet.mysql.r18.ru
28eaf5ff75 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b18908
2006-10-30 10:16:18 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
0e3a1eece7 Bug#18908: ERROR 1406 (22001): Data too long for column :: using utf8
Problem: Too confusing error message when cannot convert
between string and column character sets on INSERT and UPDATE.
Fix: producing a better error message, instead of "Data too long"
in such cases
Additional changes: Adding "DROP TABLE IF EXISTS" into several
tests to be safe against failures in previous tests.
2006-10-30 10:14:03 +04:00
holyfoot/hf@mysql.com/deer.(none)
18577a8e8f Bug #8663 (cant use bigint as input to CAST)
decimal->ulong conversion fixed to assign max possible ULONG if decimal
is bigger
Item_func_unsigned now handles DECIMAL parameter separately as we can't
rely on decimal::val_int result here.
2006-10-30 09:52:50 +04:00
jonas@perch.ndb.mysql.com
b67e5b1131 Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
2006-10-27 23:59:04 +02:00
jonas@perch.ndb.mysql.com
dc2ca8ca10 Merge perch.ndb.mysql.com:/home/jonas/src/mysql-4.1
into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-ndb
2006-10-27 23:56:51 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
c6ee81f0ed Fix for bug #23412: delete rows with null date field
Backport of the fix for bug #8143: A date with value 0 is treated as a NULL value
2006-10-27 18:08:50 +05:00
kroki/tomash@moonlight.intranet
43e84da003 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug22584
2006-10-27 13:47:45 +04:00
kroki/tomash@moonlight.intranet
0e0f7a0423 BUG#22584: last_insert_id not updated after inserting a record through
a updatable view.

When there's a VIEW on a base table that have AUTO_INCREMENT column, and
this VIEW doesn't provide an access such column, after INSERT to such
VIEW LAST_INSERT_ID() did not return the value just generated.

This behaviour is intended and correct, because if the VIEW doesn't list
some columns then these columns are effectively hidden from the user,
and so any side effects of inserting default values to them.

However, there was a bug that such statement inserting into a view would
reset LAST_INSERT_ID() instead of leaving it unchanged.

This patch restores the original value of LAST_INSERT_ID() instead of
resetting it to zero.
2006-10-27 13:32:41 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
6995d2f29f Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22158/my50-bug22158
2006-10-27 14:14:57 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
7b90a45425 Fix for bug #22158: Errors in init_connect terminate connections silently
When executing the init_connect statement, thd->net.vio is set to 0, to         
forbid sending any results to the client. As a side effect we don't log         
possible errors, either.                                                        
                                                                                
Now we write warnings to the error log if an init_connect query                
fails.
2006-10-26 14:51:34 +05:00
kroki/tomash@moonlight.intranet
99baff565e Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18819
2006-10-25 20:16:39 +04:00
kroki/tomash@moonlight.intranet
fa60a03073 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-runtime
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug18819
2006-10-25 20:13:07 +04:00
kroki/tomash@moonlight.intranet
c8bb2f396a Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug18819
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18819
2006-10-25 20:00:51 +04:00
kroki/tomash@moonlight.intranet
b7b991cec3 BUG#18819: DELETE IGNORE hangs on foreign key parent delete
If the error happens during DELETE IGNORE, nothing could be send to the
client, thus leaving it frozen expecting the reply.

The problem was that if some error occurred, it wouldn't be reported to
the client because of IGNORE, but neither success would be reported.

MySQL 4.1 would not freeze the client, but will report

  ERROR 1105 (HY000): Unknown error

instead, which is also a bug.

The solution is to report success if we are in DELETE IGNORE and some
non-fatal error has happened.
2006-10-25 19:53:26 +04:00
holyfoot/hf@mysql.com/deer.(none)
4fb00857ca bug #19491 (CAST do DATETIME wrong result) 2006-10-25 20:14:39 +05:00
lars/lthalmann@mysql.com/dl145h.mysql.com
4743fb6902 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
2006-10-25 17:10:18 +02:00
mskold/marty@mysql.com/linux.site
7ad30e80f1 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into  mysql.com:/windows/Linux_space/MySQL/mysql-4.1-ndb
2006-10-25 15:17:44 +02:00
mskold/marty@mysql.com/linux.site
c14c547289 Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2006-10-25 12:41:42 +02:00
mskold/marty@mysql.com/linux.site
0dea24947d Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0
2006-10-25 12:21:45 +02:00
mskold/marty@mysql.com/linux.site
deb26a93e5 Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-4.1-ndb
2006-10-25 11:45:47 +02:00
mskold/marty@mysql.com/linux.site
44e55e3b43 Bug #21072 Duplicate key error in NDB references wrong key: Re-wrote string usage to avoid valgrind warnings 2006-10-25 11:44:40 +02:00
stewart@willster.(none)
a4faddc64f Merge bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into  willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2-merge2
2006-10-25 17:24:20 +10:00
jonas@perch.ndb.mysql.com
6e4a0ec042 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
2006-10-25 08:28:30 +02:00
tsmith/tim@siva.hindu.god
3af2089b13 Merge siva.hindu.god:/usr/home/tim/m/bk/g50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-10-24 14:42:08 -06:00
holyfoot/hf@mysql.com/deer.(none)
8972d77b27 Merge abotchkov@production.mysql.com:mysql-5.0-opt1
into  mysql.com:/home/hf/work/current_stmt/my50-current_stmt
2006-10-24 18:49:04 +05:00
stewart@willster.(none)
dc38d0249a fix ndb_cache_multi2
util thread wasn't behaving correctly after 241 error due to get_table_statistics
not properly returning an error code
2006-10-24 23:26:58 +10:00
holyfoot/hf@mysql.com/deer.(none)
f95645ac36 Merge bk@192.168.21.1:mysql-4.1-opt
into  mysql.com:/home/hf/work/0current_stmt/my41-current_stmt
2006-10-24 17:55:30 +05:00
holyfoot/hf@mysql.com/deer.(none)
887e6af60c Merge mysql.com:/home/hf/work/0current_stmt/my41-current_stmt
into  mysql.com:/home/hf/work/current_stmt/my50-current_stmt
2006-10-24 17:50:46 +05:00
gkodinov/kgeorge@macbook.gmz
932d86bbb9 Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
The SQL parser was using Item::name to transfer user defined function attributes
to the user defined function (udf). It was not distinguishing between user defined 
function call arguments and stored procedure call arguments. Setting Item::name 
was causing Item_ref::print() method to print the argument as quoted identifiers 
and caused views that reference aggregate functions as udf call arguments (and 
rely on Item::print() for the text of the view to store) to throw an undefined 
identifier error.
Overloaded Item_ref::print to print aggregate functions as such when printing
the references to aggregate functions taken out of context by split_sum_func2()
Fixed the parser to properly detect using AS clause in stored procedure arguments
as an error.
Fixed printing the arguments of udf call to print properly the udf attribute.
2006-10-24 15:26:41 +03:00
holyfoot/hf@mysql.com/deer.(none)
d0ef58b6a4 Bug #23427 (incompatible ABI change)
the incompatibility was caused by current_stmt member added to the MYSQL
structure.
It's possible to move it to THD structure instead which saves ABI
2006-10-24 17:19:02 +05:00
mskold/marty@mysql.com/linux.site
8da80dd39d Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2006-10-24 08:29:37 +02:00
stewart@willster.(none)
826628c99b post merge fix 2006-10-24 00:18:57 +10:00
stewart@willster.(none)
3c2eeb2c15 Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2-merge2
into  willster.(none):/home/stewart/Documents/MySQL/5.0/ndb
2006-10-23 23:57:28 +10:00
stewart@willster.(none)
5926602aa7 Bug #19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
fixes for ndb_* tests broken by previous fix

be more careful in ndb about setting errors on failure of info call (especially
in open)
2006-10-23 23:46:35 +10:00
stewart@willster.(none)
fc776db8e7 Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2
into  willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2-merge2
2006-10-23 23:43:48 +10:00
andrey@example.com
6237be99d0 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  example.com:/work/bug23037/my50
2006-10-23 15:21:23 +02:00
andrey@example.com
389c6a019e Fix for bug#23037 Bug in field "Default" of query "SHOW COLUMNS FROM table"
To the documentor: The DEFAULT value in SHOW COLUMNS/SELECT FROM I_S.COLUMNS
was truncated to NAME_LEN (which effectively is 64) characters.
2006-10-23 13:12:30 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
7ad7d6e324 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  mysql.com:/usr/home/ram/work/bug20732/my41-bug20732
2006-10-23 13:25:24 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
1f65242652 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
2006-10-23 13:18:56 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
dd2a1d1e96 Merge mysql.com:/usr/home/ram/work/mysql-4.1-maint
into  mysql.com:/usr/home/ram/work/bug20732/my41-bug20732
2006-10-23 12:58:20 +05:00
kostja@bodhi.local
0ef2ae34e7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
2006-10-23 11:51:45 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
a67472f289 Merge mysql.com:/usr/home/ram/work/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
2006-10-23 12:44:25 +05:00
igor@rurik.mysql.com
2ab34bac4b Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-10-20 12:43:01 -07:00
igor@rurik.mysql.com
d8a8369454 Adjustments after the merge for bug 23478. 2006-10-20 12:41:27 -07:00
tsmith/tim@siva.hindu.god
8998ecbc21 Merge siva.hindu.god:/usr/home/tim/m/bk/inno/50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-10-20 13:28:47 -06:00
tsmith/tim@siva.hindu.god
deee020489 Apply InnoDB snapshot ss923
Fixes:
- Bug #18077: InnoDB uses full explicit table locks in stored FUNCTION
2006-10-20 12:34:31 -06:00
igor@rurik.mysql.com
a771364196 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-10-20 10:08:58 -07:00
igor@rurik.mysql.com
c6663c32db Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-10-20 09:26:01 -07:00
dlenev@mockturtle.local
384f0fee0d Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg15228-2
2006-10-20 16:05:23 +04:00
dlenev@mockturtle.local
3fce634fc1 Fix for bug#15228 "'invalid access to non-static data member'
warnings in sql_trigger.cc and sql_view.cc".

According to the current version of C++ standard offsetof() macro
can't be used for non-POD types. So warnings were emitted when we
tried to use this macro for TABLE_LIST and Table_triggers_list
classes. Note that despite of these warnings it was probably safe
thing to do.

This fix tries to circumvent this limitation by implementing
custom version of offsetof() macro to be used with these
classes. This hack should go away once we will refactor
File_parser class.

Alternative approaches such as disabling this warning for
sql_trigger.cc/sql_view.cc or for the whole server were
considered less explicit. Also I was unable to find a way
to disable particular warning for particular _part_ of
file in GCC.
2006-10-20 15:47:52 +04:00
kaa@polly.local
fdbb0d2a00 Merge polly.local:/tmp/maint/bug23256/mysql-5.0-maint
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
2006-10-20 14:45:34 +04:00
kaa@polly.local
c06f64e814 Merge polly.local:/tmp/maint/bug23256/mysql-4.1-maint
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-10-20 14:44:22 +04:00
kaa@polly.local
165e2f156c Merge polly.local:/tmp/maint/bug23256/mysql-4.1-maint
into  polly.local:/tmp/maint/bug23256/mysql-5.0-maint
2006-10-20 14:32:31 +04:00
kaa@polly.local
4d93069773 Fix for bug #23256 "doesn't build on alpha"
- compilation on the Alpha platform was broken because the Alpha-specific code was not updated after replacing the SIGRETURN_FRAME_COUNT constant with a variable
2006-10-20 14:31:47 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
0bbae9b3c5 Fix for bug #22723: Host field blank when server started with skip-grant
We set 'host_or_ip' to "" in the Security_context::skip_grants().
2006-10-20 15:08:25 +05: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
0612a212d1 Merge bk-internal:/home/bk/mysql-4.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
2006-10-20 10:57:38 +02:00
igor@rurik.mysql.com
d8b6f46a39 Fixed bug #23478.
If elements a not top-level IN subquery were accessed by an index and 
the subquery result set included  a NULL value then the quantified
predicate that contained the subquery was evaluated to NULL when 
it should return a non-null value.
2006-10-19 23:05:53 -07:00
malff/marcsql@weblab.(none)
ea0998caca Bug#20028 (Function with select return no data)
This patch reverts a change introduced by Bug 6951, which incorrectly
set thd->abort_on_warning for stored procedures.

As per internal discussions about the SQL_MODE=TRADITIONAL,
the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE
trigger.

Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE
have been included or revised, to reflect the intended behavior.

(reposting approved patch, to work around source control issues, no review needed)
2006-10-19 11:39:51 -07:00
mskold/marty@mysql.com/linux.site
6961bd6315 Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2006-10-19 15:08:10 +02:00
gkodinov@dl145s.mysql.com
c77fae407b Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-10-19 15:04:12 +02:00
mskold/marty@mysql.com/linux.site
b97dff67c9 Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0
2006-10-19 15:00:46 +02:00
mskold/marty@mysql.com/linux.site
3a4ca6d736 Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-4.1-ndb
2006-10-19 14:58:43 +02:00
mskold/marty@mysql.com/linux.site
240cd87dbf Bug #21072 Duplicate key error in NDB references wrong key: use MAX_KEY to signal unknown key: Added string initialization 2006-10-19 14:57:04 +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
gkodinov@dl145s.mysql.com
1dacdd4c85 Merge dl145s.mysql.com:/data/bk/team_tree_merge/mysql-4.1
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
2006-10-19 14:34:56 +02:00
svoj@mysql.com/april.(none)
b6f909bf1b Merge mysql.com:/home/svoj/devel/mysql/BUG22562/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/engines/mysql-4.1-engines
2006-10-19 17:33:22 +05: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
ramil/ram@mysql.com/myoffice.izhnet.ru
f6ea36c3a5 Merge mysql.com:/usr/home/ram/work/bug20732/my41-bug20732
into  mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
2006-10-19 16:15:30 +05:00
kroki/tomash@moonlight.intranet
dea0028cd9 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21856
2006-10-19 14:53:50 +04:00
kroki/tomash@moonlight.intranet
00b2fc6aff BUG#21856: Prepared Statements: crash if bad create
When statement to be prepared contained CREATE PROCEDURE, CREATE FUNCTION
or CREATE TRIGGER statements with a syntax error in it, the preparation
would fail with syntax error message, but the memory could be corrupted.

The problem occurred because we switch memroot when parse stored
routine or trigger definitions, and on parse error we restored the
original memroot only after performing some memory operations.  In more
detail:
 - prepared statement would activate its own memory root to parse
   the definition of the stored procedure.
 - SP would reset this memory root with its own memory root to
   parse SP statements
 - a syntax error would happen
 - prepared statement would restore the original memory root
 - stored procedure would restore what it thinks was the original
   memory root, but actually was the statement memory root.
That led to double free - in destruction of the statement and in
a next call to mysql_parse().

The solution is to restore memroot right after the failed parsing.
2006-10-19 14:43:52 +04:00
andrey@example.com
5a510c7299 Merge example.com:/work/bug23379/my41-bug23379
into  example.com:/work/bug23379/my50-bug23379
2006-10-19 11:39:19 +02:00
andrey@example.com
102d36b7f6 Fix for bug#23379 "wrong time value in SHOW PROCESSLIST"
The value taken to be shown in SHOW PROCESSLIST is not
initialized when THD is created and will be random for
unauthenticated connections.
  
To the documentor: Random value, instead of NULL, was shown,
in SHOW PROCESSLIST for still non-authenticated connections.
2006-10-19 11:37:07 +02:00
msvensson@neptunus.(none)
6573fed1c7 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-19 11:35:10 +02:00
istruewing@chilla.local
11d453cc33 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  chilla.local:/home/mydev/mysql-5.0-merge
2006-10-19 09:59:01 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
0027b6e4b7 Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
We miss some records sometimes using RANGE method if we have
partial key segments.
Example:
  Create table t1(a char(2), key(a(1)));
  insert into t1 values ('a'), ('xx');
  select a from t1 where a > 'x';
We call index_read() passing 'x' key and HA_READ_AFTER_KEY flag
in the handler::read_range_first() wich is wrong because we have
a partial key segment for the field and might miss records like 'xx'.

Fix: don't use open segments in such a case.
2006-10-19 12:52:37 +05:00
jonas@perch.ndb.mysql.com
470e4daa14 Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
2006-10-19 09:38:37 +02:00
jonas@perch.ndb.mysql.com
2b04fb22be ndb - bug#23200
this changes lock taken during peek, to decrease likelyhood of transaction abort
2006-10-19 09:27:58 +02:00
msvensson@neptunus.(none)
4cf0a5ee74 Merge neptunus.(none):/home/msvensson/mysql/bug17039/my50-bug17039
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-19 00:10:36 +02:00
andrey@example.com
b53f83881e Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  example.com:/work/bug23379/my41-bug23379
2006-10-18 20:07:28 +02:00
andrey@example.com
9010a79527 Fix for bug#23379 "wrong time value in SHOW PROCESSLIST"
The value taken to be shown in SHOW PROCESSLIST is not
initialized when THD is created and will be random for
unauthenticated connections.

To the documentor: Random value, instead of NULL, was shown,
in SHOW PROCESSLIST for still non-authenticated connections.
2006-10-18 18:17:41 +02:00
mskold/marty@mysql.com/linux.site
0522b11066 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2006-10-18 16:41:17 +02:00
mskold/marty@mysql.com/linux.site
9f686a4c99 Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-4.1-ndb
2006-10-18 16:34:43 +02:00
mskold/marty@mysql.com/linux.site
b381ed95d9 Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
2006-10-18 14:28:18 +02:00
kroki/tomash@moonlight.intranet
9fd2c86103 Fix for valgrind warning introduced by the fix for bug#21354:
(COUNT(*) = 1) not working in SELECT inside prepared statement.
Note: the warning was introduced in 5.0 and 5.1, 4.1 is OK with the
original fix.

The problem was that in 5.0 and 5.1 clear() for group functions may
access hybrid_type member, and this member is initialized in
fix_fields().

So we should not call clear() from item cleanup() methods, as cleanup()
may be called for unfixed items.
2006-10-18 15:20:34 +04:00
evgen@sunlight.local
8fd7ea23d6 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  sunlight.local:/local_work/14959-bug-5.0-opt-mysql
2006-10-18 00:15:14 +04:00
evgen@sunlight.local
0c5a2865f7 sql_rename.cc:
Cleanup of fix for bug#14959.
2006-10-18 00:14:14 +04:00
igor@rurik.mysql.com
17eb0b353e Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-10-17 12:25:53 -07:00
igor@rurik.mysql.com
c4c9fe63db Merge rurik.mysql.com:/home/igor/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug19579
2006-10-17 10:07:29 -07:00
cmiller@zippy.cornsilk.net
7714fea9a2 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint_20061016
2006-10-17 12:31:52 -04:00
gkodinov/kgeorge@macbook.gmz
8e7f0fe785 rename of the new members introduced in the fix for bug 21798 2006-10-17 19:22:13 +03:00
cmiller@zippy.cornsilk.net
3a709f50b2 Fix previous bad patch for Bug#14262.
Remove table engine qualification where it's unnecessary.
2006-10-17 11:06:11 -04: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
ramil/ram@mysql.com/myoffice.izhnet.ru
d39a012441 Fix for bug #22229: Bug in DATE_ADD()
From the manual:
date arithmetic operations require complete dates and do not work with
incomplete dates such as '2006-07-00' or badly malformed dates.
2006-10-17 16:30:49 +05:00
kroki/tomash@moonlight.intranet
656b643276 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-runtime
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug21726
2006-10-17 13:41:29 +04:00
istruewing@chilla.local
647dee0316 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  chilla.local:/home/mydev/mysql-4.1-bug12240
2006-10-17 09:33:58 +02:00
tsmith/tim@siva.hindu.god
df200bd018 Merge siva.hindu.god:/usr/home/tim/m/bk/b19764/50
into  siva.hindu.god:/usr/home/tim/m/bk/tmp/mrgOct16/50
2006-10-16 20:15:14 -06:00
igor@rurik.mysql.com
c467be8d6e Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
In some cases this resulted in choosing non-optimal execution plans.
Now info of such potentially saragable predicates is saved in
an array and after reading const tables we check whether this
predicates has become saragable.
2006-10-16 14:25:28 -07:00
gkodinov/kgeorge@rakia.(none)
a5899ea863 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B22342-5.0-opt
2006-10-16 19:46:02 +03:00
gkodinov/kgeorge@macbook.gmz
0e954d2c1a Bug #22342: No results returned for query using max and group by
When using index for group by and range access the server isolates    
 a set of ranges based on the conditions over the key parts of the
 index used. Then it uses only the ranges over the GROUP BY fields to
 jump from one group to another. Since the GROUP BY fields may form a
 prefix over the index, we may use only a prefix of the ranges produced
 by the range optimizer.
 Each range contains a notion on whether it includes its border values.
 The problem is that when using a range prefix, the last range is open
 because it assumes that there is a range on the next keypart. Thus when
 we use a prefix range as it is, it excludes all border values.
 The solution is when ignoring the suffix of the range conditions 
 (to jump over the GROUP BY prefix only) the server must change the 
 remaining intervals so they always contain their borders, e.g. 
 if the whole range was :
 (1,-inf) <= (<group_by_col>,<min_max_arg_col>) < (1, 3) we must make
 (1) <= (<group_by_col>) <= (1) because (a,b) < (c1,c2) means :
 a < c1 OR (a = c1 AND b < c2).
2006-10-16 19:30:19 +03:00
istruewing@chilla.local
b14e9a7ad5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  chilla.local:/home/mydev/mysql-5.0-bug12240
2006-10-16 17:12:57 +02:00
gkodinov/kgeorge@macbook.gmz
abad78f455 Merge bk-internal:/home/bk/mysql-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B14019-5.0-opt
2006-10-16 16:28:13 +03:00
gkodinov/kgeorge@rakia.(none)
623df6b128 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B14019-4.1-opt
2006-10-16 14:42:51 +03:00
istruewing@chilla.local
9f4d8208da Merge chilla.local:/home/mydev/mysql-4.1-bug12240
into  chilla.local:/home/mydev/mysql-5.0-bug12240
2006-10-16 13:15:15 +02:00
gkodinov/kgeorge@macbook.gmz
dff0a1ac7c Merge macbook.gmz:/Users/kgeorge/mysql/work/B14019-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B14019-5.0-opt
2006-10-16 13:24:54 +03:00
gkodinov/kgeorge@macbook.gmz
115616381d BUG#14019 : group by converts literal string to column name
When resolving unqualified name references MySQL was not
   checking what is the item type for the reference. Thus
   e.g a string literal item that has by convention a name
   equal to its string value will also work as a reference to 
   a SELECT list item or a table field.
   Fixed by allowing only Item_ref or Item_field to referenced by
   (unqualified) name.
2006-10-16 13:10:25 +03:00
mskold/marty@mysql.com/linux.site
e7f69b424a Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0
2006-10-16 10:07:19 +02:00
stewart@willster.(none)
fff4559edd BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
update federated for fix
2006-10-16 17:41:29 +10:00
stewart@willster.(none)
c1903d967a Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2
into  willster.(none):/home/stewart/Documents/MySQL/5.0/bug19914-mk2-merge
2006-10-16 17:39:38 +10:00
mskold/marty@mysql.com/linux.site
aafe6e4663 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0
2006-10-16 08:33:22 +02:00
msvensson@shellback.(none)
f60e544902 Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-14 17:31:04 +02: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
ramil/ram@mysql.com/myoffice.izhnet.ru
0e3ccedd6b Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  mysql.com:/usr/home/ram/work/bug23254/my41-bug23254
2006-10-13 21:12:07 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
23727a851b Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug23254/my50-bug23254
2006-10-13 21:09:20 +05:00
cmiller@zippy.cornsilk.net
adea21fd1c Merge fix-up. 2006-10-13 10:57:50 -04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
84048dc763 Merge mysql.com:/usr/home/ram/work/bug23254/my41-bug23254
into  mysql.com:/usr/home/ram/work/bug23254/my50-bug23254
2006-10-13 19:09:22 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
31402835d4 Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL
We don't set null_value to 0 in the Item_func_compress::val_str() for 
not-NULL results.
2006-10-13 19:05:54 +05:00
cmiller@zippy.cornsilk.net
87ba07e832 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug14262/my50-bug14262
2006-10-13 08:57:15 -04:00
tsmith/tim@siva.hindu.god
0e3cfe02ec Bug #19764: SHOW commands end up in the slow log as table scans
Do not consider SHOW commands slow queries, just because they don't use proper indexes.

This bug fix is not needed in 5.1, and the code changes will be null merged.  However, the test cases will be propogated up to 5.1.
2006-10-12 17:10:34 -06:00
msvensson@shellback.(none)
1b06c7c78e Merge shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint-new
2006-10-12 17:37:59 +02:00
kroki/tomash@moonlight.intranet
9e942999d6 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug20953
2006-10-12 18:33:07 +04:00
kroki/tomash@moonlight.intranet
591c06d4b7 BUG#20953: create proc with a create view that uses local vars/params
should fail to create

The problem was that this type of errors was checked during view
creation, which doesn't happen when CREATE VIEW is a statement of
a created stored routine.

The solution is to perform the checks at parse time.  The idea of the
fix is that the parser checks if a construction just parsed is allowed
in current circumstances by testing certain flags, and this flags are
reset for VIEWs.

The side effect of this change is that if the user already have
such bogus routines, it will now get a error when trying to do

  SHOW CREATE PROCEDURE proc;

(and some other) and when trying to execute such routine he will get

  ERROR 1457 (HY000): Failed to load routine test.p5. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)

However there should be very few such users (if any), and they may
(and should) drop these bogus routines.
2006-10-12 18:02:57 +04:00
kaa@polly.local
8c88bb4eaa Merge polly.local:/tmp/maint/bug22728/my41-bug22728
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-10-12 13:39:52 +04:00
holyfoot/hf@mysql.com/deer.(none)
edc9026842 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/mysql-5.0.mrg
2006-10-12 13:50:22 +05:00
kaa@polly.local
1ceb8d34ad Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
2006-10-12 12:12:09 +04:00
kaa@polly.local
2667443173 Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
2006-10-12 11:28:44 +04:00