MCPcopy Create free account
hub / github.com/bytebase/bytebase / addResultLimit

Function addResultLimit

backend/plugin/db/oracle/query.go:160–171  ·  view source on GitHub ↗

========== Limit Handling Functions ========== addResultLimit adds a limit clause to the statement based on Oracle version

(stmt string, limit int, engineVersion string)

Source from the content-addressed store, hash-verified

158
159// addResultLimit adds a limit clause to the statement based on Oracle version
160func 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
174func shouldSkipLimit(stmt string) bool {

Calls 4

shouldSkipLimitFunction · 0.85
isOracle11gOrEarlierFunction · 0.85
addLimitFor11gFunction · 0.85
addLimitFor12cAndLaterFunction · 0.85