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
c415044b
Commit
c415044b
authored
Dec 14, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge jamppa@work:/home/bk/mysql-4.0/
into hynda.mysql.fi:/data/my/bk/mysql-4.0-quick-fixes
parents
afeffa38
09f8f2c8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
47 deletions
+27
-47
client/mysql.cc
client/mysql.cc
+27
-47
No files found.
client/mysql.cc
View file @
c415044b
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#include <signal.h>
#include <signal.h>
#include <violite.h>
#include <violite.h>
const
char
*
VER
=
"11.1
8
"
;
const
char
*
VER
=
"11.1
9
"
;
/* 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
...
@@ -172,8 +172,7 @@ static int sql_connect(char *host,char *database,char *user,char *password,
...
@@ -172,8 +172,7 @@ static int sql_connect(char *host,char *database,char *user,char *password,
static
int
put_info
(
const
char
*
str
,
INFO_TYPE
info
,
uint
error
=
0
);
static
int
put_info
(
const
char
*
str
,
INFO_TYPE
info
,
uint
error
=
0
);
static
void
safe_put_field
(
const
char
*
pos
,
ulong
length
);
static
void
safe_put_field
(
const
char
*
pos
,
ulong
length
);
static
const
char
*
array_value
(
const
char
**
array
,
char
*
key
);
static
const
char
*
array_value
(
const
char
**
array
,
char
*
key
);
static
void
xmlencode
(
char
*
dest
,
char
*
src
);
static
void
xmlencode_print
(
const
char
*
src
,
uint
length
);
static
void
my_chomp
(
char
*
end
);
static
void
init_pager
();
static
void
init_pager
();
static
void
end_pager
();
static
void
end_pager
();
static
void
init_tee
();
static
void
init_tee
();
...
@@ -1708,18 +1707,11 @@ print_table_data_xml(MYSQL_RES *result)
...
@@ -1708,18 +1707,11 @@ print_table_data_xml(MYSQL_RES *result)
mysql_field_seek
(
result
,
0
);
mysql_field_seek
(
result
,
0
);
char
*
statement
;
tee_fputs
(
"<?xml version=
\"
1.0
\"
?>
\n\n
<resultset statement=
\"
"
,
PAGER
);
statement
=
(
char
*
)
my_malloc
(
strlen
(
glob_buffer
.
ptr
())
*
5
+
1
,
MYF
(
MY_WME
));
xmlencode_print
(
glob_buffer
.
ptr
(),
strlen
(
glob_buffer
.
ptr
())
-
1
);
xmlencode
(
statement
,
(
char
*
)
glob_buffer
.
ptr
());
tee_fputs
(
"
\"
>"
,
PAGER
);
(
void
)
my_chomp
(
strend
(
statement
));
tee_fprintf
(
PAGER
,
"<?xml version=
\"
1.0
\"
?>
\n\n
<resultset statement=
\"
%s
\"
>"
,
statement
);
my_free
(
statement
,
MYF
(
MY_ALLOW_ZERO_PTR
));
fields
=
mysql_fetch_fields
(
result
);
fields
=
mysql_fetch_fields
(
result
);
while
((
cur
=
mysql_fetch_row
(
result
)))
while
((
cur
=
mysql_fetch_row
(
result
)))
{
{
(
void
)
tee_fputs
(
"
\n
<row>
\n
"
,
PAGER
);
(
void
)
tee_fputs
(
"
\n
<row>
\n
"
,
PAGER
);
...
@@ -1727,16 +1719,13 @@ print_table_data_xml(MYSQL_RES *result)
...
@@ -1727,16 +1719,13 @@ print_table_data_xml(MYSQL_RES *result)
{
{
char
*
data
;
char
*
data
;
ulong
*
lengths
=
mysql_fetch_lengths
(
result
);
ulong
*
lengths
=
mysql_fetch_lengths
(
result
);
data
=
(
char
*
)
my_malloc
(
lengths
[
i
]
*
5
+
1
,
MYF
(
MY_WME
));
tee_fprintf
(
PAGER
,
"
\t
<%s>"
,
(
fields
[
i
].
name
?
tee_fprintf
(
PAGER
,
"
\t
<%s>"
,
(
fields
[
i
].
name
?
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
" "
)
:
"NULL"
));
" "
)
:
"NULL"
));
xmlencode
(
data
,
cur
[
i
]);
xmlencode_print
(
cur
[
i
],
lengths
[
i
]);
safe_put_field
(
data
,
strlen
(
data
));
tee_fprintf
(
PAGER
,
"</%s>
\n
"
,
(
fields
[
i
].
name
?
tee_fprintf
(
PAGER
,
"</%s>
\n
"
,
(
fields
[
i
].
name
?
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
(
fields
[
i
].
name
[
0
]
?
fields
[
i
].
name
:
" "
)
:
"NULL"
));
" "
)
:
"NULL"
));
my_free
(
data
,
MYF
(
MY_ALLOW_ZERO_PTR
));
}
}
(
void
)
tee_fputs
(
" </row>
\n
"
,
PAGER
);
(
void
)
tee_fputs
(
" </row>
\n
"
,
PAGER
);
}
}
...
@@ -1774,43 +1763,34 @@ print_table_data_vertically(MYSQL_RES *result)
...
@@ -1774,43 +1763,34 @@ print_table_data_vertically(MYSQL_RES *result)
}
}
}
}
static
const
char
static
const
char
*
array_value
(
const
char
**
array
,
char
*
key
)
{
*
array_value
(
const
char
**
array
,
char
key
)
{
int
x
;
int
x
;
for
(
x
=
0
;
array
[
x
];
x
+=
2
)
for
(
x
=
0
;
array
[
x
];
x
+=
2
)
if
(
!
strcmp
(
array
[
x
],
key
)
)
if
(
*
array
[
x
]
==
key
)
return
array
[
x
+
1
];
return
array
[
x
+
1
];
return
0
;
return
0
;
}
}
static
void
static
void
xmlencode
(
char
*
dest
,
char
*
src
)
xmlencode
_print
(
const
char
*
src
,
uint
length
)
{
{
char
*
p
=
src
;
if
(
!
src
)
const
char
*
t
;
tee_fputs
(
"NULL"
,
PAGER
);
char
s
[
2
]
=
{
0
,
0
};
else
*
dest
=
0
;
do
{
{
s
[
0
]
=
*
p
;
for
(
const
char
*
p
=
src
;
*
p
&&
length
;
*
p
++
,
length
--
)
if
(
!
(
t
=
array_value
(
xmlmeta
,
s
)))
{
t
=
s
;
const
char
*
t
;
dest
=
strmov
(
dest
,
t
);
if
((
t
=
array_value
(
xmlmeta
,
*
p
)))
}
while
(
*
p
++
);
tee_fputs
(
t
,
PAGER
);
}
else
tee_putc
(
*
p
,
PAGER
);
static
void
}
my_chomp
(
char
*
end
)
{
}
char
*
mend
;
mend
=
end
;
do
{
if
(
isspace
(
*
mend
))
{
*
mend
=
'\0'
;
}
else
mend
--
;
}
while
(
mend
&&
*
mend
);
}
}
...
...
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