Beispiel #1
0
        static SrcList TargetSrcList(Parse parse, TriggerStep step)
        {
            Context ctx = parse.Ctx;
            SrcList src = Parse.SrcListAppend(parse.Ctx, null, step.Target, null); // SrcList to be returned

            if (src != null)
            {
                Debug.Assert(src.Srcs > 0);
                Debug.Assert(src.Ids != null);
                int db = Prepare.SchemaToIndex(ctx, step.Trig.Schema); // Index of the database to use
                if (db == 0 || db >= 2)
                {
                    Debug.Assert(db < ctx.DBs.length);
                    src.Ids[src.Srcs - 1].Database = ctx.DBs[db].Name; //: _tagstrdup(ctx, ctx->DBs[db].Name);
                }
            }
            return(src);
        }