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
8748cde9
Commit
8748cde9
authored
18 years ago
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into mysql.com:/usr/home/bar/mysql-5.1-rpl
parents
506b97fd
45ac1365
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
413 additions
and
145 deletions
+413
-145
BitKeeper/etc/collapsed
BitKeeper/etc/collapsed
+1
-0
mysql-test/include/strict_autoinc.inc
mysql-test/include/strict_autoinc.inc
+4
-0
mysql-test/r/ctype_recoding.result
mysql-test/r/ctype_recoding.result
+2
-2
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+3
-3
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+4
-4
mysql-test/r/strict_autoinc_1myisam.result
mysql-test/r/strict_autoinc_1myisam.result
+1
-0
mysql-test/r/strict_autoinc_2innodb.result
mysql-test/r/strict_autoinc_2innodb.result
+1
-0
mysql-test/r/strict_autoinc_3heap.result
mysql-test/r/strict_autoinc_3heap.result
+1
-0
mysql-test/r/strict_autoinc_4bdb.result
mysql-test/r/strict_autoinc_4bdb.result
+1
-0
mysql-test/r/strict_autoinc_5ndb.result
mysql-test/r/strict_autoinc_5ndb.result
+1
-0
sql/field.cc
sql/field.cc
+217
-136
sql/log.cc
sql/log.cc
+12
-0
sql/sql_string.cc
sql/sql_string.cc
+156
-0
sql/sql_string.h
sql/sql_string.h
+8
-0
strings/ctype-utf8.c
strings/ctype-utf8.c
+1
-0
No files found.
BitKeeper/etc/collapsed
View file @
8748cde9
...
@@ -7,3 +7,4 @@
...
@@ -7,3 +7,4 @@
4513d8e4Af4dQWuk13sArwofRgFDQw
4513d8e4Af4dQWuk13sArwofRgFDQw
4519a6c5BVUxEHTf5iJnjZkixMBs8g
4519a6c5BVUxEHTf5iJnjZkixMBs8g
451ab499rgdjXyOnUDqHu-wBDoS-OQ
451ab499rgdjXyOnUDqHu-wBDoS-OQ
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
This diff is collapsed.
Click to expand it.
mysql-test/include/strict_autoinc.inc
View file @
8748cde9
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
# Test for strict-mode autoincrement
# Test for strict-mode autoincrement
#
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
set
@
org_mode
=@@
sql_mode
;
set
@
org_mode
=@@
sql_mode
;
eval
create
table
t1
eval
create
table
t1
(
(
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/ctype_recoding.result
View file @
8748cde9
...
@@ -171,8 +171,8 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r);
...
@@ -171,8 +171,8 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
insert into t1 values ('test','test');
insert into t1 values ('','');
insert into t1 values ('','');
Warnings:
Warnings:
Warning 1
265 Data truncated
for column 'a' at row 1
Warning 1
366 Incorrect string value: '\xCA\xC3\xD5\xCB'
for column 'a' at row 1
Warning 1
265 Data truncated
for column 'b' at row 1
Warning 1
366 Incorrect string value: '\xCA\xC3\xD5\xCB'
for column 'b' at row 1
drop table t1;
drop table t1;
set names koi8r;
set names koi8r;
create table t1 (a char(10) character set cp1251);
create table t1 (a char(10) character set cp1251);
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/ctype_utf8.result
View file @
8748cde9
...
@@ -197,7 +197,7 @@ drop table t1;
...
@@ -197,7 +197,7 @@ drop table t1;
create table t1 (s1 char(10) character set utf8);
create table t1 (s1 char(10) character set utf8);
insert into t1 values (0x41FF);
insert into t1 values (0x41FF);
Warnings:
Warnings:
Warning 1
265 Data truncated
for column 's1' at row 1
Warning 1
366 Incorrect string value: '\xFF'
for column 's1' at row 1
select hex(s1) from t1;
select hex(s1) from t1;
hex(s1)
hex(s1)
41
41
...
@@ -205,7 +205,7 @@ drop table t1;
...
@@ -205,7 +205,7 @@ drop table t1;
create table t1 (s1 varchar(10) character set utf8);
create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF);
insert into t1 values (0x41FF);
Warnings:
Warnings:
Warning 1
265 Data truncated
for column 's1' at row 1
Warning 1
366 Incorrect string value: '\xFF'
for column 's1' at row 1
select hex(s1) from t1;
select hex(s1) from t1;
hex(s1)
hex(s1)
41
41
...
@@ -213,7 +213,7 @@ drop table t1;
...
@@ -213,7 +213,7 @@ drop table t1;
create table t1 (s1 text character set utf8);
create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF);
insert into t1 values (0x41FF);
Warnings:
Warnings:
Warning 1
265 Data truncated
for column 's1' at row 1
Warning 1
366 Incorrect string value: '\xFF'
for column 's1' at row 1
select hex(s1) from t1;
select hex(s1) from t1;
hex(s1)
hex(s1)
41
41
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/fulltext.result
View file @
8748cde9
...
@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
...
@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
aus Osnabrck utf8_general_ci 1.591140
aus Osnabrck utf8_general_ci 1.591140
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
Warnings:
Warnings:
Warning 1
265 Data truncated
for column 't' at row 3
Warning 1
366 Incorrect string value: '\xD0\xAD\xD1\x82\xD0\xBE...'
for column 't' at row 3
Warning 1
265 Data truncated
for column 't' at row 4
Warning 1
366 Incorrect string value: '\xD0\x9E\xD1\x82\xD0\xBB...'
for column 't' at row 4
Warning 1
265 Data truncated
for column 't' at row 5
Warning 1
366 Incorrect string value: '\xD0\x9D\xD0\xB5 \xD0...'
for column 't' at row 5
Warning 1
265 Data truncated
for column 't' at row 6
Warning 1
366 Incorrect string value: '\xD0\xB8 \xD0\xB1\xD1...'
for column 't' at row 6
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t collation(t)
t collation(t)
aus Osnabrck latin1_german2_ci
aus Osnabrck latin1_german2_ci
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/strict_autoinc_1myisam.result
View file @
8748cde9
drop table if exists t1;
set @org_mode=@@sql_mode;
set @org_mode=@@sql_mode;
create table t1
create table t1
(
(
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/strict_autoinc_2innodb.result
View file @
8748cde9
drop table if exists t1;
set @org_mode=@@sql_mode;
set @org_mode=@@sql_mode;
create table t1
create table t1
(
(
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/strict_autoinc_3heap.result
View file @
8748cde9
drop table if exists t1;
set @org_mode=@@sql_mode;
set @org_mode=@@sql_mode;
create table t1
create table t1
(
(
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/strict_autoinc_4bdb.result
View file @
8748cde9
drop table if exists t1;
set @org_mode=@@sql_mode;
set @org_mode=@@sql_mode;
create table t1
create table t1
(
(
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/strict_autoinc_5ndb.result
View file @
8748cde9
drop table if exists t1;
set @org_mode=@@sql_mode;
set @org_mode=@@sql_mode;
create table t1
create table t1
(
(
...
...
This diff is collapsed.
Click to expand it.
sql/field.cc
View file @
8748cde9
This diff is collapsed.
Click to expand it.
sql/log.cc
View file @
8748cde9
...
@@ -386,6 +386,18 @@ bool Log_to_csv_event_handler::
...
@@ -386,6 +386,18 @@ bool Log_to_csv_event_handler::
{
{
TABLE
*
table
=
general_log
.
table
;
TABLE
*
table
=
general_log
.
table
;
/*
"INSERT INTO general_log" can generate warning sometimes.
Let's reset warnings from previous queries,
otherwise warning list can grow too much,
so thd->query gets spoiled as some point in time,
and mysql_parse() receives a broken query.
QQ: this problem needs to be studied in more details.
Probably it's better to suppress warnings in logging INSERTs at all.
Comment this line and run "cast.test" to see what's happening:
*/
mysql_reset_errors
(
table
->
in_use
,
1
);
/* below should never happen */
/* below should never happen */
if
(
unlikely
(
!
logger
.
is_log_tables_initialized
))
if
(
unlikely
(
!
logger
.
is_log_tables_initialized
))
return
FALSE
;
return
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
sql/sql_string.cc
View file @
8748cde9
...
@@ -844,6 +844,162 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
...
@@ -844,6 +844,162 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
}
}
/*
copy a string,
with optional character set conversion,
with optional left padding (for binary -> UCS2 conversion)
SYNOPSIS
well_formed_copy_nhars()
to Store result here
to_length Maxinum length of "to" string
to_cs Character set of "to" string
from Copy from here
from_length Length of from string
from_cs From character set
nchars Copy not more that nchars characters
well_formed_error_pos Return position when "from" is not well formed
or NULL otherwise.
cannot_convert_error_pos Return position where a not convertable
character met, or NULL otherwise.
from_end_pos Return position where scanning of "from"
string stopped.
NOTES
RETURN
length of bytes copied to 'to'
*/
uint32
well_formed_copy_nchars
(
CHARSET_INFO
*
to_cs
,
char
*
to
,
uint
to_length
,
CHARSET_INFO
*
from_cs
,
const
char
*
from
,
uint
from_length
,
uint
nchars
,
const
char
**
well_formed_error_pos
,
const
char
**
cannot_convert_error_pos
,
const
char
**
from_end_pos
)
{
uint
res
;
if
((
to_cs
==
&
my_charset_bin
)
||
(
from_cs
==
&
my_charset_bin
)
||
(
to_cs
==
from_cs
)
||
my_charset_same
(
from_cs
,
to_cs
))
{
if
(
to_length
<
to_cs
->
mbminlen
||
!
nchars
)
{
*
from_end_pos
=
from
;
*
cannot_convert_error_pos
=
NULL
;
*
well_formed_error_pos
=
NULL
;
return
0
;
}
if
(
to_cs
==
&
my_charset_bin
)
{
res
=
min
(
min
(
nchars
,
to_length
),
from_length
);
memmove
(
to
,
from
,
res
);
*
from_end_pos
=
from
+
res
;
*
well_formed_error_pos
=
NULL
;
*
cannot_convert_error_pos
=
NULL
;
}
else
{
int
well_formed_error
;
uint
from_offset
;
if
((
from_offset
=
(
from_length
%
to_cs
->
mbminlen
))
&&
(
from_cs
==
&
my_charset_bin
))
{
/*
Copying from BINARY to UCS2 needs to prepend zeros sometimes:
INSERT INTO t1 (ucs2_column) VALUES (0x01);
0x01 -> 0x0001
*/
uint
pad_length
=
to_cs
->
mbminlen
-
from_offset
;
bzero
(
to
,
pad_length
);
memmove
(
to
+
pad_length
,
from
,
from_offset
);
nchars
--
;
from
+=
from_offset
;
from_length
-=
from_offset
;
to
+=
to_cs
->
mbminlen
;
to_length
-=
to_cs
->
mbminlen
;
}
set_if_smaller
(
from_length
,
to_length
);
res
=
to_cs
->
cset
->
well_formed_len
(
to_cs
,
from
,
from
+
from_length
,
nchars
,
&
well_formed_error
);
memmove
(
to
,
from
,
res
);
*
from_end_pos
=
from
+
res
;
*
well_formed_error_pos
=
well_formed_error
?
from
+
res
:
NULL
;
*
cannot_convert_error_pos
=
NULL
;
if
(
from_offset
)
res
+=
to_cs
->
mbminlen
;
}
}
else
{
int
cnvres
;
my_wc_t
wc
;
int
(
*
mb_wc
)(
struct
charset_info_st
*
,
my_wc_t
*
,
const
uchar
*
,
const
uchar
*
)
=
from_cs
->
cset
->
mb_wc
;
int
(
*
wc_mb
)(
struct
charset_info_st
*
,
my_wc_t
,
uchar
*
s
,
uchar
*
e
)
=
to_cs
->
cset
->
wc_mb
;
const
uchar
*
from_end
=
(
const
uchar
*
)
from
+
from_length
;
uchar
*
to_end
=
(
uchar
*
)
to
+
to_length
;
char
*
to_start
=
to
;
*
well_formed_error_pos
=
NULL
;
*
cannot_convert_error_pos
=
NULL
;
for
(
;
nchars
;
nchars
--
)
{
const
char
*
from_prev
=
from
;
if
((
cnvres
=
(
*
mb_wc
)(
from_cs
,
&
wc
,
(
uchar
*
)
from
,
from_end
))
>
0
)
from
+=
cnvres
;
else
if
(
cnvres
==
MY_CS_ILSEQ
)
{
if
(
!*
well_formed_error_pos
)
*
well_formed_error_pos
=
from
;
from
++
;
wc
=
'?'
;
}
else
if
(
cnvres
>
MY_CS_TOOSMALL
)
{
/*
A correct multibyte sequence detected
But it doesn't have Unicode mapping.
*/
if
(
!*
cannot_convert_error_pos
)
*
cannot_convert_error_pos
=
from
;
from
+=
(
-
cnvres
);
wc
=
'?'
;
}
else
break
;
// Not enough characters
outp:
if
((
cnvres
=
(
*
wc_mb
)(
to_cs
,
wc
,
(
uchar
*
)
to
,
to_end
))
>
0
)
to
+=
cnvres
;
else
if
(
cnvres
==
MY_CS_ILUNI
&&
wc
!=
'?'
)
{
if
(
!*
cannot_convert_error_pos
)
*
cannot_convert_error_pos
=
from_prev
;
wc
=
'?'
;
goto
outp
;
}
else
break
;
}
*
from_end_pos
=
from
;
res
=
to
-
to_start
;
}
return
(
uint32
)
res
;
}
void
String
::
print
(
String
*
str
)
void
String
::
print
(
String
*
str
)
{
{
char
*
st
=
(
char
*
)
Ptr
,
*
end
=
st
+
str_length
;
char
*
st
=
(
char
*
)
Ptr
,
*
end
=
st
+
str_length
;
...
...
This diff is collapsed.
Click to expand it.
sql/sql_string.h
View file @
8748cde9
...
@@ -30,6 +30,14 @@ String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
...
@@ -30,6 +30,14 @@ String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
uint32
copy_and_convert
(
char
*
to
,
uint32
to_length
,
CHARSET_INFO
*
to_cs
,
uint32
copy_and_convert
(
char
*
to
,
uint32
to_length
,
CHARSET_INFO
*
to_cs
,
const
char
*
from
,
uint32
from_length
,
const
char
*
from
,
uint32
from_length
,
CHARSET_INFO
*
from_cs
,
uint
*
errors
);
CHARSET_INFO
*
from_cs
,
uint
*
errors
);
uint32
well_formed_copy_nchars
(
CHARSET_INFO
*
to_cs
,
char
*
to
,
uint
to_length
,
CHARSET_INFO
*
from_cs
,
const
char
*
from
,
uint
from_length
,
uint
nchars
,
const
char
**
well_formed_error_pos
,
const
char
**
cannot_convert_error_pos
,
const
char
**
from_end_pos
);
class
String
class
String
{
{
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-utf8.c
View file @
8748cde9
...
@@ -4051,6 +4051,7 @@ static MY_CHARSET_HANDLER my_charset_filename_handler=
...
@@ -4051,6 +4051,7 @@ static MY_CHARSET_HANDLER my_charset_filename_handler=
my_strntoull_8bit
,
my_strntoull_8bit
,
my_strntod_8bit
,
my_strntod_8bit
,
my_strtoll10_8bit
,
my_strtoll10_8bit
,
my_strntoull10rnd_8bit
,
my_scan_8bit
my_scan_8bit
};
};
...
...
This diff is collapsed.
Click to expand it.
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