SQLite Forum

sqlite3 column truncation problem

sqlite3 column truncation problem

(1) By anonymous on 2020-09-06 16:51:05 [link] [source]

I asked a question at stackoverflow.

Heres the link: https://dba.stackexchange.com/q/275062/215228

Please help.

(2) By RandomCoder on 2020-09-06 17:29:50 in reply to 1 [source]

Your question seems to be:

Why is sqlite3's shell limiting output to 333 characters in some display modes that justify the output?

It turns out most of the output for these modes goes through this function:

static void utf8_width_print(FILE *pOut, int w, const char *zUtf){ int i; int n; int aw = w<0 ? -w : w; char zBuf[1000]; if( aw>(int)sizeof(zBuf)/3 ) aw = (int)sizeof(zBuf)/3;

This final safety check has the effect of limiting all output to 333 characters (aw>(int)sizeof(zBuf)/3). I know of no way around this limitation other than building your own version of the shell with the size of zBuf increased.

(3) By Richard Hipp (drh) on 2020-09-06 17:43:26 in reply to 1 [link] [source]

Fixed by check-in 783fa887c9ed1a7d

(4) By anonymous on 2020-09-06 19:28:59 in reply to 3 [link] [source]

Thank you. I have to build it myself now. Right?

(5) By David Raymond (dvdraymond) on 2020-09-08 13:29:17 in reply to 4 [link] [source]

Thank you. I have to build it myself now. Right?

Correct. The pre-compiled stuff only gets made at the release of a new version. So the change has been made, but until the next version happens you'll have get the latest source code from the repository (or just remove those two lines from your current copy of shell.c) and compile it yourself to see the change.