========== Limit Handling Functions ========== addResultLimit adds a limit clause to the statement based on Oracle version
(stmt string, limit int, engineVersion string)
| 158 | |
| 159 | // addResultLimit adds a limit clause to the statement based on Oracle version |
| 160 | func addResultLimit(stmt string, limit int, engineVersion string) string { |
| 161 | // Check if we should skip adding limit (e.g., for simple DUAL queries) |
| 162 | if shouldSkipLimit(stmt) { |
| 163 | return stmt |
| 164 | } |
| 165 | |
| 166 | // Determine Oracle version |
| 167 | if isOracle11gOrEarlier(engineVersion) { |
| 168 | return addLimitFor11g(stmt, limit) |
| 169 | } |
| 170 | return addLimitFor12cAndLater(stmt, limit) |
| 171 | } |
| 172 | |
| 173 | // shouldSkipLimit checks if the statement needs a limit clause |
| 174 | func shouldSkipLimit(stmt string) bool { |