BUGFIX: depart the ls meta lock

This commit is contained in:
obdev
2023-11-20 08:32:44 +00:00
committed by ob-robot
parent 7f360fc2f5
commit 4c53146024
64 changed files with 682 additions and 557 deletions

View File

@ -24,3 +24,4 @@ select /* QUERY_TIMEOUT(15000000) */ id from notify_000 where gmt_create <= cur
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;
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());
delete from notify_history_000 where ((group_no = (- 1)) AND (iw_user_id = '1111'));

View File

@ -8,16 +8,16 @@ set @@session.explicit_defaults_for_timestamp=off;
#
--disable_warnings
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 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 TIMEOUT_REMIND_000;
DROP TABLE if exists TRADE_BASE_000 ;
DROP TABLE if exists TRADE_CHARGE_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 ;
@ -51,7 +51,7 @@ CREATE TABLE if not exists trade_sequence_000
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTION_000
CREATE TABLE if not exists BUSINESS_ACTION_000
(
ACTION_ID int NOT NULL,
TX_ID varchar(128) NOT NULL,
@ -63,7 +63,7 @@ CREATE TABLE if not exists BUSINESS_ACTION_000
primary key (ACTION_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists BUSINESS_ACTIVITY_000
CREATE TABLE if not exists BUSINESS_ACTIVITY_000
(
TX_ID varchar(128) NOT NULL,
STATE VARCHAR(1) NOT NULL,
@ -75,7 +75,7 @@ CREATE TABLE if not exists BUSINESS_ACTIVITY_000
primary key (TX_ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists NOTIFY_000
CREATE TABLE if not exists NOTIFY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
@ -96,7 +96,7 @@ CREATE TABLE if not exists NOTIFY_000
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
CREATE TABLE if not exists NOTIFY_HISTORY_000
(
ID varchar(34) NOT NULL,
PLUGIN varchar(50) NOT NULL,
@ -116,7 +116,7 @@ CREATE TABLE if not exists NOTIFY_HISTORY_000
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
CREATE TABLE if not exists TIMEOUT_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
@ -138,7 +138,7 @@ 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
CREATE TABLE if not exists TIMEOUT_HISTORY_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -156,7 +156,7 @@ CREATE TABLE if not exists TIMEOUT_HISTORY_000
PRIMARY KEY (JOB_ID, TRADE_NO, ACTION_TYPE)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TIMEOUT_LONG_000
CREATE TABLE if not exists TIMEOUT_LONG_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
@ -178,7 +178,7 @@ 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
CREATE TABLE if not exists TIMEOUT_REMIND_000
(
JOB_ID varchar(32) NOT NULL,
TRADE_NO varchar(64),
@ -203,7 +203,7 @@ 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
CREATE TABLE if not exists TRADE_BASE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -253,16 +253,16 @@ CREATE TABLE if not exists TRADE_BASE_000
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX BYD_TRADE_BASE_TEMAIL_GMTC_IND ON TRADE_BASE_000
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
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
CREATE INDEX IND_BEYOND_TRADE_BASE_SALGMT1 ON TRADE_BASE_000
(SELLER_ACCOUNT, GMT_CREATE);
CREATE TABLE if not exists TRADE_CHARGE_000
CREATE TABLE if not exists TRADE_CHARGE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -295,7 +295,7 @@ CREATE TABLE if not exists TRADE_CHARGE_000
CREATE INDEX TRADE_CHARGE_000_GMT_IND ON TRADE_CHARGE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_EXT_000
CREATE TABLE if not exists TRADE_EXT_000
(
TRADE_NO varchar(64) NOT NULL,
EXT_INFO varchar(1000),
@ -319,7 +319,7 @@ CREATE TABLE if not exists TRADE_EXT_000
)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
CREATE TABLE if not exists TRADE_FUND_BILL_000
(
BILL_NO varchar(128) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -356,7 +356,7 @@ CREATE INDEX TRADE_FUND_BILL_PTG_IND ON TRADE_FUND_BILL_000 (PARTNER_ID, GMT_TRA
CREATE INDEX TRADE_FUND_BILL_000_GMT_IND ON TRADE_FUND_BILL_000(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_GOODS_INFO_000
CREATE TABLE if not exists TRADE_GOODS_INFO_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -387,7 +387,7 @@ CREATE TABLE if not exists TRADE_LOGISTICS_000
INVOICE_NO VARCHAR(64),
SIGN_VOUCHER_NO VARCHAR(64),
TRANSPORT_TYPE int,
TRANSPORT_FEE int default 0 NOT NULL,
TRANSPORT_FEE int default 0 NOT NULL,
OTHER_FEE int default 0,
ADDITIONAL_SERVICE VARCHAR(300),
LOGISTICS_STATUS VARCHAR(100),
@ -429,7 +429,7 @@ CREATE INDEX TRADE_LOGISTICS_000_GMT_IND ON TRADE_LOGISTICS_000
#这个表修改了IS_READ,原来使用的是CHAR(1)
CREATE TABLE if not exists TRADE_MESSAGE_BOARD_000
CREATE TABLE if not exists TRADE_MESSAGE_BOARD_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -443,7 +443,7 @@ CREATE TABLE if not exists TRADE_MESSAGE_BOARD_000
PRIMARY KEY (TRADE_NO, ID)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_NOTE_000
CREATE TABLE if not exists TRADE_NOTE_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -459,7 +459,7 @@ CREATE TABLE if not exists TRADE_NOTE_000
primary key (TRADE_NO, ID, GMT_CREATE)
)DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_OUTTRADE_000
CREATE TABLE if not exists TRADE_OUTTRADE_000
(
PARTNER_ID varchar(200) NOT NULL,
OUT_TRADE_NO varchar(64) NOT NULL,
@ -469,7 +469,7 @@ CREATE TABLE if not exists TRADE_OUTTRADE_000
primary key (OUT_TRADE_NO, PARTNER_ID, TRADE_FROM)
) DEFAULT CHARSET = 'utf8';
CREATE TABLE if not exists TRADE_PAYMENT_CLAUSE_000
CREATE TABLE if not exists TRADE_PAYMENT_CLAUSE_000
(
ID int NOT NULL,
OUT_RELATION_ID varchar(64),
@ -491,10 +491,10 @@ CREATE TABLE if not exists TRADE_PAYMENT_CLAUSE_000
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
CREATE INDEX TRADE_PCLAUSE_000_GMT_IND ON TRADE_PAYMENT_CLAUSE_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PAYMENT_ORDER_000
CREATE TABLE if not exists TRADE_PAYMENT_ORDER_000
(
ORDER_NO varchar(64) NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -522,7 +522,7 @@ CREATE TABLE if not exists TRADE_PAYMENT_ORDER_000
CREATE INDEX TRADE_PAYMENT_ORD_000_GM_IND ON TRADE_PAYMENT_ORDER_000
(GMT_MODIFIED);
CREATE TABLE if not exists TRADE_PROCESS_000
CREATE TABLE if not exists TRADE_PROCESS_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
@ -560,13 +560,13 @@ CREATE TABLE if not exists TRADE_PROCESS_000
PRIMARY KEY (TRADE_NO)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX IND_BYD_TRD_PROCESS_GRPAY ON TRADE_PROCESS_000
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
CREATE TABLE if not exists TRADE_REFUND_000
(
ID int NOT NULL,
TRADE_NO varchar(64) NOT NULL,
@ -599,18 +599,18 @@ CREATE TABLE if not exists TRADE_REFUND_000
REFUND_FOREX_FEE int,
PRIMARY KEY (TRADE_NO, ID)
)DEFAULT CHARSET = 'utf8';
CREATE INDEX TRADE_REFUND_BG_IND ON TRADE_REFUND_000
CREATE INDEX TRADE_REFUND_BG_IND ON TRADE_REFUND_000
(BUY_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_SG_IND ON TRADE_REFUND_000
CREATE INDEX TRADE_REFUND_SG_IND ON TRADE_REFUND_000
(SELL_ACCOUNT, GMT_CREATE);
CREATE INDEX TRADE_REFUND_TG_IND ON TRADE_REFUND_000
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
CREATE TABLE if not exists TRADE_VOUCHER_000
(
ID int NOT NULL,
TRADE_NO varchar(64) default ' ' NOT NULL,
@ -730,16 +730,16 @@ CREATE INDEX EXTERFACE_INVOKE_000_ID_IND ON EXTERFACE_INVOKE_000(ID);
--disable_warnings
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 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 TIMEOUT_REMIND_000;
DROP TABLE if exists TRADE_BASE_000 ;
DROP TABLE if exists TRADE_CHARGE_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 ;

View File

@ -33,3 +33,6 @@ select c5+1 c51,c6 c61,c7+1 c71 from t1 where c1=1 and c2='s' and c3=1.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);
drop table t1;

View File

@ -32,7 +32,7 @@ select c1 as a1,c2 as a2 from t1 group by a2 having a1>0 order by a1;
select c1 as a1,c2 as a2 from t1 group by a2 having a1>0 order by a2;
# select expr
# select expr
select c1+c2 as total from t1 order by total;
select c1, c1+c2 as total from t1 group by total order by c1;
select c1, c1+c2 as total from t1 group by total having c1>2 order by c1 desc;
@ -42,3 +42,6 @@ select c1, c1+c2 as total from t1 group by total having c1>2 order by c1 desc;
select c1 as a1, c2 as a2 from t1 where c1>1;
select c1 as a1, c2 as a2 from t1 where c2>1;
select c1,c1+c2 as a1 from t1 where c1+c2>2;

View File

@ -14,7 +14,7 @@ create table t1(c1 int primary key, c2 int);
insert into t1 values(1,1),(2,2),(3,3);
let $cnt=30;
while($cnt)
while($cnt)
{
select * from t1 as t2 where c1=1;
dec $cnt;

View File

@ -6,7 +6,7 @@ set @@session.explicit_defaults_for_timestamp=off;
## update
--disable_warnings
drop table if exists t1;
drop table if exists t1;
--enable_warnings
create table t1(a bigint primary key , b bigint);
@ -21,7 +21,7 @@ select * from t1;
## delete
--disable_warnings
drop table if exists t1;
drop table if exists t1;
--enable_warnings
create table t1(a bigint primary key , b bigint);
@ -31,3 +31,4 @@ delete from t1 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc limi
select * from t1;
delete from t1 WHERE ( a = 1 ) OR (( b = 3 ) AND ( a = 2 )) order by a desc;
select * from t1;

View File

@ -19,3 +19,5 @@ commit;
set autocommit=1;
select * from t1;
disconnect conn1;

View File

@ -37,3 +37,5 @@ select c1 as c1, c2 as c1 from tt1 where c1<4;
#show columns from t1 like 'c1';
show columns from tt1;
#show columns from t1 like '%c%';

View File

@ -94,17 +94,17 @@ drop table a1;
#CREATE TABLE t2 (a int);
#INSERT INTO t2 VALUES (1),(2);
#
#SELECT a,
# (SELECT COUNT(*) FROM t1
# WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
#SELECT a,
# (SELECT COUNT(*) FROM t1
# WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
#FROM t2 ORDER BY a;
#
--disable_result_log
#EXPLAIN EXTENDED
#EXPLAIN EXTENDED
--enable_result_log
#SELECT a,
# (SELECT COUNT(*) FROM t1
# WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
#SELECT a,
# (SELECT COUNT(*) FROM t1
# WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x
#FROM t2 ORDER BY a;
#
#DROP TABLE t1,t2;
@ -113,7 +113,7 @@ drop table a1;
## Bug #39353: Multiple conditions on timestamp column crashes server
##
#
#CREATE TABLE t1 (a TIMESTAMP);
#CREATE TABLE t1 (a TIMESTAMP);
#INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
#SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
#DROP TABLE t1;

View File

@ -9,7 +9,7 @@ set sql_mode='';
--disable_warnings
drop table if exists t;
--enable_warnings
create table t(id int primary key auto_increment,
create table t(id int primary key auto_increment,
int_val smallint,
uint_val smallint unsigned,
flt_val float(5, 3),

View File

@ -5,7 +5,7 @@ set @@session.explicit_defaults_for_timestamp=off;
#owner: linlin.xll
#owner group: sql2
#description:
#tags: join,optimizer
#tags: join,optimizer
--disable_warnings
drop database if exists yy;

View File

@ -16,7 +16,7 @@ let $a=abcdefghij;
let $p=abcdefghij;
let $cnt=1000;
while($cnt)
{
{
let $a=$a$p;
dec $cnt;
}

View File

@ -24,7 +24,7 @@ insert into t4 values(1,0),(2,0),(3,1),(4,1);
select * from t1 except select * from t1;
--error 1064
select * from t1 except all select * from t1;
#partial same
#partial same
select * from t1 except select * from t2;
--error 1064
select * from t1 except all select * from t2;
@ -93,3 +93,5 @@ select c2 from t5 except all select c2 from t6;
drop table t1,t2,t3,t4,t5,t6;

View File

@ -43,9 +43,9 @@ SELECT INFLUX_ID FROM fin_settle_serial_map WHERE FINANCE_EXCHANGE_CODE IN ('EX
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';
## table 5 fin_info_transaction
create table fin_info_transaction(
info_id varchar(64) primary key,
## table 5 fin_info_transaction
create table fin_info_transaction(
info_id varchar(64) primary key,
inst_id varchar(32),
business_code varchar(16),
sub_business_code varchar(16),
@ -76,7 +76,7 @@ gmt_create datetime,
gmt_modified datetime,
primary key(inst_id, term_batch_no, inst_merchant_no, term_trace_no, inst_terminal_no)
);
#selects to add
#selects to add
## table 7 fin_request_no_unique
@ -141,7 +141,7 @@ 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';
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';
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';
### table 10 idx1_fin_influx_transaction
@ -182,9 +182,9 @@ 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';
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';
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';
## table 12 idx1_fin_influx_payer

View File

@ -17,13 +17,13 @@ drop table if exists t1,t2,t3,t4,t5;
## Bug #10966: Variance functions return wrong data type
##
#
#create table t1 select variance(0);
#show create table t1;
#drop table t1;
#create table t1 select variance(0);
#show create table t1;
#drop table t1;
#create table t1 select stddev(0);
#show create table t1;
#drop table t1;
#
#
#
##
## Bug#22555: STDDEV yields positive result for groups with only one row
@ -127,7 +127,7 @@ drop table t1;
#
##
## Bug #23184: SELECT causes server crash
##
##
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);
#INSERT INTO t1 SELECT a, b+8 FROM t1;
@ -150,7 +150,7 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
DROP TABLE t1;
#
##
## Bug #27573: MIN() on an indexed column which is always NULL sets _other_
## Bug #27573: MIN() on an indexed column which is always NULL sets _other_
## results to NULL
##
CREATE TABLE t1 ( a INT, b INT primary key);
@ -186,7 +186,7 @@ EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
SELECT MIN(a), MIN(b) FROM t4 where a = 2;
SELECT MIN(b), min(c) FROM t4 where a = 2;
#
CREATE TABLE t5( a INT, b INT, primary KEY( a, b),c int);
CREATE TABLE t5( a INT, b INT, primary KEY( a, b),c int);
INSERT INTO t5(a,b) VALUES( 1, 1 ), ( 1, 2 );
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
@ -201,13 +201,13 @@ DROP TABLE t1, t2, t3, t4, t5;
#drop table t4, t5;
#
##
## Bug #31156: mysqld: item_sum.cc:918:
## Bug #31156: mysqld: item_sum.cc:918:
## virtual bool Item_sum_distinct::setup(THD*): Assertion
##
#
#CREATE TABLE t1 (a INT);
#INSERT INTO t1 values (),(),();
#SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1
#SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1
# GROUP BY x;
#SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) );
#
@ -287,10 +287,10 @@ SELECT COUNT(*),a FROM t1;
SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
#
#--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
#SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
#SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
#FROM t1 outr;
#
#SELECT COUNT(*) FROM t1 a JOIN t1 outr
#SELECT COUNT(*) FROM t1 a JOIN t1 outr
# ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
#
#SET SQL_MODE=default;
@ -301,13 +301,13 @@ DROP TABLE t1;
#--echo End of 5.0 tests
#
#--echo #
#--echo # BUG#47280 - strange results from count(*) with order by multiple
#--echo # BUG#47280 - strange results from count(*) with order by multiple
#--echo # columns without where/group
#--echo #
#--echo #
#
#--echo #
#--echo #
#--echo # Initialize test
#--echo #
#--echo #
#
CREATE TABLE t1 (
pk INT NOT NULL,
@ -322,7 +322,7 @@ INSERT INTO t1 VALUES (1,11),(2,12),(3,13);
#--echo #
#
#--echo
#--echo # Masking all correct values {11...13} for column i in this result.
#--echo # Masking all correct values {11...13} for column i in this result.
#--replace_column 2 #
SELECT MAX(pk) as max, i
FROM t1
@ -386,7 +386,7 @@ DROP TABLE t1;
#CREATE TABLE t1 (a INT);
#INSERT INTO t1 VALUES (1), (2);
#
#SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1
#SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1
# ORDER BY t1.a;
#
#DROP TABLE t1;
@ -414,7 +414,7 @@ DROP TABLE t1;
#
#
#--echo #
#--echo # Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
#--echo # Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
#--echo #
#
#CREATE TABLE t1 (a BIGINT UNSIGNED);

View File

@ -28,7 +28,7 @@ create table dddddddddd2222222222333333333344444444445555555555666666666612345 (
drop table if exists alter_table1;
--enable_warnings
create table alter_table1 (cc1 int primary key);
create table alter_table1 (cc1 int primary key);
ALTER TABLE alter_table1 CHANGE cc1 `hhhhhhhhhh222222222233333333334444444444555555555566666666661234` INT;
--disable_warnings
@ -39,7 +39,7 @@ drop table if exists alter_table1;
drop table if exists alter_table2;
--enable_warnings
create table alter_table2 (cc2 int primary key);
create table alter_table2 (cc2 int primary key);
#--error 1059
ALTER TABLE alter_table2 CHANGE cc2 `gggggggggg2222222222333333333344444444445555555555666666666612345` INT;
@ -64,11 +64,11 @@ use vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2
drop database vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666612345vvvvvvvvvv2222222222333333333344444444445555555555666666666a193;
##name can not ended with ' '
--error 1102
--error 1102
create database `adc `;
--error 1102
--error 1102
drop database `adc `;
--error 1102
--error 1102
use `adc `;
##when bytes number of name is between 65 and 191,return error 1102
@ -78,30 +78,30 @@ drop database vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65;
use vvvvvvvvvv2222222222333333333344444444445555555555666666666612a65;
#when database name is prefix of '#mysql50#' and end of these alpha '~' ,'.', '\\' ,'/' return error 1102
--error 1102
--error 1102
create database `#mysql50#~`;
--error 1102
--error 1102
drop database `#mysql50#~`;
--error 1102
--error 1102
use `#mysql50#~`;
--error 1102
--error 1102
create database `#mysql50#.`;
--error 1102
--error 1102
drop database `#mysql50#.`;
--error 1102
--error 1102
use `#mysql50#.`;
--error 1102
--error 1102
create database `#mysql50#\\`;
--error 1102
--error 1102
drop database `#mysql50#\\`;
--error 1102
--error 1102
use `#mysql50#\\`;
--error 1102
--error 1102
create database `#mysql50#/`;
--error 1102
--error 1102
drop database `#mysql50#/`;
--error 1102
--error 1102
use `#mysql50#/`;

View File

@ -29,3 +29,5 @@ create unique index idx_5 on tbl1(d4);
create unique index idx_7 on tbl1(i1,v2,i3,d4,i6);
#--source mysql_test/include/check_idx_error.inc
drop table tbl1;

View File

@ -5,10 +5,10 @@ set @@session.explicit_defaults_for_timestamp=off;
#owner group: sql1
#test:
#create index objecting to columns
#create index objecting to columns
###TODO regenerate result file after physicalplan output is ready
--disable_query_log
--source mysql_test/include/index_quick_major.inc
--source mysql_test/include/index_quick_major.inc
--real_sleep 1
--disable_warnings
drop table if exists t1;

View File

@ -85,3 +85,5 @@ select pk1 from t1 where key2=NULL and key3<=NULL;
##
select * from t1 where key2=NULL and key3>=NULL;
select pk1 from t1 where key2=NULL and key3>=NULL;

View File

@ -28,3 +28,5 @@ select /*+index(t1 i1) */ * from t1 b where b.c2 > 0 and b.c2 < 5;
select /*+index(b i1) */ * from t1 b where b.c2 > 0 and b.c2 < 5;
drop table t1;

View File

@ -34,7 +34,7 @@ select * from t1 intersect all (select * from t2 where false);
(select * from t1 where false) intersect all (select * from t2 where false) intersect (select * from t3 where false);
#
#
select c1 from t1 intersect select c1 from t1;
--error 1064
select c1 from t1 intersect all select c1 from t1;
@ -102,3 +102,5 @@ insert into t8 values('cdxLVdvvJjcoHFBECqXKkRGoMXYgNsTpJRrqYaluQdfEeB00000',0,'R
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);
drop table t1,t2,t3,t4,t5,t6, t8;

View File

@ -66,3 +66,4 @@ select * from t2;
select * from t1, t2 where t1.c1>=t2.c1;
drop table orders,persons, t1, t2, t3;

View File

@ -72,3 +72,5 @@ select t1.pk,t2.c2 from t1 RIGHT join t2 on t1.pk=t2.pk and t2.pk=1;
--sorted_result
select t1.pk,t2.c2 from t1 FULL join t2 on t1.pk=t2.pk and t2.pk=1;

View File

@ -27,18 +27,18 @@ 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;
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;
select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl1.i1=tbl3.i1 join tbl4 on tbl1.i1=tbl4.i1;
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;
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;
select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl2.i1=tbl3.i1 join tbl4 on tbl3.i1=tbl4.i1;
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;
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
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 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl1.i1=tbl3.i1 join tbl4 on tbl1.i1=tbl4.i1;
--enable_result_log
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
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 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;
--enable_result_log
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
@ -48,18 +48,18 @@ explain select * from tbl1 join tbl2 on tbl1.i1=tbl2.i1 join tbl3 on tbl2.i1=t
--disable_result_log
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;
--enable_result_log
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;
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;
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;
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;
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;
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;
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;
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
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 left join tbl2 on tbl1.i1=tbl2.i1 left join tbl3 on tbl1.i1=tbl3.i1 left join tbl4 on tbl1.i1=tbl4.i1;
--enable_result_log
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log
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 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;
--enable_result_log
--replace_regex /Plan signature: [0-9]*/Plan signature/
--disable_result_log

View File

@ -34,3 +34,4 @@ SELECT * FROM (SELECT * FROM tjuo1) tjuo1_alias RIGHT JOIN tjuo2 USING (c1) RI
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);
SELECT * FROM (SELECT c2 FROM tjuo1 as i1 JOIN (SELECT * FROM tjuo2) as i2 USING (c1) ) as t12;
drop table tjuo1, tjuo2, tjuo3;

View File

@ -38,3 +38,4 @@ select * FROM t1 ORDER BY a desc LIMIT 8;
select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
drop table t1;

View File

@ -17,3 +17,5 @@ insert into t1 values(1,1);
rollback;
insert into t1 values(1,1);
rollback;

View File

@ -27,3 +27,4 @@ select use_bloom_filter() from dual;
select use_bloom() from dual;
drop table t_status;

View File

@ -5,7 +5,7 @@ set @@session.explicit_defaults_for_timestamp=off;
#owner group: sql1
#
## Bug
## Bug
#
# partition by key()
--disable_warnings

View File

@ -5,5 +5,5 @@ set @@session.explicit_defaults_for_timestamp=off;
# owner group: SQL2
# description:
#
--error 1064
--error 1064
SELECT name FROM master.dbo.sysdatabases WHERE status <> 512;

View File

@ -41,3 +41,7 @@ commit;
select * from t1;

View File

@ -142,3 +142,4 @@ commit;
select * from tbl1 where pk in (100,200);
delete from tbl1 where pk in (100,200);

View File

@ -5,7 +5,7 @@ set @@session.explicit_defaults_for_timestamp=off;
#owner: linlin.xll
#owner group: SQL1
#description:
#tags:sys_vars
#tags:sys_vars
connect (conn1,$OBMYSQL_MS0,$OBMYSQL_USR,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
connection conn1;

View File

@ -5,7 +5,7 @@ set @@session.explicit_defaults_for_timestamp=off;
#owner: linlin.xll
#owner group: SQL1
#description:
#tags: sys_vars
#tags: sys_vars
show collation;
show collation;

View File

@ -16,7 +16,7 @@ insert into tc1 values (3, 'ccccc');
create index idxc2 on tc1(c2);
alter table tc1 add index idxc3(c1,c2);
select * from tc1;
--source mysql_test/include/check_all_idx_ok.inc
--source mysql_test/include/check_all_idx_ok.inc
show index from tc1;
truncate table tc1;
let $is_truncate_table = 1;

View File

@ -103,3 +103,7 @@ if($user2_c_2 == $user2_ct)
}
drop table t1;

View File

@ -109,4 +109,4 @@ select * from t1;
#connection conn1;
#--error 4012
#commit;
set global ob_trx_timeout = 100000000;
set global ob_trx_timeout = 100000000;

View File

@ -8,15 +8,16 @@ set @@session.explicit_defaults_for_timestamp=off;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(pk int primary key, i1 int, v1 varchar(20));
set autocommit=0;
set session ob_trx_timeout=10000000;
create table t1(pk int primary key, i1 int, v1 varchar(20));
set autocommit=0;
set session ob_trx_timeout=10000000;
#because start from 4.0 empty delete won't cause session into txn,
#we do some really modifies here
--disable_query_log
insert into t1 values(1,1,'1');
--enable_query_log
delete from t1 where pk<4;
delete from t1 where pk<4;
sleep 12;
--error 6002
commit;

View File

@ -50,16 +50,16 @@ insert into t2 values
--enable_query_log
##############one table union #############
#all use index
#all use index
--sorted_result
(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);
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;
(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);
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;
--sorted_result
(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);
(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);
--sorted_result
(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);
(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);
--sorted_result
(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);
(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);
--sorted_result
(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);

View File

@ -54,3 +54,4 @@ select * from test;
set @@global.ob_enable_plan_cache= 1;
drop table test;
drop database db1;

View File

@ -23,7 +23,7 @@ insert into tbl1 values(1,1,'abc12','1agc',1.25,'2014-01-01 12:00:00',23.23,1),
(11,null,null,null,null,null,null,null);
create unique index idx_1 on tbl1(i1);
--source mysql_test/include/check_all_idx_ok.inc
select date_sub(null, INTERVAL -6 DAY);
select date_sub(null, INTERVAL -6 DAY);
select * from tbl1;
update tbl1 set i1=i1-20 where pk<=11 limit 20;
update tbl1 set i1=i1+20 where pk<=11 limit 20;
@ -47,8 +47,8 @@ update tbl1 set i5=i5-0.05;
update tbl1 set i6=i6 and 1;
select * from tbl1;
select * from tbl1 where i1>10 and i1<=1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1 between 10+1 and 1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1 between 10+1 and 1000;
prepare stmt1 from select * from tbl1 where i1>?+1 and i1<?-10;
set @a=10;
set @b=1000;
@ -56,16 +56,16 @@ execute stmt1 using @a, @b;
set @a=10+1-1;
set @b=1000-1+1;
execute stmt1 using @a, @b;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
prepare stmt1 from select * from tbl1 where i1>(? mod 10) and i1<(? mod 1005)-10;
set @a=10;
set @b=1001;
@ -73,33 +73,33 @@ execute stmt1 using @a, @b;
set @a=10+1-1;
set @b=1001-1+1;
execute stmt1 using @a, @b;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
update tbl1 set i1=i1+1-1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
update tbl1 set i1=i1+1-1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
update tbl1 set i1=i1+1-1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
update tbl1 set i1=i1+1-1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
--error 1064
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is (null+1);
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is (null+1);
--error 5083
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null+1;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
update tbl1 set i1=i1+100-100 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null+1;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
update tbl1 set i1=i1+100-100 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
prepare stmt1 from select * from tbl1 where i1>=?+1 and i1<=(?*2) and i5 between ? and ?;
set @a=10;
set @b=100;
@ -135,22 +135,22 @@ drop index idx_1 on tbl1;
create index idx_12 on tbl1(i1,i5);
--source mysql_test/include/check_all_idx_ok.inc
select * from tbl1 where i1>10 and i1<=1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
select * from tbl1 where i1>=10+1 and i1<=(100*10) and i5 between -100 and 1000;
select * from tbl1 where i1<=round(1000.5) and i1>=round(0.5);
select * from tbl1 where i1>=0 and i1<=EXTRACT(DAY FROM '2014-09-30 12:00:00' )+600;
@ -163,33 +163,33 @@ select * from tbl1 where (i4,i1) in ((1.25,1),(-0.25,10),(-85.85,42),(2.25,80));
create index idx_15 on tbl1(i1,i5);
--source mysql_test/include/check_all_idx_ok.inc
select * from tbl1 where i1>10 and i1<=1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
select * from tbl1 where i1>10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<1000-10;
select * from tbl1 where i1>10+1 and i1<1000-10;
select * from tbl1 where i1>1*10+1 and i1<1000;
select * from tbl1 where i1>10 and i1<=1000*2;
select * from tbl1 where i1>10*2+3 and i1<=1000*2;
select * from tbl1 where i1>1*50/5+1 and i1<=1000*2/2+1;
select * from tbl1 where i1>50 and i1<=1000*2/2+1;
select * from tbl1 where i1>50*1+3 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=1000;
select * from tbl1 where i1>(19 mod 10)+1 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10 and i1<=(1000 mod 1001) +10;
select * from tbl1 where i1>10+0 and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+null and i1<=(1000*1001) +10;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) +null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) or i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is null;
select * from tbl1 where i1>=10+1 and i1<=(1000*2) and i1 is not null;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i1 = 610;
select * from tbl1 where i1>=10+1 and i1<=(100*2) or i3 = 'cx23abc12';
select * from tbl1 where i1>=10+1 and i1<=(100*2) and i5 between 0 and 1000;
select * from tbl1 where i1>=10+1 and i1<=(100*10) and i5 between -100 and 1000;
select * from tbl1 where i1>10+1 and i1<1000 and pk<=10;
select * from tbl1 where i1>-9999999999+1+0 and i1<10000000000-2+1-1+2-2+3-3+4-4+5-5+6-6+7-7+8-8+9-9+0-0+10-10 and pk<=10;
select * from tbl1 where i1>-9999999999+1+0 and i1<10000000000-2+1-1+2-2+3-3+4-4+5-5+6-6+7-7+8-8+9-9+0-0+10-10 ;
select * from tbl1 where i1>=10+1 and i1<=(100*10) and i5 between -100 and 1000;
prepare stmt1 from select * from tbl1 where i1>=?+1 and i1<=(?*10) and i5 between ? and ?;
prepare stmt1 from select * from tbl1 where i1>=?+1 and i1<=(?*10) and i5 between ? and ?;
set @a=10;
set @b=100;
set @c=-100;
@ -209,13 +209,13 @@ select * from tbl1 where (i1,i5) in ((1,23.23),(42,-99.131),(50,93.131),(610,99.
select * from tbl1 where (i5,i1) in ((23.23,1),(-99.131,42),(93.131,50),(99.131,610));
select * from tbl1 where (i1,i5,i4) in ((1,23.23,1.25),(610,99.131,-1.85),(42,-99.131,-85.85));
select * from tbl1 where (i4,i1,i5) in ((1.25,1,23.23),(-1.85,610,99.131),(-85.85,42,-99.131));
prepare stmt1 from select * from tbl1 where (i4,i1,i5) in ((1.25,?,23.23),(-1.85,?,99.131),(?,42,?));
prepare stmt1 from select * from tbl1 where (i4,i1,i5) in ((1.25,?,23.23),(-1.85,?,99.131),(?,42,?));
set @a=-99.131;
set @b=610;
set @c=1;
set @d=-85.85;
execute stmt1 using @c,@b,@d,@a;
prepare stmt1 from select * from tbl1 where i1>=?*?+?+? and i1<=?*?+?-?;
prepare stmt1 from select * from tbl1 where i1>=?*?+?+? and i1<=?*?+?-?;
set @a=-10;
set @b=2;
set @c=1;

View File

@ -58,7 +58,7 @@ create view view_v1_null_default as select c1,c2 from view_t1_null_default;
#create view view_v1_not_null_default as select * from view_t1_not_null_default;
create view view_v1_not_null_default as select c1,c2 from view_t1_not_null_default;
#
## Bug
## Bug
#
create table table_t8(c1 int null,c2 int not null);
create view view_v8 as select c1+c2 from table_t8;
@ -208,7 +208,7 @@ drop view if exists v1,v2,v3;
drop table if exists t1;
--enable_warnings
# Bug
# Bug
--disable_warnings
drop table if exists t1;
--enable_warnings

View File

@ -121,7 +121,7 @@ select v.c1 from v join t2 using(c1);
--error 1356
select v.c1 from v join t2 using(c2);
#column in where
#column in where
--disable_warnings
drop table if exists t1,t2;
drop view if exists v;
@ -166,7 +166,7 @@ select c1 from v group by c2;
--error 1356
select c1 from v group by (select c2);
#column in having
#column in having
#drop table if exists t1,t2;
#drop view if exists v;
#create table t1(c1 int,c2 int);
@ -186,7 +186,7 @@ drop view if exists v;
--enable_warnings
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;
create view v as select c1,c2 from t1 order by c2;
alter table t1 drop column c2;
#order by 即使是从select里找到了c2(select中的c2不报错是因为view_stmt),因为select里面的c2也是无效列,因此最终结果也是视图无效
--error 1356
@ -354,7 +354,7 @@ alter table t2 add column c3 int;
select (select c3 from v limit 1) from t2;
#
##Bug
##Bug
#
--disable_warnings
drop table if exists t1;
@ -431,7 +431,7 @@ select * from v2;
select * from v3;
#
## Bug :
## Bug :
## 主要测试在非select语句引用select_stmt(view展开)的问题,select结果作为其它stmt的输入暂时不支持,
## 这里仅仅针对bug加入回归case
#
@ -462,12 +462,12 @@ show warnings;
#Bug 对于基表schema失效的视图,查询成功后不应该有warning
--disable_warnings
drop table if exists t1;
drop table if exists t1;
drop view if exists v;
--enable_warnings
create table t1(c1 int,c2 int);
create view v as select * from t1;
alter table t1 drop column c2;
create view v as select * from t1;
alter table t1 drop column c2;
--error 1356
select c1 from v;
show warnings;
@ -488,7 +488,7 @@ select * from xy;
#Bug 创建视图中包含union子句并且类型为char的时候长度出错
--disable_warnings
drop table if exists t1;
drop table if exists t1;
drop table if exists t2;
drop view if exists v;
--enable_warnings
@ -509,7 +509,7 @@ create view v as (select k, v from t1) union (select 1, 1 from t1);
show create view v;
--disable_warnings
drop table if exists t1;
drop table if exists t1;
drop table if exists t2;
--enable_warnings
CREATE TABLE `t11` ( `a` int(11) NOT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, PRIMARY KEY (`a`) );