Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
079678be
Commit
079678be
authored
Aug 30, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
parents
38d9ce96
9632f7d9
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
246 additions
and
159 deletions
+246
-159
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
Build-tools/Bootstrap
Build-tools/Bootstrap
+6
-4
VC++Files/sql/message.mc
VC++Files/sql/message.mc
+8
-0
acconfig.h
acconfig.h
+3
-0
configure.in
configure.in
+2
-0
mysql-test/r/lowercase_table.result
mysql-test/r/lowercase_table.result
+16
-5
mysql-test/t/flush_block_commit-master.opt
mysql-test/t/flush_block_commit-master.opt
+0
-1
mysql-test/t/lowercase_table.test
mysql-test/t/lowercase_table.test
+12
-5
mysys/my_getopt.c
mysys/my_getopt.c
+48
-39
sql/convert.cc
sql/convert.cc
+3
-0
sql/log.cc
sql/log.cc
+106
-87
sql/log_event.cc
sql/log_event.cc
+0
-2
sql/mysqld.cc
sql/mysqld.cc
+13
-7
sql/share/charsets/win1251.conf
sql/share/charsets/win1251.conf
+2
-2
sql/sql_base.cc
sql/sql_base.cc
+8
-5
sql/table.cc
sql/table.cc
+17
-1
support-files/Makefile.am
support-files/Makefile.am
+1
-1
No files found.
BitKeeper/etc/logging_ok
View file @
079678be
...
...
@@ -16,6 +16,7 @@ arjen@george.bitbike.com
bar@bar.intranet.mysql.r18.ru
bar@bar.mysql.r18.ru
bar@bar.udmsearch.izhnet.ru
bar@mysql.com
bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua
bk@admin.bk
...
...
Build-tools/Bootstrap
View file @
079678be
...
...
@@ -123,14 +123,16 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run))
if
(
$opt_pull
)
{
&
logger
("
Updating BK tree
$REPO
to latest ChangeSet first
");
$command
=
"
cd
$REPO
; bk pull; cd ..
";
&
run_command
(
$command
,
"
Could not update
$REPO
!
");
chdir
(
$REPO
)
or
&
abort
("
Could not chdir to
$REPO
!
");
&
run_command
("
bk pull
",
"
Could not update
$REPO
!
");
chdir
(
$PWD
)
or
&
abort
("
Could not chdir to
$PWD
!
");
unless
(
$opt_skip_manual
)
{
&
logger
("
Updating manual tree in
$opt_docdir
");
$command
=
"
cd
$opt_docdir
; bk pull; cd ..
";
&
run_command
(
$command
,
"
Could not update
$opt_docdir
!
");
chdir
(
$opt_docdir
)
or
&
abort
("
Could not chdir to
$opt_docdir
!
");
&
run_command
("
bk pull
",
"
Could not update
$opt_docdir
!
");
chdir
(
$PWD
)
or
&
abort
("
Could not chdir to
$PWD
!
");
}
}
...
...
VC++Files/sql/message.mc
0 → 100644
View file @
079678be
MessageId = 100
Severity = Error
Facility = Application
SymbolicName = MSG_DEFAULT
Language = English
%
1
For
more
information
,
see
Help
and
Support
Center
at
http:
//
www
.
mysql
.
com
.
acconfig.h
View file @
079678be
...
...
@@ -281,6 +281,9 @@
/* READLINE: */
#undef VOID_SIGHANDLER
/* Define this if you want extra character set conversion table*/
#undef DEFINE_ALL_CHARACTER_SETS
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
...
...
configure.in
View file @
079678be
...
...
@@ -2262,9 +2262,11 @@ elif test "$extra_charsets" = complex; then
CHARSETS
=
`
/bin/ls
-1
$srcdir
/strings/ctype-
*
.c |
\
sed
-e
's;^.*/ctype-;;'
-e
's;.c$;;'
`
CHARSETS
=
`
echo
$CHARSETS
`
# get rid of line breaks
AC_DEFINE
([
DEFINE_ALL_CHARACTER_SETS]
)
else
if
test
"
$extra_charsets
"
=
all
;
then
CHARSETS
=
"
$CHARSETS_AVAILABLE
$CHARSETS_DEPRECATED
"
AC_DEFINE
([
DEFINE_ALL_CHARACTER_SETS]
)
else
CHARSETS
=
`
echo
$extra_charsets
|
sed
-e
's/,/ /g'
`
fi
...
...
mysql-test/r/lowercase_table.result
View file @
079678be
drop table if exists t1,t2,t3,t4,T1;
drop database if exists mysqltest;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
...
...
@@ -39,12 +40,22 @@ Unknown table 'T1' in field list
select count(bags.a) from t1 as Bags;
Unknown table 'bags' in field list
drop table t1;
create database
foo
;
use
foo
;
create database
mysqltest
;
use
MYSQLTEST
;
create table t1 (a int);
select FOO.t1.* from FOO.t1;
select T1.a from MYSQLTEST.T1;
a
select t1.a from MYSQLTEST.T1;
Unknown table 't1' in field list
select mysqltest.t1.* from MYSQLTEST.t1;
a
select MYSQLTEST.t1.* from MYSQLTEST.t1;
a
select MYSQLTEST.T1.* from MYSQLTEST.T1;
a
select MYSQLTEST.T1.* from T1;
a
alter table t1 rename to T1;
select
FOO.t1.* from FOO
.t1;
select
MYSQLTEST.t1.* from MYSQLTEST
.t1;
a
drop database
FOO
;
drop database
mysqltest
;
mysql-test/t/flush_block_commit-master.opt
deleted
100644 → 0
View file @
38d9ce96
--innodb_lock_wait_timeout=5
mysql-test/t/lowercase_table.test
View file @
079678be
...
...
@@ -3,6 +3,7 @@
#
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
T1
;
drop
database
if
exists
mysqltest
;
create
table
T1
(
id
int
primary
key
,
Word
varchar
(
40
)
not
null
,
Index
(
Word
));
create
table
t4
(
id
int
primary
key
,
Word
varchar
(
40
)
not
null
);
INSERT
INTO
T1
VALUES
(
1
,
'a'
),
(
2
,
'b'
),
(
3
,
'c'
);
...
...
@@ -34,10 +35,16 @@ drop table t1;
#
# Test all caps database name
#
create
database
foo
;
use
foo
;
create
database
mysqltest
;
use
MYSQLTEST
;
create
table
t1
(
a
int
);
select
FOO
.
t1
.*
from
FOO
.
t1
;
select
T1
.
a
from
MYSQLTEST
.
T1
;
--
error
1109
select
t1
.
a
from
MYSQLTEST
.
T1
;
select
mysqltest
.
t1
.*
from
MYSQLTEST
.
t1
;
select
MYSQLTEST
.
t1
.*
from
MYSQLTEST
.
t1
;
select
MYSQLTEST
.
T1
.*
from
MYSQLTEST
.
T1
;
select
MYSQLTEST
.
T1
.*
from
T1
;
alter
table
t1
rename
to
T1
;
select
FOO
.
t1
.*
from
FOO
.
t1
;
drop
database
FOO
;
select
MYSQLTEST
.
t1
.*
from
MYSQLTEST
.
t1
;
drop
database
mysqltest
;
mysys/my_getopt.c
View file @
079678be
...
...
@@ -56,12 +56,12 @@ char *disabled_my_option= (char*) "0";
my_bool
my_getopt_print_errors
=
1
;
void
default_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...
)
void
default_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...
)
{
va_list
args
;
va_start
(
args
,
format
);
vfprintf
(
stderr
,
format
,
args
);
va_end
(
args
);
va_start
(
args
,
format
);
vfprintf
(
stderr
,
format
,
args
);
va_end
(
args
);
}
/*
...
...
@@ -75,8 +75,9 @@ void default_reporter( enum loglevel level, const char *format, ... )
*/
int
handle_options
(
int
*
argc
,
char
***
argv
,
const
struct
my_option
*
longopts
,
my_get_one_option
get_one_option
,
my_error_reporter
reporter
)
const
struct
my_option
*
longopts
,
my_get_one_option
get_one_option
,
my_error_reporter
reporter
)
{
uint
opt_found
,
argvpos
=
0
,
length
,
i
;
my_bool
end_of_options
=
0
,
must_be_var
,
set_maximum_value
,
special_used
,
...
...
@@ -90,7 +91,8 @@ int handle_options(int *argc, char ***argv,
(
*
argv
)
++
;
/* --- || ---- */
init_variables
(
longopts
);
if
(
!
reporter
)
reporter
=
&
default_reporter
;
if
(
!
reporter
)
reporter
=
&
default_reporter
;
for
(
pos
=
*
argv
,
pos_end
=
pos
+
*
argc
;
pos
!=
pos_end
;
pos
++
)
{
...
...
@@ -116,7 +118,8 @@ int handle_options(int *argc, char ***argv,
if
(
!*++
pos
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: Option '-O' requires an argument
\n
"
,
progname
);
reporter
(
ERROR_LEVEL
,
"%s: Option '-O' requires an argument
\n
"
,
progname
);
return
EXIT_ARGUMENT_REQUIRED
;
}
cur_arg
=
*
pos
;
...
...
@@ -132,7 +135,9 @@ int handle_options(int *argc, char ***argv,
if
(
!*
cur_arg
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: Option '--set-variable' requires an argument
\n
"
,
progname
);
reporter
(
ERROR_LEVEL
,
"%s: Option '--set-variable' requires an argument
\n
"
,
progname
);
return
EXIT_ARGUMENT_REQUIRED
;
}
}
...
...
@@ -144,7 +149,9 @@ int handle_options(int *argc, char ***argv,
if
(
!*++
pos
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: Option '--set-variable' requires an argument
\n
"
,
progname
);
reporter
(
ERROR_LEVEL
,
"%s: Option '--set-variable' requires an argument
\n
"
,
progname
);
return
EXIT_ARGUMENT_REQUIRED
;
}
cur_arg
=
*
pos
;
...
...
@@ -203,10 +210,10 @@ int handle_options(int *argc, char ***argv,
if
(
opt_found
>
1
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: ambiguous option '--%s-%s' (--%s-%s)
\n
"
,
progname
,
special_opt_prefix
[
i
],
cur_arg
,
special_opt_prefix
[
i
],
prev_found
);
reporter
(
ERROR_LEVEL
,
"%s: ambiguous option '--%s-%s' (--%s-%s)
\n
"
,
progname
,
special_opt_prefix
[
i
],
cur_arg
,
special_opt_prefix
[
i
],
prev_found
);
return
EXIT_AMBIGUOUS_OPTION
;
}
switch
(
i
)
{
...
...
@@ -238,16 +245,16 @@ int handle_options(int *argc, char ***argv,
if
(
must_be_var
)
{
if
(
my_getopt_print_errors
)
reporter
(
option_is_loose
?
WARNING_LEVEL
:
ERROR_LEVEL
,
"%s: unknown variable '%s'
\n
"
,
progname
,
cur_arg
);
reporter
(
option_is_loose
?
WARNING_LEVEL
:
ERROR_LEVEL
,
"%s: unknown variable '%s'
\n
"
,
progname
,
cur_arg
);
if
(
!
option_is_loose
)
return
EXIT_UNKNOWN_VARIABLE
;
}
else
{
if
(
my_getopt_print_errors
)
reporter
(
option_is_loose
?
WARNING_LEVEL
:
ERROR_LEVEL
,
"%s: unknown option '--%s'
\n
"
,
progname
,
cur_arg
);
reporter
(
option_is_loose
?
WARNING_LEVEL
:
ERROR_LEVEL
,
"%s: unknown option '--%s'
\n
"
,
progname
,
cur_arg
);
if
(
!
option_is_loose
)
return
EXIT_UNKNOWN_OPTION
;
}
...
...
@@ -263,23 +270,23 @@ int handle_options(int *argc, char ***argv,
if
(
must_be_var
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: variable prefix '%s' is not unique
\n
"
,
progname
,
cur_arg
);
reporter
(
ERROR_LEVEL
,
"%s: variable prefix '%s' is not unique
\n
"
,
progname
,
cur_arg
);
return
EXIT_VAR_PREFIX_NOT_UNIQUE
;
}
else
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: ambiguous option '--%s' (%s, %s)
\n
"
,
progname
,
cur_arg
,
prev_found
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: ambiguous option '--%s' (%s, %s)
\n
"
,
progname
,
cur_arg
,
prev_found
,
optp
->
name
);
return
EXIT_AMBIGUOUS_OPTION
;
}
}
if
(
must_be_var
&&
optp
->
var_type
==
GET_NO_ARG
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: option '%s' cannot take an argument
\n
"
,
progname
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: option '%s' cannot take an argument
\n
"
,
progname
,
optp
->
name
);
return
EXIT_NO_ARGUMENT_ALLOWED
;
}
if
(
optp
->
arg_type
==
NO_ARG
)
...
...
@@ -287,8 +294,9 @@ int handle_options(int *argc, char ***argv,
if
(
optend
&&
optp
->
var_type
!=
GET_BOOL
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: option '--%s' cannot take an argument
\n
"
,
progname
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: option '--%s' cannot take an argument
\n
"
,
progname
,
optp
->
name
);
return
EXIT_NO_ARGUMENT_ALLOWED
;
}
if
(
optp
->
var_type
==
GET_BOOL
)
...
...
@@ -325,8 +333,9 @@ int handle_options(int *argc, char ***argv,
if
(
!*++
pos
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: option '--%s' requires an argument
\n
"
,
progname
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: option '--%s' requires an argument
\n
"
,
progname
,
optp
->
name
);
return
EXIT_ARGUMENT_REQUIRED
;
}
argument
=
*
pos
;
...
...
@@ -375,9 +384,9 @@ int handle_options(int *argc, char ***argv,
if
(
!
pos
[
1
])
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: option '-%c' requires an argument
\n
"
,
progname
,
optp
->
id
);
reporter
(
ERROR_LEVEL
,
"%s: option '-%c' requires an argument
\n
"
,
progname
,
optp
->
id
);
return
EXIT_ARGUMENT_REQUIRED
;
}
argument
=
*++
pos
;
...
...
@@ -387,9 +396,9 @@ int handle_options(int *argc, char ***argv,
}
if
((
error
=
setval
(
optp
,
argument
,
set_maximum_value
)))
{
reporter
(
ERROR_LEVEL
,
"%s: Error while setting value '%s' to '%s'
\n
"
,
progname
,
argument
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: Error while setting value '%s' to '%s'
\n
"
,
progname
,
argument
,
optp
->
name
);
return
error
;
}
get_one_option
(
optp
->
id
,
optp
,
argument
);
...
...
@@ -399,8 +408,8 @@ int handle_options(int *argc, char ***argv,
if
(
!
opt_found
)
{
if
(
my_getopt_print_errors
)
reporter
(
ERROR_LEVEL
,
"%s: unknown option '-%c'
\n
"
,
progname
,
*
optend
);
reporter
(
ERROR_LEVEL
,
"%s: unknown option '-%c'
\n
"
,
progname
,
*
optend
);
return
EXIT_UNKNOWN_OPTION
;
}
}
...
...
@@ -409,9 +418,9 @@ int handle_options(int *argc, char ***argv,
}
if
((
error
=
setval
(
optp
,
argument
,
set_maximum_value
)))
{
reporter
(
ERROR_LEVEL
,
"%s: Error while setting value '%s' to '%s'
\n
"
,
progname
,
argument
,
optp
->
name
);
reporter
(
ERROR_LEVEL
,
"%s: Error while setting value '%s' to '%s'
\n
"
,
progname
,
argument
,
optp
->
name
);
return
error
;
}
get_one_option
(
optp
->
id
,
optp
,
argument
);
...
...
sql/convert.cc
View file @
079678be
...
...
@@ -20,6 +20,9 @@
** Some of the tables are hidden behind IFDEF to reduce some space.
** One can enable them by removing the // characters from the next comment
** One must also give a name to each mapping that one wants to use...
**
** All tables are activated if --with-extra-charsets=all or
** --with-extra-charsets=complex was given to configure.
*/
/* #define DEFINE_ALL_CHARACTER_SETS */
...
...
sql/log.cc
View file @
079678be
...
...
@@ -43,37 +43,41 @@ static bool test_if_number(const char *str,
#ifdef __NT__
static
int
eventSource
=
0
;
void
setupWindowsEventSource
()
{
if
(
eventSource
)
return
;
eventSource
=
1
;
HKEY
hRegKey
=
NULL
;
DWORD
dwError
=
0
;
TCHAR
szPath
[
MAX_PATH
];
void
setup_windows_event_source
()
{
HKEY
hRegKey
=
NULL
;
DWORD
dwError
=
0
;
TCHAR
szPath
[
MAX_PATH
];
DWORD
dwTypes
;
// Create the event source registry key
dwError
=
RegCreateKey
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
EventLog
\\
Application
\\
MySQL"
,
&
hRegKey
);
if
(
eventSource
)
// Ensure that we are only called once
return
;
eventSource
=
1
;
// Create the event source registry key
dwError
=
RegCreateKey
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
EventLog
\\
Application
\\
MySQL"
,
&
hRegKey
);
// Name of the PE module that contains the message resource
GetModuleFileName
(
NULL
,
szPath
,
MAX_PATH
);
/* Name of the PE module that contains the message resource */
GetModuleFileName
(
NULL
,
szPath
,
MAX_PATH
);
// Register EventMessageFile
dwError
=
RegSetValueEx
(
hRegKey
,
"EventMessageFile"
,
0
,
REG_EXPAND_SZ
,
(
PBYTE
)
szPath
,
strlen
(
szPath
)
+
1
);
/* Register EventMessageFile */
dwError
=
RegSetValueEx
(
hRegKey
,
"EventMessageFile"
,
0
,
REG_EXPAND_SZ
,
(
PBYTE
)
szPath
,
strlen
(
szPath
)
+
1
);
// Register supported event types
DWORD
dwTypes
=
EVENTLOG_ERROR_TYPE
|
EVENTLOG_WARNING_TYPE
|
EVENTLOG_INFORMATION_TYPE
;
dwError
=
RegSetValueEx
(
hRegKey
,
"TypesSupported"
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
dwTypes
,
sizeof
dwTypes
);
/* Register supported event types */
dwTypes
=
(
EVENTLOG_ERROR_TYPE
|
EVENTLOG_WARNING_TYPE
|
EVENTLOG_INFORMATION_TYPE
);
dwError
=
RegSetValueEx
(
hRegKey
,
"TypesSupported"
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
dwTypes
,
sizeof
dwTypes
);
RegCloseKey
(
hRegKey
);
RegCloseKey
(
hRegKey
);
}
#endif
#endif
/* __NT__ */
/****************************************************************************
...
...
@@ -1208,12 +1212,24 @@ bool MYSQL_LOG::write(Log_event* event_info)
/* Write log events to reset the 'run environment' of the SQL command */
if
(
thd
&&
thd
->
options
&
OPTION_NO_FOREIGN_KEY_CHECKS
)
if
(
thd
)
{
Query_log_event
e
(
thd
,
"SET FOREIGN_KEY_CHECKS=1"
,
24
,
0
);
e
.
set_log_pos
(
this
);
if
(
e
.
write
(
file
))
goto
err
;
if
(
thd
->
options
&
OPTION_NO_FOREIGN_KEY_CHECKS
)
{
Query_log_event
e
(
thd
,
"SET FOREIGN_KEY_CHECKS=1"
,
24
,
0
);
e
.
set_log_pos
(
this
);
if
(
e
.
write
(
file
))
goto
err
;
}
#if MYSQL_VERSION_ID < 40100
if
(
thd
->
variables
.
convert_set
)
{
Query_log_event
e
(
thd
,
"SET CHARACTER SET DEFAULT"
,
25
,
0
);
e
.
set_log_pos
(
this
);
if
(
e
.
write
(
file
))
goto
err
;
}
#endif
}
/*
...
...
@@ -1732,33 +1748,33 @@ static bool test_if_number(register const char *str,
}
/* test_if_number */
void
print_buffer_to_file
(
enum
loglevel
level
,
const
char
*
buffer
)
void
print_buffer_to_file
(
enum
loglevel
level
,
const
char
*
buffer
)
{
time_t
skr
;
struct
tm
tm_tmp
;
struct
tm
*
start
;
DBUG_
ENTER
(
"print_buffer_to_log"
);
DBUG_ENTER
(
"print_buffer_to_file"
);
DBUG_
PRINT
(
"enter"
,(
"buffer: %s"
,
buffer
)
);
VOID
(
pthread_mutex_lock
(
&
LOCK_error_log
));
skr
=
time
(
NULL
);
localtime_r
(
&
skr
,
&
tm_tmp
);
start
=&
tm_tmp
;
fprintf
(
stderr
,
"%02d%02d%02d %2d:%02d:%02d [%s] %s
\n
"
,
fprintf
(
stderr
,
"%02d%02d%02d %2d:%02d:%02d [%s] %s
\n
"
,
start
->
tm_year
%
100
,
start
->
tm_mon
+
1
,
start
->
tm_mday
,
start
->
tm_hour
,
start
->
tm_min
,
start
->
tm_sec
,
level
==
ERROR_LEVEL
?
"ERROR"
:
level
==
WARNING_LEVEL
?
"WARNING"
:
"INFORMATION"
,
buffer
);
(
level
==
ERROR_LEVEL
?
"ERROR"
:
level
==
WARNING_LEVEL
?
"WARNING"
:
"INFORMATION"
),
buffer
);
fflush
(
stderr
);
VOID
(
pthread_mutex_unlock
(
&
LOCK_error_log
));
DBUG_VOID_RETURN
;
}
...
...
@@ -1772,6 +1788,7 @@ void sql_perror(const char *message)
#endif
}
bool
flush_error_log
()
{
bool
result
=
0
;
...
...
@@ -1820,122 +1837,124 @@ bool flush_error_log()
#ifdef __NT__
void
print_buffer_to_nt_eventlog
(
enum
loglevel
level
,
char
*
buff
,
int
buffLen
)
void
print_buffer_to_nt_eventlog
(
enum
loglevel
level
,
char
*
buff
,
uint
length
,
int
buffLen
)
{
HANDLE
event
;
char
*
buffptr
;
LPCSTR
*
buffmsgptr
;
DBUG_ENTER
(
"print_buffer_to_nt_eventlog"
);
DBUG_ENTER
(
"print_buffer_to_nt_eventlog"
);
buffptr
=
buff
;
if
(
strlen
(
buff
)
>
(
uint
)(
buffLen
-
4
))
buffptr
=
buff
;
if
(
length
>
(
uint
)(
buffLen
-
4
))
{
char
*
newBuff
=
new
char
[
strlen
(
buff
)
+
4
];
strcpy
(
newBuff
,
buff
);
buffptr
=
newBuff
;
char
*
newBuff
=
new
char
[
length
+
4
];
strcpy
(
newBuff
,
buff
);
buffptr
=
newBuff
;
}
str
cat
(
buffptr
,
"
\r\n\r\n
"
);
buffmsgptr
=
(
LPCSTR
*
)
&
buffptr
;
str
mov
(
buffptr
+
length
,
"
\r\n\r\n
"
);
buffmsgptr
=
(
LPCSTR
*
)
&
buffptr
;
// Keep windows happy
setup
WindowsEventS
ource
();
if
(
event
=
RegisterEventSource
(
NULL
,
"MySQL"
))
setup
_windows_event_s
ource
();
if
(
(
event
=
RegisterEventSource
(
NULL
,
"MySQL"
)
))
{
switch
(
level
){
switch
(
level
)
{
case
ERROR_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_ERROR_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
ReportEvent
(
event
,
EVENTLOG_ERROR_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
break
;
case
WARNING_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_WARNING_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
ReportEvent
(
event
,
EVENTLOG_WARNING_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
break
;
case
INFORMATION_LEVEL
:
ReportEvent
(
event
,
EVENTLOG_INFORMATION_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
ReportEvent
(
event
,
EVENTLOG_INFORMATION_TYPE
,
0
,
MSG_DEFAULT
,
NULL
,
1
,
0
,
buffmsgptr
,
NULL
);
break
;
}
DeregisterEventSource
(
event
);
}
/
/ if we created a string buffer, then delete it
if
(
buffptr
!=
buff
)
/
* if we created a string buffer, then delete it */
if
(
buffptr
!=
buff
)
delete
[]
buffptr
;
DBUG_VOID_RETURN
;
}
#endif
#endif
/* __NT__ */
/*
Prints a printf style message to the error log and, under NT, to the Windows event log.
Prints a printf style message to the error log and, under NT, to the
Windows event log.
SYNOPSIS
vprint_msg_to_log()
event_type
Type of event to write (Error, Warning, or Info)
format
Printf style format of message
args
va_list list of arguments for the message
event_type Type of event to write (Error, Warning, or Info)
format Printf style format of message
args va_list list of arguments for the message
NOTE
IMPLEMENTATION
This function prints the message into a buffer and then sends that buffer
to other
functions to write that message to other logging sources.
This function prints the message into a buffer and then sends that buffer
to other
functions to write that message to other logging sources.
RETURN VALUES
void
*/
void
vprint_msg_to_log
(
enum
loglevel
level
,
const
char
*
format
,
va_list
args
)
{
char
buff
[
1024
];
uint
length
;
DBUG_ENTER
(
"vprint_msg_to_log"
);
my_vsnprintf
(
buff
,
sizeof
(
buff
)
-
5
,
format
,
args
);
print_buffer_to_file
(
level
,
buff
);
#ifndef DBUG_OFF
DBUG_PRINT
(
"error"
,(
"%s"
,
buff
));
#endif
length
=
my_vsnprintf
(
buff
,
sizeof
(
buff
)
-
5
,
format
,
args
);
print_buffer_to_file
(
level
,
buff
);
#ifdef __NT__
print_buffer_to_nt_eventlog
(
level
,
buff
,
sizeof
(
buff
)
);
print_buffer_to_nt_eventlog
(
level
,
buff
,
length
,
sizeof
(
buff
)
);
#endif
DBUG_VOID_RETURN
;
}
void
sql_print_error
(
const
char
*
format
,
...
)
void
sql_print_error
(
const
char
*
format
,
...
)
{
DBUG_ENTER
(
"sql_print_error"
);
va_list
args
;
va_start
(
args
,
format
);
vprint_msg_to_log
(
ERROR_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_ENTER
(
"sql_print_error"
);
va_start
(
args
,
format
);
vprint_msg_to_log
(
ERROR_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_VOID_RETURN
;
}
void
sql_print_warning
(
const
char
*
format
,
...
)
{
DBUG_ENTER
(
"sql_print_warning"
);
void
sql_print_warning
(
const
char
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
vprint_msg_to_log
(
WARNING_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_ENTER
(
"sql_print_warning"
);
va_start
(
args
,
format
);
vprint_msg_to_log
(
WARNING_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_VOID_RETURN
;
}
void
sql_print_information
(
const
char
*
format
,
...
)
{
DBUG_ENTER
(
"sql_print_information"
);
void
sql_print_information
(
const
char
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
vprint_msg_to_log
(
INFORMATION_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_ENTER
(
"sql_print_information"
);
va_start
(
args
,
format
);
vprint_msg_to_log
(
INFORMATION_LEVEL
,
format
,
args
);
va_end
(
args
);
DBUG_VOID_RETURN
;
}
sql/log_event.cc
View file @
079678be
...
...
@@ -1932,8 +1932,6 @@ end:
thd
->
query
=
0
;
// just to be sure
thd
->
query_length
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
// assume no convert for next query unless set explictly
thd
->
variables
.
convert_set
=
0
;
close_thread_tables
(
thd
);
free_root
(
&
thd
->
mem_root
,
MYF
(
MY_KEEP_PREALLOC
));
return
(
thd
->
query_error
?
thd
->
query_error
:
Log_event
::
exec_event
(
rli
));
...
...
sql/mysqld.cc
View file @
079678be
...
...
@@ -2247,6 +2247,10 @@ int main(int argc, char **argv)
if
(
!
opt_mysql_tmpdir
||
!
opt_mysql_tmpdir
[
0
])
opt_mysql_tmpdir
=
(
char
*
)
P_tmpdir
;
/* purecov: inspected */
/* needed by get_options */
(
void
)
pthread_mutex_init
(
&
LOCK_error_log
,
MY_MUTEX_INIT_FAST
);
set_options
();
get_options
(
argc
,
argv
);
set_server_version
();
...
...
@@ -2263,7 +2267,6 @@ int main(int argc, char **argv)
(
void
)
pthread_mutex_init
(
&
LOCK_thread_count
,
MY_MUTEX_INIT_FAST
);
(
void
)
pthread_mutex_init
(
&
LOCK_mapped_file
,
MY_MUTEX_INIT_SLOW
);
(
void
)
pthread_mutex_init
(
&
LOCK_status
,
MY_MUTEX_INIT_FAST
);
(
void
)
pthread_mutex_init
(
&
LOCK_error_log
,
MY_MUTEX_INIT_FAST
);
(
void
)
pthread_mutex_init
(
&
LOCK_delayed_insert
,
MY_MUTEX_INIT_FAST
);
(
void
)
pthread_mutex_init
(
&
LOCK_delayed_status
,
MY_MUTEX_INIT_FAST
);
(
void
)
pthread_mutex_init
(
&
LOCK_delayed_create
,
MY_MUTEX_INIT_SLOW
);
...
...
@@ -5100,21 +5103,24 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
return
0
;
}
/* Initiates DEBUG - but no debugging here ! */
void
option_error_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...
)
void
option_error_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
vprint_msg_to_log
(
level
,
format
,
args
);
va_end
(
args
);
va_start
(
args
,
format
);
vprint_msg_to_log
(
level
,
format
,
args
);
va_end
(
args
);
}
/* Initiates DEBUG - but no debugging here ! */
static
void
get_options
(
int
argc
,
char
**
argv
)
{
int
ho_error
;
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
,
option_error_reporter
)))
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
,
option_error_reporter
)))
exit
(
ho_error
);
#if defined(HAVE_BROKEN_REALPATH)
...
...
sql/share/charsets/win1251.conf
View file @
079678be
...
...
@@ -41,7 +41,7 @@
A0
A1
A2
A3
A4
A5
A6
A7
B8
A9
AA
AB
AC
AD
AE
AF
B0
B1
B2
B3
B4
B5
B6
B7
B8
B9
BA
BB
BC
BD
BE
BF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F
5
F7
F8
F9
FA
FB
FC
FD
FE
FF
F0
F1
F2
F3
F4
F5
F
6
F7
F8
F9
FA
FB
FC
FD
FE
FF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF
...
...
@@ -59,7 +59,7 @@
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
B0
B1
B2
B3
B4
B5
B6
B7
A8
B9
BA
BB
BC
BD
BE
BF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D
5
D7
D8
D9
DA
DB
DC
DD
DE
DF
D0
D1
D2
D3
D4
D5
D
6
D7
D8
D9
DA
DB
DC
DD
DE
DF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
...
...
sql/sql_base.cc
View file @
079678be
...
...
@@ -2066,13 +2066,16 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
uint
found
;
DBUG_ENTER
(
"insert_fields"
);
if
(
db_name
&&
lower_case_table_names
)
{
/* convert database to lower case for comparison */
strmake
(
name_buff
,
db_name
,
sizeof
(
name_buff
)
-
1
);
casedn_str
(
name_buff
);
db_name
=
name_buff
;
/*
convert database to lower case for comparison
We can't do this in Item_field as this would change the
'name' of the item which may be used in the select list
*/
strmake
(
name_buff
,
db_name
,
sizeof
(
name_buff
)
-
1
);
casedn_str
(
name_buff
);
db_name
=
name_buff
;
}
...
...
sql/table.cc
View file @
079678be
...
...
@@ -993,8 +993,23 @@ ulong next_io_size(register ulong pos)
void
append_unescaped
(
String
*
res
,
const
char
*
pos
)
{
for
(;
*
pos
;
pos
++
)
#ifdef USE_MB
const
char
*
end
=
pos
+
strlen
(
pos
);
#endif
for
(;
*
pos
;
)
{
#if defined(USE_MB) && MYSQL_VERSION_ID < 40100
uint
mblen
;
if
(
use_mb
(
default_charset_info
)
&&
(
mblen
=
my_ismbchar
(
default_charset_info
,
pos
,
end
)))
{
res
->
append
(
pos
,
mblen
);
pos
+=
mblen
;
continue
;
}
#endif
switch
(
*
pos
)
{
case
0
:
/* Must be escaped for 'mysql' */
res
->
append
(
'\\'
);
...
...
@@ -1020,6 +1035,7 @@ void append_unescaped(String *res,const char *pos)
res
->
append
(
*
pos
);
break
;
}
pos
++
;
}
}
...
...
support-files/Makefile.am
View file @
079678be
...
...
@@ -22,7 +22,7 @@ EXTRA_DIST = mysql.spec.sh \
my-medium.cnf.sh
\
my-large.cnf.sh
\
my-huge.cnf.sh
\
my-innodb-heavy-4G
\
my-innodb-heavy-4G
.cnf.sh
\
mysql-log-rotate.sh
\
mysql.server.sh
\
binary-configure.sh
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment