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
494a75c8
Commit
494a75c8
authored
Jul 03, 2022
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-28888 : Embedded MariaDB does not build on Windows
Add limited support for building embedded library (DLL only).
parent
0c62b6d5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
21 deletions
+28
-21
cmake/libutils.cmake
cmake/libutils.cmake
+5
-1
libmysqld/CMakeLists.txt
libmysqld/CMakeLists.txt
+1
-0
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+11
-11
sql/mysqld.cc
sql/mysqld.cc
+11
-9
No files found.
cmake/libutils.cmake
View file @
494a75c8
...
...
@@ -154,7 +154,11 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# (can be a static or shared lib)
IF
(
LIB_TYPE STREQUAL
"STATIC_LIBRARY"
)
SET
(
STATIC_TGTS
${
STATIC_TGTS
}
${
LIB
}
)
IF
(
MSVC
)
TARGET_LINK_LIBRARIES
(
${
TARGET
}
PRIVATE
${
LIB
}
)
ELSE
()
SET
(
STATIC_LIBS
${
STATIC_LIBS
}
$<TARGET_FILE:
${
LIB
}
>
)
ENDIF
()
ADD_DEPENDENCIES
(
${
TARGET
}
${
LIB
}
)
# Extract dependent OS libraries
GET_DEPENDEND_OS_LIBS
(
${
LIB
}
LIB_OSLIBS
)
...
...
libmysqld/CMakeLists.txt
View file @
494a75c8
...
...
@@ -148,6 +148,7 @@ ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
IF
(
TARGET pcre2
)
ADD_DEPENDENCIES
(
sql_embedded pcre2
)
ENDIF
()
TARGET_LINK_LIBRARIES
(
sql_embedded LINK_PRIVATE tpool
${
CRC32_LIBRARY
}
)
# On Windows, static embedded server library is called mysqlserver.lib
# On Unix, it is libmysqld.a
...
...
libmysqld/lib_sql.cc
View file @
494a75c8
...
...
@@ -485,7 +485,7 @@ MYSQL_METHODS embedded_methods=
char
**
copy_arguments
(
int
argc
,
char
**
argv
)
{
uin
t
length
=
0
;
size_
t
length
=
0
;
char
**
from
,
**
res
,
**
end
=
argv
+
argc
;
for
(
from
=
argv
;
from
!=
end
;
from
++
)
...
...
@@ -1100,11 +1100,11 @@ bool Protocol_text::store_field_metadata(const THD * thd,
client_field
->
flags
=
(
uint16
)
server_field
.
flags
;
client_field
->
decimals
=
server_field
.
decimals
;
client_field
->
db_length
=
strlen
(
client_field
->
db
);
client_field
->
table_length
=
strlen
(
client_field
->
table
);
client_field
->
name_length
=
strlen
(
client_field
->
name
);
client_field
->
org_name_length
=
strlen
(
client_field
->
org_name
);
client_field
->
org_table_length
=
strlen
(
client_field
->
org_table
);
client_field
->
db_length
=
(
uint
)
strlen
(
client_field
->
db
);
client_field
->
table_length
=
(
uint
)
strlen
(
client_field
->
table
);
client_field
->
name_length
=
(
uint
)
strlen
(
client_field
->
name
);
client_field
->
org_name_length
=
(
uint
)
strlen
(
client_field
->
org_name
);
client_field
->
org_table_length
=
(
uint
)
strlen
(
client_field
->
org_table
);
client_field
->
catalog
=
dup_str_aux
(
field_alloc
,
"def"
,
3
,
cs
,
thd_cs
);
client_field
->
catalog_length
=
3
;
...
...
@@ -1378,12 +1378,12 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
if
(
!
(
field_buf
=
(
char
*
)
alloc_root
(
alloc
,
length
+
sizeof
(
uint
)
+
1
)))
return
TRUE
;
*
(
uint
*
)
field_buf
=
length
;
*
(
uint
*
)
field_buf
=
(
uint
)
length
;
*
next_field
=
field_buf
+
sizeof
(
uint
);
memcpy
((
uchar
*
)
*
next_field
,
from
,
length
);
(
*
next_field
)[
length
]
=
0
;
if
(
next_mysql_field
->
max_length
<
length
)
next_mysql_field
->
max_length
=
length
;
next_mysql_field
->
max_length
=
(
ulong
)
length
;
++
next_field
;
++
next_mysql_field
;
return
FALSE
;
...
...
@@ -1393,7 +1393,7 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
bool
Protocol
::
net_store_data_cs
(
const
uchar
*
from
,
size_t
length
,
CHARSET_INFO
*
from_cs
,
CHARSET_INFO
*
to_cs
)
{
uint
conv_length
=
to_cs
->
mbmaxlen
*
length
/
from_cs
->
mbminlen
;
size_t
conv_length
=
length
*
to_cs
->
mbmaxlen
/
from_cs
->
mbminlen
;
uint
dummy_error
;
char
*
field_buf
;
if
(
!
thd
->
mysql
)
// bootstrap file handling
...
...
@@ -1404,10 +1404,10 @@ bool Protocol::net_store_data_cs(const uchar *from, size_t length,
*
next_field
=
field_buf
+
sizeof
(
uint
);
length
=
copy_and_convert
(
*
next_field
,
conv_length
,
to_cs
,
(
const
char
*
)
from
,
length
,
from_cs
,
&
dummy_error
);
*
(
uint
*
)
field_buf
=
length
;
*
(
uint
*
)
field_buf
=
(
uint
)
length
;
(
*
next_field
)[
length
]
=
0
;
if
(
next_mysql_field
->
max_length
<
length
)
next_mysql_field
->
max_length
=
length
;
next_mysql_field
->
max_length
=
(
ulong
)
length
;
++
next_field
;
++
next_mysql_field
;
return
false
;
...
...
sql/mysqld.cc
View file @
494a75c8
...
...
@@ -1827,6 +1827,13 @@ extern "C" sig_handler print_signal_warning(int sig)
#endif
}
#ifdef _WIN32
typedef
void
(
*
report_svc_status_t
)(
DWORD
current_state
,
DWORD
win32_exit_code
,
DWORD
wait_hint
);
static
void
dummy_svc_status
(
DWORD
,
DWORD
,
DWORD
)
{}
static
report_svc_status_t
my_report_svc_status
=
dummy_svc_status
;
#endif
#ifndef EMBEDDED_LIBRARY
extern
"C"
void
unireg_abort
(
int
exit_code
)
{
...
...
@@ -1872,13 +1879,6 @@ extern "C" void unireg_abort(int exit_code)
mysqld_exit
(
exit_code
);
}
#ifdef _WIN32
typedef
void
(
*
report_svc_status_t
)(
DWORD
current_state
,
DWORD
win32_exit_code
,
DWORD
wait_hint
);
static
void
dummy_svc_status
(
DWORD
,
DWORD
,
DWORD
)
{}
static
report_svc_status_t
my_report_svc_status
=
dummy_svc_status
;
#endif
static
void
mysqld_exit
(
int
exit_code
)
{
DBUG_ENTER
(
"mysqld_exit"
);
...
...
@@ -4564,6 +4564,7 @@ void ssl_acceptor_stats_update(int sslaccept_ret)
static
void
init_ssl
()
{
#if !defined(EMBEDDED_LIBRARY)
/*
Not need to check require_secure_transport on the Linux,
because it always has Unix domain sockets that are secure:
...
...
@@ -4579,7 +4580,7 @@ static void init_ssl()
unireg_abort
(
1
);
}
#endif
#if defined(HAVE_OPENSSL)
&& !defined(EMBEDDED_LIBRARY)
#if defined(HAVE_OPENSSL)
if
(
opt_use_ssl
)
{
enum
enum_ssl_init_error
error
=
SSL_INITERR_NOERROR
;
...
...
@@ -4620,7 +4621,8 @@ static void init_ssl()
}
if
(
des_key_file
)
load_des_key_file
(
des_key_file
);
#endif
/* HAVE_OPENSSL && ! EMBEDDED_LIBRARY */
#endif
/* HAVE_OPENSSL */
#endif
/* !EMBEDDED_LIBRARY */
}
/* Reinitialize SSL (FLUSH SSL) */
...
...
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