<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to support-requests</title><link href="https://sourceforge.net/p/sqsh/support-requests/" rel="alternate"/><link href="https://sourceforge.net/p/sqsh/support-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/sqsh/support-requests/</id><updated>2013-08-27T16:09:52.266000Z</updated><subtitle>Recent changes to support-requests</subtitle><entry><title>#4 sqsh doesn't work with ASE!5</title><link href="https://sourceforge.net/p/sqsh/support-requests/4/?limit=25#87d8" rel="alternate"/><published>2013-08-27T16:09:52.266000Z</published><updated>2013-08-27T16:09:52.266000Z</updated><author><name>Martin Wesdorp</name><uri>https://sourceforge.net/u/mwesdorp/</uri></author><id>https://sourceforge.net6849f39c981baa63f2456beb42779076905c4575</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Group&lt;/strong&gt;:  --&amp;gt; v1.0 (example)&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#11 Issue with sql update when single quote in data</title><link href="https://sourceforge.net/p/sqsh/support-requests/11/?limit=25#b7ac" rel="alternate"/><published>2013-06-07T14:45:58.760000Z</published><updated>2013-06-07T14:45:58.760000Z</updated><author><name>Martin Wesdorp</name><uri>https://sourceforge.net/u/mwesdorp/</uri></author><id>https://sourceforge.netdc1e549e3c420edc6e603b496c1323a3fe59da83</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;After reading through the question again, I would like to add some additional comments to explain what is happening here. First please note that&lt;/p&gt;
&lt;p&gt;1) Sqsh does not expand $variables or escape characters in between a single quoted string.&lt;br /&gt;
2) Everything in the buffer outside single quoted strings will go through expansion, including double quoted strings, only if $expand is true.&lt;br /&gt;
3) By default expansion is on, which can be controlled by the sqsh variable $expand. To turn expansion off use:&lt;/p&gt;
&lt;p&gt;1&amp;gt; \set expand=&lt;span&gt;[0|Off|False]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;or start sqsh with the parameter -Lexpand=0 on the command line. &lt;br /&gt;
4) sqsh use double backslashes as escape sequence and does not understand single backslash escape characters.&lt;br /&gt;
5) You can use the -e command line parameter with sqsh to make it echo the command buffer it is sending to the server to stdout. You can also switch the variable $echo on (\set echo=On) just to accomplish the same. This might sometimes explain what is really going on under the hood with buffer expansion and what command is finally sent to the server.&lt;/p&gt;
&lt;p&gt;So what happened with your update statement then?&lt;/p&gt;
&lt;p&gt;update custom.maintenance set MessageText='test\'s datastore1_\(23\)'&lt;/p&gt;
&lt;p&gt;Well, just before the SQL buffer is submitted to the server it is expanded by default. During expansion $variable names are substituted and escaped characters are skipped from interpretation (but the escape sequence \ itself is removed). So when sqsh encounters the first quote in the buffer it assumes the beginning of a string that should be skipped from expansion and when it encounters the second quote it assumes end of quoted string and resumes normal expansion again. Sqsh does not understand a single backslash as an escape sequence. So it interprets the \' as end of the single quoted string and starts expanding the remainder of the SQL buffer. Then it finds a \( sequence which it interprets as an escaped ( so it trims of the \. The same happens with the \). Then it finds a quote again and assumes a new beginning of a quoted string. But then finally end of buffer is reached and the buffer&lt;/p&gt;
&lt;p&gt;update custom.maintenance set MessageText='test\'s datastore1_(23)'&lt;/p&gt;
&lt;p&gt;is sent to the server. It is left to the server to interpret the \' escape sequence. When you leave out the \' from the command, sqsh skips expansion of the whole string 'tests datastore1_\(23\)' and your backslashes remain there.&lt;/p&gt;
&lt;p&gt;So what can you do to circumvent this problem then? 1) Set expand to off. 2) Use 2 single quotes in sequence to escape a single quote. For example:&lt;/p&gt;
&lt;p&gt;'test''s datastore1_\(23\)'&lt;/p&gt;
&lt;p&gt;would work as well. 3) Code enough backslashes for expansion. A single backslash will not be expanded, Two backslashes escape the third character but will be removed from the buffer themselves. So whatever follows a \ remains there. So for example \\ will result in \, but \\ will result in \ because the first two backslashes escape the third backslash and the fourth backslash will be just interpreted as is. However 5 backslashes just result in one, the first three produce that one \ and the last two will just be trimmed off. To demonstrate this look at the following SQL and the output it produces:&lt;/p&gt;
&lt;p&gt;1&amp;gt; select "one"  ="\"&lt;br /&gt;
2&amp;gt; select "two"  ="\"&lt;br /&gt;
3&amp;gt; select "three"="\\"&lt;br /&gt;
4&amp;gt; select "four" ="\\"&lt;br /&gt;
5&amp;gt; select "five" ="\\\"&lt;br /&gt;
6&amp;gt; select "six"  ="\\\"&lt;br /&gt;
7&amp;gt; select "seven"="\\\\"&lt;br /&gt;
8&amp;gt; go -f -m vertical&lt;br /&gt;
one: \ &lt;br /&gt;
two:&lt;br /&gt;
three: \
four: \&lt;br /&gt;
five: \
six: \&lt;br /&gt;
seven: \\&lt;/p&gt;
&lt;p&gt;But this SQL was sent to a Sybase ASE server which does not interpret escape characters. When you connect to a MSSQL server that does interpret \ escape characters, this might complicate things even more. Your initial insert statement for example contains many single quotes, two of them escaped, which led to the situation, according to sqsh, that \( and \) was inside single quotes and did not get expanded by sqsh and the string was correctly sent to the server. The server then inserted ( in the database as it interpreted the single backslash escape character to escape a backslash (\). So probably just a coincidence that the insert worked fine here.&lt;/p&gt;
&lt;p&gt;Hope this clarifies some of the internal sqsh behaviour with expansion.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;
Martin. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Not a bug but a question</title><link href="https://sourceforge.net/p/sqsh/support-requests/12/" rel="alternate"/><published>2013-04-22T04:12:10Z</published><updated>2013-04-22T04:12:10Z</updated><author><name>Murali Sabapathi</name><uri>https://sourceforge.net/u/muralisabapathi/</uri></author><id>https://sourceforge.netcc34c90935c84868ac22e598d2cc443465e0f71f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Marin, am trying to use a function as below but variable substitution is not happening, is this because of single quotes ?&lt;/p&gt;
&lt;p&gt;Unfortunately, object_id() (from mssql) needs it within single quotes, any tips ?&lt;/p&gt;
&lt;p&gt;\func -x show_frag&lt;br /&gt;
\if [ $# -ne 1 ]&lt;br /&gt;
\echo "usage: show_frag &amp;lt;table&amp;gt;"&lt;br /&gt;
\return 1&lt;br /&gt;
\fi&lt;/p&gt;
&lt;p&gt;SELECT a.index_id, name, avg_fragmentation_in_percent&lt;br /&gt;
FROM sys.dm_db_index_physical_stats (DB_ID(db_name()), OBJECT_ID('${1}'), NULL, NULL, NULL) AS a&lt;br /&gt;
JOIN sys.indexes AS b&lt;br /&gt;
ON a.object_id = b.object_id AND a.index_id = b.index_id&lt;br /&gt;
go&lt;br /&gt;
\done&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Issue with sql update when single quote in data</title><link href="https://sourceforge.net/p/sqsh/support-requests/11/" rel="alternate"/><published>2012-11-16T23:54:56Z</published><updated>2012-11-16T23:54:56Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netb31bea2120bfa96d19cd1befdec5a4d13770e3d2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If you look at the below insert statement, I am escaping the parenthesis with two backslashes to insert the record in the database and that works fine.  After that, when I update the same record in that field, when I change the value from 22 to 23 with the two backslashes, it no longer inserts the \( in the db.  So what seems to be the issue?  Any help would be very much appreciated.&lt;br /&gt;
DEVPNCOMS..1&amp;gt; insert into custom.maintenance (KeyField, Device, sModeType, StartTime, EndTime, Flag, EnteredBy, Reason, DevComp, sModeScope, MessageText, LOB) values('Device_serverx_MessageText_test\'s datastore1_\\(22\\)_1353107520_1353108420', ‘serverx’, 'Device', 1353107520, 1353108420, 1, 'gnangia','test','Server','MessageText','test\'s datastore1_\\(22\\)','XXXX');&lt;br /&gt;
DEVPNCOMS..1&amp;gt; go&lt;br /&gt;
DEVPNCOMS..1&amp;gt; select MessageText from custom.maintenance&lt;br /&gt;
DEVPNCOMS..2&amp;gt; go&lt;/p&gt;
&lt;p&gt;test's datastore1_\(22\)                                                                                                         &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;DEVPNCOMS..1&amp;gt; update custom.maintenance set MessageText='test\'s datastore1_\\(23\\)'&lt;br /&gt;
DEVPNCOMS..2&amp;gt; go&lt;br /&gt;
DEVPNCOMS..1&amp;gt; select MessageText from custom.maintenance&lt;br /&gt;
DEVPNCOMS..2&amp;gt; go&lt;/p&gt;
&lt;p&gt;test's datastore1_(23)             &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;I did some further testing and found that if I use 4 backslashes before the parenthesis, it inserts a single backslash - same as the initial insert - but this is only true if I have a single quote in the value prior to the parenthesis.  If there is no single quote or the single quote is after the parenthesis, I only need two backslashes, which seem to be very inconsistent.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>$width limitation of 256 should be removed/increased</title><link href="https://sourceforge.net/p/sqsh/support-requests/10/" rel="alternate"/><published>2010-06-06T07:10:36Z</published><updated>2010-06-06T07:10:36Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netc71cede4c1c3053e332aa9b039bcd8073a003094</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;older versions of sqsh (as far as I remember) did not have a $width variable and did not automatically wrap lines. That was incredibly nice together with using less -S as the pager: you could scroll left/right with your arrow keys in less to see the entire line, everything nicely lined up with no wrapping.&lt;/p&gt;
&lt;p&gt;Current versions of sqsh seem to automatically wrap lines based on the $width variable. The maximum value of that is 256, which for many purposes is too short, for example sp_help &amp;lt;tablename&amp;gt; wraps for me on the description of the indices. There's many system tables as well for which a select * from result in lines longer than 256 characters, not to mention user tables.&lt;/p&gt;
&lt;p&gt;I'd like to propose an option to either disable wrapping in sqsh, or to allow much larger allowed values for $width.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>make file error on Linux </title><link href="https://sourceforge.net/p/sqsh/support-requests/9/" rel="alternate"/><published>2008-10-15T16:00:28Z</published><updated>2008-10-15T16:00:28Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net33a7f24742a1558d574651ba09fd95dc340c5a09</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Linux 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Linux&lt;/p&gt;
&lt;p&gt;make[1]: Entering directory `/software/sqsh-2.1.5/src'&lt;br /&gt;
gcc    -L/opt/sybase12_5/OCS-12_5/lib  cmd_alias.o cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o cmd_echo.o cmd_exit.o cmd_for.o cmd_func.o cmd_go.o cmd_help.o cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o cmd_kill.o cmd_lock.o cmd_loop.o cmd_misc.o cmd_read.o cmd_reconnect.o cmd_redraw.o cmd_reset.o cmd_return.o cmd_rpc.o cmd_set.o cmd_shell.o cmd_show.o cmd_sleep.o cmd_wait.o cmd_warranty.o cmd_while.o var_ctlib.o var_date.o var_debug.o var_dsp.o var_hist.o var_misc.o var_passwd.o var_readline.o var_thresh.o dsp.o dsp_bcp.o dsp_csv.o dsp_conv.o dsp_desc.o dsp_horiz.o dsp_html.o dsp_meta.o dsp_none.o dsp_out.o dsp_pretty.o dsp_vert.o dsp_x.o sqsh_alias.o sqsh_args.o sqsh_avl.o sqsh_buf.o sqsh_cmd.o sqsh_compat.o sqsh_ctx.o sqsh_debug.o sqsh_env.o sqsh_error.o sqsh_expand.o sqsh_fd.o sqsh_filter.o sqsh_fork.o sqsh_func.o sqsh_getopt.o sqsh_global.o sqsh_history.o sqsh_init.o sqsh_job.o sqsh_readline.o sqsh_sig.o sqsh_sigcld.o sqsh_stdin.o sqsh_strchr.o sqsh_tok.o sqsh_varbuf.o sqsh_main.o -lblk -lcs -lct -lsybtcl -lcomn -lintl -ldl -lm     -o sqsh&lt;br /&gt;
/usr/bin/ld: skipping incompatible /opt/sybase12_5/OCS-12_5/lib/libblk.a when searching for -lblk&lt;br /&gt;
/usr/bin/ld: cannot find -lblk&lt;br /&gt;
collect2: ld returned 1 exit status&lt;br /&gt;
make[1]: *** [sqsh] Error 1&lt;br /&gt;
make[1]: Leaving directory `/software/sqsh-2.1.5/src'&lt;br /&gt;
make: *** [build-subdirs] Error 2&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Segmentation fault for select with large floating point valu</title><link href="https://sourceforge.net/p/sqsh/support-requests/8/" rel="alternate"/><published>2008-03-06T14:37:05Z</published><updated>2008-03-06T14:37:05Z</updated><author><name>Michael Tibbetts</name><uri>https://sourceforge.net/u/mtibbetts/</uri></author><id>https://sourceforge.netf110ca2060d21d9e8b16f15b4a72c2ce7646c8de</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I get a segmentation fault when I select from a table containing a certain floating point numbers.&lt;/p&gt;
&lt;p&gt;host-13: sqsh &lt;br /&gt;
sqsh-2.1.4 Copyright (C) 1995-2001 Scott C. Gray&lt;br /&gt;
Portions Copyright (C) 2004-2006 Michael Peppler&lt;br /&gt;
This is free software with ABSOLUTELY NO WARRANTY&lt;br /&gt;
For more information type '\warranty'&lt;br /&gt;
[22] sqldev15.tibbetts.1&amp;gt; create table foo (col1 double precision);&lt;br /&gt;
[23] sqldev15.tibbetts.1&amp;gt; insert into foo values (-1e120);&lt;br /&gt;
(1 row affected)&lt;br /&gt;
[24] sqldev15.tibbetts.1&amp;gt; select col1 from foo;&lt;br /&gt;
col1              &lt;br /&gt;
--------------------&lt;br /&gt;
-999999999999999980003468347394201181668805192897008518188648311830772414627428&lt;br /&gt;
725464789434929992439754776075181077037056.000000&lt;/p&gt;
&lt;p&gt;(1 row affected)&lt;br /&gt;
Segmentation fault&lt;/p&gt;
&lt;p&gt;This happens on both Solaris, sqsh built with Sun C compiler 5.7, and Linux, sqsh built with gcc-3.4.6.&lt;/p&gt;
&lt;p&gt;I suspect this is a buffer overflow issue with the space allocated for CS_FLOAT and CS_REAL datatypes in dsp_desc.c.  64 bytes are malloc, but the values requires more to properly display using the %f format specifier in sprintf.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>unable to link sqsh on cygwin</title><link href="https://sourceforge.net/p/sqsh/support-requests/7/" rel="alternate"/><published>2006-05-16T19:43:54Z</published><updated>2006-05-16T19:43:54Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netbdcf957d6879d39ca6de37a6fc5fbebf398ce3f6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The linking trips up on libdl which doesn't exist on&lt;br /&gt;
cygwin.  Attempted to substitute with libsybct with no&lt;br /&gt;
luck.  OpenClient 15&lt;/p&gt;
&lt;p&gt;$ make&lt;br /&gt;
....&lt;br /&gt;
sqsh_main.c: In function `hide_password':&lt;br /&gt;
sqsh_main.c:889: warning: comparison between pointer&lt;br /&gt;
and integer&lt;br /&gt;
gcc  -L/usr/X11R6/lib &lt;br /&gt;
-L/cygdrive/c/sybase15/OCS-15_0/lib  cmd_alias.o&lt;br /&gt;
cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o cmd_echo.o cm&lt;br /&gt;
d_exit.o cmd_for.o cmd_func.o cmd_go.o cmd_help.o&lt;br /&gt;
cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o&lt;br /&gt;
cmd_kill.o cmd_lock.o cmd_loop.o&lt;br /&gt;
cmd_misc.o cmd_read.o cmd_reconnect.o cmd_redraw.o&lt;br /&gt;
cmd_reset.o cmd_return.o cmd_rpc.o cmd_set.o&lt;br /&gt;
cmd_shell.o cmd_show.o cmd_slee&lt;br /&gt;
p.o cmd_wait.o cmd_warranty.o cmd_while.o var_ctlib.o&lt;br /&gt;
var_date.o var_debug.o var_dsp.o var_hist.o var_misc.o&lt;br /&gt;
var_passwd.o var_re&lt;br /&gt;
adline.o var_thresh.o dsp.o dsp_bcp.o dsp_csv.o&lt;br /&gt;
dsp_conv.o dsp_desc.o dsp_horiz.o dsp_html.o dsp_meta.o&lt;br /&gt;
dsp_none.o dsp_out.o dsp&lt;br /&gt;
_pretty.o dsp_vert.o dsp_x.o sqsh_alias.o sqsh_args.o&lt;br /&gt;
sqsh_avl.o sqsh_buf.o sqsh_cmd.o sqsh_compat.o&lt;br /&gt;
sqsh_ctx.o sqsh_debug.o sqs&lt;br /&gt;
h_env.o sqsh_error.o sqsh_expand.o sqsh_fd.o&lt;br /&gt;
sqsh_filter.o sqsh_fork.o sqsh_func.o sqsh_getopt.o&lt;br /&gt;
sqsh_global.o sqsh_history.o sq&lt;br /&gt;
sh_init.o sqsh_job.o sqsh_readline.o sqsh_sig.o&lt;br /&gt;
sqsh_sigcld.o sqsh_stdin.o sqsh_strchr.o sqsh_tok.o&lt;br /&gt;
sqsh_varbuf.o sqsh_main.o -l&lt;br /&gt;
m -lsybct -lXaw   -lXt -lXext -lXmu  -lX11  -lreadline&lt;br /&gt;
-lcurses  -o sqsh&lt;br /&gt;
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:&lt;br /&gt;
cannot find -lsybct&lt;br /&gt;
collect2: ld returned 1 exit status&lt;br /&gt;
make: *** [sqsh] Error 1&lt;/p&gt;
&lt;p&gt;Fix??&lt;/p&gt;
&lt;p&gt;Jason L. Froebe&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error msg when connecting to Replication Server</title><link href="https://sourceforge.net/p/sqsh/support-requests/6/" rel="alternate"/><published>2006-02-24T09:47:31Z</published><updated>2006-02-24T09:47:31Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net61a0877f916112cb3d822f7dc253736b274a0df6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I've got the following problem since using sqsh 2.1.3 &lt;br /&gt;
( AIX ).&lt;br /&gt;
When I establish a connection to a Replication Server &lt;br /&gt;
(12.6), an error is displayed :&lt;br /&gt;
./sqsh  -Usa -SEXPRS1 -Ppass&lt;br /&gt;
sqsh-2.1.3 Copyright (C) 1995-2001 Scott C. Gray&lt;br /&gt;
Portions Copyright (C) 2004 Michael Peppler&lt;br /&gt;
This is free software with ABSOLUTELY NO WARRANTY&lt;br /&gt;
For more information type '\warranty'&lt;br /&gt;
No SRV_OPTION handler installed.&lt;br /&gt;
Open Client Message&lt;br /&gt;
Layer 1, Origin 1, Severity 1, Number 183&lt;br /&gt;
ct_options(): user api layer: external error: An error &lt;br /&gt;
was returned from the server while&lt;br /&gt;
setting the options, check the server message for &lt;br /&gt;
details.&lt;br /&gt;
[3] EXPRS1..1&amp;gt;&lt;/p&gt;
&lt;p&gt;There was no such error with sqsh 2.1 on Solaris.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Language/Charset warnings</title><link href="https://sourceforge.net/p/sqsh/support-requests/5/" rel="alternate"/><published>2005-10-28T15:11:11Z</published><updated>2005-10-28T15:11:11Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netc60aabe1e9a565e1ea081a598119913727dafe0e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When connecting  to an ASE server with sqsh - if there &lt;br /&gt;
is a non iso_1 character set ( in my case utf8) etc, &lt;br /&gt;
several warning messages are returned - 5704, 5703 &amp;amp; &lt;br /&gt;
5701 - according to one of the solved cases on Sybase' &lt;br /&gt;
website , these can be suppressed in OpenSwitch - &lt;br /&gt;
using :&lt;/p&gt;
&lt;p&gt;SUPPRESS_CHARSET = 1  -  suppresses 5704&lt;br /&gt;
SUPPRESS_DBCTX = 1 - suppresses 5701 &lt;br /&gt;
SUPPRESS_LANG = 1 - supresses the language &lt;br /&gt;
change&lt;/p&gt;
&lt;p&gt;I was wondering whether this kind of suppression could &lt;br /&gt;
be added to SQSH so that the messages are &lt;br /&gt;
suppressed when connecting to ASE?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>