Пример #1
0
static enum proto_parse_status tns_parse_sql_query(struct sql_proto_info *info, struct cursor *cursor)
{
    DROP_FIX(cursor, 1);

    if (is_oci(cursor)) {
        // Option is not prefix based, seems like an oci query
        return tns_parse_sql_query_oci(info, cursor);
    } else {
        return tns_parse_sql_query_jdbc(info, cursor);
    }
}
Пример #2
0
static enum proto_parse_status tns_parse_sql_query(struct sql_proto_info *info, struct cursor *cursor)
{
    DROP_FIX(cursor, 1);
    if (is_oci(cursor)) {
        // Option is not prefix based, seems like an oci query
        return tns_parse_sql_query_oci(info, cursor);
    } else {
        struct cursor save_cursor = *cursor;
        if (tns_parse_sql_query_jdbc(info, cursor) != PROTO_OK) {
            // Fallback to query guessing
            SLOG(LOG_DEBUG, "jdbc query failed, fallback to oci");
            *cursor = save_cursor;
            return tns_parse_sql_query_oci(info, cursor);
        } else {
            return PROTO_OK;
        }
    }
}