File tree Expand file tree Collapse file tree 5 files changed +119
-4
lines changed Expand file tree Collapse file tree 5 files changed +119
-4
lines changed Original file line number Diff line number Diff line change @@ -5830,5 +5830,44 @@ OCTET_LENGTH(a) a
5830
5830
255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
5831
5831
DROP TABLE t1;
5832
5832
#
5833
+ # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
5834
+ #
5835
+ #
5836
+ SET NAMES utf8;
5837
+ SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data;
5838
+ data
5839
+ 131072
5840
+ SELECT length(data) AS len FROM (
5841
+ SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data
5842
+ ) AS sub;
5843
+ len
5844
+ 131072
5845
+ SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data;
5846
+ data
5847
+ 131070
5848
+ SELECT length(data) AS len FROM (
5849
+ SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data
5850
+ ) AS sub;
5851
+ len
5852
+ 131070
5853
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub;
5854
+ len
5855
+ 73532
5856
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub;
5857
+ len
5858
+ 73534
5859
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub;
5860
+ len
5861
+ 73556
5862
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
5863
+ len
5864
+ 131070
5865
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
5866
+ len
5867
+ 131072
5868
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
5869
+ len
5870
+ 131074
5871
+ #
5833
5872
# End of 5.5 tests
5834
5873
#
Original file line number Diff line number Diff line change @@ -2622,6 +2622,40 @@ OCTET_LENGTH(a) a
2622
2622
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
2623
2623
DROP TABLE t1;
2624
2624
#
2625
+ # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
2626
+ #
2627
+ #
2628
+ SET NAMES utf8mb4;
2629
+ SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data;
2630
+ data
2631
+ 65532
2632
+ SELECT length(data) AS len
2633
+ FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub;
2634
+ len
2635
+ 65532
2636
+ SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data;
2637
+ data
2638
+ 65538
2639
+ SELECT length(data) AS len
2640
+ FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub;
2641
+ len
2642
+ 65538
2643
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub;
2644
+ len
2645
+ 65532
2646
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub;
2647
+ len
2648
+ 65535
2649
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
2650
+ len
2651
+ 65538
2652
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
2653
+ len
2654
+ 196605
2655
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
2656
+ len
2657
+ 196608
2658
+ #
2625
2659
# End of 5.5 tests
2626
2660
#
2627
2661
#
Original file line number Diff line number Diff line change @@ -1658,6 +1658,29 @@ ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
1658
1658
SELECT OCTET_LENGTH(a),a FROM t1;
1659
1659
DROP TABLE t1;
1660
1660
1661
+ --echo #
1662
+ --echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
1663
+ --echo #
1664
+ --echo #
1665
+
1666
+ SET NAMES utf8;
1667
+ SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data;
1668
+ SELECT length(data) AS len FROM (
1669
+ SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data
1670
+ ) AS sub;
1671
+
1672
+ SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data;
1673
+ SELECT length(data) AS len FROM (
1674
+ SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data
1675
+ ) AS sub;
1676
+
1677
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub;
1678
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub;
1679
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub;
1680
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
1681
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
1682
+ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
1683
+
1661
1684
--echo #
1662
1685
--echo # End of 5.5 tests
1663
1686
--echo #
Original file line number Diff line number Diff line change @@ -1838,6 +1838,26 @@ SELECT OCTET_LENGTH(a),a FROM t1;
1838
1838
DROP TABLE t1;
1839
1839
1840
1840
1841
+ --echo #
1842
+ --echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
1843
+ --echo #
1844
+ --echo #
1845
+
1846
+ SET NAMES utf8mb4;
1847
+ SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data;
1848
+ SELECT length(data) AS len
1849
+ FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub;
1850
+
1851
+ SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data;
1852
+ SELECT length(data) AS len
1853
+ FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub;
1854
+
1855
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub;
1856
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub;
1857
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
1858
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
1859
+ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
1860
+
1841
1861
--echo #
1842
1862
--echo # End of 5.5 tests
1843
1863
--echo #
Original file line number Diff line number Diff line change @@ -1854,10 +1854,9 @@ class Field_blob :public Field_longstr {
1854
1854
packlength= 4 ;
1855
1855
if (set_packlength)
1856
1856
{
1857
- uint32 l_char_length= len_arg/cs->mbmaxlen ;
1858
- packlength= l_char_length <= 255 ? 1 :
1859
- l_char_length <= 65535 ? 2 :
1860
- l_char_length <= 16777215 ? 3 : 4 ;
1857
+ packlength= len_arg <= 255 ? 1 :
1858
+ len_arg <= 65535 ? 2 :
1859
+ len_arg <= 16777215 ? 3 : 4 ;
1861
1860
}
1862
1861
}
1863
1862
Field_blob (uint32 packlength_arg)
You can’t perform that action at this time.
0 commit comments