Bugs item #2787825, was opened at 2009-05-06 14:21
Message generated for change (Comment added) made by vzzzbx
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2787825&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Mapi
Group: Clients CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Wouter Alink (vzzzbx)
Assigned to: Nobody/Anonymous (nobody)
Summary: mclient: stdin + statement 

Initial Comment:
It seems that there is a  problem with both providing data via stdin and via 
the -s feature in mclient.  (see example below).

A possible solution could perhaps be to forbid this use. Another solution would 
be to define a behaviour: either read the '-s' first or the stdin first. 
(perhaps this already is the case, but I couldn't find any documentation about 
it)

$ cat data.dat
1
2
3
4
5
$ N=4; head -n $N data.dat | mclient -lsql -p50151 -dtest -s "copy $N records 
into aap from STDIN;"
MAPI  = mone...@localhost:50151
QUERY = copy 4 records into aap from STDIN;
ERROR = !SQLException:sql:value ';' while parsing ';' from line 0 field 0 not 
inserted, expecting type int
        !SQLException:importTable:failed to import table


----------------------------------------------------------------------

>Comment By: Wouter Alink (vzzzbx)
Date: 2009-05-07 21:55

Message:
as discussed on the monetdb-users list, using either the -s _or_ the stdin
works fine (except for other reported/unreported bugs), but the combination
fails. (stefan's example works fine).

I can very well imagine that using a combination should not be allowed
(and should not even become a feature request), but I feel that the current
message is not very helpful. 

And, actually (I hadn't thought of this option before), if I would have
specified "-i" then the documentation (mclient --help) says it reads from
stdin _after_ reading the command line args, but it generates the same
error.

After some more tests I discovered that:
- when using the command line args + stdin + mentioning '-i', the
semi-colon after "copy $N records into aap from STDIN;" should be left out,
so the following does work:

$ echo "1
2
3
4
5" | mclient -lsql -dtest -hskadi -p50151 -i -s "COPY 5 RECORDS INTO aap
FROM STDIN"

(notice the omission of ';' after the COPY statement)

If I do exactly the same, but leave out the '-i', no error is displayed,
but nothing gets inserted either.

If I use only stdin only:

$ echo "COPY 5 RECORDS INTO aap FROM STDIN;
1
2
3
4
5" | mclient -lsql -dtest -hskadi -p50151

then this works (only if the ';' after the COPY statement is present).

I don't know whether there are two different bugs mentioned in this
explanation, but I think there definitely is something wrong.

by the way: the create statement for aap is: "CREATE TABLE aap (x int);"

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-05-07 19:30

Message:
What about:

{ N=4 ; echo "copy $N records into aap from STDIN;" ; head -n $N data.dat
; } | mclient -lsql -p50151 -dtest

?


----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2009-05-07 14:26

Message:
Where does it say that this is supported?
If it doesn't say anywhere, this is a feature request, not a bug.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2787825&group_id=56967

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to