mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Portability fixes
Changed TRUNCATE table_name -> TRUNCATE TABLE table_name Docs/manual.texi: Changed TRUNCATE table_name -> TRUNCATE TABLE table_name client/mysql.cc: Don't crash when using -q with long fields include/my_net.h: Portability fix mysql-test/t/truncate.test: Changed TRUNCATE table_name -> TRUNCATE TABLE table_name readline/input.c: Portability fix scripts/make_binary_distribution.sh: Portability fix sql-bench/crash-me.sh: Portability fix sql/mini_client.cc: Portability fix sql/mysqld.cc: cleanup sql/share/dutch/errmsg.txt: Fixed typo sql/share/english/errmsg.txt: Fixed typo sql/share/greek/errmsg.txt: Fixed typo sql/share/hungarian/errmsg.txt: Fixed typo sql/share/italian/errmsg.txt: New translated messages sql/share/portuguese/errmsg.txt: Fixed typo sql/share/romanian/errmsg.txt: Fixed typo sql/share/slovak/errmsg.txt: Fixed typo sql/share/spanish/errmsg.txt: Fixed typo sql/sql_yacc.yy: Changed TRUNCATE table_name -> TRUNCATE TABLE table_name support-files/Makefile.am: Portability fix
This commit is contained in:
@@ -41,6 +41,9 @@
|
||||
|
||||
const char *VER="11.12";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
|
||||
gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
|
||||
void sql_element_free(void *ptr);
|
||||
#include "sql_string.h"
|
||||
@@ -1546,7 +1549,8 @@ print_table_data(MYSQL_RES *result)
|
||||
(void) tee_fputs("|", PAGER);
|
||||
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
|
||||
{
|
||||
tee_fprintf(PAGER, " %-*s|",field->max_length,field->name);
|
||||
tee_fprintf(PAGER, " %-*s|",min(field->max_length,MAX_COLUMN_LENGTH),
|
||||
field->name);
|
||||
num_flag[off]= IS_NUM(field->type);
|
||||
}
|
||||
(void) tee_fputs("\n", PAGER);
|
||||
@@ -1559,10 +1563,16 @@ print_table_data(MYSQL_RES *result)
|
||||
mysql_field_seek(result,0);
|
||||
for (uint off=0 ; off < mysql_num_fields(result); off++)
|
||||
{
|
||||
const char *str=cur[off] ? cur[off] : "NULL";
|
||||
field = mysql_fetch_field(result);
|
||||
uint length=field->max_length;
|
||||
if (length > MAX_COLUMN_LENGTH)
|
||||
{
|
||||
tee_fputs(str,PAGER); tee_fputs(" |",PAGER);
|
||||
}
|
||||
else
|
||||
tee_fprintf(PAGER, num_flag[off] ? "%*s |" : " %-*s|",
|
||||
length,cur[off] ? (char*) cur[off] : "NULL");
|
||||
length, str);
|
||||
}
|
||||
(void) tee_fputs("\n", PAGER);
|
||||
}
|
||||
|
Reference in New Issue
Block a user