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
ebc6e02d
Commit
ebc6e02d
authored
May 13, 2008
by
gshchepa/uchum@host.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge host.loc:/work/bugs/5.0-bugteam-30059
into host.loc:/work/bk/5.1-bugteam
parents
45e796d5
1c45081b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
15 deletions
+14
-15
mysql-test/r/heap.result
mysql-test/r/heap.result
+0
-1
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+0
-1
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+0
-1
mysql-test/r/strict.result
mysql-test/r/strict.result
+0
-2
mysql-test/r/type_binary.result
mysql-test/r/type_binary.result
+0
-1
mysql-test/r/warnings.result
mysql-test/r/warnings.result
+0
-2
sql/field.cc
sql/field.cc
+12
-6
sql/field.h
sql/field.h
+2
-1
No files found.
mysql-test/r/heap.result
View file @
ebc6e02d
...
...
@@ -256,7 +256,6 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+ *+*+ *
...
...
mysql-test/r/innodb.result
View file @
ebc6e02d
...
...
@@ -1836,7 +1836,6 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+
*+*+ *
...
...
mysql-test/r/myisam.result
View file @
ebc6e02d
...
...
@@ -1086,7 +1086,6 @@ set @a=repeat(' ',20);
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
Warnings:
Note 1265 Data truncated for column 'v' at row 1
Note 1265 Data truncated for column 'c' at row 1
select concat('*',v,'*',c,'*',t,'*') from t1;
concat('*',v,'*',c,'*',t,'*')
*+
*+*+ *
...
...
mysql-test/r/strict.result
View file @
ebc6e02d
...
...
@@ -933,8 +933,6 @@ NULL NULL
DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
Warnings:
Note 1265 Data truncated for column 'col1' at row 3
INSERT INTO t1 (col1) VALUES ('hellobob');
ERROR 22001: Data too long for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('hellobob');
...
...
mysql-test/r/type_binary.result
View file @
ebc6e02d
...
...
@@ -125,7 +125,6 @@ create table t1 (c char(2), vc varchar(2));
insert into t1 values(0x4120, 0x4120);
insert into t1 values(0x412020, 0x412020);
Warnings:
Note 1265 Data truncated for column 'c' at row 1
Note 1265 Data truncated for column 'vc' at row 1
drop table t1;
set @old_sql_mode= @@sql_mode, sql_mode= 'traditional';
...
...
mysql-test/r/warnings.result
View file @
ebc6e02d
...
...
@@ -283,7 +283,6 @@ set @q = repeat('q', 256);
set sql_mode = '';
insert into t1 values(@c, @c, @c);
Warnings:
Note 1265 Data truncated for column 'c_char' at row 1
Note 1265 Data truncated for column 'c_varchar' at row 1
Note 1265 Data truncated for column 'c_tinytext' at row 1
insert into t2 values(@c);
...
...
@@ -300,7 +299,6 @@ Warning 1265 Data truncated for column 'c_tinyblob' at row 1
set sql_mode = 'traditional';
insert into t1 values(@c, @c, @c);
Warnings:
Note 1265 Data truncated for column 'c_char' at row 1
Note 1265 Data truncated for column 'c_varchar' at row 1
Note 1265 Data truncated for column 'c_tinytext' at row 1
insert into t2 values(@c);
...
...
sql/field.cc
View file @
ebc6e02d
...
...
@@ -6328,6 +6328,7 @@ check_string_copy_error(Field_str *field,
Field_longstr::report_if_important_data()
ptr - Truncated rest of string
end - End of truncated string
count_spaces - Treat traling spaces as important data
RETURN VALUES
0 - None was truncated (or we don't count cut fields)
...
...
@@ -6337,10 +6338,12 @@ check_string_copy_error(Field_str *field,
Check if we lost any important data (anything in a binary string,
or any non-space in others). If only trailing spaces was lost,
send a truncation note, otherwise send a truncation error.
Silently ignore traling spaces if the count_space parameter is FALSE.
*/
int
Field_longstr
::
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
)
Field_longstr
::
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
,
bool
count_spaces
)
{
if
((
ptr
<
end
)
&&
table
->
in_use
->
count_cuted_fields
)
{
...
...
@@ -6350,10 +6353,13 @@ Field_longstr::report_if_important_data(const char *ptr, const char *end)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
ER_DATA_TOO_LONG
,
1
);
else
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
return
2
;
}
else
/* If we lost only spaces then produce a NOTE, not a WARNING */
else
if
(
count_spaces
)
{
/* If we lost only spaces then produce a NOTE, not a WARNING */
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
WARN_DATA_TRUNCATED
,
1
);
return
2
;
return
2
;
}
}
return
0
;
}
...
...
@@ -6390,7 +6396,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
cannot_convert_error_pos
,
from
+
length
,
cs
))
return
2
;
return
report_if_important_data
(
from_end_pos
,
from
+
length
);
return
report_if_important_data
(
from_end_pos
,
from
+
length
,
FALSE
);
}
...
...
@@ -6965,7 +6971,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
cannot_convert_error_pos
,
from
+
length
,
cs
))
return
2
;
return
report_if_important_data
(
from_end_pos
,
from
+
length
);
return
report_if_important_data
(
from_end_pos
,
from
+
length
,
TRUE
);
}
...
...
@@ -7669,7 +7675,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
cannot_convert_error_pos
,
from
+
length
,
cs
))
return
2
;
return
report_if_important_data
(
from_end_pos
,
from
+
length
);
return
report_if_important_data
(
from_end_pos
,
from
+
length
,
TRUE
);
oom_error:
/* Fatal OOM error */
...
...
sql/field.h
View file @
ebc6e02d
...
...
@@ -594,7 +594,8 @@ class Field_str :public Field {
class
Field_longstr
:
public
Field_str
{
protected:
int
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
);
int
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
,
bool
count_spaces
);
public:
Field_longstr
(
uchar
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
utype
unireg_check_arg
,
...
...
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