Commit 3099c54d authored by monty@tik.mysql.fi's avatar monty@tik.mysql.fi
Browse files

Test case for bug when updating on key

Fixed bug in CONCAT_WS()
Print the default ISOLATION level.
Change lock type for CREATE ... SELECT and INSERT/REPLACE ... SELECT
parent d145a6b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
mikef@nslinux.bedford.progress.com
monty@tik.mysql.fi
+27 −6
Original line number Diff line number Diff line
@@ -13469,7 +13469,7 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run
* COMMIT::                      @code{BEGIN/COMMIT/ROLLBACK} syntax
* LOCK TABLES::                 @code{LOCK TABLES/UNLOCK TABLES} syntax
* SET OPTION::                  @code{SET OPTION} syntax
* SET TRANSACTION::             
* SET TRANSACTION::             @code{SET TRANSACTION} syntax
* GRANT::                       @code{GRANT} and @code{REVOKE} syntax
* CREATE INDEX::                @code{CREATE INDEX} syntax
* DROP INDEX::                  @code{DROP INDEX} syntax
@@ -18499,7 +18499,8 @@ row length = 1
             + (number of variable-length columns)
@end example
@item The @code{table_options} and @code{SELECT} options are only
@item
The @code{table_options} and @code{SELECT} options are only
implemented in @strong{MySQL} Version 3.23 and above.
The different table types are:
@@ -18577,6 +18578,10 @@ mysql> CREATE TABLE test (a int not null auto_increment,
This will create a @code{MyISAM} table with 3 columns.  Note that the
table will automatically be deleted if any errors occur while copying
data into the table.
To ensure that the update log/binary log can be used to re-create the
original tables, @strong{MySQL} will not allow concurrent inserts during
@code{CREATE TABLE .... SELECT}.
@item
The @code{RAID_TYPE} option will help you to break the 2G/4G limit for
the MyISAM data file (not the index file) on
@@ -19913,6 +19918,11 @@ sub-select clauses, the situation could easily be very confusing!)
@item
You can use the C API function @code{mysql_info()} to get information about
the query. @xref{INSERT}.
@item
To ensure that the update log/binary log can be used to re-create the
original tables, @strong{MySQL} will not allow concurrent inserts during
@code{INSERT .... SELECT}.
@end itemize
You can of course also use @code{REPLACE} instead of @code{INSERT} to
@@ -23861,8 +23871,8 @@ The @code{GEMINI} table type is developed and supported by NuSphere Corporation
(@uref{http://www.nusphere.com}).  It features row-level locking, transaction
support (@code{COMMIT} and @code{ROLLBACK}), and automatic crash recovery.
@code{GEMINI} tables will be included in the @strong{MySQL} 3.23.35 source
distribution.
@code{GEMINI} tables will be included in some future @strong{MySQL} 3.23.X
source distribution.
@node GEMINI start, GEMINI features, GEMINI overview, GEMINI
@subsection GEMINI startup options
@@ -41228,7 +41238,7 @@ are supported if the server and tables support them. It is
thread-safe, and contains a compatibility module for older code
written for the no-longer-maintained MySQLmodule interface.
@item @uref{http://www.mysql.com/Downloads/Contrib/mysql_mex_11.tar.gz, mysql_mex_1_11.tar.gz}
@item @uref{http://www.mysql.com/Downloads/Contrib/mysql_mex_12.tar.gz, mysql_mex_1_12.tar.gz}
An interface program for the Matlab program by MathWorks.  The interface
is done by Kimmo Uutela and John Fisher (not by Mathworks).
Check @uref{http://boojum.hut.fi/~kuutela/mysqlmex.html,mysqlmex.html}
@@ -42331,7 +42341,7 @@ users uses this code as the rest of the code and because of this we are
not yet 100 % confident in this code.
@menu
* News-3.23.36::                
* News-3.23.36::                Changes in release 3.23.36
* News-3.23.35::                Changes in release 3.23.35
* News-3.23.34a::               Changes in release 3.23.34a
* News-3.23.34::                Changes in release 3.23.34
@@ -42377,6 +42387,17 @@ not yet 100 % confident in this code.
Added @code{SET TRANSACTION ISOLATION LEVEL ...}
@item
Added @code{SELECT ... FOR UPDATE}.
@item
Fixed bug where affected rows where not returned when @code{MySQL} was compiled
without transaction support.
@item
Fixed a bug in @code{UPDATE} where keys weren't always used to find the
rows to be updated.
@item
Fixed a bug in @code{CONCAT_WS()} where it returned wrong results.
@item
Changed @code{CREATE ... INSERT} and @code{INSERT ... SELECT} to not
allow concurrent inserts as this could make the binary log hard to repeat.
@end itemize
@node News-3.23.35, News-3.23.34a, News-3.23.36, News-3.23.x
+14 −0
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*')
:my:sql:
TRIM("foo" FROM "foo")	TRIM("foo" FROM "foook")	TRIM("foo" FROM "okfoo")
	ok	ok
concat_ws(', ','monty','was here','again')
monty, was here, again
concat_ws(NULL,'a')	concat_ws(',',NULL,'')
NULL	
concat_ws(',','',NULL,'a')
a
CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"')
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
insert('txs',2,1,'hi')	insert('is ',4,0,'a')	insert('txxxxt',2,4,'es')
this	is a	test
replace('aaaa','a','b')	replace('aaaa','aa','b')	replace('aaaa','a','bb')	replace('aaaa','','b')	replace('bbbb','a','c')
@@ -96,3 +104,9 @@ domain
hello.de
domain
test.de
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"')
"Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4"
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"')
"Link";"1";"1";"1";"0";"4"
CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter)
Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4
+2 −0
Original line number Diff line number Diff line
@@ -37,3 +37,5 @@ a
146
place_id	shows
1	1
status
1
+30 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
# -----------
# Testing string functions

drop table if exists t1;

select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
select 'hello' 'monty';
select length('\n\t\r\b\0\_\%\\');
@@ -24,6 +26,11 @@ select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***s
select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');
select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");

select concat_ws(', ','monty','was here','again');
select concat_ws(NULL,'a'),concat_ws(',',NULL,'');
select concat_ws(',','',NULL,'a');
SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');

select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
@@ -70,3 +77,26 @@ insert into t1 VALUES ("hello.de" ), ("test.de" );
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de';
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de';
drop table t1;

#
# Test bug in concat_ws
#

CREATE TABLE t1 (
  id int(10) unsigned NOT NULL,
  title varchar(255) default NULL,
  prio int(10) unsigned default NULL,
  category int(10) unsigned default NULL,
  program int(10) unsigned default NULL,
  bugdesc text,
  created datetime default NULL,
  modified timestamp(14) NOT NULL,
  bugstatus int(10) unsigned default NULL,
  submitter int(10) unsigned default NULL
) TYPE=MyISAM;

INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4);
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"') FROM t1;
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1;
SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) FROM t1;
drop table t1;
Loading