Project

General

Profile

« Previous | Next » 

Revision 2639

schemas/functions.sql: _nullIf: Fixed bug where NOT NULL parameters were not supported, because an input NULL value would not match an existing DEFAULT value in a select query, by temporarily disabling _nullIf until this can be supported. Removed previous workarounds.

View differences:

schemas/functions.sql
223 223
SET default_with_oids = false;
224 224

  
225 225
--
226
-- Name: !disabled!_nullIf; Type: TABLE; Schema: functions; Owner: -; Tablespace: 
227
--
228

  
229
CREATE TABLE "!disabled!_nullIf" (
230
    result text,
231
    not_null_col boolean DEFAULT true NOT NULL,
232
    "null" text,
233
    type datatype DEFAULT 'str'::datatype NOT NULL,
234
    value text
235
);
236

  
237

  
238
--
226 239
-- Name: _alt; Type: TABLE; Schema: functions; Owner: -; Tablespace: 
227 240
--
228 241

  
......
275 288

  
276 289

  
277 290
--
278
-- Name: _nullIf; Type: TABLE; Schema: functions; Owner: -; Tablespace: 
279
--
280

  
281
CREATE TABLE "_nullIf" (
282
    result text,
283
    not_null_col boolean DEFAULT true NOT NULL,
284
    "null" text,
285
    type datatype DEFAULT 'str'::datatype NOT NULL,
286
    value text
287
);
288

  
289

  
290
--
291 291
-- Name: _alt_0; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
292 292
--
293 293

  
......
466 466
-- Name: _nullIf_null; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
467 467
--
468 468

  
469
CREATE INDEX "_nullIf_null" ON "_nullIf" USING btree ("null");
469
CREATE INDEX "_nullIf_null" ON "!disabled!_nullIf" USING btree ("null");
470 470

  
471 471

  
472 472
--
473 473
-- Name: _nullIf_type; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
474 474
--
475 475

  
476
CREATE INDEX "_nullIf_type" ON "_nullIf" USING btree (type);
476
CREATE INDEX "_nullIf_type" ON "!disabled!_nullIf" USING btree (type);
477 477

  
478 478

  
479 479
--
480 480
-- Name: _nullIf_unique; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
481 481
--
482 482

  
483
CREATE UNIQUE INDEX "_nullIf_unique" ON "_nullIf" USING btree (ensure_not_null("null"), type, ensure_not_null(value));
483
CREATE UNIQUE INDEX "_nullIf_unique" ON "!disabled!_nullIf" USING btree (ensure_not_null("null"), type, ensure_not_null(value));
484 484

  
485 485

  
486 486
--
487 487
-- Name: _nullIf_value; Type: INDEX; Schema: functions; Owner: -; Tablespace: 
488 488
--
489 489

  
490
CREATE INDEX "_nullIf_value" ON "_nullIf" USING btree (value);
490
CREATE INDEX "_nullIf_value" ON "!disabled!_nullIf" USING btree (value);
491 491

  
492 492

  
493 493
--
......
515 515
-- Name: _nullIf; Type: TRIGGER; Schema: functions; Owner: -
516 516
--
517 517

  
518
CREATE TRIGGER "_nullIf" BEFORE INSERT OR UPDATE ON "_nullIf" FOR EACH ROW EXECUTE PROCEDURE "_nullIf"();
518
CREATE TRIGGER "_nullIf" BEFORE INSERT OR UPDATE ON "!disabled!_nullIf" FOR EACH ROW EXECUTE PROCEDURE "_nullIf"();
519 519

  
520 520

  
521 521
--
lib/sql.py
867 867
            row_ct_ref[0] += cur.rowcount
868 868
        return value(cur)
869 869
    except DuplicateKeyException, e:
870
        return value_or_none(select(db, table, [pkey_],
870
        return value(select(db, table, [pkey_],
871 871
            util.dict_subset_right_join(row, e.cols), recover=True))
872 872

  
873 873
def get(db, table, row, pkey, row_ct_ref=None, create=False):
bin/map
405 405
                pool.share_vars(locals())
406 406
                
407 407
                row_root = root.cloneNode(True) # deep copy so don't modify root
408
                xml_func.process(row_root, on_error)
408
                xml_func.process(row_root, on_error, rel_funcs, out_db)
409 409
                if not xml_dom.is_empty(row_root):
410 410
                    assert xml_dom.has_one_child(row_root)
411 411
                    try:

Also available in: Unified diff