Commit 1afbe4fe authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi

The environment variable PAGER is now used as the default pager

Fixed bug with float columns
parent ac77076f
......@@ -2376,6 +2376,9 @@ Apart from the following links, you can find and download a lot of
@subheading Tutorials and Manuals
@table @asis
@item @uref{http://netgraft.com/~mbac/research/mysqlmyths.html, MySQL Myths Debunked}
@strong{MySQL} used in the real world.
@item @uref{http://www.4t2.com/mysql}
Information about the German MySQL mailing list.
......@@ -39,7 +39,7 @@
#include "my_readline.h"
#include <signal.h>
const char *VER="11.14";
const char *VER="11.15";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
......@@ -269,6 +269,11 @@ int main(int argc,char *argv[])
strmov(outfile, "\0"); // no (default) outfile, unless given at least once
strmov(pager, "stdout"); // the default, if --pager wasn't given
{
char *tmp=getenv("PAGER");
if (tmp)
strmov(default_pager,tmp);
}
if (!isatty(0) || !isatty(1))
{
status.batch=1; opt_silent=1;
......
......@@ -1791,7 +1791,8 @@ String *Field_float::val_str(String *val_buffer,
#endif
memcpy_fixed((byte*) &nr,ptr,sizeof(nr));
val_buffer->alloc(max(field_length,70));
uint to_length=max(field_length,70);
val_buffer->alloc(to_length);
char *to=(char*) val_buffer->ptr();
if (dec >= NOT_FIXED_DEC)
......@@ -1841,8 +1842,9 @@ String *Field_float::val_str(String *val_buffer,
while (tmp_dec--)
*to++= *pos++;
#else
#ifdef HAVE_SNPRINTF_
sprintf(to,val_buffer->length(),"%.*f",dec,nr);
#ifdef HAVE_SNPRINTF
to[to_length-1]=0; // Safety
snprintf(to,to_length-1,"%.*f",dec,nr);
#else
sprintf(to,"%.*f",dec,nr);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment