execute_debugger_query(trans_id, query_type) This method is responsible to execute the query and return value. As this method is generic so user has to pass the query_type to get the required information for debugging. e.g. If user want to execute 'step_into' then query_type='
(trans_id, query_type)
| 1208 | ) |
| 1209 | @pga_login_required |
| 1210 | def execute_debugger_query(trans_id, query_type): |
| 1211 | """ |
| 1212 | execute_debugger_query(trans_id, query_type) |
| 1213 | |
| 1214 | This method is responsible to execute the query and return value. As this |
| 1215 | method is generic so user has to pass the query_type to get the required |
| 1216 | information for debugging. |
| 1217 | |
| 1218 | e.g. If user want to execute 'step_into' then query_type='step_into'. |
| 1219 | If user want to execute 'continue' then query_type='continue' |
| 1220 | |
| 1221 | Parameters: |
| 1222 | trans_id |
| 1223 | - Transaction ID |
| 1224 | query_type |
| 1225 | - Type of query to execute |
| 1226 | """ |
| 1227 | |
| 1228 | de_inst = DebuggerInstance(trans_id) |
| 1229 | if de_inst.debugger_data is None: |
| 1230 | return make_json_response( |
| 1231 | data={ |
| 1232 | 'status': False, |
| 1233 | 'result': SERVER_CONNECTION_CLOSED |
| 1234 | } |
| 1235 | ) |
| 1236 | |
| 1237 | manager = get_driver(PG_DEFAULT_DRIVER).connection_manager( |
| 1238 | de_inst.debugger_data['server_id']) |
| 1239 | conn = manager.connection( |
| 1240 | did=de_inst.debugger_data['database_id'], |
| 1241 | conn_id=de_inst.debugger_data['exe_conn_id']) |
| 1242 | |
| 1243 | # find the debugger version and execute the query accordingly |
| 1244 | template_path = DEBUGGER_SQL_V1_PATH \ |
| 1245 | if de_inst.debugger_data['debugger_version'] <= 2 \ |
| 1246 | else DEBUGGER_SQL_V3_PATH |
| 1247 | |
| 1248 | if not conn.connected(): |
| 1249 | result = SERVER_CONNECTION_CLOSED |
| 1250 | return internal_server_error(errormsg=result) |
| 1251 | |
| 1252 | sql = render_template( |
| 1253 | "/".join([template_path, query_type + ".sql"]), |
| 1254 | session_id=de_inst.debugger_data['session_id'] |
| 1255 | ) |
| 1256 | # As the query type is continue or step_into or step_over then we |
| 1257 | # may get result after some time so poll the result. |
| 1258 | # We need to update the frame id variable when user move the next |
| 1259 | # step for debugging. |
| 1260 | if query_type in ('continue', 'step_into', 'step_over'): |
| 1261 | # We should set the frame_id to 0 when execution starts. |
| 1262 | de_inst.debugger_data['frame_id'] = 0 |
| 1263 | de_inst.update_session() |
| 1264 | |
| 1265 | status, result = execute_async_search_path( |
| 1266 | conn, sql, de_inst.debugger_data['search_path']) |
| 1267 |
nothing calls this directly
no test coverage detected