Skip to content

Commit ec581e3

Browse files
Merge pull request #10156 from dreamsxin/10143
Support for SELECT ALL/SELECT DISTINCT
2 parents 7011230 + d5fa068 commit ec581e3

File tree

12 files changed

+4347
-4883
lines changed

12 files changed

+4347
-4883
lines changed

ext/phalcon/mvc/model/query/base.c

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const phql_token_names phql_tokens[] =
8585
{ SL("CAST"), PHQL_T_CAST },
8686
{ SL("CONVERT"), PHQL_T_CONVERT },
8787
{ SL("USING"), PHQL_T_USING },
88+
{ SL("ALL"), PHQL_T_ALL },
8889
{ NULL, 0, 0 }
8990
};
9091

@@ -458,6 +459,9 @@ int phql_internal_parse_phql(zval **result, char *phql, unsigned int phql_length
458459
case PHQL_T_DISTINCT:
459460
phql_(phql_parser, PHQL_DISTINCT, NULL, parser_status);
460461
break;
462+
case PHQL_T_ALL:
463+
phql_(phql_parser, PHQL_ALL, NULL, parser_status);
464+
break;
461465
case PHQL_T_CAST:
462466
phql_(phql_parser, PHQL_CAST, NULL, parser_status);
463467
break;

ext/phalcon/mvc/model/query/parser.c

+1,017-1,248
Large diffs are not rendered by default.

ext/phalcon/mvc/model/query/parser.h

+44-43
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,50 @@
2020
#define PHQL_MINUS 20
2121
#define PHQL_IS 21
2222
#define PHQL_IN 22
23-
#define PHQL_DISTINCT 23
24-
#define PHQL_NOT 24
25-
#define PHQL_BITWISE_NOT 25
23+
#define PHQL_NOT 23
24+
#define PHQL_BITWISE_NOT 24
25+
#define PHQL_COMMA 25
2626
#define PHQL_SELECT 26
2727
#define PHQL_FROM 27
28-
#define PHQL_COMMA 28
29-
#define PHQL_IDENTIFIER 29
30-
#define PHQL_DOT 30
31-
#define PHQL_AS 31
32-
#define PHQL_JOIN 32
28+
#define PHQL_DISTINCT 28
29+
#define PHQL_ALL 29
30+
#define PHQL_IDENTIFIER 30
31+
#define PHQL_DOT 31
32+
#define PHQL_AS 32
3333
#define PHQL_INNER 33
34-
#define PHQL_CROSS 34
35-
#define PHQL_LEFT 35
36-
#define PHQL_OUTER 36
37-
#define PHQL_RIGHT 37
38-
#define PHQL_FULL 38
39-
#define PHQL_ON 39
40-
#define PHQL_INSERT 40
41-
#define PHQL_INTO 41
42-
#define PHQL_VALUES 42
43-
#define PHQL_PARENTHESES_OPEN 43
44-
#define PHQL_PARENTHESES_CLOSE 44
45-
#define PHQL_UPDATE 45
46-
#define PHQL_SET 46
47-
#define PHQL_DELETE 47
48-
#define PHQL_WHERE 48
49-
#define PHQL_ORDER 49
50-
#define PHQL_BY 50
51-
#define PHQL_ASC 51
52-
#define PHQL_DESC 52
53-
#define PHQL_GROUP 53
54-
#define PHQL_HAVING 54
55-
#define PHQL_LIMIT 55
56-
#define PHQL_OFFSET 56
57-
#define PHQL_INTEGER 57
58-
#define PHQL_NPLACEHOLDER 58
59-
#define PHQL_SPLACEHOLDER 59
60-
#define PHQL_CAST 60
61-
#define PHQL_CONVERT 61
62-
#define PHQL_USING 62
63-
#define PHQL_NULL 63
64-
#define PHQL_STRING 64
65-
#define PHQL_DOUBLE 65
66-
#define PHQL_TRUE 66
67-
#define PHQL_FALSE 67
68-
#define PHQL_COLON 68
34+
#define PHQL_JOIN 34
35+
#define PHQL_CROSS 35
36+
#define PHQL_LEFT 36
37+
#define PHQL_OUTER 37
38+
#define PHQL_RIGHT 38
39+
#define PHQL_FULL 39
40+
#define PHQL_ON 40
41+
#define PHQL_INSERT 41
42+
#define PHQL_INTO 42
43+
#define PHQL_VALUES 43
44+
#define PHQL_PARENTHESES_OPEN 44
45+
#define PHQL_PARENTHESES_CLOSE 45
46+
#define PHQL_UPDATE 46
47+
#define PHQL_SET 47
48+
#define PHQL_DELETE 48
49+
#define PHQL_WHERE 49
50+
#define PHQL_ORDER 50
51+
#define PHQL_BY 51
52+
#define PHQL_ASC 52
53+
#define PHQL_DESC 53
54+
#define PHQL_GROUP 54
55+
#define PHQL_HAVING 55
56+
#define PHQL_LIMIT 56
57+
#define PHQL_OFFSET 57
58+
#define PHQL_INTEGER 58
59+
#define PHQL_NPLACEHOLDER 59
60+
#define PHQL_SPLACEHOLDER 60
61+
#define PHQL_CAST 61
62+
#define PHQL_CONVERT 62
63+
#define PHQL_USING 63
64+
#define PHQL_NULL 64
65+
#define PHQL_STRING 65
66+
#define PHQL_DOUBLE 66
67+
#define PHQL_TRUE 67
68+
#define PHQL_FALSE 68
69+
#define PHQL_COLON 69

0 commit comments

Comments
 (0)