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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ced66387
Commit
ced66387
authored
May 30, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysys: ME_ERROR_LOG_ONLY flag
parent
c9061d11
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
22 deletions
+26
-22
include/my_sys.h
include/my_sys.h
+1
-0
include/mysql/service_my_print_error.h
include/mysql/service_my_print_error.h
+5
-4
plugin/aws_key_management/aws_key_management_plugin.cc
plugin/aws_key_management/aws_key_management_plugin.cc
+11
-11
sql/log.cc
sql/log.cc
+3
-3
sql/mysqld.cc
sql/mysqld.cc
+3
-1
sql/sp.cc
sql/sp.cc
+1
-1
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+1
-1
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+1
-1
No files found.
include/my_sys.h
View file @
ced66387
...
...
@@ -106,6 +106,7 @@ typedef struct my_aio_result {
#define ME_BELL 4U
/* Ring bell then printing message */
#define ME_ERROR_LOG 64
/**< write the error message to error log */
#define ME_ERROR_LOG_ONLY 128
/**< write the error message to error log only */
#define ME_NOTE 1024
/**< not error but just info */
#define ME_WARNING 2048
/**< not error but just warning */
#define ME_FATAL 4096
/**< fatal statement error */
...
...
include/mysql/service_my_print_error.h
View file @
ced66387
...
...
@@ -32,10 +32,11 @@ extern "C" {
#include <stdlib.h>
#endif
#define ME_ERROR_LOG 64
/* Write the message to the error log */
#define ME_NOTE 1024
/* Not an error, just a note */
#define ME_WARNING 2048
/* Not an error, just a warning */
#define ME_FATAL 4096
/* Fatal statement error */
#define ME_ERROR_LOG 64
/* Write the message to the error log */
#define ME_ERROR_LOG_ONLY 128
/* Write the error message to error log only */
#define ME_NOTE 1024
/* Not an error, just a note */
#define ME_WARNING 2048
/* Not an error, just a warning */
#define ME_FATAL 4096
/* Fatal statement error */
extern
struct
my_print_error_service_st
{
void
(
*
my_error_func
)(
unsigned
int
nr
,
unsigned
long
MyFlags
,
...);
...
...
plugin/aws_key_management/aws_key_management_plugin.cc
View file @
ced66387
...
...
@@ -229,7 +229,7 @@ static int aws_init()
client
=
new
KMSClient
(
clientConfiguration
);
if
(
!
client
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"Can
not initialize KMS client"
,
ME_ERROR_LOG
|
ME_WARNING
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"Can
't initialize KMS client"
,
ME_ERROR_LOG_ONLY
|
ME_WARNING
);
return
-
1
;
}
return
0
;
...
...
@@ -331,12 +331,12 @@ static int load_key(KEY_INFO *info)
if
(
!
ret
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: loaded key %u, version %u, key length %u bit"
,
ME_ERROR_LOG
|
ME_NOTE
,
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: loaded key %u, version %u, key length %u bit"
,
ME_ERROR_LOG
_ONLY
|
ME_NOTE
,
info
->
key_id
,
info
->
key_version
,(
uint
)
info
->
length
*
8
);
}
else
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: key %u, version %u could not be decrypted"
,
ME_ERROR_LOG
|
ME_WARNING
,
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: key %u, version %u could not be decrypted"
,
ME_ERROR_LOG
_ONLY
|
ME_WARNING
,
info
->
key_id
,
info
->
key_version
);
}
return
ret
;
...
...
@@ -435,13 +435,13 @@ static int read_and_decrypt_key(const char *path, KEY_INFO *info)
ifstream
ifs
(
path
,
ios
::
binary
|
ios
::
ate
);
if
(
!
ifs
.
good
())
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"can't open file %s"
,
ME_ERROR_LOG
,
path
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"can't open file %s"
,
ME_ERROR_LOG
_ONLY
,
path
);
return
(
-
1
);
}
size_t
pos
=
(
size_t
)
ifs
.
tellg
();
if
(
!
pos
||
pos
==
SIZE_T_MAX
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"invalid key file %s"
,
ME_ERROR_LOG
,
path
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"invalid key file %s"
,
ME_ERROR_LOG
_ONLY
,
path
);
return
(
-
1
);
}
std
::
vector
<
char
>
contents
(
pos
);
...
...
@@ -456,7 +456,7 @@ static int read_and_decrypt_key(const char *path, KEY_INFO *info)
if
(
decrypt
(
input
,
&
plaintext
,
&
errmsg
))
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: Decrypt failed for %s : %s"
,
ME_ERROR_LOG
,
path
,
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: Decrypt failed for %s : %s"
,
ME_ERROR_LOG
_ONLY
,
path
,
errmsg
.
c_str
());
return
-
1
;
}
...
...
@@ -465,7 +465,7 @@ static int read_and_decrypt_key(const char *path, KEY_INFO *info)
if
(
len
>
sizeof
(
info
->
data
))
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: encoding key too large for %s"
,
ME_ERROR_LOG
,
path
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: encoding key too large for %s"
,
ME_ERROR_LOG
_ONLY
,
path
);
return
(
ENCRYPTION_KEY_BUFFER_TOO_SMALL
);
}
memcpy
(
info
->
data
,
plaintext
.
GetUnderlyingData
(),
len
);
...
...
@@ -491,7 +491,7 @@ int aws_generate_encrypted_key(Aws::Utils::ByteBuffer *result)
outcome
=
client
->
GenerateDataKeyWithoutPlaintext
(
request
);
if
(
!
outcome
.
IsSuccess
())
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin : GenerateDataKeyWithoutPlaintext failed : %s - %s"
,
ME_ERROR_LOG
,
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin : GenerateDataKeyWithoutPlaintext failed : %s - %s"
,
ME_ERROR_LOG
_ONLY
,
outcome
.
GetError
().
GetExceptionName
().
c_str
(),
outcome
.
GetError
().
GetMessage
().
c_str
());
return
(
-
1
);
...
...
@@ -524,19 +524,19 @@ static int generate_and_save_datakey(uint keyid, uint version)
int
fd
=
open
(
filename
,
O_WRONLY
|
O_CREAT
|
O_BINARY
,
IF_WIN
(
_S_IREAD
,
S_IRUSR
|
S_IRGRP
|
S_IROTH
));
if
(
fd
<
0
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: Can't create file %s"
,
ME_ERROR_LOG
,
filename
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: Can't create file %s"
,
ME_ERROR_LOG
_ONLY
,
filename
);
return
(
-
1
);
}
unsigned
int
len
=
(
unsigned
int
)
byteBuffer
.
GetLength
();
if
(
write
(
fd
,
byteBuffer
.
GetUnderlyingData
(),
len
)
!=
len
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: can't write to %s"
,
ME_ERROR_LOG
,
filename
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: can't write to %s"
,
ME_ERROR_LOG
_ONLY
,
filename
);
close
(
fd
);
unlink
(
filename
);
return
(
-
1
);
}
close
(
fd
);
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: generated encrypted datakey for key id=%u, version=%u"
,
ME_ERROR_LOG
|
ME_NOTE
,
my_printf_error
(
ER_UNKNOWN_ERROR
,
"AWS KMS plugin: generated encrypted datakey for key id=%u, version=%u"
,
ME_ERROR_LOG
_ONLY
|
ME_NOTE
,
keyid
,
version
);
return
(
0
);
}
...
...
sql/log.cc
View file @
ced66387
...
...
@@ -2181,16 +2181,16 @@ void MYSQL_BIN_LOG::set_write_error(THD *thd, bool is_transactional)
{
if
(
is_transactional
)
{
my_message
(
ER_TRANS_CACHE_FULL
,
ER_THD
(
thd
,
ER_TRANS_CACHE_FULL
),
MYF
(
MY_WME
));
my_message
(
ER_TRANS_CACHE_FULL
,
ER_THD
(
thd
,
ER_TRANS_CACHE_FULL
),
MYF
(
0
));
}
else
{
my_message
(
ER_STMT_CACHE_FULL
,
ER_THD
(
thd
,
ER_STMT_CACHE_FULL
),
MYF
(
MY_WME
));
my_message
(
ER_STMT_CACHE_FULL
,
ER_THD
(
thd
,
ER_STMT_CACHE_FULL
),
MYF
(
0
));
}
}
else
{
my_error
(
ER_ERROR_ON_WRITE
,
MYF
(
MY_WME
),
name
,
errno
);
my_error
(
ER_ERROR_ON_WRITE
,
MYF
(
0
),
name
,
errno
);
}
DBUG_VOID_RETURN
;
...
...
sql/mysqld.cc
View file @
ced66387
...
...
@@ -3660,7 +3660,7 @@ extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
void
my_message_sql
(
uint
error
,
const
char
*
str
,
myf
MyFlags
)
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
MyFlags
&
ME_ERROR_LOG_ONLY
?
NULL
:
current_thd
;
Sql_condition
::
enum_warning_level
level
;
sql_print_message_func
func
;
DBUG_ENTER
(
"my_message_sql"
);
...
...
@@ -3669,6 +3669,8 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
DBUG_ASSERT
(
str
!=
NULL
);
DBUG_ASSERT
(
error
!=
0
);
DBUG_ASSERT
((
MyFlags
&
~
(
ME_BELL
|
ME_ERROR_LOG
|
ME_ERROR_LOG_ONLY
|
ME_NOTE
|
ME_WARNING
|
ME_FATAL
))
==
0
);
if
(
MyFlags
&
ME_NOTE
)
{
...
...
sql/sp.cc
View file @
ced66387
...
...
@@ -1468,7 +1468,7 @@ Sp_handler::sp_create_routine(THD *thd, const sp_head *sp) const
log_query
.
ptr
(),
log_query
.
length
(),
FALSE
,
FALSE
,
FALSE
,
0
))
{
my_error
(
ER_ERROR_ON_WRITE
,
MYF
(
MY_WME
),
"binary log"
,
-
1
);
my_error
(
ER_ERROR_ON_WRITE
,
MYF
(
0
),
"binary log"
,
-
1
);
goto
done
;
}
thd
->
variables
.
sql_mode
=
0
;
...
...
storage/maria/ha_maria.cc
View file @
ced66387
...
...
@@ -427,7 +427,7 @@ static void _ma_check_print_msg(HA_CHECK *param, const char *msg_type,
if
(
param
->
testflag
&
(
T_CREATE_MISSING_KEYS
|
T_SAFE_REPAIR
|
T_AUTO_REPAIR
))
{
my_message
(
ER_NOT_KEYFILE
,
msgbuf
,
MYF
(
MY_WME
));
my_message
(
ER_NOT_KEYFILE
,
msgbuf
,
MYF
(
0
));
if
(
thd
->
variables
.
log_warnings
>
2
)
sql_print_error
(
"%s.%s: %s"
,
param
->
db_name
,
param
->
table_name
,
msgbuf
);
return
;
...
...
storage/myisam/ha_myisam.cc
View file @
ced66387
...
...
@@ -158,7 +158,7 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type,
if
(
param
->
testflag
&
(
T_CREATE_MISSING_KEYS
|
T_SAFE_REPAIR
|
T_AUTO_REPAIR
))
{
my_message
(
ER_NOT_KEYFILE
,
msgbuf
,
MYF
(
MY_WME
));
my_message
(
ER_NOT_KEYFILE
,
msgbuf
,
MYF
(
0
));
if
(
thd
->
variables
.
log_warnings
>
2
&&
!
thd
->
log_all_errors
)
sql_print_error
(
"%s.%s: %s"
,
param
->
db_name
,
param
->
table_name
,
msgbuf
);
return
;
...
...
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