Skip to content

Commit ece01ef

Browse files
committed
After-review changes
* remove redundant code * fix tests * move declarations and defines where they belong
1 parent 1206763 commit ece01ef

File tree

13 files changed

+20
-389
lines changed

13 files changed

+20
-389
lines changed

client/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ INCLUDE_DIRECTORIES(
2525
${CMAKE_CURRENT_BINARY_DIR}
2626
)
2727

28-
ADD_DEFINITIONS(-DHAVE_OPENSSL=1)
29-
3028
INCLUDE_DIRECTORIES(BEFORE
3129
${CMAKE_BINARY_DIR}/libmariadb/include
3230
${CMAKE_SOURCE_DIR}/libmariadb/include)
3331

3432
## We will need libeay32.dll and ssleay32.dll when running client executables.
3533
COPY_OPENSSL_DLLS(copy_openssl_client)
3634

37-
38-
ADD_DEFINITIONS(-DHAVE_LIBMARIADB=1)
3935
SET(CLIENT_LIB mariadbclient mysys)
4036

4137
ADD_DEFINITIONS(${SSL_DEFINES})

client/mysql.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,8 +1367,6 @@ static bool do_connect(MYSQL *mysql, const char *host, const char *user,
13671367
opt_ssl_capath, opt_ssl_cipher);
13681368
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
13691369
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
1370-
char enforce= 1;
1371-
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &enforce);
13721370
}
13731371
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
13741372
(char*)&opt_ssl_verify_server_cert);
@@ -4621,23 +4619,6 @@ sql_real_connect(char *host,char *database,char *user,char *password,
46214619
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
46224620
if (using_opt_local_infile)
46234621
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
4624-
#if !defined(EMBEDDED_LIBRARY)
4625-
if (opt_use_ssl)
4626-
{
4627-
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
4628-
opt_ssl_capath, opt_ssl_cipher);
4629-
mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
4630-
mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
4631-
}
4632-
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
4633-
(my_bool*)&opt_ssl_verify_server_cert);
4634-
#endif
4635-
if (opt_protocol)
4636-
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
4637-
#ifdef HAVE_SMEM
4638-
if (shared_memory_base_name)
4639-
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
4640-
#endif
46414622
if (safe_updates)
46424623
{
46434624
char init_command[100];

client/mysqladmin.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <my_pthread.h> /* because of signal() */
2323
#include <sys/stat.h>
2424
#include <mysql.h>
25-
#include <sql_common.h>
2625
#include <mysql_version.h>
2726
#include <welcome_copyright_notice.h>
2827
#include <my_rnd.h>
@@ -545,16 +544,16 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
545544
{
546545
fprintf(stderr,
547546
"Check that mysqld is running and that the socket: '%s' exists!\n",
548-
unix_port ? unix_port : MYSQL_UNIX_ADDR);
547+
unix_port ? unix_port : mysql_unix_port);
549548
}
550549
else if (mysql_errno(mysql) == CR_CONN_HOST_ERROR ||
551550
mysql_errno(mysql) == CR_UNKNOWN_HOST)
552551
{
553552
fprintf(stderr,"Check that mysqld is running on %s",host);
554553
fprintf(stderr," and that the port is %d.\n",
555-
tcp_port ? tcp_port: MYSQL_PORT);
554+
tcp_port ? tcp_port: mysql_port);
556555
fprintf(stderr,"You can check this by doing 'telnet %s %d'\n",
557-
host, tcp_port ? tcp_port: MYSQL_PORT);
556+
host, tcp_port ? tcp_port: mysql_port);
558557
}
559558
}
560559
return 1;
@@ -1080,9 +1079,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
10801079
}
10811080
}
10821081
if (old)
1083-
my_make_scrambled_password_323(crypted_pw, typed_password, sizeof(crypted_pw));
1082+
my_make_scrambled_password_323(crypted_pw, typed_password, strlen(typed_password));
10841083
else
1085-
my_make_scrambled_password(crypted_pw, typed_password, sizeof(crypted_pw));
1084+
my_make_scrambled_password(crypted_pw, typed_password, strlen(typed_password));
10861085
}
10871086
else
10881087
crypted_pw[0]=0; /* No password */

cmake/iconv.cmake

Lines changed: 0 additions & 78 deletions
This file was deleted.

include/my_time.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
171171
return TRUE;
172172
}
173173

174+
/* Can't include mysqld_error.h, it needs mysys to build, thus hardcode 2 error values here. */
175+
#define ER_WARN_DATA_OUT_OF_RANGE 1264
176+
#define ER_WARN_INVALID_TIMESTAMP 1299
177+
174178
my_time_t
175179
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, uint *error_code);
176180

include/sql_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
113113
const char *format, ...);
114114

115115
/* client side of the pluggable authentication */
116+
struct st_vio;
116117
struct st_plugin_vio_info;
118+
void mpvio_info(struct st_vio *vio, struct st_plugin_vio_info *info);
117119
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
118120
const char *data_plugin, const char *db);
119121
int mysql_client_plugin_init();

mysys/my_static.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,10 @@ my_bool my_disable_sync=0;
9898
my_bool my_disable_async_io=0;
9999
my_bool my_disable_flush_key_blocks=0;
100100
my_bool my_disable_symlinks=0;
101+
102+
/* Typelib by all clients */
103+
const char *sql_protocol_names_lib[] =
104+
{ "TCP", "SOCKET", "PIPE", "MEMORY", NullS };
105+
106+
TYPELIB sql_protocol_typelib ={ array_elements(sql_protocol_names_lib) - 1, "",
107+
sql_protocol_names_lib, NULL };

mysys/typelib.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,3 @@ my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name,
409409
return res;
410410
}
411411

412-
/* Typelib by all clients */
413-
const char *sql_protocol_names_lib[] =
414-
{ "TCP", "SOCKET", "PIPE", "MEMORY", NullS };
415-
416-
TYPELIB sql_protocol_typelib ={ array_elements(sql_protocol_names_lib) - 1, "",
417-
sql_protocol_names_lib, NULL };
418-

0 commit comments

Comments
 (0)