Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fixes for MySQL 5.5 #1

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions driver/connect.c
Expand Up @@ -245,12 +245,14 @@ SQLRETURN myodbc_do_connect(DBC *dbc, DataSource *ds)
mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(const char *)&opt_ssl_verify_server_cert);

#if MYSQL_VERSION_ID >= 50660
if (ds->rsakey)
{
/* Read the public key on the client side */
mysql_options(mysql, MYSQL_SERVER_PUBLIC_KEY,
ds_get_utf8attr(ds->rsakey, &ds->rsakey8));
}
#endif

#if MYSQL_VERSION_ID >= 50710
{
Expand Down Expand Up @@ -511,10 +513,10 @@ SQLRETURN myodbc_do_connect(DBC *dbc, DataSource *ds)
}

#if MYSQL_VERSION_ID >= 50709
mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_length);
mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_len);
#else
// for older versions just use net_buffer_length() macro
dbc->net_buffer_length = net_buffer_length;
dbc->net_buffer_len = net_buffer_length;
#endif
return rc;

Expand Down
2 changes: 1 addition & 1 deletion driver/cursor.c
Expand Up @@ -1465,7 +1465,7 @@ static SQLRETURN batch_insert( STMT *stmt, SQLULEN irow, DYNAMIC_STRING *ext_que
We have a limited capacity to shove data across the wire, but
we handle this by sending in multiple calls to exec_stmt_query()
*/
if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_length)
if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_len)
{
break_insert= TRUE;
break;
Expand Down
2 changes: 1 addition & 1 deletion driver/driver.h
Expand Up @@ -378,7 +378,7 @@ typedef struct tagDBC
int txn_isolation;
uint port;
uint cursor_count;
ulong net_buffer_length;
ulong net_buffer_len;
uint commit_flag;
#ifdef THREAD
myodbc_mutex_t lock;
Expand Down
2 changes: 1 addition & 1 deletion driver/info.c
Expand Up @@ -587,7 +587,7 @@ MySQLGetInfo(SQLHDBC hdbc, SQLUSMALLINT fInfoType,
MYINFO_SET_USHORT(0);

case SQL_MAX_STATEMENT_LEN:
MYINFO_SET_ULONG(dbc->net_buffer_length);
MYINFO_SET_ULONG(dbc->net_buffer_len);

case SQL_MAX_TABLE_NAME_LEN:
MYINFO_SET_USHORT(NAME_LEN);
Expand Down
8 changes: 8 additions & 0 deletions util/stringutil.c
Expand Up @@ -983,3 +983,11 @@ SQLWCHAR *wchar_t_as_sqlwchar(wchar_t *from, SQLWCHAR *to, size_t len)
return out;
}
}

#if MYSQL_VERSION_ID < 50700
char *my_stpmov(char *dst, const char *src)
{
while ((*dst++ = *src++)) ;
return dst-1;
}
#endif
2 changes: 2 additions & 0 deletions util/stringutil.h
Expand Up @@ -120,6 +120,8 @@ SQLWCHAR *wchar_t_as_sqlwchar(wchar_t *from, SQLWCHAR *to, size_t len);
char * myodbc_strlwr(char *target, size_t len);
SQLCHAR* sqlwchar_as_utf8_simple(SQLWCHAR *s);

char *my_stpmov(char *dst, const char *src);

#ifdef __cplusplus
}
#endif
Expand Down