Commit graph

40 commits

Author SHA1 Message Date
jani@ua141d10.elisa.omakaista.fi
0410832526 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
2006-05-04 18:35:58 +03:00
tnurnberg@mysql.com
5becb110e0 Bug#19025 4.1 mysqldump doesn't correctly dump "auto_increment = [int]"
mysqldump / SHOW CREATE TABLE will show the NEXT available value for
the PK, rather than the *first* one that was available (that named in
the original CREATE TABLE ... AUTO_INCREMENT = ... statement).

This should produce correct and robust behaviour for the obvious use
cases -- when no data were inserted, then we'll produce a statement
featuring the same value the original CREATE TABLE had; if we dump
with values, INSERTing the values on the target machine should set the
correct next_ID anyway (and if not, we'll still have our AUTO_INCREMENT =
... to do that). Lastly, just the CREATE statement (with no data) for
a table that saw inserts would still result in a table that new values
could safely be inserted to).

There seems to be no robust way however to see whether the next_ID
field is > 1 because it was set to something else with CREATE TABLE
... AUTO_INCREMENT = ..., or because there is an AUTO_INCREMENT column
in  the table (but no initial value was set with AUTO_INCREMENT = ...)
and then one or more rows were INSERTed, counting up next_ID. This
means that in both cases, we'll generate an AUTO_INCREMENT =
... clause in SHOW CREATE TABLE / mysqldump.  As we also show info on,
say, charsets even if the user did not explicitly give that info in
their own CREATE TABLE, this shouldn't be an issue.

As per above, the next_ID will be affected by any INSERTs that have
taken place, though.  This /should/ result in correct and robust
behaviour, but it may look non-intuitive to some users if they CREATE
TABLE ... AUTO_INCREMENT = 1000 and later (after some INSERTs) have
SHOW CREATE TABLE give them a different value (say, CREATE TABLE
... AUTO_INCREMENT = 1006), so the docs should possibly feature a
caveat to that effect.

It's not very intuitive the way it works now (with the fix), but it's
*correct*.  We're not storing the original value anyway, if we wanted
that, we'd have to change on-disk representation?

If we do dump/load cycles with empty DBs, nothing will change.  This
changeset includes an additional test case that proves that tables
with rows will create the same next_ID for AUTO_INCREMENT = ... across
dump/restore cycles.

Confirmed by support as likely solution for client's problem.
2006-05-04 03:12:51 +02:00
monty@mysql.com
dec2607e1d Ensure that we reset auto-increment cache if we have to do an UPDATE becasue of REPLACE
This fixes bug #11080: Multi-row REPLACE fails on a duplicate key error
2005-06-06 20:41:52 +03:00
monty@mysql.com
9db45adb60 Merge with 4.1 2005-05-14 18:31:22 +03:00
monty@mysql.com
b4e92e6360 Merge with 4.0 2005-05-14 00:01:40 +03:00
monty@mysql.com
9b39f8304e Fixed wrong buffer usage for auto-increment key with blob part that caused CHECK TABLE to report that the table was wrong. (Bug #10045) 2005-05-13 23:08:29 +03:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03:00
dlenev@brandersnatch.localdomain
1f54900630 Fix for bug #5915 "ALTER TABLE behaves differently when converting column
to auto_increment in 4.1".
Now we are enforcing NO_AUTO_VALUE_ON_ZERO mode during ALTER TABLE only
if we are converting one auto_increment column to another auto_increment
column (this also includes most common case when we don't do anything
with such column).

Also now when we convert some column to TIMESTAMP NOT NULL column with
ALTER TABLE we convert NULL values to current timestamp, (as we do this
in INSERT). One can still get old behavior by setting system TIMESTAMP
variable to 0.
2004-10-07 13:02:39 +04:00
monty@mishka.local
be4ca46fbe More fixes for strict mode:
More tests.
Better error messages.
Fixed bug when checking if we updated all needed columns for INSERT.
Give an error if we encounter a wrong float value during parsing.
Don't print DEFAULT for columns without a default value in SHOW CREATE/SHOW FIELDS.
Fixed UPDATE IGNORE when using STRICT mode.
2004-10-02 22:20:08 +03:00
monty@mishka.local
f2941380c4 Strict mode & better warnings
Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field.
Added checking of date/datetime fields.
If strict mode, give error if we have not given value to field without a default value (for INSERT)
2004-09-28 20:08:00 +03:00
serg@serg.mylan
c5e2fbcc53 no_auto_value_on_zero + alter table bug 2004-07-30 14:17:12 +02:00
serg@serg.mylan
3a17ab4551 auto_value_on_zero bug test 2004-07-30 09:47:56 +02:00
bar@mysql.com
51e08a7c49 auto_increment.test, auto_increment.result:
Drop t2 in the beginning.
  ,
2004-06-22 14:10:50 +05:00
paul@ice.snake.net
fd1d01e098 Language/consistency edits to error messages
and affected test results.
2004-06-15 22:18:20 -05:00
bell@sanja.is.com.ua
4c774e0c18 fixed flags of printed query 2004-05-13 23:47:20 +03:00
pem@mysql.comhem.se
6395822932 Fixed BUG#3117: LAST_INSERT_ID() works incorrectly inside stored procedure.
This turned out to be a problem for prepared statements as well; the id was
evaluated once, at parse time.
2004-03-25 17:42:13 +01:00
monty@mysql.com
f43093ec0e After merge fixes
Added more DBUG statements
Ensure that we are comparing end space with BINARY strings
Use 'any_db' instead of '' to mean any database. (For HANDLER command)
Only strip ' ' when comparing CHAR, not other space-like characters (like \t)
2004-02-16 10:03:25 +02:00
monty@mysql.com
7dfcc949d6 after merge fixes 2003-12-19 17:15:54 +02:00
monty@mysql.com
d4c32db181 merge with 4.0.18 2003-12-19 16:42:17 +02:00
monty@mysql.com
031390a9a4 Fixes after merge with 4.0
Cleaned up embedded library access and query cache handling
Changed min stack size to 128K (to allow longer MyISAM keys)
Fixed wrong priority for XOR (should be less than NEG to get -1^1 to work)
2003-12-19 16:25:50 +02:00
monty@mysql.com
1f997d4a70 Removed compiler warning
Fixed not updated test from last changeset
2003-12-18 15:24:21 +02:00
monty@mysql.com
e0cc6799ec Merge with 4.0.17 2003-12-17 17:35:34 +02:00
monty@mysql.com
f995a5f4aa Fix autoincrement for signed columns (Bug #1366)
Fixed problem with char > 128 in QUOTE() function. (Bug #1868)
Disable creation of symlinks if my_disable_symlink is set
Fixed searching of TEXT with end space. (Bug #1651)
Fixed caching bug in multi-table-update where same table was used twice. (Bug #1711)
Fixed problem with UNIX_TIMESTAMP() for timestamps close to 0. (Bug #1998)
Fixed timestamp.test
2003-12-12 22:26:58 +02:00
antony@ltantony.rdg.cyberkinetica.homeunix.net
fcf96dbb18 WorkLog#1323
Deprecate the use of TYPE=... Preferred syntax is ENGINE=
2003-12-10 04:31:42 +00:00
bell@sanja.is.com.ua
33346e26af added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor()
added string length for more speed
made code covarage for print() method of Item
fixed printability of some items (SCRUM) (WL#1274)
2003-10-30 12:57:26 +02:00
monty@mashka.mysql.fi
4f7512160b After merge fixes
Use server character set if --default-character-set is not used
Added convert_string() for more efficient alloc+character-set convert of strings
2003-08-19 00:08:08 +03:00
vva@eagle.mysql.r18.ru
406b8ba21e changed for AUTO_VALUE_ON_ZERO 2003-07-28 10:57:46 -04:00
vva@eagle.mysql.r18.ru
f32299279d fixed bug 663 and WL 1052 (sql_mode is safe for mysqldump) 2003-07-22 18:58:30 -04:00
monty@mashka.mysql.fi
6bc7b3a6be LAST_INSERT_ID() should not be set if we couldn't generate an auto_increment id. 2003-06-30 13:28:36 +03:00
monty@narttu.mysql.fi
d33cb08eb6 LAST_INSERT_ID()}will now return 0 if the last INSERT didn't insert any rows. 2003-06-15 12:34:04 +03:00
monty@narttu.mysql.fi
23145cfed7 Added SQLSTATE to client/server protocol
bmove_allign -> bmove_align
Added OLAP function ROLLUP
Split mysql_fix_privilege_tables to a script and a .sql data file
Added new (MEMROOT*) functions to avoid calling current_thd() when creating some common objects.
Added table_alias_charset, for easier --lower-case-table-name handling
Better SQL_MODE handling (Setting complex options also sets sub options)
New (faster) assembler string functions for x86
2003-06-04 18:28:51 +03:00
venu@myvenu.com
72196c9b16 Updated warning test
Updated all tests to catchup warnings for all field conversions
2003-04-30 00:07:37 -07:00
serg@sergbook.mysql.com
91d6ec3438 don't increment LAST_INSERT_ID() when incremented value cannot be stored in auto_increment column (e.g. is too big) 2003-03-31 23:14:26 +04:00
serg@serg.mysql.com
be580475be fix auto-increment in sub-key and insert ... select 2003-03-02 01:48:57 +01:00
monty@hundin.mysql.fi
2f603156ed Cleanup after last merge 2001-10-08 07:24:04 +03:00
monty@hundin.mysql.fi
938a8dc2ef merge 2001-10-08 05:36:35 +03:00
monty@hundin.mysql.fi
88aff4bf85 Updated manual about embedded version.
Speed up column-completion in 'mysql'
Don't use ISAM if HAVE_ISAM is not defined
A lot of fixes for the embedded version.  All libraries are now included in libmysqld.a
Changed arguments to convert_dirname() to make it more general.
Renamed files in the 'merge' directory to all use a common prefix.
Don't compile both assembler and C functions on x86
2001-10-08 04:58:07 +03:00
sasha@mysql.sashanet.com
bb66c80aeb client/mysqlmanagerc.c
added support for quiet
    increased line buffer size
client/mysqltest.c
    fixed memory leak
    added query logging to result file
    added error message logging to result file
    added enable_query_log/disable_query_log
mysql-test/mysql-test-run.sh
    converted tests to use mysqlmanager

Updated test results
2001-09-27 23:05:54 -06:00
monty@tik.mysql.fi
bf9876a195 Patch for netBSD
Added warning for tables where the auto_increment key is 0
Fixed DELETE ... LIMIT 0
Fixed UPDATE ..LIMIT 0
2001-07-16 03:04:30 +03:00
monty@donna.mysql.com
c0f40d14cc Added support for hex strings to mysqlimport
A lot of new tests to mysqltest
Fixed bug with BDB tables and autocommit
2000-12-28 03:56:38 +02:00