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
477776bf
Commit
477776bf
authored
Jun 03, 2022
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
This is a 10.7 version of the patch.
parent
712b443a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
2 deletions
+76
-2
plugin/type_inet/mysql-test/type_inet/type_inet6.result
plugin/type_inet/mysql-test/type_inet/type_inet6.result
+19
-0
plugin/type_inet/mysql-test/type_inet/type_inet6.test
plugin/type_inet/mysql-test/type_inet/type_inet6.test
+17
-0
plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
+19
-0
plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
+18
-0
sql/sql_type_fixedbin.h
sql/sql_type_fixedbin.h
+3
-2
No files found.
plugin/type_inet/mysql-test/type_inet/type_inet6.result
View file @
477776bf
...
@@ -2194,3 +2194,22 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
...
@@ -2194,3 +2194,22 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
f
f
::
::
DROP TABLE t1;
DROP TABLE t1;
#
# MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
#
CREATE TABLE companies (id INET6, name varchar(10));
INSERT INTO companies (id) values ('00::01');
CREATE TABLE divisions (company_id INET6);
INSERT INTO divisions (company_id) values ('00::01');
SELECT * FROM companies WHERE id IN (SELECT company_id FROM divisions);
id name
::1 NULL
UPDATE companies SET name = 'value' WHERE id IN (SELECT company_id FROM divisions);
SELECT * FROM companies;
id name
::1 value
DELETE FROM companies WHERE id IN (SELECT company_id FROM divisions);
SELECT * FROM companies;
id name
DROP TABLE divisions;
DROP TABLE companies;
plugin/type_inet/mysql-test/type_inet/type_inet6.test
View file @
477776bf
...
@@ -1612,3 +1612,20 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
...
@@ -1612,3 +1612,20 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
SELECT
IF
(
1
,
'::'
,
a
)
AS
f
FROM
t1
GROUP
BY
'foo'
HAVING
f
!=
'::'
;
SELECT
IF
(
1
,
'::'
,
a
)
AS
f
FROM
t1
GROUP
BY
'foo'
HAVING
f
!=
'::'
;
SELECT
IF
(
1
,
'::'
,
a
)
AS
f
FROM
t1
GROUP
BY
'foo'
HAVING
f
!=
'::1'
;
SELECT
IF
(
1
,
'::'
,
a
)
AS
f
FROM
t1
GROUP
BY
'foo'
HAVING
f
!=
'::1'
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
--
echo
#
CREATE
TABLE
companies
(
id
INET6
,
name
varchar
(
10
));
INSERT
INTO
companies
(
id
)
values
(
'00::01'
);
CREATE
TABLE
divisions
(
company_id
INET6
);
INSERT
INTO
divisions
(
company_id
)
values
(
'00::01'
);
SELECT
*
FROM
companies
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
UPDATE
companies
SET
name
=
'value'
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
SELECT
*
FROM
companies
;
DELETE
FROM
companies
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
SELECT
*
FROM
companies
;
DROP
TABLE
divisions
;
DROP
TABLE
companies
;
plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
View file @
477776bf
...
@@ -3152,3 +3152,22 @@ f var_pop('x')
...
@@ -3152,3 +3152,22 @@ f var_pop('x')
Warnings:
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Incorrect uuid value: ''
Warning 1292 Incorrect uuid value: ''
#
# MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
#
CREATE TABLE companies (id uuid, name varchar(10));
INSERT INTO companies (id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
CREATE TABLE divisions (company_id uuid);
INSERT INTO divisions (company_id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
SELECT * FROM companies WHERE id IN (SELECT company_id FROM divisions);
id name
7bc95b06-cc6c-11ec-96c5-0242ac130002 NULL
UPDATE companies SET name = 'value' WHERE id IN (SELECT company_id FROM divisions);
SELECT * FROM companies;
id name
7bc95b06-cc6c-11ec-96c5-0242ac130002 value
DELETE FROM companies WHERE id IN (SELECT company_id FROM divisions);
SELECT * FROM companies;
id name
DROP TABLE divisions;
DROP TABLE companies;
plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
View file @
477776bf
...
@@ -1652,3 +1652,21 @@ DROP TABLE t1;
...
@@ -1652,3 +1652,21 @@ DROP TABLE t1;
--
echo
#
--
echo
#
SELECT
uuid
()
AS
f
,
var_pop
(
'x'
)
FROM
dual
HAVING
f
>
''
;
SELECT
uuid
()
AS
f
,
var_pop
(
'x'
)
FROM
dual
HAVING
f
>
''
;
--
echo
#
--
echo
# MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
--
echo
#
CREATE
TABLE
companies
(
id
uuid
,
name
varchar
(
10
));
INSERT
INTO
companies
(
id
)
values
(
'7bc95b06-cc6c-11ec-96c5-0242ac130002'
);
CREATE
TABLE
divisions
(
company_id
uuid
);
INSERT
INTO
divisions
(
company_id
)
values
(
'7bc95b06-cc6c-11ec-96c5-0242ac130002'
);
SELECT
*
FROM
companies
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
UPDATE
companies
SET
name
=
'value'
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
SELECT
*
FROM
companies
;
DELETE
FROM
companies
WHERE
id
IN
(
SELECT
company_id
FROM
divisions
);
SELECT
*
FROM
companies
;
DROP
TABLE
divisions
;
DROP
TABLE
companies
;
sql/sql_type_fixedbin.h
View file @
477776bf
...
@@ -1589,8 +1589,9 @@ class FixedBinTypeBundle
...
@@ -1589,8 +1589,9 @@ class FixedBinTypeBundle
if
(
!
example
)
if
(
!
example
)
return
false
;
return
false
;
value_cached
=
true
;
value_cached
=
true
;
null_value
=
example
->
val_native_with_conversion_result
(
current_thd
,
null_value_inside
=
null_value
=
&
m_value
,
type_handler
());
example
->
val_native_with_conversion_result
(
current_thd
,
&
m_value
,
type_handler
());
return
true
;
return
true
;
}
}
String
*
val_str
(
String
*
to
)
String
*
val_str
(
String
*
to
)
...
...
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