2018-03-14 11:27:27 +08:00
|
|
|
/* $%BEGINLICENSE%$
|
|
|
|
Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation; version 2 of the
|
|
|
|
License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
|
|
02110-1301 USA
|
|
|
|
|
|
|
|
$%ENDLICENSE%$ */
|
|
|
|
|
2018-03-06 14:00:39 +08:00
|
|
|
#ifndef __SHARDING_PARSER_H__
|
|
|
|
#define __SHARDING_PARSER_H__
|
|
|
|
|
|
|
|
#include "network-mysqld.h"
|
|
|
|
#include "sharding-query-plan.h"
|
|
|
|
#include "sql-context.h"
|
|
|
|
|
2018-03-20 14:19:44 +08:00
|
|
|
#define USE_NON_SHARDING_TABLE 0 /* default */
|
|
|
|
#define USE_SHARDING 1 /* default */
|
2018-03-06 14:00:39 +08:00
|
|
|
#define USE_DIS_TRAN 2
|
2018-03-20 14:19:44 +08:00
|
|
|
#define USE_ANY_SHARDINGS 3 /* default */
|
|
|
|
#define USE_ALL_SHARDINGS 4 /* default */
|
|
|
|
#define USE_ALL 5 /* default */
|
2018-03-06 14:00:39 +08:00
|
|
|
#define USE_SAME 6
|
|
|
|
#define USE_PREVIOUS_WARNING_CONN 7
|
|
|
|
#define USE_NONE 8
|
|
|
|
#define USE_PREVIOUS_TRAN_CONNS 9
|
|
|
|
#define ERROR_UNPARSABLE -1
|
|
|
|
|
2018-03-20 14:19:44 +08:00
|
|
|
NETWORK_API int sharding_parse_groups(GString *, sql_context_t *, query_stats_t *, unsigned int, sharding_plan_t *);
|
2018-03-06 14:00:39 +08:00
|
|
|
|
|
|
|
NETWORK_API GString *sharding_modify_sql(sql_context_t *, having_condition_t *);
|
|
|
|
|
|
|
|
NETWORK_API void sharding_filter_sql(sql_context_t *);
|
|
|
|
|
|
|
|
#endif //__SHARDING_PARSER_H__
|