pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause
2+ messages / 2 participants
[nested] [flat]

* BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause
@ 2012-01-26 12:46  emre.hasegeli@tart.com.tr
  0 siblings, 1 reply; 2+ messages in thread

From: emre.hasegeli@tart.com.tr @ 2012-01-26 12:46 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6411
Logged by:          Using a Foreign Table in a Dependent Subquery
Email address:      emre.hasegeli@tart.com.tr
PostgreSQL version: 9.1.2
Operating system:   Linux 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 2
Description:        

I installed Dave Page's MySQL Foreign Data Wrapper on GitHub [1]. It works
fine until foreign table is used in a dependent subquery on select clause.

How to reproduce:

Create extension mysql_fdw;

Create server AMySQLServer
    foreign data wrapper mysql_fdw 
    options (address '***', port '3306');

Create user mapping for public 
    server AMySQLServer
    options (username '***', password '***');

Create foreign table AForeignTable (id integer) server AMySQLServer options
(query 'Select id from ASchema.ATable');

Select id, (select true from AForeignTable where AForeignTable.id =
ATable.id) from ATable;

WARNING:  57P02: terminating connection because of crash of another server
process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because another server process exited
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.

[1] https://github.com/dpage/mysql_fdw





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause
@ 2012-01-26 21:14  Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  parent: emre.hasegeli@tart.com.tr
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2012-01-26 21:14 UTC (permalink / raw)
  To: emre.hasegeli@tart.com.tr; +Cc: pgsql-bugs; Dave Page <dpage@pgadmin.org>

On 26.01.2012 14:46, emre.hasegeli@tart.com.tr wrote:
> The following bug has been logged on the website:
>
> Bug reference:      6411
> Logged by:          Using a Foreign Table in a Dependent Subquery
> Email address:      emre.hasegeli@tart.com.tr
> PostgreSQL version: 9.1.2
> Operating system:   Linux 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 2
> Description:
>
> I installed Dave Page's MySQL Foreign Data Wrapper on GitHub [1]. It works
> fine until foreign table is used in a dependent subquery on select clause.

This mailing list is really for bugs in PostgreSQL itself, but I'll give 
this a shot...

> How to reproduce:
>
> Create extension mysql_fdw;
>
> Create server AMySQLServer
>      foreign data wrapper mysql_fdw
>      options (address '***', port '3306');
>
> Create user mapping for public
>      server AMySQLServer
>      options (username '***', password '***');
>
> Create foreign table AForeignTable (id integer) server AMySQLServer options
> (query 'Select id from ASchema.ATable');
>
> Select id, (select true from AForeignTable where AForeignTable.id =
> ATable.id) from ATable;
>
> WARNING:  57P02: terminating connection because of crash of another server
> process
> DETAIL:  The postmaster has commanded this server process to roll back the
> current transaction and exit, because another server process exited
> abnormally and possibly corrupted shared memory.
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.
>
> [1] https://github.com/dpage/mysql_fdw

I'm guessing that there's mysql_fdw's rescan function isn't working 
correctly. Looking at the source, it seems to be calling 
"mysql_row_seek(festate->result, 0);". But according to MySQL's docs 
[1], that 2nd argument should be an opaque value returned by 
mysql_row_tell() or mysql_row_seek(), not a row number. I think 
mysql_data_seek should be used there instead of mysql_row_seek().

That said, I have no idea if that's causing the crash.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-01-26 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-01-26 12:46 BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause emre.hasegeli@tart.com.tr
2012-01-26 21:14 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox