Function returns the debugger version. :param conn: :return:
(conn, search_path)
| 686 | |
| 687 | |
| 688 | def get_debugger_version(conn, search_path): |
| 689 | """ |
| 690 | Function returns the debugger version. |
| 691 | :param conn: |
| 692 | :return: |
| 693 | """ |
| 694 | debugger_version = 0 |
| 695 | status, res = conn.execute_void(SET_SEARCH_PATH.format(search_path)) |
| 696 | |
| 697 | if not status: |
| 698 | return False, internal_server_error(errormsg=res) |
| 699 | |
| 700 | status, rid = conn.execute_scalar( |
| 701 | "SELECT COUNT(*) FROM pg_catalog.pg_proc p" |
| 702 | " LEFT JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid" |
| 703 | " WHERE n.nspname = ANY(current_schemas(false)) AND" |
| 704 | " p.proname = 'pldbg_get_proxy_info';" |
| 705 | ) |
| 706 | |
| 707 | if not status: |
| 708 | return False, internal_server_error(errormsg=rid) |
| 709 | |
| 710 | if int(rid) == 0: |
| 711 | debugger_version = 1 |
| 712 | else: |
| 713 | status, rid = conn.execute_scalar( |
| 714 | "SELECT proxyapiver FROM pldbg_get_proxy_info();") |
| 715 | |
| 716 | if status and rid in (2, 3): |
| 717 | debugger_version = rid |
| 718 | |
| 719 | return True, debugger_version |
| 720 | |
| 721 | |
| 722 | def validate_debug(conn, debug_type, is_superuser): |
no test coverage detected