mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
cleanup: move safe_str*() from sql_acl.cc to m_string.h
This commit is contained in:
parent
9bd5d54c11
commit
99677cc510
3 changed files with 15 additions and 14 deletions
|
@ -239,4 +239,15 @@ static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
|
|||
lex_str->length= strlen(c_str);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
static inline char *safe_str(char *str)
|
||||
{ return str ? str : const_cast<char*>(""); }
|
||||
#endif
|
||||
|
||||
static inline const char *safe_str(const char *str)
|
||||
{ return str ? str : ""; }
|
||||
|
||||
static inline size_t safe_strlen(const char *str)
|
||||
{ return str ? strlen(str) : 0; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
|
||||
#ifndef _maria_h
|
||||
#define _maria_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <my_base.h>
|
||||
#include <my_sys.h>
|
||||
#include <m_ctype.h>
|
||||
|
@ -30,6 +27,10 @@ extern "C" {
|
|||
#include <myisamchk.h>
|
||||
#include <mysql/plugin.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MARIA_CANNOT_ROLLBACK
|
||||
|
||||
/*
|
||||
|
|
|
@ -205,17 +205,6 @@ static plugin_ref old_password_plugin;
|
|||
#endif
|
||||
static plugin_ref native_password_plugin;
|
||||
|
||||
static char *safe_str(char *str)
|
||||
{ return str ? str : const_cast<char*>(""); }
|
||||
|
||||
static const char *safe_str(const char *str)
|
||||
{ return str ? str : ""; }
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static size_t safe_strlen(const char *str)
|
||||
{ return str ? strlen(str) : 0; }
|
||||
#endif
|
||||
|
||||
/* Classes */
|
||||
|
||||
struct acl_host_and_ip
|
||||
|
|
Loading…
Reference in a new issue