示例#1
0
/* MakeColumn
 */
rc_t VCursorMakeColumn ( VCursor *self, VColumn **col, const SColumn *scol )
{
    VTable *vtbl;

    if ( self -> read_only )
        return VColumnMake ( col, self -> schema, scol );

    vtbl = self -> tbl;
    return WColumnMake ( col, self -> schema, scol, vtbl -> stbl -> limit, vtbl -> mgr );
}
示例#2
0
/* AddSColumn
 */
static
rc_t
VViewCursorAddSColumn ( VViewCursor *      p_self,
                        uint32_t *         p_idx,
                        const SColumn *    p_scol,
                        const VTypedecl *  p_cast,
                        Vector *           p_cx_bind )
{
    rc_t rc = 0;
    VColumn *col;

    /* must be readable */
    if ( p_scol -> read == NULL )
    {
        return RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcWriteonly );
    }

    /* must not already be there - benign error */
    col = VCursorCacheGet ( & p_self -> dad . col, & p_scol -> cid );
    if ( col != NULL )
    {
        * p_idx = col -> ord;
        rc = RC ( rcVDB, rcCursor, rcUpdating, rcColumn, rcExists );
    }
    else
    {
        /* make object */
        rc = VColumnMake ( & col, p_self -> view -> schema, p_scol );
        if ( rc == 0 )
        {
#if 0
            /* open column if cursor open or type unknown */
            if ( self -> dad . state >= vcReady || scol -> td . type_id == 0 )
            {
                rc = RC ( rcVDB, rcCursor, rcUpdating, rcColumn, ?? );
            }
            else
            {   /* check cast of SColumn against requested type
                this is to handle the case where the column
                was created incomplete, i.e. with unknown type */
                if ( cast != NULL && | VTypedeclToTypedecl ( & scol -> td,
                        self -> schema, cast, & col -> td, NULL ) )
                {
                    rc = RC ( rcVDB, rcCursor, rcUpdating, rcColumn, ?? );
                }
            }
示例#3
0
/* MakeColumn
 */
rc_t VCursorMakeColumn ( VCursor *self, VColumn **col, const SColumn *scol )
{
    return VColumnMake ( col, self -> schema, scol );
}
示例#4
0
文件: cursor.c 项目: ncbi/ncbi-vdb
/* MakeColumn
 */
rc_t VTableReadCursorMakeColumn ( VTableCursor *self, VColumn **col, const SColumn *scol, Vector *cx_bind )
{
    return VColumnMake ( col, self -> schema, scol );
}