提交 98ca4a1d 编写于 作者: martianzhang's avatar martianzhang

add mysql environment verbose info

上级 faaa59f6
......@@ -1405,7 +1405,7 @@ func FormatSuggest(sql string, format string, suggests ...map[string]Rule) (map[
}
sort.Strings(sortedHeuristicSuggest)
for _, item := range sortedHeuristicSuggest {
buf = append(buf, fmt.Sprintln("## ", suggest[item].Summary))
buf = append(buf, fmt.Sprintln("##", suggest[item].Summary))
if item == "OK" {
continue
}
......
......@@ -46,7 +46,7 @@ SELECT country_id, last_update FROM city NATURAL LEFT JOIN country;
SELECT country_id, last_update FROM city NATURAL RIGHT JOIN country;
SELECT a.country_id, a.last_update FROM city a STRAIGHT_JOIN country b ON a.country_id=b.country_id;
SELECT a.address, a.postal_code FROM sakila.address a WHERE a.city_id IN (SELECT c.city_id FROM sakila.city c);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT city FROM( SELECT city_id FROM city WHERE city = "A Corua (La Corua)" ORDER BY last_update DESC LIMIT 50, 10) I JOIN city ON (I.city_id = city.city_id) JOIN country ON (country.country_id = city.country_id) ORDER BY city DESC;
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
DELETE city FROM city LEFT JOIN country ON city.country_id = country.country_id WHERE country.country IS NULL;
DELETE a1, a2 FROM city AS a1 INNER JOIN country AS a2 WHERE a1.country_id=a2.country_id;
......@@ -79,7 +79,7 @@ SELECT description FROM film WHERE description IN('NEWS','asd') GROUP BY descrip
alter table address add index idx_city_id(city_id);
alter table inventory add index `idx_store_film` (`store_id`,`film_id`);
alter table inventory add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`);
SELECT DATE_FORMAT(t.atm, '%Y-%m-%d'), COUNT(DISTINCT (t.usr)) FROM usr_terminal t WHERE t.atm > '2018-10-22 00:00:00' AND t.agent LIKE '%Chrome%' AND t.system = 'eip' GROUP BY DATE_FORMAT(t.atm, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.atm, '%Y-%m-%d');
SELECT DATE_FORMAT(t.last_update, '%Y-%m-%d'), COUNT(DISTINCT (t.city)) FROM city t WHERE t.last_update > '2018-10-22 00:00:00' AND t.city LIKE '%Chrome%' AND t.city = 'eip' GROUP BY DATE_FORMAT(t.last_update, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.last_update, '%Y-%m-%d');
create table hello.t (id int unsigned);
select * from tb where data >= '';
alter table tb alter column id drop default;
......@@ -94,8 +94,8 @@ SELECT a.country_id, a.last_update FROM city a STRAIGHT_JOIN country b ON a.coun
SELECT a.country_id, a.last_update FROM city a STRAIGHT_JOIN country b ON a.country_id=b.country_id;
SELECT a.address, a.postal_code FROM sakila.address a WHERE a.city_id IN (SELECT c.city_id FROM sakila.city c);
SELECT a.address, a.postal_code FROM sakila.address a WHERE a.city_id IN (SELECT c.city_id FROM sakila.city c);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT city FROM( SELECT city_id FROM city WHERE city = "A Corua (La Corua)" ORDER BY last_update DESC LIMIT 50, 10) I JOIN city ON (I.city_id = city.city_id) JOIN country ON (country.country_id = city.country_id) ORDER BY city DESC;
SELECT city FROM( SELECT city_id FROM city WHERE city = "A Corua (La Corua)" ORDER BY last_update DESC LIMIT 50, 10) I JOIN city ON (I.city_id = city.city_id) JOIN country ON (country.country_id = city.country_id) ORDER BY city DESC;
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
DELETE city FROM city LEFT JOIN country ON city.country_id = country.country_id WHERE country.country IS NULL;
......@@ -160,8 +160,8 @@ alter table inventory add index `idx_store_film` (`store_id`,`film_id`);
alter table inventory add index `idx_store_film` (`store_id`,`film_id`);
alter table inventory add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`);
alter table inventory add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`);
SELECT DATE_FORMAT(t.atm, '%Y-%m-%d'), COUNT(DISTINCT (t.usr)) FROM usr_terminal t WHERE t.atm > '2018-10-22 00:00:00' AND t.agent LIKE '%Chrome%' AND t.system = 'eip' GROUP BY DATE_FORMAT(t.atm, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.atm, '%Y-%m-%d');
SELECT DATE_FORMAT(t.atm, '%Y-%m-%d'), COUNT(DISTINCT (t.usr)) FROM usr_terminal t WHERE t.atm > '2018-10-22 00:00:00' AND t.agent LIKE '%Chrome%' AND t.system = 'eip' GROUP BY DATE_FORMAT(t.atm, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.atm, '%Y-%m-%d');
SELECT DATE_FORMAT(t.last_update, '%Y-%m-%d'), COUNT(DISTINCT (t.city)) FROM city t WHERE t.last_update > '2018-10-22 00:00:00' AND t.city LIKE '%Chrome%' AND t.city = 'eip' GROUP BY DATE_FORMAT(t.last_update, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.last_update, '%Y-%m-%d');
SELECT DATE_FORMAT(t.last_update, '%Y-%m-%d'), COUNT(DISTINCT (t.city)) FROM city t WHERE t.last_update > '2018-10-22 00:00:00' AND t.city LIKE '%Chrome%' AND t.city = 'eip' GROUP BY DATE_FORMAT(t.last_update, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.last_update, '%Y-%m-%d');
create table hello.t (id int unsigned);
create table hello.t (id int unsigned);
select * from tb where data >= '';
......
......@@ -456,26 +456,25 @@ SELECT
c. city_id
FROM
sakila. city c);
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
SELECT city FROM( SELECT city_id FROM city WHERE city = "A Corua (La Corua)" ORDER BY last_update DESC LIMIT 50, 10) I JOIN city ON (I.city_id = city.city_id) JOIN country ON (country.country_id = city.country_id) ORDER BY city DESC;
SELECT
visitor_id, url
FROM
(
city
FROM(
SELECT
id
city_id
FROM
LOG
city
WHERE
ip= "123.45.67.89"
city = "A Corua (La Corua)"
ORDER BY
ts desc
last_update DESC
LIMIT
50, 10) I
JOIN LOG ON (I. id= LOG. id)
JOIN url ON (url. id= LOG. url_id)
JOIN city ON (I. city_id = city. city_id)
JOIN country ON (country. country_id = city. country_id)
ORDER BY
TS desc;
city DESC;
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
DELETE city, country
FROM
......@@ -846,24 +845,24 @@ ADD
ADD
index `idx_store_film` (
`store_id`, `film_id`);
SELECT DATE_FORMAT(t.atm, '%Y-%m-%d'), COUNT(DISTINCT (t.usr)) FROM usr_terminal t WHERE t.atm > '2018-10-22 00:00:00' AND t.agent LIKE '%Chrome%' AND t.system = 'eip' GROUP BY DATE_FORMAT(t.atm, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.atm, '%Y-%m-%d');
SELECT DATE_FORMAT(t.last_update, '%Y-%m-%d'), COUNT(DISTINCT (t.city)) FROM city t WHERE t.last_update > '2018-10-22 00:00:00' AND t.city LIKE '%Chrome%' AND t.city = 'eip' GROUP BY DATE_FORMAT(t.last_update, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.last_update, '%Y-%m-%d');
SELECT
DATE_FORMAT( t. atm, '%Y-%m-%d'
DATE_FORMAT( t. last_update, '%Y-%m-%d'
),
COUNT( DISTINCT (
t. usr))
t. city))
FROM
usr_terminal t
city t
WHERE
t. atm > '2018-10-22 00:00:00'
AND t. agent LIKE '%Chrome%'
AND t. system = 'eip'
t. last_update > '2018-10-22 00:00:00'
AND t. city LIKE '%Chrome%'
AND t. city = 'eip'
GROUP BY
DATE_FORMAT( t. atm, '%Y-%m-%d'
DATE_FORMAT( t. last_update, '%Y-%m-%d'
)
ORDER BY
DATE_FORMAT( t. atm, '%Y-%m-%d'
DATE_FORMAT( t. last_update, '%Y-%m-%d'
);
create table hello.t (id int unsigned);
create table hello. t (id int unsigned);
......
[
{
"text": "select 1",
"resultFields": null,
"SQLCache": true,
"CalcFoundRows": false,
"StraightJoin": false,
......@@ -8,11 +10,14 @@
"From": null,
"Where": null,
"Fields": {
"text": "",
"Fields": [
{
"text": "1",
"Offset": 7,
"WildCard": null,
"Expr": {
"text": "",
"Type": {
"Tp": 8,
"Flag": 128,
......@@ -21,7 +26,16 @@
"Charset": "binary",
"Collate": "binary",
"Elems": null
}
},
"flag": 0,
"k": 1,
"collation": 0,
"decimal": 0,
"length": 0,
"i": 1,
"b": null,
"x": null,
"projectionOffset": -1
},
"AsName": {
"O": "",
......
......@@ -94,8 +94,8 @@ SELECT a.country_id, a.last_update FROM city a STRAIGHT_JOIN country b ON a.coun
[{5 SELECT 0} {1 a. 0} {1 country_id, 0} {0 0} {1 a. 0} {1 last_update 0} {5 FROM 0} {1 city 0} {1 a 0} {1 STRAIGHT_JOIN 0} {1 country 0} {1 b 0} {1 ON 0} {1 a. 0} {1 country_id= 0} {1 b. 0} {1 country_id; 0}]
SELECT a.address, a.postal_code FROM sakila.address a WHERE a.city_id IN (SELECT c.city_id FROM sakila.city c);
[{5 SELECT 0} {1 a. 0} {1 address, 0} {0 0} {1 a. 0} {1 postal_code 0} {5 FROM 0} {1 sakila. 0} {1 address 0} {1 a 0} {5 WHERE 0} {1 a. 0} {1 city_id 0} {1 IN 0} {0 0} {7 ( 0} {5 SELECT 0} {1 c. 0} {1 city_id 0} {5 FROM 0} {1 sakila. 0} {1 city 0} {1 c) 0} {7 ; 0}]
SELECT visitor_id, url FROM (SELECT id FROM log WHERE ip="123.45.67.89" order by ts desc limit 50, 10) I JOIN log ON (I.id=log.id) JOIN url ON (url.id=log.url_id) order by TS desc;
[{5 SELECT 0} {1 visitor_id, 0} {0 0} {1 url 0} {5 FROM 0} {7 ( 0} {5 SELECT 0} {1 id 0} {5 FROM 0} {4 LOG 0} {5 WHERE 0} {1 ip= 0} {2 "123.45.67.89" 0} {0 0} {5 ORDER BY 0} {1 ts 0} {1 desc 0} {5 LIMIT 0} {10 50, 0} {0 0} {10 10) 0} {0 0} {1 I 0} {6 JOIN 0} {4 LOG 0} {1 ON 0} {7 ( 0} {1 I. 0} {1 id= 0} {4 LOG. 0} {1 id) 0} {0 0} {6 JOIN 0} {1 url 0} {1 ON 0} {7 ( 0} {1 url. 0} {1 id= 0} {4 LOG. 0} {1 url_id) 0} {0 0} {5 ORDER BY 0} {1 TS 0} {1 desc; 0}]
SELECT city FROM( SELECT city_id FROM city WHERE city = "A Corua (La Corua)" ORDER BY last_update DESC LIMIT 50, 10) I JOIN city ON (I.city_id = city.city_id) JOIN country ON (country.country_id = city.country_id) ORDER BY city DESC;
[{5 SELECT 0} {1 city 0} {5 FROM( 0} {0 0} {5 SELECT 0} {1 city_id 0} {5 FROM 0} {1 city 0} {5 WHERE 0} {1 city 0} {7 = 0} {0 0} {2 "A Corua (La Corua)" 0} {0 0} {5 ORDER BY 0} {1 last_update 0} {1 DESC 0} {5 LIMIT 0} {10 50, 0} {0 0} {10 10) 0} {0 0} {1 I 0} {6 JOIN 0} {1 city 0} {1 ON 0} {7 ( 0} {1 I. 0} {1 city_id 0} {7 = 0} {0 0} {1 city. 0} {1 city_id) 0} {0 0} {6 JOIN 0} {1 country 0} {1 ON 0} {7 ( 0} {1 country. 0} {1 country_id 0} {7 = 0} {0 0} {1 city. 0} {1 country_id) 0} {0 0} {5 ORDER BY 0} {1 city 0} {1 DESC; 0}]
DELETE city, country FROM city INNER JOIN country using (country_id) WHERE city.city_id = 1;
[{1 DELETE 0} {1 city, 0} {0 0} {1 country 0} {5 FROM 0} {1 city 0} {6 INNER JOIN 0} {1 country 0} {1 using 0} {7 ( 0} {1 country_id) 0} {0 0} {5 WHERE 0} {1 city. 0} {1 city_id 0} {7 = 0} {0 0} {10 1; 0}]
DELETE city FROM city LEFT JOIN country ON city.country_id = country.country_id WHERE country.country IS NULL;
......@@ -160,8 +160,8 @@ alter table inventory add index `idx_store_film` (`store_id`,`film_id`);
[{5 ALTER TABLE 0} {1 inventory 0} {5 ADD 0} {1 index 0} {3 `idx_store_film` 0} {0 0} {7 ( 0} {3 `store_id` 0} {7 , 0} {3 `film_id` 0} {7 ) 0} {7 ; 0}]
alter table inventory add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`),add index `idx_store_film` (`store_id`,`film_id`);
[{5 ALTER TABLE 0} {1 inventory 0} {5 ADD 0} {1 index 0} {3 `idx_store_film` 0} {0 0} {7 ( 0} {3 `store_id` 0} {7 , 0} {3 `film_id` 0} {7 ) 0} {7 , 0} {5 ADD 0} {1 index 0} {3 `idx_store_film` 0} {0 0} {7 ( 0} {3 `store_id` 0} {7 , 0} {3 `film_id` 0} {7 ) 0} {7 , 0} {5 ADD 0} {1 index 0} {3 `idx_store_film` 0} {0 0} {7 ( 0} {3 `store_id` 0} {7 , 0} {3 `film_id` 0} {7 ) 0} {7 ; 0}]
SELECT DATE_FORMAT(t.atm, '%Y-%m-%d'), COUNT(DISTINCT (t.usr)) FROM usr_terminal t WHERE t.atm > '2018-10-22 00:00:00' AND t.agent LIKE '%Chrome%' AND t.system = 'eip' GROUP BY DATE_FORMAT(t.atm, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.atm, '%Y-%m-%d');
[{5 SELECT 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 atm, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {7 , 0} {0 0} {4 COUNT( 0} {1 DISTINCT 0} {7 ( 0} {1 t. 0} {1 usr) 0} {7 ) 0} {0 0} {5 FROM 0} {1 usr_terminal 0} {1 t 0} {5 WHERE 0} {1 t. 0} {1 atm 0} {7 > 0} {0 0} {2 '2018-10-22 00:00:00' 0} {0 0} {6 AND 0} {1 t. 0} {1 agent 0} {1 LIKE 0} {2 '%Chrome%' 0} {0 0} {6 AND 0} {1 t. 0} {1 system 0} {7 = 0} {0 0} {2 'eip' 0} {0 0} {5 GROUP BY 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 atm, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {0 0} {5 ORDER BY 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 atm, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {7 ; 0}]
SELECT DATE_FORMAT(t.last_update, '%Y-%m-%d'), COUNT(DISTINCT (t.city)) FROM city t WHERE t.last_update > '2018-10-22 00:00:00' AND t.city LIKE '%Chrome%' AND t.city = 'eip' GROUP BY DATE_FORMAT(t.last_update, '%Y-%m-%d') ORDER BY DATE_FORMAT(t.last_update, '%Y-%m-%d');
[{5 SELECT 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 last_update, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {7 , 0} {0 0} {4 COUNT( 0} {1 DISTINCT 0} {7 ( 0} {1 t. 0} {1 city) 0} {7 ) 0} {0 0} {5 FROM 0} {1 city 0} {1 t 0} {5 WHERE 0} {1 t. 0} {1 last_update 0} {7 > 0} {0 0} {2 '2018-10-22 00:00:00' 0} {0 0} {6 AND 0} {1 t. 0} {1 city 0} {1 LIKE 0} {2 '%Chrome%' 0} {0 0} {6 AND 0} {1 t. 0} {1 city 0} {7 = 0} {0 0} {2 'eip' 0} {0 0} {5 GROUP BY 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 last_update, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {0 0} {5 ORDER BY 0} {4 DATE_FORMAT( 0} {1 t. 0} {1 last_update, 0} {0 0} {2 '%Y-%m-%d' 0} {7 ) 0} {7 ; 0}]
create table hello.t (id int unsigned);
[{1 create 0} {1 table 0} {1 hello. 0} {1 t 0} {7 ( 0} {1 id 0} {1 int 0} {1 unsigned) 0} {7 ; 0}]
select * from tb where data >= '';
......
......@@ -425,8 +425,5 @@ func main() {
return
}
// syntax check verbose mode, add output for success!
if common.Config.OnlySyntaxCheck && common.Config.Verbose {
fmt.Println("Syntax check OK!")
}
verboseInfo()
}
......@@ -153,3 +153,33 @@ func Test_Main_helpTools(t *testing.T) {
common.Config.ListReportTypes = orgConfig
common.Log.Debug("Exiting function: %s", common.GetFunctionName())
}
func Test_Main_verboseInfo(t *testing.T) {
common.Log.Debug("Entering function: %s", common.GetFunctionName())
orgVerbose := common.Config.Verbose
common.Config.Verbose = true
err := common.GoldenDiff(func() {
// Syntax check OK
orgSyntaxCheck := common.Config.OnlySyntaxCheck
common.Config.OnlySyntaxCheck = true
verboseInfo()
common.Config.OnlySyntaxCheck = orgSyntaxCheck
// MySQL environment verbose info
orgTestDSNDisable := common.Config.TestDSN.Disable
common.Config.TestDSN.Disable = true
verboseInfo()
common.Config.TestDSN.Disable = orgTestDSNDisable
orgOnlineDSNDisable := common.Config.OnlineDSN.Disable
common.Config.OnlineDSN.Disable = true
verboseInfo()
common.Config.OnlineDSN.Disable = orgOnlineDSNDisable
}, t.Name(), update)
if err != nil {
t.Error(err)
}
common.Config.Verbose = orgVerbose
common.Log.Debug("Exiting function: %s", common.GetFunctionName())
}
Syntax check OK!
MySQL environment verbose info
* test-dsn: 127.0.0.1:3306 is disable, please check log.
MySQL environment verbose info
* online-dsn: 127.0.0.1:3306 is disable, please check log.
......@@ -237,3 +237,28 @@ func shutdown(vEnv *env.VirtualEnv, rEnv *database.Connector) {
common.LogIfWarn(err, "")
os.Exit(0)
}
func verboseInfo() {
if !common.Config.Verbose {
return
}
// syntax check verbose mode, add output for success!
if common.Config.OnlySyntaxCheck {
fmt.Println("Syntax check OK!")
return
}
switch common.Config.ReportType {
case "markdown":
if common.Config.TestDSN.Disable || common.Config.OnlineDSN.Disable {
fmt.Println("MySQL environment verbose info")
// TestDSN
if common.Config.TestDSN.Disable {
fmt.Println("* test-dsn:", common.Config.TestDSN.Addr, "is disable, please check log.")
}
// OnlineDSN
if common.Config.OnlineDSN.Disable {
fmt.Println("* online-dsn:", common.Config.OnlineDSN.Addr, "is disable, please check log.")
}
}
}
}
online-dsn:
user: root
password: '********'
net: tcp
addr: 127.0.0.1:3306
schema: sakila
user: root
password: '********'
charset: utf8mb4
disable: false
charset: utf8
collation: utf8_general_ci
loc: UTC
tls: ""
server-public-key: ""
maxallowedpacket: 4194304
params:
charset: utf8
timeout: 0
read-timeout: 0
write-timeout: 0
allow-native-passwords: true
allow-old-passwords: false
disable: false
test-dsn:
user: root
password: '********'
net: tcp
addr: 127.0.0.1:3306
schema: sakila
user: root
password: '********'
charset: utf8mb4
disable: false
charset: utf8
collation: utf8_general_ci
loc: UTC
tls: ""
server-public-key: ""
maxallowedpacket: 4194304
params:
charset: utf8
timeout: 0
read-timeout: 0
write-timeout: 0
allow-native-passwords: true
allow-old-passwords: false
disable: false
allow-online-as-test: true
drop-test-temporary: true
cleanup-test-database: false
......
char(10) cp1250 10
char(256) cp1250 255
binary(10) cp1250 10
binary(256) cp1250 255
varchar(10) cp1250 11
varbinary(10) cp1250 11
enum('G','PG','PG-13','R','NC-17') cp1250 1
set('one', 'two') cp1250 1
not_exist cp1250 0
char(10) cp932 20
char(256) cp932 510
binary(10) cp932 10
binary(256) cp932 255
varchar(10) cp932 21
varbinary(10) cp932 21
enum('G','PG','PG-13','R','NC-17') cp932 1
set('one', 'two') cp932 1
not_exist cp932 0
char(10) gb2312 20
char(256) gb2312 510
binary(10) gb2312 10
binary(256) gb2312 255
varchar(10) gb2312 21
varbinary(10) gb2312 21
enum('G','PG','PG-13','R','NC-17') gb2312 1
set('one', 'two') gb2312 1
not_exist gb2312 0
char(10) latin1 10
char(256) latin1 255
binary(10) latin1 10
binary(256) latin1 255
varchar(10) latin1 11
varbinary(10) latin1 11
enum('G','PG','PG-13','R','NC-17') latin1 1
set('one', 'two') latin1 1
not_exist latin1 0
char(10) utf32 40
char(256) utf32 1020
binary(10) utf32 10
binary(256) utf32 255
varchar(10) utf32 41
varbinary(10) utf32 41
enum('G','PG','PG-13','R','NC-17') utf32 1
set('one', 'two') utf32 1
not_exist utf32 0
char(10) latin5 10
char(256) latin5 255
binary(10) latin5 10
binary(256) latin5 255
varchar(10) latin5 11
varbinary(10) latin5 11
enum('G','PG','PG-13','R','NC-17') latin5 1
set('one', 'two') latin5 1
not_exist latin5 0
char(10) latin7 10
char(256) latin7 255
binary(10) latin7 10
......@@ -61,24 +7,107 @@ varbinary(10) latin7 11
enum('G','PG','PG-13','R','NC-17') latin7 1
set('one', 'two') latin7 1
not_exist latin7 0
char(10) big5 20
char(256) big5 510
binary(10) big5 10
binary(256) big5 255
varchar(10) big5 21
varbinary(10) big5 21
enum('G','PG','PG-13','R','NC-17') big5 1
set('one', 'two') big5 1
not_exist big5 0
char(10) cp1257 10
char(256) cp1257 255
binary(10) cp1257 10
binary(256) cp1257 255
varchar(10) cp1257 11
varbinary(10) cp1257 11
enum('G','PG','PG-13','R','NC-17') cp1257 1
set('one', 'two') cp1257 1
not_exist cp1257 0
char(-1) latin7 0
char(10) ujis 30
char(256) ujis 765
binary(10) ujis 10
binary(256) ujis 255
varchar(10) ujis 31
varbinary(10) ujis 31
enum('G','PG','PG-13','R','NC-17') ujis 1
set('one', 'two') ujis 1
not_exist ujis 0
char(-1) ujis 0
char(10) cp1256 10
char(256) cp1256 255
binary(10) cp1256 10
binary(256) cp1256 255
varchar(10) cp1256 11
varbinary(10) cp1256 11
enum('G','PG','PG-13','R','NC-17') cp1256 1
set('one', 'two') cp1256 1
not_exist cp1256 0
char(-1) cp1256 0
char(10) cp852 10
char(256) cp852 255
binary(10) cp852 10
binary(256) cp852 255
varchar(10) cp852 11
varbinary(10) cp852 11
enum('G','PG','PG-13','R','NC-17') cp852 1
set('one', 'two') cp852 1
not_exist cp852 0
char(-1) cp852 0
char(10) cp866 10
char(256) cp866 255
binary(10) cp866 10
binary(256) cp866 255
varchar(10) cp866 11
varbinary(10) cp866 11
enum('G','PG','PG-13','R','NC-17') cp866 1
set('one', 'two') cp866 1
not_exist cp866 0
char(-1) cp866 0
char(10) geostd8 10
char(256) geostd8 255
binary(10) geostd8 10
binary(256) geostd8 255
varchar(10) geostd8 11
varbinary(10) geostd8 11
enum('G','PG','PG-13','R','NC-17') geostd8 1
set('one', 'two') geostd8 1
not_exist geostd8 0
char(-1) geostd8 0
char(10) keybcs2 10
char(256) keybcs2 255
binary(10) keybcs2 10
binary(256) keybcs2 255
varchar(10) keybcs2 11
varbinary(10) keybcs2 11
enum('G','PG','PG-13','R','NC-17') keybcs2 1
set('one', 'two') keybcs2 1
not_exist keybcs2 0
char(-1) keybcs2 0
char(10) ucs2 20
char(256) ucs2 510
binary(10) ucs2 10
binary(256) ucs2 255
varchar(10) ucs2 21
varbinary(10) ucs2 21
enum('G','PG','PG-13','R','NC-17') ucs2 1
set('one', 'two') ucs2 1
not_exist ucs2 0
char(-1) ucs2 0
char(10) utf32 40
char(256) utf32 1020
binary(10) utf32 10
binary(256) utf32 255
varchar(10) utf32 41
varbinary(10) utf32 41
enum('G','PG','PG-13','R','NC-17') utf32 1
set('one', 'two') utf32 1
not_exist utf32 0
char(-1) utf32 0
char(10) armscii8 10
char(256) armscii8 255
binary(10) armscii8 10
binary(256) armscii8 255
varchar(10) armscii8 11
varbinary(10) armscii8 11
enum('G','PG','PG-13','R','NC-17') armscii8 1
set('one', 'two') armscii8 1
not_exist armscii8 0
char(-1) armscii8 0
char(10) ascii 10
char(256) ascii 255
binary(10) ascii 10
binary(256) ascii 255
varchar(10) ascii 11
varbinary(10) ascii 11
enum('G','PG','PG-13','R','NC-17') ascii 1
set('one', 'two') ascii 1
not_exist ascii 0
char(-1) ascii 0
char(10) dec8 10
char(256) dec8 255
binary(10) dec8 10
......@@ -88,24 +117,17 @@ varbinary(10) dec8 11
enum('G','PG','PG-13','R','NC-17') dec8 1
set('one', 'two') dec8 1
not_exist dec8 0
char(10) hebrew 10
char(256) hebrew 255
binary(10) hebrew 10
binary(256) hebrew 255
varchar(10) hebrew 11
varbinary(10) hebrew 11
enum('G','PG','PG-13','R','NC-17') hebrew 1
set('one', 'two') hebrew 1
not_exist hebrew 0
char(10) koi8u 10
char(256) koi8u 255
binary(10) koi8u 10
binary(256) koi8u 255
varchar(10) koi8u 11
varbinary(10) koi8u 11
enum('G','PG','PG-13','R','NC-17') koi8u 1
set('one', 'two') koi8u 1
not_exist koi8u 0
char(-1) dec8 0
char(10) eucjpms 30
char(256) eucjpms 765
binary(10) eucjpms 10
binary(256) eucjpms 255
varchar(10) eucjpms 31
varbinary(10) eucjpms 31
enum('G','PG','PG-13','R','NC-17') eucjpms 1
set('one', 'two') eucjpms 1
not_exist eucjpms 0
char(-1) eucjpms 0
char(10) latin2 10
char(256) latin2 255
binary(10) latin2 10
......@@ -115,42 +137,57 @@ varbinary(10) latin2 11
enum('G','PG','PG-13','R','NC-17') latin2 1
set('one', 'two') latin2 1
not_exist latin2 0
char(10) macce 10
char(256) macce 255
binary(10) macce 10
binary(256) macce 255
varchar(10) macce 11
varbinary(10) macce 11
enum('G','PG','PG-13','R','NC-17') macce 1
set('one', 'two') macce 1
not_exist macce 0
char(10) sjis 20
char(256) sjis 510
binary(10) sjis 10
binary(256) sjis 255
varchar(10) sjis 21
varbinary(10) sjis 21
enum('G','PG','PG-13','R','NC-17') sjis 1
set('one', 'two') sjis 1
not_exist sjis 0
char(10) tis620 10
char(256) tis620 255
binary(10) tis620 10
binary(256) tis620 255
varchar(10) tis620 11
varbinary(10) tis620 11
enum('G','PG','PG-13','R','NC-17') tis620 1
set('one', 'two') tis620 1
not_exist tis620 0
char(10) ucs2 20
char(256) ucs2 510
binary(10) ucs2 10
binary(256) ucs2 255
varchar(10) ucs2 21
varbinary(10) ucs2 21
enum('G','PG','PG-13','R','NC-17') ucs2 1
set('one', 'two') ucs2 1
not_exist ucs2 0
char(-1) latin2 0
char(10) cp1257 10
char(256) cp1257 255
binary(10) cp1257 10
binary(256) cp1257 255
varchar(10) cp1257 11
varbinary(10) cp1257 11
enum('G','PG','PG-13','R','NC-17') cp1257 1
set('one', 'two') cp1257 1
not_exist cp1257 0
char(-1) cp1257 0
char(10) cp932 20
char(256) cp932 510
binary(10) cp932 10
binary(256) cp932 255
varchar(10) cp932 21
varbinary(10) cp932 21
enum('G','PG','PG-13','R','NC-17') cp932 1
set('one', 'two') cp932 1
not_exist cp932 0
char(-1) cp932 0
char(10) cp1250 10
char(256) cp1250 255
binary(10) cp1250 10
binary(256) cp1250 255
varchar(10) cp1250 11
varbinary(10) cp1250 11
enum('G','PG','PG-13','R','NC-17') cp1250 1
set('one', 'two') cp1250 1
not_exist cp1250 0
char(-1) cp1250 0
char(10) greek 10
char(256) greek 255
binary(10) greek 10
binary(256) greek 255
varchar(10) greek 11
varbinary(10) greek 11
enum('G','PG','PG-13','R','NC-17') greek 1
set('one', 'two') greek 1
not_exist greek 0
char(-1) greek 0
char(10) swe7 10
char(256) swe7 255
binary(10) swe7 10
binary(256) swe7 255
varchar(10) swe7 11
varbinary(10) swe7 11
enum('G','PG','PG-13','R','NC-17') swe7 1
set('one', 'two') swe7 1
not_exist swe7 0
char(-1) swe7 0
char(10) utf8 30
char(256) utf8 765
binary(10) utf8 10
......@@ -160,15 +197,27 @@ varbinary(10) utf8 31
enum('G','PG','PG-13','R','NC-17') utf8 1
set('one', 'two') utf8 1
not_exist utf8 0
char(10) armscii8 10
char(256) armscii8 255
binary(10) armscii8 10
binary(256) armscii8 255
varchar(10) armscii8 11
varbinary(10) armscii8 11
enum('G','PG','PG-13','R','NC-17') armscii8 1
set('one', 'two') armscii8 1
not_exist armscii8 0
char(-1) utf8 0
char(10) utf8mb4 40
char(256) utf8mb4 1020
binary(10) utf8mb4 10
binary(256) utf8mb4 255
varchar(10) utf8mb4 41
varbinary(10) utf8mb4 41
enum('G','PG','PG-13','R','NC-17') utf8mb4 1
set('one', 'two') utf8mb4 1
not_exist utf8mb4 0
char(-1) utf8mb4 0
char(10) cp850 10
char(256) cp850 255
binary(10) cp850 10
binary(256) cp850 255
varchar(10) cp850 11
varbinary(10) cp850 11
enum('G','PG','PG-13','R','NC-17') cp850 1
set('one', 'two') cp850 1
not_exist cp850 0
char(-1) cp850 0
char(10) euckr 20
char(256) euckr 510
binary(10) euckr 10
......@@ -178,24 +227,37 @@ varbinary(10) euckr 21
enum('G','PG','PG-13','R','NC-17') euckr 1
set('one', 'two') euckr 1
not_exist euckr 0
char(10) keybcs2 10
char(256) keybcs2 255
binary(10) keybcs2 10
binary(256) keybcs2 255
varchar(10) keybcs2 11
varbinary(10) keybcs2 11
enum('G','PG','PG-13','R','NC-17') keybcs2 1
set('one', 'two') keybcs2 1
not_exist keybcs2 0
char(10) ascii 10
char(256) ascii 255
binary(10) ascii 10
binary(256) ascii 255
varchar(10) ascii 11
varbinary(10) ascii 11
enum('G','PG','PG-13','R','NC-17') ascii 1
set('one', 'two') ascii 1
not_exist ascii 0
char(-1) euckr 0
char(10) hp8 10
char(256) hp8 255
binary(10) hp8 10
binary(256) hp8 255
varchar(10) hp8 11
varbinary(10) hp8 11
enum('G','PG','PG-13','R','NC-17') hp8 1
set('one', 'two') hp8 1
not_exist hp8 0
char(-1) hp8 0
char(10) koi8u 10
char(256) koi8u 255
binary(10) koi8u 10
binary(256) koi8u 255
varchar(10) koi8u 11
varbinary(10) koi8u 11
enum('G','PG','PG-13','R','NC-17') koi8u 1
set('one', 'two') koi8u 1
not_exist koi8u 0
char(-1) koi8u 0
char(10) macce 10
char(256) macce 255
binary(10) macce 10
binary(256) macce 255
varchar(10) macce 11
varbinary(10) macce 11
enum('G','PG','PG-13','R','NC-17') macce 1
set('one', 'two') macce 1
not_exist macce 0
char(-1) macce 0
char(10) binary 10
char(256) binary 255
binary(10) binary 10
......@@ -205,60 +267,7 @@ varbinary(10) binary 11
enum('G','PG','PG-13','R','NC-17') binary 1
set('one', 'two') binary 1
not_exist binary 0
char(10) cp1251 10
char(256) cp1251 255
binary(10) cp1251 10
binary(256) cp1251 255
varchar(10) cp1251 11
varbinary(10) cp1251 11
enum('G','PG','PG-13','R','NC-17') cp1251 1
set('one', 'two') cp1251 1
not_exist cp1251 0
char(10) utf8mb4 40
char(256) utf8mb4 1020
binary(10) utf8mb4 10
binary(256) utf8mb4 255
varchar(10) utf8mb4 41
varbinary(10) utf8mb4 41
enum('G','PG','PG-13','R','NC-17') utf8mb4 1
set('one', 'two') utf8mb4 1
not_exist utf8mb4 0
char(10) cp852 10
char(256) cp852 255
binary(10) cp852 10
binary(256) cp852 255
varchar(10) cp852 11
varbinary(10) cp852 11
enum('G','PG','PG-13','R','NC-17') cp852 1
set('one', 'two') cp852 1
not_exist cp852 0
char(10) koi8r 10
char(256) koi8r 255
binary(10) koi8r 10
binary(256) koi8r 255
varchar(10) koi8r 11
varbinary(10) koi8r 11
enum('G','PG','PG-13','R','NC-17') koi8r 1
set('one', 'two') koi8r 1
not_exist koi8r 0
char(10) cp866 10
char(256) cp866 255
binary(10) cp866 10
binary(256) cp866 255
varchar(10) cp866 11
varbinary(10) cp866 11
enum('G','PG','PG-13','R','NC-17') cp866 1
set('one', 'two') cp866 1
not_exist cp866 0
char(10) eucjpms 30
char(256) eucjpms 765
binary(10) eucjpms 10
binary(256) eucjpms 255
varchar(10) eucjpms 31
varbinary(10) eucjpms 31
enum('G','PG','PG-13','R','NC-17') eucjpms 1
set('one', 'two') eucjpms 1
not_exist eucjpms 0
char(-1) binary 0
char(10) gb18030 40
char(256) gb18030 1020
binary(10) gb18030 10
......@@ -268,51 +277,57 @@ varbinary(10) gb18030 41
enum('G','PG','PG-13','R','NC-17') gb18030 1
set('one', 'two') gb18030 1
not_exist gb18030 0
char(10) hp8 10
char(256) hp8 255
binary(10) hp8 10
binary(256) hp8 255
varchar(10) hp8 11
varbinary(10) hp8 11
enum('G','PG','PG-13','R','NC-17') hp8 1
set('one', 'two') hp8 1
not_exist hp8 0
char(10) swe7 10
char(256) swe7 255
binary(10) swe7 10
binary(256) swe7 255
varchar(10) swe7 11
varbinary(10) swe7 11
enum('G','PG','PG-13','R','NC-17') swe7 1
set('one', 'two') swe7 1
not_exist swe7 0
char(10) greek 10
char(256) greek 255
binary(10) greek 10
binary(256) greek 255
varchar(10) greek 11
varbinary(10) greek 11
enum('G','PG','PG-13','R','NC-17') greek 1
set('one', 'two') greek 1
not_exist greek 0
char(10) macroman 10
char(256) macroman 255
binary(10) macroman 10
binary(256) macroman 255
varchar(10) macroman 11
varbinary(10) macroman 11
enum('G','PG','PG-13','R','NC-17') macroman 1
set('one', 'two') macroman 1
not_exist macroman 0
char(10) ujis 30
char(256) ujis 765
binary(10) ujis 10
binary(256) ujis 255
varchar(10) ujis 31
varbinary(10) ujis 31
enum('G','PG','PG-13','R','NC-17') ujis 1
set('one', 'two') ujis 1
not_exist ujis 0
char(-1) gb18030 0
char(10) gb2312 20
char(256) gb2312 510
binary(10) gb2312 10
binary(256) gb2312 255
varchar(10) gb2312 21
varbinary(10) gb2312 21
enum('G','PG','PG-13','R','NC-17') gb2312 1
set('one', 'two') gb2312 1
not_exist gb2312 0
char(-1) gb2312 0
char(10) latin5 10
char(256) latin5 255
binary(10) latin5 10
binary(256) latin5 255
varchar(10) latin5 11
varbinary(10) latin5 11
enum('G','PG','PG-13','R','NC-17') latin5 1
set('one', 'two') latin5 1
not_exist latin5 0
char(-1) latin5 0
char(10) big5 20
char(256) big5 510
binary(10) big5 10
binary(256) big5 255
varchar(10) big5 21
varbinary(10) big5 21
enum('G','PG','PG-13','R','NC-17') big5 1
set('one', 'two') big5 1
not_exist big5 0
char(-1) big5 0
char(10) koi8r 10
char(256) koi8r 255
binary(10) koi8r 10
binary(256) koi8r 255
varchar(10) koi8r 11
varbinary(10) koi8r 11
enum('G','PG','PG-13','R','NC-17') koi8r 1
set('one', 'two') koi8r 1
not_exist koi8r 0
char(-1) koi8r 0
char(10) sjis 20
char(256) sjis 510
binary(10) sjis 10
binary(256) sjis 255
varchar(10) sjis 21
varbinary(10) sjis 21
enum('G','PG','PG-13','R','NC-17') sjis 1
set('one', 'two') sjis 1
not_exist sjis 0
char(-1) sjis 0
char(10) utf16le 40
char(256) utf16le 1020
binary(10) utf16le 10
......@@ -322,42 +337,17 @@ varbinary(10) utf16le 41
enum('G','PG','PG-13','R','NC-17') utf16le 1
set('one', 'two') utf16le 1
not_exist utf16le 0
char(10) cp1256 10
char(256) cp1256 255
binary(10) cp1256 10
binary(256) cp1256 255
varchar(10) cp1256 11
varbinary(10) cp1256 11
enum('G','PG','PG-13','R','NC-17') cp1256 1
set('one', 'two') cp1256 1
not_exist cp1256 0
char(10) cp850 10
char(256) cp850 255
binary(10) cp850 10
binary(256) cp850 255
varchar(10) cp850 11
varbinary(10) cp850 11
enum('G','PG','PG-13','R','NC-17') cp850 1
set('one', 'two') cp850 1
not_exist cp850 0
char(10) gbk 20
char(256) gbk 510
binary(10) gbk 10
binary(256) gbk 255
varchar(10) gbk 21
varbinary(10) gbk 21
enum('G','PG','PG-13','R','NC-17') gbk 1
set('one', 'two') gbk 1
not_exist gbk 0
char(10) geostd8 10
char(256) geostd8 255
binary(10) geostd8 10
binary(256) geostd8 255
varchar(10) geostd8 11
varbinary(10) geostd8 11
enum('G','PG','PG-13','R','NC-17') geostd8 1
set('one', 'two') geostd8 1
not_exist geostd8 0
char(-1) utf16le 0
char(10) tis620 10
char(256) tis620 255
binary(10) tis620 10
binary(256) tis620 255
varchar(10) tis620 11
varbinary(10) tis620 11
enum('G','PG','PG-13','R','NC-17') tis620 1
set('one', 'two') tis620 1
not_exist tis620 0
char(-1) tis620 0
char(10) utf16 40
char(256) utf16 1020
binary(10) utf16 10
......@@ -367,3 +357,54 @@ varbinary(10) utf16 41
enum('G','PG','PG-13','R','NC-17') utf16 1
set('one', 'two') utf16 1
not_exist utf16 0
char(-1) utf16 0
char(10) cp1251 10
char(256) cp1251 255
binary(10) cp1251 10
binary(256) cp1251 255
varchar(10) cp1251 11
varbinary(10) cp1251 11
enum('G','PG','PG-13','R','NC-17') cp1251 1
set('one', 'two') cp1251 1
not_exist cp1251 0
char(-1) cp1251 0
char(10) gbk 20
char(256) gbk 510
binary(10) gbk 10
binary(256) gbk 255
varchar(10) gbk 21
varbinary(10) gbk 21
enum('G','PG','PG-13','R','NC-17') gbk 1
set('one', 'two') gbk 1
not_exist gbk 0
char(-1) gbk 0
char(10) hebrew 10
char(256) hebrew 255
binary(10) hebrew 10
binary(256) hebrew 255
varchar(10) hebrew 11
varbinary(10) hebrew 11
enum('G','PG','PG-13','R','NC-17') hebrew 1
set('one', 'two') hebrew 1
not_exist hebrew 0
char(-1) hebrew 0
char(10) latin1 10
char(256) latin1 255
binary(10) latin1 10
binary(256) latin1 255
varchar(10) latin1 11
varbinary(10) latin1 11
enum('G','PG','PG-13','R','NC-17') latin1 1
set('one', 'two') latin1 1
not_exist latin1 0
char(-1) latin1 0
char(10) macroman 10
char(256) macroman 255
binary(10) macroman 10
binary(256) macroman 255
varchar(10) macroman 11
varbinary(10) macroman 11
enum('G','PG','PG-13','R','NC-17') macroman 1
set('one', 'two') macroman 1
not_exist macroman 0
char(-1) macroman 0
[]database.ReferenceValue{
{ReferencedTableSchema:"sakila", ReferencedTableName:"language", TableSchema:"sakila", TableName:"film", ConstraintName:"fk_film_language"},
{ReferencedTableSchema:"sakila", ReferencedTableName:"language", TableSchema:"sakila", TableName:"film", ConstraintName:"fk_film_language_original"},
}
[]database.ReferenceValue(nil)
......@@ -2,3 +2,4 @@ select 1 []database.TraceRow{
{Query:"explain select 1", Trace:"{\n \"steps\": [\n {\n \"join_preparation\": {\n \"select#\": 1,\n \"steps\": [\n {\n \"expanded_query\": \"/* select#1 */ select 1 AS `1`\"\n }\n ]\n }\n },\n {\n \"join_optimization\": {\n \"select#\": 1,\n \"steps\": [\n ]\n }\n },\n {\n \"join_explain\": {\n \"select#\": 1,\n \"steps\": [\n ]\n }\n }\n ]\n}", MissingBytesBeyondMaxMemSize:0, InsufficientPrivileges:0},
} nil
explain select 1 []database.TraceRow(nil) &errors.errorString{s:"no need trace"}
show create table film []database.TraceRow(nil) &errors.errorString{s:"no need trace"}
......@@ -46,7 +46,7 @@ WHERE
## 不建议使用 SELECT * 类型查询
## 不建议使用 SELECT * 类型查询
* **Item:** COL.001
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册