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
c3bab1c7
Commit
c3bab1c7
authored
Oct 04, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to make things work in the max version
parent
29ea2e56
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1116 additions
and
13 deletions
+1116
-13
acinclude.m4
acinclude.m4
+35
-9
client/mysqltest.c
client/mysqltest.c
+10
-1
libmysqld/Makefile.am
libmysqld/Makefile.am
+2
-2
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+101
-0
mysql-test/include/have_bdb.inc
mysql-test/include/have_bdb.inc
+2
-0
mysql-test/include/have_gemini.inc
mysql-test/include/have_gemini.inc
+2
-0
mysql-test/include/have_innodb.inc
mysql-test/include/have_innodb.inc
+2
-0
mysql-test/include/have_openssl.inc
mysql-test/include/have_openssl.inc
+2
-0
mysql-test/include/have_openssl_1.inc
mysql-test/include/have_openssl_1.inc
+2
-0
mysql-test/include/have_openssl_2.inc
mysql-test/include/have_openssl_2.inc
+2
-0
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+569
-0
mysql-test/r/have_openssl.require
mysql-test/r/have_openssl.require
+1
-1
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+386
-0
No files found.
acinclude.m4
View file @
c3bab1c7
...
...
@@ -707,6 +707,32 @@ AC_DEFUN(MYSQL_CHECK_VIO, [
AC_SUBST([vio_libs])
])
AC_DEFUN(MYSQL_FIND_OPENSSL, [
for d in /usr/ssl/include /usr/local/ssl/include /usr/include/openssl \
/usr/include/ssl /opt/ssl/include /opt/openssl/include ; do
if test -f $d/ssl.h ; then
OPENSSL_INCLUDE=$d
fi
done
for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /opt/ssl/lib /opt/openssl/lib ; do
if test -f $d/libssl.a -o -f $d/libssl.so ; then
OPENSSL_LIB=$d
fi
done
if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then
echo "Could not find an installation of OpenSSL"
if test -n "$OPENSSL_LIB" ; then
if test "$IS_LINUX" = "true"; then
echo "Looks like you've forgotted to install OpenSSL development RPM"
fi
fi
exit 1
fi
])
AC_DEFUN(MYSQL_CHECK_OPENSSL, [
AC_MSG_CHECKING(for OpenSSL)
...
...
@@ -719,15 +745,15 @@ AC_MSG_CHECKING(for OpenSSL)
openssl_includes=""
if test "$openssl" = "yes"
then
if test -n "$vio_dir"
then
AC_MSG_RESULT(yes)
openssl_libs="-L/usr/local/ssl/lib -lssl -lcrypto
"
openssl_includes="-I/usr/local/ssl/include"
AC_DEFINE(HAVE_OPENSSL
)
else
AC_MSG_RESULT(disabled because --with-vio wasn not used)
fi
MYSQL_FIND_OPENSSL
#force VIO use
vio_dir="vio"
vio_libs="../vio/libvio.la
"
AC_DEFINE(HAVE_VIO)
AC_MSG_RESULT(yes
)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
openssl_includes="-I$OPENSSL_INCLUDE"
AC_DEFINE(HAVE_OPENSSL)
else
AC_MSG_RESULT(no)
fi
...
...
client/mysqltest.c
View file @
c3bab1c7
...
...
@@ -337,8 +337,10 @@ static void free_used_memory()
{
uint
i
;
DBUG_ENTER
(
"free_used_memory"
);
#ifndef EMBEDDED_LIBRARY
if
(
manager
)
mysql_manager_close
(
manager
);
#endif
close_cons
();
close_files
();
hash_free
(
&
var_hash
);
...
...
@@ -599,6 +601,7 @@ int open_file(const char* name)
return
0
;
}
#ifndef EMBEDDED_LIBRARY
int
do_server_start
(
struct
st_query
*
q
)
{
return
do_server_op
(
q
,
"start"
);
...
...
@@ -636,6 +639,7 @@ int do_server_op(struct st_query* q,const char* op)
return
0
;
}
#endif
int
do_source
(
struct
st_query
*
q
)
{
...
...
@@ -1182,6 +1186,7 @@ char* safe_get_param(char* str, char** arg, const char* msg)
DBUG_RETURN
(
str
);
}
#ifndef EMBEDDED_LIBRARY
void
init_manager
()
{
if
(
!
(
manager
=
mysql_manager_init
(
0
)))
...
...
@@ -1192,6 +1197,7 @@ void init_manager()
manager
->
last_errno
);
}
#endif
int
safe_connect
(
MYSQL
*
con
,
const
char
*
host
,
const
char
*
user
,
const
char
*
pass
,
...
...
@@ -2101,8 +2107,9 @@ int main(int argc, char** argv)
if
(
cur_file
==
file_stack
)
*++
cur_file
=
stdin
;
*
lineno
=
1
;
#ifndef EMBEDDED_LIBRARY
init_manager
();
#endif
if
(
!
(
mysql_init
(
&
cur_con
->
mysql
)))
die
(
"Failed in mysql_init()"
);
cur_con
->
name
=
my_strdup
(
"default"
,
MYF
(
MY_WME
));
...
...
@@ -2134,8 +2141,10 @@ int main(int argc, char** argv)
case
Q_DISABLE_QUERY_LOG
:
disable_query_log
=
1
;
break
;
case
Q_SOURCE
:
do_source
(
q
);
break
;
case
Q_SLEEP
:
do_sleep
(
q
);
break
;
#ifndef EMBEDDED_LIBRARY
case
Q_SERVER_START
:
do_server_start
(
q
);
break
;
case
Q_SERVER_STOP
:
do_server_stop
(
q
);
break
;
#endif
case
Q_INC
:
do_inc
(
q
);
break
;
case
Q_DEC
:
do_dec
(
q
);
break
;
case
Q_ECHO
:
do_echo
(
q
);
break
;
...
...
libmysqld/Makefile.am
View file @
c3bab1c7
...
...
@@ -47,7 +47,7 @@ sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \
hostname.cc init.cc
\
item.cc item_buff.cc item_cmpfunc.cc item_create.cc
\
item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc
\
item_uniq.cc key.cc lock.cc log.cc log_event.cc
md5.c
\
item_uniq.cc key.cc lock.cc log.cc log_event.cc
\
mini_client.cc net_pkg.cc net_serv.cc opt_ft.cc opt_range.cc
\
opt_sum.cc procedure.cc records.cc slave.cc sql_acl.cc
\
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc
\
...
...
@@ -65,7 +65,7 @@ sqlobjects = convert.lo derror.lo field.lo field_conv.lo filesort.lo \
hostname.lo init.lo
\
item.lo item_buff.lo item_cmpfunc.lo item_create.lo
\
item_func.lo item_strfunc.lo item_sum.lo item_timefunc.lo
\
item_uniq.lo key.lo lock.lo log.lo log_event.lo
md5.lo
\
item_uniq.lo key.lo lock.lo log.lo log_event.lo
\
mini_client.lo net_pkg.lo net_serv.lo opt_ft.lo opt_range.lo
\
opt_sum.lo procedure.lo records.lo slave.lo sql_acl.lo
\
sql_analyse.lo sql_base.lo sql_cache.lo sql_class.lo
\
...
...
libmysqld/libmysqld.c
View file @
c3bab1c7
...
...
@@ -1473,6 +1473,107 @@ mysql_read_query_result(MYSQL *mysql)
DBUG_RETURN
(
0
);
}
/****************************************************************************
* A modified version of connect(). connect2() allows you to specify
* a timeout value, in seconds, that we should wait until we
* derermine we can't connect to a particular host. If timeout is 0,
* my_connect() will behave exactly like connect().
*
* Base version coded by Steve Bernacki, Jr. <steve@navinet.net>
*****************************************************************************/
int
my_connect
(
my_socket
s
,
const
struct
sockaddr
*
name
,
uint
namelen
,
uint
timeout
)
{
#if defined(__WIN__) || defined(OS2)
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
#else
int
flags
,
res
,
s_err
;
SOCKOPT_OPTLEN_TYPE
s_err_size
=
sizeof
(
uint
);
fd_set
sfds
;
struct
timeval
tv
;
time_t
start_time
,
now_time
;
/* If they passed us a timeout of zero, we should behave
* exactly like the normal connect() call does.
*/
if
(
timeout
==
0
)
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
flags
=
fcntl
(
s
,
F_GETFL
,
0
);
/* Set socket to not block */
#ifdef O_NONBLOCK
fcntl
(
s
,
F_SETFL
,
flags
|
O_NONBLOCK
);
/* and save the flags.. */
#endif
res
=
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
s_err
=
errno
;
/* Save the error... */
fcntl
(
s
,
F_SETFL
,
flags
);
if
((
res
!=
0
)
&&
(
s_err
!=
EINPROGRESS
))
{
errno
=
s_err
;
/* Restore it */
return
(
-
1
);
}
if
(
res
==
0
)
/* Connected quickly! */
return
(
0
);
/* Otherwise, our connection is "in progress." We can use
* the select() call to wait up to a specified period of time
* for the connection to suceed. If select() returns 0
* (after waiting howevermany seconds), our socket never became
* writable (host is probably unreachable.) Otherwise, if
* select() returns 1, then one of two conditions exist:
*
* 1. An error occured. We use getsockopt() to check for this.
* 2. The connection was set up sucessfully: getsockopt() will
* return 0 as an error.
*
* Thanks goes to Andrew Gierth <andrew@erlenstar.demon.co.uk>
* who posted this method of timing out a connect() in
* comp.unix.programmer on August 15th, 1997.
*/
FD_ZERO
(
&
sfds
);
FD_SET
(
s
,
&
sfds
);
/*
* select could be interrupted by a signal, and if it is,
* the timeout should be adjusted and the select restarted
* to work around OSes that don't restart select and
* implementations of select that don't adjust tv upon
* failure to reflect the time remaining
*/
start_time
=
time
(
NULL
);
for
(;;)
{
tv
.
tv_sec
=
(
long
)
timeout
;
tv
.
tv_usec
=
0
;
if
((
res
=
select
(
s
+
1
,
NULL
,
&
sfds
,
NULL
,
&
tv
))
>=
0
)
break
;
now_time
=
time
(
NULL
);
timeout
-=
(
uint
)
(
now_time
-
start_time
);
if
(
errno
!=
EINTR
||
(
int
)
timeout
<=
0
)
return
-
1
;
}
/* select() returned something more interesting than zero, let's
* see if we have any errors. If the next two statements pass,
* we've got an open socket!
*/
s_err
=
0
;
if
(
getsockopt
(
s
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
s_err
,
&
s_err_size
)
!=
0
)
return
(
-
1
);
if
(
s_err
)
{
/* getsockopt could succeed */
errno
=
s_err
;
return
(
-
1
);
/* but return an error... */
}
return
(
0
);
/* It's all good! */
#endif
}
int
STDCALL
mysql_real_query
(
MYSQL
*
mysql
,
const
char
*
query
,
uint
length
)
{
...
...
mysql-test/include/have_bdb.inc
View file @
c3bab1c7
--
require
r
/
have_bdb
.
require
disable_query_log
;
show
variables
like
"have_bdb"
;
enable_query_log
;
mysql-test/include/have_gemini.inc
View file @
c3bab1c7
--
require
r
/
have_gemini
.
require
disable_query_log
;
show
variables
like
"have_gemini"
;
enable_query_log
;
mysql-test/include/have_innodb.inc
View file @
c3bab1c7
--
require
r
/
have_innodb
.
require
disable_query_log
;
show
variables
like
"have_innodb"
;
enable_query_log
;
mysql-test/include/have_openssl.inc
View file @
c3bab1c7
--
require
r
/
have_openssl
.
require
disable_query_log
;
show
variables
like
"have_openssl"
;
enable_query_log
;
mysql-test/include/have_openssl_1.inc
View file @
c3bab1c7
--
require
r
/
have_openssl_1
.
require
disable_query_log
;
show
variables
like
"have_openssl"
;
enable_query_log
;
mysql-test/include/have_openssl_2.inc
View file @
c3bab1c7
--
require
r
/
have_openssl_2
.
require
disable_query_log
;
SHOW
STATUS
LIKE
"SSL_get_cipher"
;
enable_query_log
;
mysql-test/r/bdb.result
View file @
c3bab1c7
This diff is collapsed.
Click to expand it.
mysql-test/r/have_openssl.require
View file @
c3bab1c7
Variable_name Value
have_ssl YES
have_
open
ssl YES
mysql-test/r/innodb.result
View file @
c3bab1c7
This diff is collapsed.
Click to expand it.
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