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
5168c2ac
Commit
5168c2ac
authored
Dec 09, 2008
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.0-bugteam->5.1-bugteam merge
parents
b3012d08
0661c210
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
74 additions
and
10 deletions
+74
-10
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+9
-3
mysql-test/r/myisam_data_pointer_size_func.result
mysql-test/r/myisam_data_pointer_size_func.result
+1
-0
mysql-test/r/partition_datatype.result
mysql-test/r/partition_datatype.result
+1
-1
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+15
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+10
-0
mysql-test/t/myisam_data_pointer_size_func.test
mysql-test/t/myisam_data_pointer_size_func.test
+1
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+15
-0
sql/item.cc
sql/item.cc
+3
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+4
-3
sql/sql_show.cc
sql/sql_show.cc
+15
-3
No files found.
mysql-test/r/func_str.result
View file @
5168c2ac
...
...
@@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
replace(_latin2'abcd',_latin2'b',_latin2'B'),
encode('abcd','ab')
;
Warnings:
Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -727,7 +725,7 @@ t1 CREATE TABLE `t1` (
`conv(130,16,10)` varchar(64) DEFAULT NULL,
`hex(130)` varchar(6) NOT NULL DEFAULT '',
`char(130)` varbinary(4) NOT NULL DEFAULT '',
`format(130,10)` varchar(
4
) NOT NULL DEFAULT '',
`format(130,10)` varchar(
37
) NOT NULL DEFAULT '',
`left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
`lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
...
...
@@ -2513,4 +2511,12 @@ SELECT HEX(c1) from v1;
HEX(c1)
414243
DROP VIEW v1;
create table t1(a float);
insert into t1 values (1.33);
select format(a, 2) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def format(a, 2) 253 49 4 Y 0 31 8
format(a, 2)
1.33
drop table t1;
End of 5.0 tests
mysql-test/r/myisam_data_pointer_size_func.result
View file @
5168c2ac
...
...
@@ -40,3 +40,4 @@ count(*)
65536
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
SET @@global.myisam_data_pointer_size = default;
mysql-test/r/partition_datatype.result
View file @
5168c2ac
...
...
@@ -324,7 +324,7 @@ partition by hash (a)
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(27) NOT NULL DEFAULT
'\0\0\0\
0',
`a` bit(27) NOT NULL DEFAULT
b'
0',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
...
...
mysql-test/r/type_bit.result
View file @
5168c2ac
...
...
@@ -708,6 +708,21 @@ HEX(b1) HEX(b2) i2
1 0 100
1 0 200
DROP TABLE t1, t2;
CREATE TABLE IF NOT EXISTS t1 (
f1 bit(2) NOT NULL default b'10',
f2 bit(14) NOT NULL default b'11110000111100'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` bit(2) NOT NULL DEFAULT b'10',
`f2` bit(14) NOT NULL DEFAULT b'11110000111100'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
DROP TABLE t1;
CREATE TABLE IF NOT EXISTS t1 (
f1 bit(2) NOT NULL default b''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
ERROR 42000: Invalid default value for 'f1'
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
...
...
mysql-test/t/func_str.test
View file @
5168c2ac
...
...
@@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
SELECT
HEX
(
c1
)
from
v1
;
DROP
VIEW
v1
;
#
# Bug #35558 Wrong server metadata blows up the client
#
create
table
t1
(
a
float
);
insert
into
t1
values
(
1.33
);
--
enable_metadata
select
format
(
a
,
2
)
from
t1
;
--
disable_metadata
drop
table
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/myisam_data_pointer_size_func.test
View file @
5168c2ac
...
...
@@ -105,6 +105,7 @@ SELECT count(*) from t1;
DROP
PROCEDURE
sp_addRec
;
DROP
TABLE
t1
;
SET
@@
global
.
myisam_data_pointer_size
=
default
;
################################################################
# End of functionality Testing for myisam_data_pointer_size #
################################################################
...
...
mysql-test/t/type_bit.test
View file @
5168c2ac
...
...
@@ -352,6 +352,21 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2
DROP
TABLE
t1
,
t2
;
#
# Bug #35796 SHOW CREATE TABLE and default value for BIT field
#
CREATE
TABLE
IF
NOT
EXISTS
t1
(
f1
bit
(
2
)
NOT
NULL
default
b
'10'
,
f2
bit
(
14
)
NOT
NULL
default
b
'11110000111100'
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
COLLATE
=
latin1_general_ci
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
error
ER_INVALID_DEFAULT
CREATE
TABLE
IF
NOT
EXISTS
t1
(
f1
bit
(
2
)
NOT
NULL
default
b
''
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
COLLATE
=
latin1_general_ci
;
--
echo
End
of
5.0
tests
#
...
...
sql/item.cc
View file @
5168c2ac
...
...
@@ -5114,6 +5114,9 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions)
ulonglong
nr
;
uint32
length
=
str_value
.
length
();
if
(
!
length
)
return
1
;
if
(
length
>
8
)
{
nr
=
field
->
flags
&
UNSIGNED_FLAG
?
ULONGLONG_MAX
:
LONGLONG_MAX
;
...
...
sql/item_strfunc.cc
View file @
5168c2ac
...
...
@@ -2033,10 +2033,11 @@ Item_func_format::Item_func_format(Item *org, Item *dec)
void
Item_func_format
::
fix_length_and_dec
()
{
collation
.
set
(
default_charset
());
uint
char_length
=
args
[
0
]
->
max_length
/
args
[
0
]
->
collation
.
collation
->
mbmaxlen
;
max_length
=
((
char_length
+
(
char_length
-
args
[
0
]
->
decimals
)
/
3
)
*
collation
.
collation
->
mbmaxlen
);
uint
max_sep_count
=
char_length
/
3
+
(
decimals
?
1
:
0
)
+
/*sign*/
1
;
collation
.
set
(
default_charset
());
max_length
=
(
char_length
+
max_sep_count
+
decimals
)
*
collation
.
collation
->
mbmaxlen
;
}
...
...
sql/sql_show.cc
View file @
5168c2ac
...
...
@@ -993,7 +993,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{
bool
has_default
;
bool
has_now_default
;
enum
enum_field_types
field_type
=
field
->
type
();
/*
We are using CURRENT_TIMESTAMP instead of NOW because it is
more standard
...
...
@@ -1001,7 +1001,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
has_now_default
=
table
->
timestamp_field
==
field
&&
field
->
unireg_check
!=
Field
::
TIMESTAMP_UN_FIELD
;
has_default
=
(
field
->
type
()
!=
FIELD_TYPE_BLOB
&&
has_default
=
(
field
_type
!=
FIELD_TYPE_BLOB
&&
!
(
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
)
&&
field
->
unireg_check
!=
Field
::
NEXT_NUMBER
&&
!
((
thd
->
variables
.
sql_mode
&
(
MODE_MYSQL323
|
MODE_MYSQL40
))
...
...
@@ -1016,6 +1016,18 @@ static bool get_field_default_value(THD *thd, TABLE *table,
{
// Not null by default
char
tmp
[
MAX_FIELD_WIDTH
];
String
type
(
tmp
,
sizeof
(
tmp
),
field
->
charset
());
if
(
field_type
==
MYSQL_TYPE_BIT
)
{
longlong
dec
=
field
->
val_int
();
char
*
ptr
=
longlong2str
(
dec
,
tmp
+
2
,
2
);
uint32
length
=
(
uint32
)
(
ptr
-
tmp
);
tmp
[
0
]
=
'b'
;
tmp
[
1
]
=
'\''
;
tmp
[
length
]
=
'\''
;
type
.
length
(
length
+
1
);
quoted
=
0
;
}
else
field
->
val_str
(
&
type
);
if
(
type
.
length
())
{
...
...
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