mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
The environment variable PAGER is now used as the default pager
Fixed bug with float columns Docs/manual.texi: Added new link client/mysql.cc: The environment variable PAGER is now used as the default pager sql/field.cc: Fixed bug with float columns.
This commit is contained in:
parent
e5bd740dea
commit
aab24fff88
3 changed files with 14 additions and 4 deletions
|
@ -2376,6 +2376,9 @@ Apart from the following links, you can find and download a lot of
|
||||||
@subheading Tutorials and Manuals
|
@subheading Tutorials and Manuals
|
||||||
|
|
||||||
@table @asis
|
@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}
|
@item @uref{http://www.4t2.com/mysql}
|
||||||
Information about the German MySQL mailing list.
|
Information about the German MySQL mailing list.
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "my_readline.h"
|
#include "my_readline.h"
|
||||||
#include <signal.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 */
|
/* Don't try to make a nice table if the data is too big */
|
||||||
#define MAX_COLUMN_LENGTH 1024
|
#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(outfile, "\0"); // no (default) outfile, unless given at least once
|
||||||
strmov(pager, "stdout"); // the default, if --pager wasn't given
|
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))
|
if (!isatty(0) || !isatty(1))
|
||||||
{
|
{
|
||||||
status.batch=1; opt_silent=1;
|
status.batch=1; opt_silent=1;
|
||||||
|
|
|
@ -1791,7 +1791,8 @@ String *Field_float::val_str(String *val_buffer,
|
||||||
#endif
|
#endif
|
||||||
memcpy_fixed((byte*) &nr,ptr,sizeof(nr));
|
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();
|
char *to=(char*) val_buffer->ptr();
|
||||||
|
|
||||||
if (dec >= NOT_FIXED_DEC)
|
if (dec >= NOT_FIXED_DEC)
|
||||||
|
@ -1841,8 +1842,9 @@ String *Field_float::val_str(String *val_buffer,
|
||||||
while (tmp_dec--)
|
while (tmp_dec--)
|
||||||
*to++= *pos++;
|
*to++= *pos++;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SNPRINTF_
|
#ifdef HAVE_SNPRINTF
|
||||||
sprintf(to,val_buffer->length(),"%.*f",dec,nr);
|
to[to_length-1]=0; // Safety
|
||||||
|
snprintf(to,to_length-1,"%.*f",dec,nr);
|
||||||
#else
|
#else
|
||||||
sprintf(to,"%.*f",dec,nr);
|
sprintf(to,"%.*f",dec,nr);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue