On Wed, 2003-11-19 at 14:03, Dan Greene wrote:
> This may be simplistic, but is mysql putting any text before / after blob content, 
> such as column name, '1 row processed OK', that may be 'corrupting' the tar data?
> 
> using a very small tar file, and run your command, piping to more instead of tar to 
> see if there is any extra text that mysql is adding in when it's not explictly 
> running 'into dumpfile'

I tried your suggestion,result in other post,
I took your idea further, instead of a tar file I stored
my test1 file as is, using FILE_LOAD().

before:
use test;
select * from test;
after:
mysql --skip-column-names  < test1 | more
use test;\nselect * from test;\n

\n's are added?


> > -----Original Message-----
> > From: Denis Mercier [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, November 19, 2003 1:55 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: piping blob into shell command (tar)
> > 
> > 
> > On Wed, 2003-11-19 at 12:26, Paul DuBois wrote:
> > > At 11:03 -0500 11/19/03, Denis Mercier wrote:
> > > 
> > > >  > >>  >i also tried:
> > > >>  >>  >use my_db;
> > > >>  >>  >select * from my_table;
> > > >>  >>  >
> > > >>  >>  >so when i try shell> mysql --pager < test1 | tar x
> > > >>  >>  >
> > > >>  >>  >the tar file does not get written to 
> > /usr/local/test1 but i still dont
> > > >>  >>  >get my untared files? write permissions are ok?
> > > >>  >>  >what am i missing?
> > > >>  >>
> > > >>  >>  Have you verified that the mysql command actually 
> > writes any output, for
> > > >>  >>  example, with this command:
> > > >>  >>
> > > >>  >  > shell> mysql --pager < test1 | wc
> > > >>  >>
> > > >>  >>  Do you get any output from tar at all, such as an 
> > error message?
> > > >>  >>  Maybe the output from mysql isn't suitable.  Couple 
> > of things to try:
> > > >>  >>
> > > >>  >The output from mysql seems fine because when it does 
> > write the value
> > > >>  >of my blob I get a well formatted tar file,
> > > >>  >I'm thinking that maybe tar cannot handle a stream as 
> > it's input?
> > > >>
> > > >>  That may be.  In that case, you should invoke tar as
> > > >>
> > > >>  tar xf -
> > > >>
> > > >
> > > >I have tried tar xf but tar gives me an error, it wants a file
> > > >specified.
> > > 
> > > But I didn't say to use "tar xf".  I said to use "tar xf -".  That
> > > dash is highly significant.  It means "The file to read is the
> > > standard input".
> > 
> > tried tar xf - 
> > mysql  < test1 |  tar xf -
> > tar: This does not look like a tar archive
> > tar: Skipping to next header
> > tar: Error exit delayed from previous errors
> > 
> > I dont get it, if i do this command:
> > 
> > mysql> select * into dumpfile "/usr/local/test1.tar" from my_table
> > 
> > I get a tar archive written to /usr/local/
> > 
> > I'm using mysql client to store my tar file as a blob,
> > mysql> insert into my_table values(LOAD_FILE("/usr/local/test1.tar"));
> > 
> > could this function cause my problem?
> > Thanks 
> > > 
> > 
> > > 
> > > -- 
> > > Paul DuBois, Senior Technical Writer
> > > Madison, Wisconsin, USA
> > > MySQL AB, www.mysql.com
> > > 
> > > Are you MySQL certified?  http://www.mysql.com/certification/
> > > 
> > 
> > 
> > -- 
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to