Commit graph

47220 commits

Author SHA1 Message Date
malff/marcsql@weblab.(none)
dd2bdfda8d Bug#27857 (Log tables supplies the wrong value for generating AUTO_INCREMENT
numbers)

Before this patch, the code in the class Log_to_csv_event_handler, which is
used by the global LOGGER object to write to the tables mysql.slow_log and
mysql_general_log, was supporting only records of the format defined for
these tables in the database creation scripts.

Also before this patch, the server would allow, with certain limitations,
to perform ALTER TABLE on the LOG TABLES.

As implemented, the behavior of the server, with regards to LOG TABLES,
is inconsistent:
- either ALTER TABLES on LOG TABLES should be prohibited,
and the code writing to these tables can make assumptions on the record
format,
- or ALTER TABLE on LOG TABLES is permitted, in which case the code
writing a record to these tables should be more flexible and honor
new fields.

In particular, adding an AUTO_INCREMENT column to the logs,
does not work as expected (per the bug report).

Given that the ALTER TABLE on log tables statement has been explicitly
implemented to check that the log should be off to perform the operation,
and that current test cases already cover this, the user expectation is
already set that this is a "feature" and should be supported.

With this patch, the server will:
- populate AUTO INCREMENT columns if present,
- populate any additional column with it's default value
when writing a record to the LOG TABLES.

Tests are provided, that detail the precise sequence of statements
a SUPER user might want to perform to add more columns to the log tables.
2007-06-13 22:05:22 -06:00
malff/marcsql@weblab.(none)
daf0b9274f Fixed valgrind error, caused by incorrect pointer arithetic 2007-06-13 07:31:41 -06:00
malff/marcsql@weblab.(none)
a508260b85 Bug#25411 (trigger code truncated), PART II
Bug 28127 (Some valid identifiers names are not parsed correctly)
Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)

This patch is the second part of a major cleanup, required to fix
Bug 25411 (trigger code truncated).

The root cause of the issue stems from the function skip_rear_comments,
which was a work around to remove "extra" "*/" characters from the query
text, when parsing a query and reusing the text fragments to represent a
view, trigger, function or stored procedure.
The reason for this work around is that "special comments",
like /*!50002 XXX */, were not parsed properly, so that a query like:
  AAA /*!50002 BBB */ CCC
would be seen by the parser as "AAA BBB */ CCC" when the current version
is greater or equal to 5.0.2

The root cause of this stems from how special comments are parsed.
Special comments are really out-of-bound text that appear inside a query,
that affects how the parser behave.
In nature, /*!50002 XXX */ in MySQL is similar to the C concept
of preprocessing :
  #if VERSION >= 50002
  XXX
  #endif

Depending on the current VERSION of the server, either the special comment
should be expanded or it should be ignored, but in all cases the "text" of
the query should be re-written to strip the "/*!50002" and "*/" markers,
which does not belong to the SQL language itself.

Prior to this fix, these markers would leak into :
- the storage format for VIEW,
- the storage format for FUNCTION,
- the storage format for FUNCTION parameters, in mysql.proc (param_list),
- the storage format for PROCEDURE,
- the storage format for PROCEDURE parameters, in mysql.proc (param_list),
- the storage format for TRIGGER,
- the binary log used for replication.

In all cases, not only this cause format corruption, but also provide a vector
for dormant security issues, by allowing to tunnel code that will be activated
after an upgrade.

The proper solution is to deal with special comments strictly during parsing,
when accepting a query from the outside world.
Once a query is parsed and an object is created with a persistant
representation, this object should not arbitrarily mutate after an upgrade.
In short, special comments are a useful but limited feature for MYSQLdump,
when used at an *interface* level to facilitate import/export,
but bloating the server *internal* storage format is *not* the proper way
to deal with configuration management of the user logic.

With this fix:
- the Lex_input_stream class now acts as a comment pre-processor,
and either expands or ignore special comments on the fly.
- MYSQLlex and sql_yacc.yy have been cleaned up to strictly use the
public interface of Lex_input_stream. In particular, how the input stream
accepts or rejects a character is private to Lex_input_stream, and the
internal buffer pointers of that class are strictly private, and should not
be tempered with during parsing.

This caused many changes mostly in sql_lex.cc.

During the code cleanup in case MY_LEX_NUMBER_IDENT,
Bug 28127 (Some valid identifiers names are not parsed correctly)
was found and fixed.

By parsing special comments properly, and removing the function
'skip_rear_comments' [sic],
Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
has been fixed as well.
2007-06-12 15:23:58 -06:00
malff/marcsql@weblab.(none)
586ef7052a Resolved merge conflicts 2007-06-11 18:08:51 -06:00
malff/marcsql@weblab.(none)
e6f9d712aa Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
2007-06-11 15:57:59 -06:00
malff/marcsql@weblab.(none)
041c7797a9 Manual merge of Bug 27592 (5.0-runtime to 5.1-runtime) 2007-06-11 15:20:46 -06:00
malff/marcsql@weblab.(none)
7b55e8b88e Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge50
2007-06-11 10:49:26 -06:00
kostja@bodhi.(none)
6c352d16d9 Follow up after work on Bug 4968
Coding style: classes start with a capital letter.
Rename some classes related to parsing:
create_field -> Create_field
foreign_key -> Foreign_key
key_part_spec -> Key_part_spec
2007-06-10 14:43:57 +04:00
kostja@bodhi.(none)
5005ae3656 Fix for Bug#28963 "Missing DBUG_RETURN message when stopping event
scheduler".
Add missing DBUG_VOID_RETURN
2007-06-10 13:16:02 +04:00
anozdrin/alik@ibm.
8725f45724 Fix Windows failure. 2007-06-07 20:46:35 +04:00
anozdrin/alik@ibm.
795dabefd1 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  ibm.:/home/alik/Documents/MySQL/devel/5.0-rt-bug275920-2
2007-06-07 19:36:15 +04:00
anozdrin/alik@ibm.
6dce2955f1 Add test case for BUG#27592: stack overrun when storing datetime
value using prepared statements.
2007-06-07 19:35:29 +04:00
joerg@trift2.
ee116570dc Merge trift2.:/MySQL/M50/push-5.0
into  trift2.:/MySQL/M51/push-5.1
2007-06-07 16:37:15 +02:00
joerg@trift2.
d870247de1 Merge trift2.:/MySQL/M41/bug23504-4.1
into  trift2.:/MySQL/M50/push-5.0
2007-06-07 16:29:59 +02:00
joerg@trift2.
0d84c3f710 netware/*.def : Allocate 128K stack for all executables (bug#23504) 2007-06-07 12:59:31 +02:00
anozdrin/alik@ibm.
bacc6ee071 Fix for BUG#27592: stack overrun when storing datetime value
using prepared statements.
2007-06-07 13:50:22 +04:00
joerg@trift2.
d8c385c397 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-06-06 20:06:59 +02:00
joerg@trift2.
449cd28598 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-06-06 19:59:18 +02:00
joerg@trift2.
66a17c5839 Merge trift2.:/MySQL/M50/push-5.0
into  trift2.:/MySQL/M51/push-5.1
2007-06-06 17:39:22 +02:00
tomas@whalegate.ndb.mysql.com
016cf69867 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-build
2007-06-06 16:51:04 +02:00
tomas@whalegate.ndb.mysql.com
7b285522f4 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-build
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-build
2007-06-06 16:49:23 +02:00
joerg@trift2.
86fbe0bdf0 Merge trift2.:/MySQL/M41/push-4.1
into  trift2.:/MySQL/M50/push-5.0
2007-06-06 16:16:14 +02:00
joerg@trift2.
fef905d0bf Merge trift2.:/MySQL/M41/mysql-4.1
into  trift2.:/MySQL/M41/push-4.1
2007-06-06 16:05:23 +02:00
joerg/mysqldev@mysql.com/production.mysql.com
0067a9cc02 Raise version number after cloning 4.1.23 2007-06-06 15:22:06 +02:00
joerg@trift2.
3d95b80da9 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-06-06 12:02:07 +02:00
tsmith@quadxeon.mysql.com
13adcedc90 mtr_report.pl:
Add another exception to the acceptable mysqld errors, for test case for bug 28436
2007-06-06 03:49:24 +02:00
tsmith@quadxeon.mysql.com
60f6e71ef8 ctype-bin.c:
Post-merge fix warning
2007-06-06 00:22:35 +02:00
tsmith@quadxeon.mysql.com
6d86790711 sql_prepare.cc:
Post-merge fix (byte -> uchar)
2007-06-05 23:56:02 +02:00
tsmith@quadxeon.mysql.com
dad35dc1c1 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 23:24:05 +02:00
tsmith@quadxeon.mysql.com
0ca0984f59 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 23:06:43 +02:00
tsmith@quadxeon.mysql.com
d2fe24d1ef Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50
2007-06-05 23:04:40 +02:00
tsmith@quadxeon.mysql.com
016bff8adc Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 22:49:22 +02:00
tsmith@quadxeon.mysql.com
173d07de78 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/41
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50
2007-06-05 22:47:14 +02:00
tomas@poseidon.mysql.com
8fd5212a9f Merge poseidon.mysql.com:/home/tomas/mysql-5.1-telco-gca
into  poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-06-05 18:00:42 +02:00
joerg@trift2.
27f907b74b Merge trift2.:/MySQL/M51/clone-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-06-05 17:53:02 +02:00
tomas@poseidon.mysql.com
ce93bc3d13 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-telco-gca
into  poseidon.mysql.com:/home/tomas/mysql-5.1-telco-gca
2007-06-05 17:51:53 +02:00
tsmith@quadxeon.mysql.com
4b93804592 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 17:51:30 +02:00
tomas@poseidon.mysql.com
47d5fb91d2 Bug #28751 Lots of memory locked in memory causes high kswapd
- add odirect option for lcp+backup+redo log to lower CPU/kswapd usage
- writing odirect removes need for kernel write buffers avoiding kswapd to kick in
2007-06-05 17:29:50 +02:00
tsmith@quadxeon.mysql.com
502320ef05 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/50
2007-06-05 17:28:49 +02:00
tomas@poseidon.mysql.com
8c35f44b21 Bug #28899 not possible to set separate watchdog timeout at startup 2007-06-05 17:06:33 +02:00
joerg@trift2.
7c9a81687b Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-06-05 10:39:02 +02:00
tomas@whalegate.ndb.mysql.com
c5e13ae053 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-build
2007-06-04 22:23:14 +02:00
iggy@amd64.(none)
9317cd4c2d Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  amd64.(none):/src/bug24400/my41-bug24400
2007-06-04 13:02:41 -04:00
iggy@amd64.(none)
2e892d30f2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  amd64.(none):/src/bug24400/my50-bug24400
2007-06-04 12:56:15 -04:00
iggy@amd64.(none)
2cdb525f9f Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  amd64.(none):/src/bug24400/my51-bug24400
2007-06-04 12:53:18 -04:00
iggy@amd64.(none)
375dff28cb Merge amd64.(none):/src/bug24400/my50-bug24400
into  amd64.(none):/src/bug24400/my51-bug24400
2007-06-04 12:49:19 -04:00
iggy@amd64.(none)
9346e9246a Merge amd64.(none):/src/bug24400/my41-bug24400
into  amd64.(none):/src/bug24400/my50-bug24400
2007-06-04 12:47:48 -04:00
igor@olga.mysql.com
76b580b84e Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt
2007-06-04 05:57:57 -07:00
igor@olga.mysql.com
d0cb11e6ba Post-merge fix. 2007-06-04 05:55:27 -07:00
igor@olga.mysql.com
a5011de0a8 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt-merge
2007-06-04 03:16:17 -07:00