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
02cf765f
Commit
02cf765f
authored
Dec 10, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.0
into gluh.mysql.r18.ru:/home/gluh/mysql-4.0.ssl
parents
2e4343c8
568d3a5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
5 deletions
+96
-5
client/mysqldump.c
client/mysqldump.c
+29
-5
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+48
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+19
-0
No files found.
client/mysqldump.c
View file @
02cf765f
...
...
@@ -1067,10 +1067,22 @@ static void dumpTable(uint numFields, char *table)
}
else
{
/* change any strings ("inf",
"nan",..
) into NULL */
/* change any strings ("inf",
"-inf", "nan"
) into NULL */
char
*
ptr
=
row
[
i
];
dynstr_append
(
&
extended_row
,
(
!
isalpha
(
*
ptr
))
?
ptr
:
"NULL"
);
if
(
isalpha
(
*
ptr
)
||
(
*
ptr
==
'-'
&&
*
(
ptr
+
1
)
==
'i'
))
dynstr_append
(
&
extended_row
,
"NULL"
);
else
{
if
(
field
->
type
==
FIELD_TYPE_DECIMAL
)
{
/* add " signs around */
dynstr_append
(
&
extended_row
,
"
\"
"
);
dynstr_append
(
&
extended_row
,
ptr
);
dynstr_append
(
&
extended_row
,
"
\"
"
);
}
else
dynstr_append
(
&
extended_row
,
ptr
);
}
}
}
else
...
...
@@ -1098,13 +1110,25 @@ static void dumpTable(uint numFields, char *table)
}
else
{
/* change any strings ("inf",
"nan",..
) into NULL */
/* change any strings ("inf",
"-inf", "nan"
) into NULL */
char
*
ptr
=
row
[
i
];
if
(
opt_xml
)
fprintf
(
md_result_file
,
"
\t\t
<field name=
\"
%s
\"
>%s</field>
\n
"
,
field
->
name
,
!
isalpha
(
*
ptr
)
?
ptr
:
"NULL"
);
else
if
(
isalpha
(
*
ptr
)
||
(
*
ptr
==
'-'
&&
*
(
ptr
+
1
)
==
'i'
))
fputs
(
"NULL"
,
md_result_file
);
else
fputs
((
!
isalpha
(
*
ptr
))
?
ptr
:
"NULL"
,
md_result_file
);
{
if
(
field
->
type
==
FIELD_TYPE_DECIMAL
)
{
/* add " signs around */
fputs
(
"
\"
"
,
md_result_file
);
fputs
(
ptr
,
md_result_file
);
fputs
(
"
\"
"
,
md_result_file
);
}
else
fputs
(
ptr
,
md_result_file
);
}
}
}
else
...
...
mysql-test/r/mysqldump.result
View file @
02cf765f
...
...
@@ -15,3 +15,51 @@ INSERT INTO t1 VALUES (1), (2);
</database>
</mysqldump>
DROP TABLE t1;
CREATE TABLE t1 (a decimal(240, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
-- MySQL dump 9.09
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 4.0.17-debug-log
--
-- Table structure for table `t1`
--
CREATE TABLE t1 (
a decimal(240,20) default NULL
) TYPE=MyISAM;
--
-- Dumping data for table `t1`
--
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890.00000000000000000000");
INSERT INTO t1 VALUES ("0987654321098765432109876543210987654321.00000000000000000000");
DROP TABLE t1;
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES (-9e999999);
-- MySQL dump 9.09
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 4.0.17-debug-log
--
-- Table structure for table `t1`
--
CREATE TABLE t1 (
a double default NULL
) TYPE=MyISAM;
--
-- Dumping data for table `t1`
--
INSERT INTO t1 VALUES (NULL);
DROP TABLE t1;
mysql-test/t/mysqldump.test
View file @
02cf765f
...
...
@@ -8,3 +8,22 @@ CREATE TABLE t1(a int);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
--
exec
$MYSQL_DUMP
-
X
test
t1
DROP
TABLE
t1
;
#
# Bug #2005
#
CREATE
TABLE
t1
(
a
decimal
(
240
,
20
));
INSERT
INTO
t1
VALUES
(
"1234567890123456789012345678901234567890"
),
(
"0987654321098765432109876543210987654321"
);
--
exec
$MYSQL_DUMP
test
t1
DROP
TABLE
t1
;
#
# Bug #2055
#
CREATE
TABLE
t1
(
a
double
);
INSERT
INTO
t1
VALUES
(
-
9
e999999
);
--
exec
$MYSQL_DUMP
test
t1
DROP
TABLE
t1
;
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