Remove redundant flag value definitions

The response status flag values are already declared in the mysql_com.h
header.
This commit is contained in:
Markus Mäkelä 2017-04-04 08:57:06 +03:00
parent 673631084a
commit 5037646846
3 changed files with 9 additions and 21 deletions

View File

@ -62,6 +62,7 @@
#include <maxscale/housekeeper.h>
#include <maxscale/utils.h>
#include <mysql.h>
#include <mysql_com.h>
MXS_BEGIN_DECLS
@ -114,22 +115,6 @@ MXS_BEGIN_DECLS
#define MYSQL_DATABASE_MAXLEN 128
#define MYSQL_TABLE_MAXLEN 64
/** Response packet status bits for OK and EOF packets */
#define MXS_MYSQL_STATUS_IN_TRANS 0x0001
#define MXS_MYSQL_STATUS_AUTOCOMMIT 0x0002
#define MXS_MYSQL_MORE_RESULTS_EXISTS 0x0008
#define MXS_MYSQL_STATUS_NO_GOOD_INDEX_USED 0x0010
#define MXS_MYSQL_STATUS_NO_INDEX_USED 0x0020
#define MXS_MYSQL_STATUS_CURSOR_EXISTS 0x0040
#define MXS_MYSQL_STATUS_LAST_ROW_SENT 0x0080
#define MXS_MYSQL_STATUS_DB_DROPPED 0x0100
#define MXS_MYSQL_STATUS_NO_BACKSLASH_ESCAPES 0x0200
#define MXS_MYSQL_STATUS_METADATA_CHANGED 0x0400
#define MXS_MYSQL_QUERY_WAS_SLOW 0x0800
#define MXS_MYSQL_PS_OUT_PARAMS 0x1000
#define MXS_MYSQL_STATUS_IN_TRANS_READONLY 0x2000
#define MXS_MYSQL_SESSION_STATE_CHANGED 0x4000
#define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR)
#define SMALL_CHUNK 1024
#define MAX_CHUNK SMALL_CHUNK * 8 * 4

View File

@ -24,13 +24,15 @@
*
* @endverbatim
*/
#include <maxscale/buffer.h>
#include <string.h>
#include <strings.h>
#include <maxscale/buffer.h>
#include <maxscale/protocol/mysql.h>
#include <maxscale/alloc.h>
#include <maxscale/poll.h>
#include <maxscale/modutil.h>
#include <strings.h>
/** These are used when converting MySQL wildcards to regular expressions */
static SPINLOCK re_lock = SPINLOCK_INIT;
@ -661,7 +663,7 @@ int modutil_count_signal_packets(GWBUF *reply, int n_found, bool* more, size_t*
{
gwbuf_copy_data(reply, *offset, sizeof(header), header);
uint16_t* status = (uint16_t*)(header + MYSQL_HEADER_LEN + 1 + 2); // Skip command and warning count
*more = ((*status) & MXS_MYSQL_MORE_RESULTS_EXISTS);
*more = ((*status) & SERVER_MORE_RESULTS_EXIST);
*offset += pktlen;
break;
}

View File

@ -42,11 +42,12 @@
*
*/
#include <netinet/tcp.h>
#include <maxscale/utils.h>
#include <maxscale/protocol/mysql.h>
#include <maxscale/alloc.h>
#include <maxscale/log_manager.h>
#include <netinet/tcp.h>
#include <maxscale/modutil.h>
#include <maxscale/mysql_utils.h>
@ -1592,7 +1593,7 @@ bool mxs_mysql_more_results_after_ok(GWBUF *buffer, size_t extra_offset)
ptr += mxs_leint_bytes(ptr);
ptr += mxs_leint_bytes(ptr);
uint16_t* status = (uint16_t*)ptr;
rval = (*status) & MXS_MYSQL_MORE_RESULTS_EXISTS;
rval = (*status) & SERVER_MORE_RESULTS_EXIST;
}
else
{