Currently I am using MariaDB 10.1. I have tables with persistent columns that derive the date value from a timestamp. I understand this is no longer possible in MariaDB 10.3.
... dataDt date AS (date(from_unixtime(timestamp_int))) PERSISTENT,
How can I do the same in MariaDB 10.3?
Thanks for your help!
Related
When installing/updating AzerothCore sometimes one encounters errors such as:
[ERROR]: In mysql_stmt_prepare() id: 3, sql:
[ERROR]: Unknown column 'entry' in 'field list'
[ERROR]: Unknown column 'dmg_multiplier' in 'field list'
[ERROR]: Table 'acore_world.graveyard_zone' doesn't exist
[ERROR]: Unknown column 'mindmg' in 'field list'
ERROR: Your database structure is not up to date. Please make sure you've executed all queries in the sql/updates folders.
this usually means the database structure is not up to date.
More specifically, the local DB version is not aligned with the local core version.
This leads to the following questions:
How to check whether the DB is up to date or not?
How to understand what DB SQL updates are missing per each DB?
UPDATE 2021:
The latest AzerothCore has now the automated DB updater integrated inside the core.
You just need to enable it via worldserver.conf by setting:
Updates.EnableDatabases = 7
Then your worldserver process will automatically update all DBs for you.
You need latest AC to get this feature.
Original answer and explanation:
AzerothCore has three databases: auth, characters and world. All of them need to be properly up to date in order to start the server application.
Each database has a table version_db_xxxx which holds information about the database version inside its last column's name.
auth DB has the version_db_auth table
characters DB has the version_db_characters table
world DB has the version_db_world table
The database version will be expressed in the format of YYYY_MM_DD_XX which is basically a date followed by a number (XX).
This value will be the name of the last column of such tables and it corresponds to the name of the last SQL update file that has been applied to that database.
The SQL update files can be found in the azerothcore-wotlk/data/sql/updates/db_xxxx/ directory (where xxx is the database name):
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_auth
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_characters
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_world
To make sure the database is up to date, one should compare (per each database):
the last column name of the version_db_xxxx table
the most recent sql file name contained in data/sql/updates/db_xxxx
(most recent in terms of most recent date. If the date is the same, the file having the highest pending number is the most recent)
If the values are the same, then the DB is up to date. Otherwise, the DB needs to be updated by importing all missing SQL update files in order.
I used this schema to create Spring batch tables in MariaDB - https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql.
BATCH_JOB_EXECUTION_PARAMS table fails with below error
Error: (conn=10719030) This table type requires a primary key
SQLState: 42000
ErrorCode: 1173
Add PRIMARY KEY(JOB_EXECUTION_ID, KEY_NAME) to BATCH_JOB_EXECUTION_PARAMS if that combination is Unique.
BATCH_JOB_EXECUTION_SEQ also has no PK. The UNIQUE key could be promoted to be the PK. (Ditto for some other tables.) That particular table is rather weird -- it turns a 1-byte UNIQUE_KEY into an 8-byte id!?!
BATCH_JOB_EXECUTION_PARAMS is a pretty awful variant of the classic EAV schema.
MySQL and MariaDB are different products and it looks like they behave differently in regards to primary keys. You are using the MySQL DDL script against a MariaDB server which is not officially supported by Spring Batch.
So either adapt the script accordingly (by adding the primary keys manually) and be aware that Spring Batch would not necessarily work as expected since it does not support MariaDB officially, or open a feature request in the JIRA of the project to request support for MariaDB.
From MariaDB KB:
mysqldump does not read historical rows from versioned tables, and so
historical data will not be backed up. Also, a restore of the
timestamps would not be possible as they cannot be defined by an
insert/a user.
Not being able to set the system start/end timestamps, I can see no way to migrate existing tables which now track start/end manually.
Doesn't this mean that the AS OF feature is really only useful for new databases or am I missing some way around the limitation?
AUD$ table holds all the database audit information in Oracle Database. And by default it resides in SYSTEM tablespace.
From research I know that using DBMS_AUDIT_MGMT, it is possible to move the AUD$ table to the other tablespace.
My question is, whether or not it is supported by Oracle?
And will there be any issues if I move the AUD$ table out of SYSTEM tablespace?
Yes. (see Doc ID 1328239.1 f from Oracle Support)
I remember once i had temporary data used on a webpage. I used php and mysql to create a table that stored visitors ips and the port they requested. I didnt care how long they lasted because after 10mins or an hour the data would no longer be relevant. I cant remember how i did it but using sqlite instead...
How do i create a table for rows meant to be stored in ram only for a limited amount of time (a few minutes) using sqlite? Using C# .NET
You could use the following connection string: Data Source=:memory:;Version=3;New=True. It is important to note that a memory database exists as long as the connection remains open.