Bug in sql_fmgr when envoked via copy

From: Darcy Buskermolen <darcyb(at)commandprompt(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Bug in sql_fmgr when envoked via copy
Date: 2006-08-04 17:35:41
Message-ID: 200608041035.41523.darcyb@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A fresh cvs update of -HEAD produces the following when I attempt to import a
dump that has a domain using a SQL function as part of the check constraint.
This error only shows while using COPY for more than 1 row. Inserts work
fine. Find attached a simple self contained test case.

gdb ../bin/postgres postgres.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `postgres'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libm.so.4...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x0814cb65 in fmgr_sql (fcinfo=0xbfbfc6a0) at functions.c:621
621 if (es && es->status == F_EXEC_START)
(gdb) bt
#0 0x0814cb65 in fmgr_sql (fcinfo=0xbfbfc6a0) at functions.c:621
#1 0x08146615 in ExecMakeFunctionResultNoSets (fcache=0x85c0880,
econtext=0x858c0a8, isNull=0xbfbfca81 "", isDone=0x0) at execQual.c:1213
#2 0x081465b0 in ExecMakeFunctionResultNoSets (fcache=0x85c0428,
econtext=0x858c0a8, isNull=0xbfbfccc0 "", isDone=0x85c0c8c) at
execQual.c:1188
#3 0x081465b0 in ExecMakeFunctionResultNoSets (fcache=0x85c001c,
econtext=0x858c0a8, isNull=0xbfbfcf00 "", isDone=0x85c0ca0) at
execQual.c:1188
#4 0x081465b0 in ExecMakeFunctionResultNoSets (fcache=0x8588b70,
econtext=0x858c0a8, isNull=0xbfbfd140 "", isDone=0x85c0cd0) at
execQual.c:1188
#5 0x081465b0 in ExecMakeFunctionResultNoSets (fcache=0x8588764,
econtext=0x858c0a8, isNull=0xbfbfd21b "\b\034
\\\b$$D\bpÒ¿¿XÒ¿¿<Ô\035\b$$D\b\034 D\b½\002",
isDone=0x85c116c) at execQual.c:1188
#6 0x08148da0 in ExecEvalExprSwitchContext (expression=0xbfbfc6a0,
econtext=0x858a2a4,
isNull=0xbfbfd21b "\b\034 \\\b$$D\bpÒ¿¿XÒ¿¿<Ô\035\b$$D\b\034 D\b½\002",
isDone=0x0) at execQual.c:3085
#7 0x081dd334 in domain_check_input (value=140255260, isnull=0 '\0',
my_extra=0x8442424) at domains.c:150
#8 0x081dd43c in domain_in (fcinfo=0xbfbfd270) at domains.c:230
#9 0x08236cf1 in InputFunctionCall (flinfo=0x858a2a4, str=0x844201c "2",
typioparam=140249232, typmod=140249232) at fmgr.c:1715
#10 0x08110803 in DoCopy (stmt=0x844201c) at copy.c:1821
#11 0x081c6ea3 in ProcessUtility (parsetree=0x854a334, params=0x0,
dest=0x854a390, completionTag=0xbfbfd840 "") at utility.c:634
#12 0x081c5b0f in PortalRunUtility (portal=0x854e01c, query=0x854a3dc,
dest=0x854a390, completionTag=0xbfbfd840 "") at pquery.c:992
#13 0x081c60c9 in PortalRun (portal=0x854e01c, count=2147483647,
dest=0x854a390, altdest=0x854a390, completionTag=0xbfbfd840 "") at
pquery.c:1059
#14 0x081c20a8 in exec_simple_query (query_string=0x854a01c "copy sql_table
from stdin;") at postgres.c:1004
#15 0x081c4116 in PostgresMain (argc=4, argv=0x840b680, username=0x840b650
"pgsql") at postgres.c:3182
#16 0x0819d898 in ServerLoop () at postmaster.c:2845
#17 0x0819ed59 in PostmasterMain (argc=1, argv=0xbfbfed5c) at postmaster.c:949
#18 0x08162092 in main (argc=1, argv=0xbfbfed5c) at main.c:187

--
Darcy Buskermolen
CommandPrompt, Inc.
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
http://www.commandprompt.com

Attachment Content-Type Size
sql_fmgr.dmp text/plain 402 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-08-04 17:36:34 Re: 8.2 features status
Previous Message Joshua D. Drake 2006-08-04 17:35:08 Re: 8.2 features status