Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0d68fcf9
Commit
0d68fcf9
authored
Jun 04, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
parents
c72c3e4c
8376d814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
9 deletions
+86
-9
client/mysql.cc
client/mysql.cc
+86
-9
No files found.
client/mysql.cc
View file @
0d68fcf9
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
#include <locale.h>
#include <locale.h>
#endif
#endif
const
char
*
VER
=
"14.1
0
"
;
const
char
*
VER
=
"14.1
1
"
;
/* 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
...
@@ -1917,7 +1917,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
...
@@ -1917,7 +1917,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
time_buff
[
0
]
=
0
;
time_buff
[
0
]
=
0
;
if
(
result
)
if
(
result
)
{
{
if
(
!
mysql_num_rows
(
result
)
&&
!
quick
)
if
(
!
mysql_num_rows
(
result
)
&&
!
quick
&&
!
info_flag
)
{
{
strmov
(
buff
,
"Empty set"
);
strmov
(
buff
,
"Empty set"
);
}
}
...
@@ -2049,18 +2049,93 @@ com_ego(String *buffer,char *line)
...
@@ -2049,18 +2049,93 @@ com_ego(String *buffer,char *line)
return
result
;
return
result
;
}
}
static
char
*
fieldtype2str
(
enum
enum_field_types
type
)
{
switch
(
type
)
{
case
FIELD_TYPE_BIT
:
return
"BIT"
;
case
FIELD_TYPE_BLOB
:
return
"BLOB"
;
case
FIELD_TYPE_DATE
:
return
"DATE"
;
case
FIELD_TYPE_DATETIME
:
return
"DATETIME"
;
case
FIELD_TYPE_NEWDECIMAL
:
return
"NEWDECIMAL"
;
case
FIELD_TYPE_DECIMAL
:
return
"DECIMAL"
;
case
FIELD_TYPE_DOUBLE
:
return
"DOUBLE"
;
case
FIELD_TYPE_ENUM
:
return
"ENUM"
;
case
FIELD_TYPE_FLOAT
:
return
"FLOAT"
;
case
FIELD_TYPE_GEOMETRY
:
return
"GEOMETRY"
;
case
FIELD_TYPE_INT24
:
return
"INT24"
;
case
FIELD_TYPE_LONG
:
return
"LONG"
;
case
FIELD_TYPE_LONGLONG
:
return
"LONGLONG"
;
case
FIELD_TYPE_LONG_BLOB
:
return
"LONG_BLOB"
;
case
FIELD_TYPE_MEDIUM_BLOB
:
return
"MEDIUM_BLOB"
;
case
FIELD_TYPE_NEWDATE
:
return
"NEWDATE"
;
case
FIELD_TYPE_NULL
:
return
"NULL"
;
case
FIELD_TYPE_SET
:
return
"SET"
;
case
FIELD_TYPE_SHORT
:
return
"SHORT"
;
case
FIELD_TYPE_STRING
:
return
"STRING"
;
case
FIELD_TYPE_TIME
:
return
"TIME"
;
case
FIELD_TYPE_TIMESTAMP
:
return
"TIMESTAMP"
;
case
FIELD_TYPE_TINY
:
return
"TINY"
;
case
FIELD_TYPE_TINY_BLOB
:
return
"TINY_BLOB"
;
case
FIELD_TYPE_VAR_STRING
:
return
"VAR_STRING"
;
case
FIELD_TYPE_YEAR
:
return
"YEAR"
;
default:
return
"?-unknown-?"
;
}
}
static
char
*
fieldflags2str
(
uint
f
)
{
static
char
buf
[
1024
];
char
*
s
=
buf
;
*
s
=
0
;
#define ff2s_check_flag(X) \
if (f & X ## _FLAG) { s=strmov(s, # X " "); f &= ~ X ## _FLAG; }
ff2s_check_flag
(
NOT_NULL
);
ff2s_check_flag
(
PRI_KEY
);
ff2s_check_flag
(
UNIQUE_KEY
);
ff2s_check_flag
(
MULTIPLE_KEY
);
ff2s_check_flag
(
BLOB
);
ff2s_check_flag
(
UNSIGNED
);
ff2s_check_flag
(
ZEROFILL
);
ff2s_check_flag
(
BINARY
);
ff2s_check_flag
(
ENUM
);
ff2s_check_flag
(
AUTO_INCREMENT
);
ff2s_check_flag
(
TIMESTAMP
);
ff2s_check_flag
(
SET
);
ff2s_check_flag
(
NO_DEFAULT_VALUE
);
ff2s_check_flag
(
NUM
);
ff2s_check_flag
(
PART_KEY
);
ff2s_check_flag
(
GROUP
);
ff2s_check_flag
(
UNIQUE
);
ff2s_check_flag
(
BINCMP
);
#undef ff2s_check_flag
if
(
f
)
sprintf
(
s
,
" unknows=0x%04x"
,
f
);
return
buf
;
}
static
void
static
void
print_field_types
(
MYSQL_RES
*
result
)
print_field_types
(
MYSQL_RES
*
result
)
{
{
MYSQL_FIELD
*
field
;
MYSQL_FIELD
*
field
;
uint
i
=
0
;
while
((
field
=
mysql_fetch_field
(
result
)))
while
((
field
=
mysql_fetch_field
(
result
)))
{
{
tee_fprintf
(
PAGER
,
"Catalog: '%s'
\n
Database: '%s'
\n
Table: '%s'
\n
Name: '%s'
\n
Type: %d
\n
Length: %ld
\n
Max length: %ld
\n
Is_null: %d
\n
Flags: %u
\n
Decimals: %u
\n\n
"
,
tee_fprintf
(
PAGER
,
"Field %3u: `%s`
\n
"
field
->
catalog
,
field
->
db
,
field
->
table
,
field
->
name
,
"Catalog: `%s`
\n
"
(
int
)
field
->
type
,
"Database: `%s`
\n
"
field
->
length
,
field
->
max_length
,
"Table: `%s`
\n
"
!
IS_NOT_NULL
(
field
->
flags
),
"Org_table: `%s`
\n
"
field
->
flags
,
field
->
decimals
);
"Type: %s
\n
"
"Collation: %s (%u)
\n
"
"Length: %lu
\n
"
"Max_length: %lu
\n
"
"Decimals: %u
\n
"
"Flags: %s
\n\n
"
,
++
i
,
field
->
name
,
field
->
catalog
,
field
->
db
,
field
->
table
,
field
->
org_table
,
fieldtype2str
(
field
->
type
),
get_charset_name
(
field
->
charsetnr
),
field
->
charsetnr
,
field
->
length
,
field
->
max_length
,
field
->
decimals
,
fieldflags2str
(
field
->
flags
));
}
}
tee_puts
(
""
,
PAGER
);
tee_puts
(
""
,
PAGER
);
}
}
...
@@ -2078,6 +2153,8 @@ print_table_data(MYSQL_RES *result)
...
@@ -2078,6 +2153,8 @@ print_table_data(MYSQL_RES *result)
if
(
info_flag
)
if
(
info_flag
)
{
{
print_field_types
(
result
);
print_field_types
(
result
);
if
(
!
mysql_num_rows
(
result
))
return
;
mysql_field_seek
(
result
,
0
);
mysql_field_seek
(
result
,
0
);
}
}
separator
.
copy
(
"+"
,
1
,
charset_info
);
separator
.
copy
(
"+"
,
1
,
charset_info
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment