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
ecd23f62
Commit
ecd23f62
authored
Jul 05, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.6 into 10.9
parents
b1317c17
46b79b8c
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1444 additions
and
1452 deletions
+1444
-1452
mysql-test/main/kill_debug.result
mysql-test/main/kill_debug.result
+1
-0
mysql-test/main/kill_debug.test
mysql-test/main/kill_debug.test
+6
-0
mysql-test/main/type_json.result
mysql-test/main/type_json.result
+18
-0
mysql-test/main/type_json.test
mysql-test/main/type_json.test
+14
-0
mysys/my_thr_init.c
mysys/my_thr_init.c
+1
-1
plugin/type_inet/item_inetfunc.cc
plugin/type_inet/item_inetfunc.cc
+5
-5
plugin/type_inet/plugin.cc
plugin/type_inet/plugin.cc
+1
-1
plugin/type_inet/sql_type_inet.h
plugin/type_inet/sql_type_inet.h
+1
-1
plugin/type_mysql_json/type.cc
plugin/type_mysql_json/type.cc
+0
-7
plugin/type_mysql_timestamp/plugin.cc
plugin/type_mysql_timestamp/plugin.cc
+0
-5
plugin/type_test/plugin.cc
plugin/type_test/plugin.cc
+0
-4
plugin/type_uuid/item_uuidfunc.cc
plugin/type_uuid/item_uuidfunc.cc
+1
-1
plugin/type_uuid/plugin.cc
plugin/type_uuid/plugin.cc
+1
-1
plugin/type_uuid/sql_type_uuid.h
plugin/type_uuid/sql_type_uuid.h
+1
-1
sql/sql_string.cc
sql/sql_string.cc
+3
-3
sql/sql_string.h
sql/sql_string.h
+3
-3
sql/sql_type.cc
sql/sql_type.cc
+1
-9
sql/sql_type.h
sql/sql_type.h
+0
-1
sql/sql_type_fixedbin.h
sql/sql_type_fixedbin.h
+1366
-1364
sql/sql_type_geom.cc
sql/sql_type_geom.cc
+1
-1
sql/sql_type_geom.h
sql/sql_type_geom.h
+2
-1
sql/sql_type_json.cc
sql/sql_type_json.cc
+0
-14
sql/sql_yacc.yy
sql/sql_yacc.yy
+9
-22
storage/innobase/dict/dict0stats.cc
storage/innobase/dict/dict0stats.cc
+9
-7
No files found.
mysql-test/main/kill_debug.result
View file @
ecd23f62
...
...
@@ -234,6 +234,7 @@ connection default;
set debug_sync='now WAIT_FOR go0';
set debug_sync='found_killee SIGNAL go1 WAIT_FOR go2';
kill $id;
select variable_value into @threads_cached from information_schema.global_status where variable_name='threads_cached';
set debug_sync='now SIGNAL go3';
drop table t1;
set debug_sync='reset';
mysql-test/main/kill_debug.test
View file @
ecd23f62
...
...
@@ -313,6 +313,12 @@ connection default;
set
debug_sync
=
'now WAIT_FOR go0'
;
set
debug_sync
=
'found_killee SIGNAL go1 WAIT_FOR go2'
;
evalp
kill
$id
;
select
variable_value
into
@
threads_cached
from
information_schema
.
global_status
where
variable_name
=
'threads_cached'
;
set
debug_sync
=
'now SIGNAL go3'
;
if
(
`select @@thread_handling != 'pool-of-threads'`
)
{
# cannot check that a thread was added to thread pool on windows, but the test works there w/o the wait
let
wait_condition
=
select
variable_value
>@
threads_cached
from
information_schema
.
global_status
where
variable_name
=
'threads_cached'
;
source
include
/
wait_condition
.
inc
;
}
drop
table
t1
;
set
debug_sync
=
'reset'
;
mysql-test/main/type_json.result
View file @
ecd23f62
...
...
@@ -159,5 +159,23 @@ def j 250 (format=json) 9437283 16 Y 0 39 33
j
{"a": {"b":"c"}}
#
# MDEV-26506 Over-quoted JSON when combining JSON_ARRAYAGG with JSON_OBJECT
#
# maintain JSON property through internal temporary tables
create table t1 (a varchar(30));
insert into t1 values ('root');
select json_object('attr2',o) from (select a, json_arrayagg(json_object('attr1', a)) as o from t1) u;
json_object('attr2',o)
{"attr2": [{"attr1": "root"}]}
drop table t1;
create view v1 as select json_object(_latin1 'a', _latin1'b') as v1_json;
select v1_json from v1;
v1_json
{"a": "b"}
select json_arrayagg(v1_json) from v1;
json_arrayagg(v1_json)
[{"a": "b"}]
drop view v1;
#
# End of 10.5 tests
#
mysql-test/main/type_json.test
View file @
ecd23f62
...
...
@@ -121,6 +121,20 @@ SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) A
--
disable_ps_protocol
--
enable_view_protocol
--
echo
#
--
echo
# MDEV-26506 Over-quoted JSON when combining JSON_ARRAYAGG with JSON_OBJECT
--
echo
#
--
echo
# maintain JSON property through internal temporary tables
create
table
t1
(
a
varchar
(
30
));
insert
into
t1
values
(
'root'
);
select
json_object
(
'attr2'
,
o
)
from
(
select
a
,
json_arrayagg
(
json_object
(
'attr1'
,
a
))
as
o
from
t1
)
u
;
drop
table
t1
;
create
view
v1
as
select
json_object
(
_latin1
'a'
,
_latin1
'b'
)
as
v1_json
;
select
v1_json
from
v1
;
select
json_arrayagg
(
v1_json
)
from
v1
;
drop
view
v1
;
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
mysys/my_thr_init.c
View file @
ecd23f62
...
...
@@ -23,7 +23,7 @@
#include <m_string.h>
#include <signal.h>
pthread_key
(
struct
st_my_thread_var
*
,
THR_KEY_mysys
);
pthread_key
(
struct
st_my_thread_var
*
,
THR_KEY_mysys
=-
1
);
mysql_mutex_t
THR_LOCK_malloc
,
THR_LOCK_open
,
THR_LOCK_lock
,
THR_LOCK_myisam
,
THR_LOCK_heap
,
THR_LOCK_net
,
THR_LOCK_charset
,
THR_LOCK_threads
,
...
...
plugin/type_inet/item_inetfunc.cc
View file @
ecd23f62
...
...
@@ -158,7 +158,7 @@ String *Item_func_inet6_aton::val_str(String *buffer)
return
buffer
;
}
Inet6Bundle
::
Fbt_null
ipv6
(
*
tmp
.
string
());
Type_handler_inet6
::
Fbt_null
ipv6
(
*
tmp
.
string
());
if
(
!
ipv6
.
is_null
())
{
ipv6
.
to_binary
(
buffer
);
...
...
@@ -197,7 +197,7 @@ String *Item_func_inet6_ntoa::val_str_ascii(String *buffer)
return
buffer
;
}
Inet6Bundle
::
Fbt_null
ipv6
(
static_cast
<
const
Binary_string
&>
(
*
tmp
.
string
()));
Type_handler_inet6
::
Fbt_null
ipv6
(
static_cast
<
const
Binary_string
&>
(
*
tmp
.
string
()));
if
(
!
ipv6
.
is_null
())
{
ipv6
.
to_string
(
buffer
);
...
...
@@ -221,10 +221,10 @@ longlong Item_func_is_ipv4::val_int()
return
!
tmp
.
is_null
()
&&
!
Inet4_null
(
*
tmp
.
string
()).
is_null
();
}
class
IP6
:
public
Inet6Bundle
::
Fbt_null
class
IP6
:
public
Type_handler_inet6
::
Fbt_null
{
public:
IP6
(
Item
*
arg
)
:
Inet6Bundle
::
Fbt_null
(
arg
)
{}
IP6
(
Item
*
arg
)
:
Type_handler_inet6
::
Fbt_null
(
arg
)
{}
bool
is_v4compat
()
const
{
static_assert
(
sizeof
(
in6_addr
)
==
IN6_ADDR_SIZE
,
"unexpected in6_addr size"
);
...
...
@@ -246,7 +246,7 @@ longlong Item_func_is_ipv6::val_int()
{
DBUG_ASSERT
(
fixed
());
String_ptr_and_buffer
<
STRING_BUFFER_USUAL_SIZE
>
tmp
(
args
[
0
]);
return
!
tmp
.
is_null
()
&&
!
Inet6Bundle
::
Fbt_null
(
*
tmp
.
string
()).
is_null
();
return
!
tmp
.
is_null
()
&&
!
Type_handler_inet6
::
Fbt_null
(
*
tmp
.
string
()).
is_null
();
}
/**
...
...
plugin/type_inet/plugin.cc
View file @
ecd23f62
...
...
@@ -24,7 +24,7 @@
static
struct
st_mariadb_data_type
plugin_descriptor_type_inet6
=
{
MariaDB_DATA_TYPE_INTERFACE_VERSION
,
Inet6Bundle
::
type_handler_fbt
()
Type_handler_inet6
::
singleton
()
};
...
...
plugin/type_inet/sql_type_inet.h
View file @
ecd23f62
...
...
@@ -44,7 +44,7 @@ class Inet6: public FixedBinTypeStorage<IN6_ADDR_SIZE, IN6_ADDR_MAX_CHAR_LENGTH>
#include "sql_type_fixedbin.h"
typedef
FixedBinTypeBundle
<
Inet6
>
Inet6Bundle
;
typedef
Type_handler_fbt
<
Inet6
>
Type_handler_inet6
;
/***********************************************************************/
...
...
plugin/type_mysql_json/type.cc
View file @
ecd23f62
...
...
@@ -188,13 +188,6 @@ class Type_collection_mysql_json: public Type_collection
{
return
NULL
;
}
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
if
(
type_handler_mysql_json
.
name
().
eq
(
name
))
return
&
type_handler_mysql_json
;
return
NULL
;
}
};
const
Type_collection
*
Type_handler_mysql_json
::
type_collection
()
const
...
...
plugin/type_mysql_timestamp/plugin.cc
View file @
ecd23f62
...
...
@@ -26,11 +26,6 @@ class Type_collection_local: public Type_collection
const
Type_handler
*
aggregate_common
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
;
public:
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
return
NULL
;
}
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
override
...
...
plugin/type_test/plugin.cc
View file @
ecd23f62
...
...
@@ -26,10 +26,6 @@ class Type_collection_test: public Type_collection
const
Type_handler
*
aggregate_common
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
;
public:
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
return
NULL
;
}
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
override
;
...
...
plugin/type_uuid/item_uuidfunc.cc
View file @
ecd23f62
...
...
@@ -33,7 +33,7 @@ String *Item_func_sys_guid::val_str(String *str)
const
Type_handler
*
Item_func_uuid
::
type_handler
()
const
{
return
UUIDBundle
::
type_handler_fbt
();
return
UUIDBundle
::
singleton
();
}
bool
Item_func_uuid
::
val_native
(
THD
*
,
Native
*
to
)
...
...
plugin/type_uuid/plugin.cc
View file @
ecd23f62
...
...
@@ -24,7 +24,7 @@
static
struct
st_mariadb_data_type
plugin_descriptor_type_uuid
=
{
MariaDB_DATA_TYPE_INTERFACE_VERSION
,
UUIDBundle
::
type_handler_fbt
()
UUIDBundle
::
singleton
()
};
/*************************************************************************/
...
...
plugin/type_uuid/sql_type_uuid.h
View file @
ecd23f62
...
...
@@ -181,6 +181,6 @@ class UUID: public FixedBinTypeStorage<MY_UUID_SIZE, MY_UUID_STRING_LENGTH>
#include "sql_type_fixedbin.h"
typedef
FixedBinTypeBundle
<
UUID
>
UUIDBundle
;
typedef
Type_handler_fbt
<
UUID
>
UUIDBundle
;
#endif // SQL_TYPE_UUID_INCLUDED
sql/sql_string.cc
View file @
ecd23f62
...
...
@@ -677,7 +677,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
}
int
Binary_string
::
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
)
int
Binary_string
::
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
)
const
{
if
(
search_length
+
offset
<=
str_length
)
{
...
...
@@ -703,7 +703,7 @@ int Binary_string::strstr(const char *search, uint32 search_length, uint32 offse
return
-
1
;
}
int
Binary_string
::
strstr
(
const
Binary_string
&
s
,
uint32
offset
)
int
Binary_string
::
strstr
(
const
Binary_string
&
s
,
uint32
offset
)
const
{
return
strstr
(
s
.
ptr
(),
s
.
length
(),
offset
);
}
...
...
@@ -712,7 +712,7 @@ int Binary_string::strstr(const Binary_string &s, uint32 offset)
** Search string from end. Offset is offset to the end of string
*/
int
Binary_string
::
strrstr
(
const
Binary_string
&
s
,
uint32
offset
)
int
Binary_string
::
strrstr
(
const
Binary_string
&
s
,
uint32
offset
)
const
{
if
(
s
.
length
()
<=
offset
&&
offset
<=
str_length
)
{
...
...
sql/sql_string.h
View file @
ecd23f62
...
...
@@ -406,10 +406,10 @@ class Binary_string: public Sql_alloc
}
// Returns offset to substring or -1
int
strstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
);
int
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
=
0
);
int
strstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
)
const
;
int
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
=
0
)
const
;
// Returns offset to substring or -1
int
strrstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
);
int
strrstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
)
const
;
/*
The following append operations do not extend the strings and in production
...
...
sql/sql_type.cc
View file @
ecd23f62
...
...
@@ -94,10 +94,6 @@ Vers_type_trx vers_type_trx;
class
Type_collection_std
:
public
Type_collection
{
public:
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
return
NULL
;
}
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
...
...
@@ -137,10 +133,6 @@ class Type_collection_row: public Type_collection
{
return
false
;
}
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
return
NULL
;
}
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
...
...
@@ -212,7 +204,7 @@ Type_handler::handler_by_name(THD *thd, const LEX_CSTRING &name)
}
#ifdef HAVE_SPATIAL
const
Type_handler
*
ha
=
type_collection_geometry
.
handler_by_name
(
name
);
const
Type_handler
*
ha
=
Type_collection_geometry_
handler_by_name
(
name
);
if
(
ha
)
return
ha
;
#endif
...
...
sql/sql_type.h
View file @
ecd23f62
...
...
@@ -7396,7 +7396,6 @@ class Type_collection
public:
virtual
~
Type_collection
()
=
default
;
virtual
bool
init
(
Type_handler_data
*
)
{
return
false
;
}
virtual
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
=
0
;
virtual
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
h1
,
const
Type_handler
*
h2
)
const
=
0
;
...
...
sql/sql_type_fixedbin.h
View file @
ecd23f62
This source diff could not be displayed because it is too large. You can
view the blob
instead.
sql/sql_type_geom.cc
View file @
ecd23f62
...
...
@@ -67,7 +67,7 @@ Type_handler_geometry::type_handler_geom_by_type(uint type)
const
Type_handler
*
Type_collection_geometry
::
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
Type_collection_geometry
_handler_by_name
(
const
LEX_CSTRING
&
name
)
{
if
(
type_handler_point
.
name
().
eq
(
name
))
return
&
type_handler_point
;
...
...
sql/sql_type_geom.h
View file @
ecd23f62
...
...
@@ -296,7 +296,6 @@ class Type_collection_geometry: public Type_collection
#endif
public:
bool
init
(
Type_handler_data
*
data
)
override
;
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
;
const
Type_handler
*
aggregate_for_result
(
const
Type_handler
*
a
,
const
Type_handler
*
b
)
const
override
;
...
...
@@ -315,6 +314,8 @@ class Type_collection_geometry: public Type_collection
};
extern
Type_collection_geometry
type_collection_geometry
;
const
Type_handler
*
Type_collection_geometry_handler_by_name
(
const
LEX_CSTRING
&
name
);
#include "field.h"
...
...
sql/sql_type_json.cc
View file @
ecd23f62
...
...
@@ -233,20 +233,6 @@ class Type_collection_json: public Type_collection
*/
return
NULL
;
}
const
Type_handler
*
handler_by_name
(
const
LEX_CSTRING
&
name
)
const
override
{
/*
Name resolution is not needed yet.
JSON is not fully pluggable at the moment:
- It is parsed using a hard-coded rule in sql_yacc.yy
- It does not store extended data type information into
FRM file yet. JSON is detected by CHECK(JSON_VALID(col))
and this detection is also hard-coded.
This will change in the future.
*/
return
NULL
;
}
};
...
...
sql/sql_yacc.yy
View file @
ecd23f62
...
...
@@ -1320,6 +1320,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
sp_opt_label BIN_NUM TEXT_STRING_filesystem
opt_constraint constraint opt_ident
sp_block_label sp_control_label opt_place opt_db
udt_name
%type <ident_sys>
IDENT_sys
...
...
@@ -6022,23 +6023,19 @@ qualified_field_type:
}
;
udt_name:
IDENT_sys { $$= $1; }
| reserved_keyword_udt { $$= $1; }
| non_reserved_keyword_udt { $$= $1; }
;
field_type_all:
field_type_numeric
| field_type_temporal
| field_type_string
| field_type_lob
| field_type_misc
| IDENT_sys float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
}
| reserved_keyword_udt float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
}
| non_reserved_keyword_udt float_options srid_option
| udt_name float_options srid_option
{
if (Lex->set_field_type_udt(&$$, $1, $2))
MYSQL_YYABORT;
...
...
@@ -11189,17 +11186,7 @@ cast_type:
}
| cast_type_numeric { $$= $1; }
| cast_type_temporal { $$= $1; }
| IDENT_sys
{
if (Lex->set_cast_type_udt(&$$, $1))
MYSQL_YYABORT;
}
| reserved_keyword_udt
{
if (Lex->set_cast_type_udt(&$$, $1))
MYSQL_YYABORT;
}
| non_reserved_keyword_udt
| udt_name
{
if (Lex->set_cast_type_udt(&$$, $1))
MYSQL_YYABORT;
...
...
storage/innobase/dict/dict0stats.cc
View file @
ecd23f62
...
...
@@ -514,15 +514,17 @@ static bool dict_stats_persistent_storage_check(bool dict_already_locked)
dict_sys
.
unlock
();
}
if
(
ret
!=
DB_SUCCESS
&&
ret
!=
DB_STATS_DO_NOT_EXIST
)
{
ib
::
error
()
<<
errstr
;
return
(
false
);
}
else
if
(
ret
==
DB_STATS_DO_NOT_EXIST
)
{
switch
(
ret
)
{
case
DB_SUCCESS
:
return
true
;
default:
if
(
!
opt_bootstrap
)
{
ib
::
error
()
<<
errstr
;
}
/* fall through */
case
DB_STATS_DO_NOT_EXIST
:
return
false
;
}
/* else */
return
(
true
);
}
/** Executes a given SQL statement using the InnoDB internal SQL parser.
...
...
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