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
721ec081
Commit
721ec081
authored
May 07, 2010
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for Bug#52357
parents
0c82d3f3
278ae9a8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
182 additions
and
4 deletions
+182
-4
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+30
-0
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+15
-0
mysql-test/r/outfile_loaddata.result
mysql-test/r/outfile_loaddata.result
+20
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+30
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+29
-0
mysql-test/t/outfile_loaddata.test
mysql-test/t/outfile_loaddata.test
+34
-0
sql/sql_class.cc
sql/sql_class.cc
+23
-2
sql/sql_select.cc
sql/sql_select.cc
+1
-2
No files found.
mysql-test/r/innodb_mysql.result
View file @
721ec081
...
...
@@ -2378,4 +2378,34 @@ SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
SECOND(c)-@bug47453
0
DROP TABLE t1, t2;
#
# Bug #53334: wrong result for outer join with impossible ON condition
# (see the same test case for MyISAM in join.test)
#
CREATE TABLE t1 (id INT PRIMARY KEY);
CREATE TABLE t2 (id INT);
INSERT INTO t1 VALUES (75);
INSERT INTO t1 VALUES (79);
INSERT INTO t1 VALUES (78);
INSERT INTO t1 VALUES (77);
REPLACE INTO t1 VALUES (76);
REPLACE INTO t1 VALUES (76);
INSERT INTO t1 VALUES (104);
INSERT INTO t1 VALUES (103);
INSERT INTO t1 VALUES (102);
INSERT INTO t1 VALUES (101);
INSERT INTO t1 VALUES (105);
INSERT INTO t1 VALUES (106);
INSERT INTO t1 VALUES (107);
INSERT INTO t2 VALUES (107),(75),(1000);
SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
WHERE t2.id=75 AND t1.id IS NULL;
id id
NULL 75
EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
WHERE t2.id=75 AND t1.id IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
DROP TABLE t1,t2;
End of 5.1 tests
mysql-test/r/mysqldump.result
View file @
721ec081
...
...
@@ -4561,5 +4561,20 @@ a b c
SET NAMES default;
DROP TABLE t1, t2;
#
# Bug #53088: mysqldump with -T & --default-character-set set
# truncates text/blob to 766 chars
#
# Also see outfile_loaddata.test
#
CREATE TABLE t1 (a BLOB) CHARSET latin1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES (REPEAT('.', 800));
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET latin1;
# should be 800
SELECT LENGTH(a) FROM t2;
LENGTH(a)
800
DROP TABLE t1, t2;
#
# End of 5.1 tests
#
mysql-test/r/outfile_loaddata.result
View file @
721ec081
...
...
@@ -239,4 +239,24 @@ a b c
2 NULL NULL
SET NAMES default;
DROP TABLE t1, t2;
#
# Bug #53088: mysqldump with -T & --default-character-set set
# truncates text/blob to 766 chars
#
# Also see mysqldump.test
#
CREATE TABLE t1 (a BLOB) CHARSET latin1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES (REPEAT('.', 800));
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' CHARACTER SET latin1 FROM t1;
# should be greater than 800
SELECT LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt'));
LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt'))
801
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' INTO TABLE t2;
# should be 800
SELECT LENGTH(a) FROM t2;
LENGTH(a)
800
DROP TABLE t1, t2;
# End of 5.1 tests.
mysql-test/t/innodb_mysql.test
View file @
721ec081
...
...
@@ -618,5 +618,35 @@ SELECT SECOND(c)-@bug47453 FROM t1 JOIN t2 ON d=a;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug #53334: wrong result for outer join with impossible ON condition
--
echo
# (see the same test case for MyISAM in join.test)
--
echo
#
CREATE
TABLE
t1
(
id
INT
PRIMARY
KEY
);
CREATE
TABLE
t2
(
id
INT
);
INSERT
INTO
t1
VALUES
(
75
);
INSERT
INTO
t1
VALUES
(
79
);
INSERT
INTO
t1
VALUES
(
78
);
INSERT
INTO
t1
VALUES
(
77
);
REPLACE
INTO
t1
VALUES
(
76
);
REPLACE
INTO
t1
VALUES
(
76
);
INSERT
INTO
t1
VALUES
(
104
);
INSERT
INTO
t1
VALUES
(
103
);
INSERT
INTO
t1
VALUES
(
102
);
INSERT
INTO
t1
VALUES
(
101
);
INSERT
INTO
t1
VALUES
(
105
);
INSERT
INTO
t1
VALUES
(
106
);
INSERT
INTO
t1
VALUES
(
107
);
INSERT
INTO
t2
VALUES
(
107
),(
75
),(
1000
);
SELECT
t1
.
id
,
t2
.
id
FROM
t2
LEFT
JOIN
t1
ON
t1
.
id
>=
74
AND
t1
.
id
<=
0
WHERE
t2
.
id
=
75
AND
t1
.
id
IS
NULL
;
EXPLAIN
SELECT
t1
.
id
,
t2
.
id
FROM
t2
LEFT
JOIN
t1
ON
t1
.
id
>=
74
AND
t1
.
id
<=
0
WHERE
t2
.
id
=
75
AND
t1
.
id
IS
NULL
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
mysql-test/t/mysqldump.test
View file @
721ec081
...
...
@@ -2131,6 +2131,35 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
SET
NAMES
default
;
DROP
TABLE
t1
,
t2
;
###########################################################################
--
echo
#
--
echo
# Bug #53088: mysqldump with -T & --default-character-set set
--
echo
# truncates text/blob to 766 chars
--
echo
#
--
echo
# Also see outfile_loaddata.test
--
echo
#
CREATE
TABLE
t1
(
a
BLOB
)
CHARSET
latin1
;
CREATE
TABLE
t2
LIKE
t1
;
let
$table
=
t1
;
let
$dir
=
$MYSQLTEST_VARDIR
/
tmp
;
let
$file
=
$dir
/
$table
.
txt
;
let
$length
=
800
;
--
eval
INSERT
INTO
t1
VALUES
(
REPEAT
(
'.'
,
$length
))
--
exec
$MYSQL_DUMP
--
character
-
sets
-
dir
=
$CHARSETSDIR
--
default
-
character
-
set
=
latin1
--
tab
=
$dir
/
test
$table
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
eval
LOAD
DATA
INFILE
'$file'
INTO
TABLE
t2
CHARACTER
SET
latin1
--
remove_file
$file
--
echo
# should be $length
SELECT
LENGTH
(
a
)
FROM
t2
;
DROP
TABLE
t1
,
t2
;
###########################################################################
...
...
mysql-test/t/outfile_loaddata.test
View file @
721ec081
...
...
@@ -251,6 +251,40 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
SET
NAMES
default
;
DROP
TABLE
t1
,
t2
;
###########################################################################
--
echo
#
--
echo
# Bug #53088: mysqldump with -T & --default-character-set set
--
echo
# truncates text/blob to 766 chars
--
echo
#
--
echo
# Also see mysqldump.test
--
echo
#
CREATE
TABLE
t1
(
a
BLOB
)
CHARSET
latin1
;
CREATE
TABLE
t2
LIKE
t1
;
let
$file
=
'$MYSQLTEST_VARDIR/tmp/bug53088.txt'
;
let
$length
=
800
;
--
eval
INSERT
INTO
t1
VALUES
(
REPEAT
(
'.'
,
$length
))
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
eval
SELECT
*
INTO
OUTFILE
$file
CHARACTER
SET
latin1
FROM
t1
--
echo
# should be greater than $length
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
eval
SELECT
LENGTH
(
LOAD_FILE
(
$file
))
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
eval
LOAD
DATA
INFILE
$file
INTO
TABLE
t2
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug53088
.
txt
--
echo
# should be $length
SELECT
LENGTH
(
a
)
FROM
t2
;
DROP
TABLE
t1
,
t2
;
###########################################################################
--
echo
# End of 5.1 tests.
sql/sql_class.cc
View file @
721ec081
...
...
@@ -1998,9 +1998,21 @@ bool select_export::send_data(List<Item> &items)
const
char
*
from_end_pos
;
const
char
*
error_pos
;
uint32
bytes
;
bytes
=
well_formed_copy_nchars
(
write_cs
,
cvt_buff
,
sizeof
(
cvt_buff
),
uint64
estimated_bytes
=
((
uint64
)
res
->
length
()
/
res
->
charset
()
->
mbminlen
+
1
)
*
write_cs
->
mbmaxlen
+
1
;
set_if_smaller
(
estimated_bytes
,
UINT_MAX32
);
if
(
cvt_str
.
realloc
((
uint32
)
estimated_bytes
))
{
my_error
(
ER_OUTOFMEMORY
,
MYF
(
0
),
(
uint32
)
estimated_bytes
);
goto
err
;
}
bytes
=
well_formed_copy_nchars
(
write_cs
,
(
char
*
)
cvt_str
.
ptr
(),
cvt_str
.
alloced_length
(),
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
sizeof
(
cvt_buff
),
UINT_MAX32
,
// copy all input chars,
// i.e. ignore nchars parameter
&
well_formed_error_pos
,
&
cannot_convert_error_pos
,
&
from_end_pos
);
...
...
@@ -2018,6 +2030,15 @@ bool select_export::send_data(List<Item> &items)
"string"
,
printable_buff
,
item
->
name
,
row_count
);
}
else
if
(
from_end_pos
<
res
->
ptr
()
+
res
->
length
())
{
/*
result is longer than UINT_MAX32 and doesn't fit into String
*/
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
ER
(
WARN_DATA_TRUNCATED
),
item
->
full_name
(),
row_count
);
}
cvt_str
.
length
(
bytes
);
res
=
&
cvt_str
;
}
...
...
sql/sql_select.cc
View file @
721ec081
...
...
@@ -2967,8 +2967,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
s
->
quick
=
select
->
quick
;
s
->
needed_reg
=
select
->
needed_reg
;
select
->
quick
=
0
;
if
(
records
==
0
&&
s
->
table
->
reginfo
.
impossible_range
&&
(
s
->
table
->
file
->
ha_table_flags
()
&
HA_STATS_RECORDS_IS_EXACT
))
if
(
records
==
0
&&
s
->
table
->
reginfo
.
impossible_range
)
{
/*
Impossible WHERE or ON expression
...
...
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