(boolean parseResultQuery, boolean parseSelect)
| 1178 | } |
| 1179 | |
| 1180 | private final Query parseQuery(boolean parseResultQuery, boolean parseSelect) { |
| 1181 | if (done()) |
| 1182 | return null; |
| 1183 | |
| 1184 | scope.scopeStart(); |
| 1185 | boolean previousMetaLookupsForceIgnore = metaLookupsForceIgnore(); |
| 1186 | Query result = null; |
| 1187 | LanguageContext previous = languageContext; |
| 1188 | |
| 1189 | try { |
| 1190 | languageContext = LanguageContext.QUERY; |
| 1191 | |
| 1192 | switch (characterUpper()) { |
| 1193 | case 'A': |
| 1194 | if (!parseResultQuery && peekKeyword("ALTER")) |
| 1195 | return result = metaLookupsForceIgnore(true).parseAlter(); |
| 1196 | else if (!parseResultQuery && peekKeyword("ANALYZE")) |
| 1197 | throw notImplemented("ANALYZE statement"); |
| 1198 | |
| 1199 | break; |
| 1200 | |
| 1201 | case 'B': |
| 1202 | if (!parseResultQuery && peekKeyword("BEGIN WORK", "BEGIN TRANSACTION", "BEGIN TRAN")) |
| 1203 | return result = parseStartTransaction(); |
| 1204 | else if (!parseResultQuery && parseKeywordIf("BT")) |
| 1205 | return dsl.startTransaction(); |
| 1206 | else if (!parseResultQuery && peekKeyword("BEGIN")) { |
| 1207 | languageContext = previous; |
| 1208 | return result = parseBlock(false); |
| 1209 | } |
| 1210 | |
| 1211 | break; |
| 1212 | |
| 1213 | case 'C': |
| 1214 | if (!parseResultQuery && peekKeyword("CREATE")) |
| 1215 | return result = metaLookupsForceIgnore(true).parseCreate(); |
| 1216 | else if (!parseResultQuery && peekKeyword("COMMENT ON")) |
| 1217 | return result = metaLookupsForceIgnore(true).parseCommentOn(); |
| 1218 | else if (!parseResultQuery && parseKeywordIf("CT")) |
| 1219 | return result = metaLookupsForceIgnore(true).parseCreateTable(null); |
| 1220 | else if (!parseResultQuery && parseKeywordIf("CV")) |
| 1221 | return result = metaLookupsForceIgnore(true).parseCreateView(false, false); |
| 1222 | else if (!ignoreProEdition() && peekKeyword("CALL") && requireProEdition()) |
| 1223 | |
| 1224 | |
| 1225 | |
| 1226 | ; |
| 1227 | else if (!parseResultQuery && peekKeyword("COMMIT")) |
| 1228 | return result = parseCommit(); |
| 1229 | else if (parseKeywordIf("CONNECT")) |
| 1230 | throw notImplemented("CONNECT"); |
| 1231 | |
| 1232 | break; |
| 1233 | |
| 1234 | case 'D': |
| 1235 | if (!parseResultQuery && parseKeywordIf("DECLARE GLOBAL TEMPORARY TABLE")) |
| 1236 | return result = parseCreateTable(TableScope.LOCAL_TEMPORARY); |
| 1237 | else if (!parseResultQuery && !ignoreProEdition() && peekKeyword("DECLARE") && requireProEdition()) |
no test coverage detected