# Merging with a Merge Tree

{% hint style="info" %}
This page contains background information for MariaDB developers.
{% endhint %}

If you have a [merge tree](/docs/server/reference/product-development/mariadb-internals/mariadb-internals-documentation-merging-into-mariadb/creating-a-new-merge-tree.md), you merge into MariaDB as follows:

1. MariaDB merge trees are in the [mergetrees](https://github.com/MariaDB/mergetrees) repository. Add it as a new remote:

```
git remote add merge https://github.com/MariaDB/mergetrees
```

1. Check out the branch you want to update and merge, for example:

```
git checkout merge-innodb-5.6
```

1. delete everything in the branch
2. download the latest released source tarball, unpack it, copy files into the repository:

* for InnoDB-5.6: use the content of the `storage/innobase/` of the latest MySQL 5.6 source release tarball.
* for performance schema 5.6: use `storage/perfschema`, `include/mysql/psi`, `mysql-test/suite/perfschema`, and `mysql-test/suite/perfschema_stress` from the latest MySQL 5.6 source release tarball.
* for SphinxSE: use `mysqlse/` subdirectory from the latest Sphinx source release tarball.
* for XtraDB: use the content of the `storage/innobase/` of the latest Percona-Server source release tarball (5.5 or 5.6 as appropriate).
* for pcre: simply unpack the latest pcre release source tarball into the repository, rename `pcre-X-XX/` to `pcre`.

1. Now `git add .`, `git commit` (use the tarball version as a comment), `git push`
2. merge this branch into MariaDB
3. Sometimes after a merge, some changes may be needed:

* for performance schema 5.6: update `storage/perfschema/ha_perfschema.cc`, plugin version under `maria_declare_plugin`.
* for InnoDB-5.6: update `storage/innobase/include/univ.i`, setting `INNODB_VERSION_MAJOR`, `INNODB_VERSION_MINOR`, `INNODB_VERSION_BUGFIX` to whatever MySQL version you were merging from.
* for XtraDB-5.5: update `storage/xtradb/include/univ.i`, setting `PERCONA_INNODB_VERSION`, `INNODB_VERSION_STR` to whatever Percona-Server version you were merging from.
* for XtraDB-5.6: update `storage/xtradb/include/univ.i`, setting `PERCONA_INNODB_VERSION`, `INNODB_VERSION_MAJOR`, `INNODB_VERSION_MINOR`, `INNODB_VERSION_BUGFIX` to whatever Percona-Server version you were merging from.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/product-development/mariadb-internals/mariadb-internals-documentation-merging-into-mariadb/merging-with-a-merge-tree.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
