Commit 88693ddd authored by Ivan Tyagov's avatar Ivan Tyagov

10.1.18 files not added at first step because they were in .gitignore (my mistake)

parent f8906b63
commit: 6925689ca829901567e9503fd4fdce443f9a7d53
date: 2016-09-29 15:00:20 -0400
build-date: 2016-09-29 21:06:24 +0200
short: 6925689
branch: HEAD
MariaDB source 10.1.18
.\" @(#)user.r 1.13 10/29/86
.\"
.\" 2004-10-29: documented features implemented since 10/29/86
.\" formatting cleanup
.\" - Sergei Golubchik
.\"
.\" DBUG (Macro Debugger Package) nroff source
.\"
.\" nroff -mm user.r >user.t
.\" groff -mm user.r >user.ps
.\"
.\" ===================================================
.\"
.\" === Some sort of black magic, but I forget...
.tr ~
.\" === Hyphenation control (1 = on)
.\".nr Hy 1
.\" === Force all first level headings to start on new page
.nr Ej 1
.\" === Set for breaks after headings for levels 1-3
.nr Hb 3
.\" === Set for space after headings for levels 1-3
.nr Hs 3
.\" === Set standard indent for one/half inch
.nr Si 10
.\" === Set page header
.PH "/DBUG User Manual//\*(DT/"
.\" === Set page footer
.PF "// - % - //"
.\" === Set page offset
.\".po 0.60i
.\" === Set line length
.\".ll 6.5i
.TL
.warn 0
D B U G
.P 0
C Program Debugging Package
.P 0
by
.AU "Fred Fish"
.AF ""
.SA 1
.\" === All paragraphs indented.
.nr Pt 1
.AS 1
This document introduces
.I dbug ,
a macro based C debugging
package which has proven to be a very flexible and useful tool
for debugging, testing, and porting C programs.
.P
All of the features of the
.I dbug
package can be enabled or disabled dynamically at execution time.
This means that production programs will run normally when
debugging is not enabled, and eliminates the need to maintain two
separate versions of a program.
.P
Many of the things easily accomplished with conventional debugging
tools, such as symbolic debuggers, are difficult or impossible with this
package, and vice versa.
Thus the
.I dbug
package should
.I not
be thought of as a replacement or substitute for
other debugging tools, but simply as a useful
.I addition
to the
program development and maintenance environment.
.AE
.MT 4
.SK
.B
INTRODUCTION
.R
.P
Almost every program development environment worthy of the name
provides some sort of debugging facility.
Usually this takes the form of a program which is capable of
controlling execution of other programs and examining the internal
state of other executing programs.
These types of programs will be referred to as external debuggers
since the debugger is not part of the executing program.
Examples of this type of debugger include the
.B adb
and
.B sdb
debuggers provided with the
.B UNIX\*F
.FS
UNIX is a trademark of AT&T Bell Laboratories.
.FE
operating system.
.P
One of the problems associated with developing programs in an environment
with good external debuggers is that developed programs tend to have
little or no internal instrumentation.
This is usually not a problem for the developer since he is,
or at least should be, intimately familiar with the internal organization,
data structures, and control flow of the program being debugged.
It is a serious problem for maintenance programmers, who
are unlikely to have such familiarity with the program being
maintained, modified, or ported to another environment.
It is also a problem, even for the developer, when the program is
moved to an environment with a primitive or unfamiliar debugger,
or even no debugger.
.P
On the other hand,
.I dbug
is an example of an internal debugger.
Because it requires internal instrumentation of a program,
and its usage does not depend on any special capabilities of
the execution environment, it is always available and will
execute in any environment that the program itself will
execute in.
In addition, since it is a complete package with a specific
user interface, all programs which use it will be provided
with similar debugging capabilities.
This is in sharp contrast to other forms of internal instrumentation
where each developer has their own, usually less capable, form
of internal debugger.
In summary,
because
.I dbug
is an internal debugger it provides consistency across operating
environments,
and because it is available to all developers it provides
consistency across all programs in the same environment.
.P
The
.I dbug
package imposes only a slight speed penalty on executing
programs, typically much less than 10 percent, and a modest size
penalty, typically 10 to 20 percent.
By defining a specific C preprocessor symbol both of these
can be reduced to zero with no changes required to the
source code.
.P
The following list is a quick summary of the capabilities
of the
.I dbug
package.
Each capability can be individually enabled or disabled
at the time a program is invoked by specifying the appropriate
command line arguments.
.SP 1
.ML o 1i
.LI
Execution trace showing function level control flow in a
semi-graphically manner using indentation to indicate nesting
depth.
.LI
Output the values of all, or any subset of, key internal variables.
.LI
Limit actions to a specific set of named functions.
.LI
Limit function trace to a specified nesting depth.
.LI
Label each output line with source file name and line number.
.LI
Label each output line with name of current process.
.LI
Push or pop internal debugging state to allow execution with
built in debugging defaults.
.LI
Redirect the debug output stream to standard output (stdout)
or a named file.
The default output stream is standard error (stderr).
The redirection mechanism is completely independent of
normal command line redirection to avoid output conflicts.
.LE
.SK
.B
PRIMITIVE DEBUGGING TECHNIQUES
.R
.P
Internal instrumentation is already a familiar concept
to most programmers, since it is usually the first debugging
technique learned.
Typically, "print\ statements" are inserted in the source
code at interesting points, the code is recompiled and executed,
and the resulting output is examined in an attempt to determine
where the problem is.
The procedure is iterative, with each iteration yielding more
and more output, and hopefully the source of the problem is
discovered before the output becomes too large to deal with
or previously inserted statements need to be removed.
Figure 1 is an example of this type of primitive debugging
technique.
.DS I N
.SP 2
\fC
.so example1.r
\fR
.SP 2
.ll -5
.ce
Figure 1
.ce
Primitive Debugging Technique
.ll +5
.SP 2
.DE
.P
Eventually, and usually after at least several iterations, the
problem will be found and corrected.
At this point, the newly inserted print statements must be
dealt with.
One obvious solution is to simply delete them all.
Beginners usually do this a few times until they have to
repeat the entire process every time a new bug pops up.
The second most obvious solution is to somehow disable
the output, either through the source code comment facility,
creation of a debug variable to be switched on or off, or by using the
C preprocessor.
Figure 2 is an example of all three techniques.
.DS I N
.SP 2
\fC
.so example2.r
\fR
.SP 2
.ll -5
.ce
Figure 2
.ce
Debug Disable Techniques
.ll +5
.SP 2
.DE
.P
Each technique has its advantages and disadvantages with respect
to dynamic vs static activation, source code overhead, recompilation
requirements, ease of use, program readability, etc.
Overuse of the preprocessor solution quickly leads to problems with
source code readability and maintainability when multiple
.B #ifdef
symbols are to be defined or undefined based on specific types
of debug desired.
The source code can be made slightly more readable by suitable indentation
of the
.B #ifdef
arguments to match the indentation of the code, but
not all C preprocessors allow this.
The only requirement for the standard
.B UNIX
C preprocessor is for the '#' character to appear
in the first column, but even this seems
like an arbitrary and unreasonable restriction.
Figure 3 is an example of this usage.
.DS I N
.SP 2
\fC
.so example3.r
\fR
.SP 2
.ll -5
.ce
Figure 3
.ce
More Readable Preprocessor Usage
.ll +5
.SP 2
.DE
.SK
.B
FUNCTION TRACE EXAMPLE
.R
.P
We will start off learning about the capabilities of the
.I dbug
package by using a simple minded program which computes the
factorial of a number.
In order to better demonstrate the function trace mechanism, this
program is implemented recursively.
Figure 4 is the main function for this factorial program.
.DS I N
.SP 2
\fC
.so main.r
\fR
.SP 2
.ll -5
.ce
Figure 4
.ce
Factorial Program Mainline
.ll +5
.SP 2
.DE
.P
The
.B main
function is responsible for processing any command line
option arguments and then computing and printing the factorial of
each non-option argument.
.P
First of all, notice that all of the debugger functions are implemented
via preprocessor macros.
This does not detract from the readability of the code and makes disabling
all debug compilation trivial (a single preprocessor symbol,
.B DBUG_OFF ,
forces the macro expansions to be null).
.P
Also notice the inclusion of the header file
.B dbug.h
from the local header file directory.
(The version included here is the test version in the dbug source
distribution directory).
This file contains all the definitions for the debugger macros, which
all have the form
.B DBUG_XX...XX .
.P
The
.B DBUG_ENTER
macro informs that debugger that we have entered the
function named
.B main .
It must be the very first "executable" line in a function, after
all declarations and before any other executable line.
The
.B DBUG_PROCESS
macro is generally used only once per program to
inform the debugger what name the program was invoked with.
The
.B DBUG_PUSH
macro modifies the current debugger state by
saving the previous state and setting a new state based on the
control string passed as its argument.
The
.B DBUG_PRINT
macro is used to print the values of each argument
for which a factorial is to be computed.
The
.B DBUG_RETURN
macro tells the debugger that the end of the current
function has been reached and returns a value to the calling
function.
All of these macros will be fully explained in subsequent sections.
.P
To use the debugger, the factorial program is invoked with a command
line of the form:
.DS CB N
\fCfactorial -#d:t 1 2 3
.DE
The
.B main
function recognizes the "-#d:t" string as a debugger control
string, and passes the debugger arguments ("d:t") to the
.I dbug
runtime support routines via the
.B DBUG_PUSH
macro.
This particular string enables output from the
.B DBUG_PRINT
macro with the 'd' flag and enables function tracing with the 't' flag.
The factorial function is then called three times, with the arguments
"1", "2", and "3".
Note that the DBUG_PRINT takes exactly
.B two
arguments, with the second argument (a format string and list
of printable values) enclosed in parentheses.
.P
Debug control strings consist of a header, the "-#", followed
by a colon separated list of debugger arguments.
Each debugger argument is a single character flag followed
by an optional comma separated list of arguments specific
to the given flag.
Some examples are:
.DS CB N
\fC
-#d:t:o
-#d,in,out:f,main:F:L
.DE
Note that previously enabled debugger actions can be disabled by the
control string "-#".
.P
The definition of the factorial function, symbolized as "N!", is
given by:
.DS CB N
N! = N * N-1 * ... 2 * 1
.DE
Figure 5 is the factorial function which implements this algorithm
recursively.
Note that this is not necessarily the best way to do factorials
and error conditions are ignored completely.
.DS I N
.SP 2
\fC
.so factorial.r
\fR
.SP 2
.ll -5
.ce
Figure 5
.ce
Factorial Function
.ll +5
.SP 2
.DE
.P
One advantage (some may not consider it so) to using the
.I dbug
package is that it strongly encourages fully structured coding
with only one entry and one exit point in each function.
Multiple exit points, such as early returns to escape a loop,
may be used, but each such point requires the use of an
appropriate
.B DBUG_RETURN
or
.B DBUG_VOID_RETURN
macro.
.P
To build the factorial program on a
.B UNIX
system, compile and
link with the command:
.DS CB N
\fCcc -o factorial main.c factorial.c -ldbug
.DE
The "-ldbug" argument tells the loader to link in the
runtime support modules for the
.I dbug
package.
Executing the factorial program with a command of the form:
.DS CB N
\fCfactorial 1 2 3 4 5
.DE
generates the output shown in figure 6.
.DS I N
.SP 2
\fC
.so output1.r
\fR
.SP 2
.ll -5
.ce
Figure 6
.ce
\fCfactorial 1 2 3 4 5
.ll +5
.SP 2
.DE
.P
Function level tracing is enabled by passing the debugger
the 't' flag in the debug control string.
Figure 7 is the output resulting from the command
"factorial\ -#t:o\ 2\ 3".
.DS I N
.SP 2
\fC
.so output2.r
\fR
.SP 2
.ll -5
.ce
Figure 7
.ce
\fCfactorial -#t:o 2 3
.ll +5
.SP 2
.DE
.P
Each entry to or return from a function is indicated by '>' for the
entry point and '<' for the exit point, connected by
vertical bars to allow matching points to be easily found
when separated by large distances.
.P
This trace output indicates that there was an initial call
to factorial from main (to compute 2!), followed by
a single recursive call to factorial to compute 1!.
The main program then output the result for 2! and called the
factorial function again with the second argument, 3.
Factorial called itself recursively to compute 2! and 1!, then
returned control to main, which output the value for 3! and exited.
.P
Note that there is no matching entry point "main>" for the
return point "<main" because at the time the
.B DBUG_ENTER
macro was reached in main, tracing was not enabled yet.
It was only after the macro
.B DBUG_PUSH
was executing that tracing became enabled.
This implies that the argument list should be processed as early as
possible since all code preceding the first call to
.B DBUG_PUSH
is
essentially invisible to
.I dbug
(this can be worked around by
inserting a temporary
.B DBUG_PUSH(argv[1])
immediately after the
.B DBUG_ENTER("main")
macro.
.P
One last note,
the trace output normally comes out on the standard error.
Since the factorial program prints its result on the standard
output, there is the possibility of the output on the terminal
being scrambled if the two streams are not synchronized.
Thus the debugger is told to write its output on the standard
output instead, via the 'o' flag character.
Note that no 'o' implies the default (standard error), a 'o'
with no arguments means standard output, and a 'o'
with an argument means used the named file.
i.e, "factorial\ -#t:o,logfile\ 3\ 2" would write the trace
output in "logfile".
Because of
.B UNIX
implementation details, programs usually run
faster when writing to stdout rather than stderr, though this
is not a prime consideration in this example.
.SK
.B
USE OF DBUG_PRINT MACRO
.R
.P
The mechanism used to produce "printf" style output is the
.B DBUG_PRINT
macro.
.P
To allow selection of output from specific macros, the first argument
to every
.B DBUG_PRINT
macro is a
.I dbug
keyword.
When this keyword appears in the argument list of the 'd' flag in
a debug control string, as in "-#d,keyword1,keyword2,...:t",
output from the corresponding macro is enabled.
The default when there is no 'd' flag in the control string is to
enable output from all
.B DBUG_PRINT
macros.
.P
Typically, a program will be run once, with no keywords specified,
to determine what keywords are significant for the current problem
(the keywords are printed in the macro output line).
Then the program will be run again, with the desired keywords,
to examine only specific areas of interest.
.P
The second argument to a
.B DBUG_PRINT
macro is a standard printf style
format string and one or more arguments to print, all
enclosed in parentheses so that they collectively become a single macro
argument.
This is how variable numbers of printf arguments are supported.
Also note that no explicit newline is required at the end of the format string.
As a matter of style, two or three small
.B DBUG_PRINT
macros are preferable
to a single macro with a huge format string.
Figure 8 shows the output for default tracing and debug.
.DS I N
.SP 2
\fC
.so output3.r
\fR
.SP 2
.ll -5
.ce
Figure 8
.ce
\fCfactorial -#d:t:o 3
.ll +5
.SP 2
.DE
.P
The output from the
.B DBUG_PRINT
macro is indented to match the trace output
for the function in which the macro occurs.
When debugging is enabled, but not trace, the output starts at the left
margin, without indentation.
.P
To demonstrate selection of specific macros for output, figure
9 shows the result when the factorial program is invoked with
the debug control string "-#d,result:o".
.DS I N
.SP 2
\fC
.so output4.r
\fR
.SP 2
.ll -5
.ce
Figure 9
.ce
\fCfactorial -#d,result:o 4
.ll +5
.SP 2
.DE
.P
It is sometimes desirable to restrict debugging and trace actions
to a specific function or list of functions.
This is accomplished with the 'f' flag character in the debug
control string.
Figure 10 is the output of the factorial program when run with the
control string "-#d:f,factorial:F:L:o".
The 'F' flag enables printing of the source file name and the 'L'
flag enables printing of the source file line number.
.DS I N
.SP 2
\fC
.so output5.r
\fR
.SP 2
.ll -5
.ce
Figure 10
.ce
\fCfactorial -#d:f,factorial:F:L:o 3
.ll +5
.SP 2
.DE
.P
The output in figure 10 shows that the "find" macro is in file
"factorial.c" at source line 8 and the "result" macro is in the same
file at source line 12.
.SK
.B
SUMMARY OF MACROS
.R
.P
This section summarizes the usage of all currently defined macros
in the
.I dbug
package.
The macros definitions are found in the user include file
.B dbug.h
from the standard include directory.
.SP 2
.BL 20
.LI DBUG_ENTER\
Used to tell the runtime support module the name of the function being
entered. The argument must be of type "pointer to character". The
DBUG_ENTER macro must precede all executable lines in the function
just entered, and must come after all local declarations. Each
DBUG_ENTER macro must have a matching DBUG_RETURN or DBUG_VOID_RETURN
macro at the function exit points. DBUG_ENTER macros used without a
matching DBUG_RETURN or DBUG_VOID_RETURN macro will cause warning
messages from the
.I dbug
package runtime support module.
.SP 1
EX:\ \fCDBUG_ENTER\ ("main");\fR
.SP 1
.LI DBUG_RETURN\
Used at each exit point of a function containing a DBUG_ENTER macro at
the entry point. The argument is the value to return. Functions
which return no value (void) should use the DBUG_VOID_RETURN macro.
It is an error to have a DBUG_RETURN or DBUG_VOID_RETURN macro in a
function which has no matching DBUG_ENTER macro, and the compiler will
complain if the macros are actually used (expanded).
.SP 1
EX:\ \fCDBUG_RETURN\ (value);\fR
.br
EX:\ \fCDBUG_VOID_RETURN;\fR
.SP 1
.LI DBUG_PROCESS\
Used to name the current process being executed.
A typical argument for this macro is "argv[0]", though
it will be perfectly happy with any other string.
Im multi-threaded environment threads may have different names.
.SP 1
EX:\ \fCDBUG_PROCESS\ (argv[0]);\fR
.SP 1
.LI DBUG_PUSH\
Sets a new debugger state by pushing the current
.I dbug
state onto an internal stack and setting up the new state using the
debug control string passed as the macro argument. The most common
usage is to set the state specified by a debug control string
retrieved from the argument list. If the control string is
.I incremental,
the new state is a copy of the old state, modified by the control
string.
.SP 1
EX:\ \fCDBUG_PUSH\ (\&(argv[i][2]));\fR
.br
EX:\ \fCDBUG_PUSH\ ("d:t");\fR
.br
EX:\ \fCDBUG_PUSH\ ("");\fR
.SP 1
.LI DBUG_POP\
Restores the previous debugger state by popping the state stack.
Attempting to pop more states than pushed will be ignored and no
warning will be given. The DBUG_POP macro has no arguments.
.SP 1
EX:\ \fCDBUG_POP\ ();\fR
.SP 1
.LI DBUG_SET\
Modifies the current debugger state on top of the stack or pushes
a new state if the current is set to the initial settings, using
the debug control string passed as the macro argument. Unless
.I incremental
control string is used (see below), it's equivalent to a combination of
DBUG_POP and DBUG_PUSH.
.SP 1
EX:\ \fCDBUG_SET\ ("d:t");\fR
.br
EX:\ \fCDBUG_SET\ ("+d,info");\fR
.br
EX:\ \fCDBUG_SET\ ("+t:-d");\fR
.SP 1
.LI DBUG_FILE\
The DBUG_FILE macro is used to do explicit I/O on the debug output
stream. It is used in the same manner as the symbols "stdout" and
"stderr" in the standard I/O package.
.SP 1
EX:\ \fCfprintf\ (DBUG_FILE,\ "Doing\ my\ own\ I/O!\\n");\fR
.SP 1
.LI DBUG_EXECUTE\
The DBUG_EXECUTE macro is used to execute any arbitrary C code. The
first argument is the debug keyword, used to trigger execution of the
code specified as the second argument. This macro must be used
cautiously because, like the DBUG_PRINT macro, it is automatically
selected by default whenever the 'd' flag has no argument list (i.e.,
a "-#d:t" control string).
.SP 1
EX:\ \fCDBUG_EXECUTE\ ("status",\ print_status\ ());\fR
.SP 1
.LI DBUG_EXECUTE_IF\
Works like DBUG_EXECUTE macro, but the code is
.B not
executed "by default", if the keyword is not explicitly listed in
the 'd' flag. Used to conditionally execute "dangerous" actions, e.g
to crash the program testing how recovery works, or to introduce an
artificial delay checking for race conditions.
.SP 1
EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR
.SP 1
.LI DBUG_EVALUATE\
The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in
the expression context. The first argument is the debug keyword that is used to
choose whether the second (keyword is enabled) or the third (keyword is not
enabled) argument is evaluated. When
.I dbug
is compiled off, the third argument is evaluated.
.SP 1
EX:\fC
.br
printf("Info-debug is %s",
.br
DBUG_EVALUATE\ ("info", "ON", "OFF"));\fR
.SP 1
.LI DBUG_EVALUATE_IF\
Works like DBUG_EVALUATE macro, but the second argument is
.B not
evaluated, if the keyword is not explicitly listed in
the 'd' flag. Like DBUG_EXECUTE_IF this could be used to conditionally execute
"dangerous" actions.
.SP 1
EX:\fC
.br
if (prepare_transaction () ||
.br
DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) ||
.br
commit_transaction () )\fR
.SP 1
.LI DBUG_PRINT\
Used to do printing via the "fprintf" library function on the current
debug stream, DBUG_FILE. The first argument is a debug keyword, the
second is a format string and the corresponding argument list. Note
that the format string and argument list are all one macro argument
and
.B must
be enclosed in parentheses.
.SP 1
EX:\ \fCDBUG_PRINT\ ("eof",\ ("end\ of\ file\ found"));\fR
.br
EX:\ \fCDBUG_PRINT\ ("type",\ ("type\ is\ %x", type));\fR
.br
EX:\ \fCDBUG_PRINT\ ("stp",\ ("%x\ ->\ %s", stp, stp\ ->\ name));\fR
.SP 1
.LI DBUG_DUMP\
Used to dump a memory block in hex via the "fprintf" library function
on the current debug stream, DBUG_FILE. The first argument is a debug
keyword, the second is a pointer to a memory to dump, the third is a
number of bytes to dump.
.SP 1
EX: \fCDBUG_DBUG\ ("net",\ packet,\ len);\fR
.SP 1
.LI DBUG_LOCK_FILE\
Used in multi-threaded environment to lock DBUG_FILE stream.
It can be used, for example, in functions that need to write something to a
debug stream more than in one fprintf() call and want to ensure that no other
thread will write something in between.
.SP 1
EX:\fC
.br
DBUG_LOCK_FILE;
.br
fprintf (DBUG_FILE, "a=[");
.br
for (int i=0; i < a_length; i++)
.br
fprintf (DBUG_FILE, "0x%03x ", a[i]);
.br
fprintf (DBUG_FILE, "]");
.br
DBUG_UNLOCK_FILE;\fR
.SP 1
.LI DBUG_UNLOCK_FILE\
Unlocks DBUG_FILE stream, that was locked with a DBUG_LOCK_FILE.
.LI DBUG_ASSERT\
This macro just does a regular assert(). The difference is that it will be
disabled by DBUG_OFF togeher with the
.I dbug
library. So there will be no need to disable asserts separately with NDEBUG.
.SP 1
EX:\ \fCDBUG_ASSERT(\ a\ >\ 0\ );\fR
.SP 1
.LI DBUG_ABORT\
This macro could be used instead of abort(). It flushes DBUG_FILE stream
to ensure that no
.I dbug
output is lost and then calls abort().
.SP 1
.LI DBUG_EXPLAIN\
Generates control string corresponding to the current debug state.
The macro takes two arguments - a buffer to store the result string
into and its length. The macro (which could be used as a function)
returns 1 if the control string didn't fit into the buffer and was
truncated and 0 otherwise.
.SP 1
EX:\fC
.br
char buf[256];
.br
DBUG_EXPLAIN( buf, sizeof(buf) );\fR
.SP 1
.LI DBUG_SET_INITIAL\
.LI DBUG_EXPLAIN_INITIAL\
.br
These two macros are identical to DBUG_SET and DBUG_EXPLAIN, but they
operate on the debug state that any new thread starts from.
Modifying
.I initial
value does not affect threads that are already running. Obviously,
these macros are only useful in the multi-threaded environment.
.LE
.SK
.B
DEBUG CONTROL STRING
.R
.P
The debug control string is used to set the state of the debugger
via the
.B DBUG_PUSH
or
.B DBUG_SET
macros. Control string consists of colon separated flags. Colons
that are part of ':\\', ':/', or '::' are not considered flag
separators. A flag may take an argument or a list of arguments.
If a control string starts from a '+' sign it works
.I incrementally,
that is, it can modify existing state without overriding it. Every
flag may be preceded by a '+' or '-' to enable or disable a
corresponding option in the debugger state or to add or remove
arguments to the list. This section summarizes the currently available
debugger options and the flag characters which enable or disable them.
Argument lists enclosed in '[' and ']' are optional.
.SP 2
.BL 22
.LI a[,file]
Redirect the debugger output stream and append it to the specified
file. The default output stream is stderr. A null argument list
causes output to be redirected to stdout.
.SP 1
EX: \fCa,C:\\tmp\\log\fR
.LI A[,file]
Like 'a[,file]' but ensure that data are written after each write
(this typically implies flush or close/reopen). It helps to get
a complete log file in case of crashes. This mode is implicit in
multi-threaded environment.
.LI d[,keywords]
Enable output from macros with specified keywords.
Every keyword can be a
.I glob(7)
pattern.
An empty list of keywords implies that all keywords are selected.
.LI D[,time]
Delay for specified time after each output line, to let output drain.
Time is given in tenths of a second (value of 10 is one second).
Default is zero.
.LI f[,functions]
Limit debugger actions to the specified list of functions.
Every function can be a
.I glob(7)
pattern.
An empty list of functions implies that all functions are selected.
Every function in the list may optionally be followed by a '/' -
this will implicitly select all the functions down the call stack.
.SP 1
EX: \fCf,func1,func2/:-f,func3,func4/\fR
.SP 1
This would enable debugger in functions 'func1()', 'func2()' and all
functions called from it (directly or indirectly). But not in
functions 'func3()' or 'func4()' and all functions called from
it.
.LI F
Mark each debugger output line with the name of the source file
containing the macro causing the output.
.LI i
Mark each debugger output line with the PID (or thread ID) of the
current process.
.LI L
Mark each debugger output line with the source file line number of
the macro causing the output.
.LI n
Mark each debugger output line with the current function nesting depth.
.LI N
Sequentially number each debugger output line starting at 1.
This is useful for reference purposes when debugger output is
interspersed with program output.
.LI o[,file]
Like 'a[,file]' but overwrite old file, do not append.
.LI O[,file]
Like 'A[,file]' but overwrite old file, do not append.
.LI p[,processes]
Limit debugger actions to the specified processes.
Every name can be a
.I glob(7)
pattern.
An empty list
implies all processes. This is useful for processes which run child
processes. Note that each debugger output line can be marked with the
name of the current process via the 'P' flag. The process name must
match the argument passed to the
.B DBUG_PROCESS
macro.
.LI P
Mark each debugger output line with the name of the current process.
Most useful when used with a process which runs child processes that
are also being debugged. Note that the parent process must arrange
for the debugger control string to be passed to the child processes.
.LI r
Used in conjunction with the
.B DBUG_PUSH
macro to reset the current
indentation level back to zero.
Most useful with
.B DBUG_PUSH
macros used to temporarily alter the
debugger state.
.LI S
When compiled with
.I safemalloc
this flag invokes "sanity" memory checks (for overwrites/underwrites)
on each
.B DBUG_ENTER
and
.B DBUG_RETURN.
.LI t[,N]
Enable function control flow tracing.
The maximum nesting depth is specified by N, and defaults to
200.
.LI T
Mark each debugger output line with the current timestamp.
The value is printed with microsecond resolution, as returned by
.I gettimeofday()
system call. The actual resolution is OS- and hardware-dependent.
.LE
.SK
.B
MULTI-THREADED DEBUGGING
.R
.P
When
.I dbug
is used in a multi-threaded environment there are few differences from a single-threaded
case to keep in mind. This section tries to summarize them.
.SP 2
.BL 5
.LI
Every thread has its own stack of debugger states.
.B DBUG_PUSH
and
.B DBUG_POP
affect only the thread that executed them.
.LI
At the bottom of the stack for all threads there is the common
.I initial
state. Changes to this state (for example, with
.B DBUG_SET_INITIAL
macro) affect all new threads and all running threads that didn't
.B DBUG_PUSH
yet.
.LI
Every thread can have its own name, that can be set with
.B DBUG_PROCESS
macro. Thus, "-#p,name1,name2" can be used to limit the output to specific threads.
.LI
When printing directly to
.B DBUG_FILE
it may be necessary to prevent other threads from writing something between two parts
of logically indivisible output. It is done with
.B DBUG_LOCK_FILE
and
.B DBUG_UNLOCK_FILE
macors. See the appropriate section for examples.
.LI
"-#o,file" and "-#O,file" are treated as "-#a,file" and "-#A,file" respectively. That is
all writes to a file are always followed by a flush.
.LI
"-#i" prints not a PID but a thread id in the form of "T@nnn"
.LE
.SK
.B
HINTS AND MISCELLANEOUS
.R
.P
One of the most useful capabilities of the
.I dbug
package is to compare the executions of a given program in two
different environments.
This is typically done by executing the program in the environment
where it behaves properly and saving the debugger output in a
reference file.
The program is then run with identical inputs in the environment where
it misbehaves and the output is again captured in a reference file.
The two reference files can then be differentially compared to
determine exactly where execution of the two processes diverges.
.P
A related usage is regression testing where the execution of a current
version is compared against executions of previous versions.
This is most useful when there are only minor changes.
.P
It is not difficult to modify an existing compiler to implement
some of the functionality of the
.I dbug
package automatically, without source code changes to the
program being debugged.
In fact, such changes were implemented in a version of the
Portable C Compiler by the author in less than a day.
However, it is strongly encouraged that all newly
developed code continue to use the debugger macros
for the portability reasons noted earlier.
The modified compiler should be used only for testing existing
programs.
.SK
.B
CAVEATS
.R
.P
The
.I dbug
package works best with programs which have "line\ oriented"
output, such as text processors, general purpose utilities, etc.
It can be interfaced with screen oriented programs such as
visual editors by redefining the appropriate macros to call
special functions for displaying the debugger results.
Of course, this caveat is not applicable if the debugger output
is simply dumped into a file for post-execution examination.
.P
Programs which use memory allocation functions other than
.B malloc
will usually have problems using the standard
.I dbug
package.
The most common problem is multiply allocated memory.
.SP 2
.\" .DE nroff dident like this. davida 900108
.CS
.\" vim:filetype=nroff
show create table t55;
Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYI
36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYI
36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYI
27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYI
45 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYI
8594 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.frm
408 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.par
Can't open perl script "./mtr": No such file or directory
[a@c54hdd libhsclient]$ ./hstest_hs.sh host=192.168.100.104 key_mask=1000000 num_threads=100 num=10000000 timelimit=10 dbname=hstest
now: 1274127653 cntdiff: 265538 tdiff: 1.000996 rps: 265273.757409
now: 1274127654 cntdiff: 265762 tdiff: 1.000995 rps: 265497.850684
now: 1274127655 cntdiff: 265435 tdiff: 1.001010 rps: 265167.196749
now: 1274127656 cntdiff: 265144 tdiff: 1.000994 rps: 264880.654203
now: 1274127657 cntdiff: 265593 tdiff: 1.000995 rps: 265329.018659
now: 1274127658 cntdiff: 264863 tdiff: 1.000996 rps: 264599.492138
now: 1274127659 cntdiff: 265688 tdiff: 1.001008 rps: 265420.447231
now: 1274127660 cntdiff: 265727 tdiff: 1.000999 rps: 265461.810594
now: 1274127661 cntdiff: 265848 tdiff: 1.001010 rps: 265579.716809
now: 1274127662 cntdiff: 265430 tdiff: 1.000992 rps: 265167.001723
now: 1274127663 cntdiff: 266379 tdiff: 1.001008 rps: 266110.751381
now: 1274127664 cntdiff: 266244 tdiff: 1.001003 rps: 265977.217679
now: 1274127665 cntdiff: 265737 tdiff: 1.000996 rps: 265472.559379
now: 1274127666 cntdiff: 265878 tdiff: 1.001003 rps: 265611.647683
(1274127656.104648: 1328292, 1274127666.114649: 3985679), 265473.20173 qps
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
100518 5:18:13 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 5 seconds
----------
BACKGROUND THREAD
----------
srv_master_thread loops: 191 1_second, 190 sleeps, 18 10_second, 5 background, 5 flush
srv_master_thread log flush and writes: 190
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 53519, signal count 29547
Mutex spin waits 3083488, rounds 5159906, OS waits 50700
RW-shared spins 21, OS waits 16; RW-excl spins 1, OS waits 4
Spin rounds per wait: 1.67 mutex, 30.00 RW-shared, 151.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter EDA36085
Purge done for trx's n:o < EC1F94A7 undo n:o < 0
History list length 20
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started, process no 4533, OS thread id 1079281984
MySQL thread id 11, query id 16 localhost root
show engine innodb status
---TRANSACTION ED9D5959, not started, process no 4533, OS thread id 1089849664
MySQL thread id 7, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION ED9D5956, not started, process no 4533, OS thread id 1238796608
MySQL thread id 1, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION EDA36084, not started, process no 4533, OS thread id 1255582016
mysql tables in use 1, locked 1
MySQL thread id 3, query id 0 handlersocket: mode=rd, 12 conns, 7 active
---TRANSACTION EDA36080, not started, process no 4533, OS thread id 1247189312
mysql tables in use 1, locked 1
MySQL thread id 2, query id 0 handlersocket: mode=rd, 36 conns, 18 active
---TRANSACTION EDA36082, ACTIVE 0 sec, process no 4533, OS thread id 1263974720 committing
MySQL thread id 4, query id 0 handlersocket: mode=rd, 37 conns, 20 active
Trx read view will not see trx with id >= EDA36083, sees < EDA3607D
---TRANSACTION EDA3607D, ACTIVE 0 sec, process no 4533, OS thread id 1272367424, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
MySQL thread id 5, query id 0 handlersocket: mode=rd, 15 conns, 9 active
Trx read view will not see trx with id >= EDA3607E, sees < EDA36079
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
71 OS file reads, 235 OS file writes, 235 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 1.00 writes/s, 1.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 12750011, node heap has 2 buffer(s)
267203.76 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 147179727377
Log flushed up to 147179726685
Last checkpoint at 147179716475
0 pending log writes, 0 pending chkp writes
194 log i/o's done, 1.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 6587154432; in additional pool allocated 0
Dictionary memory allocated 33640
Buffer pool size 393216
Free buffers 393154
Database pages 60
Old database pages 0
Modified db pages 1
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 60, created 0, written 23
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s
LRU len: 60, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
2 queries inside InnoDB, 0 queries in queue
3 read views open inside InnoDB
Main thread process no. 4533, id 1230403904, state: sleeping
Number of rows inserted 0, updated 0, deleted 0, read 37653556
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 266608.28 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
[a@c54hdd libhsclient]$ ./hstest_my.sh host=192.168.100.104 key_mask=1000000 num_threads=100 num=10000000 timelimit=10 dbname=hstest
now: 1274128046 cntdiff: 63061 tdiff: 1.000999 rps: 62998.066579
now: 1274128047 cntdiff: 61227 tdiff: 1.001013 rps: 61165.037337
now: 1274128048 cntdiff: 61367 tdiff: 1.001029 rps: 61303.917375
now: 1274128049 cntdiff: 61959 tdiff: 1.000962 rps: 61899.451554
now: 1274128050 cntdiff: 62176 tdiff: 1.001006 rps: 62113.520756
now: 1274128051 cntdiff: 61367 tdiff: 1.000998 rps: 61305.815559
now: 1274128052 cntdiff: 61644 tdiff: 1.001015 rps: 61581.497988
now: 1274128053 cntdiff: 60659 tdiff: 1.000984 rps: 60599.373036
now: 1274128054 cntdiff: 59459 tdiff: 1.000996 rps: 59399.831067
now: 1274128055 cntdiff: 62310 tdiff: 1.001011 rps: 62247.074757
now: 1274128056 cntdiff: 61947 tdiff: 1.000991 rps: 61885.664744
now: 1274128057 cntdiff: 60675 tdiff: 1.001006 rps: 60614.029076
now: 1274128058 cntdiff: 60312 tdiff: 1.001001 rps: 60251.680861
now: 1274128059 cntdiff: 60290 tdiff: 1.001004 rps: 60229.530717
(1274128049.309634: 309654, 1274128059.319648: 920493), 61022.79143 qps
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
100518 5:24:51 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 5 seconds
----------
BACKGROUND THREAD
----------
srv_master_thread loops: 220 1_second, 219 sleeps, 21 10_second, 6 background, 6 flush
srv_master_thread log flush and writes: 219
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 56193, signal count 30826
Mutex spin waits 3415153, rounds 5618661, OS waits 53251
RW-shared spins 24, OS waits 17; RW-excl spins 1, OS waits 5
Spin rounds per wait: 1.65 mutex, 30.00 RW-shared, 181.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter EDB514D6
Purge done for trx's n:o < EC1F94A7 undo n:o < 0
History list length 20
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started, process no 4533, OS thread id 1306585408
MySQL thread id 113, query id 920620 localhost root
show engine innodb status
---TRANSACTION EDA708BB, not started, process no 4533, OS thread id 1272367424
MySQL thread id 5, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION ED9D5959, not started, process no 4533, OS thread id 1089849664
MySQL thread id 7, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION ED9D5956, not started, process no 4533, OS thread id 1238796608
MySQL thread id 1, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION EDA708BD, not started, process no 4533, OS thread id 1255582016
MySQL thread id 3, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION EDA708BF, not started, process no 4533, OS thread id 1247189312
MySQL thread id 2, query id 0 handlersocket: mode=rd, 0 conns, 0 active
---TRANSACTION EDA708BE, not started, process no 4533, OS thread id 1263974720
MySQL thread id 4, query id 0 handlersocket: mode=rd, 0 conns, 0 active
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
71 OS file reads, 269 OS file writes, 269 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 2.40 writes/s, 2.40 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 12750011, node heap has 2 buffer(s)
65739.45 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 147179774153
Log flushed up to 147179771813
Last checkpoint at 147179761899
0 pending log writes, 0 pending chkp writes
220 log i/o's done, 1.60 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 6587154432; in additional pool allocated 0
Dictionary memory allocated 33640
Buffer pool size 393216
Free buffers 393154
Database pages 60
Old database pages 0
Modified db pages 1
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 60, created 0, written 27
0.00 reads/s, 0.00 creates/s, 0.40 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s
LRU len: 60, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 4533, id 1230403904, state: sleeping
Number of rows inserted 0, updated 0, deleted 0, read 40071920
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 66321.54 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
This source diff could not be displayed because it is too large. You can view the blob instead.
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
ABORT_SYM = 258,
ACCESSIBLE_SYM = 259,
ACTION = 260,
ADD = 261,
ADMIN_SYM = 262,
ADDDATE_SYM = 263,
AFTER_SYM = 264,
AGAINST = 265,
AGGREGATE_SYM = 266,
ALGORITHM_SYM = 267,
ALL = 268,
ALTER = 269,
ALWAYS_SYM = 270,
ANALYZE_SYM = 271,
AND_AND_SYM = 272,
AND_SYM = 273,
ANY_SYM = 274,
AS = 275,
ASC = 276,
ASCII_SYM = 277,
ASENSITIVE_SYM = 278,
AT_SYM = 279,
ATOMIC_SYM = 280,
AUTHORS_SYM = 281,
AUTOEXTEND_SIZE_SYM = 282,
AUTO_INC = 283,
AUTO_SYM = 284,
AVG_ROW_LENGTH = 285,
AVG_SYM = 286,
BACKUP_SYM = 287,
BEFORE_SYM = 288,
BEGIN_SYM = 289,
BETWEEN_SYM = 290,
BIGINT = 291,
BINARY = 292,
BINLOG_SYM = 293,
BIN_NUM = 294,
BIT_AND = 295,
BIT_OR = 296,
BIT_SYM = 297,
BIT_XOR = 298,
BLOB_SYM = 299,
BLOCK_SYM = 300,
BOOLEAN_SYM = 301,
BOOL_SYM = 302,
BOTH = 303,
BTREE_SYM = 304,
BY = 305,
BYTE_SYM = 306,
CACHE_SYM = 307,
CALL_SYM = 308,
CASCADE = 309,
CASCADED = 310,
CASE_SYM = 311,
CAST_SYM = 312,
CATALOG_NAME_SYM = 313,
CHAIN_SYM = 314,
CHANGE = 315,
CHANGED = 316,
CHARSET = 317,
CHAR_SYM = 318,
CHECKPOINT_SYM = 319,
CHECKSUM_SYM = 320,
CHECK_SYM = 321,
CIPHER_SYM = 322,
CLASS_ORIGIN_SYM = 323,
CLIENT_SYM = 324,
CLOSE_SYM = 325,
COALESCE = 326,
CODE_SYM = 327,
COLLATE_SYM = 328,
COLLATION_SYM = 329,
COLUMNS = 330,
COLUMN_ADD_SYM = 331,
COLUMN_CHECK_SYM = 332,
COLUMN_CREATE_SYM = 333,
COLUMN_DELETE_SYM = 334,
COLUMN_GET_SYM = 335,
COLUMN_SYM = 336,
COLUMN_NAME_SYM = 337,
COMMENT_SYM = 338,
COMMITTED_SYM = 339,
COMMIT_SYM = 340,
COMPACT_SYM = 341,
COMPLETION_SYM = 342,
COMPRESSED_SYM = 343,
CONCURRENT = 344,
CONDITION_SYM = 345,
CONNECTION_SYM = 346,
CONSISTENT_SYM = 347,
CONSTRAINT = 348,
CONSTRAINT_CATALOG_SYM = 349,
CONSTRAINT_NAME_SYM = 350,
CONSTRAINT_SCHEMA_SYM = 351,
CONTAINS_SYM = 352,
CONTEXT_SYM = 353,
CONTINUE_SYM = 354,
CONTRIBUTORS_SYM = 355,
CONVERT_SYM = 356,
COUNT_SYM = 357,
CPU_SYM = 358,
CREATE = 359,
CROSS = 360,
CUBE_SYM = 361,
CURDATE = 362,
CURRENT_SYM = 363,
CURRENT_USER = 364,
CURRENT_ROLE = 365,
CURRENT_POS_SYM = 366,
CURSOR_SYM = 367,
CURSOR_NAME_SYM = 368,
CURTIME = 369,
DATABASE = 370,
DATABASES = 371,
DATAFILE_SYM = 372,
DATA_SYM = 373,
DATETIME = 374,
DATE_ADD_INTERVAL = 375,
DATE_SUB_INTERVAL = 376,
DATE_SYM = 377,
DAY_HOUR_SYM = 378,
DAY_MICROSECOND_SYM = 379,
DAY_MINUTE_SYM = 380,
DAY_SECOND_SYM = 381,
DAY_SYM = 382,
DEALLOCATE_SYM = 383,
DECIMAL_NUM = 384,
DECIMAL_SYM = 385,
DECLARE_SYM = 386,
DEFAULT = 387,
DEFINER_SYM = 388,
DELAYED_SYM = 389,
DELAY_KEY_WRITE_SYM = 390,
DELETE_SYM = 391,
DESC = 392,
DESCRIBE = 393,
DES_KEY_FILE = 394,
DETERMINISTIC_SYM = 395,
DIAGNOSTICS_SYM = 396,
DIRECTORY_SYM = 397,
DISABLE_SYM = 398,
DISCARD = 399,
DISK_SYM = 400,
DISTINCT = 401,
DIV_SYM = 402,
DOUBLE_SYM = 403,
DO_DOMAIN_IDS_SYM = 404,
DO_SYM = 405,
DROP = 406,
DUAL_SYM = 407,
DUMPFILE = 408,
DUPLICATE_SYM = 409,
DYNAMIC_SYM = 410,
EACH_SYM = 411,
ELSE = 412,
ELSEIF_SYM = 413,
ENABLE_SYM = 414,
ENCLOSED = 415,
END = 416,
ENDS_SYM = 417,
END_OF_INPUT = 418,
ENGINES_SYM = 419,
ENGINE_SYM = 420,
ENUM = 421,
EQUAL_SYM = 422,
ERROR_SYM = 423,
ERRORS = 424,
ESCAPED = 425,
ESCAPE_SYM = 426,
EVENTS_SYM = 427,
EVENT_SYM = 428,
EVERY_SYM = 429,
EXCHANGE_SYM = 430,
EXAMINED_SYM = 431,
EXECUTE_SYM = 432,
EXISTS = 433,
EXIT_SYM = 434,
EXPANSION_SYM = 435,
EXPORT_SYM = 436,
EXTENDED_SYM = 437,
EXTENT_SIZE_SYM = 438,
EXTRACT_SYM = 439,
FALSE_SYM = 440,
FAST_SYM = 441,
FAULTS_SYM = 442,
FETCH_SYM = 443,
FILE_SYM = 444,
FIRST_SYM = 445,
FIXED_SYM = 446,
FLOAT_NUM = 447,
FLOAT_SYM = 448,
FLUSH_SYM = 449,
FORCE_SYM = 450,
FOREIGN = 451,
FOR_SYM = 452,
FORMAT_SYM = 453,
FOUND_SYM = 454,
FROM = 455,
FULL = 456,
FULLTEXT_SYM = 457,
FUNCTION_SYM = 458,
GE = 459,
GENERAL = 460,
GENERATED_SYM = 461,
GEOMETRYCOLLECTION = 462,
GEOMETRY_SYM = 463,
GET_FORMAT = 464,
GET_SYM = 465,
GLOBAL_SYM = 466,
GRANT = 467,
GRANTS = 468,
GROUP_SYM = 469,
GROUP_CONCAT_SYM = 470,
HANDLER_SYM = 471,
HARD_SYM = 472,
HASH_SYM = 473,
HAVING = 474,
HELP_SYM = 475,
HEX_NUM = 476,
HEX_STRING = 477,
HIGH_PRIORITY = 478,
HOST_SYM = 479,
HOSTS_SYM = 480,
HOUR_MICROSECOND_SYM = 481,
HOUR_MINUTE_SYM = 482,
HOUR_SECOND_SYM = 483,
HOUR_SYM = 484,
ID_SYM = 485,
IDENT = 486,
IDENTIFIED_SYM = 487,
IDENT_QUOTED = 488,
IF_SYM = 489,
IGNORE_DOMAIN_IDS_SYM = 490,
IGNORE_SYM = 491,
IGNORE_SERVER_IDS_SYM = 492,
IMPORT = 493,
INDEXES = 494,
INDEX_SYM = 495,
INFILE = 496,
INITIAL_SIZE_SYM = 497,
INNER_SYM = 498,
INOUT_SYM = 499,
INSENSITIVE_SYM = 500,
INSERT = 501,
INSERT_METHOD = 502,
INSTALL_SYM = 503,
INTERVAL_SYM = 504,
INTO = 505,
INT_SYM = 506,
INVOKER_SYM = 507,
IN_SYM = 508,
IO_SYM = 509,
IPC_SYM = 510,
IS = 511,
ISOLATION = 512,
ISSUER_SYM = 513,
ITERATE_SYM = 514,
JOIN_SYM = 515,
KEYS = 516,
KEY_BLOCK_SIZE = 517,
KEY_SYM = 518,
KILL_SYM = 519,
LANGUAGE_SYM = 520,
LAST_SYM = 521,
LAST_VALUE = 522,
LE = 523,
LEADING = 524,
LEAVES = 525,
LEAVE_SYM = 526,
LEFT = 527,
LESS_SYM = 528,
LEVEL_SYM = 529,
LEX_HOSTNAME = 530,
LIKE = 531,
LIMIT = 532,
LINEAR_SYM = 533,
LINES = 534,
LINESTRING = 535,
LIST_SYM = 536,
LOAD = 537,
LOCAL_SYM = 538,
LOCATOR_SYM = 539,
LOCKS_SYM = 540,
LOCK_SYM = 541,
LOGFILE_SYM = 542,
LOGS_SYM = 543,
LONGBLOB = 544,
LONGTEXT = 545,
LONG_NUM = 546,
LONG_SYM = 547,
LOOP_SYM = 548,
LOW_PRIORITY = 549,
MASTER_CONNECT_RETRY_SYM = 550,
MASTER_GTID_POS_SYM = 551,
MASTER_HOST_SYM = 552,
MASTER_LOG_FILE_SYM = 553,
MASTER_LOG_POS_SYM = 554,
MASTER_PASSWORD_SYM = 555,
MASTER_PORT_SYM = 556,
MASTER_SERVER_ID_SYM = 557,
MASTER_SSL_CAPATH_SYM = 558,
MASTER_SSL_CA_SYM = 559,
MASTER_SSL_CERT_SYM = 560,
MASTER_SSL_CIPHER_SYM = 561,
MASTER_SSL_CRL_SYM = 562,
MASTER_SSL_CRLPATH_SYM = 563,
MASTER_SSL_KEY_SYM = 564,
MASTER_SSL_SYM = 565,
MASTER_SSL_VERIFY_SERVER_CERT_SYM = 566,
MASTER_SYM = 567,
MASTER_USER_SYM = 568,
MASTER_USE_GTID_SYM = 569,
MASTER_HEARTBEAT_PERIOD_SYM = 570,
MATCH = 571,
MAX_CONNECTIONS_PER_HOUR = 572,
MAX_QUERIES_PER_HOUR = 573,
MAX_ROWS = 574,
MAX_SIZE_SYM = 575,
MAX_SYM = 576,
MAX_UPDATES_PER_HOUR = 577,
MAX_STATEMENT_TIME_SYM = 578,
MAX_USER_CONNECTIONS_SYM = 579,
MAX_VALUE_SYM = 580,
MEDIUMBLOB = 581,
MEDIUMINT = 582,
MEDIUMTEXT = 583,
MEDIUM_SYM = 584,
MEMORY_SYM = 585,
MERGE_SYM = 586,
MESSAGE_TEXT_SYM = 587,
MICROSECOND_SYM = 588,
MIGRATE_SYM = 589,
MINUTE_MICROSECOND_SYM = 590,
MINUTE_SECOND_SYM = 591,
MINUTE_SYM = 592,
MIN_ROWS = 593,
MIN_SYM = 594,
MODE_SYM = 595,
MODIFIES_SYM = 596,
MODIFY_SYM = 597,
MOD_SYM = 598,
MONTH_SYM = 599,
MULTILINESTRING = 600,
MULTIPOINT = 601,
MULTIPOLYGON = 602,
MUTEX_SYM = 603,
MYSQL_SYM = 604,
MYSQL_ERRNO_SYM = 605,
NAMES_SYM = 606,
NAME_SYM = 607,
NATIONAL_SYM = 608,
NATURAL = 609,
NCHAR_STRING = 610,
NCHAR_SYM = 611,
NE = 612,
NEG = 613,
NEW_SYM = 614,
NEXT_SYM = 615,
NODEGROUP_SYM = 616,
NONE_SYM = 617,
NOT2_SYM = 618,
NOT_SYM = 619,
NOW_SYM = 620,
NO_SYM = 621,
NO_WAIT_SYM = 622,
NO_WRITE_TO_BINLOG = 623,
NULL_SYM = 624,
NUM = 625,
NUMBER_SYM = 626,
NUMERIC_SYM = 627,
NVARCHAR_SYM = 628,
OFFSET_SYM = 629,
OLD_PASSWORD_SYM = 630,
ON = 631,
ONE_SYM = 632,
ONLY_SYM = 633,
ONLINE_SYM = 634,
OPEN_SYM = 635,
OPTIMIZE = 636,
OPTIONS_SYM = 637,
OPTION = 638,
OPTIONALLY = 639,
OR2_SYM = 640,
ORDER_SYM = 641,
OR_OR_SYM = 642,
OR_SYM = 643,
OUTER = 644,
OUTFILE = 645,
OUT_SYM = 646,
OWNER_SYM = 647,
PACK_KEYS_SYM = 648,
PAGE_SYM = 649,
PAGE_CHECKSUM_SYM = 650,
PARAM_MARKER = 651,
PARSER_SYM = 652,
PARSE_VCOL_EXPR_SYM = 653,
PARTIAL = 654,
PARTITION_SYM = 655,
PARTITIONS_SYM = 656,
PARTITIONING_SYM = 657,
PASSWORD_SYM = 658,
PERSISTENT_SYM = 659,
PHASE_SYM = 660,
PLUGINS_SYM = 661,
PLUGIN_SYM = 662,
POINT_SYM = 663,
POLYGON = 664,
PORT_SYM = 665,
POSITION_SYM = 666,
PRECISION = 667,
PREPARE_SYM = 668,
PRESERVE_SYM = 669,
PREV_SYM = 670,
PRIMARY_SYM = 671,
PRIVILEGES = 672,
PROCEDURE_SYM = 673,
PROCESS = 674,
PROCESSLIST_SYM = 675,
PROFILE_SYM = 676,
PROFILES_SYM = 677,
PROXY_SYM = 678,
PURGE = 679,
QUARTER_SYM = 680,
QUERY_SYM = 681,
QUICK = 682,
RANGE_SYM = 683,
READS_SYM = 684,
READ_ONLY_SYM = 685,
READ_SYM = 686,
READ_WRITE_SYM = 687,
REAL = 688,
REBUILD_SYM = 689,
RECOVER_SYM = 690,
REDOFILE_SYM = 691,
REDO_BUFFER_SIZE_SYM = 692,
REDUNDANT_SYM = 693,
REFERENCES = 694,
REGEXP = 695,
RELAY = 696,
RELAYLOG_SYM = 697,
RELAY_LOG_FILE_SYM = 698,
RELAY_LOG_POS_SYM = 699,
RELAY_THREAD = 700,
RELEASE_SYM = 701,
RELOAD = 702,
REMOVE_SYM = 703,
RENAME = 704,
REORGANIZE_SYM = 705,
REPAIR = 706,
REPEATABLE_SYM = 707,
REPEAT_SYM = 708,
REPLACE = 709,
REPLICATION = 710,
REQUIRE_SYM = 711,
RESET_SYM = 712,
RESIGNAL_SYM = 713,
RESOURCES = 714,
RESTORE_SYM = 715,
RESTRICT = 716,
RESUME_SYM = 717,
RETURNED_SQLSTATE_SYM = 718,
RETURNING_SYM = 719,
RETURNS_SYM = 720,
RETURN_SYM = 721,
REVERSE_SYM = 722,
REVOKE = 723,
RIGHT = 724,
ROLE_SYM = 725,
ROLLBACK_SYM = 726,
ROLLUP_SYM = 727,
ROUTINE_SYM = 728,
ROWS_SYM = 729,
ROW_FORMAT_SYM = 730,
ROW_SYM = 731,
ROW_COUNT_SYM = 732,
RTREE_SYM = 733,
SAVEPOINT_SYM = 734,
SCHEDULE_SYM = 735,
SCHEMA_NAME_SYM = 736,
SECOND_MICROSECOND_SYM = 737,
SECOND_SYM = 738,
SECURITY_SYM = 739,
SELECT_SYM = 740,
SENSITIVE_SYM = 741,
SEPARATOR_SYM = 742,
SERIALIZABLE_SYM = 743,
SERIAL_SYM = 744,
SESSION_SYM = 745,
SERVER_SYM = 746,
SERVER_OPTIONS = 747,
SET = 748,
SET_VAR = 749,
SHARE_SYM = 750,
SHIFT_LEFT = 751,
SHIFT_RIGHT = 752,
SHOW = 753,
SHUTDOWN = 754,
SIGNAL_SYM = 755,
SIGNED_SYM = 756,
SIMPLE_SYM = 757,
SLAVE = 758,
SLAVES = 759,
SLAVE_POS_SYM = 760,
SLOW = 761,
SMALLINT = 762,
SNAPSHOT_SYM = 763,
SOCKET_SYM = 764,
SOFT_SYM = 765,
SONAME_SYM = 766,
SOUNDS_SYM = 767,
SOURCE_SYM = 768,
SPATIAL_SYM = 769,
SPECIFIC_SYM = 770,
SQLEXCEPTION_SYM = 771,
SQLSTATE_SYM = 772,
SQLWARNING_SYM = 773,
SQL_BIG_RESULT = 774,
SQL_BUFFER_RESULT = 775,
SQL_CACHE_SYM = 776,
SQL_CALC_FOUND_ROWS = 777,
SQL_NO_CACHE_SYM = 778,
SQL_SMALL_RESULT = 779,
SQL_SYM = 780,
SQL_THREAD = 781,
REF_SYSTEM_ID_SYM = 782,
SSL_SYM = 783,
STARTING = 784,
STARTS_SYM = 785,
START_SYM = 786,
STATEMENT_SYM = 787,
STATS_AUTO_RECALC_SYM = 788,
STATS_PERSISTENT_SYM = 789,
STATS_SAMPLE_PAGES_SYM = 790,
STATUS_SYM = 791,
STDDEV_SAMP_SYM = 792,
STD_SYM = 793,
STOP_SYM = 794,
STORAGE_SYM = 795,
STRAIGHT_JOIN = 796,
STRING_SYM = 797,
SUBCLASS_ORIGIN_SYM = 798,
SUBDATE_SYM = 799,
SUBJECT_SYM = 800,
SUBPARTITIONS_SYM = 801,
SUBPARTITION_SYM = 802,
SUBSTRING = 803,
SUM_SYM = 804,
SUPER_SYM = 805,
SUSPEND_SYM = 806,
SWAPS_SYM = 807,
SWITCHES_SYM = 808,
SYSDATE = 809,
TABLES = 810,
TABLESPACE = 811,
TABLE_REF_PRIORITY = 812,
TABLE_SYM = 813,
TABLE_CHECKSUM_SYM = 814,
TABLE_NAME_SYM = 815,
TEMPORARY = 816,
TEMPTABLE_SYM = 817,
TERMINATED = 818,
TEXT_STRING = 819,
TEXT_SYM = 820,
THAN_SYM = 821,
THEN_SYM = 822,
TIMESTAMP = 823,
TIMESTAMP_ADD = 824,
TIMESTAMP_DIFF = 825,
TIME_SYM = 826,
TINYBLOB = 827,
TINYINT = 828,
TINYTEXT = 829,
TO_SYM = 830,
TRAILING = 831,
TRANSACTION_SYM = 832,
TRANSACTIONAL_SYM = 833,
TRIGGERS_SYM = 834,
TRIGGER_SYM = 835,
TRIM = 836,
TRUE_SYM = 837,
TRUNCATE_SYM = 838,
TYPES_SYM = 839,
TYPE_SYM = 840,
UDF_RETURNS_SYM = 841,
ULONGLONG_NUM = 842,
UNCOMMITTED_SYM = 843,
UNDEFINED_SYM = 844,
UNDERSCORE_CHARSET = 845,
UNDOFILE_SYM = 846,
UNDO_BUFFER_SIZE_SYM = 847,
UNDO_SYM = 848,
UNICODE_SYM = 849,
UNINSTALL_SYM = 850,
UNION_SYM = 851,
UNIQUE_SYM = 852,
UNKNOWN_SYM = 853,
UNLOCK_SYM = 854,
UNSIGNED = 855,
UNTIL_SYM = 856,
UPDATE_SYM = 857,
UPGRADE_SYM = 858,
USAGE = 859,
USER = 860,
USE_FRM = 861,
USE_SYM = 862,
USING = 863,
UTC_DATE_SYM = 864,
UTC_TIMESTAMP_SYM = 865,
UTC_TIME_SYM = 866,
VALUES = 867,
VALUE_SYM = 868,
VARBINARY = 869,
VARCHAR = 870,
VARIABLES = 871,
VARIANCE_SYM = 872,
VARYING = 873,
VAR_SAMP_SYM = 874,
VIA_SYM = 875,
VIEW_SYM = 876,
VIRTUAL_SYM = 877,
WAIT_SYM = 878,
WARNINGS = 879,
WEEK_SYM = 880,
WEIGHT_STRING_SYM = 881,
WHEN_SYM = 882,
WHERE = 883,
WHILE_SYM = 884,
WITH = 885,
WITH_CUBE_SYM = 886,
WITH_ROLLUP_SYM = 887,
WORK_SYM = 888,
WRAPPER_SYM = 889,
WRITE_SYM = 890,
X509_SYM = 891,
XA_SYM = 892,
XML_SYM = 893,
XOR = 894,
YEAR_MONTH_SYM = 895,
YEAR_SYM = 896,
ZEROFILL = 897,
IMPOSSIBLE_ACTION = 898
};
#endif
/* Tokens. */
#define ABORT_SYM 258
#define ACCESSIBLE_SYM 259
#define ACTION 260
#define ADD 261
#define ADMIN_SYM 262
#define ADDDATE_SYM 263
#define AFTER_SYM 264
#define AGAINST 265
#define AGGREGATE_SYM 266
#define ALGORITHM_SYM 267
#define ALL 268
#define ALTER 269
#define ALWAYS_SYM 270
#define ANALYZE_SYM 271
#define AND_AND_SYM 272
#define AND_SYM 273
#define ANY_SYM 274
#define AS 275
#define ASC 276
#define ASCII_SYM 277
#define ASENSITIVE_SYM 278
#define AT_SYM 279
#define ATOMIC_SYM 280
#define AUTHORS_SYM 281
#define AUTOEXTEND_SIZE_SYM 282
#define AUTO_INC 283
#define AUTO_SYM 284
#define AVG_ROW_LENGTH 285
#define AVG_SYM 286
#define BACKUP_SYM 287
#define BEFORE_SYM 288
#define BEGIN_SYM 289
#define BETWEEN_SYM 290
#define BIGINT 291
#define BINARY 292
#define BINLOG_SYM 293
#define BIN_NUM 294
#define BIT_AND 295
#define BIT_OR 296
#define BIT_SYM 297
#define BIT_XOR 298
#define BLOB_SYM 299
#define BLOCK_SYM 300
#define BOOLEAN_SYM 301
#define BOOL_SYM 302
#define BOTH 303
#define BTREE_SYM 304
#define BY 305
#define BYTE_SYM 306
#define CACHE_SYM 307
#define CALL_SYM 308
#define CASCADE 309
#define CASCADED 310
#define CASE_SYM 311
#define CAST_SYM 312
#define CATALOG_NAME_SYM 313
#define CHAIN_SYM 314
#define CHANGE 315
#define CHANGED 316
#define CHARSET 317
#define CHAR_SYM 318
#define CHECKPOINT_SYM 319
#define CHECKSUM_SYM 320
#define CHECK_SYM 321
#define CIPHER_SYM 322
#define CLASS_ORIGIN_SYM 323
#define CLIENT_SYM 324
#define CLOSE_SYM 325
#define COALESCE 326
#define CODE_SYM 327
#define COLLATE_SYM 328
#define COLLATION_SYM 329
#define COLUMNS 330
#define COLUMN_ADD_SYM 331
#define COLUMN_CHECK_SYM 332
#define COLUMN_CREATE_SYM 333
#define COLUMN_DELETE_SYM 334
#define COLUMN_GET_SYM 335
#define COLUMN_SYM 336
#define COLUMN_NAME_SYM 337
#define COMMENT_SYM 338
#define COMMITTED_SYM 339
#define COMMIT_SYM 340
#define COMPACT_SYM 341
#define COMPLETION_SYM 342
#define COMPRESSED_SYM 343
#define CONCURRENT 344
#define CONDITION_SYM 345
#define CONNECTION_SYM 346
#define CONSISTENT_SYM 347
#define CONSTRAINT 348
#define CONSTRAINT_CATALOG_SYM 349
#define CONSTRAINT_NAME_SYM 350
#define CONSTRAINT_SCHEMA_SYM 351
#define CONTAINS_SYM 352
#define CONTEXT_SYM 353
#define CONTINUE_SYM 354
#define CONTRIBUTORS_SYM 355
#define CONVERT_SYM 356
#define COUNT_SYM 357
#define CPU_SYM 358
#define CREATE 359
#define CROSS 360
#define CUBE_SYM 361
#define CURDATE 362
#define CURRENT_SYM 363
#define CURRENT_USER 364
#define CURRENT_ROLE 365
#define CURRENT_POS_SYM 366
#define CURSOR_SYM 367
#define CURSOR_NAME_SYM 368
#define CURTIME 369
#define DATABASE 370
#define DATABASES 371
#define DATAFILE_SYM 372
#define DATA_SYM 373
#define DATETIME 374
#define DATE_ADD_INTERVAL 375
#define DATE_SUB_INTERVAL 376
#define DATE_SYM 377
#define DAY_HOUR_SYM 378
#define DAY_MICROSECOND_SYM 379
#define DAY_MINUTE_SYM 380
#define DAY_SECOND_SYM 381
#define DAY_SYM 382
#define DEALLOCATE_SYM 383
#define DECIMAL_NUM 384
#define DECIMAL_SYM 385
#define DECLARE_SYM 386
#define DEFAULT 387
#define DEFINER_SYM 388
#define DELAYED_SYM 389
#define DELAY_KEY_WRITE_SYM 390
#define DELETE_SYM 391
#define DESC 392
#define DESCRIBE 393
#define DES_KEY_FILE 394
#define DETERMINISTIC_SYM 395
#define DIAGNOSTICS_SYM 396
#define DIRECTORY_SYM 397
#define DISABLE_SYM 398
#define DISCARD 399
#define DISK_SYM 400
#define DISTINCT 401
#define DIV_SYM 402
#define DOUBLE_SYM 403
#define DO_DOMAIN_IDS_SYM 404
#define DO_SYM 405
#define DROP 406
#define DUAL_SYM 407
#define DUMPFILE 408
#define DUPLICATE_SYM 409
#define DYNAMIC_SYM 410
#define EACH_SYM 411
#define ELSE 412
#define ELSEIF_SYM 413
#define ENABLE_SYM 414
#define ENCLOSED 415
#define END 416
#define ENDS_SYM 417
#define END_OF_INPUT 418
#define ENGINES_SYM 419
#define ENGINE_SYM 420
#define ENUM 421
#define EQUAL_SYM 422
#define ERROR_SYM 423
#define ERRORS 424
#define ESCAPED 425
#define ESCAPE_SYM 426
#define EVENTS_SYM 427
#define EVENT_SYM 428
#define EVERY_SYM 429
#define EXCHANGE_SYM 430
#define EXAMINED_SYM 431
#define EXECUTE_SYM 432
#define EXISTS 433
#define EXIT_SYM 434
#define EXPANSION_SYM 435
#define EXPORT_SYM 436
#define EXTENDED_SYM 437
#define EXTENT_SIZE_SYM 438
#define EXTRACT_SYM 439
#define FALSE_SYM 440
#define FAST_SYM 441
#define FAULTS_SYM 442
#define FETCH_SYM 443
#define FILE_SYM 444
#define FIRST_SYM 445
#define FIXED_SYM 446
#define FLOAT_NUM 447
#define FLOAT_SYM 448
#define FLUSH_SYM 449
#define FORCE_SYM 450
#define FOREIGN 451
#define FOR_SYM 452
#define FORMAT_SYM 453
#define FOUND_SYM 454
#define FROM 455
#define FULL 456
#define FULLTEXT_SYM 457
#define FUNCTION_SYM 458
#define GE 459
#define GENERAL 460
#define GENERATED_SYM 461
#define GEOMETRYCOLLECTION 462
#define GEOMETRY_SYM 463
#define GET_FORMAT 464
#define GET_SYM 465
#define GLOBAL_SYM 466
#define GRANT 467
#define GRANTS 468
#define GROUP_SYM 469
#define GROUP_CONCAT_SYM 470
#define HANDLER_SYM 471
#define HARD_SYM 472
#define HASH_SYM 473
#define HAVING 474
#define HELP_SYM 475
#define HEX_NUM 476
#define HEX_STRING 477
#define HIGH_PRIORITY 478
#define HOST_SYM 479
#define HOSTS_SYM 480
#define HOUR_MICROSECOND_SYM 481
#define HOUR_MINUTE_SYM 482
#define HOUR_SECOND_SYM 483
#define HOUR_SYM 484
#define ID_SYM 485
#define IDENT 486
#define IDENTIFIED_SYM 487
#define IDENT_QUOTED 488
#define IF_SYM 489
#define IGNORE_DOMAIN_IDS_SYM 490
#define IGNORE_SYM 491
#define IGNORE_SERVER_IDS_SYM 492
#define IMPORT 493
#define INDEXES 494
#define INDEX_SYM 495
#define INFILE 496
#define INITIAL_SIZE_SYM 497
#define INNER_SYM 498
#define INOUT_SYM 499
#define INSENSITIVE_SYM 500
#define INSERT 501
#define INSERT_METHOD 502
#define INSTALL_SYM 503
#define INTERVAL_SYM 504
#define INTO 505
#define INT_SYM 506
#define INVOKER_SYM 507
#define IN_SYM 508
#define IO_SYM 509
#define IPC_SYM 510
#define IS 511
#define ISOLATION 512
#define ISSUER_SYM 513
#define ITERATE_SYM 514
#define JOIN_SYM 515
#define KEYS 516
#define KEY_BLOCK_SIZE 517
#define KEY_SYM 518
#define KILL_SYM 519
#define LANGUAGE_SYM 520
#define LAST_SYM 521
#define LAST_VALUE 522
#define LE 523
#define LEADING 524
#define LEAVES 525
#define LEAVE_SYM 526
#define LEFT 527
#define LESS_SYM 528
#define LEVEL_SYM 529
#define LEX_HOSTNAME 530
#define LIKE 531
#define LIMIT 532
#define LINEAR_SYM 533
#define LINES 534
#define LINESTRING 535
#define LIST_SYM 536
#define LOAD 537
#define LOCAL_SYM 538
#define LOCATOR_SYM 539
#define LOCKS_SYM 540
#define LOCK_SYM 541
#define LOGFILE_SYM 542
#define LOGS_SYM 543
#define LONGBLOB 544
#define LONGTEXT 545
#define LONG_NUM 546
#define LONG_SYM 547
#define LOOP_SYM 548
#define LOW_PRIORITY 549
#define MASTER_CONNECT_RETRY_SYM 550
#define MASTER_GTID_POS_SYM 551
#define MASTER_HOST_SYM 552
#define MASTER_LOG_FILE_SYM 553
#define MASTER_LOG_POS_SYM 554
#define MASTER_PASSWORD_SYM 555
#define MASTER_PORT_SYM 556
#define MASTER_SERVER_ID_SYM 557
#define MASTER_SSL_CAPATH_SYM 558
#define MASTER_SSL_CA_SYM 559
#define MASTER_SSL_CERT_SYM 560
#define MASTER_SSL_CIPHER_SYM 561
#define MASTER_SSL_CRL_SYM 562
#define MASTER_SSL_CRLPATH_SYM 563
#define MASTER_SSL_KEY_SYM 564
#define MASTER_SSL_SYM 565
#define MASTER_SSL_VERIFY_SERVER_CERT_SYM 566
#define MASTER_SYM 567
#define MASTER_USER_SYM 568
#define MASTER_USE_GTID_SYM 569
#define MASTER_HEARTBEAT_PERIOD_SYM 570
#define MATCH 571
#define MAX_CONNECTIONS_PER_HOUR 572
#define MAX_QUERIES_PER_HOUR 573
#define MAX_ROWS 574
#define MAX_SIZE_SYM 575
#define MAX_SYM 576
#define MAX_UPDATES_PER_HOUR 577
#define MAX_STATEMENT_TIME_SYM 578
#define MAX_USER_CONNECTIONS_SYM 579
#define MAX_VALUE_SYM 580
#define MEDIUMBLOB 581
#define MEDIUMINT 582
#define MEDIUMTEXT 583
#define MEDIUM_SYM 584
#define MEMORY_SYM 585
#define MERGE_SYM 586
#define MESSAGE_TEXT_SYM 587
#define MICROSECOND_SYM 588
#define MIGRATE_SYM 589
#define MINUTE_MICROSECOND_SYM 590
#define MINUTE_SECOND_SYM 591
#define MINUTE_SYM 592
#define MIN_ROWS 593
#define MIN_SYM 594
#define MODE_SYM 595
#define MODIFIES_SYM 596
#define MODIFY_SYM 597
#define MOD_SYM 598
#define MONTH_SYM 599
#define MULTILINESTRING 600
#define MULTIPOINT 601
#define MULTIPOLYGON 602
#define MUTEX_SYM 603
#define MYSQL_SYM 604
#define MYSQL_ERRNO_SYM 605
#define NAMES_SYM 606
#define NAME_SYM 607
#define NATIONAL_SYM 608
#define NATURAL 609
#define NCHAR_STRING 610
#define NCHAR_SYM 611
#define NE 612
#define NEG 613
#define NEW_SYM 614
#define NEXT_SYM 615
#define NODEGROUP_SYM 616
#define NONE_SYM 617
#define NOT2_SYM 618
#define NOT_SYM 619
#define NOW_SYM 620
#define NO_SYM 621
#define NO_WAIT_SYM 622
#define NO_WRITE_TO_BINLOG 623
#define NULL_SYM 624
#define NUM 625
#define NUMBER_SYM 626
#define NUMERIC_SYM 627
#define NVARCHAR_SYM 628
#define OFFSET_SYM 629
#define OLD_PASSWORD_SYM 630
#define ON 631
#define ONE_SYM 632
#define ONLY_SYM 633
#define ONLINE_SYM 634
#define OPEN_SYM 635
#define OPTIMIZE 636
#define OPTIONS_SYM 637
#define OPTION 638
#define OPTIONALLY 639
#define OR2_SYM 640
#define ORDER_SYM 641
#define OR_OR_SYM 642
#define OR_SYM 643
#define OUTER 644
#define OUTFILE 645
#define OUT_SYM 646
#define OWNER_SYM 647
#define PACK_KEYS_SYM 648
#define PAGE_SYM 649
#define PAGE_CHECKSUM_SYM 650
#define PARAM_MARKER 651
#define PARSER_SYM 652
#define PARSE_VCOL_EXPR_SYM 653
#define PARTIAL 654
#define PARTITION_SYM 655
#define PARTITIONS_SYM 656
#define PARTITIONING_SYM 657
#define PASSWORD_SYM 658
#define PERSISTENT_SYM 659
#define PHASE_SYM 660
#define PLUGINS_SYM 661
#define PLUGIN_SYM 662
#define POINT_SYM 663
#define POLYGON 664
#define PORT_SYM 665
#define POSITION_SYM 666
#define PRECISION 667
#define PREPARE_SYM 668
#define PRESERVE_SYM 669
#define PREV_SYM 670
#define PRIMARY_SYM 671
#define PRIVILEGES 672
#define PROCEDURE_SYM 673
#define PROCESS 674
#define PROCESSLIST_SYM 675
#define PROFILE_SYM 676
#define PROFILES_SYM 677
#define PROXY_SYM 678
#define PURGE 679
#define QUARTER_SYM 680
#define QUERY_SYM 681
#define QUICK 682
#define RANGE_SYM 683
#define READS_SYM 684
#define READ_ONLY_SYM 685
#define READ_SYM 686
#define READ_WRITE_SYM 687
#define REAL 688
#define REBUILD_SYM 689
#define RECOVER_SYM 690
#define REDOFILE_SYM 691
#define REDO_BUFFER_SIZE_SYM 692
#define REDUNDANT_SYM 693
#define REFERENCES 694
#define REGEXP 695
#define RELAY 696
#define RELAYLOG_SYM 697
#define RELAY_LOG_FILE_SYM 698
#define RELAY_LOG_POS_SYM 699
#define RELAY_THREAD 700
#define RELEASE_SYM 701
#define RELOAD 702
#define REMOVE_SYM 703
#define RENAME 704
#define REORGANIZE_SYM 705
#define REPAIR 706
#define REPEATABLE_SYM 707
#define REPEAT_SYM 708
#define REPLACE 709
#define REPLICATION 710
#define REQUIRE_SYM 711
#define RESET_SYM 712
#define RESIGNAL_SYM 713
#define RESOURCES 714
#define RESTORE_SYM 715
#define RESTRICT 716
#define RESUME_SYM 717
#define RETURNED_SQLSTATE_SYM 718
#define RETURNING_SYM 719
#define RETURNS_SYM 720
#define RETURN_SYM 721
#define REVERSE_SYM 722
#define REVOKE 723
#define RIGHT 724
#define ROLE_SYM 725
#define ROLLBACK_SYM 726
#define ROLLUP_SYM 727
#define ROUTINE_SYM 728
#define ROWS_SYM 729
#define ROW_FORMAT_SYM 730
#define ROW_SYM 731
#define ROW_COUNT_SYM 732
#define RTREE_SYM 733
#define SAVEPOINT_SYM 734
#define SCHEDULE_SYM 735
#define SCHEMA_NAME_SYM 736
#define SECOND_MICROSECOND_SYM 737
#define SECOND_SYM 738
#define SECURITY_SYM 739
#define SELECT_SYM 740
#define SENSITIVE_SYM 741
#define SEPARATOR_SYM 742
#define SERIALIZABLE_SYM 743
#define SERIAL_SYM 744
#define SESSION_SYM 745
#define SERVER_SYM 746
#define SERVER_OPTIONS 747
#define SET 748
#define SET_VAR 749
#define SHARE_SYM 750
#define SHIFT_LEFT 751
#define SHIFT_RIGHT 752
#define SHOW 753
#define SHUTDOWN 754
#define SIGNAL_SYM 755
#define SIGNED_SYM 756
#define SIMPLE_SYM 757
#define SLAVE 758
#define SLAVES 759
#define SLAVE_POS_SYM 760
#define SLOW 761
#define SMALLINT 762
#define SNAPSHOT_SYM 763
#define SOCKET_SYM 764
#define SOFT_SYM 765
#define SONAME_SYM 766
#define SOUNDS_SYM 767
#define SOURCE_SYM 768
#define SPATIAL_SYM 769
#define SPECIFIC_SYM 770
#define SQLEXCEPTION_SYM 771
#define SQLSTATE_SYM 772
#define SQLWARNING_SYM 773
#define SQL_BIG_RESULT 774
#define SQL_BUFFER_RESULT 775
#define SQL_CACHE_SYM 776
#define SQL_CALC_FOUND_ROWS 777
#define SQL_NO_CACHE_SYM 778
#define SQL_SMALL_RESULT 779
#define SQL_SYM 780
#define SQL_THREAD 781
#define REF_SYSTEM_ID_SYM 782
#define SSL_SYM 783
#define STARTING 784
#define STARTS_SYM 785
#define START_SYM 786
#define STATEMENT_SYM 787
#define STATS_AUTO_RECALC_SYM 788
#define STATS_PERSISTENT_SYM 789
#define STATS_SAMPLE_PAGES_SYM 790
#define STATUS_SYM 791
#define STDDEV_SAMP_SYM 792
#define STD_SYM 793
#define STOP_SYM 794
#define STORAGE_SYM 795
#define STRAIGHT_JOIN 796
#define STRING_SYM 797
#define SUBCLASS_ORIGIN_SYM 798
#define SUBDATE_SYM 799
#define SUBJECT_SYM 800
#define SUBPARTITIONS_SYM 801
#define SUBPARTITION_SYM 802
#define SUBSTRING 803
#define SUM_SYM 804
#define SUPER_SYM 805
#define SUSPEND_SYM 806
#define SWAPS_SYM 807
#define SWITCHES_SYM 808
#define SYSDATE 809
#define TABLES 810
#define TABLESPACE 811
#define TABLE_REF_PRIORITY 812
#define TABLE_SYM 813
#define TABLE_CHECKSUM_SYM 814
#define TABLE_NAME_SYM 815
#define TEMPORARY 816
#define TEMPTABLE_SYM 817
#define TERMINATED 818
#define TEXT_STRING 819
#define TEXT_SYM 820
#define THAN_SYM 821
#define THEN_SYM 822
#define TIMESTAMP 823
#define TIMESTAMP_ADD 824
#define TIMESTAMP_DIFF 825
#define TIME_SYM 826
#define TINYBLOB 827
#define TINYINT 828
#define TINYTEXT 829
#define TO_SYM 830
#define TRAILING 831
#define TRANSACTION_SYM 832
#define TRANSACTIONAL_SYM 833
#define TRIGGERS_SYM 834
#define TRIGGER_SYM 835
#define TRIM 836
#define TRUE_SYM 837
#define TRUNCATE_SYM 838
#define TYPES_SYM 839
#define TYPE_SYM 840
#define UDF_RETURNS_SYM 841
#define ULONGLONG_NUM 842
#define UNCOMMITTED_SYM 843
#define UNDEFINED_SYM 844
#define UNDERSCORE_CHARSET 845
#define UNDOFILE_SYM 846
#define UNDO_BUFFER_SIZE_SYM 847
#define UNDO_SYM 848
#define UNICODE_SYM 849
#define UNINSTALL_SYM 850
#define UNION_SYM 851
#define UNIQUE_SYM 852
#define UNKNOWN_SYM 853
#define UNLOCK_SYM 854
#define UNSIGNED 855
#define UNTIL_SYM 856
#define UPDATE_SYM 857
#define UPGRADE_SYM 858
#define USAGE 859
#define USER 860
#define USE_FRM 861
#define USE_SYM 862
#define USING 863
#define UTC_DATE_SYM 864
#define UTC_TIMESTAMP_SYM 865
#define UTC_TIME_SYM 866
#define VALUES 867
#define VALUE_SYM 868
#define VARBINARY 869
#define VARCHAR 870
#define VARIABLES 871
#define VARIANCE_SYM 872
#define VARYING 873
#define VAR_SAMP_SYM 874
#define VIA_SYM 875
#define VIEW_SYM 876
#define VIRTUAL_SYM 877
#define WAIT_SYM 878
#define WARNINGS 879
#define WEEK_SYM 880
#define WEIGHT_STRING_SYM 881
#define WHEN_SYM 882
#define WHERE 883
#define WHILE_SYM 884
#define WITH 885
#define WITH_CUBE_SYM 886
#define WITH_ROLLUP_SYM 887
#define WORK_SYM 888
#define WRAPPER_SYM 889
#define WRITE_SYM 890
#define X509_SYM 891
#define XA_SYM 892
#define XML_SYM 893
#define XOR 894
#define YEAR_MONTH_SYM 895
#define YEAR_SYM 896
#define ZEROFILL 897
#define IMPOSSIBLE_ACTION 898
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
/* Line 1676 of yacc.c */
#line 948 "/home/buildbot/git/sql/sql_yacc.yy"
int num;
ulong ulong_num;
ulonglong ulonglong_number;
longlong longlong_number;
/* structs */
LEX_STRING lex_str;
LEX_SYMBOL symbol;
struct sys_var_with_base variable;
struct { int vars, conds, hndlrs, curs; } spblock;
/* pointers */
CHARSET_INFO *charset;
Condition_information_item *cond_info_item;
DYNCALL_CREATE_DEF *dyncol_def;
Diagnostics_information *diag_info;
Item *item;
Item_num *item_num;
Item_param *item_param;
Key_part_spec *key_part;
LEX *lex;
LEX_STRING *lex_str_ptr;
LEX_USER *lex_user;
List<Condition_information_item> *cond_info_list;
List<DYNCALL_CREATE_DEF> *dyncol_def_list;
List<Item> *item_list;
List<Statement_information_item> *stmt_info_list;
List<String> *string_list;
Statement_information_item *stmt_info_item;
String *string;
TABLE_LIST *table_list;
Table_ident *table;
char *simple_string;
chooser_compare_func_creator boolfunc2creator;
class my_var *myvar;
class sp_condition_value *spcondvalue;
class sp_head *sphead;
class sp_label *splabel;
class sp_name *spname;
class sp_variable *spvar;
handlerton *db_type;
st_select_lex *select_lex;
struct p_elem_val *p_elem_value;
udf_func *udf;
/* enums */
enum Cast_target cast_type;
enum Condition_information_item::Name cond_info_item_name;
enum enum_diag_condition_item_name diag_condition_item_name;
enum Diagnostics_information::Which_area diag_area;
enum Field::geometry_type geom_type;
enum Foreign_key::fk_option m_fk_option;
enum Item_udftype udf_type;
enum Key::Keytype key_type;
enum Statement_information_item::Name stmt_info_item_name;
enum enum_field_types field_type;
enum enum_filetype filetype;
enum enum_tx_isolation tx_isolation;
enum enum_var_type var_type;
enum enum_yes_no_unknown m_yes_no_unk;
enum ha_choice choice;
enum ha_key_alg key_alg;
enum ha_rkey_function ha_rkey_mode;
enum index_hint_type index_hint;
enum interval_type interval, interval_time_st;
enum row_type row_type;
enum sp_variable::enum_mode spvar_mode;
enum thr_lock_type lock_type;
enum enum_mysql_timestamp_type date_time_type;
DDL_options_st object_ddl_options;
/* Line 1676 of yacc.c */
#line 1413 "/home/buildbot/git/mkdist/sql/sql_yacc.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
Running tests with dynamic row format
Running tests with static row format
Running tests with block row format
Running tests with block row format and transactions
ma_test2 -s -L -K -R1 -m2000 ; Should give error 135
Error: 135 in write at record: 1099
got error: 135 when using MARIA-database
./maria_chk -sm test2 will warn that 'Datafile is almost full'
maria_chk: MARIA file test2
maria_chk: warning: Datafile is almost full, 65516 of 65534 used
MARIA-table 'test2' is usable but should be fixed
MARIA RECOVERY TESTS
ALL RECOVERY TESTS OK
!!!!!!!! BUT REMEMBER to FIX this BLOB issue !!!!!!!
#!/usr/bin/env perl
#
# Run various unit tests.
#
use Getopt::Long;
use File::Basename;
$|= 1;
$^W = 1; # warnings, because env cannot parse 'perl -w'
$VER= "1.5";
$opt_version= 0;
$opt_help= 0;
$opt_verbose= 0;
$opt_abort_on_error= 0;
$opt_valgrind= "valgrind --alignment=8 --leak-check=yes";
$opt_silent= "-s";
$opt_number_of_tests= 0;
$opt_run_tests= undef();
my $maria_path; # path to "storage/maria"
my $maria_exe_path; # path to executables (ma_test1, aria_chk etc)
my $my_progname= $0;
$my_progname=~ s/.*[\/]//;
my $runtime_error= 0; # Return 1 if error(s) occur during run
my $NEW_TEST= 0; # Test group separator in an array of tests
my $test_begin= 0;
my $test_end= 0;
my $test_counter= 0;
my $using_internal_tmpdir= 0;
my $full_tmpdir;
my $tmpdir="tmp";
my $exec_dir="TMP-ma_test_all"; # Run test in this directory
run_tests();
####
#### Initialise variables, clean temporary files and run the tests
####
sub run_tests
{
my $nr_tests= 0;
my $flag_exit= 0;
if (!GetOptions("help" => \$opt_help,
"version" => \$opt_version,
"verbose" => \$opt_verbose,
"abort-on-error" => \$opt_abort_on_error,
"valgrind=s" => \$opt_valgrind,
"silent=s" => \$opt_silent,
"tmpdir=s" => \$full_tmpdir,
"number-of-tests" => \$opt_number_of_tests,
"run-tests=s" => \$opt_run_tests,
"start-from=s" => \$opt_run_tests))
{
$flag_exit= 1;
}
if ($opt_version)
{
print "$my_progname version $VER\n";
exit(0);
}
if (! -d $exec_dir)
{
die if (!mkdir("$exec_dir"));
}
chdir($exec_dir);
$maria_path= "../" . dirname($0) . "/..";
my $suffix= ( $^O =~ /win/i && $^O !~ /darwin/i ) ? ".exe" : "";
$maria_exe_path= "$maria_path/release";
# we use -f, sometimes -x is unexpectedly false in Cygwin
if ( ! -f "$maria_exe_path/ma_test1$suffix" )
{
$maria_exe_path= "$maria_path/relwithdebinfo";
if ( ! -f "$maria_exe_path/ma_test1$suffix" )
{
$maria_exe_path= "$maria_path/debug";
if ( ! -f "$maria_exe_path/ma_test1$suffix" )
{
$maria_exe_path= $maria_path;
if ( ! -f "$maria_exe_path/ma_test1$suffix" )
{
die("Cannot find ma_test1 executable in $maria_path\n");
}
}
}
}
usage() if ($opt_help || $flag_exit);
if (defined($full_tmpdir))
{
$tmpdir= $full_tmpdir;
}
else
{
$full_tmpdir= $tmpdir;
$using_internal_tmpdir= 1;
if (! -d "$full_tmpdir")
{
die if (!mkdir("$full_tmpdir"));
}
}
#
# IMPORTANT: If you modify this file, please read this:
#
# Count total number of tests. Make sure that the functions return
# number of unit tests correctly, e.g. calls to ok(). The last argument
# for each function is a flag counter and will return the number of
# unit tests in each. Please see comments on function ok() at the end.
#
# If you modify any functions or add any new ones, please make sure the
# unit tests are appropriately detected here. A wrong count will
# make the unit test fail during 'make test'. $nr_tests must be right.
#
$nr_tests+= run_check_tests(0, 0, 0, 0, 1) * 5; #
$nr_tests+= run_repair_tests(0, 0, 0, 0, 1) * 5; # called 4 times
$nr_tests+= run_pack_tests(0, 0, 0, 0, 1) * 5; #
$nr_tests+= run_tests_on_warnings_and_errors(0, 0, 0, 1);
$nr_tests+= run_ma_test_recovery(0, 1);
$nr_tests+= run_tests_on_clrs(0, 0, 1);
if ($opt_number_of_tests)
{
print "Total number of tests is $nr_tests\n";
exit(0);
}
if (defined($opt_run_tests))
{
if ($opt_run_tests =~ m/^(\d+)$/ ||
$opt_run_tests =~ m/^(\d+)\.+$/)
{
$test_begin= $1;
}
elsif ($opt_run_tests =~ m/^(\d+)\.+(\d+)$/)
{
$test_begin= $1;
$test_end= $2;
}
else
{
print "Wrong syntax for option --run-tests=$opt_run_tests\n";
print "Please use --run-tests=<begin>..<end>\nwhere 'begin' is the ";
print "first test to be run and 'end' is the last.\n";
exit(1);
}
if ($test_end > $nr_tests)
{
print "Test range ($test_begin..$test_end) out of range. ";
print "There are only $nr_tests in the test suite.\n";
exit(1);
}
$test_begin++ if (!$test_begin); # Handle zero, if user gave that
if ($test_end && $test_begin > $test_end)
{
print "Bad test range ($test_begin..$test_end)\n";
exit(1);
}
# Now adjust number of tests
$nr_tests= ($test_end ? $test_end : $nr_tests) - $test_begin + 1;
}
#
# clean-up
#
unlink_all_possible_tmp_files();
#
# Run tests
#
if (!$opt_verbose)
{
print "1..$nr_tests\n";
}
else
{
print "Total tests: $nr_tests\n";
}
if ($opt_verbose)
{
print "Running tests with dynamic row format\n"
}
run_check_tests($suffix, $opt_silent, "", $opt_verbose, 0);
run_repair_tests($suffix, $opt_silent, "", $opt_verbose, 0);
run_pack_tests($suffix, $opt_silent, "", $opt_verbose, 0);
if ($opt_verbose)
{
print "\nRunning tests with static row format\n";
}
run_check_tests($suffix, $opt_silent, "-S", $opt_verbose, 0);
run_repair_tests($suffix, $opt_silent, "-S", $opt_verbose, 0);
run_pack_tests($suffix, $opt_silent, "-S", $opt_verbose, 0);
if ($opt_verbose)
{
print "\nRunning tests with block row format\n";
}
run_check_tests($suffix, $opt_silent, "-M", $opt_verbose, 0);
run_repair_tests($suffix, $opt_silent, "-M", $opt_verbose, 0);
run_pack_tests($suffix, $opt_silent, "-M", $opt_verbose, 0);
if ($opt_verbose)
{
print "\nRunning tests with block row format and transactions\n";
}
run_check_tests($suffix, $opt_silent, "-M -T", $opt_verbose, 0);
run_repair_tests($suffix, $opt_silent, "-M -T", $opt_verbose, 0);
run_pack_tests($suffix, $opt_silent, "-M -T", $opt_verbose, 0);
if ($opt_verbose)
{
print "\nRunning tests with block row format, transactions and versioning\n";
}
run_check_tests($suffix, $opt_silent, "-M -T -C", $opt_verbose, 0);
run_repair_tests($suffix, $opt_silent, "-M -T -C", $opt_verbose, 0);
run_pack_tests($suffix, $opt_silent, "-M -T -C", $opt_verbose, 0);
if ($opt_verbose)
{
print "\nRunning tests with warnings and recovery\n";
}
run_tests_on_warnings_and_errors($suffix, $opt_silent, $opt_verbose, 0);
run_ma_test_recovery($opt_verbose, 0);
run_tests_on_clrs($suffix, $opt_verbose, 0);
unlink_all_possible_tmp_files();
if ($using_internal_tmpdir)
{
rmdir($tmpdir);
}
rmdir($exec_dir);
chdir("..");
rmdir($exec_dir);
exit($runtime_error);
}
####
#### regular tests
####
sub run_check_tests
{
my ($suffix, $silent, $row_type, $verbose, $count)= @_;
my ($i, $nr_tests);
my @ma_test1_opt= ( ["","-se"],
["-N","-se"],
["-P --checksum","-se"],
["-P -N","-se"],
["-B -N -R2","-sm"],
["-a -k 480 --unique","-sm"],
["-a -N -R1 ","-sm"],
["-p","-sm"],
["-p -N --unique","-sm"],
["-p -N --key_length=127 --checksum","-sm"],
["-p -N --key_length=128","-sm"],
["-p --key_length=480","-sm"],
["-a -B","-sm"],
["-a -B --key_length=64 --unique","-sm"],
["-a -B -k 480 --checksum","-sm"],
["-a -B -k 480 -N --unique --checksum","-sm"],
["-a -m","-sm"],
["-a -m -P --unique --checksum","-sm"],
["-a -m -P --key_length=480 --key_cache","-sm"],
["-m -p","-sm"],
["-w --unique","-sm"],
["-a -w --key_length=64 --checksum","-sm"],
["-a -w -N --key_length=480","-sm"],
["-a -w --key_length=480 --checksum","-sm"],
["-a -b -N","-sm"],
["-a -b --key_length=480","-sm"],
["-p -B --key_length=480","-sm"],
["--checksum --unique","-se"],
["--unique","-se"],
["--rows-no-data", "-s"],
["--key_multiple -N -S","-sm"],
["--key_multiple -a -p --key_length=480","-sm"],
["--key_multiple -a -B --key_length=480","-sm"],
["--key_multiple -P -S","-sm"] );
my @ma_test2_opt= ( ["-L -K -W -P","-sm"],
["-L -K -W -P -A","-sm"],
["-L -K -W -P -b32768", "-sm"],
["-L -K -W -P -M -T -c -b32768 -t4 -m300", "-sm"],
["-L -K -P -R3 -m50 -b1000000", "-sm"],
["-L -B","-sm"],
["-D -B -c","-sm"],
["-m10000 -e4096 -K","-sm"],
["-m10000 -e8192 -K","-sm"],
["-m10000 -e16384 -E16384 -K -L","-sm"],
["-L -K -W -P -b32768", "-se"],
["-c -b65000","-se"] );
my @ma_rt_test_opt= ( ); # (["--checksum", "-se"] );
if ($count)
{
$nr_tests= 2; # Number of tests outside loops
for ($i= 0; defined($ma_test1_opt[$i]); $i++) { $nr_tests+=2; }
for ($i= 0; defined($ma_test2_opt[$i]); $i++) { $nr_tests+=2; }
for ($i= 0; defined($ma_rt_test_opt[$i]); $i++) { $nr_tests+=2; }
return $nr_tests;
}
for ($i= 0; defined($ma_test1_opt[$i]); $i++)
{
unlink_log_files();
ok("$maria_exe_path/ma_test1$suffix $silent -h$tmpdir $ma_test1_opt[$i][0] $row_type",
$verbose, $i + 1);
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir $ma_test1_opt[$i][1] $tmpdir/test1",
$verbose, $i + 1);
}
#
# These tests are outside the loops. Make sure to include them in
# nr_tests manually
#
ok("$maria_exe_path/aria_pack$suffix --force -s $tmpdir/test1", $verbose, 0);
ok("$maria_exe_path/aria_chk$suffix -ess $tmpdir/test1", $verbose, 0);
for ($i= 0; defined($ma_test2_opt[$i]); $i++)
{
unlink_log_files();
ok("$maria_exe_path/ma_test2$suffix $silent -h$tmpdir $ma_test2_opt[$i][0] $row_type",
$verbose, $i + 1);
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir $ma_test2_opt[$i][1] $tmpdir/test2",
$verbose, $i + 1);
}
for ($i= 0; defined($ma_rt_test_opt[$i]); $i++)
{
unlink_log_files();
ok("$maria_exe_path/ma_rt_test$suffix $silent -h$tmpdir $ma_rt_test_opt[$i][0] $row_type",
$verbose, $i + 1);
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir $ma_rt_test_opt[$i][1] $tmpdir/rt_test",
$verbose, $i + 1);
}
unlink_log_files();
return 0;
}
####
#### repair tests
####
sub run_repair_tests()
{
my ($suffix, $silent, $row_type, $verbose, $count)= @_;
my ($i);
my @t= ($NEW_TEST,
"$maria_exe_path/ma_test1$suffix $silent --checksum $row_type",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix --silent -re --transaction-log test1",
"$maria_exe_path/aria_chk$suffix -rs test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -rqs test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -rs --correct-checksum test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -rqs --correct-checksum test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -ros --correct-checksum test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -rqos --correct-checksum test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -sz test1",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/ma_test2$suffix $silent -c -d1 $row_type",
"$maria_exe_path/aria_chk$suffix -s --parallel-recover test2",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/aria_chk$suffix -s --parallel-recover --quick test2",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/ma_test2$suffix $silent -c $row_type",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/aria_chk$suffix -sr test2",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/ma_test2$suffix $silent -c -t4 -b32768 $row_type",
"$maria_exe_path/aria_chk$suffix -s --zerofill test1",
"$maria_exe_path/aria_chk$suffix -se test1"
);
return &count_tests(\@t) if ($count);
&run_test_bunch(\@t, $verbose, 0);
return 0;
}
####
#### pack tests
####
sub run_pack_tests()
{
my ($suffix, $silent, $row_type, $verbose, $count)= @_;
my ($i);
my @t= ($NEW_TEST,
"$maria_exe_path/ma_test1$suffix $silent --checksum $row_type",
"$maria_exe_path/aria_pack$suffix --force -s test1",
"$maria_exe_path/aria_chk$suffix -ess test1",
"$maria_exe_path/aria_chk$suffix -rqs test1",
"$maria_exe_path/aria_chk$suffix -es test1",
"$maria_exe_path/aria_chk$suffix -rs test1",
"$maria_exe_path/aria_chk$suffix -es test1",
"$maria_exe_path/aria_chk$suffix -rus test1",
"$maria_exe_path/aria_chk$suffix -es test1",
$NEW_TEST,
"$maria_exe_path/ma_test1$suffix $silent --checksum $row_type",
"$maria_exe_path/aria_pack$suffix --force -s test1",
"$maria_exe_path/aria_chk$suffix -rus --safe-recover test1",
"$maria_exe_path/aria_chk$suffix -es test1",
$NEW_TEST,
"$maria_exe_path/ma_test1$suffix $silent --checksum -S $row_type",
"$maria_exe_path/aria_chk$suffix -se test1",
"$maria_exe_path/aria_chk$suffix -ros test1",
"$maria_exe_path/aria_chk$suffix -rqs test1",
"$maria_exe_path/aria_chk$suffix -se test1",
$NEW_TEST,
"$maria_exe_path/aria_pack$suffix --force -s test1",
"$maria_exe_path/aria_chk$suffix -rqs test1",
"$maria_exe_path/aria_chk$suffix -es test1",
"$maria_exe_path/aria_chk$suffix -rus test1",
"$maria_exe_path/aria_chk$suffix -es test1",
$NEW_TEST,
"$maria_exe_path/ma_test2$suffix $silent -c -d1 $row_type",
"$maria_exe_path/aria_chk$suffix -s --parallel-recover test2",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/aria_chk$suffix -s --unpack --parallel-recover test2",
"$maria_exe_path/aria_chk$suffix -se test2",
"$maria_exe_path/aria_pack$suffix --force -s test1",
"$maria_exe_path/aria_chk$suffix -s --unpack --parallel-recover test2",
"$maria_exe_path/aria_chk$suffix -se test2",
$NEW_TEST,
"$maria_exe_path/ma_test1$suffix $silent -c $row_type",
"cp test1.MAD test2.MAD",
"cp test1.MAI test2.MAI",
"$maria_exe_path/aria_pack$suffix --force -s --join=test3 test1 test2",
);
return (&count_tests(\@t) + 3) if ($count);
&run_test_bunch(\@t, $verbose, 0);
ok("$maria_exe_path/aria_chk -s test3", $verbose, 0, 1);
@t= ("$maria_exe_path/aria_chk -s --safe-recover test3",
"$maria_exe_path/aria_chk -s test3");
&run_test_bunch(\@t, $verbose, 0);
return 0;
}
####
#### Tests that gives warnings or errors
####
sub run_tests_on_warnings_and_errors
{
my ($suffix, $silent, $verbose, $count)= @_;
my ($com);
return 9 if ($count); # Number of tests in this function, e.g. calls to ok()
ok("$maria_exe_path/ma_test2$suffix -h$tmpdir $silent -L -K -W -P -S -R1 -m500",
$verbose, 0);
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir -sm $tmpdir/test2", $verbose, 0);
# ma_test2$suffix $silent -L -K -R1 -m2000 ; Should give error 135\n
# In the following a failure is a success and success is a failure
$com= "$maria_exe_path/ma_test2$suffix -h$tmpdir $silent -L -K -R1 -m2000 ";
$com.= ">ma_test2_message.txt 2>&1";
ok($com, $verbose, 0, 1);
ok("cat ma_test2_message.txt", $verbose, 0);
ok("grep \"Error: 135\" ma_test2_message.txt > /dev/null", $verbose, 0);
# maria_exe_path/aria_chk$suffix -h$tmpdir -sm $tmpdir/test2 will warn that
# Datafile is almost full
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir -sm $tmpdir/test2 >ma_test2_message.txt 2>&1",
$verbose, 0, 1);
ok("cat ma_test2_message.txt", $verbose, 0);
ok("grep \"warning: Datafile is almost full\" ma_test2_message.txt>/dev/null",
$verbose, 0);
unlink <ma_test2_message.txt>;
ok("$maria_exe_path/aria_chk$suffix -h$tmpdir -ssm $tmpdir/test2", $verbose, 0);
return 0;
}
####
#### Test that removing tables and applying the log leads to identical tables
####
sub run_ma_test_recovery
{
my ($verbose, $count)= @_;
return 1 if ($count); # Number of tests in this function
ok("$maria_path/unittest/ma_test_recovery.pl", $verbose, 0);
return 0;
}
####
#### Tests on CLR's
####
sub run_tests_on_clrs
{
my ($suffix, $verbose, $count)= @_;
my ($i);
my @t= ($NEW_TEST,
"$maria_exe_path/ma_test2$suffix -h$tmpdir -s -L -K -W -P -M -T -c -b -t2 -A1",
"cp $tmpdir/aria_log_control $tmpdir/aria_log_control.backup",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -s -e $tmpdir/test2",
"mv $tmpdir/aria_log_control.backup $tmpdir/aria_log_control",
"rm $tmpdir/test2.MA?",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -s -e $tmpdir/test2",
"rm $tmpdir/test2.MA?",
$NEW_TEST,
"$maria_exe_path/ma_test2$suffix -h$tmpdir -s -L -K -W -P -M -T -c -b -t2 -A1",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir ",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -s -e $tmpdir/test2",
"rm $tmpdir/test2.MA?",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -e -s $tmpdir/test2",
"rm $tmpdir/test2.MA?",
$NEW_TEST,
"$maria_exe_path/ma_test2$suffix -h$tmpdir -s -L -K -W -P -M -T -c -b32768 -t4 -A1",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -es $tmpdir/test2",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir ",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -es $tmpdir/test2",
"rm $tmpdir/test2.MA?",
"$maria_exe_path/aria_read_log$suffix -a -s -h$tmpdir",
"$maria_exe_path/aria_chk$suffix -h$tmpdir -es $tmpdir/test2",
"rm $tmpdir/test2.MA?"
);
return &count_tests(\@t) if ($count);
&run_test_bunch(\@t, $verbose, 1);
return 0;
}
#
# Print "ok" on success and "not ok" on error
#
# Note: Every time this function is called it will be counted
# as a unit test.
#
# Args: $com: The actual command run. Will be printed on a failure
# $verbose: Be more verbose.
# $iteration: Number of iterations in a loop when the error
# occurred. If not in loop, this should be blank
# (e.g. send zero).
# $expected_error: Optional; put here expected error code. Test
# will pass with this result only.
#
# Return value: Will return 1 on success and 0 on an error
#
sub ok
{
my ($com, $verbose, $iteration, $expected_error)= @_;
my ($msg, $output, $err, $errcode, $len);
$test_counter++;
if ($test_begin > $test_counter)
{
return 0;
}
if ($test_end && $test_end < $test_counter)
{
exit(0);
}
$msg= "";
$expected_error= 0 if (!defined($expected_error));
if ($verbose)
{
# Print command with out the long unittest/../ prefix
my $tmp;
$tmp= $com;
$tmp =~ s|^unittest/../||;
print "$tmp ";
$len= length($tmp);
}
$output= `$com 2>&1`;
if ($verbose)
{
print " " x (62 - $len);
}
$err= $?;
$errcode= ($? >> 8);
if ((!$err && !$expected_error) ||
($errcode == $expected_error && $expected_error))
{
print "[ " if ($verbose);
print "ok";
if ($verbose)
{
print " ]";
print " " x (5 - length("$test_counter"));
print "$test_counter";
}
else
{
print " $test_counter - $com"
}
print "\n";
return 1;
}
print "[ " if ($verbose);
print "not ok";
print " ]" if ($verbose);
print " $test_counter - $com" unless $verbose;
print "\n";
if ($verbose && defined($output) && length($output))
{
print "$output\n";
}
if (!$verbose)
{
$msg= "\n"; # Get a nicer output in perl unit test mode
}
$msg.= "Failed test '$com' ";
if ($iteration)
{
$msg.= "(loop iteration $iteration.) ";
}
$msg.= "at line ";
$msg.= (caller)[2];
$msg.= "\n(errcode: $errcode, test: $test_counter)\n";
if ($expected_error)
{
$msg.= "Was expecting errcode: $expected_error\n";
}
warn $msg;
$runtime_error= 1;
if ($opt_abort_on_error)
{
exit 1;
}
# Unlink all files so that we can continue on error
unlink_all_possible_tmp_files();
return 0;
}
#
# Print "skip" and the reason
#
# Note: Every time this function is called it will be counted
# as a unit test.
#
# Args: $com: The actual command run. Will be printed on a failure
# $reason: The reason to skip a test
# $verbose: Be more verbose.
#
sub skip
{
my ($com, $reason, $verbose)= @_;
$test_counter++;
return 0 if $test_begin > $test_counter;
exit 0 if $test_end && $test_end < $test_counter;
printf '%-64s[ skipped ]%5d', $com, $test_counter if $verbose;
print "ok $test_counter # skip $reason" unless $verbose;
print "\n";
return 1;
}
####
#### Count tests
#### Arguments: $t: an array of the tests
####
sub count_tests
{
my ($t)= @_;
my ($i, $nr_tests);
$nr_tests= 0;
for ($i= 0; defined(@$t[$i]); $i++) { $nr_tests++ if (@$t[$i]); }
return $nr_tests;
}
sub unlink_log_files
{
unlink "$full_tmpdir/aria_log_control", "$full_tmpdir/aria_log.00000001", "$full_tmpdir/aria_log.00000002";
}
sub unlink_all_possible_tmp_files()
{
unlink_log_files();
# Unlink tmp files that may have been created when testing the test programs
unlink <$full_tmpdir/*.TMD $full_tmpdir/aria_read_log_test1.txt $full_tmpdir/test1*.MA? $full_tmpdir/ma_test_recovery.output aria_log_control aria_log.00000001 aria_log.00000002 aria_logtest1.MA? test1.MA? test2.MA? test3.MA? *.TMD>;
}
####
#### Run a bunch of tests
#### Arguments: $t: an array of the tests
#### $verbose: to be passed to ok()
#### $clear: clear log files if set
####
sub run_test_bunch
{
my ($t, $verbose, $clear)= @_;
my ($i);
for ($i= 0; defined(@$t[$i]); $i++)
{
if ($clear && @$t[$i] eq $NEW_TEST)
{
unlink_log_files();
}
if (@$t[$i] ne $NEW_TEST)
{
ok(@$t[$i], $verbose, $i + 1);
}
}
}
####
#### usage
####
sub usage
{
print <<EOF;
$my_progname version $VER
Description:
Run various Aria related tests. Typically used via make test as a unittest.
Options
--help Show this help and exit.
--abort-on-error Abort at once in case of error.
--number-of-tests Print the total number of tests and exit.
--run-tests=... Test number(s) that should be run. You can give just
one number or a range. For example 45..89. To run a specific
test alone, for example test 215, use --run-tests=215..215
Use this option with caution, because some of the tests
might depend on previous ones.
--start-from=... Alias for --run-tests
--silent=... Silent option passed to ma_test* tests ('$opt_silent')
--tmpdir=... Store tests data in this directory (works for most tests)
--valgrind=... Options for valgrind.
('$opt_valgrind')
--verbose Be more verbose. Will print each unittest on a line
and result after. This mode cannot be used with unit.pl
when running in normal unit test mode.
--version Show version number and exit.
EOF
exit(0);
}
SUBDIRS = \
cmake_modules
EXTRA_DIST = \
ReadFileList.cmake
# Copyright(C) 2012 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
macro(read_file_list file_name output_variable)
file(READ ${file_name} ${output_variable})
# Remove variable declaration at the first line:
# "libgroonga_la_SOURCES = \" -> ""
string(REGEX REPLACE "^.*=[ \t]*\\\\" ""
${output_variable} "${${output_variable}}")
# Remove white spaces: " com.c \\\n com.h \\\n" -> "com.c\\com.h"
string(REGEX REPLACE "[ \t\n]" "" ${output_variable} "${${output_variable}}")
# Convert string to list: "com.c\\com.h" -> "com.c;com.h"
# NOTE: List in CMake is ";" separated string.
string(REGEX REPLACE "\\\\" ";" ${output_variable} "${${output_variable}}")
endmacro()
BUILT_SOURCES =
EXTRA_DIST =
SUFFIXES =
include $(top_srcdir)/build/makefiles/gettext.am
include $(top_srcdir)/doc/files.am
include $(top_srcdir)/build/makefiles/sphinx-build.am
CLEANFILES =
EXTRA_DIST += \
$(po_files)
if DOCUMENT_AVAILABLE
EXTRA_DIST += \
$(mo_files)
endif
if DOCUMENT_BUILDABLE
BUILT_SOURCES += \
mo-build-stamp
CLEANFILES += \
pot-build-stamp \
edit-po-build-stamp \
mo-build-stamp
endif
SUFFIXES += .pot .po .mo .edit
.PHONY: gettext update build
.pot.edit:
if test -f $*.po; then \
msgmerge \
--quiet \
--sort-by-file \
--output-file=$@.tmp \
$*.po \
$<; \
else \
msginit \
--input=$< \
--output-file=$@.tmp \
--locale=$(LOCALE) \
--no-translator; \
fi
(echo "# -*- po -*-"; \
GREP_OPTIONS= grep -v '^# -\*- po -\*-' $@.tmp | \
GREP_OPTIONS= grep -v '^"POT-Creation-Date:') > $@
rm $@.tmp
.edit.po:
msgcat --no-location --output $@ $<
.po.mo:
msgfmt -o $@ $<
if DOCUMENT_BUILDABLE
update: edit-po-build-stamp
build: mo-build-stamp
else
update:
build:
endif
html: build
man: build
pdf: build
gettext:
rm *.pot || true
$(SPHINX_BUILD_COMMAND) -d doctrees -b gettext $(ALLSPHINXOPTS) .
xgettext --language Python --output conf.pot \
$(top_srcdir)/doc/source/conf.py
pot-build-stamp: $(absolute_source_files)
$(MAKE) gettext
@touch $@
edit-po-build-stamp: pot-build-stamp
$(MAKE) $(edit_po_files)
@touch $@
mo_build_stamp_dependencies = edit-po-build-stamp
if DOCUMENT_BUILDABLE
mo_build_stamp_dependencies += $(edit_po_files)
endif
mo-build-stamp: $(mo_build_stamp_dependencies)
$(MAKE) $(mo_files)
@touch $@
SUBDIRS = LC_MESSAGES
BUILT_SOURCES =
EXTRA_DIST =
include $(top_srcdir)/build/makefiles/sphinx.am
init:
cd LC_MESSAGES && $(MAKE) $@
update-po:
cd LC_MESSAGES && $(MAKE) update
# You can set these variables from the command line.
DOCTREES_BASE = doctrees
SPHINXOPTS =
PAPER =
# Internal variables.
SOURCE_DIR = $(abs_top_srcdir)/doc/source
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR)
SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
SPHINX_BUILD_COMMAND = \
DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \
DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \
LOCALE="$(LOCALE)" \
PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \
$(SPHINX_BUILD)
include $(top_srcdir)/doc/files.am
include $(top_srcdir)/build/makefiles/sphinx-build.am
$(html_files): html-build-stamp
$(html_files_relative_from_locale_dir): html-build-stamp
$(man_files): man-build-stamp
am__nobase_dist_doc_locale_DATA_DIST =
if DOCUMENT_AVAILABLE
doc_localedir = $(docdir)/$(LOCALE)
nobase_dist_doc_locale_DATA = \
$(html_files_relative_from_locale_dir)
am__nobase_dist_doc_locale_DATA_DIST += \
$(nobase_dist_doc_locale_DATA)
endif
document_source_files = \
$(absolute_source_files) \
$(absolute_theme_files) \
$(po_files_relative_from_locale_dir) \
$(mo_files_relative_from_locale_dir)
required_build_stamps = \
html-build-stamp \
man-build-stamp \
mo-build-stamp
if DOCUMENT_BUILDABLE
EXTRA_DIST += $(required_build_stamps)
endif
man_files = \
man/$(PACKAGE_NAME).1
generated_files = \
$(DOCTREES_BASE) \
man \
man-build-stamp \
html \
html-build-stamp \
pdf \
pdf-build-stamp \
dirhtml \
dirhtml-build-stamp \
pickle \
pikcle-build-stamp \
json \
json-build-stamp \
htmlhelp \
htmlhelp-build-stamp \
qthelp \
qthelp-build-stamp \
latex \
latex-build-stamp \
changes \
changes-build-stamp \
linkcheck \
linkcheck-build-stamp \
doctest
$(mo_files_relative_from_locale_dir): mo-build-stamp
mo-build-stamp: $(po_files_relative_from_locale_dir)
cd LC_MESSAGES && $(MAKE) build
@touch $@
if DOCUMENT_BUILDABLE
clean-local: $(clean_targets) clean-doctrees
clean-doctrees:
rm -rf $(DOCTREES_BASE)
maintainer-clean-local:
rm -rf -- $(generated_files)
endif
.PHONY: help
.PHONY: man clean-man
.PHONY: html clean-html
.PHONY: pdf
.PHONY: dirhtml
.PHONY: pickle
.PHONY: json
.PHONY: htmlhelp
.PHONY: qthelp
.PHONY: latex
.PHONY: changes
.PHONY: linkcheck
.PHONY: doctest
if DOCUMENT_BUILDABLE
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " man to make man files"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " rdoc to make RDoc files"
@echo " textile to make Textile files"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
man: man-build-stamp
html: html-recursive html-build-stamp
dirhtml: dirhtml-build-stamp
pickle: pickle-build-stamp
json: json-build-stamp
htmlhelp: htmlhelp-build-stamp
qthelp: qthelp-build-stamp
latex: latex-build-stamp
rdoc: rdoc-build-stamp
textile: textile-build-stamp
changes: changes-build-stamp
linkcheck: linkcheck-build-stamp
doctest: doctest-build-stamp
clean_targets = \
clean-man \
clean-html \
clean-dirhtml \
clean-pickle \
clean-json \
clean-htmlhelp \
clean-qthelp \
clean-latex \
clean-rdoc \
clean-textile \
clean-changes \
clean-linkcheck \
clean-doctest
$(clean_targets):
target=`echo $@ | sed -e 's/^clean-//'`; \
rm -rf $${target}-build-stamp $${target}
build_stamps = \
man-build-stamp \
html-build-stamp \
dirhtml-build-stamp \
pickle-build-stamp \
json-build-stamp \
htmlhelp-build-stamp \
qthelp-build-stamp \
latex-build-stamp \
rdoc-build-stamp \
textile-build-stamp \
changes-build-stamp \
linkcheck-build-stamp \
doctest-build-stamp
$(build_stamps): $(document_source_files)
target=`echo $@ | sed -e 's/-build-stamp$$//'`; \
$(SPHINX_BUILD_COMMAND) \
-Dlanguage=$(LOCALE) \
-d $(DOCTREES_BASE)/$${target} \
-b $${target} \
$(ALLSPHINXOPTS) \
$${target}
@touch $@
qthelp: qthelp-message
qthelp-message: qthelp-build-stamp
@echo "Build finished; now you can run 'qcollectiongenerator' with the" \
".qhcp project file in qthelp/*, like this:"
@echo "# qcollectiongenerator qthelp/groonga.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile qthelp/groonga.qhc"
latex: latex-message
latex-message: latex-build-stamp
@echo "Build finished; the LaTeX files are in latex/*."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
endif
SUBDIRS = \
apt \
rpm \
source \
ubuntu \
windows \
yum
REPOSITORIES_PATH = repositories
DISTRIBUTIONS = debian
ARCHITECTURES = i386 amd64
CODE_NAMES = wheezy jessie
all:
release: build sign-packages update-repository sign-repository upload
remove-existing-packages:
for distribution in $(DISTRIBUTIONS); do \
find $(REPOSITORIES_PATH)/$${distribution}/pool \
-type f -delete; \
done
download:
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete \
$(RSYNC_PATH)/$${distribution} $(REPOSITORIES_PATH)/; \
done
sign-packages:
./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
update-repository:
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
'$(ARCHITECTURES)' '$(CODE_NAMES)'
sign-repository:
./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
(cd $(REPOSITORIES_PATH)/$${distribution}; \
rsync -avz --progress --delete \
dists pool $(RSYNC_PATH)/$${distribution}; \
); \
done
build: build-package-deb
build-package-deb: prepare-build-package-deb
vagrant destroy --force
for architecture in $(ARCHITECTURES); do \
for code_name in $(CODE_NAMES); do \
id=debian-$$code_name-$$architecture; \
vagrant up $$id || exit 1; \
vagrant destroy --force $$id; \
done; \
done
prepare-build-package-deb: source env.sh
cp env.sh tmp/
rm -rf tmp/debian
cp -rp $(srcdir)/../debian tmp/
source: tmp/$(PACKAGE)-$(VERSION).tar.gz
tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
mkdir -p tmp
cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = [
{
:id => "debian-wheezy-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8-i386_chef-provisionerless.box",
},
{
:id => "debian-wheezy-amd64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8_chef-provisionerless.box",
},
{
:id => "debian-jessie-i386",
:box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0-i386_chef-provisionerless.box",
},
{
:id => "debian-jessie-amd64",
:box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0_chef-provisionerless.box",
},
]
vms.each do |vm|
config.vm.define(vm[:id]) do |node|
node.vm.box = vm[:id]
node.vm.box_url = vm[:box_url]
node.vm.provision(:shell, :path => "build-deb.sh")
node.vm.provider("virtualbox") do |virtual_box|
virtual_box.memory = 768
end
end
end
end
#!/bin/sh
LANG=C
mysql_server_package=mysql-server
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
. /vagrant/tmp/env.sh
grep '^deb ' /etc/apt/sources.list | \
sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list
run apt-get update
run apt-get install -y lsb-release
distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
code_name=$(lsb_release --codename --short)
case "${distribution}" in
debian)
component=main
run cat <<EOF > /etc/apt/sources.list.d/groonga.list
deb http://packages.groonga.org/debian/ ${code_name} main
deb-src http://packages.groonga.org/debian/ ${code_name} main
EOF
if ! grep --quiet security /etc/apt/sources.list; then
run cat <<EOF > /etc/apt/sources.list.d/security.list
deb http://security.debian.org/ ${code_name}/updates main
deb-src http://security.debian.org/ ${code_name}/updates main
EOF
fi
run apt-get update
run apt-get install -y --allow-unauthenticated groonga-keyring
run apt-get update
;;
ubuntu)
component=universe
run cat <<EOF > /etc/apt/sources.list.d/security.list
deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
EOF
run sed -e 's/main/universe/' /etc/apt/sources.list > \
/etc/apt/sources.list.d/universe.list
run apt-get -y install software-properties-common
run add-apt-repository -y universe
run add-apt-repository -y ppa:groonga/ppa
run apt-get update
;;
esac
run apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
run apt-get build-dep -y ${mysql_server_package}
run mkdir -p build
run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
build/${PACKAGE}_${VERSION}.orig.tar.gz
run cd build
run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
run cd ${PACKAGE}-${VERSION}/
run cp -rp /vagrant/tmp/debian debian
# export DEB_BUILD_OPTIONS=noopt
MYSQL_PACKAGE_INFO=$(apt-cache show mysql-server | grep Version | sort | tail -1)
MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_INFO##Version: }
sed -i "s/MYSQL_VERSION/$MYSQL_PACKAGE_VERSION/" debian/control
run debuild -us -uc
run cd -
package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
run mkdir -p "${pool_dir}/"
run cp *.tar.* *.diff.gz *.dsc *.deb "${pool_dir}/"
PACKAGE=@PACKAGE@
VERSION=@VERSION@
DEPENDED_PACKAGES="
debhelper
autotools-dev
libgroonga-dev
pkg-config
libmecab-dev
mecab-utils
libmysqlclient-dev
libmysqld-dev
libssl-dev
groonga-normalizer-mysql
wget
"
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESITINATION CODES"
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
CODES=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
;;
*)
distribution=ubuntu
;;
esac
base_directory=${DESTINATION}${distribution}
debsign -pgpg2 --re-sign -k${GPG_UID} \
$(find ${base_directory} -name '*.dsc' -or -name '*.changes') &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESTINATION CODES"
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
CODES=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
;;
*)
distribution=ubuntu
;;
esac
release=${DESTINATION}${distribution}/dists/${code_name}/Release
rm -f ${release}.gpg
gpg2 --sign --detach-sign --armor \
--local-user ${GPG_UID} \
--output ${release}.gpg \
${release} &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 4 ]; then
echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES"
echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'"
exit 1
fi
PROJECT_NAME=$1
DESTINATION=$2
ARCHITECTURES=$3
CODES=$4
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
update_repository()
{
distribution=$1
code_name=$2
component=$3
rm -rf dists/${code_name}
mkdir -p dists/${code_name}/${component}/binary-i386/
mkdir -p dists/${code_name}/${component}/binary-amd64/
mkdir -p dists/${code_name}/${component}/source/
cat <<EOF > dists/.htaccess
Options +Indexes
EOF
cat <<EOF > dists/${code_name}/${component}/binary-i386/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: i386
EOF
cat <<EOF > dists/${code_name}/${component}/binary-amd64/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: amd64
EOF
cat <<EOF > dists/${code_name}/${component}/source/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: source
EOF
cat <<EOF > generate-${code_name}.conf
Dir::ArchiveDir ".";
Dir::CacheDir ".";
TreeDefault::Directory "pool/${code_name}/${component}";
TreeDefault::SrcDirectory "pool/${code_name}/${component}";
Default::Packages::Extensions ".deb";
Default::Packages::Compress ". gzip bzip2";
Default::Sources::Compress ". gzip bzip2";
Default::Contents::Compress "gzip bzip2";
BinDirectory "dists/${code_name}/${component}/binary-i386" {
Packages "dists/${code_name}/${component}/binary-i386/Packages";
Contents "dists/${code_name}/Contents-i386";
SrcPackages "dists/${code_name}/${component}/source/Sources";
};
BinDirectory "dists/${code_name}/${component}/binary-amd64" {
Packages "dists/${code_name}/${component}/binary-amd64/Packages";
Contents "dists/${code_name}/Contents-amd64";
SrcPackages "dists/${code_name}/${component}/source/Sources";
};
Tree "dists/${code_name}" {
Sections "${component}";
Architectures "i386 amd64 source";
};
EOF
apt-ftparchive generate generate-${code_name}.conf
chmod 644 dists/${code_name}/Contents-*
rm -f dists/${code_name}/Release*
rm -f *.db
cat <<EOF > release-${code_name}.conf
APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project";
APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project";
APT::FTPArchive::Release::Architectures "i386 amd64";
APT::FTPArchive::Release::Codename "${code_name}";
APT::FTPArchive::Release::Suite "${code_name}";
APT::FTPArchive::Release::Components "${component}";
APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages";
EOF
apt-ftparchive -c release-${code_name}.conf \
release dists/${code_name} > /tmp/Release
mv /tmp/Release dists/${code_name}
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
component=main
;;
*)
distribution=ubuntu
component=universe
;;
esac
mkdir -p ${DESTINATION}${distribution}
(cd ${DESTINATION}${distribution}
update_repository $distribution $code_name $component) &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
#!/bin/sh
# Usage: check-utility.sh [--install-groonga]
# [--check-install]
# [--check-address]
# [--enable-repository]
#
# CODES="squeeze wheezy unstable lucid natty oneiric precise"
# DISTRIBUTIONS="centos fedora"
CHROOT_ROOT=/var/lib/chroot
CHECK_ADDRESS=0
CHECK_INSTALL=0
CHECK_INSTALL_PACKAGE=mysql-server-mroonga
CHECK_BUILD=0
CHECK_DEPENDS=0
CHECK_PROVIDES=0
ENABLE_REPOSITORY=0
DISABLE_REPOSITORY=0
INSTALL_SCRIPT=0
INSTALL_MROONGA=0
UNINSTALL_MROONGA=0
common_deb_procedure ()
{
for code in $CODES; do
for arch in $DEB_ARCHITECTURES; do
root_dir=$CHROOT_ROOT/$code-$arch
eval $1 $code $arch $root_dir
done
done
}
common_rpm_procedure ()
{
for dist in $DISTRIBUTIONS; do
case $dist in
"fedora")
DISTRIBUTIONS_VERSION="19"
;;
"centos")
DISTRIBUTIONS_VERSION="5 6"
;;
esac
for ver in $DISTRIBUTIONS_VERSION; do
for arch in $RPM_ARCHITECTURES; do
root_dir=$CHROOT_ROOT/$dist-$ver-$arch
eval $1 $dist $arch $ver $root_dir
done
done
done
}
echo_packages_repository_address ()
{
root_dir=$1
code=$2
arch=$3
address=`grep "packages.groonga.org" $root_dir/etc/hosts | grep -v "#"`
if [ -z "$address" ]; then
echo "$code-$arch: default"
else
echo "$code-$arch: $address"
fi
}
setup_distributions ()
{
if [ -z "$DISTRIBUTIONS" ]; then
DISTRIBUTIONS="centos fedora"
fi
}
setup_rpm_architectures ()
{
if [ -z "$RPM_ARCHITECTURES" ]; then
RPM_ARCHITECTURES="i386 x86_64"
fi
}
setup_codes ()
{
if [ -z "$CODES" ]; then
CODES="squeeze wheezy jessie unstable lucid precise quantal raring"
fi
}
setup_deb_architectures ()
{
if [ -z "$DEB_ARCHITECTURES" ]; then
DEB_ARCHITECTURES="i386 amd64"
fi
}
check_packages_repository_address ()
{
common_deb_procedure "check_packages_deb_repository_address"
common_rpm_procedure "check_packages_rpm_repository_address"
}
check_packages_deb_repository_address ()
{
code=$1
arch=$2
root_dir=$4
echo_packages_repository_address "$root_dir" "$code" "$arch"
}
check_packages_rpm_repository_address ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
echo_packages_repository_address "$root_dir" "$dist-$ver" "$arch"
}
host_address ()
{
ifconfig_result=`LANG=C /sbin/ifconfig wlan0`
inet_addr=`echo "$ifconfig_result" | grep "inet addr:192"`
address=`echo $inet_addr | ruby -ne '/inet addr:(.+?)\s/ =~ $_ && puts($1)'`
HOST_ADDRESS=$address
}
check_build_packages ()
{
common_deb_procedure "check_build_deb_packages"
common_rpm_procedure "check_build_rpm_packages"
}
check_build_deb_packages ()
{
code=$1
arch=$2
BASE_VERSION=`cat ../version`
RESULT_SET=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch`
if [ -z "$RESULT_SET" ]; then
printf "%8s %5s %s => 0 deb\n" $code $arch $BASE_VERSION
else
PACKAGE_COUNT=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch | wc | awk '{print \$1}'`
printf "%8s %5s %s => %2d debs\n" $code $arch $BASE_VERSION $PACKAGE_COUNT
fi
}
check_build_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
BASE_VERSION=`cat ../version`
FIND_PATH=yum/repositories/$dist/$ver/$arch
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"`
if [ -z "$RESULT_SET" ]; then
printf "%8s %6s %s => 0 rpm\n" $dist$ver $arch $BASE_VERSION
else
PACKAGE_COUNT=`find $FIND_PATH -name "*$BASE_VERSION*" | wc -l`
printf "%8s %6s %s => %2d rpms\n" $dist$ver $arch $BASE_VERSION $PACKAGE_COUNT
fi
}
check_depends_packages ()
{
common_deb_procedure "check_depends_deb_packages"
common_rpm_procedure "check_depends_rpm_packages"
}
check_depends_deb_packages ()
{
code=$1
arch=$2
BASE_VERSION=`cat ../version`
FIND_PATH=apt/repositories/*/pool/$code
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*.deb"`
if [ -z "$RESULT_SET" ]; then
printf "%8s %5s %s => 404 deb\n" $code $arch $BASE_VERSION
else
for pkg in $RESULT_SET; do
DEB_NAME=`basename $pkg`
DEPENDS=`dpkg -I $pkg | grep "Depends"`
printf "%8s %5s %s => %s\n" $code $arch $DEB_NAME "$DEPENDS"
done
fi
}
check_depends_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
BASE_VERSION=`cat ../version`
FIND_PATH=yum/repositories/$dist/$ver/$arch
RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"`
if [ -z "$RESULT_SET" ]; then
printf "%8s %6s %s => 404 rpm\n" $dist$ver $arch $BASE_VERSION
else
for pkg in $RESULT_SET; do
RPM_NAME=`basename $pkg`
DEPENDS=`rpm -qp --requires $pkg | grep -i "mysql" | tr -t '\n' ' '`
printf "%9s %6s %s => %s\n" $dist$ver $arch $RPM_NAME "$DEPENDS"
done
fi
}
check_provided_mysql_packages ()
{
common_deb_procedure "check_provided_mysql_deb_packages"
common_rpm_procedure "check_provided_mysql_rpm_packages"
for code in $CODES; do
echo $code
cat tmp/$code-amd64-mysql-server.txt
done
for dist in $DISTRIBUTIONS; do
echo $dist
cat tmp/$dist-x86_64-mysql-server.txt
done
}
check_provided_mysql_deb_packages ()
{
code=$1
arch=$2
root_dir=$3
cat > tmp/check-provided-mysql.sh <<EOF
#!/bin/sh
apt-get update > /dev/null
apt-cache show mysql-server | grep "Version" | head -1 > /tmp/$code-$arch-mysql-server.txt
EOF
if [ -d $root_dir ]; then
CHECK_SCRIPT=check-provided-mysql.sh
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
cp tmp/$CHECK_SCRIPT $root_dir/tmp
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
cp $root_dir/tmp/$code-$arch-mysql-server.txt tmp
fi
}
check_provided_mysql_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
cat > tmp/check-provided-mysql.sh <<EOF
#!/bin/sh
yum update > /dev/null
yum info mysql-server | grep "Version" > /tmp/$code-$arch-mysql-server.txt
EOF
if [ -d $root_dir ]; then
CHECK_SCRIPT=check-provided-mysql.sh
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
cp tmp/$CHECK_SCRIPT $root_dir/tmp
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
cp $root_dir/tmp/$code-$arch-mysql-server.txt tmp
fi
}
check_installed_mroonga_packages ()
{
common_deb_procedure "check_installed_mroonga_deb_packages"
common_rpm_procedure "check_installed_mroonga_rpm_packages"
}
check_installed_mroonga_deb_packages ()
{
code=$1
arch=$2
root_dir=$3
cat > tmp/check-deb-mroonga.sh <<EOF
#!/bin/sh
dpkg -l | grep $CHECK_INSTALL_PACKAGE
EOF
if [ -d $root_dir ]; then
CHECK_SCRIPT=check-deb-mroonga.sh
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
cp tmp/$CHECK_SCRIPT $root_dir/tmp
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
fi
}
check_installed_mroonga_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
cat > tmp/check-rpm-mroonga.sh <<EOF
#!/bin/sh
rpm -qa | grep $CHECK_INSTALL_PACKAGE
EOF
CHECK_SCRIPT=check-rpm-mroonga.sh
if [ -d $root_dir ]; then
echo "copy check script $CHECK_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$CHECK_SCRIPT
cp tmp/$CHECK_SCRIPT $root_dir/tmp
sudo chmod 755 $root_dir/tmp/$CHECK_SCRIPT
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$CHECK_SCRIPT
fi
}
install_mroonga_packages ()
{
common_deb_procedure "install_mroonga_deb_packages"
common_rpm_procedure "install_mroonga_rpm_packages"
}
install_mroonga_deb_packages ()
{
code=$1
arch=$2
root_dir=$4
cat > tmp/install-aptitude-mroonga.sh <<EOF
#!/bin/sh
sudo aptitude clean
rm -f /var/lib/apt/lists/packages.groonga.org_*
rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
sudo aptitude update
sudo aptitude -V -D -y --allow-untrusted install groonga-keyring
sudo aptitude update
sudo aptitude -V -D install mysql-server-mroonga
sudo aptitude -V -D install groonga-tokenizer-mecab
EOF
cat > tmp/install-aptget-mroonga.sh <<EOF
#!/bin/sh
sudo apt-get clean
rm -f /var/lib/apt/lists/packages.groonga.org_*
rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
sudo apt-get update
sudo apt-get -y --allow-unauthenticated install groonga-keyring
sudo apt-get update
sudo apt-get -V -y install mysql-server-mroonga
sudo apt-get -V -y install groonga-tokenizer-mecab
EOF
root_dir=$CHROOT_ROOT/$code-$arch
INSTALL_SCRIPT=""
case $code in
squeeze|unstable)
INSTALL_SCRIPT=install-aptitude-mroonga.sh
;;
*)
INSTALL_SCRIPT=install-aptget-mroonga.sh
;;
esac
if [ -d $root_dir ]; then
echo "copy install script $INSTALL_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$INSTALL_SCRIPT
cp tmp/$INSTALL_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$INSTALL_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$INSTALL_SCRIPT
fi
}
install_mroonga_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
cat > tmp/install-centos5-mroonga.sh <<EOF
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm
sudo yum makecache
sudo yum install -y MySQL-server
sudo service mysql start
sudo yum install -y mysql-mroonga
sudo yum install -y groonga-tokenizer-mecab
EOF
cat > tmp/install-centos6-mroonga.sh <<EOF
sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-0.noarch.rpm
sudo yum makecache
sudo yum install -y mysql-server
sudo service mysql start
sudo yum install -y mysql-mroonga
sudo yum install -y groonga-tokenizer-mecab
EOF
cat > tmp/install-fedora-mroonga.sh <<EOF
sudo rpm -ivh http://packages.groonga.org/fedora/groonga-release-1.1.0-0.noarch.rpm
sudo yum makecache
sudo yum install -y mysql-mroonga
sudo yum install -y groonga-tokenizer-mecab
EOF
INSTALL_SCRIPT=""
case "$dist-$ver" in
centos-5)
INSTALL_SCRIPT=install-centos5-mroonga.sh
;;
centos-6)
INSTALL_SCRIPT=install-centos6-mroonga.sh
;;
fedora-18)
INSTALL_SCRIPT=install-fedora-mroonga.sh
;;
*)
;;
esac
if [ -d $root_dir ]; then
echo "copy install script $INSTALL_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$INSTALL_SCRIPT
cp tmp/$INSTALL_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$INSTALL_SCRIPT
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$INSTALL_SCRIPT
fi
}
uninstall_mroonga_packages ()
{
common_deb_procedure "uninstall_mroonga_deb_packages"
common_rpm_procedure "uninstall_mroonga_rpm_packages"
}
uninstall_mroonga_deb_packages ()
{
code=$1
arch=$2
root_dir=$4
UNINSTALL_SCRIPT=uninstall-deb-mroonga.sh
cat > $UNINSTALL_SCRIPT <<EOF
#!/bin/sh
sudo apt-get purge mroonga-* mysql-*
EOF
if [ -d $root_dir ]; then
echo "copy uninstall script $UNINSTALL_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
cp $UNINSTALL_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
fi
}
uninstall_mroonga_rpm_packages ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
UNINSTALL_SCRIPT=uninstall-rpm-mroonga.sh
cat > tmp/$UNINSTALL_SCRIPT <<EOF
#!/bin/sh
sudo yum remove mroonga-* mysql-*
EOF
if [ -d $root_dir ]; then
echo "copy install script $UNINSTALL_SCRIPT to $root_dir/tmp"
sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
cp tmp/$UNINSTALL_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
sudo chname $code-$ver-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
fi
}
enable_temporaly_mroonga_repository ()
{
cat > tmp/enable-repository.sh <<EOF
#!/bin/sh
grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
echo "$HOST_ADDRESS packages.groonga.org" >> /tmp/hosts
cp -f /tmp/hosts /etc/hosts
EOF
common_deb_procedure "enable_temporaly_mroonga_deb_repository"
common_rpm_procedure "enable_temporaly_mroonga_rpm_repository"
check_packages_repository_address
}
enable_temporaly_mroonga_deb_repository ()
{
code=$1
arch=$2
root_dir=$4
today=`date '+%Y%m%d.%s'`
if [ -d $root_dir ]; then
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
sudo cp tmp/enable-repository.sh $root_dir/tmp
sudo chname $code-$arch chroot $root_dir /tmp/enable-repository.sh
fi
}
enable_temporaly_mroonga_rpm_repository ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
today=`date '+%Y%m%d.%s'`
if [ -d $root_dir ]; then
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
sudo cp tmp/enable-repository.sh $root_dir/tmp
sudo chname $code-$arch chroot $root_dir /tmp/enable-repository.sh
fi
}
disable_temporaly_mroonga_repository ()
{
cat > tmp/disable-repository.sh <<EOF
#!/bin/sh
grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
cp -f /tmp/hosts /etc/hosts
EOF
common_deb_procedure "disable_temporaly_mroonga_deb_repository"
common_rpm_procedure "disable_temporaly_mroonga_rpm_repository"
check_packages_repository_address
}
disable_temporaly_mroonga_deb_repository ()
{
code=$1
arch=$2
root_dir=$4
DISABLE_SCRIPT=disable-repository.sh
today=`date '+%Y%m%d.%s'`
if [ -d $root_dir ]; then
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
cp tmp/$DISABLE_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$DISABLE_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$DISABLE_SCRIPT
fi
}
disable_temporaly_mroonga_rpm_repository ()
{
dist=$1
arch=$2
ver=$3
root_dir=$4
DISABLE_SCRIPT=disable-repository.sh
today=`date '+%Y%m%d.%s'`
if [ -d $root_dir ]; then
sudo cp $root_dir/etc/hosts $root_dir/etc/hosts.$today
cp tmp/$DISABLE_SCRIPT $root_dir/tmp
chmod 755 $root_dir/tmp/$DISABLE_SCRIPT
sudo chname $code-$arch chroot $root_dir /tmp/$DISABLE_SCRIPT
fi
}
host_address
echo $HOST_ADDRESS
while [ $# -ne 0 ]; do
case $1 in
--check-install)
CHECK_INSTALL=1
shift
if [ ! -z "$1" ]; then
case $1 in
groonga|mroonga|roonga|mecab|mysql)
CHECK_INSTALL_PACKAGE=$1
;;
*)
;;
esac
fi
;;
--check-address)
CHECK_ADDRESS=1
shift
;;
--check-depends)
CHECK_DEPENDS=1
shift
;;
--check-provides)
CHECK_PROVIDES=1
shift
;;
--check-build)
CHECK_BUILD=1
shift
;;
--enable-repository)
ENABLE_REPOSITORY=1
shift
;;
--disable-repository)
DISABLE_REPOSITORY=1
shift
;;
--install-mroonga)
INSTALL_MROONGA=1
shift
;;
--uninstall-mroonga)
UNINSTALL_MROONGA=1
shift
;;
--code)
shift
if [ "$1" = "all" ]; then
setup_codes
else
CODES=$1
fi
shift
;;
--code-arch)
shift
if [ "$1" = "all" ]; then
setup_deb_architectures
else
DEB_ARCHITECTURES=$1
fi
shift
;;
--dist)
shift
if [ "$1" = "all" ]; then
setup_distributions
else
DISTRIBUTIONS=$1
fi
shift
;;
--dist-arch)
shift
if [ "$1" = "all" ]; then
setup_rpm_architectures
else
RPM_ARCHITECTURES=$1
fi
shift
;;
*)
shift
;;
esac
done
mkdir -p tmp
setup_deb_architectures
setup_rpm_architectures
if [ $CHECK_INSTALL -ne 0 ]; then
check_installed_mroonga_packages
fi
if [ $CHECK_ADDRESS -ne 0 ]; then
check_packages_repository_address
fi
if [ $CHECK_BUILD -ne 0 ]; then
check_build_packages
fi
if [ $CHECK_DEPENDS -ne 0 ]; then
check_depends_packages
fi
if [ $CHECK_PROVIDES -ne 0 ]; then
check_provided_mysql_packages
fi
if [ $ENABLE_REPOSITORY -ne 0 ]; then
enable_temporaly_mroonga_repository
fi
if [ $DISABLE_REPOSITORY -ne 0 ]; then
disable_temporaly_mroonga_repository
fi
if [ $INSTALL_MROONGA -ne 0 ]; then
install_mroonga_packages
fi
if [ $UNINSTALL_MROONGA -ne 0 ]; then
uninstall_mroonga_packages
fi
/usr/lib/groonga/plugins/ r,
/usr/lib/groonga/plugins/** rm,
/etc/mecabrc r,
/var/lib/mecab/dic/** r,
#include <local/mysql-server-mroonga>
mroonga (5.04-1) unstable; urgency=low
* New upstream release.
-- Masafumi Yokoyama <myokoym@gmail.com> Mon, 29 Jun 2015 00:00:00 +0900
mroonga (5.03-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 May 2015 00:00:00 +0900
mroonga (5.02-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Apr 2015 00:00:00 +0900
mroonga (5.01-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Mar 2015 00:00:00 +0900
mroonga (5.00-1) unstable; urgency=low
* New upstream release.
-- <hayashi@clear-code.com> Mon, 09 Feb 2015 00:00:00 +0900
mroonga (4.10-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Jan 2015 00:00:00 +0900
mroonga (4.09-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@cozmixng.org> Mon, 29 Dec 2014 00:00:00 +0900
mroonga (4.08-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Nov 2014 00:00:00 +0900
mroonga (4.07-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Oct 2014 00:00:00 +0900
mroonga (4.06-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Sep 2014 00:00:00 +0900
mroonga (4.05-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Aug 2014 00:00:00 +0900
mroonga (4.04-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jul 2014 00:00:00 +0900
mroonga (4.03-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
mroonga (4.02-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 Apr 2014 00:00:00 +0900
mroonga (4.01-2) unstable; urgency=low
* Built for mysql-server 5.5.37
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 28 Apr 2014 00:00:00 +0900
mroonga (4.01-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Mar 2014 00:00:00 +0900
mroonga (4.00-2) unstable; urgency=low
* Built for mysql-server 5.5.35+dfsg-2 on Debian jessie
* Built for mysql-server 5.5.35+dfsg-2 on Debian sid
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 06 Mar 2014 00:00:00 +0900
mroonga (4.00-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 09 Feb 2014 00:00:00 +0900
mroonga (3.12-2) unstable; urgency=low
* Built for mysql-server updates on Ubuntu 12.04,12.10, and 13.10.
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 13:12:56 +0900
mroonga (3.12-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 00:00:00 +0900
mroonga (3.11-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Dec 2013 00:00:00 +0900
mroonga (3.10-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Nov 2013 00:00:00 +0900
mroonga (3.09-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Oct 2013 00:00:00 +0900
mroonga (3.08-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Sep 2013 00:00:00 +0900
mroonga (3.07-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Aug 2013 00:00:00 +0900
mroonga (3.06-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Jul 2013 00:00:00 +0900
mroonga (3.05-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Jun 2013 00:00:00 +0900
mroonga (3.04-2) unstable; urgency=low
* Built for mysql-server 5.5.31-0ubuntu0.12.04.2 on Ubuntu 12.04 (precise)
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 13 Jun 2013 00:00:00 +0900
mroonga (3.04-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 May 2013 00:00:00 +0900
mroonga (3.03-2) unstable; urgency=low
* Built for mysql-server 5.5.31+dfsg-0+wheezy1 on Debian wheezy
* Built for mysql-server 5.5.31+dfsg-1 on Debian unstable
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 16 May 2013 00:00:00 +0900
mroonga (3.03-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Apr 2013 00:00:00 +0900
mroonga (3.02-2) unstable; urgency=low
* Built for mysql-server 5.5.29-0ubuntu0.12.04.2 on Ubuntu 12.04 (precise)
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 22:15:39 +0900
mroonga (3.02-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 00:00:00 +0900
mroonga (3.01-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 28 Feb 2013 00:00:00 +0900
mroonga (3.00-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 09 Feb 2013 00:00:00 +0900
mroonga (2.10-2) unstable; urgency=low
* Built for mysql-server 5.5.29+dfsg-1 on Debian/unstable.
* Built for mysql-server 5.1.67-0ubuntu0.10.04.1 on Ubuntu 10.04(lucid).
* Built for mysql-server 5.1.67-0ubuntu0.11.10.1 on Ubuntu 11.10(oneiric).
* Built for mysql-server 5.5.29-0ubuntu0.12.04.1 on Ubuntu 12.04(precise).
* Built for mysql-server 5.5.29-0ubuntu0.12.10.1 on Ubuntu 12.10(quantal).
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 24 Jan 2013 10:28:16 +0900
mroonga (2.10-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Dec 2012 00:00:00 +0900
mroonga (2.09-2) unstable; urgency=low
* Built for mysql-server 5.5.28-0ubuntu0.12.10.2 on Ubuntu 12.10.
Reported by @watanabekiyokaz
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 12 Dec 2012 13:28:00 +0900
mroonga (2.09-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Nov 2012 00:00:00 +0900
mroonga (2.08-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Oct 2012 00:00:00 +0900
mroonga (2.07-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Sep 2012 00:00:00 +0900
mroonga (2.06-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Aug 2012 00:00:00 +0900
mroonga (2.05-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Jul 2012 00:00:00 +0900
mroonga (2.04-1) unstable; urgency=low
* New upstream release.
* Ensure deleting mroonga plugin before install.
Suggested by Kazuhiro Isobe. Thanks!!!
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jun 2012 00:00:00 +0900
mroonga (2.03-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 May 2012 00:00:00 +0900
mroonga (2.02-1) unstable; urgency=low
* New upstream release.
* Require groonga >= 2.0.2.
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 Apr 2012 00:00:00 +0900
mroonga (2.01-1) unstable; urgency=low
* New upstream release.
* Ensure plugin is uninstalled by closing all tables use mroonga.
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Mar 2012 00:00:00 +0900
mroonga (2.00-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Feb 2012 00:00:00 +0900
mroonga (1.20-1) unstable; urgency=low
* New upstream release.
* Add mysql-server-mroonga-compatible package for "groonga" storage engine.
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jan 2012 00:00:00 +0900
mroonga (1.11-1) unstable; urgency=low
* New upstream release.
* Change apparmor configuration file name:
mysql-server-groonga -> mysql-server-mroonga
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Dec 2011 00:00:00 +0900
mroonga (1.10-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Sat, 29 Oct 2011 00:00:00 +0900
groonga-storage-engine (1.0.0-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Thu, 29 Sep 2011 00:00:00 +0900
groonga-storage-engine (0.9-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Aug 2011 00:00:00 +0900
groonga-storage-engine (0.8-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jul 2011 00:00:00 +0900
groonga-storage-engine (0.7-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Wed, 29 Jun 2011 00:00:00 +0900
groonga-storage-engine (0.6-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Sun, 29 May 2011 00:00:00 +0900
groonga-storage-engine (0.5-4) unstable; urgency=low
* fix a typo.
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 01:05:00 +0900
groonga-storage-engine (0.5-3) unstable; urgency=low
* fix AppArmor files.
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 00:59:00 +0900
groonga-storage-engine (0.5-2) unstable; urgency=low
* hook script fix.
-- Kouhei Sutou <kou@clear-code.com> Tue, 30 Mar 2011 00:58:00 +0900
groonga-storage-engine (0.5-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 00:00:00 +0900
groonga-storage-engine (0.4-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Mon, 29 Nov 2010 00:00:00 +0900
groonga-storage-engine (0.3-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 Oct 2010 16:34:04 +0900
groonga-storage-engine (0.2-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Sat, 25 Sep 2010 14:52:49 +0900
groonga-storage-engine (0.1-4) unstable; urgency=low
* follow configure option changes.
-- Kouhei Sutou <kou@cozmixng.org> Fri, 10 Sep 2010 08:45:53 +0900
groonga-storage-engine (0.1-3) unstable; urgency=low
* Use HEAD.
-- Kouhei Sutou <kou@clear-code.com> Thu, 02 Sep 2010 12:03:46 +0900
groonga-storage-engine (0.1-2) unstable; urgency=low
* Built with groonga 1.0.0.
-- Kouhei Sutou <kou@cozmixng.org> Mon, 30 Aug 2010 13:26:25 +0900
groonga-storage-engine (0.1-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Mon, 23 Aug 2010 13:52:01 +0900
Source: mroonga
Section: database
Priority: optional
Maintainer: Kouhei Sutou <kou@clear-code.com>
Build-Depends:
debhelper (>= 7.0.50),
autotools-dev,
pkg-config,
libgroonga-dev (>= @REQUIRED_GROONGA_VERSION@),
groonga-normalizer-mysql,
libmysqlclient-dev,
libmysqld-dev,
libssl-dev,
wget,
lsb-release
Standards-Version: 3.9.1
Homepage: http://mroonga.org/
Package: mysql-server-mroonga
Section: database
Architecture: any
Replaces: mysql-server-groonga (<< 1.10-1)
Breaks: mysql-server-groonga (<< 1.10-1)
Depends:
${misc:Depends},
${shlibs:Depends},
libgroonga0 (>= @REQUIRED_GROONGA_VERSION@),
mysql-server (= MYSQL_VERSION),
groonga-normalizer-mysql
Description: A fast fulltext searchable storage engine for MySQL.
Mroonga is a fast fulltext searchable storage engine for MySQL.
It is based on Groonga, a fast fulltext search engine and column store.
Groonga is good at real time update.
.
This package provides a MySQL storage engine as a shared library.
This provides "mroonga" storage engine. It means you can use
"ENGINE = mroonga" in "CREATE TABLE".
Package: mysql-server-mroonga-doc
Section: doc
Architecture: all
Replaces: mysql-server-groonga-doc (<< 1.10-1)
Breaks: mysql-server-groonga-doc (<< 1.10-1)
Depends:
${misc:Depends}
Description: Documentation of Mroonga.
Mroonga is a fast fulltext searchable storage engine for MySQL.
It is based on Groonga, a fast fulltext search engine and column store.
Groonga is good at real time update.
.
This package provides documentation of Mroonga.
This work was packaged for Debian by:
Kouhei Sutou <kou@clear-code.com> on Thu, 02 Sep 2010 13:51:56 +0900.
It was downloaded:
<http://github.com/mroonga/mroonga/downloads>
Upstream Author(s):
Tetsuro IKEDA <ikdttr at gmail.com>
Daijiro MORI <morita at razil. jp>
Tasuku SUENAGA <a at razil. jp>
Kouhei Sutou <kou at clear-code. com>
Copyright:
Copyright(C) 2009-2010 Tetsuro IKEDA
License:
LGPLv2.1
See `/usr/share/common-licenses/LGPL-2.1'.
The Debian packaging is done by Kouhei Sutou <kou@clear-code.com> in 2010,
and put into public domain, anyone can use it for any purpose.
usr/lib/mysql/plugin/ha_mroonga.so*
usr/share/mroonga/*
debian/apparmor/mysql-server-mroonga etc/apparmor.d/abstractions/
#! /bin/sh
set -e
prevver="$2"
install_plugin() {
cat /usr/share/mroonga/install.sql | \
mysql --defaults-file=/etc/mysql/debian.cnf || true
}
install_apparmor() {
mysql_apparmor_profile_name=usr.sbin.mysqld
mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name}
mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name}
apparmor_profile_name=mysql-server-mroonga
include_profile="#include <abstractions/${apparmor_profile_name}>"
local_apparmor_profile=/etc/apparmor.d/local/${apparmor_profile_name}
if test -f "${mysql_local_apparmor_profile}"; then
if ! grep -q "${include_profile}" "${mysql_local_apparmor_profile}"; then
echo >> "${mysql_local_apparmor_profile}"
echo "${include_profile}" >> "${mysql_local_apparmor_profile}"
fi
else
mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql
mysql_plugin_dir=/usr/lib/mysql/plugin
if test -f "${mysql_abstraction_apparmor_profile}" && \
! grep -q "${mysql_plugin_dir}" \
"${mysql_abstraction_apparmor_profile}"; then
# For Lucid.
cat <<EOF >> "${mysql_abstraction_apparmor_profile}"
# ${apparmor_profile_name}: START
# Added by mysql-server-mroonga.
${mysql_plugin_dir}/ r,
${mysql_plugin_dir}/*.so* mr,
${include_profile}
# ${apparmor_profile_name}: END
EOF
fi
fi
if ! test -e "$local_apparmor_profile"; then
mkdir -p $(dirname "$local_apparmor_profile")
cat <<EOF > "$local_apparmor_profile"
# Site-specific additions and overrides for ${apparmor_profile_name}.
# For more details, please see /etc/apparmor.d/local/README.
EOF
fi
if aa-status --enabled 2>/dev/null; then
apparmor_parser -r -T -W "${mysql_apparmor_profile}" || true
fi
true
}
case "$1" in
configure)
install_apparmor
install_plugin
;;
abort-upgrade|abort-deconfigure|abort-remove)
:
;;
*)
echo "Called with unknown argument $1, bailing out."
exit 1
;;
esac
#DEBHELPER#
#! /bin/sh
set -e
if [ "$1" = "purge" ]; then
mysql_apparmor_profile_name=usr.sbin.mysqld
mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name}
mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name}
mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql
apparmor_profile_name=mysql-server-mroonga
if test -f "${mysql_local_apparmor_profile}"; then
include_profile="#include <abstractions/${apparmor_profile_name}>"
if grep -q "${include_profile}" "${mysql_local_apparmor_profile}"; then
sed -i'' -e "s,${include_profile},," \
"${mysql_local_apparmor_profile}"
fi
else
start_marker_re="^# ${apparmor_profile_name}: START$"
end_marker_re="^# ${apparmor_profile_name}: END$"
if test -f "${mysql_abstraction_apparmor_profile}" && \
grep -q "${start_marker_re}" \
"${mysql_abstraction_apparmor_profile}"; then
sed -i'' -e "/${start_marker_re}/,/${end_marker_re}/d" \
"${mysql_abstraction_apparmor_profile}"
fi
fi
rm -f "/etc/apparmor.d/local/${apparmor_profile_name}" || true
rmdir /etc/apparmor.d/local 2>/dev/null || true
if aa-status --enabled 2>/dev/null; then
apparmor_parser -r -T -W "${mysql_apparmor_profile}" || true
fi
fi
#DEBHELPER#
exit 0
#! /bin/sh
set -e
cat /usr/share/mroonga/uninstall.sql | \
mysql --defaults-file=/etc/mysql/debian.cnf || true
#DEBHELPER#
exit 0
#!/usr/bin/make -f
# -*- makefile-gmake -*-
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
export MYSQL_VERSION := $(shell apt-cache show mysql-server-5.5 | grep Version | head -n 1 | awk '{print $$2}' | awk -F '-' '{print $$1}')
%:
dh $@
override_dh_auto_configure:
path=main/m/mysql-5.5/mysql-5.5_$(MYSQL_VERSION).orig.tar.gz; \
if [ "$$(lsb_release --id --short)" = "Ubuntu" ]; then \
base_url=http://archive.ubuntu.com/ubuntu/pool; \
security_base_url=http://security.ubuntu.com/ubuntu/pool; \
else \
base_url=http://ftp.debian.org/debian/pool; \
security_base_url=http://security.debian.org/pool/updates; \
fi; \
wget $${security_base_url}/$${path} || \
wget $${base_url}/$${path}
tar xf mysql-5.5_$(MYSQL_VERSION).orig.tar.gz
dh_auto_configure -- --with-mysql-source=./mysql-$(MYSQL_VERSION)
# disable 'make check'.
override_dh_auto_test:
override_dh_install:
mv debian/tmp/usr/share/doc/mroonga/ \
debian/tmp/usr/share/doc/mysql-server-mroonga-doc/
dh_install
# if test -x /usr/bin/dh_apparmor; then \
# dh_apparmor \
# -pmysql-server-mroonga \
# --profile-name=usr.lib.mysql.plugin.ha_mroonga; \
# fi
EXTRA_DIST = \
mysql55-mroonga.spec.in \
mysql56-community-mroonga.spec.in \
mariadb-mroonga.spec.in
noinst_DATA = \
mysql55-mroonga.spec \
mysql56-community-mroonga.spec \
mariadb-mroonga.spec
%define mariadb_epoch_default 1
%define mariadb_version_default 5.5.41
%define mariadb_release_default 2
%define mariadb_dist_default .el7_0
%define mariadb_download_base_url_default http://vault.centos.org/7.1.1503/os/Source/SPackages
%define mariadb_spec_file_default mariadb.spec
%{!?mariadb_epoch:%define mariadb_epoch %{mariadb_epoch_default}}
%{!?mariadb_version:%define mariadb_version %{mariadb_version_default}}
%{!?mariadb_release:%define mariadb_release %{mariadb_release_default}}
%{!?mariadb_dist:%define mariadb_dist %{mariadb_dist_default}}
%{!?mariadb_download_base_url:%define mariadb_download_base_url %{mariadb_download_base_url_default}}
%{!?mariadb_spec_file:%define mariadb_spec_file %{mariadb_spec_file_default}}
%define mariadb_package_version %{mariadb_epoch}:%{mariadb_version}-%{mariadb_release}%{mariadb_dist}
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
Name: mariadb-mroonga
Version: @VERSION@
Release: 1%{?dist}
Summary: A fast fulltext searchable storage engine for MariaDB
Group: Applications/Databases
License: LGPLv2.1
URL: http://mroonga.org/
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: groonga-devel >= %{groonga_required_version}
BuildRequires: groonga-normalizer-mysql-devel
BuildRequires: wget
BuildRequires: mariadb-devel = %{mariadb_package_version}
Requires: mariadb-server = %{mariadb_package_version}
Requires: mariadb = %{mariadb_package_version}
Requires: groonga-libs >= %{groonga_required_version}
Requires: groonga-normalizer-mysql
%description
Mroonga is a fast fulltext searchable storage plugin for MariaDB.
It is based on Groonga that is a fast fulltext search engine and
column store. Groonga is good at real-time update.
%package doc
Summary: Documentation for Mroonga
Group: Documentation
License: LGPLv2.1
%description doc
Documentation for Mroonga
%prep
%setup -q -n mroonga-%{version}
mariadb_full_version=%{mariadb_version}-%{mariadb_release}%{mariadb_dist}
srpm=mariadb-${mariadb_full_version}.src.rpm
if [ ! -f ../../SRPMS/$srpm ]; then
wget --continue -O ../../SRPMS/$srpm %{mariadb_download_base_url}/$srpm
rpm -Uvh ../../SRPMS/$srpm
rm ../../SRPMS/$srpm
fi
%build
mariadb_source=../mariadb-%{mariadb_version}
if [ ! -d ${mariadb_source} ]; then
rpmbuild -bc \
--define 'runselftest 0' \
--define 'optflags -O0' \
../../SPECS/%{mariadb_spec_file}
fi
%configure \
--disable-static \
--with-mysql-source=${mariadb_source} \
%{?mroonga_configure_options}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
%clean
rm -rf $RPM_BUILD_ROOT
%post
if /usr/bin/mysql -u root -e "quit"; then
password_option=""
else
password_option="-p"
fi
current_version=0
version=$(echo %{groonga_required_version} | sed -e 's/\.//g')
required_version=$(expr $version)
version=$(/usr/bin/mysql -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
grep mroonga | cut -f 2 | sed -e 's/\.//g')
if [ -n "$version" ]; then
current_version=$(expr $version)
fi
install_sql=%{_datadir}/mroonga/install.sql
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
if [ "$1" = 2 ] ; then
if [ $current_version -lt $required_version ]; then
command="/usr/bin/mysql -u root $password_option"
echo "run the following command after restarting MySQL server:";
echo " $command < ${uninstall_sql}"
echo " $command < ${install_sql}"
exit 0
else
command="/usr/bin/mysql -u root $password_option"
command="${command} < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
fi
command="/usr/bin/mysql -u root $password_option < ${install_sql}"
echo $command
eval $command || \
(echo "run the following command to register Mroonga:"; \
echo " $command")
%preun
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
if mysql -u root -e "quit"; then
password_option=""
else
password_option="-p"
fi
if [ "$1" = 0 ]; then
command="/usr/bin/mysql -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
%files
%defattr(-,root,root,-)
%{_libdir}/mysql/plugin/
%{_datadir}/mroonga/*
%{_datadir}/man/man1/*
%{_datadir}/man/*/man1/*
%files doc
%defattr(-,root,root,-)
%doc README COPYING
%doc mysql-mroonga-doc/*
%changelog
* Mon Jun 29 2015 Masafumi Yokoyama <myokoym@gmail.com> - 5.04-1
- new upstream release.
* Fri May 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.03-1
- new upstream release.
* Wed Apr 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.02-1
- new upstream release.
* Sun Mar 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.01-1
- new upstream release.
* Mon Feb 09 2015 <hayashi@clear-code.com> - 5.00-1
- new upstream release.
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
- new upstream release.
* Wed Jan 14 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.09-2
- build against mariadb-5.5.40-2.el7_0.
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
- new upstream release.
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
- new upstream release.
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
- new upstream release.
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
- new upstream release.
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
* Thu Aug 14 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-4
- build MariaDB for libmysqlservices.a.
* Thu Aug 14 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-3
- support epoch in MariaDB.
* Wed Aug 13 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-2
- build against mariadb-5.5.37-1.el7_0.
* Sun Aug 10 2014 Kouhei Sutou <kou@clear-code.com> - 4.04-1
- initial packaging for CentOS 7 based on mysql-mroogna package.
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
- new upstream release.
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
- new upstream release.
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
- new upstream release.
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
- new upstream release.
* Thu Feb 13 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
- use MySQL 5.1.73-3 on CentOS 6.
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
- new upstream release.
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
- new upstream release.
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
- new upstream release.
* Sat Dec 7 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-2
- use MySQL 5.1.71-1 on CentOS 6.
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
- new upstream release.
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
- new upstream release.
* Sun Sep 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.08-1
- new upstream release.
- use MySQL 5.6.14-1 on CentOS 5.
* Wed Sep 4 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.07-2
- fix a bug that mroonga is removed accidentally on upgrade #1918.
Reported by @ceekz. Thanks!!!
* Thu Aug 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.07-1
- new upstream release.
- use MySQL 5.6.13-1 on CentOS 5.
* Mon Jul 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.06-1
- new upstream release.
- use MySQL 5.6.12-2 on CentOS 5.
* Sat Jun 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.05-1
- new upstream release.
- use MySQL 5.6.12 on CentOS 5.
* Wed May 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.04-1
- new upstream release.
* Fri May 10 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.03-2
- use MySQL 5.6.11-2 on CentOS 5. see http://bugs.mysql.com/bug.php?id=69027
Reported by Y.Kentaro. Thanks!!!
* Mon Apr 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.03-1
- new upstream release.
* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.02-0
- new upstream release.
* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.01-0
- new upstream release.
* Sat Feb 09 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.00-0
- new upstream release.
- require groonga 3.0.0 or later
* Tue Feb 05 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 2.10-2
- use MySQL 5.1.67-1 on CentOS 6.
Reported by wakisuke.ua. Thanks!!!
* Sat Dec 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.10-0
- new upstream release.
* Mon Dec 10 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.09-1
- use MySQL 5.1.66-2 on CentOS 6.
Reported by wakisuke.ua. Thanks!!!
* Thu Nov 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.09-0
- new upstream release.
- use MySQL 5.5.28 on CentOS 5.
- use MySQL 5.1.66 on CentOS 6.
* Mon Oct 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.08-0
- new upstream release.
- add missing "DROP FUNCTION mroonga_snippet".
Reported by @tokuhy. Thanks!!!
* Sat Sep 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.07-0
- new upstream release.
* Wed Aug 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.06-0
- new upstream release.
- make MySQL spec file name customizable.
- make mroonga configure options customizable.
- add missing mysql-devel BuildRequires. Reported by wing. Thanks!!!
- use MySQL 5.5.27.
* Sun Jul 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.05-0
- new upstream release.
- use MySQL 5.5.25a.
* Fri Jun 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.04-0
- new upstream release.
- ensure deleting mroonga plugin before install.
Suggested by Kazuhiro Isobe. Thanks!!!
- use MySQL 5.5.25.
* Tue May 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.03-0
- new upstream release.
- use MySQL 5.5.24.
- make mysql_* variables customizable
- require groonga 2.0.3 or later.
* Sun Apr 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.02-0
- new upstream release.
- use MySQL 5.5.23.
- require groonga 2.0.2 or later.
* Thu Mar 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.01-0
- new upstream release.
- ensure plugin is uninstalled by closing all tables use mroonga.
* Wed Feb 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.00-0
- new upstream release.
- always install/uninstall plugin.
- use MySQL 5.1.61 and 5.5.21.
- require groonga 2.0.0 or later.
* Sun Jan 29 2012 Kouhei Sutou <kou@clear-code.com> - 1.20-0
- new upstream release.
- require groonga 1.3.0.
- groonga -> mroonga.
- use MySQL 5.5.20.
* Thu Dec 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.11-0
- new upstream release.
* Sat Oct 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.10-0
- new upstream release.
- groonga storage engine -> mroonga.
* Thu Sep 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.0-0
- new upstream release.
* Mon Aug 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.9-0
- new upstream release.
* Fri Jul 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.8-0
- new upstream release.
* Wed Jun 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.7-0
- new upstream release.
* Sun May 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.6-0
- new upstream release.
* Tue May 17 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-2
- use MySQL 5.5.12.
* Tue Mar 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.5-1
- new upstream release.
* Sat Jan 29 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-4
- do not remove plugin on upgrade.
* Wed Jan 12 2011 Kouhei Sutou <kou@clear-code.com> - 0.4-3
- rebuild without debug symbol.
* Thu Dec 30 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-2
- use MySQL 5.5.8-1.
- fix SQL literal notation.
* Mon Nov 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.4-1
- use the latest MySQL.
- new upstream release.
* Sun Nov 21 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-2
- install user define function.
* Fri Oct 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.3-1
- new upstream release.
* Fri Oct 08 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-2
- specify target MySQL version.
- use %{version}.
* Wed Sep 29 2010 Kouhei Sutou <kou@clear-code.com> - 0.2-1
- new upstream release.
* Sun Sep 12 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-3
- require MySQL-client-community.
* Fri Sep 10 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-2
- use MySQL-devel-community.
* Fri Sep 03 2010 Kouhei Sutou <kou@clear-code.com> - 0.1-1
- initial packaging for CentOS.
%{?scl:%scl_package mroonga}
%{!?scl:%global pkg_name %{name}}
%{!?centos_ver:%define centos_ver 5}
%if %{centos_ver} == 6
%define mysql_version_default 5.5.41
%define mysql_release_default 2
%define mysql_dist_default el6.centos.alt
%define mysql_download_base_url_default http://vault.centos.org/6.6/SCL/Source/SPackages
%define mysql_spec_file_default mysql.spec
%else
%define mysql_version_default 5.5.40
%define mysql_release_default 2
%define mysql_dist_default el5
%define mysql_download_base_url_default http://vault.centos.org/5.11/updates/SRPMS
%define mysql_spec_file_default mysql.spec
%endif
%{!?mysql_version:%define mysql_version %{mysql_version_default}}
%{!?mysql_release:%define mysql_release %{mysql_release_default}}
%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}}
%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}}
%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}}
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
Name: %{?scl_prefix}mroonga
Version: @VERSION@
Release: 1%{?dist}
Summary: A fast fulltext searchable storage engine for MySQL
Group: Applications/Databases
License: LGPLv2.1
URL: http://mroonga.org/
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: groonga-devel >= %{groonga_required_version}
BuildRequires: groonga-normalizer-mysql-devel
BuildRequires: wget
BuildRequires: which
BuildRequires: mysql55-mysql-devel = %{mysql_version}-%{mysql_release}.%{mysql_dist}
BuildRequires: mysql55-build
Requires: mysql55-mysql-server = %{mysql_version}-%{mysql_release}.%{mysql_dist}
Requires: mysql55-mysql = %{mysql_version}-%{mysql_release}.%{mysql_dist}
Requires: groonga-libs >= %{groonga_required_version}
Requires: groonga-normalizer-mysql
%{?scl:Requires: %scl_runtime}
%description
Mroonga is a fast fulltext searchable storage plugin for MySQL.
It is based on Groonga that is a fast fulltext search engine and
column store. Groonga is good at real-time update.
%package doc
Summary: Documentation for Mroonga
Group: Documentation
License: LGPLv2.1
%description doc
Documentation for Mroonga
%prep
%setup -q -n %{pkg_name}-%{version}
mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist}
srpm=mysql55-mysql-${mysql_full_version}.src.rpm
if [ ! -f ../../SRPMS/$srpm ]; then
wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm
rpm -Uvh ../../SRPMS/$srpm
fi
%build
mysql_source=../mysql-%{mysql_version}
if [ ! -d ${mysql_source} ]; then
specs_dir=
MYSQL_RPMBUILD_TEST=no rpmbuild -bp \
--define 'runselftest 0' \
--define 'optflags -O0' \
../../SPECS/%{mysql_spec_file}
fi
%configure --disable-static --with-mysql-source=${mysql_source} \
--disable-fast-mutexes \
--with-mysql-config=`scl enable mysql55 'which mysql_config'` \
%{?mroonga_configure_options}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
%clean
rm -rf $RPM_BUILD_ROOT
%post
mysql_command=`scl enable mysql55 'which mysql'`
password_option=""
$mysql_command -u root -e "quit"
if [ $? -ne 0 ]; then
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
required_version=`expr $version`
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
grep mroonga | cut -f 2 | sed -e 's/\.//g'`
if [ -n "$version" ]; then
current_version=`expr $version`
fi
install_sql=%{_datadir}/mroonga/install.sql
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
if [ "$1" = 2 ] ; then
if [ $current_version -lt $required_version ]; then
command="$mysql_command -u root $password_option"
echo "run the following command after restarting MySQL server:";
echo " $command < ${uninstall_sql}"
echo " $command < ${install_sql}"
exit 0
else
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
fi
command="$mysql_command -u root $password_option < ${install_sql}"
echo $command
eval $command || \
(echo "run the following command to register Mroonga:"; \
echo " $command")
%preun
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
mysql_command=`scl enable mysql55 'which mysql'`
if $mysql_command -u root -e "quit"; then
password_option=""
else
password_option="-p"
fi
if [ "$1" = 0 ]; then
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
%files
%defattr(-,root,root,-)
%{_libdir}/mysql/plugin/
%{_datadir}/mroonga/*
%{_datadir}/man/man1/*
%{_datadir}/man/*/man1/*
%files doc
%defattr(-,root,root,-)
%doc README COPYING
%doc mysql-mroonga-doc/*
%changelog
* Mon Jun 29 2015 Masafumi Yokoyama <myokoym@gmail.com> - 5.04-1
- new upstream release.
* Fri May 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.03-1
- new upstream release.
* Wed Apr 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.02-1
- new upstream release.
* Sun Mar 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.01-1
- new upstream release.
* Mon Feb 09 2015 <hayashi@clear-code.com> - 5.00-1
- new upstream release.
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
- new upstream release.
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
- new upstream release.
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
- new upstream release.
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
- new upstream release.
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
- new upstream release.
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
- new upstream release.
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-2
- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!!
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
- new upstream release.
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
- new upstream release.
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
- new upstream release.
* Thu Mar 06 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
- use MySQL 5.5.36 on CentOS 5.
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
- new upstream release.
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
- new upstream release.
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
- new upstream release.
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
- new upstream release.
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
- initial packaging for MySQL 5.5 on CentOS 5.
%{!?centos_ver:%define centos_ver 6}
%if %{centos_ver} == 7
%define mysql_version_default 5.6.25
%define mysql_release_default 2
%define mysql_dist_default el7
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/7/SRPMS
%define mysql_spec_file_default mysql.spec
%else
%define mysql_version_default 5.6.25
%define mysql_release_default 2
%define mysql_dist_default el6
%define mysql_download_base_url_default http://repo.mysql.com/yum/mysql-5.6-community/el/6/SRPMS
%define mysql_spec_file_default mysql.spec
%endif
%{!?mysql_version:%define mysql_version %{mysql_version_default}}
%{!?mysql_release:%define mysql_release %{mysql_release_default}}
%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}}
%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}}
%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}}
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
Name: mysql-community-mroonga
Version: @VERSION@
Release: 1%{?dist}
Summary: A fast fulltext searchable storage engine for MySQL
Group: Applications/Databases
License: LGPLv2.1
URL: http://mroonga.org/
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: groonga-devel >= %{groonga_required_version}
BuildRequires: groonga-normalizer-mysql-devel
BuildRequires: wget
BuildRequires: which
BuildRequires: gcc, gcc-c++
BuildRequires: mysql-community-devel = %{mysql_version}-%{mysql_release}.%{mysql_dist}
Requires: mysql-community-server = %{mysql_version}-%{mysql_release}.%{mysql_dist}
Requires: mysql-community-client = %{mysql_version}-%{mysql_release}.%{mysql_dist}
Requires: groonga-libs >= %{groonga_required_version}
Requires: groonga-normalizer-mysql
%description
Mroonga is a fast fulltext searchable storage plugin for MySQL.
It is based on Groonga that is a fast fulltext search engine and
column store. Groonga is good at real-time update.
%package doc
Summary: Documentation for Mroonga
Group: Documentation
License: LGPLv2.1
%description doc
Documentation for Mroonga
%prep
%setup -q -n mroonga-%{version}
mysql_full_version=%{mysql_version}-%{mysql_release}.%{mysql_dist}
srpm=mysql-community-${mysql_full_version}.src.rpm
if [ ! -f ../../SRPMS/$srpm ]; then
wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm
rpm -Uvh ../../SRPMS/$srpm
fi
%build
mysql_source=../mysql-%{mysql_version}/mysql-%{mysql_version}
if [ ! -d ${mysql_source} ]; then
specs_dir=
MYSQL_RPMBUILD_TEST=no rpmbuild -bp \
--define 'runselftest 0' \
--define 'optflags -O0' \
../../SPECS/%{mysql_spec_file}
fi
%configure \
--disable-static \
--with-mysql-source=${mysql_source} \
--enable-fast-mutexes \
%{?mroonga_configure_options}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
%clean
rm -rf $RPM_BUILD_ROOT
%post
if ! /sbin/service mysqld status > /dev/null; then
/sbin/service mysqld start
stop_after_installation=1
else
stop_after_installation=0
fi
mysql_command=`which mysql`
password_option=""
$mysql_command -u root -e "quit"
if [ $? -ne 0 ]; then
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
required_version=`expr $version`
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
grep mroonga | cut -f 2 | sed -e 's/\.//g'`
if [ -n "$version" ]; then
current_version=`expr $version`
fi
install_sql=%{_datadir}/mroonga/install.sql
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
if [ "$1" = 2 ] ; then
if [ $current_version -lt $required_version ]; then
command="$mysql_command -u root $password_option"
echo "run the following command after restarting MySQL server:";
echo " $command < ${uninstall_sql}"
echo " $command < ${install_sql}"
exit 0
else
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
fi
command="$mysql_command -u root $password_option < ${install_sql}"
echo $command
eval $command || \
(echo "run the following command to register Mroonga:"; \
echo " $command")
if [ "$stop_after_installation" = "1" ]; then
/sbin/service mysqld stop
fi
%preun
if ! /sbin/service mysqld status > /dev/null; then
/sbin/service mysqld start
stop_after_uninstallation=1
else
stop_after_uninstallation=0
fi
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
mysql_command=`which mysql`
if $mysql_command -u root -e "quit"; then
password_option=""
else
password_option="-p"
fi
if [ "$1" = 0 ]; then
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
if [ "$stop_after_uninstallation" = "1" ]; then
/sbin/service mysqld stop
fi
%files
%defattr(-,root,root,-)
%{_libdir}/mysql/plugin/
%{_datadir}/mroonga/*
%{_datadir}/man/man1/*
%{_datadir}/man/*/man1/*
%files doc
%defattr(-,root,root,-)
%doc README COPYING
%doc mysql-mroonga-doc/*
%changelog
* Mon Jun 29 2015 Masafumi Yokoyama <myokoym@gmail.com> - 5.04-1
- new upstream release.
* Thu Jun 02 2015 Masafumi Yokoyama <yokoyama@clear-code.com> - 5.03-2
- build against MySQL 5.6.25.
* Fri May 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.03-1
- new upstream release.
* Wed Apr 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.02-1
- new upstream release.
* Fri Apr 10 2015 Kouhei Sutou <kou@clear-code.com> - 5.01-2
- build against MySQL 5.6.24.
* Sun Mar 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.01-1
- new upstream release.
* Mon Feb 09 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 5.00-1
- new upstream release.
* Wed Feb 04 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-2
- build against MySQL 5.6.23-2 on MySQL yum repository.
* Thu Jan 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 4.10-1
- new upstream release.
* Mon Dec 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.09-1
- new upstream release.
* Sat Nov 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.08-1
- new upstream release.
* Wed Oct 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.07-1
- new upstream release.
* Mon Sep 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.06-1
- new upstream release.
* Sat Sep 27 2014 Eiichi Sato <miko@cafelounge.net> - 4.05-2
- build against MySQL 5.6.21-2 on MySQL yum repository.
* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.05-1
- new upstream release.
* Sat Aug 09 2014 Eiichi Sato <miko@cafelounge.net> - 4.04-2
- build against MySQL 5.6.20-4 on MySQL yum repository.
* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.04-1
- new upstream release.
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-2
- build against MySQL 5.6.37. Reported by YOSHIDA Mitsuo. Thanks!!!
* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.03-1
- new upstream release.
* Tue Apr 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.02-1
- new upstream release.
* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.01-1
- new upstream release.
* Thu Mar 06 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-2
- use MySQL 5.5.36 on CentOS 5.
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.00-1
- new upstream release.
* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.12-1
- new upstream release.
* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.11-1
- new upstream release.
* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.10-1
- new upstream release.
* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.09-1
- initial packaging for MySQL 5.5 on CentOS 5.
%{!?centos_ver:%define centos_ver 6}
%define mysql_version_default 5.6.24
%define mysql_release_default rel72.2
%define mysql_dist_default %{?dist}
%define mysql_download_base_url_default http://repo.percona.com/centos/%{centos_ver}/SRPMS
%define mysql_spec_file_default percona-server.spec
%{!?mysql_version:%define mysql_version %{mysql_version_default}}
%{!?mysql_release:%define mysql_release %{mysql_release_default}}
%{!?mysql_dist:%define mysql_dist %{mysql_dist_default}}
%{!?mysql_download_base_url:%define mysql_download_base_url %{mysql_download_base_url_default}}
%{!?mysql_spec_file:%define mysql_spec_file %{mysql_spec_file_default}}
%define groonga_required_version @REQUIRED_GROONGA_VERSION@
Name: percona-server-56-mroonga
Version: @VERSION@
Release: 1%{?dist}
Summary: A fast fulltext searchable storage engine for MySQL
Group: Applications/Databases
License: LGPLv2.1
URL: http://mroonga.org/
Source0: http://packages.groonga.org/source/mroonga/mroonga-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: groonga-devel >= %{groonga_required_version}
BuildRequires: groonga-normalizer-mysql-devel
BuildRequires: wget
BuildRequires: which
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: Percona-Server-devel-56 = %{mysql_version}-%{mysql_release}%{mysql_dist}
BuildRequires: selinux-policy-devel
Requires: Percona-Server-server-56 = %{mysql_version}-%{mysql_release}%{mysql_dist}
Requires: Percona-Server-client-56 = %{mysql_version}-%{mysql_release}%{mysql_dist}
Requires: groonga-libs >= %{groonga_required_version}
Requires: groonga-normalizer-mysql
%description
Mroonga is a fast fulltext searchable storage plugin for MySQL.
It is based on Groonga that is a fast fulltext search engine and
column store. Groonga is good at real-time update.
%package doc
Summary: Documentation for Mroonga
Group: Documentation
License: LGPLv2.1
%description doc
Documentation for Mroonga
%prep
%setup -q -n mroonga-%{version}
mysql_full_version=%{mysql_version}-%{mysql_release}.generic
srpm=Percona-Server-56-${mysql_full_version}.src.rpm
if [ ! -f ../../SRPMS/$srpm ]; then
wget --continue -O ../../SRPMS/$srpm %{mysql_download_base_url}/$srpm
rpm -Uvh ../../SRPMS/$srpm
fi
%build
mysql_source=../percona-server-%{mysql_version}-$(echo %{mysql_release} | sed -e 's/rel//')
if [ ! -d ${mysql_source} ]; then
specs_dir=
rpmbuild -bp \
--define 'runselftest 0' \
--define 'optflags -O0' \
../../SPECS/%{mysql_spec_file}
fi
%configure --disable-static --with-mysql-source=${mysql_source} \
%{?mroonga_configure_options}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/*.la
mv $RPM_BUILD_ROOT%{_datadir}/doc/mroonga/ mysql-mroonga-doc/
%clean
rm -rf $RPM_BUILD_ROOT
%post
if ! /sbin/service mysql status > /dev/null; then
/sbin/service mysql start
stop_after_installation=1
else
stop_after_installation=0
fi
mysql_command=`which mysql`
password_option=""
$mysql_command -u root -e "quit"
if [ $? -ne 0 ]; then
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
required_version=`expr $version`
version=`$mysql_command -e "SHOW VARIABLES LIKE 'mroonga_libgroonga_version'" | \
grep mroonga | cut -f 2 | sed -e 's/\.//g'`
if [ -n "$version" ]; then
current_version=`expr $version`
fi
install_sql=%{_datadir}/mroonga/install.sql
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
if [ "$1" = 2 ] ; then
if [ $current_version -lt $required_version ]; then
command="$mysql_command -u root $password_option"
echo "run the following command after restarting MySQL server:";
echo " $command < ${uninstall_sql}"
echo " $command < ${install_sql}"
exit 0
else
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
fi
command="$mysql_command -u root $password_option < ${install_sql}"
echo $command
eval $command || \
(echo "run the following command to register Mroonga:"; \
echo " $command")
if [ "$stop_after_installation" = "1" ]; then
/sbin/service mysql stop
fi
%preun
if ! /sbin/service mysql status > /dev/null; then
/sbin/service mysql start
stop_after_uninstallation=1
else
stop_after_uninstallation=0
fi
uninstall_sql=%{_datadir}/mroonga/uninstall.sql
mysql_command=`which mysql`
if $mysql_command -u root -e "quit"; then
password_option=""
else
password_option="-p"
fi
if [ "$1" = 0 ]; then
command="$mysql_command -u root $password_option < ${uninstall_sql}"
echo $command
eval $command || \
(echo "run the following command to unregister Mroonga:"; \
echo " $command")
fi
if [ "$stop_after_uninstallation" = "1" ]; then
/sbin/service mysql stop
fi
%files
%defattr(-,root,root,-)
%{_libdir}/mysql/plugin/
%{_datadir}/mroonga/*
%{_datadir}/man/man1/*
%{_datadir}/man/*/man1/*
%files doc
%defattr(-,root,root,-)
%doc README COPYING
%doc mysql-mroonga-doc/*
%changelog
* Tue Mar 17 2015 Kouhei Sutou <kou@clear-code.com> - 5.00-1
- initial release.
MROONGA_BASE = $(PACKAGE)-$(VERSION)
MROONGA_TAR_GZ = $(MROONGA_BASE).tar.gz
GROONGA_VERSION = 5.0.5
GROONGA_BASE = groonga-$(GROONGA_VERSION)
GROONGA_TAR_GZ = $(GROONGA_BASE).tar.gz
GROONGA_NORMALIZER_MYSQL_VERSION = 1.1.0
GROONGA_NORMALIZER_MYSQL_BASE = \
groonga-normalizer-mysql-$(GROONGA_NORMALIZER_MYSQL_VERSION)
GROONGA_NORMALIZER_MYSQL_TAR_GZ = \
$(GROONGA_NORMALIZER_MYSQL_BASE).tar.gz
MARIADB_VERSION = 10.0.20
MARIADB_BASE = mariadb-$(MARIADB_VERSION)
MARIADB_TAR_GZ = $(MARIADB_BASE).tar.gz
MARIADB_WITH_MROONGA_BASE = $(MARIADB_BASE)-with-$(MROONGA_BASE)
MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE = $(MARIADB_WITH_MROONGA_BASE)-for-windows
GROONGA_PROJECT_DOWNLOAD_BASE = http://packages.groonga.org/source
GROONGA_DOWNLOAD_BASE = $(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga
GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE = \
$(GROONGA_PROJECT_DOWNLOAD_BASE)/groonga-normalizer-mysql
MARIADB_DOWNLOAD_BASE = http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb
CURL = curl --fail --silent --show-error
all:
release: archive upload
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
download: ensure-rsync-path
rsync -avz --progress --delete $(RSYNC_PATH)/source/mroonga/ files
ARCHIVES = \
files/$(MROONGA_TAR_GZ) \
files/$(MARIADB_WITH_MROONGA_BASE).tar.gz \
files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip
archive: $(ARCHIVES)
upload: ensure-rsync-path
rsync -avz --progress --delete files/ $(RSYNC_PATH)/source/mroonga
files/$(MROONGA_TAR_GZ): $(top_builddir)/$(MROONGA_TAR_GZ)
mkdir -p files
cp -p $< $@
tmp/$(GROONGA_TAR_GZ):
mkdir -p tmp
$(CURL) --output $@ $(GROONGA_DOWNLOAD_BASE)/$(GROONGA_TAR_GZ)
tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ):
mkdir -p tmp
$(CURL) --output $@ $(GROONGA_NORMALIZER_MYSQL_DOWNLOAD_BASE)/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ)
tmp/$(MARIADB_TAR_GZ):
mkdir -p tmp
$(CURL) --output $@ $(MARIADB_DOWNLOAD_BASE)/mariadb-$(MARIADB_VERSION)/source/$(MARIADB_TAR_GZ)
MARIADB_WITH_MROONGA_ARCHIVES = \
tmp/$(GROONGA_TAR_GZ) \
tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ) \
tmp/$(MARIADB_TAR_GZ) \
$(top_builddir)/$(MROONGA_TAR_GZ)
BUNDLED_MROONGA_PATH = $(MARIADB_BASE)/storage/$(PACKAGE)
BUNDLED_GROONGA_PATH = $(BUNDLED_MROONGA_PATH)/vendor/groonga
BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH = \
$(BUNDLED_GROONGA_PATH)/vendor/plugins/groonga-normalizer-mysql
tmp/$(MARIADB_WITH_MROONGA_BASE).stamp: $(MARIADB_WITH_MROONGA_ARCHIVES)
rm -rf $(MARIADB_BASE)
tar xf tmp/$(MARIADB_TAR_GZ)
rm -fr $(MARIADB_BASE)/storage/mroonga
tar xf $(top_builddir)/$(MROONGA_TAR_GZ)
mv $(MROONGA_BASE) $(BUNDLED_MROONGA_PATH)
mkdir -p $$(dirname $(BUNDLED_GROONGA_PATH))
tar xf tmp/$(GROONGA_TAR_GZ)
rm -rf $(GROONGA_BASE)/test
mv $(GROONGA_BASE) $(BUNDLED_GROONGA_PATH)
tar xf tmp/$(GROONGA_NORMALIZER_MYSQL_TAR_GZ)
rm -rf $(GROONGA_NORMALIZER_MYSQL_BASE)/test
mv $(GROONGA_NORMALIZER_MYSQL_BASE) $(BUNDLED_GROONGA_NORMALIZER_MYSQL_PATH)
rm -rf tmp/$(MARIADB_WITH_MROONGA_BASE)
mv $(MARIADB_BASE) tmp/$(MARIADB_WITH_MROONGA_BASE)
touch $@
files/$(MARIADB_WITH_MROONGA_BASE).tar.gz: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp
mkdir -p files/
(cd tmp && tar czf ../$@ $(MARIADB_WITH_MROONGA_BASE))
PATCHES = \
patches/mariadb-10.0.3-windows-build.diff
tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp: tmp/$(MARIADB_WITH_MROONGA_BASE).stamp $(PATCHES)
rm -rf tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE)
cp -a \
tmp/$(MARIADB_WITH_MROONGA_BASE) \
tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE)
for patch in $(PATCHES); do \
(cd tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE) && \
patch -p1 < $(abs_srcdir)/$${patch}); \
done
touch $@
files/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).zip: tmp/$(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE).stamp
mkdir -p files/
(cd tmp && zip -q -r ../$@ $(MARIADB_WITH_MROONGA_FOR_WINDOWS_BASE))
diff -ur mariadb-10.0.2.orig/sql/sql_locale.cc mariadb-10.0.2/sql/sql_locale.cc
--- mariadb-10.0.2.orig/sql/sql_locale.cc 2013-04-23 13:13:59.000000000 +0900
+++ mariadb-10.0.2/sql/sql_locale.cc 2013-05-19 12:55:27.590366542 +0900
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
CODE_NAMES = precise,trusty,utopic,vivid
SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz
all:
ensure-launchpad-configuration:
@if test -z "$(LAUNCHPAD_UPLOADER_PGP_KEY)"; then \
echo "--with-launchpad-uploader-pgp-key configure option must be specified."; \
false; \
fi
upload: source ensure-launchpad-configuration
./upload.rb \
--package '$(PACKAGE)' \
--version '$(VERSION)' \
--source-archive '$(SOURCE)' \
--code-names '$(CODE_NAMES)' \
--debian-directory '$(srcdir)/../debian/' \
--pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)'
source: $(SOURCE)
$(SOURCE):
ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE)
#!/usr/bin/env ruby
#
# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
# Copyright(C) 2014 HAYASHI Kentaro <hayashi@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
require "optparse"
require "fileutils"
require "pathname"
require "open-uri"
class Uploader
def initialize
@dput_configuration_name = "groonga-ppa"
end
def run
ensure_dput_configuration
parse_command_line!
ensure_mysql_version
@required_groonga_version = required_groonga_version
@code_names.each do |code_name|
upload(code_name)
end
end
private
def ensure_dput_configuration
dput_cf_path = Pathname.new("~/.dput.cf").expand_path
if dput_cf_path.exist?
dput_cf_content = dput_cf_path.read
else
dput_cf_content = ""
end
dput_cf_content.each_line do |line|
return if line.chomp == "[#{@dput_configuration_name}]"
end
dput_cf_path.open("w") do |dput_cf|
dput_cf.puts(dput_cf_content)
dput_cf.puts(<<-CONFIGURATION)
[#{@dput_configuration_name}]
fqdn = ppa.launchpad.net
method = ftp
incoming = ~groonga/ppa/ubuntu/
login = anonymous
allow_unsigned_uploads = 0
CONFIGURATION
end
end
def ensure_mysql_version
@mysql_version = {}
@code_names.each do |code_name|
open("http://packages.ubuntu.com/#{code_name}/allpackages?format=txt.gz") do |file|
file.each_line do |line|
@mysql_version[code_name] = $1 if line =~ /\Amysql-server \((.+?)\).+/
end
end
end
end
def parse_command_line!
parser = OptionParser.new
parser.on("--package=NAME",
"The package name") do |name|
@package = name
end
parser.on("--version=VERSION",
"The version") do |version|
@version = version
end
parser.on("--source-archive=ARCHIVE",
"The source archive") do |source_archive|
@source_archive = Pathname.new(source_archive).expand_path
end
parser.on("--code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array,
"The target code names") do |code_names|
@code_names = code_names
end
parser.on("--debian-directory=DIRECTORY",
"The debian/ directory") do |debian_directory|
@debian_directory = Pathname.new(debian_directory).expand_path
end
parser.on("--pgp-sign-key=KEY",
"The PGP key to sign .changes and .dsc") do |pgp_sign_key|
@pgp_sign_key = pgp_sign_key
end
parser.on("--pbuilder",
"Use pbuilder for build check") do |pbuilder|
@use_pbuilder = pbuilder
end
parser.parse!
end
def upload(code_name)
in_temporary_directory do
FileUtils.cp(@source_archive.to_s,
"#{@package}_#{@version}.orig.tar.gz")
run_command("tar", "xf", @source_archive.to_s)
directory_name = "#{@package}-#{@version}"
Dir.chdir(directory_name) do
FileUtils.cp_r(@debian_directory.to_s, "debian")
deb_version = "#{current_deb_version.succ}~#{code_name}1"
run_command("dch",
"--distribution", code_name,
"--newversion", deb_version,
"Build for #{code_name}.")
case code_name
when "vivid"
run_command("sed",
"-i", "-e", "s,5\\.5,5.6,g",
"debian/rules")
end
run_command("sed",
"-i", "-e", "s,MYSQL_VERSION,#{@mysql_version[code_name]},",
"debian/control")
run_command("debuild", "-S", "-sa", "-pgpg2", "-k#{@pgp_sign_key}")
if @use_pbuilder
run_command("pbuilder-dist", code_name, "build",
"../#{@package}_#{deb_version}.dsc")
else
run_command("dput", @dput_configuration_name,
"../#{@package}_#{deb_version}_source.changes")
end
end
end
end
def required_groonga_version
File.read("../../required_groonga_version").lines.first.chomp
end
def current_deb_version
/\((.+)\)/ =~ File.read("debian/changelog").lines.first
$1
end
def in_temporary_directory
name = "tmp"
FileUtils.rm_rf(name)
FileUtils.mkdir_p(name)
Dir.chdir(name) do
yield
end
end
def run_command(*command_line)
unless system(*command_line)
raise "failed to run command: #{command_line.join(' ')}"
end
end
end
uploader = Uploader.new
uploader.run
EXTRA_DIST = \
README.md \
build-vc2013.bat \
build-vc2013-zip-32.bat \
build-vc2013-zip-64.bat \
build-vc2013-msi-32.bat \
build-vc2013-msi-64.bat \
build-vc2015.bat \
build-vc2015-zip-32.bat \
build-vc2015-zip-64.bat \
build-vc2015-msi-32.bat \
build-vc2015-msi-64.bat
# How to build Windows binaries
## Preparation
TODO...
## Build with Visual C++ Express
You need to use Visual C++ 2013 or later to build Mroonga with Express
edition. `build-vc2013.bat` is a build batch script to build with
Visual C++ Express 2013.
Note that you can't build MSI file with Express edition. You need to
use Professional edition or upper editions to build MSI file.
## Build with Visual C++ Professional
You can build both zip file MSI file with Professional edition.
But now, this feature is temporary disabled.
If you want to create MSI package, please uncomment in `build-vc2013.bat`.
And then, you can build MSI package with Visual Studio 2013 Professional.
rmdir /S /Q build-vc2013-msi-32
mkdir build-vc2013-msi-32
cd build-vc2013-msi-32
cmake ..\source -G "Visual Studio 12" > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target msi > msi.log
move *.msi ..\
cd ..
rmdir /S /Q build-vc2013-msi-64
mkdir build-vc2013-msi-64
cd build-vc2013-msi-64
cmake ..\source -G "Visual Studio 12 Win64" > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target msi > msi.log
move *.msi ..\
cd ..
rmdir /S /Q build-vc2013-zip-32
mkdir build-vc2013-zip-32
cd build-vc2013-zip-32
cmake ..\source -G "Visual Studio 12" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target package > zip.log
move *.zip ..\
cd ..
rmdir /S /Q build-vc2013-zip-64
mkdir build-vc2013-zip-64
cd build-vc2013-zip-64
cmake ..\source -G "Visual Studio 12 Win64" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target package > zip.log
move *.zip ..\
cd ..
build-vc2013-zip-32.bat
build-vc2013-zip-64.bat
REM build-vc2013-msi-32.bat
REM build-vc2013-msi-64.bat
rmdir /S /Q build-vc2015-msi-32
mkdir build-vc2015-msi-32
cd build-vc2015-msi-32
cmake ..\source -G "Visual Studio 14" > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target msi > msi.log
move *.msi ..\
cd ..
rmdir /S /Q build-vc2015-msi-64
mkdir build-vc2015-msi-64
cd build-vc2015-msi-64
cmake ..\source -G "Visual Studio 14 Win64" > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target msi > msi.log
move *.msi ..\
cd ..
rmdir /S /Q build-vc2015-zip-32
mkdir build-vc2015-zip-32
cd build-vc2015-zip-32
cmake ..\source -G "Visual Studio 14" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target package > zip.log
move *.zip ..\
cd ..
rmdir /S /Q build-vc2015-zip-64
mkdir build-vc2015-zip-64
cd build-vc2015-zip-64
cmake ..\source -G "Visual Studio 14 Win64" -DMRN_GROONGA_EMBED=OFF -DMRN_GROONGA_NORMALIZER_MYSQL_EMBED=OFF > config.log
cmake --build . --config RelWithDebInfo > build.log
cmake --build . --config RelWithDebInfo --target package > zip.log
move *.zip ..\
cd ..
build-vc2015-zip-32.bat
build-vc2015-zip-64.bat
REM build-vc2015-msi-32.bat
REM build-vc2015--msi-64.bat
REPOSITORIES_PATH = repositories
DISTRIBUTIONS = centos
ARCHITECTURES = i386 x86_64
MYSQL_VARIANTS = mysql55 mysql56-community mariadb percona-server-56
SPEC_DIR = $(builddir)/../rpm/centos
all:
release: download build sign-packages update-repository upload
remove-existing-packages:
for distribution in $(DISTRIBUTIONS); do \
find $${distribution} -name "*.rpm" -delete; \
done
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
sign-packages:
./sign-rpm.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(DISTRIBUTIONS)'
update-repository:
./update-repository.sh '$(REPOSITORIES_PATH)/' '$(DISTRIBUTIONS)'
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete --exclude .gitignore \
$(REPOSITORIES_PATH)/$${distribution}/ \
$(RSYNC_PATH)/$${distribution}; \
done
download: ensure-rsync-path
mkdir -p $(REPOSITORIES_PATH)
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete \
$(RSYNC_PATH)/$${distribution}/ \
$(REPOSITORIES_PATH)/$${distribution}; \
done
build: build-in-vm
build-in-vm: source specs env.sh
./build-in-vm.sh \
"$(PACKAGE)" \
"$(SPEC_DIR)" \
"$(MYSQL_VARIANTS)" \
"$(ARCHITECTURES)"
source: tmp/$(PACKAGE)-$(VERSION).tar.gz
tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
mkdir -p tmp/
cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz tmp/
$(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz:
cd $(abs_top_builddir) && $(MAKE) dist
specs: $(SPEC_DIR)/mysql55-$(PACKAGE).spec
specs: $(SPEC_DIR)/mysql56-community-$(PACKAGE).spec
specs: $(SPEC_DIR)/mariadb-$(PACKAGE).spec
specs: $(SPEC_DIR)/percona-server-56-$(PACKAGE).spec
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = [
{
:id => "centos-5-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11-i386_chef-provisionerless.box",
},
{
:id => "centos-5-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11_chef-provisionerless.box",
},
{
:id => "centos-6-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6-i386_chef-provisionerless.box",
},
{
:id => "centos-6-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6_chef-provisionerless.box",
},
{
:id => "centos-7-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.1_chef-provisionerless.box",
},
]
vms.each do |vm|
config.vm.define(vm[:id]) do |node|
node.vm.box = vm[:id]
node.vm.box_url = vm[:box_url]
node.vm.provision(:shell, :path => "build-rpm.sh")
node.vm.provider("virtualbox") do |virtual_box|
system_n_cpus = 1
if File.exist?("/proc/cpuinfo")
system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size
end
if system_n_cpus > 1
vm_n_cpus = system_n_cpus / 2
else
vm_n_cpus = 1
end
virtual_box.cpus = vm_n_cpus
end
end
end
end
#!/bin/sh
if [ $# != 4 ]; then
echo "Usage: $0 PACKAGE SPEC_DIR MYSQL_VARIANTS ARCHITECTURES"
echo " e.g.: $0 mroonga ../rpm/centos 'mysql55 mariadb' 'i386 x86_64'"
exit 1
fi
PACKAGE="$1"
SPEC_DIR="$2"
MYSQL_VARIANTS="$3"
ARCHITECTURES="$4"
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
run vagrant destroy --force
for mysql_variant in ${MYSQL_VARIANTS}; do
rm -rf tmp/centos/
mkdir -p tmp/centos/
cp ${SPEC_DIR}/${mysql_variant}-${PACKAGE}.spec tmp/centos/
architectures="${ARCHITECTURES}"
case ${mysql_variant} in
mysql55)
centos_versions="5 6"
;;
mysql56-community)
centos_versions="6 7"
;;
mariadb)
centos_versions="7"
;;
percona-server-56)
centos_versions="6 7"
;;
esac
for architecture in ${architectures}; do
for centos_version in ${centos_versions}; do
if [ ${mysql_variant} = mysql55 -a ${centos_version} = 6 -a ${architecture} = i386 ]; then
continue
fi
if [ ${centos_version} = 7 -a ${architecture} = i386 ]; then
continue
fi
id=centos-${centos_version}-${architecture}
vagrant up ${id}
build_status=$?
if [ $build_status -ne 0 ]; then
exit $build_status
fi
vagrant destroy --force ${id}
done
done
done
#!/bin/sh
LANG=C
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
rpmbuild_options=
. /vagrant/env.sh
distribution=$(cut -d " " -f 1 /etc/redhat-release | tr "A-Z" "a-z")
if grep -q Linux /etc/redhat-release; then
distribution_version=$(cut -d " " -f 4 /etc/redhat-release)
else
distribution_version=$(cut -d " " -f 3 /etc/redhat-release)
fi
distribution_version=$(echo ${distribution_version} | sed -e 's/\..*$//g')
architecture="$(arch)"
case "${architecture}" in
i*86)
architecture=i386
;;
esac
run yum groupinstall -y "Development Tools"
run yum install -y rpm-build rpmdevtools tar wget
if [ -x /usr/bin/rpmdev-setuptree ]; then
rm -rf .rpmmacros
run rpmdev-setuptree
else
run cat <<EOM > ~/.rpmmacros
%_topdir ${HOME}/rpmbuild
EOM
run mkdir -p ~/rpmbuild/SOURCES
run mkdir -p ~/rpmbuild/SPECS
run mkdir -p ~/rpmbuild/BUILD
run mkdir -p ~/rpmbuild/RPMS
run mkdir -p ~/rpmbuild/SRPMS
fi
repository="/vagrant/repositories/${distribution}/${distribution_version}"
rpm_dir="${repository}/${architecture}/Packages"
srpm_dir="${repository}/source/SRPMS"
run mkdir -p "${rpm_dir}" "${srpm_dir}"
rpmbuild_options=""
# for debug
# rpmbuild_options="${rpmbuild_options} --define 'optflags -O0 -g3'"
cd
run cp /vagrant/tmp/${PACKAGE}-${VERSION}.* rpmbuild/SOURCES/
run cp /vagrant/tmp/${distribution}/*.spec rpmbuild/SPECS/
package_name=$(cd rpmbuild/SPECS; echo *.spec | sed -e 's/\.spec$//g')
case ${distribution} in
fedora)
USE_MYSQLSERVICES_COMPAT=yes
run yum install -y mariadb-devel
;;
centos)
case ${package_name} in
mysql55-${PACKAGE})
USE_MYSQLSERVICES_COMPAT=yes
run yum install -y scl-utils-build
if [ ${distribution_version} = 6 ]; then
run yum install -y centos-release-SCL
fi
run yum install -y mysql55-mysql-devel mysql55-build
;;
mysql56-community-${PACKAGE})
release_rpm=mysql-community-release-el${distribution_version}-5.noarch.rpm
run yum -y install http://repo.mysql.com/${release_rpm}
run yum -y install mysql-community-devel
;;
mariadb-${PACKAGE})
run yum -y install mariadb-devel
;;
percona-server-56-${PACKAGE})
release_rpm_version=0.1-3
release_rpm=percona-release-${release_rpm_version}.noarch.rpm
run yum -y install http://www.percona.com/downloads/percona-release/redhat/${release_rpm_version}/${release_rpm}
run yum -y install Percona-Server-devel-56
;;
esac
release_rpm=groonga-release-1.1.0-1.noarch.rpm
wget http://packages.groonga.org/${distribution}/${release_rpm}
run rpm -U ${release_rpm}
rm -f ${release_rpm}
run yum makecache
;;
esac
run yum install -y ${DEPENDED_PACKAGES}
if [ "${package_name}" = "percona-server-56-${PACKAGE}" ]; then
if [ "${distribution_version}" = "7" ]; then
rpmbuild_options="$rpmbuild_options --define 'dist .el7'"
fi
fi
if [ "${USE_MYSQLSERVICES_COMPAT}" = "yes" ]; then
rpmbuild_options="$rpmbuild_options --define 'mroonga_configure_options --with-libmysqlservices-compat'"
fi
run eval rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${package_name}.spec
run mv rpmbuild/RPMS/*/* "${rpm_dir}/"
run mv rpmbuild/SRPMS/* "${srpm_dir}/"
PACKAGE=@PACKAGE@
VERSION=@VERSION@
DEPENDED_PACKAGES="
intltool
libtool
gcc
gcc-c++
make
gperf
readline-devel
openssl-devel
time
wget
ncurses-devel
sudo
pkgconfig
tar
cmake
libaio-devel
systemtap-sdt-devel
perl-Time-HiRes
perl-Env
perl-Test-Simple
pam-devel
selinux-policy-devel
groonga-devel
groonga-normalizer-mysql-devel
"
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESTINATION DISTRIBUTIONS"
echo " e.g.: $0 'F10399C0' repositories/ 'fedora centos'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
DISTRIBUTIONS=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
unsigned_rpms()
{
while read rpm; do
rpm --checksig "$rpm" | grep -v 'gpg OK' | grep -v 'MISSING KEYS' | cut -d":" -f1
done
}
if ! gpg --list-keys "${GPG_UID}" > /dev/null 2>&1; then
run gpg --keyserver keyserver.ubuntu.com --recv-key "${GPG_UID}"
fi
run mkdir -p tmp
run gpg --armor --export "${GPG_UID}" > tmp/sign-key
run rpm --import tmp/sign-key
run rm -rf tmp/sign-key
rpms=""
for distribution in ${DISTRIBUTIONS}; do
rpms="${rpms} $(find ${DESTINATION}${distribution} -name '*.rpm' | unsigned_rpms)"
done
echo "NOTE: YOU JUST ENTER! YOU DON'T NEED TO INPUT PASSWORD!"
echo " IT'S JUST FOR rpm COMMAND RESTRICTION!"
run echo $rpms | xargs rpm \
-D "_gpg_name ${GPG_UID}" \
-D "_gpg_digest_algo sha1" \
-D "__gpg /usr/bin/gpg2" \
-D "__gpg_check_password_cmd /bin/true true" \
-D "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" \
--resign
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 2 ]; then
echo "Usage: $0 DESTINATION DISTRIBUTIONS"
echo " e.g.: $0 repositories/ 'fedora centos'"
exit 1
fi
DESTINATION=$1
DISTRIBUTIONS=$2
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for distribution in ${DISTRIBUTIONS}; do
for dir in ${DESTINATION}${distribution}/*/*; do
# "--checksum sha" is for CentOS 5. If we drop CentOS 5 support,
# we can remove the option.
test -d $dir && run createrepo --checksum sha $dir
done;
done
# -*- autoconf -*-
AC_CHECK_FUNCS(_gmtime64_s)
AC_CHECK_FUNCS(_localtime64_s)
AC_CHECK_FUNCS(_stricmp)
AC_CHECK_FUNCS(_strnicmp)
AC_CHECK_FUNCS(_strtoui64)
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(strtoull)
# -*- autoconf -*-
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_HEADERS(inttypes.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(signal.h)
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/sysctl.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(ucontext.h)
AC_CHECK_HEADERS(unistd.h)
# Copyright(C) 2012 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
macro(read_file_list file_name output_variable)
file(READ ${file_name} ${output_variable})
# Remove variable declaration at the first line:
# "libgroonga_la_SOURCES = \" -> ""
string(REGEX REPLACE "^.*=[ \t]*\\\\" ""
${output_variable} "${${output_variable}}")
# Remove white spaces: " com.c \\\n com.h \\\n" -> "com.c\\com.h"
string(REGEX REPLACE "[ \t\n]" "" ${output_variable} "${${output_variable}}")
# Convert string to list: "com.c\\com.h" -> "com.c;com.h"
# NOTE: List in CMake is ";" separated string.
string(REGEX REPLACE "\\\\" ";" ${output_variable} "${${output_variable}}")
endmacro()
BUILT_SOURCES =
EXTRA_DIST =
SUFFIXES =
include $(top_srcdir)/build/makefiles/gettext.am
include $(top_srcdir)/doc/files.am
include $(top_srcdir)/build/makefiles/sphinx-build.am
CLEANFILES =
EXTRA_DIST += \
$(po_files)
if DOCUMENT_AVAILABLE
EXTRA_DIST += \
$(mo_files)
endif
if DOCUMENT_BUILDABLE
BUILT_SOURCES += \
mo-build-stamp
CLEANFILES += \
pot-build-stamp \
edit-po-build-stamp \
mo-build-stamp
endif
SUFFIXES += .pot .po .mo .edit
.PHONY: gettext update build
.pot.edit:
if test -f $*.po; then \
msgmerge \
--quiet \
--sort-by-file \
--output-file=$@.tmp \
$*.po \
$<; \
else \
msginit \
--input=$< \
--output-file=$@.tmp \
--locale=$(LOCALE) \
--no-translator; \
fi
(echo "# -*- po -*-"; \
GREP_OPTIONS= grep -v '^# -\*- po -\*-' $@.tmp | \
GREP_OPTIONS= grep -v '^"POT-Creation-Date:') > $@
rm $@.tmp
.edit.po:
msgcat --no-location --output $@ $<
.po.mo:
msgfmt -o $@ $<
if DOCUMENT_BUILDABLE
update: edit-po-build-stamp
build: mo-build-stamp
else
update:
build:
endif
html: build
man: build
pdf: build
gettext:
rm *.pot || true
$(SPHINX_BUILD_COMMAND) -d doctrees -b gettext $(ALLSPHINXOPTS) .
xgettext --language Python --output conf.pot \
$(top_srcdir)/doc/source/conf.py
pot-build-stamp: $(absolute_source_files)
$(MAKE) gettext
@touch $@
edit-po-build-stamp: pot-build-stamp
$(MAKE) $(edit_po_files)
@touch $@
mo_build_stamp_dependencies = edit-po-build-stamp
if DOCUMENT_BUILDABLE
mo_build_stamp_dependencies += $(edit_po_files)
endif
mo-build-stamp: $(mo_build_stamp_dependencies)
$(MAKE) $(mo_files)
@touch $@
SUBDIRS = LC_MESSAGES
BUILT_SOURCES =
EXTRA_DIST =
include $(top_srcdir)/build/makefiles/sphinx.am
init:
cd LC_MESSAGES && $(MAKE) $@
update-po:
cd LC_MESSAGES && $(MAKE) update
# You can set these variables from the command line.
DOCTREES_BASE = doctrees
SPHINXOPTS =
PAPER =
# Internal variables.
SOURCE_DIR = $(abs_top_srcdir)/doc/source
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR)
SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
SPHINX_BUILD_COMMAND = \
DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \
DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \
LOCALE="$(LOCALE)" \
PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \
$(SPHINX_BUILD)
include $(top_srcdir)/doc/files.am
include $(top_srcdir)/build/makefiles/sphinx-build.am
$(html_files): html-build-stamp
$(html_files_relative_from_locale_dir): html-build-stamp
$(man_files): man-build-stamp
am__nobase_dist_doc_locale_DATA_DIST =
if DOCUMENT_AVAILABLE
doc_localedir = $(docdir)/$(LOCALE)
nobase_dist_doc_locale_DATA = \
$(html_files_relative_from_locale_dir)
am__nobase_dist_doc_locale_DATA_DIST += \
$(nobase_dist_doc_locale_DATA)
endif
document_source_files = \
$(absolute_source_files) \
$(absolute_theme_files) \
$(po_files_relative_from_locale_dir) \
$(mo_files_relative_from_locale_dir)
required_build_stamps = \
html-build-stamp \
man-build-stamp \
mo-build-stamp
if DOCUMENT_BUILDABLE
EXTRA_DIST += $(required_build_stamps)
endif
man_files = \
man/$(PACKAGE_NAME).1
generated_files = \
$(DOCTREES_BASE) \
man \
man-build-stamp \
html \
html-build-stamp \
pdf \
pdf-build-stamp \
dirhtml \
dirhtml-build-stamp \
pickle \
pikcle-build-stamp \
json \
json-build-stamp \
htmlhelp \
htmlhelp-build-stamp \
qthelp \
qthelp-build-stamp \
latex \
latex-build-stamp \
changes \
changes-build-stamp \
linkcheck \
linkcheck-build-stamp \
doctest
$(mo_files_relative_from_locale_dir): mo-build-stamp
mo-build-stamp: $(po_files_relative_from_locale_dir)
cd LC_MESSAGES && $(MAKE) build
@touch $@
if DOCUMENT_BUILDABLE
clean-local: $(clean_targets) clean-doctrees
clean-doctrees:
rm -rf $(DOCTREES_BASE)
maintainer-clean-local:
rm -rf -- $(generated_files)
endif
.PHONY: help
.PHONY: man clean-man
.PHONY: html clean-html
.PHONY: pdf
.PHONY: dirhtml
.PHONY: pickle
.PHONY: json
.PHONY: htmlhelp
.PHONY: qthelp
.PHONY: latex
.PHONY: changes
.PHONY: linkcheck
.PHONY: doctest
if DOCUMENT_BUILDABLE
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " man to make man files"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " rdoc to make RDoc files"
@echo " textile to make Textile files"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
man: man-build-stamp
html: html-recursive html-build-stamp
dirhtml: dirhtml-build-stamp
pickle: pickle-build-stamp
json: json-build-stamp
htmlhelp: htmlhelp-build-stamp
qthelp: qthelp-build-stamp
latex: latex-build-stamp
rdoc: rdoc-build-stamp
textile: textile-build-stamp
changes: changes-build-stamp
linkcheck: linkcheck-build-stamp
doctest: doctest-build-stamp
clean_targets = \
clean-man \
clean-html \
clean-dirhtml \
clean-pickle \
clean-json \
clean-htmlhelp \
clean-qthelp \
clean-latex \
clean-rdoc \
clean-textile \
clean-changes \
clean-linkcheck \
clean-doctest
$(clean_targets):
target=`echo $@ | sed -e 's/^clean-//'`; \
rm -rf $${target}-build-stamp $${target}
build_stamps = \
man-build-stamp \
html-build-stamp \
dirhtml-build-stamp \
pickle-build-stamp \
json-build-stamp \
htmlhelp-build-stamp \
qthelp-build-stamp \
latex-build-stamp \
rdoc-build-stamp \
textile-build-stamp \
changes-build-stamp \
linkcheck-build-stamp \
doctest-build-stamp
$(build_stamps): $(document_source_files)
target=`echo $@ | sed -e 's/-build-stamp$$//'`; \
$(SPHINX_BUILD_COMMAND) \
-Dlanguage=$(LOCALE) \
-d $(DOCTREES_BASE)/$${target} \
-b $${target} \
$(ALLSPHINXOPTS) \
$${target}
@touch $@
qthelp: qthelp-message
qthelp-message: qthelp-build-stamp
@echo "Build finished; now you can run 'qcollectiongenerator' with the" \
".qhcp project file in qthelp/*, like this:"
@echo "# qcollectiongenerator qthelp/groonga.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile qthelp/groonga.qhc"
latex: latex-message
latex-message: latex-build-stamp
@echo "Build finished; the LaTeX files are in latex/*."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
endif
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
SUBDIRS = \
cmake_modules
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
EXTRA_DIST = \
ReadFileList.cmake
# Copyright(C) 2012 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
macro(read_file_list file_name output_variable)
file(READ ${file_name} ${output_variable})
# Remove variable declaration at the first line:
# "libgroonga_la_SOURCES = \" -> ""
string(REGEX REPLACE "^.*=[ \t]*\\\\" ""
${output_variable} "${${output_variable}}")
# Remove white spaces: " com.c \\\n com.h \\\n" -> "com.c\\com.h"
string(REGEX REPLACE "[ \t\n]" "" ${output_variable} "${${output_variable}}")
# Convert string to list: "com.c\\com.h" -> "com.c;com.h"
# NOTE: List in CMake is ";" separated string.
string(REGEX REPLACE "\\\\" ";" ${output_variable} "${${output_variable}}")
endmacro()
REPOSITORIES_PATH = repositories
DISTRIBUTIONS = debian
ARCHITECTURES = i386 amd64
CODE_NAMES = wheezy jessie
all:
release: build sign-packages update-repository sign-repository upload
remove-existing-packages:
for distribution in $(DISTRIBUTIONS); do \
find $(REPOSITORIES_PATH)/$${distribution}/pool \
-type f -delete; \
done
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
download: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete \
$(RSYNC_PATH)/$${distribution} \
${REPOSITORIES_PATH}/; \
done
sign-packages:
./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
update-repository:
./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
'$(ARCHITECTURES)' '$(CODE_NAMES)'
sign-repository:
./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
(cd $(REPOSITORIES_PATH)/$${distribution}; \
rsync -avz --progress --delete \
dists pool $(RSYNC_PATH)/$${distribution}); \
done
build: build-package-deb
build-package-deb: prepare-build-package-deb
vagrant destroy --force
for architecture in $(ARCHITECTURES); do \
for code_name in $(CODE_NAMES); do \
id=debian-$$code_name-$$architecture; \
vagrant up $$id || exit 1; \
vagrant destroy --force $$id; \
done; \
done
prepare-build-package-deb: source env.sh
cp env.sh tmp/
rm -rf tmp/debian
cp -rp $(srcdir)/../debian tmp/
source: tmp/$(PACKAGE)-$(VERSION).tar.gz
tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
mkdir -p tmp
cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = [
{
:id => "debian-wheezy-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8-i386_chef-provisionerless.box",
},
{
:id => "debian-wheezy-amd64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.8_chef-provisionerless.box",
},
{
:id => "debian-jessie-i386",
:box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0-i386_chef-provisionerless.box",
},
{
:id => "debian-jessie-amd64",
:box_url => "http://packages.groonga.org/tmp/opscode_debian-8.0_chef-provisionerless.box",
},
]
vms.each do |vm|
config.vm.define(vm[:id]) do |node|
node.vm.box = vm[:id]
node.vm.box_url = vm[:box_url]
node.vm.provision(:shell, :path => "build-deb.sh")
end
end
end
#!/bin/sh
LANG=C
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
. /vagrant/tmp/env.sh
run apt-get update
run apt-get install -y lsb-release
distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
code_name=$(lsb_release --codename --short)
case "${distribution}" in
debian)
component=main
run cat <<EOF > /etc/apt/sources.list.d/groonga.list
deb http://packages.groonga.org/debian/ ${code_name} main
deb-src http://packages.groonga.org/debian/ ${code_name} main
EOF
run apt-get update
run apt-get install -y --allow-unauthenticated groonga-keyring
run apt-get update
;;
ubuntu)
component=universe
run apt-get -y install software-properties-common
run add-apt-repository -y universe
run add-apt-repository -y ppa:groonga/ppa
run apt-get update
;;
esac
run apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
run mkdir -p build
run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
build/${PACKAGE}_${VERSION}.orig.tar.gz
run cd build
run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
run cd ${PACKAGE}-${VERSION}/
run cp -rp /vagrant/tmp/debian debian
# export DEB_BUILD_OPTIONS=noopt
run debuild -us -uc
run cd -
package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
run mkdir -p "${pool_dir}/"
run cp *.tar.* *.dsc *.deb "${pool_dir}/"
PACKAGE=@PACKAGE@
VERSION=@VERSION@
DEPENDED_PACKAGES="
debhelper
autotools-dev
pkg-config
libgroonga-dev
"
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESITINATION CODES"
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
CODES=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
;;
*)
distribution=ubuntu
;;
esac
base_directory=${DESTINATION}${distribution}
debsign -pgpg2 --re-sign -k${GPG_UID} \
$(find ${base_directory} -name '*.dsc' -or -name '*.changes') &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESTINATION CODES"
echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
CODES=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
;;
*)
distribution=ubuntu
;;
esac
release=${DESTINATION}${distribution}/dists/${code_name}/Release
rm -f ${release}.gpg
gpg2 --sign --detach-sign --armor \
--local-user ${GPG_UID} \
--output ${release}.gpg \
${release} &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 4 ]; then
echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES"
echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'"
exit 1
fi
PROJECT_NAME=$1
DESTINATION=$2
ARCHITECTURES=$3
CODES=$4
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
update_repository()
{
distribution=$1
code_name=$2
component=$3
rm -rf dists/${code_name}
mkdir -p dists/${code_name}/${component}/binary-i386/
mkdir -p dists/${code_name}/${component}/binary-amd64/
mkdir -p dists/${code_name}/${component}/source/
cat <<EOF > dists/.htaccess
Options +Indexes
EOF
cat <<EOF > dists/${code_name}/${component}/binary-i386/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: i386
EOF
cat <<EOF > dists/${code_name}/${component}/binary-amd64/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: amd64
EOF
cat <<EOF > dists/${code_name}/${component}/source/Release
Archive: ${code_name}
Component: ${component}
Origin: The ${PROJECT_NAME} project
Label: The ${PROJECT_NAME} project
Architecture: source
EOF
cat <<EOF > generate-${code_name}.conf
Dir::ArchiveDir ".";
Dir::CacheDir ".";
TreeDefault::Directory "pool/${code_name}/${component}";
TreeDefault::SrcDirectory "pool/${code_name}/${component}";
Default::Packages::Extensions ".deb";
Default::Packages::Compress ". gzip bzip2";
Default::Sources::Compress ". gzip bzip2";
Default::Contents::Compress "gzip bzip2";
BinDirectory "dists/${code_name}/${component}/binary-i386" {
Packages "dists/${code_name}/${component}/binary-i386/Packages";
Contents "dists/${code_name}/Contents-i386";
SrcPackages "dists/${code_name}/${component}/source/Sources";
};
BinDirectory "dists/${code_name}/${component}/binary-amd64" {
Packages "dists/${code_name}/${component}/binary-amd64/Packages";
Contents "dists/${code_name}/Contents-amd64";
SrcPackages "dists/${code_name}/${component}/source/Sources";
};
Tree "dists/${code_name}" {
Sections "${component}";
Architectures "i386 amd64 source";
};
EOF
apt-ftparchive generate generate-${code_name}.conf
chmod 644 dists/${code_name}/Contents-*
rm -f dists/${code_name}/Release*
rm -f *.db
cat <<EOF > release-${code_name}.conf
APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project";
APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project";
APT::FTPArchive::Release::Architectures "i386 amd64";
APT::FTPArchive::Release::Codename "${code_name}";
APT::FTPArchive::Release::Suite "${code_name}";
APT::FTPArchive::Release::Components "${component}";
APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages";
EOF
apt-ftparchive -c release-${code_name}.conf \
release dists/${code_name} > /tmp/Release
mv /tmp/Release dists/${code_name}
}
for code_name in ${CODES}; do
case ${code_name} in
squeeze|wheezy|jessie|unstable)
distribution=debian
component=main
;;
*)
distribution=ubuntu
component=universe
;;
esac
mkdir -p ${DESTINATION}${distribution}
(cd ${DESTINATION}${distribution}
update_repository $distribution $code_name $component) &
if [ "${PARALLEL}" != "yes" ]; then
wait
fi
done
wait
groonga-normalizer-mysql (1.1.0-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Fri, 29 May 2015 00:00:00 +0900
groonga-normalizer-mysql (1.0.9-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Mar 2015 00:00:00 +0900
groonga-normalizer-mysql (1.0.8-1) unstable; urgency=low
* New upstream release.
-- Kouhei Sutou <kou@clear-code.com> Tue, 10 Feb 2015 00:00:00 +0900
groonga-normalizer-mysql (1.0.7-1) unstable; urgency=low
* New upstream release.
-- <hayashi@clear-code.com> Mon, 09 Feb 2015 00:00:00 +0900
groonga-normalizer-mysql (1.0.6-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 09 Feb 2014 00:00:00 +0900
groonga-normalizer-mysql (1.0.5-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Jun 2013 00:00:00 +0900
groonga-normalizer-mysql (1.0.4-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 May 2013 00:00:00 +0900
groonga-normalizer-mysql (1.0.3-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Apr 2013 00:00:00 +0900
groonga-normalizer-mysql (1.0.2-1) unstable; urgency=low
* New upstream release.
-- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 00:00:00 +0900
groonga-normalizer-mysql (1.0.1) unstable; urgency=low
* New upstream release
-- khayashi <hayashi@clear-code.com> Thu, 28 Feb 2013 00:00:00 +0900
groonga-normalizer-mysql (1.0.0-1) unstable; urgency=low
* Initial release
-- Kouhei Sutou <kou@clear-code.com> Sat, 9 Feb 2013 00:00:00 +0900
Source: groonga-normalizer-mysql
Section: libs
Priority: optional
Maintainer: Groonga Project <packages@groonga.org>
Build-Depends:
debhelper (>= 9),
autotools-dev,
pkg-config,
libgroonga-dev (>= 3.0.0)
Standards-Version: 3.9.3
Homepage: https://github.com/groonga/groonga-normalizer-mysql
Package: groonga-normalizer-mysql
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
libgroonga0
Description: MySQL derived normalizer for Groonga
Groonga is an open-source fulltext search engine and column store.
It lets you write high-performance applications that requires fulltext
search.
.
This package provides a normalizer which normalizes text as same as
MySQL does.
.
Groonga has its own normalizers by default, but that behavior is a bit
defferent from MySQL does, so as a result, it affects search results.
These normalizers are useful if you regards it important for keeping
normalizer compatibility with MySQL in Mroonga which uses Groonga as
storage engine.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Contact: Kouhei Sutou <kou at clear-code.com>
Source: http://packages.groonga.org/source/groonga-normalizer-mysql/
Files: *
Copyright: 2013 Kouhei Sutou <kou@clear-code.com>
License: LGPL-2
Files: debian/*
Copyright: 2013 Kouhei Sutou <kou@clear-code.com>
2013 HAYASHI Kentaro <hayashi@clear-code.com>
License: LGPL-2
Files: test/run-test.sh
Copyright: 2013 Kouhei Sutou <kou@clear-code.com>
License: LGPL-2+
Files: normalizers/mysql_general_ci_table.h
Copyright: 2013 Kouhei Sutou <kou@clear-code.com>
2000, 2012, Oracle and/or its affiliates
License: LGPL-2
Files: normalizers/mysql_unicode_ci_*.h
Copyright: 2013 Kouhei Sutou <kou@clear-code.com>
2004, 2011, Oracle and/or its affiliates
License: LGPL-2
Files: ltmain.sh
Copyright: 1996, Gordon Matzigkeit <gord@gnu.ai.mit.edu>
1996-2011, Free Software Foundation, Inc.
License: GPL-2+ with Libtool exception
GNU Libtool is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
As a special exception to the GNU General Public License,
if you distribute this file as part of a program or library that
is built using GNU Libtool, you may include this file under the
same distribution terms that you use for the rest of that program.
.
GNU Libtool is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with GNU Libtool; see the file COPYING. If not, a copy
can be downloaded from http://www.gnu.org/licenses/gpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
License: LGPL-2
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, version 2 of the License.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
The Debian packaging is (C) 2013, Kouhei Sutou <kou@clear-code.com> and
is licensed under the LGPL-2, see `/usr/share/common-licenses/LGPL-2'.
License: LGPL-2+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian systems, the full text of the GNU Library General Public
License version 2 can be found in the file `/usr/share/common-licenses/LGPL-2'.
#!/usr/bin/make -f
# -*- makefile-gmake -*-
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
%:
dh $@
# disable 'make check'.
override_dh_auto_test:
override_dh_install:
find $(CURDIR) -name '*.la' -delete
find $(CURDIR) -name 'lgpl-2.0.txt' -delete
version=3
http://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-(.+).tar.gz
%global _initddir %{_sysconfdir}/init.d/
Name: groonga-normalizer-mysql
Version: @VERSION@
Release: 1%{?dist}
Summary: MySQL compatible normalizer plugin for groonga
Group: Applications/Text
License: LGPLv2
URL: http://groonga.org/
Source0: http://packages.groonga.org/source/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires: groonga-devel >= 3.0.3
Requires: groonga-libs >= 3.0.3
%description
This package provides MySQL compatible normalizer plugin.
You can use NormalizerMySQLGeneralCI and NormalizerMySQLUnicodeCI as normalizer.
%package devel
Summary: Development files for groonga-normalizer-mysql
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package provides development files for groonga-normalizer-mysql.
%prep
%setup -q
%build
%configure \
--disable-static
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm $RPM_BUILD_ROOT%{_libdir}/groonga/plugins/*/*.la
%files
%dir %{_libdir}/groonga
%dir %{_libdir}/groonga/plugins
%dir %{_libdir}/groonga/plugins/normalizers
%{_libdir}/groonga/plugins/normalizers/mysql.so
%{_datadir}/doc/groonga-normalizer-mysql/
%files devel
%{_libdir}/pkgconfig/groonga-normalizer-mysql.pc
%changelog
* Fri May 29 2015 Kouhei Sutou <kou@clear-code.com> - 1.1.0-1
- new upstream release.
* Sun Mar 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.9-1
- new upstream release.
* Tue Feb 10 2015 Kouhei Sutou <kou@clear-code.com> - 1.0.8-1
- new upstream release.
* Mon Feb 09 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.7-1
- new upstream release.
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.6-1
- new upstream release.
* Sat Jun 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.5-1
- new upstream release.
* Wed May 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.4-1
- new upstream release.
* Mon Apr 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.3-0
- new upstream release.
- Reduce required packages. groonga-libs is only required.
- Require groonga 3.0.3 or later.
- Split development files into -devel package.
* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.2-0
- new upstream release.
* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.1-0
- new upstream release
* Tue Jan 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.0-0
- initial packaging for CentOS
%global __provides_exclude_from ^%{_libdir}/groonga/plugins/normalizers/mysql\\.so$
Name: groonga-normalizer-mysql
Version: @VERSION@
Release: 1%{?dist}
Summary: MySQL compatible normalizer plugin for groonga
Group: Applications/Text
License: LGPLv2
URL: http://groonga.org/
Source0: http://packages.groonga.org/source/%{name}/%{name}-%{version}.tar.gz
BuildRequires: groonga-devel >= 3.0.3
Requires: groonga-libs >= 3.0.3
ExclusiveArch: %{ix86} x86_64
%description
This package provides MySQL compatible normalizer plugin.
You can use NormalizerMySQLGeneralCI and NormalizerMySQLUnicodeCI as normalizer.
%package devel
Summary: Development files for groonga-normalizer-mysql
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package provides development files for groonga-normalizer-mysql.
%prep
%setup -q
%build
%configure \
--disable-static
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm $RPM_BUILD_ROOT%{_libdir}/groonga/plugins/*/*.la
%files
%dir %{_libdir}/groonga
%dir %{_libdir}/groonga/plugins
%dir %{_libdir}/groonga/plugins/normalizers
%{_libdir}/groonga/plugins/normalizers/mysql.so
%{_datadir}/doc/groonga-normalizer-mysql/
%files devel
%{_libdir}/pkgconfig/groonga-normalizer-mysql.pc
%changelog
* Fri May 29 2015 Kouhei Sutou <kou@clear-code.com> - 1.1.0-1
- new upstream release.
* Sun Mar 29 2015 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.9-1
- new upstream release.
* Tue Feb 10 2015 Kouhei Sutou <kou@clear-code.com> - 1.0.8-1
- new upstream release.
* Mon Feb 09 2015 <hayashi@clear-code.com> - 1.0.7-1
- new upstream release.
* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.6-1
- new upstream release.
* Sat Jun 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.5-1
- new upstream release.
* Wed May 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.4-1
- new upstream release.
* Mon Apr 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.3-1
- new upstream release.
- Reduce required packages. groonga-libs is only required.
- Require groonga 3.0.3 or later.
- Split development files into -devel package.
* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.2-0
- new upstream release.
* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.1-1
- new upstream release
* Tue Jan 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 1.0.0-1
- initial packaging for Fedora
all:
release: upload
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
download: ensure-rsync-path
rsync -avz --progress $(RSYNC_PATH)/source/groonga-normalizer-mysql/ files
upload: ensure-rsync-path files/$(PACKAGE)-$(VERSION).tar.gz files/$(PACKAGE)-$(VERSION).zip
rsync -avz --progress --delete files/ $(RSYNC_PATH)/source/groonga-normalizer-mysql
files/$(PACKAGE)-$(VERSION).tar.gz: $(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
mkdir -p files
cp -p $< $@
files/$(PACKAGE)-$(VERSION).zip: files/$(PACKAGE)-$(VERSION).tar.gz
rm -rf $(PACKAGE)-$(VERSION)
tar xvzf files/$(PACKAGE)-$(VERSION).tar.gz
zip -r $@ $(PACKAGE)-$(VERSION)
rm -rf $(PACKAGE)-$(VERSION)
CODE_NAMES = precise,trusty,utopic,vivid
SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz
all:
ensure-configuration:
@if test -z "$(LAUNCHPAD_UPLOADER_PGP_KEY)"; then \
echo "--with-launchpad-uploader-pgp-key configure option must be specified."; \
false; \
fi
@if test -z "$(GROONGA_SOURCE_PATH)"; then \
echo "--with-groonga-source-path configure option must be specified."; \
false; \
fi
upload: source ensure-configuration
$(GROONGA_SOURCE_PATH)/packages/ubuntu/upload.rb \
--package '$(PACKAGE)' \
--version '$(VERSION)' \
--source-archive '$(SOURCE)' \
--code-names '$(CODE_NAMES)' \
--debian-directory '$(srcdir)/../debian/' \
--pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)'
source: $(SOURCE)
$(SOURCE):
ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE)
REPOSITORIES_PATH = repositories
DISTRIBUTIONS = centos
ARCHITECTURES = i386 x86_64
release: download build sign-packages update-repository upload
ensure-rsync-path:
@if test -z "$(RSYNC_PATH)"; then \
echo "--with-rsync-path configure option must be specified."; \
false; \
fi
sign-packages:
./sign-rpm.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' \
'$(DISTRIBUTIONS)'
update-repository: RPM-GPG-KEY-$(PACKAGE)
./update-repository.sh '$(PACKAGE)' '$(REPOSITORIES_PATH)/' \
'$(DISTRIBUTIONS)'
upload: ensure-rsync-path
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete --exclude .gitignore \
$(REPOSITORIES_PATH)/$${distribution}/ \
$(RSYNC_PATH)/$${distribution}; \
done
download: ensure-rsync-path
mkdir -p $(REPOSITORIES_PATH)
for distribution in $(DISTRIBUTIONS); do \
rsync -avz --progress --delete \
$(RSYNC_PATH)/$${distribution}/ \
$(REPOSITORIES_PATH)/$${distribution}; \
done
build: build-in-vm
build-in-vm: source specs env.sh
vagrant destroy --force
for architecture in $(ARCHITECTURES); do \
for version in 5 6 7; do \
if [ $$version = 7 -a $$architecture = i386 ]; then \
continue; \
fi; \
id=centos-$$version-$$architecture; \
vagrant up $$id; \
vagrant destroy --force $$id; \
done; \
done
ensure-public-key:
gpg --list-keys '$(GPG_UID)' > /dev/null || \
gpg --keyserver keyserver.ubuntu.com --recv-key '$(GPG_UID)'
RPM-GPG-KEY-$(PACKAGE): ensure-public-key
gpg --armor --export '$(GPG_UID)' > $@
source: tmp/$(PACKAGE)-$(VERSION).tar.gz
tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
mkdir -p tmp/
cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz tmp/
$(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz:
cd $(abs_top_builddir) && $(MAKE) dist
specs: tmp/centos/$(PACKAGE).spec
tmp/centos/$(PACKAGE).spec: $(builddir)/../rpm/centos/$(PACKAGE).spec
mkdir -p tmp/centos
cp $(builddir)/../rpm/centos/$(PACKAGE).spec tmp/centos/
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = [
{
:id => "centos-5-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11-i386_chef-provisionerless.box",
},
{
:id => "centos-5-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.11_chef-provisionerless.box",
},
{
:id => "centos-6-i386",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6-i386_chef-provisionerless.box",
},
{
:id => "centos-6-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.6_chef-provisionerless.box",
},
{
:id => "centos-7-x86_64",
:box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box",
},
]
vms.each do |vm|
config.vm.define(vm[:id]) do |node|
node.vm.box = vm[:id]
node.vm.box_url = vm[:box_url]
node.vm.provision(:shell, :path => "build-rpm.sh")
end
end
end
#!/bin/sh
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
rpmbuild_options=
. /vagrant/env.sh
distribution=$(cut -d " " -f 1 /etc/redhat-release | tr "A-Z" "a-z")
if grep -q Linux /etc/redhat-release; then
distribution_version=$(cut -d " " -f 4 /etc/redhat-release)
else
distribution_version=$(cut -d " " -f 3 /etc/redhat-release)
fi
distribution_version=$(echo ${distribution_version} | sed -e 's/\..*$//g')
architecture="$(arch)"
case "${architecture}" in
i*86)
architecture=i386
;;
esac
run rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
run yum makecache
run yum groupinstall -y "Development Tools"
run yum install -y rpm-build rpmdevtools tar ${DEPENDED_PACKAGES}
if [ -x /usr/bin/rpmdev-setuptree ]; then
rm -rf .rpmmacros
run rpmdev-setuptree
else
run cat <<EOM > ~/.rpmmacros
%_topdir ${HOME}/rpmbuild
EOM
run mkdir -p ~/rpmbuild/SOURCES
run mkdir -p ~/rpmbuild/SPECS
run mkdir -p ~/rpmbuild/BUILD
run mkdir -p ~/rpmbuild/RPMS
run mkdir -p ~/rpmbuild/SRPMS
fi
repository="/vagrant/repositories/${distribution}/${distribution_version}"
rpm_dir="${repository}/${architecture}/Packages"
srpm_dir="${repository}/source/SRPMS"
run mkdir -p "${rpm_dir}" "${srpm_dir}"
# for debug
# rpmbuild_options="$rpmbuild_options --define 'optflags -O0 -g3'"
cd
run cp /vagrant/tmp/${PACKAGE}-${VERSION}.* rpmbuild/SOURCES/
run cp /vagrant/tmp/${distribution}/${PACKAGE}.spec rpmbuild/SPECS/
run rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${PACKAGE}.spec
run mv rpmbuild/RPMS/*/* "${rpm_dir}/"
run mv rpmbuild/SRPMS/* "${srpm_dir}/"
PACKAGE=@PACKAGE@
VERSION=@VERSION@
DEPENDED_PACKAGES="
intltool
libtool
gcc
gcc-c++
make
tar
groonga-devel
"
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_UID DESTINATION DISTRIBUTIONS"
echo " e.g.: $0 'F10399C0' repositories/ 'fedora centos'"
exit 1
fi
GPG_UID=$1
DESTINATION=$2
DISTRIBUTIONS=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
rpms=""
for distribution in ${DISTRIBUTIONS}; do
rpms="${rpms} $(echo ${DESTINATION}${distribution}/*/*/*/*.rpm)"
done
echo "NOTE: YOU JUST ENTER! YOU DON'T NEED TO INPUT PASSWORD!"
echo " IT'S JUST FOR rpm COMMAND RESTRICTION!"
run echo $rpms | xargs rpm \
-D "_gpg_name ${GPG_UID}" \
-D "_gpg_digest_algo sha1" \
-D "__gpg /usr/bin/gpg2" \
-D "__gpg_check_password_cmd /bin/true true" \
-D "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" \
--resign
#!/bin/sh
script_base_dir=`dirname $0`
if [ $# != 3 ]; then
echo "Usage: $0 GPG_KEY_NAME DESTINATION DISTRIBUTIONS"
echo " e.g.: $0 mitler-manager repositories/ 'fedora centos'"
exit 1
fi
GPG_KEY_NAME=$1
DESTINATION=$2
DISTRIBUTIONS=$3
run()
{
"$@"
if test $? -ne 0; then
echo "Failed $@"
exit 1
fi
}
for distribution in ${DISTRIBUTIONS}; do
for dir in ${DESTINATION}${distribution}/*/*; do
# "--checksum sha" is for CentOS 5. If we drop CentOS 5 support,
# we can remove the option.
test -d $dir && run createrepo --checksum sha $dir
done;
run cp $script_base_dir/RPM-GPG-KEY-${GPG_KEY_NAME} \
${DESTINATION}${distribution}/RPM-GPG-KEY-${GPG_KEY_NAME};
done
myisamchk: MyISAM file test1
myisamchk: warning: Size of indexfile is: 1024 Should be: 2048
MyISAM-table 'test1' is usable but should be fixed
mi_test2 -s -L -K -R1 -m2000 ; Should give error 135
Error: 135 in write at record: 1105
got error: 135 when using MyISAM-database
myisamchk: MyISAM file test2
myisamchk: warning: Datafile is almost full, 65532 of 65534 used
MyISAM-table 'test2' is usable but should be fixed
Commands Used count Errors Recover errors
open 7 0 0
write 350 0 0
update 35 0 0
delete 350 0 0
close 7 0 0
extra 42 0 0
Total 791 0 0
Commands Used count Errors Recover errors
open 8 0 0
write 400 0 0
update 40 0 0
delete 400 0 0
close 8 0 0
extra 48 0 0
Total 904 0 0
real 0m0.221s
user 0m0.120s
sys 0m0.100s
real 0m0.222s
user 0m0.140s
sys 0m0.084s
real 0m0.232s
user 0m0.112s
sys 0m0.120s
real 0m0.163s
user 0m0.116s
sys 0m0.036s
real 0m0.159s
user 0m0.136s
sys 0m0.020s
real 0m0.147s
user 0m0.132s
sys 0m0.016s
real 0m0.211s
user 0m0.124s
sys 0m0.088s
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
##
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
noinst_PROGRAMS = \
repeat \
sync_flush \
full_flush \
memusage \
crc32 \
known_sizes \
hex2bin
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/liblzma/api \
$(STATIC_CPPFLAGS)
AM_LDFLAGS = $(STATIC_LDFLAGS)
LDADD = $(top_builddir)/src/liblzma/liblzma.la
if COND_GNULIB
LDADD += $(top_builddir)/lib/libgnu.a
endif
LDADD += $(LTLIBINTL)
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = repeat$(EXEEXT) sync_flush$(EXEEXT) \
full_flush$(EXEEXT) memusage$(EXEEXT) crc32$(EXEEXT) \
known_sizes$(EXEEXT) hex2bin$(EXEEXT)
@COND_GNULIB_TRUE@am__append_1 = $(top_builddir)/lib/libgnu.a
subdir = debug
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lc_cpucores.m4 \
$(top_srcdir)/m4/lc_physmem.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/visibility.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
crc32_SOURCES = crc32.c
crc32_OBJECTS = crc32.$(OBJEXT)
crc32_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
crc32_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
full_flush_SOURCES = full_flush.c
full_flush_OBJECTS = full_flush.$(OBJEXT)
full_flush_LDADD = $(LDADD)
full_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
hex2bin_SOURCES = hex2bin.c
hex2bin_OBJECTS = hex2bin.$(OBJEXT)
hex2bin_LDADD = $(LDADD)
hex2bin_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
known_sizes_SOURCES = known_sizes.c
known_sizes_OBJECTS = known_sizes.$(OBJEXT)
known_sizes_LDADD = $(LDADD)
known_sizes_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
memusage_SOURCES = memusage.c
memusage_OBJECTS = memusage.$(OBJEXT)
memusage_LDADD = $(LDADD)
memusage_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
repeat_SOURCES = repeat.c
repeat_OBJECTS = repeat.$(OBJEXT)
repeat_LDADD = $(LDADD)
repeat_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
sync_flush_SOURCES = sync_flush.c
sync_flush_OBJECTS = sync_flush.$(OBJEXT)
sync_flush_LDADD = $(LDADD)
sync_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \
$(am__append_1) $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \
repeat.c sync_flush.c
DIST_SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \
repeat.c sync_flush.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
DYNAMIC_CPPFLAGS = @DYNAMIC_CPPFLAGS@
DYNAMIC_LDFLAGS = @DYNAMIC_LDFLAGS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GETOPT_H = @GETOPT_H@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
HAVE_VISIBILITY = @HAVE_VISIBILITY@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_HOMEPAGE = @PACKAGE_HOMEPAGE@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSIX_SHELL = @POSIX_SHELL@
POSUB = @POSUB@
PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATIC_CPPFLAGS = @STATIC_CPPFLAGS@
STATIC_LDFLAGS = @STATIC_LDFLAGS@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
xz = @xz@
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/liblzma/api \
$(STATIC_CPPFLAGS)
AM_LDFLAGS = $(STATIC_LDFLAGS)
LDADD = $(top_builddir)/src/liblzma/liblzma.la $(am__append_1) \
$(LTLIBINTL)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debug/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign debug/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
crc32$(EXEEXT): $(crc32_OBJECTS) $(crc32_DEPENDENCIES)
@rm -f crc32$(EXEEXT)
$(LINK) $(crc32_OBJECTS) $(crc32_LDADD) $(LIBS)
full_flush$(EXEEXT): $(full_flush_OBJECTS) $(full_flush_DEPENDENCIES)
@rm -f full_flush$(EXEEXT)
$(LINK) $(full_flush_OBJECTS) $(full_flush_LDADD) $(LIBS)
hex2bin$(EXEEXT): $(hex2bin_OBJECTS) $(hex2bin_DEPENDENCIES)
@rm -f hex2bin$(EXEEXT)
$(LINK) $(hex2bin_OBJECTS) $(hex2bin_LDADD) $(LIBS)
known_sizes$(EXEEXT): $(known_sizes_OBJECTS) $(known_sizes_DEPENDENCIES)
@rm -f known_sizes$(EXEEXT)
$(LINK) $(known_sizes_OBJECTS) $(known_sizes_LDADD) $(LIBS)
memusage$(EXEEXT): $(memusage_OBJECTS) $(memusage_DEPENDENCIES)
@rm -f memusage$(EXEEXT)
$(LINK) $(memusage_OBJECTS) $(memusage_LDADD) $(LIBS)
repeat$(EXEEXT): $(repeat_OBJECTS) $(repeat_DEPENDENCIES)
@rm -f repeat$(EXEEXT)
$(LINK) $(repeat_OBJECTS) $(repeat_LDADD) $(LIBS)
sync_flush$(EXEEXT): $(sync_flush_OBJECTS) $(sync_flush_DEPENDENCIES)
@rm -f sync_flush$(EXEEXT)
$(LINK) $(sync_flush_OBJECTS) $(sync_flush_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full_flush.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hex2bin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/known_sizes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memusage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_flush.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Debug tools
-----------
This directory contains a few tiny programs that may be helpful when
debugging LZMA Utils.
These tools are not meant to be installed. Often one needs to edit
the source code a little to make the programs do the wanted things.
If you don't know how these programs could help you, it is likely
that they really are useless to you.
These aren't intended to be used as example programs. They take some
shortcuts here and there, which correct programs should not do. Many
possible errors (especially I/O errors) are ignored. Don't report
bugs or send patches to fix this kind of bugs.
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32.c
/// \brief Primitive CRC32 calculation tool
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include <stdio.h>
int
main(void)
{
uint32_t crc = 0;
do {
uint8_t buf[BUFSIZ];
const size_t size = fread(buf, 1, sizeof(buf), stdin);
crc = lzma_crc32(buf, size, crc);
} while (!ferror(stdin) && !feof(stdin));
//printf("%08" PRIX32 "\n", crc);
// I want it little endian so it's easy to work with hex editor.
printf("%02" PRIX32 " ", crc & 0xFF);
printf("%02" PRIX32 " ", (crc >> 8) & 0xFF);
printf("%02" PRIX32 " ", (crc >> 16) & 0xFF);
printf("%02" PRIX32 " ", crc >> 24);
printf("\n");
return 0;
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file full_flush.c
/// \brief Encode files using LZMA_FULL_FLUSH
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in;
static void
encode(size_t size, lzma_action action)
{
static const size_t CHUNK = 64;
uint8_t in[CHUNK];
uint8_t out[CHUNK];
lzma_ret ret;
do {
if (strm.avail_in == 0 && size > 0) {
const size_t amount = MIN(size, CHUNK);
strm.avail_in = fread(in, 1, amount, file_in);
strm.next_in = in;
size -= amount; // Intentionally not using avail_in.
}
strm.next_out = out;
strm.avail_out = CHUNK;
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
} while (size > 0 || strm.avail_out == 0);
if ((action == LZMA_RUN && ret != LZMA_OK)
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
}
int
main(int argc, char **argv)
{
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
// Config
lzma_options_lzma opt_lzma;
if (lzma_lzma_preset(&opt_lzma, 1)) {
fprintf(stderr, "preset failed\n");
exit(1);
}
lzma_filter filters[LZMA_FILTERS_MAX + 1];
filters[0].id = LZMA_FILTER_LZMA2;
filters[0].options = &opt_lzma;
filters[1].id = LZMA_VLI_UNKNOWN;
// Init
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
fprintf(stderr, "init failed\n");
exit(1);
}
// if (lzma_easy_encoder(&strm, 1)) {
// fprintf(stderr, "init failed\n");
// exit(1);
// }
// Encoding
encode(0, LZMA_FULL_FLUSH);
encode(6, LZMA_FULL_FLUSH);
encode(0, LZMA_FULL_FLUSH);
encode(7, LZMA_FULL_FLUSH);
encode(0, LZMA_FULL_FLUSH);
encode(0, LZMA_FINISH);
// Clean up
lzma_end(&strm);
return 0;
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file hex2bin.c
/// \brief Converts hexadecimal input strings to binary
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include <stdio.h>
#include <ctype.h>
static int
getbin(int x)
{
if (x >= '0' && x <= '9')
return x - '0';
if (x >= 'A' && x <= 'F')
return x - 'A' + 10;
return x - 'a' + 10;
}
int
main(void)
{
while (true) {
int byte = getchar();
if (byte == EOF)
return 0;
if (!isxdigit(byte))
continue;
const int digit = getchar();
if (digit == EOF || !isxdigit(digit)) {
fprintf(stderr, "Invalid input\n");
return 1;
}
byte = (getbin(byte) << 4) | getbin(digit);
if (putchar(byte) == EOF) {
perror(NULL);
return 1;
}
}
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file known_sizes.c
/// \brief Encodes .lzma Stream with sizes known in Block Header
///
/// The input file is encoded in RAM, and the known Compressed Size
/// and/or Uncompressed Size values are stored in the Block Header.
/// As of writing there's no such Stream encoder in liblzma.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include <stdio.h>
// Support file sizes up to 1 MiB. We use this for output space too, so files
// close to 1 MiB had better compress at least a little or we have a buffer
// overflow.
#define BUFFER_SIZE (1U << 20)
int
main(void)
{
// Allocate the buffers.
uint8_t *in = malloc(BUFFER_SIZE);
uint8_t *out = malloc(BUFFER_SIZE);
if (in == NULL || out == NULL)
return 1;
// Fill the input buffer.
const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin);
// Filter setup
lzma_options_lzma opt_lzma;
if (lzma_lzma_preset(&opt_lzma, 1))
return 1;
lzma_filter filters[] = {
{
.id = LZMA_FILTER_LZMA2,
.options = &opt_lzma
},
{
.id = LZMA_VLI_UNKNOWN
}
};
lzma_block block = {
.check = LZMA_CHECK_CRC32,
.compressed_size = BUFFER_SIZE, // Worst case reserve
.uncompressed_size = in_size,
.filters = filters,
};
lzma_stream strm = LZMA_STREAM_INIT;
if (lzma_block_encoder(&strm, &block) != LZMA_OK)
return 1;
// Reserve space for Stream Header and Block Header. We need to
// calculate the size of the Block Header first.
if (lzma_block_header_size(&block) != LZMA_OK)
return 1;
size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size;
strm.next_in = in;
strm.avail_in = in_size;
strm.next_out = out + out_size;
strm.avail_out = BUFFER_SIZE - out_size;
if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END)
return 1;
out_size += strm.total_out;
if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE)
!= LZMA_OK)
return 1;
lzma_index *idx = lzma_index_init(NULL, NULL);
if (idx == NULL)
return 1;
if (lzma_index_append(idx, NULL, block.header_size + strm.total_out,
strm.total_in) != LZMA_OK)
return 1;
if (lzma_index_encoder(&strm, idx) != LZMA_OK)
return 1;
if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END)
return 1;
out_size += strm.total_out;
lzma_end(&strm);
lzma_index_end(idx, NULL);
// Encode the Stream Header and Stream Footer. backwards_size is
// needed only for the Stream Footer.
lzma_stream_flags sf = {
.backward_size = strm.total_out,
.check = block.check,
};
if (lzma_stream_header_encode(&sf, out) != LZMA_OK)
return 1;
if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK)
return 1;
out_size += LZMA_STREAM_HEADER_SIZE;
// Write out the file.
fwrite(out, 1, out_size, stdout);
return 0;
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file memusage.c
/// \brief Calculates memory usage using lzma_memory_usage()
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
int
main(void)
{
lzma_options_lzma lzma = {
.dict_size = (1U << 30) + (1U << 29),
.lc = 3,
.lp = 0,
.pb = 2,
.preset_dict = NULL,
.preset_dict_size = 0,
.mode = LZMA_MODE_NORMAL,
.nice_len = 48,
.mf = LZMA_MF_BT4,
.depth = 0,
};
/*
lzma_options_filter filters[] = {
{ LZMA_FILTER_LZMA1,
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
{ UINT64_MAX, NULL }
};
*/
lzma_filter filters[] = {
{ LZMA_FILTER_LZMA1, &lzma },
{ UINT64_MAX, NULL }
};
printf("Encoder: %10" PRIu64 " B\n", lzma_memusage_encoder(filters));
printf("Decoder: %10" PRIu64 " B\n", lzma_memusage_decoder(filters));
return 0;
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file repeat.c
/// \brief Repeats given string given times
///
/// This program can be useful when debugging run-length encoder in
/// the Subblock filter, especially the condition when repeat count
/// doesn't fit into 28-bit integer.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include <stdio.h>
int
main(int argc, char **argv)
{
if (argc != 3) {
fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]);
exit(1);
}
unsigned long long count = strtoull(argv[1], NULL, 10);
const size_t size = strlen(argv[2]);
while (count-- != 0)
fwrite(argv[2], 1, size, stdout);
return !!(ferror(stdout) || fclose(stdout));
}
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: expandtab:ts=8:sw=4:softtabstop=4:
///////////////////////////////////////////////////////////////////////////////
//
/// \file sync_flush.c
/// \brief Encode files using LZMA_SYNC_FLUSH
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
#include <stdio.h>
static lzma_stream strm = LZMA_STREAM_INIT;
static FILE *file_in;
static void
encode(size_t size, lzma_action action)
{
static const size_t CHUNK = 64;
uint8_t in[CHUNK];
uint8_t out[CHUNK];
lzma_ret ret;
do {
if (strm.avail_in == 0 && size > 0) {
const size_t amount = MIN(size, CHUNK);
strm.avail_in = fread(in, 1, amount, file_in);
strm.next_in = in;
size -= amount; // Intentionally not using avail_in.
}
strm.next_out = out;
strm.avail_out = CHUNK;
ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN);
if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
fwrite(out, 1, CHUNK - strm.avail_out, stdout);
} while (size > 0 || strm.avail_out == 0);
if ((action == LZMA_RUN && ret != LZMA_OK)
|| (action != LZMA_RUN && ret != LZMA_STREAM_END)) {
fprintf(stderr, "%s:%u: %s: ret == %d\n",
__FILE__, __LINE__, __func__, ret);
exit(1);
}
}
int
main(int argc, char **argv)
{
file_in = argc > 1 ? fopen(argv[1], "rb") : stdin;
// Config
lzma_options_lzma opt_lzma = {
.dict_size = 1U << 16,
.lc = LZMA_LC_DEFAULT,
.lp = LZMA_LP_DEFAULT,
.pb = LZMA_PB_DEFAULT,
.preset_dict = NULL,
.persistent = true,
.mode = LZMA_MODE_NORMAL,
.nice_len = 32,
.mf = LZMA_MF_HC3,
.depth = 0,
};
lzma_options_delta opt_delta = {
.dist = 16
};
lzma_options_subblock opt_subblock = {
.allow_subfilters = true,
.alignment = 8, // LZMA_SUBBLOCK_ALIGNMENT_DEFAULT,
.subblock_data_size = LZMA_SUBBLOCK_DATA_SIZE_DEFAULT,
.rle = 1, // LZMA_SUBBLOCK_RLE_OFF,
.subfilter_mode = LZMA_SUBFILTER_SET,
};
opt_subblock.subfilter_options.id = LZMA_FILTER_LZMA1;
opt_subblock.subfilter_options.options = &opt_lzma;
opt_subblock.subfilter_options.id = LZMA_FILTER_DELTA;
opt_subblock.subfilter_options.options = &opt_delta;
lzma_filter filters[LZMA_FILTERS_MAX + 1];
filters[0].id = LZMA_FILTER_LZMA2;
filters[0].options = &opt_lzma;
filters[1].id = LZMA_VLI_UNKNOWN;
// Init
if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) {
fprintf(stderr, "init failed\n");
exit(1);
}
// Encoding
encode(0, LZMA_SYNC_FLUSH);
encode(6, LZMA_SYNC_FLUSH);
encode(0, LZMA_SYNC_FLUSH);
encode(7, LZMA_SYNC_FLUSH);
encode(0, LZMA_SYNC_FLUSH);
encode(0, LZMA_FINISH);
/*
encode(53, LZMA_SYNC_FLUSH);
// opt_lzma.literal_context_bits = 2;
// opt_lzma.literal_pos_bits = 1;
// opt_lzma.pos_bits = 0;
encode(404, LZMA_FINISH);
*/
// Clean up
lzma_end(&strm);
return 0;
// Prevent useless warnings so we don't need to have special CFLAGS
// to disable -Werror.
(void)opt_lzma;
(void)opt_subblock;
(void)opt_delta;
}
###############################################################################
#
# Makefile to build XZ Utils using DJGPP
#
# Make flags to alter compilation:
#
# DEBUG=1 Enable assertions. Don't use this for production builds!
# You may also want to set CFLAGS="-g -O0" to disable
# optimizations.
#
# The usual CPPFLAGS and CFLAGS are supported too.
#
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
CC = gcc
AR = ar
STRIP = strip
SED = sed
RM = rm -f
CFLAGS = -g -Wextra -Wfatal-errors -Wall -march=i386 -mtune=i686 -O2
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC 4.3.2
# because time.h uses GNU-style "extern inline".
ALL_CFLAGS = -std=gnu99 -fgnu89-inline
ALL_CPPFLAGS = \
-I. \
-I../lib \
-I../src/common \
-I../src/liblzma/api \
-I../src/liblzma/common \
-I../src/liblzma/check \
-I../src/liblzma/rangecoder \
-I../src/liblzma/lz \
-I../src/liblzma/lzma \
-I../src/liblzma/delta \
-I../src/liblzma/simple \
-I../src/liblzma/subblock
ALL_CPPFLAGS += -DHAVE_CONFIG_H
ifdef DEBUG
STRIP := rem Skipping strip
else
ALL_CPPFLAGS += -DNDEBUG
endif
ALL_CPPFLAGS += $(CPPFLAGS)
ALL_CFLAGS += $(CFLAGS)
################
# Common rules #
################
.PHONY: all clean
all: liblzma.a getopt.a xzdec.exe lzmadec.exe xz.exe
clean: liblzma-clean getopt-clean xzdec-clean xz-clean
#############
# liblzma.a #
#############
LIBLZMA_SRCS_C = \
../src/liblzma/common/alone_decoder.c \
../src/liblzma/common/alone_encoder.c \
../src/liblzma/common/auto_decoder.c \
../src/liblzma/common/block_buffer_decoder.c \
../src/liblzma/common/block_buffer_encoder.c \
../src/liblzma/common/block_decoder.c \
../src/liblzma/common/block_encoder.c \
../src/liblzma/common/block_header_decoder.c \
../src/liblzma/common/block_header_encoder.c \
../src/liblzma/common/block_util.c \
../src/liblzma/common/common.c \
../src/liblzma/common/easy_buffer_encoder.c \
../src/liblzma/common/easy_decoder_memusage.c \
../src/liblzma/common/easy_encoder.c \
../src/liblzma/common/easy_encoder_memusage.c \
../src/liblzma/common/easy_preset.c \
../src/liblzma/common/filter_common.c \
../src/liblzma/common/filter_decoder.c \
../src/liblzma/common/filter_encoder.c \
../src/liblzma/common/filter_flags_decoder.c \
../src/liblzma/common/filter_flags_encoder.c \
../src/liblzma/common/index.c \
../src/liblzma/common/index_decoder.c \
../src/liblzma/common/index_encoder.c \
../src/liblzma/common/index_hash.c \
../src/liblzma/common/stream_buffer_decoder.c \
../src/liblzma/common/stream_buffer_encoder.c \
../src/liblzma/common/stream_decoder.c \
../src/liblzma/common/stream_encoder.c \
../src/liblzma/common/stream_flags_common.c \
../src/liblzma/common/stream_flags_decoder.c \
../src/liblzma/common/stream_flags_encoder.c \
../src/liblzma/common/vli_decoder.c \
../src/liblzma/common/vli_encoder.c \
../src/liblzma/common/vli_size.c \
../src/liblzma/check/check.c \
../src/liblzma/check/crc32_table.c \
../src/liblzma/check/crc64_table.c \
../src/liblzma/check/sha256.c \
../src/liblzma/rangecoder/price_table.c \
../src/liblzma/lz/lz_decoder.c \
../src/liblzma/lz/lz_encoder.c \
../src/liblzma/lz/lz_encoder_mf.c \
../src/liblzma/lzma/fastpos_table.c \
../src/liblzma/lzma/lzma2_decoder.c \
../src/liblzma/lzma/lzma2_encoder.c \
../src/liblzma/lzma/lzma_decoder.c \
../src/liblzma/lzma/lzma_encoder.c \
../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
../src/liblzma/lzma/lzma_encoder_presets.c \
../src/liblzma/delta/delta_common.c \
../src/liblzma/delta/delta_decoder.c \
../src/liblzma/delta/delta_encoder.c \
../src/liblzma/simple/arm.c \
../src/liblzma/simple/armthumb.c \
../src/liblzma/simple/ia64.c \
../src/liblzma/simple/powerpc.c \
../src/liblzma/simple/simple_coder.c \
../src/liblzma/simple/simple_decoder.c \
../src/liblzma/simple/simple_encoder.c \
../src/liblzma/simple/sparc.c \
../src/liblzma/simple/x86.c
LIBLZMA_SRCS_ASM = \
../src/liblzma/check/crc32_x86.S \
../src/liblzma/check/crc64_x86.S
LIBLZMA_OBJS_C = $(LIBLZMA_SRCS_C:.c=.o)
LIBLZMA_OBJS_ASM = $(LIBLZMA_SRCS_ASM:.S=.o)
LIBLZMA_OBJS = $(LIBLZMA_OBJS_C) $(LIBLZMA_OBJS_ASM)
$(LIBLZMA_OBJS_C): %.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
$(LIBLZMA_OBJS_ASM): %.o: %.S
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
liblzma.a: $(LIBLZMA_OBJS)
$(RM) $@
$(AR) rcs $@ $(LIBLZMA_OBJS)
$(STRIP) --strip-unneeded $@
# Avoid too long command lines.
.PHONY: liblzma-clean $(LIBLZMA_OBJS:.o=-clean)
liblzma-clean: $(LIBLZMA_OBJS:.o=-clean)
-$(RM) liblzma.a
$(LIBLZMA_OBJS:.o=-clean):
-$(RM) $(@:-clean=.o)
###############
# getopt_long #
###############
GETOPT_SRCS = \
../lib/getopt.c \
../lib/getopt1.c
GETOPT_OBJS = $(GETOPT_SRCS:.c=.o)
GETOPT_H = ../lib/getopt.h
$(GETOPT_H): %.h: %.in.h
$(SED) "" $< > $@
$(GETOPT_OBJS): %.o: %.c $(GETOPT_H)
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
getopt.a: $(GETOPT_OBJS)
$(RM) $@
$(AR) rcs $@ $(GETOPT_OBJS)
$(STRIP) --strip-unneeded $@
getopt-clean:
$(RM) $(GETOPT_H) $(GETOPT_OBJS) getopt.a
###########################
# xzdec.exe & lzmadec.exe #
###########################
XZDEC_SRCS = ../src/xzdec/xzdec.c
xzdec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
$(STRIP) --strip-all $@
exe2coff $@
$(RM) $@
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
$(RM) $(@:.exe=)
lzmadec.exe: getopt.a liblzma.a $(XZDEC_SRCS)
$(CC) $(ALL_CPPFLAGS) -DLZMADEC $(ALL_CFLAGS) $(XZDEC_SRCS) -o $@ getopt.a liblzma.a
$(STRIP) --strip-all $@
exe2coff $@
$(RM) $@
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
$(RM) $(@:.exe=)
.PHONY: xzdec-clean
xzdec-clean:
-$(RM) xzdec.exe lzmadec.exe xzdec lzmadec
##########
# xz.exe #
##########
XZ_SRCS = \
../src/xz/args.c \
../src/xz/coder.c \
../src/xz/file_io.c \
../src/xz/hardware.c \
../src/xz/main.c \
../src/xz/message.c \
../src/xz/options.c \
../src/xz/signals.c \
../src/xz/suffix.c \
../src/xz/util.c
XZ_OBJS = $(XZ_SRCS:.c=.o)
$(XZ_OBJS): %.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
xz.exe: getopt.a liblzma.a $(XZ_OBJS)
$(CC) $(ALL_CFLAGS) $(XZ_OBJS) -o $@ getopt.a liblzma.a
$(STRIP) --strip-all $@
exe2coff $@
$(RM) $@
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
$(RM) $(@:.exe=)
# Avoid too long command lines.
.PHONY: xz-clean $(XZ_OBJS:.o=-clean)
xz-clean: $(XZ_OBJS:.o=-clean)
-$(RM) xz.exe xz
$(XZ_OBJS:.o=-clean):
-$(RM) $(@:-clean=.o)
###############################################################################
#
# Makefile to build XZ Utils using MinGW
#
# Make flags to alter compilation:
#
# DEBUG=1 Enable assertions. Don't use this for production builds!
# You may also want to set CFLAGS="-g -O0" to disable
# optimizations.
#
# W64=1 Build for 64-bit Windows. Make sure that you have 64-bit
# MinGW in PATH.
#
# WINE=1 Shortcut to set CC, AR, and STRIP to use Wine to run Windows
# versions of MinGW binaries.
#
# The usual CPPFLAGS and CFLAGS are supported too.
#
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
ifdef W64
CC = x86_64-pc-mingw32-gcc
WINDRES = x86_64-pc-mingw32-windres
AR = x86_64-pc-mingw32-ar
STRIP = x86_64-pc-mingw32-strip
else
CC = mingw32-gcc
WINDRES = windres
AR = ar
STRIP = strip
endif
SED = sed
MKDIR = mkdir
CP = cp
RM = rm -f
CFLAGS = -g -Wall -Wextra -O2
# CFLAGS = -Wall -Wextra -O3 -fomit-frame-pointer -funroll-loops
ALL_CFLAGS = -std=gnu99 -mms-bitfields
ALL_CPPFLAGS = \
-I. \
-I../src/common \
-I../src/liblzma/api \
-I../src/liblzma/common \
-I../src/liblzma/check \
-I../src/liblzma/rangecoder \
-I../src/liblzma/lz \
-I../src/liblzma/lzma \
-I../src/liblzma/delta \
-I../src/liblzma/simple \
-I../src/liblzma/subblock
ALL_CPPFLAGS += -DHAVE_CONFIG_H
# This works with Wine too while using native GNU make, sed, and rm.
ifdef WINE
ifdef W64
CC := wine c:/MinGW64/bin/x86_64-pc-mingw32-gcc
WINDRES := wine c:/MinGW64/bin/x86_64-pc-mingw32-windres
AR := wine c:/MinGW64/bin/x86_64-pc-mingw32-ar
STRIP := wine c:/MinGW64/bin/x86_64-pc-mingw32-strip
else
CC := wine c:/MinGW/bin/gcc
WINDRES := wine c:/MinGW/bin/windres
AR := wine c:/MinGW/bin/ar
STRIP := wine c:/MinGW/bin/strip
endif
endif
ifdef DEBUG
# Use echo since it works for this purpose on both Windows and POSIX.
STRIP := echo Skipping strip
else
ALL_CPPFLAGS += -DNDEBUG
endif
ALL_CPPFLAGS += $(CPPFLAGS)
ALL_CFLAGS += $(CFLAGS)
################
# Common rules #
################
.PHONY: all clean pkg
all: liblzma xzdec xz
clean: liblzma-clean xzdec-clean xz-clean
pkg: all
$(RM) -r pkg
$(MKDIR) -p pkg/lib pkg/include/lzma
$(CP) liblzma.dll xz-dynamic.exe xz.exe xzdec-dynamic.exe xzdec.exe lzmadec-dynamic.exe lzmadec.exe pkg
$(CP) liblzma.a liblzma.def liblzma_static.lib pkg/lib
$(CP) ../src/liblzma/api/lzma.h pkg/include
$(CP) ../src/liblzma/api/lzma/*.h pkg/include/lzma
%.o: %.rc
$(WINDRES) $(ALL_CPPFLAGS) $< $@
###############
# liblzma.dll #
###############
.PHONY: liblzma
liblzma: liblzma.dll liblzma_static.lib
LIBLZMA_SRCS_C = \
../src/liblzma/common/alone_decoder.c \
../src/liblzma/common/alone_encoder.c \
../src/liblzma/common/auto_decoder.c \
../src/liblzma/common/block_buffer_decoder.c \
../src/liblzma/common/block_buffer_encoder.c \
../src/liblzma/common/block_decoder.c \
../src/liblzma/common/block_encoder.c \
../src/liblzma/common/block_header_decoder.c \
../src/liblzma/common/block_header_encoder.c \
../src/liblzma/common/block_util.c \
../src/liblzma/common/common.c \
../src/liblzma/common/easy_buffer_encoder.c \
../src/liblzma/common/easy_decoder_memusage.c \
../src/liblzma/common/easy_encoder.c \
../src/liblzma/common/easy_encoder_memusage.c \
../src/liblzma/common/easy_preset.c \
../src/liblzma/common/filter_buffer_decoder.c \
../src/liblzma/common/filter_buffer_encoder.c \
../src/liblzma/common/filter_common.c \
../src/liblzma/common/filter_decoder.c \
../src/liblzma/common/filter_encoder.c \
../src/liblzma/common/filter_flags_decoder.c \
../src/liblzma/common/filter_flags_encoder.c \
../src/liblzma/common/index.c \
../src/liblzma/common/index_decoder.c \
../src/liblzma/common/index_encoder.c \
../src/liblzma/common/index_hash.c \
../src/liblzma/common/stream_buffer_decoder.c \
../src/liblzma/common/stream_buffer_encoder.c \
../src/liblzma/common/stream_decoder.c \
../src/liblzma/common/stream_encoder.c \
../src/liblzma/common/stream_flags_common.c \
../src/liblzma/common/stream_flags_decoder.c \
../src/liblzma/common/stream_flags_encoder.c \
../src/liblzma/common/vli_decoder.c \
../src/liblzma/common/vli_encoder.c \
../src/liblzma/common/vli_size.c \
../src/liblzma/check/check.c \
../src/liblzma/check/crc32_table.c \
../src/liblzma/check/crc64_table.c \
../src/liblzma/check/sha256.c \
../src/liblzma/rangecoder/price_table.c \
../src/liblzma/lz/lz_decoder.c \
../src/liblzma/lz/lz_encoder.c \
../src/liblzma/lz/lz_encoder_mf.c \
../src/liblzma/lzma/fastpos_table.c \
../src/liblzma/lzma/lzma2_decoder.c \
../src/liblzma/lzma/lzma2_encoder.c \
../src/liblzma/lzma/lzma_decoder.c \
../src/liblzma/lzma/lzma_encoder.c \
../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
../src/liblzma/lzma/lzma_encoder_presets.c \
../src/liblzma/delta/delta_common.c \
../src/liblzma/delta/delta_decoder.c \
../src/liblzma/delta/delta_encoder.c \
../src/liblzma/simple/arm.c \
../src/liblzma/simple/armthumb.c \
../src/liblzma/simple/ia64.c \
../src/liblzma/simple/powerpc.c \
../src/liblzma/simple/simple_coder.c \
../src/liblzma/simple/simple_decoder.c \
../src/liblzma/simple/simple_encoder.c \
../src/liblzma/simple/sparc.c \
../src/liblzma/simple/x86.c
LIBLZMA_SRCS_ASM =
ifdef W64
LIBLZMA_SRCS_C += \
../src/liblzma/check/crc32_fast.c \
../src/liblzma/check/crc64_fast.c
else
LIBLZMA_SRCS_ASM += \
../src/liblzma/check/crc32_x86.S \
../src/liblzma/check/crc64_x86.S
endif
LIBLZMA_OBJS_C = $(LIBLZMA_SRCS_C:.c=.o)
LIBLZMA_OBJS_ASM = $(LIBLZMA_SRCS_ASM:.S=.o)
LIBLZMA_OBJS = \
$(LIBLZMA_OBJS_C) \
$(LIBLZMA_OBJS_ASM) \
../src/liblzma/liblzma_w32res.o
LIBLZMA_OBJS_STATIC_C = $(LIBLZMA_SRCS_C:.c=-static.o)
LIBLZMA_OBJS_STATIC_ASM = $(LIBLZMA_SRCS_ASM:.S=-static.o)
LIBLZMA_OBJS_STATIC = $(LIBLZMA_OBJS_STATIC_C) $(LIBLZMA_OBJS_STATIC_ASM)
# The sed is needed to remove ordinals from the .def file. I'm not going
# to track the ordinal numbers, so people should link against liblzma.dll
# only by using symbol names.
liblzma.dll: $(LIBLZMA_OBJS)
$(CC) $(ALL_CFLAGS) -shared -o liblzma.dll $(LIBLZMA_OBJS) -Wl,--out-implib,liblzma.a,--output-def,liblzma.def.in
$(SED) 's/ \+@ *[0-9]\+//' liblzma.def.in > liblzma.def
$(RM) liblzma.def.in
$(STRIP) --strip-unneeded liblzma.a
$(STRIP) --strip-all liblzma.dll
$(LIBLZMA_OBJS_C): %.o: %.c
$(CC) -DDLL_EXPORT $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
$(LIBLZMA_OBJS_ASM): %.o: %.S
$(CC) -DDLL_EXPORT $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
liblzma_static.lib: $(LIBLZMA_OBJS_STATIC)
$(RM) $@
$(AR) rcs $@ $(LIBLZMA_OBJS_STATIC)
$(STRIP) --strip-unneeded $@
$(LIBLZMA_OBJS_STATIC_C): %-static.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
$(LIBLZMA_OBJS_STATIC_ASM): %-static.o: %.S
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
.PHONY: liblzma-clean
liblzma-clean:
-$(RM) $(LIBLZMA_OBJS) $(LIBLZMA_OBJS_STATIC) liblzma.def.in liblzma.def liblzma.a liblzma.dll liblzma_static.lib
###########################
# xzdec.exe & lzmadec.exe #
###########################
.PHONY: xzdec
xzdec: xzdec-dynamic.exe lzmadec-dynamic.exe xzdec.exe lzmadec.exe
XZDEC_SRCS = ../src/xzdec/xzdec.c
xzdec-dynamic.exe: liblzma.dll $(XZDEC_SRCS) ../src/xzdec/xzdec_w32res.o
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(XZDEC_SRCS) ../src/xzdec/xzdec_w32res.o -o $@ liblzma.a
$(STRIP) --strip-all $@
lzmadec-dynamic.exe: liblzma.dll $(XZDEC_SRCS) ../src/xzdec/lzmadec_w32res.o
$(CC) $(ALL_CPPFLAGS) -DLZMADEC $(ALL_CFLAGS) $(XZDEC_SRCS) ../src/xzdec/lzmadec_w32res.o -o $@ liblzma.a
$(STRIP) --strip-all $@
xzdec.exe: liblzma_static.lib $(XZDEC_SRCS) ../src/xzdec/xzdec_w32res.o
$(CC) -DLZMA_API_STATIC $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(XZDEC_SRCS) ../src/xzdec/xzdec_w32res.o -o $@ liblzma_static.lib
$(STRIP) --strip-all $@
lzmadec.exe: liblzma_static.lib $(XZDEC_SRCS) ../src/xzdec/lzmadec_w32res.o
$(CC) -DLZMA_API_STATIC $(ALL_CPPFLAGS) -DLZMADEC $(ALL_CFLAGS) $(XZDEC_SRCS) ../src/xzdec/lzmadec_w32res.o -o $@ liblzma_static.lib
$(STRIP) --strip-all $@
.PHONY: xzdec-clean
xzdec-clean:
-$(RM) xzdec-dynamic.exe lzmadec-dynamic.exe xzdec.exe lzmadec.exe ../src/xzdec/xzdec_w32res.o ../src/xzdec/lzmadec_w32res.o
##########
# xz.exe #
##########
.PHONY: xz
xz: xz-dynamic.exe xz.exe
XZ_SRCS = \
../src/xz/args.c \
../src/xz/coder.c \
../src/xz/file_io.c \
../src/xz/hardware.c \
../src/xz/main.c \
../src/xz/message.c \
../src/xz/options.c \
../src/xz/signals.c \
../src/xz/suffix.c \
../src/xz/util.c
XZ_OBJS = $(XZ_SRCS:.c=.o)
XZ_OBJS_STATIC = $(XZ_SRCS:.c=-static.o)
$(XZ_OBJS): %.o: %.c
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
xz-dynamic.exe: liblzma.dll $(XZ_OBJS) ../src/xz/xz_w32res.o
$(CC) $(ALL_CFLAGS) $(XZ_OBJS) ../src/xz/xz_w32res.o -o $@ liblzma.a
$(STRIP) --strip-all $@
$(XZ_OBJS_STATIC): %-static.o: %.c
$(CC) -DLZMA_API_STATIC $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
xz.exe: liblzma_static.lib $(XZ_OBJS_STATIC) ../src/xz/xz_w32res.o
$(CC) $(ALL_CFLAGS) $(XZ_OBJS_STATIC) ../src/xz/xz_w32res.o -o $@ liblzma_static.lib
$(STRIP) --strip-all $@
.PHONY: xz-clean
xz-clean:
-$(RM) $(XZ_OBJS) $(XZ_OBJS_STATIC) ../src/xz/xz_w32res.o xz-dynamic.exe xz.exe
SRCS = $(wildcard *.cc)
TARGETS = $(patsubst %.cc,%,$(SRCS))
CHECKS = $(patsubst %,%.check,$(TARGETS))
CPPFLAGS = -I.. -D__STDC_FORMAT_MACROS
CXXFLAGS = -g -Wall -Wextra -Wno-missing-field-initializers -Wshadow
ifdef USE_OPENMP
CPPFLAGS += -DUSE_OPENMP
CXXFLAGS += -fopenmp
endif
FRACTALTREE_BASE_DIR = ../ft-index
FRACTALTREE_INSTALL_DIR = $(FRACTALTREE_BASE_DIR)/install.debug
VALGRIND = valgrind -q --leak-check=full --show-reachable=yes --suppressions=$(FRACTALTREE_BASE_DIR)/ft/valgrind.suppressions --soname-synonyms=somalloc=*tokuportability*
ifeq ($(GCOV),1)
CXXFLAGS += -fprofile-arcs -ftest-coverage
else
CXXFLAGS += -O3
endif
all: $(TARGETS)
clean:
rm -rf $(TARGETS) *.gcov *.gcno *.gcda *.testdir *.dSYM
%.check: %
LD_LIBRARY_PATH=$(FRACTALTREE_INSTALL_DIR)/lib $(VALGRIND) ./$<
card.check: $(patsubst %.cc,%.check,$(wildcard card*.cc))
true
ifndef USE_OPENMP
# unravel vlq_test_uint64 8 times
vlq_test_uint64_%.check:
LD_LIBRARY_PATH=$(FRACTALTREE_INSTALL_DIR)/lib $(VALGRIND) ./vlq_test_uint64 $(patsubst vlq_test_uint64_%.check,%,$@) 8
vlq_test_uint64.check: $(foreach i,0 1 2 3 4 5 6 7,vlq_test_uint64_$(i).check)
true
endif
vlq.check: $(patsubst %.cc,%.check,$(wildcard vlq*.cc))
true
max_test.check: max_test
$(VALGRIND) ./$< 1 2
check: $(CHECKS)
true
%: %.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -g -o $@ $<
card_%: card_%.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -g -o $@ $< -I.. -I$(FRACTALTREE_INSTALL_DIR)/include -L$(FRACTALTREE_INSTALL_DIR)/lib -ltokufractaltree -ltokuportability
--------------
drop table if exists auto_incr_test,auto_incr_test2
--------------
Query OK, 0 rows affected
--------------
create table auto_incr_test (id int not null auto_increment, name char(40), timestamp timestamp, primary key (id))
--------------
Query OK, 0 rows affected
--------------
insert into auto_incr_test (name) values ("first record")
--------------
Query OK, 1 row affected
--------------
insert into auto_incr_test values (last_insert_id()+1,"second record",null)
--------------
Query OK, 1 row affected
--------------
insert into auto_incr_test (id,name) values (10,"tenth record")
--------------
Query OK, 1 row affected
--------------
insert into auto_incr_test values (0,"eleventh record",null)
--------------
Query OK, 1 row affected
--------------
insert into auto_incr_test values (last_insert_id()+1,"12","1997-01-01")
--------------
Query OK, 1 row affected
--------------
insert into auto_incr_test values (12,"this will not work",NULL)
--------------
ERROR 1062 at line 15: Duplicate entry '12' for key 1
--------------
replace into auto_incr_test values (12,"twelfth record",NULL)
--------------
Query OK, 2 rows affected
--------------
select * from auto_incr_test
--------------
id name timestamp
1 first record 19980817042654
2 second record 19980817042655
10 tenth record 19980817042655
11 eleventh record 19980817042655
12 twelfth record 19980817042655
5 rows in set
--------------
create table auto_incr_test2 (id int not null auto_increment, name char(40), primary key (id))
--------------
Query OK, 0 rows affected
--------------
insert into auto_incr_test2 select NULL,name from auto_incr_test
--------------
Query OK, 5 rows affected
Records: 5 Duplicates: 0 Warnings: 0
--------------
insert into auto_incr_test2 select id,name from auto_incr_test
--------------
Query OK, 3 rows affected
Records: 5 Duplicates: 2 Warnings: 0
--------------
replace into auto_incr_test2 select id,name from auto_incr_test
--------------
Query OK, 5 rows affected
Records: 5 Duplicates: 5 Warnings: 0
--------------
select * from auto_incr_test2
--------------
id name
1 first record
2 second record
3 tenth record
4 eleventh record
5 twelfth record
10 tenth record
11 eleventh record
12 twelfth record
8 rows in set
--------------
drop table auto_incr_test,auto_incr_test2
--------------
Query OK, 0 rows affected
Bye
--------------
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2,sign(-5)
--------------
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 sign(-5)
2 0 3 1.60 3 3 3 4 -1
--------------
select floor(5.5),floor(-5.5),ceiling(5.5),ceiling(-5.5),round(5.5),round(-5.5)
--------------
floor(5.5) floor(-5.5) ceiling(5.5) ceiling(-5.5) round(5.5) round(-5.5)
5 -6 6 -5 6 -6
--------------
select abs(-10),log(exp(10)),ln(exp(10)),log2(65535),log(2,65535),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand()
--------------
abs(-10) log(exp(10)) ln(exp(10)) log2(65535) log(2,65535) exp(log(sqrt(10))*2) pow(10,log10(10)) rand(999999) rand()
10 10.000000 10.000000 2.000000 2.000000 10.000000 10.000000 0.1844 0.7637
--------------
select least(6,1.0,2.0),greatest(3,4,5,0)
--------------
least(6,1.0,2.0) greatest(3,4,5,0)
1.0 5
--------------
select 1 | (1+1),5 & 3,bit_count(7)
--------------
1 | (1+1) 5 & 3 bit_count(7)
3 1 3
--------------
select 0=0,1>0,1>=1,1<0,1<=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a")
--------------
0=0 1>0 1>=1 1<0 1<=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
1 1 1 0 0 -1 1 0
--------------
select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"
--------------
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
1 1 1 1 1 1
--------------
select "abc" like "a%", "abc" not like "%d%", "ab" like "a\%", "a%" like "a\%","abcd" like "a%b_%d"
--------------
"abc" like "a%" "abc" not like "%d%" "ab" like "a\%" "a%" like "a\%" "abcd" like "a%b_%d"
1 1 0 1 1
--------------
select "Det hr r svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"
--------------
"Det hr r svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
1 1
--------------
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0
--------------
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
1 1 0 1 0 1 1 1
--------------
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0
--------------
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
--------------
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3
--------------
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
1 1 1
--------------
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0)
--------------
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
1 1 1
--------------
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'
--------------
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
--------------
select concat("monty"," was here ","again"),length("hello"),ascii("hello")
--------------
concat("monty"," was here ","again") length("hello") ascii("hello")
monty was here again 5 104
--------------
select locate("he","hello"),locate("he","hello",2),locate("lo","hello",2)
--------------
locate("he","hello") locate("he","hello",2) locate("lo","hello",2)
1 0 4
--------------
select left("hello",2),right("hello",2),substring("hello",2,2),mid("hello",1,5)
--------------
left("hello",2) right("hello",2) substring("hello",2,2) mid("hello",1,5)
he lo el hello
--------------
select concat("",left(right(concat("what ",concat("is ","happening")),9),4),"",substring("monty",5,1))
--------------
concat("",left(right(concat("what ",concat("is ","happening")),9),4),"",substring("monty",5,1))
happy
--------------
select concat("!",ltrim(" left "),"!",rtrim(" right "),"!")
--------------
concat("!",ltrim(" left "),"!",rtrim(" right "),"!")
!left ! right!
--------------
select insert("txs",2,1,"hi"),insert("is ",4,0,"a"),insert("txxxxt",2,4,"es")
--------------
insert("txs",2,1,"hi") insert("is ",4,0,"a") insert("txxxxt",2,4,"es")
this is a test
--------------
select replace("aaaa","a","b"),replace("aaaa","aa","b"),replace("aaaa","a","bb"),replace("aaaa","","b"),replace("bbbb","a","c")
--------------
replace("aaaa","a","b") replace("aaaa","aa","b") replace("aaaa","a","bb") replace("aaaa","","b") replace("bbbb","a","c")
bbbb bb bbbbbbbb aaaa bbbb
--------------
select replace(concat(lcase(concat("THIS"," ","IS"," ","A"," ")),ucase("false")," ","test"),"FALSE","REAL")
--------------
replace(concat(lcase(concat("THIS"," ","IS"," ","A"," ")),ucase("false")," ","test"),"FALSE","REAL")
this is a REAL test
--------------
select soundex(""),soundex("he"),soundex("hello all folks")
--------------
soundex("") soundex("he") soundex("hello all folks")
H000 H4142
--------------
select password("test")
--------------
password("test")
378b243e220ca493
--------------
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0
--------------
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
A 65 9223372036854775807 -1
--------------
select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0
--------------
interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0
5 2 4 0 TWO 0 1 1.1
--------------
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2)
--------------
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
--------------
select database(),user()
--------------
database() user()
monty
--------------
select null,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null
--------------
NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
NULL 1 1 1 1 TRUE TRUE 1 1
--------------
select 1 | NULL,1 & NULL,1+NULL,1-NULL
--------------
1 | NULL 1 & NULL 1+NULL 1-NULL
NULL NULL NULL NULL
--------------
select NULL=NULL,NULL<>NULL,NULL IS NULL, NULL IS NOT NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0
--------------
NULL=NULL NULL<>NULL NULL IS NULL NULL IS NOT NULL IFNULL(NULL,1.1)+0 IFNULL(NULL,1) | 0
NULL NULL 1 0 1.1 1
--------------
select strcmp("a",NULL),(1<NULL)+0.0,NULL regexp "a",null like "a%","a%" like null
--------------
strcmp("a",NULL) (1<NULL)+0.0 NULL regexp "a" null like "a%" "a%" like null
NULL NULL NULL NULL NULL
--------------
select concat("a",NULL),replace(NULL,"a","b"),replace("string","i",NULL),replace("string",NULL,"i"),insert("abc",1,1,NULL),left(NULL,1)
--------------
concat("a",NULL) replace(NULL,"a","b") replace("string","i",NULL) replace("string",NULL,"i") insert("abc",1,1,NULL) left(NULL,1)
NULL NULL NULL NULL NULL NULL
--------------
select field(NULL,"a","b","c")
--------------
field(NULL,"a","b","c")
0
--------------
select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null,2 between null and 1,2 between 3 AND NULL
--------------
2 between null and 1 2 between 3 AND NULL NULL between 1 and 2 2 between NULL and 3 2 between 1 AND null 2 between null and 1 2 between 3 AND NULL
0 0 NULL NULL NULL 0 0
--------------
select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2)
--------------
insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2)
aa b a
--------------
select elt(2,1),field(NULL,"a","b","c")
--------------
elt(2,1) field(NULL,"a","b","c")
NULL 0
--------------
select locate("a","b",2),locate("","a",1),ltrim("a"),rtrim("a")
--------------
locate("a","b",2) locate("","a",1) ltrim("a") rtrim("a")
0 1 a a
--------------
select concat("1","2")|0,concat("1",".5")+0.0
--------------
concat("1","2")|0 concat("1",".5")+0.0
12 1.5
--------------
select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(curdate()+1)-to_days(curdate()),weekday("1997-01-01")
--------------
from_days(to_days("960101")) to_days(960201)-to_days("19960101") to_days(curdate()+1)-to_days(curdate()) weekday("1997-01-01")
1996-01-01 31 1 2
--------------
select period_add("9602",-12),period_diff(199505,"9404")
--------------
period_add("9602",-12) period_diff(199505,"9404")
199502 13
--------------
select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now())
--------------
now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(now())
0 0 0
--------------
select now(),now()+0,curdate(),weekday(curdate()),weekday(now()),unix_timestamp(),unix_timestamp(now())
--------------
now() now()+0 curdate() weekday(curdate()) weekday(now()) unix_timestamp() unix_timestamp(now())
1998-08-17 04:24:33 19980817042433 1998-08-17 0 0 903317073 903317073
delete from user where user='grant_user' or user='grant_user2'
delete from db where user='grant_user'
delete from tables_priv
delete from columns_priv
lock tables mysql.user write
flush privileges
unlock tables
drop database grant_test
create database grant_test
Connecting grant_user
Error on connect: Access denied for user: ''@'localhost' to database 'grant_test'
grant select(user) on mysql.user to grant_user@localhost
revoke select(user) on mysql.user from grant_user@localhost
grant select on *.* to grant_user@localhost
set password FOR grant_user2@localhost = password('test')
Error in execute: Can't find any matching row in the user table
set password FOR grant_user=password('test')
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
set password FOR grant_user=''
Connecting grant_user
select * from mysql.user where user = 'grant_user'
localhost grant_user Y N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
grant select on *.* to grant_user@localhost,grant_user@localhost
show grants for grant_user@localhost
GRANT SELECT ON *.* TO 'grant_user'@'localhost'
Connecting grant_user
insert into mysql.user (host,user) values ('error','grant_user')
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'user'
update mysql.user set host='error' WHERE user='grant_user'
Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'user'
create table grant_test.test (a int,b int)
Error in execute: create command denied to user: 'grant_user'@'localhost' for table 'test'
grant select on *.* to grant_user2@localhost
Error in execute: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
revoke select on grant_test.test from grant_user@opt_host
Error in execute: There is no such grant defined for user 'grant_user' on host 'opt_host'
revoke select on grant_test.* from grant_user@opt_host
Error in execute: There is no such grant defined for user 'grant_user' on host 'opt_host'
revoke select on *.* from grant_user
Error in execute: There is no such grant defined for user 'grant_user' on host '%'
grant select on grant_test.not_exists to grant_user
Error in execute: Table 'grant_test.not_exists' doesn't exist
grant FILE on grant_test.test to grant_user
Error in execute: Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used
grant select on *.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
grant select on grant_test.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
Connecting grant_user
grant select on grant_test.test to grant_user with grant option
Error in execute: grant command denied to user: 'grant_user'@'localhost' for table 'test'
set password FOR ''@''=''
Error in execute: Can't find any matching row in the user table
set password FOR root@localhost = password('test')
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
revoke select on *.* from grant_user@localhost
grant create,update on *.* to grant_user@localhost
Connecting grant_user
flush privileges
create table grant_test.test (a int,b int)
update grant_test.test set b=b+1 where a > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
show grants for grant_user@localhost
GRANT UPDATE, CREATE ON *.* TO 'grant_user'@'localhost'
revoke update on *.* from grant_user@localhost
Connecting grant_user
grant select(c) on grant_test.test to grant_user@localhost
Error in execute: Unknown column 'c' in 'test'
revoke select(c) on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
grant select on grant_test.test to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
INSERT INTO grant_test.test values (2,0)
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test'
grant ALL PRIVILEGES on *.* to grant_user@localhost
REVOKE INSERT on *.* from grant_user@localhost
Connecting grant_user
INSERT INTO grant_test.test values (1,0)
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test'
grant INSERT on *.* to grant_user@localhost
Connecting grant_user
INSERT INTO grant_test.test values (2,0)
select count(*) from grant_test.test
1
revoke SELECT on *.* from grant_user@localhost
Connecting grant_user
select count(*) from grant_test.test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
INSERT INTO grant_test.test values (3,0)
grant SELECT on *.* to grant_user@localhost
Connecting grant_user
select count(*) from grant_test.test
2
revoke ALL PRIVILEGES on *.* from grant_user@localhost
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
delete from user where user='grant_user'
flush privileges
delete from user where user='grant_user'
flush privileges
grant select on grant_test.* to grant_user@localhost
select * from mysql.user where user = 'grant_user'
localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user Y N N N N N N N N N N N
Connecting grant_user
select count(*) from grant_test.test
2
select * from mysql.user where user = 'grant_user'
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
insert into grant_test.test values (4,0)
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
update grant_test.test set a=1
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
delete from grant_test.test
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
create table grant_test.test2 (a int)
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
ALTER TABLE grant_test.test add c int
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
CREATE INDEX dummy ON grant_test.test (a)
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop table grant_test.test
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
Connecting grant_user
insert into grant_test.test values (5,0)
REVOKE ALL PRIVILEGES on * from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost'
REVOKE ALL PRIVILEGES on *.* from grant_user@localhost
REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
Connecting grant_user
insert into grant_test.test values (6,0)
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
REVOKE GRANT OPTION on grant_test.* from grant_user@localhost
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost
Connecting grant_user
select * from mysql.user where user = 'grant_user'
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
insert into grant_test.test values (7,0)
update grant_test.test set a=3 where a=2
delete from grant_test.test where a=3
create table grant_test.test2 (a int not null)
alter table grant_test.test2 add b int
create index dummy on grant_test.test2 (a)
update test,test2 SET test.a=test2.a where test.a=test2.a
drop table grant_test.test2
show tables from grant_test
test
insert into mysql.user (host,user) values ('error','grant_user',0)
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
select * from mysql.user where user = 'grant_user'
localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
grant CREATE,UPDATE,DROP on grant_test.* to grant_user@localhost
Connecting grant_user
create table grant_test.test2 (a int not null)
update test,test2 SET test.a=1 where 1
update test,test2 SET test.a=test2.a where 1
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
grant SELECT on grant_test.* to grant_user@localhost
Connecting grant_user
update test,test2 SET test.a=test2.a where test2.a=test.a
drop table grant_test.test2
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant create on grant_test.test2 to grant_user@localhost
Connecting grant_user
create table grant_test.test2 (a int not null)
show tables
test2
show columns from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
show keys from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
show columns from test2
a int(11) binary 0
show keys from test2
select * from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant insert on grant_test.test to grant_user@localhost
show tables
test
test2
insert into grant_test.test values (8,0)
update grant_test.test set b=1
Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
grant update on grant_test.test to grant_user@localhost
update grant_test.test set b=2
update grant_test.test,test2 SET test.b=3
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant select on grant_test.test2 to grant_user@localhost
update grant_test.test,test2 SET test.b=3
revoke select on grant_test.test2 from grant_user@localhost
delete from grant_test.test
Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
grant delete on grant_test.test to grant_user@localhost
delete from grant_test.test where a=1
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update grant_test.test set b=3 where b=1
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update grant_test.test set b=b+1
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update grant_test.test,test2 SET test.a=test2.a
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant SELECT on *.* to grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1
update grant_test.test set b=b+1 where a > 0
update grant_test.test,test2 SET test.a=test2.a
update grant_test.test,test2 SET test2.a=test.a
Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
revoke SELECT on *.* from grant_user@localhost
grant SELECT on grant_test.* to grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1
update grant_test.test set b=b+1 where a > 0
grant UPDATE on *.* to grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1
update grant_test.test set b=b+1 where a > 0
revoke UPDATE on *.* from grant_user@localhost
revoke SELECT on grant_test.* from grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1 where a > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update grant_test.test set b=b+1
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select * from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant select on grant_test.test to grant_user@localhost
delete from grant_test.test where a=1
update grant_test.test set b=2 where b=1
update grant_test.test set b=b+1
select count(*) from test
3
update test,test2 SET test.b=4
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
update test,test2 SET test2.a=test.a
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
update test,test2 SET test.a=test2.a
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
create table grant_test.test3 (a int)
Error in execute: create command denied to user: 'grant_user'@'localhost' for table 'test3'
alter table grant_test.test2 add c int
Error in execute: alter command denied to user: 'grant_user'@'localhost' for table 'test2'
grant alter on grant_test.test2 to grant_user@localhost
alter table grant_test.test2 add c int
create index dummy ON grant_test.test (a)
Error in execute: index command denied to user: 'grant_user'@'localhost' for table 'test'
grant index on grant_test.test2 to grant_user@localhost
create index dummy ON grant_test.test2 (a)
insert into test2 SELECT a,a from test
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test2'
grant insert on test2 to grant_user@localhost
Error in execute: Table 'mysql.test2' doesn't exist
grant insert(a) on grant_test.test2 to grant_user@localhost
insert into test2 SELECT a,a from test
Error in execute: insert command denied to user: 'grant_user'@'localhost' for column 'c' in table 'test2'
grant insert(c) on grant_test.test2 to grant_user@localhost
insert into test2 SELECT a,a from test
select count(*) from test2,test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
select count(*) from test,test2
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
replace into test2 SELECT a from test
Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test2'
grant update on grant_test.test2 to grant_user@localhost
update test,test2 SET test2.a=test.a
update test,test2 SET test.b=test2.a where 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
update test,test2 SET test.a=2 where test2.a>100
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
update test,test2 SET test.a=test2.a
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
replace into test2 SELECT a,a from test
Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test2'
grant DELETE on grant_test.test2 to grant_user@localhost
replace into test2 SELECT a,a from test
insert into test (a) SELECT a from test2
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant SELECT on grant_test.test2 to grant_user@localhost
update test,test2 SET test.b=test2.a where 0
update test,test2 SET test.a=test2.a where test2.a>100
revoke UPDATE on grant_test.test2 from grant_user@localhost
grant UPDATE (c) on grant_test.test2 to grant_user@localhost
update test,test2 SET test.b=test2.a where 0
update test,test2 SET test.a=test2.a where test2.a>100
update test,test2 SET test2.a=test2.a where test2.a>100
Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
update test,test2 SET test2.c=test2.a where test2.a>100
revoke SELECT,UPDATE on grant_test.test2 from grant_user@localhost
grant UPDATE on grant_test.test2 to grant_user@localhost
drop table grant_test.test2
Error in execute: drop command denied to user: 'grant_user'@'localhost' for table 'test2'
grant select on grant_test.test2 to grant_user@localhost with grant option
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant select on grant_test.test2 to grant_user@localhost with grant option
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test3'
grant CREATE,DROP on grant_test.test3 to grant_user@localhost
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test3'
create table grant_test.test3 (a int)
grant INSERT on grant_test.test3 to grant_user@localhost
drop table grant_test.test3
rename table grant_test.test2 to grant_test.test3
rename table grant_test.test3 to grant_test.test2
Error in execute: alter command denied to user: 'grant_user'@'localhost' for table 'test3'
grant ALTER on grant_test.test3 to grant_user@localhost
rename table grant_test.test3 to grant_test.test2
revoke DROP on grant_test.test2 from grant_user@localhost
rename table grant_test.test2 to grant_test.test3
drop table if exists grant_test.test2,grant_test.test3
Error in execute: drop command denied to user: 'grant_user'@'localhost' for table 'test2'
drop table if exists grant_test.test2,grant_test.test3
create database grant_test
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop database grant_test
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
flush tables
Error in execute: Access denied. You need the RELOAD privilege for this operation
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Update,Delete,Create,Grant,Index,Alter Insert
localhost grant_test grant_user test root@localhost Select,Insert,Update,Delete
localhost grant_test grant_user test3 root@localhost Insert,Create,Drop,Alter
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test2 from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test3 from grant_user@localhost
revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select count(a) from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant create,update on grant_test.test2 to grant_user@localhost
create table grant_test.test2 (a int not null)
delete from grant_test.test where a=2
Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
delete from grant_test.test where A=2
Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
update test set b=5 where b>0
Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
update test,test2 SET test.b=5 where b>0
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant update(b),delete on grant_test.test to grant_user@localhost
revoke update(a) on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
delete from grant_test.test where a=2
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update test set b=5 where b>0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
grant select(a),select(b) on grant_test.test to grant_user@localhost
delete from grant_test.test where a=2
delete from grant_test.test where A=2
update test set b=5 where b>0
update test set a=11 where b>5
Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update test,test2 SET test.b=5 where b>0
update test,test2 SET test.a=11 where b>0
Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update test,test2 SET test.b=test2.a where b>0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
update test,test2 SET test.b=11 where test2.a>0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
select a,A from test
8 8
5 5
7 7
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Update,Create
localhost grant_test grant_user test root@localhost Delete Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Update,Create
revoke GRANT OPTION on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
drop table grant_test.test2
revoke create,update on grant_test.test2 from grant_user@localhost
grant select(a) on grant_test.test to grant_user@localhost
show full columns from test
a int(11) binary YES NULL select
b int(11) binary YES NULL
grant insert (b), update (b) on grant_test.test to grant_user@localhost
select count(a) from test
3
select count(skr.a) from test as skr
3
select count(a) from test where a > 5
2
insert into test (b) values (5)
insert into test (b) values (a)
update test set b=3 where a > 0
select * from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select b from test
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select a from test where b > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
insert into test (a) values (10)
Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
insert into test (b) values (b)
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
insert into test (a,b) values (1,5)
Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
insert into test (b) values (1),(b)
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update test set b=3 where b > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
localhost grant_test grant_user test b Insert,Update
localhost grant_test grant_user test a Select
revoke select(a), update (b) on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test root@localhost Insert
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
localhost grant_test grant_user test b Insert
select count(a) from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
update test set b=4
Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
grant select(a,b), update (a,b) on grant_test.test to grant_user@localhost
select count(a),count(b) from test where a+b > 0
3 3
insert into test (b) values (9)
update test set b=6 where b > 0
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
localhost grant_test grant_user test b Select,Insert,Update
localhost grant_test grant_user test a Select,Update
insert into test (a,b) values (12,12)
Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
grant insert on grant_test.* to grant_user@localhost
Connecting grant_user
insert into test (a,b) values (13,13)
revoke select(b) on grant_test.test from grant_user@localhost
select count(a) from test where a+b > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update test set b=5 where a=2
grant select on grant_test.test to grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
4
revoke select(b) on grant_test.test from grant_user@localhost
select count(a) from test where a+b > 0
4
revoke select on grant_test.test from grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant select(a) on grant_test.test to grant_user@localhost
select count(a) from test where a+b > 0
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
grant select on *.* to grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
4
revoke select on *.* from grant_user@localhost
grant select(b) on grant_test.test to grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
4
select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
localhost grant_test grant_user test b Select,Insert,Update
localhost grant_test grant_user test a Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select count(a) from test
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
select * from mysql.user order by hostname
Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'user'
select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
delete from user where user='grant_user'
delete from db where user='grant_user'
flush privileges
show grants for grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost'
grant ALL PRIVILEGES on grant_test.test to grant_user@localhost identified by 'dummy', grant_user@127.0.0.1 identified by 'dummy2'
Connecting grant_user
grant SELECT on grant_test.* to grant_user@localhost identified by ''
Connecting grant_user
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost identified by '', grant_user@127.0.0.1 identified by 'dummy2'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost identified by ''
show grants for grant_user@localhost
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
create table grant_test.test3 (a int, b int)
grant SELECT on grant_test.test3 to grant_user@localhost
grant FILE on *.* to grant_user@localhost
insert into grant_test.test3 values (1,1)
Connecting grant_user
select * into outfile '/tmp/mysql-grant.test' from grant_test.test3
revoke SELECT on grant_test.test3 from grant_user@localhost
grant SELECT(a) on grant_test.test3 to grant_user@localhost
select a from grant_test.test3
1
select * from grant_test.test3
Error in execute: select command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
select a,b from grant_test.test3
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
select b from grant_test.test3
Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
revoke SELECT(a) on grant_test.test3 from grant_user@localhost
revoke FILE on *.* from grant_user@localhost
drop table grant_test.test3
create table grant_test.test3 (a int)
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant INSERT on grant_test.test3 to grant_user@localhost
Connecting grant_user
select * into outfile '/tmp/mysql-grant.test' from grant_test.test3
Error in execute: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
grant SELECT on grant_test.test3 to grant_user@localhost
Connecting grant_user
LOCK TABLES grant_test.test3 READ
Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant LOCK TABLES on *.* to grant_user@localhost
show grants for grant_user@localhost
GRANT LOCK TABLES ON *.* TO 'grant_user'@'localhost'
GRANT SELECT, INSERT ON `grant_test`.`test3` TO 'grant_user'@'localhost'
select * from mysql.user where user='grant_user'
127.0.0.1 grant_user *042a99b3d247ae587783f647f2d69496d390aa71eab3 N N N N N N N N N N N N N N N N N N N N N 0 0 0
localhost grant_user N N N N N N N N N N N N N N N N N Y N N N 0 0 0
Connecting grant_user
LOCK TABLES grant_test.test3 READ
UNLOCK TABLES
revoke SELECT,INSERT,UPDATE,DELETE on grant_test.test3 from grant_user@localhost
Connecting grant_user
revoke LOCK TABLES on *.* from grant_user@localhost
Connecting grant_user
Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop table grant_test.test3
show grants for grant_user@localhost
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
grant all on *.* to grant_user@localhost WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
show grants for grant_user@localhost
GRANT ALL PRIVILEGES ON *.* TO 'grant_user'@'localhost' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
revoke LOCK TABLES on *.* from grant_user@localhost
flush privileges
show grants for grant_user@localhost
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'grant_user'@'localhost' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
revoke ALL PRIVILEGES on *.* from grant_user@localhost
show grants for grant_user@localhost
GRANT USAGE ON *.* TO 'grant_user'@'localhost' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
drop database grant_test
delete from user where user='grant_user'
delete from db where user='grant_user'
delete from tables_priv
delete from columns_priv
flush privileges
end of test
Creating tables test_lock_1 and test_lock_2 in database test
Reading started
Writing started
Write: 1000
Read: 1000 Found: 28
Write: 2000
Write: 3000
Read: 2000 Found: 79
Write: 4000
Write: 5000
Read: 3000 Found: 165
Write: 6000
Write: 7000
Read: 4000 Found: 291
Write: 8000
Write: 9000
Write: 10000
Writing done
Read: 5000 Found: 482
Read: 6000 Found: 680
Read: 7000 Found: 862
Read: 8000 Found: 1076
Read: 9000 Found: 1275
Read: 10000 Found: 1507
Reading done Found: 1507
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment