Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529574 - dev-db/mysql - INTO OUTFILE should support writing to named pipes
Summary: dev-db/mysql - INTO OUTFILE should support writing to named pipes
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL: http://bugs.mysql.com/bug.php?id=44835
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-11-16 20:05 UTC by Hanno Zysik (geki)
Modified: 2014-11-18 18:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
mysql select ... into fifo (mysql_select-into-fifo.diff,1.77 KB, patch)
2014-11-16 20:05 UTC, Hanno Zysik (geki)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Zysik (geki) 2014-11-16 20:05:18 UTC
Created attachment 389532 [details, diff]
mysql select ... into fifo

My patch is taken from [0]. Only applied the FIFO part to keep the patch simple.
Surely, there must be an improvement wrt security concerns.

Just good enough for my use-case where mysql runs in a safe environment.
So I guess it is not better than a RFC and a record for others that need this feature and know about the consequences.


[0] https://code.launchpad.net/~sergei.glushchenko/percona-server/5.5-BT34246-ps-blueprint-into-outfile-pipe-and-socket/+merge/181115
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-17 13:05:45 UTC
Why would Gentoo need to implement this when upstream does not?
Comment 2 Hanno Zysik (geki) 2014-11-17 19:10:57 UTC
well, my use-case is not resolved as-is. ;)

and I quite do not care about upstream. I am just a user that wants to get it done.


wrt my use-case: how can a process receive a notification about table updates? where updates may come multiple times in a second.

so, mysql offers triggers which one can install that executes commands for each row that changes. to get that information out of the scope of mysql, it has the command 'select ... into outfile' to send it into a file.

mysql only allows to write to non-existent non-timestamped files(yes, for a good reason - but only by default). i.e.: outfile = 'CONCAT('/path/to/file_', SYSDATE() + 0)' fails.

so, what to do if the trigger executes multiple times in a second? the process for whatever reason cannot react and delete the file before the next trigger executes. the whole update command fails - not just the trigger.

so, why not rip that superfluous harddisk access layer and use POSIX named pipes instead?

data is kept in memory and update commands cannot fail for such a ... reason.


well, again, this is just a recond for others that may have a need for this and I hope others find this when they search for it.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-11-17 20:51:22 UTC
geki:
No, we're not going to add a new feature like this.
If you really need it:
a) go and test out the percona ebuilds in the mysql overlay
b) convince upstream oracle mysql and/or mariadb to accept this patch.

But I think the approach you're taking to the problem, you should probably be using some publish/subscribe mechanism outside of MySQL.
Comment 4 Hanno Zysik (geki) 2014-11-18 18:25:59 UTC
never said that you should. I use my patch successful. does what it should.

and yes, I use a publish/subscribe mechanism. though, with that trigger feature to have my processes do what they should and not entangle with too many tasks. being able to start and stop the processes as I please.