| 1897 | |
| 1898 | |
| 1899 | static bool_t xdr_sql_blr(RemoteXdr* xdrs, |
| 1900 | SLONG statement_id, |
| 1901 | CSTRING* blr, |
| 1902 | bool direction, SQL_STMT_TYPE stmt_type) |
| 1903 | { |
| 1904 | /************************************** |
| 1905 | * |
| 1906 | * x d r _ s q l _ b l r |
| 1907 | * |
| 1908 | ************************************** |
| 1909 | * |
| 1910 | * Functional description |
| 1911 | * Map an sql blr string. This work is necessary because |
| 1912 | * we will use the blr to read data in the current packet. |
| 1913 | * |
| 1914 | **************************************/ |
| 1915 | if (!xdr_cstring(xdrs, blr)) |
| 1916 | return FALSE; |
| 1917 | |
| 1918 | // We care about all receives and sends from fetch |
| 1919 | |
| 1920 | if (xdrs->x_op == XDR_FREE) |
| 1921 | return TRUE; |
| 1922 | |
| 1923 | rem_port* port = xdrs->x_public; |
| 1924 | |
| 1925 | Rsr* statement; |
| 1926 | |
| 1927 | if (statement_id >= 0) |
| 1928 | { |
| 1929 | if (static_cast<ULONG>(statement_id) >= port->port_objects.getCount()) |
| 1930 | return FALSE; |
| 1931 | |
| 1932 | try |
| 1933 | { |
| 1934 | statement = port->port_objects[statement_id]; |
| 1935 | } |
| 1936 | catch (const status_exception&) |
| 1937 | { |
| 1938 | return FALSE; |
| 1939 | } |
| 1940 | } |
| 1941 | else |
| 1942 | { |
| 1943 | if (!(statement = port->port_statement)) |
| 1944 | statement = port->port_statement = FB_NEW Rsr; |
| 1945 | } |
| 1946 | |
| 1947 | if ((xdrs->x_op == XDR_ENCODE) && !direction) |
| 1948 | { |
| 1949 | if (statement->rsr_bind_format) |
| 1950 | statement->rsr_format = statement->rsr_bind_format; |
| 1951 | return TRUE; |
| 1952 | } |
| 1953 | |
| 1954 | // Parse the blr describing the message. |
| 1955 | |
| 1956 | rem_fmt** fmt_ptr = direction ? &statement->rsr_select_format : &statement->rsr_bind_format; |
no test coverage detected