summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-07-14 15:13:23 +0400
committerkonstantin@mysql.com <>2005-07-14 15:13:23 +0400
commit62b8e6fdd153c62a1143a65be5b3c84d37bef890 (patch)
tree45790627120e94b2a70af285a897073369e66c2b
parentef1e748ef1d8ac2735222dae9e89d2a7edb99fc6 (diff)
downloadmariadb-git-62b8e6fdd153c62a1143a65be5b3c84d37bef890.tar.gz
A fix and a test case for Bug#9735.
No separate typecode for MEDIUMTEXT/LONGTEXT is added, as we have no sound decision yet what typecodes and for what types are sent by the server (aka what constitutes a distinct type in MySQL).
-rw-r--r--mysql-test/r/ps_2myisam.result20
-rw-r--r--mysql-test/r/ps_3innodb.result20
-rw-r--r--mysql-test/r/ps_4heap.result16
-rw-r--r--mysql-test/r/ps_5merge.result40
-rw-r--r--mysql-test/r/ps_6bdb.result20
-rw-r--r--mysql-test/r/ps_7ndb.result20
-rw-r--r--sql/field.cc4
-rw-r--r--tests/mysql_client_test.c31
8 files changed, 101 insertions, 70 deletions
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index c569c9842f7..4b655cfb854 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -77,8 +77,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -1812,17 +1812,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1830,8 +1830,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 930aea2e381..4d2a62887d6 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -77,8 +77,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -1795,17 +1795,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1813,8 +1813,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 083a4b221fe..a4919b664c4 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1796,17 +1796,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1814,8 +1814,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 1edd617ffc6..f98cc1b3cdf 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -120,8 +120,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -1732,17 +1732,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1750,8 +1750,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
@@ -3134,8 +3134,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -4746,17 +4746,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -4764,8 +4764,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 06be8750cc4..acd7f45de95 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -77,8 +77,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -1795,17 +1795,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1813,8 +1813,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index f5750d947b5..27a1ea0925d 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -77,8 +77,8 @@ def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63
-def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
def test t9 t9 c31 c31 254 5 3 Y 256 0 8
def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
@@ -1795,17 +1795,17 @@ def test t5 t5 param02 param02 5 20 1 Y 32768 31 63
def test t5 t5 const03 const03 5 23 1 N 32769 31 63
def test t5 t5 param03 param03 5 20 1 Y 32768 31 63
def test t5 t5 const04 const04 254 3 3 N 1 0 8
-def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
def test t5 t5 const05 const05 254 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
@@ -1813,8 +1813,8 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
-def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
-def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
+def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
param01 8
const02 8.0
diff --git a/sql/field.cc b/sql/field.cc
index 64d5babd159..39a99830b14 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -47,6 +47,8 @@ uchar Field_null::null[1]={1};
const char field_separator=',';
#define DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE 320
+#define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
+((ulong) ((LL(1) << min(arg, 4) * 8) - LL(1)))
/*
Rules for merging different types of fields in UNION
@@ -5445,7 +5447,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length,
CHARSET_INFO *cs)
- :Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
+ :Field_str(ptr_arg, BLOB_PACK_LENGTH_TO_MAX_LENGH(blob_pack_length),
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
table_arg, cs),
packlength(blob_pack_length)
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index dbee6e77e4f..f874276a656 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -672,7 +672,7 @@ static void verify_prepare_field(MYSQL_RES *result,
fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)",
field->org_table, org_table);
fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db);
- fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)",
+ fprintf(stdout, "\n length :`%lu`\t(expected: `%lu`)",
field->length, length * cs->mbmaxlen);
fprintf(stdout, "\n maxlength:`%ld`", field->max_length);
fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr);
@@ -11670,6 +11670,34 @@ static void test_bug8378()
#endif
}
+
+/* Test correct max length for MEDIUMTEXT and LONGTEXT columns */
+
+static void test_bug9735()
+{
+ MYSQL_RES *res;
+ int rc;
+
+ myheader("test_bug9735");
+
+ rc= mysql_query(mysql, "drop table if exists t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "create table t1 (a mediumtext, b longtext) "
+ "character set latin1");
+ myquery(rc);
+ rc= mysql_query(mysql, "select * from t1");
+ myquery(rc);
+ res= mysql_store_result(mysql);
+ verify_prepare_field(res, 0, "a", "a", MYSQL_TYPE_BLOB,
+ "t1", "t1", current_db, (1U << 24)-1, 0);
+ verify_prepare_field(res, 1, "b", "b", MYSQL_TYPE_BLOB,
+ "t1", "t1", current_db, ~0U, 0);
+ mysql_free_result(res);
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -11884,6 +11912,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug8330", test_bug8330 },
{ "test_bug7990", test_bug7990 },
{ "test_bug8378", test_bug8378 },
+ { "test_bug9735", test_bug9735 },
{ 0, 0 }
};