Skip to content

Commit 81bc313

Browse files
All statements are now run in a sub transaction
Give warning if we are using non transactional tables and do ROLLBACK Porting of crash-me and benchmarks to FrontBase
1 parent c625540 commit 81bc313

73 files changed

Lines changed: 1377 additions & 331 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Docs/manual.texi

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Installing a MySQL Source Distribution
243243

244244
Perl Installation Comments
245245

246-
* Perl installation:: Installing Perl on UNIX
246+
* Perl installation:: Installing Perl on Unix
247247
* ActiveState Perl:: Installing ActiveState Perl on Windows
248248
* Windows Perl:: Installing the @strong{MySQL} Perl distribution on Windows
249249
* Perl support problems:: Problems using the Perl @code{DBI}/@code{DBD} interface
@@ -297,7 +297,7 @@ Windows Notes
297297
* Windows symbolic links:: Splitting data across different disks under Win32
298298
* Windows compiling:: Compiling MySQL clients on Windows.
299299
* Windows and BDB tables.:: Windows and BDB Tables
300-
* Windows vs Unix:: @strong{MySQL}-Windows compared to UNIX @strong{MySQL}
300+
* Windows vs Unix:: @strong{MySQL}-Windows compared to Unix @strong{MySQL}
301301

302302
Post-installation Setup and Testing
303303

@@ -454,7 +454,7 @@ Functions for Use in @code{SELECT} and @code{WHERE} Clauses
454454

455455
* Silent column changes:: Silent column changes
456456

457-
@code{SHOW} syntax (Get information about tables, columns,...)
457+
@code{SHOW} Syntax (Get Information About Tables, Columns,...)
458458

459459
* SHOW DATABASE INFO::
460460
* SHOW TABLE STATUS::
@@ -464,26 +464,26 @@ Functions for Use in @code{SELECT} and @code{WHERE} Clauses
464464
* SHOW GRANTS::
465465
* SHOW CREATE TABLE::
466466

467-
MySQL table types
467+
MySQL Table Types
468468

469469
* MyISAM:: MyISAM tables
470470
* MERGE:: MERGE tables
471471
* ISAM:: ISAM tables
472472
* HEAP:: HEAP tables
473473
* BDB:: BDB or Berkeley_db tables
474474

475-
MyISAM tables
475+
MyISAM Tables
476476

477477
* Key space:: Space needed for keys
478478
* MyISAM table formats:: MyISAM table formats
479479

480-
MyISAM table formats
480+
MyISAM Table Formats
481481

482482
* Static format:: Static (Fixed-length) table characteristics
483483
* Dynamic format:: Dynamic table characteristics
484484
* Compressed format:: Compressed table characteristics
485485

486-
BDB or Berkeley_db tables
486+
BDB or Berkeley_db Tables
487487

488488
* BDB overview::
489489
* BDB install::
@@ -503,7 +503,7 @@ MySQL Tutorial
503503
* Batch mode:: Using @code{mysql} in batch mode
504504
* Twin:: Queries from twin project
505505

506-
Examples of common queries
506+
Examples of Common Queries
507507

508508
* example-Maximum-column:: The maximum value for a column
509509
* example-Maximum-row:: The row holding the maximum of a certain column
@@ -512,15 +512,15 @@ Examples of common queries
512512
* example-user-variables::
513513
* example-Foreign keys:: Using foreign keys
514514

515-
Creating and using a database
515+
Creating and Using a Database
516516

517517
* Creating database:: Creating a database
518518
* Creating tables:: Creating a table
519519
* Loading tables:: Loading data into a table
520520
* Retrieving data:: Retrieving information from a table
521521
* Multiple tables:: Using more than one table
522522

523-
Retrieving information from a table
523+
Retrieving Information from a Table
524524

525525
* Selecting all:: Selecting all data
526526
* Selecting rows:: Selecting particular rows
@@ -531,7 +531,7 @@ Retrieving information from a table
531531
* Pattern matching:: Pattern matching
532532
* Counting rows:: Counting rows
533533

534-
Queries from twin project
534+
Queries from Twin Project
535535

536536
* Twin pool:: Find all non-distributed twins
537537
* Twin event:: Show a table on twin pair status
@@ -541,7 +541,7 @@ MySQL server functions
541541
* Languages:: What languages are supported by @strong{MySQL}?
542542
* Table size:: How big @strong{MySQL} tables can be
543543

544-
What languages are supported by MySQL?
544+
What Languages Are Supported by MySQL?
545545

546546
* Character sets:: The character set used for data and sorting
547547
* Adding character set:: Adding a new character set
@@ -558,7 +558,7 @@ Replication in MySQL
558558
* Replication SQL:: SQL Commands related to replication
559559
* Replication FAQ:: Frequently Asked Questions about replication
560560

561-
Getting maximum performance from MySQL
561+
Getting Maximum Performance from MySQL
562562

563563
* Optimize Basics:: Optimization overview
564564
* System:: System/Compile time and startup parameter tuning
@@ -572,7 +572,7 @@ Getting maximum performance from MySQL
572572
* Portability:: Portability
573573
* Internal use:: What have we used MySQL for?
574574

575-
System/Compile time and startup parameter tuning
575+
System/Compile Time and Startup Parameter Tuning
576576

577577
* Compile and link options:: How compiling and linking affects the speed of MySQL
578578
* Disk issues:: Disk issues
@@ -831,6 +831,7 @@ MySQL change history
831831

832832
Changes in release 3.23.x (Recommended; beta)
833833

834+
* News-3.23.29:: Changes in release 3.23.29
834835
* News-3.23.28:: Changes in release 3.23.28
835836
* News-3.23.27:: Changes in release 3.23.27
836837
* News-3.23.26:: Changes in release 3.23.26
@@ -15573,7 +15574,7 @@ mysql> select ATAN(-2);
1557315574
@end example
1557415575

1557515576
@findex ATAN2()
15576-
@item ATAN2(X,Y)
15577+
@item ATAN2(Y,X)
1557715578
Returns the arc tangent of the two variables @code{X} and @code{Y}. It is
1557815579
similar to calculating the arc tangent of @code{Y / X}, except that the
1557915580
signs of both arguments are used to determine the quadrant of the
@@ -17701,7 +17702,7 @@ using @code{myisampack}. @xref{Compressed format}.
1770117702
@section @code{ALTER TABLE} Syntax
1770217703

1770317704
@example
17704-
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...] [ORDER BY col]
17705+
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
1770517706

1770617707
alter_specification:
1770717708
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
@@ -17719,6 +17720,7 @@ alter_specification:
1771917720
or DROP PRIMARY KEY
1772017721
or DROP INDEX index_name
1772117722
or RENAME [TO] new_tbl_name
17723+
or ORDER BY col
1772217724
or table_options
1772317725
@end example
1772417726

@@ -17859,9 +17861,12 @@ if no @code{PRIMARY KEY} was specified explicitly.)
1785917861
@item
1786017862
@code{ORDER BY} allows you to create the new table with the rows in a
1786117863
specific order. Note that the table will not remain in this order after
17862-
inserts and deletes. In some cases, it may make sorting easier for
17864+
inserts and deletes. In some cases, it may make sorting easier for
1786317865
@strong{MySQL} if the table is in order by the column that you wish to
17864-
order it by later.
17866+
order it by later. This option is mainly useful when you know that you
17867+
are mostly going to query the rows in a certain order; By using this
17868+
option after big changes to the table, you may be able to get higher
17869+
performance.
1786517870

1786617871
@findex ALTER TABLE
1786717872
@item
@@ -17991,7 +17996,7 @@ to the original state.
1799117996
@section @code{DROP TABLE} Syntax
1799217997

1799317998
@example
17994-
DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...]
17999+
DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT | CASCADE]
1799518000
@end example
1799618001

1799718002
@code{DROP TABLE} removes one or more tables. All table data and the table
@@ -18001,6 +18006,9 @@ In @strong{MySQL} Version 3.22 or later, you can use the keywords
1800118006
@code{IF EXISTS} to prevent an error from occurring for tables that don't
1800218007
exist.
1800318008

18009+
@code{RESTRICT} and @code{CASCADE} are allowed to make porting easier.
18010+
For the moment they don't do anything.
18011+
1800418012
@findex OPTIMIZE TABLE
1800518013
@node OPTIMIZE TABLE, CHECK TABLE, DROP TABLE, Reference
1800618014
@section @code{OPTIMIZE TABLE} Syntax
@@ -20755,6 +20763,11 @@ COMMIT;
2075520763
Note that if you are using non-transaction-safe tables, the changes will be
2075620764
stored at once, independent of the status of the @code{autocommit} mode.
2075720765

20766+
If you do a @code{ROLLBACK} when you have updated a non-transactional
20767+
table you will get an error (@code{ER_WARNING_NOT_COMPLETE_ROLLBACK}) as
20768+
a warning. All transactional safe tables will be restored but any
20769+
non-transactional table will not change.
20770+
2075820771
@findex LOCK TABLES
2075920772
@findex UNLOCK TABLES
2076020773
@node LOCK TABLES, SET OPTION, COMMIT, Reference
@@ -27240,6 +27253,10 @@ rows at the same time another table is reading from it. If this is important
2724027253
for you, you should consider methods where you don't have to delete rows
2724127254
or run @code{OPTIMIZE TABLE} after you have deleted a lot of rows.
2724227255
@item
27256+
Use @code{ALTER TABLE ... ORDER BY expr1,expr2...} if you mostly
27257+
retrieve rows in expr1,expr2.. order. By using this option after big
27258+
changes to the table, you may be able to get higher performance.
27259+
@item
2724327260
In some cases it may make sense to introduce a column that is 'hashed'
2724427261
based on information from other columns. If this column is short and
2724527262
reasonably unique it may be much faster than a big index on many
@@ -32981,6 +32998,9 @@ contain a path, the file is written in the data directory.
3298132998
The slow query log can be used to find queries that takes a long time to
3298232999
execute and are thus candidates for optimization.
3298333000

33001+
You are using @code{--log-long-format} then also queries that are not
33002+
using indexes are printed. @xref{Command-line options}.
33003+
3298433004
@cindex database replication
3298533005
@cindex replication, database
3298633006
@cindex database mirroring
@@ -38778,6 +38798,7 @@ version. The replication and BerkeleyDB code is still under development,
3877838798
though, so Version 3.23 is not released as a stable version yet.
3877938799

3878038800
@menu
38801+
* News-3.23.29:: Changes in release 3.23.29
3878138802
* News-3.23.28:: Changes in release 3.23.28
3878238803
* News-3.23.27:: Changes in release 3.23.27
3878338804
* News-3.23.26:: Changes in release 3.23.26
@@ -38809,7 +38830,25 @@ though, so Version 3.23 is not released as a stable version yet.
3880938830
* News-3.23.0:: Changes in release 3.23.0
3881038831
@end menu
3881138832

38812-
@node News-3.23.28, News-3.23.27, News-3.23.x, News-3.23.x
38833+
@node News-3.23.29, News-3.23.28, News-3.23.x, News-3.23.x
38834+
@appendixsubsec Changes in release 3.23.29
38835+
@itemize @bullet
38836+
@item
38837+
Changed crash-me and the MySQL benchmarks to also work with FrontBase.
38838+
@item
38839+
Allow @code{RESTRICT} and @code{CASCADE} after @code{DROP TABLE} to make
38840+
porting easier.
38841+
@item
38842+
If we get an error we now only rollback the statement (for BDB tables),
38843+
not the whole transaction.
38844+
@item
38845+
If you do a @code{ROLLBACK} when you have updated a non-transactional table
38846+
you will get an error as a warning.
38847+
@item
38848+
Reset status variable which could cause problem if one used @code{--slow-log}.
38849+
@end itemize
38850+
38851+
@node News-3.23.28, News-3.23.27, News-3.23.29, News-3.23.x
3881338852
@appendixsubsec Changes in release 3.23.28
3881438853
@itemize @bullet
3881538854
@item

include/mysqld_error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,5 @@
196196
#define ER_UNKNOWN_SYSTEM_VARIABLE 1193
197197
#define ER_CRASHED_ON_USAGE 1194
198198
#define ER_CRASHED_ON_REPAIR 1195
199-
#define ER_ERROR_MESSAGES 196
199+
#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
200+
#define ER_ERROR_MESSAGES 197

sql-bench/bench-init.pl.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n";
3838

3939
$|=1; # Output data immediately
4040

41-
$opt_skip_test=$opt_skip_create=$opt_skip_delete=$opt_verbose=$opt_fast_insert=$opt_lock_tables=$opt_debug=$opt_skip_delete=$opt_fast=$opt_force=$opt_log=$opt_use_old_results=$opt_help=$opt_odbc=$opt_small_test=$opt_small_tables=$opt_samll_key_tables=$opt_stage=$opt_old_headers=$opt_die_on_errors=0;
41+
$opt_skip_test=$opt_skip_create=$opt_skip_delete=$opt_verbose=$opt_fast_insert=$opt_lock_tables=$opt_debug=$opt_skip_delete=$opt_fast=$opt_force=$opt_log=$opt_use_old_results=$opt_help=$opt_odbc=$opt_small_test=$opt_small_tables=$opt_samll_key_tables=$opt_stage=$opt_old_headers=$opt_die_on_errors=$opt_tcpip=0;
4242
$opt_cmp=$opt_user=$opt_password="";
4343
$opt_server="mysql"; $opt_dir="output";
4444
$opt_host="localhost";$opt_database="test";
@@ -51,7 +51,7 @@ $log_prog_args=join(" ", skip_arguments(\@ARGV,"comments","cmp","server",
5151
"user", "host", "database", "password",
5252
"use-old-results","skip-test",
5353
"machine", "dir", "suffix", "log"));
54-
GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","old-headers","die-on-errors","create-options=s","hires") || usage();
54+
GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","old-headers","die-on-errors","create-options=s","hires","tcpip") || usage();
5555

5656
usage() if ($opt_help);
5757
$server=get_server($opt_server,$opt_host,$opt_database,$opt_odbc,
@@ -256,6 +256,17 @@ sub fetch_all_rows
256256
if (!$sth->execute)
257257
{
258258
print "\n" if ($opt_debug);
259+
if (defined($server->{'error_on_execute_means_zero_rows'}) &&
260+
!$server->abort_if_fatal_error())
261+
{
262+
if (defined($must_get_result) && $must_get_result)
263+
{
264+
die "Error: Query $query didn't return any rows\n";
265+
}
266+
$sth->finish;
267+
print "0\n" if ($opt_debug);
268+
return 0;
269+
}
259270
die "Error occured with execute($query)\n -> $DBI::errstr\n";
260271
$sth->finish;
261272
return undef;
@@ -507,6 +518,11 @@ All benchmarks takes the following options:
507518
different server options without overwritten old files.
508519
When using --fast the suffix is automaticly set to '_fast'.
509520
521+
--tcpip
522+
Inform test suite that we are using TCP/IP to connect to the server. In
523+
this case we can\t do many new connections in a row as we in this case may
524+
fill the TCP/IP stack
525+
510526
--time-limit (Default $opt_time_limit)
511527
How long a test loop is allowed to take, in seconds, before the end result
512528
is 'estimated'.

0 commit comments

Comments
 (0)