]> granicus.if.org Git - postgresql/commitdiff
Fix bogus error test in get_ti_Oid().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Oct 2005 20:28:59 +0000 (20:28 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Oct 2005 20:28:59 +0000 (20:28 +0000)
contrib/tsearch2/ts_stat.c

index 2cde25df8e5b88c998d0a41cf12b19405d2f57f3..b8ecf96e6db4e23d37aac5dc948f92e3c42c9e1e 100644 (file)
@@ -412,6 +412,7 @@ ts_accum_finish(PG_FUNCTION_ARGS)
 }
 
 static Oid     tiOid = InvalidOid;
+
 static void
 get_ti_Oid(void)
 {
@@ -422,7 +423,7 @@ get_ti_Oid(void)
                /* internal error */
                elog(ERROR, "SPI_exec to get tsvector oid returns %d", ret);
 
-       if (SPI_processed < 0)
+       if (SPI_processed < 1)
                /* internal error */
                elog(ERROR, "There is no tsvector type");
        tiOid = DatumGetObjectId(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &isnull));