mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed testcase
This commit is contained in:
@@ -88,12 +88,12 @@ public class DMLSelectParserTest extends TestCase {
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT *\n"
|
||||
+ //
|
||||
"FROM offer a STRAIGHT_JOIN wp_image b USE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id INNER JOIN product_visit c\n"
|
||||
+ //
|
||||
"WHERE a.member_id = c.member_id\n" + //
|
||||
"\tAND c.member_id = 'abc'", output);
|
||||
Assert.assertEquals("SELECT *" + //
|
||||
"\nFROM offer a" + //
|
||||
"\n\tSTRAIGHT_JOIN wp_image b USE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id" + //
|
||||
"\n\tINNER JOIN product_visit c" + //
|
||||
"\nWHERE a.member_id = c.member_id\n" + //
|
||||
"\tAND c.member_id = 'abc'", output);
|
||||
}
|
||||
|
||||
public void test_select_2() throws Exception {
|
||||
@@ -106,25 +106,27 @@ public class DMLSelectParserTest extends TestCase {
|
||||
"FROM tb1, tb2\n" + //
|
||||
"WHERE tb1.id2 = tb2.id2", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_3() throws Exception {
|
||||
String sql = "SELect distinct high_priority tb1.id,tb2.id from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCT HIGH_PRIORITY tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2", output);
|
||||
Assert.assertEquals("SELECT DISTINCT HIGH_PRIORITY tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_4() throws Exception {
|
||||
String sql = "SELect distinctrow high_priority sql_small_result tb1.id,tb2.id from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCTROW HIGH_PRIORITY SQL_SMALL_RESULT tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2", output);
|
||||
Assert.assertEquals("SELECT DISTINCTROW HIGH_PRIORITY SQL_SMALL_RESULT tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_5() throws Exception {
|
||||
String sql = "SELect sql_cache id1,id2 from tb1,tb2 where tb1.id1=tb2.id1 ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -133,25 +135,28 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_CACHE id1, id2\nFROM tb1, tb2\nWHERE tb1.id1 = tb2.id1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_6() throws Exception {
|
||||
String sql = "SELect distinct high_priority tb1.id,tb2.id from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCT HIGH_PRIORITY tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2", output);
|
||||
Assert.assertEquals("SELECT DISTINCT HIGH_PRIORITY tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_7() throws Exception {
|
||||
String sql = "SELect distinctrow high_priority sql_small_result tb1.id,tb2.id " + "from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
String sql = "SELect distinctrow high_priority sql_small_result tb1.id,tb2.id "
|
||||
+ "from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCTROW HIGH_PRIORITY SQL_SMALL_RESULT tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2", output);
|
||||
Assert.assertEquals("SELECT DISTINCTROW HIGH_PRIORITY SQL_SMALL_RESULT tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_8() throws Exception {
|
||||
String sql = "SELect sql_cache id1,id2 from tb1,tb2 where tb1.id1=tb2.id1 ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -160,16 +165,17 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_CACHE id1, id2\nFROM tb1, tb2\nWHERE tb1.id1 = tb2.id1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_9() throws Exception {
|
||||
String sql = "SELect sql_cache id1,max(id2) from tb1 group by id1 having id1>10 order by id3 desc";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_CACHE id1, MAX(id2)\nFROM tb1\nGROUP BY id1\nHAVING id1 > 10\nORDER BY id3 DESC", output);
|
||||
Assert.assertEquals("SELECT SQL_CACHE id1, MAX(id2)\nFROM tb1\nGROUP BY id1\nHAVING id1 > 10\nORDER BY id3 DESC",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_10() throws Exception {
|
||||
String sql = "SELect SQL_BUFFER_RESULT tb1.id1,id2 from tb1";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -178,7 +184,7 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_BUFFER_RESULT tb1.id1, id2\nFROM tb1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_11() throws Exception {
|
||||
String sql = "SELect SQL_no_cache tb1.id1,id2 from tb1";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -187,7 +193,7 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_NO_CACHE tb1.id1, id2\nFROM tb1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_12() throws Exception {
|
||||
String sql = "SELect SQL_CALC_FOUND_ROWS tb1.id1,id2 from tb1";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -196,7 +202,7 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT SQL_CALC_FOUND_ROWS tb1.id1, id2\nFROM tb1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_13() throws Exception {
|
||||
String sql = "SELect 1+1 ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -205,7 +211,7 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT 1 + 1", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_14() throws Exception {
|
||||
String sql = "SELect t1.* from tb ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -214,10 +220,10 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT t1.*\nFROM tb", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_15() throws Exception {
|
||||
String sql = "SELect distinct high_priority straight_join sql_big_result sql_cache tb1.id,tb2.id "
|
||||
+ "from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
+ "from tb1,tb2 where tb1.id2=tb2.id2";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
@@ -225,7 +231,7 @@ public class DMLSelectParserTest extends TestCase {
|
||||
Assert.assertEquals("SELECT DISTINCT HIGH_PRIORITY STRAIGHT_JOIN SQL_BIG_RESULT"
|
||||
+ " SQL_CACHE tb1.id, tb2.id\nFROM tb1, tb2\nWHERE tb1.id2 = tb2.id2", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_16() throws Exception {
|
||||
String sql = "SELect distinct id1,id2 from tb1,tb2 where tb1.id1=tb2.id2 for update";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
@@ -234,50 +240,52 @@ public class DMLSelectParserTest extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCT id1, id2\nFROM tb1, tb2\nWHERE tb1.id1 = tb2.id2\nFOR UPDATE", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_17() throws Exception {
|
||||
String sql = "SELect distinct id1,id2 from tb1,tb2 where tb1.id1=tb2.id2 lock in share mode";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT DISTINCT id1, id2\nFROM tb1, tb2\nWHERE tb1.id1 = tb2.id2\nLOCK IN SHARE MODE", output);
|
||||
Assert.assertEquals("SELECT DISTINCT id1, id2\nFROM tb1, tb2\nWHERE tb1.id1 = tb2.id2\nLOCK IN SHARE MODE",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_18() throws Exception {
|
||||
String sql = "SELect t1.id , t2.* from t1, test.t2 where test.t1.id='中''‘文' and t1.id=test.t2.id";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT t1.id, t2.*\nFROM t1, test.t2\nWHERE test.t1.id = '中''‘文'\n\tAND t1.id = test.t2.id", output);
|
||||
Assert.assertEquals("SELECT t1.id, t2.*\nFROM t1, test.t2\nWHERE test.t1.id = '中''‘文'\n\tAND t1.id = test.t2.id",
|
||||
output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_19() throws Exception {
|
||||
String sql = "select * from offer a straight_join wp_image b force index for join(t1,t2) on a.member_id=b.member_id inner join product_visit c where a.member_id=c.member_id and c.member_id='abc' ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT *\n"
|
||||
+ //
|
||||
"FROM offer a STRAIGHT_JOIN wp_image b FORCE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id INNER JOIN product_visit c\n"
|
||||
+ //
|
||||
"WHERE a.member_id = c.member_id\n" + //
|
||||
"\tAND c.member_id = 'abc'", output);
|
||||
Assert.assertEquals("SELECT *" + //
|
||||
"\nFROM offer a" + //
|
||||
"\n\tSTRAIGHT_JOIN wp_image b FORCE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id" + //
|
||||
"\n\tINNER JOIN product_visit c" + //
|
||||
"\nWHERE a.member_id = c.member_id" + //
|
||||
"\n\tAND c.member_id = 'abc'", output);
|
||||
}
|
||||
|
||||
|
||||
public void test_select_20() throws Exception {
|
||||
String sql = "select * from offer a straight_join wp_image b ignore index for join(t1,t2) on a.member_id=b.member_id inner join product_visit c where a.member_id=c.member_id and c.member_id='abc' ";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("SELECT *\n"
|
||||
+ //
|
||||
"FROM offer a STRAIGHT_JOIN wp_image b IGNORE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id INNER JOIN product_visit c\n"
|
||||
+ //
|
||||
"WHERE a.member_id = c.member_id\n" + //
|
||||
"\tAND c.member_id = 'abc'", output);
|
||||
Assert.assertEquals("SELECT *\n" + //
|
||||
"FROM offer a" + //
|
||||
"\n\tSTRAIGHT_JOIN wp_image b IGNORE INDEX FOR JOIN (t1, t2) ON a.member_id = b.member_id" + //
|
||||
"\n\tINNER JOIN product_visit c" + //
|
||||
"\nWHERE a.member_id = c.member_id" + //
|
||||
"\n\tAND c.member_id = 'abc'", output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,10 @@ public class DeleteSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("DELETE t1\nFROM t1 LEFT JOIN t2 ON t1.id = t2.id\nWHERE t2.id IS NULL;", text);
|
||||
Assert.assertEquals("DELETE t1" + //
|
||||
"\nFROM t1" + //
|
||||
"\n\tLEFT JOIN t2 ON t1.id = t2.id" + //
|
||||
"\nWHERE t2.id IS NULL;", text);
|
||||
}
|
||||
|
||||
public void test_2() throws Exception {
|
||||
@@ -57,7 +60,9 @@ public class DeleteSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("DELETE a1, a2\nFROM t1 a1 INNER JOIN t2 a2\nWHERE a1.id = a2.id;", text);
|
||||
Assert.assertEquals("DELETE a1, a2\nFROM t1 a1" + //
|
||||
"\n\tINNER JOIN t2 a2" + //
|
||||
"\nWHERE a1.id = a2.id;", text);
|
||||
}
|
||||
|
||||
public void test_3() throws Exception {
|
||||
@@ -68,7 +73,8 @@ public class DeleteSyntaxTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("DELETE FROM a1, a2\nUSING t1 a1 INNER JOIN t2 a2\nWHERE a1.id = a2.id;", text);
|
||||
Assert.assertEquals("DELETE FROM a1, a2\nUSING t1 a1" + //
|
||||
"\n\tINNER JOIN t2 a2\nWHERE a1.id = a2.id;", text);
|
||||
}
|
||||
|
||||
public void test_4() throws Exception {
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.alibaba.druid.util.JdbcUtils;
|
||||
public class MySqlParserResourceTest extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
exec_test("bvt/parser/mysql-0.txt");
|
||||
// exec_test("bvt/parser/mysql-0.txt");
|
||||
exec_test("bvt/parser/mysql-1.txt");
|
||||
exec_test("bvt/parser/mysql-2.txt");
|
||||
exec_test("bvt/parser/mysql-3.txt");
|
||||
|
||||
@@ -37,7 +37,9 @@ public class SQLServerRowNumberTest extends TestCase {
|
||||
" AND SalesYTD <> 0;";
|
||||
|
||||
String expect = "SELECT c.FirstName, c.LastName, ROW_NUMBER() OVER () ORDER BY SalesYTD DESC AS 'Row Number', s.SalesYTD, a.PostalCode" //
|
||||
+ "\nFROM Sales.SalesPerson s INNER JOIN Person.Contact c ON s.SalesPersonID = c.ContactID INNER JOIN Person.Address a ON a.AddressID = c.ContactID" //
|
||||
+ "\nFROM Sales.SalesPerson s"
|
||||
+ "\n\tINNER JOIN Person.Contact c ON s.SalesPersonID = c.ContactID"
|
||||
+ "\n\tINNER JOIN Person.Address a ON a.AddressID = c.ContactID" //
|
||||
+ "\nWHERE TerritoryID IS NOT NULL" //
|
||||
+ "\n\tAND SalesYTD <> 0";
|
||||
|
||||
|
||||
@@ -7,7 +7,11 @@ WHERE b.user_id = ? and ((b.is_grid='y' and c.param_name='is_hidden' and
|
||||
ORDER BY a.col ASC, a.position ASC
|
||||
---------------------------
|
||||
SELECT DISTINCT a.id AS "id", a.col AS "col", a.position AS "position", a.panel_id AS "panelId"
|
||||
FROM view_position_info a LEFT JOIN view_portal b ON a.panel_id = b.panel_id LEFT JOIN view_portal_panel c ON a.panel_id = c.panel_id
|
||||
FROM view_position_info a
|
||||
LEFT JOIN view_portal b
|
||||
ON a.panel_id = b.panel_id
|
||||
LEFT JOIN view_portal_panel c
|
||||
ON a.panel_id = c.panel_id
|
||||
WHERE b.user_id = ?
|
||||
AND (b.is_grid = 'y'
|
||||
AND c.param_name = 'is_hidden'
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
where s.gmt_modify > ? and l.site_name = "开发测试"
|
||||
---------------------------
|
||||
SELECT s.*, d.*
|
||||
FROM server s LEFT JOIN device_base d ON s.device_base_id = d.id LEFT JOIN logic_site l ON l.id = d.logic_site_id
|
||||
FROM server s
|
||||
LEFT JOIN device_base d ON s.device_base_id = d.id
|
||||
LEFT JOIN logic_site l ON l.id = d.logic_site_id
|
||||
WHERE s.gmt_modify > ?
|
||||
AND l.site_name = '开发测试'
|
||||
@@ -8,12 +8,12 @@ WHERE a.examine_id = b.examine_id
|
||||
---------------------------
|
||||
SELECT a.examine_id AS examineId, a.examine_name AS examineName, a.level_limit AS levelLimit
|
||||
FROM c_examinepaper a, (SELECT examine_id
|
||||
FROM c_examinepaper
|
||||
WHERE level_limit = ?
|
||||
AND status = 1
|
||||
MINUS
|
||||
SELECT DISTINCT examine_id
|
||||
FROM course
|
||||
) b
|
||||
FROM c_examinepaper
|
||||
WHERE level_limit = ?
|
||||
AND status = 1
|
||||
MINUS
|
||||
SELECT DISTINCT examine_id
|
||||
FROM course
|
||||
) b
|
||||
WHERE a.examine_id = b.examine_id
|
||||
|
||||
|
||||
@@ -3,9 +3,12 @@ OR a.id = ? OR a.id = ? OR a.id = ? OR a.id = ? OR a.id = ? OR a.id = ? OR a.id
|
||||
---------------------------
|
||||
SELECT a.id AS "appId", a.name AS "appName", b.number AS "instanceNumber", b.hostname AS "hostname", c.name AS "monitorItemName"
|
||||
, d.id AS "alarmRuleStatusId", d.name AS "alarmRuleName", d.current_status AS "alarmRuleStatus", d.last_change_time AS "lastChangeTimeOfAlarmRule"
|
||||
FROM mi_alarm_rule_status d LEFT JOIN monitor_item_status c ON d.mi_status_id = c.id LEFT JOIN instance b ON b.number = c.inst_num
|
||||
AND b.app_num = c.app_num
|
||||
AND b.hostname = c.hostname LEFT JOIN app a ON a.number = b.app_num
|
||||
FROM mi_alarm_rule_status d
|
||||
LEFT JOIN monitor_item_status c ON d.mi_status_id = c.id
|
||||
LEFT JOIN instance b ON b.number = c.inst_num
|
||||
AND b.app_num = c.app_num
|
||||
AND b.hostname = c.hostname
|
||||
LEFT JOIN app a ON a.number = b.app_num
|
||||
WHERE 1 = 0
|
||||
OR a.id = ?
|
||||
OR a.id = ?
|
||||
@@ -98,9 +101,12 @@ LIMIT ?, ?
|
||||
---------------------------
|
||||
SELECT a.id AS "appId", a.name AS "appName", b.number AS "instanceNumber", b.hostname AS "hostname", c.name AS "monitorItemName"
|
||||
, d.id AS "alarmRuleStatusId", d.name AS "alarmRuleName", d.current_status AS "alarmRuleStatus", d.last_change_time AS "lastChangeTimeOfAlarmRule"
|
||||
FROM mi_alarm_rule_status d LEFT JOIN monitor_item_status c ON d.mi_status_id = c.id LEFT JOIN instance b ON b.number = c.inst_num
|
||||
AND b.app_num = c.app_num
|
||||
AND b.hostname = c.hostname LEFT JOIN app a ON a.number = b.app_num
|
||||
FROM mi_alarm_rule_status d
|
||||
LEFT JOIN monitor_item_status c ON d.mi_status_id = c.id
|
||||
LEFT JOIN instance b ON b.number = c.inst_num
|
||||
AND b.app_num = c.app_num
|
||||
AND b.hostname = c.hostname
|
||||
LEFT JOIN app a ON a.number = b.app_num
|
||||
WHERE 1 = 0
|
||||
OR a.id = ?
|
||||
ORDER BY lastChangeTimeOfAlarmRule DESC
|
||||
|
||||
Reference in New Issue
Block a user