Take in input a query string and return its CASE statement query string. Example: Input: (SELECT super_priv FROM mysql.user WHERE user=(SUBSTRING_INDEX(CURRENT_USER(), '@', 1)) LIMIT 0, 1)='Y' Output: SELECT (CASE WHEN ((SELECT super_priv FROM mysql.user W
(self, expression)
| 1190 | return unescaper.escape(lengthExpr) |
| 1191 | |
| 1192 | def forgeCaseStatement(self, expression): |
| 1193 | """ |
| 1194 | Take in input a query string and return its CASE statement query |
| 1195 | string. |
| 1196 | |
| 1197 | Example: |
| 1198 | |
| 1199 | Input: (SELECT super_priv FROM mysql.user WHERE user=(SUBSTRING_INDEX(CURRENT_USER(), '@', 1)) LIMIT 0, 1)='Y' |
| 1200 | Output: SELECT (CASE WHEN ((SELECT super_priv FROM mysql.user WHERE user=(SUBSTRING_INDEX(CURRENT_USER(), '@', 1)) LIMIT 0, 1)='Y') THEN 1 ELSE 0 END) |
| 1201 | |
| 1202 | @param expression: expression to be processed |
| 1203 | @type num: C{str} |
| 1204 | |
| 1205 | @return: processed expression |
| 1206 | @rtype: C{str} |
| 1207 | """ |
| 1208 | |
| 1209 | caseExpression = expression |
| 1210 | |
| 1211 | if Backend.getIdentifiedDbms() is not None: |
| 1212 | caseExpression = queries[Backend.getIdentifiedDbms()].case.query % expression |
| 1213 | |
| 1214 | if "(IIF" not in caseExpression and Backend.getIdentifiedDbms() in FROM_DUMMY_TABLE and not caseExpression.upper().endswith(FROM_DUMMY_TABLE[Backend.getIdentifiedDbms()]): |
| 1215 | caseExpression += FROM_DUMMY_TABLE[Backend.getIdentifiedDbms()] |
| 1216 | |
| 1217 | return caseExpression |
| 1218 | |
| 1219 | def addPayloadDelimiters(self, value): |
| 1220 | """ |
no test coverage detected