mark some file to been opensource for ce-farm

This commit is contained in:
niyuhang
2023-11-15 11:44:43 +00:00
committed by ob-robot
parent 4900683cff
commit c8ace58297
685 changed files with 1080566 additions and 111051 deletions

View File

@ -0,0 +1,694 @@
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
DROP TABLE if exists trade_sequence_000;
DROP TABLE if exists BUSINESS_ACTION_000;
DROP TABLE if exists BUSINESS_ACTIVITY_000;
DROP TABLE if exists NOTIFY_000 ;
DROP TABLE if exists NOTIFY_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_000 ;
DROP TABLE if exists TIMEOUT_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_LONG_000 ;
DROP TABLE if exists TIMEOUT_REMIND_000;
DROP TABLE if exists TRADE_BASE_000 ;
DROP TABLE if exists TRADE_CHARGE_000;
DROP TABLE if exists TRADE_EXT_000 ;
DROP TABLE if exists TRADE_FUND_BILL_000 ;
DROP TABLE if exists TRADE_GOODS_INFO_000 ;
DROP TABLE if exists TRADE_LOGISTICS_000;
DROP TABLE if exists TRADE_MESSAGE_BOARD_000 ;
DROP TABLE if exists TRADE_NOTE_000 ;
DROP TABLE if exists TRADE_OUTTRADE_000 ;
DROP TABLE if exists TRADE_PAYMENT_CLAUSE_000 ;
DROP TABLE if exists TRADE_PAYMENT_ORDER_000 ;
DROP TABLE if exists TRADE_PROCESS_000 ;
DROP TABLE if exists TRADE_REFUND_000 ;
DROP TABLE if exists TRADE_VOUCHER_000 ;
DROP TABLE if exists TRADE_RECEIVE_ADDRESS_000;
DROP TABLE if exists TRADE_COOPERATE_000;
DROP TABLE if exists TRADE_SETTLE_ORDER_000;
DROP TABLE if exists TRADE_PARTICIPANT_000;
DROP TABLE if exists BUSINESS_ACTIVITY_ASYNC_000;
DROP TABLE if exists EXTERFACE_INVOKE_000;
CREATE TABLE if not exists trade_sequence_000
(
name varchar(256),
value int,
min_value int,
max_value int,
step int,
gmt_create TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
gmt_modified TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
primary key (name)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTION_000
(
ACTION_ID int NOT NULL,
TX_ID varchar(128) NOT NULL,
NAME varchar(64) NOT NULL,
STATE CHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
CONTEXT varchar(4000),
primary key (ACTION_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTIVITY_000
(
TX_ID varchar(128) NOT NULL,
STATE VARCHAR(1) NOT NULL,
ACCOUNT_TRANS_STATE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
PROPAGATION VARCHAR(1),
CONTEXT varchar(2048),
primary key (TX_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists NOTIFY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
PARAMETER varchar(4000) NOT NULL,
GROUP_NO int NOT NULL,
STATUS VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFY TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
IW_USER_ID varchar(16),
CHANNEL_ENDPOINT varchar(200),
BUSINESS_ORDER varchar(128),
BUSINESS_TYPE varchar(50),
PLUGIN_HOST varchar(15),
GMT_LOCAL_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
primary key (id)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX NOTIFY_BUSINESS_ORDER1_IND ON NOTIFY_000 (BUSINESS_ORDER);
CREATE INDEX NOTIFY_PLUGIN_IND ON NOTIFY_000 (PLUGIN, CHANNEL_ENDPOINT);
CREATE TABLE if not exists NOTIFY_HISTORY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
PARAMETER varchar(4000) NOT NULL,
GROUP_NO int NOT NULL,
STATUS VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFY TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
IW_USER_ID varchar(16),
CHANNEL_ENDPOINT varchar(200),
BUSINESS_ORDER varchar(128),
BUSINESS_TYPE varchar(50),
PLUGIN_HOST varchar(15),
GMT_LOCAL_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX NOTIFY_HISTORY_000_BORDER_IND ON NOTIFY_HISTORY_000 (BUSINESS_ORDER);
CREATE INDEX NOTIFY_HISTORY_IG_IND ON NOTIFY_HISTORY_000 (IW_USER_ID, GROUP_NO);
CREATE TABLE if not exists TIMEOUT_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIOR_LEVEL int default 1,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX IND_BEYOND_TIMEOUT_ETIME ON TIMEOUT_000 (END_TIME);
CREATE INDEX TIMEOUT_000_PL_IND ON TIMEOUT_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_TNO_IND ON TIMEOUT_000 (TRADE_NO);
CREATE TABLE if not exists TIMEOUT_HISTORY_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIOR_LEVEL int,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (JOB_ID, TRADE_NO, ACTION_TYPE)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TIMEOUT_LONG_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIOR_LEVEL int ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TIMEOUT_LONG_ENDTIME_IND ON TIMEOUT_LONG_000 (END_TIME);
CREATE INDEX TIMEOUT_LONG_000_PL_IND ON TIMEOUT_LONG_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_LONG_TNO_IND ON TIMEOUT_LONG_000 (TRADE_NO);
CREATE TABLE if not exists TIMEOUT_REMIND_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIOR_LEVEL int ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX BY_TIMEOUT_REMIND_ETIME_IND ON TIMEOUT_REMIND_000 (END_TIME);
CREATE INDEX TIMEOUT_REMIND_000_PL_IND ON TIMEOUT_REMIND_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_REMIND_TNO_IND ON TIMEOUT_REMIND_000 (TRADE_NO);
CREATE TABLE if not exists TRADE_BASE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
OUT_TRADE_NO varchar(64),
SELLER_ACCOUNT varchar(100) NOT NULL,
SELLER_LOGIN_EMAIL varchar(100) NOT NULL,
BUYER_ACCOUNT varchar(100) NOT NULL,
BUYER_LOGIN_EMAIL varchar(100) NOT NULL,
SELLER_TYPE int,
BUYER_TYPE int,
TRADE_FROM varchar(100),
TRADE_EMAIL varchar(100),
OPERATOR_ROLE VARCHAR(1) NOT NULL,
TRADE_STATUS varchar(50) NOT NULL,
TOTAL_FEE int default 0 NOT NULL,
SERVICE_FEE_RATIO varchar(64),
SERVICE_FEE int default 0 NOT NULL,
CURRENCY varchar(3),
SELLER_ACTION varchar(200),
BUYER_ACTION varchar(200),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" ,
SELLER_USER_ID varchar(16),
BUYER_USER_ID varchar(16),
ADDITIONAL_TRD_STATUS varchar(50),
TRADE_TYPE varchar(4) NOT NULL,
SELLER_FULLNAME varchar(256) default '',
BUYER_FULLNAME varchar(256) default '',
SELLER_NICK varchar(100) default '' NOT NULL,
BUYER_NICK varchar(100) default '' NOT NULL,
GOODS_TITLE varchar(256),
GMT_LAST_MODIFIED_DT TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
STOP_TIMEOUT varchar(4) default '0',
GATHERING_TYPE varchar(4),
BUYER_MARKER VARCHAR(1),
SELLER_MARKER VARCHAR(1),
BUYER_MARKER_MEMO varchar(1000),
SELLER_MARKER_MEMO varchar(1000),
CHANNEL varchar(32),
PRODUCT varchar(20),
PAY_CHANNEL varchar(32),
OTHER_SERVICE_FEE int,
RELATION_PRO varchar(64),
PLATFORM varchar(100),
CHANNEL_PARTNER varchar(100),
GOODS_TYPE VARCHAR(4),
GOODS_SUB_TYPE VARCHAR(4),
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TRADE_BASE_TEMAIL_GMTC_IND ON TRADE_BASE_000
(TRADE_EMAIL, GMT_CREATE);
CREATE INDEX IND_BEYOND_TRADE_BASE_BUYGMT1 ON TRADE_BASE_000
(BUYER_ACCOUNT, GMT_CREATE);
CREATE INDEX IND_BEYOND_TRADE_BASE_SALGMT1 ON TRADE_BASE_000
(SELLER_ACCOUNT, GMT_CREATE);
CREATE TABLE if not exists TRADE_CHARGE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GMT_CHARGE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
CHARGE_OUT_DATE VARCHAR(8),
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PLAN_CHARGE int,
ACTUAL_CHARGE int,
RATE_ID int,
RATE int,
RATE_ORIGIN VARCHAR(1),
PRODUCT_NAME varchar(32),
CHARGE_TYPE varchar(16),
SERVICE_EVENT_ID int,
PAYMENT_BILL_ID int,
SALES_ID int,
PARTNER_ID varchar(30),
DEBIT_ACCOUNT varchar(20),
CREDIT_ACCOUNT varchar(20),
BILL_STATUS VARCHAR(1),
SERVICE_AMOUNT int,
TRADE_FROM varchar(100),
DEBIT_USER_ID varchar(16),
SERVICT_TYPE varchar(8),
SUB_TRADE_NO varchar(64),
primary key (TRADE_NO, SERVICT_TYPE, CHARGE_TYPE, SUB_TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_CHARGE_000_GMT_IND ON TRADE_CHARGE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_EXT_000
(
TRADE_NO varchar(64) NOT NULL,
EXT_INFO varchar(1000),
TRADE_AGENT varchar(30),
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
FP_TIME_OUT_RULE varchar(1000),
FOREX_RATE_ID int,
FOREX_CURRENCY varchar(8),
FOREX_TOTAL_FEE int,
GOODS_INNER_SELL_RATE int,
PREPARE_COUPON_FEE int,
PREPARE_COUPON_LIST varchar(64),
FOREX_CERT_NO varchar(128),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
AUTH_DEBIT_TYPE varchar(1),
SUPPORT_CREDIT_CARD varchar(256),
SPECIFIED_PAY_CHANNEL varchar(128),
CHARGE_CHANNEL_INFO varchar(256),
PAY_CHANNELS varchar(900),
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_EXT_000_GMT_IND ON TRADE_EXT_000 (GMT_MODIFIED);
CREATE TABLE if not exists TRADE_FUND_BILL_000
(
BILL_NO varchar(128) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
PAY_ACCOUNT_NO varchar(20) NOT NULL,
RECEIVE_ACCOUNT_NO varchar(20) NOT NULL,
CURRENCY varchar(3) default '156' NOT NULL,
AMOUNT int NOT NULL,
TYPE VARCHAR(2) NOT NULL,
STATUS VARCHAR(1) NOT NULL,
CHANNEL VARCHAR(2) NOT NULL,
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
IW_TRANS_LOG_ID int,
GMT_TRADE_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
MEMO varchar(1000),
BANK_PAY_ONLINE_ID int,
BANK_AMOUNT int,
BANK_TYPE varchar(32),
FREEZE_TYPE varchar(5),
OUT_ORDER_NO varchar(64),
PARTNER_ID varchar(30),
DEPOSIT_ID varchar(16),
BILL_EXT varchar(200),
PAY_ORDER_NO varchar(64),
primary key (TRADE_NO,BILL_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TRADE_FUND_BILL_PF_IND ON TRADE_FUND_BILL_000
(PAY_ACCOUNT_NO, GMT_TRADE_CREATE);
CREATE INDEX BYD_TRADE_FUND_BILL_RF_IND ON TRADE_FUND_BILL_000
(RECEIVE_ACCOUNT_NO, GMT_TRADE_CREATE);
CREATE INDEX TRADE_FUND_BILL_PTG_IND ON TRADE_FUND_BILL_000
(PARTNER_ID, GMT_TRADE_CREATE);
CREATE INDEX TRADE_FUND_BILL_000_GMT_IND ON TRADE_FUND_BILL_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_GOODS_INFO_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GOODS_ID varchar(32) default ' ' NOT NULL,
GOODS_TITLE varchar(256),
GOODS_BID int default 0 NOT NULL,
GOODS_QUANTITY int default 1 NOT NULL,
DETAIL_URL varchar(400),
GOODS_MEMO varchar(1000),
REFER_URL varchar(400),
PARTNER varchar(100),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
OTHER_FEE int,
CATEGORY varchar(24),
PROMOTION_DESC varchar(256),
PIC_URL varchar(400),
GOODS_TYPE VARCHAR(4),
GOODS_SUB_TYPE VARCHAR(4),
primary key (TRADE_NO, ID)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_LOGISTICS_000
(
ID int NOT NULL,
TRADE_NO VARCHAR(64) NOT NULL,
LOGISTICS_ID VARCHAR(20),
LOGISTICS_NAME VARCHAR(128),
INVOICE_NO VARCHAR(64),
SIGN_VOUCHER_NO VARCHAR(64),
TRANSPORT_TYPE int,
TRANSPORT_FEE int default 0 NOT NULL,
OTHER_FEE int default 0,
ADDITIONAL_SERVICE VARCHAR(300),
LOGISTICS_STATUS VARCHAR(100),
SEND_FULLNAME VARCHAR(256),
SEND_PHONE VARCHAR(30),
SEND_MOBILE_PHONE VARCHAR(30),
SEND_ADDRESS VARCHAR(256),
SEND_POST VARCHAR(20),
RECEIVE_FULLNAME VARCHAR(256),
RECEIVE_PHONE VARCHAR(30),
RECEIVE_MOBILE_PHONE VARCHAR(30),
RECEIVE_ADDRESS VARCHAR(256),
RECEIVE_POST VARCHAR(20),
LOGISTICS_MEMO VARCHAR(600),
TRADE_OR_REFUND_FLAG int default 1 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_APPLY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_FETCH TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_TRANSPORT TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_SIGN TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
SEND_IM_TYPE VARCHAR(10),
SEND_IM_ID VARCHAR(100),
RECEIVE_IM_TYPE VARCHAR(10),
RECEIVE_IM_ID VARCHAR(100),
TRANSPORT_PAYMENT int,
TRANSPORT_MODIFIABLE int,
RECEIVE_ADDRESS_CODE VARCHAR(8),
SEND_ADDRESS_CODE VARCHAR(8),
TRANSPORT_TYPE_SEND int,
LOGISTICS_NO VARCHAR(100),
TRANS_GOODS_INFO VARCHAR(400),
REC_ADDRESS_NO VARCHAR(100),
FLAG_MAIN int,
primary key (TRADE_NO, TRADE_OR_REFUND_FLAG, ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_LOGISTICS_000_GMT_IND ON TRADE_LOGISTICS_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_MESSAGE_BOARD_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
MESSAGE varchar(2000) NOT NULL,
POSTER varchar(100) default ' ' NOT NULL,
POSTER_ROLE int,
OPERATOR_IP varchar(15),
MSG_TYPE int default 0,
IS_READ int default 0 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (TRADE_NO, ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_NOTE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
TRADE_STATUS varchar(64) default ' ',
BUYER_EMAIL varchar(100) default ' ' NOT NULL,
SELLER_EMAIL varchar(100) default ' ' NOT NULL,
OPERATOR_EMAIL varchar(100) default ' ' NOT NULL,
OPERATOR_IP varchar(15),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
OPERATOR_MEMO varchar(256),
NOTE_TYPE varchar(100),
REMOTE_MAC varchar(64),
primary key (TRADE_NO, ID, GMT_CREATE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_OUTTRADE_000
(
PARTNER_ID varchar(200) NOT NULL,
OUT_TRADE_NO varchar(64) NOT NULL,
TRADE_FROM varchar(100) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
primary key (OUT_TRADE_NO, PARTNER_ID, TRADE_FROM)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_PAYMENT_CLAUSE_000
(
ID int NOT NULL,
OUT_RELATION_ID varchar(64),
SERIAL_NO int,
TRADE_NO varchar(64) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PAYMENT_TYPE varchar(64) NOT NULL,
STATUS varchar(50),
PAY_ACCOUNT_NO varchar(20),
PAY_USER_ID varchar(16),
RECEIVE_ACCOUNT_NO varchar(20),
RECEIVE_USER_ID varchar(16),
AMOUNT int,
CURRENCY varchar(64),
PAYMENT_RESTRICT_RULE varchar(1000),
DESCRIPTION varchar(1000),
MEMO varchar(1000),
CONTEXT varchar(1000),
primary key (TRADE_NO, OUT_RELATION_ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_PCLAUSE_000_GMT_IND ON TRADE_PAYMENT_CLAUSE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PAYMENT_ORDER_000
(
ORDER_NO varchar(64) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
BIZ_TYPE varchar(20) NOT NULL,
OUT_ORDER_NO varchar(64),
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
STATUS varchar(2) NOT NULL,
PAY_ACCOUNT_NO varchar(20) NOT NULL,
RECEIVE_ACCOUNT_NO varchar(20) NOT NULL,
AMOUNT int NOT NULL,
RETURN_AMOUNT int,
CURRENCY varchar(3) NOT NULL,
FREEZE_TYPE varchar(5),
EXT_INFO varchar(1000),
MEMO varchar(1000),
PAYMENT_ID varchar(64),
PAYMENT_CONTEXT varchar(1000),
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
FREEZE_AMOUNT int,
SUB_TRANS_CODE varchar(40) NOT NULL,
primary key (TRADE_NO, ORDER_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_PAYMENT_ORD_000_GM_IND ON TRADE_PAYMENT_ORDER_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PROCESS_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
OUT_TRADE_NO varchar(64),
RECEIVE_FEE int default 0 NOT NULL,
SEND_FEE int default 0 NOT NULL,
ADJUST_FEE int default 0 NOT NULL,
MEMO varchar(600),
OPERATE_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
OPERATE_NAME varchar(256),
FLAG_REFUND varchar(4) default '0' NOT NULL,
FLAG_DEFERPAY varchar(4) default '0' NOT NULL,
FLAG_PAYMENT varchar(8) default '0' NOT NULL,
FLAG_TRADE_LOCKED varchar(4) default '0' NOT NULL,
FLAG_SELLER_MDF varchar(4) default '0' NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_RECEIVE_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_SEND_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_SEND_GOODS TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
TIME_OUT_RULE varchar(1000),
GMT_OUT_TRADE_NO_CREATED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
COUPON_CLEAR_FEE int,
COUPON_ADJUST_FEE int,
REFUND_FEE int,
GMT_REFUND_PAY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_FINISH TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ACCOUNT_TX_ID varchar(40),
ADJUST_TIMEOUT int,
GMT_PRE_AUTH TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRE_AUTH_FEE int,
ACTUAL_ADJUST_FEE int,
EXPIRE_TIME TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
SEND_BACK_FEE int,
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX IND_BYD_TRD_PROCESS_GRPAY ON TRADE_PROCESS_000
(GMT_RECEIVE_PAY, RECEIVE_FEE);
CREATE INDEX TRADE_PROCESS_GMT_IND ON TRADE_PROCESS_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_REFUND_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
OUT_TRADE_NO varchar(64),
RETURN_STATUS varchar(100),
MEMO varchar(2000),
RETURN_FEE int,
GMT_ADMIN_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
ADMIN_STATUS varchar(100),
RETURN_TYPE varchar(20) NOT NULL,
RETURN_GOODS int,
GOODS_STATUS int,
CLOSE_CAUSE varchar(600),
REQUIRE_VOUCHER int,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
SELLER_NOT_RECEIVE int,
REFUND_REASON varchar(400),
APPEAL_NO varchar(50),
GMT_DW_SYNC TIMESTAMP(6) default "2012-01-01 12:00:00" ,
BUY_USER_ID varchar(16) NOT NULL,
BUY_ACCOUNT varchar(20) NOT NULL,
SELL_USER_ID varchar(16) NOT NULL,
SELL_ACCOUNT varchar(20) NOT NULL,
TRADE_FROM varchar(100),
TRADE_EMAIL varchar(100),
IS_INPOUR_REFUND VARCHAR(1),
REFUND_FLOW_TYPE VARCHAR(1),
GMT_LAST_APPLY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
REFUND_FOREX_FEE int,
PRIMARY KEY (TRADE_NO, ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_REFUND_BG_IND ON TRADE_REFUND_000
(BUY_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_SG_IND ON TRADE_REFUND_000
(SELL_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_TG_IND ON TRADE_REFUND_000
(TRADE_EMAIL, GMT_CREATE);
CREATE INDEX TRADE_REFUND_000_GMT_IND ON TRADE_REFUND_000 (GMT_MODIFIED);
CREATE TABLE if not exists TRADE_VOUCHER_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
REFUND_ID int NOT NULL,
SELLER_OR_BUYER VARCHAR(1) default 'S' NOT NULL,
SELLER_UPLOAD_VOUCHER varchar(4000),
BUYER_UPLOAD_VOUCHER varchar(4000),
UPLOAD_FLAG int default 0 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_CHECK TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
LAST_OPERATOR varchar(32),
CHECK_MEMO varchar(2000),
MEMEO varchar(4000),
GMT_TIMEOUT_START TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (TRADE_NO, ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_VOUCHER_000_MT_IND ON TRADE_VOUCHER_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_RECEIVE_ADDRESS_000
(
TRADE_NO VARCHAR(64) NOT NULL,
ADDRESS_NO VARCHAR(100) NOT NULL,
RECEIVE_NAME VARCHAR(256),
ADDRESS_CODE VARCHAR(8),
ADDRESS VARCHAR(256),
MOBILE_PHONE VARCHAR(30),
PHONE VARCHAR(30),
RECEIVE_POST VARCHAR(20),
VIRTUAL_REC_INFO VARCHAR(400),
GMT_CREATE DATETIME NOT NULL,
GMT_MODIFIED DATETIME,
PRIMARY KEY (TRADE_NO, ADDRESS_NO)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_COOPERATE_000
(
TRADE_NO VARCHAR(64),
COOPERATE_NO VARCHAR(64),
COOPERATOR_FROM VARCHAR(32),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY key (TRADE_NO, COOPERATE_NO, COOPERATOR_FROM)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_COOPERATE_000_MT_IND ON TRADE_COOPERATE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_SETTLE_ORDER_000
(
ORDER_NO VARCHAR(64) NOT NULL,
ORG_ORDER_NO VARCHAR(64),
TRADE_NO VARCHAR(64) NOT NULL,
OUT_REQUEST_NO VARCHAR(64),
BIZ_PRODUCT VARCHAR(32),
SETTLE_ACTION_TYPE VARCHAR(32),
AMOUNT int NOT NULL,
STATUS VARCHAR(50) NOT NULL,
EXTINFO VARCHAR(1024),
MEMO VARCHAR(512),
SETTLE_ID VARCHAR(64),
SETTLE_CONTEXT VARCHAR(1024),
GMT_CREATE TIMESTAMP(6) NOT NULL,
GMT_MODIFIED TIMESTAMP(6),
SETTLE_TYPE VARCHAR(32),
PRIMARY KEY (TRADE_NO, ORDER_NO, GMT_CREATE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_PARTICIPANT_000
(
TRADE_NO VARCHAR(64) NOT NULL,
USER_ID VARCHAR(16) NOT NULL,
USER_NAME VARCHAR(256),
USER_NICK VARCHAR(100),
PARTICIPANT_ROLE VARCHAR(64) NOT NULL,
MEMO VARCHAR(200),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY (TRADE_NO, USER_ID, PARTICIPANT_ROLE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTIVITY_ASYNC_000
(
TX_ID VARCHAR(128) NOT NULL,
STATE VARCHAR(1) NOT NULL,
ACCOUNT_TRANS_STATE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
PROPAGATION VARCHAR(1),
CONTEXT VARCHAR(2048),
PRIMARY KEY (TX_ID)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists EXTERFACE_INVOKE_000
(
ID int NOT NULL,
PARTNER_ID VARCHAR(32) NOT NULL,
TARGET VARCHAR(64) NOT NULL,
EXTERFACE VARCHAR(128) NOT NULL,
NOTIFY_URL VARCHAR(200),
RETURN_URL VARCHAR(200),
SIGN_TYPE VARCHAR(10),
CHARSET VARCHAR(20),
GMT_INVOKE TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
GMT_FINISH TIMESTAMP(6) default "2012-01-01 12:00:00" NOT NULL,
TARGET_TYPE VARCHAR(20) NOT NULL,
GMT_NOTIFY TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
GMT_RETURN TIMESTAMP(6) default "2012-01-01 12:00:00" NULL,
PRIMARY KEY(TARGET_TYPE, TARGET, PARTNER_ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX EXTERFACE_INVOKE_000_ID_IND ON EXTERFACE_INVOKE_000(ID);
merge happens
insert into notify_history_000(id,plugin,parameter,group_no,status,gmt_create,gmt_modify) values('1111','1','1bdc',-2,'1','2014-09-19 12:00:00','2014-09-19 11:11:11');
insert into notify_history_000(id,plugin,parameter,group_no,status,gmt_create,gmt_modify) values('2111','1','1bdc',-2,'1','2014-09-19 12:00:00','2014-09-19 11:11:11');
insert into notify_history_000(id,plugin,parameter,group_no,status,gmt_create,gmt_modify) values('3111','1','1bdc',-2,'1','2014-09-19 12:00:00','2014-09-19 11:11:11');
update notify_history_000 set group_no=-1 , iw_user_id = '1111' , status ='N';
select id from notify_history_000 where group_no = -1 and iw_user_id = '1111';
id
1111
2111
3111
select id, plugin, plugin_host, parameter, group_no, status, gmt_create, gmt_local_create, gmt_modify, iw_user_id, channel_endpoint, business_order, business_type from notify_000 where (id = '1111') for update;
id plugin plugin_host parameter group_no status gmt_create gmt_local_create gmt_modify iw_user_id channel_endpoint business_order business_type
select id, plugin, plugin_host, parameter, group_no, status, gmt_create, gmt_local_create, gmt_modify, iw_user_id, channel_endpoint, business_order, business_type from notify_000 where ((id = '1111') AND (status IN ('N', 'C')));
id plugin plugin_host parameter group_no status gmt_create gmt_local_create gmt_modify iw_user_id channel_endpoint business_order business_type
select id, plugin, plugin_host, parameter, group_no, status, gmt_create, gmt_local_create, gmt_modify, iw_user_id, channel_endpoint, business_order, business_type from notify_000 where ((id = '1111') AND (status IN ('N', 'C'))) for update;
id plugin plugin_host parameter group_no status gmt_create gmt_local_create gmt_modify iw_user_id channel_endpoint business_order business_type
select /* QUERY_TIMEOUT(15000000) */ id from notify_000 where gmt_create <= current_timestamp() and gmt_create >= date_sub(current_timestamp(), INTERVAL 6 MINUTE) and gmt_modify < now() and status in ('N', 'C') and group_no != -1;
id
select /* QUERY_TIMEOUT(15000000) */ id from notify_000 where gmt_create <= current_timestamp() and gmt_create >= date_sub(current_timestamp(), INTERVAL 6 MINUTE) and gmt_modify < now() and status in ('N', 'C') and group_no = -1;
id
select /* QUERY_TIMEOUT(15000000) */ id, business_order, business_type from notify_000 where gmt_create <= current_timestamp() AND gmt_create >= date_sub(current_timestamp(), INTERVAL 6 MINUTE) AND ((status = 'N') AND (gmt_modify < current_timestamp())) limit 1;
id business_order business_type
select id, plugin, plugin_host, parameter, group_no, status, gmt_create, gmt_local_create, gmt_modify, iw_user_id, channel_endpoint, business_order, business_type from notify_000 where (iw_user_id ='1111') and (gmt_create < current_timestamp()) and (gmt_create >= current_timestamp());
id plugin plugin_host parameter group_no status gmt_create gmt_local_create gmt_modify iw_user_id channel_endpoint business_order business_type
delete from notify_history_000 where ((group_no = (- 1)) AND (iw_user_id = '1111'));

View File

@ -0,0 +1,690 @@
DROP TABLE if exists trade_sequence_000;
DROP TABLE if exists BUSINESS_ACTION_000;
DROP TABLE if exists BUSINESS_ACTIVITY_000;
DROP TABLE if exists NOTIFY_000 ;
DROP TABLE if exists NOTIFY_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_000 ;
DROP TABLE if exists TIMEOUT_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_LONG_000 ;
DROP TABLE if exists TIMEOUT_REMIND_000;
DROP TABLE if exists TRADE_BASE_000 ;
DROP TABLE if exists TRADE_CHARGE_000;
DROP TABLE if exists TRADE_EXT_000 ;
DROP TABLE if exists TRADE_FUND_BILL_000 ;
DROP TABLE if exists TRADE_GOODS_INFO_000 ;
DROP TABLE if exists TRADE_LOGISTICS_000;
DROP TABLE if exists TRADE_MESSAGE_BOARD_000 ;
DROP TABLE if exists TRADE_NOTE_000 ;
DROP TABLE if exists TRADE_OUTTRADE_000 ;
DROP TABLE if exists TRADE_PAYMENT_CLAUSE_000 ;
DROP TABLE if exists TRADE_PAYMENT_ORDER_000 ;
DROP TABLE if exists TRADE_PROCESS_000 ;
DROP TABLE if exists TRADE_REFUND_000 ;
DROP TABLE if exists TRADE_VOUCHER_000 ;
DROP TABLE if exists TRADE_RECEIVE_ADDRESS_000;
DROP TABLE if exists TRADE_COOPERATE_000;
DROP TABLE if exists TRADE_SETTLE_ORDER_000;
DROP TABLE if exists TRADE_PARTICIPANT_000;
DROP TABLE if exists BUSINESS_ACTIVITY_ASYNC_000;
DROP TABLE if exists EXTERFACE_INVOKE_000;
CREATE TABLE if not exists trade_sequence_000
(
name varchar(256),
value int,
min_value int,
max_value int,
step int,
gmt_create TIMESTAMP(6) default "2012-01-01 12:00:00",
gmt_modified TIMESTAMP(6) default "2012-01-01 12:00:00",
primary key (name)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTION_000
(
ACTION_ID int NOT NULL,
TX_ID varchar(128) NOT NULL,
NAME varchar(64) NOT NULL,
STATE CHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP NOT NULL,
CONTEXT varchar(4000),
primary key (ACTION_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTIVITY_000
(
TX_ID varchar(128) NOT NULL,
STATE VARCHAR(1) NOT NULL,
ACCOUNT_TRANS_STATE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP NOT NULL,
PROPAGATION VARCHAR(1),
CONTEXT varchar(2048),
primary key (TX_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists NOTIFY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
PARAMETER varchar(4000) NOT NULL,
GROUP_NO int NOT NULL,
STATUS VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFY TIMESTAMP NOT NULL,
IW_USER_ID varchar(16),
CHANNEL_ENDPOINT varchar(200),
BUSINESS_ORDER varchar(128),
BUSINESS_TYPE varchar(50),
PLUGIN_HOST varchar(15),
GMT_LOCAL_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
primary key (id)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX NOTIFY_BUSINESS_ORDER1_IND ON NOTIFY_000 (BUSINESS_ORDER);
CREATE INDEX NOTIFY_PLUGIN_IND ON NOTIFY_000 (PLUGIN, CHANNEL_ENDPOINT);
CREATE TABLE if not exists NOTIFY_HISTORY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
PARAMETER varchar(4000) NOT NULL,
GROUP_NO int NOT NULL,
STATUS VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFY TIMESTAMP NOT NULL,
IW_USER_ID varchar(16),
CHANNEL_ENDPOINT varchar(200),
BUSINESS_ORDER varchar(128),
BUSINESS_TYPE varchar(50),
PLUGIN_HOST varchar(15),
GMT_LOCAL_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX NOTIFY_HISTORY_000_BORDER_IND ON NOTIFY_HISTORY_000 (BUSINESS_ORDER);
CREATE INDEX NOTIFY_HISTORY_IG_IND ON NOTIFY_HISTORY_000 (IW_USER_ID, GROUP_NO);
CREATE TABLE if not exists TIMEOUT_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIOR_LEVEL int default 1,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX IND_BEYOND_TIMEOUT_ETIME ON TIMEOUT_000 (END_TIME);
CREATE INDEX TIMEOUT_000_PL_IND ON TIMEOUT_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_TNO_IND ON TIMEOUT_000 (TRADE_NO);
CREATE TABLE if not exists TIMEOUT_HISTORY_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIOR_LEVEL int,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (JOB_ID, TRADE_NO, ACTION_TYPE)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TIMEOUT_LONG_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIOR_LEVEL int ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TIMEOUT_LONG_ENDTIME_IND ON TIMEOUT_LONG_000 (END_TIME);
CREATE INDEX TIMEOUT_LONG_000_PL_IND ON TIMEOUT_LONG_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_LONG_TNO_IND ON TIMEOUT_LONG_000 (TRADE_NO);
CREATE TABLE if not exists TIMEOUT_REMIND_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
USER_ID varchar(128),
PAYTYPE varchar(4),
END_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
ACTION varchar(30),
PARAMETER varchar(100),
STATUS VARCHAR(1),
ACTION_TYPE VARCHAR(1),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIOR_LEVEL int ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_OCCUR TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (JOB_ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX BY_TIMEOUT_REMIND_ETIME_IND ON TIMEOUT_REMIND_000 (END_TIME);
CREATE INDEX TIMEOUT_REMIND_000_PL_IND ON TIMEOUT_REMIND_000 (PRIOR_LEVEL);
CREATE INDEX TIMEOUT_REMIND_TNO_IND ON TIMEOUT_REMIND_000 (TRADE_NO);
CREATE TABLE if not exists TRADE_BASE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
OUT_TRADE_NO varchar(64),
SELLER_ACCOUNT varchar(100) NOT NULL,
SELLER_LOGIN_EMAIL varchar(100) NOT NULL,
BUYER_ACCOUNT varchar(100) NOT NULL,
BUYER_LOGIN_EMAIL varchar(100) NOT NULL,
SELLER_TYPE int,
BUYER_TYPE int,
TRADE_FROM varchar(100),
TRADE_EMAIL varchar(100),
OPERATOR_ROLE VARCHAR(1) NOT NULL,
TRADE_STATUS varchar(50) NOT NULL,
TOTAL_FEE int default 0 NOT NULL,
SERVICE_FEE_RATIO varchar(64),
SERVICE_FEE int default 0 NOT NULL,
CURRENCY varchar(3),
SELLER_ACTION varchar(200),
BUYER_ACTION varchar(200),
GMT_CREATE TIMESTAMP ,
SELLER_USER_ID varchar(16),
BUYER_USER_ID varchar(16),
ADDITIONAL_TRD_STATUS varchar(50),
TRADE_TYPE varchar(4) NOT NULL,
SELLER_FULLNAME varchar(256) default '',
BUYER_FULLNAME varchar(256) default '',
SELLER_NICK varchar(100) default '' NOT NULL,
BUYER_NICK varchar(100) default '' NOT NULL,
GOODS_TITLE varchar(256),
GMT_LAST_MODIFIED_DT TIMESTAMP(6) default "2012-01-01 12:00:00",
STOP_TIMEOUT varchar(4) default '0',
GATHERING_TYPE varchar(4),
BUYER_MARKER VARCHAR(1),
SELLER_MARKER VARCHAR(1),
BUYER_MARKER_MEMO varchar(1000),
SELLER_MARKER_MEMO varchar(1000),
CHANNEL varchar(32),
PRODUCT varchar(20),
PAY_CHANNEL varchar(32),
OTHER_SERVICE_FEE int,
RELATION_PRO varchar(64),
PLATFORM varchar(100),
CHANNEL_PARTNER varchar(100),
GOODS_TYPE VARCHAR(4),
GOODS_SUB_TYPE VARCHAR(4),
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TRADE_BASE_TEMAIL_GMTC_IND ON TRADE_BASE_000
(TRADE_EMAIL, GMT_CREATE);
CREATE INDEX IND_BEYOND_TRADE_BASE_BUYGMT1 ON TRADE_BASE_000
(BUYER_ACCOUNT, GMT_CREATE);
CREATE INDEX IND_BEYOND_TRADE_BASE_SALGMT1 ON TRADE_BASE_000
(SELLER_ACCOUNT, GMT_CREATE);
CREATE TABLE if not exists TRADE_CHARGE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GMT_CHARGE TIMESTAMP NOT NULL,
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
CHARGE_OUT_DATE VARCHAR(8),
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
PLAN_CHARGE int,
ACTUAL_CHARGE int,
RATE_ID int,
RATE int,
RATE_ORIGIN VARCHAR(1),
PRODUCT_NAME varchar(32),
CHARGE_TYPE varchar(16),
SERVICE_EVENT_ID int,
PAYMENT_BILL_ID int,
SALES_ID int,
PARTNER_ID varchar(30),
DEBIT_ACCOUNT varchar(20),
CREDIT_ACCOUNT varchar(20),
BILL_STATUS VARCHAR(1),
SERVICE_AMOUNT int,
TRADE_FROM varchar(100),
DEBIT_USER_ID varchar(16),
SERVICT_TYPE varchar(8),
SUB_TRADE_NO varchar(64),
primary key (TRADE_NO, SERVICT_TYPE, CHARGE_TYPE, SUB_TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_CHARGE_000_GMT_IND ON TRADE_CHARGE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_EXT_000
(
TRADE_NO varchar(64) NOT NULL,
EXT_INFO varchar(1000),
TRADE_AGENT varchar(30),
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
FP_TIME_OUT_RULE varchar(1000),
FOREX_RATE_ID int,
FOREX_CURRENCY varchar(8),
FOREX_TOTAL_FEE int,
GOODS_INNER_SELL_RATE int,
PREPARE_COUPON_FEE int,
PREPARE_COUPON_LIST varchar(64),
FOREX_CERT_NO varchar(128),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
AUTH_DEBIT_TYPE varchar(1),
SUPPORT_CREDIT_CARD varchar(256),
SPECIFIED_PAY_CHANNEL varchar(128),
CHARGE_CHANNEL_INFO varchar(256),
PAY_CHANNELS varchar(900),
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_EXT_000_GMT_IND ON TRADE_EXT_000 (GMT_MODIFIED);
CREATE TABLE if not exists TRADE_FUND_BILL_000
(
BILL_NO varchar(128) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
PAY_ACCOUNT_NO varchar(20) NOT NULL,
RECEIVE_ACCOUNT_NO varchar(20) NOT NULL,
CURRENCY varchar(3) default '156' NOT NULL,
AMOUNT int NOT NULL,
TYPE VARCHAR(2) NOT NULL,
STATUS VARCHAR(1) NOT NULL,
CHANNEL VARCHAR(2) NOT NULL,
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
IW_TRANS_LOG_ID int,
GMT_TRADE_CREATE TIMESTAMP NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP NOT NULL,
MEMO varchar(1000),
BANK_PAY_ONLINE_ID int,
BANK_AMOUNT int,
BANK_TYPE varchar(32),
FREEZE_TYPE varchar(5),
OUT_ORDER_NO varchar(64),
PARTNER_ID varchar(30),
DEPOSIT_ID varchar(16),
BILL_EXT varchar(200),
PAY_ORDER_NO varchar(64),
primary key (TRADE_NO,BILL_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TRADE_FUND_BILL_PF_IND ON TRADE_FUND_BILL_000(PAY_ACCOUNT_NO, GMT_TRADE_CREATE);
CREATE INDEX BYD_TRADE_FUND_BILL_RF_IND ON TRADE_FUND_BILL_000(RECEIVE_ACCOUNT_NO, GMT_TRADE_CREATE);
CREATE INDEX TRADE_FUND_BILL_PTG_IND ON TRADE_FUND_BILL_000 (PARTNER_ID, GMT_TRADE_CREATE);
CREATE INDEX TRADE_FUND_BILL_000_GMT_IND ON TRADE_FUND_BILL_000(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_GOODS_INFO_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GOODS_ID varchar(32) default ' ' NOT NULL,
GOODS_TITLE varchar(256),
GOODS_BID int default 0 NOT NULL,
GOODS_QUANTITY int default 1 NOT NULL,
DETAIL_URL varchar(400),
GOODS_MEMO varchar(1000),
REFER_URL varchar(400),
PARTNER varchar(100),
GMT_CREATE TIMESTAMP NOT NULL,
OTHER_FEE int,
CATEGORY varchar(24),
PROMOTION_DESC varchar(256),
PIC_URL varchar(400),
GOODS_TYPE VARCHAR(4),
GOODS_SUB_TYPE VARCHAR(4),
primary key (TRADE_NO, ID)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_LOGISTICS_000
(
ID int NOT NULL,
TRADE_NO VARCHAR(64) NOT NULL,
LOGISTICS_ID VARCHAR(20),
LOGISTICS_NAME VARCHAR(128),
INVOICE_NO VARCHAR(64),
SIGN_VOUCHER_NO VARCHAR(64),
TRANSPORT_TYPE int,
TRANSPORT_FEE int default 0 NOT NULL,
OTHER_FEE int default 0,
ADDITIONAL_SERVICE VARCHAR(300),
LOGISTICS_STATUS VARCHAR(100),
SEND_FULLNAME VARCHAR(256),
SEND_PHONE VARCHAR(30),
SEND_MOBILE_PHONE VARCHAR(30),
SEND_ADDRESS VARCHAR(256),
SEND_POST VARCHAR(20),
RECEIVE_FULLNAME VARCHAR(256),
RECEIVE_PHONE VARCHAR(30),
RECEIVE_MOBILE_PHONE VARCHAR(30),
RECEIVE_ADDRESS VARCHAR(256),
RECEIVE_POST VARCHAR(20),
LOGISTICS_MEMO VARCHAR(600),
TRADE_OR_REFUND_FLAG int default 1 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_APPLY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_FETCH TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_TRANSPORT TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_SIGN TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
SEND_IM_TYPE VARCHAR(10),
SEND_IM_ID VARCHAR(100),
RECEIVE_IM_TYPE VARCHAR(10),
RECEIVE_IM_ID VARCHAR(100),
TRANSPORT_PAYMENT int,
TRANSPORT_MODIFIABLE int,
RECEIVE_ADDRESS_CODE VARCHAR(8),
SEND_ADDRESS_CODE VARCHAR(8),
TRANSPORT_TYPE_SEND int,
LOGISTICS_NO VARCHAR(100),
TRANS_GOODS_INFO VARCHAR(400),
REC_ADDRESS_NO VARCHAR(100),
FLAG_MAIN int,
primary key (TRADE_NO, TRADE_OR_REFUND_FLAG, ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_LOGISTICS_000_GMT_IND ON TRADE_LOGISTICS_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_MESSAGE_BOARD_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
MESSAGE varchar(2000) NOT NULL,
POSTER varchar(100) default ' ' NOT NULL,
POSTER_ROLE int,
OPERATOR_IP varchar(15),
MSG_TYPE int default 0,
IS_READ int default 0 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (TRADE_NO, ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_NOTE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
TRADE_STATUS varchar(64) default ' ',
BUYER_EMAIL varchar(100) default ' ' NOT NULL,
SELLER_EMAIL varchar(100) default ' ' NOT NULL,
OPERATOR_EMAIL varchar(100) default ' ' NOT NULL,
OPERATOR_IP varchar(15),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
OPERATOR_MEMO varchar(256),
NOTE_TYPE varchar(100),
REMOTE_MAC varchar(64),
primary key (TRADE_NO, ID, GMT_CREATE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_OUTTRADE_000
(
PARTNER_ID varchar(200) NOT NULL,
OUT_TRADE_NO varchar(64) NOT NULL,
TRADE_FROM varchar(100) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
primary key (OUT_TRADE_NO, PARTNER_ID, TRADE_FROM)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_PAYMENT_CLAUSE_000
(
ID int NOT NULL,
OUT_RELATION_ID varchar(64),
SERIAL_NO int,
TRADE_NO varchar(64) NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
PAYMENT_TYPE varchar(64) NOT NULL,
STATUS varchar(50),
PAY_ACCOUNT_NO varchar(20),
PAY_USER_ID varchar(16),
RECEIVE_ACCOUNT_NO varchar(20),
RECEIVE_USER_ID varchar(16),
AMOUNT int,
CURRENCY varchar(64),
PAYMENT_RESTRICT_RULE varchar(1000),
DESCRIPTION varchar(1000),
MEMO varchar(1000),
CONTEXT varchar(1000),
primary key (TRADE_NO, OUT_RELATION_ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_PCLAUSE_000_GMT_IND ON TRADE_PAYMENT_CLAUSE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PAYMENT_ORDER_000
(
ORDER_NO varchar(64) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
BIZ_TYPE varchar(20) NOT NULL,
OUT_ORDER_NO varchar(64),
GMT_MODIFIED TIMESTAMP NOT NULL,
STATUS varchar(2) NOT NULL,
PAY_ACCOUNT_NO varchar(20) NOT NULL,
RECEIVE_ACCOUNT_NO varchar(20) NOT NULL,
AMOUNT int NOT NULL,
RETURN_AMOUNT int,
CURRENCY varchar(3) NOT NULL,
FREEZE_TYPE varchar(5),
EXT_INFO varchar(1000),
MEMO varchar(1000),
PAYMENT_ID varchar(64),
PAYMENT_CONTEXT varchar(1000),
GMT_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_CREATE TIMESTAMP NOT NULL,
FREEZE_AMOUNT int,
SUB_TRANS_CODE varchar(40) NOT NULL,
primary key (TRADE_NO, ORDER_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_PAYMENT_ORD_000_GM_IND ON TRADE_PAYMENT_ORDER_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PROCESS_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
OUT_TRADE_NO varchar(64),
RECEIVE_FEE int default 0 NOT NULL,
SEND_FEE int default 0 NOT NULL,
ADJUST_FEE int default 0 NOT NULL,
MEMO varchar(600),
OPERATE_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
OPERATE_NAME varchar(256),
FLAG_REFUND varchar(4) default '0' NOT NULL,
FLAG_DEFERPAY varchar(4) default '0' NOT NULL,
FLAG_PAYMENT varchar(8) default '0' NOT NULL,
FLAG_TRADE_LOCKED varchar(4) default '0' NOT NULL,
FLAG_SELLER_MDF varchar(4) default '0' NOT NULL,
GMT_CREATE TIMESTAMP ,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_RECEIVE_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_SEND_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_SEND_GOODS TIMESTAMP(6) default "2012-01-01 12:00:00",
TIME_OUT_RULE varchar(1000),
GMT_OUT_TRADE_NO_CREATED TIMESTAMP(6) default "2012-01-01 12:00:00",
COUPON_CLEAR_FEE int,
COUPON_ADJUST_FEE int,
REFUND_FEE int,
GMT_REFUND_PAY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_FINISH TIMESTAMP(6) default "2012-01-01 12:00:00",
ACCOUNT_TX_ID varchar(40),
ADJUST_TIMEOUT int,
GMT_PRE_AUTH TIMESTAMP(6) default "2012-01-01 12:00:00",
PRE_AUTH_FEE int,
ACTUAL_ADJUST_FEE int,
EXPIRE_TIME TIMESTAMP(6) default "2012-01-01 12:00:00",
SEND_BACK_FEE int,
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX IND_BYD_TRD_PROCESS_GRPAY ON TRADE_PROCESS_000
(GMT_RECEIVE_PAY, RECEIVE_FEE);
CREATE INDEX TRADE_PROCESS_GMT_IND ON TRADE_PROCESS_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_REFUND_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
OUT_TRADE_NO varchar(64),
RETURN_STATUS varchar(100),
MEMO varchar(2000),
RETURN_FEE int,
GMT_ADMIN_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
ADMIN_STATUS varchar(100),
RETURN_TYPE varchar(20) NOT NULL,
RETURN_GOODS int,
GOODS_STATUS int,
CLOSE_CAUSE varchar(600),
REQUIRE_VOUCHER int,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
SELLER_NOT_RECEIVE int,
REFUND_REASON varchar(400),
APPEAL_NO varchar(50),
GMT_DW_SYNC TIMESTAMP ,
BUY_USER_ID varchar(16) NOT NULL,
BUY_ACCOUNT varchar(20) NOT NULL,
SELL_USER_ID varchar(16) NOT NULL,
SELL_ACCOUNT varchar(20) NOT NULL,
TRADE_FROM varchar(100),
TRADE_EMAIL varchar(100),
IS_INPOUR_REFUND VARCHAR(1),
REFUND_FLOW_TYPE VARCHAR(1),
GMT_LAST_APPLY TIMESTAMP(6) default "2012-01-01 12:00:00",
REFUND_FOREX_FEE int,
PRIMARY KEY (TRADE_NO, ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_REFUND_BG_IND ON TRADE_REFUND_000
(BUY_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_SG_IND ON TRADE_REFUND_000
(SELL_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_TG_IND ON TRADE_REFUND_000
(TRADE_EMAIL, GMT_CREATE);
CREATE INDEX TRADE_REFUND_000_GMT_IND ON TRADE_REFUND_000 (GMT_MODIFIED);
CREATE TABLE if not exists TRADE_VOUCHER_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
REFUND_ID int NOT NULL,
SELLER_OR_BUYER VARCHAR(1) default 'S' NOT NULL,
SELLER_UPLOAD_VOUCHER varchar(4000),
BUYER_UPLOAD_VOUCHER varchar(4000),
UPLOAD_FLAG int default 0 NOT NULL,
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_CHECK TIMESTAMP(6) default "2012-01-01 12:00:00",
LAST_OPERATOR varchar(32),
CHECK_MEMO varchar(2000),
MEMEO varchar(4000),
GMT_TIMEOUT_START TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (TRADE_NO, ID)
) DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_VOUCHER_000_MT_IND ON TRADE_VOUCHER_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_RECEIVE_ADDRESS_000
(
TRADE_NO VARCHAR(64) NOT NULL,
ADDRESS_NO VARCHAR(100) NOT NULL,
RECEIVE_NAME VARCHAR(256),
ADDRESS_CODE VARCHAR(8),
ADDRESS VARCHAR(256),
MOBILE_PHONE VARCHAR(30),
PHONE VARCHAR(30),
RECEIVE_POST VARCHAR(20),
VIRTUAL_REC_INFO VARCHAR(400),
GMT_CREATE DATETIME NOT NULL,
GMT_MODIFIED DATETIME,
PRIMARY KEY (TRADE_NO, ADDRESS_NO)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_COOPERATE_000
(
TRADE_NO VARCHAR(64),
COOPERATE_NO VARCHAR(64),
COOPERATOR_FROM VARCHAR(32),
GMT_CREATE TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY key (TRADE_NO, COOPERATE_NO, COOPERATOR_FROM)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_COOPERATE_000_MT_IND ON TRADE_COOPERATE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_SETTLE_ORDER_000
(
ORDER_NO VARCHAR(64) NOT NULL,
ORG_ORDER_NO VARCHAR(64),
TRADE_NO VARCHAR(64) NOT NULL,
OUT_REQUEST_NO VARCHAR(64),
BIZ_PRODUCT VARCHAR(32),
SETTLE_ACTION_TYPE VARCHAR(32),
AMOUNT int NOT NULL,
STATUS VARCHAR(50) NOT NULL,
EXTINFO VARCHAR(1024),
MEMO VARCHAR(512),
SETTLE_ID VARCHAR(64),
SETTLE_CONTEXT VARCHAR(1024),
GMT_CREATE TIMESTAMP(6) NOT NULL,
GMT_MODIFIED TIMESTAMP(6),
SETTLE_TYPE VARCHAR(32),
PRIMARY KEY (TRADE_NO, ORDER_NO, GMT_CREATE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_PARTICIPANT_000
(
TRADE_NO VARCHAR(64) NOT NULL,
USER_ID VARCHAR(16) NOT NULL,
USER_NAME VARCHAR(256),
USER_NICK VARCHAR(100),
PARTICIPANT_ROLE VARCHAR(64) NOT NULL,
MEMO VARCHAR(200),
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY (TRADE_NO, USER_ID, PARTICIPANT_ROLE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTIVITY_ASYNC_000
(
TX_ID VARCHAR(128) NOT NULL,
STATE VARCHAR(1) NOT NULL,
ACCOUNT_TRANS_STATE VARCHAR(1) NOT NULL,
GMT_CREATE TIMESTAMP NOT NULL,
GMT_MODIFIED TIMESTAMP NOT NULL,
PROPAGATION VARCHAR(1),
CONTEXT VARCHAR(2048),
PRIMARY KEY (TX_ID)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists EXTERFACE_INVOKE_000
(
ID int NOT NULL,
PARTNER_ID VARCHAR(32) NOT NULL,
TARGET VARCHAR(64) NOT NULL,
EXTERFACE VARCHAR(128) NOT NULL,
NOTIFY_URL VARCHAR(200),
RETURN_URL VARCHAR(200),
SIGN_TYPE VARCHAR(10),
CHARSET VARCHAR(20),
GMT_INVOKE TIMESTAMP NOT NULL,
GMT_FINISH TIMESTAMP NOT NULL,
TARGET_TYPE VARCHAR(20) NOT NULL,
GMT_NOTIFY TIMESTAMP(6) default "2012-01-01 12:00:00",
GMT_RETURN TIMESTAMP(6) default "2012-01-01 12:00:00",
PRIMARY KEY(TARGET_TYPE, TARGET, PARTNER_ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX EXTERFACE_INVOKE_000_ID_IND ON EXTERFACE_INVOKE_000(ID);
DROP TABLE if exists trade_sequence_000;
DROP TABLE if exists BUSINESS_ACTION_000;
DROP TABLE if exists BUSINESS_ACTIVITY_000;
DROP TABLE if exists NOTIFY_000 ;
DROP TABLE if exists NOTIFY_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_000 ;
DROP TABLE if exists TIMEOUT_HISTORY_000 ;
DROP TABLE if exists TIMEOUT_LONG_000 ;
DROP TABLE if exists TIMEOUT_REMIND_000;
DROP TABLE if exists TRADE_BASE_000 ;
DROP TABLE if exists TRADE_CHARGE_000;
DROP TABLE if exists TRADE_EXT_000 ;
DROP TABLE if exists TRADE_FUND_BILL_000 ;
DROP TABLE if exists TRADE_GOODS_INFO_000 ;
DROP TABLE if exists TRADE_LOGISTICS_000;
DROP TABLE if exists TRADE_MESSAGE_BOARD_000 ;
DROP TABLE if exists TRADE_NOTE_000 ;
DROP TABLE if exists TRADE_OUTTRADE_000 ;
DROP TABLE if exists TRADE_PAYMENT_CLAUSE_000 ;
DROP TABLE if exists TRADE_PAYMENT_ORDER_000 ;
DROP TABLE if exists TRADE_PROCESS_000 ;
DROP TABLE if exists TRADE_REFUND_000 ;
DROP TABLE if exists TRADE_VOUCHER_000 ;
DROP TABLE if exists TRADE_RECEIVE_ADDRESS_000;
DROP TABLE if exists TRADE_COOPERATE_000;
DROP TABLE if exists TRADE_SETTLE_ORDER_000;
DROP TABLE if exists TRADE_PARTICIPANT_000;
DROP TABLE if exists BUSINESS_ACTIVITY_ASYNC_000;
DROP TABLE if exists EXTERFACE_INVOKE_000;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
drop table if exists t1;
create table t1 (id int primary key, n1 int, n2 int, s varchar(20), vs varchar(20), t varchar(256));
insert into t1 values (0, NULL, NULL, 'zero', 'zero', 'zero'), (1,1,11, 'one','eleven', 'eleven'), (2,1,11, 'one','eleven', 'eleven'), (3,2,11, 'two','eleven', 'eleven'), (4,2,12, 'two','twevle', 'twelve'), (5,2,13, 'two','thirteen', 'foo'), (6,2,13, 'two','thirteen', 'foo'), (7,2,13, 'two','thirteen', 'bar'), (8,NULL,13, 'two','thirteen', 'bar'), (9,2,NULL, 'two','thirteen', 'bar'), (10,2,13, NULL,'thirteen', 'bar'), (11,2,13, 'two',NULL, 'bar'), (12,2,13, 'two','thirteen', NULL);
select n1, n2 from t1;
n1 n2
NULL NULL
1 11
1 11
2 11
2 12
2 13
2 13
2 13
NULL 13
2 NULL
2 13
2 13
2 13
select count(distinct n1), count(distinct n2) from t1;
count(distinct n1) count(distinct n2)
2 3
select count(n1), count(distinct n1), count(n2), count(distinct n2) from t1;
count(n1) count(distinct n1) count(n2) count(distinct n2)
11 2 11 3
select count(distinct n1), count(distinct n2), count(n1), count(n2) from t1;
count(distinct n1) count(distinct n2) count(n1) count(n2)
2 3 11 11

View File

@ -0,0 +1,44 @@
drop table if exists t1;
select 1+2 c1;
c1
3
select 1+2 as c1;
c1
3
select 1 c1;
c1
1
select 1 as c1;
c1
1
select 1+2 c1 from dual where 1=1;
c1
3
select 1+2 as c1 from dual where 1=1;
c1
3
select 1 c1 from dual where 1=1;
c1
1
select 1 as c1 from dual where NULL is NULL;
c1
1
create table t1(c1 int primary key, c2 int);
insert into t1 values(1,1),(2,1);
select c2 +100 c3 from t1 where c1=1;
c3
101
select c2 -100 c3 from t1 where c1 in (1,2);
c3
-99
-99
drop table t1;
create table t1(c1 int,c2 varchar(1024),c3 float,c4 datetime(6),c5 int,c6 varchar(1024),c7 float, primary key(c1,c2));
insert into t1 (c1,c2,c3,c5,c6,c7) values(1,'s',1.5,1,'t',2.5);
select c5+1 c51,c6 c61,c7+1 c71 from t1 where c1=1 and c2='s' and c3=1.5;
c51 c61 c71
2 t 3.5
select c5+1 c51,c6 c61,c7+1 c71 from t1 where c1=1 and c2='s' and c3=1.5 and c5 in (1,2,3);
c51 c61 c71
2 t 3.5
drop table t1;

View File

@ -0,0 +1,125 @@
drop table if exists t1;
create table t1(c1 int primary key, c2 int);
insert into t1 values(7,3),(8,3),(1,1),(2,0),(3,1),(4,0),(5,2),(6,2);
select c1 as a1,c2 as a2 from t1 group by a2 order by a1;
a1 a2
1 1
2 0
5 2
7 3
select c1 as a1,c2 as a2 from t1 group by a1 order by a2;
a1 a2
2 0
4 0
1 1
3 1
5 2
6 2
7 3
8 3
select c1 as a1,c2 as a2 from t1 group by a2 order by a2;
a1 a2
2 0
1 1
5 2
7 3
select c1 as a1,c2 as a2 from t1 group by a1 order by a1;
a1 a2
1 1
2 0
3 1
4 0
5 2
6 2
7 3
8 3
select c1 as a1,c2 as a2 from t1 order by a2;
a1 a2
2 0
4 0
1 1
3 1
5 2
6 2
7 3
8 3
select c1 as a1,c2 as a2 from t1 order by a1;
a1 a2
1 1
2 0
3 1
4 0
5 2
6 2
7 3
8 3
select c1 as a1,c2 as a2 from t1 group by a2 having a2>0 order by a1;
a1 a2
1 1
5 2
7 3
select c1 as a1,c2 as a2 from t1 group by a2 having a2>0 order by a2;
a1 a2
1 1
5 2
7 3
select c1 as a1,c2 as a2 from t1 group by a2 having a1>0 order by a1;
a1 a2
1 1
2 0
5 2
7 3
select c1 as a1,c2 as a2 from t1 group by a2 having a1>0 order by a2;
a1 a2
2 0
1 1
5 2
7 3
select c1+c2 as total from t1 order by total;
total
2
2
4
4
7
8
10
11
select c1, c1+c2 as total from t1 group by total order by c1;
c1 total
1 2
3 4
5 7
6 8
7 10
8 11
select c1, c1+c2 as total from t1 group by total having c1>2 order by c1 desc;
c1 total
8 11
7 10
6 8
5 7
4 4
select c1 as a1, c2 as a2 from t1 where c1>1;
a1 a2
2 0
3 1
4 0
5 2
6 2
7 3
8 3
select c1 as a1, c2 as a2 from t1 where c2>1;
a1 a2
5 2
6 2
7 3
8 3
select c1,c1+c2 as a1 from t1 where c1+c2>2;
c1 a1
3 4
4 4
5 7
6 8
7 10
8 11

View File

@ -0,0 +1,6 @@
drop table if exists a1;
create table a1(rowkey_suffix int primary key, price int) ;
select count(distinct price) from a1;
count(distinct price)
100
drop table a1;

View File

@ -0,0 +1,7 @@
drop table if exists t1;
create table t1(i int primary key, c1 varchar(1024), c256 varchar(1024), dt datetime(6), d datetime(6));
set ob_query_timeout=100000000;
select count(i) from t1;
count(i)
2000
drop table t1;

View File

@ -0,0 +1,10 @@
drop table if exists ob_new_sql_test;
create table ob_new_sql_test(c0 varchar(20), c1 int primary key, c2 int , c3 int,c4 int,c5 int,c6 int,c7 int,c8 int,c9 int,c10 int,c11 int,c12 int,c13 int,c14 int,c15 int);
insert into ob_new_sql_test (c0, c1) values ('hello', 0);
select * from ob_new_sql_test where c1 < 1;
c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15
hello 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
select * from ob_new_sql_test where c1 = 0;
c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15
hello 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
drop table ob_new_sql_test;

View File

@ -0,0 +1,3 @@
drop table if exists t1;
create table t1(a int primary key, b int primary key);
ERROR 42000: Multiple primary key defined

View File

@ -0,0 +1,94 @@
drop table if exists t1;
create table t1(c1 int primary key, c2 int);
insert into t1 values(1,1),(2,2),(3,3);
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
select * from t1 as t2 where c1=1;
c1 c2
1 1
drop table t1;

View File

@ -0,0 +1,29 @@
drop table if exists t1;
create table t1(a bigint primary key , b bigint);
insert into t1 values(1,1),(2,2);
update t1 set b=100 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc limit 1;
select * from t1;
a b
1 100
2 2
update t1 set b=200 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc;
select * from t1;
a b
1 200
2 2
update t1 set b=300 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a limit 1;
select * from t1;
a b
1 300
2 2
drop table if exists t1;
create table t1(a bigint primary key , b bigint);
insert into t1 values(1,1),(2,2);
delete from t1 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc limit 1;
select * from t1;
a b
2 2
delete from t1 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc;
select * from t1;
a b
2 2

View File

@ -0,0 +1,9 @@
drop table if exists t1,t2,t3,t4;
set password for = password('pass11');
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '= password('pass11')' at line 1
set password '' for = password('pass11');
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ''' for = password('pass11')' at line 1
set password for '' = password('pass11');
ERROR 42000: Can not find any matching row in the user table
create user '' identified by 'pass11';
ERROR HY000: Operation CREATE USER failed for %

View File

@ -0,0 +1,516 @@
drop table if exists t;
create table t (a char(10) not null);
insert into t values('b'),('b ');
select hex(a) from t;
hex(a)
62
62
insert into t values('b '),('b');
select hex(a) from t;
hex(a)
62
62
62
62
drop table t;
drop table if exists test_bulk, test_bulk_prefix;
create table test_bulk(a int, b int, c int, d int, primary key(a, b)) row_format = redundant;
create table test_bulk_prefix(a int, b int, c int, d int, primary key(a, b, c, d)) row_format = redundant;
insert into test_bulk values (100,1,1,1), (100,2,1,1), (100,3,1,1), (100,4,1,1), (100,5,1,1), (100,6,1,1), (100,7,1,1), (100,8,1,1), (100,9,1,1), (100,10,1,1);
insert into test_bulk_prefix values (100,1,1,1), (100,2,2,2), (100,3,3,3), (100,4,4,4), (100,5,5,5), (100,6,6,6), (100,7,7,7), (100,8,8,8), (100,9,9,9), (100,10,10,10);
insert into test_bulk values (99,1,1,1), (99,2,1,1), (99,3,1,1), (99,4,1,1), (99,5,1,1), (99,6,1,1), (99,7,1,1), (99,8,1,1), (99,9,1,1), (99,10,1,1);
insert into test_bulk_prefix values (99,1,1,1), (99,2,2,2), (99,3,3,3), (99,4,4,4), (99,5,5,5), (99,6,6,6), (99,7,7,7), (99,8,8,8), (99,9,9,9), (99,10,10,10);
insert into test_bulk values (98,1,1,1), (98,2,1,1), (98,3,1,1), (98,4,1,1), (98,5,1,1), (98,6,1,1), (98,7,1,1), (98,8,1,1), (98,9,1,1), (98,10,1,1);
insert into test_bulk_prefix values (98,1,1,1), (98,2,2,2), (98,3,3,3), (98,4,4,4), (98,5,5,5), (98,6,6,6), (98,7,7,7), (98,8,8,8), (98,9,9,9), (98,10,10,10);
insert into test_bulk values (97,1,1,1), (97,2,1,1), (97,3,1,1), (97,4,1,1), (97,5,1,1), (97,6,1,1), (97,7,1,1), (97,8,1,1), (97,9,1,1), (97,10,1,1);
insert into test_bulk_prefix values (97,1,1,1), (97,2,2,2), (97,3,3,3), (97,4,4,4), (97,5,5,5), (97,6,6,6), (97,7,7,7), (97,8,8,8), (97,9,9,9), (97,10,10,10);
insert into test_bulk values (96,1,1,1), (96,2,1,1), (96,3,1,1), (96,4,1,1), (96,5,1,1), (96,6,1,1), (96,7,1,1), (96,8,1,1), (96,9,1,1), (96,10,1,1);
insert into test_bulk_prefix values (96,1,1,1), (96,2,2,2), (96,3,3,3), (96,4,4,4), (96,5,5,5), (96,6,6,6), (96,7,7,7), (96,8,8,8), (96,9,9,9), (96,10,10,10);
insert into test_bulk values (95,1,1,1), (95,2,1,1), (95,3,1,1), (95,4,1,1), (95,5,1,1), (95,6,1,1), (95,7,1,1), (95,8,1,1), (95,9,1,1), (95,10,1,1);
insert into test_bulk_prefix values (95,1,1,1), (95,2,2,2), (95,3,3,3), (95,4,4,4), (95,5,5,5), (95,6,6,6), (95,7,7,7), (95,8,8,8), (95,9,9,9), (95,10,10,10);
insert into test_bulk values (94,1,1,1), (94,2,1,1), (94,3,1,1), (94,4,1,1), (94,5,1,1), (94,6,1,1), (94,7,1,1), (94,8,1,1), (94,9,1,1), (94,10,1,1);
insert into test_bulk_prefix values (94,1,1,1), (94,2,2,2), (94,3,3,3), (94,4,4,4), (94,5,5,5), (94,6,6,6), (94,7,7,7), (94,8,8,8), (94,9,9,9), (94,10,10,10);
insert into test_bulk values (93,1,1,1), (93,2,1,1), (93,3,1,1), (93,4,1,1), (93,5,1,1), (93,6,1,1), (93,7,1,1), (93,8,1,1), (93,9,1,1), (93,10,1,1);
insert into test_bulk_prefix values (93,1,1,1), (93,2,2,2), (93,3,3,3), (93,4,4,4), (93,5,5,5), (93,6,6,6), (93,7,7,7), (93,8,8,8), (93,9,9,9), (93,10,10,10);
insert into test_bulk values (92,1,1,1), (92,2,1,1), (92,3,1,1), (92,4,1,1), (92,5,1,1), (92,6,1,1), (92,7,1,1), (92,8,1,1), (92,9,1,1), (92,10,1,1);
insert into test_bulk_prefix values (92,1,1,1), (92,2,2,2), (92,3,3,3), (92,4,4,4), (92,5,5,5), (92,6,6,6), (92,7,7,7), (92,8,8,8), (92,9,9,9), (92,10,10,10);
insert into test_bulk values (91,1,1,1), (91,2,1,1), (91,3,1,1), (91,4,1,1), (91,5,1,1), (91,6,1,1), (91,7,1,1), (91,8,1,1), (91,9,1,1), (91,10,1,1);
insert into test_bulk_prefix values (91,1,1,1), (91,2,2,2), (91,3,3,3), (91,4,4,4), (91,5,5,5), (91,6,6,6), (91,7,7,7), (91,8,8,8), (91,9,9,9), (91,10,10,10);
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1);
insert into test_bulk_prefix values (90,1,1,1), (90,2,2,2), (90,3,3,3), (90,4,4,4), (90,5,5,5), (90,6,6,6), (90,7,7,7), (90,8,8,8), (90,9,9,9), (90,10,10,10);
insert into test_bulk values (89,1,1,1), (89,2,1,1), (89,3,1,1), (89,4,1,1), (89,5,1,1), (89,6,1,1), (89,7,1,1), (89,8,1,1), (89,9,1,1), (89,10,1,1);
insert into test_bulk_prefix values (89,1,1,1), (89,2,2,2), (89,3,3,3), (89,4,4,4), (89,5,5,5), (89,6,6,6), (89,7,7,7), (89,8,8,8), (89,9,9,9), (89,10,10,10);
insert into test_bulk values (88,1,1,1), (88,2,1,1), (88,3,1,1), (88,4,1,1), (88,5,1,1), (88,6,1,1), (88,7,1,1), (88,8,1,1), (88,9,1,1), (88,10,1,1);
insert into test_bulk_prefix values (88,1,1,1), (88,2,2,2), (88,3,3,3), (88,4,4,4), (88,5,5,5), (88,6,6,6), (88,7,7,7), (88,8,8,8), (88,9,9,9), (88,10,10,10);
insert into test_bulk values (87,1,1,1), (87,2,1,1), (87,3,1,1), (87,4,1,1), (87,5,1,1), (87,6,1,1), (87,7,1,1), (87,8,1,1), (87,9,1,1), (87,10,1,1);
insert into test_bulk_prefix values (87,1,1,1), (87,2,2,2), (87,3,3,3), (87,4,4,4), (87,5,5,5), (87,6,6,6), (87,7,7,7), (87,8,8,8), (87,9,9,9), (87,10,10,10);
insert into test_bulk values (86,1,1,1), (86,2,1,1), (86,3,1,1), (86,4,1,1), (86,5,1,1), (86,6,1,1), (86,7,1,1), (86,8,1,1), (86,9,1,1), (86,10,1,1);
insert into test_bulk_prefix values (86,1,1,1), (86,2,2,2), (86,3,3,3), (86,4,4,4), (86,5,5,5), (86,6,6,6), (86,7,7,7), (86,8,8,8), (86,9,9,9), (86,10,10,10);
insert into test_bulk values (85,1,1,1), (85,2,1,1), (85,3,1,1), (85,4,1,1), (85,5,1,1), (85,6,1,1), (85,7,1,1), (85,8,1,1), (85,9,1,1), (85,10,1,1);
insert into test_bulk_prefix values (85,1,1,1), (85,2,2,2), (85,3,3,3), (85,4,4,4), (85,5,5,5), (85,6,6,6), (85,7,7,7), (85,8,8,8), (85,9,9,9), (85,10,10,10);
insert into test_bulk values (84,1,1,1), (84,2,1,1), (84,3,1,1), (84,4,1,1), (84,5,1,1), (84,6,1,1), (84,7,1,1), (84,8,1,1), (84,9,1,1), (84,10,1,1);
insert into test_bulk_prefix values (84,1,1,1), (84,2,2,2), (84,3,3,3), (84,4,4,4), (84,5,5,5), (84,6,6,6), (84,7,7,7), (84,8,8,8), (84,9,9,9), (84,10,10,10);
insert into test_bulk values (83,1,1,1), (83,2,1,1), (83,3,1,1), (83,4,1,1), (83,5,1,1), (83,6,1,1), (83,7,1,1), (83,8,1,1), (83,9,1,1), (83,10,1,1);
insert into test_bulk_prefix values (83,1,1,1), (83,2,2,2), (83,3,3,3), (83,4,4,4), (83,5,5,5), (83,6,6,6), (83,7,7,7), (83,8,8,8), (83,9,9,9), (83,10,10,10);
insert into test_bulk values (82,1,1,1), (82,2,1,1), (82,3,1,1), (82,4,1,1), (82,5,1,1), (82,6,1,1), (82,7,1,1), (82,8,1,1), (82,9,1,1), (82,10,1,1);
insert into test_bulk_prefix values (82,1,1,1), (82,2,2,2), (82,3,3,3), (82,4,4,4), (82,5,5,5), (82,6,6,6), (82,7,7,7), (82,8,8,8), (82,9,9,9), (82,10,10,10);
insert into test_bulk values (81,1,1,1), (81,2,1,1), (81,3,1,1), (81,4,1,1), (81,5,1,1), (81,6,1,1), (81,7,1,1), (81,8,1,1), (81,9,1,1), (81,10,1,1);
insert into test_bulk_prefix values (81,1,1,1), (81,2,2,2), (81,3,3,3), (81,4,4,4), (81,5,5,5), (81,6,6,6), (81,7,7,7), (81,8,8,8), (81,9,9,9), (81,10,10,10);
insert into test_bulk values (80,1,1,1), (80,2,1,1), (80,3,1,1), (80,4,1,1), (80,5,1,1), (80,6,1,1), (80,7,1,1), (80,8,1,1), (80,9,1,1), (80,10,1,1);
insert into test_bulk_prefix values (80,1,1,1), (80,2,2,2), (80,3,3,3), (80,4,4,4), (80,5,5,5), (80,6,6,6), (80,7,7,7), (80,8,8,8), (80,9,9,9), (80,10,10,10);
insert into test_bulk values (79,1,1,1), (79,2,1,1), (79,3,1,1), (79,4,1,1), (79,5,1,1), (79,6,1,1), (79,7,1,1), (79,8,1,1), (79,9,1,1), (79,10,1,1);
insert into test_bulk_prefix values (79,1,1,1), (79,2,2,2), (79,3,3,3), (79,4,4,4), (79,5,5,5), (79,6,6,6), (79,7,7,7), (79,8,8,8), (79,9,9,9), (79,10,10,10);
insert into test_bulk values (78,1,1,1), (78,2,1,1), (78,3,1,1), (78,4,1,1), (78,5,1,1), (78,6,1,1), (78,7,1,1), (78,8,1,1), (78,9,1,1), (78,10,1,1);
insert into test_bulk_prefix values (78,1,1,1), (78,2,2,2), (78,3,3,3), (78,4,4,4), (78,5,5,5), (78,6,6,6), (78,7,7,7), (78,8,8,8), (78,9,9,9), (78,10,10,10);
insert into test_bulk values (77,1,1,1), (77,2,1,1), (77,3,1,1), (77,4,1,1), (77,5,1,1), (77,6,1,1), (77,7,1,1), (77,8,1,1), (77,9,1,1), (77,10,1,1);
insert into test_bulk_prefix values (77,1,1,1), (77,2,2,2), (77,3,3,3), (77,4,4,4), (77,5,5,5), (77,6,6,6), (77,7,7,7), (77,8,8,8), (77,9,9,9), (77,10,10,10);
insert into test_bulk values (76,1,1,1), (76,2,1,1), (76,3,1,1), (76,4,1,1), (76,5,1,1), (76,6,1,1), (76,7,1,1), (76,8,1,1), (76,9,1,1), (76,10,1,1);
insert into test_bulk_prefix values (76,1,1,1), (76,2,2,2), (76,3,3,3), (76,4,4,4), (76,5,5,5), (76,6,6,6), (76,7,7,7), (76,8,8,8), (76,9,9,9), (76,10,10,10);
insert into test_bulk values (75,1,1,1), (75,2,1,1), (75,3,1,1), (75,4,1,1), (75,5,1,1), (75,6,1,1), (75,7,1,1), (75,8,1,1), (75,9,1,1), (75,10,1,1);
insert into test_bulk_prefix values (75,1,1,1), (75,2,2,2), (75,3,3,3), (75,4,4,4), (75,5,5,5), (75,6,6,6), (75,7,7,7), (75,8,8,8), (75,9,9,9), (75,10,10,10);
insert into test_bulk values (74,1,1,1), (74,2,1,1), (74,3,1,1), (74,4,1,1), (74,5,1,1), (74,6,1,1), (74,7,1,1), (74,8,1,1), (74,9,1,1), (74,10,1,1);
insert into test_bulk_prefix values (74,1,1,1), (74,2,2,2), (74,3,3,3), (74,4,4,4), (74,5,5,5), (74,6,6,6), (74,7,7,7), (74,8,8,8), (74,9,9,9), (74,10,10,10);
insert into test_bulk values (73,1,1,1), (73,2,1,1), (73,3,1,1), (73,4,1,1), (73,5,1,1), (73,6,1,1), (73,7,1,1), (73,8,1,1), (73,9,1,1), (73,10,1,1);
insert into test_bulk_prefix values (73,1,1,1), (73,2,2,2), (73,3,3,3), (73,4,4,4), (73,5,5,5), (73,6,6,6), (73,7,7,7), (73,8,8,8), (73,9,9,9), (73,10,10,10);
insert into test_bulk values (72,1,1,1), (72,2,1,1), (72,3,1,1), (72,4,1,1), (72,5,1,1), (72,6,1,1), (72,7,1,1), (72,8,1,1), (72,9,1,1), (72,10,1,1);
insert into test_bulk_prefix values (72,1,1,1), (72,2,2,2), (72,3,3,3), (72,4,4,4), (72,5,5,5), (72,6,6,6), (72,7,7,7), (72,8,8,8), (72,9,9,9), (72,10,10,10);
insert into test_bulk values (71,1,1,1), (71,2,1,1), (71,3,1,1), (71,4,1,1), (71,5,1,1), (71,6,1,1), (71,7,1,1), (71,8,1,1), (71,9,1,1), (71,10,1,1);
insert into test_bulk_prefix values (71,1,1,1), (71,2,2,2), (71,3,3,3), (71,4,4,4), (71,5,5,5), (71,6,6,6), (71,7,7,7), (71,8,8,8), (71,9,9,9), (71,10,10,10);
insert into test_bulk values (70,1,1,1), (70,2,1,1), (70,3,1,1), (70,4,1,1), (70,5,1,1), (70,6,1,1), (70,7,1,1), (70,8,1,1), (70,9,1,1), (70,10,1,1);
insert into test_bulk_prefix values (70,1,1,1), (70,2,2,2), (70,3,3,3), (70,4,4,4), (70,5,5,5), (70,6,6,6), (70,7,7,7), (70,8,8,8), (70,9,9,9), (70,10,10,10);
insert into test_bulk values (69,1,1,1), (69,2,1,1), (69,3,1,1), (69,4,1,1), (69,5,1,1), (69,6,1,1), (69,7,1,1), (69,8,1,1), (69,9,1,1), (69,10,1,1);
insert into test_bulk_prefix values (69,1,1,1), (69,2,2,2), (69,3,3,3), (69,4,4,4), (69,5,5,5), (69,6,6,6), (69,7,7,7), (69,8,8,8), (69,9,9,9), (69,10,10,10);
insert into test_bulk values (68,1,1,1), (68,2,1,1), (68,3,1,1), (68,4,1,1), (68,5,1,1), (68,6,1,1), (68,7,1,1), (68,8,1,1), (68,9,1,1), (68,10,1,1);
insert into test_bulk_prefix values (68,1,1,1), (68,2,2,2), (68,3,3,3), (68,4,4,4), (68,5,5,5), (68,6,6,6), (68,7,7,7), (68,8,8,8), (68,9,9,9), (68,10,10,10);
insert into test_bulk values (67,1,1,1), (67,2,1,1), (67,3,1,1), (67,4,1,1), (67,5,1,1), (67,6,1,1), (67,7,1,1), (67,8,1,1), (67,9,1,1), (67,10,1,1);
insert into test_bulk_prefix values (67,1,1,1), (67,2,2,2), (67,3,3,3), (67,4,4,4), (67,5,5,5), (67,6,6,6), (67,7,7,7), (67,8,8,8), (67,9,9,9), (67,10,10,10);
insert into test_bulk values (66,1,1,1), (66,2,1,1), (66,3,1,1), (66,4,1,1), (66,5,1,1), (66,6,1,1), (66,7,1,1), (66,8,1,1), (66,9,1,1), (66,10,1,1);
insert into test_bulk_prefix values (66,1,1,1), (66,2,2,2), (66,3,3,3), (66,4,4,4), (66,5,5,5), (66,6,6,6), (66,7,7,7), (66,8,8,8), (66,9,9,9), (66,10,10,10);
insert into test_bulk values (65,1,1,1), (65,2,1,1), (65,3,1,1), (65,4,1,1), (65,5,1,1), (65,6,1,1), (65,7,1,1), (65,8,1,1), (65,9,1,1), (65,10,1,1);
insert into test_bulk_prefix values (65,1,1,1), (65,2,2,2), (65,3,3,3), (65,4,4,4), (65,5,5,5), (65,6,6,6), (65,7,7,7), (65,8,8,8), (65,9,9,9), (65,10,10,10);
insert into test_bulk values (64,1,1,1), (64,2,1,1), (64,3,1,1), (64,4,1,1), (64,5,1,1), (64,6,1,1), (64,7,1,1), (64,8,1,1), (64,9,1,1), (64,10,1,1);
insert into test_bulk_prefix values (64,1,1,1), (64,2,2,2), (64,3,3,3), (64,4,4,4), (64,5,5,5), (64,6,6,6), (64,7,7,7), (64,8,8,8), (64,9,9,9), (64,10,10,10);
insert into test_bulk values (63,1,1,1), (63,2,1,1), (63,3,1,1), (63,4,1,1), (63,5,1,1), (63,6,1,1), (63,7,1,1), (63,8,1,1), (63,9,1,1), (63,10,1,1);
insert into test_bulk_prefix values (63,1,1,1), (63,2,2,2), (63,3,3,3), (63,4,4,4), (63,5,5,5), (63,6,6,6), (63,7,7,7), (63,8,8,8), (63,9,9,9), (63,10,10,10);
insert into test_bulk values (62,1,1,1), (62,2,1,1), (62,3,1,1), (62,4,1,1), (62,5,1,1), (62,6,1,1), (62,7,1,1), (62,8,1,1), (62,9,1,1), (62,10,1,1);
insert into test_bulk_prefix values (62,1,1,1), (62,2,2,2), (62,3,3,3), (62,4,4,4), (62,5,5,5), (62,6,6,6), (62,7,7,7), (62,8,8,8), (62,9,9,9), (62,10,10,10);
insert into test_bulk values (61,1,1,1), (61,2,1,1), (61,3,1,1), (61,4,1,1), (61,5,1,1), (61,6,1,1), (61,7,1,1), (61,8,1,1), (61,9,1,1), (61,10,1,1);
insert into test_bulk_prefix values (61,1,1,1), (61,2,2,2), (61,3,3,3), (61,4,4,4), (61,5,5,5), (61,6,6,6), (61,7,7,7), (61,8,8,8), (61,9,9,9), (61,10,10,10);
insert into test_bulk values (60,1,1,1), (60,2,1,1), (60,3,1,1), (60,4,1,1), (60,5,1,1), (60,6,1,1), (60,7,1,1), (60,8,1,1), (60,9,1,1), (60,10,1,1);
insert into test_bulk_prefix values (60,1,1,1), (60,2,2,2), (60,3,3,3), (60,4,4,4), (60,5,5,5), (60,6,6,6), (60,7,7,7), (60,8,8,8), (60,9,9,9), (60,10,10,10);
insert into test_bulk values (59,1,1,1), (59,2,1,1), (59,3,1,1), (59,4,1,1), (59,5,1,1), (59,6,1,1), (59,7,1,1), (59,8,1,1), (59,9,1,1), (59,10,1,1);
insert into test_bulk_prefix values (59,1,1,1), (59,2,2,2), (59,3,3,3), (59,4,4,4), (59,5,5,5), (59,6,6,6), (59,7,7,7), (59,8,8,8), (59,9,9,9), (59,10,10,10);
insert into test_bulk values (58,1,1,1), (58,2,1,1), (58,3,1,1), (58,4,1,1), (58,5,1,1), (58,6,1,1), (58,7,1,1), (58,8,1,1), (58,9,1,1), (58,10,1,1);
insert into test_bulk_prefix values (58,1,1,1), (58,2,2,2), (58,3,3,3), (58,4,4,4), (58,5,5,5), (58,6,6,6), (58,7,7,7), (58,8,8,8), (58,9,9,9), (58,10,10,10);
insert into test_bulk values (57,1,1,1), (57,2,1,1), (57,3,1,1), (57,4,1,1), (57,5,1,1), (57,6,1,1), (57,7,1,1), (57,8,1,1), (57,9,1,1), (57,10,1,1);
insert into test_bulk_prefix values (57,1,1,1), (57,2,2,2), (57,3,3,3), (57,4,4,4), (57,5,5,5), (57,6,6,6), (57,7,7,7), (57,8,8,8), (57,9,9,9), (57,10,10,10);
insert into test_bulk values (56,1,1,1), (56,2,1,1), (56,3,1,1), (56,4,1,1), (56,5,1,1), (56,6,1,1), (56,7,1,1), (56,8,1,1), (56,9,1,1), (56,10,1,1);
insert into test_bulk_prefix values (56,1,1,1), (56,2,2,2), (56,3,3,3), (56,4,4,4), (56,5,5,5), (56,6,6,6), (56,7,7,7), (56,8,8,8), (56,9,9,9), (56,10,10,10);
insert into test_bulk values (55,1,1,1), (55,2,1,1), (55,3,1,1), (55,4,1,1), (55,5,1,1), (55,6,1,1), (55,7,1,1), (55,8,1,1), (55,9,1,1), (55,10,1,1);
insert into test_bulk_prefix values (55,1,1,1), (55,2,2,2), (55,3,3,3), (55,4,4,4), (55,5,5,5), (55,6,6,6), (55,7,7,7), (55,8,8,8), (55,9,9,9), (55,10,10,10);
insert into test_bulk values (54,1,1,1), (54,2,1,1), (54,3,1,1), (54,4,1,1), (54,5,1,1), (54,6,1,1), (54,7,1,1), (54,8,1,1), (54,9,1,1), (54,10,1,1);
insert into test_bulk_prefix values (54,1,1,1), (54,2,2,2), (54,3,3,3), (54,4,4,4), (54,5,5,5), (54,6,6,6), (54,7,7,7), (54,8,8,8), (54,9,9,9), (54,10,10,10);
insert into test_bulk values (53,1,1,1), (53,2,1,1), (53,3,1,1), (53,4,1,1), (53,5,1,1), (53,6,1,1), (53,7,1,1), (53,8,1,1), (53,9,1,1), (53,10,1,1);
insert into test_bulk_prefix values (53,1,1,1), (53,2,2,2), (53,3,3,3), (53,4,4,4), (53,5,5,5), (53,6,6,6), (53,7,7,7), (53,8,8,8), (53,9,9,9), (53,10,10,10);
insert into test_bulk values (52,1,1,1), (52,2,1,1), (52,3,1,1), (52,4,1,1), (52,5,1,1), (52,6,1,1), (52,7,1,1), (52,8,1,1), (52,9,1,1), (52,10,1,1);
insert into test_bulk_prefix values (52,1,1,1), (52,2,2,2), (52,3,3,3), (52,4,4,4), (52,5,5,5), (52,6,6,6), (52,7,7,7), (52,8,8,8), (52,9,9,9), (52,10,10,10);
insert into test_bulk values (51,1,1,1), (51,2,1,1), (51,3,1,1), (51,4,1,1), (51,5,1,1), (51,6,1,1), (51,7,1,1), (51,8,1,1), (51,9,1,1), (51,10,1,1);
insert into test_bulk_prefix values (51,1,1,1), (51,2,2,2), (51,3,3,3), (51,4,4,4), (51,5,5,5), (51,6,6,6), (51,7,7,7), (51,8,8,8), (51,9,9,9), (51,10,10,10);
insert into test_bulk values (50,1,1,1), (50,2,1,1), (50,3,1,1), (50,4,1,1), (50,5,1,1), (50,6,1,1), (50,7,1,1), (50,8,1,1), (50,9,1,1), (50,10,1,1);
insert into test_bulk_prefix values (50,1,1,1), (50,2,2,2), (50,3,3,3), (50,4,4,4), (50,5,5,5), (50,6,6,6), (50,7,7,7), (50,8,8,8), (50,9,9,9), (50,10,10,10);
insert into test_bulk values (49,1,1,1), (49,2,1,1), (49,3,1,1), (49,4,1,1), (49,5,1,1), (49,6,1,1), (49,7,1,1), (49,8,1,1), (49,9,1,1), (49,10,1,1);
insert into test_bulk_prefix values (49,1,1,1), (49,2,2,2), (49,3,3,3), (49,4,4,4), (49,5,5,5), (49,6,6,6), (49,7,7,7), (49,8,8,8), (49,9,9,9), (49,10,10,10);
insert into test_bulk values (48,1,1,1), (48,2,1,1), (48,3,1,1), (48,4,1,1), (48,5,1,1), (48,6,1,1), (48,7,1,1), (48,8,1,1), (48,9,1,1), (48,10,1,1);
insert into test_bulk_prefix values (48,1,1,1), (48,2,2,2), (48,3,3,3), (48,4,4,4), (48,5,5,5), (48,6,6,6), (48,7,7,7), (48,8,8,8), (48,9,9,9), (48,10,10,10);
insert into test_bulk values (47,1,1,1), (47,2,1,1), (47,3,1,1), (47,4,1,1), (47,5,1,1), (47,6,1,1), (47,7,1,1), (47,8,1,1), (47,9,1,1), (47,10,1,1);
insert into test_bulk_prefix values (47,1,1,1), (47,2,2,2), (47,3,3,3), (47,4,4,4), (47,5,5,5), (47,6,6,6), (47,7,7,7), (47,8,8,8), (47,9,9,9), (47,10,10,10);
insert into test_bulk values (46,1,1,1), (46,2,1,1), (46,3,1,1), (46,4,1,1), (46,5,1,1), (46,6,1,1), (46,7,1,1), (46,8,1,1), (46,9,1,1), (46,10,1,1);
insert into test_bulk_prefix values (46,1,1,1), (46,2,2,2), (46,3,3,3), (46,4,4,4), (46,5,5,5), (46,6,6,6), (46,7,7,7), (46,8,8,8), (46,9,9,9), (46,10,10,10);
insert into test_bulk values (45,1,1,1), (45,2,1,1), (45,3,1,1), (45,4,1,1), (45,5,1,1), (45,6,1,1), (45,7,1,1), (45,8,1,1), (45,9,1,1), (45,10,1,1);
insert into test_bulk_prefix values (45,1,1,1), (45,2,2,2), (45,3,3,3), (45,4,4,4), (45,5,5,5), (45,6,6,6), (45,7,7,7), (45,8,8,8), (45,9,9,9), (45,10,10,10);
insert into test_bulk values (44,1,1,1), (44,2,1,1), (44,3,1,1), (44,4,1,1), (44,5,1,1), (44,6,1,1), (44,7,1,1), (44,8,1,1), (44,9,1,1), (44,10,1,1);
insert into test_bulk_prefix values (44,1,1,1), (44,2,2,2), (44,3,3,3), (44,4,4,4), (44,5,5,5), (44,6,6,6), (44,7,7,7), (44,8,8,8), (44,9,9,9), (44,10,10,10);
insert into test_bulk values (43,1,1,1), (43,2,1,1), (43,3,1,1), (43,4,1,1), (43,5,1,1), (43,6,1,1), (43,7,1,1), (43,8,1,1), (43,9,1,1), (43,10,1,1);
insert into test_bulk_prefix values (43,1,1,1), (43,2,2,2), (43,3,3,3), (43,4,4,4), (43,5,5,5), (43,6,6,6), (43,7,7,7), (43,8,8,8), (43,9,9,9), (43,10,10,10);
insert into test_bulk values (42,1,1,1), (42,2,1,1), (42,3,1,1), (42,4,1,1), (42,5,1,1), (42,6,1,1), (42,7,1,1), (42,8,1,1), (42,9,1,1), (42,10,1,1);
insert into test_bulk_prefix values (42,1,1,1), (42,2,2,2), (42,3,3,3), (42,4,4,4), (42,5,5,5), (42,6,6,6), (42,7,7,7), (42,8,8,8), (42,9,9,9), (42,10,10,10);
insert into test_bulk values (41,1,1,1), (41,2,1,1), (41,3,1,1), (41,4,1,1), (41,5,1,1), (41,6,1,1), (41,7,1,1), (41,8,1,1), (41,9,1,1), (41,10,1,1);
insert into test_bulk_prefix values (41,1,1,1), (41,2,2,2), (41,3,3,3), (41,4,4,4), (41,5,5,5), (41,6,6,6), (41,7,7,7), (41,8,8,8), (41,9,9,9), (41,10,10,10);
insert into test_bulk values (40,1,1,1), (40,2,1,1), (40,3,1,1), (40,4,1,1), (40,5,1,1), (40,6,1,1), (40,7,1,1), (40,8,1,1), (40,9,1,1), (40,10,1,1);
insert into test_bulk_prefix values (40,1,1,1), (40,2,2,2), (40,3,3,3), (40,4,4,4), (40,5,5,5), (40,6,6,6), (40,7,7,7), (40,8,8,8), (40,9,9,9), (40,10,10,10);
insert into test_bulk values (39,1,1,1), (39,2,1,1), (39,3,1,1), (39,4,1,1), (39,5,1,1), (39,6,1,1), (39,7,1,1), (39,8,1,1), (39,9,1,1), (39,10,1,1);
insert into test_bulk_prefix values (39,1,1,1), (39,2,2,2), (39,3,3,3), (39,4,4,4), (39,5,5,5), (39,6,6,6), (39,7,7,7), (39,8,8,8), (39,9,9,9), (39,10,10,10);
insert into test_bulk values (38,1,1,1), (38,2,1,1), (38,3,1,1), (38,4,1,1), (38,5,1,1), (38,6,1,1), (38,7,1,1), (38,8,1,1), (38,9,1,1), (38,10,1,1);
insert into test_bulk_prefix values (38,1,1,1), (38,2,2,2), (38,3,3,3), (38,4,4,4), (38,5,5,5), (38,6,6,6), (38,7,7,7), (38,8,8,8), (38,9,9,9), (38,10,10,10);
insert into test_bulk values (37,1,1,1), (37,2,1,1), (37,3,1,1), (37,4,1,1), (37,5,1,1), (37,6,1,1), (37,7,1,1), (37,8,1,1), (37,9,1,1), (37,10,1,1);
insert into test_bulk_prefix values (37,1,1,1), (37,2,2,2), (37,3,3,3), (37,4,4,4), (37,5,5,5), (37,6,6,6), (37,7,7,7), (37,8,8,8), (37,9,9,9), (37,10,10,10);
insert into test_bulk values (36,1,1,1), (36,2,1,1), (36,3,1,1), (36,4,1,1), (36,5,1,1), (36,6,1,1), (36,7,1,1), (36,8,1,1), (36,9,1,1), (36,10,1,1);
insert into test_bulk_prefix values (36,1,1,1), (36,2,2,2), (36,3,3,3), (36,4,4,4), (36,5,5,5), (36,6,6,6), (36,7,7,7), (36,8,8,8), (36,9,9,9), (36,10,10,10);
insert into test_bulk values (35,1,1,1), (35,2,1,1), (35,3,1,1), (35,4,1,1), (35,5,1,1), (35,6,1,1), (35,7,1,1), (35,8,1,1), (35,9,1,1), (35,10,1,1);
insert into test_bulk_prefix values (35,1,1,1), (35,2,2,2), (35,3,3,3), (35,4,4,4), (35,5,5,5), (35,6,6,6), (35,7,7,7), (35,8,8,8), (35,9,9,9), (35,10,10,10);
insert into test_bulk values (34,1,1,1), (34,2,1,1), (34,3,1,1), (34,4,1,1), (34,5,1,1), (34,6,1,1), (34,7,1,1), (34,8,1,1), (34,9,1,1), (34,10,1,1);
insert into test_bulk_prefix values (34,1,1,1), (34,2,2,2), (34,3,3,3), (34,4,4,4), (34,5,5,5), (34,6,6,6), (34,7,7,7), (34,8,8,8), (34,9,9,9), (34,10,10,10);
insert into test_bulk values (33,1,1,1), (33,2,1,1), (33,3,1,1), (33,4,1,1), (33,5,1,1), (33,6,1,1), (33,7,1,1), (33,8,1,1), (33,9,1,1), (33,10,1,1);
insert into test_bulk_prefix values (33,1,1,1), (33,2,2,2), (33,3,3,3), (33,4,4,4), (33,5,5,5), (33,6,6,6), (33,7,7,7), (33,8,8,8), (33,9,9,9), (33,10,10,10);
insert into test_bulk values (32,1,1,1), (32,2,1,1), (32,3,1,1), (32,4,1,1), (32,5,1,1), (32,6,1,1), (32,7,1,1), (32,8,1,1), (32,9,1,1), (32,10,1,1);
insert into test_bulk_prefix values (32,1,1,1), (32,2,2,2), (32,3,3,3), (32,4,4,4), (32,5,5,5), (32,6,6,6), (32,7,7,7), (32,8,8,8), (32,9,9,9), (32,10,10,10);
insert into test_bulk values (31,1,1,1), (31,2,1,1), (31,3,1,1), (31,4,1,1), (31,5,1,1), (31,6,1,1), (31,7,1,1), (31,8,1,1), (31,9,1,1), (31,10,1,1);
insert into test_bulk_prefix values (31,1,1,1), (31,2,2,2), (31,3,3,3), (31,4,4,4), (31,5,5,5), (31,6,6,6), (31,7,7,7), (31,8,8,8), (31,9,9,9), (31,10,10,10);
insert into test_bulk values (30,1,1,1), (30,2,1,1), (30,3,1,1), (30,4,1,1), (30,5,1,1), (30,6,1,1), (30,7,1,1), (30,8,1,1), (30,9,1,1), (30,10,1,1);
insert into test_bulk_prefix values (30,1,1,1), (30,2,2,2), (30,3,3,3), (30,4,4,4), (30,5,5,5), (30,6,6,6), (30,7,7,7), (30,8,8,8), (30,9,9,9), (30,10,10,10);
insert into test_bulk values (29,1,1,1), (29,2,1,1), (29,3,1,1), (29,4,1,1), (29,5,1,1), (29,6,1,1), (29,7,1,1), (29,8,1,1), (29,9,1,1), (29,10,1,1);
insert into test_bulk_prefix values (29,1,1,1), (29,2,2,2), (29,3,3,3), (29,4,4,4), (29,5,5,5), (29,6,6,6), (29,7,7,7), (29,8,8,8), (29,9,9,9), (29,10,10,10);
insert into test_bulk values (28,1,1,1), (28,2,1,1), (28,3,1,1), (28,4,1,1), (28,5,1,1), (28,6,1,1), (28,7,1,1), (28,8,1,1), (28,9,1,1), (28,10,1,1);
insert into test_bulk_prefix values (28,1,1,1), (28,2,2,2), (28,3,3,3), (28,4,4,4), (28,5,5,5), (28,6,6,6), (28,7,7,7), (28,8,8,8), (28,9,9,9), (28,10,10,10);
insert into test_bulk values (27,1,1,1), (27,2,1,1), (27,3,1,1), (27,4,1,1), (27,5,1,1), (27,6,1,1), (27,7,1,1), (27,8,1,1), (27,9,1,1), (27,10,1,1);
insert into test_bulk_prefix values (27,1,1,1), (27,2,2,2), (27,3,3,3), (27,4,4,4), (27,5,5,5), (27,6,6,6), (27,7,7,7), (27,8,8,8), (27,9,9,9), (27,10,10,10);
insert into test_bulk values (26,1,1,1), (26,2,1,1), (26,3,1,1), (26,4,1,1), (26,5,1,1), (26,6,1,1), (26,7,1,1), (26,8,1,1), (26,9,1,1), (26,10,1,1);
insert into test_bulk_prefix values (26,1,1,1), (26,2,2,2), (26,3,3,3), (26,4,4,4), (26,5,5,5), (26,6,6,6), (26,7,7,7), (26,8,8,8), (26,9,9,9), (26,10,10,10);
insert into test_bulk values (25,1,1,1), (25,2,1,1), (25,3,1,1), (25,4,1,1), (25,5,1,1), (25,6,1,1), (25,7,1,1), (25,8,1,1), (25,9,1,1), (25,10,1,1);
insert into test_bulk_prefix values (25,1,1,1), (25,2,2,2), (25,3,3,3), (25,4,4,4), (25,5,5,5), (25,6,6,6), (25,7,7,7), (25,8,8,8), (25,9,9,9), (25,10,10,10);
insert into test_bulk values (24,1,1,1), (24,2,1,1), (24,3,1,1), (24,4,1,1), (24,5,1,1), (24,6,1,1), (24,7,1,1), (24,8,1,1), (24,9,1,1), (24,10,1,1);
insert into test_bulk_prefix values (24,1,1,1), (24,2,2,2), (24,3,3,3), (24,4,4,4), (24,5,5,5), (24,6,6,6), (24,7,7,7), (24,8,8,8), (24,9,9,9), (24,10,10,10);
insert into test_bulk values (23,1,1,1), (23,2,1,1), (23,3,1,1), (23,4,1,1), (23,5,1,1), (23,6,1,1), (23,7,1,1), (23,8,1,1), (23,9,1,1), (23,10,1,1);
insert into test_bulk_prefix values (23,1,1,1), (23,2,2,2), (23,3,3,3), (23,4,4,4), (23,5,5,5), (23,6,6,6), (23,7,7,7), (23,8,8,8), (23,9,9,9), (23,10,10,10);
insert into test_bulk values (22,1,1,1), (22,2,1,1), (22,3,1,1), (22,4,1,1), (22,5,1,1), (22,6,1,1), (22,7,1,1), (22,8,1,1), (22,9,1,1), (22,10,1,1);
insert into test_bulk_prefix values (22,1,1,1), (22,2,2,2), (22,3,3,3), (22,4,4,4), (22,5,5,5), (22,6,6,6), (22,7,7,7), (22,8,8,8), (22,9,9,9), (22,10,10,10);
insert into test_bulk values (21,1,1,1), (21,2,1,1), (21,3,1,1), (21,4,1,1), (21,5,1,1), (21,6,1,1), (21,7,1,1), (21,8,1,1), (21,9,1,1), (21,10,1,1);
insert into test_bulk_prefix values (21,1,1,1), (21,2,2,2), (21,3,3,3), (21,4,4,4), (21,5,5,5), (21,6,6,6), (21,7,7,7), (21,8,8,8), (21,9,9,9), (21,10,10,10);
insert into test_bulk values (20,1,1,1), (20,2,1,1), (20,3,1,1), (20,4,1,1), (20,5,1,1), (20,6,1,1), (20,7,1,1), (20,8,1,1), (20,9,1,1), (20,10,1,1);
insert into test_bulk_prefix values (20,1,1,1), (20,2,2,2), (20,3,3,3), (20,4,4,4), (20,5,5,5), (20,6,6,6), (20,7,7,7), (20,8,8,8), (20,9,9,9), (20,10,10,10);
insert into test_bulk values (19,1,1,1), (19,2,1,1), (19,3,1,1), (19,4,1,1), (19,5,1,1), (19,6,1,1), (19,7,1,1), (19,8,1,1), (19,9,1,1), (19,10,1,1);
insert into test_bulk_prefix values (19,1,1,1), (19,2,2,2), (19,3,3,3), (19,4,4,4), (19,5,5,5), (19,6,6,6), (19,7,7,7), (19,8,8,8), (19,9,9,9), (19,10,10,10);
insert into test_bulk values (18,1,1,1), (18,2,1,1), (18,3,1,1), (18,4,1,1), (18,5,1,1), (18,6,1,1), (18,7,1,1), (18,8,1,1), (18,9,1,1), (18,10,1,1);
insert into test_bulk_prefix values (18,1,1,1), (18,2,2,2), (18,3,3,3), (18,4,4,4), (18,5,5,5), (18,6,6,6), (18,7,7,7), (18,8,8,8), (18,9,9,9), (18,10,10,10);
insert into test_bulk values (17,1,1,1), (17,2,1,1), (17,3,1,1), (17,4,1,1), (17,5,1,1), (17,6,1,1), (17,7,1,1), (17,8,1,1), (17,9,1,1), (17,10,1,1);
insert into test_bulk_prefix values (17,1,1,1), (17,2,2,2), (17,3,3,3), (17,4,4,4), (17,5,5,5), (17,6,6,6), (17,7,7,7), (17,8,8,8), (17,9,9,9), (17,10,10,10);
insert into test_bulk values (16,1,1,1), (16,2,1,1), (16,3,1,1), (16,4,1,1), (16,5,1,1), (16,6,1,1), (16,7,1,1), (16,8,1,1), (16,9,1,1), (16,10,1,1);
insert into test_bulk_prefix values (16,1,1,1), (16,2,2,2), (16,3,3,3), (16,4,4,4), (16,5,5,5), (16,6,6,6), (16,7,7,7), (16,8,8,8), (16,9,9,9), (16,10,10,10);
insert into test_bulk values (15,1,1,1), (15,2,1,1), (15,3,1,1), (15,4,1,1), (15,5,1,1), (15,6,1,1), (15,7,1,1), (15,8,1,1), (15,9,1,1), (15,10,1,1);
insert into test_bulk_prefix values (15,1,1,1), (15,2,2,2), (15,3,3,3), (15,4,4,4), (15,5,5,5), (15,6,6,6), (15,7,7,7), (15,8,8,8), (15,9,9,9), (15,10,10,10);
insert into test_bulk values (14,1,1,1), (14,2,1,1), (14,3,1,1), (14,4,1,1), (14,5,1,1), (14,6,1,1), (14,7,1,1), (14,8,1,1), (14,9,1,1), (14,10,1,1);
insert into test_bulk_prefix values (14,1,1,1), (14,2,2,2), (14,3,3,3), (14,4,4,4), (14,5,5,5), (14,6,6,6), (14,7,7,7), (14,8,8,8), (14,9,9,9), (14,10,10,10);
insert into test_bulk values (13,1,1,1), (13,2,1,1), (13,3,1,1), (13,4,1,1), (13,5,1,1), (13,6,1,1), (13,7,1,1), (13,8,1,1), (13,9,1,1), (13,10,1,1);
insert into test_bulk_prefix values (13,1,1,1), (13,2,2,2), (13,3,3,3), (13,4,4,4), (13,5,5,5), (13,6,6,6), (13,7,7,7), (13,8,8,8), (13,9,9,9), (13,10,10,10);
insert into test_bulk values (12,1,1,1), (12,2,1,1), (12,3,1,1), (12,4,1,1), (12,5,1,1), (12,6,1,1), (12,7,1,1), (12,8,1,1), (12,9,1,1), (12,10,1,1);
insert into test_bulk_prefix values (12,1,1,1), (12,2,2,2), (12,3,3,3), (12,4,4,4), (12,5,5,5), (12,6,6,6), (12,7,7,7), (12,8,8,8), (12,9,9,9), (12,10,10,10);
insert into test_bulk values (11,1,1,1), (11,2,1,1), (11,3,1,1), (11,4,1,1), (11,5,1,1), (11,6,1,1), (11,7,1,1), (11,8,1,1), (11,9,1,1), (11,10,1,1);
insert into test_bulk_prefix values (11,1,1,1), (11,2,2,2), (11,3,3,3), (11,4,4,4), (11,5,5,5), (11,6,6,6), (11,7,7,7), (11,8,8,8), (11,9,9,9), (11,10,10,10);
insert into test_bulk values (10,1,1,1), (10,2,1,1), (10,3,1,1), (10,4,1,1), (10,5,1,1), (10,6,1,1), (10,7,1,1), (10,8,1,1), (10,9,1,1), (10,10,1,1);
insert into test_bulk_prefix values (10,1,1,1), (10,2,2,2), (10,3,3,3), (10,4,4,4), (10,5,5,5), (10,6,6,6), (10,7,7,7), (10,8,8,8), (10,9,9,9), (10,10,10,10);
insert into test_bulk values (9,1,1,1), (9,2,1,1), (9,3,1,1), (9,4,1,1), (9,5,1,1), (9,6,1,1), (9,7,1,1), (9,8,1,1), (9,9,1,1), (9,10,1,1);
insert into test_bulk_prefix values (9,1,1,1), (9,2,2,2), (9,3,3,3), (9,4,4,4), (9,5,5,5), (9,6,6,6), (9,7,7,7), (9,8,8,8), (9,9,9,9), (9,10,10,10);
insert into test_bulk values (8,1,1,1), (8,2,1,1), (8,3,1,1), (8,4,1,1), (8,5,1,1), (8,6,1,1), (8,7,1,1), (8,8,1,1), (8,9,1,1), (8,10,1,1);
insert into test_bulk_prefix values (8,1,1,1), (8,2,2,2), (8,3,3,3), (8,4,4,4), (8,5,5,5), (8,6,6,6), (8,7,7,7), (8,8,8,8), (8,9,9,9), (8,10,10,10);
insert into test_bulk values (7,1,1,1), (7,2,1,1), (7,3,1,1), (7,4,1,1), (7,5,1,1), (7,6,1,1), (7,7,1,1), (7,8,1,1), (7,9,1,1), (7,10,1,1);
insert into test_bulk_prefix values (7,1,1,1), (7,2,2,2), (7,3,3,3), (7,4,4,4), (7,5,5,5), (7,6,6,6), (7,7,7,7), (7,8,8,8), (7,9,9,9), (7,10,10,10);
insert into test_bulk values (6,1,1,1), (6,2,1,1), (6,3,1,1), (6,4,1,1), (6,5,1,1), (6,6,1,1), (6,7,1,1), (6,8,1,1), (6,9,1,1), (6,10,1,1);
insert into test_bulk_prefix values (6,1,1,1), (6,2,2,2), (6,3,3,3), (6,4,4,4), (6,5,5,5), (6,6,6,6), (6,7,7,7), (6,8,8,8), (6,9,9,9), (6,10,10,10);
insert into test_bulk values (5,1,1,1), (5,2,1,1), (5,3,1,1), (5,4,1,1), (5,5,1,1), (5,6,1,1), (5,7,1,1), (5,8,1,1), (5,9,1,1), (5,10,1,1);
insert into test_bulk_prefix values (5,1,1,1), (5,2,2,2), (5,3,3,3), (5,4,4,4), (5,5,5,5), (5,6,6,6), (5,7,7,7), (5,8,8,8), (5,9,9,9), (5,10,10,10);
insert into test_bulk values (4,1,1,1), (4,2,1,1), (4,3,1,1), (4,4,1,1), (4,5,1,1), (4,6,1,1), (4,7,1,1), (4,8,1,1), (4,9,1,1), (4,10,1,1);
insert into test_bulk_prefix values (4,1,1,1), (4,2,2,2), (4,3,3,3), (4,4,4,4), (4,5,5,5), (4,6,6,6), (4,7,7,7), (4,8,8,8), (4,9,9,9), (4,10,10,10);
insert into test_bulk values (3,1,1,1), (3,2,1,1), (3,3,1,1), (3,4,1,1), (3,5,1,1), (3,6,1,1), (3,7,1,1), (3,8,1,1), (3,9,1,1), (3,10,1,1);
insert into test_bulk_prefix values (3,1,1,1), (3,2,2,2), (3,3,3,3), (3,4,4,4), (3,5,5,5), (3,6,6,6), (3,7,7,7), (3,8,8,8), (3,9,9,9), (3,10,10,10);
insert into test_bulk values (2,1,1,1), (2,2,1,1), (2,3,1,1), (2,4,1,1), (2,5,1,1), (2,6,1,1), (2,7,1,1), (2,8,1,1), (2,9,1,1), (2,10,1,1);
insert into test_bulk_prefix values (2,1,1,1), (2,2,2,2), (2,3,3,3), (2,4,4,4), (2,5,5,5), (2,6,6,6), (2,7,7,7), (2,8,8,8), (2,9,9,9), (2,10,10,10);
insert into test_bulk values (1,1,1,1), (1,2,1,1), (1,3,1,1), (1,4,1,1), (1,5,1,1), (1,6,1,1), (1,7,1,1), (1,8,1,1), (1,9,1,1), (1,10,1,1);
insert into test_bulk_prefix values (1,1,1,1), (1,2,2,2), (1,3,3,3), (1,4,4,4), (1,5,5,5), (1,6,6,6), (1,7,7,7), (1,8,8,8), (1,9,9,9), (1,10,10,10);
insert into test_bulk values (9,9,1,1);
ERROR 23000: Duplicate entry '9-9' for key 'PRIMARY'
insert into test_bulk values (9,11,1,1),(9,9,1,1);
ERROR 23000: Duplicate entry '9-9' for key 'PRIMARY'
insert into test_bulk values (9,11,1,1), (9,12,1,1), (9,13,1,1), (9,14,1,1), (9,15,1,1), (9,16,1,1), (9,17,1,1), (9,18,1,1), (9,19,1,1), (9,9,1,1);
ERROR 23000: Duplicate entry '9-9' for key 'PRIMARY'
insert into test_bulk_prefix values (9, 9, 9, 1),(9, 9, 9, 2),(9, 9, 9, 3),(9, 9, 9, 4),(9, 9, 9, 5),(9, 9, 9, 6),(9, 9, 9, 7),(9, 9, 9, 8),(9, 9, 9, 9),(9, 9, 9, 10);
ERROR 23000: Duplicate entry '9-9-9-9' for key 'PRIMARY'
alter system major freeze;
insert into test_bulk values (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1), (5,5,1,1);
ERROR 23000: Duplicate entry '5-5' for key 'PRIMARY'
insert into test_bulk values (5,5,1,1);
ERROR 23000: Duplicate entry '5-5' for key 'PRIMARY'
insert into test_bulk values (5,11,1,1),(5,5,1,1);
ERROR 23000: Duplicate entry '5-5' for key 'PRIMARY'
insert into test_bulk values (5,11,1,1), (5,12,1,1), (5,13,1,1), (5,14,1,1), (5,15,1,1), (5,16,1,1), (5,17,1,1), (5,18,1,1), (5,19,1,1), (5,5,1,1);
ERROR 23000: Duplicate entry '5-5' for key 'PRIMARY'
insert into test_bulk_prefix values (5, 5, 5, 1),(5, 5, 5, 2),(5, 5, 5, 3),(5, 5, 5, 4),(5, 5, 5, 5),(5, 5, 5, 6),(5, 5, 5, 7),(5, 5, 5, 8),(5, 5, 5, 9),(5, 5, 5, 10);
ERROR 23000: Duplicate entry '5-5-5-5' for key 'PRIMARY'
insert into test_bulk values (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1), (4,4,1,1);
ERROR 23000: Duplicate entry '4-4' for key 'PRIMARY'
insert into test_bulk values (4,4,1,1);
ERROR 23000: Duplicate entry '4-4' for key 'PRIMARY'
insert into test_bulk values (4,11,1,1),(4,4,1,1);
ERROR 23000: Duplicate entry '4-4' for key 'PRIMARY'
insert into test_bulk values (4,11,1,1), (4,12,1,1), (4,13,1,1), (4,14,1,1), (4,15,1,1), (4,16,1,1), (4,17,1,1), (4,18,1,1), (4,19,1,1), (4,4,1,1);
ERROR 23000: Duplicate entry '4-4' for key 'PRIMARY'
insert into test_bulk_prefix values (4, 4, 4, 1),(4, 4, 4, 2),(4, 4, 4, 3),(4, 4, 4, 4),(4, 4, 4, 5),(4, 4, 4, 6),(4, 4, 4, 7),(4, 4, 4, 8),(4, 4, 4, 9),(4, 4, 4, 10);
ERROR 23000: Duplicate entry '4-4-4-4' for key 'PRIMARY'
insert into test_bulk values (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1), (3,3,1,1);
ERROR 23000: Duplicate entry '3-3' for key 'PRIMARY'
insert into test_bulk values (3,3,1,1);
ERROR 23000: Duplicate entry '3-3' for key 'PRIMARY'
insert into test_bulk values (3,11,1,1),(3,3,1,1);
ERROR 23000: Duplicate entry '3-3' for key 'PRIMARY'
insert into test_bulk values (3,11,1,1), (3,12,1,1), (3,13,1,1), (3,14,1,1), (3,15,1,1), (3,16,1,1), (3,17,1,1), (3,18,1,1), (3,19,1,1), (3,3,1,1);
ERROR 23000: Duplicate entry '3-3' for key 'PRIMARY'
insert into test_bulk_prefix values (3, 3, 3, 1),(3, 3, 3, 2),(3, 3, 3, 3),(3, 3, 3, 4),(3, 3, 3, 5),(3, 3, 3, 6),(3, 3, 3, 7),(3, 3, 3, 8),(3, 3, 3, 9),(3, 3, 3, 10);
ERROR 23000: Duplicate entry '3-3-3-3' for key 'PRIMARY'
insert into test_bulk values (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1), (2,2,1,1);
ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
insert into test_bulk values (2,2,1,1);
ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
insert into test_bulk values (2,11,1,1),(2,2,1,1);
ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
insert into test_bulk values (2,11,1,1), (2,12,1,1), (2,13,1,1), (2,14,1,1), (2,15,1,1), (2,16,1,1), (2,17,1,1), (2,18,1,1), (2,19,1,1), (2,2,1,1);
ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
insert into test_bulk_prefix values (2, 2, 2, 1),(2, 2, 2, 2),(2, 2, 2, 3),(2, 2, 2, 4),(2, 2, 2, 5),(2, 2, 2, 6),(2, 2, 2, 7),(2, 2, 2, 8),(2, 2, 2, 9),(2, 2, 2, 10);
ERROR 23000: Duplicate entry '2-2-2-2' for key 'PRIMARY'
insert into test_bulk values (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1), (1,1,1,1);
ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
insert into test_bulk values (1,1,1,1);
ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
insert into test_bulk values (1,11,1,1),(1,1,1,1);
ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
insert into test_bulk values (1,11,1,1), (1,12,1,1), (1,13,1,1), (1,14,1,1), (1,15,1,1), (1,16,1,1), (1,17,1,1), (1,18,1,1), (1,19,1,1), (1,1,1,1);
ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
insert into test_bulk_prefix values (1, 1, 1, 1),(1, 1, 1, 2),(1, 1, 1, 3),(1, 1, 1, 4),(1, 1, 1, 5),(1, 1, 1, 6),(1, 1, 1, 7),(1, 1, 1, 8),(1, 1, 1, 9),(1, 1, 1, 10);
ERROR 23000: Duplicate entry '1-1-1-1' for key 'PRIMARY'
ERROR 23000: Duplicate entry '50-1' for key 'PRIMARY'
insert into test_bulk values (150,1,1,1), (150,2,1,1), (150,3,1,1), (150,4,1,1), (150,5,1,1), (150,6,1,1), (150,7,1,1), (150,8,1,1), (150,9,1,1), (150,10,1,1);
insert into test_bulk_prefix values (150, 150, 150, 1),(150, 150, 150, 2),(150, 150, 150, 3),(150, 150, 150, 4),(150, 150, 150, 5),(150, 150, 150, 6),(150, 150, 150, 7),(150, 150, 150, 8),(150, 150, 150, 9),(150, 150, 150, 10);
insert into test_bulk values (149,1,1,1), (149,2,1,1), (149,3,1,1), (149,4,1,1), (149,5,1,1), (149,6,1,1), (149,7,1,1), (149,8,1,1), (149,9,1,1), (149,10,1,1);
insert into test_bulk_prefix values (149, 149, 149, 1),(149, 149, 149, 2),(149, 149, 149, 3),(149, 149, 149, 4),(149, 149, 149, 5),(149, 149, 149, 6),(149, 149, 149, 7),(149, 149, 149, 8),(149, 149, 149, 9),(149, 149, 149, 10);
insert into test_bulk values (148,1,1,1), (148,2,1,1), (148,3,1,1), (148,4,1,1), (148,5,1,1), (148,6,1,1), (148,7,1,1), (148,8,1,1), (148,9,1,1), (148,10,1,1);
insert into test_bulk_prefix values (148, 148, 148, 1),(148, 148, 148, 2),(148, 148, 148, 3),(148, 148, 148, 4),(148, 148, 148, 5),(148, 148, 148, 6),(148, 148, 148, 7),(148, 148, 148, 8),(148, 148, 148, 9),(148, 148, 148, 10);
insert into test_bulk values (147,1,1,1), (147,2,1,1), (147,3,1,1), (147,4,1,1), (147,5,1,1), (147,6,1,1), (147,7,1,1), (147,8,1,1), (147,9,1,1), (147,10,1,1);
insert into test_bulk_prefix values (147, 147, 147, 1),(147, 147, 147, 2),(147, 147, 147, 3),(147, 147, 147, 4),(147, 147, 147, 5),(147, 147, 147, 6),(147, 147, 147, 7),(147, 147, 147, 8),(147, 147, 147, 9),(147, 147, 147, 10);
insert into test_bulk values (146,1,1,1), (146,2,1,1), (146,3,1,1), (146,4,1,1), (146,5,1,1), (146,6,1,1), (146,7,1,1), (146,8,1,1), (146,9,1,1), (146,10,1,1);
insert into test_bulk_prefix values (146, 146, 146, 1),(146, 146, 146, 2),(146, 146, 146, 3),(146, 146, 146, 4),(146, 146, 146, 5),(146, 146, 146, 6),(146, 146, 146, 7),(146, 146, 146, 8),(146, 146, 146, 9),(146, 146, 146, 10);
insert into test_bulk values (145,1,1,1), (145,2,1,1), (145,3,1,1), (145,4,1,1), (145,5,1,1), (145,6,1,1), (145,7,1,1), (145,8,1,1), (145,9,1,1), (145,10,1,1);
insert into test_bulk_prefix values (145, 145, 145, 1),(145, 145, 145, 2),(145, 145, 145, 3),(145, 145, 145, 4),(145, 145, 145, 5),(145, 145, 145, 6),(145, 145, 145, 7),(145, 145, 145, 8),(145, 145, 145, 9),(145, 145, 145, 10);
insert into test_bulk values (144,1,1,1), (144,2,1,1), (144,3,1,1), (144,4,1,1), (144,5,1,1), (144,6,1,1), (144,7,1,1), (144,8,1,1), (144,9,1,1), (144,10,1,1);
insert into test_bulk_prefix values (144, 144, 144, 1),(144, 144, 144, 2),(144, 144, 144, 3),(144, 144, 144, 4),(144, 144, 144, 5),(144, 144, 144, 6),(144, 144, 144, 7),(144, 144, 144, 8),(144, 144, 144, 9),(144, 144, 144, 10);
insert into test_bulk values (143,1,1,1), (143,2,1,1), (143,3,1,1), (143,4,1,1), (143,5,1,1), (143,6,1,1), (143,7,1,1), (143,8,1,1), (143,9,1,1), (143,10,1,1);
insert into test_bulk_prefix values (143, 143, 143, 1),(143, 143, 143, 2),(143, 143, 143, 3),(143, 143, 143, 4),(143, 143, 143, 5),(143, 143, 143, 6),(143, 143, 143, 7),(143, 143, 143, 8),(143, 143, 143, 9),(143, 143, 143, 10);
insert into test_bulk values (142,1,1,1), (142,2,1,1), (142,3,1,1), (142,4,1,1), (142,5,1,1), (142,6,1,1), (142,7,1,1), (142,8,1,1), (142,9,1,1), (142,10,1,1);
insert into test_bulk_prefix values (142, 142, 142, 1),(142, 142, 142, 2),(142, 142, 142, 3),(142, 142, 142, 4),(142, 142, 142, 5),(142, 142, 142, 6),(142, 142, 142, 7),(142, 142, 142, 8),(142, 142, 142, 9),(142, 142, 142, 10);
insert into test_bulk values (141,1,1,1), (141,2,1,1), (141,3,1,1), (141,4,1,1), (141,5,1,1), (141,6,1,1), (141,7,1,1), (141,8,1,1), (141,9,1,1), (141,10,1,1);
insert into test_bulk_prefix values (141, 141, 141, 1),(141, 141, 141, 2),(141, 141, 141, 3),(141, 141, 141, 4),(141, 141, 141, 5),(141, 141, 141, 6),(141, 141, 141, 7),(141, 141, 141, 8),(141, 141, 141, 9),(141, 141, 141, 10);
insert into test_bulk values (140,1,1,1), (140,2,1,1), (140,3,1,1), (140,4,1,1), (140,5,1,1), (140,6,1,1), (140,7,1,1), (140,8,1,1), (140,9,1,1), (140,10,1,1);
insert into test_bulk_prefix values (140, 140, 140, 1),(140, 140, 140, 2),(140, 140, 140, 3),(140, 140, 140, 4),(140, 140, 140, 5),(140, 140, 140, 6),(140, 140, 140, 7),(140, 140, 140, 8),(140, 140, 140, 9),(140, 140, 140, 10);
insert into test_bulk values (139,1,1,1), (139,2,1,1), (139,3,1,1), (139,4,1,1), (139,5,1,1), (139,6,1,1), (139,7,1,1), (139,8,1,1), (139,9,1,1), (139,10,1,1);
insert into test_bulk_prefix values (139, 139, 139, 1),(139, 139, 139, 2),(139, 139, 139, 3),(139, 139, 139, 4),(139, 139, 139, 5),(139, 139, 139, 6),(139, 139, 139, 7),(139, 139, 139, 8),(139, 139, 139, 9),(139, 139, 139, 10);
insert into test_bulk values (138,1,1,1), (138,2,1,1), (138,3,1,1), (138,4,1,1), (138,5,1,1), (138,6,1,1), (138,7,1,1), (138,8,1,1), (138,9,1,1), (138,10,1,1);
insert into test_bulk_prefix values (138, 138, 138, 1),(138, 138, 138, 2),(138, 138, 138, 3),(138, 138, 138, 4),(138, 138, 138, 5),(138, 138, 138, 6),(138, 138, 138, 7),(138, 138, 138, 8),(138, 138, 138, 9),(138, 138, 138, 10);
insert into test_bulk values (137,1,1,1), (137,2,1,1), (137,3,1,1), (137,4,1,1), (137,5,1,1), (137,6,1,1), (137,7,1,1), (137,8,1,1), (137,9,1,1), (137,10,1,1);
insert into test_bulk_prefix values (137, 137, 137, 1),(137, 137, 137, 2),(137, 137, 137, 3),(137, 137, 137, 4),(137, 137, 137, 5),(137, 137, 137, 6),(137, 137, 137, 7),(137, 137, 137, 8),(137, 137, 137, 9),(137, 137, 137, 10);
insert into test_bulk values (136,1,1,1), (136,2,1,1), (136,3,1,1), (136,4,1,1), (136,5,1,1), (136,6,1,1), (136,7,1,1), (136,8,1,1), (136,9,1,1), (136,10,1,1);
insert into test_bulk_prefix values (136, 136, 136, 1),(136, 136, 136, 2),(136, 136, 136, 3),(136, 136, 136, 4),(136, 136, 136, 5),(136, 136, 136, 6),(136, 136, 136, 7),(136, 136, 136, 8),(136, 136, 136, 9),(136, 136, 136, 10);
insert into test_bulk values (135,1,1,1), (135,2,1,1), (135,3,1,1), (135,4,1,1), (135,5,1,1), (135,6,1,1), (135,7,1,1), (135,8,1,1), (135,9,1,1), (135,10,1,1);
insert into test_bulk_prefix values (135, 135, 135, 1),(135, 135, 135, 2),(135, 135, 135, 3),(135, 135, 135, 4),(135, 135, 135, 5),(135, 135, 135, 6),(135, 135, 135, 7),(135, 135, 135, 8),(135, 135, 135, 9),(135, 135, 135, 10);
insert into test_bulk values (134,1,1,1), (134,2,1,1), (134,3,1,1), (134,4,1,1), (134,5,1,1), (134,6,1,1), (134,7,1,1), (134,8,1,1), (134,9,1,1), (134,10,1,1);
insert into test_bulk_prefix values (134, 134, 134, 1),(134, 134, 134, 2),(134, 134, 134, 3),(134, 134, 134, 4),(134, 134, 134, 5),(134, 134, 134, 6),(134, 134, 134, 7),(134, 134, 134, 8),(134, 134, 134, 9),(134, 134, 134, 10);
insert into test_bulk values (133,1,1,1), (133,2,1,1), (133,3,1,1), (133,4,1,1), (133,5,1,1), (133,6,1,1), (133,7,1,1), (133,8,1,1), (133,9,1,1), (133,10,1,1);
insert into test_bulk_prefix values (133, 133, 133, 1),(133, 133, 133, 2),(133, 133, 133, 3),(133, 133, 133, 4),(133, 133, 133, 5),(133, 133, 133, 6),(133, 133, 133, 7),(133, 133, 133, 8),(133, 133, 133, 9),(133, 133, 133, 10);
insert into test_bulk values (132,1,1,1), (132,2,1,1), (132,3,1,1), (132,4,1,1), (132,5,1,1), (132,6,1,1), (132,7,1,1), (132,8,1,1), (132,9,1,1), (132,10,1,1);
insert into test_bulk_prefix values (132, 132, 132, 1),(132, 132, 132, 2),(132, 132, 132, 3),(132, 132, 132, 4),(132, 132, 132, 5),(132, 132, 132, 6),(132, 132, 132, 7),(132, 132, 132, 8),(132, 132, 132, 9),(132, 132, 132, 10);
insert into test_bulk values (131,1,1,1), (131,2,1,1), (131,3,1,1), (131,4,1,1), (131,5,1,1), (131,6,1,1), (131,7,1,1), (131,8,1,1), (131,9,1,1), (131,10,1,1);
insert into test_bulk_prefix values (131, 131, 131, 1),(131, 131, 131, 2),(131, 131, 131, 3),(131, 131, 131, 4),(131, 131, 131, 5),(131, 131, 131, 6),(131, 131, 131, 7),(131, 131, 131, 8),(131, 131, 131, 9),(131, 131, 131, 10);
set ob_query_timeout=100000000;
alter system minor freeze;
insert into test_bulk values (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1), (140,140,1,1);
ERROR 23000: Duplicate entry '140-140' for key 'PRIMARY'
insert into test_bulk values (140,11,1,1), (140,12,1,1), (140,13,1,1), (140,14,1,1), (140,15,1,1), (140,16,1,1), (140,17,1,1), (140,18,1,1), (140,19,1,1), (140,10,1,1);
ERROR 23000: Duplicate entry '140-10' for key 'PRIMARY'
insert into test_bulk values (10,11,1,1), (10,12,1,1), (10,13,1,1), (10,14,1,1), (10,15,1,1), (10,10,1,1), (10,17,1,1), (10,18,1,1), (10,19,1,1), (10,20,1,1);
ERROR 23000: Duplicate entry '10-10' for key 'PRIMARY'
insert into test_bulk_prefix values (140, 140, 140, 1),(140, 140, 140, 2),(140, 140, 140, 3),(140, 140, 140, 4),(140, 140, 140, 5),(140, 140, 140, 6),(140, 140, 140, 7),(140, 140, 140, 8),(140, 140, 140, 9),(140, 140, 140, 10);
ERROR 23000: Duplicate entry '140-140-140-1' for key 'PRIMARY'
insert into test_bulk values (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1), (139,139,1,1);
ERROR 23000: Duplicate entry '139-139' for key 'PRIMARY'
insert into test_bulk values (139,11,1,1), (139,12,1,1), (139,13,1,1), (139,14,1,1), (139,15,1,1), (139,16,1,1), (139,17,1,1), (139,18,1,1), (139,19,1,1), (139,9,1,1);
ERROR 23000: Duplicate entry '139-9' for key 'PRIMARY'
insert into test_bulk values (9,11,1,1), (9,12,1,1), (9,13,1,1), (9,14,1,1), (9,15,1,1), (9,9,1,1), (9,17,1,1), (9,18,1,1), (9,19,1,1), (9,20,1,1);
ERROR 23000: Duplicate entry '9-9' for key 'PRIMARY'
insert into test_bulk_prefix values (139, 139, 139, 1),(139, 139, 139, 2),(139, 139, 139, 3),(139, 139, 139, 4),(139, 139, 139, 5),(139, 139, 139, 6),(139, 139, 139, 7),(139, 139, 139, 8),(139, 139, 139, 9),(139, 139, 139, 10);
ERROR 23000: Duplicate entry '139-139-139-1' for key 'PRIMARY'
insert into test_bulk values (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1), (138,138,1,1);
ERROR 23000: Duplicate entry '138-138' for key 'PRIMARY'
insert into test_bulk values (138,11,1,1), (138,12,1,1), (138,13,1,1), (138,14,1,1), (138,15,1,1), (138,16,1,1), (138,17,1,1), (138,18,1,1), (138,19,1,1), (138,8,1,1);
ERROR 23000: Duplicate entry '138-8' for key 'PRIMARY'
insert into test_bulk values (8,11,1,1), (8,12,1,1), (8,13,1,1), (8,14,1,1), (8,15,1,1), (8,8,1,1), (8,17,1,1), (8,18,1,1), (8,19,1,1), (8,20,1,1);
ERROR 23000: Duplicate entry '8-8' for key 'PRIMARY'
insert into test_bulk_prefix values (138, 138, 138, 1),(138, 138, 138, 2),(138, 138, 138, 3),(138, 138, 138, 4),(138, 138, 138, 5),(138, 138, 138, 6),(138, 138, 138, 7),(138, 138, 138, 8),(138, 138, 138, 9),(138, 138, 138, 10);
ERROR 23000: Duplicate entry '138-138-138-1' for key 'PRIMARY'
insert into test_bulk values (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1), (137,137,1,1);
ERROR 23000: Duplicate entry '137-137' for key 'PRIMARY'
insert into test_bulk values (137,11,1,1), (137,12,1,1), (137,13,1,1), (137,14,1,1), (137,15,1,1), (137,16,1,1), (137,17,1,1), (137,18,1,1), (137,19,1,1), (137,7,1,1);
ERROR 23000: Duplicate entry '137-7' for key 'PRIMARY'
insert into test_bulk values (7,11,1,1), (7,12,1,1), (7,13,1,1), (7,14,1,1), (7,15,1,1), (7,7,1,1), (7,17,1,1), (7,18,1,1), (7,19,1,1), (7,20,1,1);
ERROR 23000: Duplicate entry '7-7' for key 'PRIMARY'
insert into test_bulk_prefix values (137, 137, 137, 1),(137, 137, 137, 2),(137, 137, 137, 3),(137, 137, 137, 4),(137, 137, 137, 5),(137, 137, 137, 6),(137, 137, 137, 7),(137, 137, 137, 8),(137, 137, 137, 9),(137, 137, 137, 10);
ERROR 23000: Duplicate entry '137-137-137-1' for key 'PRIMARY'
insert into test_bulk values (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1), (136,136,1,1);
ERROR 23000: Duplicate entry '136-136' for key 'PRIMARY'
insert into test_bulk values (136,11,1,1), (136,12,1,1), (136,13,1,1), (136,14,1,1), (136,15,1,1), (136,16,1,1), (136,17,1,1), (136,18,1,1), (136,19,1,1), (136,6,1,1);
ERROR 23000: Duplicate entry '136-6' for key 'PRIMARY'
insert into test_bulk values (6,11,1,1), (6,12,1,1), (6,13,1,1), (6,14,1,1), (6,15,1,1), (6,6,1,1), (6,17,1,1), (6,18,1,1), (6,19,1,1), (6,20,1,1);
ERROR 23000: Duplicate entry '6-6' for key 'PRIMARY'
insert into test_bulk_prefix values (136, 136, 136, 1),(136, 136, 136, 2),(136, 136, 136, 3),(136, 136, 136, 4),(136, 136, 136, 5),(136, 136, 136, 6),(136, 136, 136, 7),(136, 136, 136, 8),(136, 136, 136, 9),(136, 136, 136, 10);
ERROR 23000: Duplicate entry '136-136-136-1' for key 'PRIMARY'
ERROR 23000: Duplicate entry '140-1' for key 'PRIMARY'
insert into test_bulk values (200,1,1,1), (200,2,1,1), (200,3,1,1), (200,4,1,1), (200,5,1,1), (200,6,1,1), (200,7,1,1), (200,8,1,1), (200,9,1,1), (200,10,1,1);
insert into test_bulk_prefix values (200, 200, 200, 1),(200, 200, 200, 2),(200, 200, 200, 3),(200, 200, 200, 4),(200, 200, 200, 5),(200, 200, 200, 6),(200, 200, 200, 7),(200, 200, 200, 8),(200, 200, 200, 9),(200, 200, 200, 10);
insert into test_bulk values (199,1,1,1), (199,2,1,1), (199,3,1,1), (199,4,1,1), (199,5,1,1), (199,6,1,1), (199,7,1,1), (199,8,1,1), (199,9,1,1), (199,10,1,1);
insert into test_bulk_prefix values (199, 199, 199, 1),(199, 199, 199, 2),(199, 199, 199, 3),(199, 199, 199, 4),(199, 199, 199, 5),(199, 199, 199, 6),(199, 199, 199, 7),(199, 199, 199, 8),(199, 199, 199, 9),(199, 199, 199, 10);
insert into test_bulk values (198,1,1,1), (198,2,1,1), (198,3,1,1), (198,4,1,1), (198,5,1,1), (198,6,1,1), (198,7,1,1), (198,8,1,1), (198,9,1,1), (198,10,1,1);
insert into test_bulk_prefix values (198, 198, 198, 1),(198, 198, 198, 2),(198, 198, 198, 3),(198, 198, 198, 4),(198, 198, 198, 5),(198, 198, 198, 6),(198, 198, 198, 7),(198, 198, 198, 8),(198, 198, 198, 9),(198, 198, 198, 10);
insert into test_bulk values (197,1,1,1), (197,2,1,1), (197,3,1,1), (197,4,1,1), (197,5,1,1), (197,6,1,1), (197,7,1,1), (197,8,1,1), (197,9,1,1), (197,10,1,1);
insert into test_bulk_prefix values (197, 197, 197, 1),(197, 197, 197, 2),(197, 197, 197, 3),(197, 197, 197, 4),(197, 197, 197, 5),(197, 197, 197, 6),(197, 197, 197, 7),(197, 197, 197, 8),(197, 197, 197, 9),(197, 197, 197, 10);
insert into test_bulk values (196,1,1,1), (196,2,1,1), (196,3,1,1), (196,4,1,1), (196,5,1,1), (196,6,1,1), (196,7,1,1), (196,8,1,1), (196,9,1,1), (196,10,1,1);
insert into test_bulk_prefix values (196, 196, 196, 1),(196, 196, 196, 2),(196, 196, 196, 3),(196, 196, 196, 4),(196, 196, 196, 5),(196, 196, 196, 6),(196, 196, 196, 7),(196, 196, 196, 8),(196, 196, 196, 9),(196, 196, 196, 10);
insert into test_bulk values (195,1,1,1), (195,2,1,1), (195,3,1,1), (195,4,1,1), (195,5,1,1), (195,6,1,1), (195,7,1,1), (195,8,1,1), (195,9,1,1), (195,10,1,1);
insert into test_bulk_prefix values (195, 195, 195, 1),(195, 195, 195, 2),(195, 195, 195, 3),(195, 195, 195, 4),(195, 195, 195, 5),(195, 195, 195, 6),(195, 195, 195, 7),(195, 195, 195, 8),(195, 195, 195, 9),(195, 195, 195, 10);
insert into test_bulk values (194,1,1,1), (194,2,1,1), (194,3,1,1), (194,4,1,1), (194,5,1,1), (194,6,1,1), (194,7,1,1), (194,8,1,1), (194,9,1,1), (194,10,1,1);
insert into test_bulk_prefix values (194, 194, 194, 1),(194, 194, 194, 2),(194, 194, 194, 3),(194, 194, 194, 4),(194, 194, 194, 5),(194, 194, 194, 6),(194, 194, 194, 7),(194, 194, 194, 8),(194, 194, 194, 9),(194, 194, 194, 10);
insert into test_bulk values (193,1,1,1), (193,2,1,1), (193,3,1,1), (193,4,1,1), (193,5,1,1), (193,6,1,1), (193,7,1,1), (193,8,1,1), (193,9,1,1), (193,10,1,1);
insert into test_bulk_prefix values (193, 193, 193, 1),(193, 193, 193, 2),(193, 193, 193, 3),(193, 193, 193, 4),(193, 193, 193, 5),(193, 193, 193, 6),(193, 193, 193, 7),(193, 193, 193, 8),(193, 193, 193, 9),(193, 193, 193, 10);
insert into test_bulk values (192,1,1,1), (192,2,1,1), (192,3,1,1), (192,4,1,1), (192,5,1,1), (192,6,1,1), (192,7,1,1), (192,8,1,1), (192,9,1,1), (192,10,1,1);
insert into test_bulk_prefix values (192, 192, 192, 1),(192, 192, 192, 2),(192, 192, 192, 3),(192, 192, 192, 4),(192, 192, 192, 5),(192, 192, 192, 6),(192, 192, 192, 7),(192, 192, 192, 8),(192, 192, 192, 9),(192, 192, 192, 10);
insert into test_bulk values (191,1,1,1), (191,2,1,1), (191,3,1,1), (191,4,1,1), (191,5,1,1), (191,6,1,1), (191,7,1,1), (191,8,1,1), (191,9,1,1), (191,10,1,1);
insert into test_bulk_prefix values (191, 191, 191, 1),(191, 191, 191, 2),(191, 191, 191, 3),(191, 191, 191, 4),(191, 191, 191, 5),(191, 191, 191, 6),(191, 191, 191, 7),(191, 191, 191, 8),(191, 191, 191, 9),(191, 191, 191, 10);
insert into test_bulk values (190,1,1,1), (190,2,1,1), (190,3,1,1), (190,4,1,1), (190,5,1,1), (190,6,1,1), (190,7,1,1), (190,8,1,1), (190,9,1,1), (190,10,1,1);
insert into test_bulk_prefix values (190, 190, 190, 1),(190, 190, 190, 2),(190, 190, 190, 3),(190, 190, 190, 4),(190, 190, 190, 5),(190, 190, 190, 6),(190, 190, 190, 7),(190, 190, 190, 8),(190, 190, 190, 9),(190, 190, 190, 10);
insert into test_bulk values (189,1,1,1), (189,2,1,1), (189,3,1,1), (189,4,1,1), (189,5,1,1), (189,6,1,1), (189,7,1,1), (189,8,1,1), (189,9,1,1), (189,10,1,1);
insert into test_bulk_prefix values (189, 189, 189, 1),(189, 189, 189, 2),(189, 189, 189, 3),(189, 189, 189, 4),(189, 189, 189, 5),(189, 189, 189, 6),(189, 189, 189, 7),(189, 189, 189, 8),(189, 189, 189, 9),(189, 189, 189, 10);
insert into test_bulk values (188,1,1,1), (188,2,1,1), (188,3,1,1), (188,4,1,1), (188,5,1,1), (188,6,1,1), (188,7,1,1), (188,8,1,1), (188,9,1,1), (188,10,1,1);
insert into test_bulk_prefix values (188, 188, 188, 1),(188, 188, 188, 2),(188, 188, 188, 3),(188, 188, 188, 4),(188, 188, 188, 5),(188, 188, 188, 6),(188, 188, 188, 7),(188, 188, 188, 8),(188, 188, 188, 9),(188, 188, 188, 10);
insert into test_bulk values (187,1,1,1), (187,2,1,1), (187,3,1,1), (187,4,1,1), (187,5,1,1), (187,6,1,1), (187,7,1,1), (187,8,1,1), (187,9,1,1), (187,10,1,1);
insert into test_bulk_prefix values (187, 187, 187, 1),(187, 187, 187, 2),(187, 187, 187, 3),(187, 187, 187, 4),(187, 187, 187, 5),(187, 187, 187, 6),(187, 187, 187, 7),(187, 187, 187, 8),(187, 187, 187, 9),(187, 187, 187, 10);
insert into test_bulk values (186,1,1,1), (186,2,1,1), (186,3,1,1), (186,4,1,1), (186,5,1,1), (186,6,1,1), (186,7,1,1), (186,8,1,1), (186,9,1,1), (186,10,1,1);
insert into test_bulk_prefix values (186, 186, 186, 1),(186, 186, 186, 2),(186, 186, 186, 3),(186, 186, 186, 4),(186, 186, 186, 5),(186, 186, 186, 6),(186, 186, 186, 7),(186, 186, 186, 8),(186, 186, 186, 9),(186, 186, 186, 10);
insert into test_bulk values (185,1,1,1), (185,2,1,1), (185,3,1,1), (185,4,1,1), (185,5,1,1), (185,6,1,1), (185,7,1,1), (185,8,1,1), (185,9,1,1), (185,10,1,1);
insert into test_bulk_prefix values (185, 185, 185, 1),(185, 185, 185, 2),(185, 185, 185, 3),(185, 185, 185, 4),(185, 185, 185, 5),(185, 185, 185, 6),(185, 185, 185, 7),(185, 185, 185, 8),(185, 185, 185, 9),(185, 185, 185, 10);
insert into test_bulk values (184,1,1,1), (184,2,1,1), (184,3,1,1), (184,4,1,1), (184,5,1,1), (184,6,1,1), (184,7,1,1), (184,8,1,1), (184,9,1,1), (184,10,1,1);
insert into test_bulk_prefix values (184, 184, 184, 1),(184, 184, 184, 2),(184, 184, 184, 3),(184, 184, 184, 4),(184, 184, 184, 5),(184, 184, 184, 6),(184, 184, 184, 7),(184, 184, 184, 8),(184, 184, 184, 9),(184, 184, 184, 10);
insert into test_bulk values (183,1,1,1), (183,2,1,1), (183,3,1,1), (183,4,1,1), (183,5,1,1), (183,6,1,1), (183,7,1,1), (183,8,1,1), (183,9,1,1), (183,10,1,1);
insert into test_bulk_prefix values (183, 183, 183, 1),(183, 183, 183, 2),(183, 183, 183, 3),(183, 183, 183, 4),(183, 183, 183, 5),(183, 183, 183, 6),(183, 183, 183, 7),(183, 183, 183, 8),(183, 183, 183, 9),(183, 183, 183, 10);
insert into test_bulk values (182,1,1,1), (182,2,1,1), (182,3,1,1), (182,4,1,1), (182,5,1,1), (182,6,1,1), (182,7,1,1), (182,8,1,1), (182,9,1,1), (182,10,1,1);
insert into test_bulk_prefix values (182, 182, 182, 1),(182, 182, 182, 2),(182, 182, 182, 3),(182, 182, 182, 4),(182, 182, 182, 5),(182, 182, 182, 6),(182, 182, 182, 7),(182, 182, 182, 8),(182, 182, 182, 9),(182, 182, 182, 10);
insert into test_bulk values (181,1,1,1), (181,2,1,1), (181,3,1,1), (181,4,1,1), (181,5,1,1), (181,6,1,1), (181,7,1,1), (181,8,1,1), (181,9,1,1), (181,10,1,1);
insert into test_bulk_prefix values (181, 181, 181, 1),(181, 181, 181, 2),(181, 181, 181, 3),(181, 181, 181, 4),(181, 181, 181, 5),(181, 181, 181, 6),(181, 181, 181, 7),(181, 181, 181, 8),(181, 181, 181, 9),(181, 181, 181, 10);
insert into test_bulk values (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1), (190,190,1,1);
ERROR 23000: Duplicate entry '190-190' for key 'PRIMARY'
insert into test_bulk values (190,11,1,1), (190,12,1,1), (190,13,1,1), (190,14,1,1), (190,15,1,1), (190,16,1,1), (190,17,1,1), (190,18,1,1), (190,19,1,1), (190,10,1,1);
ERROR 23000: Duplicate entry '190-10' for key 'PRIMARY'
insert into test_bulk values (140,11,1,1), (140,12,1,1), (140,13,1,1), (140,10,1,1), (140,15,1,1), (140,16,1,1), (140,17,1,1), (140,18,1,1), (140,19,1,1), (140,20,1,1);
ERROR 23000: Duplicate entry '140-10' for key 'PRIMARY'
insert into test_bulk values (50,11,1,1), (50,12,1,1), (50,13,1,1), (50,14,1,1), (50,15,1,1), (50,50,1,1), (50,17,1,1), (50,10,1,1), (50,19,1,1), (50,20,1,1);
ERROR 23000: Duplicate entry '50-10' for key 'PRIMARY'
insert into test_bulk values (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1), (189,189,1,1);
ERROR 23000: Duplicate entry '189-189' for key 'PRIMARY'
insert into test_bulk values (189,11,1,1), (189,12,1,1), (189,13,1,1), (189,14,1,1), (189,15,1,1), (189,16,1,1), (189,17,1,1), (189,18,1,1), (189,19,1,1), (189,9,1,1);
ERROR 23000: Duplicate entry '189-9' for key 'PRIMARY'
insert into test_bulk values (139,11,1,1), (139,12,1,1), (139,13,1,1), (139,9,1,1), (139,15,1,1), (139,16,1,1), (139,17,1,1), (139,18,1,1), (139,19,1,1), (139,20,1,1);
ERROR 23000: Duplicate entry '139-9' for key 'PRIMARY'
insert into test_bulk values (49,11,1,1), (49,12,1,1), (49,13,1,1), (49,14,1,1), (49,15,1,1), (49,49,1,1), (49,17,1,1), (49,9,1,1), (49,19,1,1), (49,20,1,1);
ERROR 23000: Duplicate entry '49-9' for key 'PRIMARY'
insert into test_bulk values (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1), (188,188,1,1);
ERROR 23000: Duplicate entry '188-188' for key 'PRIMARY'
insert into test_bulk values (188,11,1,1), (188,12,1,1), (188,13,1,1), (188,14,1,1), (188,15,1,1), (188,16,1,1), (188,17,1,1), (188,18,1,1), (188,19,1,1), (188,8,1,1);
ERROR 23000: Duplicate entry '188-8' for key 'PRIMARY'
insert into test_bulk values (138,11,1,1), (138,12,1,1), (138,13,1,1), (138,8,1,1), (138,15,1,1), (138,16,1,1), (138,17,1,1), (138,18,1,1), (138,19,1,1), (138,20,1,1);
ERROR 23000: Duplicate entry '138-8' for key 'PRIMARY'
insert into test_bulk values (48,11,1,1), (48,12,1,1), (48,13,1,1), (48,14,1,1), (48,15,1,1), (48,48,1,1), (48,17,1,1), (48,8,1,1), (48,19,1,1), (48,20,1,1);
ERROR 23000: Duplicate entry '48-8' for key 'PRIMARY'
insert into test_bulk values (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1), (187,187,1,1);
ERROR 23000: Duplicate entry '187-187' for key 'PRIMARY'
insert into test_bulk values (187,11,1,1), (187,12,1,1), (187,13,1,1), (187,14,1,1), (187,15,1,1), (187,16,1,1), (187,17,1,1), (187,18,1,1), (187,19,1,1), (187,7,1,1);
ERROR 23000: Duplicate entry '187-7' for key 'PRIMARY'
insert into test_bulk values (137,11,1,1), (137,12,1,1), (137,13,1,1), (137,7,1,1), (137,15,1,1), (137,16,1,1), (137,17,1,1), (137,18,1,1), (137,19,1,1), (137,20,1,1);
ERROR 23000: Duplicate entry '137-7' for key 'PRIMARY'
insert into test_bulk values (47,11,1,1), (47,12,1,1), (47,13,1,1), (47,14,1,1), (47,15,1,1), (47,47,1,1), (47,17,1,1), (47,7,1,1), (47,19,1,1), (47,20,1,1);
ERROR 23000: Duplicate entry '47-7' for key 'PRIMARY'
insert into test_bulk values (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1), (186,186,1,1);
ERROR 23000: Duplicate entry '186-186' for key 'PRIMARY'
insert into test_bulk values (186,11,1,1), (186,12,1,1), (186,13,1,1), (186,14,1,1), (186,15,1,1), (186,16,1,1), (186,17,1,1), (186,18,1,1), (186,19,1,1), (186,6,1,1);
ERROR 23000: Duplicate entry '186-6' for key 'PRIMARY'
insert into test_bulk values (136,11,1,1), (136,12,1,1), (136,13,1,1), (136,6,1,1), (136,15,1,1), (136,16,1,1), (136,17,1,1), (136,18,1,1), (136,19,1,1), (136,20,1,1);
ERROR 23000: Duplicate entry '136-6' for key 'PRIMARY'
insert into test_bulk values (46,11,1,1), (46,12,1,1), (46,13,1,1), (46,14,1,1), (46,15,1,1), (46,46,1,1), (46,17,1,1), (46,6,1,1), (46,19,1,1), (46,20,1,1);
ERROR 23000: Duplicate entry '46-6' for key 'PRIMARY'
ERROR 23000: Duplicate entry '190-1' for key 'PRIMARY'
delete from test_bulk where a = 170;
delete from test_bulk where a = 90;
insert into test_bulk values (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1), (185,185,1,1);
ERROR 23000: Duplicate entry '185-185' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (185,11,1,1), (185,12,1,1), (185,13,1,1), (185,14,1,1), (185,15,1,1), (185,16,1,1), (185,17,1,1), (185,18,1,1), (185,19,1,1), (185,10,1,1);
ERROR 23000: Duplicate entry '185-10' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (185,11,1,1), (185,12,1,1), (185,13,1,1), (185,14,1,1), (185,15,1,1), (185,16,1,1), (185,17,1,1), (185,18,1,1), (185,19,1,1), (185,10,1,1);
ERROR 23000: Duplicate entry '185-10' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (140,11,1,1), (140,12,1,1), (140,13,1,1), (140,10,1,1), (140,15,1,1), (140,16,1,1), (140,17,1,1), (140,18,1,1), (140,19,1,1), (140,20,1,1);
ERROR 23000: Duplicate entry '140-10' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (140,11,1,1), (140,12,1,1), (140,13,1,1), (140,10,1,1), (140,15,1,1), (140,16,1,1), (140,17,1,1), (140,18,1,1), (140,19,1,1), (140,20,1,1);
ERROR 23000: Duplicate entry '140-10' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (50,11,1,1), (50,12,1,1), (50,13,1,1), (50,14,1,1), (50,15,1,1), (50,50,1,1), (50,17,1,1), (50,10,1,1), (50,19,1,1), (50,20,1,1);
ERROR 23000: Duplicate entry '50-10' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (50,11,1,1), (50,12,1,1), (50,13,1,1), (50,14,1,1), (50,15,1,1), (50,50,1,1), (50,17,1,1), (50,10,1,1), (50,19,1,1), (50,20,1,1);
ERROR 23000: Duplicate entry '50-10' for key 'PRIMARY'
insert into test_bulk values (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1), (184,184,1,1);
ERROR 23000: Duplicate entry '184-184' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (184,11,1,1), (184,12,1,1), (184,13,1,1), (184,14,1,1), (184,15,1,1), (184,16,1,1), (184,17,1,1), (184,18,1,1), (184,19,1,1), (184,9,1,1);
ERROR 23000: Duplicate entry '184-9' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (184,11,1,1), (184,12,1,1), (184,13,1,1), (184,14,1,1), (184,15,1,1), (184,16,1,1), (184,17,1,1), (184,18,1,1), (184,19,1,1), (184,9,1,1);
ERROR 23000: Duplicate entry '184-9' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (139,11,1,1), (139,12,1,1), (139,13,1,1), (139,9,1,1), (139,15,1,1), (139,16,1,1), (139,17,1,1), (139,18,1,1), (139,19,1,1), (139,20,1,1);
ERROR 23000: Duplicate entry '139-9' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (139,11,1,1), (139,12,1,1), (139,13,1,1), (139,9,1,1), (139,15,1,1), (139,16,1,1), (139,17,1,1), (139,18,1,1), (139,19,1,1), (139,20,1,1);
ERROR 23000: Duplicate entry '139-9' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (49,11,1,1), (49,12,1,1), (49,13,1,1), (49,14,1,1), (49,15,1,1), (49,49,1,1), (49,17,1,1), (49,9,1,1), (49,19,1,1), (49,20,1,1);
ERROR 23000: Duplicate entry '49-9' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (49,11,1,1), (49,12,1,1), (49,13,1,1), (49,14,1,1), (49,15,1,1), (49,49,1,1), (49,17,1,1), (49,9,1,1), (49,19,1,1), (49,20,1,1);
ERROR 23000: Duplicate entry '49-9' for key 'PRIMARY'
insert into test_bulk values (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1), (183,183,1,1);
ERROR 23000: Duplicate entry '183-183' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (183,11,1,1), (183,12,1,1), (183,13,1,1), (183,14,1,1), (183,15,1,1), (183,16,1,1), (183,17,1,1), (183,18,1,1), (183,19,1,1), (183,8,1,1);
ERROR 23000: Duplicate entry '183-8' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (183,11,1,1), (183,12,1,1), (183,13,1,1), (183,14,1,1), (183,15,1,1), (183,16,1,1), (183,17,1,1), (183,18,1,1), (183,19,1,1), (183,8,1,1);
ERROR 23000: Duplicate entry '183-8' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (138,11,1,1), (138,12,1,1), (138,13,1,1), (138,8,1,1), (138,15,1,1), (138,16,1,1), (138,17,1,1), (138,18,1,1), (138,19,1,1), (138,20,1,1);
ERROR 23000: Duplicate entry '138-8' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (138,11,1,1), (138,12,1,1), (138,13,1,1), (138,8,1,1), (138,15,1,1), (138,16,1,1), (138,17,1,1), (138,18,1,1), (138,19,1,1), (138,20,1,1);
ERROR 23000: Duplicate entry '138-8' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (48,11,1,1), (48,12,1,1), (48,13,1,1), (48,14,1,1), (48,15,1,1), (48,48,1,1), (48,17,1,1), (48,8,1,1), (48,19,1,1), (48,20,1,1);
ERROR 23000: Duplicate entry '48-8' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (48,11,1,1), (48,12,1,1), (48,13,1,1), (48,14,1,1), (48,15,1,1), (48,48,1,1), (48,17,1,1), (48,8,1,1), (48,19,1,1), (48,20,1,1);
ERROR 23000: Duplicate entry '48-8' for key 'PRIMARY'
insert into test_bulk values (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1), (182,182,1,1);
ERROR 23000: Duplicate entry '182-182' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (182,11,1,1), (182,12,1,1), (182,13,1,1), (182,14,1,1), (182,15,1,1), (182,16,1,1), (182,17,1,1), (182,18,1,1), (182,19,1,1), (182,7,1,1);
ERROR 23000: Duplicate entry '182-7' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (182,11,1,1), (182,12,1,1), (182,13,1,1), (182,14,1,1), (182,15,1,1), (182,16,1,1), (182,17,1,1), (182,18,1,1), (182,19,1,1), (182,7,1,1);
ERROR 23000: Duplicate entry '182-7' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (137,11,1,1), (137,12,1,1), (137,13,1,1), (137,7,1,1), (137,15,1,1), (137,16,1,1), (137,17,1,1), (137,18,1,1), (137,19,1,1), (137,20,1,1);
ERROR 23000: Duplicate entry '137-7' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (137,11,1,1), (137,12,1,1), (137,13,1,1), (137,7,1,1), (137,15,1,1), (137,16,1,1), (137,17,1,1), (137,18,1,1), (137,19,1,1), (137,20,1,1);
ERROR 23000: Duplicate entry '137-7' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (47,11,1,1), (47,12,1,1), (47,13,1,1), (47,14,1,1), (47,15,1,1), (47,47,1,1), (47,17,1,1), (47,7,1,1), (47,19,1,1), (47,20,1,1);
ERROR 23000: Duplicate entry '47-7' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (47,11,1,1), (47,12,1,1), (47,13,1,1), (47,14,1,1), (47,15,1,1), (47,47,1,1), (47,17,1,1), (47,7,1,1), (47,19,1,1), (47,20,1,1);
ERROR 23000: Duplicate entry '47-7' for key 'PRIMARY'
insert into test_bulk values (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1), (181,181,1,1);
ERROR 23000: Duplicate entry '181-181' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (181,11,1,1), (181,12,1,1), (181,13,1,1), (181,14,1,1), (181,15,1,1), (181,16,1,1), (181,17,1,1), (181,18,1,1), (181,19,1,1), (181,6,1,1);
ERROR 23000: Duplicate entry '181-6' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (181,11,1,1), (181,12,1,1), (181,13,1,1), (181,14,1,1), (181,15,1,1), (181,16,1,1), (181,17,1,1), (181,18,1,1), (181,19,1,1), (181,6,1,1);
ERROR 23000: Duplicate entry '181-6' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (136,11,1,1), (136,12,1,1), (136,13,1,1), (136,6,1,1), (136,15,1,1), (136,16,1,1), (136,17,1,1), (136,18,1,1), (136,19,1,1), (136,20,1,1);
ERROR 23000: Duplicate entry '136-6' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (136,11,1,1), (136,12,1,1), (136,13,1,1), (136,6,1,1), (136,15,1,1), (136,16,1,1), (136,17,1,1), (136,18,1,1), (136,19,1,1), (136,20,1,1);
ERROR 23000: Duplicate entry '136-6' for key 'PRIMARY'
insert into test_bulk values (90,1,1,1), (90,2,1,1), (90,3,1,1), (90,4,1,1), (90,5,1,1), (90,6,1,1), (90,7,1,1), (90,8,1,1), (90,9,1,1), (90,10,1,1), (46,11,1,1), (46,12,1,1), (46,13,1,1), (46,14,1,1), (46,15,1,1), (46,46,1,1), (46,17,1,1), (46,6,1,1), (46,19,1,1), (46,20,1,1);
ERROR 23000: Duplicate entry '46-6' for key 'PRIMARY'
insert into test_bulk values (170,1,1,1), (170,2,1,1), (170,3,1,1), (170,4,1,1), (170,5,1,1), (170,6,1,1), (170,7,1,1), (170,8,1,1), (170,9,1,1), (170,10,1,1), (46,11,1,1), (46,12,1,1), (46,13,1,1), (46,14,1,1), (46,15,1,1), (46,46,1,1), (46,17,1,1), (46,6,1,1), (46,19,1,1), (46,20,1,1);
ERROR 23000: Duplicate entry '46-6' for key 'PRIMARY'
ERROR 23000: Duplicate entry '150-1' for key 'PRIMARY'
drop table if exists t;

View File

@ -0,0 +1,16 @@
case 1: commit
show variables like 'autocommit';
Variable_name Value
autocommit ON
drop table if exists t1;
create table t1 (c1 int primary key, c2 varchar(1024));
set autocommit=0;
insert into t1 values (1, '中国');
select * from t1 where c1 = 1 for update;
c1 c2
1 中国
commit;
set autocommit=1;
select * from t1;
c1 c2
1 中国

View File

@ -0,0 +1,46 @@
drop table if exists tt1;
create table tt1(c1 int primary key, c2 int);
insert into tt1 values(1,4);
insert into tt1 values(2,3);
select c1, c2 as c1 from tt1;
c1 c1
1 4
2 3
select c1, c2 as c1 from tt1 order by c1;
ERROR 23000: Column 'c1' in order clause is ambiguous
select c2 as c1 from tt1 order by c1;
c1
3
4
select c2 as c1 from tt1 where c1<4;
c1
4
3
select c1 as cc, c2 as c1 from tt1 where c1<4;
cc c1
1 4
2 3
select c1 as cc, c2 as c1 from tt1 order by c1;
cc c1
2 3
1 4
select c1, c2 as c1 from tt1 where c1<4;
c1 c1
1 4
2 3
select c2 as cc from tt1 order by c1;
cc
4
3
select c2 as c1 from tt1 order by c1;
c1
3
4
select c1 as c1, c2 as c1 from tt1 where c1<4;
c1 c1
1 4
2 3
show columns from tt1;
Field Type Null Key Default Extra
c1 int(11) NO PRI NULL
c2 int(11) YES NULL

View File

@ -0,0 +1,43 @@
drop table if exists ob_new_sql_test;
drop table if exists a1;
create table ob_new_sql_test(c0 varchar(10) primary key, c1 int, c2 int);
insert into ob_new_sql_test(c0, c1) values ('0001',1);
select * from ob_new_sql_test where c0='0001';
c0 c1 c2
0001 1 NULL
select * from ob_new_sql_test;
c0 c1 c2
0001 1 NULL
select length(c0) from ob_new_sql_test;
length(c0)
4
select hex(c0) from ob_new_sql_test;
hex(c0)
30303031
drop table ob_new_sql_test;
SELECT 'a' = 'a ';
'a' = 'a '
1
SELECT 'a\0' < 'a';
'a\0' < 'a'
1
SELECT 'a\0' < 'a ';
'a\0' < 'a '
1
SELECT 'a\t' < 'a';
'a\t' < 'a'
1
SELECT 'a\t' < 'a ';
'a\t' < 'a '
1
create table a1 (rowkey_suffix int primary key,price int);
insert into a1 (rowkey_suffix, price) values(10,10);
insert into a1 (rowkey_suffix, price) values(20,20);
select * from a1 where rowkey_suffix=price;
rowkey_suffix price
10 10
20 20
select * from a1 where rowkey_suffix=price and price=10;
rowkey_suffix price
10 10
drop table a1;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
drop table if exists t1,t2,t3;
select count(*);
count(*)
1
select count(*) from dual;
count(*)
1
create table t1 (libname varchar(21), city varchar(256), primary key (libname));
select count(*) from t1;
count(*)
0
insert into t1 values ('test1','city1'),('test2','city2');
insert into t1 values ('l', null);
replace into t1 values ('2', null);
replace into t1 values ('test3','city3'),('test4','city4');
select count(*) from t1;
count(*)
6
select count(city) from t1;
count(city)
4
select count(t1.*) from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use

View File

@ -0,0 +1,25 @@
drop database if exists hualong;
create database hualong;
use hualong;
create table using_hash_t1 (c1 int, c2 int, primary key using hash (c1));
create table using_btree_t1 (c1 int, c2 int, primary key using btree (c1));
select t.table_name, t.index_using_type from oceanbase.__all_virtual_table t join oceanbase.__all_virtual_database d on t.database_id = d.database_id where t.table_name = 'using_hash_t1' and d.database_name = 'hualong';
table_name index_using_type
using_hash_t1 1
select t.table_name, t.index_using_type from oceanbase.__all_virtual_table t join oceanbase.__all_virtual_database d on t.database_id = d.database_id where t.table_name = 'using_btree_t1' and d.database_name = 'hualong';
table_name index_using_type
using_btree_t1 0
select index_table.table_name as index_name, data_table.table_name as data_table_name, index_table.index_using_type
from oceanbase.__all_virtual_table index_table join oceanbase.__all_virtual_table data_table
on index_table.data_table_id = data_table.table_id
where index_table.index_using_type = 1 and index_table.tenant_id = 1 and index_table.tenant_id = data_table.tenant_id
order by 1;
index_name data_table_name index_using_type
__idx_11003_all_virtual_plan_cache_stat_i1 __all_virtual_plan_cache_stat 1
__idx_11013_all_virtual_session_event_i1 __all_virtual_session_event 1
__idx_11014_all_virtual_session_wait_i1 __all_virtual_session_wait 1
__idx_11015_all_virtual_session_wait_history_i1 __all_virtual_session_wait_history 1
__idx_11017_all_virtual_system_event_i1 __all_virtual_system_event 1
__idx_11020_all_virtual_sesstat_i1 __all_virtual_sesstat 1
__idx_11021_all_virtual_sysstat_i1 __all_virtual_sysstat 1
drop database hualong;

View File

@ -0,0 +1,692 @@
drop database if exists createsql;
create database createsql;
use createsql;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_shishi_000(
thedate datetime(6),
puttype int,
sourcetype int,
clickprice int,
click int,
custid int,
impression int,
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_feed_bidword_ob_000(
bidwordid int,
searchtype int,
thedate datetime(6),
adgroupid int,
freeclick int,
directtransactionshipping int,
matchscope int,
memberid int,
feedid int,
favshoptotal int,
cost int,
campaignid int,
favitemtotal int,
indirecttransaction int,
gmt_created datetime default now(),
gmt_modified datetime default now(),
directtransaction int,
indirecttransactionshipping int,
network int,
invalidclick int,
bidwordstr varchar(300),
custid int,
impression int,
itemid int,
click int,
ranksum int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,bidwordid,feedid,network,matchscope)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_lixian_000(
thedate datetime(6),
sourcetype int,
custid int,
impression int,
puttype int,
campaignid int,
clickprice int,
click int,
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_bidword_ob_000(
click int,
bidwordstr varchar(300),
custid int,
onefavshoptotal int,
directtransaction int,
invalidclick int,
network int,
campaignid int,
cost int,
favitemtotal int,
adgroupid int,
memberid int,
sevenindirecttransactionshipping int,
fifteenfavitemtotal int,
thedate datetime(6),
fifteenindirecttransactionshipping int,
isshop int,
fifteenfavshoptotal int,
fifteendirecttransactionshipping int,
threeindirecttransactionshipping int,
ranksum int,
sevenfavitemtotal int,
impression int,
threefavshoptotal int,
sevenindirecttransaction int,
indirecttransactionshipping int,
onedirecttransactionshipping int,
onefavitemtotal int,
indirecttransaction int,
threeindirecttransaction int,
sevendirecttransactionshipping int,
sevendirecttransaction int,
sevenfavshoptotal int,
fifteenindirecttransaction int,
favshoptotal int,
onedirecttransaction int,
oneindirecttransactionshipping int,
matchscope int,
directtransactionshipping int,
threefavitemtotal int,
fifteendirecttransaction int,
threedirecttransactionshipping int,
oneindirecttransaction int,
threedirecttransaction int,
bidwordid int,
searchtype int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,bidwordid,network,matchscope)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroupplace_name_000(
placeid int,
placename varchar(100),
thedate datetime(6),
PRIMARY KEY (placeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_shishi_accumulative_000(
custid int,
impression int,
sourcetype int,
puttype int,
thedate datetime(6),
clickprice int,
click int,
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_querysession_ob_000(
relword varchar(3000),
originalword varchar(300),
PRIMARY KEY (originalword)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_area_ob_000(
onedirecttransaction int,
favshoptotal int,
threefavitemtotal int,
oneindirecttransactionshipping int,
directtransactionshipping int,
provinceid int,
threedirecttransactionshipping int,
fifteendirecttransaction int,
oneindirecttransaction int,
threedirecttransaction int,
ext2 int,
threeindirecttransactionshipping int,
threefavshoptotal int,
impression int,
sevenfavitemtotal int,
ext1 int,
onedirecttransactionshipping int,
indirecttransactionshipping int,
onefavitemtotal int,
sevenindirecttransaction int,
sevenfavshoptotal int,
fifteenindirecttransaction int,
sevendirecttransaction int,
cityid int,
sevendirecttransactionshipping int,
threeindirecttransaction int,
indirecttransaction int,
favitemtotal int,
productid int,
campaignid int,
cost int,
sevenindirecttransactionshipping int,
memberid int,
fifteenfavshoptotal int,
fifteenfavitemtotal int,
fifteenindirecttransactionshipping int,
thedate datetime(6),
fifteendirecttransactionshipping int,
click int,
traffictype int,
custid int,
invalidclick int,
productline int,
directtransaction int,
onefavshoptotal int,
mechanism int,
PRIMARY KEY (custid,thedate,campaignid,traffictype,mechanism,provinceid,cityid,productline,productid,ext1,ext2)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_area_000(
indirecttransaction int,
mechanism int,
competition int,
area int,
indirecttransactionshipping int,
network int,
ext1 int,
directtransaction int,
bidwordstr varchar(300),
impression int,
click int,
ext2 int,
thedate datetime(6),
directtransactionshipping int,
bidwordhash int,
cost int,
favshoptotal int,
favitemtotal int,
PRIMARY KEY (bidwordhash,thedate,area,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_feed_name_000(
gmt_created datetime default now(),
gmt_modified datetime default now(),
thedate datetime(6),
linkurl varchar(1024),
adgroupid int,
custid int,
title varchar(1024),
memberid int,
imgurl varchar(1024),
feedid int,
campaignid int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,feedid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_lixian_accumulative_000(
clickprice int,
click int,
sourcetype int,
puttype int,
thedate datetime(6),
impression int,
custid int,
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_creative_name_000(
is_shop int,
thedate datetime(6),
linkurl varchar(1024),
adgroupid int,
title varchar(1024),
custid int,
creativeid int,
memberid int,
imgurl varchar(1024),
campaignid int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,creativeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_000(
name varchar(100),
demographicid int,
thedate datetime(6),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_star_000(
thedate datetime(6),
demographicid int,
name varchar(100),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_item_ob_000(
indirecttransactionshipping int,
ext1 int,
onedirecttransactionshipping int,
onefavitemtotal int,
sevenindirecttransaction int,
fifteenindirecttransaction int,
sevenfavshoptotal int,
productlineid int,
sevendirecttransaction int,
sevendirecttransactionshipping int,
threeindirecttransaction int,
indirecttransaction int,
ranksum int,
ext2 int,
threeindirecttransactionshipping int,
threefavshoptotal int,
impression int,
sevenfavitemtotal int,
creativeid int,
threedirecttransactionshipping int,
fifteendirecttransaction int,
searchtype int,
rptext2 int,
threedirecttransaction int,
oneindirecttransaction int,
onedirecttransaction int,
favshoptotal int,
entityid int,
creativepv int,
threefavitemtotal int,
oneindirecttransactionshipping int,
directtransactionshipping int,
invalidclick int,
directtransaction int,
onefavshoptotal int,
rptext1 int,
click int,
traffictype int,
custid int,
entitytype int,
fifteenfavshoptotal int,
thedate datetime(6),
fifteenfavitemtotal int,
fifteenindirecttransactionshipping int,
fifteendirecttransactionshipping int,
favitemtotal int,
productid int,
cost int,
areaid int,
campaignid int,
feedid int,
sevenindirecttransactionshipping int,
memberid int,
adgroupid int,
PRIMARY KEY (memberid,thedate,productlineid,campaignid,adgroupid,creativeid,areaid,entityid,entitytype,traffictype,searchtype,productid,ext1,ext2)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_p4p_bidword_normtoorigin_000(
normalword varchar(300),
originalword varchar(300),
PRIMARY KEY (normalword)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_lixian_accumulative_000(
click int,
clickprice int,
puttype int,
campaignid int,
impression int,
custid int,
thedate datetime(6),
sourcetype int,
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_lixian_000(
custid int,
impression int,
sourcetype int,
puttype int,
thedate datetime(6),
click int,
clickprice int,
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_shishi_000(
thedate datetime(6),
sourcetype int,
custid int,
impression int,
campaignid int,
puttype int,
click int,
clickprice int,
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_shishi_accumulative_000(
clickprice int,
click int,
puttype int,
campaignid int,
impression int,
custid int,
sourcetype int,
thedate datetime(6),
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_custom_ob_000(
oneindirecttransaction int,
threedirecttransaction int,
fifteendirecttransaction int,
threedirecttransactionshipping int,
directtransactionshipping int,
oneindirecttransactionshipping int,
threefavitemtotal int,
favshoptotal int,
onedirecttransaction int,
indirecttransaction int,
threeindirecttransaction int,
sevendirecttransactionshipping int,
sevendirecttransaction int,
sevenfavshoptotal int,
fifteenindirecttransaction int,
sevenindirecttransaction int,
onedirecttransactionshipping int,
indirecttransactionshipping int,
onefavitemtotal int,
sevenfavitemtotal int,
impression int,
threefavshoptotal int,
threeindirecttransactionshipping int,
ranksum int,
fifteendirecttransactionshipping int,
fifteenfavitemtotal int,
fifteenindirecttransactionshipping int,
thedate datetime(6),
fifteenfavshoptotal int,
memberid int,
sevenindirecttransactionshipping int,
cost int,
favitemtotal int,
onefavshoptotal int,
directtransaction int,
invalidclick int,
custid int,
click int,
PRIMARY KEY (custid,thedate)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_purchase_000(
demographicid int,
thedate datetime(6),
name varchar(100),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_tag_000(
name varchar(300),
gmt_created datetime default now(),
id int,
type int,
gmt_modified datetime default now(),
PRIMARY KEY (id)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroup_ob_000(
adgroupid int,
sevenindirecttransactionshipping int,
memberid int,
cost int,
campaignid int,
favitemtotal int,
fifteendirecttransactionshipping int,
fifteenindirecttransactionshipping int,
fifteenfavitemtotal int,
thedate datetime(6),
isshop int,
fifteenfavshoptotal int,
custid int,
click int,
onefavshoptotal int,
invalidclick int,
network int,
directtransaction int,
oneindirecttransactionshipping int,
directtransactionshipping int,
matchscope int,
threefavitemtotal int,
favshoptotal int,
onedirecttransaction int,
threedirecttransaction int,
oneindirecttransaction int,
searchtype int,
auctionid int,
fifteendirecttransaction int,
threedirecttransactionshipping int,
sevenfavitemtotal int,
creativeid int,
threefavshoptotal int,
impression int,
threeindirecttransactionshipping int,
ranksum int,
sevendirecttransactionshipping int,
threeindirecttransaction int,
indirecttransaction int,
fifteenindirecttransaction int,
sevenfavshoptotal int,
sevendirecttransaction int,
onefavitemtotal int,
indirecttransactionshipping int,
onedirecttransactionshipping int,
sevenindirecttransaction int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,creativeid,network,matchscope,searchtype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_dim_000(
gmt_modified datetime default now(),
id int,
name varchar(300),
gmt_created datetime default now(),
PRIMARY KEY (id)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroup_name_000(
title varchar(1024),
custid int,
adgroupid int,
memberid int,
campaignid int,
imgurl varchar(1024),
auctionid int,
thedate datetime(6),
isshop int,
linkurl varchar(1024),
PRIMARY KEY (custid,thedate,campaignid,adgroupid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_price_000(
indirecttransaction int,
competition int,
mechanism int,
directtransaction int,
ext1 int,
indirecttransactionshipping int,
network int,
bidwordstr varchar(300),
impression int,
ext2 int,
click int,
pricedistribution int,
thedate datetime(6),
directtransactionshipping int,
bidwordhash int,
favshoptotal int,
cost int,
favitemtotal int,
PRIMARY KEY (bidwordhash,thedate,pricedistribution,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_sexpowerstar_ob_000(
directtransaction int,
invalidclick int,
onefavshoptotal int,
click int,
custid int,
fifteenfavshoptotal int,
fifteenfavitemtotal int,
thedate datetime(6),
fifteenindirecttransactionshipping int,
fifteendirecttransactionshipping int,
demographicstarid int,
demographicsexid int,
favitemtotal int,
campaignid int,
cost int,
memberid int,
sevenindirecttransactionshipping int,
sevenindirecttransaction int,
onefavitemtotal int,
indirecttransactionshipping int,
onedirecttransactionshipping int,
sevendirecttransaction int,
fifteenindirecttransaction int,
sevenfavshoptotal int,
indirecttransaction int,
threeindirecttransaction int,
sevendirecttransactionshipping int,
threeindirecttransactionshipping int,
impression int,
threefavshoptotal int,
sevenfavitemtotal int,
threedirecttransactionshipping int,
fifteendirecttransaction int,
demographicpurchaseid int,
threedirecttransaction int,
oneindirecttransaction int,
onedirecttransaction int,
favshoptotal int,
threefavitemtotal int,
directtransactionshipping int,
oneindirecttransactionshipping int,
PRIMARY KEY (custid,thedate,campaignid,demographicsexid,demographicpurchaseid,demographicstarid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_campaign_name_000(
memeberid int,
thedate datetime(6),
campaignid int,
campaigintitle varchar(1024),
custid int,
campaigntype int,
PRIMARY KEY (custid,thedate,campaignid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_000(
mechanism int,
competition int,
indirecttransaction int,
ext1 int,
indirecttransactionshipping int,
network int,
directtransaction int,
impression int,
bidwordstr varchar(512),
click int,
ext2 int,
thedate datetime(6),
bidwordhash int,
directtransactionshipping int,
favitemtotal int,
cost int,
favshoptotal int,
PRIMARY KEY (bidwordhash,thedate,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_category_000(
click int,
ext2 int,
bidwordstr varchar(300),
impression int,
indirecttransactionshipping int,
ext1 int,
network int,
directtransaction int,
indirecttransaction int,
mechanism int,
competition int,
favshoptotal int,
cost int,
favitemtotal int,
directtransactionshipping int,
bidwordhash int,
thedate datetime(6),
category int,
PRIMARY KEY (category,bidwordhash,thedate,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_sex_000(
name varchar(100),
thedate datetime(6),
demographicid int,
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_pos_ob_000(
threedirecttransactionshipping int,
fifteendirecttransaction int,
auctionid int,
oneindirecttransaction int,
threedirecttransaction int,
dimid int,
onedirecttransaction int,
favshoptotal int,
threefavitemtotal int,
oneindirecttransactionshipping int,
directtransactionshipping int,
sevenindirecttransaction int,
onedirecttransactionshipping int,
indirecttransactionshipping int,
onefavitemtotal int,
sevendirecttransaction int,
fifteenindirecttransaction int,
sevenfavshoptotal int,
indirecttransaction int,
threeindirecttransaction int,
sevendirecttransactionshipping int,
threeindirecttransactionshipping int,
impression int,
threefavshoptotal int,
placeid int,
sevenfavitemtotal int,
fifteenfavshoptotal int,
isshop int,
fifteenindirecttransactionshipping int,
fifteenfavitemtotal int,
thedate datetime(6),
fifteendirecttransactionshipping int,
favitemtotal int,
cost int,
campaignid int,
memberid int,
sevenindirecttransactionshipping int,
adgroupid int,
directtransaction int,
invalidclick int,
onefavshoptotal int,
click int,
custid int,
PRIMARY KEY (custid,thedate,campaignid,adgroupid,placeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_campaign_ob_000(
searchtype int,
oneindirecttransaction int,
threedirecttransaction int,
threedirecttransactionshipping int,
fifteendirecttransaction int,
threefavitemtotal int,
matchscope int,
directtransactionshipping int,
oneindirecttransactionshipping int,
onedirecttransaction int,
favshoptotal int,
sevenfavshoptotal int,
fifteenindirecttransaction int,
sevendirecttransaction int,
sevendirecttransactionshipping int,
threeindirecttransaction int,
indirecttransaction int,
onefavitemtotal int,
indirecttransactionshipping int,
onedirecttransactionshipping int,
sevenindirecttransaction int,
threefavshoptotal int,
impression int,
sevenfavitemtotal int,
ranksum int,
threeindirecttransactionshipping int,
fifteendirecttransactionshipping int,
fifteenfavshoptotal int,
isshop int,
fifteenfavitemtotal int,
fifteenindirecttransactionshipping int,
thedate datetime(6),
sevenindirecttransactionshipping int,
memberid int,
favitemtotal int,
campaignid int,
cost int,
invalidclick int,
network int,
directtransaction int,
onefavshoptotal int,
custid int,
click int,
PRIMARY KEY (custid,thedate,campaignid,network,matchscope,searchtype,isshop)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_area_name_000(
cityid int,
cityname varchar(100),
provinceid int,
provincename varchar(100),
PRIMARY KEY (provinceid,cityid)
) COMPRESSION='lz4_1.0' ;
drop database createsql;

View File

@ -0,0 +1,693 @@
drop database if exists createvarchar;
create database createvarchar;
use createvarchar;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_shishi_000(
thedate datetime(6),
puttype varchar(124),
sourcetype varchar(124),
clickprice varchar(124),
click varchar(124),
custid varchar(124),
impression varchar(124),
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_feed_bidword_ob_000(
bidwordid varchar(124),
searchtype varchar(124),
thedate datetime(6),
adgroupid varchar(124),
freeclick varchar(124),
directtransactionshipping varchar(124),
matchscope varchar(124),
memberid varchar(124),
feedid varchar(124),
favshoptotal varchar(124),
cost varchar(124),
campaignid varchar(124),
favitemtotal varchar(124),
indirecttransaction varchar(124),
gmt_created datetime default now(),
gmt_modified datetime default now(),
directtransaction varchar(124),
indirecttransactionshipping varchar(124),
network varchar(124),
invalidclick varchar(124),
bidwordstr varchar(300),
custid varchar(124),
impression varchar(124),
itemid varchar(124),
click varchar(124),
ranksum varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,bidwordid,feedid,network,matchscope)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_lixian_000(
thedate datetime(6),
sourcetype varchar(124),
custid varchar(124),
impression varchar(124),
puttype varchar(124),
campaignid varchar(124),
clickprice varchar(124),
click varchar(124),
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_bidword_ob_000(
click varchar(124),
bidwordstr varchar(300),
custid varchar(124),
onefavshoptotal varchar(124),
directtransaction varchar(124),
invalidclick varchar(124),
network varchar(124),
campaignid varchar(124),
cost varchar(124),
favitemtotal varchar(124),
adgroupid varchar(124),
memberid varchar(124),
sevenindirecttransactionshipping varchar(124),
fifteenfavitemtotal varchar(124),
thedate datetime(6),
fifteenindirecttransactionshipping varchar(124),
isshop varchar(124),
fifteenfavshoptotal varchar(124),
fifteendirecttransactionshipping varchar(124),
threeindirecttransactionshipping varchar(124),
ranksum varchar(124),
sevenfavitemtotal varchar(124),
impression varchar(124),
threefavshoptotal varchar(124),
sevenindirecttransaction varchar(124),
indirecttransactionshipping varchar(124),
onedirecttransactionshipping varchar(124),
onefavitemtotal varchar(124),
indirecttransaction varchar(124),
threeindirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
sevendirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
fifteenindirecttransaction varchar(124),
favshoptotal varchar(124),
onedirecttransaction varchar(124),
oneindirecttransactionshipping varchar(124),
matchscope varchar(124),
directtransactionshipping varchar(124),
threefavitemtotal varchar(124),
fifteendirecttransaction varchar(124),
threedirecttransactionshipping varchar(124),
oneindirecttransaction varchar(124),
threedirecttransaction varchar(124),
bidwordid varchar(124),
searchtype varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,bidwordid,network,matchscope)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroupplace_name_000(
placeid varchar(124),
placename varchar(100),
thedate datetime(6),
PRIMARY KEY (placeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_shishi_accumulative_000(
custid varchar(124),
impression varchar(124),
sourcetype varchar(124),
puttype varchar(124),
thedate datetime(6),
clickprice varchar(124),
click varchar(124),
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_querysession_ob_000(
relword varchar(3000),
originalword varchar(300),
PRIMARY KEY (originalword)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_area_ob_000(
onedirecttransaction varchar(124),
favshoptotal varchar(124),
threefavitemtotal varchar(124),
oneindirecttransactionshipping varchar(124),
directtransactionshipping varchar(124),
provinceid varchar(124),
threedirecttransactionshipping varchar(124),
fifteendirecttransaction varchar(124),
oneindirecttransaction varchar(124),
threedirecttransaction varchar(124),
ext2 varchar(124),
threeindirecttransactionshipping varchar(124),
threefavshoptotal varchar(124),
impression varchar(124),
sevenfavitemtotal varchar(124),
ext1 varchar(124),
onedirecttransactionshipping varchar(124),
indirecttransactionshipping varchar(124),
onefavitemtotal varchar(124),
sevenindirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
fifteenindirecttransaction varchar(124),
sevendirecttransaction varchar(124),
cityid varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransaction varchar(124),
indirecttransaction varchar(124),
favitemtotal varchar(124),
productid varchar(124),
campaignid varchar(124),
cost varchar(124),
sevenindirecttransactionshipping varchar(124),
memberid varchar(124),
fifteenfavshoptotal varchar(124),
fifteenfavitemtotal varchar(124),
fifteenindirecttransactionshipping varchar(124),
thedate datetime(6),
fifteendirecttransactionshipping varchar(124),
click varchar(124),
traffictype varchar(124),
custid varchar(124),
invalidclick varchar(124),
productline varchar(124),
directtransaction varchar(124),
onefavshoptotal varchar(124),
mechanism varchar(124),
PRIMARY KEY (custid,thedate,campaignid,traffictype,mechanism,provinceid,cityid,productline,productid,ext1,ext2)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_area_000(
indirecttransaction varchar(124),
mechanism varchar(124),
competition varchar(124),
area varchar(124),
indirecttransactionshipping varchar(124),
network varchar(124),
ext1 varchar(124),
directtransaction varchar(124),
bidwordstr varchar(300),
impression varchar(124),
click varchar(124),
ext2 varchar(124),
thedate datetime(6),
directtransactionshipping varchar(124),
bidwordhash varchar(124),
cost varchar(124),
favshoptotal varchar(124),
favitemtotal varchar(124),
PRIMARY KEY (bidwordhash,thedate,area,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_feed_name_000(
gmt_created datetime default now(),
gmt_modified datetime default now(),
thedate datetime(6),
linkurl varchar(124),
adgroupid varchar(124),
custid varchar(124),
title varchar(124),
memberid varchar(124),
imgurl varchar(124),
feedid varchar(124),
campaignid varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,feedid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_lixian_accumulative_000(
clickprice varchar(124),
click varchar(124),
sourcetype varchar(124),
puttype varchar(124),
thedate datetime(6),
impression varchar(124),
custid varchar(124),
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_creative_name_000(
is_shop varchar(124),
thedate datetime(6),
linkurl varchar(124),
adgroupid varchar(124),
title varchar(124),
custid varchar(124),
creativeid varchar(124),
memberid varchar(124),
imgurl varchar(124),
campaignid varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,creativeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_000(
name varchar(100),
demographicid varchar(124),
thedate datetime(6),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_star_000(
thedate datetime(6),
demographicid varchar(124),
name varchar(100),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_solar_item_ob_000(
indirecttransactionshipping varchar(124),
ext1 varchar(124),
onedirecttransactionshipping varchar(124),
onefavitemtotal varchar(124),
sevenindirecttransaction varchar(124),
fifteenindirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
productlineid varchar(124),
sevendirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransaction varchar(124),
indirecttransaction varchar(124),
ranksum varchar(124),
ext2 varchar(124),
threeindirecttransactionshipping varchar(124),
threefavshoptotal varchar(124),
impression varchar(124),
sevenfavitemtotal varchar(124),
creativeid varchar(124),
threedirecttransactionshipping varchar(124),
fifteendirecttransaction varchar(124),
searchtype varchar(124),
rptext2 varchar(124),
threedirecttransaction varchar(124),
oneindirecttransaction varchar(124),
onedirecttransaction varchar(124),
favshoptotal varchar(124),
entityid varchar(124),
creativepv varchar(124),
threefavitemtotal varchar(124),
oneindirecttransactionshipping varchar(124),
directtransactionshipping varchar(124),
invalidclick varchar(124),
directtransaction varchar(124),
onefavshoptotal varchar(124),
rptext1 varchar(124),
click varchar(124),
traffictype varchar(124),
custid varchar(124),
entitytype varchar(124),
fifteenfavshoptotal varchar(124),
thedate datetime(6),
fifteenfavitemtotal varchar(124),
fifteenindirecttransactionshipping varchar(124),
fifteendirecttransactionshipping varchar(124),
favitemtotal varchar(124),
productid varchar(124),
cost varchar(124),
areaid varchar(124),
campaignid varchar(124),
feedid varchar(124),
sevenindirecttransactionshipping varchar(124),
memberid varchar(124),
adgroupid varchar(124),
PRIMARY KEY (memberid,thedate,productlineid,campaignid,adgroupid,creativeid,areaid,entityid,entitytype,traffictype,searchtype,productid,ext1,ext2)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_p4p_bidword_normtoorigin_000(
normalword varchar(300),
originalword varchar(300),
PRIMARY KEY (normalword)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_lixian_accumulative_000(
click varchar(124),
clickprice varchar(124),
puttype varchar(124),
campaignid varchar(124),
impression varchar(124),
custid varchar(124),
thedate datetime(6),
sourcetype varchar(124),
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_custid_lixian_000(
custid varchar(124),
impression varchar(124),
sourcetype varchar(124),
puttype varchar(124),
thedate datetime(6),
click varchar(124),
clickprice varchar(124),
PRIMARY KEY (custid,thedate,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_shishi_000(
thedate datetime(6),
sourcetype varchar(124),
custid varchar(124),
impression varchar(124),
campaignid varchar(124),
puttype varchar(124),
click varchar(124),
clickprice varchar(124),
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_chenfeng_campaignid_shishi_accumulative_000(
clickprice varchar(124),
click varchar(124),
puttype varchar(124),
campaignid varchar(124),
impression varchar(124),
custid varchar(124),
sourcetype varchar(124),
thedate datetime(6),
PRIMARY KEY (custid,thedate,campaignid,puttype,sourcetype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_custom_ob_000(
oneindirecttransaction varchar(124),
threedirecttransaction varchar(124),
fifteendirecttransaction varchar(124),
threedirecttransactionshipping varchar(124),
directtransactionshipping varchar(124),
oneindirecttransactionshipping varchar(124),
threefavitemtotal varchar(124),
favshoptotal varchar(124),
onedirecttransaction varchar(124),
indirecttransaction varchar(124),
threeindirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
sevendirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
fifteenindirecttransaction varchar(124),
sevenindirecttransaction varchar(124),
onedirecttransactionshipping varchar(124),
indirecttransactionshipping varchar(124),
onefavitemtotal varchar(124),
sevenfavitemtotal varchar(124),
impression varchar(124),
threefavshoptotal varchar(124),
threeindirecttransactionshipping varchar(124),
ranksum varchar(124),
fifteendirecttransactionshipping varchar(124),
fifteenfavitemtotal varchar(124),
fifteenindirecttransactionshipping varchar(124),
thedate datetime(6),
fifteenfavshoptotal varchar(124),
memberid varchar(124),
sevenindirecttransactionshipping varchar(124),
cost varchar(124),
favitemtotal varchar(124),
onefavshoptotal varchar(124),
directtransaction varchar(124),
invalidclick varchar(124),
custid varchar(124),
click varchar(124),
PRIMARY KEY (custid,thedate)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_purchase_000(
demographicid varchar(124),
thedate datetime(6),
name varchar(100),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_tag_000(
name varchar(300),
gmt_created datetime default now(),
id varchar(124),
type varchar(124),
gmt_modified datetime default now(),
PRIMARY KEY (id)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroup_ob_000(
adgroupid varchar(124),
sevenindirecttransactionshipping varchar(124),
memberid varchar(124),
cost varchar(124),
campaignid varchar(124),
favitemtotal varchar(124),
fifteendirecttransactionshipping varchar(124),
fifteenindirecttransactionshipping varchar(124),
fifteenfavitemtotal varchar(124),
thedate datetime(6),
isshop varchar(124),
fifteenfavshoptotal varchar(124),
custid varchar(124),
click varchar(124),
onefavshoptotal varchar(124),
invalidclick varchar(124),
network varchar(124),
directtransaction varchar(124),
oneindirecttransactionshipping varchar(124),
directtransactionshipping varchar(124),
matchscope varchar(124),
threefavitemtotal varchar(124),
favshoptotal varchar(124),
onedirecttransaction varchar(124),
threedirecttransaction varchar(124),
oneindirecttransaction varchar(124),
searchtype varchar(124),
auctionid varchar(124),
fifteendirecttransaction varchar(124),
threedirecttransactionshipping varchar(124),
sevenfavitemtotal varchar(124),
creativeid varchar(124),
threefavshoptotal varchar(124),
impression varchar(124),
threeindirecttransactionshipping varchar(124),
ranksum varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransaction varchar(124),
indirecttransaction varchar(124),
fifteenindirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
sevendirecttransaction varchar(124),
onefavitemtotal varchar(124),
indirecttransactionshipping varchar(124),
onedirecttransactionshipping varchar(124),
sevenindirecttransaction varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,creativeid,network,matchscope,searchtype)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_dim_000(
gmt_modified datetime default now(),
id varchar(124),
name varchar(300),
gmt_created datetime default now(),
PRIMARY KEY (id)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_adgroup_name_000(
title varchar(124),
custid varchar(124),
adgroupid varchar(124),
memberid varchar(124),
campaignid varchar(124),
imgurl varchar(124),
auctionid varchar(124),
thedate datetime(6),
isshop varchar(124),
linkurl varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_price_000(
indirecttransaction varchar(124),
competition varchar(124),
mechanism varchar(124),
directtransaction varchar(124),
ext1 varchar(124),
indirecttransactionshipping varchar(124),
network varchar(124),
bidwordstr varchar(300),
impression varchar(124),
ext2 varchar(124),
click varchar(124),
pricedistribution varchar(124),
thedate datetime(6),
directtransactionshipping varchar(124),
bidwordhash varchar(124),
favshoptotal varchar(124),
cost varchar(124),
favitemtotal varchar(124),
PRIMARY KEY (bidwordhash,thedate,pricedistribution,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_sexpowerstar_ob_000(
directtransaction varchar(124),
invalidclick varchar(124),
onefavshoptotal varchar(124),
click varchar(124),
custid varchar(124),
fifteenfavshoptotal varchar(124),
fifteenfavitemtotal varchar(124),
thedate datetime(6),
fifteenindirecttransactionshipping varchar(124),
fifteendirecttransactionshipping varchar(124),
demographicstarid varchar(124),
demographicsexid varchar(124),
favitemtotal varchar(124),
campaignid varchar(124),
cost varchar(124),
memberid varchar(124),
sevenindirecttransactionshipping varchar(124),
sevenindirecttransaction varchar(124),
onefavitemtotal varchar(124),
indirecttransactionshipping varchar(124),
onedirecttransactionshipping varchar(124),
sevendirecttransaction varchar(124),
fifteenindirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
indirecttransaction varchar(124),
threeindirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransactionshipping varchar(124),
impression varchar(124),
threefavshoptotal varchar(124),
sevenfavitemtotal varchar(124),
threedirecttransactionshipping varchar(124),
fifteendirecttransaction varchar(124),
demographicpurchaseid varchar(124),
threedirecttransaction varchar(124),
oneindirecttransaction varchar(124),
onedirecttransaction varchar(124),
favshoptotal varchar(124),
threefavitemtotal varchar(124),
directtransactionshipping varchar(124),
oneindirecttransactionshipping varchar(124),
PRIMARY KEY (custid,thedate,campaignid,demographicsexid,demographicpurchaseid,demographicstarid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_campaign_name_000(
memeberid varchar(124),
thedate datetime(6),
campaignid varchar(124),
campaigintitle varchar(124),
custid varchar(124),
campaigntype varchar(124),
PRIMARY KEY (custid,thedate,campaignid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_000(
mechanism varchar(124),
competition varchar(124),
indirecttransaction varchar(124),
ext1 varchar(124),
indirecttransactionshipping varchar(124),
network varchar(124),
directtransaction varchar(124),
impression varchar(124),
bidwordstr varchar(512),
click varchar(124),
ext2 varchar(124),
thedate datetime(6),
bidwordhash varchar(124),
directtransactionshipping varchar(124),
favitemtotal varchar(124),
cost varchar(124),
favshoptotal varchar(124),
PRIMARY KEY (bidwordhash,thedate,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_insight_bidword_category_000(
click varchar(124),
ext2 varchar(124),
bidwordstr varchar(300),
impression varchar(124),
indirecttransactionshipping varchar(124),
ext1 varchar(124),
network varchar(124),
directtransaction varchar(124),
indirecttransaction varchar(124),
mechanism varchar(124),
competition varchar(124),
favshoptotal varchar(124),
cost varchar(124),
favitemtotal varchar(124),
directtransactionshipping varchar(124),
bidwordhash varchar(124),
thedate datetime(6),
category varchar(124),
PRIMARY KEY (category,bidwordhash,thedate,network,mechanism,ext1,ext2,bidwordstr)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_demographic_name_sex_000(
name varchar(100),
thedate datetime(6),
demographicid varchar(124),
PRIMARY KEY (demographicid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_pos_ob_000(
threedirecttransactionshipping varchar(124),
fifteendirecttransaction varchar(124),
auctionid varchar(124),
oneindirecttransaction varchar(124),
threedirecttransaction varchar(124),
dimid varchar(124),
onedirecttransaction varchar(124),
favshoptotal varchar(124),
threefavitemtotal varchar(124),
oneindirecttransactionshipping varchar(124),
directtransactionshipping varchar(124),
sevenindirecttransaction varchar(124),
onedirecttransactionshipping varchar(124),
indirecttransactionshipping varchar(124),
onefavitemtotal varchar(124),
sevendirecttransaction varchar(124),
fifteenindirecttransaction varchar(124),
sevenfavshoptotal varchar(124),
indirecttransaction varchar(124),
threeindirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransactionshipping varchar(124),
impression varchar(124),
threefavshoptotal varchar(124),
placeid varchar(124),
sevenfavitemtotal varchar(124),
fifteenfavshoptotal varchar(124),
isshop varchar(124),
fifteenindirecttransactionshipping varchar(124),
fifteenfavitemtotal varchar(124),
thedate datetime(6),
fifteendirecttransactionshipping varchar(124),
favitemtotal varchar(124),
cost varchar(124),
campaignid varchar(124),
memberid varchar(124),
sevenindirecttransactionshipping varchar(124),
adgroupid varchar(124),
directtransaction varchar(124),
invalidclick varchar(124),
onefavshoptotal varchar(124),
click varchar(124),
custid varchar(124),
PRIMARY KEY (custid,thedate,campaignid,adgroupid,placeid)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_campaign_ob_000(
searchtype varchar(124),
oneindirecttransaction varchar(124),
threedirecttransaction varchar(124),
threedirecttransactionshipping varchar(124),
fifteendirecttransaction varchar(124),
threefavitemtotal varchar(124),
matchscope varchar(124),
directtransactionshipping varchar(124),
oneindirecttransactionshipping varchar(124),
onedirecttransaction varchar(124),
favshoptotal varchar(124),
sevenfavshoptotal varchar(124),
fifteenindirecttransaction varchar(124),
sevendirecttransaction varchar(124),
sevendirecttransactionshipping varchar(124),
threeindirecttransaction varchar(124),
indirecttransaction varchar(124),
onefavitemtotal varchar(124),
indirecttransactionshipping varchar(124),
onedirecttransactionshipping varchar(124),
sevenindirecttransaction varchar(124),
threefavshoptotal varchar(124),
impression varchar(124),
sevenfavitemtotal varchar(124),
ranksum varchar(124),
threeindirecttransactionshipping varchar(124),
fifteendirecttransactionshipping varchar(124),
fifteenfavshoptotal varchar(124),
isshop varchar(124),
fifteenfavitemtotal varchar(124),
fifteenindirecttransactionshipping varchar(124),
thedate datetime(6),
sevenindirecttransactionshipping varchar(124),
memberid varchar(124),
favitemtotal varchar(124),
campaignid varchar(124),
cost varchar(124),
invalidclick varchar(124),
network varchar(124),
directtransaction varchar(124),
onefavshoptotal varchar(124),
custid varchar(124),
click varchar(124),
PRIMARY KEY (custid,thedate,campaignid,network,matchscope,searchtype,isshop)
) COMPRESSION='lz4_1.0' ;
CREATE TABLE IF NOT EXISTS rpt_bpp4p_area_name_000(
cityid varchar(124),
cityname varchar(100),
provinceid varchar(124),
provincename varchar(100),
PRIMARY KEY (provinceid,cityid)
) COMPRESSION='lz4_1.0' ;
set @@recyclebin = off;
drop database createvarchar;

View File

@ -0,0 +1,32 @@
set sql_mode='';
drop table if exists t;
create table t(id int primary key auto_increment,
int_val smallint,
uint_val smallint unsigned,
flt_val float(5, 3),
dbl_val double(7, 4),
dec_val decimal(5, 3),
vc_val varchar(2));
insert into t(int_val, uint_val, flt_val, dbl_val, dec_val, vc_val) values
( 184467440737095516150, 184467440737095516150, 12345.67890, 12345.67890, '12345.67890', '123456789'),
(-184467440737095516150, -184467440737095516150, 0.444444, 0.444444, '98.76abc', '987654321'),
(NULL, NULL, -0.555555, -0.555555, 'abc', '阿里巴巴');
Warnings:
Warning 1265 Data truncated for column '"test"."t"."vc_val"' at row 1
Warning 1265 Data truncated for column '"test"."t"."vc_val"' at row 2
Warning 1265 Data truncated for column '"test"."t"."vc_val"' at row 3
select * from t order by id;
id int_val uint_val flt_val dbl_val dec_val vc_val
auto_increment_id 32767 65535 99.999 999.9999 99.999 12
auto_increment_id -32768 0 0.444 0.4444 98.760 98
auto_increment_id NULL NULL -0.556 -0.5556 0.000 阿里
update t set int_val = 123456789, uint_val = -123456789, flt_val = 98765.43210, dbl_val = 98765.43210, dec_val = 98765.43210, vc_val = '支付宝';
Warnings:
Warning 1265 Data truncated for column '"test"."t"."vc_val"' at row 1
select * from t order by id limit 1;
id int_val uint_val flt_val dbl_val dec_val vc_val
auto_increment_id 32767 0 99.999 999.9999 99.999 支付
select 4/3, 4/3*1000000 + 1, 4.00000/3*1000000000 + 1, 4.000000/3*1000000000 + 1, 4/3 = 1.3333, 4/3 = 1.333333333, length(4/3);
4/3 4/3*1000000 + 1 4.00000/3*1000000000 + 1 4.000000/3*1000000000 + 1 4/3 = 1.3333 4/3 = 1.333333333 length(4/3)
1.3333 1333334.3330 1333333334.000000000 1333333334.3333333330 0 1 6
drop table t;

View File

@ -0,0 +1,78 @@
drop database if exists jx_db;
create database jx_db;
use jx_db;
drop table if exists t1, t2,t3;
create table t1 (c1 int primary key, c2 int);
set autocommit=0;
insert into t1 values(1,1);
create table t2 (c1 int primary key, c2 int);
rollback;
select * from t1;
c1 c2
1 1
desc t2;
Field Type Null Key Default Extra
c1 int(11) NO PRI NULL
c2 int(11) YES NULL
set autocommit=1;
begin;
insert into t1 values(2,2);
create table t3 (c1 int primary key, c2 int);
rollback;
select * from t1;
c1 c2
1 1
2 2
desc t3;
Field Type Null Key Default Extra
c1 int(11) NO PRI NULL
c2 int(11) YES NULL
create table ddl_t(c int);
set autocommit = off;
insert into ddl_t values(3);
alter table ddl_t add column c2 int;
select * from ddl_t;
c c2
3 NULL
rollback;
select * from ddl_t;
c c2
3 NULL
create table jx_t1(c int);
set autocommit = off;
insert into jx_t1 values(4);
create table jx_t1(c int);
ERROR 42S01: Table 'jx_t1' already exists
select * from jx_t1;
c
4
rollback;
select * from jx_t1;
c
4
create table jx_t2(c int);
set autocommit = off;
insert into jx_t2 values(5);
create user if not exists jx_user;
select * from jx_t2;
c
5
rollback;
select * from jx_t2;
c
5
create table jx_t3(c int);
set autocommit = off;
insert into jx_t3 values(6);
create user jx_user;
ERROR HY000: Operation CREATE USER failed for 'jx_user'@'%'
select * from jx_t3;
c
6
rollback;
select * from jx_t3;
c
6
set autocommit = on;
drop user jx_user;
drop database jx_db;

View File

@ -0,0 +1,6 @@
select 1 from dual;
1
1
select 1 from dual;
1
1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
drop table if exists test;
create table test(a int primary key,b int,c int);
insert into test values(1,4,null);
insert into test values(3,3,null);
insert into test values(4,3,null);
select avg(distinct(a)),avg(a),avg(b) from test;
avg(distinct(a)) avg(a) avg(b)
2.6667 2.6667 3.3333
select avg(distinct(b)),avg(b),avg(c) from test;
avg(distinct(b)) avg(b) avg(c)
3.5000 3.3333 NULL
select avg(c),avg(b),avg(distinct(b)) from test;
avg(c) avg(b) avg(distinct(b))
NULL 3.3333 3.5000
select avg(c),avg(b),avg(b) from test;
avg(c) avg(b) avg(b)
NULL 3.3333 3.3333

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
drop table if exists t;
create table t (c1 int primary key, c2 int);
insert into t values(1,2),(3,4),(1,2);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t values(1,2),(3,4),(5,6);
select * from t;
c1 c2
1 2
3 4
5 6
select * from t where c1 in (1,3,1);
c1 c2
1 2
3 4
select * from t where c1 in (1,1);
c1 c2
1 2
drop table t;

View File

@ -0,0 +1 @@
/*!40101 SET SQL_MODE='' */;

View File

@ -0,0 +1,10 @@
drop table if exists t1;
create table t1 (nr int ,b char(30),str char(10), primary key (nr));
select count(*) from t1;
count(*)
0
select * from t1;
nr b str
select * from t1 limit 0;
nr b str
drop table t1;

View File

@ -0,0 +1,7 @@
drop table if exists t2;
create table t2 (c1 varchar(1024) primary key, c2 varchar(1024), c3 varchar(1024));
replace into t2 values ('abc', '\\\\', 'DC');
select * from t2;
c1 c2 c3
abc \\ DC
drop table t2;

View File

@ -0,0 +1,117 @@
drop table if exists t1,t2,t3,t4;
create table t1(c1 int primary key, c2 int);
create table t2(c1 int primary key, c2 int);
create table t3(c1 int, c2 int primary key);
create table t4(c1 int primary key, c2 int);
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
insert into t2 values(0,0),(2,2),(4,4),(6,6);
insert into t3 values(1,1),(3,3),(5,5),(7,7);
insert into t4 values(1,0),(2,0),(3,1),(4,1);
select * from t1 except select * from t1;
c1 c2
select * from t1 except all select * from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select * from t1' at line 1
select * from t1 except select * from t2;
c1 c2
1 1
3 3
5 5
select * from t1 except all select * from t2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select * from t2' at line 1
select * from t1 except select * from t3;
c1 c2
2 2
4 4
select * from t1 except all select * from t3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select * from t3' at line 1
select * from t1 except select 1,1 from t1;
c1 c2
2 2
3 3
4 4
5 5
select * from t1 except all select 1,1 from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select 1,1 from t1' at line 1
select * from t2 except select * from t3;
c1 c2
0 0
2 2
4 4
6 6
select * from t2 except all select * from t3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select * from t3' at line 1
(select * from t2) except (select * from t2 where false);
c1 c2
0 0
2 2
4 4
6 6
(select * from t2) except all (select * from t2 where false);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 where false)' at line 1
(select * from t2 where false) except (select * from t2);
c1 c2
(select * from t2 where false) except (select * from t2 where false);
c1 c2
select c2 from t4 except select 1 from t4;
c2
0
select c2 from t4 except all select 1 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select 1 from t4' at line 1
select c2 from t4 except select 0 from t4;
c2
1
select c2 from t4 except select c2 from t4;
c2
select c2 from t4 except select distinct c2 from t4;
c2
select distinct c2 from t4 except select distinct c2 from t4;
c2
select distinct c2 from t4 except all select distinct c2 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select distinct c2 from t4' at line 1
select distinct c2 from t4 except select c2 from t4;
c2
select distinct c2 from t4 except all select c2 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t4' at line 1
select 0 from t4 except select c2 from t4;
0
select 1 from t4 except select 0 from t4;
1
1
select 1 from t4 except all select 0 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select 0 from t4' at line 1
(select * from t4 except (select * from t4 where c1=1) )except (select * from t4 where c1=2);
c1 c2
3 1
4 1
select * from t4 except (select * from t4 where c1=1) except (select * from t4 where c1=3);
c1 c2
2 0
4 1
select * from t4 except select 1,0 from t4 except select 3,1 from t4;
c1 c2
2 0
4 1
(select * from t4 where false) except (select * from t4 where false) except select * from t4;
c1 c2
select * from t4 except ((select * from t4 where c1=1) except (select * from t4 where c1=2));
c1 c2
2 0
3 1
4 1
select * from t4 except ((select * from t4 where c1=1) union (select * from t4 where c1=2));
c1 c2
3 1
4 1
drop table if exists t5,t6;
create table t5(c1 int primary key, c2 int);
create table t6(c1 int primary key, c2 int);
insert into t5 values(1,1),(2,2),(3,3),(4,4),(5,5),(6,2),(7,3),(8,6);
insert into t6 values(0,0),(2,2),(4,4),(6,6);
select c2 from t5 except select c2 from t6;
c2
1
3
5
select c2 from t5 except all select c2 from t6;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t6' at line 1
drop table t1,t2,t3,t4,t5,t6;

View File

@ -0,0 +1,65 @@
drop table if exists test;
create table test(a int,b int primary key);
insert into test values(1,1);
insert into test values(1,2);
insert into test values(1,3);
insert into test values(1,4);
select * from test;
a b
1 1
1 2
1 3
1 4
explain select * from test;
desc select * from test;
describe select * from test;
explain insert into test values(1,5);
desc insert into test values(1,5);
describe insert into test values(1,5);
explain insert into test values(1,4);
desc insert into test values(1,4);
describe insert into test values(1,4);
explain update test set a=2 where b=2;
desc update test set a=2 where b=2;
describe update test set a=2 where b=2;
explain update test set b=2 where a=1;
desc update test set b=2 where a=1;
describe update test set b=2 where a=1;
explain delete from test where b=5;
desc delete from test where b=5;
describe delete from test where b=5;
explain create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
desc create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
describe create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
explain drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
desc drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
describe drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
drop table if exists sd;
create table sd(a int);
insert into sd values(5),(4),(4),(3),(2),(2),(2),(1);
explain select @rownum := @rownum + 1 as row, @rank := IF(@prev_score!=a, @rownum, @rank) as rank, @prev_score := a as score from sd;
explain outline select 1 < '2009-12-17 06:03:17';
Query Plan
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([cast(1, DECIMAL(1, 0)) < cast('2009-12-17 06:03:17', DECIMAL(1, -1))]), filter(nil)
values({cast(1, DECIMAL(1, 0)) < cast('2009-12-17 06:03:17', DECIMAL(1, -1))})
Outline Data:
-------------------------------------
/*+
BEGIN_OUTLINE_DATA
OPTIMIZER_FEATURES_ENABLE('4.0.0.0')
END_OUTLINE_DATA
*/
drop table sd;

View File

@ -0,0 +1,186 @@
drop table if exists fin_influx_extension;
drop table if exists fin_influx_inst;
drop table if exists fin_settle_serial_map;
drop table if exists fin_influx_terminal;
drop table if exists fin_info_transaction;
drop table if exists fin_influx_terminal_unique;
drop table if exists fin_request_no_unique;
drop table if exists fin_settle_serial_unique;
drop table if exists fin_influx_transaction;
drop table if exists idx1_fin_influx_transaction;
drop table if exists fin_influx_payer;
drop table if exists idx1_fin_influx_payer;
drop table if exists idx2_fin_influx_payer;
create table fin_influx_extension(INFLUX_ID varchar(64) primary key, EXTENSION1 varchar(32), EXTENSION2 varchar(32), REQ_EXTENSION varchar(4000), RES_EXTENSION varchar(4000), GMT_CREATE datetime(6), GMT_MODIFIED datetime(6));
insert into fin_influx_extension(INFLUX_ID, REQ_EXTENSION, RES_EXTENSION, GMT_CREATE, GMT_MODIFIED) values('0001','req_1', 'res_1', '2012-12-20 12:00', '2013-1-20 13:00');
select INFLUX_ID,EXTENSION1,EXTENSION2,REQ_EXTENSION,RES_EXTENSION,GMT_CREATE,GMT_MODIFIED from fin_influx_extension where INFLUX_ID = '0001';
INFLUX_ID EXTENSION1 EXTENSION2 REQ_EXTENSION RES_EXTENSION GMT_CREATE GMT_MODIFIED
0001 NULL NULL req_1 res_1 2012-12-20 12:00:00.000000 2013-01-20 13:00:00.000000
create table fin_influx_inst(INFLUX_ID varchar(64) primary key, INST_ID varchar(32), INST_SERIAL_NO varchar(32), INST_REF_NO varchar(32), RESP_AMOUNT int, RESP_CURRENCY char(3), INST_RESULT_CODE varchar(16), INST_RESULT_DESCRIPTION varchar(256), GMT_SETTLE datetime(6), GMT_RESP datetime(6), GMT_CREATE datetime(6), GMT_MODIFIED datetime(6));
insert into fin_influx_inst values('0001', '00001', 'serial_no', 'ref_no', 100, '123', 'result_code', 'result_des', '2013-1-20 13:00','2013-1-20 13:00','2013-1-20 13:00','2013-1-20 13:00');
SELECT INFLUX_ID, INST_ID, INST_SERIAL_NO, INST_REF_NO, RESP_AMOUNT, RESP_CURRENCY, INST_RESULT_CODE, INST_RESULT_DESCRIPTION, GMT_SETTLE, GMT_RESP, GMT_CREATE, GMT_MODIFIED FROM fin_influx_inst WHERE INFLUX_ID = '0001';
INFLUX_ID INST_ID INST_SERIAL_NO INST_REF_NO RESP_AMOUNT RESP_CURRENCY INST_RESULT_CODE INST_RESULT_DESCRIPTION GMT_SETTLE GMT_RESP GMT_CREATE GMT_MODIFIED
0001 00001 serial_no ref_no 100 123 result_code result_des 2013-01-20 13:00:00.000000 2013-01-20 13:00:00.000000 2013-01-20 13:00:00.000000 2013-01-20 13:00:00.000000
create table fin_settle_serial_map(INFLUX_ID varchar(64) primary key, SETTLE_SERIAL_NO varchar(64), INST_ID varchar(32), FINANCE_EXCHANGE_CODE varchar(32), GMT_CREATE datetime(6), GMT_MODIFIED datetime(6));
SELECT FINANCE_EXCHANGE_CODE, SETTLE_SERIAL_NO, INST_ID, INFLUX_ID, GMT_CREATE, GMT_MODIFIED FROM fin_settle_serial_map WHERE SETTLE_SERIAL_NO = '0001' AND FINANCE_EXCHANGE_CODE = '0001';
FINANCE_EXCHANGE_CODE SETTLE_SERIAL_NO INST_ID INFLUX_ID GMT_CREATE GMT_MODIFIED
SELECT FINANCE_EXCHANGE_CODE, SETTLE_SERIAL_NO, INST_ID, INFLUX_ID, GMT_CREATE, GMT_MODIFIED FROM fin_settle_serial_map WHERE SETTLE_SERIAL_NO = '0001';
FINANCE_EXCHANGE_CODE SETTLE_SERIAL_NO INST_ID INFLUX_ID GMT_CREATE GMT_MODIFIED
SELECT INFLUX_ID FROM fin_settle_serial_map WHERE FINANCE_EXCHANGE_CODE IN ('EXCHANGECODES') AND SETTLE_SERIAL_NO = '0001';
INFLUX_ID
create table fin_influx_terminal(influx_id varchar(64) primary key, inst_id varchar(32), inst_merchant_no varchar(32), inst_terminal_no varchar(32), term_batch_no varchar(6), term_trace_no varchar(6), rrn varchar(12), auth_code varchar(6), gmt_create datetime, gmt_modified datetime, finance_exchange_code varchar(32), inst_account_no varchar(32), exchange_amount int, exchange_currency char(3), extension varchar(4000));
select influx_id, inst_id, inst_merchant_no, inst_terminal_no, term_batch_no, term_trace_no, rrn, auth_code, gmt_create, gmt_modified, finance_exchange_code, inst_account_no, exchange_amount, exchange_currency, extension from fin_influx_terminal where influx_id='0001' and term_trace_no = '123';
influx_id inst_id inst_merchant_no inst_terminal_no term_batch_no term_trace_no rrn auth_code gmt_create gmt_modified finance_exchange_code inst_account_no exchange_amount exchange_currency extension
create table fin_info_transaction(
info_id varchar(64) primary key,
inst_id varchar(32),
business_code varchar(16),
sub_business_code varchar(16),
exchange_type varchar(32),
finance_exchange_code varchar(32),
exchange_status varchar(8),
request_info varchar(4000),
response_info varchar(4000),
gmt_send datetime,
gmt_res datetime,
gmt_create datetime,
gmt_modified datetime,
result_code varchar(16),
result_description varchar(256),
inst_result_code varchar(16),
inst_result_description varchar(256)
);
create table fin_influx_terminal_unique(
inst_id varchar(32),
inst_merchant_no varchar(32),
inst_terminal_no varchar(32),
term_batch_no varchar(6),
term_trace_no varchar(6),
gmt_create datetime,
gmt_modified datetime,
primary key(inst_id, term_batch_no, inst_merchant_no, term_trace_no, inst_terminal_no)
);
create table fin_request_no_unique(
request_identify varchar(32),
request_biz_no varchar(64),
gmt_create datetime,
gmt_modified datetime,
influx_id varchar(64),
primary key(request_identify, request_biz_no)
);
create table fin_settle_serial_unique(
finance_exchange_code varchar(32),
settle_serial_no varchar(64),
gmt_create datetime,
gmt_modified datetime,
primary key(finance_exchange_code, settle_serial_no)
);
create table fin_influx_transaction(
influx_id varchar(64) primary key,
org_influx_id varchar(64),
inst_id varchar(32),
business_code varchar(16),
sub_business_code varchar(16),
exchange_type varchar(32),
finance_exchange_code varchar(32),
settle_serial_no varchar(64),
payer_account_no varchar(32),
exchange_amount int,
exchange_currency char(3),
account_amount int,
account_currency char(3),
settle_amount int,
settle_currency char(3),
settle_status varchar(8),
exchange_status varchar(8),
result_code varchar(16),
result_description varchar(256),
recover_flag char(1),
recon_flag char(1),
negative_flag char(1),
negative_exchange_type varchar(16),
request_identify varchar(32),
request_biz_no varchar(64),
pay_unique_no varchar(64),
pay_channel_api varchar(32),
inst_channel_api varchar(32),
clear_channel varchar(32),
biz_identity varchar(32),
gmt_submit datetime,
gmt_resp datetime,
gmt_settle datetime,
gmt_create datetime,
gmt_modified datetime
);
select influx_id, org_influx_id, inst_id, business_code, sub_business_code, exchange_type, finance_exchange_code, settle_serial_no, payer_account_no, exchange_amount, exchange_currency, account_amount, account_currency, settle_amount, settle_currency, settle_status, exchange_status, result_code, result_description, recover_flag, recon_flag, negative_flag, negative_exchange_type, request_identify, request_biz_no, pay_unique_no, pay_channel_api, inst_channel_api, clear_channel, biz_identity, gmt_submit, gmt_resp, gmt_settle, gmt_create, gmt_modified from fin_influx_transaction where influx_id = '0001';
influx_id org_influx_id inst_id business_code sub_business_code exchange_type finance_exchange_code settle_serial_no payer_account_no exchange_amount exchange_currency account_amount account_currency settle_amount settle_currency settle_status exchange_status result_code result_description recover_flag recon_flag negative_flag negative_exchange_type request_identify request_biz_no pay_unique_no pay_channel_api inst_channel_api clear_channel biz_identity gmt_submit gmt_resp gmt_settle gmt_create gmt_modified
select influx_id, org_influx_id, inst_id, business_code, sub_business_code, exchange_type, finance_exchange_code, settle_serial_no, payer_account_no, exchange_amount, exchange_currency, account_amount, account_currency, settle_amount, settle_currency, settle_status, exchange_status, result_code, result_description, recover_flag, recon_flag, negative_flag, negative_exchange_type, request_identify, request_biz_no, pay_unique_no, pay_channel_api, inst_channel_api, clear_channel, biz_identity, gmt_submit, gmt_resp, gmt_settle, gmt_create, gmt_modified from fin_influx_transaction where finance_exchange_code = 'ss' and settle_serial_no = '00001';
influx_id org_influx_id inst_id business_code sub_business_code exchange_type finance_exchange_code settle_serial_no payer_account_no exchange_amount exchange_currency account_amount account_currency settle_amount settle_currency settle_status exchange_status result_code result_description recover_flag recon_flag negative_flag negative_exchange_type request_identify request_biz_no pay_unique_no pay_channel_api inst_channel_api clear_channel biz_identity gmt_submit gmt_resp gmt_settle gmt_create gmt_modified
select influx_id, org_influx_id, inst_id, business_code, sub_business_code, exchange_type, finance_exchange_code, settle_serial_no, payer_account_no, exchange_amount, exchange_currency, account_amount, account_currency, settle_amount, settle_currency, settle_status, exchange_status, result_code, result_description, recover_flag, recon_flag, negative_flag, negative_exchange_type, request_identify, request_biz_no, pay_unique_no, pay_channel_api, inst_channel_api, clear_channel, biz_identity, gmt_submit, gmt_resp, gmt_settle, gmt_create, gmt_modified from fin_influx_transaction where inst_channel_api = 'api' and settle_serial_no = '00001';
influx_id org_influx_id inst_id business_code sub_business_code exchange_type finance_exchange_code settle_serial_no payer_account_no exchange_amount exchange_currency account_amount account_currency settle_amount settle_currency settle_status exchange_status result_code result_description recover_flag recon_flag negative_flag negative_exchange_type request_identify request_biz_no pay_unique_no pay_channel_api inst_channel_api clear_channel biz_identity gmt_submit gmt_resp gmt_settle gmt_create gmt_modified
create table idx1_fin_influx_transaction(
settle_serial_no varchar(64),
finance_exchange_code varchar(32),
influx_id varchar(64),
inst_channel_api varchar(32),
primary key(settle_serial_no,finance_exchange_code,influx_id)
);
select * from idx1_fin_influx_transaction where finance_exchange_code = 'sss' and settle_serial_no = 'ss';
settle_serial_no finance_exchange_code influx_id inst_channel_api
select * from idx1_fin_influx_transaction where inst_channel_api = 'ss' and settle_serial_no = 'ss';
settle_serial_no finance_exchange_code influx_id inst_channel_api
create table fin_influx_payer(
influx_id varchar(64) ,
payer_account_no varchar(32),
payer_name varchar(32),
inst_account_no varchar(32),
inst_account_name varchar(128),
card_type varchar(16),
card_index varchar(32),
issuer varchar(32),
agreement_no varchar(100),
certificate_type varchar(64),
certificate_no varchar(32),
mobile_phone varchar(16),
pay_tool varchar(16),
bill_no varchar(32),
bill_type varchar(8),
gmt_create datetime,
gmt_modified datetime,
primary key(inst_account_no, gmt_create, influx_id)
);
select influx_id, payer_account_no, payer_name, inst_account_no, inst_account_name, card_type, card_index, issuer, agreement_no, certificate_type, certificate_no, mobile_phone, pay_tool, bill_no, bill_type, gmt_create, gmt_modified from fin_influx_payer where influx_id='0001';
influx_id payer_account_no payer_name inst_account_no inst_account_name card_type card_index issuer agreement_no certificate_type certificate_no mobile_phone pay_tool bill_no bill_type gmt_create gmt_modified
select influx_id, payer_account_no, payer_name, inst_account_no, inst_account_name, card_type, card_index, issuer, agreement_no, certificate_type, certificate_no, mobile_phone, pay_tool, bill_no, bill_type, gmt_create, gmt_modified from fin_influx_payer where bill_no='sss';
influx_id payer_account_no payer_name inst_account_no inst_account_name card_type card_index issuer agreement_no certificate_type certificate_no mobile_phone pay_tool bill_no bill_type gmt_create gmt_modified
select influx_id, payer_account_no, payer_name, inst_account_no, inst_account_name, card_type, card_index, issuer, agreement_no, certificate_type, certificate_no, mobile_phone, pay_tool, bill_no, bill_type, gmt_create, gmt_modified from fin_influx_payer where inst_account_no='0001' and gmt_create>='2012-10-1 23:00:00' and gmt_create<='2012-12-23 23:00:00';
influx_id payer_account_no payer_name inst_account_no inst_account_name card_type card_index issuer agreement_no certificate_type certificate_no mobile_phone pay_tool bill_no bill_type gmt_create gmt_modified
create table idx1_fin_influx_payer (
bill_no varchar(32),
inst_account_no varchar(32),
gmt_create datetime,
influx_id varchar(64),
virtual_col1 int,
primary key(bill_no,inst_account_no,gmt_create,influx_id)
);
create table idx2_fin_influx_payer(
influx_id varchar(64),
inst_account_no varchar(32),
gmt_create datetime,
virtual_col1 int,
a int,
primary key(influx_id,inst_account_no,gmt_create,virtual_col1)
);
drop table fin_influx_extension;
drop table fin_influx_inst;
drop table fin_settle_serial_map;
drop table fin_influx_terminal;
drop table fin_info_transaction;
drop table fin_influx_terminal_unique;
drop table fin_request_no_unique;
drop table fin_settle_serial_unique;
drop table fin_influx_transaction;
drop table idx1_fin_influx_transaction;
drop table fin_influx_payer;
drop table idx1_fin_influx_payer;
drop table idx2_fin_influx_payer;

View File

@ -0,0 +1,214 @@
drop table if exists t1,t2;
create table t1 (pk int primary key, grp int, a int, c char(10) not null);
insert into t1 values (1, 1,1,'a');
insert into t1 values (2, 2,2,'b');
insert into t1 values (3, 2,3,'c');
insert into t1 values (4, 3,4,'E');
insert into t1 values (5, 3,5,'C');
insert into t1 values (6, 3,6,'D');
select a,c,sum(a) from t1 group by a order by a;
a c sum(a)
1 a 1
2 b 2
3 c 3
4 E 4
5 C 5
6 D 6
select a,c,sum(a) from t1 where a > 10 group by a order by a;
a c sum(a)
select sum(a) from t1 where a > 10;
sum(a)
NULL
select count(distinct a),count(distinct grp) from t1;
count(distinct a) count(distinct grp)
6 3
insert into t1 values (7, null,null,'');
select count(distinct a),count(distinct grp) from t1;
count(distinct a) count(distinct grp)
6 3
create table t2 (pk int primary key, grp int, a int, c char(10));
select grp,max(a)+max(grp),max(c) from t1 group by grp order by grp;
grp max(a)+max(grp) max(c)
NULL NULL
1 2 a
2 5 c
3 9 E
select * from t2;
pk grp a c
drop table t1,t2;
drop table if exists t1;
CREATE TABLE t1 (id int ,value1 decimal(10,2),c int primary key);
INSERT INTO t1 VALUES (1,0.00,1),(1,1.00,2), (1,2.00,3), (2,10.00,4), (2,11.00,5), (2,12.00,6);
CREATE TABLE t2 (id int primary key,name char(20));
INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two');
select id, avg(value1) from t1 group by id;
id avg(value1)
1 1.000000
2 11.000000
select name, avg(value1) from t1, t2 where t1.id = t2.id group by t1.id;
name avg(value1)
Set One 1.000000
Set Two 11.000000
drop table t1,t2;
create table t1 (pk int primary key, id int not null);
create table t2 (pk int primary key, id int not null,rating int null);
insert into t1 values(1,1),(2,2),(3,3);
insert into t2 values(1, 1, 3),(2, 2, NULL),(3, 2, NULL),(4, 3, 2),(5, 3, NULL);
select t1.id, avg(rating) from t1 left join t2 on ( t1.id = t2.id ) group by t1.id order by t1.id;
id avg(rating)
1 3.0000
2 NULL
3 2.0000
drop table t1,t2;
create table t1 (a int primary key, c char(10), b char(128));
INSERT INTO t1 VALUES (1,'1','1');
INSERT INTO t1 VALUES (2,'2','2');
INSERT INTO t1 VALUES (4,'4','4');
select count(*) from t1;
count(*)
3
select count(*) from t1 where a = 1;
count(*)
1
select count(*) from t1 where a = 100;
count(*)
0
select count(*) from t1 where a >= 10;
count(*)
0
select count(a) from t1 where a = 1;
count(a)
1
select count(a) from t1 where a = 100;
count(a)
0
select count(a) from t1 where a >= 10;
count(a)
0
select count(b) from t1 where b >= 2;
count(b)
2
select count(b) from t1 where b >= 10;
count(b)
0
select count(c) from t1 where c = 10;
count(c)
0
drop table t1;
CREATE TABLE t1 (d datetime default now(), i int primary key);
INSERT INTO t1(i) VALUES (1);
SELECT COUNT(i), i, COUNT(i)*i FROM t1 GROUP BY i;
COUNT(i) i COUNT(i)*i
1 1 1
SELECT COUNT(i), (i+0), COUNT(i)*(i+0) FROM t1 GROUP BY i;
COUNT(i) (i+0) COUNT(i)*(i+0)
1 1 1
DROP TABLE t1;
create table t1 (
pk int primary key,
num float,
my_user char(20)
);
insert into t1 values (1, 10.3,'nem'),(2, 20.53,'monty'),(3, 30.23,'sinisa');
insert into t1 values (4, 30.13,'nem'),(5, 20.98,'monty'),(6, 10.45,'sinisa');
insert into t1 values (7, 5.2,'nem'),(8, 8.64,'monty'),(9, 11.12,'sinisa');
select sum(num) from t1;
sum(num)
147.57999897003174
select sum(num) from t1 group by my_user order by my_user;
sum(num)
50.15000057220459
45.6299991607666
51.79999923706055
drop table t1;
drop table if exists t1,t2,t3;
create table t1 (pk int primary key, a1 int, a2 char(3));
insert into t1 values(1, 10,'aaa'), (2, 10,null), (3, 10,'bbb'), (4, 20,'zzz');
create table t2(pk int primary key, a1 char(3), a2 int, a3 float);
create table t3(pk int primary key, a1 char(3), a2 int, a3 float);
select * from t1;
pk a1 a2
1 10 aaa
2 10 NULL
3 10 bbb
4 20 zzz
select min(a2) from t1;
min(a2)
aaa
select max(t1.a1), max(t2.a2) from t1, t2;
max(t1.a1) max(t2.a2)
NULL NULL
insert into t2 values(1, 'AAA', 10, 0.5);
insert into t2 values(2, 'BBB', 20, 1.0);
select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t3 on t1.a1=10;
ERROR 42S22: Unknown column 't2.a1' in 'field list'
select max(t1.a2) from t1 left outer join t2 on t1.a1=10;
max(t1.a2)
zzz
select max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and 1=0 where t2.a1='AAA';
max(t2.a1)
NULL
explain select max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and 1=0 where t2.a1='AAA';
select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 where t2.a1='AAA';
max(t2.a1)
AAA
explain select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 where t2.a1='AAA';
select max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk where t2.a1='AAA' and 1=0;
max(t2.a1)
NULL
explain select max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk where t2.a1='AAA' and 1=0;
select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and t1.a1=10;
max(t1.a2) max(t2.a1)
zzz BBB
explain select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and t1.a1=10;
select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and t1.pk=10;
max(t1.a2) max(t2.a1)
zzz NULL
explain select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.pk=t2.pk and t1.pk=10;
select * from t1 left join t2 on t1.pk=t2.pk where t2.a2 > 1 and t2.a2 < 10;
pk a1 a2 pk a1 a2 a3
explain select * from t1 left join t2 on t1.pk=t2.pk where t2.a2 > 1 and t2.a2 < 10;
select * from t1 left join t2 on t1.pk=t2.pk and t2.a2 > 1 and t2.a2 < 10 order by t1.pk;
pk a1 a2 pk a1 a2 a3
1 10 aaa NULL NULL NULL NULL
2 10 NULL NULL NULL NULL NULL
3 10 bbb NULL NULL NULL NULL
4 20 zzz NULL NULL NULL NULL
explain select * from t1 left join t2 on t1.pk=t2.pk and t2.a2 > 1 and t2.a2 < 10;
drop table t1,t2;
CREATE TABLE t1 (pk int primary key, a int, b int);
select count(b), sum(b), avg(b), min(b), max(b) from t1;
count(b) sum(b) avg(b) min(b) max(b)
0 NULL NULL NULL NULL
select a,count(b), sum(b), avg(b), min(b), max(b) from t1 group by a order by a;
a count(b) sum(b) avg(b) min(b) max(b)
insert into t1 values (1, 1,null);
select a,count(b), sum(b), avg(b), min(b), max(b) from t1 group by a order by a;
a count(b) sum(b) avg(b) min(b) max(b)
1 0 NULL NULL NULL NULL
insert into t1 values (2, 1,null);
insert into t1 values (3, 2,null);
select a,count(b), sum(b), avg(b), min(b), max(b) from t1 group by a order by a;
a count(b) sum(b) avg(b) min(b) max(b)
1 0 NULL NULL NULL NULL
2 0 NULL NULL NULL NULL
insert into t1 values (4, 2,1);
select a,count(b), sum(b), avg(b), min(b), max(b) from t1 group by a order by a;
a count(b) sum(b) avg(b) min(b) max(b)
1 0 NULL NULL NULL NULL
2 1 1 1.0000 1 1
insert into t1 values (5, 3,1);
select a,count(b), sum(b), avg(b), min(b), max(b) from t1 group by a order by a;
a count(b) sum(b) avg(b) min(b) max(b)
1 0 NULL NULL NULL NULL
2 1 1 1.0000 1 1
3 1 1 1.0000 1 1
drop table t1;
create table t1 (col int primary key,col2 int);
insert into t1(col) values (-1), (-2), (-3);
drop table t1;
create table t1 (a int primary key,b int);
select avg(2) from t1;
avg(2)
NULL
drop table t1;

View File

@ -0,0 +1,26 @@
drop table if exists t1,t2;
CREATE TABLE t1 (pk int primary key,col1 double , col2 double);
INSERT INTO t1(pk,col1) VALUES (1,-5.00000000001),(2,-5.00000000002),(3,-5.00000000003),(4,-5.00000000000);
select col1,count(col1),sum(col1),avg(col1) from t1 group by col1 order by col1;
col1 count(col1) sum(col1) avg(col1)
-5.00000000003 1 -5.00000000003 -5.00000000003
-5.00000000002 1 -5.00000000002 -5.00000000002
-5.00000000001 1 -5.00000000001 -5.00000000001
-5 1 -5 -5
DROP TABLE t1;
create table t1 (pk int primary key,col1 double , col2 double);
insert into t1(pk,col1) values (1,-5.00000000001);
insert into t1(pk,col1) values (2,-5.00000000002);
select col1,sum(col1),max(col1),min(col1) from t1 group by col1 order by col1;
col1 sum(col1) max(col1) min(col1)
-5.00000000002 -5.00000000002 -5.00000000002 -5.00000000002
-5.00000000001 -5.00000000001 -5.00000000001 -5.00000000001
insert into t1(pk,col1) values (3,5.00000000003);
insert into t1(pk,col1) values (4,5.00000000004);
select col1,sum(col1),max(col1),min(col1) from t1 group by col1 order by col1;
col1 sum(col1) max(col1) min(col1)
-5.00000000002 -5.00000000002 -5.00000000002 -5.00000000002
-5.00000000001 -5.00000000001 -5.00000000001 -5.00000000001
5.00000000003 5.00000000003 5.00000000003 5.00000000003
5.00000000004 5.00000000004 5.00000000004 5.00000000004
DROP TABLE t1;

View File

@ -0,0 +1,67 @@
drop table if exists t1,t2;
CREATE TABLE t1 (pk int primary key, a VARCHAR(400));
INSERT INTO t1 VALUES (1,'A'), (2,'a'), (3,'a '), (4,'a '),
(5,'B'), (6,'b'), (7,'b '), (8,'b ');
SELECT COUNT(DISTINCT a) FROM t1;
COUNT(DISTINCT a)
2
DROP TABLE t1;
CREATE TABLE t1 (pk int primary key, a int, b int, c int);
INSERT INTO t1 (pk, a, b, c) VALUES
(1,1,1,1), (2,1,1,2), (3,1,1,3),
(4,1,2,1), (5,1,2,2), (6,1,2,3),
(7,1,3,1), (8,1,3,2), (9,1,3,3),
(10,2,1,1), (11,2,1,2), (12,2,1,3),
(13,2,2,1), (14,2,2,2), (15,2,2,3),
(16,2,3,1), (17,2,3,2), (18,2,3,3),
(19,3,1,1), (20,3,1,2), (21,3,1,3),
(22,3,2,1), (23,3,2,2), (24,3,2,3),
(25,3,3,1), (26,3,3,2), (27,3,3,3);
SELECT b/c as v, a FROM t1 ORDER BY v, a;
v a
0.3333 1
0.3333 2
0.3333 3
0.5000 1
0.5000 2
0.5000 3
0.6667 1
0.6667 2
0.6667 3
1.0000 1
1.0000 1
1.0000 1
1.0000 2
1.0000 2
1.0000 2
1.0000 3
1.0000 3
1.0000 3
1.5000 1
1.5000 2
1.5000 3
2.0000 1
2.0000 2
2.0000 3
3.0000 1
3.0000 2
3.0000 3
SELECT b/c as v, SUM(a) FROM t1 GROUP BY v ORDER BY v;
v SUM(a)
0.3333 6
0.5000 6
0.6667 6
1.0000 18
1.5000 6
2.0000 6
3.0000 6
SELECT SUM(a) as suma FROM t1 GROUP BY b/c ORDER BY suma;
suma
6
6
6
6
6
6
18
DROP TABLE t1;

View File

@ -0,0 +1,142 @@
drop table if exists t1,t2,t3,t4,t5;
create table t1 (pk int primary key,a double ,b double);
insert into t1(pk,a) values (1,12345678901234567890);
select count(a) from t1;
count(a)
1
select count(distinct a) from t1;
count(distinct a)
1
drop table t1;
CREATE TABLE t1 (a INT, b INT primary key);
INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
SELECT a,COUNT(DISTINCT b) AS cnt FROM t1 GROUP BY a HAVING cnt > 50;
a cnt
SELECT a,SUM(DISTINCT b) AS sumation FROM t1 GROUP BY a HAVING sumation > 50;
a sumation
SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
a average
DROP TABLE t1;
CREATE TABLE t1 ( a INT, b INT primary key);
INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
SELECT MIN(a), MIN(b) FROM t1;
MIN(a) MIN(b)
NULL 1
CREATE TABLE t2( pk int primary key, a INT, b INT, c INT);
INSERT INTO t2 ( pk,a, b, c ) VALUES ( 1,1, NULL, 2 ), ( 2,1, 3, 4 ), ( 3,1, 4, 4 );
EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
MIN(b) MIN(c)
3 2
CREATE TABLE t3 (pk int primary key , a INT, b INT, c int);
INSERT INTO t3 VALUES (1,1, NULL, 1), (2,2, NULL, 2), (3,3, NULL, 3);
EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
SELECT MIN(a), MIN(b) FROM t3 where a = 2;
MIN(a) MIN(b)
2 NULL
CREATE TABLE t4 (a INT, b INT, c int, primary KEY(a, c));
INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (3, 1, 3);
EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
SELECT MIN(a), MIN(b) FROM t4 where a = 2;
MIN(a) MIN(b)
2 NULL
SELECT MIN(b), min(c) FROM t4 where a = 2;
MIN(b) min(c)
NULL 2
CREATE TABLE t5( a INT, b INT, primary KEY( a, b),c int);
INSERT INTO t5(a,b) VALUES( 1, 1 ), ( 1, 2 );
EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
MIN(a) MIN(b)
1 1
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
MIN(a) MIN(b)
1 2
DROP TABLE t1, t2, t3, t4, t5;
CREATE TABLE t1 (a int, b datetime(6), primary key (a,b),c int);
SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
MIN(b)
NULL
DROP TABLE t1;
CREATE TABLE t1 (a INT primary key, b int);
INSERT INTO t1(a) VALUES (1),(2),(3),(4);
SELECT a FROM t1 HAVING COUNT(*)>2;
a
1
SELECT COUNT(*), a FROM t1;
COUNT(*) a
4 1
SELECT a FROM t1 HAVING COUNT(*)>2;
a
1
SELECT COUNT(*), a FROM t1;
COUNT(*) a
4 1
DROP TABLE t1;
CREATE TABLE t1(pk int primary key,a DOUBLE );
INSERT INTO t1 VALUES (1,10), (2,20);
SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
AVG(a) CAST(AVG(a) AS DECIMAL)
15 15
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT primary key);
INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
SELECT COUNT(*) FROM t1;
COUNT(*)
3
SELECT COUNT(*) FROM t1 where a=1;
COUNT(*)
3
SELECT COUNT(*),a FROM t1;
COUNT(*) a
3 1
SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
COUNT(*)
9
DROP TABLE t1;
CREATE TABLE t1 (
pk INT NOT NULL,
i INT,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,11),(2,12),(3,13);
SELECT MAX(pk) as max, i
FROM t1
ORDER BY max;
max i
3 11
SELECT MAX(pk) as max, i
FROM t1
WHERE pk<2
ORDER BY max;
max i
1 11
DROP TABLE t1;
CREATE TABLE t1(a int, primary KEY(a), b int);
INSERT INTO t1(a) VALUES (1), (2);
SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a);
1
1
DROP TABLE t1;
CREATE TABLE t1 (pk int primary key,col_int_nokey int);
INSERT INTO t1 VALUES (1,7),(2,8),(3,NULL);
SELECT AVG(DISTINCT col_int_nokey) FROM t1;
AVG(DISTINCT col_int_nokey)
7.5000
SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON
outr.col_int_nokey = outr2.col_int_nokey;
AVG(DISTINCT outr.col_int_nokey)
7.5000
DROP TABLE t1;
create table t1 (pk int primary key, b int);
insert into t1 values (1, NULL), (2, 2), (3, 4);
select * from t1;
pk b
1 NULL
2 2
3 4
select count(b), min(b), max(b), sum(b), avg(b) from t1;
count(b) min(b) max(b) sum(b) avg(b)
2 2 4 6 3.0000
drop table t1;

View File

@ -0,0 +1,22 @@
drop table if exists t2;
create table t2 (i int primary key, j int);
insert into t2 values (1,1),(2,2),(5,null),(4,4),(3,3);
select * from t2 where (i) in ((1),(null)) and i = 2;
i j
select * from t2 where (i) in ((1),(null)) and i = 1;
i j
1 1
select * from t2 where (i) in ((1),(null));
i j
1 1
select * from t2 where (i) in ((1),(null)) and i = 1 and i = 2;
i j
update t2 set j=i+1 where i=2;
select * from t2;
i j
1 1
2 3
3 3
4 4
5 NULL
drop table t2;

View File

@ -0,0 +1,7 @@
drop table if exists t1,t2,left_table;
create table t1(c0 int primary key, c1 int , c2 int);
insert into t1 values(1,10,100);
select c1+10 c3, c2 from t1 where c0=1;
c3 c2
20 100
drop table t1;

View File

@ -0,0 +1,61 @@
drop table if exists aaaaaaaaaa222222222233333333334444444444555555555566666666661234;
create table aaaaaaaaaa222222222233333333334444444444555555555566666666661234 (xxxxxxxxxx222222222233333333334444444444555555555566666666661234 int primary key);
drop table if exists aaaaaaaaaa222222222233333333334444444444555555555566666666661234;
create table if not exists bbbbbbbbbb222222222233333333334444444444555555555566666666661234 (yyyyyyyyyy2222222222333333333344444444445555555555666666666612345 int primary key);
create table cccccccccc2222222222333333333344444444445555555555666666666612345 (zzzzzzzzzz222222222233333333334444444444555555555566666666661234 int primary key);
ERROR 42000: Identifier name 'cccccccccc2222222222333333333344444444445555555555666666666612345' is too long
create table dddddddddd2222222222333333333344444444445555555555666666666612345 (ssssssssss2222222222333333333344444444445555555555666666666612345 int primary key);
ERROR 42000: Identifier name 'dddddddddd2222222222333333333344444444445555555555666666666612345' is too long
drop table if exists alter_table1;
create table alter_table1 (cc1 int primary key);
ALTER TABLE alter_table1 CHANGE cc1 `hhhhhhhhhh222222222233333333334444444444555555555566666666661234` INT;
drop table if exists alter_table1;
drop table if exists alter_table2;
create table alter_table2 (cc2 int primary key);
ALTER TABLE alter_table2 CHANGE cc2 `gggggggggg2222222222333333333344444444445555555555666666666612345` INT;
drop table if exists alter_table2;
drop database if exists vffvvvvvvv222222222233333333334444444444555555555566666666661234;
create database vffvvvvvvv222222222233333333334444444444555555555566666666661234;
drop database if exists vffvvvvvvv222222222233333333334444444444555555555566666666661234;
create database if not exists vvvvvvvvvv2222222222333333333344444444445555555555666666666612345;
drop database if exists vvvvvvvvvv2222222222333333333344444444445555555555666666666612345;
create database vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193;
ERROR 42000: Identifier name 'vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193' is too long
use vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193;
ERROR 42000: Identifier name 'vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193' is too long
drop database vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193;
ERROR 42000: Identifier name 'vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193' is too long
create database `adc `;
ERROR 42000: Incorrect database name 'adc '
drop database `adc `;
ERROR 42000: Incorrect database name 'adc '
use `adc `;
ERROR 42000: Incorrect database name 'adc '
create database if not exists vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65;
drop database vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65;
use vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65;
ERROR 42000: Unknown database 'vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65'
create database `#mysql50#~`;
ERROR 42000: Incorrect database name '#mysql50#~'
drop database `#mysql50#~`;
ERROR 42000: Incorrect database name '#mysql50#~'
use `#mysql50#~`;
ERROR 42000: Incorrect database name '#mysql50#~'
create database `#mysql50#.`;
ERROR 42000: Incorrect database name '#mysql50#.'
drop database `#mysql50#.`;
ERROR 42000: Incorrect database name '#mysql50#.'
use `#mysql50#.`;
ERROR 42000: Incorrect database name '#mysql50#.'
create database `#mysql50#\\`;
ERROR 42000: Incorrect database name '#mysql50#\\'
drop database `#mysql50#\\`;
ERROR 42000: Incorrect database name '#mysql50#\\'
use `#mysql50#\\`;
ERROR 42000: Incorrect database name '#mysql50#\\'
create database `#mysql50#/`;
ERROR 42000: Incorrect database name '#mysql50#/'
drop database `#mysql50#/`;
ERROR 42000: Incorrect database name '#mysql50#/'
use `#mysql50#/`;
ERROR 42000: Incorrect database name '#mysql50#/'

View File

@ -0,0 +1,99 @@
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
drop table if exists tbl1;
create table tbl1 (pk int,i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6),i5 decimal(5,3),i6 bool, gmt_create datetime default now(), gmt_modify datetime default now(),primary key(pk));
insert into tbl1(pk,i1,v2,i3,i4,d4,i5,i6) values(1,1,'abc12','1agc',1.25,'2014-01-01 12:00:00',23.23,1),
(2,10,'23abc12','4agc1',-0.25,'2015-11-01 12:00:00',-23.230,0),
(3,201,'xx23abc12','cagc1',-2.25,'2015-11-21 11:20:10',3.231,1),
(4,80,'zx23abc12','zcagc1',2.25,'2013-01-21 11:20:10',-3.231,1),
(5,53,'cx23abc12','rcagc1',109.25,'2016-01-22 11:20:10',-13.131,0),
(6,78,'tx23abc12','icagc1',-109.25,'2014-09-16 16:24:00',-13.131,1),
(7,400,'yx23abc12','ocagc1',85.85,'2014-09-17 16:20:21',-93.131,0),
(8,50,'vx23abc12','wcagc1',-85.85,'2014-09-10 16:20:21',93.131,1),
(9,610,'ukx23abc12','pecagc1',-1.85,'2014-09-19 16:20:21',99.131,0),
(10,42,'kx23abc12','ecagc1',-85.85,'2014-09-18 16:20:21',-99.131,1),
(11,null,null,null,null,null,null,null);
create index idx_1 on tbl1(i6);
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -6 YEAR) and gmt_create>=date_sub(current_timestamp(), INTERVAL 6 YEAR) ;
pk i1 i6
1 1 1
2 10 0
3 201 1
4 80 1
5 53 0
6 78 1
7 400 0
8 50 1
9 610 0
10 42 1
11 NULL NULL
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -6 YEAR) and gmt_create>=date_sub(current_timestamp(), INTERVAL 6 YEAR) and i6 in ('0','1');
pk i1 i6
2 10 0
5 53 0
7 400 0
9 610 0
1 1 1
3 201 1
4 80 1
6 78 1
8 50 1
10 42 1
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -6 YEAR) and gmt_create>=date_sub(current_timestamp(), INTERVAL 6 YEAR) and i6 in ('1','0');
pk i1 i6
2 10 0
5 53 0
7 400 0
9 610 0
1 1 1
3 201 1
4 80 1
6 78 1
8 50 1
10 42 1
select pk,i1,i6 from tbl1 where i6=true;
pk i1 i6
1 1 1
3 201 1
4 80 1
6 78 1
8 50 1
10 42 1
select pk,i1,i6 from tbl1 where i6=false;
pk i1 i6
2 10 0
5 53 0
7 400 0
9 610 0
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -16 minute) and gmt_create>=date_sub(current_timestamp(), INTERVAL 16 minute) and pk<=11;
pk i1 i6
1 1 1
2 10 0
3 201 1
4 80 1
5 53 0
6 78 1
7 400 0
8 50 1
9 610 0
10 42 1
11 NULL NULL
update tbl1 set i1=i1*2/2 where gmt_create<=date_sub(current_timestamp(), INTERVAL -16 minute) and gmt_create>=date_sub(current_timestamp(), INTERVAL 16 minute) and pk<=11;
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -16 minute) and gmt_create>=date_sub(current_timestamp(), INTERVAL 16 minute) and pk<=11;
pk i1 i6
1 1 1
2 10 0
3 201 1
4 80 1
5 53 0
6 78 1
7 400 0
8 50 1
9 610 0
10 42 1
11 NULL NULL
delete from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -16 minute) and gmt_create>=date_sub(current_timestamp(), INTERVAL 16 minute) and pk<=11;
select pk,i1,i6 from tbl1 where gmt_create<=date_sub(current_timestamp(), INTERVAL -16 minute) and gmt_create>=date_sub(current_timestamp(), INTERVAL 16 minute) and pk<=11;
pk i1 i6

View File

@ -0,0 +1,24 @@
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
drop table if exists tbl1;
create table tbl1 (pk int,i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6),i5 decimal(5,3),i6 bool, primary key(pk));
insert into tbl1 values(1,1,'abc12','1agc',1.25,'2014-01-01 12:00:00',23.23,1),
(2,10,'23abc12','4agc1',-0.25,'2015-11-01 12:00:00',-23.230,0),
(3,201,'xx23abc12','cagc1',-2.25,'2015-11-21 11:20:10',3.231,1),
(4,80,'zx23abc12','zcagc1',2.25,'2013-01-21 11:20:10',-3.231,1),
(5,53,'cx23abc12','rcagc1',109.25,'2016-01-22 11:20:10',-13.131,0),
(6,78,'tx23abc12','icagc1',-109.25,'2014-09-16 16:24:00',-13.531,1),
(7,400,'yx23abc12','ocagc1',85.85,'2014-09-17 16:20:21',-93.131,0),
(8,50,'vx23abc12','wcagc1',-85.85,'2014-09-10 16:20:21',93.131,1),
(9,610,'ukx23abc12','pecagc1',-1.85,'2014-09-19 16:20:21',99.131,0),
(10,610,'kx23abc12','ecagc1',-85.86,'2014-09-18 16:20:21',-99.131,1),
(11,null,null,null,null,null,null,null);
create unique index idx_1 on tbl1(i1);
ERROR 23000: Duplicate entry '610' for key 'idx_1'
create unique index idx_2 on tbl1(v2);
create unique index idx_3 on tbl1(i3);
create unique index idx_5 on tbl1(d4);
create unique index idx_7 on tbl1(i1,v2,i3,d4,i6);
drop table tbl1;

View File

@ -0,0 +1,46 @@
create table t1 (c1 int, c2 int, c3 int, c4 int, primary key(c1));
create index i1 on t1 (c2);
create index i2 on t1 (c3, c4);
create index i3 on t1 (c3) storing(c4);
replace into t1 values (1,1,2,1),(2,2,1,null),(3,3,null,null),(4,null,null,null);
select * from t1;
c1 c2 c3 c4
1 1 2 1
2 2 1 NULL
3 3 NULL NULL
4 NULL NULL NULL
select /*+ index(t1 i2) */ * from t1 where c3=1;
c1 c2 c3 c4
2 2 1 NULL
select * from t1 where c3=1;
c1 c2 c3 c4
2 2 1 NULL
select /*+ index(a1 i2) */ * from t1 as a1 where c3 in(1,2);
c1 c2 c3 c4
2 2 1 NULL
1 1 2 1
select * from t1 as a1 where a1.c3 in (1,2);
c1 c2 c3 c4
2 2 1 NULL
1 1 2 1
select /*+ index(t1 primary) */ * from t1 where c3 in(1,2);
c1 c2 c3 c4
1 1 2 1
2 2 1 NULL
select * from t1 where c3 is null;
c1 c2 c3 c4
3 3 NULL NULL
4 NULL NULL NULL
select /*+ index(t1 i2) */ * from t1 where c3 is null;
c1 c2 c3 c4
3 3 NULL NULL
4 NULL NULL NULL
select /*+ index(t1 primary) */ * from t1 where c3 is null;
c1 c2 c3 c4
3 3 NULL NULL
4 NULL NULL NULL
select /*+ index(t1 i4) */ * from t1 where c3 is null;
c1 c2 c3 c4
3 3 NULL NULL
4 NULL NULL NULL
drop table t1;

View File

@ -0,0 +1,73 @@
drop table if exists t1;
CREATE TABLE t1
(
pk1 INT primary key,
key1 INT,
key2 VARCHAR(20),
key3 VARCHAR(20)
);
insert into t1 values(1,12,'a','a1'),(2,11,'a','b1'),(3,10,'b','b1'),(4,9,'c','c1'),
(5,8,NULL,'d1'),(6,7,NULL,'b1'),(7,6,NULL,'b1'),
(8,5,'a',NULL),(9,4,'a',NULL),(10,3,NULL,NULL),
(11,2,'',NULL),(12,1,NULL,'');
create index i1 on t1(key2,key3);
select * from t1 where key2='a' and key3=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2='a' and key3=NULL;
pk1
select * from t1 where key2='a' and key3>NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2='a' and key3>NULL;
pk1
select * from t1 where key2='a' and key3<NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2='a' and key3<NULL;
pk1
select * from t1 where key2='a' and key3>=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2='a' and key3>=NULL;
pk1
select * from t1 where key2='a' and key3<=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2='a' and key3<=NULL;
pk1
select * from t1 where key2=NULL and key3='b1';
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3='b1';
pk1
select * from t1 where key2>NULL and key3='b1';
pk1 key1 key2 key3
select pk1 from t1 where key2>NULL and key3='b1';
pk1
select * from t1 where key2<NULL and key3='b1';
pk1 key1 key2 key3
select pk1 from t1 where key2<NULL and key3='b1';
pk1
select * from t1 where key2>=NULL and key3='b1';
pk1 key1 key2 key3
select pk1 from t1 where key2>=NULL and key3='b1';
pk1
select * from t1 where key2<=NULL and key3='b1';
pk1 key1 key2 key3
select pk1 from t1 where key2<=NULL and key3='b1';
pk1
select * from t1 where key2=NULL and key3=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3=NULL;
pk1
select * from t1 where key2=NULL and key3<NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3<NULL;
pk1
select * from t1 where key2=NULL and key3>NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3>NULL;
pk1
select * from t1 where key2=NULL and key3<=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3<=NULL;
pk1
select * from t1 where key2=NULL and key3>=NULL;
pk1 key1 key2 key3
select pk1 from t1 where key2=NULL and key3>=NULL;
pk1

View File

@ -0,0 +1,28 @@
create table t1 (c1 int primary key, c2 int, c3 int, c4 int);
create index i1 on t1(c2);
insert into t1 values(10, 1, 1, 1), (9, 2, 2, 2), (8, 3, 3, 3), (7, 4, 4, 4);
select * from t1 where c2 > 0 and c2 < 5;
c1 c2 c3 c4
10 1 1 1
9 2 2 2
8 3 3 3
7 4 4 4
select * from t1 b where b.c2 > 0 and b.c2 < 5;
c1 c2 c3 c4
10 1 1 1
9 2 2 2
8 3 3 3
7 4 4 4
select /*+index(t1 i1) */ * from t1 b where b.c2 > 0 and b.c2 < 5;
c1 c2 c3 c4
10 1 1 1
9 2 2 2
8 3 3 3
7 4 4 4
select /*+index(b i1) */ * from t1 b where b.c2 > 0 and b.c2 < 5;
c1 c2 c3 c4
10 1 1 1
9 2 2 2
8 3 3 3
7 4 4 4
drop table t1;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,247 @@
drop table if exists t1,t2,t3,t4,t8;
create table t1(c1 int primary key, c2 int);
create table t2(c1 int primary key, c2 int);
create table t3(c1 int, c2 int primary key);
create table t4(c1 int primary key, c2 int);
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
insert into t2 values(0,0),(2,2),(4,4),(6,6);
insert into t3 values(1,1),(3,3),(5,5),(7,7);
insert into t4 values(1,0),(2,0),(3,1),(4,1);
(select * from t1 where false ) intersect (select * from t2 where false);
c1 c2
(select * from t1 where false ) intersect all (select * from t2 where false);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 where false)' at line 1
(select * from t1 where false ) intersect select * from t2;
c1 c2
(select * from t1 where false ) intersect all select * from t2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select * from t2' at line 1
select * from t1 intersect (select * from t2 where false);
c1 c2
select * from t1 intersect all (select * from t2 where false);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 where false)' at line 1
(select * from t1 where false) intersect (select * from t2 where false) intersect (select * from t3 where false);
c1 c2
(select * from t1 where false) intersect all (select * from t2 where false) intersect (select * from t3 where false);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 where false) intersect (select * from t3 where false)' at line 1
select c1 from t1 intersect select c1 from t1;
c1
1
2
3
4
5
select c1 from t1 intersect all select c1 from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c1 from t1' at line 1
select c1 from t1 intersect select c1 from t4;
c1
1
2
3
4
select c1 from t1 intersect all select c1 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c1 from t4' at line 1
select c1 from t4 intersect select c1 from t1;
c1
1
2
3
4
select c1 from t4 intersect all select c1 from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c1 from t1' at line 1
select c1 from t2 intersect select c1 from t3;
c1
select c1 from t2 intersect all select c1 from t3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c1 from t3' at line 1
select c1 from t1 intersect select c1 from t2;
c1
2
4
select c1 from t1 intersect all select c1 from t2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c1 from t2' at line 1
select c2 from t4 intersect select c2 from t1;
c2
1
select c2 from t4 intersect all select c2 from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t1' at line 1
select c2 from t1 intersect select c2 from t4;
c2
1
select c2 from t1 intersect all select c2 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t4' at line 1
select * from t1 intersect (select * from t2 union select * from t3) ;
c1 c2
1 1
2 2
3 3
4 4
5 5
select * from t1 intersect all (select * from t2 union select * from t3) ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 union select * from t3)' at line 1
(select * from t1 intersect select * from t2) union (select * from t1 intersect select * from t3);
c1 c2
1 1
2 2
3 3
4 4
5 5
select * from t1 intersect all (select * from t2 union select * from t3) ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select * from t2 union select * from t3)' at line 1
select c2 from t1 intersect select c2 from t3 intersect select c2 from t4;
c2
1
select c2 from t1 intersect all select c2 from t3 intersect select c2 from t4;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t3 intersect select c2 from t4' at line 1
select c2 from t1 intersect (select c2 from t3 intersect select c2 from t4);
c2
1
select c2 from t1 intersect all (select c2 from t3 intersect select c2 from t4);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all (select c2 from t3 intersect select c2 from t4)' at line 1
drop table if exists t5,t6;
create table t5(c1 int primary key, c2 int);
create table t6(c1 int primary key, c2 int);
insert into t5 values(1,1),(2,2),(3,3),(4,4),(5,5),(6,2),(7,3),(8,6),(9,6),(10,4),(11,2);
insert into t6 values(0,0),(2,2),(4,4),(6,6),(1,2),(3,4),(5,6);
select c2 from t5 intersect select c2 from t6;
c2
2
4
6
select c2 from t5 intersect all select c2 from t6;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'all select c2 from t6' at line 1
select c2 from t5 intersect select c1,c2 from t6;
ERROR 21000: The used SELECT statements have a different number of columns
create table t8 (c1 BINARY(99) ,c2 INTEGER(127) ,c3 VARBINARY(71) ,c4 BINARY(65) ,c5 BIGINT(127) ,c6 INTEGER(127) ,c7 INT(127) ,c8 INTEGER(127) ,c9 NUMERIC(64,25) ,c10 VARBINARY(55) ,c11 BIGINT(127) ,c12 VARCHAR(86) ,c13 INTEGER(127) ,c14 INT(127) ,c15 INTEGER(127) ,c16 DECIMAL(64,15) ,c17 INTEGER(127) ,c18 VARBINARY(76) ,c19 INTEGER(127) , primary key(c7,c6), index i_OkcN(c19) global, index i_ahayugXY(c10,c18) global, index i_iA(c16,c2) global) DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin PARTITION BY KEY(c7) PARTITIONS 20;
insert into t8 values('cdxLVdvvJjcoHFBECqXKkRGoMXYgNsTpJRrqYaluQdfEeB00000',0,'RetSgyIigYXIPgBXBsmZHQZQPLWcGoELCf00000','wD00000',0,0,0,0,0.0000000000000000000000000,'ieLhJAFmNCq00000',0,'DcKPncNvJjyYcNJKFmVUVhqvgUlLfINbycifYNHjzqALoLfn00000',0,0,0,0.000000000000000,0,'MojimRsQZuotWXMuvSQVDSdCmOaloSXNLRTxMYYXaxGbtuk00000',0);
explain (select /*+USE_HASH_AGGREGATION*/ c15 from (select c15 from t8) except (select c15 from t8) order by 1 limit 1000) union all (select t8_alias1.c10 from t8 t8_alias1 limit 1);
Query Plan
================================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------------------------
|0 |UNION ALL | |2 |88 |
|1 |├─TOP-N SORT | |1 |86 |
|2 |│ └─HASH EXCEPT DISTINCT | |1 |86 |
|3 |│ ├─PX COORDINATOR | |1 |43 |
|4 |│ │ └─EXCHANGE OUT DISTR |:EX10000 |1 |43 |
|5 |│ │ └─PX PARTITION ITERATOR| |1 |43 |
|6 |│ │ └─TABLE FULL SCAN |t8 |1 |43 |
|7 |│ └─PX COORDINATOR | |1 |43 |
|8 |│ └─EXCHANGE OUT DISTR |:EX20000 |1 |43 |
|9 |│ └─PX PARTITION ITERATOR| |1 |43 |
|10|│ └─TABLE FULL SCAN |t8 |1 |43 |
|11|└─DISTRIBUTED TABLE FULL SCAN |t8_alias1(i_ahayugXY)|1 |3 |
================================================================================
Outputs & filters:
-------------------------------------
0 - output([UNION([1])]), filter(nil), rowset=16
1 - output([cast(EXCEPT([1]), VARCHAR(127))]), filter(nil), rowset=16
sort_keys([EXCEPT([1]), ASC]), topn(1000)
2 - output([EXCEPT([1])], [cast(EXCEPT([1]), VARCHAR(127))]), filter(nil), rowset=16
3 - output([t8.c15]), filter(nil), rowset=16
4 - output([t8.c15]), filter(nil), rowset=16
dop=1
5 - output([t8.c15]), filter(nil), rowset=16
force partition granule
6 - output([t8.c15]), filter(nil), rowset=16
access([t8.c15]), partitions(p[0-19])
is_index_back=false, is_global_index=false,
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
7 - output([t8.c15]), filter(nil), rowset=16
8 - output([t8.c15]), filter(nil), rowset=16
dop=1
9 - output([t8.c15]), filter(nil), rowset=16
force partition granule
10 - output([t8.c15]), filter(nil), rowset=16
access([t8.c15]), partitions(p[0-19])
is_index_back=false, is_global_index=false,
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
11 - output([t8_alias1.c10]), filter(nil), rowset=16
access([t8_alias1.c10]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=true,
range_key([t8_alias1.c10], [t8_alias1.c18], [t8_alias1.c7], [t8_alias1.c6]), range(MIN,MIN,MIN,MIN ; MAX,MAX,MAX,MAX)always true
(select /*+USE_HASH_AGGREGATION*/ c15 from (select c15 from t8) except (select c15 from t8) order by 1 limit 1000) union all (select t8_alias1.c10 from t8 t8_alias1 limit 1);
c15
ieLhJAFmNCq00000
explain (select /*+USE_HASH_AGGREGATION*/ c15 from (select c15 from t8) intersect (select c15 from t8) order by 1 limit 1000) union all (select t8_alias1.c10 from t8 t8_alias1 limit 1);
Query Plan
================================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------------------------
|0 |UNION ALL | |2 |88 |
|1 |├─TOP-N SORT | |1 |86 |
|2 |│ └─HASH INTERSECT DISTINCT | |1 |86 |
|3 |│ ├─PX COORDINATOR | |1 |43 |
|4 |│ │ └─EXCHANGE OUT DISTR |:EX10000 |1 |43 |
|5 |│ │ └─PX PARTITION ITERATOR| |1 |43 |
|6 |│ │ └─TABLE FULL SCAN |t8 |1 |43 |
|7 |│ └─PX COORDINATOR | |1 |43 |
|8 |│ └─EXCHANGE OUT DISTR |:EX20000 |1 |43 |
|9 |│ └─PX PARTITION ITERATOR| |1 |43 |
|10|│ └─TABLE FULL SCAN |t8 |1 |43 |
|11|└─DISTRIBUTED TABLE FULL SCAN |t8_alias1(i_ahayugXY)|1 |3 |
================================================================================
Outputs & filters:
-------------------------------------
0 - output([UNION([1])]), filter(nil), rowset=16
1 - output([cast(INTERSECT([1]), VARCHAR(127))]), filter(nil), rowset=16
sort_keys([INTERSECT([1]), ASC]), topn(1000)
2 - output([INTERSECT([1])], [cast(INTERSECT([1]), VARCHAR(127))]), filter(nil), rowset=16
3 - output([t8.c15]), filter(nil), rowset=16
4 - output([t8.c15]), filter(nil), rowset=16
dop=1
5 - output([t8.c15]), filter(nil), rowset=16
force partition granule
6 - output([t8.c15]), filter(nil), rowset=16
access([t8.c15]), partitions(p[0-19])
is_index_back=false, is_global_index=false,
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
7 - output([t8.c15]), filter(nil), rowset=16
8 - output([t8.c15]), filter(nil), rowset=16
dop=1
9 - output([t8.c15]), filter(nil), rowset=16
force partition granule
10 - output([t8.c15]), filter(nil), rowset=16
access([t8.c15]), partitions(p[0-19])
is_index_back=false, is_global_index=false,
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
11 - output([t8_alias1.c10]), filter(nil), rowset=16
access([t8_alias1.c10]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=true,
range_key([t8_alias1.c10], [t8_alias1.c18], [t8_alias1.c7], [t8_alias1.c6]), range(MIN,MIN,MIN,MIN ; MAX,MAX,MAX,MAX)always true
(select /*+USE_HASH_AGGREGATION*/ c15 from (select c15 from t8) intersect (select c15 from t8) order by 1 limit 1000) union all (select t8_alias1.c10 from t8 t8_alias1 limit 1);
c15
0
ieLhJAFmNCq00000
drop table t8;
create table t8 (c1 BINARY(99) ,c2 INTEGER(127) ,c3 VARBINARY(71) ,c4 BINARY(65) ,c5 BIGINT(127) ,c6 INTEGER(127) ,c7 INT(127) ,c8 INTEGER(127) ,c9 NUMERIC(64,25) ,c10 VARBINARY(55) ,c11 BIGINT(127) ,c12 VARCHAR(86) ,c13 INTEGER(127) ,c14 INT(127) ,c15 INTEGER(127) ,c16 DECIMAL(64,15) ,c17 INTEGER(127) ,c18 VARBINARY(76) ,c19 INTEGER(127) , primary key(c7,c6), index i_OkcN(c19), index i_ahayugXY(c10,c18), index i_iA(c16,c2));
insert into t8 values('cdxLVdvvJjcoHFBECqXKkRGoMXYgNsTpJRrqYaluQdfEeB00000',0,'RetSgyIigYXIPgBXBsmZHQZQPLWcGoELCf00000','wD00000',0,0,0,0,0.0000000000000000000000000,'ieLhJAFmNCq00000',0,'DcKPncNvJjyYcNJKFmVUVhqvgUlLfINbycifYNHjzqALoLfn00000',0,0,0,0.000000000000000,0,'MojimRsQZuotWXMuvSQVDSdCmOaloSXNLRTxMYYXaxGbtuk00000',0);
explain ((select c6 from t8 where c6 < 1000) except (select c6 from t8 where c6 > -1000) order by c6 limit 1000) union all (select t8_alias1.c10 from t8 t8_alias1 limit 1);
Query Plan
=============================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------------
|0 |UNION ALL | |2 |7 |
|1 |├─TOP-N SORT | |1 |5 |
|2 |│ └─HASH EXCEPT DISTINCT| |1 |5 |
|3 |│ ├─TABLE FULL SCAN |t8 |1 |3 |
|4 |│ └─TABLE FULL SCAN |t8 |1 |3 |
|5 |└─TABLE FULL SCAN |t8_alias1|1 |3 |
=============================================================
Outputs & filters:
-------------------------------------
0 - output([UNION([1])]), filter(nil), rowset=16
1 - output([cast(EXCEPT([1]), VARCHAR(127))]), filter(nil), rowset=16
sort_keys([EXCEPT([1]), ASC]), topn(1000)
2 - output([EXCEPT([1])], [cast(EXCEPT([1]), VARCHAR(127))]), filter(nil), rowset=16
3 - output([t8.c6]), filter([t8.c6 < 1000]), rowset=16
access([t8.c6]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
4 - output([t8.c6]), filter([t8.c6 > -1000]), rowset=16
access([t8.c6]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t8.c7], [t8.c6]), range(MIN,MIN ; MAX,MAX)always true
5 - output([t8_alias1.c10]), filter(nil), rowset=16
access([t8_alias1.c10]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false,
range_key([t8_alias1.c7], [t8_alias1.c6]), range(MIN,MIN ; MAX,MAX)always true
drop table t1,t2,t3,t4,t5,t6, t8;

View File

@ -0,0 +1,76 @@
drop table if exists persons,orders, t1, t2, t3;
create table persons (id_p int primary key, lastname varchar(20), firstname varchar(20), address varchar(20), city varchar(20));
insert into persons values(1,'a','a1','a2', 'a3');
insert into persons values(2,'b','b1','b2', 'b3');
insert into persons values(3,'c','c1','c2', 'c3');
create table orders(id_o int primary key, orderno int, id_p int);
insert into orders values(1,1111,3);
insert into orders values(2,2222,3);
insert into orders values(3,3333,1);
insert into orders values(4,4444,1);
insert into orders values(5,5555,65);
select persons.lastname, persons.firstname, orders.orderno from persons left join orders on persons.id_p=orders.id_p order by persons.lastname, persons.firstname, orders.orderno;
lastname firstname orderno
a a1 3333
a a1 4444
b b1 NULL
c c1 1111
c c1 2222
select persons.lastname, persons.firstname, orders.orderno from persons right join orders on persons.id_p=orders.id_p order by persons.lastname, persons.firstname, orders.orderno;
lastname firstname orderno
NULL NULL 5555
a a1 3333
a a1 4444
c c1 1111
c c1 2222
select persons.lastname, persons.firstname, orders.orderno
from persons
inner join orders
on persons.id_p=orders.id_p
order by persons.lastname, persons.firstname, orders.orderno;
lastname firstname orderno
a a1 3333
a a1 4444
c c1 1111
c c1 2222
select persons.lastname, persons.firstname, orders.orderno from persons full join orders on persons.id_p=orders.id_p order by persons.lastname, persons.firstname, orders.orderno;
lastname firstname orderno
NULL NULL 5555
a a1 3333
a a1 4444
b b1 NULL
c c1 1111
c c1 2222
create table t1(c1 date);
create table t2(c1 int primary key);
insert into t1 values('2078-10-10'), ('1970-11-01');
insert into t2 values(320);
select * from t1, t2 where t1.c1<=t2.c1;
c1 c1
1970-11-01 320
drop table if exists t1;
create table t1(a bigint);
insert into t1 values (32);
drop table if exists t2;
create table t2(b year(4), key key_b (b));
insert into t2 values (1901);
create table t3(c year(4));
insert into t3 values (1901);
select a, b from t1, t2 where a > b;
a b
select a, c from t1, t3 where a > c;
a c
drop table if exists t1, t2;
create table t1(c1 bigint(92));
create table t2(c1 year(4) primary key);
insert into t1 values(32);
insert into t2 values(1901);
select * from t1;
c1
32
select * from t2;
c1
1901
select * from t1, t2 where t1.c1>=t2.c1;
c1 c1
drop table orders,persons, t1, t2, t3;

View File

@ -0,0 +1,53 @@
drop table if exists t1,t2;
create table t1(pk int primary key, c1 int, c2 int);
insert into t1 values(1,1,1),(2,2,2);
explain select * from t1 where c2=1 and c1=c2 and pk=c1;
select * from t1 where c2=1 and c1=c2 and pk=c1;
pk c1 c2
1 1 1
drop table t1;
create table t1(pk int primary key, c1 int, c2 int, c3 int,c4 int , c5 int, c6 int, c7 int, c8 int, c9 int, c10 int);
insert into t1 values(1,1,1,1,1,1,1,1,1,1,1),(2,2,2,2,2,2,2,2,2,2,2),(3,2,2,2,3,2,3,2,3,3,3);
explain select * from t1 where c10=1 and c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and pk=c1;
select * from t1 where c10=1 and c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and pk=c1;
pk c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
1 1 1 1 1 1 1 1 1 1 1
select * from t1 where c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and c10=1 and pk=c1;
pk c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
1 1 1 1 1 1 1 1 1 1 1
select * from t1 where c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and pk=c1;
pk c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2
explain select * from t1 where c10>1 and c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and pk=c1;
select * from t1 where c10>1 and c9=c10 and c8=c9 and c7=c8 and c6=c7 and c5=c6 and c4=c5 and c3=c4 and c2=c3 and c1=c2 and pk=c1;
pk c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
2 2 2 2 2 2 2 2 2 2 2
drop table t1;
create table t1(pk int primary key, c1 int, c2 int);
insert into t1 values(1,1,1),(2,2,2);
create table t2(pk int primary key, c1 int, c2 int);
insert into t2 values(1,1,1),(2,2,2);
select t1.pk,t2.c2 from t1,t2 where t1.pk=t2.pk and t1.pk=1;
pk c2
1 1
select t1.pk,t2.c2 from t1,t2 where t1.pk=t2.pk and t1.pk>1;
pk c2
2 2
select t1.pk,t2.c2 from t1 INNER join t2 on t1.pk=t2.pk and t2.pk=1;
pk c2
1 1
select t1.pk,t2.c2 from t1 LEFT join t2 on t1.pk=t2.pk and t2.pk=1;
pk c2
1 1
2 NULL
explain select t1.pk,t2.c2 from t1 LEFT join t2 on t1.pk=t2.pk and t2.pk=1;
select t1.pk,t2.c2 from t1 RIGHT join t2 on t1.pk=t2.pk and t2.pk=1;
pk c2
1 1
NULL 2
select t1.pk,t2.c2 from t1 FULL join t2 on t1.pk=t2.pk and t2.pk=1;
pk c2
1 1
2 NULL
NULL 2

View File

@ -0,0 +1,68 @@
drop table if exists t1;
CREATE TABLE t1 (
id int,
token varchar(100) ,
count int ,
qty int,
phone char(1) ,
stamp datetime ,
PRIMARY KEY (id)
);
INSERT INTO t1 VALUES (21,'e45703b64de71482360de8fec94c3ade',3,7800,'n','1999-12-23 17:22:21');
INSERT INTO t1 VALUES (22,'e45703b64de71482360de8fec94c3ade',4,5000,'y','1999-12-23 17:22:21');
INSERT INTO t1 VALUES (18,'346d1cb63c89285b2351f0ca4de40eda',3,13200,'b','1999-12-23 11:58:04');
INSERT INTO t1 VALUES (17,'ca6ddeb689e1b48a04146b1b5b6f936a',4,15000,'b','1999-12-23 11:36:53');
INSERT INTO t1 VALUES (16,'ca6ddeb689e1b48a04146b1b5b6f936a',3,13200,'b','1999-12-23 11:36:53');
INSERT INTO t1 VALUES (26,'a71250b7ed780f6ef3185bfffe027983',5,1500,'b','1999-12-27 09:44:24');
INSERT INTO t1 VALUES (24,'4d75906f3c37ecff478a1eb56637aa09',3,5400,'y','1999-12-23 17:29:12');
INSERT INTO t1 VALUES (25,'4d75906f3c37ecff478a1eb56637aa09',4,6500,'y','1999-12-23 17:29:12');
INSERT INTO t1 VALUES (27,'a71250b7ed780f6ef3185bfffe027983',3,6200,'b','1999-12-27 09:44:24');
INSERT INTO t1 VALUES (28,'a71250b7ed780f6ef3185bfffe027983',3,5400,'y','1999-12-27 09:44:36');
INSERT INTO t1 VALUES (29,'a71250b7ed780f6ef3185bfffe027983',4,17700,'b','1999-12-27 09:45:05');
select t1000.id from
t1 as t1000
left join t1 as t2000 on t1000.id=t2000.id
left join t1 as t2001 on t2000.id=t2001.id
left join t1 as t2002 on t2001.id=t2002.id
left join t1 as t2003 on t2002.id=t2003.id
left join t1 as t2004 on t2003.id=t2004.id
left join t1 as t2005 on t2004.id=t2005.id
left join t1 as t2006 on t2005.id=t2006.id
left join t1 as t2007 on t2006.id=t2007.id
left join t1 as t2008 on t2007.id=t2008.id
left join t1 as t2009 on t2008.id=t2009.id
left join t1 as t2010 on t2009.id=t2010.id
left join t1 as t2011 on t2010.id=t2011.id
left join t1 as t2012 on t2011.id=t2012.id
left join t1 as t2013 on t2012.id=t2013.id
left join t1 as t2014 on t2013.id=t2014.id
left join t1 as t2015 on t2014.id=t2015.id
left join t1 as t2016 on t2015.id=t2016.id
left join t1 as t2017 on t2016.id=t2017.id
left join t1 as t2018 on t2017.id=t2018.id
left join t1 as t2019 on t2018.id=t2019.id
left join t1 as t2020 on t2019.id=t2020.id
left join t1 as t2021 on t2020.id=t2021.id
left join t1 as t2022 on t2021.id=t2022.id
left join t1 as t2023 on t2022.id=t2023.id
left join t1 as t2024 on t2023.id=t2024.id
left join t1 as t2025 on t2024.id=t2025.id
left join t1 as t2026 on t2025.id=t2026.id
left join t1 as t2027 on t2026.id=t2027.id
left join t1 as t2028 on t2027.id=t2028.id
left join t1 as t2029 on t2028.id=t2029.id
left join t1 as t2030 on t2029.id=t2030.id
left join t1 as t2031 on t2030.id=t2031.id;
id
16
17
18
21
22
24
25
26
27
28
29
drop table t1;

View File

@ -0,0 +1,77 @@
drop table if exists t1;
set global ob_sql_work_area_percentage = 100;
create table t1 (id int primary key,extra int);
insert into t1(id) values(1),(2);
select t1000.id from
t1 as t1000
left join t1 as t2000 on t1000.id=t2000.id
left join t1 as t2001 on t2000.id=t2001.id
left join t1 as t2002 on t2001.id=t2002.id
left join t1 as t2003 on t2002.id=t2003.id
left join t1 as t2004 on t2003.id=t2004.id
left join t1 as t2005 on t2004.id=t2005.id
left join t1 as t2006 on t2005.id=t2006.id
left join t1 as t2007 on t2006.id=t2007.id
left join t1 as t2008 on t2007.id=t2008.id
left join t1 as t2009 on t2008.id=t2009.id
left join t1 as t2010 on t2009.id=t2010.id
left join t1 as t2011 on t2010.id=t2011.id
left join t1 as t2012 on t2011.id=t2012.id
left join t1 as t2013 on t2012.id=t2013.id
left join t1 as t2014 on t2013.id=t2014.id
left join t1 as t2015 on t2014.id=t2015.id
left join t1 as t2016 on t2015.id=t2016.id
left join t1 as t2017 on t2016.id=t2017.id
left join t1 as t2018 on t2017.id=t2018.id
left join t1 as t2019 on t2018.id=t2019.id
left join t1 as t2020 on t2019.id=t2020.id
left join t1 as t2021 on t2020.id=t2021.id
left join t1 as t2022 on t2021.id=t2022.id
left join t1 as t2023 on t2022.id=t2023.id
left join t1 as t2024 on t2023.id=t2024.id
left join t1 as t2025 on t2024.id=t2025.id
left join t1 as t2026 on t2025.id=t2026.id
left join t1 as t2027 on t2026.id=t2027.id
left join t1 as t2028 on t2027.id=t2028.id
left join t1 as t2029 on t2028.id=t2029.id
left join t1 as t2030 on t2029.id=t2030.id
left join t1 as t2031 on t2030.id=t2031.id;
id
1
2
explain select t1000.id from
t1 as t1000
left join t1 as t2000 on t1000.id=t2000.id
left join t1 as t2001 on t2000.id=t2001.id
left join t1 as t2002 on t2001.id=t2002.id
left join t1 as t2003 on t2002.id=t2003.id
left join t1 as t2004 on t2003.id=t2004.id
left join t1 as t2005 on t2004.id=t2005.id
left join t1 as t2006 on t2005.id=t2006.id
left join t1 as t2007 on t2006.id=t2007.id
left join t1 as t2008 on t2007.id=t2008.id
left join t1 as t2009 on t2008.id=t2009.id
left join t1 as t2010 on t2009.id=t2010.id
left join t1 as t2011 on t2010.id=t2011.id
left join t1 as t2012 on t2011.id=t2012.id
left join t1 as t2013 on t2012.id=t2013.id
left join t1 as t2014 on t2013.id=t2014.id
left join t1 as t2015 on t2014.id=t2015.id
left join t1 as t2016 on t2015.id=t2016.id
left join t1 as t2017 on t2016.id=t2017.id
left join t1 as t2018 on t2017.id=t2018.id
left join t1 as t2019 on t2018.id=t2019.id
left join t1 as t2020 on t2019.id=t2020.id
left join t1 as t2021 on t2020.id=t2021.id
left join t1 as t2022 on t2021.id=t2022.id
left join t1 as t2023 on t2022.id=t2023.id
left join t1 as t2024 on t2023.id=t2024.id
left join t1 as t2025 on t2024.id=t2025.id
left join t1 as t2026 on t2025.id=t2026.id
left join t1 as t2027 on t2026.id=t2027.id
left join t1 as t2028 on t2027.id=t2028.id
left join t1 as t2029 on t2028.id=t2029.id
left join t1 as t2030 on t2029.id=t2030.id
left join t1 as t2031 on t2030.id=t2031.id;
drop table t1;
set global ob_sql_work_area_percentage = 5;

View File

@ -0,0 +1,30 @@
drop table if exists t1,t2,t5,t6;
CREATE TABLE t1 (
pk int primary key,
id int,
gender varchar(1)
);
CREATE TABLE t2 (
user_id int primary key,
birthday datetime
);
insert into t1 values (1, NULL, 'M'), (2, 1, 'M'), (3, 2, 'F'),(4, 3, 'F'),(5, 4, 'F'),(6, 5, 'M');
insert into t2 values (1, '2002-06-09 00:00:00'),(2, '2002-06-09 00:00:00'),(100, '2002-06-09 00:00:00'),
(3, '2002-06-09 00:00:00'),(4, '2002-06-09 00:00:00');
select id,gender,user_id from t1,t2 where t2.user_id=t1.id;
id gender user_id
1 M 1
2 F 2
3 F 3
4 F 4
create table t5(a int);
create table t6(a int);
insert into t5 values (null), (null);
insert into t6 values (null), (null);
select * from t5, t6 where t5.a <=> t6.a;
a a
NULL NULL
NULL NULL
NULL NULL
NULL NULL
drop table t1,t2,t5,t6;

View File

@ -0,0 +1,73 @@
drop table if exists tbl1,tbl2,tbl3,tbl4;
create table tbl1 (i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6),i5 decimal(5,3), primary key(i1));
create table tbl2 (i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6), i5 decimal(5,3), primary key(i1));
create table tbl3 (i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6), i5 decimal(5,3), primary key(i1));
create table tbl4 (i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6), i5 decimal(5,3), primary key(i1));
insert into tbl1 values(1,'now','haha',1.6256,'2014-05-04 12:00:00',-10.235);
insert into tbl1 values(2,'now','haha',-1.6256,'2014-05-04 12:00:00',1.243);
insert into tbl1 values(3,'now','haha',1.656,'2014-05-04 12:00:00',-1.45);
insert into tbl2 values(1,'now','haha',1.6256,'2014-05-04 12:00:00',3.45);
insert into tbl2 values(2,'now1','haha',1.6256,'2014-05-04 12:00:00',-0.25);
insert into tbl2 values(3,'now2','haha',1.6256,'2014-05-04 12:00:00',0.253);
insert into tbl2 values(4,'now3','haha',1.6256,'2014-05-04 12:00:00',1.677);
insert into tbl3 values(1,'now','haha',1.6256,'2014-05-04 12:00:00',-10.235);
insert into tbl3 values(2,'now','haha',-1.6256,'2014-05-04 12:00:00',1.243);
insert into tbl3 values(3,'now','haha',1.656,'2014-05-04 12:00:00',-1.45);
insert into tbl4 values(1,'now','haha',1.6256,'2014-05-04 12:00:00',3.45);
insert into tbl4 values(2,'now1','haha',1.6256,'2014-05-04 12:00:00',-0.25);
insert into tbl4 values(3,'now2','haha',1.6256,'2014-05-04 12:00:00',0.253);
insert into tbl4 values(4,'now3','haha',1.6256,'2014-05-04 12:00:00',1.677);
select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl1.i1=tbl3.i1 join tbl4 on tbl1.i1=tbl4.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 a join tbl2 b on a.i1=b.i1 join tbl3 c on a.i1=c.i1 join tbl4 d on a.i1=d.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl1.i1=tbl3.i1 join tbl4 on tbl1.i1=tbl4.i1 where tbl1.i1=1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl2.i1=tbl3.i1 join tbl4 on tbl3.i1=tbl4.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 a join tbl2 b on a.i1=b.i1 join tbl3 c on b.i1=c.i1 join tbl4 d on c.i1=d.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
explain select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl1.i1=tbl3.i1 join tbl4 on tbl1.i1=tbl4.i1;
explain select * from tbl1 a join tbl2 b on a.i1=b.i1 join tbl3 c on a.i1=c.i1 join tbl4 d on a.i1=d.i1;
explain select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl2.i1=tbl3.i1 join tbl4 on tbl3.i1=tbl4.i1;
explain select * from tbl1 a join tbl2 b on a.i1=b.i1 join tbl3 c on b.i1=c.i1 join tbl4 d on c.i1=d.i1;
select * from tbl1 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl1.i1=tbl3.i1 left join tbl4 on tbl1.i1=tbl4.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 a left join tbl2 b on a.i1=b.i1 left join tbl3 c on a.i1=c.i1 left join tbl4 d on a.i1=d.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl1.i1=tbl3.i1 left join tbl4 on tbl1.i1=tbl4.i1 where tbl1.i1=1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
select * from tbl1 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl2.i1=tbl3.i1 left join tbl4 on tbl3.i1=tbl4.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
select * from tbl1 a left join tbl2 b on a.i1=b.i1 left join tbl3 c on b.i1=c.i1 left join tbl4 d on c.i1=d.i1;
i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5 i1 v2 i3 i4 d4 i5
1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450 1 now haha 1.6256 2014-05-04 12:00:00.000000 -10.235 1 now haha 1.6256 2014-05-04 12:00:00.000000 3.450
2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250 2 now haha -1.6256 2014-05-04 12:00:00.000000 1.243 2 now1 haha 1.6256 2014-05-04 12:00:00.000000 -0.250
3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253 3 now haha 1.656 2014-05-04 12:00:00.000000 -1.450 3 now2 haha 1.6256 2014-05-04 12:00:00.000000 0.253
explain select* from tbl1 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl1.i1=tbl3.i1 left join tbl4 on tbl1.i1=tbl4.i1;
explain select* from tbl1 a left join tbl2 b on a.i1=b.i1 left join tbl3 c on a.i1=c.i1 left join tbl4 d on a.i1=d.i1;
explain select* from tbl1 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl2.i1=tbl3.i1 left join tbl4 on tbl3.i1=tbl4.i1;
explain select* from tbl1 a left join tbl2 b on a.i1=b.i1 left join tbl3 c on b.i1=c.i1 left join tbl4 d on c.i1=d.i1;

View File

@ -0,0 +1,68 @@
drop table if exists tjuo1,tjuo2,tjuo3;
create table tjuo1 (pk int,c1 int, primary key(pk));
create table tjuo2 (pk int,c1 int, c2 int, primary key(pk));
create table tjuo3 (pk int,c2 int, primary key(pk));
insert into tjuo1 values(1, 11), (2, 12), (3, 13);
insert into tjuo2 values(4, 11, 21), (5, 12, 22), (6, 13, 23);
insert into tjuo3 values(7, 21), (8, 22), (9, 23);
select * from tjuo1;
pk c1
1 11
2 12
3 13
select * from tjuo2;
pk c1 c2
4 11 21
5 12 22
6 13 23
select * from tjuo3;
pk c2
7 21
8 22
9 23
SELECT * FROM tjuo1 JOIN (SELECT * FROM tjuo2) as tjuo2_alias on tjuo1.c1= tjuo2_alias.c1;
pk c1 pk c1 c2
1 11 4 11 21
2 12 5 12 22
3 13 6 13 23
SELECT * FROM tjuo1 RIGHT JOIN (SELECT * FROM tjuo2) as tjuo2_alias USING (c1);
c1 pk c2 pk
11 4 21 1
12 5 22 2
13 6 23 3
SELECT * FROM tjuo1 JOIN tjuo2 on tjuo1.c1=tjuo2.c1 JOIN tjuo3 on tjuo2.c2=tjuo3.c2;
pk c1 pk c1 c2 pk c2
1 11 4 11 21 7 21
2 12 5 12 22 8 22
3 13 6 13 23 9 23
SELECT * FROM tjuo1 RIGHT JOIN tjuo2 USING (c1) RIGHT JOIN tjuo3 USING (c2);
c2 pk c1 pk pk
21 7 11 4 1
22 8 12 5 2
23 9 13 6 3
SELECT * FROM tjuo1 RIGHT JOIN (SELECT * FROM tjuo2) as tjuo2_alias USING (c1) RIGHT JOIN tjuo3 USING (c2);
c2 pk c1 pk pk
21 7 11 4 1
22 8 12 5 2
23 9 13 6 3
SELECT * FROM (SELECT * FROM tjuo1) tjuo1_alias RIGHT JOIN (SELECT * FROM tjuo2) as tjuo2_alias USING (c1) RIGHT JOIN (SELECT * FROM tjuo3) as tjuo3_alias USING (c2);
c2 pk c1 pk pk
21 7 11 4 1
22 8 12 5 2
23 9 13 6 3
SELECT * FROM (SELECT * FROM tjuo1) tjuo1_alias RIGHT JOIN tjuo2 USING (c1) RIGHT JOIN (SELECT * FROM tjuo3) as tjuo3_alias USING (c2);
c2 pk c1 pk pk
21 7 11 4 1
22 8 12 5 2
23 9 13 6 3
SELECT * FROM (SELECT c2 FROM tjuo1 as i1 JOIN (SELECT * FROM tjuo2) as i2 USING (c1) ) as t12 RIGHT JOIN (SELECT * FROM tjuo3) as tjuo3_alias USING (c2);
c2 pk
21 7
22 8
23 9
SELECT * FROM (SELECT c2 FROM tjuo1 as i1 JOIN (SELECT * FROM tjuo2) as i2 USING (c1) ) as t12;
c2
21
22
23
drop table tjuo1, tjuo2, tjuo3;

View File

@ -0,0 +1,181 @@
drop table if exists `T1`;
drop table if exists `T2`;
drop table if exists `T3`;
drop table if exists `T4`;
drop table if exists `T5`;
drop table if exists `T6`;
drop table if exists `T7`;
drop table if exists `T8`;
drop table if exists `T9`;
SET NAMES utf8;
CREATE TABLE `T1` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T2` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T3` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T4` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T5` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T6` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T7` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T8` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
CREATE TABLE `T9` (`C1` char(5) PRIMARY KEY, INDEX(`C1`)) DEFAULT CHARSET = utf8;
INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
INSERT INTO `T2` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
INSERT INTO `T4` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
INSERT INTO `T5` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `T6` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
INSERT INTO `T7` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ア'),('');
INSERT INTO `T8` VALUES ('あいうえお'),('あいうえ'),('あいう'),('あい'),('あ'),('');
INSERT INTO `T9` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('龔'),('');
SELECT * FROM `T1`;
C1
アイ
アイウ
アイウエ
アイウエオ
SELECT * FROM `T2`;
C1
あい
あいう
あいうえ
あいうえお
SELECT * FROM `T3`;
C1
龔龖
龔龖龗
龔龖龗龞
龔龖龗龞龡
SELECT * FROM `T4`;
C1
アイ
アイウ
アイウエ
アイウエオ
SELECT * FROM `T5`;
C1
あい
あいう
あいうえ
あいうえお
SELECT * FROM `T6`;
C1
龔龖
龔龖龗
龔龖龗龞
龔龖龗龞龡
SELECT * FROM `T7`;
C1
アイ
アイウ
アイウエ
アイウエオ
SELECT * FROM `T8`;
C1
あい
あいう
あいうえ
あいうえお
SELECT * FROM `T9`;
C1
龔龖
龔龖龗
龔龖龗龞
龔龖龗龞龡
SELECT `C1`, LENGTH(`C1`) FROM `T1`;
C1 LENGTH(`C1`)
0
ア 3
アイ 6
アイウ 9
アイウエ 12
アイウエオ 15
SELECT `C1`, LENGTH(`C1`) FROM `T2`;
C1 LENGTH(`C1`)
0
あ 3
あい 6
あいう 9
あいうえ 12
あいうえお 15
SELECT `C1`, LENGTH(`C1`) FROM `T3`;
C1 LENGTH(`C1`)
0
龔 3
龔龖 6
龔龖龗 9
龔龖龗龞 12
龔龖龗龞龡 15
SELECT `C1`, LENGTH(`C1`) FROM `T4`;
C1 LENGTH(`C1`)
0
ア 3
アイ 6
アイウ 9
アイウエ 12
アイウエオ 15
SELECT `C1`, LENGTH(`C1`) FROM `T5`;
C1 LENGTH(`C1`)
0
あ 3
あい 6
あいう 9
あいうえ 12
あいうえお 15
SELECT `C1`, LENGTH(`C1`) FROM `T6`;
C1 LENGTH(`C1`)
0
龔 3
龔龖 6
龔龖龗 9
龔龖龗龞 12
龔龖龗龞龡 15
SELECT `C1`, LENGTH(`C1`) FROM `T7`;
C1 LENGTH(`C1`)
0
ア 3
アイ 6
アイウ 9
アイウエ 12
アイウエオ 15
SELECT `C1`, LENGTH(`C1`) FROM `T8`;
C1 LENGTH(`C1`)
0
あ 3
あい 6
あいう 9
あいうえ 12
あいうえお 15
SELECT `C1`, LENGTH(`C1`) FROM `T9`;
C1 LENGTH(`C1`)
0
龔 3
龔龖 6
龔龖龗 9
龔龖龗龞 12
龔龖龗龞龡 15
DROP TABLE `T1`;
DROP TABLE `T2`;
DROP TABLE `T3`;
DROP TABLE `T4`;
DROP TABLE `T5`;
DROP TABLE `T6`;
DROP TABLE `T7`;
DROP TABLE `T8`;
DROP TABLE `T9`;

View File

@ -0,0 +1,29 @@
set @@ob_query_timeout=3599999999999999963;
Warnings:
Warning 1265 Timeout value truncated to 102 years
select @@ob_query_timeout;
@@ob_query_timeout
3216672000000000
set @@ob_query_timeout=3216672000000000;
select @@ob_query_timeout;
@@ob_query_timeout
3216672000000000
set @@ob_query_timeout=3216672000000001;
Warnings:
Warning 1265 Timeout value truncated to 102 years
select @@ob_query_timeout;
@@ob_query_timeout
3216672000000000
set @@ob_query_timeout=3216671999999999;
select @@ob_query_timeout;
@@ob_query_timeout
3216671999999999
drop table if exists t1;
create table t1(a int primary key ,b int);
desc t1;
Field Type Null Key Default Extra
a int(11) NO PRI NULL
b int(11) YES NULL
select * from t1;
a b
drop table t1;

View File

@ -0,0 +1,50 @@
drop table if exists t1;
create table t1(a int primary key,b int);
insert into t1(a) values(1),(2),(3);
select * from t1 limit 0;
a b
select * from t1 limit 1;
a b
1 NULL
select * from t1 limit 3;
a b
1 NULL
2 NULL
3 NULL
select * from t1 limit 4;
a b
1 NULL
2 NULL
3 NULL
select /*+no_rewrite*/ * from (select * from t1 order by b limit 4) AS t2 limit 2;
a b
1 NULL
2 NULL
select * from t1 limit -1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '-1' at line 1
drop table t1;
create table t1 (a int primary key,b int);
insert into t1(a) values (1),(2),(3),(4),(5),(6),(7);
select * FROM t1 ORDER BY a desc LIMIT 3;
a b
7 NULL
6 NULL
5 NULL
select * FROM t1 ORDER BY a desc LIMIT 0;
a b
select * FROM t1 ORDER BY a desc LIMIT 8;
a b
7 NULL
6 NULL
5 NULL
4 NULL
3 NULL
2 NULL
1 NULL
select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
c
7
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
c
28
drop table t1;

View File

@ -0,0 +1,10 @@
drop table if exists t1;
create table t1(c1 int primary key, c2 int);
insert into t1 values(1,1);
set autocommit=0;
insert into t1 values(1,1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
rollback;
insert into t1 values(1,1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
rollback;

View File

@ -0,0 +1,16 @@
create table t_status(id int primary key, chunkserver char(90), mergesrver char(90), rootserver char(90), updateserver char(90), tablet_max_size int, status int);
insert into t_status(id, chunkserver, tablet_max_size, status) values(1, 'chunkserver', 1024, 0);
select id, chunkserver, status from t_status;
id chunkserver status
1 chunkserver 0
select id, chunkserver, status as verbose from t_status;
id chunkserver verbose
1 chunkserver 0
select id, chunkserver, grants.status as verbose from t_status grants;
id chunkserver verbose
1 chunkserver 0
select use_bloom_filter() from dual;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '() from dual' at line 1
select use_bloom() from dual;
ERROR 42000: FUNCTION use_bloom does not exist
drop table t_status;

View File

@ -0,0 +1,21 @@
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id smallint NOT NULL,
name varchar(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO t1 VALUES (1,'Antonio Paz');
INSERT INTO t1 VALUES (2,'Lilliana Angelovska');
INSERT INTO t1 VALUES (3,'Thimble Smith');
CREATE TABLE t2 (
id smallint NOT NULL,
owner smallint DEFAULT '0' NOT NULL,
name varchar(60),
PRIMARY KEY (id)
);
INSERT INTO t2 VALUES (1,1,'El Gato');
INSERT INTO t2 VALUES (2,1,'Perrito');
INSERT INTO t2 VALUES (3,3,'Happy');
select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null;
name name id
Lilliana Angelovska NULL NULL

View File

@ -0,0 +1,59 @@
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
drop table if exists t1;
create table t1(pk int primary key, c1 int);
create index idx on t1(c1);
insert into t1 values(6,6),(7,7),(8,8);
set autocommit=0;
set autocommit=0;
insert into t1 values(1,1);
insert into t1 values(1,11);
commit;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit;
select * from t1;
pk c1
1 1
6 6
7 7
8 8
insert into t1 values(2,2);
replace into t1 values(2,12);
commit;
commit;
select * from t1;
pk c1
1 1
2 12
6 6
7 7
8 8
replace into t1 values(3,3);
insert into t1 values(3,13);
commit;
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
commit;
select * from t1;
pk c1
1 1
2 12
3 3
6 6
7 7
8 8
replace into t1 values(4,4);
replace into t1 values(4,14);
commit;
commit;
select * from t1;
pk c1
1 1
2 12
3 3
4 14
6 6
7 7
8 8
drop table t1;

View File

@ -0,0 +1,284 @@
create table t1 (
c1 int,
c2 int,
c3 int,
c4 int,
c5 int,
c6 int,
c7 int,
c8 int,
c9 int,
c10 int,
c11 int,
c12 int,
c13 int,
c14 int,
c15 int,
c16 int,
c17 int,
c18 int,
c19 int,
c20 int,
c21 int,
c22 int,
c23 int,
c24 int,
c25 int,
c26 int,
c27 int,
c28 int,
c29 int,
c30 int,
c31 int,
c32 int,
c33 int,
c34 int,
c35 int,
c36 int,
c37 int,
c38 int,
c39 int,
c40 int,
c41 int,
c42 int,
c43 int,
c44 int,
c45 int,
c46 int,
c47 int,
c48 int,
c49 int,
c50 int,
c51 int,
c52 int,
c53 int,
c54 int,
c55 int,
c56 int,
c57 int,
c58 int,
c59 int,
c60 int,
c61 int,
c62 int,
c63 int,
c64 int,
c65 int,
c66 int,
c67 int,
c68 int,
c69 int,
c70 int,
c71 int,
c72 int,
c73 int,
c74 int,
c75 int,
c76 int,
c77 int,
c78 int,
c79 int,
c80 int,
primary key(
c1,
c2,
c3,
c4,
c5,
c6,
c7,
c8,
c9,
c10,
c11,
c12,
c13,
c14,
c15,
c16,
c17,
c18,
c19,
c20,
c21,
c22,
c23,
c24,
c25,
c26,
c27,
c28,
c29,
c30,
c31,
c32,
c33,
c34,
c35,
c36,
c37,
c38,
c39,
c40,
c41,
c42,
c43,
c44,
c45,
c46,
c47,
c48,
c49,
c50,
c51,
c52,
c53,
c54,
c55,
c56,
c57
)
);
create table t2 (
c1 int,
c2 int,
c3 int,
c4 int,
c5 int,
c6 int,
c7 int,
c8 int,
c9 int,
c10 int,
c11 int,
c12 int,
c13 int,
c14 int,
c15 int,
c16 int,
c17 int,
c18 int,
c19 int,
c20 int,
c21 int,
c22 int,
c23 int,
c24 int,
c25 int,
c26 int,
c27 int,
c28 int,
c29 int,
c30 int,
c31 int,
c32 int,
c33 int,
c34 int,
c35 int,
c36 int,
c37 int,
c38 int,
c39 int,
c40 int,
c41 int,
c42 int,
c43 int,
c44 int,
c45 int,
c46 int,
c47 int,
c48 int,
c49 int,
c50 int,
c51 int,
c52 int,
c53 int,
c54 int,
c55 int,
c56 int,
c57 int,
c58 int,
c59 int,
c60 int,
c61 int,
c62 int,
c63 int,
c64 int,
c65 int,
c66 int,
c67 int,
c68 int,
c69 int,
c70 int,
c71 int,
c72 int,
c73 int,
c74 int,
c75 int,
c76 int,
c77 int,
c78 int,
c79 int,
c80 int,
primary key(
c1,
c2,
c3,
c4,
c5,
c6,
c7,
c8,
c9,
c10,
c11,
c12,
c13,
c14,
c15,
c16,
c17,
c18,
c19,
c20,
c21,
c22,
c23,
c24,
c25,
c26,
c27,
c28,
c29,
c30,
c31,
c32,
c33,
c34,
c35,
c36,
c37,
c38,
c39,
c40,
c41,
c42,
c43,
c44,
c45,
c46,
c47,
c48,
c49,
c50,
c51,
c52,
c53,
c54,
c55,
c56,
c57,
c58
)
);
create index i1 on t1 (c80);

View File

@ -0,0 +1,547 @@
drop table if exists t1, t2, t3;
CREATE TABLE t1 (
event_date datetime DEFAULT '2014-02-22' NOT NULL,
obtype int DEFAULT '0' NOT NULL,
event_id int DEFAULT '0' NOT NULL,
extra int,
PRIMARY KEY (event_date,obtype,event_id)
);
INSERT INTO t1(event_date,obtype,event_id) VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25),
('1999-07-13',100600,0), ('1999-07-13',100600,4), ('1999-07-13',100600,26),
('1999-07-14',100600,10), ('1999-07-15',100600,16), ('1999-07-15',100800,45),
('1999-07-15',101000,47), ('1999-07-16',100800,46), ('1999-07-20',100600,5),
('1999-07-20',100600,27), ('1999-07-21',100600,11), ('1999-07-22',100600,17),
('1999-07-23',100100,39), ('1999-07-24',100100,39), ('1999-07-24',100500,40),
('1999-07-25',100100,39), ('1999-07-27',100600,1), ('1999-07-27',100600,6),
('1999-07-27',100600,28), ('1999-07-28',100600,12), ('1999-07-29',100500,41),
('1999-07-29',100600,18), ('1999-07-30',100500,41), ('1999-07-31',100500,41),
('1999-08-01',100700,34), ('1999-08-03',100600,7), ('1999-08-03',100600,29),
('1999-08-04',100600,13), ('1999-08-05',100500,42), ('1999-08-05',100600,19),
('1999-08-06',100500,42), ('1999-08-07',100500,42), ('1999-08-08',100500,42),
('1999-08-10',100600,2), ('1999-08-10',100600,9), ('1999-08-10',100600,30),
('1999-08-11',100600,14), ('1999-08-12',100600,20), ('1999-08-17',100500,8),
('1999-08-17',100600,31), ('1999-08-18',100600,15), ('1999-08-19',100600,22),
('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43),
('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37),
('1999-09-19',100100,37), ('2000-12-18',100700,38);
select event_date,obtype,event_id from t1 WHERE event_date >= '1999-07-01' AND event_date < '1999-07-15' AND (obtype=100600 OR obtype=100100) ORDER BY event_date;
event_date obtype event_id
1999-07-10 00:00:00 100100 24
1999-07-11 00:00:00 100100 25
1999-07-13 00:00:00 100600 0
1999-07-13 00:00:00 100600 4
1999-07-13 00:00:00 100600 26
1999-07-14 00:00:00 100600 10
select event_date,obtype,event_id from t1 WHERE event_date >= '1999-07-01' AND event_date <= '1999-07-15' AND (obtype=100600 OR obtype=100100) or event_date >= '1999-07-01' AND event_date <= '1999-07-15' AND obtype=100099;
event_date obtype event_id
1999-07-10 00:00:00 100100 24
1999-07-11 00:00:00 100100 25
1999-07-13 00:00:00 100600 0
1999-07-13 00:00:00 100600 4
1999-07-13 00:00:00 100600 26
1999-07-14 00:00:00 100600 10
1999-07-15 00:00:00 100600 16
drop table t1;
CREATE TABLE t1 (
PAPER_ID smallint DEFAULT '0' NOT NULL,
YEAR smallint DEFAULT '0' NOT NULL,
ISSUE smallint DEFAULT '0' NOT NULL,
CLOSED tinyint DEFAULT '0' NOT NULL,
ISS_DATE datetime DEFAULT '2014-02-22' NOT NULL,
PRIMARY KEY (PAPER_ID,YEAR,ISSUE)
);
INSERT INTO t1 VALUES (3,1999,34,0,'1999-07-12'), (1,1999,111,0,'1999-03-23'),
(1,1999,222,0,'1999-03-23'), (3,1999,33,0,'1999-07-12'),
(3,1999,32,0,'1999-07-12'), (3,1999,31,0,'1999-07-12'),
(3,1999,30,0,'1999-07-12'), (3,1999,29,0,'1999-07-12'),
(3,1999,28,0,'1999-07-12'), (1,1999,40,1,'1999-05-01'),
(1,1999,41,1,'1999-05-01'), (1,1999,42,1,'1999-05-01'),
(1,1999,46,1,'1999-05-01'), (1,1999,47,1,'1999-05-01'),
(1,1999,48,1,'1999-05-01'), (1,1999,49,1,'1999-05-01'),
(1,1999,50,0,'1999-05-01'), (1,1999,51,0,'1999-05-01'),
(1,1999,200,0,'1999-06-28'), (1,1999,52,0,'1999-06-28'),
(1,1999,53,0,'1999-06-28'), (1,1999,54,0,'1999-06-28'),
(1,1999,55,0,'1999-06-28'), (1,1999,56,0,'1999-07-01'),
(1,1999,57,0,'1999-07-01'), (1,1999,58,0,'1999-07-01'),
(1,1999,59,0,'1999-07-01'), (1,1999,60,0,'1999-07-01'),
(3,1999,35,0,'1999-07-12');
select YEAR,ISSUE from t1 where PAPER_ID=3 and (YEAR>1999 or (YEAR=1999 and ISSUE>28)) order by YEAR,ISSUE;
YEAR ISSUE
1999 29
1999 30
1999 31
1999 32
1999 33
1999 34
1999 35
drop table t1;
CREATE TABLE t1 (
id int NOT NULL auto_increment,
parent_id int DEFAULT '0' NOT NULL,
`level` tinyint DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO t1 VALUES (1,0,0), (3,1,1), (4,1,1), (8,2,2), (9,2,2), (17,3,2),
(22,4,2), (24,4,2), (28,5,2), (29,5,2), (30,5,2), (31,6,2), (32,6,2), (33,6,2),
(203,7,2), (202,7,2), (20,3,2), (157,0,0), (193,5,2), (40,7,2), (2,1,1),
(15,2,2), (6,1,1), (34,6,2), (35,6,2), (16,3,2), (7,1,1), (36,7,2), (18,3,2),
(26,5,2), (27,5,2), (183,4,2), (38,7,2), (25,5,2), (37,7,2), (21,4,2),
(19,3,2), (5,1,1), (179,5,2);
SELECT * FROM t1 WHERE `level` = 1 AND parent_id = 1;
id parent_id level
2 1 1
3 1 1
4 1 1
5 1 1
6 1 1
7 1 1
SELECT * FROM t1 WHERE `level` = 1 AND parent_id = 1 order by id;
id parent_id level
2 1 1
3 1 1
4 1 1
5 1 1
6 1 1
7 1 1
drop table t1;
create table t1(
Satellite varchar(25) not null,
SensorMode varchar(25) not null,
FullImageCornersUpperLeftLongitude double not null,
FullImageCornersUpperRightLongitude double not null,
FullImageCornersUpperRightLatitude double not null,
FullImageCornersLowerRightLatitude double not null,
primary key(Satellite,SensorMode));
insert into t1 values('OV-3','PAN1',91,-92,40,50);
insert into t1 values('OV-4','PAN1',91,-92,40,50);
select * from t1 where t1.Satellite = 'OV-3' and t1.SensorMode = 'PAN1' and t1.FullImageCornersUpperLeftLongitude > -90.000000 and t1.FullImageCornersUpperRightLongitude < -82.000000;
Satellite SensorMode FullImageCornersUpperLeftLongitude FullImageCornersUpperRightLongitude FullImageCornersUpperRightLatitude FullImageCornersLowerRightLatitude
OV-3 PAN1 91 -92 40 50
drop table t1;
create table t1 ( aString char(100) not null default '', primary key (aString) , extra char(100));
insert into t1 (aString) values ( 'believe in myself' ), ( 'believe' ), ('baaa' ), ( 'believe in love');
select * from t1 where aString < 'believe in myself' order by aString;
aString extra
baaa NULL
believe NULL
believe in love NULL
select * from t1 where aString > 'believe in love' order by aString;
aString extra
believe in myself NULL
drop table t1;
CREATE TABLE t1 (
t1ID int NOT NULL ,
art binary(1) NOT NULL default '',
KNR char(5) NOT NULL default '',
RECHNR char(6) NOT NULL default '',
POSNR char(2) NOT NULL default '',
ARTNR char(10) NOT NULL default '',
TEX char(70) NOT NULL default '',
PRIMARY KEY (t1ID)
);
INSERT INTO t1 (t1ID,art) VALUES
(0,'j'),
(1,'J'),
(2,'J'),
(3,'j'),
(4,'J'),
(5,'J'),
(6,'j'),
(7,'J'),
(8,'J'),
(9,'j'),
(10,'J'),
(11,'J'),
(12,'j'),
(13,'J'),
(14,'J'),
(15,'j'),
(16,'J'),
(17,'J'),
(18,'j'),
(19,'J'),
(20,'J'),
(21,'j'),
(22,'J'),
(23,'J'),
(24,'j'),
(25,'J'),
(26,'J'),
(27,'j'),
(28,'J'),
(29,'J'),
(30,'j'),
(31,'J'),
(32,'J'),
(33,'j'),
(34,'J'),
(35,'J'),
(36,'j'),
(37,'J'),
(38,'J'),
(39,'j'),
(40,'J'),
(41,'J'),
(42,'j'),
(43,'J'),
(44,'J'),
(45,'j'),
(46,'J'),
(47,'J'),
(48,'j'),
(49,'J'),
(50,'J'),
(51,'j'),
(52,'J'),
(53,'J'),
(54,'j'),
(55,'J'),
(56,'J'),
(57,'j'),
(58,'J'),
(59,'J'),
(60,'j'),
(61,'J'),
(62,'J'),
(63,'j'),
(64,'J'),
(65,'J'),
(66,'j'),
(67,'J'),
(68,'J'),
(69,'j'),
(70,'J'),
(71,'J'),
(72,'j'),
(73,'J'),
(74,'J'),
(75,'j'),
(76,'J'),
(77,'J'),
(78,'j'),
(79,'J'),
(80,'J'),
(81,'j'),
(82,'J'),
(83,'J'),
(84,'j'),
(85,'J'),
(86,'J'),
(87,'j'),
(88,'J'),
(89,'J'),
(90,'j'),
(91,'J'),
(92,'J'),
(93,'j'),
(94,'J'),
(95,'J'),
(96,'j'),
(97,'J'),
(98,'J'),
(99,'j'),
(100,'J'),
(101,'J'),
(102,'j'),
(103,'J'),
(104,'J'),
(105,'j'),
(106,'J'),
(107,'J'),
(108,'j'),
(109,'J'),
(110,'J'),
(111,'j'),
(112,'J'),
(113,'J'),
(114,'j'),
(115,'J'),
(116,'J'),
(117,'j'),
(118,'J'),
(119,'J'),
(120,'j'),
(121,'J'),
(122,'J'),
(123,'j'),
(124,'J'),
(125,'J'),
(126,'j'),
(127,'J'),
(128,'J'),
(129,'j'),
(130,'J'),
(131,'J'),
(132,'j'),
(133,'J'),
(134,'J'),
(135,'j'),
(136,'J'),
(137,'J'),
(138,'j'),
(139,'J'),
(140,'J'),
(141,'j'),
(142,'J'),
(143,'J'),
(144,'j'),
(145,'J'),
(146,'J'),
(147,'j'),
(148,'J'),
(149,'J'),
(150,'j'),
(151,'J'),
(152,'J'),
(153,'j'),
(154,'J'),
(155,'J'),
(156,'j'),
(157,'J'),
(158,'J'),
(159,'j'),
(160,'J'),
(161,'J'),
(162,'j'),
(163,'J'),
(164,'J'),
(165,'j'),
(166,'J'),
(167,'J'),
(168,'j'),
(169,'J'),
(170,'J'),
(171,'j'),
(172,'J'),
(173,'J'),
(174,'j'),
(175,'J'),
(176,'J'),
(177,'j'),
(178,'J'),
(179,'J'),
(180,'j'),
(181,'J'),
(182,'J'),
(183,'j'),
(184,'J'),
(185,'J'),
(186,'j'),
(187,'J'),
(188,'J'),
(189,'j'),
(190,'J'),
(191,'J'),
(192,'j'),
(193,'J'),
(194,'J'),
(195,'j'),
(196,'J'),
(197,'J'),
(198,'j'),
(199,'J');
select count(*) from t1 where upper(art) = 'J';
count(*)
133
select count(*) from t1 where art = 'J' or art = 'j';
count(*)
200
select count(*) from t1 where art = 'j' or art = 'J';
count(*)
200
select count(*) from t1 where art = 'j';
count(*)
67
select count(*) from t1 where art = 'J';
count(*)
133
drop table t1;
CREATE TABLE t1 (
a int,
b int,
c int,
primary key(a,b)
);
INSERT INTO t1(a,b) VALUES
(1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),
(13,2),(14,2),(15,2),(16,2),(17,3),(16,3),(19,3),(20,3),
(21,4),(22,5),(23,5),(24,5),(25,5),(26,5),(30,5),(31,5),(32,5),
(33,5),(34,5),(35,5);
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
a b c
DROP TABLE t1;
create table t1(c1 varchar(1024),c2 varchar(1024), c3 varchar(1024), primary key(c1,c2,c3), extra varchar(1024));
insert into t1(c1,c2,c3) values ('s1_1','s1_2','s1_3'),('s2_1','s2_2','s2_3');
select * from t1 where c1 in ('s1_1','s2_1') and c2 in ('s2_1','s1_2');
c1 c2 c3 extra
s1_1 s1_2 s1_3 NULL
drop table t1;
create table t2 (x bigint not null primary key, y bigint);
insert into t2(x) values (-16);
insert into t2(x) values (-15);
select * from t2;
x y
-16 NULL
-15 NULL
select count(*) from t2 where x>0;
count(*)
0
select count(*) from t2 where x=0;
count(*)
0
select count(*) from t2 where x<0;
count(*)
2
select count(*) from t2 where x < -16;
count(*)
0
select count(*) from t2 where x = -16;
count(*)
1
select count(*) from t2 where x > -16;
count(*)
1
select count(*) from t2 where x = 1844674407370955160;
count(*)
0
drop table t2;
create table t1 (
c1 char(10) primary key, c2 char(10), c3 char(10), c4 char(10),
c5 char(10), c6 char(10), c7 char(10), c8 char(10),
c9 char(10), c10 char(10), c11 char(10), c12 char(10),
c13 char(10), c14 char(10), c15 char(10), c16 char(10)
);
insert into t1 (c1) values ('1');
select * from t1 where
c1 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c2 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c3 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c4 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c5 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c6 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c7 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c8 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c9 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC')
and c10 in ('abcdefgh', '123456789', 'qwertyuio', 'asddfgh',
'abcdefg1', '123456781', 'qwertyui1', 'asddfg1',
'abcdefg2', '123456782', 'qwertyui2', 'asddfg2',
'abcdefg3', '123456783', 'qwertyui3', 'asddfg3',
'abcdefg4', '123456784', 'qwertyui4', 'asddfg4',
'abcdefg5', '123456785', 'qwertyui5', 'asddfg5',
'abcdefg6', '123456786', 'qwertyui6', 'asddfg6',
'abcdefg7', '123456787', 'qwertyui7', 'asddfg7',
'abcdefg8', '123456788', 'qwertyui8', 'asddfg8',
'abcdefg9', '123456789', 'qwertyui9', 'asddfg9',
'abcdefgA', '12345678A', 'qwertyuiA', 'asddfgA',
'abcdefgB', '12345678B', 'qwertyuiB', 'asddfgB',
'abcdefgC', '12345678C', 'qwertyuiC', 'asddfgC');
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16
drop table t1;

View File

@ -0,0 +1,63 @@
drop database if exists hualong;
create database hualong;
use hualong;
drop table if exists r1;
drop table if exists r2;
create table hualong.r1(c1 int not null primary key, c2 int);
create table hualong.r2(a int not null primary key , b int);
rename table r1 to r2;
ERROR 42S01: Table 'r2' already exists
alter table r1 rename to r2;
ERROR 42S01: Table 'r2' already exists
rename table r1 to r3, r2 to r3;
ERROR 42S01: Table 'r3' already exists
rename table r1 to r3, r1 to r3;
ERROR 42S01: Table 'r3' already exists
rename table r1 to r3, r1 to r4;
ERROR HY000: File not exist
rename table xx to r1;
ERROR 42S01: Table 'r1' already exists
rename table xx to a.xxx;
ERROR 42000: Unknown database 'a'
rename table r1 to table1, table1 to r1;
rename table r1 to r3, r2 to r1;
rename table r3 to r3;
ERROR 42S01: Table 'r3' already exists
drop database if exists hualong2;
create database hualong2;
rename table hualong.r1 to hualong2.r1;
show tables from hualong;
Tables_in_hualong
r3
show tables from hualong2;
Tables_in_hualong2
r1
create index idx1 on hualong.r3(c1);
rename table hualong.r3 to hualong2.r2;
show tables from hualong;
Tables_in_hualong
show tables from hualong2;
Tables_in_hualong2
r1
r2
show index from hualong2.r2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
r2 0 PRIMARY 1 c1 A NULL NULL NULL BTREE available YES NULL
r2 1 idx1 1 c1 A NULL NULL NULL BTREE available YES NULL
rename table hualong2.r2 to hualong.r2;
show index from hualong.r2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
r2 0 PRIMARY 1 c1 A NULL NULL NULL BTREE available YES NULL
r2 1 idx1 1 c1 A NULL NULL NULL BTREE available YES NULL
show tables from hualong;
Tables_in_hualong
r2
rename table hualong2.r1 to hualong.r1;
rename table r1 to tmp, tmp to r1, r2 to tmp;
show tables from hualong;
Tables_in_hualong
r1
tmp
drop table hualong.r1, hualong.tmp;
drop database hualong;
drop database hualong2;

View File

@ -0,0 +1,134 @@
set @@recyclebin = off;
drop table if exists t1,t2,t3,t4;
create table t1(pk1 int, pk2 int, pk3 int, extra int, d int primary key);
insert into t1(pk1,pk2,pk3,d) values(1,1,1,1),(2,2,2,2);
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
insert into t1 values(3,null,null,NULL,3),(null,null,null,null,4);
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
3 NULL NULL NULL 3
NULL NULL NULL NULL 4
select * from t1 where extra = NULL;
pk1 pk2 pk3 extra d
select * from t1 where extra != NULL;
pk1 pk2 pk3 extra d
select * from t1 where extra <=> null;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
3 NULL NULL NULL 3
NULL NULL NULL NULL 4
select * from t1 where extra is not NULL;
pk1 pk2 pk3 extra d
select * from t1 where pk1 <=> null and pk2 <=> null and pk3 <=> null;
pk1 pk2 pk3 extra d
NULL NULL NULL NULL 4
select * from t1 where pk1 = NULL and pk3 = NULL and pk3 = NULL;
pk1 pk2 pk3 extra d
select * from t1 where pk1 != NULL and pk2 != NULL and pk3 != NULL;
pk1 pk2 pk3 extra d
select * from t1 where pk1 is not NULL and pk2 is not NULL and pk3 is not NULL;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
select * from t1 where pk1 in (NULL) and pk2 in (NULL) and pk3 in (NULL);
pk1 pk2 pk3 extra d
select * from t1 where pk1 in (NULL,1) and pk2 in (NULL, 1);
pk1 pk2 pk3 extra d
1 1 1 NULL 1
update t1 set extra=4 where pk1 = NULL and pk2 = NULL and pk3 = NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
3 NULL NULL NULL 3
NULL NULL NULL NULL 4
update t1 set extra=1 where pk1 <=> null;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
3 NULL NULL NULL 3
NULL NULL NULL 1 4
update t1 set extra=2 where pk1 <=> null and pk2 <=> null and pk3 <=> null;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 NULL 1
2 2 2 NULL 2
3 NULL NULL NULL 3
NULL NULL NULL 2 4
update t1 set extra=3 where pk1 is not NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 3 1
2 2 2 3 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
update t1 set extra=4 where pk1 is not NULL and pk2 is not NULL and pk3 is not NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
update t1 set extra=5 where pk1 != NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
update t1 set extra=6 where pk1 != NULL and pk2 != NULL and pk3 != NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
delete from t1 where pk1 != NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
delete from t1 where pk1 != NULL and pk2 != NULL and pk3 != NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
delete from t1 where pk1 = NULL and pk2 = NULL and pk3 = NULL;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
NULL NULL NULL 2 4
delete from t1 where pk1 <=> null;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
delete from t1 where pk1 <=> null and pk2 <=> null and pk3 <=> null;
select * from t1;
pk1 pk2 pk3 extra d
1 1 1 4 1
2 2 2 4 2
3 NULL NULL 3 3
delete from t1 where pk1 is not NULL and pk2 is not NULL and pk3 is not NULL;
select * from t1;
pk1 pk2 pk3 extra d
3 NULL NULL 3 3
delete from t1 where pk1 is not NULL;
select * from t1;
pk1 pk2 pk3 extra d
set @@recyclebin = off;
drop table t1;

View File

@ -0,0 +1,319 @@
drop database if exists db1;
drop database if exists db2;
create database db1;
create database db2;
use db1;
drop table if exists t1;
create table t1(c1 int key) partition by key() partitions 2;
use db2;
drop table if exists t1;
create table t1(c1 int key) partition by key() partitions 2;
select * from db1.t1,db2.t1;
c1 c1
use db1;
drop table if exists t1;
create table t1(c1 int key) partition by key(c1) partitions 2;
create database if not exists db2;
use db2;
drop table if exists t1;
create table t1(c1 int key) partition by key(c1) partitions 2;
select * from db1.t1,db2.t1;
c1 c1
use db1;
drop table if exists t1;
create table t1(c1 int key) partition by hash(c1) partitions 2;
create database if not exists db2;
use db2;
drop table if exists t1;
create table t1(c1 int key) partition by hash(c1) partitions 2;
select * from db1.t1,db2.t1;
c1 c1
drop table if exists t1;
create table t1 (c1 int primary key, c2 int);
insert into t1 values(1,8), (2,7), (3,6), (4,5);
select c1 from t1 group by t2.c1;
ERROR 42S22: Unknown column 't2.c1' in 'group statement'
select c1, c2 as c1 from t1 group by c1;
ERROR 23000: Column 'c1' in group statement is ambiguous
select c1, c2 as c1 from t1 group by t1.c1;
c1 c1
1 8
2 7
3 6
4 5
select c1 as c1, c2 as c1 from t1 group by c1;
ERROR 23000: Column 'c1' in group statement is ambiguous
select c1 as c1, c2 as c1 from t1 group by t1.c1;
c1 c1
1 8
2 7
3 6
4 5
select t1.c1 as cc from t1 group by t1.c1;
cc
1
2
3
4
select c1, c1 from t1 group by c1;
c1 c1
1 1
2 2
3 3
4 4
select 1 as c1, 2 as c2 from t1 group by c1;
c1 c2
1 2
1 2
1 2
1 2
Warnings:
Warning 1052 Column 'c1' in group statement is ambiguous
select 1 as c1, c1 from t1 group by c1;
ERROR 23000: Column 'c1' in group statement is ambiguous
select c1 as c2, c2 as c1 from t1 group by c1;
c2 c1
1 8
2 7
3 6
4 5
select c2+1 as c1, c1 from t1 group by c1;
ERROR 23000: Column 'c1' in group statement is ambiguous
select c1, c2 as c1 from t1 having t1.c1 > 2;
c1 c1
3 6
4 5
select c1, c2 + 1 as c1 from t1 having t1.c1 > 2;
c1 c1
3 7
4 6
select c1, c2 + 1 as c1 from t1 having c1 > 2;
ERROR 23000: Column 'c1' in having clause is ambiguous
select c1, c2 + 1 as c1 from t1 order by c1;
ERROR 23000: Column 'c1' in order clause is ambiguous
select c1, c2 + 1 as c1 from t1 order by t1.c1;
c1 c1
1 9
2 8
3 7
4 6
select c1, c2 + 1 as c1 from t1 group by c1;
ERROR 23000: Column 'c1' in group statement is ambiguous
select c1, c2 + 1 as c1 from t1 group by t1.c1;
c1 c1
1 9
2 8
3 7
4 6
select t1.c1 as c1 from t1 order by t1.c1;
c1
1
2
3
4
select t1.c1 as c2 from t1 order by t1.c1;
c2
1
2
3
4
drop table t1;
drop table if exists t1, t2;
create table t1 (a int(11), b char(10), key (a));
insert into t1 (a) values (1),(2),(3),(4);
create table t2 (a int);
select * from t1 left join t2 on t1.a=t2.a order by t1.a;
a b a
1 NULL NULL
2 NULL NULL
3 NULL NULL
4 NULL NULL
select * from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a) order by t1.a;
a b a
1 NULL NULL
2 NULL NULL
3 NULL NULL
4 NULL NULL
select exists(( select 1));
exists(( select 1))
1
select exists( select 1);
exists( select 1)
1
drop table t1,t2;
create table t1(c1 int, c2 int);
insert into t1 values(1, 1), (2, 2);
select * from t1 where c1<'2';
c1 c2
1 1
select * from t1 where c1>'1';
c1 c2
2 2
select * from t1 where c1='2';
c1 c2
2 2
select * from t1 where c1!='2';
c1 c2
1 1
select * from t1 where c1<='2';
c1 c2
1 1
2 2
select * from t1 where c1>='2';
c1 c2
2 2
select * from t1 where c1+'1'<=3;
c1 c2
1 1
2 2
select * from t1 where c1+'1'>=2;
c1 c2
1 1
2 2
drop table t1;
create table t1(c1 int primary key, c2 int);
insert into t1 values(1, 1), (2, 2);
select * from t1 where c1<'2';
c1 c2
1 1
select * from t1 where c1>'1';
c1 c2
2 2
select * from t1 where c1='2';
c1 c2
2 2
select * from t1 where c1!='2';
c1 c2
1 1
select * from t1 where c1<='2';
c1 c2
1 1
2 2
select * from t1 where c1>='2';
c1 c2
2 2
select * from t1 where c1+'1'<=3;
c1 c2
1 1
2 2
select * from t1 where c1+'1'>=2;
c1 c2
1 1
2 2
drop table t1;
SELECT 'a' = 'a ', 'a' LIKE 'a ';
'a' = 'a ' 'a' LIKE 'a '
1 0
SELECT 'David!' LIKE 'David_';
'David!' LIKE 'David_'
1
SELECT 'David!' LIKE '%D%v%';
'David!' LIKE '%D%v%'
1
SELECT 'David!' LIKE 'David\_';
'David!' LIKE 'David\_'
0
SELECT 'David_' LIKE 'David\_';
'David_' LIKE 'David\_'
1
SELECT 'David_' LIKE 'David|_' ESCAPE '|';
'David_' LIKE 'David|_' ESCAPE '|'
1
SELECT 'abc' LIKE 'ABC';
'abc' LIKE 'ABC'
1
SELECT 'abc' LIKE BINARY 'ABC';
'abc' LIKE BINARY 'ABC'
0
SELECT 10 LIKE '1%';
10 LIKE '1%'
1
SELECT 'David_' LIKE 'David|_' ESCAPE null;
'David_' LIKE 'David|_' ESCAPE null
0
SELECT 'David_' LIKE 'David|_' ESCAPE 1;
'David_' LIKE 'David|_' ESCAPE 1
0
SELECT 'David_' LIKE 'David|_' ESCAPE 12;
ERROR HY000: Incorrect arguments to ESCAPE
SELECT 'David_' LIKE 'David|_' ESCAPE '12';
ERROR HY000: Incorrect arguments to ESCAPE
drop table if exists a1,a2;
create table a2(rowkey_suffix2 int primary key, price2 int);
create table a1(rowkey_suffix int primary key, price int);
select (select price from a2 where 1000 > price) as 'x', a1.* as 'with_alias' from a1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'as 'with_alias' from a1' at line 1
select (select price from a2 where 1000 > price) as 'x', a1.* as with_alias from a1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'as with_alias from a1' at line 1
select 1 from dual where @a:=1 and (1, 2);
ERROR 21000: Operand should contain 1 column(s)
select 1 from dual where @a:=1 and (1, (select 2));
ERROR 21000: Operand should contain 1 column(s)
select 1 from dual where @a:=1 and (1, exists(select 2));
ERROR 21000: Operand should contain 1 column(s)
create table t1(c1 int);
select 1 from t1 where c1 in (select c1 from t1 where exists( (select 1) union (select 1)));
1
select (1 and 100) or 100;
(1 and 100) or 100
1
drop table t1;
create table t1(c1 bigint, c2 varchar(64), c3 datetime);
insert into t1 values(20101010000000, '020101010000000', '2010-10-10 00:00:00');
select * from t1 where c1=c2 and c1=cast('2010-10-10 00:00:00' as datetime);
c1 c2 c3
20101010000000 020101010000000 2010-10-10 00:00:00
drop table if exists bug;
create table bug (col_float float);
insert into bug values(100);
select ((col_float and 100) or col_float) from bug;
((col_float and 100) or col_float)
1
drop table t1;
create table test1 (id int,dt datetime(6), primary key(id, dt));
insert into test1 values (0, '2017-01-01'), (0, '2017-01-02'), (0, '2017-01-03'), (1, '2017-01-01'), (1, '2017-01-02'), (1, '2017-01-03');
select * from test1 where (id, dt) > (0, '2017-01-02') and (id, dt) <= (1, '2017-01-03');
id dt
0 2017-01-03 00:00:00.000000
1 2017-01-01 00:00:00.000000
1 2017-01-02 00:00:00.000000
1 2017-01-03 00:00:00.000000
select * from test1 where (id, dt) > (0, '2017-01-02') and (id, dt) <= (1, '2017-01-03') and dt < '2017-01-02';
id dt
1 2017-01-01 00:00:00.000000
result_format: 4
select cast '';
ERROR 42S22: Unknown column 'cast' in 'field list'
select length '';
ERROR 42S22: Unknown column 'length' in 'field list'
select yearweek '';
ERROR 42S22: Unknown column 'yearweek' in 'field list'
select lala '';
ERROR 42S22: Unknown column 'lala' in 'field list'
select 1 '';
+---+
| |
+---+
| 1 |
+---+
select 2 '';
+---+
| |
+---+
| 2 |
+---+
select 2 as '';
+---+
| |
+---+
| 2 |
+---+
select 1 as '';
+---+
| |
+---+
| 1 |
+---+
drop database if exists db1;
drop database if exists db2;

View File

@ -0,0 +1,2 @@
SELECT name FROM master.dbo.sysdatabases WHERE status <> 512;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '.sysdatabases WHERE status <> 512' at line 1

View File

@ -0,0 +1,18 @@
drop table if exists t1;
create table t1(pk int primary key, c1 int);
insert into t1 values(1,1);
begin;
select * from t1 where pk=1 for update;
pk c1
1 1
update t1 set c1=c1+1 where pk=1;
begin;
select * from t1 where t1.pk=1 for update;
commit;
pk c1
1 2
update t1 set c1=c1+1 where pk=1;
commit;
select * from t1;
pk c1
1 3

View File

@ -0,0 +1,96 @@
drop table if exists tbl1,tbl2;
create table tbl1 (pk int,i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6),i5 decimal(5,3),i6 bool, primary key(pk));
insert into tbl1 values(1,1,'abc12','1agc',1.25,'2014-01-01 12:00:00',23.23,1),
(2,10,'23abc12','4agc1',-0.25,'2015-11-01 12:00:00',-23.230,0),
(3,201,'xx23abc12','cagc1',-2.25,'2015-11-21 11:20:10',3.231,1),
(4,80,'zx23abc12','zcagc1',2.25,'2013-01-21 11:20:10',-3.231,1),
(5,53,'cx23abc12','rcagc1',109.25,'2016-01-22 11:20:10',-13.131,0);
alter system major freeze tenant = sys;
alter system major freeze tenant = all_user;
alter system major freeze tenant = all_meta;
insert into tbl1 values (6,78,'tx23abc12','icagc1',-109.25,'2014-09-16 16:24:00',-13.531,1),(8,50,'vx23abc12','wcagc1',-85.85,'2014-09-10 16:20:21',93.131,1),(9,610,'ukx23abc12','pecagc1',-1.85,'2014-09-19 16:20:21',99.131,0),(10,42,'kx23abc12','ecagc1',-85.86,'2014-09-18 16:20:21',-99.131,1),(11,null,null,null,null,null,null,null);
set autocommit=0;
set autocommit=0;
select * from tbl1 where pk=100 for update;
pk i1 v2 i3 i4 d4 i5 i6
insert into tbl1 values(100,102,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
update tbl1 set i1=i1-300 where pk in (100,1,123,8,9);
update tbl1 set pk=200 where pk=100;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
delete from tbl1 where pk in (100,200);
commit;
select * from tbl1 where pk=100 for update;
pk i1 v2 i3 i4 d4 i5 i6
insert into tbl1 values(100,102,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
update tbl1 set i1=i1-300 where pk in (100,1,123,8,9);
insert into tbl1 values(100,102,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
Got one of the listed errors
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
delete from tbl1 where pk in (100,200);
commit;
select * from tbl1 where pk=100 for update;
pk i1 v2 i3 i4 d4 i5 i6
insert into tbl1 values(100,102,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
update tbl1 set i1=i1-300 where pk in (100,1,123,8,9);
select * from tbl1 where pk=100 for update;
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
replace into tbl1 values(100,105,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
Got one of the listed errors
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
delete from tbl1 where pk in (100,200);
commit;
select * from tbl1 where pk in(100,10,1,200) for update;
pk i1 v2 i3 i4 d4 i5 i6
1 -899 abc12 1agc 1.25 2014-01-01 12:00:00.000000 23.230 1
10 42 kx23abc12 ecagc1 -85.86 2014-09-18 16:20:21.000000 -99.131 1
insert into tbl1 values(100,102,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
update tbl1 set i1=i1-300 where pk in (100,1,123,8,9);
Got one of the listed errors
update tbl1 set i1=i1-300 where pk in (100,123);
update tbl1 set pk=1 where pk=1;
Got one of the listed errors
select * from tbl1 t1 where t1.pk in(100,200) for update;
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
replace into tbl1 values(100,105,'abdggc12','1agc1d',1.215,'2014-01-01 12:00:10',83.23,1);
Got one of the listed errors
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
update tbl1 set pk=1 where pk=1;
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
commit;
select * from tbl1 where pk in (100,200);
pk i1 v2 i3 i4 d4 i5 i6
100 -198 abdggc12 1agc1d 1.215 2014-01-01 12:00:10.000000 83.230 1
delete from tbl1 where pk in (100,200);

View File

@ -0,0 +1,243 @@
drop tablegroup if exists show_create_tg_0;
create tablegroup show_create_tg_0;
show create tablegroup show_create_tg_0;
Tablegroup Create Tablegroup
show_create_tg_0 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_0` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_0;
drop tablegroup if exists show_create_tg_1;
create tablegroup show_create_tg_1 partition by hash partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_1;
Tablegroup Create Tablegroup
show_create_tg_1 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_1` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_1;
drop tablegroup if exists show_create_tg_2;
create tablegroup show_create_tg_2 partition by key 2 partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_2;
Tablegroup Create Tablegroup
show_create_tg_2 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_2` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_2;
drop tablegroup if exists show_create_tg_3;
create tablegroup show_create_tg_3 partition by range (partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_3;
Tablegroup Create Tablegroup
show_create_tg_3 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_3` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_3;
drop tablegroup if exists show_create_tg_4;
create tablegroup show_create_tg_4 partition by range columns 2 (partition p0 values less than (1, '100'), partition p1 values less than (2, '200'), partition p2 values less than (MAXVALUE, MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_4;
Tablegroup Create Tablegroup
show_create_tg_4 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_4` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_4;
drop tablegroup if exists show_create_tg_5;
create tablegroup show_create_tg_5 partition by list (partition p0 values in (0, 1), partition p1 values in (2, 3), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_5;
Tablegroup Create Tablegroup
show_create_tg_5 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_5` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_5;
drop tablegroup if exists show_create_tg_6;
create tablegroup show_create_tg_6 partition by list columns 2 (partition p0 values in (('00', 0), ('01', 1)), partition p1 values in (('02', 2), ('03', 3)), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_6;
Tablegroup Create Tablegroup
show_create_tg_6 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_6` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_6;
drop tablegroup if exists show_create_tg_7;
create tablegroup show_create_tg_7 partition by hash subpartition by range subpartition template (subpartition p0 values less than (100), subpartition p1 values less than (200), subpartition p2 values less than (MAXVALUE)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_7;
Tablegroup Create Tablegroup
show_create_tg_7 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_7` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_7;
drop tablegroup if exists show_create_tg_8;
create tablegroup show_create_tg_8 partition by hash subpartition by range columns 2 subpartition template (subpartition p0 values less than (1, '100'), subpartition p1 values less than (2, '200'), subpartition p2 values less than (MAXVALUE, MAXVALUE)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_8;
Tablegroup Create Tablegroup
show_create_tg_8 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_8` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_8;
drop tablegroup if exists show_create_tg_9;
create tablegroup show_create_tg_9 partition by hash subpartition by list subpartition template (subpartition p0 values in (0, 1), subpartition p1 values in (2, 3), subpartition p3 values in (DEFAULT)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_9;
Tablegroup Create Tablegroup
show_create_tg_9 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_9` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_9;
drop tablegroup if exists show_create_tg_10;
create tablegroup show_create_tg_10 partition by hash subpartition by list columns 2 subpartition template (subpartition p0 values in (('00', 0), ('01', 1)), subpartition p1 values in (('02', 2), ('03', 3)), subpartition p3 values in (DEFAULT)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_10;
Tablegroup Create Tablegroup
show_create_tg_10 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_10` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_10;
drop tablegroup if exists show_create_tg_11;
create tablegroup show_create_tg_11 partition by key 2 subpartition by range subpartition template (subpartition p0 values less than (100), subpartition p1 values less than (200), subpartition p2 values less than (MAXVALUE)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_11;
Tablegroup Create Tablegroup
show_create_tg_11 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_11` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_11;
drop tablegroup if exists show_create_tg_12;
create tablegroup show_create_tg_12 partition by key 2 subpartition by range columns 2 subpartition template (subpartition p0 values less than (1, '100'), subpartition p1 values less than (2, '200'), subpartition p2 values less than (MAXVALUE, MAXVALUE)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_12;
Tablegroup Create Tablegroup
show_create_tg_12 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_12` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_12;
drop tablegroup if exists show_create_tg_13;
create tablegroup show_create_tg_13 partition by key 2 subpartition by list subpartition template (subpartition p0 values in (0, 1), subpartition p1 values in (2, 3), subpartition p3 values in (DEFAULT)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_13;
Tablegroup Create Tablegroup
show_create_tg_13 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_13` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_13;
drop tablegroup if exists show_create_tg_14;
create tablegroup show_create_tg_14 partition by key 2 subpartition by list columns 2 subpartition template (subpartition p0 values in (('00', 0), ('01', 1)), subpartition p1 values in (('02', 2), ('03', 3)), subpartition p3 values in (DEFAULT)) partitions 2;
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_14;
Tablegroup Create Tablegroup
show_create_tg_14 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_14` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_14;
drop tablegroup if exists show_create_tg_15;
create tablegroup show_create_tg_15 partition by range subpartition by hash subpartitions 2 (partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_15;
Tablegroup Create Tablegroup
show_create_tg_15 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_15` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_15;
drop tablegroup if exists show_create_tg_16;
create tablegroup show_create_tg_16 partition by range subpartition by key 2 subpartitions 2 (partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_16;
Tablegroup Create Tablegroup
show_create_tg_16 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_16` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_16;
drop tablegroup if exists show_create_tg_17;
create tablegroup show_create_tg_17 partition by range subpartition by list subpartition template (subpartition p0 values in (0, 1), subpartition p1 values in (2, 3), subpartition p3 values in (DEFAULT)) (partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_17;
Tablegroup Create Tablegroup
show_create_tg_17 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_17` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_17;
drop tablegroup if exists show_create_tg_18;
create tablegroup show_create_tg_18 partition by range subpartition by list columns 2 subpartition template (subpartition p0 values in (('00', 0), ('01', 1)), subpartition p1 values in (('02', 2), ('03', 3)), subpartition p3 values in (DEFAULT)) (partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_18;
Tablegroup Create Tablegroup
show_create_tg_18 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_18` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_18;
drop tablegroup if exists show_create_tg_19;
create tablegroup show_create_tg_19 partition by range columns 2 subpartition by hash subpartitions 2 (partition p0 values less than (1, '100'), partition p1 values less than (2, '200'), partition p2 values less than (MAXVALUE, MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_19;
Tablegroup Create Tablegroup
show_create_tg_19 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_19` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_19;
drop tablegroup if exists show_create_tg_20;
create tablegroup show_create_tg_20 partition by range columns 2 subpartition by key 2 subpartitions 2 (partition p0 values less than (1, '100'), partition p1 values less than (2, '200'), partition p2 values less than (MAXVALUE, MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_20;
Tablegroup Create Tablegroup
show_create_tg_20 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_20` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_20;
drop tablegroup if exists show_create_tg_21;
create tablegroup show_create_tg_21 partition by range columns 2 subpartition by list subpartition template (subpartition p0 values in (0, 1), subpartition p1 values in (2, 3), subpartition p3 values in (DEFAULT)) (partition p0 values less than (1, '100'), partition p1 values less than (2, '200'), partition p2 values less than (MAXVALUE, MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_21;
Tablegroup Create Tablegroup
show_create_tg_21 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_21` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_21;
drop tablegroup if exists show_create_tg_22;
create tablegroup show_create_tg_22 partition by range columns 2 subpartition by list columns 2 subpartition template (subpartition p0 values in (('00', 0), ('01', 1)), subpartition p1 values in (('02', 2), ('03', 3)), subpartition p3 values in (DEFAULT)) (partition p0 values less than (1, '100'), partition p1 values less than (2, '200'), partition p2 values less than (MAXVALUE, MAXVALUE));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_22;
Tablegroup Create Tablegroup
show_create_tg_22 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_22` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_22;
drop tablegroup if exists show_create_tg_23;
create tablegroup show_create_tg_23 partition by list subpartition by hash subpartitions 2 (partition p0 values in (0, 1), partition p1 values in (2, 3), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_23;
Tablegroup Create Tablegroup
show_create_tg_23 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_23` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_23;
drop tablegroup if exists show_create_tg_24;
create tablegroup show_create_tg_24 partition by list subpartition by key 2 subpartitions 2 (partition p0 values in (0, 1), partition p1 values in (2, 3), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_24;
Tablegroup Create Tablegroup
show_create_tg_24 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_24` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_24;
drop tablegroup if exists show_create_tg_25;
create tablegroup show_create_tg_25 partition by list subpartition by range subpartition template (subpartition p0 values less than (100), subpartition p1 values less than (200), subpartition p2 values less than (MAXVALUE)) (partition p0 values in (0, 1), partition p1 values in (2, 3), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_25;
Tablegroup Create Tablegroup
show_create_tg_25 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_25` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_25;
drop tablegroup if exists show_create_tg_26;
create tablegroup show_create_tg_26 partition by list subpartition by range columns 2 subpartition template (subpartition p0 values less than (1, '100'), subpartition p1 values less than (2, '200'), subpartition p2 values less than (MAXVALUE, MAXVALUE)) (partition p0 values in (0, 1), partition p1 values in (2, 3), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
drop tablegroup if exists show_create_tg_26;
drop tablegroup if exists show_create_tg_27;
create tablegroup show_create_tg_27 partition by list columns 2 subpartition by hash subpartitions 2 (partition p0 values in (('00', 0), ('01', 1)), partition p1 values in (('02', 2), ('03', 3)), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_27;
Tablegroup Create Tablegroup
show_create_tg_27 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_27` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_27;
drop tablegroup if exists show_create_tg_28;
create tablegroup show_create_tg_28 partition by list columns 2 subpartition by key 2 subpartitions 2 (partition p0 values in (('00', 0), ('01', 1)), partition p1 values in (('02', 2), ('03', 3)), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_28;
Tablegroup Create Tablegroup
show_create_tg_28 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_28` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_28;
drop tablegroup if exists show_create_tg_29;
create tablegroup show_create_tg_29 partition by list columns 2 subpartition by range subpartition template (subpartition p0 values less than (100), subpartition p1 values less than (200), subpartition p2 values less than (MAXVALUE)) (partition p0 values in (('00', 0), ('01', 1)), partition p1 values in (('02', 2), ('03', 3)), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_29;
Tablegroup Create Tablegroup
show_create_tg_29 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_29` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_29;
drop tablegroup if exists show_create_tg_30;
create tablegroup show_create_tg_30 partition by list columns 2 subpartition by range columns 2 subpartition template (subpartition p0 values less than (1, '100'), subpartition p1 values less than (2, '200'), subpartition p2 values less than (MAXVALUE, MAXVALUE)) (partition p0 values in (('00', 0), ('01', 1)), partition p1 values in (('02', 2), ('03', 3)), partition p3 values in (DEFAULT));
Warnings:
Warning 1235 create tablegroup with partition not supported
show create tablegroup show_create_tg_30;
Tablegroup Create Tablegroup
show_create_tg_30 CREATE TABLEGROUP IF NOT EXISTS `show_create_tg_30` SHARDING = ADAPTIVE
drop tablegroup if exists show_create_tg_30;

View File

@ -0,0 +1,38 @@
select @@version_comment limit 1;
@@version_comment
ob_version_info
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SHOW COLLATION;
Collation Charset Id Default Compiled Sortlen
utf8mb4_general_ci utf8mb4 45 Yes Yes 1
utf8mb4_bin utf8mb4 46 Yes 1
binary binary 63 Yes Yes 1
gbk_chinese_ci gbk 28 Yes Yes 1
gbk_bin gbk 87 Yes 1
utf16_general_ci utf16 54 Yes Yes 1
utf16_bin utf16 55 Yes 1
utf8mb4_unicode_ci utf8mb4 224 Yes 1
utf16_unicode_ci utf16 101 Yes 1
gb18030_chinese_ci gb18030 248 Yes Yes 1
gb18030_bin gb18030 249 Yes 1
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_bin latin1 47 Yes 1
gb18030_2022_bin gb18030_2022 216 Yes 1
gb18030_2022_chinese_ci gb18030_2022 217 Yes Yes 1
gb18030_2022_chinese_cs gb18030_2022 218 Yes 1
gb18030_2022_radical_ci gb18030_2022 219 Yes 1
gb18030_2022_radical_cs gb18030_2022 220 Yes 1
gb18030_2022_stroke_ci gb18030_2022 221 Yes 1
gb18030_2022_stroke_cs gb18030_2022 222 Yes 1
SHOW CHARACTER SET;
Charset Description Default collation Maxlen
binary Binary pseudo charset binary 1
utf8mb4 UTF-8 Unicode utf8mb4_general_ci 4
gbk GBK charset gbk_chinese_ci 2
utf16 UTF-16 Unicode utf16_general_ci 2
gb18030 GB18030 charset gb18030_chinese_ci 4
latin1 cp1252 West European latin1_swedish_ci 1
gb18030_2022 GB18030-2022 charset gb18030_2022_chinese_ci 4
SET NAMES latin1;

View File

@ -0,0 +1,80 @@
show collation;
Collation Charset Id Default Compiled Sortlen
utf8mb4_general_ci utf8mb4 45 Yes Yes 1
utf8mb4_bin utf8mb4 46 Yes 1
binary binary 63 Yes Yes 1
gbk_chinese_ci gbk 28 Yes Yes 1
gbk_bin gbk 87 Yes 1
utf16_general_ci utf16 54 Yes Yes 1
utf16_bin utf16 55 Yes 1
utf8mb4_unicode_ci utf8mb4 224 Yes 1
utf16_unicode_ci utf16 101 Yes 1
gb18030_chinese_ci gb18030 248 Yes Yes 1
gb18030_bin gb18030 249 Yes 1
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_bin latin1 47 Yes 1
gb18030_2022_bin gb18030_2022 216 Yes 1
gb18030_2022_chinese_ci gb18030_2022 217 Yes Yes 1
gb18030_2022_chinese_cs gb18030_2022 218 Yes 1
gb18030_2022_radical_ci gb18030_2022 219 Yes 1
gb18030_2022_radical_cs gb18030_2022 220 Yes 1
gb18030_2022_stroke_ci gb18030_2022 221 Yes 1
gb18030_2022_stroke_cs gb18030_2022 222 Yes 1
show collation;
Collation Charset Id Default Compiled Sortlen
utf8mb4_general_ci utf8mb4 45 Yes Yes 1
utf8mb4_bin utf8mb4 46 Yes 1
binary binary 63 Yes Yes 1
gbk_chinese_ci gbk 28 Yes Yes 1
gbk_bin gbk 87 Yes 1
utf16_general_ci utf16 54 Yes Yes 1
utf16_bin utf16 55 Yes 1
utf8mb4_unicode_ci utf8mb4 224 Yes 1
utf16_unicode_ci utf16 101 Yes 1
gb18030_chinese_ci gb18030 248 Yes Yes 1
gb18030_bin gb18030 249 Yes 1
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_bin latin1 47 Yes 1
gb18030_2022_bin gb18030_2022 216 Yes 1
gb18030_2022_chinese_ci gb18030_2022 217 Yes Yes 1
gb18030_2022_chinese_cs gb18030_2022 218 Yes 1
gb18030_2022_radical_ci gb18030_2022 219 Yes 1
gb18030_2022_radical_cs gb18030_2022 220 Yes 1
gb18030_2022_stroke_ci gb18030_2022 221 Yes 1
gb18030_2022_stroke_cs gb18030_2022 222 Yes 1
show collation test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'test' at line 1
SHOW CHARACTER SET;
Charset Description Default collation Maxlen
binary Binary pseudo charset binary 1
utf8mb4 UTF-8 Unicode utf8mb4_general_ci 4
gbk GBK charset gbk_chinese_ci 2
utf16 UTF-16 Unicode utf16_general_ci 2
gb18030 GB18030 charset gb18030_chinese_ci 4
latin1 cp1252 West European latin1_swedish_ci 1
gb18030_2022 GB18030-2022 charset gb18030_2022_chinese_ci 4
SHOW CHARACTER SET;
Charset Description Default collation Maxlen
binary Binary pseudo charset binary 1
utf8mb4 UTF-8 Unicode utf8mb4_general_ci 4
gbk GBK charset gbk_chinese_ci 2
utf16 UTF-16 Unicode utf16_general_ci 2
gb18030 GB18030 charset gb18030_chinese_ci 4
latin1 cp1252 West European latin1_swedish_ci 1
gb18030_2022 GB18030-2022 charset gb18030_2022_chinese_ci 4
SHOW CHARACTER SET test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'test' at line 1
set names utf8;
set names utf8;
set names;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'names' at line 1
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'test' at line 1
show girls;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'girls' at line 1
show girls;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'girls' at line 1
show girls test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'girls test' at line 1

View File

@ -0,0 +1,42 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (pk int primary key,c1 INT, c2 CHAR(100),c3 FLOAT);
SELECT * FROM t1 where pk = 1;
pk c1 c2 c3
INSERT INTO t1 VALUES (1, null,null,0.0);
INSERT INTO t1 VALUES (2, 1,'',1.0);
INSERT INTO t1 VALUES (3, 2,'abcde',2.0);
INSERT INTO t1 VALUES (4, 100,'abcdefghij',3.0);
CREATE TABLE t2 (pk int primary key,c1 INT, c2 VARCHAR(100));
INSERT INTO t2 VALUES (1, 1,'abcde');
INSERT INTO t2 VALUES (2, 2,'abcde');
SELECT sb1,sb2,sb3 FROM (SELECT c1 AS sb1, c2 AS sb2, c3*2 AS sb3
FROM t1) AS sb WHERE sb1 > 1;
sb1 sb2 sb3
2 abcde 4
100 abcdefghij 6
SELECT AVG(sum_column1) FROM (SELECT SUM(c1) AS sum_column1 FROM t1
GROUP BY c1) AS t1;
AVG(sum_column1)
34.3333
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (pk int primary key, c1 INT, c2 VARCHAR(100),c3 FLOAT);
INSERT INTO t1 VALUES (1, null,null,0.0);
INSERT INTO t1 VALUES (2, 1,'',1.0);
INSERT INTO t1 VALUES (3, 2,'abcde',2.0);
INSERT INTO t1 VALUES (4, 100,'abcdefghij',3.0);
CREATE TABLE t2 (pk int primary key, c1 INT, c2 VARCHAR(100));
INSERT INTO t2 VALUES (1, 1,'abcde');
INSERT INTO t2 VALUES (2, 2,'abcde');
SELECT sb1,sb2,sb3 FROM (SELECT c1 AS sb1, c2 AS sb2, c3*2 AS sb3
FROM t1) AS sb WHERE sb1 > 1;
sb1 sb2 sb3
2 abcde 4
100 abcdefghij 6
SELECT AVG(sum_column1) FROM (SELECT SUM(c1) AS sum_column1 FROM t1
GROUP BY c1) AS t1;
AVG(sum_column1)
34.3333
DROP TABLE t1;
DROP TABLE t2;

View File

@ -0,0 +1,32 @@
drop table if exists t1,t2,t3,a,b;
CREATE TABLE t1 (pk int primary key, c1 INT, c2 VARCHAR(100),c3 FLOAT);
INSERT INTO t1 VALUES (1, null,null,0.0);
INSERT INTO t1 VALUES (2, 1,'',1.0);
INSERT INTO t1 VALUES (3, 2,'abcde',2.0);
INSERT INTO t1 VALUES (4, 100,'abcdefghij',3.0);
CREATE TABLE t2 (pk int primary key, c1 INT, c2 VARCHAR(100));
INSERT INTO t2 VALUES (1, 1,'abcde');
INSERT INTO t2 VALUES (2, 2,'abcde');
SELECT sb1,sb2,sb3 FROM (SELECT c1 AS sb1, c2 AS sb2, c3*2 AS sb3
FROM t1) AS sb WHERE sb1 > 1;
sb1 sb2 sb3
2 abcde 4
100 abcdefghij 6
SELECT AVG(sum_column1) FROM (SELECT SUM(c1) AS sum_column1 FROM t1
GROUP BY c1) AS t1;
AVG(sum_column1)
34.3333
DROP TABLE t1;
DROP TABLE t2;
create table a(pk2 int primary key, a1 int, a2 int, a3 int) partition by key(pk2) partitions 4;
create table b(pk1 int primary key, b1 int, b2 int, b3 int) partition by key(pk1) partitions 3;
select a2 from (select *,case b1 when 1 then 2 else 3 end as c from a left join b on a2=b2) v where c>1;
a2
drop table a;
drop table b;
create table t2(c1 int primary key, c2 int, c3 varchar(32)) partition by hash (c1) partitions 3;
create table t3(c1 int primary key, c2 int, c3 varchar(32)) partition by hash (c1) partitions 2;
select tb.c2, tb.c3 from (select t.* from (select * from t2 WHERE c2 = 1) t left JOIN t3 b on t.c3=b.c3)tb;
c2 c3
drop table t2;
drop table t3;

View File

@ -0,0 +1,168 @@
SELECT SUBSTRING_INDEX(NULL, NULL, NULL);
SUBSTRING_INDEX(NULL, NULL, NULL)
NULL
SELECT SUBSTRING_INDEX(NULL, NULL, 0);
SUBSTRING_INDEX(NULL, NULL, 0)
NULL
SELECT SUBSTRING_INDEX(NULL, NULL, 3);
SUBSTRING_INDEX(NULL, NULL, 3)
NULL
SELECT SUBSTRING_INDEX(NULL, NULL, -3);
SUBSTRING_INDEX(NULL, NULL, -3)
NULL
SELECT SUBSTRING_INDEX('abcdabcdabc', NULL, NULL);
SUBSTRING_INDEX('abcdabcdabc', NULL, NULL)
NULL
SELECT SUBSTRING_INDEX('abcdabcdabc', NULL, 0);
SUBSTRING_INDEX('abcdabcdabc', NULL, 0)
NULL
SELECT SUBSTRING_INDEX('abcdabcdabc', NULL, 3);
SUBSTRING_INDEX('abcdabcdabc', NULL, 3)
NULL
SELECT SUBSTRING_INDEX('abcdabcdabc', NULL, -3);
SUBSTRING_INDEX('abcdabcdabc', NULL, -3)
NULL
SELECT SUBSTRING_INDEX(NULL, 'abc', NULL);
SUBSTRING_INDEX(NULL, 'abc', NULL)
NULL
SELECT SUBSTRING_INDEX(NULL, 'abc', 0);
SUBSTRING_INDEX(NULL, 'abc', 0)
NULL
SELECT SUBSTRING_INDEX(NULL, 'abc', 3);
SUBSTRING_INDEX(NULL, 'abc', 3)
NULL
SELECT SUBSTRING_INDEX(NULL, 'abc', -3);
SUBSTRING_INDEX(NULL, 'abc', -3)
NULL
SELECT SUBSTRING_INDEX('', '', 0);
SUBSTRING_INDEX('', '', 0)
SELECT SUBSTRING_INDEX('', '', 3);
SUBSTRING_INDEX('', '', 3)
SELECT SUBSTRING_INDEX('', '', -3);
SUBSTRING_INDEX('', '', -3)
SELECT SUBSTRING_INDEX('abcdabcdabc', '', 0);
SUBSTRING_INDEX('abcdabcdabc', '', 0)
SELECT SUBSTRING_INDEX('abcdabcdabc', '', 3);
SUBSTRING_INDEX('abcdabcdabc', '', 3)
SELECT SUBSTRING_INDEX('abcdabcdabc', '', -3);
SUBSTRING_INDEX('abcdabcdabc', '', -3)
SELECT SUBSTRING_INDEX('', 'abc', 0);
SUBSTRING_INDEX('', 'abc', 0)
SELECT SUBSTRING_INDEX('', 'abc', 3);
SUBSTRING_INDEX('', 'abc', 3)
SELECT SUBSTRING_INDEX('', 'abc', -3);
SUBSTRING_INDEX('', 'abc', -3)
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', 0);
SUBSTRING_INDEX('abcdabcdabc', 'abc', 0)
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', 3);
SUBSTRING_INDEX('abcdabcdabc', 'abc', 3)
abcdabcd
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', -3);
SUBSTRING_INDEX('abcdabcdabc', 'abc', -3)
dabcdabc
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', '0');
SUBSTRING_INDEX('abcdabcdabc', 'abc', '0')
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', '3');
SUBSTRING_INDEX('abcdabcdabc', 'abc', '3')
abcdabcd
SELECT SUBSTRING_INDEX('abcdabcdabc', 'abc', '-3');
SUBSTRING_INDEX('abcdabcdabc', 'abc', '-3')
dabcdabc
SELECT SUBSTRING_INDEX(1.414, 1, '-1');
SUBSTRING_INDEX(1.414, 1, '-1')
4
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775806);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775806)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775807);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775807)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775808);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775808)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775809);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775809)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775810);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775810)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775811);
SUBSTRING_INDEX( 'www.mysql.com','.', 9223372036854775811)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775806);
SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775806)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775807);
SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775807)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775808);
SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775808)
www.mysql.com
select SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775809);
SUBSTRING_INDEX( 'www.mysql.com','.', -9223372036854775809)
www.mysql.com
select substring_index('aaaaaaaaa1','aa',5);
substring_index('aaaaaaaaa1','aa',5)
aaaaaaaaa1
select substring_index('aaaaaaaaa1','aa',4);
substring_index('aaaaaaaaa1','aa',4)
aaaaaa
select substring_index('aaaaaaaaa1','aa',3);
substring_index('aaaaaaaaa1','aa',3)
aaaa
select substring_index('aaaaaaaaa1','aa',2);
substring_index('aaaaaaaaa1','aa',2)
aa
select substring_index('aaaaaaaaa1','aa',1);
substring_index('aaaaaaaaa1','aa',1)
select substring_index('aaaaaaaaa1','aa',0);
substring_index('aaaaaaaaa1','aa',0)
select substring_index('aaaaaaaaa1','aa',-1);
substring_index('aaaaaaaaa1','aa',-1)
1
select substring_index('aaaaaaaaa1','aa',-2);
substring_index('aaaaaaaaa1','aa',-2)
aa1
select substring_index('aaaaaaaaa1','aa',-3);
substring_index('aaaaaaaaa1','aa',-3)
aaaa1
select substring_index('aaaaaaaaa1','aa',-4);
substring_index('aaaaaaaaa1','aa',-4)
aaaaaa1
select substring_index('aaaaaaaaa1','aa',-5);
substring_index('aaaaaaaaa1','aa',-5)
aaaaaaaaa1
select substring_index('aaaaaaaaa1','aaaa',3);
substring_index('aaaaaaaaa1','aaaa',3)
aaaaaaaaa1
select substring_index('aaaaaaaaa1','aaaa',2);
substring_index('aaaaaaaaa1','aaaa',2)
aaaa
select substring_index('aaaaaaaaa1','aaaa',-1);
substring_index('aaaaaaaaa1','aaaa',-1)
1
select substring_index('aaaaaaaaa1','aaaa',0);
substring_index('aaaaaaaaa1','aaaa',0)
select substring_index('aaaaaaaaa1','aaaa',-1);
substring_index('aaaaaaaaa1','aaaa',-1)
1
select substring_index('aaaaaaaaa1','aaaa',-2);
substring_index('aaaaaaaaa1','aaaa',-2)
aaaa1
select substring_index('aaaaaaaaa1','aaaa',-3);
substring_index('aaaaaaaaa1','aaaa',-3)
aaaaaaaaa1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
drop table if exists t2;
drop table if exists t3;
create table t2 (i int primary key, j int);
insert into t2 values (1,1);
set autocommit = 1;
insert into t2 values (2,2);
commit;
rollback;
select * from t2;
i j
1 1
2 2
set autocommit = 0;
insert into t2 values (3,3);
rollback;
insert into t2 values (3,3);
commit;
insert into t2 values (3,3);
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
rollback;
commit;
set autocommit = 0;
insert into t2 values (4,4);
create table t3 (i int primary key, j int);
select * from t2;
i j
1 1
2 2
3 3
4 4
rollback;
select * from t2;
i j
1 1
2 2
3 3
4 4
set autocommit = 0;
insert into t2 values (5,5);
set autocommit = 1;
rollback;
select * from t2;
i j
1 1
2 2
3 3
4 4
5 5
set autocommit = 0;
insert into t2 values (6,6);
begin;
rollback;
select * from t2;
i j
1 1
2 2
3 3
4 4
5 5
6 6
drop table if exists t2;
drop table if exists t3;

View File

@ -0,0 +1,29 @@
use test;
drop table if exists tc1;
create table tc1(c1 int not null primary key, c2 varchar(11));
insert into tc1 values (1, 'aaa');
insert into tc1 values (2, 'bbbb');
insert into tc1 values (3, 'ccccc');
create index idxc2 on tc1(c2);
alter table tc1 add index idxc3(c1,c2);
select * from tc1;
c1 c2
1 aaa
2 bbbb
3 ccccc
show index from tc1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
tc1 0 PRIMARY 1 c1 A NULL NULL NULL BTREE available YES NULL
tc1 1 idxc2 1 c2 A NULL NULL NULL YES BTREE available YES NULL
tc1 1 idxc3 1 c1 A NULL NULL NULL BTREE available YES NULL
tc1 1 idxc3 2 c2 A NULL NULL NULL YES BTREE available YES NULL
truncate table tc1;
select * from tc1;
c1 c2
show index from tc1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
tc1 0 PRIMARY 1 c1 A NULL NULL NULL BTREE available YES NULL
tc1 1 idxc2 1 c2 A NULL NULL NULL YES BTREE available YES NULL
tc1 1 idxc3 1 c1 A NULL NULL NULL BTREE available YES NULL
tc1 1 idxc3 2 c2 A NULL NULL NULL YES BTREE available YES NULL
drop table tc1;

View File

@ -0,0 +1,43 @@
drop table if exists t1,t2,t3,t4;
create table t1(id int primary key, money1 int, when1 datetime default now());
insert into t1(id,money1) values(1,100);
insert into t1(id,money1) values(2,100);
select id,money1,when1 from t1;
id money1 when1
1 100 searched
2 100 searched
id1 - 100 id2 + 100
begin;
update t1 set money1 = money1-100 where id = 1;
update t1 set money1 = money1+100 where id = 2;
commit;
select id,money1,when1 from t1;
id money1 when1
1 0 searched
2 200 searched
select id,money1,when1 from t1;
id money1 when1
1 0 searched
2 200 searched
drop table t1;
create table t1(id int primary key, money1 int, when1 datetime default now());
insert into t1(id,money1) values(1,100);
insert into t1(id,money1) values(2,100);
select id,money1,when1 from t1;
id money1 when1
1 100 searched
2 100 searched
id1 - 100 id2 + 100
begin;
update t1 set money1 = money1-100 where id = 1;
update t1 set money1 = money1+100 where id = 2;
ERROR HY000: OceanBase server has gone away
commit;
ERROR HY000: OceanBase server has gone away
select id,money1,when1 from t1;
id money1 when1
1 100 searched
2 100 searched
send failed
receive failed
drop table t1;

View File

@ -0,0 +1,49 @@
drop table if exists t1,t2,t3,t4;
create table t1(id int primary key, money1 int);
insert into t1(id,money1) values(1,100);
create table t2(id int primary key, money1 int);
insert into t2(id,money1) values(1,100);
select id,money1 from t1;
id money1
1 100
select id,money1 from t2;
id money1
1 100
id1 - 100 id2 + 100
begin;
update t1 set money1 = money1-100 where id = 1;
update t2 set money1 = money1+100 where id = 1;
commit;
select id,money1 from t1;
id money1
1 0
select id,money1 from t2;
id money1
1 200
drop table t1;
drop table t2;
create table t1(id int primary key, money1 int);
insert into t1(id,money1) values(1,100);
create table t2(id int primary key, money1 int);
insert into t2(id,money1) values(1,100);
select id,money1 from t1;
id money1
1 100
select id,money1 from t2;
id money1
1 100
id1 - 100 id2 + 100
begin;
update t1 set money1 = money1-100 where id = 1;
update t2 set money1 = money1+100 where id = 1;
ERROR HY000: OceanBase server has gone away
commit;
ERROR HY000: OceanBase server has gone away
select id,money1 from t1;
id money1
1 100
select id,money1 from t2;
id money1
1 100
drop table t1;
drop table t2;

View File

@ -0,0 +1,29 @@
drop table if exists t1,t2,t3,t4;
create table t1(id int primary key, money1 int);
insert into t1 values(1,100);
begin;
update t1 set money1 = money1+100 where id=2;
begin;
insert into t1 values(2,100);
commit;
ROLLBACK;
select * from t1;
id money1
1 100
begin;
insert into t1 values(3,100);
commit;
begin;
update t1 set money1 = money1+100 where id=3;
set @@ob_trx_timeout=100000000;
begin;
set @@ob_query_timeout = 10000000;
delete from t1 where id = 3;
Got one of the listed errors
commit;
ROLLBACK;
select * from t1;
id money1
1 100
3 200
drop table t1;

View File

@ -0,0 +1,54 @@
drop table if exists t1;
set timeout to 10s
set global ob_trx_timeout = 10000000;
create table t1(c1 int primary key, c2 int);
insert into t1 values(1,1);
insert into t1 values(2,2);
insert into t1 values(3,3);
create 2 sessions
trx timeout
begin;
insert into t1 values(4,4);
insert into t1 values(5,5);
insert into t1 values(6,6);
commit;
select * from t1;
c1 c2
1 1
2 2
3 3
4 4
5 5
6 6
begin;
insert into t1 values(7,7);
insert into t1 values(8,8);
insert into t1 values(9,9);
insert into t1 values(10,10);
commit;
ERROR 40000: Transaction rollbacked
select * from t1;
c1 c2
1 1
2 2
3 3
4 4
5 5
6 6
trx idle timeout
begin;
insert into t1 values(11,11);
insert into t1 values(12,12);
ERROR 25000: Transaction timeout occurred, please rollback the transaction, set the variable ob_trx_timeout to a larger value and then restart the transaction
commit;
ERROR 40000: Transaction rollbacked
select * from t1;
c1 c2
1 1
2 2
3 3
4 4
5 5
6 6
test two users
set global ob_trx_timeout = 100000000;

View File

@ -0,0 +1,7 @@
drop table if exists t1;
create table t1(pk int primary key, i1 int, v1 varchar(20));
set autocommit=0;
set session ob_trx_timeout=10000000;
delete from t1 where pk<4;
commit;
ERROR 40000: Transaction rollbacked

View File

@ -0,0 +1,176 @@
(select /*+index(t1 i1) */ pk1,c1 from t1 where c1<30 order by c1) union all (select /*+index(t1 i1) */ pk1,c1 from t1 where c1 > 10 order by c1);
pk1 c1
1 44
2 33
3 22
3 22
4 11
4 11
select * from ((select /*+index(t1 i1) */ pk1,c1 from t1 where c1<30 order by c1) union all (select /*+index(t1 i1) */ pk1,c1 from t2 where c1 > 10 order by c1) ) a order by pk1, a.c1;
pk1 c1
1 44
3 22
3 22
4 11
4 11
5 33
6 33
(select /*+index(t1 i1) */ pk1,c1 from t1 where c1<30 order by c1) union (select /*+index(t1 i1) */ pk1,c1 from t1 where c1 > 10 order by c1);
pk1 c1
1 44
2 33
3 22
4 11
(select /*+index(t1 i1) */ pk1,c1 from t1 where c1<30 order by c1) except (select /*+index(t1 i1) */ pk1,c1 from t1 where c1 > 10 order by c1);
pk1 c1
(select /*+index(t1 i1) */ pk1,c1 from t1 where c1<30 order by c1) intersect (select /*+index(t1 i1) */ pk1,c1 from t1 where c1 > 10 order by c1);
pk1 c1
3 22
4 11
(select c1,c2,c3 from t1 where c1=11 order by c2) union (select c1,c2,c3 from t1 where c1=22 and c2 like 'column3_' order by c1) union distinct select c1,c2,c3 from t1 where c1>22 and c2 is not null and c3>='2013-12-11 11:11:11' union all (select c1,c2,c3 from t1 where c4<2 and c5>1 and c6=3 order by c4) except (select c1,c2,c3 from t1 where c3 <= '2013-12-11 11:11:11' order by c3);
c1 c2 c3
11 column42 2013-12-11 11:11:14.000000
22 column32 2013-12-11 11:11:13.000000
33 column21 2013-12-11 11:11:12.000000
select * from ((select * from t1 where c1=44) union (select * from t1 where c1=33 and c2 like 'column%') union all (select * from t1 where c4>2 and c5<3 and c6 != 2)) as a;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
select * from ((select * from t1 where c1=44) union all (select * from t1 where c1=33 and c2 like 'column%') except (select * from t1 where c4>2 and c5<3 and c6 != 2)) as a;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
select * from ((select * from t1 where c1=44) intersect (select * from t1 where c1=33 and c2 like 'column%') union all (select * from t1 where c4>2 and c5<3 and c6 != 2)) as a;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
(select c1,c4 from t1 where c1 in (33,11) order by c1) union all select c1,c4 from t1 where c1=44;
c1 c4
11 1
33 3
44 4
(select c1,c4 from t1 where c1 in (1,44) order by c1) union all (select c1,c4 from t1 where c1 in (33,11) order by c1);
c1 c4
11 1
33 3
44 4
(select c1,c4 from t1 where c1 in (1,44) order by c1) union all (select c1,c4 from t1 where c1 =33 order by c4);
c1 c4
33 3
44 4
select c1,c4 from t1 where c1=44 union (select c1,c4 from t1 where c1 not in (33,11) order by c1);
c1 c4
22 2
44 4
(select c1,c4 from t1 where c1 not in (33,11) order by c1) except select c1,c4 from t1 where c1=44;
c1 c4
22 2
(select c1,c4 from t1 where c1 not in (33,11) order by c1) intersect select c1,c4 from t1 where c1=44;
c1 c4
44 4
(select c4,c5,c6 from t1 order by c1 limit 2) union all (select c4,c5,c6 from t1 order by c4 limit 1) order by c4 desc;
c4 c5 c6
2 1 2
1 3 2
1 3 2
(select c4,c5,c6 from t1 order by c4 limit 2) union (select c4,c5,c6 from t1 order by c4 limit 1) order by c4 desc;
c4 c5 c6
2 1 2
1 3 2
(select c4,c5,c6 from t1 order by c2 limit 2) except (select c4,c5,c6 from t1 order by c4 limit 1) order by c4 desc;
c4 c5 c6
4 2 3
3 1 3
(select c4,c5,c6 from t1 order by c4 limit 2) intersect (select c4,c5,c6 from t1 order by c4 limit 1) order by c4 desc;
c4 c5 c6
1 3 2
select /*+index(t1 i1)*/ pk1,c1 from t1 union select /*+index(t2 i11)*/ pk1,c1 from t2;
pk1 c1
1 44
2 10
2 33
3 22
4 11
5 33
6 33
select /*+index(t1 i1)*/ pk1,c1 from t1 union all select /*+index(t2 i11)*/ pk1,c1 from t2;
pk1 c1
1 44
1 44
2 10
2 33
3 22
3 22
4 11
4 11
5 33
6 33
select /*+index(t1 i1)*/ pk1,c1 from t1 except select /*+index(t2 i11)*/ pk1,c1 from t2;
pk1 c1
2 33
select /*+index(t1 i1)*/ pk1,c1 from t1 intersect select /*+index(t2 i11)*/ pk1,c1 from t2;
pk1 c1
1 44
3 22
4 11
(select t1.c1,t2.c4 from t1,t2 where t1.c1=t2.c1 order by t1.c1) union (select c1,c4 from t2 where c1=44 order by c1);
c1 c4
11 1
22 2
33 0
33 3
44 4
(select c1,c4 from t2 where c1=44 order by c1) union (select t1.c1,t2.c4 from t1,t2 where t1.c1=t2.c1 order by t1.c1);
c1 c4
11 1
22 2
33 0
33 3
44 4
(select t1.c1,t2.c4 from t1,t2 where t1.c1=t2.c1 order by t2.c1) union all (select c1,c4 from t2 where c1=44 order by c1);
c1 c4
11 1
22 2
33 0
33 3
44 4
44 4
(select t1.c1,t2.c4 from t1,t2 where t1.c1=t2.c1 order by t1.c1) except (select c1,c4 from t2 where c1=44 order by c2);
c1 c4
11 1
22 2
33 0
33 3
(select t1.c1,t2.c4 from t1,t2 where t1.c1=t2.c1 order by t2.c1) intersect (select c1,c4 from t2 where c1=44 order by c1);
c1 c4
44 4
select * from (select * from t1 where pk1 in(1,2,3,4,5,6)) a order by pk2;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
3 primarykey3 2013-12-11 01:01:03.000000 22 column32 2013-12-11 11:11:13.000000 2 1 2
4 primarykey4 2013-12-11 01:01:04.000000 11 column42 2013-12-11 11:11:14.000000 1 3 2
select * from (select * from t1 where pk1 in(1,2,3,4,5,6) order by pk1) a order by pk2;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
3 primarykey3 2013-12-11 01:01:03.000000 22 column32 2013-12-11 11:11:13.000000 2 1 2
4 primarykey4 2013-12-11 01:01:04.000000 11 column42 2013-12-11 11:11:14.000000 1 3 2
select * from (select * from t1 where pk1 in(1,2,3,4,5,6) order by pk1) a order by pk1;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
3 primarykey3 2013-12-11 01:01:03.000000 22 column32 2013-12-11 11:11:13.000000 2 1 2
4 primarykey4 2013-12-11 01:01:04.000000 11 column42 2013-12-11 11:11:14.000000 1 3 2
select * from (select * from t1 where pk1 in(1,2,3,4,5,6) order by pk1) a where a.c2>='abc' order by pk1;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
3 primarykey3 2013-12-11 01:01:03.000000 22 column32 2013-12-11 11:11:13.000000 2 1 2
4 primarykey4 2013-12-11 01:01:04.000000 11 column42 2013-12-11 11:11:14.000000 1 3 2
select * from (select * from t1 where pk1 in(1,2,3,4,5,6) order by pk1) a where a.c2>='abc' order by pk2;
pk1 pk2 pk3 c1 c2 c3 c4 c5 c6
1 primarykey1 2013-12-11 01:01:01.000000 44 column11 2013-12-11 11:11:11.000000 4 2 3
2 primarykey2 2013-12-11 01:01:02.000000 33 column21 2013-12-11 11:11:12.000000 3 1 3
3 primarykey3 2013-12-11 01:01:03.000000 22 column32 2013-12-11 11:11:13.000000 2 1 2
4 primarykey4 2013-12-11 01:01:04.000000 11 column42 2013-12-11 11:11:14.000000 1 3 2

View File

@ -0,0 +1,19 @@
drop database if exists db1;
create database if not exists db1;
use db1;
drop table if exists test;
create table test(c1 int primary key, c2 int, c3 int);
insert into test values(1,1,1);
insert into test values(2,2,2);
set @@global.ob_enable_plan_cache= 0;
use db1;
update test set c2=c1+c2, c3=c2+c1;
succeed
succeed
select * from test;
c1 c2 c3
1 2 3
2 4 6
set @@global.ob_enable_plan_cache= 1;
drop table test;
drop database db1;

View File

@ -0,0 +1,37 @@
drop table if exists t1;
create table t1(pk int primary key, c1 int);
insert into t1 values(1,2), (2, 3),(3,4),(4,5);
select * from t1;
pk c1
1 2
2 3
3 4
4 5
update t1 set c1=pk ;
select * from t1;
pk c1
1 1
2 2
3 3
4 4
update t1 set c1=pk where pk=1 ;
select * from t1;
pk c1
1 1
2 2
3 3
4 4
update t1 set c1=pk where pk in (1,2,3,4) ;
select * from t1;
pk c1
1 1
2 2
3 3
4 4
update t1 set c1=pk-0 ;
select * from t1;
pk c1
1 1
2 2
3 3
4 4

View File

@ -0,0 +1,66 @@
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
drop table if exists tbl1;
create table tbl1 (pk int,i1 int, v2 varchar(80), i3 char(20),i4 float, d4 datetime(6),i5 decimal(5,3),i6 bool, primary key(pk));
insert into tbl1 values(1,1,'abc12','1agc',1.25,'2014-01-01 12:00:00',23.23,1),
(2,10,'23abc12','4agc1',-0.25,'2015-11-01 12:00:00',-23.230,0),
(3,201,'xx23abc12','cagc1',-2.25,'2015-11-21 11:20:10',3.231,1),
(4,80,'zx23abc12','zcagc1',2.25,'2013-01-21 11:20:10',-3.231,1),
(5,53,'cx23abc12','rcagc1',109.25,'2016-01-22 11:20:10',-13.131,0),
(6,78,'tx23abc12','icagc1',-109.25,'2014-09-16 16:24:00',-13.531,1),
(7,400,'yx23abc12','ocagc1',85.85,'2014-09-17 16:20:21',-93.131,0),
(8,50,'vx23abc12','wcagc1',-85.85,'2014-09-10 16:20:21',93.131,1),
(9,610,'ukx23abc12','pecagc1',-1.85,'2014-09-19 16:20:21',99.131,0),
(10,42,'kx23abc12','ecagc1',-85.86,'2014-09-18 16:20:21',-99.131,1),
(11,null,null,null,null,null,null,null);
create unique index idx_1 on tbl1(i1);
select date_sub(null, INTERVAL -6 DAY);
date_sub(null, INTERVAL -6 DAY)
NULL
select * from tbl1;
pk i1 v2 i3 i4 d4 i5 i6
1 1 abc12 1agc 1.25 2014-01-01 12:00:00.000000 23.230 1
2 10 23abc12 4agc1 -0.25 2015-11-01 12:00:00.000000 -23.230 0
3 201 xx23abc12 cagc1 -2.25 2015-11-21 11:20:10.000000 3.231 1
4 80 zx23abc12 zcagc1 2.25 2013-01-21 11:20:10.000000 -3.231 1
5 53 cx23abc12 rcagc1 109.25 2016-01-22 11:20:10.000000 -13.131 0
6 78 tx23abc12 icagc1 -109.25 2014-09-16 16:24:00.000000 -13.531 1
7 400 yx23abc12 ocagc1 85.85 2014-09-17 16:20:21.000000 -93.131 0
8 50 vx23abc12 wcagc1 -85.85 2014-09-10 16:20:21.000000 93.131 1
9 610 ukx23abc12 pecagc1 -1.85 2014-09-19 16:20:21.000000 99.131 0
10 42 kx23abc12 ecagc1 -85.86 2014-09-18 16:20:21.000000 -99.131 1
11 NULL NULL NULL NULL NULL NULL NULL
update tbl1 set i1=i1-20 where pk<=11 limit 20;
update tbl1 set i1=i1+20 where pk<=11 limit 20;
select * from tbl1;
pk i1 v2 i3 i4 d4 i5 i6
1 1 abc12 1agc 1.25 2014-01-01 12:00:00.000000 23.230 1
2 10 23abc12 4agc1 -0.25 2015-11-01 12:00:00.000000 -23.230 0
3 201 xx23abc12 cagc1 -2.25 2015-11-21 11:20:10.000000 3.231 1
4 80 zx23abc12 zcagc1 2.25 2013-01-21 11:20:10.000000 -3.231 1
5 53 cx23abc12 rcagc1 109.25 2016-01-22 11:20:10.000000 -13.131 0
6 78 tx23abc12 icagc1 -109.25 2014-09-16 16:24:00.000000 -13.531 1
7 400 yx23abc12 ocagc1 85.85 2014-09-17 16:20:21.000000 -93.131 0
8 50 vx23abc12 wcagc1 -85.85 2014-09-10 16:20:21.000000 93.131 1
9 610 ukx23abc12 pecagc1 -1.85 2014-09-19 16:20:21.000000 99.131 0
10 42 kx23abc12 ecagc1 -85.86 2014-09-18 16:20:21.000000 -99.131 1
11 NULL NULL NULL NULL NULL NULL NULL
update tbl1 set v2=concat(v2,'abc') where i1<=100 order by i1 limit 10;
update tbl1 set v2=substr(v2,1,10) where i1<=100 order by i1 limit 10;
select * from tbl1;
pk i1 v2 i3 i4 d4 i5 i6
1 1 abc12abc 1agc 1.25 2014-01-01 12:00:00.000000 23.230 1
2 10 23abc12abc 4agc1 -0.25 2015-11-01 12:00:00.000000 -23.230 0
3 201 xx23abc12 cagc1 -2.25 2015-11-21 11:20:10.000000 3.231 1
4 80 zx23abc12a zcagc1 2.25 2013-01-21 11:20:10.000000 -3.231 1
5 53 cx23abc12a rcagc1 109.25 2016-01-22 11:20:10.000000 -13.131 0
6 78 tx23abc12a icagc1 -109.25 2014-09-16 16:24:00.000000 -13.531 1
7 400 yx23abc12 ocagc1 85.85 2014-09-17 16:20:21.000000 -93.131 0
8 50 vx23abc12a wcagc1 -85.85 2014-09-10 16:20:21.000000 93.131 1
9 610 ukx23abc12 pecagc1 -1.85 2014-09-19 16:20:21.000000 99.131 0
10 42 kx23abc12a ecagc1 -85.86 2014-09-18 16:20:21.000000 -99.131 1
11 NULL NULL NULL NULL NULL NULL NULL
update tbl1 set i3=concat(v2,'abc') where i1 in (1,201,10,80,420,600) limit 5;
update tbl1 set i3=substr(v2,1,10) where i1 in (1,201,10,80,420,600) limit 5;

View File

@ -0,0 +1,333 @@
drop table if exists t1;
create table t1 (a int, b int, primary key (a));
insert into t1(a,b) values(1,1),(2,1),(3,1),(4,1);
update t1 set b=2 where a>0;
select * from t1;
a b
1 2
2 2
3 2
4 2
update t1 set b=3 where a<5;
select * from t1;
a b
1 3
2 3
3 3
4 3
update t1 set b=4 where a>1;
update t1 set b=5 where a<4;
select * from t1;
a b
1 5
2 5
3 5
4 4
update t1 set b=6 where a>=1;
select * from t1;
a b
1 6
2 6
3 6
4 6
update t1 set b=7 where a<=5;
select * from t1;
a b
1 7
2 7
3 7
4 7
update t1 set b=8 where a>0 and a<2;
update t1 set b=9 where a>=2 and a<3;
update t1 set b=10 where a>=3 and a<=4;
select * from t1;
a b
1 8
2 9
3 10
4 10
update t1 set b=11 where a=1 or a=2 or a=3 or a=4;
select * from t1;
a b
1 11
2 11
3 11
4 11
replace into t1(a,b) values(1,1),(2,2),(3,3),(4,4);
update t1 set b=b+1 where b>0;
select * from t1;
a b
1 2
2 3
3 4
4 5
update t1 set b=b-1 where b<6;
select * from t1;
a b
1 1
2 2
3 3
4 4
update t1 set b=5 where b>1;
update t1 set b=6 where b<5;
select * from t1;
a b
1 6
2 5
3 5
4 5
update t1 set b=7 where b>=1;
select * from t1;
a b
1 7
2 7
3 7
4 7
update t1 set b=8 where b<=7;
select * from t1;
a b
1 8
2 8
3 8
4 8
replace into t1(a,b) values(1,1),(2,2),(3,3),(4,4);
update t1 set b=10 where b>0 and b<2;
update t1 set b=11 where b>=2 and b<3;
update t1 set b=12 where b>=3 and b<=4;
select * from t1;
a b
1 10
2 11
3 12
4 12
replace into t1(a,b) values(1,1),(2,2),(3,3),(4,4);
update t1 set b=11 where b=1 or b=2 or b=3 or b=4;
select * from t1;
a b
1 11
2 11
3 11
4 11
drop table if exists t1;
create table t1(a int, b int, c int, primary key(a));
replace into t1(a,b) values(1,1),(2,2),(3,1),(4,2);
update t1 set c=1 where a>0 and b>1;
update t1 set c=2 where a<5 and b<2;
select * from t1;
a b c
1 1 2
2 2 1
3 1 2
4 2 1
update t1 set c=3 where a>=0 and b<=1;
update t1 set c=4 where a<=5 and b>=2;
select * from t1;
a b c
1 1 3
2 2 4
3 1 3
4 2 4
update t1 set c=5 where a=0 or a=1 or a=2 or b=1;
update t1 set c=6 where b=2 or a=1 or a=2;
select * from t1;
a b c
1 1 6
2 2 6
3 1 5
4 2 6
replace into t1(a,b,c) values(1,1,NULL),(2,2,NULL),(3,3,NULL),(4,4,NULL);
update t1 set c=1 where a<=1 or b>=4;
update t1 set c=2 where a>1 or b<4;
select * from t1;
a b c
1 1 2
2 2 2
3 3 2
4 4 2
drop table if exists t1;
create table t1(a int, b int, c int, d int, primary key(a,b));
insert into t1(a,b,c,d) values(1,1,1,1),(2,2,1,1),(3,3,1,1);
update t1 set c=c+1, d=d+1 where (a,b) > (0,0);
select * from t1;
a b c d
1 1 2 2
2 2 2 2
3 3 2 2
update t1 set c=c+1, d=d+1 where (a,b) < (4,4);
select * from t1;
a b c d
1 1 3 3
2 2 3 3
3 3 3 3
update t1 set c=c+1, d=d+1 where (a,b) >= (1,1);
select * from t1;
a b c d
1 1 4 4
2 2 4 4
3 3 4 4
update t1 set c=c+1, d=d+1 where (a,b) <= (1,1);
select * from t1;
a b c d
1 1 5 5
2 2 4 4
3 3 4 4
update t1 set c=c+1, d=d+1 where (a,b) in ((NULL,NULL),(0,0),(1,1),(2,2),(3,3),(4,4));
select * from t1;
a b c d
1 1 6 6
2 2 5 5
3 3 5 5
update t1 set c=c+1, d=d+1 where (a,b)=(1,1) or (a,b)=(2,2) or (a,b)=(3,3);
select * from t1;
a b c d
1 1 7 7
2 2 6 6
3 3 6 6
update t1 set c=1, d=1 where (a,b) in ((1,1),(2,2),(3,3));
update t1 set c=c+1, d=d+1 where (a,b,c,d) >= (1,1,1,1);
select * from t1;
a b c d
1 1 2 2
2 2 2 2
3 3 2 2
update t1 set c=c+1, d=d+1 where (a,b,c,d) <= (3,3,3,3);
select * from t1;
a b c d
1 1 3 3
2 2 3 3
3 3 3 3
update t1 set c=c+1, d=d+1 where (a,b,c,d)=(1,1,1,1) or (a,b,c,d)=(2,2,1,1) or (a,b,c,d)=(3,3,3,3);
select * from t1;
a b c d
1 1 3 3
2 2 3 3
3 3 4 4
drop table if exists t1;
create table t1(a int, b int, c int, d int, primary key(a,b));
insert into t1(a,b,c,d) values(1,1,1,1),(1,2,1,1),(1,3,1,1);
update t1 set c=c+1, d=d+1 where a = 1;
select * from t1;
a b c d
1 1 2 2
1 2 2 2
1 3 2 2
update t1 set c=c+1, d=d+1 where a > 0;
update t1 set c=c+1, d=d+1 where a >=1 ;
select * from t1;
a b c d
1 1 4 4
1 2 4 4
1 3 4 4
update t1 set c=c+1, d=d+1 where a < 4;
select * from t1;
a b c d
1 1 5 5
1 2 5 5
1 3 5 5
update t1 set c=c+1, d=d+1 where a <= 1;
select * from t1;
a b c d
1 1 6 6
1 2 6 6
1 3 6 6
update t1 set c=c+1, d=d+1 where a=1 or a=2 or a=3;
select * from t1;
a b c d
1 1 7 7
1 2 7 7
1 3 7 7
update t1 set c=c+1, d=d+1 where (a=1 or a=2 or a=3) and (b=1 or b=2);
select * from t1;
a b c d
1 1 8 8
1 2 8 8
1 3 7 7
update t1 set c=c+1, d=d+1 where a>=1 and b>=2;
select * from t1;
a b c d
1 1 8 8
1 2 9 9
1 3 8 8
drop table if exists t1;
create table t1(a int, b int, c int, d int, primary key(a,b));
replace into t1(a,b,c,d) values(1,1,1,1),(2,2,2,1),(3,3,3,1);
update t1 set d=d+1 where (a,b)>=(1,1) and c=1;
select * from t1;
a b c d
1 1 1 2
2 2 2 1
3 3 3 1
update t1 set d=d+1 where (a,b)>=(1,1) and c=3;
select * from t1;
a b c d
1 1 1 2
2 2 2 1
3 3 3 2
update t1 set d=d+1 where (a=1 or a=2 or a=3) and c>=1;
select * from t1;
a b c d
1 1 1 3
2 2 2 2
3 3 3 3
update t1 set d=d+1 where (a=1 or a=2 or a=3) and c<1;
select * from t1;
a b c d
1 1 1 3
2 2 2 2
3 3 3 3
update t1 set d=d+1 where (a=1 or a=2 or a=3) and (b=2 or b=3);
select * from t1;
a b c d
1 1 1 3
2 2 2 3
3 3 3 4
update t1 set d=d+1 where (a=1 or a=2 or a=3) and (b=2 or b=3) and c=3;
select * from t1;
a b c d
1 1 1 3
2 2 2 3
3 3 3 5
update t1 set c=c+1, d=d+1 where a>=0 and a<=3 and b>1 and b<3;
select * from t1;
a b c d
1 1 1 3
2 2 3 4
3 3 3 5
update t1 set c=c+1, d=d+1 where (c,d)>=(1,1);
select * from t1;
a b c d
1 1 2 4
2 2 4 5
3 3 4 6
update t1 set c=c+1, d=d+1 where (b,a) > (1,1);
select * from t1;
a b c d
1 1 2 4
2 2 5 6
3 3 5 7
drop table if exists t1, t2, t3;
create table t1(a int, b int, c int, d int, primary key(a,b,c));
insert into t1(a,b,c) values (1,1,1),(2,2,2),(3,3,3);
update t1 set d=1 where (a,b,c)>(0,0,0) and (a,b,c)<=(3,3,3);
select * from t1;
a b c d
1 1 1 1
2 2 2 1
3 3 3 1
create table t2(a varchar(1024), b varchar(1024), c varchar(1024), d varchar(1024), primary key(a,b,c));
insert into t2(a,b,c) values ('a','a','a'),('b','b','b'),('c','c','c');
update t2 set d='a' where (a,b,c)>=('a','a','b') and (a,b,c)<('b','b','c');
select * from t2;
a b c d
a a a NULL
b b b a
c c c NULL
create table t3(a int, b varchar(1024), c timestamp(6) default "2012-01-01 12:00:00", d int, primary key(a,b,c));
insert into t3(a,b,c) values (1,'a','2014-02-17'),(2,'b','2014-02-17'),(3,'c','2014-02-18');
update t3 set d=1 where (a,b,c)>=(1,'a','2014-02-17 00:00:00') and (a,b,c)<=(2,'b','2014-02-18');
select * from t3;
a b c d
1 a 2014-02-17 00:00:00.000000 1
2 b 2014-02-17 00:00:00.000000 1
3 c 2014-02-18 00:00:00.000000 NULL
drop table if exists t1, t2, t3;

View File

@ -0,0 +1,372 @@
drop database if exists db_view;
create database db_view;
use db_view;
drop view if exists v_mix_tv, v_mix_1, v_mix_2, v_mix_3, vv_mix_1, vv_1, vvv_1;
drop view if exists view_v1, view_v2, view_v3, view_v4, view_v5, view_v6, view_v7;
drop table if exists view_t1_not_null, view_t1_null_default, view_t1_not_null_default;
drop view if exists view_v1_null_default, view_v1_not_null, view_v1_not_null_default;
drop table if exists view_t1, view_t2, view_t3;
set character_set_client = 45;
create table view_t1(c1 int primary key, c2 int);
create table view_t2(c3 int primary key, c4 int);
create table view_t3(c1 int primary key, c2 int);
insert into view_t1 values(1, 11), (2, 12), (3, 13);
insert into view_t2 values(10, 111), (20, 112), (30, 113);
insert into view_t3 values(100, 1111), (200, 1112), (300, 1113);
create table view_t1_not_null(c1 int primary key, c2 int not null);
create table view_t1_null_default(c1 int primary key, c2 int default 22222);
create table view_t1_not_null_default(c1 int primary key, c2 int not null default 2222);
create view view_v1_not_null as select c1,c2 from view_t1_not_null;
create view view_v1_null_default as select c1,c2 from view_t1_null_default;
create view view_v1_not_null_default as select c1,c2 from view_t1_not_null_default;
create table table_t8(c1 int null,c2 int not null);
create view view_v8 as select c1+c2 from table_t8;
desc view_v8;
Field Type Null Key Default Extra
c1+c2 bigint(12) YES NULL
create view view_v9 as select c1+c2 from table_t8 a;
desc view_v9;
Field Type Null Key Default Extra
c1+c2 bigint(12) YES NULL
drop table table_t8;
drop view view_v8;
drop view view_v9;
create or replace view view_v1 as select c1,c2 from view_t1;
select * from view_v1;
c1 c2
1 11
2 12
3 13
create or replace view view_v2(c1, c2) as select c1, c2 from view_t1;
select * from view_v2;
c1 c2
1 11
2 12
3 13
create or replace view view_v3(c2) as select c2 from view_t1;
select * from view_v3;
c2
11
12
13
create or replace view view_v4(vc2) as select c2 as vc2 from view_t1;
select * from view_v4;
vc2
11
12
13
create or replace view view_v5(vc2) as select c2 as vc2 from view_t1;
select * from view_v5;
vc2
11
12
13
create or replace view view_v6 as select c1+1 from view_t1;
select * from view_v6;
c1+1
2
3
4
create or replace view view_v7(vc1,vc2) as select c1+1 as vc1, c2+2 as vc2 from view_t1;
select * from view_v7;
vc1 vc2
2 13
3 14
4 15
create or replace view v_2t_1 as select c1,c2,c3,c4 from view_t1, view_t2;
select * from v_2t_1;
c1 c2 c3 c4
1 11 10 111
1 11 20 112
1 11 30 113
2 12 10 111
2 12 20 112
2 12 30 113
3 13 10 111
3 13 20 112
3 13 30 113
create or replace view v_3t_1(vc1, vc2, vc3, vc4, vc5, vc6) as select view_t1.c1 as vc1, view_t1.c2 as vc2, view_t2.c3 as vc3, view_t2.c4 as vc4, view_t3.c1 as vc5, view_t3.c2 as vc6 from view_t1, view_t2, view_t3;
select * from v_3t_1;
vc1 vc2 vc3 vc4 vc5 vc6
1 11 10 111 100 1111
1 11 10 111 200 1112
1 11 10 111 300 1113
1 11 20 112 100 1111
1 11 20 112 200 1112
1 11 20 112 300 1113
1 11 30 113 100 1111
1 11 30 113 200 1112
1 11 30 113 300 1113
2 12 10 111 100 1111
2 12 10 111 200 1112
2 12 10 111 300 1113
2 12 20 112 100 1111
2 12 20 112 200 1112
2 12 20 112 300 1113
2 12 30 113 100 1111
2 12 30 113 200 1112
2 12 30 113 300 1113
3 13 10 111 100 1111
3 13 10 111 200 1112
3 13 10 111 300 1113
3 13 20 112 100 1111
3 13 20 112 200 1112
3 13 20 112 300 1113
3 13 30 113 100 1111
3 13 30 113 200 1112
3 13 30 113 300 1113
create or replace view vv_1 as select c1,c2 from view_v1;
select * from vv_1;
c1 c2
1 11
2 12
3 13
create or replace view vvv_1 as select c1,c2 from vv_1;
select * from vvv_1;
c1 c2
1 11
2 12
3 13
create view v_mix_1 as select c1,c2 from view_t1;
create view vv_mix_1 as select c1,c2,c3,c4 from v_mix_1, view_t2;
select * from (select * from (select * from view_t1) as v_test, view_t2) as vv_test;
c1 c2 c3 c4
1 11 10 111
1 11 20 112
1 11 30 113
2 12 10 111
2 12 20 112
2 12 30 113
3 13 10 111
3 13 20 112
3 13 30 113
select * from vv_mix_1;
c1 c2 c3 c4
1 11 10 111
1 11 20 112
1 11 30 113
2 12 10 111
2 12 20 112
2 12 30 113
3 13 10 111
3 13 20 112
3 13 30 113
create or replace view v_mix_3 as select c1,c2 from view_t1;
select * from v_mix_3;
c1 c2
1 11
2 12
3 13
drop view if exists v_mix_tv, v_mix_1, v_mix_2, v_mix_3, vv_mix_1, vv_mix_2, vv_mix_3, vv_1, vvv_1;
drop view if exists v_2t_1, v_3t_1;
drop view if exists view_v1, view_v2, view_v3, view_v4, view_v5, view_v6, view_v7;
drop table if exists view_t1_not_null, view_t1_null_default, view_t1_not_null_default;
drop view if exists view_v1_null_default, view_v1_not_null, view_v1_not_null_default;
drop table if exists view_t1, view_t2, view_t3;
drop view if exists v1,v2,v3;
drop table if exists t1;
create table t1(c1 int primary key);
insert into t1 values(1),(2);
create view v1 as select c1 from t1;
create view v2 as (select c1 from t1);
create view v3 as ((select c1 from t1));
insert into t1 values(3),(4);
select * from v1;
c1
1
2
3
4
select * from v2;
c1
1
2
3
4
select * from v3;
c1
1
2
3
4
drop view if exists v1,v2,v3;
drop table if exists t1;
drop table if exists t1;
drop view if exists v1;
create table t1(c1 varchar(10));
insert into t1 value('test1');
insert into t1 value('test2');
create view v1 as select c1 from t1;
select v1.c1 from v1 join t1 on v1.c1 = t1.c1;
c1
test1
test2
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS select `db_view`.`t1`.`c1` AS `c1` from `db_view`.`t1` utf8mb4 utf8mb4_general_ci
drop table if exists t1;
drop view if exists v1;
drop table if exists t1;
drop view if exists v1;
create table t1(c1 int, c2 int);
insert into t1 values(1,1);
select * from t1;
c1 c2
1 1
create or replace view v1 as select c1 from t1;
select * from v1;
c1
1
create or replace view v1 as select c1,c2 from t1;
select * from v1;
c1 c2
1 1
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS select `db_view`.`t1`.`c1` AS `c1`,`db_view`.`t1`.`c2` AS `c2` from `db_view`.`t1` utf8mb4 utf8mb4_general_ci
create view v1 as select c2 from t1;
ERROR 42S01: Table 'v1' already exists
drop view v1;
drop table t1;
drop table if exists t1;
drop view if exists v1;
create table t1(c1 int,c2 int);
create table t2(a int,b int);
create view v as select c1,c2 from t1;
create view vv as select c1,c2,a,b from v,t2;
select * from v;
c1 c2
select c1 from v;
c1
select * from vv;
c1 c2 a b
select c1 from vv;
c1
alter table t1 drop column c2;
select * from v;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from vv;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1 from v;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1 from vv;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from vv;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
alter table t1 add column c2 int;
select * from v;
c1 c2
select * from vv;
c1 c2 a b
drop table t1;
select * from v;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from vv;
ERROR 42S22: View 'db_view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create table t1(c1 varchar(10), c2 datetime);
select * from v;
c1 c2
select * from vv;
c1 c2 a b
drop table t1;
create table t1(c1 varchar(10), c2 datetime, c3 int);
select * from v;
c1 c2
select * from vv;
c1 c2 a b
drop table t1;
create table t1(c1 int,c2 int);
insert into t1 values(1,10),(2,11);
select * from v;
c1 c2
1 10
2 11
select * from vv;
c1 c2 a b
drop table t1;
create table t1(c1 varchar(10), c2 double, c3 int);
insert into t1 values('hello', 100.10, 1),('hello', 100.11,2);
select * from v;
c1 c2
hello 100.1
hello 100.11
select * from v;
c1 c2
hello 100.1
hello 100.11
drop table t1;
drop view v;
create table t1(c1 int, c2 int);
insert into t1 values(1,1), (2,2);
create view v as select 5 from t1 order by 1;
select * from v;
5
5
5
create view v1 as select * from t1 where c1>'1';
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS select `db_view`.`t1`.`c1` AS `c1`,`db_view`.`t1`.`c2` AS `c2` from `db_view`.`t1` where (`db_view`.`t1`.`c1` > '1') utf8mb4 utf8mb4_general_ci
select * from v1;
c1 c2
2 2
drop view v, v1;
create view v as select 5, 6 from t1 order by 1,2;
select * from v;
5 6
5 6
5 6
drop view v;
create view v as select c1 + 1 from t1 order by 1;
select * from v;
c1 + 1
2
3
drop view v;
create view v as select 7 + 3 from t1 order by 1;
select * from v;
7 + 3
10
10
drop view v;
drop table if exists t1;
create table t1(a int, b int);
insert into t1 values (1,1);
create view v as select group_concat(b) from t1 group by a;
select * from v;
group_concat(b)
1
drop table if exists t1;
drop view if exists v;
create table t1(c1 datetime, c2 int);
insert into t1 values('1990-03-03 00:00:00', 2), ('2016-05-31 20:00:00', 3);
create view v as select * from t1 where c1>'1990-04-01 00:00:00';
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS select `db_view`.`t1`.`c1` AS `c1`,`db_view`.`t1`.`c2` AS `c2` from `db_view`.`t1` where (`db_view`.`t1`.`c1` > '1990-04-01 00:00:00') utf8mb4 utf8mb4_general_ci
select * from v;
c1 c2
2016-05-31 20:00:00 3
drop view if exists v;
drop table if exists t1;
drop view if exists v1, v2;
Warnings:
Note 1051 Unknown table 'db_view.v1'
Note 1051 Unknown table 'db_view.v2'
create table t1(col1 varchar(12) character set utf8mb4 collate utf8mb4_general_ci);
insert into t1 values('t1_val');
create view v1 as select 'v1_val' collate utf8mb4_general_ci as col1;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS select 'v1_val' collate utf8mb4_general_ci AS `col1` utf8mb4 utf8mb4_general_ci
create view v2 as select col1 from v1 union select col1 from t1;
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE VIEW `v2` AS (select `db_view`.`v1`.`col1` AS `col1` from `db_view`.`v1`) union (select `db_view`.`t1`.`col1` AS `col1` from `db_view`.`t1`) utf8mb4 utf8mb4_general_ci
select coercibility(col1), collation(col1) from v2;
coercibility(col1) collation(col1)
0 utf8mb4_general_ci
0 utf8mb4_general_ci
drop database if exists db_view;

View File

@ -0,0 +1,503 @@
drop database if exists view;
create database view;
use view;
set character_set_client = 45;
drop table if exists t1;
drop view if exists v, vv;
create table t1(c1 int, c2 int);
create view v as select c1, c2 from t1;
create view vv as select c1 from v;
select c1, c2 from v;
c1 c2
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table t1;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create table t1(c1 int);
select c1 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select 1 as a from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v, vv;
create table t1(c1 int, c2 int);
create view v as select c1, c2 from t1;
create view vv as select c2 from v;
select c1, c2 from v;
c1 c2
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table t1;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create table t1(c1 int);
select c1 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1, c2 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2, c1 from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select 1 as a from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1,t2;
drop view if exists v,vv;
create table t1(c1 int ,c2 int);
create table t2(c1 int ,c2 int);
create view v as select c1, c2 from t1;
create view vv as select c1 from v;
alter table t1 drop column c2;
select * from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select v.* from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select vv.* from vv;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int,c2 int);
create table t2(c1 int,c2 int);
create view v as select c1, c2 from t1;
alter table t1 drop column c2;
select v.c1 from v join t2 on v.c1 = t2.c1;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select v.c1 from v join t2 on v.c2 = t2.c2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select v.c1 from v join t2 using(c1);
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select v.c1 from v join t2 using(c2);
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1, c2 from t1;
select c1 from v where c2 = 1;
c1
select c1 from v where (select c2) = 1;
c1
alter table t1 drop column c2;
select c1 from v where c2 = 1;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1 from v where (select c2) = 1;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1, c2 from t1;
select c1 from v order by c2;
c1
select c1 from v order by (select c2);
c1
alter table t1 drop column c2;
select c1 from v order by c2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1 from v order by (select c2);
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1, c2 from t1;
select c1 from v group by c2;
c1
select c1 from v group by (select c2);
c1
alter table t1 drop column c2;
select c1 from v group by c2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c1 from v group by (select c2);
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
insert into t1 values(1,2),(2,3),(3,4);
create view v as select c1,c2 from t1 order by c2;
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
insert into t1 values(1,2),(2,3),(3,4);
create view v as select c1, -1 as c2 from t1 order by (select c2);
select c1 from v;
c1
1
2
3
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1,c2 from t1 where c2=1;
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
insert into t1 values(1,2),(2,3),(3,4);
create view v as select c1, -1 as c2 from t1 order by (select c2);
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1,sum(c2) from t1;
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
insert into t1 values(1,2),(2,3),(3,4),(4,5);
create view v as select c1,c2 from t1;
select * from v;
c1 c2
1 2
2 3
3 4
4 5
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select c2 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
alter table t1 add column c2 int default 100;
select * from v;
c1 c2
1 100
2 100
3 100
4 100
alter table t1 alter column c2 set default 200;
insert into t1(c1) values(5);
select * from v;
c1 c2
1 100
2 100
3 100
4 100
5 200
drop table if exists t1;
drop view if exists v;
create table t1(c1 int);
create view v as select c1 from t1;
desc v;
Field Type Null Key Default Extra
c1 int(11) YES NULL
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int);
create table t2(c1 int);
create view v as (select c1 from t1) union (select c1 from t2);
desc v;
Field Type Null Key Default Extra
c1 int(11) YES NULL
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select c1,c2 from t1;
desc v;
Field Type Null Key Default Extra
c1 int(11) YES NULL
c2 int(11) YES NULL
alter table t1 drop column c2;
desc v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v,vv;
create table t1(c1 int,c2 int);
create view v as select c1,c2 from t1;
create view vv as select c1,c2 from v;
alter table t1 drop column c2;
desc v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
desc vv;
ERROR 42S22: View 'view.vv' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v,vv;
create table t1(c1 int,c2 int);
create view v as select c1,c2 from t1;
create view vv as select c1,c2 from v;
create or replace view v as select c1 from t1;
desc v;
Field Type Null Key Default Extra
c1 int(11) YES NULL
desc vv;
ERROR 42S22: View 'view.vv' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create or replace view vv as select c1 from v;
desc vv;
Field Type Null Key Default Extra
c1 int(11) NO
drop table if exists t1,t2,t3,t4;
drop view if exists v,vv;
create table t1(c1 int,c2 int);
create table t2(c1 int,c2 int);
create table t3(c1 int,c2 int);
create table t4(c1 int,c2 int);
create view v as ((select * from t1) union (select c1,c2 from t2)) union (select * from t3);
desc v;
Field Type Null Key Default Extra
c1 int(11) YES NULL
c2 int(11) YES NULL
create view vv as (select * from v) union (select * from t4);
desc vv;
Field Type Null Key Default Extra
c1 int(11) NO
c2 int(11) NO
drop table if exists t1,t2;
drop view if exists v;
create table t1(c1 int,c2 int);
create table t2(c1 int,c2 int);
create view v as select c1,c2 from t1;
select (select c2 from v limit 1) from t2;
(select c2 from v limit 1)
alter table t1 drop column c2;
select (select c2 from v limit 1) from t2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select (select c3 from v limit 1) from t2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
alter table t2 add column c3 int;
select (select c3 from v limit 1) from t2;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists t1;
drop table if exists v1,v2,v3;
drop view if exists v1,v2,v3;
create table t1(c1 int);
create view v1 as select * from t1;
create view v2 as select * from v1;
create view v3 as select * from v2;
drop table t1;
rename table v3 to t1;
select * from v1;
ERROR 42S02: 'view.v1' contains view recursion
select * from v2;
ERROR 42S02: 'view.v2' contains view recursion
select * from v3;
ERROR 42S02: Table 'view.v3' doesn't exist
drop table if exists t1,t2;
drop view if exists t1,t2;
drop table if exists v1,v2,v3;
drop view if exists v1,v2,v3;
create table t1(c1 int);
create table t2(c1 int);
create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select v1.c1 as v1c1, v2.c1 as v2c1 from v1,v2;
drop table t2;
rename table v3 to t2;
select * from t2;
ERROR 42S02: 'view.t2' contains view recursion
select * from v2;
ERROR 42S02: 'view.v2' contains view recursion
drop table if exists t1,t2;
drop view if exists t1,t2;
drop table if exists v1,v2;
drop view if exists v1,v2;
create table t1(c1 int);
create table t2(c1 int);
create view v1 as select * from t1;
create view v2 as select (select c1 from v1 limit 1) from t2;
drop table t1;
rename table v2 to t1;
select * from t1;
ERROR 42S02: 'view.t1' contains view recursion
select * from v1;
ERROR 42S02: 'view.v1' contains view recursion
drop table if exists t1;
drop view if exists t1;
drop table if exists v1,v2,v3,v4;
drop view if exists v1,v2,v3,v4;
create table t1(c1 int);
create view v1 as select * from t1;
create view v2 as select * from v1;
create view v3 as select * from v2;
create view v4 as select * from v2;
drop view v1;
rename table v4 to v1;
select * from v1;
ERROR 42S02: 'view.v1' contains view recursion
select * from v2;
ERROR 42S02: 'view.v2' contains view recursion
select * from v3;
ERROR 42S02: 'view.v2' contains view recursion
SET optimizer_switch = (SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'optimizer_switch');
ERROR 0A000: subqueries or stored function calls here not supported
drop table if exists t1,t2;
drop view if exists v1;
create table t1(c1 int,c2 int);
create table t2(c1 int,c2 int);
insert into t1(c1,c2) values(1,2),(2,3);
create view v1 as select * from t1;
insert into t2(c1,c2) select * from v1;
select * from t2;
c1 c2
1 2
2 3
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select * from t1;
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show warnings;
Level Code Message
Error 1356 View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
create view v as select * from t1;
alter table t1 drop column c2;
select c1 from v;
ERROR 42S22: View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show warnings;
Level Code Message
Error 1356 View 'view.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table if exists t1;
drop view if exists v;
create table t1(c1 int,c2 int);
insert into t1 values(1, 1);
create view v as select * from t1 where not exists(select * from t1 where c1>0);
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS select `view`.`t1`.`c1` AS `c1`,`view`.`t1`.`c2` AS `c2` from `view`.`t1` where not exists((select `t1`.`c1`,`t1`.`c2` from `view`.`t1` `t1` where (`t1`.`c1` > 0))) utf8mb4 utf8mb4_general_ci
select * from v;
c1 c2
create view xy as select 123 from dual where not exists (select 1 from dual) limit 1;
select * from xy;
123
drop table if exists t1;
drop table if exists t2;
drop view if exists v;
create table t1 (k int primary key, v1 int, v2 int);
create table t2 (k int primary key, v1 char(1), v2 varchar(10));
create view v as select k, v1, v2 from t1 union select k, v1, v2 from t2;
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS (select `view`.`t1`.`k` AS `k`,`view`.`t1`.`v1` AS `v1`,`view`.`t1`.`v2` AS `v2` from `view`.`t1`) union (select `view`.`t2`.`k` AS `k`,`view`.`t2`.`v1` AS `v1`,`view`.`t2`.`v2` AS `v2` from `view`.`t2`) utf8mb4 utf8mb4_general_ci
select * from v;
k v1 v2
drop table if exists t1;
drop view if exists v;
create table t1 (k int, v int);
create view v as (select k, v from t1) union (select 1, 1 from t1);
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS (select `view`.`t1`.`k` AS `k`,`view`.`t1`.`v` AS `v` from `view`.`t1`) union (select 1 AS `1`,1 AS `1` from `view`.`t1` `t1`) utf8mb4 utf8mb4_general_ci
drop table if exists t1;
drop table if exists t2;
CREATE TABLE `t11` ( `a` int(11) NOT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, PRIMARY KEY (`a`) );
CREATE TABLE `t21` ( `a` int(11) NOT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, PRIMARY KEY (`a`) );
explain extended_noaddr select t3.* from (select t11.a as X, t21.a as Y from t11 left join t21 on t11.a = t21.a) as t3 where t3.y is not null and t3.x > 10;
Query Plan
==================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
--------------------------------------------------
|0 |MERGE JOIN | |1 |5 |
|1 |├─TABLE RANGE SCAN|t11 |1 |3 |
|2 |└─TABLE RANGE SCAN|t21 |1 |3 |
==================================================
Outputs & filters:
-------------------------------------
0 - output([t11.a], [t21.a]), filter(nil), rowset=16
equal_conds([t11.a = t21.a]), other_conds(nil)
merge_directions([ASC])
1 - output([t11.a]), filter(nil), rowset=16
access([t11.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t11.a]), range(10 ; MAX),
range_cond([t11.a > 10])
2 - output([t21.a]), filter(nil), rowset=16
access([t21.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t21.a]), range(10 ; MAX),
range_cond([t21.a > 10])
Used Hint:
-------------------------------------
/*+
*/
Qb name trace:
-------------------------------------
stmt_id:0, stmt_type:T_EXPLAIN
stmt_id:1, SEL$1 > SEL$CFEA49FE > SEL$A7A036C9 > SEL$AC33F27C > SEL$21AFC505
stmt_id:2, SEL$2
Outline Data:
-------------------------------------
/*+
BEGIN_OUTLINE_DATA
LEADING(@"SEL$21AFC505" ("view"."t11"@"SEL$2" "view"."t21"@"SEL$2"))
USE_MERGE(@"SEL$21AFC505" "view"."t21"@"SEL$2")
FULL(@"SEL$21AFC505" "view"."t11"@"SEL$2")
FULL(@"SEL$21AFC505" "view"."t21"@"SEL$2")
MERGE(@"SEL$2" > "SEL$1")
OUTER_TO_INNER(@"SEL$CFEA49FE")
PRED_DEDUCE(@"SEL$A7A036C9")
SIMPLIFY_EXPR(@"SEL$AC33F27C")
OPTIMIZER_FEATURES_ENABLE('4.0.0.0')
END_OUTLINE_DATA
*/
Optimization Info:
-------------------------------------
t11:
table_rows:1
physical_range_rows:1
logical_range_rows:1
index_back_rows:0
output_rows:1
table_dop:1
dop_method:Table DOP
avaiable_index_name:[t11]
stats version:0
dynamic sampling level:1
t21:
table_rows:1
physical_range_rows:1
logical_range_rows:1
index_back_rows:0
output_rows:1
table_dop:1
dop_method:Table DOP
avaiable_index_name:[t21]
stats version:0
dynamic sampling level:1
Plan Type:
LOCAL
Note:
Degree of Parallelisim is 1 because of table property
Expr Constraints:
1 result is TRUE
drop database if exists view;

View File

@ -0,0 +1,31 @@
desc oceanbase.__all_virtual_thread;
Field Type Null Key Default Extra
svr_ip varchar(46) NO NULL
svr_port bigint(20) NO NULL
tenant_id bigint(20) NO NULL
tid bigint(20) NO NULL
tname varchar(16) NO NULL
status varchar(32) NO NULL
wait_event varchar(64) NO NULL
latch_wait varchar(16) NO NULL
latch_hold varchar(256) NO NULL
trace_id varchar(40) NO NULL
loop_ts timestamp(6) NO NULL
cgroup_path varchar(256) NO NULL
desc oceanbase.GV$OB_THREAD;
Field Type Null Key Default Extra
SVR_IP varchar(46) NO NULL
SVR_PORT bigint(20) NO NULL
TENANT_ID bigint(20) NO NULL
TID bigint(20) NO NULL
TNAME varchar(16) NO NULL
STATUS varchar(32) NO NULL
LATCH_WAIT varchar(16) NO NULL
LATCH_HOLD varchar(256) NO NULL
TRACE_ID varchar(40) NO NULL
select count(1) from oceanbase.__all_virtual_thread where tname = "";
count(1)
0
select count(1) from oceanbase.V$OB_THREAD where tname = "observer";
count(1)
1