Commit graph

1185 commits

Author SHA1 Message Date
cmiller@zippy.cornsilk.net
4c9af55908 Bug#28984: crasher on connect with out of range password length in \
protocol

Fixed duplicated code, same as last commit.

One could send a malformed packet that caused the server to SEGV.  In 
recent versions of the password protocol, the client tells the server 
what length the ciphertext is (almost always 20).  If that length was
large enough to overflow a signed char, then the number would jump to 
very large after being casted to unsigned int.

Instead, cast the *passwd char to uchar.
2007-06-12 08:47:36 -04:00
cmiller@zippy.cornsilk.net
4584ac2c73 Bug #28984: crasher on connect with out of range password length in \
protocol

One could send a malformed packet that caused the server to SEGV.  In 
recent versions of the password protocol, the client tells the server 
what length the ciphertext is (almost always 20).  If that length was
large enough to overflow a signed char, then the number would jump to 
very large after being casted to unsigned int.

Instead, cast the *passwd char to uchar.
2007-06-08 16:10:53 -04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
f4060b4b81 Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE
Added missed DROP privilege check on the original table for RENAME TABLE command.
2007-04-17 16:52:50 +05:00
svoj@mysql.com/april.(none)
cb132bea8f BUG#26881 - Large MERGE tables report incorrect specification when no
differences in tables
Certain merge tables were wrongly reported as having incorrect definition:
- Some fields that are 1 byte long (e.g. TINYINT, CHAR(1)), might
  be internally casted (in certain cases) to a different type on a
  storage engine layer. (affects 4.1 and up)
- If tables in a merge (and a MERGE table itself) had short VARCHAR column (less
  than 4 bytes) and at least one (but not all) tables were ALTER'ed (even to an
  identical table: ALTER TABLE xxx ENGINE=yyy), table definitions went ouf of
  sync. (affects 4.1 only)

This is fixed by relaxing a check for underlying conformance and setting
field type to FIELD_TYPE_STRING in case varchar is shorter than 4
when a table is created.
2007-03-13 18:02:06 +04:00
malff/marcsql@weblab.(none)
14e1ed367e Merge weblab.(none):/home/marcsql/TREE/mysql-4.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-4.1-runtime
2007-03-01 05:59:16 -07:00
thek@kpdesk.mysql.com
8f24815af1 Merge kpdesk.mysql.com:/home/thek/dev/bug23240/my41-bug23240
into  kpdesk.mysql.com:/home/thek/dev/mysql-4.1-runtime
2007-02-19 15:26:07 +01:00
thek@kpdesk.mysql.com
dd41fd5732 Bug#23240 --init-file statements with NOW() reports '1970-01-01 11:00:00'as the date time
- Starting time of a query sent by file bootstrapping wasn't initialized
  and starting time defaulted to 0. This later used value by the Now-
  item and is translated to 1970-01-01 11:00:00.
- marking the time with thd->set_time() before the call to 
  mysql_parse resolves this issue.
2007-02-19 09:37:34 +01: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
7eaa82ea38 Bug#22943 syscall pruning in libmysql
- Set the timeout values only where needed
2007-01-29 14:31:48 +01:00
tsmith@siva.hindu.god
6fd02a439f Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/41
into  siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/41
2007-01-18 09:53:30 -07: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
6399db740e Fix a failure of lowercase_tables2 test on powermacg5, introduced
by the patch for Bug#4968
2007-01-17 15:46:30 +03:00
msvensson@pilot.mysql.com
8154355a07 Merge pilot.mysql.com:/home/msvensson/mysql/mysql-4.1
into  pilot.mysql.com:/home/msvensson/mysql/mysql-4.1-maint
2007-01-17 11:13:03 +01:00
kostja@bodhi.local
d49ac4fbb7 A post-merge fix. 2007-01-15 23:25:16 +03:00
lars/lthalmann@mysql.com/dl145j.mysql.com
22398faa91 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-4.1-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-4.1-merge
2007-01-12 12:21:44 +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
Kristofer.Pettersson@naruto.
ecbb4eb987 Bug#17498 failed to put data file in custom directory use "data directory" option
- Using DATA/INDEX DIRECTORY option on Windows put data/index file into
  default directory because the OS doesn't support readlink().
- The procedure for changing data/index file directory is 
  different under Windows.
- With this fix we report a warning if DATA/INDEX option is used,
  but OS doesn't support readlink().
2006-12-07 17:01:00 +01:00
svoj@mysql.com/april.(none)
e17d7bce00 BUG#23404 - ROW_FORMAT=FIXED option is lost is an index is added to the
table

ROW_FORMAT option is lost during CREATE/DROP INDEX.

This fix forces CREATE/DROP INDEX to retain ROW_FORMAT by instructing
mysql_alter_table() that ROW_FORMAT is not used during creating/dropping
indexes.
2006-12-07 18:32:40 +04: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
kroki/tomash@moonlight.intranet
ee0cebf9a7 BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID.
Note: bug#21726 does not directly apply to 4.1, as it doesn't have stored
procedures.  However, 4.1 had some bugs that were fixed in 5.0 by the
patch for bug#21726, and this patch is a backport of those fixes.
Namely, in 4.1 it fixes:

  - LAST_INSERT_ID(expr) didn't return value of expr (4.1 specific).

  - LAST_INSERT_ID() could return the value generated by current
    statement if the call happens after the generation, like in

      CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY, j INT);
      INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());

  - Redundant binary log LAST_INSERT_ID_EVENTs could be generated.
2006-10-06 13:34:07 +04:00
gluh@mysql.com/gluh.(none)
a039376c43 Patch for bug#21432 is reverted 2006-09-27 17:49:16 +05:00
gkodinov/kgeorge@rakia.(none)
68b9ae4d14 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21392-4.1-opt
2006-09-05 13:12:30 +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
gluh@mysql.com/gluh.(none)
af9895d4c2 Bug#20393 User name truncation in mysql client
Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
2006-08-30 15:56:17 +05:00
evgen@moonbone.local
40a1fbdffb Merge moonbone.local:/work/tmp_merge-4.1
into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-08-02 16:10:52 +04:00
sergefp@mysql.com
bffd438de3 BUG#20975: Incorrect query result for NOT (subquery):
Add implementations of Item_func_{nop,not}_all::neg_transformer
2006-07-21 03:04:04 +04:00
holyfoot/hf@mysql.com/deer.(none)
eddaafb12b Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/work/mysql-4.1.16017
2006-07-13 22:32:18 +05:00
svoj@may.pils.ru
ffd8ed1716 BUG#1662 - ALTER TABLE LIKE ignores DATA/INDEX DIRECTPORY
Produce a warning if DATA/INDEX DIRECTORY is specified in
ALTER TABLE statement.

Ignoring of these options is documented in the symbolic links
section of the manual.
2006-06-27 22:22:43 +05:00
holyfoot@mysql.com
bb347299b1 Merge mysql.com:/home/hf/work/mysql-4.1.20318
into mysql.com:/home/hf/work/mysql-4.1.clean
2006-06-26 22:17:42 +05:00
holyfoot@deer.(none)
d8d42948b2 bug #20318 (ctype_ucs2_def test fails with embedded)
there was two problems about charsets in embedded server
1. mysys/charset.c - defined there default_charset_info variable is
modified by both server and client code (particularly when
--default-charset option is handled)
In embedded server we get two codelines modifying one variable.
I created separate default_client_charset_info for client code

2. mysql->charset and mysql->options.charset initialization isn't
properly done for embedded server - necessary calls added
2006-06-19 22:11:01 +05:00
holyfoot@deer.(none)
bc35c50063 bug #16017 (memory leaks in embedded server)
There actually was 3 different problems -
hash_user_connections wasn't cleaned
one strdupped database name wasn't freed
and stmt->mem_root wasn't cleaned as it was
replased with mysql->field_alloc for result
For the last one - i made the library using stmt's
fields to store result if it's the case.
2006-06-01 17:06:42 +05:00
evgen@moonbone.local
1f30bf5a33 Fixed bug#19225: unchecked error results in server crash
In multi-table delete a table for delete can't be used for selecting in
subselects. Appropriate error was raised but wasn't checked which leads to a
crash at the execution phase.

The mysql_execute_command() now checks for errors before executing select
for multi-delete.
2006-05-29 00:32:59 +04:00
serg@sergbook.mysql.com
54c97e6150 after merge fix 2006-04-25 17:12:06 -07:00
serg@sergbook.mysql.com
c97d923cfd merged 2006-04-25 14:06:04 -07:00
serg@sergbook.mysql.com
3144d5eb48 buffer overflow and information exposure bugs fixed
(reported by Stefano Di Paola)
2006-04-25 13:37:33 -07:00
igor@rurik.mysql.com
fc7514151f Fixed bug #18767.
The bug caused wrong result sets for union constructs of the form
(SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2.
For such queries order lists were concatenated and limit clause was
completely neglected.
2006-04-20 22:15:38 -07:00
konstantin@mysql.com
442c2ba8af A fix and a test case for Bug#13134 "Length of VARCHAR() utf8
column is increasing when table is recreated with PS/SP":
make use of create_field::char_length more consistent in the code.
Reinit create_field::length from create_field::char_length
for every execution of a prepared statement (actually fixes the 
bug).
2006-02-21 19:52:20 +03:00
aelkin@mysql.com
2fbdc5483a BUG#15699 importing the fix from 5.0 2006-01-26 12:49:55 +02:00
ingo@mysql.com
5aa315e23a BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
INSERT ... SELECT with the same table on both sides (hidden
below a MERGE table) does now work by buffering the select result.
The duplicate detection works now after open_and_lock_tables() 
on the locks.
I did not find a test case that failed without the change in
sql_update.cc. I made the change anyway as it should in theory
fix a possible MERGE table problem with multi-table update.
2005-12-07 19:52:26 +01:00
ingo@mysql.com
2ecd3a6164 Merge mysql.com:/home/mydev/mysql-4.0
into  mysql.com:/home/mydev/mysql-4.0-bug5390
2005-12-06 17:48:31 +01:00
jani@a193-229-222-105.elisa-laajakaista.fi
d88d8081da Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
2005-12-04 15:34:47 +02:00
jani@a193-229-222-105.elisa-laajakaista.fi
669a12fdb0 A set of Netware related patches. 2005-12-04 15:02:06 +02:00
ingo@mysql.com
76861ac6ad BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT
INSERT ... SELECT with the same table on both sides (hidden
below a MERGE table) does now work by buffering the select result.
The duplicate detection works now after open_and_lock_tables() 
on the locks.
I did not find a test case that failed without the change in
sql_update.cc. I made the change anyway as it should in theory
fix a possible MERGE table problem with multi-table update.
2005-11-29 19:17:39 +01:00
lars@mysql.com
cd0e0a9933 Added missing HAVE_REPLICATION define 2005-10-10 19:23:13 +02:00
lars@mysql.com
998380521f BUG#12618: Removing fake locking 2005-10-10 15:10:14 +02:00
serg@serg.mylan
ae293f9ac5 Bug #10942 "deadlock with FLUSH TABLES WITH READ LOCK + STOP SLAVE"
don't allow STOP SLAVE if global read lock is in taken
2005-10-08 14:46:04 +02:00
jonas@perch.ndb.mysql.com
8983e39070 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-push
2005-09-20 09:50:10 +02:00
jonas@perch.ndb.mysql.com
668a192ce5 ndb - imlp. show engine ndb status;
that dump free list allocation per connection
2005-09-19 15:35:07 +02:00
sasha@asksasha.com
a9a612f1b6 Merge spachev@bk-internal.mysql.com:/home/bk/mysql-4.1
into  asksasha.com:/reiser-data/mysql-dev/mysql-4.1-bug11139
2005-09-14 06:37:52 -06:00
sasha@asksasha.com
00eae49b5c fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
present): the problem originally was that the tables in auxilliary_tables did not have 
the correct real_name, which caused problems in the second call to tables_ok(). 
The fix corrects the real_name problem, and also sets the updating flag properly, 
which makes the second call to tables_ok() unnecessary.
2005-09-14 06:31:38 -06:00