summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/manual.de.texi65
-rw-r--r--Docs/manual.texi40
-rw-r--r--client/client_priv.h3
-rw-r--r--client/mysqlimport.c10
-rw-r--r--include/myisam.h6
-rw-r--r--mysql-test/r/union.result10
-rw-r--r--mysql-test/t/union.test4
-rw-r--r--sql/sql_table.cc61
-rw-r--r--sql/sql_union.cc5
-rw-r--r--sql/sql_yacc.yy4
10 files changed, 157 insertions, 51 deletions
diff --git a/Docs/manual.de.texi b/Docs/manual.de.texi
index dc9d0bf53dc..77e1aa71197 100644
--- a/Docs/manual.de.texi
+++ b/Docs/manual.de.texi
@@ -1,5 +1,5 @@
\input texinfo @c -*-texinfo-*-
-@c Copyright 1997-2001 TcX AB, Detron HB und MySQL Finland AB
+@c Copyright 1997-2002 TcX AB, Detron HB und MySQL Finland AB
@c
@c *********************************************************
@c Note that @node names are used on our Website.
@@ -6135,9 +6135,9 @@ Solaris 2.5 und höher mit nativen Threads auf SPARC und x86. @xref{Solaris}.
@item
SunOS 4.x mit enthaltenem MIT-pThreads-Paket. @xref{Solaris}.
@item
-SCO OpenServer mit einem aktuellen Port des FSU-PThreads-Pakets. @xref{SCO}.
+Caldera (SCO) OpenServer mit einem aktuellen Port des FSU-PThreads-Pakets. @xref{Caldera}.
@item
-SCO UnixWare 7.0.1. @xref{SCO Unixware}.
+Caldera (SCO) UnixWare 7.0.1. @xref{Caldera Unixware}.
@item
Tru64 Unix
@item
@@ -10675,8 +10675,8 @@ alias mysqladmin '/usr/local/mysql/bin/mysqladmin'
* Alpha-DEC-UNIX::
* Alpha-DEC-OSF1::
* SGI-Irix::
-* SCO::
-* SCO Unixware::
+* Caldera::
+* Caldera Unixware::
@end menu
@node Binary notes-HP-UX, HP-UX 10.20, Other Unix Notes, Other Unix Notes
@@ -11230,7 +11230,8 @@ hinzu, falls Sie keine @code{-O}-Option auf Ihrer Kompilierzeile haben.)
Danach wechseln Sie einfach direkt zurück in oberste Verzeichnis und lassen
@code{make} noch einmal laufen.
-@node SGI-Irix, SCO, Alpha-DEC-OSF1, Other Unix Notes
+
+@node SGI-Irix, Caldera, Alpha-DEC-OSF1, Other Unix Notes
@c German node SGI-Irix
@subsubsection Anmerkungen zu SGI Irix
@@ -11307,9 +11308,10 @@ CC=cc CXX=CC CFLAGS='-O3 -n32 -TARG:platform=IP22 -I/usr/local/include \
@end example
-@node SCO, SCO Unixware, SGI-Irix, Other Unix Notes
+@node Caldera, Caldera Unixware, SGI-Irix, Other Unix Notes
@c German node SCO
-@subsubsection Anmerkungen zu SCO
+@subsubsection Anmerkungen zu Caldera
+@c German fixup: 2002-03-22 monty changed SCO -> Caldera in English manual
Die aktuelle Portierung wird auf ``sco3.2v5.0.4''-
und-``sco3.2v5.0.5''-Systemen getestet. Die Portierung auf ``sco 3.2v4.2''
@@ -11336,7 +11338,7 @@ shell> cp -p /usr/include/pThread/stdtypes.h /usr/local/lib/gcc-lib/i386-pc-sco3
@item
Sie brauchen die Portierung von GCC 2.5.x für dieses Produkt und das
-Entwicklungssystem. Sie werden auf dieser Version von SCO Unix benötigt.
+Entwicklungssystem. Sie werden auf dieser Version von Caldera (SCO) Unix benötigt.
Sie können nicht lediglich das GCC-Dev-System benutzen.
@item
@@ -11349,10 +11351,10 @@ Sie finden ein vorkompiliertes Paket auf
@item
FSU-PThreads kann mit SCO Unix 4.2 mit TCP/IP kompiliert werden. Oder mit
OpenServer 3.0 oder Open Desktop 3.0 (OS 3.0 ODT 3.0), mit installiertem
-SCO-Entwicklungssystem unter Benutzung einer guten Portierung von GCC 2.5.x
+Caldera (SCO) Entwicklungssystem unter Benutzung einer guten Portierung von GCC 2.5.x
ODT oder OS 3.0. Hierbei brauchen Sie eine gute Portierung von GCC 2.5.x.
Ohne gute Portierung gibt es eine Menge Probleme. Die Portierung für dieses
-Produkt erfordert das SCO-Unix-Entwicklungssystem. Ohne dieses fehlen die
+Produkt erfordert das Caldera (SCO) Unix-Entwicklungssystem. Ohne dieses fehlen die
Bibliotheken und der Linker, die benötigt werden.
@item
@@ -11410,7 +11412,7 @@ Entpacken Sie diese Datei ins @file{include}-Verzeichnis Ihres
MySQL-Source-Trees.
@end enumerate
-Anmerkungen zur SCO-Entwicklung:
+Anmerkungen zur Caldera (SCO) Entwicklung:
@itemize @bullet
@item
@@ -11419,7 +11421,7 @@ MySQL kann FSU-PThreads automatisch erkennen und @code{mysqld} mit
@item
@c Question: Good translation for "re-entrant"?
-Die SCO-Entwicklungsbibliotheken sind re-entrant in FSU-PThreads. SCO
+Die Caldera (SCO) Entwicklungsbibliotheken sind re-entrant in FSU-PThreads. Caldera
behauptet, dass seine Bibliotheken-Funktionen re-entrant sind, daher müssen
sie mit FSU-PThreads re-entrant sein. FSU-PThreads auf OpenServer versucht,
das SCO-Scheme zu benutzen, um Bibliotheken re-entrant zu machen.
@@ -11436,7 +11438,7 @@ In FSU-PThreads achten folgende Systemaufrufe auf pThreads: @code{read()},
@code{select()} und @code{wait()}.
@end itemize
-Wenn Sie DBI auf SCO installieren wollen, müssen Sie @file{Makefile} in
+Wenn Sie DBI auf Caldera (SCO) installieren wollen, müssen Sie @file{Makefile} in
DBI-xxx und jedem Unterverzeichnis editieren.
Beachten Sie, dass folgendes gcc 2.95.2 oder neuer voraussetzt:
@@ -11467,9 +11469,10 @@ mit @code{icc} oder @code{cc} kompiliert wurden.
Perl funktioniert am besten, wenn es mit @code{cc} kompiliert wird.
-@node SCO Unixware, , SCO, Other Unix Notes
+@node Caldera Unixware, , Caldera, Other Unix Notes
@c German node SCO Unixware
-@subsubsection Anmerkungen zu SCO Unixware Version 7.0
+@subsubsection Anmerkungen zu Caldera Unixware Version 7.0
+@c German fixup: 2002-03-22 monty changed SCO -> Caldera in English manual
Sie benötigen mindestens MySQL-Version 3.22.13, weil diese Version einige
Portabilitätsprobleme unter Unixware behebt.
@@ -11851,7 +11854,7 @@ Danach @strong{müssen} Sie 'make realclean' laufen lassen und danach mit
der Installation von Anfang an beginnen.
Wenn Sie das Perl-Modul auf einem System laufen lassen wollen, das
-dynamisches Linken nicht unterstützt (wie SCO), können Sie eine
+dynamisches Linken nicht unterstützt (wie Caldera/SCO), können Sie eine
statische Version von Perl erzeugen, die @code{DBI} und @code{DBD-mysql}
enthält. Das bringt man zum Laufen, indem man eine Version von Perl
erzeugt, in der der @code{DBI}-Code eingelinkt ist, und diese über das
@@ -11859,7 +11862,7 @@ aktuelle Perls installiert. Dann benutzen Sie diese, um eine Version von
Perl zu bauen, die zusätzlich den @code{DBD}-Code eingelinkt hat, und
installieren diese.
-Unter SCO müssen folgende Umgebungsvariablen gesetzt sein:
+Unter Caldera (SCO) müssen folgende Umgebungsvariablen gesetzt sein:
@example
shell> LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/lib
@@ -11885,7 +11888,7 @@ shell> make perl
Dann müssen Sie das neue Perl installieren. Die Ausgabe von @code{make
perl} zeigt den genauen @code{make}-Befehl an, den Sie für die
-Installation ausführen müssen. Unter SCO ist das @code{make -f
+Installation ausführen müssen. Unter Caldera (SCO) ist das @code{make -f
Makefile.aperl inst_perl MAP_TARGET=perl}.
Benutzen Sie als nächstes dieses soeben erzeugte Perl, um ein weiteres
@@ -22307,16 +22310,16 @@ Standard-@strong{MySQL-Max}-Binärdateien beinhalten:
@multitable @columnfractions .4 .3 .3
@item @strong{System} @tab @strong{BDB} @tab @strong{InnoDB}
-@item AIX 4.3 @tab NEIN @tab JA
-@item HP-UX 11.0 @tab NEIN @tab JA
-@item Linux-Alpha @tab NEIN @tab JA
-@item Linux-Intel @tab JA @tab JA
-@item Linux-Ia64 @tab NEIN @tab JA
-@item Solaris-intel @tab NEIN @tab JA
-@item Solaris-sparc @tab JA @tab JA
-@item SCO OSR5 @tab JA @tab JA
-@item UnixWare @tab JA @tab JA
-@item Windows/NT @tab JA @tab JA
+@item AIX 4.3 @tab NEIN @tab JA
+@item HP-UX 11.0 @tab NEIN @tab JA
+@item Linux-Alpha @tab NEIN @tab JA
+@item Linux-Intel @tab JA @tab JA
+@item Linux-Ia64 @tab NEIN @tab JA
+@item Solaris-intel @tab NEIN @tab JA
+@item Solaris-sparc @tab JA @tab JA
+@item Caldera (SCO) OSR5 @tab JA @tab JA
+@item UnixWare @tab JA @tab JA
+@item Windows/NT @tab JA @tab JA
@end multitable
@@ -40449,9 +40452,9 @@ Linux 2.x intel
@item
Solaris sparc
@item
-SCO OpenServer
+Caldera (SCO) OpenServer
@item
-SCO UnixWare 7.0.1
+Caldera (SCO) UnixWare 7.0.1
@end itemize
Auf folgenden Betriebssystemen läuft BDB nicht:
diff --git a/Docs/manual.texi b/Docs/manual.texi
index d2c37129455..741796fe291 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -116,10 +116,10 @@ for that version.
@end ifinfo
@menu
-* Introduction:: General Information about MySQL
+* Introduction:: General Information
* Installing:: Installing MySQL
* Tutorial:: MySQL Tutorial
-* MySQL Database Administration:: MySQL Database Administration
+* MySQL Database Administration:: Database Administration
* MySQL Optimisation:: MySQL Optimisation
* Reference:: MySQL Language Reference
* Table types:: MySQL Table Types
@@ -140,7 +140,7 @@ for that version.
@node Introduction, Installing, Top, Top
-@chapter General Information About MySQL
+@chapter General Information
@cindex overview
@cindex general information
@@ -11471,7 +11471,7 @@ perl} indicates the command to use.
@node Tutorial, MySQL Database Administration, Installing, Top
-@chapter Tutorial Introduction to MySQL
+@chapter Tutorial Introduction
@cindex tutorial
@cindex terminal monitor, defined
@@ -14049,7 +14049,7 @@ FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
@node MySQL Database Administration, MySQL Optimisation, Tutorial, Top
-@chapter MySQL Database Administration
+@chapter Database Administration
@menu
* Configuring MySQL:: Configuring MySQL
@@ -17687,7 +17687,7 @@ to set the column to some other value than 0.
@findex REPAIR TABLE
@example
-REPAIR TABLE tbl_name[,tbl_name...] [QUICK] [EXTENDED]
+REPAIR TABLE tbl_name[,tbl_name...] [QUICK] [EXTENDED] [USE_FRM]
@end example
@code{REPAIR TABLE} only works on @code{MyISAM} tables and is the same
@@ -17724,6 +17724,10 @@ by row instead of creating one index at a time with sorting; This may be
better than sorting on fixed-length keys if you have long @code{char()}
keys that compress very good.
+As of MySQL 4.0.2 there is @code{USE_FRM} mode for @code{REPAIR}.
+Use it if @code{.MYI} file is missing or its header is corrupted.
+In this mode MySQL will recreate the table, using information from
+@code{.frm} file. This kind of repair cannot be done with @code{myisamchk}.
@node Table maintenance, Maintenance regimen, REPAIR TABLE, Disaster Prevention
@subsection Using @code{myisamchk} for Table Maintenance and Crash Recovery
@@ -18019,8 +18023,7 @@ If you have lots of memory, you should increase the size of
@code{key_buffer_size}!
@item -n or --sort-recover
Force @code{myisamchk} to use sorting to resolve the keys even if the
-temporary files should be very big. This will not have any effect if you have
-full-text keys in the table.
+temporary files should be very big.
@item --character-sets-dir=...
Directory where character sets are stored.
@@ -18388,6 +18391,9 @@ a copy in case something goes wrong.)
Go back to Stage 2. @code{myisamchk -r -q} should work now. (This shouldn't
be an endless loop.)
+As of MySQL 4.0.2 you can also use @code{REPAIR ... USE_FRM}
+that does the whole procedure automatically.
+
@noindent
@strong{Stage 4: Very difficult repair}
@@ -18907,7 +18913,7 @@ by sorting the index), update them.
@end itemize
@code{OPTIMIZE TABLE} for @code{MyISAM} tables is equvialent of running
-@code{myisamchk --quick --check-changed-tables --sort-index --analyze}
+@code{myisamchk --quick --check-only-changed --sort-index --analyze}
on the table.
Note that the table is locked during the time @code{OPTIMIZE TABLE} is
@@ -48762,6 +48768,18 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
+Fixed bug in UNION's with last offset being transposed to total result set
+@item
+@code{REPAIR ... USE_FRM} added.
+@item
+Fixed that DEFAULT_SELECT_LIMIT is always imposed on UNION's result set
+@item
+Fixed that some SELECT options can appear only in the first SELECT
+@item
+Fixed bug with LIMIT with UNION, where last select is in the braces
+@item
+Fixed that fulltext works fine with UNION's
+@item
Fixed bug with indexless boolean full-text search.
@item
Fixed bug that sometimes appeared when full-text search was used
@@ -50728,7 +50746,7 @@ Added @code{FAST}, @code{QUICK} @code{EXTENDED} check types to
@code{CHECK TABLES}.
@item
Changed @code{myisamchk} so that @code{--fast} and
-@code{--check-changed-tables} are also honored with @code{--sort-index} and
+@code{--check-only-changed} are also honored with @code{--sort-index} and
@code{--analyze}.
@item
Fixed fatal bug in @code{LOAD TABLE FROM MASTER} that did not lock the
@@ -55792,7 +55810,7 @@ variables to modify the behavior of MySQL. @xref{Option files}.
@node Regexp, GPL license, Environment variables, Top
-@appendix MySQL Regular Expression Syntax
+@appendix MySQL Regular Expressions
@cindex regex
@cindex regular expression syntax, described
diff --git a/client/client_priv.h b/client/client_priv.h
index 17478a2cef3..bcd4fd53cbb 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -31,4 +31,5 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
OPT_LOW_PRIORITY, OPT_AUTO_REPAIR, OPT_COMPRESS,
OPT_DROP, OPT_LOCKS, OPT_KEYWORDS, OPT_DELAYED, OPT_OPTIMIZE,
OPT_FTB, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_TABLES,
- OPT_MASTER_DATA, OPT_AUTOCOMMIT, OPT_LOCAL_INFILE, OPT_PROMPT};
+ OPT_MASTER_DATA, OPT_AUTOCOMMIT, OPT_LOCAL_INFILE, OPT_PROMPT,
+ OPT_IGN_LINES };
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index d1140c74358..ed71642507a 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -25,7 +25,7 @@
** * *
** *************************
*/
-#define IMPORT_VERSION "2.8"
+#define IMPORT_VERSION "2.9"
#include "client_priv.h"
#include "mysql_version.h"
@@ -47,6 +47,7 @@ static char *opt_password=0, *current_user=0,
*default_charset;
static uint opt_mysql_port=0;
static my_string opt_mysql_unix_port=0;
+static my_string opt_ignore_lines=0;
#include "sslopt-vars.h"
static struct option long_options[] =
@@ -65,6 +66,7 @@ static struct option long_options[] =
{"help", no_argument, 0, '?'},
{"host", required_argument, 0, 'h'},
{"ignore", no_argument, 0, 'i'},
+ {"ignore-lines", required_argument, 0, OPT_IGN_LINES},
{"lines-terminated-by", required_argument, 0, (int) OPT_LTB},
{"local", no_argument, 0, 'L'},
{"lock-tables", no_argument, 0, 'l'},
@@ -125,6 +127,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
-f, --force Continue even if we get an sql-error.\n\
-h, --host=... Connect to host.\n\
-i, --ignore If duplicate unique key was found, keep old row.\n\
+ --ignore-lines=n Ignore first n lines of data file.\n\
-l, --lock-tables Lock all tables for write.\n\
-L, --local Read all files through the client\n\
--low-priority Use LOW_PRIORITY when updating the table\n\
@@ -256,6 +259,9 @@ static int get_options(int *argc, char ***argv)
case (int) OPT_ESC:
escaped= optarg;
break;
+ case (int) OPT_IGN_LINES:
+ opt_ignore_lines= optarg;
+ break;
#include "sslopt-case.h"
}
}
@@ -345,6 +351,8 @@ static int write_to_table(char *filename, MYSQL *sock)
" OPTIONALLY ENCLOSED BY");
end= add_load_option(end, escaped, " ESCAPED BY");
end= add_load_option(end, lines_terminated, " LINES TERMINATED BY");
+ if (opt_ignore_lines)
+ end= strmov(strmov(strmov(end, " IGNORE "), opt_ignore_lines), " LINES");
if (opt_columns)
end= strmov(strmov(strmov(end, " ("), opt_columns), ")");
*end= '\0';
diff --git a/include/myisam.h b/include/myisam.h
index c79bdbe14c8..b7010dab814 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -295,6 +295,12 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def);
#define T_QUICK (1L << 30)
#define T_RETRY_WITHOUT_QUICK (1L << 31)
+/* flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
+ * to mi_check.c follows:
+ * */
+
+#define TT_USEFRM 1
+
#define O_NEW_INDEX 1 /* Bits set in out_flag */
#define O_NEW_DATA 2
#define O_DATA_LOST 4
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 113f6680167..ef82b414420 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -177,4 +177,14 @@ a
11
12
13
+(select * from t1 limit 2) union (select * from t2 limit 20,3);
+a
+1
+2
+set SQL_SELECT_LIMIT=2;
+(select * from t1 limit 2) union (select * from t2 limit 3);
+a
+1
+2
+set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index f648ebfd48c..086351e9da1 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -84,4 +84,8 @@ insert into t1 values (1),(2),(3),(4),(5);
insert into t2 values (11),(12),(13),(14),(15);
(select * from t1 limit 2) union (select * from t2 limit 3) limit 4;
(select * from t1 limit 2) union (select * from t2 limit 3);
+(select * from t1 limit 2) union (select * from t2 limit 20,3);
+set SQL_SELECT_LIMIT=2;
+(select * from t1 limit 2) union (select * from t2 limit 3);
+set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6ec02e1216f..c6b0cc1d245 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -870,7 +870,8 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table,
return 1;
}
-static int prepare_for_restore(THD* thd, TABLE_LIST* table)
+static int prepare_for_restore(THD* thd, TABLE_LIST* table,
+ HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("prepare_for_restore");
@@ -919,6 +920,57 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table)
DBUG_RETURN(0);
}
+static int prepare_for_repair(THD* thd, TABLE_LIST* table,
+ HA_CHECK_OPT *check_opt)
+{
+ DBUG_ENTER("prepare_for_repair");
+
+ if (!(check_opt->sql_flags & TT_USEFRM))
+ {
+ DBUG_RETURN(0);
+ }
+ else
+ {
+
+ char from[FN_REFLEN],to[FN_REFLEN];
+ char* db = thd->db ? thd->db : table->db;
+
+ sprintf(from, "%s/%s/%s", mysql_real_data_home, db, table->name);
+ fn_format(from, from, "", MI_NAME_DEXT, 4);
+ sprintf(to,"%s-%lx_%lx", from, current_pid, thd->thread_id);
+
+
+ my_rename(to, from, MYF(MY_WME));
+
+ if (lock_and_wait_for_table_name(thd,table))
+ DBUG_RETURN(-1);
+
+ if (my_rename(from, to, MYF(MY_WME)))
+ {
+ unlock_table_name(thd, table);
+ DBUG_RETURN(send_check_errmsg(thd, table, "repair",
+ "Failed renaming .MYD file"));
+ }
+ if (mysql_truncate(thd, table, 1))
+ {
+ unlock_table_name(thd, table);
+ DBUG_RETURN(send_check_errmsg(thd, table, "repair",
+ "Failed generating table from .frm file"));
+ }
+ if (my_rename(to, from, MYF(MY_WME)))
+ {
+ unlock_table_name(thd, table);
+ DBUG_RETURN(send_check_errmsg(thd, table, "repair",
+ "Failed restoring .MYD file"));
+ }
+ }
+
+ // now we should be able to open the partially repaired table
+ // to finish the repair in the handler later on
+ if (!(table->table = reopen_name_locked_table(thd, table)))
+ unlock_table_name(thd, table);
+ DBUG_RETURN(0);
+}
static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
HA_CHECK_OPT* check_opt,
@@ -926,7 +978,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
thr_lock_type lock_type,
bool open_for_modify,
uint extra_open_options,
- int (*prepare_func)(THD *, TABLE_LIST *),
+ int (*prepare_func)(THD *, TABLE_LIST *, HA_CHECK_OPT *),
int (handler::*operator_func)
(THD *, HA_CHECK_OPT *))
{
@@ -960,7 +1012,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
packet->length(0);
if (prepare_func)
{
- switch ((*prepare_func)(thd, table)) {
+ switch ((*prepare_func)(thd, table, check_opt)) {
case 1: continue; // error, message written to net
case -1: goto err; // error, message could be written to net
default: ; // should be 0 otherwise
@@ -1106,7 +1158,8 @@ int mysql_repair_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
DBUG_ENTER("mysql_repair_table");
DBUG_RETURN(mysql_admin_table(thd, tables, check_opt,
- "repair", TL_WRITE, 1, HA_OPEN_FOR_REPAIR, 0,
+ "repair", TL_WRITE, 1, HA_OPEN_FOR_REPAIR,
+ &prepare_for_repair,
&handler::repair));
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 0aca2668941..1658fa701c5 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -186,7 +186,10 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
thd->options&= ~OPTION_FOUND_ROWS;
}
else
- thd->select_limit= HA_POS_ERROR; // no limit
+ {
+ thd->offset_limit= 0;
+ thd->select_limit= thd->default_select_limit;
+ }
if (describe)
thd->select_limit= HA_POS_ERROR; // no limit
res=mysql_select(thd,&result_table_list,
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5b1a168ae34..00330c7cab7 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1324,9 +1324,9 @@ mi_repair_types:
| mi_repair_type mi_repair_types {}
mi_repair_type:
- QUICK { Lex->check_opt.flags|= T_QUICK; }
+ QUICK { Lex->check_opt.flags|= T_QUICK; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | USE_FRM { /*Lex->check_opt.flags|= T_USEFRM;*/ }
+ | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; }
analyze:
ANALYZE_SYM table_or_tables