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
a89cab8a
Commit
a89cab8a
authored
May 14, 2011
by
Vinay Fisrekar
Browse files
Options
Browse Files
Download
Plain Diff
Merge from mysql-5.1 to mysql-5.5
parents
f70f32c1
106ebae7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
540 additions
and
0 deletions
+540
-0
mysql-test/r/implicit_char_to_num_conversion.result
mysql-test/r/implicit_char_to_num_conversion.result
+366
-0
mysql-test/t/implicit_char_to_num_conversion.test
mysql-test/t/implicit_char_to_num_conversion.test
+174
-0
No files found.
mysql-test/r/implicit_char_to_num_conversion.result
0 → 100644
View file @
a89cab8a
DROP TABLE IF EXISTS t5;
CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (0), (1), (2);
SELECT HEX(c1) FROM t5 ORDER BY c1;
HEX(c1)
0
1
2
SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
HEX(c1)
1
SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
HEX(c1)
1
SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
HEX(c1)
0
2
SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
HEX(c1)
1
2
SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
HEX(c1)
0
1
SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
HEX(c1)
0
SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
HEX(c1)
1
2
DROP TABLE t5;
CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
SELECT c1 FROM t5 ORDER BY c1;
c1
-10.10
0.00
1.00
95.95
SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
c1
95.95
SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
c1
-10.10
0.00
1.00
SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
c1
-10.10
0.00
95.95
SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
c1
-10.10
0.00
SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
c1
1.00
95.95
DROP TABLE t5;
CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (95), (10),(11),(-8);
SELECT c1 FROM t5 ORDER BY c1;
c1
-8
10
11
95
SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
c1
10
SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
c1
10
SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
c1
95
SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
c1
-8
10
11
SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
c1
10
11
95
SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
c1
-8
10
SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
c1
11
95
DROP TABLE t5;
CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (395), (-200), (100), (111);
SELECT c1 FROM t5 ORDER BY c1;
c1
-200
100
111
395
SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
c1
100
SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
c1
100
SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
c1
395
SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
c1
-200
SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
c1
-200
111
395
SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
c1
-200
100
SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
c1
395
DROP TABLE t5;
CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
SELECT c1 FROM t5 ORDER BY c1;
c1
-8388607
215
311
88608
SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
c1
311
SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
c1
311
SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
c1
215
311
88608
SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
c1
-8388607
215
311
88608
SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
c1
215
311
88608
SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
c1
-8388607
SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
c1
311
88608
DROP TABLE t5;
CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
SELECT c1 FROM t5 ORDER BY c1;
c1
-2147483647
15
1011
9388607
SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
c1
9388607
SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
c1
9388607
SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
c1
15
1011
9388607
SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
c1
-2147483647
15
1011
SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
c1
15
1011
9388607
SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
c1
-2147483647
SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
c1
1011
9388607
DROP TABLE t5;
CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
SELECT c1 FROM t5 ORDER BY c1;
c1
-9223372036854775807
500
12011
3372036854775808
SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
c1
-9223372036854775807
SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
c1
-9223372036854775807
SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
c1
12011
3372036854775808
SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
c1
-9223372036854775807
500
SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
c1
-9223372036854775807
500
12011
SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
c1
-9223372036854775807
500
SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
c1
3372036854775808
DROP TABLE t5;
CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
SELECT c1 FROM t5 ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
DROP TABLE t5;
CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
SELECT c1 FROM t5 ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
DROP TABLE t5;
CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = <default_engine>;
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
SELECT c1 FROM t5 ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
c1
11.11
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
c1
-908.92
5.00
11.11
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
c1
5.00
11.11
95.95
DROP TABLE t5;
mysql-test/t/implicit_char_to_num_conversion.test
0 → 100644
View file @
a89cab8a
########### implicit_char_to_num_conversion.test #######################
# #
# This test aims at using string/char literal in comparison operators #
# without explicit type-cast. This is a bug test for Bug#11766521 #
# - Incorrect result is returned if string/char literal is used with #
# comparision operator and bit data type column. Test is extended to #
# include numeric data type comparison with string/char literal #
# #
# #
# Creation: #
# 2011-05-10 vfisrekar Implement this test as part of Bug#11766521 #
# #
########################################################################
--
disable_warnings
DROP
TABLE
IF
EXISTS
t5
;
--
enable_warnings
let
$default_engine
=
`select @@SESSION.default_storage_engine`
;
# Bug#11766521 - BIT Datatype comparison in where clause return incorrect
# result for '=' , '<=>' operators
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
BIT
(
2
)
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
0
),
(
1
),
(
2
);
SELECT
HEX
(
c1
)
FROM
t5
ORDER
BY
c1
;
# Enable Following two select after Bug#11766521 fix
# SELECT HEX(c1) FROM t5 WHERE c1 = '1' ORDER BY c1;
# SELECT HEX(c1) FROM t5 WHERE c1 <=> '1' ORDER BY c1;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
=
b
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
<=>
b
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
!=
b
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
>=
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
<=
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
<
'1'
ORDER
BY
c1
;
SELECT
HEX
(
c1
)
FROM
t5
WHERE
c1
>
'0'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# FLOAT Data-type
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
FLOAT
(
5
,
2
)
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
95.95
),
(
-
10.10
),
(
1
),
(
0
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
# Following two queries does not return result may be due to Bug#11766521.
# Enable them after Bug#11766521 fix.
# SELECT c1 FROM t5 WHERE c1 = '10.10' ORDER BY c1;
# SELECT c1 FROM t5 WHERE c2 <=> '11.11' ORDER BY c1;
SELECT
c1
FROM
t5
WHERE
c1
>=
'95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'10.10'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'1'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'1'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'0'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# TINYINT Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
TINYINT
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
95
),
(
10
),(
11
),(
-
8
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'10'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'10'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-8'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'10'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# SMALLINT Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
SMALLINT
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
395
),
(
-
200
),
(
100
),
(
111
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'100'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'100'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'395'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'-200'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'100'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'111'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'111'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# MEDIUMINT Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
MEDIUMINT
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
-
8388607
),
(
311
),(
215
),(
88608
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'311'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'311'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'215'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'88608'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-8388607'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'215'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'215'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# INT Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
INT
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
-
2147483647
),
(
1011
),(
15
),(
9388607
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'9388607'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'9388607'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'15'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'1011'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-2147483647'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'15'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'15'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# BIGINT Data-type
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
BIGINT
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
-
9223372036854775807
),
(
12011
),(
500
),(
3372036854775808
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'-9223372036854775807'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'-9223372036854775807'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'12011'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'500'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'3372036854775808'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'12011'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'12011'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# DOUBLE Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
DOUBLE
(
5
,
2
)
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
95.95
),
(
11.11
),(
5
),(
-
908.92
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'5'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-908.92'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'-908.92'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# NUMERIC Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
NUMERIC
(
5
,
2
)
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
95.95
),
(
11.11
),(
5
),(
-
908.92
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'5'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-908.92'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'-908.92'
ORDER
BY
c1
;
DROP
TABLE
t5
;
# DECIMAL Datatype
--
replace_result
$default_engine
<
default_engine
>
eval
CREATE
TABLE
t5
(
c1
DECIMAL
(
5
,
2
)
PRIMARY
KEY
)
ENGINE
=
$default_engine
;
INSERT
INTO
t5
VALUES
(
95.95
),
(
11.11
),(
5
),(
-
908.92
);
SELECT
c1
FROM
t5
ORDER
BY
c1
;
# Compare with string literal
SELECT
c1
FROM
t5
WHERE
c1
=
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=>
'11.11'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>=
'5'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<=
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
!=
'-908.92'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
<
'95.95'
ORDER
BY
c1
;
SELECT
c1
FROM
t5
WHERE
c1
>
'-908.92'
ORDER
BY
c1
;
DROP
TABLE
t5
;
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