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
7b97020d
Commit
7b97020d
authored
Mar 07, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
5172f132
02da00a9
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
121 additions
and
138 deletions
+121
-138
mysql-test/suite/federated/rpl.test
mysql-test/suite/federated/rpl.test
+1
-0
mysql-test/suite/innodb/r/page_reorganize.result
mysql-test/suite/innodb/r/page_reorganize.result
+7
-0
mysql-test/suite/innodb/t/page_reorganize.test
mysql-test/suite/innodb/t/page_reorganize.test
+8
-0
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+29
-0
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
+1
-0
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+25
-0
scripts/mysql_install_db.sh
scripts/mysql_install_db.sh
+5
-4
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+1
-0
sql/item_func.cc
sql/item_func.cc
+6
-8
storage/innobase/btr/btr0cur.cc
storage/innobase/btr/btr0cur.cc
+2
-1
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+8
-41
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+0
-67
storage/innobase/handler/ha_innodb.h
storage/innobase/handler/ha_innodb.h
+1
-5
storage/innobase/include/fts0fts.h
storage/innobase/include/fts0fts.h
+12
-11
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+15
-1
No files found.
mysql-test/suite/federated/rpl.test
View file @
7b97020d
source
have_federatedx
.
inc
;
source
include
/
have_binlog_format_row
.
inc
;
source
include
/
master
-
slave
.
inc
;
...
...
mysql-test/suite/innodb/r/page_reorganize.result
View file @
7b97020d
...
...
@@ -25,3 +25,10 @@ f1
disconnect con1;
connection default;
drop table t1;
#
# MDEV-27993 Assertion failed in btr_page_reorganize_low()
#
CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
SET DEBUG_DBUG = '+d,do_page_reorganize';
INSERT INTO t1 VALUES(0,0);
DROP TABLE t1;
mysql-test/suite/innodb/t/page_reorganize.test
View file @
7b97020d
...
...
@@ -53,4 +53,12 @@ connection default;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-27993 Assertion failed in btr_page_reorganize_low()
--
echo
#
CREATE
TABLE
t1
(
a
INT
PRIMARY
KEY
,
b
INT
UNIQUE
)
ENGINE
=
InnoDB
;
SET
DEBUG_DBUG
=
'+d,do_page_reorganize'
;
INSERT
INTO
t1
VALUES
(
0
,
0
);
DROP
TABLE
t1
;
--
source
include
/
wait_until_count_sessions
.
inc
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
View file @
7b97020d
...
...
@@ -289,3 +289,32 @@ ENGINE=InnoDB;
ALTER TABLE t1 ADD c SERIAL;
DROP TABLE t1;
# End of 10.3 tests
#
# MDEV-27582 Fulltext DDL decrements the FTS_DOC_ID value
#
CREATE TABLE t1 (
f1 INT NOT NULL PRIMARY KEY,
f2 VARCHAR(64), FULLTEXT ft(f2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
connect con1,localhost,root,,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1 WHERE f1 = 2;
ALTER TABLE t1 DROP INDEX ft;
ALTER TABLE t1 ADD FULLTEXT INDEX ft (f2);
INSERT INTO t1 VALUES (3, 'innodb fts search');
SET GLOBAL innodb_optimize_fulltext_only=ON;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
SET GLOBAL innodb_ft_aux_table = 'test/t1';
SELECT max(DOC_ID) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
max(DOC_ID)
3
SELECT * FROM t1 WHERE MATCH(f2) AGAINST("+innodb +search" IN BOOLEAN MODE);
f1 f2
3 innodb fts search
DROP TABLE t1;
disconnect con1;
SET GLOBAL innodb_optimize_fulltext_only=OFF;
SET GLOBAL innodb_ft_aux_table = default;
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
View file @
7b97020d
--enable-plugin-innodb-sys-tables
--innodb_ft_index_table
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
View file @
7b97020d
...
...
@@ -357,3 +357,28 @@ ALTER TABLE t1 ADD c SERIAL;
DROP
TABLE
t1
;
--
echo
# End of 10.3 tests
--
echo
#
--
echo
# MDEV-27582 Fulltext DDL decrements the FTS_DOC_ID value
--
echo
#
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
PRIMARY
KEY
,
f2
VARCHAR
(
64
),
FULLTEXT
ft
(
f2
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
,
'foo'
),(
2
,
'bar'
);
connect
(
con1
,
localhost
,
root
,,,);
START
TRANSACTION
WITH
CONSISTENT
SNAPSHOT
;
connection
default
;
DELETE
FROM
t1
WHERE
f1
=
2
;
ALTER
TABLE
t1
DROP
INDEX
ft
;
ALTER
TABLE
t1
ADD
FULLTEXT
INDEX
ft
(
f2
);
INSERT
INTO
t1
VALUES
(
3
,
'innodb fts search'
);
SET
GLOBAL
innodb_optimize_fulltext_only
=
ON
;
OPTIMIZE
TABLE
t1
;
SET
GLOBAL
innodb_ft_aux_table
=
'test/t1'
;
SELECT
max
(
DOC_ID
)
FROM
INFORMATION_SCHEMA
.
INNODB_FT_INDEX_TABLE
;
SELECT
*
FROM
t1
WHERE
MATCH
(
f2
)
AGAINST
(
"+innodb +search"
IN
BOOLEAN
MODE
);
DROP
TABLE
t1
;
disconnect
con1
;
SET
GLOBAL
innodb_optimize_fulltext_only
=
OFF
;
SET
GLOBAL
innodb_ft_aux_table
=
default
;
scripts/mysql_install_db.sh
View file @
7b97020d
...
...
@@ -512,10 +512,11 @@ then
args
=
"
$args
--user=
$user
"
fi
if
test
-n
"
$group
"
then
args
=
"
$args
--group=
$group
"
fi
#To be enabled if/when we enable --group as an option to mysqld
#if test -n "$group"
#then
# args="$args --group=$group"
#fi
if
test
-f
"
$ldata
/mysql/user.frm"
then
...
...
scripts/mysqld_safe.sh
View file @
7b97020d
...
...
@@ -703,6 +703,7 @@ then
if
test
"
$user
"
!=
"root"
-o
$SET_USER
=
1
then
USER_OPTION
=
"--user=
$user
"
# To be used if/when we enable --system-group as an option to mysqld
GROUP_OPTION
=
"--group=
$group
"
fi
if
test
-n
"
$open_files
"
...
...
sql/item_func.cc
View file @
7b97020d
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2009, 202
0
, MariaDB
Copyright (c) 2009, 202
2
, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -3406,6 +3406,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
thd
->
alloc
(
f_args
.
arg_count
*
sizeof
(
Item_result
))))
{
err_exit:
free_udf
(
u_d
);
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -3445,7 +3446,8 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
func
->
used_tables_and_const_cache_join
(
item
);
f_args
.
arg_type
[
i
]
=
item
->
result_type
();
}
if
(
!
(
buffers
=
new
(
thd
->
mem_root
)
String
[
arg_count
])
||
buffers
=
new
(
thd
->
mem_root
)
String
[
arg_count
];
if
(
!
buffers
||
!
multi_alloc_root
(
thd
->
mem_root
,
&
f_args
.
args
,
arg_count
*
sizeof
(
char
*
),
&
f_args
.
lengths
,
arg_count
*
sizeof
(
long
),
...
...
@@ -3454,10 +3456,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
&
f_args
.
attributes
,
arg_count
*
sizeof
(
char
*
),
&
f_args
.
attribute_lengths
,
arg_count
*
sizeof
(
long
),
NullS
))
{
free_udf
(
u_d
);
DBUG_RETURN
(
TRUE
);
}
goto
err_exit
;
}
if
(
func
->
fix_length_and_dec
())
DBUG_RETURN
(
TRUE
);
...
...
@@ -3525,8 +3524,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
{
my_error
(
ER_CANT_INITIALIZE_UDF
,
MYF
(
0
),
u_d
->
name
.
str
,
init_msg_buff
);
free_udf
(
u_d
);
DBUG_RETURN
(
TRUE
);
goto
err_exit
;
}
func
->
max_length
=
MY_MIN
(
initid
.
max_length
,
MAX_BLOB_WIDTH
);
func
->
maybe_null
=
initid
.
maybe_null
;
...
...
storage/innobase/btr/btr0cur.cc
View file @
7b97020d
...
...
@@ -3,7 +3,7 @@
Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2015, 202
1
, MariaDB Corporation.
Copyright (c) 2015, 202
2
, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
...
...
@@ -3565,6 +3565,7 @@ btr_cur_optimistic_insert(
<<
ib
::
hex
(
thr
?
thr
->
graph
->
trx
->
id
:
0
)
<<
' '
<<
rec_printer
(
entry
).
str
());
DBUG_EXECUTE_IF
(
"do_page_reorganize"
,
if
(
n_recs
)
btr_page_reorganize
(
page_cursor
,
index
,
mtr
););
/* Now, try the insert */
...
...
storage/innobase/fts/fts0fts.cc
View file @
7b97020d
...
...
@@ -231,18 +231,6 @@ fts_add_doc_by_id(
/*==============*/
fts_trx_table_t
*
ftt
,
/*!< in: FTS trx table */
doc_id_t
doc_id
);
/*!< in: doc id */
/******************************************************************//**
Update the last document id. This function could create a new
transaction to update the last document id.
@return DB_SUCCESS if OK */
static
dberr_t
fts_update_sync_doc_id
(
/*===================*/
const
dict_table_t
*
table
,
/*!< in: table */
doc_id_t
doc_id
,
/*!< in: last document id */
trx_t
*
trx
)
/*!< in: update trx, or NULL */
MY_ATTRIBUTE
((
nonnull
(
1
)));
/** Tokenize a document.
@param[in,out] doc document to tokenize
...
...
@@ -2540,27 +2528,6 @@ fts_get_max_cache_size(
}
#endif
/*********************************************************************//**
Update the next and last Doc ID in the CONFIG table to be the input
"doc_id" value (+ 1). We would do so after each FTS index build or
table truncate */
void
fts_update_next_doc_id
(
/*===================*/
trx_t
*
trx
,
/*!< in/out: transaction */
const
dict_table_t
*
table
,
/*!< in: table */
doc_id_t
doc_id
)
/*!< in: DOC ID to set */
{
table
->
fts
->
cache
->
synced_doc_id
=
doc_id
;
table
->
fts
->
cache
->
next_doc_id
=
doc_id
+
1
;
table
->
fts
->
cache
->
first_doc_id
=
table
->
fts
->
cache
->
next_doc_id
;
fts_update_sync_doc_id
(
table
,
table
->
fts
->
cache
->
synced_doc_id
,
trx
);
}
/*********************************************************************//**
Get the next available document id.
@return DB_SUCCESS if OK */
...
...
@@ -2719,17 +2686,17 @@ fts_cmp_set_sync_doc_id(
return
(
error
);
}
/*********************************************************************//**
Update the last document id. This function could create a new
/** Update the last document id. This function could create a new
transaction to update the last document id.
@return DB_SUCCESS if OK */
static
@param table table to be updated
@param doc_id last document id
@param trx update trx or null
@retval DB_SUCCESS if OK */
dberr_t
fts_update_sync_doc_id
(
/*===================*/
const
dict_table_t
*
table
,
/*!< in: table */
doc_id_t
doc_id
,
/*!< in: last document id */
trx_t
*
trx
)
/*!< in: update trx, or NULL */
const
dict_table_t
*
table
,
doc_id_t
doc_id
,
trx_t
*
trx
)
{
byte
id
[
FTS_MAX_ID_LEN
];
pars_info_t
*
info
;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
7b97020d
...
...
@@ -2678,63 +2678,6 @@ innobase_next_autoinc(
return
(
~
(
ulonglong
)
0
);
}
/********************************************************************//**
Reset the autoinc value in the table.
@return DB_SUCCESS if all went well else error code */
UNIV_INTERN
dberr_t
ha_innobase
::
innobase_reset_autoinc
(
/*================================*/
ulonglong
autoinc
)
/*!< in: value to store */
{
dberr_t
error
;
error
=
innobase_lock_autoinc
();
if
(
error
==
DB_SUCCESS
)
{
dict_table_autoinc_initialize
(
m_prebuilt
->
table
,
autoinc
);
m_prebuilt
->
table
->
autoinc_mutex
.
unlock
();
}
return
(
error
);
}
/*******************************************************************//**
Reset the auto-increment counter to the given value, i.e. the next row
inserted will get the given value. This is called e.g. after TRUNCATE
is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is
returned by storage engines that don't support this operation.
@return 0 or error code */
UNIV_INTERN
int
ha_innobase
::
reset_auto_increment
(
/*==============================*/
ulonglong
value
)
/*!< in: new value for table autoinc */
{
DBUG_ENTER
(
"ha_innobase::reset_auto_increment"
);
dberr_t
error
;
update_thd
(
ha_thd
());
error
=
row_lock_table_autoinc_for_mysql
(
m_prebuilt
);
if
(
error
!=
DB_SUCCESS
)
{
DBUG_RETURN
(
convert_error_code_to_mysql
(
error
,
m_prebuilt
->
table
->
flags
,
m_user_thd
));
}
/* The next value can never be 0. */
if
(
value
==
0
)
{
value
=
1
;
}
innobase_reset_autoinc
(
value
);
DBUG_RETURN
(
0
);
}
/*********************************************************************//**
Initializes some fields in an InnoDB transaction object. */
static
...
...
@@ -9103,16 +9046,6 @@ ha_innobase::delete_row(
error
,
m_prebuilt
->
table
->
flags
,
m_user_thd
));
}
/** Delete all rows from the table.
@return error number or 0 */
int
ha_innobase
::
delete_all_rows
()
{
DBUG_ENTER
(
"ha_innobase::delete_all_rows"
);
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
/**********************************************************************//**
Removes a new lock set on a row, if it was not read optimistically. This can
be called after a row has been read in the processing of an UPDATE or a DELETE
...
...
storage/innobase/handler/ha_innodb.h
View file @
7b97020d
/*****************************************************************************
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 202
1
, MariaDB Corporation.
Copyright (c) 2013, 202
2
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -105,8 +105,6 @@ class ha_innobase final: public handler
double
read_time
(
uint
index
,
uint
ranges
,
ha_rows
rows
)
override
;
int
delete_all_rows
()
override
;
int
write_row
(
const
uchar
*
buf
)
override
;
int
update_row
(
const
uchar
*
old_data
,
const
uchar
*
new_data
)
override
;
...
...
@@ -239,7 +237,6 @@ class ha_innobase final: public handler
ulonglong
nb_desired_values
,
ulonglong
*
first_value
,
ulonglong
*
nb_reserved_values
)
override
;
int
reset_auto_increment
(
ulonglong
value
)
override
;
bool
get_error_message
(
int
error
,
String
*
buf
)
override
;
...
...
@@ -449,7 +446,6 @@ class ha_innobase final: public handler
dberr_t
innobase_lock_autoinc
();
ulonglong
innobase_peek_autoinc
();
dberr_t
innobase_set_max_autoinc
(
ulonglong
auto_inc
);
dberr_t
innobase_reset_autoinc
(
ulonglong
auto_inc
);
/** Resets a query execution 'template'.
@see build_template() */
...
...
storage/innobase/include/fts0fts.h
View file @
7b97020d
...
...
@@ -402,17 +402,6 @@ fts_get_next_doc_id(
/*================*/
const
dict_table_t
*
table
,
/*!< in: table */
doc_id_t
*
doc_id
);
/*!< out: new document id */
/*********************************************************************//**
Update the next and last Doc ID in the CONFIG table to be the input
"doc_id" value (+ 1). We would do so after each FTS index build or
table truncate */
void
fts_update_next_doc_id
(
/*===================*/
trx_t
*
trx
,
/*!< in/out: transaction */
const
dict_table_t
*
table
,
/*!< in: table */
doc_id_t
doc_id
)
/*!< in: DOC ID to set */
MY_ATTRIBUTE
((
nonnull
(
2
)));
/******************************************************************//**
Create a new fts_doc_ids_t.
...
...
@@ -964,4 +953,16 @@ bool fts_check_aux_table(const char *name,
table_id_t
*
table_id
,
index_id_t
*
index_id
);
/** Update the last document id. This function could create a new
transaction to update the last document id.
@param table table to be updated
@param doc_id last document id
@param trx update trx or null
@retval DB_SUCCESS if OK */
dberr_t
fts_update_sync_doc_id
(
const
dict_table_t
*
table
,
doc_id_t
doc_id
,
trx_t
*
trx
)
MY_ATTRIBUTE
((
nonnull
(
1
)));
#endif
/*!< fts0fts.h */
storage/innobase/row/row0merge.cc
View file @
7b97020d
...
...
@@ -2861,7 +2861,21 @@ row_merge_read_clustered_index(
err
=
fts_sync_table
(
const_cast
<
dict_table_t
*>
(
new_table
));
if
(
err
==
DB_SUCCESS
)
{
fts_update_next_doc_id
(
NULL
,
new_table
,
max_doc_id
);
new_table
->
fts
->
cache
->
synced_doc_id
=
max_doc_id
;
/* Update the max value as next FTS_DOC_ID */
if
(
max_doc_id
>=
new_table
->
fts
->
cache
->
next_doc_id
)
{
new_table
->
fts
->
cache
->
next_doc_id
=
max_doc_id
+
1
;
}
new_table
->
fts
->
cache
->
first_doc_id
=
new_table
->
fts
->
cache
->
next_doc_id
;
err
=
fts_update_sync_doc_id
(
new_table
,
new_table
->
fts
->
cache
->
synced_doc_id
,
NULL
);
}
}
...
...
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