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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
673f67f6
Commit
673f67f6
authored
May 31, 2002
by
jani@dsl-jkl1657.dial.inet.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in mysql client.
parent
f587e985
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
108 deletions
+112
-108
client/mysql.cc
client/mysql.cc
+112
-108
No files found.
client/mysql.cc
View file @
673f67f6
...
...
@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>
const
char
*
VER
=
"12.
9
"
;
const
char
*
VER
=
"12.
10
"
;
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
...
...
@@ -604,112 +604,115 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char
*
argument
)
{
switch
(
optid
)
{
case
OPT_CHARSETS_DIR
:
strmov
(
mysql_charsets_dir
,
argument
);
charsets_dir
=
mysql_charsets_dir
;
break
;
case
OPT_LOCAL_INFILE
:
using_opt_local_infile
=
1
;
opt_local_infile
=
test
(
!
argument
||
atoi
(
argument
)
>
0
);
break
;
case
OPT_TEE
:
if
(
argument
==
disabled_my_option
)
{
if
(
opt_outfile
)
end_tee
();
}
else
if
(
!
opt_outfile
)
{
strmov
(
outfile
,
argument
);
init_tee
();
}
break
;
case
OPT_NOTEE
:
printf
(
"WARNING: option depricated; use --disable-tee instead.
\n
"
);
case
OPT_CHARSETS_DIR
:
strmov
(
mysql_charsets_dir
,
argument
);
charsets_dir
=
mysql_charsets_dir
;
break
;
case
OPT_LOCAL_INFILE
:
using_opt_local_infile
=
1
;
opt_local_infile
=
test
(
!
argument
||
atoi
(
argument
)
>
0
);
break
;
case
OPT_TEE
:
if
(
argument
==
disabled_my_option
)
{
if
(
opt_outfile
)
end_tee
();
break
;
case
OPT_PAGER
:
opt_nopager
=
0
;
if
(
argument
)
strmov
(
pager
,
argument
);
else
strmov
(
pager
,
default_pager
);
strmov
(
default_pager
,
pager
);
break
;
case
OPT_NOPAGER
:
printf
(
"WARNING: option depricated; use --disable-pager instead.
\n
"
);
opt_nopager
=
1
;
break
;
case
'A'
:
rehash
=
0
;
break
;
case
'e'
:
status
.
batch
=
1
;
status
.
add_to_history
=
0
;
batch_readline_end
(
status
.
line_buff
);
// If multiple -e
if
(
!
(
status
.
line_buff
=
batch_readline_command
(
argument
)))
return
1
;
ignore_errors
=
0
;
break
;
case
'o'
:
if
(
argument
==
disabled_my_option
)
one_database
=
0
;
else
one_database
=
skip_updates
=
1
;
break
;
case
'p'
:
if
(
argument
==
disabled_my_option
)
argument
=
(
char
*
)
""
;
// Don't require password
if
(
argument
)
{
char
*
start
=
argument
;
my_free
(
opt_password
,
MYF
(
MY_ALLOW_ZERO_PTR
));
opt_password
=
my_strdup
(
argument
,
MYF
(
MY_FAE
));
while
(
*
argument
)
*
argument
++=
'x'
;
// Destroy argument
if
(
*
start
)
start
[
1
]
=
0
;
}
else
tty_password
=
1
;
break
;
case
'#'
:
DBUG_PUSH
(
argument
?
argument
:
default_dbug_option
);
info_flag
=
1
;
break
;
case
's'
:
if
(
argument
==
disabled_my_option
)
opt_silent
=
0
;
else
opt_silent
++
;
break
;
case
'v'
:
if
(
argument
==
disabled_my_option
)
verbose
=
0
;
else
verbose
++
;
break
;
case
'B'
:
if
(
!
status
.
batch
)
}
else
if
(
!
opt_outfile
)
{
status
.
batch
=
1
;
status
.
add_to_history
=
0
;
opt_silent
++
;
// more silent
strmov
(
outfile
,
argument
);
init_tee
();
}
break
;
case
'W'
:
break
;
case
OPT_NOTEE
:
printf
(
"WARNING: option depricated; use --disable-tee instead.
\n
"
);
if
(
opt_outfile
)
end_tee
();
break
;
case
OPT_PAGER
:
opt_nopager
=
0
;
if
(
argument
)
strmov
(
pager
,
argument
);
else
strmov
(
pager
,
default_pager
);
strmov
(
default_pager
,
pager
);
break
;
case
OPT_NOPAGER
:
printf
(
"WARNING: option depricated; use --disable-pager instead.
\n
"
);
opt_nopager
=
1
;
break
;
case
'A'
:
rehash
=
0
;
break
;
case
'N'
:
column_names
=
0
;
break
;
case
'e'
:
status
.
batch
=
1
;
status
.
add_to_history
=
0
;
batch_readline_end
(
status
.
line_buff
);
// If multiple -e
if
(
!
(
status
.
line_buff
=
batch_readline_command
(
argument
)))
return
1
;
ignore_errors
=
0
;
break
;
case
'o'
:
if
(
argument
==
disabled_my_option
)
one_database
=
0
;
else
one_database
=
skip_updates
=
1
;
break
;
case
'p'
:
if
(
argument
==
disabled_my_option
)
argument
=
(
char
*
)
""
;
// Don't require password
if
(
argument
)
{
char
*
start
=
argument
;
my_free
(
opt_password
,
MYF
(
MY_ALLOW_ZERO_PTR
));
opt_password
=
my_strdup
(
argument
,
MYF
(
MY_FAE
));
while
(
*
argument
)
*
argument
++=
'x'
;
// Destroy argument
if
(
*
start
)
start
[
1
]
=
0
;
}
else
tty_password
=
1
;
break
;
case
'#'
:
DBUG_PUSH
(
argument
?
argument
:
default_dbug_option
);
info_flag
=
1
;
break
;
case
's'
:
if
(
argument
==
disabled_my_option
)
opt_silent
=
0
;
else
opt_silent
++
;
break
;
case
'v'
:
if
(
argument
==
disabled_my_option
)
verbose
=
0
;
else
verbose
++
;
break
;
case
'B'
:
if
(
!
status
.
batch
)
{
status
.
batch
=
1
;
status
.
add_to_history
=
0
;
opt_silent
++
;
// more silent
}
break
;
case
'W'
:
#ifdef __WIN__
opt_mysql_unix_port
=
my_strdup
(
MYSQL_NAMEDPIPE
,
MYF
(
0
));
opt_mysql_unix_port
=
my_strdup
(
MYSQL_NAMEDPIPE
,
MYF
(
0
));
#endif
break
;
case
'V'
:
usage
(
1
);
exit
(
0
);
case
'I'
:
case
'?'
:
usage
(
0
);
exit
(
0
);
break
;
case
'V'
:
usage
(
1
);
exit
(
0
);
case
'I'
:
case
'?'
:
usage
(
0
);
exit
(
0
);
#include "sslopt-case.h"
}
return
0
;
...
...
@@ -1597,18 +1600,19 @@ print_table_data(MYSQL_RES *result)
tee_puts
(
separator
.
c_ptr
(),
PAGER
);
}
while
((
cur
=
mysql_fetch_row
(
result
)))
while
((
cur
=
mysql_fetch_row
(
result
)))
{
(
void
)
tee_fputs
(
"|"
,
PAGER
);
mysql_field_seek
(
result
,
0
);
for
(
uint
off
=
0
;
off
<
mysql_num_fields
(
result
);
off
++
)
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
;
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
);
tee_fputs
(
str
,
PAGER
);
tee_fputs
(
" |"
,
PAGER
);
}
else
tee_fprintf
(
PAGER
,
num_flag
[
off
]
?
"%*s |"
:
" %-*s|"
,
...
...
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