Changeset: d277bfa0ba02 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d277bfa0ba02
Modified Files:
sql/common/sql_types.c
sql/server/sql_qc.c
sql/test/ADT2006/Tests/bram.stable.out
sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
sql/test/Skyserver/Tests/Skyserver.stable.out
sql/test/Tests/str-pad.stable.out
sql/test/Tests/str-trim.stable.out
sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_JdbcClient.stable.out
sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
sql/test/pg_regress/Tests/strings.stable.out
Branch: Jul2015
Log Message:
make sure fix char strings types are only equal if the length is the same.
diffs (truncated from 335 to 300 lines):
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -366,6 +366,8 @@ is_subtype(sql_subtype *sub, sql_subtype
if (super->digits == 0 && super->type->eclass == EC_STRING &&
(sub->type->eclass == EC_STRING || sub->type->eclass == EC_CHAR))
return 1;
+ if (super->digits != sub->digits && sub->type->eclass == EC_CHAR)
+ return 0;
/* subtypes are only equal iff
they map onto the same systemtype */
return (type_cmp(sub->type, super->type) == 0);
diff --git a/sql/server/sql_qc.c b/sql/server/sql_qc.c
--- a/sql/server/sql_qc.c
+++ b/sql/server/sql_qc.c
@@ -169,7 +169,11 @@ param_list_cmp(sql_subtype *typelist, at
if (!atom_null(a) && param_cmp(tp, atom_type(a)) != 0) {
sql_subtype *at = atom_type(a);
- if (EC_VARCHAR(tp->type->eclass) &&
+ if (tp->type->eclass == EC_CHAR &&
+ at->type->eclass == EC_CHAR &&
+ (!tp->digits || tp->digits == at->digits))
+ continue;
+ if (tp->type->eclass == EC_STRING &&
at->type->eclass == EC_CHAR &&
(!tp->digits || tp->digits >= at->digits))
continue;
diff --git a/sql/test/ADT2006/Tests/bram.stable.out
b/sql/test/ADT2006/Tests/bram.stable.out
--- a/sql/test/ADT2006/Tests/bram.stable.out
+++ b/sql/test/ADT2006/Tests/bram.stable.out
@@ -475,7 +475,7 @@ Ready.
# + cast(substring(length from (position('\'' in length) + 1) for
(position('"' in length) - position('\'' in length) - 1)) AS integer)) as
height from victim v
% .L24, .L24 # table_name
% L4, average_height # name
-% char, char # type
+% char, varchar # type
% 6, 4 # length
[ "blonde", "5'7\"" ]
[ "brown", "5'5\"" ]
diff --git a/sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
b/sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
--- a/sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
+++ b/sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
@@ -109,7 +109,7 @@ Ready.
% .L # table_name
% single_value # name
% char # type
-% 31 # length
+% 15 # length
[ "dropping kwTemp" ]
#DROP TABLE kwTemp;
#COMMIT;
@@ -131,7 +131,7 @@ Ready.
% .L # table_name
% single_value # name
% char # type
-% 27 # length
+% 16 # length
[ "dropping kwmTemp" ]
#DROP TABLE kwmTemp;
#COMMIT;
diff --git a/sql/test/Skyserver/Tests/Skyserver.stable.out
b/sql/test/Skyserver/Tests/Skyserver.stable.out
--- a/sql/test/Skyserver/Tests/Skyserver.stable.out
+++ b/sql/test/Skyserver/Tests/Skyserver.stable.out
@@ -121,7 +121,7 @@ tables
% .L # table_name
% single_value # name
% char # type
-% 14 # length
+% 8 # length
[ "ALL DONE" ]
views
functions
diff --git a/sql/test/Tests/str-pad.stable.out
b/sql/test/Tests/str-pad.stable.out
--- a/sql/test/Tests/str-pad.stable.out
+++ b/sql/test/Tests/str-pad.stable.out
@@ -55,74 +55,74 @@ Ready.
#SELECT '#' || lpad('hi', 7) || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "# hi#" ]
#SELECT '#' || lpad('hixyäbcdef', 7) || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#hixyäbc#" ]
#SELECT '#' || lpad('hi', 7, 'xya') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#xyaxyhi#" ]
#SELECT '#' || lpad('hi', 7, 'xyä') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#xyäxyhi#" ]
#SELECT '#' || lpad('hi', 7, 'xyäbcdef') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 10 # length
[ "#xy颖äbhi#" ]
#SELECT '#' || lpad('hi颖xyäbcdef', 7, 'lmn') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 10 # length
[ "#hi颖xyäb#" ]
#SELECT '#' || rpad('hi', 7) || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#hi #" ]
#SELECT '#' || rpad('hixyäbcdef', 7) || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#hixyäbc#" ]
#SELECT '#' || rpad('hi', 7, 'xya') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#hixyaxy#" ]
#SELECT '#' || rpad('hi', 7, 'xyä') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 9 # length
[ "#hixyäxy#" ]
#SELECT '#' || rpad('hi', 7, 'xyäbcdef') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 10 # length
[ "#hixy颖äb#" ]
#SELECT '#' || rpad('hi颖xyäbcdef', 7, 'lmn') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 10 # length
[ "#hi颖xyäb#" ]
#CREATE TABLE p (s VARCHAR(20), n int);
#INSERT INTO p VALUES ('hi', 10), ('hixyäbcdef', 7);
diff --git a/sql/test/Tests/str-trim.stable.out
b/sql/test/Tests/str-trim.stable.out
--- a/sql/test/Tests/str-trim.stable.out
+++ b/sql/test/Tests/str-trim.stable.out
@@ -55,56 +55,56 @@ Ready.
#SELECT '#' || trim('zzzytrimxxxx', 'zyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || trim('zzëzytrimxxëxx', 'zëyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || trim('zzë颖zytrimxx颖ëxx', 'zëy颖x') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || ltrim('zzzytrim', 'zyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || ltrim('zzëzytrim', 'zëyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || ltrim('zzë颖zytrim', 'zëy颖x') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || rtrim('trimxxxx', 'zyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || rtrim('trimxxëxx', 'zëyx') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#SELECT '#' || rtrim('trimxx颖ëxx', 'zëy颖x') || '#';
% .L # table_name
% concat_single_value # name
-% char # type
-% 0 # length
+% varchar # type
+% 6 # length
[ "#trim#" ]
#CREATE TABLE t (s VARCHAR(20), s2 VARCHAR(10));
#INSERT INTO t VALUES ('zzzytrimxxxx', 'zyx'), ('zzëzytrimxxëxx', 'zëyx'),
('zzë颖zytrimxx颖ëxx', 'zëy颖x');
diff --git
a/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_JdbcClient.stable.out
b/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_JdbcClient.stable.out
--- a/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_JdbcClient.stable.out
+++ b/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_JdbcClient.stable.out
@@ -37,11 +37,11 @@ Ready.
+--------------------------------------------------------------------------------------------------------------------------------+
1 row
-+--------------------------------------------------------------------------------------------------------------------------------+
++-----------------------+
| single_value
|
-+================================================================================================================================+
++=======================+
| SAVE 25¢ ON ICE CREAM
|
-+--------------------------------------------------------------------------------------------------------------------------------+
++-----------------------+
1 row
diff --git
a/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
b/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
--- a/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
+++ b/sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
@@ -35,7 +35,7 @@ Ready.
% .L # table_name
% single_value # name
% char # type
-% 126 # length
+% 21 # length
[ "SAVE 25¢ ON ICE CREAM" ]
# 12:55:03 >
diff --git a/sql/test/pg_regress/Tests/strings.stable.out
b/sql/test/pg_regress/Tests/strings.stable.out
--- a/sql/test/pg_regress/Tests/strings.stable.out
+++ b/sql/test/pg_regress/Tests/strings.stable.out
@@ -528,7 +528,7 @@ Ready.
#SELECT 'unknown' || ' and unknown' AS "Concat unknown types";
% .L # table_name
% Concat unknown types # name
-% char # type
+% varchar # type
% 19 # length
[ "unknown and unknown" ]
#SELECT cast('text' as text) || ' and unknown' AS "Concat text to unknown
type";
@@ -540,8 +540,8 @@ Ready.
#SELECT cast('characters' as char(20)) || ' and text' AS "Concat char to
unknown type";
% .L1 # table_name
% Concat char to unknown type # name
-% char # type
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list