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
f1109b47
Commit
f1109b47
authored
Jan 17, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: generalize ER_SPATIAL_CANT_HAVE_NULL
parent
7bb67271
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
30 deletions
+29
-30
include/mysql.h
include/mysql.h
+1
-0
mysql-test/suite/gcol/t/innodb_virtual_basic.test
mysql-test/suite/gcol/t/innodb_virtual_basic.test
+3
-3
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+11
-11
mysql-test/suite/innodb_gis/t/point_basic.test
mysql-test/suite/innodb_gis/t/point_basic.test
+2
-2
mysql-test/suite/vcol/inc/vcol_keys.inc
mysql-test/suite/vcol/inc/vcol_keys.inc
+1
-1
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+10
-11
sql/sql_table.cc
sql/sql_table.cc
+1
-2
No files found.
include/mysql.h
View file @
f1109b47
...
...
@@ -143,6 +143,7 @@ typedef unsigned long long my_ulonglong;
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
#define ER_KEY_COLUMN_DOES_NOT_EXITS ER_KEY_COLUMN_DOES_NOT_EXIST
#define ER_DROP_PARTITION_NON_EXISTENT ER_PARTITION_DOES_NOT_EXIST
#define ER_SPATIAL_CANT_HAVE_NULL ER_INDEX_CANNOT_HAVE_NULL
typedef
struct
st_mysql_rows
{
struct
st_mysql_rows
*
next
;
/* list of rows */
...
...
mysql-test/suite/gcol/t/innodb_virtual_basic.test
View file @
f1109b47
...
...
@@ -235,10 +235,10 @@ CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a));
ALTER
TABLE
t
ADD
FULLTEXT
INDEX
(
b
);
DROP
TABLE
t
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
CREATE
TABLE
t
(
a
geometry
not
null
,
b
geometry
GENERATED
ALWAYS
AS
(
a
),
spatial
INDEX
idx
(
b
));
CREATE
TABLE
t
(
a
geometry
not
null
,
b
geometry
GENERATED
ALWAYS
AS
(
a
));
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
t
ADD
SPATIAL
INDEX
(
b
);
DROP
TABLE
t
;
...
...
@@ -527,7 +527,7 @@ SHOW CREATE TABLE t1;
DROP
TABLE
t1
;
# No spatial and FTS index on virtual columns
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
CREATE
TABLE
t
(
a
INT
,
b
INT
GENERATED
ALWAYS
AS
(
a
),
c
point
,
d
point
GENERATED
ALWAYS
AS
(
c
),
spatial
index
idx
(
d
));
--
error
ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
...
...
mysql-test/suite/innodb_gis/t/alter_spatial_index.test
View file @
f1109b47
...
...
@@ -134,31 +134,31 @@ SELECT c1,ST_AsText(c2),ST_AsText(c4) FROM tab WHERE MBRWithin(tab.c4, @g1);
DELETE
FROM
tab
WHERE
MBRWithin
(
tab
.
c4
,
@
g1
);
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c2
MULTIPOINT
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c3
MULTILINESTRING
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c4
MULTIPOLYGON
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c3
MULTILINESTRING
NULL
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c4
MULTIPOLYGON
NULL
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
MODIFY
COLUMN
c4
Geometry
NULL
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
CHANGE
COLUMN
c2
c22
POINT
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
CHANGE
COLUMN
c3
c33
LINESTRING
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
tab
CHANGE
COLUMN
c4
c44
POLYGON
;
# --error ER_SPATIAL_MUST_HAVE_GEOM_COL
...
...
@@ -716,7 +716,7 @@ create table t1 (c1 int) engine=innodb;
insert
into
t1
values
(
NULL
);
# Add spatial index fail, since geometry column can't be null.
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
alter
table
t1
add
b
geometry
,
add
spatial
index
(
b
),
algorithm
=
inplace
;
# Add spatial index fail, since there's invalid geo data.
...
...
@@ -736,7 +736,7 @@ create table t1 (c1 int) engine=innodb;
insert
into
t1
values
(
NULL
);
# Add spatial index fail, since geometry column can't be null.
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
alter
table
t1
add
b
geometry
,
add
spatial
index
(
b
),
algorithm
=
copy
;
# Add spatial index fail, since there's a NULL or invalid geo data.
...
...
mysql-test/suite/innodb_gis/t/point_basic.test
View file @
f1109b47
...
...
@@ -107,7 +107,7 @@ DELETE FROM t1 WHERE p1 = ST_PointFromText('POINT(10 19)');
SELECT
ST_AsText
(
p1
)
FROM
t1
;
--
echo
# Add spatial keys on the table
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
t1
ADD
SPATIAL
(
p
),
ADD
SPATIAL
(
p1
);
SELECT
c
.
name
,
c
.
mtype
,
c
.
prtype
,
c
.
len
FROM
INFORMATION_SCHEMA
.
INNODB_SYS_COLUMNS
c
...
...
@@ -176,7 +176,7 @@ UPDATE t1 SET p1 = ST_PointFromText('POINT(5 5)');
SELECT
ST_AsText
(
pp
),
ST_AsText
(
p1
)
FROM
t1
;
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
ALTER
TABLE
t1
ADD
SPATIAL
(
p1
),
ADD
SPATIAL
(
pp
),
ALGORITHM
=
COPY
;
SELECT
c
.
name
,
c
.
mtype
,
c
.
prtype
,
c
.
len
FROM
INFORMATION_SCHEMA
.
INNODB_SYS_COLUMNS
c
...
...
mysql-test/suite/vcol/inc/vcol_keys.inc
View file @
f1109b47
...
...
@@ -94,7 +94,7 @@ drop table t1;
if
(
!
$skip_spatial_index_check
)
{
--
echo
# Error "All parts of a SPATIAL index must be NOT NULL"
--
error
ER_
SPATIAL_CAN
T_HAVE_NULL
--
error
ER_
INDEX_CANNO
T_HAVE_NULL
create
table
t1
(
a
int
,
b
geometry
as
(
a
+
1
)
persistent
,
spatial
index
(
b
));
create
table
t1
(
a
int
,
b
int
as
(
a
+
1
)
persistent
);
--
error
ER_WRONG_ARGUMENTS
...
...
sql/share/errmsg-utf8.txt
View file @
f1109b47
...
...
@@ -5642,17 +5642,16 @@ ER_NOT_SUPPORTED_AUTH_MODE 08004
spa "El cliente no soporta protocolo de autenticación requerido por el servidor; considere mejorar el cliente MariaDB"
sw "Mteja haungi mkono itifaki ya uthibitishaji iliyoombwa na seva; fikiria kuboresha mteja wa MariaDB"
swe "Klienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammet"
ER_SPATIAL_CANT_HAVE_NULL 42000
chi "SPATIAL索引的所有部分必须不为null"
eng "All parts of a SPATIAL index must be NOT NULL"
ger "Alle Teile eines SPATIAL-Index müssen als NOT NULL deklariert sein"
geo "SPATIAL ინდექსის ყველა ნაწილი NOT NULL უნდა იყოს"
jpn "空間索引のキー列は NOT NULL でなければいけません。"
nla "Alle delete van een SPATIAL index dienen als NOT NULL gedeclareerd te worden"
por "Todas as partes de uma SPATIAL index devem ser NOT NULL"
spa "Todas las partes de un índice SPATIAL deben de ser NOT NULL"
sw "Sehemu zote za faharisi ya SPATIAL lazima ziwe NOT NULL"
swe "Alla delar av en SPATIAL index måste vara NOT NULL"
ER_INDEX_CANNOT_HAVE_NULL 42000
chi "%s索引的所有部分必须不为null"
eng "All parts of a %s index must be NOT NULL"
ger "Alle Teile eines %s-Index müssen als NOT NULL deklariert sein"
geo "%s ინდექსის ყველა ნაწილი NOT NULL უნდა იყოს"
nla "Alle delete van een %s index dienen als NOT NULL gedeclareerd te worden"
por "Todas as partes de uma %s index devem ser NOT NULL"
spa "Todas las partes de un índice %s deben de ser NOT NULL"
sw "Sehemu zote za faharisi ya %s lazima ziwe NOT NULL"
swe "Alla delar av en %s index måste vara NOT NULL"
ER_COLLATION_CHARSET_MISMATCH 42000
chi "COLLATION'%s'无效地用于字符集'%s'"
eng "COLLATION '%s' is not valid for CHARACTER SET '%s'"
...
...
sql/sql_table.cc
View file @
f1109b47
...
...
@@ -3302,8 +3302,7 @@ mysql_prepare_create_table_finalize(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN
(
TRUE
);
if
(
!
(
sql_field
->
flags
&
NOT_NULL_FLAG
))
{
my_message
(
ER_SPATIAL_CANT_HAVE_NULL
,
ER_THD
(
thd
,
ER_SPATIAL_CANT_HAVE_NULL
),
MYF
(
0
));
my_error
(
ER_INDEX_CANNOT_HAVE_NULL
,
MYF
(
0
),
"SPATIAL"
);
DBUG_RETURN
(
TRUE
);
}
break
;
...
...
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