/*M!999999\- enable the sandbox mode */ 
-- MariaDB dump 10.19  Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: 
-- ------------------------------------------------------
-- Server version	10.11.14-MariaDB-0+deb12u2

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `bestelldatenbank`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `bestelldatenbank` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `bestelldatenbank`;

--
-- Table structure for table `artikel`
--

DROP TABLE IF EXISTS `artikel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `artikel` (
  `anr` int(11) NOT NULL AUTO_INCREMENT,
  `gnr` int(11) NOT NULL,
  `name` varchar(30) DEFAULT NULL,
  `preis` decimal(6,2) DEFAULT NULL,
  PRIMARY KEY (`anr`),
  KEY `gnr` (`gnr`),
  CONSTRAINT `artikel_ibfk_1` FOREIGN KEY (`gnr`) REFERENCES `gruppen` (`gnr`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `artikel`
--

LOCK TABLES `artikel` WRITE;
/*!40000 ALTER TABLE `artikel` DISABLE KEYS */;
INSERT INTO `artikel` VALUES
(1,1,'Stehlampe',19.90),
(2,1,'Tischlampe',14.90),
(3,1,'Klemmlampe',9.90),
(4,1,'Glühlampe 25 Watt',1.50),
(5,1,'Glühlampe 40 Watt',1.65),
(6,1,'Glühlampe 60 Watt',1.85),
(7,1,'Glühlampe 100 Watt',2.15),
(8,2,'Hammer 500g',4.90),
(9,2,'Hammer 1000g',8.90),
(10,2,'Zimmermannssäge',34.90),
(11,2,'Metallsäge',9.90),
(12,2,'Kneifzange',7.50),
(13,3,'Dispersion 5k',12.30),
(14,3,'Dispersion 12k',22.30),
(15,3,'Leimfarbe 1k',4.30),
(16,3,'Tapete 10m',8.50),
(17,3,'Tapete 5m',5.00),
(18,5,'Tischlerplatte 1600x800x30',139.90),
(19,5,'Kiefernbrett 1600x200x20',3.50),
(20,5,'Kiefernbrett 1800x200x20',4.50),
(21,5,'Kiefernbrett 2000x200x20',5.50);
/*!40000 ALTER TABLE `artikel` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `bestellungen`
--

DROP TABLE IF EXISTS `bestellungen`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `bestellungen` (
  `bnr` int(11) NOT NULL AUTO_INCREMENT,
  `knr` int(11) NOT NULL,
  `bdat` date DEFAULT NULL,
  `versand` decimal(6,2) DEFAULT NULL,
  `mwstsatz` float DEFAULT NULL,
  PRIMARY KEY (`bnr`),
  KEY `knr` (`knr`),
  CONSTRAINT `bestellungen_ibfk_1` FOREIGN KEY (`knr`) REFERENCES `kunden` (`knr`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `bestellungen`
--

LOCK TABLES `bestellungen` WRITE;
/*!40000 ALTER TABLE `bestellungen` DISABLE KEYS */;
INSERT INTO `bestellungen` VALUES
(1,1,'2021-01-05',12.00,0.19),
(2,2,'2021-01-07',20.00,0.19),
(3,3,'2021-01-08',10.00,0.19),
(4,1,'2021-01-11',10.00,0.19),
(5,4,'2021-01-13',22.00,0.19),
(6,5,'2021-01-14',12.00,0.19),
(7,2,'2021-01-15',10.00,0.19),
(8,6,'2021-01-21',20.00,0.19);
/*!40000 ALTER TABLE `bestellungen` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `gruppen`
--

DROP TABLE IF EXISTS `gruppen`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `gruppen` (
  `gnr` int(11) NOT NULL AUTO_INCREMENT,
  `gruppe` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`gnr`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `gruppen`
--

LOCK TABLES `gruppen` WRITE;
/*!40000 ALTER TABLE `gruppen` DISABLE KEYS */;
INSERT INTO `gruppen` VALUES
(1,'Beleuchtung'),
(2,'Werkzeug'),
(3,'Farben'),
(4,'Werkstoff'),
(5,'Holz');
/*!40000 ALTER TABLE `gruppen` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `kunden`
--

DROP TABLE IF EXISTS `kunden`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kunden` (
  `knr` int(11) NOT NULL AUTO_INCREMENT,
  `firma` varchar(20) NOT NULL,
  `firma2` varchar(20) DEFAULT NULL,
  `strasse` varchar(20) DEFAULT NULL,
  `plz` varchar(8) DEFAULT NULL,
  `ort` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`knr`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `kunden`
--

LOCK TABLES `kunden` WRITE;
/*!40000 ALTER TABLE `kunden` DISABLE KEYS */;
INSERT INTO `kunden` VALUES
(1,'Behrens','Haushaltsbedarf','Elbstrasse 22','21234','Hamburg'),
(2,'Martens','Werkzeuge','Hafenstr. 45','31232','Hamburg'),
(3,'Schmidt','','Blumenstr. 1','20123','Hamburg'),
(4,'Schmied','Haushaltsbedarf','Rathausmarkt 4','22312','Hamburg'),
(5,'Schmitt','Elektroger','Mittelweg 99','90123','Hamburg'),
(6,'Jahnke','Electroartikel','Buchenstr. 3','11123','Hamburg');
/*!40000 ALTER TABLE `kunden` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `positionen`
--

DROP TABLE IF EXISTS `positionen`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `positionen` (
  `bnr` int(11) NOT NULL,
  `anr` int(11) NOT NULL,
  `anzahl` int(11) DEFAULT NULL,
  KEY `bnr` (`bnr`),
  KEY `anr` (`anr`),
  CONSTRAINT `positionen_ibfk_1` FOREIGN KEY (`bnr`) REFERENCES `bestellungen` (`bnr`),
  CONSTRAINT `positionen_ibfk_2` FOREIGN KEY (`anr`) REFERENCES `artikel` (`anr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `positionen`
--

LOCK TABLES `positionen` WRITE;
/*!40000 ALTER TABLE `positionen` DISABLE KEYS */;
INSERT INTO `positionen` VALUES
(1,1,5),
(1,3,6),
(1,4,15),
(1,9,1),
(2,1,5),
(2,5,1),
(3,1,10),
(3,6,3),
(4,13,2),
(4,11,5),
(5,18,4),
(5,10,2),
(5,8,1),
(6,7,5),
(6,17,15),
(7,5,3),
(7,20,1),
(7,16,8),
(7,4,10),
(7,14,5),
(8,2,3),
(8,12,6),
(8,9,2),
(8,10,1),
(8,1,1),
(8,19,5),
(8,13,10),
(8,18,2);
/*!40000 ALTER TABLE `positionen` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `dummydb`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `dummydb` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */;

USE `dummydb`;

--
-- Current Database: `kursverwaltung`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `kursverwaltung` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci */;

USE `kursverwaltung`;

--
-- Table structure for table `buchung`
--

DROP TABLE IF EXISTS `buchung`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `buchung` (
  `bnummer` int(11) NOT NULL AUTO_INCREMENT,
  `termnr` int(10) unsigned NOT NULL,
  `tnummer` int(10) unsigned NOT NULL,
  PRIMARY KEY (`bnummer`),
  KEY `termnr` (`termnr`),
  KEY `tnummer` (`tnummer`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `buchung`
--

LOCK TABLES `buchung` WRITE;
/*!40000 ALTER TABLE `buchung` DISABLE KEYS */;
INSERT INTO `buchung` VALUES
(1,3,3),
(2,3,10),
(3,4,11),
(4,4,15);
/*!40000 ALTER TABLE `buchung` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `dozenten`
--

DROP TABLE IF EXISTS `dozenten`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `dozenten` (
  `doznr` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL,
  `vname` varchar(40) DEFAULT NULL,
  `plz` varchar(5) DEFAULT NULL,
  `ort` varchar(40) DEFAULT NULL,
  `strasse` varchar(40) DEFAULT NULL,
  `hausnr` varchar(5) DEFAULT NULL,
  `telefon1` varchar(15) DEFAULT NULL,
  `telefon2` varchar(15) DEFAULT NULL,
  `email` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`doznr`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dozenten`
--

LOCK TABLES `dozenten` WRITE;
/*!40000 ALTER TABLE `dozenten` DISABLE KEYS */;
INSERT INTO `dozenten` VALUES
(1,'Bertram','Frank','72072','Tübingen','Schillerstraße','16','01624545878',NULL,'info@frank-bertram.de'),
(2,'Bruns','Claudia','20144','Hamburg','Lange Gasse','2','231485566',NULL,'bruns@gnx.de'),
(3,'Weber','Hubertus','50124','Köln','Schillerstraße','14','1795544661',NULL,'hweber@tonline.com'),
(4,'Kalender','Sabine','28355','Bremen','Gotheweg','3','1659955881',NULL,'info@kalender.eu'),
(5,'Rückert','Jörg','70501','Stuttgart','Gustav-Mahler-Straße','152','71124578',NULL,'jrueckert@wub.de'),
(6,'Machowski','Michaela','50667','Köln','Neumarkt','10','1732254789',NULL,'michaela@machowski.de'),
(7,'Schmidt','Christian','44141','Dortmund','Wambeler Hellweg','99','231123456',NULL,'kontakt@chr-schmidt.de'),
(8,'Achenbach','Johannes','20144','Hamburg','Lange Straße','23','40987554',NULL,'j.achenbach@online.com'),
(9,'Fischer','Bernd','70501','Stuttgart','Bahnhofstraße','67','1721144556',NULL,'bernd@fischer-learn.de'),
(10,'Schuster','Elke','20253','Hamburg','Grüner Weg','19','40118866',NULL,'elkeschuster@gmy.com'),
(11,'Schneider','Thomas','50667','Köln','Rheingasse','141','221649731',NULL,'tomschneider@gnx.de');
/*!40000 ALTER TABLE `dozenten` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `kurs`
--

DROP TABLE IF EXISTS `kurs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kurs` (
  `kursnr` int(11) NOT NULL AUTO_INCREMENT,
  `ressort` varchar(20) DEFAULT NULL,
  `titel` varchar(40) NOT NULL,
  `beschreibung` varchar(255) DEFAULT NULL,
  `preis` decimal(6,2) unsigned DEFAULT NULL,
  PRIMARY KEY (`kursnr`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `kurs`
--

LOCK TABLES `kurs` WRITE;
/*!40000 ALTER TABLE `kurs` DISABLE KEYS */;
INSERT INTO `kurs` VALUES
(1,'EDV','Einführung Datenbanken','Einführung in relationale Datenbankmanagementsysteme',399.50),
(2,'EDV','Einführung in Visual Basic','Einführung in die Programmierung mit Visual Basic (Visual Studio 2017)',459.50),
(3,'KAUFM','Bilanzbuchhaltung ','Grundlagen Teil 1',599.00),
(4,'EDV','JavaScript','Clientseitige Programmierung mit JavaScript',449.00),
(5,'KAUFM','Kaufmännisches Rechnen I','Einführung in kaufmännisches Rechnen - Teil 1',299.00);
/*!40000 ALTER TABLE `kurs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `teilnehmer`
--

DROP TABLE IF EXISTS `teilnehmer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teilnehmer` (
  `tnummer` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL,
  `vname` varchar(40) DEFAULT NULL,
  `plz` varchar(5) DEFAULT NULL,
  `ort` varchar(40) DEFAULT NULL,
  `strasse` varchar(40) DEFAULT NULL,
  `hausnr` varchar(5) DEFAULT NULL,
  `telefon1` varchar(15) DEFAULT NULL,
  `telefon2` varchar(15) DEFAULT NULL,
  `email` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`tnummer`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `teilnehmer`
--

LOCK TABLES `teilnehmer` WRITE;
/*!40000 ALTER TABLE `teilnehmer` DISABLE KEYS */;
INSERT INTO `teilnehmer` VALUES
(1,'Maier','Josef','44141','Dortmund','Hansemannstraße ','47','231445566','55667788','meier@abc.de'),
(2,'Rüschmann','Reiner','50124','Köln','Am Dom','14','1625544661','04034204',NULL),
(3,'Bender','Claudia','28355','Bremen','Weserstraße','3','1759955881','55667788','c.bender@tonline.com'),
(5,'Müller','Frank','50667','Köln','Heumarkt','10','1732254789','55667788','fmueller@gmy.de'),
(6,'Schmidt','Olaf','20537','Hamburg','Abendrothsweg','99','40123456','04034204','derolaf@wub.de'),
(7,'Köster','Christine','20144','Hamburg','Lange Strasse','23','40987654','',''),
(8,'Borowski','Thomas','28456','Bremen','Kurze Straße','1','40987554','04034204','tombo@hitmail.com'),
(9,'Schulze','Klaus','44357','Dortmund','Mengeder Straße','648','231998866','55667788','k.schulze@tonline.com'),
(10,'Schneyder','Stefanie','50667','Köln','Rheingasse','2','221649731','04034204','steffi72@wub.de'),
(11,'Schulze','Fritz','39108','Magdeburg','Hagebuttenplatz','5','039201214','55667788','fschulze@wub.de'),
(12,'Jäger','Melanie','44556','Kleinstadt','Große Straße','22','045678926','04034204','melly@nieoffline.de'),
(13,'Müller','Fritz','52958','Münster','Gothestraße','58','025212564','55667788','muellerfritz@t-offline.com'),
(15,'Schulze','Janette','44556','Kleinstadt','Hagebuttenplätzchen','5',NULL,'55667788','janette.schulze@wub.de');
/*!40000 ALTER TABLE `teilnehmer` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `termine`
--

DROP TABLE IF EXISTS `termine`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `termine` (
  `termnr` int(11) NOT NULL AUTO_INCREMENT,
  `kursnr` int(11) DEFAULT NULL,
  `doznr` int(11) DEFAULT NULL,
  `beginn` date DEFAULT NULL,
  `ende` date DEFAULT NULL,
  `dauer` varchar(20) DEFAULT NULL,
  `minanzahl` int(11) DEFAULT NULL,
  `maxanzahl` int(11) DEFAULT NULL,
  `vort` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`termnr`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `termine`
--

LOCK TABLES `termine` WRITE;
/*!40000 ALTER TABLE `termine` DISABLE KEYS */;
INSERT INTO `termine` VALUES
(1,1,8,'2021-11-22','2021-11-24','24',5,12,'7'),
(2,2,6,'2021-12-04','2021-12-06','24',5,12,'21'),
(3,4,5,'2021-10-16','2021-10-17','16',8,15,'2'),
(4,2,2,'2022-01-02','2022-01-03','24',5,12,'7');
/*!40000 ALTER TABLE `termine` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `kverwaltung`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `kverwaltung` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `kverwaltung`;

--
-- Table structure for table `buchung`
--

DROP TABLE IF EXISTS `buchung`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `buchung` (
  `bnummer` int(11) NOT NULL AUTO_INCREMENT,
  `termnr` int(10) NOT NULL,
  `tnummer` int(10) NOT NULL,
  PRIMARY KEY (`bnummer`),
  KEY `termnr` (`termnr`),
  KEY `tnummer` (`tnummer`),
  KEY `termnr_2` (`termnr`),
  CONSTRAINT `buchung_ibfk_1` FOREIGN KEY (`termnr`) REFERENCES `termine` (`termnr`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `buchung`
--

LOCK TABLES `buchung` WRITE;
/*!40000 ALTER TABLE `buchung` DISABLE KEYS */;
INSERT INTO `buchung` VALUES
(1,3,3),
(2,3,10),
(3,4,11),
(4,4,15);
/*!40000 ALTER TABLE `buchung` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `dozenten`
--

DROP TABLE IF EXISTS `dozenten`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `dozenten` (
  `doznr` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL,
  `vname` varchar(40) DEFAULT NULL,
  `plz` varchar(5) DEFAULT NULL,
  `ort` varchar(40) DEFAULT NULL,
  `strasse` varchar(40) DEFAULT NULL,
  `hausnr` varchar(5) DEFAULT NULL,
  `telefon1` varchar(15) DEFAULT NULL,
  `telefon2` varchar(15) DEFAULT NULL,
  `email` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`doznr`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dozenten`
--

LOCK TABLES `dozenten` WRITE;
/*!40000 ALTER TABLE `dozenten` DISABLE KEYS */;
INSERT INTO `dozenten` VALUES
(1,'Bertram','Frank','72072','Tübingen','Schillerstraße','16','01624545878',NULL,'info@frank-bertram.de'),
(2,'Bruns','Claudia','20144','Hamburg','Lange Gasse','2','231485566',NULL,'bruns@gnx.de'),
(3,'Weber','Hubertus','50124','Köln','Schillerstraße','14','1795544661',NULL,'hweber@tonline.com'),
(4,'Kalender','Sabine','28355','Bremen','Gotheweg','3','1659955881',NULL,'info@kalender.eu'),
(5,'Rückert','Jörg','70501','Stuttgart','Gustav-Mahler-Straße','152','71124578',NULL,'jrueckert@wub.de'),
(6,'Machowski','Michaela','50667','Köln','Neumarkt','10','1732254789',NULL,'michaela@machowski.de'),
(7,'Schmidt','Christian','44141','Dortmund','Wambeler Hellweg','99','231123456',NULL,'kontakt@chr-schmidt.de'),
(8,'Achenbach','Johannes','20144','Hamburg','Lange Straße','23','40987554',NULL,'j.achenbach@online.com'),
(9,'Fischer','Bernd','70501','Stuttgart','Bahnhofstraße','67','1721144556',NULL,'bernd@fischer-learn.de'),
(10,'Schuster','Elke','20253','Hamburg','Grüner Weg','19','40118866',NULL,'elkeschuster@gmy.com'),
(11,'Schneider','Thomas','50667','Köln','Rheingasse','141','221649731',NULL,'tomschneider@gnx.de');
/*!40000 ALTER TABLE `dozenten` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `kurs`
--

DROP TABLE IF EXISTS `kurs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kurs` (
  `kursnr` int(11) NOT NULL AUTO_INCREMENT,
  `resnr` int(11) DEFAULT NULL,
  `titel` varchar(40) NOT NULL,
  `beschreibung` varchar(255) DEFAULT NULL,
  `preis` decimal(6,2) unsigned DEFAULT NULL,
  PRIMARY KEY (`kursnr`),
  KEY `resnr` (`resnr`),
  KEY `resnr_2` (`resnr`),
  CONSTRAINT `kurs_ibfk_1` FOREIGN KEY (`resnr`) REFERENCES `ressort` (`resnr`),
  CONSTRAINT `kurs_ibfk_2` FOREIGN KEY (`resnr`) REFERENCES `ressort` (`resnr`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `kurs`
--

LOCK TABLES `kurs` WRITE;
/*!40000 ALTER TABLE `kurs` DISABLE KEYS */;
INSERT INTO `kurs` VALUES
(1,1,'Einführung Datenbanken','Einführung in relationale Datenbankmanagementsysteme',399.50),
(2,1,'Einführung in Visual Basic','Einführung in die Programmierung mit Visual Basic (Visual Studio 2017)',459.50),
(3,2,'Bilanzbuchhaltung ','Grundlagen Teil 1',599.00),
(4,1,'JavaScript','Clientseitige Programmierung mit JavaScript',449.00),
(5,2,'Kaufmännisches Rechnen I','Einführung in kaufmännisches Rechnen - Teil 1',299.00),
(7,4,'Malen nach Zahlen','Malen mit Erfolgsgarantie',79.95);
/*!40000 ALTER TABLE `kurs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ressort`
--

DROP TABLE IF EXISTS `ressort`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ressort` (
  `resnr` int(11) NOT NULL AUTO_INCREMENT,
  `bezeichnung` varchar(10) NOT NULL,
  `info` varchar(100) NOT NULL,
  PRIMARY KEY (`resnr`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ressort`
--

LOCK TABLES `ressort` WRITE;
/*!40000 ALTER TABLE `ressort` DISABLE KEYS */;
INSERT INTO `ressort` VALUES
(1,'EDV','EDV Kurse'),
(2,'KFM','Kaufmännische Kurse'),
(3,'TEC','Techniker Kurse'),
(4,'CRE','Kreativ-Kurse');
/*!40000 ALTER TABLE `ressort` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `teilnehmer`
--

DROP TABLE IF EXISTS `teilnehmer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `teilnehmer` (
  `tnr` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL,
  `vname` varchar(40) DEFAULT NULL,
  `plz` varchar(5) DEFAULT NULL,
  `ort` varchar(40) DEFAULT NULL,
  `strasse` varchar(40) DEFAULT NULL,
  `hausnr` varchar(5) DEFAULT NULL,
  `telefon1` varchar(15) DEFAULT NULL,
  `telefon2` varchar(15) DEFAULT NULL,
  `email` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`tnr`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `teilnehmer`
--

LOCK TABLES `teilnehmer` WRITE;
/*!40000 ALTER TABLE `teilnehmer` DISABLE KEYS */;
INSERT INTO `teilnehmer` VALUES
(1,'Maier','Josef','44141','Dortmund','Hansemannstraße ','47','231445566','55667788','meier@abc.de'),
(2,'Rüschmann','Reiner','50124','Köln','Am Dom','14','1625544661','04034204',NULL),
(3,'Bender','Claudia','28355','Bremen','Weserstraße','3','1759955881','55667788','c.bender@tonline.com'),
(5,'Müller','Frank','50667','Köln','Heumarkt','10','1732254789','55667788','fmueller@gmy.de'),
(6,'Schmidt','Olaf','20537','Hamburg','Abendrothsweg','99','40123456','04034204','derolaf@wub.de'),
(8,'Borowski','Thomas','28456','Bremen','Kurze Straße','1','40987554','04034204','tombo@hitmail.com'),
(9,'Schulze','Klaus','44357','Dortmund','Mengeder Straße','648','231998866','55667788','k.schulze@tonline.com'),
(10,'Schneyder','Stefanie','50667','Köln','Rheingasse','2','221649731','04034204','steffi72@wub.de'),
(11,'Schulze','Fritz','39108','Magdeburg','Hagebuttenplatz','5','039201214','55667788','fschulze@wub.de'),
(12,'Jäger','Melanie','44556','Kleinstadt','Große Straße','22','045678926','04034204','melly@nieoffline.de'),
(13,'Müller','Fritz','52958','Münster','Gothestraße','58','025212564','55667788','muellerfritz@t-offline.com'),
(15,'Schulze','Janette','44556','Kleinstadt','Hagebuttenplätzchen','5',NULL,'55667788','janette.schulze@wub.de'),
(18,'Schulze','Fritz','39108','Magdeburg','Hagebuttenplatz','5','039201214','','fschulze@wub.de');
/*!40000 ALTER TABLE `teilnehmer` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `termine`
--

DROP TABLE IF EXISTS `termine`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `termine` (
  `termnr` int(11) NOT NULL AUTO_INCREMENT,
  `kursnr` int(11) DEFAULT NULL,
  `doznr` int(11) DEFAULT NULL,
  `beginn` date DEFAULT NULL,
  `ende` date DEFAULT NULL,
  `dauer` varchar(20) DEFAULT NULL,
  `minanzahl` int(11) DEFAULT NULL,
  `maxanzahl` int(11) DEFAULT NULL,
  `vort` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`termnr`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `termine`
--

LOCK TABLES `termine` WRITE;
/*!40000 ALTER TABLE `termine` DISABLE KEYS */;
INSERT INTO `termine` VALUES
(1,1,8,'2021-11-22','2021-11-24','24',5,12,'7'),
(2,2,6,'2021-12-04','2021-12-06','24',5,12,'21'),
(3,4,5,'2021-10-16','2021-10-17','16',8,15,'2'),
(4,2,2,'2022-01-02','2022-01-03','24',5,12,'7');
/*!40000 ALTER TABLE `termine` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `mysql`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `mysql`;

--
-- Table structure for table `general_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `slow_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
  `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user_host` mediumtext NOT NULL,
  `query_time` time(6) NOT NULL,
  `lock_time` time(6) NOT NULL,
  `rows_sent` bigint(20) unsigned NOT NULL,
  `rows_examined` bigint(20) unsigned NOT NULL,
  `db` varchar(512) NOT NULL,
  `last_insert_id` int(11) NOT NULL,
  `insert_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `sql_text` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `rows_affected` bigint(20) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Slow log';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `column_stats`
--

DROP TABLE IF EXISTS `column_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `column_stats` (
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `column_name` varchar(64) NOT NULL,
  `min_value` varbinary(255) DEFAULT NULL,
  `max_value` varbinary(255) DEFAULT NULL,
  `nulls_ratio` decimal(12,4) DEFAULT NULL,
  `avg_length` decimal(12,4) DEFAULT NULL,
  `avg_frequency` decimal(12,4) DEFAULT NULL,
  `hist_size` tinyint(3) unsigned DEFAULT NULL,
  `hist_type` enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') DEFAULT NULL,
  `histogram` longblob DEFAULT NULL,
  PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Columns';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `column_stats`
--

LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `columns_priv`
--

DROP TABLE IF EXISTS `columns_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `columns_priv` (
  `Host` char(255) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Table_name` char(64) NOT NULL DEFAULT '',
  `Column_name` char(64) NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Column privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `columns_priv`
--

LOCK TABLES `columns_priv` WRITE;
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
/*!40000 ALTER TABLE `columns_priv` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `db`
--

DROP TABLE IF EXISTS `db`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `db` (
  `Host` char(255) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Select_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Insert_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Update_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Delete_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Drop_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Grant_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `References_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Index_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_view_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Show_view_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Execute_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  `Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Host`,`Db`,`User`),
  KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `db`
--

LOCK TABLES `db` WRITE;
/*!40000 ALTER TABLE `db` DISABLE KEYS */;
INSERT INTO `db` VALUES
('localhost','phpmyadmin','phpmyadmin','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
/*!40000 ALTER TABLE `db` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `event`
--

DROP TABLE IF EXISTS `event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `event` (
  `db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `name` char(64) NOT NULL DEFAULT '',
  `body` longblob NOT NULL,
  `definer` varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `execute_at` datetime DEFAULT NULL,
  `interval_value` int(11) DEFAULT NULL,
  `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_executed` datetime DEFAULT NULL,
  `starts` datetime DEFAULT NULL,
  `ends` datetime DEFAULT NULL,
  `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
  `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
  `comment` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `originator` int(10) unsigned NOT NULL,
  `time_zone` char(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'SYSTEM',
  `character_set_client` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `collation_connection` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `db_collation` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `body_utf8` longblob DEFAULT NULL,
  PRIMARY KEY (`db`,`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Events';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `func`
--

DROP TABLE IF EXISTS `func`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `func` (
  `name` char(64) NOT NULL DEFAULT '',
  `ret` tinyint(1) NOT NULL DEFAULT 0,
  `dl` char(128) NOT NULL DEFAULT '',
  `type` enum('function','aggregate') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User defined functions';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `func`
--

LOCK TABLES `func` WRITE;
/*!40000 ALTER TABLE `func` DISABLE KEYS */;
/*!40000 ALTER TABLE `func` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `global_priv`
--

DROP TABLE IF EXISTS `global_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `global_priv` (
  `Host` char(255) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Priv` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '{}' CHECK (json_valid(`Priv`)),
  PRIMARY KEY (`Host`,`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Users and global privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `global_priv`
--

LOCK TABLES `global_priv` WRITE;
/*!40000 ALTER TABLE `global_priv` DISABLE KEYS */;
INSERT INTO `global_priv` VALUES
('localhost','mariadb.sys','{\"access\":0,\"plugin\":\"mysql_native_password\",\"authentication_string\":\"\",\"account_locked\":true,\"password_last_changed\":0}'),
('localhost','root','{\"access\": 18446744073709551615, \"plugin\": \"mysql_native_password\", \"authentication_string\": \"*2F1B9B496C8CBFEA6BA0505E8FF63D97C3A28BED\", \"auth_or\": [{}, {\"plugin\": \"unix_socket\"}], \"password_last_changed\": 1752321212}'),
('localhost','mysql','{\"access\":18446744073709551615,\"plugin\":\"mysql_native_password\",\"authentication_string\":\"invalid\",\"auth_or\":[{},{\"plugin\":\"unix_socket\"}]}'),
('localhost','phpmyadmin','{\"access\":0,\"version_id\":101111,\"plugin\":\"mysql_native_password\",\"authentication_string\":\"*2F1B9B496C8CBFEA6BA0505E8FF63D97C3A28BED\",\"password_last_changed\":1752321289}');
/*!40000 ALTER TABLE `global_priv` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `gtid_slave_pos`
--

DROP TABLE IF EXISTS `gtid_slave_pos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `gtid_slave_pos` (
  `domain_id` int(10) unsigned NOT NULL,
  `sub_id` bigint(20) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `seq_no` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`domain_id`,`sub_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='Replication slave GTID position';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `gtid_slave_pos`
--

LOCK TABLES `gtid_slave_pos` WRITE;
/*!40000 ALTER TABLE `gtid_slave_pos` DISABLE KEYS */;
/*!40000 ALTER TABLE `gtid_slave_pos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `help_category`
--

DROP TABLE IF EXISTS `help_category`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `help_category` (
  `help_category_id` smallint(5) unsigned NOT NULL,
  `name` char(64) NOT NULL,
  `parent_category_id` smallint(5) unsigned DEFAULT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`help_category_id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='help categories';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `help_category`
--

LOCK TABLES `help_category` WRITE;
/*!40000 ALTER TABLE `help_category` DISABLE KEYS */;
INSERT INTO `help_category` VALUES
(1,'Contents',0,''),
(2,'Polygon Properties',34,''),
(3,'WKT',34,''),
(4,'Numeric Functions',37,''),
(5,'Plugins',1,''),
(6,'MBR',34,''),
(7,'Control Flow Functions',37,''),
(8,'Transactions',1,''),
(9,'Help Metadata',1,''),
(10,'Account Management',1,''),
(11,'Point Properties',34,''),
(12,'Encryption Functions',37,''),
(13,'LineString Properties',34,''),
(14,'Miscellaneous Functions',37,''),
(15,'Logical Operators',47,''),
(16,'Functions and Modifiers for Use with GROUP BY',1,''),
(17,'Information Functions',37,''),
(18,'Assignment Operators',47,''),
(19,'Comparison Operators',47,''),
(20,'Bit Functions',37,''),
(21,'Table Maintenance',1,''),
(22,'User-Defined Functions',1,''),
(23,'Data Types',1,''),
(24,'Compound Statements',1,''),
(25,'Geometry Constructors',34,''),
(26,'Administration',1,''),
(27,'Data Manipulation',1,''),
(28,'Utility',1,''),
(29,'Language Structure',1,''),
(30,'Geometry Relations',34,''),
(31,'Date and Time Functions',37,''),
(32,'WKB',34,''),
(33,'Procedures',1,''),
(34,'Geographic Features',1,''),
(35,'Geometry Properties',34,''),
(36,'String Functions',37,''),
(37,'Functions',1,''),
(38,'Data Definition',1,''),
(39,'Sequences',1,''),
(40,'JSON Functions',37,''),
(41,'Window Functions',37,''),
(42,'Spider Functions',37,''),
(43,'Dynamic Column Functions',37,''),
(44,'Galera Functions',37,''),
(45,'Temporal Tables',1,''),
(46,'GeoJSON',34,''),
(47,'Operators',1,''),
(48,'Arithmetic Operators',47,''),
(49,'Replication',1,''),
(50,'Prepared Statements',1,'');
/*!40000 ALTER TABLE `help_category` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `help_keyword`
--

DROP TABLE IF EXISTS `help_keyword`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `help_keyword` (
  `help_keyword_id` int(10) unsigned NOT NULL,
  `name` char(64) NOT NULL,
  PRIMARY KEY (`help_keyword_id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='help keywords';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `help_keyword`
--

LOCK TABLES `help_keyword` WRITE;
/*!40000 ALTER TABLE `help_keyword` DISABLE KEYS */;
INSERT INTO `help_keyword` VALUES
(1,'work'),
(2,'locks'),
(3,'locking'),
(4,'drop'),
(5,'super'),
(6,'usage'),
(7,'binlog admin'),
(8,'binlog monitor'),
(9,'binlog replay'),
(10,'connection admin'),
(11,'federated admin'),
(12,'grant option'),
(13,'read_only admin'),
(14,'replica monitor'),
(15,'replication replica'),
(16,'roles'),
(17,'values'),
(18,'value'),
(19,'not'),
(20,'and'),
(21,'or'),
(22,':='),
(23,'assignment operator'),
(24,'='),
(25,'!='),
(26,'<>'),
(27,'not equal'),
(28,'less than'),
(29,'less than or equal'),
(30,'NULL-safe equal'),
(31,'equal'),
(32,'greater than'),
(33,'greater than or equal'),
(34,'bitwise and'),
(35,'shift left'),
(36,'shift right'),
(37,'bitwise xor'),
(38,'bitwise or'),
(39,'bitwise not'),
(40,'returns'),
(41,'udfs'),
(42,'udf calling sequences'),
(43,'udf security'),
(44,'int1'),
(45,'int2'),
(46,'int3'),
(47,'integer'),
(48,'int4'),
(49,'int8'),
(50,'dec'),
(51,'numeric'),
(52,'fixed'),
(53,'number'),
(54,'real'),
(55,'double precision'),
(56,'nchar'),
(57,'long'),
(58,'long varchar'),
(59,'repeat'),
(60,'declare'),
(61,'cursor'),
(62,'show'),
(63,'columns'),
(64,'kill connection'),
(65,'kill query'),
(66,'delete returning'),
(67,'sql_big_result'),
(68,'minus'),
(69,'cte'),
(70,'insert returning'),
(71,'queries'),
(72,'query'),
(73,'explain format'),
(74,'explain format json'),
(75,'rlike'),
(76,'character_length'),
(77,'escape'),
(78,'mode'),
(79,'trim_oracle'),
(80,'schedule'),
(81,'row_format'),
(82,'starts'),
(83,'host'),
(84,'generated columns'),
(85,'virtual columns'),
(86,'computed columns'),
(87,'hidden columns'),
(88,'nextval'),
(89,'lastval'),
(90,'+'),
(91,'addition operator'),
(92,'/'),
(93,'division operator'),
(94,'%'),
(95,'modulo operator'),
(96,'*'),
(97,'multiplication operator'),
(98,'-'),
(99,'subtraction operator'),
(100,'master_ssl_verify_cert'),
(101,'start replica'),
(102,'stop replica'),
(103,'reset slave'),
(104,'reset replica'),
(105,'drop prepare'),
(106,'deallocate prepare');
/*!40000 ALTER TABLE `help_keyword` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `help_relation`
--

DROP TABLE IF EXISTS `help_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `help_relation` (
  `help_topic_id` int(10) unsigned NOT NULL,
  `help_keyword_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`help_keyword_id`,`help_topic_id`),
  KEY `help_topic_id` (`help_topic_id`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='keyword-topic relation';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `help_relation`
--

LOCK TABLES `help_relation` WRITE;
/*!40000 ALTER TABLE `help_relation` DISABLE KEYS */;
INSERT INTO `help_relation` VALUES
(94,1),
(98,2),
(100,2),
(102,2),
(117,2),
(149,2),
(154,2),
(159,2),
(163,2),
(164,2),
(344,2),
(444,2),
(98,3),
(100,3),
(102,3),
(117,3),
(149,3),
(154,3),
(159,3),
(163,3),
(164,3),
(344,3),
(444,3),
(107,4),
(113,4),
(254,4),
(697,4),
(707,4),
(723,4),
(724,4),
(725,4),
(726,4),
(727,4),
(728,4),
(729,4),
(730,4),
(732,4),
(733,4),
(741,4),
(108,5),
(108,6),
(108,7),
(108,8),
(108,9),
(108,10),
(108,11),
(108,12),
(108,13),
(108,14),
(108,15),
(116,16),
(169,17),
(169,18),
(170,19),
(171,20),
(173,21),
(214,22),
(214,23),
(215,23),
(215,24),
(216,25),
(216,26),
(216,27),
(217,28),
(218,29),
(219,30),
(220,31),
(221,32),
(222,33),
(236,34),
(237,35),
(238,36),
(240,37),
(241,38),
(242,39),
(253,40),
(255,41),
(256,42),
(257,43),
(259,44),
(261,45),
(262,46),
(263,47),
(263,48),
(264,49),
(265,50),
(265,51),
(265,52),
(265,53),
(267,54),
(267,55),
(273,56),
(280,57),
(280,58),
(310,59),
(672,59),
(317,60),
(317,61),
(337,62),
(338,62),
(339,62),
(340,62),
(341,62),
(348,62),
(349,62),
(350,62),
(351,62),
(352,62),
(353,62),
(360,62),
(362,62),
(363,62),
(364,62),
(365,62),
(366,62),
(367,62),
(368,62),
(369,62),
(370,62),
(371,62),
(372,62),
(373,62),
(374,62),
(375,62),
(376,62),
(377,62),
(378,62),
(379,62),
(380,62),
(381,62),
(382,62),
(383,62),
(384,62),
(385,62),
(386,62),
(387,62),
(388,62),
(389,62),
(390,62),
(391,62),
(392,62),
(393,62),
(394,62),
(395,62),
(396,62),
(397,62),
(398,62),
(399,62),
(400,62),
(401,62),
(402,62),
(403,62),
(404,62),
(414,62),
(415,62),
(339,63),
(409,64),
(409,65),
(416,66),
(420,67),
(431,68),
(437,69),
(438,69),
(439,69),
(459,70),
(466,71),
(466,72),
(472,73),
(472,74),
(629,75),
(639,76),
(658,77),
(664,78),
(688,79),
(699,80),
(706,81),
(711,82),
(717,83),
(721,84),
(721,85),
(721,86),
(722,87),
(742,88),
(743,89),
(820,90),
(820,91),
(821,92),
(821,93),
(822,94),
(822,95),
(823,96),
(823,97),
(824,98),
(824,99),
(825,100),
(826,101),
(827,102),
(828,103),
(828,104),
(832,105),
(832,106);
/*!40000 ALTER TABLE `help_relation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `help_topic`
--

DROP TABLE IF EXISTS `help_topic`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `help_topic` (
  `help_topic_id` int(10) unsigned NOT NULL,
  `name` char(64) NOT NULL,
  `help_category_id` smallint(5) unsigned NOT NULL,
  `description` text NOT NULL,
  `example` text NOT NULL,
  `url` text NOT NULL,
  PRIMARY KEY (`help_topic_id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='help topics';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `help_topic`
--

LOCK TABLES `help_topic` WRITE;
/*!40000 ALTER TABLE `help_topic` DISABLE KEYS */;
INSERT INTO `help_topic` VALUES
(1,'HELP_DATE',9,'Help Contents generated from the MariaDB Knowledge Base on 25 July 2023.','',''),
(2,'HELP_VERSION',9,'Help Contents generated for MariaDB 10.11 from the MariaDB Knowledge Base on 25 July 2023.','',''),
(3,'AREA',2,'A synonym for ST_AREA.\n\nURL: https://mariadb.com/kb/en/polygon-properties-area/','','https://mariadb.com/kb/en/polygon-properties-area/'),
(4,'CENTROID',2,'A synonym for ST_CENTROID.\n\nURL: https://mariadb.com/kb/en/centroid/','','https://mariadb.com/kb/en/centroid/'),
(5,'ExteriorRing',2,'A synonym for ST_ExteriorRing.\n\nURL: https://mariadb.com/kb/en/polygon-properties-exteriorring/','','https://mariadb.com/kb/en/polygon-properties-exteriorring/'),
(6,'InteriorRingN',2,'A synonym for ST_InteriorRingN.\n\nURL: https://mariadb.com/kb/en/polygon-properties-interiorringn/','','https://mariadb.com/kb/en/polygon-properties-interiorringn/'),
(7,'NumInteriorRings',2,'A synonym for ST_NumInteriorRings.\n\nURL: https://mariadb.com/kb/en/polygon-properties-numinteriorrings/','','https://mariadb.com/kb/en/polygon-properties-numinteriorrings/'),
(8,'ST_AREA',2,'Syntax\n------\n\nST_Area(poly)\nArea(poly)\n\nDescription\n-----------\n\nReturns as a double-precision number the area of the Polygon value poly, as\nmeasured in its spatial reference system.\n\nST_Area() and Area() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\n\nSELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n|                         4 |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/st_area/','','https://mariadb.com/kb/en/st_area/'),
(9,'ST_CENTROID',2,'Syntax\n------\n\nST_Centroid(mpoly)\nCentroid(mpoly)\n\nDescription\n-----------\n\nReturns a point reflecting the mathematical centroid (geometric center) for\nthe MultiPolygon mpoly. The resulting point will not necessarily be on the\nMultiPolygon.\n\nST_Centroid() and Centroid() are synonyms.\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,20 0,20 20,0 20,0 0))\');\nSELECT ST_AsText(ST_Centroid(@poly)) AS center;\n+--------------+\n| center       |\n+--------------+\n| POINT(10 10) |\n+--------------+\n\nURL: https://mariadb.com/kb/en/st_centroid/','','https://mariadb.com/kb/en/st_centroid/'),
(10,'ST_ExteriorRing',2,'Syntax\n------\n\nST_ExteriorRing(poly)\nExteriorRing(poly)\n\nDescription\n-----------\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nST_ExteriorRing() and ExteriorRing() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0)           |\n+-------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_exteriorring/','','https://mariadb.com/kb/en/st_exteriorring/'),
(11,'ST_InteriorRingN',2,'Syntax\n------\n\nST_InteriorRingN(poly,N)\nInteriorRingN(poly,N)\n\nDescription\n-----------\n\nReturns the N-th interior ring for the Polygon value poly as a LineString.\nRings are numbered beginning with 1.\n\nST_InteriorRingN() and InteriorRingN() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1)              |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_interiorringn/','','https://mariadb.com/kb/en/st_interiorringn/'),
(12,'ST_NumInteriorRings',2,'Syntax\n------\n\nST_NumInteriorRings(poly)\nNumInteriorRings(poly)\n\nDescription\n-----------\n\nReturns an integer containing the number of interior rings in the Polygon\nvalue poly.\n\nNote that according the the OpenGIS standard, a POLYGON should have exactly\none ExteriorRing and all other rings should lie within that ExteriorRing and\nthus be the InteriorRings. Practically, however, some systems, including\nMariaDB\'s, permit polygons to have several \'ExteriorRings\'. In the case of\nthere being multiple, non-overlapping exterior rings ST_NumInteriorRings()\nwill return 1.\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n|                1 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/st_numinteriorrings/','','https://mariadb.com/kb/en/st_numinteriorrings/'),
(14,'AsText',3,'A synonym for ST_AsText().\n\nURL: https://mariadb.com/kb/en/wkt-astext/','','https://mariadb.com/kb/en/wkt-astext/'),
(15,'AsWKT',3,'A synonym for ST_AsText().\n\nURL: https://mariadb.com/kb/en/wkt-aswkt/','','https://mariadb.com/kb/en/wkt-aswkt/'),
(16,'GeomCollFromText',3,'A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/wkt-geomcollfromtext/','','https://mariadb.com/kb/en/wkt-geomcollfromtext/'),
(17,'GeometryCollectionFromText',3,'A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/geometrycollectionfromtext/','','https://mariadb.com/kb/en/geometrycollectionfromtext/'),
(18,'GeometryFromText',3,'A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/geometryfromtext/','','https://mariadb.com/kb/en/geometryfromtext/'),
(19,'GeomFromText',3,'A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/wkt-geomfromtext/','','https://mariadb.com/kb/en/wkt-geomfromtext/'),
(20,'LineFromText',3,'A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/wkt-linefromtext/','','https://mariadb.com/kb/en/wkt-linefromtext/'),
(21,'LineStringFromText',3,'A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/linestringfromtext/','','https://mariadb.com/kb/en/linestringfromtext/'),
(22,'MLineFromText',3,'Syntax\n------\n\nMLineFromText(wkt[,srid])\nMultiLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKT representation and SRID.\n\nMLineFromText() and MultiLineStringFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n  (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n  (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n  (MLineFromWKB(AsWKB(MultiLineString(\n   LineString(Point(1, 2), Point(3, 5)),\n   LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\nURL: https://mariadb.com/kb/en/mlinefromtext/','','https://mariadb.com/kb/en/mlinefromtext/'),
(23,'MPointFromText',3,'Syntax\n------\n\nMPointFromText(wkt[,srid])\nMultiPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nMPointFromText() and MultiPointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nURL: https://mariadb.com/kb/en/mpointfromtext/','','https://mariadb.com/kb/en/mpointfromtext/'),
(13,'WKT Definition',3,'Description\n-----------\n\nThe Well-Known Text (WKT) representation of Geometry is designed to exchange\ngeometry data in ASCII form. Examples of the basic geometry types include:\n\n+-----------------------------------------------------------------------------+\n| Geometry Types                                                              |\n+-----------------------------------------------------------------------------+\n| POINT                                                                       |\n+-----------------------------------------------------------------------------+\n| LINESTRING                                                                  |\n+-----------------------------------------------------------------------------+\n| POLYGON                                                                     |\n+-----------------------------------------------------------------------------+\n| MULTIPOINT                                                                  |\n+-----------------------------------------------------------------------------+\n| MULTILINESTRING                                                             |\n+-----------------------------------------------------------------------------+\n| MULTIPOLYGON                                                                |\n+-----------------------------------------------------------------------------+\n| GEOMETRYCOLLECTION                                                          |\n+-----------------------------------------------------------------------------+\n| GEOMETRY                                                                    |\n+-----------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/wkt-definition/','','https://mariadb.com/kb/en/wkt-definition/'),
(24,'MPolyFromText',3,'Syntax\n------\n\nMPolyFromText(wkt[,srid])\nMultiPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nMPolyFromText() and MultiPolygonFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(\n   ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n   ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(\n   ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n   ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(\n   LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\nURL: https://mariadb.com/kb/en/mpolyfromtext/','','https://mariadb.com/kb/en/mpolyfromtext/'),
(25,'MultiLineStringFromText',3,'A synonym for MLineFromText.\n\nURL: https://mariadb.com/kb/en/multilinestringfromtext/','','https://mariadb.com/kb/en/multilinestringfromtext/'),
(26,'MultiPointFromText',3,'A synonym for MPointFromText.\n\nURL: https://mariadb.com/kb/en/multipointfromtext/','','https://mariadb.com/kb/en/multipointfromtext/'),
(27,'MultiPolygonFromText',3,'A synonym for MPolyFromText.\n\nURL: https://mariadb.com/kb/en/multipolygonfromtext/','','https://mariadb.com/kb/en/multipolygonfromtext/'),
(28,'PointFromText',3,'A synonym for ST_PointFromText.\n\nURL: https://mariadb.com/kb/en/wkt-pointfromtext/','','https://mariadb.com/kb/en/wkt-pointfromtext/'),
(29,'PolyFromText',3,'A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/wkt-polyfromtext/','','https://mariadb.com/kb/en/wkt-polyfromtext/'),
(30,'PolygonFromText',3,'A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/polygonfromtext/','','https://mariadb.com/kb/en/polygonfromtext/'),
(31,'ST_AsText',3,'Syntax\n------\n\nST_AsText(g)\nAsText(g)\nST_AsWKT(g)\nAsWKT(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKT representation and\nreturns the string result.\n\nST_AsText(), AsText(), ST_AsWKT() and AsWKT() are all synonyms.\n\nExamples\n--------\n\nSET @g = \'LineString(1 1,4 4,6 6)\';\n\nSELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,4 4,6 6)        |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/st_astext/','','https://mariadb.com/kb/en/st_astext/'),
(32,'ST_ASWKT',3,'A synonym for ST_ASTEXT().\n\nURL: https://mariadb.com/kb/en/st_aswkt/','','https://mariadb.com/kb/en/st_aswkt/'),
(33,'ST_GeomCollFromText',3,'Syntax\n------\n\nST_GeomCollFromText(wkt[,srid])\nST_GeometryCollectionFromText(wkt[,srid])\nGeomCollFromText(wkt[,srid])\nGeometryCollectionFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and SRID.\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(), GeomCollFromText() and\nGeometryCollectionFromText() are all synonyms.\n\nExample\n-------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nURL: https://mariadb.com/kb/en/st_geomcollfromtext/','','https://mariadb.com/kb/en/st_geomcollfromtext/'),
(34,'ST_GeometryCollectionFromText',3,'A synonym for ST_GeomCollFromText.\n\nURL: https://mariadb.com/kb/en/st_geometrycollectionfromtext/','','https://mariadb.com/kb/en/st_geometrycollectionfromtext/'),
(35,'ST_GeometryFromText',3,'A synonym for ST_GeomFromText.\n\nURL: https://mariadb.com/kb/en/st_geometryfromtext/','','https://mariadb.com/kb/en/st_geometryfromtext/'),
(36,'ST_GeomFromText',3,'Syntax\n------\n\nST_GeomFromText(wkt[,srid])\nST_GeometryFromText(wkt[,srid])\nGeomFromText(wkt[,srid])\nGeometryFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKT representation and SRID.\n\nGeomFromText(), GeometryFromText(), ST_GeomFromText() and\nST_GeometryFromText() are all synonyms.\n\nExample\n-------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\nURL: https://mariadb.com/kb/en/st_geomfromtext/','','https://mariadb.com/kb/en/st_geomfromtext/'),
(37,'ST_LineFromText',3,'Syntax\n------\n\nST_LineFromText(wkt[,srid])\nST_LineStringFromText(wkt[,srid])\nLineFromText(wkt[,srid])\nLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nST_LineFromText(), ST_LineStringFromText(), ST_LineFromText() and\nST_LineStringFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_line  (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nURL: https://mariadb.com/kb/en/st_linefromtext/','','https://mariadb.com/kb/en/st_linefromtext/'),
(38,'ST_LineStringFromText',3,'A synonym for ST_LineFromText.\n\nURL: https://mariadb.com/kb/en/st_linestringfromtext/','','https://mariadb.com/kb/en/st_linestringfromtext/'),
(39,'ST_PointFromText',3,'Syntax\n------\n\nST_PointFromText(wkt[,srid])\nPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKT representation and SRID.\n\nST_PointFromText() and PointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_point  (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nURL: https://mariadb.com/kb/en/st_pointfromtext/','','https://mariadb.com/kb/en/st_pointfromtext/'),
(40,'ST_PolyFromText',3,'Syntax\n------\n\nST_PolyFromText(wkt[,srid])\nST_PolygonFromText(wkt[,srid])\nPolyFromText(wkt[,srid])\nPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText() and\nST_PolygonFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_polygon   (g POLYGON);\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\'));\n\nURL: https://mariadb.com/kb/en/st_polyfromtext/','','https://mariadb.com/kb/en/st_polyfromtext/'),
(41,'ST_PolygonFromText',3,'A synonym for ST_PolyFromText.\n\nURL: https://mariadb.com/kb/en/st_polygonfromtext/','','https://mariadb.com/kb/en/st_polygonfromtext/'),
(42,'DIV',4,'Syntax\n------\n\nDIV\n\nDescription\n-----------\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\nIncorrect results may occur for non-integer operands that exceed BIGINT range.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, a division by zero produces\nan error. Otherwise, it returns NULL.\n\nThe remainder of a division can be obtained using the MOD operator.\n\nExamples\n--------\n\nSELECT 300 DIV 7;\n+-----------+\n| 300 DIV 7 |\n+-----------+\n|        42 |\n+-----------+\n\nSELECT 300 DIV 0;\n+-----------+\n| 300 DIV 0 |\n+-----------+\n|      NULL |\n+-----------+\n\nURL: https://mariadb.com/kb/en/div/','','https://mariadb.com/kb/en/div/'),
(43,'ABS',4,'Syntax\n------\n\nABS(X)\n\nDescription\n-----------\n\nReturns the absolute (non-negative) value of X. If X is not a number, it is\nconverted to a numeric type.\n\nExamples\n--------\n\nSELECT ABS(42);\n+---------+\n| ABS(42) |\n+---------+\n|      42 |\n+---------+\n\nSELECT ABS(-42);\n+----------+\n| ABS(-42) |\n+----------+\n|       42 |\n+----------+\n\nSELECT ABS(DATE \'1994-01-01\');\n+------------------------+\n| ABS(DATE \'1994-01-01\') |\n+------------------------+\n|               19940101 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/abs/','','https://mariadb.com/kb/en/abs/'),
(44,'ACOS',4,'Syntax\n------\n\nACOS(X)\n\nDescription\n-----------\n\nReturns the arc cosine of X, that is, the value whose cosine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ACOS(1);\n+---------+\n| ACOS(1) |\n+---------+\n|       0 |\n+---------+\n\nSELECT ACOS(1.0001);\n+--------------+\n| ACOS(1.0001) |\n+--------------+\n|         NULL |\n+--------------+\n\nSELECT ACOS(0);\n+-----------------+\n| ACOS(0)         |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT ACOS(0.234);\n+------------------+\n| ACOS(0.234)      |\n+------------------+\n| 1.33460644244679 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/acos/','','https://mariadb.com/kb/en/acos/'),
(45,'ASIN',4,'Syntax\n------\n\nASIN(X)\n\nDescription\n-----------\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns NULL if\nX is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ASIN(0.2);\n+--------------------+\n| ASIN(0.2)          |\n+--------------------+\n| 0.2013579207903308 |\n+--------------------+\n\nSELECT ASIN(\'foo\');\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n|           0 |\n+-------------+\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level   | Code | Message                                 |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n\nURL: https://mariadb.com/kb/en/asin/','','https://mariadb.com/kb/en/asin/'),
(46,'ATAN',4,'Syntax\n------\n\nATAN(X)\n\nDescription\n-----------\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nExamples\n--------\n\nSELECT ATAN(2);\n+--------------------+\n| ATAN(2)            |\n+--------------------+\n| 1.1071487177940904 |\n+--------------------+\n\nSELECT ATAN(-2);\n+---------------------+\n| ATAN(-2)            |\n+---------------------+\n| -1.1071487177940904 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/atan/','','https://mariadb.com/kb/en/atan/'),
(47,'ATAN2',4,'Syntax\n------\n\nATAN(Y,X), ATAN2(Y,X)\n\nDescription\n-----------\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both arguments\nare used to determine the quadrant of the result.\n\nExamples\n--------\n\nSELECT ATAN(-2,2);\n+---------------------+\n| ATAN(-2,2)          |\n+---------------------+\n| -0.7853981633974483 |\n+---------------------+\n\nSELECT ATAN2(PI(),0);\n+--------------------+\n| ATAN2(PI(),0)      |\n+--------------------+\n| 1.5707963267948966 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/atan2/','','https://mariadb.com/kb/en/atan2/'),
(48,'CEIL',4,'Syntax\n------\n\nCEIL(X)\n\nDescription\n-----------\n\nCEIL() is a synonym for CEILING().\n\nURL: https://mariadb.com/kb/en/ceil/','','https://mariadb.com/kb/en/ceil/'),
(49,'CEILING',4,'Syntax\n------\n\nCEILING(X)\n\nDescription\n-----------\n\nReturns the smallest integer value not less than X.\n\nExamples\n--------\n\nSELECT CEILING(1.23);\n+---------------+\n| CEILING(1.23) |\n+---------------+\n|             2 |\n+---------------+\n\nSELECT CEILING(-1.23);\n+----------------+\n| CEILING(-1.23) |\n+----------------+\n|             -1 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/ceiling/','','https://mariadb.com/kb/en/ceiling/'),
(51,'COS',4,'Syntax\n------\n\nCOS(X)\n\nDescription\n-----------\n\nReturns the cosine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT COS(PI());\n+-----------+\n| COS(PI()) |\n+-----------+\n|        -1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/cos/','','https://mariadb.com/kb/en/cos/'),
(52,'COT',4,'Syntax\n------\n\nCOT(X)\n\nDescription\n-----------\n\nReturns the cotangent of X.\n\nExamples\n--------\n\nSELECT COT(42);\n+--------------------+\n| COT(42)            |\n+--------------------+\n| 0.4364167060752729 |\n+--------------------+\n\nSELECT COT(12);\n+---------------------+\n| COT(12)             |\n+---------------------+\n| -1.5726734063976893 |\n+---------------------+\n\nSELECT COT(0);\nERROR 1690 (22003): DOUBLE value is out of range in \'cot(0)\'\n\nURL: https://mariadb.com/kb/en/cot/','','https://mariadb.com/kb/en/cot/'),
(55,'DEGREES',4,'Syntax\n------\n\nDEGREES(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from radians to degrees.\n\nThis is the converse of the RADIANS() function.\n\nExamples\n--------\n\nSELECT DEGREES(PI());\n+---------------+\n| DEGREES(PI()) |\n+---------------+\n|           180 |\n+---------------+\n\nSELECT DEGREES(PI() / 2);\n+-------------------+\n| DEGREES(PI() / 2) |\n+-------------------+\n|                90 |\n+-------------------+\n\nSELECT DEGREES(45);\n+-----------------+\n| DEGREES(45)     |\n+-----------------+\n| 2578.3100780887 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/degrees/','','https://mariadb.com/kb/en/degrees/'),
(56,'EXP',4,'Syntax\n------\n\nEXP(X)\n\nDescription\n-----------\n\nReturns the value of e (the base of natural logarithms) raised to the power of\nX. The inverse of this function is LOG() (using a single argument only) or\nLN().\n\nIf X is NULL, this function returns NULL.\n\nExamples\n--------\n\nSELECT EXP(2);\n+------------------+\n| EXP(2)           |\n+------------------+\n| 7.38905609893065 |\n+------------------+\n\nSELECT EXP(-2);\n+--------------------+\n| EXP(-2)            |\n+--------------------+\n| 0.1353352832366127 |\n+--------------------+\n\nSELECT EXP(0);\n+--------+\n| EXP(0) |\n+--------+\n|      1 |\n+--------+\n\nSELECT EXP(NULL);\n+-----------+\n| EXP(NULL) |\n+-----------+\n|      NULL |\n+-----------+\n\nURL: https://mariadb.com/kb/en/exp/','','https://mariadb.com/kb/en/exp/'),
(50,'CONV',4,'Syntax\n------\n\nCONV(N,from_base,to_base)\n\nDescription\n-----------\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base to_base.\n\nReturns NULL if any argument is NULL, or if the second or third argument are\nnot in the allowed range.\n\nThe argument N is interpreted as an integer, but may be specified as an\ninteger or a string. The minimum base is 2 and the maximum base is 36. If\nto_base is a negative number, N is regarded as a signed number. Otherwise, N\nis treated as unsigned. CONV() works with 64-bit precision.\n\nSome shortcuts for this function are also available: BIN(), OCT(), HEX(),\nUNHEX(). Also, MariaDB allows binary literal values and hexadecimal literal\nvalues.\n\nExamples\n--------\n\nSELECT CONV(\'a\',16,2);\n+----------------+\n| CONV(\'a\',16,2) |\n+----------------+\n| 1010           |\n+----------------+\n\nSELECT CONV(\'6E\',18,8);\n+-----------------+\n| CONV(\'6E\',18,8) |\n+-----------------+\n| 172             |\n+-----------------+\n\nSELECT CONV(-17,10,-18);\n+------------------+\n| CONV(-17,10,-18) |\n+------------------+\n| -H               |\n+------------------+\n\nSELECT CONV(12+\'10\'+\'10\'+0xa,10,10);\n+------------------------------+\n| CONV(12+\'10\'+\'10\'+0xa,10,10) |\n+------------------------------+\n| 42                           |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/conv/','','https://mariadb.com/kb/en/conv/'),
(53,'CRC32',4,'Syntax\n------\n\n<= MariaDB 10.7\n\nCRC32(expr)\n\nFrom MariaDB 10.8\n\nCRC32([par,]expr)\n\nDescription\n-----------\n\nComputes a cyclic redundancy check (CRC) value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is expected to\nbe a string and (if possible) is treated as one if it is not.\n\nUses the ISO 3309 polynomial that used by zlib and many others. MariaDB 10.8\nintroduced the CRC32C() function, which uses the alternate Castagnoli\npolynomia.\n\nMariaDB starting with 10.8\n--------------------------\nOften, CRC is computed in pieces. To facilitate this, MariaDB 10.8.0\nintroduced an optional parameter: CRC32(\'MariaDB\')=CRC32(CRC32(\'Maria\'),\'DB\').\n\nExamples\n--------\n\nSELECT CRC32(\'MariaDB\');\n+------------------+\n| CRC32(\'MariaDB\') |\n+------------------+\n|       4227209140 |\n+------------------+\n\nSELECT CRC32(\'mariadb\');\n+------------------+\n| CRC32(\'mariadb\') |\n+------------------+\n|       2594253378 |\n+------------------+\n\nFrom MariaDB 10.8.0\n\nSELECT CRC32(CRC32(\'Maria\'),\'DB\');\n+----------------------------+\n| CRC32(CRC32(\'Maria\'),\'DB\') |\n+----------------------------+\n|                 4227209140 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/crc32/','','https://mariadb.com/kb/en/crc32/'),
(54,'CRC32C',4,'MariaDB starting with 10.8\n--------------------------\nIntroduced in MariaDB 10.8.0 to compute a cyclic redundancy check (CRC) value\nusing the Castagnoli polynomial.\n\nSyntax\n------\n\nCRC32C([par,]expr)\n\nDescription\n-----------\n\nMariaDB has always included a native unary function CRC32() that computes the\nCRC-32 of a string using the ISO 3309 polynomial that used by zlib and many\nothers.\n\nInnoDB and MyRocks use a different polynomial, which was implemented in SSE4.2\ninstructions that were introduced in the Intel Nehalem microarchitecture. This\nis commonly called CRC-32C (Castagnoli).\n\nThe CRC32C function uses the Castagnoli polynomial.\n\nThis allows SELECT…INTO DUMPFILE to be used for the creation of files with\nvalid checksums, such as a logically empty InnoDB redo log file ib_logfile0\ncorresponding to a particular log sequence number.\n\nThe optional parameter allows the checksum to be computed in pieces:\nCRC32C(\'MariaDB\')=CRC32C(CRC32C(\'Maria\'),\'DB\').\n\nExamples\n--------\n\nSELECT CRC32C(\'MariaDB\');\n+-------------------+\n| CRC32C(\'MariaDB\') |\n+-------------------+\n|         809606978 |\n+-------------------+\n\nSELECT CRC32C(CRC32C(\'Maria\'),\'DB\');\n+------------------------------+\n| CRC32C(CRC32C(\'Maria\'),\'DB\') |\n+------------------------------+\n|                    809606978 |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/crc32c/','','https://mariadb.com/kb/en/crc32c/'),
(57,'FLOOR',4,'Syntax\n------\n\nFLOOR(X)\n\nDescription\n-----------\n\nReturns the largest integer value not greater than X.\n\nExamples\n--------\n\nSELECT FLOOR(1.23);\n+-------------+\n| FLOOR(1.23) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT FLOOR(-1.23);\n+--------------+\n| FLOOR(-1.23) |\n+--------------+\n|           -2 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/floor/','','https://mariadb.com/kb/en/floor/'),
(58,'LN',4,'Syntax\n------\n\nLN(X)\n\nDescription\n-----------\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X. If X\nis less than or equal to 0, or NULL, then NULL is returned.\n\nThe inverse of this function is EXP().\n\nExamples\n--------\n\nSELECT LN(2);\n+-------------------+\n| LN(2)             |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LN(-2);\n+--------+\n| LN(-2) |\n+--------+\n|   NULL |\n+--------+\n\nURL: https://mariadb.com/kb/en/ln/','','https://mariadb.com/kb/en/ln/'),
(60,'LOG10',4,'Syntax\n------\n\nLOG10(X)\n\nDescription\n-----------\n\nReturns the base-10 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG10(2);\n+-------------------+\n| LOG10(2)          |\n+-------------------+\n| 0.301029995663981 |\n+-------------------+\n\nSELECT LOG10(100);\n+------------+\n| LOG10(100) |\n+------------+\n|          2 |\n+------------+\n\nSELECT LOG10(-100);\n+-------------+\n| LOG10(-100) |\n+-------------+\n|        NULL |\n+-------------+\n\nURL: https://mariadb.com/kb/en/log10/','','https://mariadb.com/kb/en/log10/'),
(61,'LOG2',4,'Syntax\n------\n\nLOG2(X)\n\nDescription\n-----------\n\nReturns the base-2 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG2(4398046511104);\n+---------------------+\n| LOG2(4398046511104) |\n+---------------------+\n|                  42 |\n+---------------------+\n\nSELECT LOG2(65536);\n+-------------+\n| LOG2(65536) |\n+-------------+\n|          16 |\n+-------------+\n\nSELECT LOG2(-100);\n+------------+\n| LOG2(-100) |\n+------------+\n|       NULL |\n+------------+\n\nURL: https://mariadb.com/kb/en/log2/','','https://mariadb.com/kb/en/log2/'),
(63,'OCT',4,'Syntax\n------\n\nOCT(N)\n\nDescription\n-----------\n\nReturns a string representation of the octal value of N, where N is a longlong\n(BIGINT) number. This is equivalent to CONV(N,10,8). Returns NULL if N is NULL.\n\nExamples\n--------\n\nSELECT OCT(34);\n+---------+\n| OCT(34) |\n+---------+\n| 42      |\n+---------+\n\nSELECT OCT(12);\n+---------+\n| OCT(12) |\n+---------+\n| 14      |\n+---------+\n\nURL: https://mariadb.com/kb/en/oct/','','https://mariadb.com/kb/en/oct/'),
(64,'PI',4,'Syntax\n------\n\nPI()\n\nDescription\n-----------\n\nReturns the value of π (pi). The default number of decimal places displayed is\nsix, but MariaDB uses the full double-precision value internally.\n\nExamples\n--------\n\nSELECT PI();\n+----------+\n| PI()     |\n+----------+\n| 3.141593 |\n+----------+\n\nSELECT PI()+0.0000000000000000000000;\n+-------------------------------+\n| PI()+0.0000000000000000000000 |\n+-------------------------------+\n|      3.1415926535897931159980 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/pi/','','https://mariadb.com/kb/en/pi/'),
(65,'POW',4,'Syntax\n------\n\nPOW(X,Y)\n\nDescription\n-----------\n\nReturns the value of X raised to the power of Y.\n\nPOWER() is a synonym.\n\nExamples\n--------\n\nSELECT POW(2,3);\n+----------+\n| POW(2,3) |\n+----------+\n|        8 |\n+----------+\n\nSELECT POW(2,-2);\n+-----------+\n| POW(2,-2) |\n+-----------+\n|      0.25 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/pow/','','https://mariadb.com/kb/en/pow/'),
(59,'LOG',4,'Syntax\n------\n\nLOG(X), LOG(B,X)\n\nDescription\n-----------\n\nIf called with one parameter, this function returns the natural logarithm of\nX. If X is less than or equal to 0, then NULL is returned.\n\nIf called with two parameters, it returns the logarithm of X to the base B. If\nB is <= 1 or X <= 0, the function returns NULL.\n\nIf any argument is NULL, the function returns NULL.\n\nThe inverse of this function (when called with a single argument) is the EXP()\nfunction.\n\nExamples\n--------\n\nLOG(X):\n\nSELECT LOG(2);\n+-------------------+\n| LOG(2)            |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LOG(-2);\n+---------+\n| LOG(-2) |\n+---------+\n|    NULL |\n+---------+\n\nLOG(B,X)\n\nSELECT LOG(2,16);\n+-----------+\n| LOG(2,16) |\n+-----------+\n|         4 |\n+-----------+\n\nSELECT LOG(3,27);\n+-----------+\n| LOG(3,27) |\n+-----------+\n|         3 |\n+-----------+\n\nSELECT LOG(3,1);\n+----------+\n| LOG(3,1) |\n+----------+\n|        0 |\n+----------+\n\nSELECT LOG(3,0);\n+----------+\n| LOG(3,0) |\n+----------+\n|     NULL |\n+----------+\n\nURL: https://mariadb.com/kb/en/log/','','https://mariadb.com/kb/en/log/'),
(62,'MOD',4,'Syntax\n------\n\nMOD(N,M), N % M, N MOD M\n\nDescription\n-----------\n\nModulo operation. Returns the remainder of N divided by M. See also Modulo\nOperator.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, any number modulus zero\nproduces an error. Otherwise, it returns NULL.\n\nThe integer part of a division can be obtained using DIV.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n|        42 |\n+-----------+\n\nSELECT MOD(234, 10);\n+--------------+\n| MOD(234, 10) |\n+--------------+\n|            4 |\n+--------------+\n\nSELECT 253 % 7;\n+---------+\n| 253 % 7 |\n+---------+\n|       1 |\n+---------+\n\nSELECT MOD(29,9);\n+-----------+\n| MOD(29,9) |\n+-----------+\n|         2 |\n+-----------+\n\nSELECT 29 MOD 9;\n+----------+\n| 29 MOD 9 |\n+----------+\n|        2 |\n+----------+\n\nURL: https://mariadb.com/kb/en/mod/','','https://mariadb.com/kb/en/mod/'),
(66,'POWER',4,'Syntax\n------\n\nPOWER(X,Y)\n\nDescription\n-----------\n\nThis is a synonym for POW(), which returns the value of X raised to the power\nof Y.\n\nURL: https://mariadb.com/kb/en/power/','','https://mariadb.com/kb/en/power/'),
(67,'RADIANS',4,'Syntax\n------\n\nRADIANS(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from degrees to radians. Note that π radians\nequals 180 degrees.\n\nThis is the converse of the DEGREES() function.\n\nExamples\n--------\n\nSELECT RADIANS(45);\n+-------------------+\n| RADIANS(45)       |\n+-------------------+\n| 0.785398163397448 |\n+-------------------+\n\nSELECT RADIANS(90);\n+-----------------+\n| RADIANS(90)     |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT RADIANS(PI());\n+--------------------+\n| RADIANS(PI())      |\n+--------------------+\n| 0.0548311355616075 |\n+--------------------+\n\nSELECT RADIANS(180);\n+------------------+\n| RADIANS(180)     |\n+------------------+\n| 3.14159265358979 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/radians/','','https://mariadb.com/kb/en/radians/'),
(68,'RAND',4,'Syntax\n------\n\nRAND(), RAND(N)\n\nDescription\n-----------\n\nReturns a random DOUBLE precision floating point value v in the range 0 <= v <\n1.0. If a constant integer argument N is specified, it is used as the seed\nvalue, which produces a repeatable sequence of column values. In the example\nbelow, note that the sequences of values produced by RAND(3) is the same both\nplaces where it occurs.\n\nIn a WHERE clause, RAND() is evaluated each time the WHERE is executed.\n\nStatements using the RAND() function are not safe for statement-based\nreplication.\n\nPractical uses\n--------------\n\nThe expression to get a random integer from a given range is the following:\n\nFLOOR(min_value + RAND() * (max_value - min_value +1))\n\nRAND() is often used to read random rows from a table, as follows:\n\nSELECT * FROM my_table ORDER BY RAND() LIMIT 10;\n\nNote, however, that this technique should never be used on a large table as it\nwill be extremely slow. MariaDB will read all rows in the table, generate a\nrandom value for each of them, order them, and finally will apply the LIMIT\nclause.\n\nExamples\n--------\n\nCREATE TABLE t (i INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i    | RAND()            |\n+------+-------------------+\n|    1 | 0.255651095188829 |\n|    2 | 0.833920199269355 |\n|    3 |  0.40264774151393 |\n+------+-------------------+\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i    | RAND(3)           |\n+------+-------------------+\n|    1 |  0.90576975597606 |\n|    2 | 0.373079058130345 |\n|    3 | 0.148086053457191 |\n+------+-------------------+\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i    | RAND()            |\n+------+-------------------+\n|    1 | 0.511478140495232 |\n|    2 | 0.349447508668012 |\n|    3 | 0.212803152588013 |\n+------+-------------------+\n\nUsing the same seed, the same sequence will be returned:\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i    | RAND(3)           |\n+------+-------------------+\n|    1 |  0.90576975597606 |\n|    2 | 0.373079058130345 |\n|    3 | 0.148086053457191 |\n+------+-------------------+\n\nGenerating a random number from 5 to 15:\n\nSELECT FLOOR(5 + (RAND() * 11));\n\nURL: https://mariadb.com/kb/en/rand/','','https://mariadb.com/kb/en/rand/'),
(70,'SIGN',4,'Syntax\n------\n\nSIGN(X)\n\nDescription\n-----------\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X is\nnegative, zero, or positive.\n\nExamples\n--------\n\nSELECT SIGN(-32);\n+-----------+\n| SIGN(-32) |\n+-----------+\n|        -1 |\n+-----------+\n\nSELECT SIGN(0);\n+---------+\n| SIGN(0) |\n+---------+\n|       0 |\n+---------+\n\nSELECT SIGN(234);\n+-----------+\n| SIGN(234) |\n+-----------+\n|         1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/sign/','','https://mariadb.com/kb/en/sign/'),
(71,'SIN',4,'Syntax\n------\n\nSIN(X)\n\nDescription\n-----------\n\nReturns the sine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT SIN(1.5707963267948966);\n+-------------------------+\n| SIN(1.5707963267948966) |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT SIN(PI());\n+----------------------+\n| SIN(PI())            |\n+----------------------+\n| 1.22460635382238e-16 |\n+----------------------+\n\nSELECT ROUND(SIN(PI()));\n+------------------+\n| ROUND(SIN(PI())) |\n+------------------+\n|                0 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/sin/','','https://mariadb.com/kb/en/sin/'),
(72,'SQRT',4,'Syntax\n------\n\nSQRT(X)\n\nDescription\n-----------\n\nReturns the square root of X. If X is negative, NULL is returned.\n\nExamples\n--------\n\nSELECT SQRT(4);\n+---------+\n| SQRT(4) |\n+---------+\n|       2 |\n+---------+\n\nSELECT SQRT(20);\n+------------------+\n| SQRT(20)         |\n+------------------+\n| 4.47213595499958 |\n+------------------+\n\nSELECT SQRT(-16);\n+-----------+\n| SQRT(-16) |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT SQRT(1764);\n+------------+\n| SQRT(1764) |\n+------------+\n|         42 |\n+------------+\n\nURL: https://mariadb.com/kb/en/sqrt/','','https://mariadb.com/kb/en/sqrt/'),
(73,'TAN',4,'Syntax\n------\n\nTAN(X)\n\nDescription\n-----------\n\nReturns the tangent of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT TAN(0.7853981633974483);\n+-------------------------+\n| TAN(0.7853981633974483) |\n+-------------------------+\n|      0.9999999999999999 |\n+-------------------------+\n\nSELECT TAN(PI());\n+-----------------------+\n| TAN(PI())             |\n+-----------------------+\n| -1.22460635382238e-16 |\n+-----------------------+\n\nSELECT TAN(PI()+1);\n+-----------------+\n| TAN(PI()+1)     |\n+-----------------+\n| 1.5574077246549 |\n+-----------------+\n\nSELECT TAN(RADIANS(PI()));\n+--------------------+\n| TAN(RADIANS(PI())) |\n+--------------------+\n| 0.0548861508080033 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/tan/','','https://mariadb.com/kb/en/tan/'),
(69,'ROUND',4,'Syntax\n------\n\nROUND(X), ROUND(X,D)\n\nDescription\n-----------\n\nRounds the argument X to D decimal places. D defaults to 0 if not specified. D\ncan be negative to cause D digits left of the decimal point of the value X to\nbecome zero.\n\nThe rounding algorithm depends on the data type of X:\n\n* for floating point types (FLOAT, DOUBLE) the C libraries rounding function\nis used, so the behavior *may* differ between operating systems\n* for fixed point types (DECIMAL, DEC/NUMBER/FIXED) the \"round half up\" rule\nis used, meaning that e.g. a value ending in exactly .5 is always rounded up.\n\nExamples\n--------\n\nSELECT ROUND(-1.23);\n+--------------+\n| ROUND(-1.23) |\n+--------------+\n|           -1 |\n+--------------+\n\nSELECT ROUND(-1.58);\n+--------------+\n| ROUND(-1.58) |\n+--------------+\n|           -2 |\n+--------------+\n\nSELECT ROUND(1.58); \n+-------------+\n| ROUND(1.58) |\n+-------------+\n|           2 |\n+-------------+\n\nSELECT ROUND(1.298, 1);\n+-----------------+\n| ROUND(1.298, 1) |\n+-----------------+\n|             1.3 |\n+-----------------+\n\nSELECT ROUND(1.298, 0);\n+-----------------+\n| ROUND(1.298, 0) |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT ROUND(23.298, -1);\n+-------------------+\n| ROUND(23.298, -1) |\n+-------------------+\n|                20 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/round/','','https://mariadb.com/kb/en/round/'),
(74,'TRUNCATE',4,'This page documents the TRUNCATE function. See TRUNCATE TABLE for the DDL\nstatement.\n\nSyntax\n------\n\nTRUNCATE(X,D)\n\nDescription\n-----------\n\nReturns the number X, truncated to D decimal places. If D is 0, the result has\nno decimal point or fractional part. D can be negative to cause D digits left\nof the decimal point of the value X to become zero.\n\nExamples\n--------\n\nSELECT TRUNCATE(1.223,1);\n+-------------------+\n| TRUNCATE(1.223,1) |\n+-------------------+\n|               1.2 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,1);\n+-------------------+\n| TRUNCATE(1.999,1) |\n+-------------------+\n|               1.9 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,0); \n+-------------------+\n| TRUNCATE(1.999,0) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSELECT TRUNCATE(-1.999,1);\n+--------------------+\n| TRUNCATE(-1.999,1) |\n+--------------------+\n|               -1.9 |\n+--------------------+\n\nSELECT TRUNCATE(122,-2);\n+------------------+\n| TRUNCATE(122,-2) |\n+------------------+\n|              100 |\n+------------------+\n\nSELECT TRUNCATE(10.28*100,0);\n+-----------------------+\n| TRUNCATE(10.28*100,0) |\n+-----------------------+\n|                  1028 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/truncate/','','https://mariadb.com/kb/en/truncate/'),
(76,'UNINSTALL PLUGIN',5,'Syntax\n------\n\nUNINSTALL PLUGIN [IF EXISTS] plugin_name\n\nDescription\n-----------\n\nThis statement removes a single installed plugin. To uninstall the whole\nlibrary which contains the plugin, use UNINSTALL SONAME. You cannot uninstall\na plugin if any table that uses it is open.\n\nplugin_name must be the name of some plugin that is listed in the mysql.plugin\ntable. The server executes the plugin\'s deinitialization function and removes\nthe row for the plugin from the mysql.plugin table, so that subsequent server\nrestarts will not load and initialize the plugin. UNINSTALL PLUGIN does not\nremove the plugin\'s shared library file.\n\nTo use UNINSTALL PLUGIN, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nUNINSTALL PLUGIN example;\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message                       |\n+-------+------+-------------------------------+\n| Note  | 1305 | PLUGIN example does not exist |\n+-------+------+-------------------------------+\n\nURL: https://mariadb.com/kb/en/uninstall-plugin/','','https://mariadb.com/kb/en/uninstall-plugin/'),
(77,'INSTALL SONAME',5,'Syntax\n------\n\nINSTALL SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of INSTALL PLUGIN. It installs all plugins from a\ngiven plugin_library. See INSTALL PLUGIN for details.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL SONAME adds one or more lines to the mysql.plugin table that describes\nthe plugin. This table contains the plugin name and library file name.\n\nINSTALL SONAME causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL SONAME also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL SONAME, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nSONAME only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nIf you need to install only one plugin from a library, use the INSTALL PLUGIN\nstatement.\n\nExamples\n--------\n\nTo load the XtraDB storage engine and all of its information_schema tables\nwith one statement, use\n\nINSTALL SONAME \'ha_xtradb\';\n\nThis statement can be used instead of INSTALL PLUGIN even when the library\ncontains only one plugin:\n\nINSTALL SONAME \'ha_sequence\';\n\nURL: https://mariadb.com/kb/en/install-soname/','','https://mariadb.com/kb/en/install-soname/'),
(75,'INSTALL PLUGIN',5,'Syntax\n------\n\nINSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement installs an individual plugin from the specified library. To\ninstall the whole library (which could be required), use INSTALL SONAME. See\nalso Installing a Plugin.\n\nplugin_name is the name of the plugin as defined in the plugin declaration\nstructure contained in the library file. Plugin names are not case sensitive.\nFor maximal compatibility, plugin names should be limited to ASCII letters,\ndigits, and underscore, because they are used in C source files, shell command\nlines, M4 and Bourne shell scripts, and SQL environments.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension can be omitted (which makes the statement look\nthe same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL PLUGIN adds a line to the mysql.plugin table that describes the\nplugin. This table contains the plugin name and library file name.\n\nINSTALL PLUGIN causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL PLUGIN also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL PLUGIN, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nPLUGIN only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a note instead of\nan error if the specified plugin already exists. See SHOW WARNINGS.\n\nExamples\n--------\n\nINSTALL PLUGIN sphinx SONAME \'ha_sphinx.so\';\n\nThe extension can also be omitted:\n\nINSTALL PLUGIN innodb SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected (0.104 sec)\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message                            |\n+-------+------+------------------------------------+\n| Note  | 1968 | Plugin \'example\' already installed |\n+-------+------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/install-plugin/','','https://mariadb.com/kb/en/install-plugin/'),
(78,'UNINSTALL SONAME',5,'Syntax\n------\n\nUNINSTALL SONAME  [IF EXISTS] \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of UNINSTALL PLUGIN statement, that removes all\nplugins belonging to a specified plugin_library. See UNINSTALL PLUGIN for\ndetails.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nTo use UNINSTALL SONAME, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin library does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nTo uninstall the XtraDB plugin and all of its information_schema tables with\none statement, use\n\nUNINSTALL SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------------+\n| Level | Code | Message                             |\n+-------+------+-------------------------------------+\n| Note  | 1305 | SONAME ha_example.so does not exist |\n+-------+------+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/uninstall-soname/','','https://mariadb.com/kb/en/uninstall-soname/'),
(79,'Plugin Overview',5,'Plugins are server components that enhance MariaDB in some way. These can be\nanything from new storage engines, plugins for enhancing full-text parsing, or\neven small enhancements, such as a plugin to get a timestamp as an integer.\n\nQuerying Plugin Information\n---------------------------\n\nThere are a number of ways to see which plugins are currently active.\n\nA server almost always has a large number of active plugins, because the\nserver contains a large number of built-in plugins, which are active by\ndefault and cannot be uninstalled.\n\nQuerying Plugin Information with SHOW PLUGINS\n---------------------------------------------\n\nThe SHOW PLUGINS statement can be used to query information about all active\nplugins.\n\nFor example:\n\nSHOW PLUGINS\\G;\n********************** 1. row **********************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n********************** 2. row **********************\n Name: mysql_native_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n********************** 3. row **********************\n Name: mysql_old_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n...\n\nIf a plugin\'s Library column has a NULL value, then the plugin is built-in,\nand it cannot be uninstalled.\n\nQuerying Plugin Information with information_schema.PLUGINS\n-----------------------------------------------------------\n\nThe information_schema.PLUGINS table can be queried to get more detailed\ninformation about plugins.\n\nFor example:\n\nSELECT * FROM information_schema.PLUGINS\\G\n...\n*************************** 6. row ***************************\n     PLUGIN_NAME: CSV\n    PLUGIN_VERSION: 1.0\n    PLUGIN_STATUS: ACTIVE\n     PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n    PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n    PLUGIN_AUTHOR: Brian Aker, MySQL AB\n  PLUGIN_DESCRIPTION: CSV storage engine\n    PLUGIN_LICENSE: GPL\n     LOAD_OPTION: FORCE\n   PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n*************************** 7. row ***************************\n     PLUGIN_NAME: MEMORY\n    PLUGIN_VERSION: 1.0\n    PLUGIN_STATUS: ACTIVE\n     PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n    PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n    PLUGIN_AUTHOR: MySQL AB\n  PLUGIN_DESCRIPTION: Hash based, stored in memory, useful for temporary\ntables\n    PLUGIN_LICENSE: GPL\n     LOAD_OPTION: FORCE\n   PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n...\n\nIf a plugin\'s PLUGIN_LIBRARY column has the NULL value, then the plugin is\nbuilt-in, and it cannot be uninstalled.\n\nQuerying Plugin Information with mysql.plugin\n---------------------------------------------\n\nThe mysql.plugin table can be queried to get information about installed\nplugins.\n\nThis table only contains information about plugins that have been installed\nvia the following methods:\n\n* The INSTALL SONAME statement.\n* The INSTALL PLUGIN statement.\n* The mariadb-plugin utility.\n\nThis table does not contain information about:\n\n* Built-in plugins.\n* Plugins loaded with the --plugin-load-add option.\n* Plugins loaded with the --plugin-load option.\n\nThis table only contains enough information to reload the plugin when the\nserver is restarted, which means it only contains the plugin name and the\nplugin library.\n\nFor example:\n\nSELECT * FROM mysql.plugin;\n\n+------+------------+\n| name | dl         |\n+------+------------+\n| PBXT | libpbxt.so |\n+------+------------+\n\nInstalling a Plugin\n-------------------\n\nThere are three primary ways to install a plugin:\n\n* A plugin can be installed dynamically with an SQL statement.\n* A plugin can be installed with a mariadbd option, but it requires a server\nrestart.\n* A plugin can be installed with the mariadb-plugin utility, while the server\nis completely offline.\n\nWhen you are installing a plugin, you also have to ensure that:\n\n* The server\'s plugin directory is properly configured, and the plugin\'s\nlibrary is in the plugin directory.\n* The server\'s minimum plugin maturity is properly configured, and the plugin\nis mature enough to be installed.\n\nInstalling a Plugin Dynamically\n-------------------------------\n\nA plugin can be installed dynamically by executing either the INSTALL SONAME\nor the INSTALL PLUGIN statement.\n\nIf a plugin is installed with one of these statements, then a record will be\nadded to the mysql.plugins table for the plugin. This means that the plugin\nwill automatically be loaded every time the server restarts, unless\nspecifically uninstalled or deactivated.\n\nInstalling a Plugin with INSTALL SONAME\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL SONAME\nstatement. INSTALL SONAME installs all plugins from the given plugin library.\nThis could be required for some plugin libraries.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin), you could execute the\nfollowing:\n\nINSTALL SONAME \'server_audit\';\n\nInstalling a Plugin with INSTALL PLUGIN\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL PLUGIN\nstatement. INSTALL PLUGIN installs a single plugin from the given plugin\nlibrary.\n\nFor example, to install the server_audit audit plugin from the server_audit\nplugin library, you could execute the following:\n\nINSTALL PLUGIN server_audit SONAME \'server_audit\';\n\nInstalling a Plugin with Plugin Load Options\n--------------------------------------------\n\nA plugin can be installed with a mariadbd option by providing either the\n--plugin-load-add or the --plugin-load option.\n\nIf a plugin is installed with one of these options, then a record will not be\nadded to the mysql.plugins table for the plugin. This means that if the server\nis restarted without the same option set, then the plugin will not\nautomatically be loaded.\n\nInstalling a Plugin with --plugin-load-add\n------------------------------------------\n\nYou can install a plugin with the --plugin-load-add option by specifying the\noption as a command-line argument to mariadbd or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load-add option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mariadbd --user=mysql --plugin-load-add=\'server_audit\'\n--plugin-load-add=\'ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nSpecial care must be taken when specifying both the --plugin-load option and\nthe --plugin-load-add option together. The --plugin-load option resets the\nplugin load list, and this can cause unexpected problems if you are not aware.\nThe --plugin-load-add option does not reset the plugin load list, so it is\nmuch safer to use. See Specifying Multiple Plugin Load Options for more\ninformation.\n\nInstalling a Plugin with --plugin-load\n--------------------------------------\n\nYou can install a plugin with the --plugin-load option by specifying the\noption as a command-line argument to mariadbd or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mariadbd --user=mysql --plugin-load=\'server_audit;ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load = server_audit;ed25519=auth_ed25519\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option together. The --plugin-load option resets the plugin\nload list, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use. See Specifying Multiple Plugin Load Options for more information.\n\nSpecifying Multiple Plugin Load Options\n---------------------------------------\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option. The --plugin-load option resets the plugin load\nlist, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use.\n\nThis can have the following consequences:\n\n* If the --plugin-load option is specified multiple times, then only the last\ninstance will have any effect. For example, in the following case, the first\ninstance of the option is reset:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* If the --plugin-load option is specified after the --plugin-load-add option,\nthen it will also reset the changes made by that option. For example, in the\nfollowing case, the --plugin-load-add option does not do anything, because the\nsubsequent --plugin-load option resets the plugin load list:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* In contrast, if the --plugin-load option is specified before the\n--plugin-load-add option, then it will work fine, because the\n--plugin-load-add option does not reset the plugin load list. For example, in\nthe following case, both plugins are properly loaded:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nInstalling a Plugin with mariadb-plugin\n---------------------------------------\n\nA plugin can be installed with the mariadb-plugin utility if the server is\ncompletely offline.\n\nThe syntax is:\n\nmariadb-plugin [options] <plugin> ENABLE|DISABLE\n\nFor example, to install the server_audit audit plugin, you could execute the\nfollowing:\n\nmariadb-plugin server_audit ENABLE\n\nIf a plugin is installed with this utility, then a record will be added to the\nmysql.plugins table for the plugin. This means that the plugin will\nautomatically be loaded every time the server restarts, unless specifically\nuninstalled or deactivated.\n\nConfiguring the Plugin Directory\n--------------------------------\n\nWhen a plugin is being installed, the server looks for the plugin\'s library in\nthe server\'s plugin directory. This directory is configured by the plugin_dir\nsystem variable. This can be specified as a command-line argument to mariadbd\nor it can be specified in a relevant server option group in an option file.\nFor example:\n\n[mariadb]\n...\nplugin_dir = /usr/lib64/mysql/plugin\n\nConfiguring the Minimum Plugin Maturity\n---------------------------------------\n\nWhen a plugin is being installed, the server compares the plugin\'s maturity\nlevel against the server\'s minimum allowed plugin maturity. This can help\nprevent users from using unstable plugins on production servers. This minimum\nplugin maturity is configured by the plugin_maturity system variable. This can\nbe specified as a command-line argument to mariadbd or it can be specified in\na relevant server option group in an option file. For example:\n\n[mariadb]\n...\nplugin_maturity = stable\n\nConfiguring Plugin Activation at Server Startup\n-----------------------------------------------\n\nA plugin will be loaded by default when the server starts if:\n\n* The plugin was installed with the INSTALL SONAME statement.\n* The plugin was installed with the INSTALL PLUGIN statement.\n* The plugin was installed with the mariadb-plugin utility.\n* The server is configured to load the plugin with the --plugin-load-add\noption.\n* The server is configured to load the plugin with the --plugin-load option.\n\nThis behavior can be changed with special options that take the form\n--plugin-name. For example, for the server_audit audit plugin, the special\noption is called --server-audit.\n\nThe possible values for these special options are:\n\n+---------------------------------------+------------------------------------+\n| Option Value                          | Description                        |\n+---------------------------------------+------------------------------------+\n| OFF                                   | Disables the plugin without        |\n|                                       | removing it from the               |\n|                                       | mysql.plugins table.               |\n+---------------------------------------+------------------------------------+\n| ON                                    | Enables the plugin. If the plugin  |\n|                                       | cannot be initialized, then the    |\n|                                       | server will still continue         |\n|                                       | starting up, but the plugin will   |\n|                                       | be disabled.                       |\n+---------------------------------------+------------------------------------+\n| FORCE                                 | Enables the plugin. If the plugin  |\n|                                       | cannot be initialized, then the    |\n|                                       | server will fail to start with an  |\n|                                       | error.                             |\n+---------------------------------------+------------------------------------+\n| FORCE_PLUS_PERMANENT                  | Enables the plugin. If the plugin  |\n|                                       | cannot be initialized, then the    |\n|                                       | server will fail to start with an  |\n|                                       | error. In addition, the plugin     |\n|                                       | cannot be uninstalled with         |\n|                                       | UNINSTALL SONAME or UNINSTALL      |\n|                                       | PLUGIN while the server is         |\n|                                       | running.                           |\n+---------------------------------------+------------------------------------+\n\nA plugin\'s status can be found by looking at the PLUGIN_STATUS column of the\ninformation_schema.PLUGINS table.\n\nUninstalling Plugins\n--------------------\n\nPlugins that are found in the mysql.plugin table, that is those that were\ninstalled with INSTALL SONAME, INSTALL PLUGIN or mariadb-plugin can be\nuninstalled in one of two ways:\n\n* The UNINSTALL SONAME or the UNINSTALL PLUGIN statement while the server is\nrunning\n* With mariadb-plugin while the server is offline.\n\nPlugins that were enabled as a --plugin-load option do not need to be\nuninstalled. If --plugin-load is omitted the next time the server starts, or\nthe plugin is not listed as one of the --plugin-load entries, the plugin will\nnot be loaded.\n\nUNINSTALL PLUGIN uninstalls a single installed plugin, while UNINSTALL SONAME\nuninstalls all plugins belonging to a given library.\n\nURL: https://mariadb.com/kb/en/plugin-overview/','','https://mariadb.com/kb/en/plugin-overview/'),
(80,'MBR Definition',6,'Description\n-----------\n\nThe MBR (Minimum Bounding Rectangle), or Envelope is the bounding geometry,\nformed by the minimum and maximum (X,Y) coordinates:\n\nExamples\n--------\n\n((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: https://mariadb.com/kb/en/mbr-definition/','','https://mariadb.com/kb/en/mbr-definition/'),
(81,'MBRContains',6,'Syntax\n------\n\nMBRContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GeomFromText(\'Point(1 1)\');\n\nSELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n+----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n|                    1 |                    0 |\n+----------------------+----------------------+\n\nURL: https://mariadb.com/kb/en/mbrcontains/','','https://mariadb.com/kb/en/mbrcontains/'),
(83,'MBREqual',6,'Syntax\n------\n\nMBREqual(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are the same.\n\nExamples\n--------\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 2)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 2, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 3)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 4, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n|                 0 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/mbrequal/','','https://mariadb.com/kb/en/mbrequal/'),
(82,'MBRDisjoint',6,'Syntax\n------\n\nMBRDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are disjoint. Two geometries are disjoint if they do not\nintersect, that is touch or overlap.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECTmbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/mbrdisjoint/','','https://mariadb.com/kb/en/mbrdisjoint/'),
(84,'MBRIntersects',6,'Syntax\n------\n\nMBRIntersects(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 intersect.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n|                      1 |\n+------------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/mbrintersects/','','https://mariadb.com/kb/en/mbrintersects/'),
(85,'MBROverlaps',6,'Syntax\n------\n\nMBROverlaps(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 overlap. The term spatially overlaps is used if two\ngeometries intersect and their intersection results in a geometry of the same\ndimension but not equal to either of the given geometries.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/mbroverlaps/','','https://mariadb.com/kb/en/mbroverlaps/'),
(86,'MBRTouches',6,'Syntax\n------\n\nMBRTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 touch. Two geometries spatially touch if the interiors of\nthe geometries do not intersect, but the boundary of one of the geometries\nintersects either the boundary or the interior of the other.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/mbrtouches/','','https://mariadb.com/kb/en/mbrtouches/'),
(87,'MBRWithin',6,'Syntax\n------\n\nMBRWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1 is\nwithin the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nSELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n|                  1 |                  0 |\n+--------------------+--------------------+\n\nURL: https://mariadb.com/kb/en/mbrwithin/','','https://mariadb.com/kb/en/mbrwithin/'),
(91,'NULLIF',7,'Syntax\n------\n\nNULLIF(expr1,expr2)\n\nDescription\n-----------\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the\nsame as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nExamples\n--------\n\nSELECT NULLIF(1,1);\n+-------------+\n| NULLIF(1,1) |\n+-------------+\n|        NULL |\n+-------------+\n\nSELECT NULLIF(1,2);\n+-------------+\n| NULLIF(1,2) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/nullif/','','https://mariadb.com/kb/en/nullif/'),
(92,'NVL',7,'MariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, NVL is a synonym for IFNULL.\n\nURL: https://mariadb.com/kb/en/nvl/','','https://mariadb.com/kb/en/nvl/'),
(93,'NVL2',7,'MariaDB starting with 10.3\n--------------------------\nThe NLV2 function was introduced in MariaDB 10.3.0.\n\nSyntax\n------\n\nNVL2(expr1,expr2,expr3)\n\nDescription\n-----------\n\nThe NVL2 function returns a value based on whether a specified expression is\nNULL or not. If expr1 is not NULL, then NVL2 returns expr2. If expr1 is NULL,\nthen NVL2 returns expr3.\n\nExamples\n--------\n\nSELECT NVL2(NULL,1,2);\n+----------------+\n| NVL2(NULL,1,2) |\n+----------------+\n|              2 |\n+----------------+\n\nSELECT NVL2(\'x\',1,2);\n+---------------+\n| NVL2(\'x\',1,2) |\n+---------------+\n|             1 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/nvl2/','','https://mariadb.com/kb/en/nvl2/'),
(102,'UNLOCK TABLES',8,'Syntax\n------\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\nSee LOCK TABLES for more information.\n\nIn addition to releasing table locks acquired by the LOCK TABLES statement,\nthe UNLOCK TABLES statement also releases the global read lock acquired by the\nFLUSH TABLES WITH READ LOCK statement. The FLUSH TABLES WITH READ LOCK\nstatement is very useful for performing backups. See FLUSH for more\ninformation about FLUSH TABLES WITH READ LOCK.\n\nURL: https://mariadb.com/kb/en/transactions-unlock-tables/','','https://mariadb.com/kb/en/transactions-unlock-tables/'),
(104,'XA Transactions',8,'Overview\n--------\n\nThe MariaDB XA implementation is based on the X/Open CAE document Distributed\nTransaction Processing: The XA Specification. This document is published by\nThe Open Group and available at\nhttp://www.opengroup.org/public/pubs/catalog/c193.htm.\n\nXA transactions are designed to allow distributed transactions, where a\ntransaction manager (the application) controls a transaction which involves\nmultiple resources. Such resources are usually DBMSs, but could be resources\nof any type. The whole set of required transactional operations is called a\nglobal transaction. Each subset of operations which involve a single resource\nis called a local transaction. XA used a 2-phases commit (2PC). With the first\ncommit, the transaction manager tells each resource to prepare an effective\ncommit, and waits for a confirm message. The changes are not still made\neffective at this point. If any of the resources encountered an error, the\ntransaction manager will rollback the global transaction. If all resources\ncommunicate that the first commit is successful, the transaction manager can\nrequire a second commit, which makes the changes effective.\n\nIn MariaDB, XA transactions can only be used with storage engines that support\nthem. At least InnoDB, TokuDB, SPIDER and MyRocks support them. For InnoDB,\nuntil MariaDB 10.2, XA transactions can be disabled by setting the\ninnodb_support_xa server system variable to 0. From MariaDB 10.3, XA\ntransactions are always supported.\n\nLike regular transactions, XA transactions create metadata locks on accessed\ntables.\n\nXA transactions require REPEATABLE READ as a minimum isolation level. However,\ndistributed transactions should always use SERIALIZABLE.\n\nTrying to start more than one XA transaction at the same time produces a 1400\nerror (SQLSTATE \'XAE09\'). The same error is produced when attempting to start\nan XA transaction while a regular transaction is in effect. Trying to start a\nregular transaction while an XA transaction is in effect produces a 1399 error\n(SQLSTATE \'XAE07\').\n\nThe statements that cause an implicit COMMIT for regular transactions produce\na 1400 error (SQLSTATE \'XAE09\') if a XA transaction is in effect.\n\nInternal XA vs External XA\n--------------------------\n\nXA transactions are an overloaded term in MariaDB. If a storage engine is\nXA-capable, it can mean one or both of these:\n\n* It supports MariaDB\'s internal two-phase commit API. This is transparent to\nthe user. Sometimes this is called \"internal XA\", since MariaDB\'s internal\ntransaction coordinator log can handle coordinating these transactions.\n\n* It supports XA transactions, with the XA START, XA PREPARE, XA COMMIT, etc.\nstatements. Sometimes this is called \"external XA\", since it requires the use\nof an external transaction coordinator to use this feature properly.\n\nTransaction Coordinator Log\n---------------------------\n\nIf you have two or more XA-capable storage engines enabled, then a transaction\ncoordinator log must be available.\n\nThere are currently two implementations of the transaction coordinator log:\n\n* Binary log-based transaction coordinator log\n* Memory-mapped file-based transaction coordinator log\n\nIf the binary log is enabled on a server, then the server will use the binary\nlog-based transaction coordinator log. Otherwise, it will use the\nmemory-mapped file-based transaction coordinator log.\n\nSee Transaction Coordinator Log for more information.\n\nSyntax\n------\n\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER [FORMAT=[\'RAW\'|\'SQL\']]\n\nxid: gtrid [, bqual [, formatID ]]\n\nThe interface to XA transactions is a set of SQL statements starting with XA.\nEach statement changes a transaction\'s state, determining which actions it can\nperform. A transaction which does not exist is in the NON-EXISTING state.\n\nXA START (or BEGIN) starts a transaction and defines its xid (a transaction\nidentifier). The JOIN or RESUME keywords have no effect. The new transaction\nwill be in ACTIVE state.\n\nThe xid can have 3 components, though only the first one is mandatory. gtrid\nis a quoted string representing a global transaction identifier. bqual is a\nquoted string representing a local transaction identifier. formatID is an\nunsigned integer indicating the format used for the first two components; if\nnot specified, defaults to 1. MariaDB does not interpret in any way these\ncomponents, and only uses them to identify a transaction. xids of transactions\nin effect must be unique.\n\nXA END declares that the specified ACTIVE transaction is finished and it\nchanges its state to IDLE. SUSPEND [FOR MIGRATE] has no effect.\n\nXA PREPARE prepares an IDLE transaction for commit, changing its state to\nPREPARED. This is the first commit.\n\nXA COMMIT definitely commits and terminates a transaction which has already\nbeen PREPARED. If the ONE PHASE clause is specified, this statements performs\na 1-phase commit on an IDLE transaction.\n\nXA ROLLBACK rolls back and terminates an IDLE or PREPARED transaction.\n\nXA RECOVER shows information about all PREPARED transactions.\n\nWhen trying to execute an operation which is not allowed for the transaction\'s\ncurrent state, an error is produced:\n\nXA COMMIT \'test\' ONE PHASE;\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the  ACTIVE state\n\nXA COMMIT \'test2\';\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the  NON-EXISTING state\n\nXA RECOVER\n----------\n\nThe XA RECOVER statement shows information about all transactions which are in\nthe PREPARED state. It does not matter which connection created the\ntransaction: if it has been PREPARED, it appears. But this does not mean that\na connection can commit or rollback a transaction which was started by another\nconnection. Note that transactions using a 1-phase commit are never in the\nPREPARED state, so they cannot be shown by XA RECOVER.\n\nXA RECOVER produces four columns:\n\nXA RECOVER;\n+----------+--------------+--------------+------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+------+\n|        1 |            4 |            0 | test |\n+----------+--------------+--------------+------+\n\nMariaDB starting with 10.3.3\n----------------------------\nYou can use XA RECOVER FORMAT=\'SQL\' to get the data in a human readable form\nthat can be directly copy-pasted into XA COMMIT or XA ROLLBACK. This is\nparticularly useful for binary xid generated by some transaction coordinators.\n\nformatID is the formatID part of xid.\n\ndata are the gtrid and bqual parts of xid, concatenated.\n\ngtrid_length and bqual_length are the lengths of gtrid and bqual, respectevely.\n\nExamples\n--------\n\n2-phases commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA PREPARE \'test\';\n\nXA COMMIT \'test\';\n\n1-phase commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA COMMIT \'test\' ONE PHASE;\n\nHuman-readable:\n\nxa start \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\ninsert t1 values (40);\n\nxa end \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\nxa prepare \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n\nxa recover format=\'RAW\';\n+----------+--------------+--------------+--------------------+\n| formatID | gtrid_length | bqual_length | data               |\n+----------+--------------+--------------+--------------------+\n34      67v78abc       11 |            7 | 12\ndef |\n+----------+--------------+--------------+--------------------+\n\nxa recover format=\'SQL\';\n+----------+--------------+--------------+-------------------------------------\n---------+\n| formatID | gtrid_length | bqual_length | data                               \n     |\n+----------+--------------+--------------+-------------------------------------\n---------+\n|        3 |           11 |            7 |\nX\'31320d3334093637763738\',X\'6162630a646566\',3 |\n+----------+--------------+--------------+-------------------------------------\n---------+\n\nxa rollback X\'31320d3334093637763738\',X\'6162630a646566\',3;\n\nKnown Issues\n------------\n\nMariaDB Galera Cluster\n----------------------\n\nMariaDB Galera Cluster does not support XA transactions.\n\nHowever, MariaDB Galera Cluster builds include a built-in plugin called wsrep.\nPrior to MariaDB 10.4.3, this plugin was internally considered an XA-capable\nstorage engine. Consequently, these MariaDB Galera Cluster builds have\nmultiple XA-capable storage engines by default, even if the only \"real\"\nstorage engine that supports external XA transactions enabled on these builds\nby default is InnoDB. Therefore, when using one these builds MariaDB would be\nforced to use a transaction coordinator log by default, which could have\nperformance implications.\n\nSee Transaction Coordinator Log Overview: MariaDB Galera Cluster for more\ninformation.\n\nURL: https://mariadb.com/kb/en/xa-transactions/','','https://mariadb.com/kb/en/xa-transactions/'),
(105,'CREATE USER',10,'Syntax\n------\n\nCREATE [OR REPLACE] USER [IF NOT EXISTS] \n user_specification [,user_specification ...] \n [REQUIRE {NONE | tls_option [[AND] tls_option ...] }]\n [WITH resource_option [resource_option ...] ]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule  ...]\n\nauthentication_rule:\n  authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n  ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe CREATE USER statement creates new MariaDB accounts. To use it, you must\nhave the global CREATE USER privilege or the INSERT privilege for the mysql\ndatabase. For each account, CREATE USER creates a new row in mysql.user (until\nMariaDB 10.3 this is a table, from MariaDB 10.4 it\'s a view) or\nmysql.global_priv_table (from MariaDB 10.4) that has no privileges.\n\nIf any of the specified accounts, or any permissions for the specified\naccounts, already exist, then the server returns ERROR 1396 (HY000). If an\nerror occurs, CREATE USER will still create the accounts that do not result in\nan error. Only one error is produced for all users which have not been created:\n\nERROR 1396 (HY000): \n Operation CREATE USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nCREATE USER, DROP USER, CREATE ROLE, and DROP ROLE all produce the same error\ncode when they fail.\n\nSee Account Names below for details on how account names are specified.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it is basically a shortcut for:\n\nDROP USER IF EXISTS name;\nCREATE USER name ...;\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE OR REPLACE USER foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected (0.00 sec)\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified user already exists.\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE USER IF NOT EXISTS foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------------+\n| Level | Code | Message                                            |\n+-------+------+----------------------------------------------------+\n| Note  | 1973 | Can\'t create user \'foo2\'@\'test\'; it already exists |\n+-------+------+----------------------------------------------------+\n\nAuthentication Options\n----------------------\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored in the\nmysql.user/mysql.global_priv_table table.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nCREATE USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored in the\nmysql.user/mysql.global_priv_table table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nCREATE USER foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nCREATE USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nCREATE USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\') OR\nunix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nCREATE USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+\n| Limit Type                           | Decription                           |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR                 | Number of statements that the        |\n|                                      | account can issue per hour           |\n|                                      | (including updates)                  |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR                 | Number of updates (not queries)      |\n|                                      | that the account can issue per hour  |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR             | Number of connections that the       |\n|                                      | account can start per hour           |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS                 | Number of simultaneous connections   |\n|                                      | that can be accepted from the same   |\n|                                      | account; if it is 0,                 |\n|                                      | max_connections will be used         |\n|                                      | instead; if max_connections is 0,    |\n|                                      | there is no limit for this           |\n|                                      | account\'s simultaneous connections.  |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME                   | Timeout, in seconds, for statements  |\n|                                      | executed by the user. See also       |\n|                                      | Aborting Statements that Exceed a    |\n|                                      | Certain Time to Execute.             |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to create a user with resource limits:\n\nCREATE USER \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 10\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mariadb-admin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nAccount Names\n-------------\n\nAccount names have both a user name component and a host name component, and\nare specified as \'user_name\'@\'host_name\'.\n\nThe user name and host name may be unquoted, quoted as strings using double\nquotes (\") or single quotes (\'), or quoted as identifiers using backticks (`).\nYou must use quotes when using special characters (such as a hyphen) or\nwildcard characters. If you quote, you must quote the user name and host name\nseparately (for example \'user_name\'@\'host_name\').\n\nHost Name Component\n-------------------\n\nIf the host name is not provided, it is assumed to be \'%\'.\n\nHost names may contain the wildcard characters % and _. They are matched as if\nby the LIKE clause. If you need to use a wildcard character literally (for\nexample, to match a domain name with an underscore), prefix the character with\na backslash. See LIKE for more information on escaping wildcard characters.\n\nHost name matches are case-insensitive. Host names can match either domain\nnames or IP addresses. Use \'localhost\' as the host name to allow only local\nclient connections. On Linux, the loopback interface (127.0.0.1) will not\nmatch \'localhost\' as it is not considered a local connection: this means that\nonly connections via UNIX-domain sockets will match \'localhost\'.\n\nYou can use a netmask to match a range of IP addresses using \'base_ip/netmask\'\nas the host name. A user with an IP address ip_addr will be allowed to connect\nif the following condition is true:\n\nip_addr & netmask = base_ip\n\nFor example, given a user:\n\nCREATE USER \'maria\'@\'247.150.130.0/255.255.255.0\';\n\nthe IP addresses satisfying this condition range from 247.150.130.0 to\n247.150.130.255.\n\nUsing 255.255.255.255 is equivalent to not using a netmask at all. Netmasks\ncannot be used for IPv6 addresses.\n\nNote that the credentials added when creating a user with the \'%\' wildcard\nhost will not grant access in all cases. For example, some systems come with\nan anonymous localhost user, and when connecting from localhost this will take\nprecedence.\n\nBefore MariaDB 10.6, the host name component could be up to 60 characters in\nlength. Starting from MariaDB 10.6, it can be up to 255 characters.\n\nUser Name Component\n-------------------\n\nUser names must match exactly, including case. A user name that is empty is\nknown as an anonymous account and is allowed to match a login attempt with any\nuser name component. These are described more in the next section.\n\nFor valid identifiers to use as user names, see Identifier Names.\n\nIt is possible for more than one account to match when a user connects.\nMariaDB selects the first matching account after sorting according to the\nfollowing criteria:\n\n* Accounts with an exact host name are sorted before accounts using a wildcard\nin the\nhost name. Host names using a netmask are considered to be exact for sorting.\n* Accounts with a wildcard in the host name are sorted according to the\nposition of\nthe first wildcard character. Those with a wildcard character later in the\nhost name\nsort before those with a wildcard character earlier in the host name.\n* Accounts with a non-empty user name sort before accounts with an empty user\nname.\n* Accounts with an empty user name are sorted last. As mentioned previously,\nthese are known as anonymous accounts. These are described more in the next\nsection.\n\nThe following table shows a list of example account as sorted by these\ncriteria:\n\n+---------+-------------+\n| User    | Host        |\n+---------+-------------+\n| joffrey | 192.168.0.3 |\n|         | 192.168.0.% |\n| joffrey | 192.168.%   |\n|         | 192.168.%   |\n+---------+-------------+\n\nOnce connected, you only have the privileges granted to the account that\nmatched, not all accounts that could have matched. For example, consider the\nfollowing commands:\n\nCREATE USER \'joffrey\'@\'192.168.0.3\';\nCREATE USER \'joffrey\'@\'%\';\nGRANT SELECT ON test.t1 to \'joffrey\'@\'192.168.0.3\';\nGRANT SELECT ON test.t2 to \'joffrey\'@\'%\';\n\nIf you connect as joffrey from 192.168.0.3, you will have the SELECT privilege\non the table test.t1, but not on the table test.t2. If you connect as joffrey\nfrom any other IP address, you will have the SELECT privilege on the table\ntest.t2, but not on the table test.t1.\n\nUsernames can be up to 80 characters long before 10.6 and starting from 10.6\nit can be 128 characters long.\n\nAnonymous Accounts\n------------------\n\nAnonymous accounts are accounts where the user name portion of the account\nname is empty. These accounts act as special catch-all accounts. If a user\nattempts to log into the system from a host, and an anonymous account exists\nwith a host name portion that matches the user\'s host, then the user will log\nin as the anonymous account if there is no more specific account match for the\nuser name that the user entered.\n\nFor example, here are some anonymous accounts:\n\nCREATE USER \'\'@\'localhost\';\nCREATE USER \'\'@\'192.168.0.3\';\n\nFixing a Legacy Default Anonymous Account\n-----------------------------------------\n\nOn some systems, the mysql.db table has some entries for the \'\'@\'%\' anonymous\naccount by default. Unfortunately, there is no matching entry in the\nmysql.user/mysql.global_priv_table table, which means that this anonymous\naccount doesn\'t exactly exist, but it does have privileges--usually on the\ndefault test database created by mariadb-install-db. These account-less\nprivileges are a legacy that is leftover from a time when MySQL\'s privilege\nsystem was less advanced.\n\nThis situation means that you will run into errors if you try to create a\n\'\'@\'%\' account. For example:\n\nCREATE USER \'\'@\'%\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'\'@\'%\'\n\nThe fix is to DELETE the row in the mysql.db table and then execute FLUSH\nPRIVILEGES:\n\nDELETE FROM mysql.db WHERE User=\'\' AND Host=\'%\';\nFLUSH PRIVILEGES;\n\nAnd then the account can be created:\n\nCREATE USER \'\'@\'%\';\nQuery OK, 0 rows affected (0.01 sec)\n\nSee MDEV-13486 for more information.\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nCREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\nURL: https://mariadb.com/kb/en/create-user/','','https://mariadb.com/kb/en/create-user/'),
(106,'ALTER USER',10,'Syntax\n------\n\nALTER USER [IF EXISTS] \n user_specification [,user_specification] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule] ...\n\nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n  ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe ALTER USER statement modifies existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. The global SUPER privilege is also required if the read_only\nsystem variable is enabled.\n\nIf any of the specified user accounts do not yet exist, an error results. If\nan error occurs, ALTER USER will still modify the accounts that do not result\nin an error. Only one error is produced for all users which have not been\nmodified.\n\nIF EXISTS\n---------\n\nWhen the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror for each specified user that does not exist.\n\nAccount Names\n-------------\n\nFor ALTER USER statements, account names are specified as the username\nargument in the same way as they are for CREATE USER statements. See account\nnames from the CREATE USER page for details on how account names are specified.\n\nCURRENT_USER or CURRENT_USER() can also be used to alter the account logged\ninto the current session. For example, to change the current user\'s password\nto mariadb:\n\nALTER USER CURRENT_USER() IDENTIFIED BY \'mariadb\';\n\nAuthentication Options\n----------------------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to use more than one authentication plugin\nfor each user account. For example, this can be useful to slowly migrate users\nto the more secure ed25519 authentication plugin over time, while allowing the\nold mysql_native_password authentication plugin as an alternative for the\ntransitional period. See Authentication from MariaDB 10.4 for more.\n\nWhen running ALTER USER, not specifying an authentication option in the\nIDENTIFIED VIA clause will remove that authentication method. (However this\nwas not the case before MariaDB 10.4.13, see MDEV-21928)\n\nFor example, a user is created with the ability to authenticate via both a\npassword and unix_socket:\n\nCREATE USER \'bob\'@\'localhost\' \n IDENTIFIED VIA mysql_native_password USING PASSWORD(\'pwd\')\n OR unix_socket;\n\nSHOW CREATE USER \'bob\'@\'localhost\'\\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED VIA mysql_native_password\n USING \'*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD\'\n OR unix_socket\n\nIf the user\'s password is updated, but unix_socket authentication is not\nspecified in the IDENTIFIED VIA clause, unix_socket authentication will no\nlonger be permitted.\n\nALTER USER \'bob\'@\'localhost\' IDENTIFIED VIA mysql_native_password \n USING PASSWORD(\'pwd2\');\n\nSHOW CREATE USER \'bob\'@\'localhost\'\\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED BY PASSWORD \'*38366FDA01695B6A5A9DD4E428D9FB8F7EB75512\'\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored to the mysql.user table.\n\nFor example, if our password is mariadb, then we can set the account\'s\npassword with:\n\nALTER USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD#function. It will be stored to the\nmysql.user table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n\nAnd then we can set an account\'s password with the hash:\n\nALTER USER foo2@test \n IDENTIFIED BY PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nALTER USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nALTER USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nIn MariaDB 10.4 and later, the USING or AS keyword can also be used to provide\na plain-text password to a plugin if it\'s provided as an argument to the\nPASSWORD() function. This is only valid for authentication plugins that have\nimplemented a hook for the PASSWORD() function. For example, the ed25519\nauthentication plugin supports this:\n\nALTER USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can alter a user account to require these TLS options with\nthe following:\n\nALTER USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\' AND\n ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+------------------------------------+---------------------------------------+\n| Limit Type                         | Description                           |\n+------------------------------------+---------------------------------------+\n| MAX_QUERIES_PER_HOUR               | Number of statements that the         |\n|                                    | account can issue per hour            |\n|                                    | (including updates)                   |\n+------------------------------------+---------------------------------------+\n| MAX_UPDATES_PER_HOUR               | Number of updates (not queries) that  |\n|                                    | the account can issue per hour        |\n+------------------------------------+---------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR           | Number of connections that the        |\n|                                    | account can start per hour            |\n+------------------------------------+---------------------------------------+\n| MAX_USER_CONNECTIONS               | Number of simultaneous connections    |\n|                                    | that can be accepted from the same    |\n|                                    | account; if it is 0, max_connections  |\n|                                    | will be used instead; if              |\n|                                    | max_connections is 0, there is no     |\n|                                    | limit for this account\'s              |\n|                                    | simultaneous connections.             |\n+------------------------------------+---------------------------------------+\n| MAX_STATEMENT_TIME                 | Timeout, in seconds, for statements   |\n|                                    | executed by the user. See also        |\n|                                    | Aborting Statements that Exceed a     |\n|                                    | Certain Time to Execute.              |\n+------------------------------------+---------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to set an account\'s resource limits:\n\nALTER USER \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 10\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\nURL: https://mariadb.com/kb/en/alter-user/','','https://mariadb.com/kb/en/alter-user/'),
(108,'GRANT',10,'Syntax\n------\n\nGRANT\n  priv_type [(column_list)]\n   [, priv_type [(column_list)]] ...\n  ON [object_type] priv_level\n  TO user_specification [ user_options ...]\n\nuser_specification:\n username [authentication_option]\n | PUBLIC\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule  ...]\n\nauthentication_rule:\n  authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\nGRANT PROXY ON username\n  TO user_specification [, user_specification ...]\n  [WITH GRANT OPTION]\n\nGRANT rolename TO grantee [, grantee ...]\n  [WITH ADMIN OPTION]\n\ngrantee:\n  rolename\n  username [authentication_option]\n\nuser_options:\n  [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n  [WITH with_option [with_option] ...]\n\nobject_type:\n  TABLE\n | FUNCTION\n | PROCEDURE\n | PACKAGE\n\npriv_level:\n  *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nwith_option:\n  GRANT OPTION\n | resource_option\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nDescription\n-----------\n\nThe GRANT statement allows you to grant privileges or roles to accounts. To\nuse GRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nUse the REVOKE statement to revoke privileges granted with the GRANT statement.\n\nUse the SHOW GRANTS statement to determine what privileges an account has.\n\nAccount Names\n-------------\n\nFor GRANT statements, account names are specified as the username argument in\nthe same way as they are for CREATE USER statements. See account names from\nthe CREATE USER page for details on how account names are specified.\n\nImplicit Account Creation\n-------------------------\n\nThe GRANT statement also allows you to implicitly create accounts in some\ncases.\n\nIf the account does not yet exist, then GRANT can implicitly create it. To\nimplicitly create an account with GRANT, a user is required to have the same\nprivileges that would be required to explicitly create the account with the\nCREATE USER statement.\n\nIf the NO_AUTO_CREATE_USER SQL_MODE is set, then accounts can only be created\nif authentication information is specified, or with a CREATE USER statement.\nIf no authentication information is provided, GRANT will produce an error when\nthe specified account does not exist, for example:\n\nshow variables like \'%sql_mode%\' ;\n+---------------+--------------------------------------------+\n| Variable_name | Value                                      |\n+---------------+--------------------------------------------+\n| sql_mode      | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n+---------------+--------------------------------------------+\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' IDENTIFIED BY \'\';\nERROR 1133 (28000): Can\'t find any matching row in the user table\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' \n IDENTIFIED VIA PAM using \'mariadb\' require ssl ;\nQuery OK, 0 rows affected (0.00 sec)\n\nselect host, user from mysql.user where user=\'user123\' ;\n\n+------+----------+\n| host | user     |\n+------+----------+\n| %    | user123 |\n+------+----------+\n\nPrivilege Levels\n----------------\n\nPrivileges can be set globally, for an entire database, for a table or\nroutine, or for individual columns in a table. Certain privileges can only be\nset at certain levels.\n\nGlobal privileges do not take effect immediately and are only applied to\nconnections created after the GRANT statement was executed.\n\n* Global privileges priv_type are granted using *.* for\npriv_level. Global privileges include privileges to administer the database\nand manage user accounts, as well as privileges for all tables, functions, and\nprocedures. Global privileges are stored in the mysql.user table prior to\nMariaDB 10.4, and in  mysql.global_priv table afterwards.\n* Database privileges priv_type are granted using db_name.*\nfor priv_level, or using just * to use default database. Database\nprivileges include privileges to create tables and functions, as well as\nprivileges for all tables, functions, and procedures in the database. Database\nprivileges are stored in the mysql.db table.\n* Table privileges priv_type are granted using db_name.tbl_name\nfor priv_level, or using just tbl_name to specify a table in the default\ndatabase. The TABLE keyword is optional. Table privileges include the\nability to select and change data in the table. Certain table privileges can\nbe granted for individual columns.\n* Column privileges priv_type are granted by specifying a table for\npriv_level and providing a column list after the privilege type. They allow\nyou to control exactly which columns in a table users can select and change.\n* Function privileges priv_type are granted using FUNCTION db_name.routine_name\nfor priv_level, or using just  FUNCTION routine_name to specify a function\nin the default database.\n* Procedure privileges priv_type are granted using PROCEDURE\ndb_name.routine_name\nfor priv_level, or using just PROCEDURE routine_name to specify a procedure\nin the default database.\n\nThe USAGE Privilege\n-------------------\n\nThe USAGE privilege grants no real privileges. The SHOW GRANTS statement will\nshow a global USAGE privilege for a newly-created user. You can use USAGE with\nthe GRANT statement to change options like GRANT OPTION and\nMAX_USER_CONNECTIONS without changing any account privileges.\n\nThe ALL PRIVILEGES Privilege\n----------------------------\n\nThe ALL PRIVILEGES privilege grants all available privileges. Granting all\nprivileges only affects the given privilege level. For example, granting all\nprivileges on a table does not grant any privileges on the database or\nglobally.\n\nUsing ALL PRIVILEGES does not grant the special GRANT OPTION privilege.\n\nYou can use ALL instead of ALL PRIVILEGES.\n\nThe GRANT OPTION Privilege\n--------------------------\n\nUse the WITH GRANT OPTION clause to give users the ability to grant privileges\nto other users at the given privilege level. Users with the GRANT OPTION\nprivilege can only grant privileges they have. They cannot grant privileges at\na higher privilege level than they have the GRANT OPTION privilege.\n\nThe GRANT OPTION privilege cannot be set for individual columns. If you use\nWITH GRANT OPTION when specifying column privileges, the GRANT OPTION\nprivilege will be granted for the entire table.\n\nUsing the WITH GRANT OPTION clause is equivalent to listing GRANT OPTION as a\nprivilege.\n\nGlobal Privileges\n-----------------\n\nThe following table lists the privileges that can be granted globally. You can\nalso grant all database, table, and function privileges globally. When granted\nglobally, these privileges apply to all databases, tables, or functions,\nincluding those created later.\n\nTo set a global privilege, use *.* for priv_level.\n\nBINLOG ADMIN\n------------\n\nEnables administration of the binary log, including the PURGE BINARY LOGS\nstatement and setting the system variables:\n\n* binlog_annotate_row_events\n* binlog_cache_size\n* binlog_commit_wait_count\n* binlog_commit_wait_usec\n* binlog_direct_non_transactional_updates\n* binlog_expire_logs_seconds\n* binlog_file_cache_size\n* binlog_format\n* binlog_row_image\n* binlog_row_metadata\n* binlog_stmt_cache_size\n* expire_logs_days\n* log_bin_compress\n* log_bin_compress_min_len\n* log_bin_trust_function_creators\n* max_binlog_cache_size\n* max_binlog_size\n* max_binlog_stmt_cache_size\n* sql_log_bin and\n* sync_binlog.\n\nAdded in MariaDB 10.5.2.\n\nBINLOG MONITOR\n--------------\n\nNew name for REPLICATION CLIENT from MariaDB 10.5.2, (REPLICATION CLIENT still\nsupported as an alias for compatibility purposes). Permits running SHOW\ncommands related to the binary log, in particular the SHOW BINLOG STATUS and\nSHOW BINARY LOGS statements. Unlike REPLICATION CLIENT prior to MariaDB 10.5,\nSHOW REPLICA STATUS isn\'t included in this privilege, and REPLICA MONITOR is\nrequired.\n\nBINLOG REPLAY\n-------------\n\nEnables replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), executing SET timestamp when secure_timestamp is set to\nreplication, and setting the session values of system variables usually\nincluded in BINLOG output, in particular:\n\n* gtid_domain_id\n* gtid_seq_no\n* pseudo_thread_id\n* server_id.\n\nAdded in MariaDB 10.5.2\n\nCONNECTION ADMIN\n----------------\n\nEnables administering connection resource limit options. This includes\nignoring the limits specified by:\n\n* max_connections\n* max_user_connections and\n* max_password_errors.\n\nThe statements specified in init_connect are not executed, killing connections\nand queries owned by other users is permitted. The following\nconnection-related system variables can be changed:\n\n* connect_timeout\n* disconnect_on_expired_password\n* extra_max_connections\n* init_connect\n* max_connections\n* max_connect_errors\n* max_password_errors\n* proxy_protocol_networks\n* secure_auth\n* slow_launch_time\n* thread_pool_exact_stats\n* thread_pool_dedicated_listener\n* thread_pool_idle_timeout\n* thread_pool_max_threads\n* thread_pool_min_threads\n* thread_pool_oversubscribe\n* thread_pool_prio_kickup_timer\n* thread_pool_priority\n* thread_pool_size, and\n* thread_pool_stall_limit.\n\nAdded in MariaDB 10.5.2.\n\nCREATE USER\n-----------\n\nCreate a user using the CREATE USER statement, or implicitly create a user\nwith the GRANT statement.\n\nFEDERATED ADMIN\n---------------\n\nExecute CREATE SERVER, ALTER SERVER, and DROP SERVER statements. Added in\nMariaDB 10.5.2.\n\nFILE\n----\n\nRead and write files on the server, using statements like LOAD DATA INFILE or\nfunctions like LOAD_FILE(). Also needed to create CONNECT outward tables.\nMariaDB server must have the permissions to access those files.\n\nGRANT OPTION\n------------\n\nGrant global privileges. You can only grant privileges that you have.\n\nPROCESS\n-------\n\nShow information about the active processes, for example via SHOW PROCESSLIST\nor mariadb-admin processlist. If you have the PROCESS privilege, you can see\nall threads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using).\n\nREAD_ONLY ADMIN\n---------------\n\nUser can set the read_only system variable and allows the user to perform\nwrite operations, even when the read_only option is active. Added in MariaDB\n10.5.2.\n\nFrom MariaDB 10.11.0, the READ_ONLY ADMIN privilege has been removed from\nSUPER. The benefit of this is that one can remove the READ_ONLY ADMIN\nprivilege from all users and ensure that no one can make any changes on any\nnon-temporary tables. This is useful on replicas when one wants to ensure that\nthe replica is kept identical to the primary.\n\nRELOAD\n------\n\nExecute FLUSH statements or equivalent mariadb-admin commands.\n\nREPLICATION CLIENT\n------------------\n\nExecute SHOW MASTER STATUS and SHOW BINARY LOGS informative statements.\nRenamed to BINLOG MONITOR in MariaDB 10.5.2 (but still supported as an alias\nfor compatibility reasons). SHOW SLAVE STATUS was part of REPLICATION CLIENT\nprior to MariaDB 10.5.\n\nREPLICATION MASTER ADMIN\n------------------------\n\nPermits administration of primary servers, including the SHOW REPLICA HOSTS\nstatement, and setting the gtid_binlog_state, gtid_domain_id,\nmaster_verify_checksum and server_id system variables. Added in MariaDB 10.5.2.\n\nREPLICA MONITOR\n---------------\n\nPermit SHOW REPLICA STATUS and SHOW RELAYLOG EVENTS. From MariaDB 10.5.9.\n\nWhen a user would upgrade from an older major release to a MariaDB 10.5 minor\nrelease prior to MariaDB 10.5.9, certain user accounts would lose\ncapabilities. For example, a user account that had the REPLICATION CLIENT\nprivilege in older major releases could run SHOW REPLICA STATUS, but after\nupgrading to a MariaDB 10.5 minor release prior to MariaDB 10.5.9, they could\nno longer run SHOW REPLICA STATUS, because that statement was changed to\nrequire the REPLICATION REPLICA ADMIN privilege.\n\nThis issue is fixed in MariaDB 10.5.9 with this new privilege, which now\ngrants the user the ability to execute SHOW [ALL] (SLAVE | REPLICA) STATUS.\n\nWhen a database is upgraded from an older major release to MariaDB Server\n10.5.9 or later, any user accounts with the REPLICATION CLIENT or REPLICATION\nSLAVE privileges will automatically be granted the new REPLICA MONITOR\nprivilege. The privilege fix occurs when the server is started up, not when\nmariadb-upgrade is performed.\n\nHowever, when a database is upgraded from an early 10.5 minor release to\n10.5.9 and later, the user will have to fix any user account privileges\nmanually.\n\nREPLICATION REPLICA\n-------------------\n\nSynonym for REPLICATION SLAVE. From MariaDB 10.5.1.\n\nREPLICATION SLAVE\n-----------------\n\nAccounts used by replica servers on the primary need this privilege. This is\nneeded to get the updates made on the master. From MariaDB 10.5.1, REPLICATION\nREPLICA is an alias for REPLICATION SLAVE.\n\nREPLICATION SLAVE ADMIN\n-----------------------\n\nPermits administering replica servers, including START REPLICA/SLAVE, STOP\nREPLICA/SLAVE, CHANGE MASTER, SHOW REPLICA/SLAVE STATUS, SHOW RELAYLOG EVENTS\nstatements, replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), and setting the system variables:\n\n* gtid_cleanup_batch_size\n* gtid_ignore_duplicates\n* gtid_pos_auto_engines\n* gtid_slave_pos\n* gtid_strict_mode\n* init_slave\n* read_binlog_speed_limit\n* relay_log_purge\n* relay_log_recovery\n* replicate_do_db\n* replicate_do_table\n* replicate_events_marked_for_skip\n* replicate_ignore_db\n* replicate_ignore_table\n* replicate_wild_do_table\n* replicate_wild_ignore_table\n* slave_compressed_protocol\n* slave_ddl_exec_mode\n* slave_domain_parallel_threads\n* slave_exec_mode\n* slave_max_allowed_packet\n* slave_net_timeout\n* slave_parallel_max_queued\n* slave_parallel_mode\n* slave_parallel_threads\n* slave_parallel_workers\n* slave_run_triggers_for_rbr\n* slave_sql_verify_checksum\n* slave_transaction_retry_interval\n* slave_type_conversions\n* sync_master_info\n* sync_relay_log, and\n* sync_relay_log_info.\n\nAdded in MariaDB 10.5.2.\n\nSET USER\n--------\n\nEnables setting the DEFINER when creating triggers, views, stored functions\nand stored procedures. Added in MariaDB 10.5.2.\n\nSHOW DATABASES\n--------------\n\nList all databases using the SHOW DATABASES statement. Without the SHOW\nDATABASES privilege, you can still issue the SHOW DATABASES statement, but it\nwill only list databases containing tables on which you have privileges.\n\nSHUTDOWN\n--------\n\nShut down the server using SHUTDOWN or the mariadb-admin shutdown command.\n\nSUPER\n-----\n\nExecute superuser statements: CHANGE MASTER TO, KILL (users who do not have\nthis privilege can only KILL their own threads), PURGE LOGS, SET global system\nvariables, or the mariadb-admin debug command. Also, this permission allows\nthe user to write data even if the read_only startup option is set, enable or\ndisable logging, enable or disable replication on replica, specify a DEFINER\nfor statements that support that clause, connect once reaching the\nMAX_CONNECTIONS. If a statement has been specified for the init-connect mysqld\noption, that command will not be executed when a user with SUPER privileges\nconnects to the server.\n\nThe SUPER privilege has been split into multiple smaller privileges from\nMariaDB 10.5.2 to allow for more fine-grained privileges (MDEV-21743). The\nprivileges are:\n\n* SET USER\n* FEDERATED ADMIN\n* CONNECTION ADMIN\n* REPLICATION SLAVE ADMIN\n* BINLOG ADMIN\n* BINLOG REPLAY\n* REPLICA MONITOR\n* BINLOG MONITOR\n* REPLICATION MASTER ADMIN\n* READ_ONLY ADMIN\n\nHowever, the smaller privileges are still a part of the SUPER grant in MariaDB\n10.5.2. From MariaDB 11.0.1 onwards, these grants are no longer a part of\nSUPER and need to be granted separately (MDEV-29668).\n\nFrom MariaDB 10.11.0, the READ_ONLY ADMIN privilege has been removed from\nSUPER. The benefit of this is that one can remove the READ_ONLY ADMIN\nprivilege from all users and ensure that no one can make any changes on any\nnon-temporary tables. This is useful on replicas when one wants to ensure that\nthe replica is kept identical to the primary (MDEV-29596).\n\nDatabase Privileges\n-------------------\n\nThe following table lists the privileges that can be granted at the database\nlevel. You can also grant all table and function privileges at the database\nlevel. Table and function privileges on a database apply to all tables or\nfunctions in that database, including those created later.\n\nTo set a privilege for a database, specify the database using db_name.* for\npriv_level, or just use * to specify the default database.\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| CREATE                           | Create a database using the CREATE      |\n|                                  | DATABASE statement, when the privilege  |\n|                                  | is granted for a database. You can      |\n|                                  | grant the CREATE privilege on           |\n|                                  | databases that do not yet exist. This   |\n|                                  | also grants the CREATE privilege on     |\n|                                  | all tables in the database.             |\n+----------------------------------+-----------------------------------------+\n| CREATE ROUTINE                   | Create Stored Programs using the        |\n|                                  | CREATE PROCEDURE and CREATE FUNCTION    |\n|                                  | statements.                             |\n+----------------------------------+-----------------------------------------+\n| CREATE TEMPORARY TABLES          | Create temporary tables with the        |\n|                                  | CREATE TEMPORARY TABLE statement. This  |\n|                                  | privilege enable writing and dropping   |\n|                                  | those temporary tables                  |\n+----------------------------------+-----------------------------------------+\n| DROP                             | Drop a database using the DROP          |\n|                                  | DATABASE statement, when the privilege  |\n|                                  | is granted for a database. This also    |\n|                                  | grants the DROP privilege on all        |\n|                                  | tables in the database.                 |\n+----------------------------------+-----------------------------------------+\n| EVENT                            | Create, drop and alter EVENTs.          |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant database privileges. You can      |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n| LOCK TABLES                      | Acquire explicit locks using the LOCK   |\n|                                  | TABLES statement; you also need to      |\n|                                  | have the SELECT privilege on a table,   |\n|                                  | in order to lock it.                    |\n+----------------------------------+-----------------------------------------+\n\nTable Privileges\n----------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| ALTER                            | Change the structure of an existing     |\n|                                  | table using the ALTER TABLE statement.  |\n+----------------------------------+-----------------------------------------+\n| CREATE                           | Create a table using the CREATE TABLE   |\n|                                  | statement.  You can grant the CREATE    |\n|                                  | privilege on tables that do not yet     |\n|                                  | exist.                                  |\n+----------------------------------+-----------------------------------------+\n| CREATE VIEW                      | Create a view using the CREATE_VIEW     |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| DELETE                           | Remove rows from a table using the      |\n|                                  | DELETE statement.                       |\n+----------------------------------+-----------------------------------------+\n| DELETE HISTORY                   | Remove historical rows from a table     |\n|                                  | using the DELETE HISTORY statement.     |\n|                                  | Displays as DELETE VERSIONING ROWS      |\n|                                  | when running SHOW GRANTS until MariaDB  |\n|                                  | 10.3.15 and until MariaDB 10.4.5        |\n|                                  | (MDEV-17655), or when running SHOW      |\n|                                  | PRIVILEGES until MariaDB 10.5.2,        |\n|                                  | MariaDB 10.4.13 and MariaDB 10.3.23     |\n|                                  | (MDEV-20382). From MariaDB 10.3.4.      |\n|                                  | From MariaDB 10.3.5, if a user has the  |\n|                                  | SUPER privilege but not this            |\n|                                  | privilege, running mariadb-upgrade      |\n|                                  | will grant this privilege as well.      |\n+----------------------------------+-----------------------------------------+\n| DROP                             | Drop a table using the DROP TABLE       |\n|                                  | statement or a view using the DROP      |\n|                                  | VIEW statement. Also required to        |\n|                                  | execute the TRUNCATE TABLE statement.   |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant table privileges. You can only    |\n|                                  | grant privileges that you have.         |\n+----------------------------------+-----------------------------------------+\n| INDEX                            | Create an index on a table using the    |\n|                                  | CREATE INDEX statement. Without the     |\n|                                  | INDEX privilege, you can still create   |\n|                                  | indexes when creating a table using     |\n|                                  | the CREATE TABLE statement if the you   |\n|                                  | have the CREATE privilege, and you can  |\n|                                  | create indexes using the ALTER TABLE    |\n|                                  | statement if you have the ALTER         |\n|                                  | privilege.                              |\n+----------------------------------+-----------------------------------------+\n| INSERT                           | Add rows to a table using the INSERT    |\n|                                  | statement.  The INSERT privilege can    |\n|                                  | also be set on individual columns; see  |\n|                                  | Column Privileges below for details.    |\n+----------------------------------+-----------------------------------------+\n| REFERENCES                       | Unused.                                 |\n+----------------------------------+-----------------------------------------+\n| SELECT                           | Read data from a table using the        |\n|                                  | SELECT statement. The SELECT privilege  |\n|                                  | can also be set on individual columns;  |\n|                                  | see Column Privileges below for         |\n|                                  | details.                                |\n+----------------------------------+-----------------------------------------+\n| SHOW VIEW                        | Show the CREATE VIEW statement to       |\n|                                  | create a view using the SHOW CREATE     |\n|                                  | VIEW statement.                         |\n+----------------------------------+-----------------------------------------+\n| TRIGGER                          | Execute triggers associated to tables   |\n|                                  | you update, execute the CREATE          |\n|                                  | TRIGGER, DROP TRIGGER, and SHOW CREATE  |\n|                                  | TRIGGER statements.                     |\n+----------------------------------+-----------------------------------------+\n| UPDATE                           | Update existing rows in a table using   |\n|                                  | the UPDATE statement. UPDATE            |\n|                                  | statements usually include a WHERE      |\n|                                  | clause to update only certain rows.     |\n|                                  | You must have SELECT privileges on the  |\n|                                  | table or the appropriate columns for    |\n|                                  | the WHERE clause. The UPDATE privilege  |\n|                                  | can also be set on individual columns;  |\n|                                  | see Column Privileges below for         |\n|                                  | details.                                |\n+----------------------------------+-----------------------------------------+\n\nColumn Privileges\n-----------------\n\nSome table privileges can be set for individual columns of a table. To use\ncolumn privileges, specify the table explicitly and provide a list of column\nnames after the privilege type. For example, the following statement would\nallow the user to read the names and positions of employees, but not other\ninformation from the same table, such as salaries.\n\nGRANT SELECT (name, position) on Employee to \'jeffrey\'@\'localhost\';\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| INSERT (column_list)             | Add rows specifying values in columns   |\n|                                  | using the INSERT statement. If you      |\n|                                  | only have column-level INSERT           |\n|                                  | privileges, you must specify the        |\n|                                  | columns you are setting in the INSERT   |\n|                                  | statement. All other columns will be    |\n|                                  | set to their default values, or NULL.   |\n+----------------------------------+-----------------------------------------+\n| REFERENCES (column_list)         | Unused.                                 |\n+----------------------------------+-----------------------------------------+\n| SELECT (column_list)             | Read values in columns using the        |\n|                                  | SELECT statement. You cannot access or  |\n|                                  | query any columns for which you do not  |\n|                                  | have SELECT privileges, including in    |\n|                                  | WHERE, ON, GROUP BY, and ORDER BY       |\n|                                  | clauses.                                |\n+----------------------------------+-----------------------------------------+\n| UPDATE (column_list)             | Update values in columns of existing    |\n|                                  | rows using the UPDATE statement.        |\n|                                  | UPDATE statements usually include a     |\n|                                  | WHERE clause to update only certain     |\n|                                  | rows. You must have SELECT privileges   |\n|                                  | on the table or the appropriate         |\n|                                  | columns for the WHERE clause.           |\n+----------------------------------+-----------------------------------------+\n\nFunction Privileges\n-------------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| ALTER ROUTINE                    | Change the characteristics of a stored  |\n|                                  | function using the ALTER FUNCTION       |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| EXECUTE                          | Use a stored function. You need SELECT  |\n|                                  | privileges for any tables or columns    |\n|                                  | accessed by the function.               |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant function privileges. You can      |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n\nProcedure Privileges\n--------------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| ALTER ROUTINE                    | Change the characteristics of a stored  |\n|                                  | procedure using the ALTER PROCEDURE     |\n|                                  | statement.                              |\n+----------------------------------+-----------------------------------------+\n| EXECUTE                          | Execute a stored procedure using the    |\n|                                  | CALL statement. The privilege to call   |\n|                                  | a procedure may allow you to perform    |\n|                                  | actions you wouldn\'t otherwise be able  |\n|                                  | to do, such as insert rows into a       |\n|                                  | table.                                  |\n+----------------------------------+-----------------------------------------+\n| GRANT OPTION                     | Grant procedure privileges. You can     |\n|                                  | only grant privileges that you have.    |\n+----------------------------------+-----------------------------------------+\n\nGRANT EXECUTE ON PROCEDURE mysql.create_db TO maintainer;\n\nProxy Privileges\n----------------\n\n+----------------------------------+-----------------------------------------+\n| Privilege                        | Description                             |\n+----------------------------------+-----------------------------------------+\n| PROXY                            | Permits one user to be a proxy for      |\n|                                  | another.                                |\n+----------------------------------+-----------------------------------------+\n\nThe PROXY privilege allows one user to proxy as another user, which means\ntheir privileges change to that of the proxy user, and the CURRENT_USER()\nfunction returns the user name of the proxy user.\n\nThe PROXY privilege only works with authentication plugins that support it.\nThe default mysql_native_password authentication plugin does not support proxy\nusers.\n\nThe pam authentication plugin is the only plugin included with MariaDB that\ncurrently supports proxy users. The PROXY privilege is commonly used with the\npam authentication plugin to enable user and group mapping with PAM.\n\nFor example, to grant the PROXY privilege to an anonymous account that\nauthenticates with the pam authentication plugin, you could execute the\nfollowing:\n\nCREATE USER \'dba\'@\'%\' IDENTIFIED BY \'strongpassword\';\nGRANT ALL PRIVILEGES ON *.* TO \'dba\'@\'%\' ;\n\nCREATE USER \'\'@\'%\' IDENTIFIED VIA pam USING \'mariadb\';\nGRANT PROXY ON \'dba\'@\'%\' TO \'\'@\'%\';\n\nA user account can only grant the PROXY privilege for a specific user account\nif the granter also has the PROXY privilege for that specific user account,\nand if that privilege is defined WITH GRANT OPTION. For example, the following\nexample fails because the granter does not have the PROXY privilege for that\nspecific user account at all:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost                                                  \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nAnd the following example fails because the granter does have the PROXY\nprivilege for that specific user account, but it is not defined WITH GRANT\nOPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost                                                  \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\'                     \n                    |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nBut the following example succeeds because the granter does have the PROXY\nprivilege for that specific user account, and it is defined WITH GRANT OPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost                                                  \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\' WITH GRANT OPTION   \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\n\nA user account can grant the PROXY privilege for any other user account if the\ngranter has the PROXY privilege for the \'\'@\'%\' anonymous user account, like\nthis:\n\nGRANT PROXY ON \'\'@\'%\' TO \'dba\'@\'localhost\' WITH GRANT OPTION;\n\nFor example, the following example succeeds because the user can grant the\nPROXY privilege for any other user account:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER()          | CURRENT_USER()  |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost                                                  \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'\'@\'%\' TO \'alice\'@\'localhost\' WITH GRANT OPTION              \n                             |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'app1_dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nGRANT PROXY ON \'app2_dba\'@\'localhost\' TO \'carol\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nThe default root user accounts created by mariadb-install-db have this\nprivilege. For example:\n\nGRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION;\nGRANT PROXY ON \'\'@\'%\' TO \'root\'@\'localhost\' WITH GRANT OPTION;\n\nThis allows the default root user accounts to grant the PROXY privilege for\nany other user account, and it also allows the default root user accounts to\ngrant others the privilege to do the same.\n\nAuthentication Options\n----------------------\n\nThe authentication options for the GRANT statement are the same as those for\nthe CREATE USER statement.\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\')                       |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \n PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\') OR unix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nResource Limit Options\n----------------------\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+\n| Limit Type                           | Decription                           |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR                 | Number of statements that the        |\n|                                      | account can issue per hour           |\n|                                      | (including updates)                  |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR                 | Number of updates (not queries)      |\n|                                      | that the account can issue per hour  |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR             | Number of connections that the       |\n|                                      | account can start per hour           |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS                 | Number of simultaneous connections   |\n|                                      | that can be accepted from the same   |\n|                                      | account; if it is 0,                 |\n|                                      | max_connections will be used         |\n|                                      | instead; if max_connections is 0,    |\n|                                      | there is no limit for this           |\n|                                      | account\'s simultaneous connections.  |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME                   | Timeout, in seconds, for statements  |\n|                                      | executed by the user. See also       |\n|                                      | Aborting Statements that Exceed a    |\n|                                      | Certain Time to Execute.             |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nTo set resource limits for an account, if you do not want to change that\naccount\'s privileges, you can issue a GRANT statement with the USAGE\nprivilege, which has no meaning. The statement can name some or all limit\ntypes, in any order.\n\nHere is an example showing how to set resource limits:\n\nGRANT USAGE ON *.* TO \'someone\'@\'localhost\' WITH\n  MAX_USER_CONNECTIONS 0\n  MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mariadb-admin reload.\n\nUsers with the CONNECTION ADMIN privilege (in MariaDB 10.5.2 and later) or the\nSUPER privilege are not restricted by max_user_connections, max_connections,\nor max_password_errors.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| REQUIRE NONE              | TLS is not required for this account, but can  |\n|                           | still be used.                                 |\n+---------------------------+------------------------------------------------+\n| REQUIRE SSL               | The account must use TLS, but no valid X509    |\n|                           | certificate is required. This option cannot    |\n|                           | be combined with other TLS options.            |\n+---------------------------+------------------------------------------------+\n| REQUIRE X509              | The account must use TLS and must have a       |\n|                           | valid X509 certificate. This option implies    |\n|                           | REQUIRE SSL. This option cannot be combined    |\n|                           | with other TLS options.                        |\n+---------------------------+------------------------------------------------+\n| REQUIRE ISSUER \'issuer\'   | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the Certificate  |\n|                           | Authority must be the one specified via the    |\n|                           | string issuer. This option implies REQUIRE     |\n|                           | X509. This option can be combined with the     |\n|                           | SUBJECT, and CIPHER options in any order.      |\n+---------------------------+------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a       |\n|                           | valid X509 certificate. Also, the              |\n|                           | certificate\'s Subject must be the one          |\n|                           | specified via the string subject. This option  |\n|                           | implies REQUIRE X509. This option can be       |\n|                           | combined with the ISSUER, and CIPHER options   |\n|                           | in any order.                                  |\n+---------------------------+------------------------------------------------+\n| REQUIRE CIPHER \'cipher\'   | The account must use TLS, but no valid X509    |\n|                           | certificate is required. Also, the encryption  |\n|                           | used for the connection must use a specific    |\n|                           | cipher method specified in the string cipher.  |\n|                           | This option implies REQUIRE SSL. This option   |\n|                           | can be combined with the ISSUER, and SUBJECT   |\n|                           | options in any order.                          |\n+---------------------------+------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nGRANT USAGE ON *.* TO \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nRoles\n-----\n\nSyntax\n------\n\nGRANT role TO grantee [, grantee ... ]\n[ WITH ADMIN OPTION ]\n\ngrantee:\n  rolename\n  username [authentication_option]\n\nThe GRANT statement is also used to grant the use of a role to one or more\nusers or other roles. In order to be able to grant a role, the grantor doing\nso must have permission to do so (see WITH ADMIN in the CREATE ROLE article).\n\nSpecifying the WITH ADMIN OPTION permits the grantee to in turn grant the role\nto another.\n\nFor example, the following commands show how to grant the same role to a\ncouple different users.\n\nGRANT journalist TO hulda;\n\nGRANT journalist TO berengar WITH ADMIN OPTION;\n\nIf a user has been granted a role, they do not automatically obtain all\npermissions associated with that role. These permissions are only in use when\nthe user activates the role with the SET ROLE statement.\n\nTO PUBLIC\n---------\n\nMariaDB starting with 10.11\n---------------------------\n\nSyntax\n------\n\nGRANT <privilege> ON <database>.<object> TO PUBLIC;\nREVOKE <privilege> ON <database>.<object> FROM PUBLIC;\n\nGRANT ... TO PUBLIC grants privileges to all users with access to the server.\nThe privileges also apply to users created after the privileges are granted.\nThis can be useful when one only wants to state once that all users need to\nhave a certain set of privileges.\n\nWhen running SHOW GRANTS, a user will also see all privileges inherited from\nPUBLIC. SHOW GRANTS FOR PUBLIC will only show TO PUBLIC grants.\n\nGrant Examples\n--------------\n\nGranting Root-like Privileges\n-----------------------------\n\nYou can create a user that has privileges similar to the default root accounts\nby executing the following:\n\nCREATE USER \'alexander\'@\'localhost\';\nGRANT ALL PRIVILEGES ON  *.* to \'alexander\'@\'localhost\' WITH GRANT OPTION;\n\nURL: https://mariadb.com/kb/en/grant/','','https://mariadb.com/kb/en/grant/'),
(118,'Authentication from MariaDB 10.4',10,'MariaDB starting with 10.4\n--------------------------\nMariaDB 10.4 introduced a number of changes to the authentication process,\nintended to make things easier and more intuitive.\n\nOverview\n--------\n\nThere are four new main features in 10.4 relating to authentication:\n\n* It is possible to use more than one authentication plugin for each user\naccount. For example, this can be useful to slowly migrate users to the more\nsecure ed25519 authentication plugin over time, while allowing the old\nmysql_native_password authentication plugin as an alternative for the\ntransitional period.\n* The root@localhost user account created by mariadb-install-db is created\nwith the ability to use two authentication plugins.\nFirst, it is configured to try to use the unix_socket authentication plugin.\nThis allows the root@localhost user to login without a password via the local\nUnix socket file defined by the socket system variable, as long as the login\nis attempted from a process owned by the operating system root user account.\nSecond, if authentication fails with the unix_socket authentication plugin,\nthen it is configured to try to use the mysql_native_password authentication\nplugin. However, an invalid password is initially set, so in order to\nauthenticate this way, a password must be set with SET PASSWORD.\nHowever, just using the unix_socket authentication plugin may be fine for many\nusers, and it is very secure. You may want to try going without password\nauthentication to see how well it works for you. Remember, the best way to\nkeep your password safe is not to have one!\n\n* All user accounts, passwords, and global privileges are now stored in the\nmysql.global_priv table. The mysql.user table still exists and has exactly the\nsame set of columns as before, but it’s now a view that references the\nmysql.global_priv table. Tools that analyze the mysql.user table should\ncontinue to work as before. From MariaDB 10.4.13, the dedicated mariadb.sys\nuser is created as the definer of this view. Previously root was the definer,\nwhich resulted in privilege problems when this username was changed.\n* MariaDB 10.4 adds supports for User Password Expiry, which is not active by\ndefault.\n\nDescription\n-----------\n\nAs a result of the above changes, the open-for-everyone all-powerful root\naccount is finally gone. And installation scripts will no longer demand that\nyou \"PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !\", because\nthe root account is securely created automatically.\n\nTwo all-powerful accounts are created by default — root and the OS user that\nowns the data directory, typically mysql. They are created as:\n\nCREATE USER root@localhost IDENTIFIED VIA unix_socket OR mysql_native_password\nUSING \'invalid\'\nCREATE USER mysql@localhost IDENTIFIED VIA unix_socket OR\nmysql_native_password USING \'invalid\'\n\nUsing unix_socket means that if you are the system root user, you can login as\nroot@locahost without a password. This technique was pioneered by Otto\nKekäläinen in Debian MariaDB packages and has been successfully used in Debian\nsince as early as MariaDB 10.0.\n\nIt is based on a simple fact that asking the system root for a password adds\nno extra security — root has full access to all the data files and all process\nmemory anyway. But not asking for a password means, there is no root password\nto forget (no need for the numerous tutorials on \"how to reset MariaDB root\npassword\"). And if you want to script some tedious database work, there is no\nneed to store the root password in plain text for the script to use (no need\nfor debian-sys-maint user).\n\nStill, some users may wish to log in as MariaDB root without using sudo. Hence\nthe old authentication method — conventional MariaDB password — is still\navailable. By default it is disabled (\"invalid\" is not a valid password hash),\nbut one can set the password with a usual SET PASSWORD statement. And still\nretain the password-less access via sudo.\n\nIf you install MariaDB locally (say from a tarball), you would not want to use\nsudo to be able to login. This is why MariaDB creates a second all-powerful\nuser with the same name as a system user that owns the data directory. In\nlocal (not system-wide) installations, this will be the user who installed\nMariaDB — they automatically get convenient password-less root-like access,\nbecause they can access all the data files anyway.\n\nEven if MariaDB is installed system-wide, you may not want to run your\ndatabase maintenance scripts as system root — now you can run them as system\nmysql user. And you will know that they will never destroy your entire system,\neven if you make a typo in a shell script.\n\nHowever, seasoned MariaDB DBAs who are used to the old ways do need to make\nsome changes. See the examples below for common tasks.\n\nCookbook\n--------\n\nAfter installing MariaDB system-wide the first thing you’ve got used to doing\nis logging in into the unprotected root account and protecting it, that is,\nsetting the root password:\n\n$ sudo dnf install MariaDB-server\n$ mysql -uroot\n...\nMariaDB> set password = password(\"XH4VmT3_jt\");\n\nThis is not only unnecessary now, it will simply not work — there is no\nunprotected root account. To login as root use\n\n$ sudo dnf install MariaDB-server\n$ sudo mysql\n\nNote that it implies you are connecting via the unix socket, not tcp. If you\nhappen to have protocol=tcp in a system-wide /etc/my.cnf file, use sudo mysql\n--protocol=socket.\n\nAfter installing MariaDB locally you’ve also used to connect to the\nunprotected root account using mysql -uroot. This will not work either, simply\nuse mysql without specifying a username.\n\nIf you\'ve forgotten your root password, no problem — you can still connect\nusing sudo and change the password. And if you\'ve also removed unix_socket\nauthentication, to restore access do as follows:\n\n* restart MariaDB with --skip-grant-tables\n* login into the unprotected server\n* run FLUSH PRIVILEGES (note, before 10.4 this would’ve been the last step,\nnot anymore). This disables --skip-grant-tables and allows you to change the\nstored authentication method\n* run SET PASSWORD FOR root@localhost to change the root password.\n\nTo view inside privilege tables, the old mysql.user table still exists. You\ncan select from it as before, although you cannot update it anymore. It\ndoesn’t show alternative authentication plugins and this was one of the\nreasons for switching to the mysql.global_priv table — complex authentication\nrules did not fit into rigid structure of a relational table. You can select\nfrom the new table, for example:\n\nselect concat(user, \'@\', host, \' => \', json_detailed(priv)) from\nmysql.global_priv;\n\nReverting to the Previous Authentication Method for root@localhost\n------------------------------------------------------------------\n\nIf you don\'t want the root@localhost user account created by\nmariadb-install-db to use unix_socket authentication by default, then there\nare a few ways to revert to the previous mysql_native_password authentication\nmethod for this user account.\n\nConfiguring mariadb-install-db to Revert to the Previous Authentication Method\n------------------------------------------------------------------------------\n\nOne way to revert to the previous mysql_native_password authentication method\nfor the root@localhost user account is to execute mariadb-install-db with a\nspecial option. If mariadb-install-db is executed while\n--auth-root-authentication-method=normal is specified, then it will create the\ndefault user accounts using the default behavior of MariaDB 10.3 and before.\n\nThis means that the root@localhost user account will use mysql_native_password\nauthentication by default. There are some other differences as well. See\nmariadb-install-db: User Accounts Created by Default for more information.\n\nFor example, the option can be set on the command-line while running\nmariadb-install-db:\n\nmariadb-install-db --user=mysql --datadir=/var/lib/mysql\n--auth-root-authentication-method=normal\n\nThe option can also be set in an option file in an option group supported by\nmariadb-install-db. For example:\n\n[mysql_install_db]\nauth_root_authentication_method=normal\n\nIf the option is set in an option file and if mariadb-install-db is executed,\nthen mariadb-install-db will read this option from the option file, and it\nwill automatically set this option.\n\nAltering the User Account to Revert to the Previous Authentication Method\n-------------------------------------------------------------------------\n\nIf you have already installed MariaDB, and if the root@localhost user account\nis already using unix_socket authentication, then you can revert to the old\nmysql_native_password authentication method for the user account by executing\nthe following:\n\nALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING\nPASSWORD(\"verysecret\")\n\nURL: https://mariadb.com/kb/en/authentication-from-mariadb-104/','','https://mariadb.com/kb/en/authentication-from-mariadb-104/'),
(88,'CASE OPERATOR',7,'Syntax\n------\n\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nDescription\n-----------\n\nThe first version returns the result where value=compare_value. The second\nversion returns the result for the first condition that is true. If there was\nno matching result value, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\nThere is also a CASE statement, which differs from the CASE operator described\nhere.\n\nExamples\n--------\n\nSELECT CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END;\n+------------------------------------------------------------+\n| CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END |\n+------------------------------------------------------------+\n| one                                                        |\n+------------------------------------------------------------+\n\nSELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n+--------------------------------------------+\n| CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END |\n+--------------------------------------------+\n| true                                       |\n+--------------------------------------------+\n\nSELECT CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n+-----------------------------------------------------+\n| CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END |\n+-----------------------------------------------------+\n|                                                NULL |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/case-operator/','','https://mariadb.com/kb/en/case-operator/'),
(89,'IF Function',7,'Syntax\n------\n\nIF(expr1,expr2,expr3)\n\nDescription\n-----------\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2;\notherwise it returns expr3. IF() returns a numeric or string value, depending\non the context in which it is used.\n\nNote: There is also an IF statement which differs from the IF() function\ndescribed here.\n\nExamples\n--------\n\nSELECT IF(1>2,2,3);\n+-------------+\n| IF(1>2,2,3) |\n+-------------+\n|           3 |\n+-------------+\n\nSELECT IF(1<2,\'yes\',\'no\');\n+--------------------+\n| IF(1<2,\'yes\',\'no\') |\n+--------------------+\n| yes                |\n+--------------------+\n\nSELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n+---------------------------------------+\n| IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\') |\n+---------------------------------------+\n| no                                    |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/if-function/','','https://mariadb.com/kb/en/if-function/'),
(90,'IFNULL',7,'Syntax\n------\n\nIFNULL(expr1,expr2)\nNVL(expr1,expr2)\n\nDescription\n-----------\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2.\nIFNULL() returns a numeric or string value, depending on the context in which\nit is used.\n\nFrom MariaDB 10.3, NVL() is an alias for IFNULL().\n\nExamples\n--------\n\nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n|           1 |\n+-------------+\n\nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n|              10 |\n+-----------------+\n\nSELECT IFNULL(1/0,10);\n+----------------+\n| IFNULL(1/0,10) |\n+----------------+\n|        10.0000 |\n+----------------+\n\nSELECT IFNULL(1/0,\'yes\');\n+-------------------+\n| IFNULL(1/0,\'yes\') |\n+-------------------+\n| yes               |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/ifnull/','','https://mariadb.com/kb/en/ifnull/'),
(95,'COMMIT',8,'The COMMIT statement ends a transaction, saving any changes to the data so\nthat they become visible to subsequent transactions. Also, unlocks metadata\nchanged by current transaction. If autocommit is set to 1, an implicit commit\nis performed after each statement. Otherwise, all transactions which don\'t end\nwith an explicit COMMIT are implicitly rollbacked and the changes are lost.\nThe ROLLBACK statement can be used to do this explicitly.\n\nThe required syntax for the COMMIT statement is as follows:\n\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\n\nCOMMIT is the more important transaction terminator, as well as the more\ninteresting one. The basic form of the COMMIT statement is simply the keyword\nCOMMIT (the keyword WORK is simply noise and can be omitted without changing\nthe effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated.\n\nRELEASE tells the server to disconnect the client immediately after the\ncurrent transaction.\n\nThere are NO RELEASE and AND NO CHAIN options. By default, commits do not\nRELEASE or CHAIN, but it\'s possible to change this default behavior with the\ncompletion_type server system variable. In this case, the AND NO CHAIN and NO\nRELEASE options override the server default.\n\nURL: https://mariadb.com/kb/en/commit/','','https://mariadb.com/kb/en/commit/'),
(120,'ST_X',11,'Syntax\n------\n\nST_X(p)\nX(p)\n\nDescription\n-----------\n\nReturns the X-coordinate value for the point p as a double-precision number.\n\nST_X() and X() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT X(GeomFromText(@pt));\n+----------------------+\n| X(GeomFromText(@pt)) |\n+----------------------+\n|                 56.7 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_x/','','https://mariadb.com/kb/en/st_x/'),
(121,'ST_Y',11,'Syntax\n------\n\nST_Y(p)\nY(p)\n\nDescription\n-----------\n\nReturns the Y-coordinate value for the point p as a double-precision number.\n\nST_Y() and Y() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT Y(GeomFromText(@pt));\n+----------------------+\n| Y(GeomFromText(@pt)) |\n+----------------------+\n|                53.34 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_y/','','https://mariadb.com/kb/en/st_y/'),
(122,'X',11,'A synonym for ST_X.\n\nURL: https://mariadb.com/kb/en/point-properties-x/','','https://mariadb.com/kb/en/point-properties-x/'),
(123,'Y',11,'A synonym for ST_Y.\n\nURL: https://mariadb.com/kb/en/point-properties-y/','','https://mariadb.com/kb/en/point-properties-y/'),
(126,'DECODE_ORACLE',12,'MariaDB starting with 10.3.2\n----------------------------\nDECODE_ORACLE is a synonym for the Oracle mode version of the DECODE function,\nand is available in all modes.\n\nURL: https://mariadb.com/kb/en/decode_oracle/','','https://mariadb.com/kb/en/decode_oracle/'),
(134,'MD5',12,'Syntax\n------\n\nMD5(str)\n\nDescription\n-----------\n\nCalculates an MD5 128-bit checksum for the string.\n\nThe return value is a 32-hex digit string, and as of MariaDB 5.5, is a\nnonbinary string in the connection character set and collation, determined by\nthe values of the character_set_connection and collation_connection system\nvariables. Before 5.5, the return value was a binary string.\n\nNULL is returned if the argument was NULL.\n\nExamples\n--------\n\nSELECT MD5(\'testing\');\n+----------------------------------+\n| MD5(\'testing\')                   |\n+----------------------------------+\n| ae2b1fca515949e5d54fb22b8ed95575 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/md5/','','https://mariadb.com/kb/en/md5/'),
(94,'START TRANSACTION',8,'Syntax\n------\n\nSTART TRANSACTION [transaction_property [, transaction_property] ...] | BEGIN\n[WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\ntransaction_property:\n  WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n\nDescription\n-----------\n\nThe START TRANSACTION or BEGIN statement begins a new transaction. COMMIT\ncommits the current transaction, making its changes permanent. ROLLBACK rolls\nback the current transaction, canceling its changes. The SET autocommit\nstatement disables or enables the default autocommit mode for the current\nsession.\n\nSTART TRANSACTION and SET autocommit = 1 implicitly commit the current\ntransaction, if any.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are the\nCHAIN and RELEASE clauses. CHAIN and RELEASE can be used for additional\ncontrol over transaction completion. The value of the completion_type system\nvariable determines the default completion behavior.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the current\none ends, and the new transaction has the same isolation level as the\njust-terminated transaction. The RELEASE clause causes the server to\ndisconnect the current client session after terminating the current\ntransaction. Including the NO keyword suppresses CHAIN or RELEASE completion,\nwhich can be useful if the completion_type system variable is set to cause\nchaining or release completion by default.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. Note that\nunlike the global read_only mode, READ_ONLY ADMIN (and SUPER before MariaDB\n10.11.0) privilege doesn\'t allow writes and DDL statements on temporary tables\nare not allowed either.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the SET TRANSACTION\nstatement, in which case the specified mode is valid for all sessions, or for\nall subsequent transaction used by the current session.\n\nautocommit\n----------\n\nBy default, MariaDB runs with autocommit mode enabled. This means that as soon\nas you execute a statement that updates (modifies) a table, MariaDB stores the\nupdate on disk to make it permanent. To disable autocommit mode, use the\nfollowing statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to zero,\nchanges to transaction-safe tables (such as those for InnoDB or NDBCLUSTER)\nare not made permanent immediately. You must use COMMIT to store your changes\nto disk or ROLLBACK to ignore the changes.\n\nTo disable autocommit mode for a single series of statements, use the START\nTRANSACTION statement.\n\nDDL Statements\n--------------\n\nDDL statements (CREATE, ALTER, DROP) and administrative statements (FLUSH,\nRESET, OPTIMIZE, ANALYZE, CHECK, REPAIR, CACHE INDEX), transaction management\nstatements (BEGIN, START TRANSACTION) and LOAD DATA INFILE, cause an implicit\nCOMMIT and start a new transaction. An exception to this rule are the DDL that\noperate on temporary tables: you can CREATE, ALTER and DROP them without\ncausing any COMMIT, but those actions cannot be rolled back. This means that\nif you call ROLLBACK, the temporary tables you created in the transaction will\nremain, while the rest of the transaction will be rolled back.\n\nTransactions cannot be used in Stored Functions or Triggers. In Stored\nProcedures and Events BEGIN is not allowed, so you should use START\nTRANSACTION instead.\n\nA transaction acquires a metadata lock on every table it accesses to prevent\nother connections from altering their structure. The lock is released at the\nend of the transaction. This happens even with non-transactional storage\nengines (like MEMORY or CONNECT), so it makes sense to use transactions with\nnon-transactional tables.\n\nin_transaction\n--------------\n\nThe in_transaction system variable is a session-only, read-only variable that\nreturns 1 inside a transaction, and 0 if not in a transaction.\n\nWITH CONSISTENT SNAPSHOT\n------------------------\n\nThe WITH CONSISTENT SNAPSHOT option starts a consistent read for storage\nengines such as InnoDB that can do so, the same as if a START TRANSACTION\nfollowed by a SELECT from any InnoDB table was issued.\n\nSee Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT.\n\nExamples\n--------\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nURL: https://mariadb.com/kb/en/start-transaction/','','https://mariadb.com/kb/en/start-transaction/'),
(99,'SAVEPOINT',8,'Syntax\n------\n\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nDescription\n-----------\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT, RELEASE\nSAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nEach savepoint must have a legal MariaDB identifier. A savepoint is a named\nsub-transaction.\n\nNormally ROLLBACK undoes the changes performed by the whole transaction. When\nused with the TO clause, it undoes the changes performed after the specified\nsavepoint, and erases all subsequent savepoints. However, all locks that have\nbeen acquired after the save point will survive. RELEASE SAVEPOINT does not\nrollback or commit any changes, but removes the specified savepoint.\n\nWhen the execution of a trigger or a stored function begins, it is not\npossible to use statements which reference a savepoint which was defined from\nout of that stored program.\n\nWhen a COMMIT (including implicit commits) or a ROLLBACK statement (with no TO\nclause) is performed, they act on the whole transaction, and all savepoints\nare removed.\n\nErrors\n------\n\nIf COMMIT or ROLLBACK is issued and no transaction was started, no error is\nreported.\n\nIf SAVEPOINT is issued and no transaction was started, no error is reported\nbut no savepoint is created. When ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT\nis called for a savepoint that does not exist, an error like this is issued:\n\nERROR 1305 (42000): SAVEPOINT svp_name does not exist\n\nURL: https://mariadb.com/kb/en/savepoint/','','https://mariadb.com/kb/en/savepoint/'),
(140,'ENDPOINT',13,'A synonym for ST_ENDPOINT.\n\nURL: https://mariadb.com/kb/en/linestring-properties-endpoint/','','https://mariadb.com/kb/en/linestring-properties-endpoint/'),
(141,'GLENGTH',13,'Syntax\n------\n\nGLength(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n|           2.82842712474619 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/glength/','','https://mariadb.com/kb/en/glength/'),
(142,'NumPoints',13,'A synonym for ST_NumPoints.\n\nURL: https://mariadb.com/kb/en/linestring-properties-numpoints/','','https://mariadb.com/kb/en/linestring-properties-numpoints/'),
(143,'PointN',13,'A synonym for ST_PointN.\n\nURL: https://mariadb.com/kb/en/linestring-properties-pointn/','','https://mariadb.com/kb/en/linestring-properties-pointn/'),
(96,'ROLLBACK',8,'The ROLLBACK statement rolls back (ends) a transaction, destroying any changes\nto SQL-data so that they never become visible to subsequent transactions. The\nrequired syntax for the ROLLBACK statement is as follows.\n\nROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] \n[ TO [ SAVEPOINT ] {<savepoint name> | <simple target specification>} ]\n\nThe ROLLBACK statement will either end a transaction, destroying all data\nchanges that happened during any of the transaction, or it will just destroy\nany data changes that happened since you established a savepoint. The basic\nform of the ROLLBACK statement is just the keyword ROLLBACK (the keyword WORK\nis simply noise and can be omitted without changing the effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated. The AND NO CHAIN option just tells your DBMS to end the\ntransaction — that is, these four SQL statements are equivalent:\n\nROLLBACK; \nROLLBACK WORK; \nROLLBACK AND NO CHAIN; \nROLLBACK WORK AND NO CHAIN;\n\nAll of them end a transaction without saving any transaction characteristics.\nThe only other options, the equivalent statements:\n\nROLLBACK AND CHAIN;\nROLLBACK WORK AND CHAIN;\n\nboth tell your DBMS to end a transaction, but to save that transaction\'s\ncharacteristics for the next transaction.\n\nROLLBACK is much simpler than COMMIT: it may involve no more than a few\ndeletions (of Cursors, locks, prepared SQL statements and log-file entries).\nIt\'s usually assumed that ROLLBACK can\'t fail, although such a thing is\nconceivable (for example, an encompassing transaction might reject an attempt\nto ROLLBACK because it\'s lining up for a COMMIT).\n\nROLLBACK cancels all effects of a transaction. It does not cancel effects on\nobjects outside the DBMS\'s control (for example the values in host program\nvariables or the settings made by some SQL/CLI function calls). But in\ngeneral, it is a convenient statement for those situations when you say \"oops,\nthis isn\'t working\" or when you simply don\'t care whether your temporary work\nbecomes permanent or not.\n\nHere is a moot question. If all you\'ve been doing is SELECTs, so that there\nhave been no data changes, should you end the transaction with ROLLBACK or\nCOMMIT? It shouldn\'t really matter because both ROLLBACK and COMMIT do the\nsame transaction-terminating job. However, the popular conception is that\nROLLBACK implies failure, so after a successful series of SELECT statements\nthe convention is to end the transaction with COMMIT rather than ROLLBACK.\n\nMariaDB (and most other DBMSs) supports rollback of SQL-data change\nstatements, but not of SQL-Schema statements. This means that if you use any\nof CREATE, ALTER, DROP, GRANT, REVOKE, you are implicitly committing at\nexecution time.\n\nINSERT INTO Table_2 VALUES(5); \nDROP TABLE Table_3 CASCADE; \nROLLBACK;\n\nThe result will be that both the INSERT and the DROP will go through as\nseparate transactions so the ROLLBACK will have no effect.\n\nURL: https://mariadb.com/kb/en/rollback/','','https://mariadb.com/kb/en/rollback/'),
(100,'Metadata Locking',8,'MariaDB supports metadata locking. This means that when a transaction\n(including XA transactions) uses a table, it locks its metadata until the end\nof transaction. Non-transactional tables are also locked, as well as views and\nobjects which are related to locked tables/views (stored functions, triggers,\netc). When a connection tries to use a DDL statement (like an ALTER TABLE)\nwhich modifies a table that is locked, that connection is queued, and has to\nwait until it\'s unlocked. Using savepoints and performing a partial rollback\ndoes not release metadata locks.\n\nLOCK TABLES ... WRITE are also queued. Some wrong statements which produce an\nerror may not need to wait for the lock to be freed.\n\nThe metadata lock\'s timeout is determined by the value of the\nlock_wait_timeout server system variable (in seconds). However, note that its\ndefault value is 31536000 (1 year, MariaDB <= 10.2.3), or 86400 (1 day,\nMariaDB >= 10.2.4). If this timeout is exceeded, the following error is\nreturned:\n\nERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table stores information about existing metadata locks.\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5, the Performance Schema metadata_locks table contains\nmetadata lock information.\n\nExample\n-------\n\nLet\'s use the following MEMORY (non-transactional) table:\n\nCREATE TABLE t (a INT) ENGINE = MEMORY;\n\nConnection 1 starts a transaction, and INSERTs a row into t:\n\nSTART TRANSACTION;\n\nINSERT INTO t SET a=1;\n\nt\'s metadata is now locked by connection 1. Connection 2 tries to alter t, but\nhas to wait:\n\nALTER TABLE t ADD COLUMN b INT;\n\nConnection 2\'s prompt is blocked now.\n\nNow connection 1 ends the transaction:\n\nCOMMIT;\n\n...and connection 2 finally gets the output of its command:\n\nQuery OK, 1 row affected (35.23 sec)\nRecords: 1  Duplicates: 0  Warnings: 0\n\nURL: https://mariadb.com/kb/en/metadata-locking/','','https://mariadb.com/kb/en/metadata-locking/'),
(144,'STARTPOINT',13,'A synonym for ST_STARTPOINT.\n\nURL: https://mariadb.com/kb/en/linestring-properties-startpoint/','','https://mariadb.com/kb/en/linestring-properties-startpoint/'),
(145,'ST_ENDPOINT',13,'Syntax\n------\n\nST_EndPoint(ls)\nEndPoint(ls)\n\nDescription\n-----------\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nST_EndPoint() and EndPoint() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3)                          |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_endpoint/','','https://mariadb.com/kb/en/st_endpoint/'),
(146,'ST_NUMPOINTS',13,'Syntax\n------\n\nST_NumPoints(ls)\nNumPoints(ls)\n\nDescription\n-----------\n\nReturns the number of Point objects in the LineString value ls.\n\nST_NumPoints() and NumPoints() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n|                            3 |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/st_numpoints/','','https://mariadb.com/kb/en/st_numpoints/'),
(147,'ST_POINTN',13,'Syntax\n------\n\nST_PointN(ls,N)\nPointN(ls,N)\n\nDescription\n-----------\n\nReturns the N-th Point in the LineString value ls. Points are numbered\nbeginning with 1.\n\nST_PointN() and PointN() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2)                          |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_pointn/','','https://mariadb.com/kb/en/st_pointn/'),
(97,'SET TRANSACTION',8,'Syntax\n------\n\nSET [GLOBAL | SESSION] TRANSACTION\n  transaction_property [, transaction_property] ...\n\ntransaction_property:\n  ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n\nlevel:\n  REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n\nDescription\n-----------\n\nThis statement sets the transaction isolation level or the transaction access\nmode globally, for the current session, or for the next transaction:\n\n* With the GLOBAL keyword, the statement sets the default\n transaction level globally for all subsequent sessions. Existing sessions are\n unaffected.\n* With the SESSION keyword, the statement sets the default\n transaction level for all subsequent transactions performed within the\n current session.\n* Without any SESSION or GLOBAL keyword,\n the statement sets the isolation level for the next (not started) transaction\n performed within the current session.\n\nA change to the global default isolation level requires the SUPER privilege.\nAny session is free to change its session isolation level (even in the middle\nof a transaction), or the isolation level for its next transaction.\n\nIsolation Level\n---------------\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option on the command line or in an option file.\nValues of level for this option use dashes rather than spaces, so the\nallowable values are READ_UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, or\nSERIALIZABLE. For example, to set the default isolation level to REPEATABLE\nREAD, use these lines in the [mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\nTo determine the global and session transaction isolation levels at runtime,\ncheck the value of the tx_isolation system variable (note that the variable\nhas been renamed transaction_isolation from MariaDB 11.1.1, to match the\noption, and the old name deprecated).\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\n\nFrom MariaDB 11.1.1:\n\nSELECT @@GLOBAL.transaction_isolation, @@transaction_isolation;\n\nInnoDB supports each of the translation isolation levels described here using\ndifferent locking strategies. The default level is REPEATABLE READ. For\nadditional information about InnoDB record-level locks and how it uses them to\nexecute various types of statements, see InnoDB Lock Modes, and\nhttp://dev.mysql.com/doc/refman/en/innodb-locks-set.html.\n\nIsolation Levels\n----------------\n\nThe following sections describe how MariaDB supports the different transaction\nlevels.\n\nREAD UNCOMMITTED\n----------------\n\nSELECT statements are performed in a non-locking fashion, but a possible\nearlier version of a row might be used. Thus, using this isolation level, such\nreads are not consistent. This is also called a \"dirty read.\" Otherwise, this\nisolation level works like READ COMMITTED.\n\nREAD COMMITTED\n--------------\n\nA somewhat Oracle-like isolation level with respect to consistent\n(non-locking) reads: Each consistent read, even within the same transaction,\nsets and reads its own fresh snapshot. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), InnoDB locks\nonly index records, not the gaps before them, and thus allows the free\ninsertion of new records next to locked records. For UPDATE and DELETE\nstatements, locking depends on whether the statement uses a unique index with\na unique search condition (such as WHERE id = 100), or a range-type search\ncondition (such as WHERE id > 100). For a unique index with a unique search\ncondition, InnoDB locks only the index record found, not the gap before it.\nFor range-type searches, InnoDB locks the index range scanned, using gap locks\nor next-key (gap plus index-record) locks to block insertions by other\nsessions into the gaps covered by the range. This is necessary because\n\"phantom rows\" must be blocked for MySQL replication and recovery to work.\n\nNote: If the READ COMMITTED isolation level is used or the\ninnodb_locks_unsafe_for_binlog system variable is enabled, there is no InnoDB\ngap locking except for foreign-key constraint checking and duplicate-key\nchecking. Also, record locks for non-matching rows are released after MariaDB\nhas evaluated the WHERE condition.If you use READ COMMITTED or enable\ninnodb_locks_unsafe_for_binlog, you must use row-based binary logging.\n\nREPEATABLE READ\n---------------\n\nThis is the default isolation level for InnoDB. For consistent reads, there is\nan important difference from the READ COMMITTED isolation level: All\nconsistent reads within the same transaction read the snapshot established by\nthe first read. This convention means that if you issue several plain\n(non-locking) SELECT statements within the same transaction, these SELECT\nstatements are consistent also with respect to each other. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), UPDATE, and\nDELETE statements, locking depends on whether the statement uses a unique\nindex with a unique search condition, or a range-type search condition. For a\nunique index with a unique search condition, InnoDB locks only the index\nrecord found, not the gap before it. For other search conditions, InnoDB locks\nthe index range scanned, using gap locks or next-key (gap plus index-record)\nlocks to block insertions by other sessions into the gaps covered by the range.\n\nThis is the minimum isolation level for non-distributed XA transactions.\n\nSERIALIZABLE\n------------\n\nThis level is like REPEATABLE READ, but InnoDB implicitly converts all plain\nSELECT statements to SELECT ... LOCK IN SHARE MODE if autocommit is disabled.\nIf autocommit is enabled, the SELECT is its own transaction. It therefore is\nknown to be read only and can be serialized if performed as a consistent\n(non-locking) read and need not block for other transactions. (This means that\nto force a plain SELECT to block if other transactions have modified the\nselected rows, you should disable autocommit.)\n\nDistributed XA transactions should always use this isolation level.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. Note that\nunlike the global read_only mode, READ_ONLY ADMIN (and SUPER before MariaDB\n10.11.0) privilege doesn\'t allow writes and DDL statements on temporary tables\nare not allowed either.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the START TRANSACTION\nstatement, in which case the specified mode is only valid for one transaction.\n\nExamples\n--------\n\nSET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;\n\nAttempting to set the isolation level within an existing transaction without\nspecifying GLOBAL or SESSION.\n\nSTART TRANSACTION;\n\nSET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed while a\ntransaction is in progress\n\nURL: https://mariadb.com/kb/en/set-transaction/','','https://mariadb.com/kb/en/set-transaction/'),
(148,'ST_STARTPOINT',13,'Syntax\n------\n\nST_StartPoint(ls)\nStartPoint(ls)\n\nDescription\n-----------\n\nReturns the Point that is the start point of the LineString value ls.\n\nST_StartPoint() and StartPoint() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1)                            |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_startpoint/','','https://mariadb.com/kb/en/st_startpoint/'),
(98,'LOCK TABLES',8,'Syntax\n------\n\nLOCK TABLE[S]\n  tbl_name [[AS] alias] lock_type\n  [, tbl_name [[AS] alias] lock_type] ...\n  [WAIT n|NOWAIT]\n\nlock_type:\n  READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n | WRITE CONCURRENT\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nThe lock_type can be one of:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| READ                      | Read lock, no writes allowed                   |\n+---------------------------+------------------------------------------------+\n| READ LOCAL                | Read lock, but allow concurrent inserts        |\n+---------------------------+------------------------------------------------+\n| WRITE                     | Exclusive write lock. No other connections     |\n|                           | can read or write to this table                |\n+---------------------------+------------------------------------------------+\n| LOW_PRIORITY WRITE        | Exclusive write lock, but allow new read       |\n|                           | locks on the table until we get the write      |\n|                           | lock.                                          |\n+---------------------------+------------------------------------------------+\n| WRITE CONCURRENT          | Exclusive write lock, but allow READ LOCAL     |\n|                           | locks to the table.                            |\n+---------------------------+------------------------------------------------+\n\nMariaDB enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to prevent\nother sessions from modifying tables during periods when a session requires\nexclusive access to them. A session can acquire or release locks only for\nitself. One session cannot acquire locks for another session or release locks\nheld by another session.\n\nLocks may be used to emulate transactions or to get more speed when updating\ntables.\n\nLOCK TABLES explicitly acquires table locks for the current client session.\nTable locks can be acquired for base tables or views. To use LOCK TABLES, you\nmust have the LOCK TABLES privilege, and the SELECT privilege for each object\nto be locked. See GRANT\n\nFor view locking, LOCK TABLES adds all base tables used in the view to the set\nof tables to be locked and locks them automatically. If you lock a table\nexplicitly with LOCK TABLES, any tables used in triggers are also locked\nimplicitly, as described in Triggers and Implicit Locks.\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nLimitations\n-----------\n\n* LOCK TABLES doesn\'t work when using Galera cluster.   You may experience\ncrashes or locks when used with Galera.\n* LOCK TABLES works on XtraDB/InnoDB tables only if the innodb_table_locks\nsystem variable is set to 1 (the default) and autocommit is set to 0 (1 is\ndefault). Please note that no error message will be returned on LOCK TABLES\nwith innodb_table_locks = 0.\n* LOCK TABLES implicitly commits the active transaction, if any. Also,\nstarting a transaction always releases all table locks acquired with LOCK\nTABLES. This means that there is no way to have table locks and an active\ntransaction at the same time. The only exceptions are the transactions in\nautocommit mode. To preserve the data integrity between transactional and\nnon-transactional tables, the GET_LOCK() function can be used.\n* When using LOCK TABLES on a TEMPORARY table, it will always be locked with a\nWRITE lock.\n* While a connection holds an explicit read lock on a table, it cannot modify\nit. If you try, the following error will be produced:\n\nERROR 1099 (HY000): Table \'tab_name\' was locked with a READ lock and can\'t be\nupdated\n\n* While a connection holds an explicit lock on a table, it cannot access a\nnon-locked table. If you try, the following error will be produced:\n\nERROR 1100 (HY000): Table \'tab_name\' was not locked with LOCK TABLES\n\n* While a connection holds an explicit lock on a table, it cannot issue the\nfollowing: INSERT DELAYED, CREATE TABLE, CREATE TABLE ... LIKE, and DDL\nstatements involving stored programs and views (except for triggers). If you\ntry, the following error will be produced:\n\nERROR 1192 (HY000): Can\'t execute the given command because you have active\nlocked tables or an active transaction\n\n* LOCK TABLES can not be used in stored routines - if you try, the following\nerror will be produced on creation:\n\nERROR 1314 (0A000): LOCK is not allowed in stored procedures\n\nURL: https://mariadb.com/kb/en/lock-tables/','','https://mariadb.com/kb/en/lock-tables/'),
(101,'Transaction Timeouts',8,'MariaDB has always had the wait_timeout and interactive_timeout settings,\nwhich close connections after a certain period of inactivity.\n\nHowever, these are by default set to a long wait period. In situations where\ntransactions may be started, but not committed or rolled back, more granular\ncontrol and a shorter timeout may be desirable so as to avoid locks being held\nfor too long.\n\nMariaDB 10.3 introduced three new variables to handle this situation.\n\n* idle_transaction_timeout (all transactions)\n* idle_write_transaction_timeout (write transactions - called\nidle_readwrite_transaction_timeout until MariaDB 10.3.2)\n* idle_readonly_transaction_timeout (read transactions)\n\nThese accept a time in seconds to time out, by closing the connection,\ntransactions that are idle for longer than this period. By default all are set\nto zero, or no timeout.\n\nidle_transaction_timeout affects all transactions,\nidle_write_transaction_timeout affects write transactions only and\nidle_readonly_transaction_timeout affects read transactions only. The latter\ntwo variables work independently. However, if either is set along with\nidle_transaction_timeout, the settings for idle_write_transaction_timeout or\nidle_readonly_transaction_timeout will take precedence.\n\nExamples\n--------\n\nSET SESSION idle_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_write_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\nINSERT INTO t VALUES(1);\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_transaction_timeout=2, SESSION\nidle_readonly_transaction_timeout=10;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n ## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 11 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nURL: https://mariadb.com/kb/en/transaction-timeouts/','','https://mariadb.com/kb/en/transaction-timeouts/'),
(152,'INET_ATON',14,'Syntax\n------\n\nINET_ATON(expr)\n\nDescription\n-----------\n\nGiven the dotted-quad representation of an IPv4 network address as a string,\nreturns an integer that represents the numeric value of the address. Addresses\nmay be 4- or 8-byte addresses.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET_ATON(\'192.168.1.1\');\n+--------------------------+\n| INET_ATON(\'192.168.1.1\') |\n+--------------------------+\n|               3232235777 |\n+--------------------------+\n\nThis is calculated as follows: 192 x 2563 + 168 x 256 2 + 1 x 256 + 1\n\nURL: https://mariadb.com/kb/en/inet_aton/','','https://mariadb.com/kb/en/inet_aton/'),
(103,'WAIT and NOWAIT',8,'Extended syntax so that it is possible to set innodb_lock_wait_timeout and\nlock_wait_timeout for the following statements:\n\nSyntax\n------\n\nALTER TABLE tbl_name [WAIT n|NOWAIT] ...\nCREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ...\nDROP INDEX ... [WAIT n|NOWAIT]\nDROP TABLE tbl_name [WAIT n|NOWAIT] ...\nLOCK TABLE ... [WAIT n|NOWAIT]\nOPTIMIZE TABLE tbl_name [WAIT n|NOWAIT]\nRENAME TABLE tbl_name [WAIT n|NOWAIT] ...\nSELECT ... FOR UPDATE [WAIT n|NOWAIT]\nSELECT ... LOCK IN SHARE MODE [WAIT n|NOWAIT]\nTRUNCATE TABLE tbl_name [WAIT n|NOWAIT]\n\nDescription\n-----------\n\nThe lock wait timeout can be explicitly set in the statement by using either\nWAIT n (to set the wait in seconds) or NOWAIT, in which case the statement\nwill immediately fail if the lock cannot be obtained. WAIT 0 is equivalent to\nNOWAIT.\n\nURL: https://mariadb.com/kb/en/wait-and-nowait/','','https://mariadb.com/kb/en/wait-and-nowait/'),
(107,'DROP USER',10,'Syntax\n------\n\nDROP USER [IF EXISTS] user_name [, user_name] ...\n\nDescription\n-----------\n\nThe DROP USER statement removes one or more MariaDB accounts. It removes\nprivilege rows for the account from all grant tables. To use this statement,\nyou must have the global CREATE USER privilege or the DELETE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used. For\nadditional information about specifying account names, see CREATE USER.\n\nNote that, if you specify an account that is currently connected, it will not\nbe deleted until the connection is closed. The connection will not be\nautomatically closed.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP USER will still drop the accounts that do\nnot result in an error. Only one error is produced for all users which have\nnot been dropped:\n\nERROR 1396 (HY000): Operation DROP USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the user does not exist.\n\nExamples\n--------\n\nDROP USER bob;\n\nDROP USER foo2@localhost,foo2@\'127.%\';\n\nIF EXISTS:\n\nDROP USER bob;\nERROR 1396 (HY000): Operation DROP USER failed for \'bob\'@\'%\'\n\nDROP USER IF EXISTS bob;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message                                     |\n+-------+------+---------------------------------------------+\n| Note  | 1974 | Can\'t drop user \'bob\'@\'%\'; it doesn\'t exist |\n+-------+------+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-user/','','https://mariadb.com/kb/en/drop-user/'),
(109,'RENAME USER',10,'Syntax\n------\n\nRENAME USER old_user TO new_user\n  [, old_user TO new_user] ...\n\nDescription\n-----------\n\nThe RENAME USER statement renames existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\n\nIf any of the old user accounts do not exist or any of the new user accounts\nalready exist, ERROR 1396 (HY000) results. If an error occurs, RENAME USER\nwill still rename the accounts that do not result in an error.\n\nExamples\n--------\n\nCREATE USER \'donald\', \'mickey\';\nRENAME USER \'donald\' TO \'duck\'@\'localhost\', \'mickey\' TO \'mouse\'@\'localhost\';\n\nURL: https://mariadb.com/kb/en/rename-user/','','https://mariadb.com/kb/en/rename-user/'),
(110,'REVOKE',10,'Privileges\n----------\n\nSyntax\n------\n\nREVOKE \n  priv_type [(column_list)]\n   [, priv_type [(column_list)]] ...\n  ON [object_type] priv_level\n  FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n  FROM user [, user] ...\n\nDescription\n-----------\n\nThe REVOKE statement enables system administrators to revoke privileges (or\nroles - see section below) from MariaDB accounts. Each account is named using\nthe same format as for the GRANT statement; for example,\n\'jeffrey\'@\'localhost\'. If you specify only the user name part of the account\nname, a host name part of \'%\' is used. For details on the levels at which\nprivileges exist, the allowable priv_type and priv_level values, and the\nsyntax for specifying users and passwords, see GRANT.\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION privilege, and\nyou must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all global,\ndatabase, table, column, and routine privileges for the named user or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql database. See GRANT.\n\nExamples\n--------\n\nREVOKE SUPER ON *.* FROM \'alexander\'@\'localhost\';\n\nRoles\n-----\n\nSyntax\n------\n\nREVOKE role  [, role ...]\n  FROM grantee [, grantee2 ... ]\n\nREVOKE ADMIN OPTION FOR role FROM grantee [, grantee2]\n\nDescription\n-----------\n\nREVOKE is also used to remove a role from a user or another role that it\'s\npreviously been assigned to. If a role has previously been set as a default\nrole, REVOKE does not remove the record of the default role from the\nmysql.user table. If the role is subsequently granted again, it will again be\nthe user\'s default. Use SET DEFAULT ROLE NONE to explicitly remove this.\n\nBefore MariaDB 10.1.13, the REVOKE role statement was not permitted in\nprepared statements.\n\nExample\n-------\n\nREVOKE journalist FROM hulda\n\nURL: https://mariadb.com/kb/en/revoke/','','https://mariadb.com/kb/en/revoke/'),
(153,'INET_NTOA',14,'Syntax\n------\n\nINET_NTOA(expr)\n\nDescription\n-----------\n\nGiven a numeric IPv4 network address in network byte order (4 or 8 byte),\nreturns the dotted-quad representation of the address as a string.\n\nExamples\n--------\n\nSELECT INET_NTOA(3232235777);\n+-----------------------+\n| INET_NTOA(3232235777) |\n+-----------------------+\n| 192.168.1.1           |\n+-----------------------+\n\n192.168.1.1 corresponds to 3232235777 since 192 x 2563 + 168 x 256 2 + 1 x 256\n+ 1 = 3232235777\n\nURL: https://mariadb.com/kb/en/inet_ntoa/','','https://mariadb.com/kb/en/inet_ntoa/'),
(154,'IS_FREE_LOCK',14,'Syntax\n------\n\nIS_FREE_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock is in\nuse, and NULL if an error occurs (such as an incorrect argument, like an empty\nstring or NULL). str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_FREE_LOCK function are not safe for statement-based\nreplication.\n\nURL: https://mariadb.com/kb/en/is_free_lock/','','https://mariadb.com/kb/en/is_free_lock/'),
(158,'IS_IPV6',14,'Syntax\n------\n\nIS_IPV6(expr)\n\nDescription\n-----------\n\nReturns 1 if the expression is a valid IPv6 address specified as a string,\notherwise returns 0. Does not consider IPv4 addresses to be valid IPv6\naddresses.\n\nExamples\n--------\n\nSELECT IS_IPV6(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV6(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n|                                    1 |\n+--------------------------------------+\n1 row in set (0.02 sec)\n\nSELECT IS_IPV6(\'10.0.1.1\');\n+---------------------+\n| IS_IPV6(\'10.0.1.1\') |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv6/','','https://mariadb.com/kb/en/is_ipv6/'),
(111,'SET PASSWORD',10,'Syntax\n------\n\nSET PASSWORD [FOR user] =\n  {\n    PASSWORD(\'some password\')\n   | OLD_PASSWORD(\'some password\')\n   | \'encrypted password\'\n  }\n\nDescription\n-----------\n\nThe SET PASSWORD statement assigns a password to an existing MariaDB user\naccount.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD() function,\nthe literal text of the password should be given. If the password is specified\nwithout using either function, the password should be the already-encrypted\npassword value as returned by PASSWORD().\n\nOLD_PASSWORD() should only be used if your MariaDB/MySQL clients are very old\n(< 4.0.0).\n\nWith no FOR clause, this statement sets the password for the current user. Any\nclient that has connected to the server using a non-anonymous account can\nchange the password for that account.\n\nWith a FOR clause, this statement sets the password for a specific account on\nthe current server host. Only clients that have the UPDATE privilege for the\nmysql database can do this. The user value should be given in\nuser_name@host_name format, where user_name and host_name are exactly as they\nare listed in the User and Host columns of the mysql.user table (or view in\nMariaDB-10.4 onwards) entry.\n\nThe argument to PASSWORD() and the password given to MariaDB clients can be of\narbitrary length.\n\nAuthentication Plugin Support\n-----------------------------\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, SET PASSWORD (with or without PASSWORD()) works for\naccounts authenticated via any authentication plugin that supports passwords\nstored in the mysql.global_priv table.\n\nThe ed25519, mysql_native_password, and mysql_old_password authentication\nplugins store passwords in the mysql.global_priv table.\n\nIf you run SET PASSWORD on an account that authenticates with one of these\nauthentication plugins that stores passwords in the mysql.global_priv table,\nthen the PASSWORD() function is evaluated by the specific authentication\nplugin used by the account. The authentication plugin hashes the password with\na method that is compatible with that specific authentication plugin.\n\nThe unix_socket, named_pipe, gssapi, and pam authentication plugins do not\nstore passwords in the mysql.global_priv table. These authentication plugins\nrely on other methods to authenticate the user.\n\nIf you attempt to run SET PASSWORD on an account that authenticates with one\nof these authentication plugins that doesn\'t store a password in the\nmysql.global_priv table, then MariaDB Server will raise a warning like the\nfollowing:\n\nSET PASSWORD is ignored for users authenticating via unix_socket plugin\n\nSee Authentication from MariaDB 10.4 for an overview of authentication changes\nin MariaDB 10.4.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, SET PASSWORD (with or without PASSWORD()) only\nworks for accounts authenticated via mysql_native_password or\nmysql_old_password authentication plugins\n\nPasswordless User Accounts\n--------------------------\n\nUser accounts do not always require passwords to login.\n\nThe unix_socket , named_pipe and gssapi authentication plugins do not require\na password to authenticate the user.\n\nThe pam authentication plugin may or may not require a password to\nauthenticate the user, depending on the specific configuration.\n\nThe mysql_native_password and mysql_old_password authentication plugins\nrequire passwords for authentication, but the password can be blank. In that\ncase, no password is required.\n\nIf you provide a password while attempting to log into the server as an\naccount that doesn\'t require a password, then MariaDB server will simply\nignore the password.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, a user account can be defined to use multiple\nauthentication plugins in a specific order of preference. This specific\nscenario may be more noticeable in these versions, since an account could be\nassociated with some authentication plugins that require a password, and some\nthat do not.\n\nExample\n-------\n\nFor example, if you had an entry with User and Host column values of \'bob\' and\n\'%.loc.gov\', you would write the statement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nIf you want to delete a password for a user, you would do:\n\nSET PASSWORD FOR \'bob\'@localhost = PASSWORD(\"\");\n\nURL: https://mariadb.com/kb/en/set-password/','','https://mariadb.com/kb/en/set-password/'),
(113,'DROP ROLE',10,'Syntax\n------\n\nDROP ROLE [IF EXISTS] role_name [,role_name ...]\n\nDescription\n-----------\n\nThe DROP ROLE statement removes one or more MariaDB roles. To use this\nstatement, you must have the global CREATE USER privilege or the DELETE\nprivilege for the mysql database.\n\nDROP ROLE does not disable roles for connections which selected them with SET\nROLE. If a role has previously been set as a default role, DROP ROLE does not\nremove the record of the default role from the mysql.user table. If the role\nis subsequently recreated and granted, it will again be the user\'s default.\nUse SET DEFAULT ROLE NONE to explicitly remove this.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP ROLE will still drop the roles that do not\nresult in an error. Only one error is produced for all roles which have not\nbeen dropped:\n\nERROR 1396 (HY000): Operation DROP ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror if the role does not exist.\n\nExamples\n--------\n\nDROP ROLE journalist;\n\nThe same thing using the optional IF EXISTS clause:\n\nDROP ROLE journalist;\nERROR 1396 (HY000): Operation DROP ROLE failed for \'journalist\'\n\nDROP ROLE IF EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nNote (Code 1975): Can\'t drop role \'journalist\'; it doesn\'t exist\n\nURL: https://mariadb.com/kb/en/drop-role/','','https://mariadb.com/kb/en/drop-role/'),
(159,'IS_USED_LOCK',14,'Syntax\n------\n\nIS_USED_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is in use (that is, locked). If so, it\nreturns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL. str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_USED_LOCK function are not safe for statement-based\nreplication.\n\nURL: https://mariadb.com/kb/en/is_used_lock/','','https://mariadb.com/kb/en/is_used_lock/'),
(162,'NAME_CONST',14,'Syntax\n------\n\nNAME_CONST(name,value)\n\nDescription\n-----------\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments should be\nconstants.\n\nThis function is used internally when replicating stored procedures. It makes\nlittle sense to use it explicitly in SQL statements, and it was not supposed\nto be used like that.\n\nSELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n|     14 |\n+--------+\n\nURL: https://mariadb.com/kb/en/name_const/','','https://mariadb.com/kb/en/name_const/'),
(165,'SLEEP',14,'Syntax\n------\n\nSLEEP(duration)\n\nDescription\n-----------\n\nSleeps (pauses) for the number of seconds given by the duration argument, then\nreturns 0. If SLEEP() is interrupted, it returns 1. The duration may have a\nfractional part given in microseconds.\n\nStatements using the SLEEP() function are not safe for replication.\n\nExample\n-------\n\nSELECT SLEEP(5.5);\n+------------+\n| SLEEP(5.5) |\n+------------+\n|          0 |\n+------------+\n1 row in set (5.50 sec)\n\nURL: https://mariadb.com/kb/en/sleep/','','https://mariadb.com/kb/en/sleep/'),
(112,'CREATE ROLE',10,'Syntax\n------\n\nCREATE [OR REPLACE] ROLE [IF NOT EXISTS] role \n [WITH ADMIN\n  {CURRENT_USER | CURRENT_ROLE | user | role}]\n\nDescription\n-----------\n\nThe CREATE ROLE statement creates one or more MariaDB roles. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for the\nmysql database. For each account, CREATE ROLE creates a new row in the\nmysql.user table that has no privileges, and with the corresponding is_role\nfield set to Y. It also creates a record in the mysql.roles_mapping table.\n\nIf any of the specified roles already exist, ERROR 1396 (HY000) results. If an\nerror occurs, CREATE ROLE will still create the roles that do not result in an\nerror. The maximum length for a role is 128 characters. Role names can be\nquoted, as explained in the Identifier names page. Only one error is produced\nfor all roles which have not been created:\n\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nPUBLIC and NONE are reserved, and cannot be used as role names. NONE is used\nto unset a role and PUBLIC has a special use in other systems, such as Oracle,\nso is reserved for compatibility purposes.\n\nFor valid identifiers to use as role names, see Identifier Names.\n\nWITH ADMIN\n----------\n\nThe optional WITH ADMIN clause determines whether the current user, the\ncurrent role or another user or role has use of the newly created role. If the\nclause is omitted, WITH ADMIN CURRENT_USER is treated as the default, which\nmeans that the current user will be able to GRANT this role to users.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP ROLE IF EXISTS name;\nCREATE ROLE name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified role already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nExamples\n--------\n\nCREATE ROLE journalist;\n\nCREATE ROLE developer WITH ADMIN lorinda@localhost;\n\nGranting the role to another user. Only user lorinda@localhost has permission\nto grant the developer role:\n\nSELECT USER();\n+-------------------+\n| USER()            |\n+-------------------+\n| henning@localhost |\n+-------------------+\n...\nGRANT developer TO ian@localhost;\nAccess denied for user \'henning\'@\'localhost\'\n\nSELECT USER();\n+-------------------+\n| USER()            |\n+-------------------+\n| lorinda@localhost |\n+-------------------+\n\nGRANT m_role TO ian@localhost;\n\nThe OR REPLACE and IF NOT EXISTS clauses. The journalist role already exists:\n\nCREATE ROLE journalist;\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'journalist\'\n\nCREATE OR REPLACE ROLE journalist;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE ROLE IF NOT EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------+\n| Level | Code | Message                                           |\n+-------+------+---------------------------------------------------+\n| Note  | 1975 | Can\'t create role \'journalist\'; it already exists |\n+-------+------+---------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/create-role/','','https://mariadb.com/kb/en/create-role/'),
(114,'SET ROLE',10,'Syntax\n------\n\nSET ROLE { role | NONE }\n\nDescription\n-----------\n\nThe SET ROLE statement enables a role, along with all of its associated\npermissions, for the current session. To unset a role, use NONE .\n\nIf a role that doesn\'t exist, or to which the user has not been assigned, is\nspecified, an ERROR 1959 (OP000): Invalid role specification error occurs.\n\nAn automatic SET ROLE is implicitly performed when a user connects if that\nuser has been assigned a default role. See SET DEFAULT ROLE.\n\nExample\n-------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff        |\n+--------------+\n\nSET ROLE NONE;\n\nSELECT CURRENT_ROLE();\n+----------------+\n| CURRENT_ROLE() |\n+----------------+\n| NULL           |\n+----------------+\n\nURL: https://mariadb.com/kb/en/set-role/','','https://mariadb.com/kb/en/set-role/'),
(115,'SET DEFAULT ROLE',10,'Syntax\n------\n\nSET DEFAULT ROLE { role | NONE } [ FOR user@host ]\n\nDescription\n-----------\n\nThe SET DEFAULT ROLE statement sets a default role for a specified (or\ncurrent) user. A default role is automatically enabled when a user connects\n(an implicit SET ROLE statement is executed immediately after a connection is\nestablished).\n\nTo be able to set a role as a default, the role must already have been granted\nto that user, and one needs the privileges to enable this role (if you cannot\ndo SET ROLE X, you won\'t be able to do SET DEFAULT ROLE X). To set a default\nrole for another user one needs to have write access to the mysql database.\n\nTo remove a user\'s default role, use SET DEFAULT ROLE NONE [ FOR user@host ].\nThe record of the default role is not removed if the role is dropped or\nrevoked, so if the role is subsequently re-created or granted, it will again\nbe the user\'s default role.\n\nThe default role is stored in the default_role column in the mysql.user\ntable/view, as well as in the Information Schema APPLICABLE_ROLES table, so\nthese can be viewed to see which role has been assigned to a user as the\ndefault.\n\nExamples\n--------\n\nSetting a default role for the current user:\n\nSET DEFAULT ROLE journalist;\n\nRemoving a default role from the current user:\n\nSET DEFAULT ROLE NONE;\n\nSetting a default role for another user. The role has to have been granted to\nthe user before it can be set as default:\n\nCREATE ROLE journalist;\nCREATE USER taniel;\n\nSET DEFAULT ROLE journalist FOR taniel;\nERROR 1959 (OP000): Invalid role specification `journalist`\n\nGRANT journalist TO taniel;\nSET DEFAULT ROLE journalist FOR taniel;\n\nViewing mysql.user:\n\nselect * from mysql.user where user=\'taniel\'\\G\n*************************** 1. row ***************************\n         Host: %\n         User: taniel\n...\n       is_role: N\n     default_role: journalist\n...\n\nRemoving a default role for another user\n\nSET DEFAULT ROLE NONE FOR taniel;\n\nURL: https://mariadb.com/kb/en/set-default-role/','','https://mariadb.com/kb/en/set-default-role/'),
(166,'SYS_GUID',14,'MariaDB starting with 10.6.1\n----------------------------\nThe SYS_GUID function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility. Similar functionality can be achieved with the UUID function.\n\nSyntax\n------\n\nSYS_GUID()\n\nDescription\n-----------\n\nReturns a 16-byte globally unique identifier (GUID), similar to the UUID\nfunction, but without the - character.\n\nExample\n-------\n\nSELECT SYS_GUID();\n+----------------------------------+\n| SYS_GUID()                       |\n+----------------------------------+\n| 2C574E45BA2811EBB265F859713E4BE4 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/sys_guid/','','https://mariadb.com/kb/en/sys_guid/'),
(170,'!',15,'Syntax\n------\n\nNOT, !\n\nDescription\n-----------\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnon-zero, and NOT NULL returns NULL.\n\nBy default, the ! operator has a higher precedence. If the HIGH_NOT_PRECEDENCE\nSQL_MODE flag is set, NOT and ! have the same precedence.\n\nExamples\n--------\n\nSELECT NOT 10;\n+--------+\n| NOT 10 |\n+--------+\n|      0 |\n+--------+\n\nSELECT NOT 0;\n+-------+\n| NOT 0 |\n+-------+\n|     1 |\n+-------+\n\nSELECT NOT NULL;\n+----------+\n| NOT NULL |\n+----------+\n|     NULL |\n+----------+\n\nSELECT ! (1+1);\n+---------+\n| ! (1+1) |\n+---------+\n|       0 |\n+---------+\n\nSELECT ! 1+1;\n+-------+\n| ! 1+1 |\n+-------+\n|     1 |\n+-------+\n\nURL: https://mariadb.com/kb/en/not/','','https://mariadb.com/kb/en/not/'),
(116,'Roles Overview',10,'Description\n-----------\n\nA role bundles a number of privileges together. It assists larger\norganizations where, typically, a number of users would have the same\nprivileges, and, previously, the only way to change the privileges for a group\nof users was by changing each user\'s privileges individually.\n\nAlternatively, multiple external users could have been assigned the same user,\nand there would have been no way to see which actual user was responsible for\nwhich action.\n\nWith roles, managing this is easy. For example, there could be a number of\nusers assigned to a journalist role, with identical privileges. Changing the\nprivileges for all the journalists is a matter of simply changing the role\'s\nprivileges, while the individual user is still linked with any changes that\ntake place.\n\nRoles are created with the CREATE ROLE statement, and dropped with the DROP\nROLE statement. Roles are then assigned to a user with an extension to the\nGRANT statement, while privileges are assigned to a role in the regular way\nwith GRANT. Similarly, the REVOKE statement can be used to both revoke a role\nfrom a user, or revoke a privilege from a role.\n\nOnce a user has connected, he can obtain all privileges associated with a role\nby setting a role with the SET ROLE statement. The CURRENT_ROLE function\nreturns the currently set role for the session, if any.\n\nOnly roles granted directly to a user can be set, roles granted to other roles\ncannot. Instead the privileges granted to a role, which is, in turn, granted\nto another role (grantee), will be immediately available to any user who sets\nthis second grantee role.\n\nThe SET DEFAULT ROLE statement allows one to set a default role for a user. A\ndefault role is automatically enabled when a user connects (an implicit SET\nROLE statement is executed immediately after a connection is established).\n\nRoles were implemented as a GSoC 2013 project by Vicentiu Ciorbaru.\n\nSystem Tables\n-------------\n\nInformation about roles and who they\'ve been granted to can be found in the\nInformation Schema APPLICABLE_ROLES table as well as the mysql.ROLES_MAPPING\ntable.\n\nThe Information Schema ENABLED_ROLES table shows the enabled roles for the\ncurrent session.\n\nExamples\n--------\n\nCreating a role and granting a privilege:\n\nCREATE ROLE journalist;\n\nGRANT SHOW DATABASES ON *.* TO journalist;\n\nGRANT journalist to hulda;\n\nNote, that hulda has no SHOW DATABASES privilege, even though she was granted\nthe journalist role. She needs to set the role first:\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n+--------------------+\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist   |\n+--------------+\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| ...                |\n| information_schema |\n| mysql              |\n| performance_schema |\n| test               |\n| ...                |\n+--------------------+\n\nSET ROLE NONE;\n\nRoles can be granted to roles:\n\nCREATE ROLE writer;\n\nGRANT SELECT ON data.* TO writer;\n\nGRANT writer TO journalist;\n\nBut one does not need to set a role granted to a role. For example, hulda will\nautomatically get all writer privileges when she sets the journalist role:\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSHOW TABLES FROM data;\nEmpty set (0.01 sec)\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist   |\n+--------------+\n\nSHOW TABLES FROM data;\n+------------------------------+\n| Tables_in_data               |\n+------------------------------+\n| set1                         |\n| ...                          |\n+------------------------------+\n\nRoles and Views (and Stored Routines)\n-------------------------------------\n\nWhen a user sets a role, he, in a sense, has two identities with two\nassociated sets of privileges. But a view (or a stored routine) can have only\none definer. So, when a view (or a stored routine) is created with the SQL\nSECURITY DEFINER, one can specify whether the definer should be CURRENT_USER\n(and the view will have none of the privileges of the user\'s role) or\nCURRENT_ROLE (in this case, the view will use role\'s privileges, but none of\nthe user\'s privileges). As a result, sometimes one can create a view that is\nimpossible to use.\n\nCREATE ROLE r1;\n\nGRANT ALL ON db1.* TO r1;\n\nGRANT r1 TO foo@localhost;\n\nGRANT ALL ON db.* TO foo@localhost;\n\nSELECT CURRENT_USER\n+---------------+\n| current_user  |\n+---------------+\n| foo@localhost |\n+---------------+\n\nSET ROLE r1;\n\nCREATE TABLE db1.t1 (i int);\n\nCREATE VIEW db.v1 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.v1;\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| View | Create View                                                          \n                                 |\ncharacter_set_client | collation_connection |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| v1   | CREATE ALGORITHM=UNDEFINED DEFINER=`foo`@`localhost` SQL SECURITY\nDEFINER VIEW `db`.`v1` AS SELECT `db1`.`t1`.`i` AS `i` from `db1`.`t1` | utf8 \n       | utf8_general_ci      |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n\nCREATE DEFINER=CURRENT_ROLE VIEW db.v2 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.b2;\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| View | Create View                                                          \n                           | character_set_client |\ncollation_connection |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| v2   | CREATE ALGORITHM=UNDEFINED DEFINER=`r1` SQL SECURITY DEFINER VIEW\n`db`.`v2` AS select `db1`.`t1`.`a` AS `a` from `db1`.`t1` | utf8              \n | utf8_general_ci      |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n\nOther Resources\n---------------\n\n* Roles Review by Peter Gulutzan\n\nURL: https://mariadb.com/kb/en/roles_overview/','','https://mariadb.com/kb/en/roles_overview/'),
(171,'&&',15,'Syntax\n------\n\nAND, &&\n\nDescription\n-----------\n\nLogical AND. Evaluates to 1 if all operands are non-zero and not NULL, to 0 if\none or more operands are 0, otherwise NULL is returned.\n\nFor this operator, short-circuit evaluation can be used.\n\nExamples\n--------\n\nSELECT 1 && 1;\n+--------+\n| 1 && 1 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 1 && 0;\n+--------+\n| 1 && 0 |\n+--------+\n|      0 |\n+--------+\n\nSELECT 1 && NULL;\n+-----------+\n| 1 && NULL |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 0 && NULL;\n+-----------+\n| 0 && NULL |\n+-----------+\n|         0 |\n+-----------+\n\nSELECT NULL && 0;\n+-----------+\n| NULL && 0 |\n+-----------+\n|         0 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/and/','','https://mariadb.com/kb/en/and/'),
(117,'Account Locking',10,'MariaDB starting with 10.4.2\n----------------------------\nAccount locking was introduced in MariaDB 10.4.2.\n\nDescription\n-----------\n\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected).\n\nUser accounts can be locked at creation, with the CREATE USER statement, or\nmodified after creation with the ALTER USER statement. For example:\n\nCREATE USER \'lorin\'@\'localhost\' ACCOUNT LOCK;\n\nor\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nThe server will return an ER_ACCOUNT_HAS_BEEN_LOCKED error when locked users\nattempt to connect:\n\nmysql -ulorin\n ERROR 4151 (HY000): Access denied, this account is locked\n\nThe ALTER USER statement is also used to unlock a user:\n\nALTER USER \'lorin\'@\'localhost\' ACCOUNT UNLOCK;\n\nThe SHOW CREATE USER statement will show whether the account is locked:\n\nSHOW CREATE USER \'marijn\'@\'localhost\';\n+-----------------------------------------------+\n| CREATE USER for marijn@localhost              |\n+-----------------------------------------------+\n| CREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK |\n+-----------------------------------------------+\n\nas well as querying the mysql.global_priv table:\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv \n WHERE user=\'marijn\';\n+------------------------------------------------------------------------------\n-------+\n| CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv))                        \n    |\n+------------------------------------------------------------------------------\n-------+\n| marijn@localhost => {\n  \"access\": 0,\n  \"plugin\": \"mysql_native_password\",\n  \"authentication_string\": \"\",\n  \"account_locked\": true,\n  \"password_last_changed\": 1558017158\n} |\n+------------------------------------------------------------------------------\n-------+\n\nURL: https://mariadb.com/kb/en/account-locking/','','https://mariadb.com/kb/en/account-locking/'),
(119,'User Password Expiry',10,'MariaDB starting with 10.4.3\n----------------------------\nUser password expiry was introduced in MariaDB 10.4.3.\n\nPassword expiry permits administrators to expire user passwords, either\nmanually or automatically.\n\nSystem Variables\n----------------\n\nThere are two system variables which affect password expiry:\ndefault_password_lifetime, which determines the amount of time between\nrequiring the user to change their password. 0, the default, means automatic\npassword expiry is not active.\n\nThe second variable, disconnect_on_expired_password determines whether a\nclient is permitted to connect if their password has expired, or whether they\nare permitted to connect in sandbox mode, able to perform a limited subset of\nqueries related to resetting the password, in particular SET PASSWORD and SET.\n\nSetting a Password Expiry Limit for a User\n------------------------------------------\n\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal using the CREATE USER or ALTER USER statements, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nLimits can be disabled by use of the NEVER keyword, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nA manually set limit can be restored the system default by use of DEFAULT, for\nexample:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER\n----------------\n\nThe SHOW CREATE USER statement will display information about the password\nexpiry status of the user. Unlike MySQL, it will not display if the user is\nunlocked, or if the password expiry is set to default.\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nCREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER;\nCREATE USER \'amse\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost                                  |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\nSHOW CREATE USER \'konstantin\'@\'localhost\';\n+------------------------------------------------------------+\n| CREATE USER for konstantin@localhost                       |\n+------------------------------------------------------------+\n| CREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER |\n+------------------------------------------------------------+\n\nSHOW CREATE USER \'amse\'@\'localhost\';\n+--------------------------------+\n| CREATE USER for amse@localhost |\n+--------------------------------+\n| CREATE USER \'amse\'@\'localhost\' |\n+--------------------------------+\n\nChecking When Passwords Expire\n------------------------------\n\nThe following query can be used to check when the current passwords expire for\nall users:\n\nWITH password_expiration_info AS (\n SELECT User, Host,\n IF(\n IFNULL(JSON_EXTRACT(Priv, \'$.password_lifetime\'), -1) = -1,\n @@global.default_password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_lifetime\')\n ) AS password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_last_changed\') AS password_last_changed\n FROM mysql.global_priv\n)\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n FROM_UNIXTIME(\n pei.password_last_changed +\n (pei.password_lifetime * 60 * 60 * 24)\n ) AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime != 0\n AND pei.password_last_changed IS NOT NULL\nUNION\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n 0 AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime = 0\n OR pei.password_last_changed IS NULL;\n\n--connect-expired-password Client Option\n----------------------------------------\n\nThe mariadb client --connect-expired-password option notifies the server that\nthe client is prepared to handle expired password sandbox mode (even if the\n--batch option was specified).\n\nURL: https://mariadb.com/kb/en/user-password-expiry/','','https://mariadb.com/kb/en/user-password-expiry/'),
(172,'XOR',15,'Syntax\n------\n\nXOR\n\nDescription\n-----------\n\nXOR stands for eXclusive OR. Returns NULL if either operand is NULL. For\nnon-NULL operands, evaluates to 1 if an odd number of operands is non-zero,\notherwise 0 is returned.\n\nExamples\n--------\n\nSELECT 1 XOR 1;\n+---------+\n| 1 XOR 1 |\n+---------+\n|       0 |\n+---------+\n\nSELECT 1 XOR 0;\n+---------+\n| 1 XOR 0 |\n+---------+\n|       1 |\n+---------+\n\nSELECT 1 XOR NULL;\n+------------+\n| 1 XOR NULL |\n+------------+\n|       NULL |\n+------------+\n\nIn the following example, the right 1 XOR 1 is evaluated first, and returns 0.\nThen, 1 XOR 0 is evaluated, and 1 is returned.\n\nSELECT 1 XOR 1 XOR 1;\n+---------------+\n| 1 XOR 1 XOR 1 |\n+---------------+\n|             1 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/xor/','','https://mariadb.com/kb/en/xor/'),
(187,'STDDEV_SAMP',16,'Syntax\n------\n\nSTDDEV_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample standard deviation of expr (the square root of VAR_SAMP()).\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_SAMP() can be used as a window function.\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: https://mariadb.com/kb/en/stddev_samp/','','https://mariadb.com/kb/en/stddev_samp/'),
(124,'UNCOMPRESS',12,'Syntax\n------\n\nUNCOMPRESS(string_to_uncompress)\n\nDescription\n-----------\n\nUncompresses a string compressed by the COMPRESS() function. If the argument\nis not a compressed value, the result is NULL. This function requires MariaDB\nto have been compiled with a compression library such as zlib. Otherwise, the\nreturn value is always NULL. The have_compress server system variable\nindicates whether a compression library is present.\n\nExamples\n--------\n\nSELECT UNCOMPRESS(COMPRESS(\'a string\'));\n+----------------------------------+\n| UNCOMPRESS(COMPRESS(\'a string\')) |\n+----------------------------------+\n| a string                         |\n+----------------------------------+\n\nSELECT UNCOMPRESS(\'a string\');\n+------------------------+\n| UNCOMPRESS(\'a string\') |\n+------------------------+\n| NULL                   |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/uncompress/','','https://mariadb.com/kb/en/uncompress/'),
(125,'DECODE',12,'Syntax\n------\n\nDECODE(crypt_str,pass_str)\n\nIn Oracle mode from MariaDB 10.3.2:\n\nDECODE(expr, search_expr, result_expr [, search_expr2, result_expr2 ...]\n[default_expr])\n\nIn all modes from MariaDB 10.3.2:\n\nDECODE_ORACLE(expr, search_expr, result_expr [, search_expr2, result_expr2\n...] [default_expr])\n\nDescription\n-----------\n\nIn the default mode, DECODE decrypts the encrypted string crypt_str using\npass_str as the password. crypt_str should be a string returned from ENCODE().\nThe resulting string will be the original string only if pass_str is the same.\n\nIn Oracle mode from MariaDB 10.3.2, DECODE compares expr to the search\nexpressions, in order. If it finds a match, the corresponding result\nexpression is returned. If no matches are found, the default expression is\nreturned, or NULL if no default is provided.\n\nNULLs are treated as equivalent.\n\nDECODE_ORACLE is a synonym for the Oracle-mode version of the function, and is\navailable in all modes.\n\nExamples\n--------\n\nFrom MariaDB 10.3.2:\n\nSELECT DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found1                                                 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found2                                                 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| default                                                |\n+--------------------------------------------------------+\n\nNulls are treated as equivalent:\n\nSELECT DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not\nequivalent\');\n+----------------------------------------------------------------------------+\n| DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not equivalent\') |\n+----------------------------------------------------------------------------+\n| Nulls are equivalent                                                       |\n+----------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/decode/','','https://mariadb.com/kb/en/decode/'),
(127,'AES_DECRYPT',12,'Syntax\n------\n\nAES_DECRYPT(crypt_str,key_str)\n\nFrom MariaDB 11.2.0\n\nAES_ENCRYPT(crypt_str, key_str, [, iv [, mode]])\n\nDescription\n-----------\n\nThis function allows decryption of data using the official AES (Advanced\nEncryption Standard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nMariaDB starting with 11.2\n--------------------------\nFrom MariaDB 11.2, the function supports an initialization vector, and control\nof the block encryption mode. The default mode is specified by the\nblock_encryption_mode system variable, which can be changed when calling the\nfunction with a mode. mode is aes-{128,192,256}-{ecb,cbc,ctr} for example:\n\"AES-128-cbc\".\n\nFor modes that require it, the initialization_vector iv should be 16 bytes (it\ncan be longer, but the extra bytes are ignored). A shorter iv, where one is\nrequired, results in the function returning NULL. Calling RANDOM_BYTES(16)\nwill generate a random series of bytes that can be used for the iv.\n\nExamples\n--------\n\nFrom MariaDB 11.2.0:\n\nSELECT HEX(AES_ENCRYPT(\'foo\', \'bar\', \'0123456789abcdef\', \'aes-128-ctr\')) AS x; \n+--------+\n| x      |\n+--------+\n| C57C4B |\n+--------+\n\nSELECT AES_DECRYPT(x\'C57C4B\', \'bar\', \'0123456789abcdef\', \'aes-128-ctr\'); \n+------------------------------------------------------------------+\n| AES_DECRYPT(x\'C57C4B\', \'bar\', \'0123456789abcdef\', \'aes-128-ctr\') |\n+------------------------------------------------------------------+\n| foo                                                              |\n+------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/aes_decrypt/','','https://mariadb.com/kb/en/aes_decrypt/'),
(192,'BENCHMARK',17,'Syntax\n------\n\nBENCHMARK(count,expr)\n\nDescription\n-----------\n\nThe BENCHMARK() function executes the expression expr repeatedly count times.\nIt may be used to time how quickly MariaDB processes the expression. The\nresult value is always 0. The intended use is from within the mariadb client,\nwhich reports query execution times.\n\nExamples\n--------\n\nSELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n|                                            0 |\n+----------------------------------------------+\n1 row in set (0.21 sec)\n\nURL: https://mariadb.com/kb/en/benchmark/','','https://mariadb.com/kb/en/benchmark/'),
(193,'BINLOG_GTID_POS',17,'Syntax\n------\n\nBINLOG_GTID_POS(binlog_filename,binlog_offset)\n\nDescription\n-----------\n\nThe BINLOG_GTID_POS() function takes as input an old-style binary log position\nin the form of a file name and a file offset. It looks up the position in the\ncurrent binlog, and returns a string representation of the corresponding GTID\nposition. If the position is not found in the current binlog, NULL is returned.\n\nExamples\n--------\n\nSELECT BINLOG_GTID_POS(\"master-bin.000001\", 600);\n\nURL: https://mariadb.com/kb/en/binlog_gtid_pos/','','https://mariadb.com/kb/en/binlog_gtid_pos/'),
(196,'COLLATION',17,'Syntax\n------\n\nCOLLATION(str)\n\nDescription\n-----------\n\nReturns the collation of the string argument. If str is not a string, it is\nconsidered as a binary string (so the function returns \'binary\'). This applies\nto NULL, too. The return value is a string in the utf8 character set.\n\nSee Character Sets and Collations.\n\nExamples\n--------\n\nSELECT COLLATION(\'abc\');\n+-------------------+\n| COLLATION(\'abc\')  |\n+-------------------+\n| latin1_swedish_ci |\n+-------------------+\n\nSELECT COLLATION(_utf8\'abc\');\n+-----------------------+\n| COLLATION(_utf8\'abc\') |\n+-----------------------+\n| utf8_general_ci       |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/collation/','','https://mariadb.com/kb/en/collation/'),
(128,'AES_ENCRYPT',12,'Syntax\n------\n\nAES_ENCRYPT(str,key_str)\n\nFrom MariaDB 11.2.0\n\nAES_ENCRYPT(str, key, [, iv [, mode]])\n\nDescription\n-----------\n\nAES_ENCRYPT() and AES_DECRYPT() allow encryption and decryption of data using\nthe official AES (Advanced Encryption Standard) algorithm, previously known as\n\"Rijndael.\" Encoding with a 128-bit key length is used (from MariaDB 11.2.0,\nthis is the default, and can be changed). 128 bits is much faster and is\nsecure enough for most purposes.\n\nAES_ENCRYPT() encrypts a string str using the key key_str, and returns a\nbinary string.\n\nAES_DECRYPT() decrypts the encrypted string and returns the original string.\n\nThe input arguments may be any length. If either argument is NULL, the result\nof this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode uneven\nlength strings and so the result string length may be calculated using this\nformula:\n\n16 x (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns NULL.\nHowever, it is possible for AES_DECRYPT() to return a non-NULL value (possibly\ngarbage) if the input data or the key is invalid.\n\nMariaDB starting with 11.2\n--------------------------\nFrom MariaDB 11.2, the function supports an initialization vector, and control\nof the block encryption mode. The default mode is specified by the\nblock_encryption_mode system variable, which can be changed when calling the\nfunction with a mode. mode is aes-{128,192,256}-{ecb,cbc,ctr} for example:\n\"AES-128-cbc\".\n\nAES_ENCRYPT(str, key) can no longer be used in persistent virtual columns (and\nthe like).\n\nExamples\n--------\n\nINSERT INTO t VALUES (AES_ENCRYPT(\'text\',SHA2(\'password\',512)));\n\nFrom MariaDB 11.2.0:\n\nSELECT HEX(AES_ENCRYPT(\'foo\', \'bar\', \'0123456789abcdef\', \'aes-256-cbc\')) AS x;\n+----------------------------------+\n| x                                |\n+----------------------------------+\n| 42A3EB91E6DFC40A900D278F99E0726E |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/aes_encrypt/','','https://mariadb.com/kb/en/aes_encrypt/'),
(129,'COMPRESS',12,'Syntax\n------\n\nCOMPRESS(string_to_compress)\n\nDescription\n-----------\n\nCompresses a string and returns the result as a binary string. This function\nrequires MariaDB to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL. The compressed string can be\nuncompressed with UNCOMPRESS().\n\nThe have_compress server system variable indicates whether a compression\nlibrary is present.\n\nExamples\n--------\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n+------------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',1000))) |\n+------------------------------------+\n|                                 21 |\n+------------------------------------+\n\nSELECT LENGTH(COMPRESS(\'\'));\n+----------------------+\n| LENGTH(COMPRESS(\'\')) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nSELECT LENGTH(COMPRESS(\'a\'));\n+-----------------------+\n| LENGTH(COMPRESS(\'a\')) |\n+-----------------------+\n|                    13 |\n+-----------------------+\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n+----------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',16))) |\n+----------------------------------+\n|                               15 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/compress/','','https://mariadb.com/kb/en/compress/'),
(130,'DES_DECRYPT',12,'DES_DECRYPT has been deprecated from MariaDB 10.10.0, and will be removed in a\nfuture release.\n\nSyntax\n------\n\nDES_DECRYPT(crypt_str[,key_str])\n\nDescription\n-----------\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs, this\nfunction returns NULL.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte of the\nencrypted string to determine the DES key number that was used to encrypt the\noriginal string, and then reads the key from the DES key file to decrypt the\nmessage. For this to work, the user must have the SUPER privilege. The key\nfile can be specified with the --des-key-file server option.\n\nIf you pass this function a key_str argument, that string is used as the key\nfor decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string, MariaDB\nreturns the given crypt_str.\n\nURL: https://mariadb.com/kb/en/des_decrypt/','','https://mariadb.com/kb/en/des_decrypt/'),
(131,'DES_ENCRYPT',12,'DES_ENCRYPT has been deprecated from MariaDB 10.10.0, and will be removed in a\nfuture release.\n\nSyntax\n------\n\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nDescription\n-----------\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from the DES\nkey file is used. With a key_num argument, the given key number (0-9) from the\nDES key file is used. With a key_str argument, the given key string is used to\nencrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is CHAR(128 |\nkey_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If you use a\nstring key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in the\nfile may be in any order. des_key_str is the string that is used to encrypt\nthe message. There should be at least one space between the number and the\nkey. The first key is the default key that is used if you do not specify any\nkey argument to DES_ENCRYPT().\n\nYou can tell MariaDB to read new key values from the key file with the FLUSH\nDES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives applications a\nway to check for the existence of encrypted column values, without giving the\nend user the right to decrypt those values.\n\nExamples\n--------\n\nSELECT customer_address FROM customer_table \n WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n\nURL: https://mariadb.com/kb/en/des_encrypt/','','https://mariadb.com/kb/en/des_encrypt/'),
(197,'CONNECTION_ID',17,'Syntax\n------\n\nCONNECTION_ID()\n\nDescription\n-----------\n\nReturns the connection ID for the connection. Every connection (including\nevents) has an ID that is unique among the set of currently connected clients.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT CONNECTION_ID();\n+-----------------+\n| CONNECTION_ID() |\n+-----------------+\n|               3 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/connection_id/','','https://mariadb.com/kb/en/connection_id/'),
(209,'SCHEMA',17,'Syntax\n------\n\nSCHEMA()\n\nDescription\n-----------\n\nThis function is a synonym for DATABASE().\n\nURL: https://mariadb.com/kb/en/schema/','','https://mariadb.com/kb/en/schema/'),
(210,'SESSION_USER',17,'Syntax\n------\n\nSESSION_USER()\n\nDescription\n-----------\n\nSESSION_USER() is a synonym for USER().\n\nURL: https://mariadb.com/kb/en/session_user/','','https://mariadb.com/kb/en/session_user/'),
(132,'ENCODE',12,'Syntax\n------\n\nENCODE(str,pass_str)\n\nDescription\n-----------\n\nENCODE is not considered cryptographically secure, and should not be used for\npassword encryption.\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random generator is.\n\nIt is not recommended to rely on the encryption performed by the ENCODE\nfunction. Using a salt value (changed when a password is updated) will improve\nmatters somewhat, but for storing passwords, consider a more cryptographically\nsecure function, such as SHA2().\n\nExamples\n--------\n\nENCODE(\'not so secret text\', CONCAT(\'random_salt\',\'password\'))\n\nURL: https://mariadb.com/kb/en/encode/','','https://mariadb.com/kb/en/encode/'),
(133,'ENCRYPT',12,'Syntax\n------\n\nENCRYPT(str[,salt])\n\nDescription\n-----------\n\nEncrypts a string using the Unix crypt() system call, returning an encrypted\nbinary string. The salt argument should be a string with at least two\ncharacters or the returned result will be NULL. If no salt argument is given,\na random value of sufficient length is used.\n\nIt is not recommended to use ENCRYPT() with utf16, utf32 or ucs2 multi-byte\ncharacter sets because the crypt() system call expects a string terminated\nwith a zero byte.\n\nNote that the underlying crypt() system call may have some limitations, such\nas ignoring all but the first eight characters.\n\nIf the have_crypt system variable is set to NO (because the crypt() system\ncall is not available), the ENCRYPT function will always return NULL.\n\nExamples\n--------\n\nSELECT ENCRYPT(\'encrypt me\');\n+-----------------------+\n| ENCRYPT(\'encrypt me\') |\n+-----------------------+\n| 4I5BsEx0lqTDk         |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/encrypt/','','https://mariadb.com/kb/en/encrypt/'),
(135,'OLD_PASSWORD',12,'Syntax\n------\n\nOLD_PASSWORD(str)\n\nDescription\n-----------\n\nOLD_PASSWORD() was added to MySQL when the implementation of PASSWORD() was\nchanged to improve security. OLD_PASSWORD() returns the value of the old\n(pre-MySQL 4.1) implementation of PASSWORD() as a string, and is intended to\npermit you to reset passwords for any pre-4.1 clients that need to connect to\na more recent MySQL server version, or any version of MariaDB, without locking\nthem out.\n\nAs of MariaDB 5.5, the return value is a nonbinary string in the connection\ncharacter set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nThe return value is 16 bytes in length, or NULL if the argument was NULL.\n\nURL: https://mariadb.com/kb/en/old_password/','','https://mariadb.com/kb/en/old_password/'),
(136,'PASSWORD',12,'Syntax\n------\n\nPASSWORD(str)\n\nDescription\n-----------\n\nThe PASSWORD() function is used for hashing passwords for use in\nauthentication by the MariaDB server. It is not intended for use in other\napplications.\n\nCalculates and returns a hashed password string from the plaintext password\nstr. Returns an empty string (>= MariaDB 10.0.4) if the argument was NULL.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nThis is the function that is used for hashing MariaDB passwords for storage in\nthe Password column of the user table (see privileges), usually used with the\nSET PASSWORD statement. It is not intended for use in other applications.\n\nUntil MariaDB 10.3, the return value is 41-bytes in length, and the first\ncharacter is always \'*\'. From MariaDB 10.4, the function takes into account\nthe authentication plugin where applicable (A CREATE USER or SET PASSWORD\nstatement). For example, when used in conjunction with a user authenticated by\nthe ed25519 plugin, the statement will create a longer hash:\n\nCREATE USER edtest@localhost IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nCREATE USER edtest2@localhost IDENTIFIED BY \'secret\';\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv\n WHERE user LIKE \'edtest%\'\\G\n*************************** 1. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest@localhost => {\n...\n  \"plugin\": \"ed25519\",\n  \"authentication_string\": \"ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY\",\n...\n}\n*************************** 2. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest2@localhost => {\n...\n  \"plugin\": \"mysql_native_password\",\n  \"authentication_string\": \"*14E65567ABDB5135D0CFD9A70B3032C179A49EE7\",\n...\n}\n\nThe behavior of this function is affected by the value of the old_passwords\nsystem variable. If this is set to 1 (0 is default), MariaDB reverts to using\nthe mysql_old_password authentication plugin by default for newly created\nusers and passwords.\n\nExamples\n--------\n\nSELECT PASSWORD(\'notagoodpwd\');\n+-------------------------------------------+\n| PASSWORD(\'notagoodpwd\')                   |\n+-------------------------------------------+\n| *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 |\n+-------------------------------------------+\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nURL: https://mariadb.com/kb/en/password/','','https://mariadb.com/kb/en/password/'),
(211,'SYSTEM_USER',17,'Syntax\n------\n\nSYSTEM_USER()\n\nDescription\n-----------\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: https://mariadb.com/kb/en/system_user/','','https://mariadb.com/kb/en/system_user/'),
(214,'Assignment Operator (:=)',18,'Syntax\n------\n\nvar_name := expr\n\nDescription\n-----------\n\nAssignment operator for assigning a value. The value on the right is assigned\nto the variable on left.\n\nUnlike the = operator, := can always be used to assign a value to a variable.\n\nThis operator works with both user-defined variables and local variables.\n\nWhen assigning the same value to several variables, LAST_VALUE() can be useful.\n\nExamples\n--------\n\nSELECT @x := 10;\n+----------+\n| @x := 10 |\n+----------+\n|       10 |\n+----------+\n\nSELECT @x, @y := @x;\n+------+----------+\n| @x   | @y := @x |\n+------+----------+\n|   10 |       10 |\n+------+----------+\n\nURL: https://mariadb.com/kb/en/assignment-operator/','','https://mariadb.com/kb/en/assignment-operator/'),
(225,'GREATEST',19,'Syntax\n------\n\nGREATEST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the largest (maximum-valued) argument. The\narguments are compared using the same rules as for LEAST().\n\nExamples\n--------\n\nSELECT GREATEST(2,0);\n+---------------+\n| GREATEST(2,0) |\n+---------------+\n|             2 |\n+---------------+\n\nSELECT GREATEST(34.0,3.0,5.0,767.0);\n+------------------------------+\n| GREATEST(34.0,3.0,5.0,767.0) |\n+------------------------------+\n|                        767.0 |\n+------------------------------+\n\nSELECT GREATEST(\'B\',\'A\',\'C\');\n+-----------------------+\n| GREATEST(\'B\',\'A\',\'C\') |\n+-----------------------+\n| C                     |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/greatest/','','https://mariadb.com/kb/en/greatest/'),
(230,'IS NOT NULL',19,'Syntax\n------\n\nIS NOT NULL\n\nDescription\n-----------\n\nTests whether a value is not NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n+---------------+---------------+------------------+\n| 1 IS NOT NULL | 0 IS NOT NULL | NULL IS NOT NULL |\n+---------------+---------------+------------------+\n|             1 |             1 |                0 |\n+---------------+---------------+------------------+\n\nURL: https://mariadb.com/kb/en/is-not-null/','','https://mariadb.com/kb/en/is-not-null/'),
(137,'RANDOM_BYTES',12,'MariaDB starting with 10.10.0\n-----------------------------\nThe RANDOM_BYTES function generates a binary string of random bytes. It was\nadded in MariaDB 10.10.0.\n\nSyntax\n------\n\nRANDOM_BYTES(length)\n\nDescription\n-----------\n\nGiven a length from 1 to 1024, generates a binary string of length consisting\nof random bytes generated by the SSL library\'s random number generator.\n\nSee the RAND_bytes() function documentation of your SSL library for\ninformation on the random number generator. In the case of OpenSSL, a\ncryptographically secure pseudo random generator (CSPRNG) is used.\n\nStatements containing the RANDOM_BYTES function are unsafe for statement-based\nreplication.\n\nAn error occurs if length is outside the range 1 to 1024.\n\nURL: https://mariadb.com/kb/en/random_bytes/','','https://mariadb.com/kb/en/random_bytes/'),
(138,'SHA1',12,'Syntax\n------\n\nSHA1(str), SHA(str)\n\nDescription\n-----------\n\nCalculates an SHA-1 160-bit checksum for the string str, as described in RFC\n3174 (Secure Hash Algorithm).\n\nThe value is returned as a string of 40 hex digits, or NULL if the argument\nwas NULL. As of MariaDB 5.5, the return value is a nonbinary string in the\nconnection character set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nExamples\n--------\n\nSELECT SHA1(\'some boring text\');\n+------------------------------------------+\n| SHA1(\'some boring text\')                 |\n+------------------------------------------+\n| af969fc2085b1bb6d31e517d5c456def5cdd7093 |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sha1/','','https://mariadb.com/kb/en/sha1/'),
(139,'SHA2',12,'Syntax\n------\n\nSHA2(str,hash_len)\n\nDescription\n-----------\n\nGiven a string str, calculates an SHA-2 checksum, which is considered more\ncryptographically secure than its SHA-1 equivalent. The SHA-2 family includes\nSHA-224, SHA-256, SHA-384, and SHA-512, and the hash_len must correspond to\none of these, i.e. 224, 256, 384 or 512. 0 is equivalent to 256.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nNULL is returned if the hash length is not valid, or the string str is NULL.\n\nSHA2 will only work if MariaDB was has been configured with TLS support.\n\nExamples\n--------\n\nSELECT SHA2(\'Maria\',224);\n+----------------------------------------------------------+\n| SHA2(\'Maria\',224)                                        |\n+----------------------------------------------------------+\n| 6cc67add32286412efcab9d0e1675a43a5c2ef3cec8879f81516ff83 |\n+----------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',256);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',256)                                                |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',0);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',0)                                                  |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sha2/','','https://mariadb.com/kb/en/sha2/'),
(150,'INET6_ATON',14,'Syntax\n------\n\nINET6_ATON(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary string\nthat represents the numeric value of the address.\n\nNo trailing zone ID\'s or traling network masks are permitted. For IPv4\naddresses, or IPv6 addresses with IPv4 address parts, no classful addresses or\ntrailing port numbers are permitted and octal numbers are not supported.\n\nThe returned binary string will be VARBINARY(16) or VARBINARY(4) for IPv6 and\nIPv4 addresses respectively.\n\nReturns NULL if the argument is not understood.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, INET6_ATON can take INET6 as an argument.\n\nExamples\n--------\n\nSELECT HEX(INET6_ATON(\'10.0.1.1\'));\n+-----------------------------+\n| HEX(INET6_ATON(\'10.0.1.1\')) |\n+-----------------------------+\n| 0A000101                    |\n+-----------------------------+\n\nSELECT HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\'));\n+----------------------------------------------+\n| HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\')) |\n+----------------------------------------------+\n| 48F3000000000000D4321431BA23846F             |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/inet6_aton/','','https://mariadb.com/kb/en/inet6_aton/'),
(232,'ISNULL',19,'Syntax\n------\n\nISNULL(expr)\n\nDescription\n-----------\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT ISNULL(1+1);\n+-------------+\n| ISNULL(1+1) |\n+-------------+\n|           0 |\n+-------------+\n\nSELECT ISNULL(1/0);\n+-------------+\n| ISNULL(1/0) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/isnull/','','https://mariadb.com/kb/en/isnull/'),
(236,'&',20,'Syntax\n------\n\n&\n\nDescription\n-----------\n\nBitwise AND. Converts the values to binary and compares bits. Only if both the\ncorresponding bits are 1 is the resulting bit also 1.\n\nSee also bitwise OR.\n\nExamples\n--------\n\nSELECT 2&1;\n+-----+\n| 2&1 |\n+-----+\n|   0 |\n+-----+\n\nSELECT 3&1;\n+-----+\n| 3&1 |\n+-----+\n|   1 |\n+-----+\n\nSELECT 29 & 15;\n+---------+\n| 29 & 15 |\n+---------+\n|      13 |\n+---------+\n\nURL: https://mariadb.com/kb/en/bitwise_and/','','https://mariadb.com/kb/en/bitwise_and/'),
(237,'<<',20,'Syntax\n------\n\nvalue1 << value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the left.\n\nExamples\n--------\n\nSELECT 1 << 2;\n+--------+\n| 1 << 2 |\n+--------+\n|      4 |\n+--------+\n\nURL: https://mariadb.com/kb/en/shift-left/','','https://mariadb.com/kb/en/shift-left/'),
(238,'>>',20,'Syntax\n------\n\nvalue1 >> value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the right.\n\nExamples\n--------\n\nSELECT 4 >> 2;\n+--------+\n| 4 >> 2 |\n+--------+\n|      1 |\n+--------+\n\nURL: https://mariadb.com/kb/en/shift-right/','','https://mariadb.com/kb/en/shift-right/'),
(239,'BIT_COUNT',20,'Syntax\n------\n\nBIT_COUNT(N)\n\nDescription\n-----------\n\nReturns the number of bits that are set in the argument N.\n\nExamples\n--------\n\nSELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n+---------------+----------------------+\n| BIT_COUNT(29) | BIT_COUNT(b\'101010\') |\n+---------------+----------------------+\n|             4 |                    3 |\n+---------------+----------------------+\n\nURL: https://mariadb.com/kb/en/bit_count/','','https://mariadb.com/kb/en/bit_count/'),
(240,'^',20,'Syntax\n------\n\n^\n\nDescription\n-----------\n\nBitwise XOR. Converts the values to binary and compares bits. If one (and only\none) of the corresponding bits is 1 is the resulting bit also 1.\n\nExamples\n--------\n\nSELECT 1 ^ 1;\n+-------+\n| 1 ^ 1 |\n+-------+\n|     0 |\n+-------+\n\nSELECT 1 ^ 0;\n+-------+\n| 1 ^ 0 |\n+-------+\n|     1 |\n+-------+\n\nSELECT 11 ^ 3;\n+--------+\n| 11 ^ 3 |\n+--------+\n|      8 |\n+--------+\n\nURL: https://mariadb.com/kb/en/bitwise-xor/','','https://mariadb.com/kb/en/bitwise-xor/'),
(149,'GET_LOCK',14,'Syntax\n------\n\nGET_LOCK(str,timeout)\n\nDescription\n-----------\n\nTries to obtain a lock with a name given by the string str, using a timeout of\ntimeout seconds. Returns 1 if the lock was obtained successfully, 0 if the\nattempt timed out (for example, because another client has previously locked\nthe name), or NULL if an error occurred (such as running out of memory or the\nthread was killed with mariadb-admin kill).\n\nA lock is released with RELEASE_LOCK(), when the connection terminates (either\nnormally or abnormally). A connection can hold multiple locks at the same\ntime, so a lock that is no longer needed needs to be explicitly released.\n\nThe IS_FREE_LOCK function returns whether a specified lock a free or not, and\nthe IS_USED_LOCK whether the function is in use or not.\n\nLocks obtained with GET_LOCK() do not interact with transactions. That is,\ncommitting a transaction does not release any such locks obtained during the\ntransaction.\n\nIt is also possible to recursively set the same lock. If a lock with the same\nname is set n times, it needs to be released n times as well.\n\nstr is case insensitive for GET_LOCK() and related functions. If str is an\nempty string or NULL, GET_LOCK() returns NULL and does nothing. timeout\nsupports microseconds.\n\nIf the metadata_lock_info plugin is installed, locks acquired with this\nfunction are visible in the Information Schema METADATA_LOCK_INFO table.\n\nThis function can be used to implement application locks or to simulate record\nlocks. Names are locked on a server-wide basis. If a name has been locked by\none client, GET_LOCK() blocks any request by another client for a lock with\nthe same name. This allows clients that agree on a given lock name to use the\nname to perform cooperative advisory locking. But be aware that it also allows\na client that is not among the set of cooperating clients to lock a name,\neither inadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of this is to\nuse lock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nStatements using the GET_LOCK function are not safe for statement-based\nreplication.\n\nThe patch to permit multiple locks was contributed by Konstantin \"Kostja\"\nOsipov (MDEV-3917).\n\nExamples\n--------\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_USED_LOCK(\'lock1\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_USED_LOCK(\'lock1\') |\n+-----------------------+-----------------------+\n|                     0 |                    46 |\n+-----------------------+-----------------------+\n\nSELECT IS_FREE_LOCK(\'lock2\'), IS_USED_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock2\') | IS_USED_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     1 |                  NULL |\n+-----------------------+-----------------------+\n\nMultiple locks can be held:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_FREE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_FREE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     0 |                     0 |\n+-----------------------+-----------------------+\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n|                     1 |                     1 |\n+-----------------------+-----------------------+\n\nIt is possible to hold the same lock recursively. This example is viewed using\nthe metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\nTimeout example: Connection 1:\n\nSELECT GET_LOCK(\'lock4\',10);\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock4\',10);\n\nAfter 10 seconds...\n\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nDeadlocks are automatically detected and resolved. Connection 1:\n\nSELECT GET_LOCK(\'lock5\',10); \n+----------------------+\n| GET_LOCK(\'lock5\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock6\',10);\n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 1:\n\nSELECT GET_LOCK(\'lock6\',10); \n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock5\',10);\nERROR 1213 (40001): Deadlock found when trying to get lock; try restarting\ntransaction\n\nURL: https://mariadb.com/kb/en/get_lock/','','https://mariadb.com/kb/en/get_lock/'),
(241,'|',20,'Syntax\n------\n\n|\n\nDescription\n-----------\n\nBitwise OR. Converts the values to binary and compares bits. If either of the\ncorresponding bits has a value of 1, the resulting bit is also 1.\n\nSee also bitwise AND.\n\nExamples\n--------\n\nSELECT 2|1;\n+-----+\n| 2|1 |\n+-----+\n|   3 |\n+-----+\n\nSELECT 29 | 15;\n+---------+\n| 29 | 15 |\n+---------+\n|      31 |\n+---------+\n\nURL: https://mariadb.com/kb/en/bitwise-or/','','https://mariadb.com/kb/en/bitwise-or/'),
(151,'INET6_NTOA',14,'Syntax\n------\n\nINET6_NTOA(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a numeric binary string, returns the\naddress as a nonbinary string in the connection character set.\n\nThe return string is lowercase, and is platform independent, since it does not\nuse functions specific to the operating system. It has a maximum length of 39\ncharacters.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET6_NTOA(UNHEX(\'0A000101\'));\n+-------------------------------+\n| INET6_NTOA(UNHEX(\'0A000101\')) |\n+-------------------------------+\n| 10.0.1.1                      |\n+-------------------------------+\n\nSELECT INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\'));\n+-------------------------------------------------------+\n| INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\')) |\n+-------------------------------------------------------+\n| 48f3::d432:1431:ba23:846f                             |\n+-------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/inet6_ntoa/','','https://mariadb.com/kb/en/inet6_ntoa/'),
(155,'IS_IPV4',14,'Syntax\n------\n\nIS_IPV4(expr)\n\nDescription\n-----------\n\nIf the expression is a valid IPv4 address, returns 1, otherwise returns 0.\n\nIS_IPV4() is stricter than INET_ATON(), but as strict as INET6_ATON(), in\ndetermining the validity of an IPv4 address. This implies that if IS_IPV4\nreturns 1, the same expression will always return a non-NULL result when\npassed to INET_ATON(), but that the reverse may not apply.\n\nExamples\n--------\n\nSELECT IS_IPV4(\'1110.0.1.1\');\n+-----------------------+\n| IS_IPV4(\'1110.0.1.1\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT IS_IPV4(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV4(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n|                                    0 |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4/','','https://mariadb.com/kb/en/is_ipv4/'),
(156,'IS_IPV4_COMPAT',14,'Syntax\n------\n\nIS_IPV4_COMPAT(expr)\n\nDescription\n-----------\n\nReturns 1 if a given numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is IPv4-compatible, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_COMPAT now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n|                                        1 |\n+------------------------------------------+\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\'));\n+-----------------------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\')) |\n+-----------------------------------------------------------+\n|                                                         0 |\n+-----------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4_compat/','','https://mariadb.com/kb/en/is_ipv4_compat/'),
(157,'IS_IPV4_MAPPED',14,'Syntax\n------\n\nIS_IPV4_MAPPED(expr)\n\nDescription\n-----------\n\nReturns 1 if a given a numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is a valid IPv4-mapped address, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_MAPPED now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n|                                        0 |\n+------------------------------------------+\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\'));\n+-----------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\')) |\n+-----------------------------------------------+\n|                                             1 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/is_ipv4_mapped/','','https://mariadb.com/kb/en/is_ipv4_mapped/'),
(161,'MASTER_POS_WAIT',14,'Syntax\n------\n\nMASTER_POS_WAIT(log_name,log_pos[,timeout,[\"connection_name\"]])\n\nDescription\n-----------\n\nThis function is useful in replication for controlling primary/replica\nsynchronization. It blocks until the replica has read and applied all updates\nup to the specified position (log_name,log_pos) in the primary log. The return\nvalue is the number of log events the replica had to wait for to advance to\nthe specified position. The function returns NULL if the replica SQL thread is\nnot started, the replica\'s primary information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the timeout has\nbeen exceeded. If the replica SQL thread stops while MASTER_POS_WAIT() is\nwaiting, the function returns NULL. If the replica is past the specified\nposition, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when timeout\nseconds have elapsed. timeout must be greater than 0; a zero or negative\ntimeout means no timeout.\n\nThe connection_name is used when you are using multi-source-replication. If\nyou don\'t specify it, it\'s set to the value of the default_master_connection\nsystem variable.\n\nStatements using the MASTER_POS_WAIT() function are not safe for replication.\n\nURL: https://mariadb.com/kb/en/master_pos_wait/','','https://mariadb.com/kb/en/master_pos_wait/'),
(242,'~',20,'Syntax\n------\n\n~\n\nDescription\n-----------\n\nBitwise NOT. Converts the value to 4 bytes binary and inverts all bits.\n\nExamples\n--------\n\nSELECT 3 & ~1;\n+--------+\n| 3 & ~1 |\n+--------+\n|      2 |\n+--------+\n\nSELECT 5 & ~1;\n+--------+\n| 5 & ~1 |\n+--------+\n|      4 |\n+--------+\n\nURL: https://mariadb.com/kb/en/bitwise-not/','','https://mariadb.com/kb/en/bitwise-not/'),
(244,'TRUE FALSE',20,'Description\n-----------\n\nThe constants TRUE and FALSE evaluate to 1 and 0, respectively. The constant\nnames can be written in any lettercase.\n\nExamples\n--------\n\nSELECT TRUE, true, FALSE, false;\n+------+------+-------+-------+\n| TRUE | TRUE | FALSE | FALSE |\n+------+------+-------+-------+\n|    1 |    1 |     0 |     0 |\n+------+------+-------+-------+\n\nURL: https://mariadb.com/kb/en/true-false/','','https://mariadb.com/kb/en/true-false/'),
(247,'CHECK VIEW',21,'Syntax\n------\n\nCHECK VIEW view_name\n\nDescription\n-----------\n\nThe CHECK VIEW statement was introduced in MariaDB 10.0.18 to assist with\nfixing MDEV-6916, an issue introduced in MariaDB 5.2 where the view algorithms\nwere swapped. It checks whether the view algorithm is correct. It is run as\npart of mariadb-upgrade, and should not normally be required in regular use.\n\nURL: https://mariadb.com/kb/en/check-view/','','https://mariadb.com/kb/en/check-view/'),
(160,'MASTER_GTID_WAIT',14,'Syntax\n------\n\nMASTER_GTID_WAIT(gtid-list[, timeout)\n\nDescription\n-----------\n\nThis function takes a string containing a comma-separated list of global\ntransaction id\'s (similar to the value of, for example, gtid_binlog_pos). It\nwaits until the value of gtid_slave_pos has the same or higher seq_no within\nall replication domains specified in the gtid-list; in other words, it waits\nuntil the slave has reached the specified GTID position.\n\nAn optional second argument gives a timeout in seconds. If the timeout expires\nbefore the specified GTID position is reached, then the function returns -1.\nPassing NULL or a negative number for the timeout means no timeout, and the\nfunction will wait indefinitely.\n\nIf the wait completes without a timeout, 0 is returned. Passing NULL for the\ngtid-list makes the function return NULL immediately, without waiting.\n\nThe gtid-list may be the empty string, in which case MASTER_GTID_WAIT()\nreturns immediately. If the gtid-list contains fewer domains than\ngtid_slave_pos, then only those domains are waited upon. If gtid-list contains\na domain that is not present in @@gtid_slave_pos, then MASTER_GTID_WAIT() will\nwait until an event containing such domain_id arrives on the slave (or until\ntimed out or killed).\n\nMASTER_GTID_WAIT() can be useful to ensure that a slave has caught up to a\nmaster. Simply take the value of gtid_binlog_pos on the master, and use it in\na MASTER_GTID_WAIT() call on the slave; when the call completes, the slave\nwill have caught up with that master position.\n\nMASTER_GTID_WAIT() can also be used in client applications together with the\nlast_gtid session variable. This is useful in a read-scaleout replication\nsetup, where the application writes to a single master but divides the reads\nout to a number of slaves to distribute the load. In such a setup, there is a\nrisk that an application could first do an update on the master, and then a\nbit later do a read on a slave, and if the slave is not fast enough, the data\nread from the slave might not include the update just made, possibly confusing\nthe application and/or the end-user. One way to avoid this is to request the\nvalue of last_gtid on the master just after the update. Then before doing the\nread on the slave, do a MASTER_GTID_WAIT() on the value obtained from the\nmaster; this will ensure that the read is not performed until the slave has\nreplicated sufficiently far for the update to have become visible.\n\nNote that MASTER_GTID_WAIT() can be used even if the slave is configured not\nto use GTID for connections (CHANGE MASTER TO master_use_gtid=no). This is\nbecause from MariaDB 10, GTIDs are always logged on the master server, and\nalways recorded on the slave servers.\n\nDifferences to MASTER_POS_WAIT()\n--------------------------------\n\n* MASTER_GTID_WAIT() is global; it waits for any master connection to reach\n the specified GTID position. MASTER_POS_WAIT() works only against a\n specific connection. This also means that while MASTER_POS_WAIT() aborts if\n its master connection is terminated with STOP SLAVE or due to an error,\n MASTER_GTID_WAIT() continues to wait while slaves are stopped.\n\n* MASTER_GTID_WAIT() can take its timeout as a floating-point value, so a\n timeout in fractional seconds is supported, eg. MASTER_GTID_WAIT(\"0-1-100\",\n 0.5). (The minimum wait is one microsecond, 0.000001 seconds).\n\n* MASTER_GTID_WAIT() allows one to specify a timeout of zero in order to do a\n non-blocking check to see if the slaves have progressed to a specific GTID\nposition\n (MASTER_POS_WAIT() takes a zero timeout as meaning an infinite wait). To do\n an infinite MASTER_GTID_WAIT(), specify a negative timeout, or omit the\n timeout argument.\n\n* MASTER_GTID_WAIT() does not return the number of events executed since the\n wait started, nor does it return NULL if a slave thread is stopped. It\n always returns either 0 for successful wait completed, or -1 for timeout\n reached (or NULL if the specified gtid-pos is NULL).\n\nSince MASTER_GTID_WAIT() looks only at the seq_no part of the GTIDs, not the\nserver_id, care is needed if a slave becomes diverged from another server so\nthat two different GTIDs with the same seq_no (in the same domain) arrive at\nthe same server. This situation is in any case best avoided; setting\ngtid_strict_mode is recommended, as this will prevent any such out-of-order\nsequence numbers from ever being replicated on a slave.\n\nURL: https://mariadb.com/kb/en/master_gtid_wait/','','https://mariadb.com/kb/en/master_gtid_wait/'),
(163,'RELEASE_ALL_LOCKS',14,'MariaDB until 10.5.2\n--------------------\nRELEASE_ALL_LOCKS was added in MariaDB 10.5.2.\n\nSyntax\n------\n\nRELEASE_ALL_LOCKS()\n\nDescription\n-----------\n\nReleases all named locks held by the current session. Returns the number of\nlocks released, or 0 if none were held.\n\nStatements using the RELEASE_ALL_LOCKS function are not safe for\nstatement-based replication.\n\nExamples\n--------\n\nSELECT RELEASE_ALL_LOCKS();\n+---------------------+\n| RELEASE_ALL_LOCKS() | \n+---------------------+\n|                   0 |\n+---------------------+\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT RELEASE_ALL_LOCKS();\n+---------------------+\n| RELEASE_ALL_LOCKS() | \n+---------------------+\n|                   1 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/release_all_locks/','','https://mariadb.com/kb/en/release_all_locks/'),
(272,'BLOB and TEXT Data Types',23,'Description\n-----------\n\nA BLOB is a binary large object that can hold a variable amount of data. The\nfour BLOB types are\n\n* TINYBLOB,\n* BLOB, \n* MEDIUMBLOB, and\n* LONGBLOB.\n\nThese differ only in the maximum length of the values they can hold.\n\nThe TEXT types are\n\n* TINYTEXT,\n* TEXT,\n* MEDIUMTEXT, and\n* LONGTEXT.\n* JSON (alias for LONGTEXT)\n\nThese correspond to the four BLOB types and have the same maximum lengths and\nstorage requirements.\n\nBLOB and TEXT columns can have a DEFAULT value.\n\nMariaDB starting with 10.4.3\n----------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on columns that use\nthe BLOB or TEXT data types.\n\nURL: https://mariadb.com/kb/en/blob-and-text-data-types/','','https://mariadb.com/kb/en/blob-and-text-data-types/'),
(274,'CHAR BYTE',23,'Description\n-----------\n\nThe CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: https://mariadb.com/kb/en/char-byte/','','https://mariadb.com/kb/en/char-byte/'),
(277,'INET6',23,'MariaDB starting with 10.5.0\n----------------------------\nThe INET6 data type was added in MariaDB 10.5.0\n\nSyntax\n------\n\nINET6\n\nDescription\n-----------\n\nThe INET6 data type is intended for storage of IPv6 addresses, as well as IPv4\naddresses assuming conventional mapping of IPv4 addresses into IPv6 addresses.\n\nBoth short and long IPv6 notation are permitted, according to RFC-5952.\n\n* Values are stored as a 16-byte fixed length binary string, with most\nsignificant byte first.\n* Storage engines see INET6 as BINARY(16).\n* Clients see INET6 as CHAR(39) and get text representation on retrieval.\n\nThe IPv4-compatible notation is considered as deprecated. It is supported for\ncompatibility with the INET6_ATON function, which also understands this\nformat. It\'s recommended to use the mapped format to store IPv4 addresses in\nINET6.\n\nWhen an IPv4 mapped (or compatible) value is stored in INET6, it still\noccupies 16 bytes:\n\nRetrieval\n---------\n\nOn retrieval, in the client-server text protocol, INET6 values are converted\nto the short text representation, according to RFC-5952, that is with all\nleading zeroes in each group removed and with consequent zero groups\ncompressed.\n\nBesides creating one\'s own stored function, there is no a way to retrieve an\nINET6 value using long text representation.\n\nCasting\n-------\n\n* CAST from a character string to INET6 understands addresses in short or long\ntext notation (including IPv4 mapped and compatible addresses). NULL is\nreturned if the format is not understood.\n* CAST from a binary string to INET6 requires a 16-byte string as an argument.\nNULL is returned if the argument length is not equal to 16.\n* CAST from other data types to INET6 first converts data to a character\nstring, then CAST from character string to INET6 is applied.\n* CAST from INET6 to CHAR returns short text address notation.\n* CAST from INET6 to BINARY returns its 16-byte binary string representation.\n* CAST from INET6 to data types other than CHAR (e.g. SIGNED, UNSIGNED, TIME,\netc) returns an error.\n\nComparisons\n-----------\n\nAn INET6 expression can be compared to:\n\n* another INET6 expression\n* a character string expression with a text (short or long) address\nrepresentation:\n* a 16-byte binary string expression:\n\nAttempting to compare INET6 to an expression of any other data type returns an\nerror.\n\nMixing INET6 Values for Result\n------------------------------\n\nAn INET6 expression can be mixed for result (i.e. UNION, CASE..THEN, COALESCE\netc) with:\n\n* another INET6 expression. The resulting data type is INET6.\n* a character string in text (short or long) address representation. The\nresult data type is INET6. The character string counterpart is automatically\nconverted to INET6. If the string format is not understood, it\'s converted\nwith a warning to either NULL or to \'::\', depending on the NULL-ability of the\nresult.\n* a 16-byte binary string. The resulting data type is INET6. The binary string\ncounterpart is automatically converted to INET6. If the length of the binary\nstring is not equal to 16, it\'s converted with a warning to NULL or to \'::\'\ndepending on the NULL-ability of the result.\n\nAttempts to mix INET6 for result with other data types will return an error.\n\nMixing INET6 with other data types for LEAST and GREATEST, when mixing for\ncomparison and mixing for result are involved at the same time, uses the same\nrules with mixing for result, described in the previous paragraphs.\n\nFunctions and Operators\n-----------------------\n\n* HEX() with an INET6 argument returns a hexadecimal representation of the\nunderlying 16-byte binary string\n* Arithmetic operators (+,-,*,/,MOD,DIV) are not supported for INET6. This may\nchange in the future.\n* The INET6_ATON function now understands INET6 values as an argument\n* The prototypes of the IS_IPV4_COMPAT and IS_IPV4_MAPPED functions have\nchanged from a BINARY(16) to a INET6,\n* When the argument for these two functions is not INET6, automatic implicit\nCAST to INET6 is applied. As a consequence, both functions now understand\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, these functions understood only binary(16) representation.\n\nPrepared Statement Parameters\n-----------------------------\n\nINET6 understands both text and binary(16) address representation in prepared\nstatement parameters (PREPARE..EXECUTE and EXECUTE IMMEDIATE statements).\n\nMigration between  BINARY(16) and INET6\n---------------------------------------\n\nBefore MariaDB 10.5.0, you may have used BINARY(16) as a storage for IPv6\ninternet addresses, in combination with INET6_ATON and INET6_NTOA to\nrespectively insert and retrieve data.\n\nFrom 10.5, you can ALTER BINARY(16) columns storing IPv6 addresses to INET6.\nAfter such an alter, there is no a need to use INET6_ATON() and INET6_NTOA().\nAddresses can be inserted and retrieved directly.\n\nIt is also possible to convert INET6 columns to BINARY(16) and continue using\nthe data in combination with INET6_NTOA() and INET6_ATON().\n\nExamples\n--------\n\nCREATE TABLE t1 (a INET6);\n\nInserting using short text address notation:\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nLong text address notation:\n\nINSERT INTO t1 VALUES (\'2001:0db8:0000:0000:0000:ff00:0042:8329\');\n\n16-byte binary string notation:\n\nINSERT INTO t1 VALUES (0x20010DB8000000000000FF0000428329);\nINSERT INTO t1 VALUES (UNHEX(\'20010DB8000000000000FF0000428329\'));\n\nIPv4 addresses, using IPv4-mapped and IPv4-compatible notations:\n\nINSERT INTO t1 VALUES (\'::ffff:192.0.2.128\'); -- mapped\nINSERT INTO t1 VALUES (\'::192.0.2.128\'); -- compatible\n\nSELECT * FROM t1;\n+------------------------+\n| a                      |\n+------------------------+\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| 2001:db8::ff00:42:8329 |\n| ::ffff:192.0.2.128     |\n| ::192.0.2.128          |\n+------------------------+\n\nIPv4 mapped (or compatible) values still occupy 16 bytes:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'::ffff:192.0.2.128\');\n\nSELECT * FROM t1;\n+--------------------+\n| a                  |\n+--------------------+\n| ::ffff:192.0.2.128 |\n+--------------------+\n\nSELECT HEX(a) FROM t1;\n+----------------------------------+\n| HEX(a)                           |\n+----------------------------------+\n| 00000000000000000000FFFFC0000280 |\n+----------------------------------+\n\nCasting from INET6 to anything other than CHAR returns an error:\n\nSELECT CAST(a AS DECIMAL) FROM t1;\n\nERROR 4079 (HY000): Illegal parameter data type inet6 for operation\n\'decimal_typecast\'\n\nComparison Examples\n-------------------\n\nComparison with another INET6 expression:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n  CREATE OR REPLACE TABLE t2 (a INET6);\n\nINSERT INTO t1 VALUES\n(\'2001:db8::ff00:42:8328\'),(\'2001:db8::ff00:42:8329\');\n  INSERT INTO t2 VALUES\n(\'2001:db8::ff00:42:832a\'),(\'2001:db8::ff00:42:8329\');\n\nSELECT t1.* FROM t1,t2 WHERE t1.a=t2.a;\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith a character string expression with a text (short or long) address\nrepresentation:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT * FROM t1 WHERE a=\'2001:db8::ff00:42:8329\';\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith a 16-byte binary string expression:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT * FROM t1 WHERE a=X\'20010DB8000000000000FF0000428329\';\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nWith an expression of another data type:\n\nSELECT * FROM t1 WHERE a=1;\nERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation\n\'=\'\n\nMixing for Result Examples\n--------------------------\n\nMixed with another INET6 expression, returning an INET6 data type:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b INET6);\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:8329\');\n\nSELECT a FROM t1 UNION SELECT b FROM t1;\n  +------------------------+\n  | a                      |\n  +------------------------+\n  | NULL                   |\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nSELECT COALESCE(a, b) FROM t1;\n  +------------------------+\n  | COALESCE(a, b)         |\n  +------------------------+\n  | 2001:db8::ff00:42:8329 |\n  +------------------------+\n\nMixed with a character string in text (short or long) address representation:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b VARCHAR(64));\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:8328\');\n\nINSERT INTO t1 VALUES (NULL,\'2001:db8::ff00:42:832a garbage\');\n\nSELECT COALESCE(a,b) FROM t1;\n  +------------------------+\n  | COALESCE(a,b)          |\n  +------------------------+\n  | 2001:db8::ff00:42:8328 |\n  | NULL                   |\n  +------------------------+\n  2 rows in set, 1 warning (0.001 sec)\n\nSHOW WARNINGS;\n\n+---------+------+---------------------------------------------------------+\n  | Level   | Code | Message\n|\n\n+---------+------+---------------------------------------------------------+\n  | Warning | 1292 | Incorrect inet6 value: \'2001:db8::ff00:42:832a garbage\'\n|\n\n+---------+------+---------------------------------------------------------+\n\nMixed with a 16-byte binary string:\n\nCREATE OR REPLACE TABLE t1 (a INET6, b VARBINARY(16));\n\nINSERT INTO t1 VALUES (NULL,CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF));\n\nINSERT INTO t1 VALUES (NULL,0x00/*garbage*/);\n\nSELECT COALESCE(a,b) FROM t1;\n  +---------------+\n  | COALESCE(a,b) |\n  +---------------+\n  | ffff::ffff    |\n  | NULL          |\n  +---------------+\n  2 rows in set, 1 warning (0.001 sec)\n\nSHOW WARNINGS;\n  +---------+------+-------------------------------+\n  | Level   | Code | Message                       |\n  +---------+------+-------------------------------+\n  | Warning | 1292 | Incorrect inet6 value: \'\\x00\' |\n  +---------+------+-------------------------------+\n\nMixing with other data types:\n\nSELECT CAST(\'ffff::ffff\' AS INET6) UNION SELECT 1;\nERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation\n\'UNION\'\n\nFunctions and Operators Examples\n--------------------------------\n\nHEX with an INET6 argument returning a hexadecimal representation:\n\nSELECT HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6));\n  +----------------------------------------------+\n  | HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6)) |\n  +----------------------------------------------+\n  | 20010DB8000000000000FF0000428329             |\n  +----------------------------------------------+\n\nINET6_ATON now understands INET6 values as an argument:\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n\nSELECT a, HEX(INET6_ATON(a)) FROM t1;\n  +------------------------+----------------------------------+\n  | a                      | HEX(INET6_ATON(a))               |\n  +------------------------+----------------------------------+\n  | 2001:db8::ff00:42:8329 | 20010DB8000000000000FF0000428329 |\n  +------------------------+----------------------------------+\n\nIS_IPV4_COMPAT and IS_IPV4_MAPPED prototype now a BINARY(16)):\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\n  INSERT INTO t1 VALUES (\'::ffff:192.168.0.1\');\n  INSERT INTO t1 VALUES (\'::192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), IS_IPV4_COMPAT(a) FROM t1;\n  +------------------------+-------------------+-------------------+\n  | a                      | IS_IPV4_MAPPED(a) | IS_IPV4_COMPAT(a) |\n  +------------------------+-------------------+-------------------+\n  | 2001:db8::ff00:42:8329 |                 0 |                 0 |\n  | ::ffff:192.168.0.1     |                 1 |                 0 |\n  | ::192.168.0.1          |                 0 |                 1 |\n  +------------------------+-------------------+-------------------+\n\nAutomatic implicit CAST to INET6:\n\nCREATE OR REPLACE TABLE t1 (\n   a INET6,\n   b VARCHAR(39) DEFAULT a\n  );\n\nINSERT INTO t1 (a) VALUES (\'ffff::ffff\'),(\'::ffff:192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), b, IS_IPV4_MAPPED(b) FROM t1;\n\n+--------------------+-------------------+--------------------+----------------\n--+\n  | a                  | IS_IPV4_MAPPED(a) | b                  |\nIS_IPV4_MAPPED(b) |\n\n+--------------------+-------------------+--------------------+----------------\n--+\n  | ffff::ffff         |                 0 | ffff::ffff         |\n  0 |\n  | ::ffff:192.168.0.1 |                 1 | ::ffff:192.168.0.1 |\n  1 |\n\n+--------------------+-------------------+--------------------+----------------\n--+\n\nCREATE OR REPLACE TABLE t1 (\n   a INET6,\n   b BINARY(16) DEFAULT UNHEX(HEX(a))\n  );\n\nINSERT INTO t1 (a) VALUES (\'ffff::ffff\'),(\'::ffff:192.168.0.1\');\n\nSELECT a, IS_IPV4_MAPPED(a), HEX(b), IS_IPV4_MAPPED(b) FROM t1;\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n  | a                  | IS_IPV4_MAPPED(a) | HEX(b)\n | IS_IPV4_MAPPED(b) |\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n  | ffff::ffff         |                 0 |\nFFFF000000000000000000000000FFFF |                 0 |\n  | ::ffff:192.168.0.1 |                 1 |\n00000000000000000000FFFFC0A80001 |                 1 |\n\n+--------------------+-------------------+----------------------------------+--\n----------------+\n\nPrepared Statement Parameters Examples\n--------------------------------------\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING \'ffff::fffe\';\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING\nX\'FFFF000000000000000000000000FFFF\';\n\nSELECT * FROM t1;\n+------------+\n| a          |\n+------------+\n| ffff::fffe |\n| ffff::ffff |\n+------------+\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING \'ffff::fffe\';\n+------------+\n| a          |\n+------------+\n| ffff::fffe |\n+------------+\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING\nX\'FFFF000000000000000000000000FFFF\';\n+------------+\n| a          |\n+------------+\n| ffff::ffff |\n+------------+\n\nMigration between BINARY(16) and INET6 Examples\n-----------------------------------------------\n\nBefore MariaDB 10.5:\n\nCREATE OR REPLACE TABLE t1 (a BINARY(16));\n\nINSERT INTO t1 VALUES (INET6_ATON(\'ffff::ffff\'));\n\nSELECT INET6_NTOA(a) FROM t1;\n+---------------+\n| INET6_NTOA(a) |\n+---------------+\n| ffff::ffff    |\n+---------------+\n\nMigrating to INET6, from MariaDB 10.5:\n\nALTER TABLE t1 MODIFY a INET6;\n\nINSERT INTO t1 VALUES (\'ffff::fffe\');\n\nSELECT * FROM t1;\n+------------+\n| a          |\n+------------+\n| ffff::ffff |\n| ffff::fffe |\n+------------+\n\nMigration from INET6 to BINARY(16):\n\nCREATE OR REPLACE TABLE t1 (a INET6);\n\nINSERT INTO t1 VALUES (\'2001:db8::ff00:42:8329\');\nINSERT INTO t1 VALUES (\'::ffff:192.168.0.1\');\nINSERT INTO t1 VALUES (\'::192.168.0.1\');\n\nALTER TABLE t1 MODIFY a BINARY(16);\n\nSELECT INET6_NTOA(a) FROM t1;\n+------------------------+\n| INET6_NTOA(a)          |\n+------------------------+\n| 2001:db8::ff00:42:8329 |\n| ::ffff:192.168.0.1     |\n| ::192.168.0.1          |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/inet6/','','https://mariadb.com/kb/en/inet6/'),
(279,'MEDIUMBLOB',23,'Syntax\n------\n\nMEDIUMBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a three-byte length prefix that indicates the\nnumber of bytes in the value.\n\nURL: https://mariadb.com/kb/en/mediumblob/','','https://mariadb.com/kb/en/mediumblob/'),
(280,'MEDIUMTEXT',23,'Syntax\n------\n\nMEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach MEDIUMTEXT value is stored using a three-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: https://mariadb.com/kb/en/mediumtext/','','https://mariadb.com/kb/en/mediumtext/'),
(164,'RELEASE_LOCK',14,'Syntax\n------\n\nRELEASE_LOCK(str)\n\nDescription\n-----------\n\nReleases the lock named by the string str that was obtained with GET_LOCK().\nReturns 1 if the lock was released, 0 if the lock was not established by this\nthread (in which case the lock is not released), and NULL if the named lock\ndid not exist. The lock does not exist if it was never obtained by a call to\nGET_LOCK() or if it has previously been released.\n\nstr is case insensitive. If str is an empty string or NULL, RELEASE_LOCK()\nreturns NULL and does nothing.\n\nStatements using the RELEASE_LOCK() function are not safe for replication.\n\nThe DO statement is convenient to use with RELEASE_LOCK().\n\nExamples\n--------\n\nConnection1:\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nConnection 1:\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\'), RELEASE_LOCK(\'lock3\');\n+-----------------------+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') | RELEASE_LOCK(\'lock3\') |\n+-----------------------+-----------------------+-----------------------+\n|                     1 |                     0 |                  NULL |\n+-----------------------+-----------------------+-----------------------+\n\nFrom MariaDB 10.0.2, it is possible to hold the same lock recursively. This\nexample is viewed using the metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE           | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n|        46 | MDL_SHARED_NO_WRITE | NULL          | User lock | lock3        |\n     |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/release_lock/','','https://mariadb.com/kb/en/release_lock/'),
(167,'UUID',14,'Syntax\n------\n\nUUID()\n\nDescription\n-----------\n\nReturns a Universally Unique Identifier (UUID).\n\nA UUID is designed as a number that is globally unique in space and time. Two\ncalls to UUID() are expected to generate two different values, even if these\ncalls are performed on two separate computers that are not connected to each\nother.\n\nUUID() results are intended to be unique, but cannot always be relied upon to\nunpredictable and unguessable, so should not be relied upon for these purposes.\n\nA UUID is a 128-bit number represented by a utf8 string of five hexadecimal\nnumbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\n* The first three numbers are generated from a timestamp.\n* The fourth number preserves temporal uniqueness in case the timestamp value\n loses monotonicity (for example, due to daylight saving time).\n* The fifth number is an IEEE 802 node number that provides spatial uniqueness.\n A random number is substituted if the latter is not available (for example,\n because the host computer has no Ethernet card, or we do not know how to find\n the hardware address of an interface on your operating system). In this case,\n spatial uniqueness cannot be guaranteed. Nevertheless, a collision should\n have very low probability.\n\nCurrently, the MAC address of an interface is taken into account only on\nFreeBSD and Linux. On other operating systems, MariaDB uses a randomly\ngenerated 48-bit number.\n\nStatements using the UUID() function are not safe for replication.\n\nThe results are generated according to the \"DCE 1.1:Remote Procedure Call\"\n(Appendix A) CAE (Common Applications Environment) Specifications published by\nThe Open Group in October 1997 (Document Number C706).\n\nExamples\n--------\n\nSELECT UUID();\n+--------------------------------------+\n| UUID()                               |\n+--------------------------------------+\n| cd41294a-afb0-11df-bc9b-00241dd75637 |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/uuid/','','https://mariadb.com/kb/en/uuid/'),
(281,'LONGBLOB',23,'Syntax\n------\n\nLONGBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 4,294,967,295 bytes or 4GB (232 - 1).\nThe effective maximum length of LONGBLOB columns depends on the configured\nmaximum packet size in the client/server protocol and available memory. Each\nLONGBLOB value is stored using a four-byte length prefix that indicates the\nnumber of bytes in the value.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\nURL: https://mariadb.com/kb/en/longblob/','','https://mariadb.com/kb/en/longblob/'),
(285,'TINYBLOB',23,'Syntax\n------\n\nTINYBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each TINYBLOB value\nis stored using a one-byte length prefix that indicates the number of bytes in\nthe value.\n\nURL: https://mariadb.com/kb/en/tinyblob/','','https://mariadb.com/kb/en/tinyblob/'),
(286,'TINYTEXT',23,'Syntax\n------\n\nTINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The effective\nmaximum length is less if the value contains multi-byte characters. Each\nTINYTEXT value is stored using a one-byte length prefix that indicates the\nnumber of bytes in the value.\n\nURL: https://mariadb.com/kb/en/tinytext/','','https://mariadb.com/kb/en/tinytext/'),
(289,'SET Data Type',23,'Syntax\n------\n\nSET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nA set. A string object that can have zero or more values, each of which must\nbe chosen from the list of values \'value1\', \'value2\', ... A SET column can\nhave a maximum of 64 members. SET values are represented internally as\nintegers.\n\nSET values cannot contain commas.\n\nIf a SET contains duplicate values, an error will be returned if strict mode\nis enabled, or a warning if strict mode is not enabled.\n\nURL: https://mariadb.com/kb/en/set-data-type/','','https://mariadb.com/kb/en/set-data-type/'),
(168,'UUID_SHORT',14,'Syntax\n------\n\nUUID_SHORT()\n\nDescription\n-----------\n\nReturns a \"short\" universally unique identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\n* The server_id of the current host is unique among your set of master and\n slave servers\n* server_id is between 0 and 255\n* You don\'t set back your system time for your server between mysqld restarts\n* You do not invoke UUID_SHORT() on average more than 16\n million times per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n(server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nStatements using the UUID_SHORT() function are not safe for statement-based\nreplication.\n\nExamples\n--------\n\nSELECT UUID_SHORT();\n+-------------------+\n| UUID_SHORT()      |\n+-------------------+\n| 21517162376069120 |\n+-------------------+\n\ncreate table t1 (a bigint unsigned default(uuid_short()) primary key);\ninsert into t1 values(),();\nselect * from t1;\n+-------------------+\n| a                 |\n+-------------------+\n| 98113699159474176 |\n| 98113699159474177 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/uuid_short/','','https://mariadb.com/kb/en/uuid_short/'),
(169,'VALUES / VALUE',14,'Syntax\n------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nVALUE(col_name)\n\nMariaDB until 10.3.2\n--------------------\n\nVALUES(col_name)\n\nDescription\n-----------\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column values from\nthe INSERT portion of the statement. In other words, VALUES(col_name) in the\nUPDATE clause refers to the value of col_name that would be inserted, had no\nduplicate-key conflict occurred. This function is especially useful in\nmultiple-row inserts.\n\nThe VALUES() function is meaningful only in INSERT ... ON DUPLICATE KEY UPDATE\nstatements and returns NULL otherwise.\n\nIn MariaDB 10.3.3 this function was renamed to VALUE(), because it\'s\nincompatible with the standard Table Value Constructors syntax, implemented in\nMariaDB 10.3.3.\n\nThe VALUES() function can still be used even from MariaDB 10.3.3, but only in\nINSERT ... ON DUPLICATE KEY UPDATE statements; it\'s a syntax error otherwise.\n\nExamples\n--------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b);\n\nMariaDB until 10.3.2\n--------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\nURL: https://mariadb.com/kb/en/values-value/','','https://mariadb.com/kb/en/values-value/'),
(173,'||',15,'Syntax\n------\n\nOR, ||\n\nDescription\n-----------\n\nLogical OR. When both operands are non-NULL, the result is 1 if any operand is\nnon-zero, and 0 otherwise. With a NULL operand, the result is 1 if the other\noperand is non-zero, and NULL otherwise. If both operands are NULL, the result\nis NULL.\n\nFor this operator, short-circuit evaluation can be used.\n\nNote that, if the PIPES_AS_CONCAT SQL_MODE is set, || is used as a string\nconcatenation operator. This means that a || b is the same as CONCAT(a,b). See\nCONCAT() for details.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, || ignores NULL.\n\nExamples\n--------\n\nSELECT 1 || 1;\n+--------+\n| 1 || 1 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 1 || 0;\n+--------+\n| 1 || 0 |\n+--------+\n|      1 |\n+--------+\n\nSELECT 0 || 0;\n+--------+\n| 0 || 0 |\n+--------+\n|      0 |\n+--------+\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 1 || NULL;\n+-----------+\n| 1 || NULL |\n+-----------+\n|         1 |\n+-----------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n| 0         |\n+-----------+\n\nURL: https://mariadb.com/kb/en/or/','','https://mariadb.com/kb/en/or/'),
(175,'AVG',16,'Syntax\n------\n\nAVG([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the average value of expr. The DISTINCT option can be used to return\nthe average of the distinct values of expr. NULL values are ignored. It is an\naggregate function, and so can be used with the GROUP BY clause.\n\nAVG() returns NULL if there were no matching rows.\n\nAVG() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\n\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT AVG(sales_value) FROM sales;\n+------------------+\n| AVG(sales_value) |\n+------------------+\n|          22.5000 |\n+------------------+\n\nSELECT AVG(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| AVG(DISTINCT(sales_value)) |\n+----------------------------+\n|                    23.3333 |\n+----------------------------+\n\nCommonly, AVG() is used with a GROUP BY clause:\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, AVG(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | AVG(score) |\n+---------+------------+\n| Chun    |    74.0000 |\n| Esben   |    37.0000 |\n| Kaolin  |    72.0000 |\n| Tatiana |    85.0000 |\n+---------+------------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,AVG(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL  |         31 |\n+------+------+------------+\n\nAs a window function:\n\nCREATE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY test) \n  AS average_by_test FROM student_test;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         65.2500 |\n| Chun    | Tuning |    73 |         68.7500 |\n| Esben   | SQL    |    43 |         65.2500 |\n| Esben   | Tuning |    31 |         68.7500 |\n| Kaolin  | SQL    |    56 |         65.2500 |\n| Kaolin  | Tuning |    88 |         68.7500 |\n| Tatiana | SQL    |    87 |         65.2500 |\n| Tatiana | Tuning |    83 |         68.7500 |\n+---------+--------+-------+-----------------+\n\nURL: https://mariadb.com/kb/en/avg/','','https://mariadb.com/kb/en/avg/'),
(294,'TIMESTAMP',23,'Syntax\n------\n\nTIMESTAMP [(<microsecond precision)]\n\nDescription\n-----------\n\nA timestamp in the format YYYY-MM-DD HH:MM:SS.ffffff.\n\nThe timestamp field is generally used to define at which moment in time a row\nwas added or updated and by default will automatically be assigned the current\ndatetime when a record is inserted or updated. The automatic properties only\napply to the first TIMESTAMP in the record; subsequent TIMESTAMP columns will\nnot be changed.\n\nMariaDB includes the --mysql56-temporal-format option, on by default, which\nallows MariaDB to store TIMESTAMPs using the same low-level format MySQL 5.6\nuses.\n\nFor more information, see Internal Format.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the TIMESTAMP data type as the number of\nseconds since \'1970-01-01 00:00:00\' (UTC). This means that the TIMESTAMP data\ntype can hold values between \'1970-01-01 00:00:01\' (UTC) and \'2038-01-19\n03:14:07\' (UTC).\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nAutomatic Values\n----------------\n\nMariaDB has special behavior for the first column that uses the TIMESTAMP data\ntype in a specific table when the system variable\nexplicit_defaults_for_timestamp is not set (which is the default until MariaDB\n10.10). For the first column that uses the TIMESTAMP data type in a specific\ntable, MariaDB automatically assigns the following properties to the column:\n\n* DEFAULT CURRENT_TIMESTAMP\n* ON UPDATE CURRENT_TIMESTAMP\n\nThis means that if the column is not explicitly assigned a value in an INSERT\nor UPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time.\n\nThis automatic initialization for INSERT and UPDATE queries can also be\nexplicitly enabled for a column that uses the TIMESTAMP data type by\nspecifying the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP\nclauses for the column. In these clauses, any synonym of CURRENT_TIMESTAMP is\naccepted, including CURRENT_TIMESTAMP(), NOW(), LOCALTIME, LOCALTIME(),\nLOCALTIMESTAMP, and LOCALTIMESTAMP().\n\nThis automatic initialization for INSERT queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nconstant DEFAULT value. For example, DEFAULT 0.\n\nThis automatic initialization for UPDATE queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nDEFAULT clause for the column, but no ON UPDATE clause. If a DEFAULT clause is\nexplicitly specified for a column that uses the TIMESTAMP data type, but an ON\nUPDATE clause is not specified for the column, then the timestamp value will\nnot automatically change when an UPDATE statement is executed.\n\nMariaDB also has special behavior if NULL is assigned to column that uses the\nTIMESTAMP data type. If the column is assigned the NULL value in an INSERT or\nUPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time. For details, see NULL values in MariaDB.\n\nThis automatic initialization for NULL values can also be explicitly disabled\nfor a column that uses the TIMESTAMP data type by specifying the NULL\nattribute for the column. In this case, if the column\'s value is set to NULL,\nthen the column\'s value will actually be set to NULL.\n\nTime Zones\n----------\n\nIf a column uses the TIMESTAMP data type, then any inserted values are\nconverted from the session\'s time zone to Coordinated Universal Time (UTC)\nwhen stored, and converted back to the session\'s time zone when retrieved.\n\nMariaDB validates TIMESTAMP literals against the session\'s time zone. For\nexample, if a specific time range never occurred in a specific time zone due\nto daylight savings time, then TIMESTAMP values within that range would be\ninvalid for that time zone.\n\nMariaDB does not currently store any time zone identifier with the value of\nthe TIMESTAMP data type. See MDEV-10018 for more information.\n\nMariaDB does not currently support time zone literals that contain time zone\nidentifiers. See MDEV-11829 for more information.\n\nLimitations\n-----------\n\n* Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value\n\'1970-01-01 00:00:00\' (UTC) is reserved since the second #0 is used to\nrepresent \'0000-00-00 00:00:00\'.\n* In MariaDB 5.5 and before there could only be one TIMESTAMP column per table\nthat had CURRENT_TIMESTAMP defined as its default value. This limit has no\nlonger applied since MariaDB 10.0.\n\nSQL_MODE=MAXDB\n--------------\n\nIf the SQL_MODE is set to MAXDB, TIMESTAMP fields will be silently converted\nto DATETIME.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIMESTAMP column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIMESTAMP;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_timestamp\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_timestamp\nCreate Table: CREATE TABLE `mariadb5312_timestamp` (\n `ts0` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp() ON\nUPDATE current_timestamp(),\n `ts6` timestamp(6) /* mariadb-5.3 */ NOT NULL DEFAULT \'0000-00-00\n00:00:00.000000\'\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote: Prior to MySQL 4.1 a different format for the TIMESTAMP datatype was\nused. This format is unsupported in MariaDB 5.1 and upwards.\n\nExamples\n--------\n\nCREATE TABLE t (id INT, ts TIMESTAMP);\n\nDESC t;\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| Field | Type      | Null | Key | Default           | Extra                  \n  |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| id    | int(11)   | YES  |     | NULL              |                        \n  |\n| ts    | timestamp | NO   |     | CURRENT_TIMESTAMP | on update\nCURRENT_TIMESTAMP |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n\nINSERT INTO t(id)  VALUES (1),(2);\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n+------+---------------------+\n\nINSERT INTO t  VALUES (3,NULL),(4,\'2001-07-22 12:12:12\');\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    1 | 2013-07-22 12:50:05 |\n|    2 | 2013-07-22 12:50:05 |\n|    3 | 2013-07-22 12:51:56 |\n|    4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nConverting to Unix epoch:\n\nSELECT ts, UNIX_TIMESTAMP(ts) FROM t;\n+---------------------+--------------------+\n| ts                  | UNIX_TIMESTAMP(ts) |\n+---------------------+--------------------+\n| 2013-07-22 12:50:05 |         1374490205 |\n| 2013-07-22 12:50:05 |         1374490205 |\n| 2013-07-22 12:51:56 |         1374490316 |\n| 2001-07-22 12:12:12 |          995796732 |\n+---------------------+--------------------+\n\nUpdate also changes the timestamp:\n\nUPDATE t set id=5 WHERE id=1;\n\nSELECT * FROM t;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    5 | 2013-07-22 14:52:33 |\n|    2 | 2013-07-22 12:50:05 |\n|    3 | 2013-07-22 12:51:56 |\n|    4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nDefault NULL:\n\nCREATE TABLE t2 (id INT, ts TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP);\n\nINSERT INTO t(id)  VALUES (1),(2);\n\nSELECT * FROM t2;\n\nINSERT INTO t2(id)  VALUES (1),(2);\n\nSELECT * FROM t2;\n+------+------+\n| id   | ts   |\n+------+------+\n|    1 | NULL |\n|    2 | NULL |\n+------+------+\n\nUPDATE t2 SET id=3 WHERE id=1;\n\nSELECT * FROM t2;\n+------+---------------------+\n| id   | ts                  |\n+------+---------------------+\n|    3 | 2013-07-22 15:32:22 |\n|    2 | NULL                |\n+------+---------------------+\n\nOnly the first timestamp is automatically inserted and updated:\n\nCREATE TABLE t3 (id INT, ts1 TIMESTAMP, ts2 TIMESTAMP);\n\nINSERT INTO t3(id)  VALUES (1),(2);\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id   | ts1                 | ts2                 |\n+------+---------------------+---------------------+\n|    1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n+------+---------------------+---------------------+\n\nDESC t3;\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| Field | Type      | Null | Key | Default             | Extra                \n   |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| id    | int(11)   | YES  |     | NULL                |                      \n   |\n| ts1   | timestamp | NO   |     | CURRENT_TIMESTAMP   | on update\nCURRENT_TIMESTAMP |\n| ts2   | timestamp | NO   |     | 0000-00-00 00:00:00 |                      \n   |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n\nExplicitly setting a timestamp with the CURRENT_TIMESTAMP function:\n\nINSERT INTO t3(id,ts2)  VALUES (3,CURRENT_TIMESTAMP());\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id   | ts1                 | ts2                 |\n+------+---------------------+---------------------+\n|    1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n|    3 | 2013-07-22 15:38:52 | 2013-07-22 15:38:52 |\n+------+---------------------+---------------------+\n\nSpecifying the timestamp as NOT NULL:\n\nCREATE TABLE t4 (id INT, ts TIMESTAMP NOT NULL);\n\nINSERT INTO t4(id)  VALUES (1);\nSELECT SLEEP(1);\nINSERT INTO t4(id,ts) VALUES (2,NULL);\n\nSELECT * FROM t4;\n\nURL: https://mariadb.com/kb/en/timestamp/','','https://mariadb.com/kb/en/timestamp/'),
(304,'GOTO',24,'MariaDB starting with 10.3\n--------------------------\nThe GOTO statement was introduced in MariaDB 10.3 for Oracle compatibility.\n\nSyntax\n------\n\nGOTO label\n\nDescription\n-----------\n\nThe GOTO statement causes the code to jump to the specified label, and\ncontinue operating from there. It is only accepted when in Oracle mode.\n\nExample\n-------\n\nSET sql_mode=ORACLE;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1 AS\n\nBEGIN\n\nSELECT 1;\n GOTO label;\n SELECT 2;\n <<label>>\n SELECT 3;\n\nEND;\n\n//\n\nDELIMITER\n\ncall p1();\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.000 sec)\n\n+---+\n| 3 |\n+---+\n| 3 |\n+---+\n1 row in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/goto/','','https://mariadb.com/kb/en/goto/'),
(174,'Stored Aggregate Functions',16,'MariaDB starting with 10.3.3\n----------------------------\nThe ability to create stored aggregate functions was added in MariaDB 10.3.3.\n\nAggregate functions are functions that are computed over a sequence of rows\nand return one result for the sequence of rows.\n\nCreating a custom aggregate function is done using the CREATE FUNCTION\nstatement with two main differences:\n\n* The addition of the AGGREGATE keyword, so CREATE AGGREGATE FUNCTION\n* The FETCH GROUP NEXT ROW instruction inside the loop\n* Oracle PL/SQL compatibility using SQL/PL is provided\n\nStandard Syntax\n---------------\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURNS return_type\nBEGIN\n   All types of declarations\n   DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN return_val;\n   LOOP\n     FETCH GROUP NEXT ROW; // fetches next row from table\n     other instructions\n   END LOOP;\nEND\n\nStored aggregate functions were a 2016 Google Summer of Code project by Varun\nGupta.\n\nUsing SQL/PL\n------------\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURN return_type\n declarations\nBEGIN\n LOOP\n   FETCH GROUP NEXT ROW; -- fetches next row from table\n   -- other instructions\n\nEND LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n   RETURN return_val;\nEND //\n\nDELIMITER ;\n\nExamples\n--------\n\nFirst a simplified example:\n\nCREATE TABLE marks(stud_id INT, grade_count INT);\n\nINSERT INTO marks VALUES (1,6), (2,4), (3,7), (4,5), (5,8);\n\nSELECT * FROM marks;\n+---------+-------------+\n| stud_id | grade_count |\n+---------+-------------+\n|       1 |           6 |\n|       2 |           4 |\n|       3 |           7 |\n|       4 |           5 |\n|       5 |           8 |\n+---------+-------------+\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION IF NOT EXISTS aggregate_count(x INT) RETURNS INT\nBEGIN\n DECLARE count_students INT DEFAULT 0;\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n RETURN count_students;\n   LOOP\n     FETCH GROUP NEXT ROW;\n     IF x  THEN\n      SET count_students = count_students+1;\n     END IF;\n   END LOOP;\nEND //\nDELIMITER ;\n\nA non-trivial example that cannot easily be rewritten using existing functions:\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION medi_int(x INT) RETURNS DOUBLE\nBEGIN\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n  BEGIN\n   DECLARE res DOUBLE;\n   DECLARE cnt INT DEFAULT (SELECT COUNT(*) FROM tt);\n   DECLARE lim INT DEFAULT (cnt-1) DIV 2;\n   IF cnt % 2 = 0 THEN\n    SET res = (SELECT AVG(a) FROM (SELECT a FROM tt ORDER BY a LIMIT\nlim,2) ttt);\n   ELSE\n    SET res = (SELECT a FROM tt ORDER BY a LIMIT lim,1);\n   END IF;\n   DROP TEMPORARY TABLE tt;\n   RETURN res;\n  END;\n CREATE TEMPORARY TABLE tt (a INT);\n LOOP\n  FETCH GROUP NEXT ROW;\n  INSERT INTO tt VALUES (x);\n END LOOP;\nEND //\nDELIMITER ;\n\nSQL/PL Example\n--------------\n\nThis uses the same marks table as created above.\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION aggregate_count(x INT) RETURN INT AS count_students\nINT DEFAULT 0;\nBEGIN\n LOOP\n   FETCH GROUP NEXT ROW;\n   IF x  THEN\n    SET count_students := count_students+1;\n   END IF;\n END LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n   RETURN count_students;\nEND aggregate_count //\nDELIMITER ;\n\nSELECT aggregate_count(stud_id) FROM marks;\n\nURL: https://mariadb.com/kb/en/stored-aggregate-functions/','','https://mariadb.com/kb/en/stored-aggregate-functions/'),
(176,'BIT_AND',16,'Syntax\n------\n\nBIT_AND(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise AND of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_AND will return a value with all bits set to 1. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_AND can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_AND(NULL);\n+----------------------+\n| BIT_AND(NULL)        |\n+----------------------+\n| 18446744073709551615 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/bit_and/','','https://mariadb.com/kb/en/bit_and/'),
(305,'IF',24,'Syntax\n------\n\nIF search_condition THEN statement_list\n  [ELSEIF search_condition THEN statement_list] ...\n  [ELSE statement_list]\nEND IF;\n\nDescription\n-----------\n\nIF implements a basic conditional construct. If the search_condition evaluates\nto true, the corresponding SQL statement list is executed. If no\nsearch_condition matches, the statement list in the ELSE clause is executed.\nEach statement_list consists of one or more statements.\n\nURL: https://mariadb.com/kb/en/if/','','https://mariadb.com/kb/en/if/'),
(309,'LOOP',24,'Syntax\n------\n\n[begin_label:] LOOP\n  statement_list\nEND LOOP [end_label]\n\nDescription\n-----------\n\nLOOP implements a simple loop construct, enabling repeated execution of the\nstatement list, which consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter. The statements within the loop are\nrepeated until the loop is exited; usually this is accomplished with a LEAVE\nstatement.\n\nA LOOP statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nSee Delimiters in the mariadb client for more on delimiter usage in the client.\n\nURL: https://mariadb.com/kb/en/loop/','','https://mariadb.com/kb/en/loop/'),
(312,'RETURN',24,'Syntax\n------\n\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and returns the\nvalue expr to the function caller. There must be at least one RETURN statement\nin a stored function. If the function has multiple exit points, all exit\npoints must have a RETURN.\n\nThis statement is not used in stored procedures, triggers, or events. LEAVE\ncan be used instead.\n\nThe following example shows that RETURN can return the result of a scalar\nsubquery:\n\nCREATE FUNCTION users_count() RETURNS BOOL\n READS SQL DATA\nBEGIN\n RETURN (SELECT COUNT(DISTINCT User) FROM mysql.user);\nEND;\n\nURL: https://mariadb.com/kb/en/return/','','https://mariadb.com/kb/en/return/'),
(315,'WHILE',24,'Syntax\n------\n\n[begin_label:] WHILE search_condition DO\n  statement_list\nEND WHILE [end_label]\n\nDescription\n-----------\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition is true. statement_list consists of one or more statements.\nIf the loop must be executed at least once, REPEAT ... LOOP can be used\ninstead.\n\nA WHILE statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nExamples\n--------\n\nCREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\nWHILE v1 > 0 DO\n  ...\n  SET v1 = v1 - 1;\n END WHILE;\nEND\n\nURL: https://mariadb.com/kb/en/while/','','https://mariadb.com/kb/en/while/'),
(177,'BIT_OR',16,'Syntax\n------\n\nBIT_OR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise OR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_OR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_OR can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_OR(NULL);\n+--------------+\n| BIT_OR(NULL) |\n+--------------+\n|            0 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/bit_or/','','https://mariadb.com/kb/en/bit_or/'),
(178,'BIT_XOR',16,'Syntax\n------\n\nBIT_XOR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise XOR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_XOR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nBIT_XOR can be used as a window function with the addition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n|        100 |       111 |        101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a        |        100 |       111 |        101 |\n| b        |          0 |        11 |         10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_XOR(NULL);\n+---------------+\n| BIT_XOR(NULL) |\n+---------------+\n|             0 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/bit_xor/','','https://mariadb.com/kb/en/bit_xor/'),
(179,'COUNT',16,'Syntax\n------\n\nCOUNT(expr)\n\nDescription\n-----------\n\nReturns a count of the number of non-NULL values of expr in the rows retrieved\nby a SELECT statement. The result is a BIGINT value. It is an aggregate\nfunction, and so can be used with the GROUP BY clause.\n\nCOUNT(*) counts the total number of rows in a table.\n\nCOUNT() returns 0 if there were no matching rows.\n\nCOUNT() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT COUNT(*) FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n|        8 |\n+----------+\n\nCOUNT(DISTINCT) example:\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n|                      4 |\n+------------------------+\n\nAs a window function\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, COUNT(score) OVER (PARTITION BY name) \n  AS tests_written FROM student_test;\n+---------+--------+-------+---------------+\n| name    | test   | score | tests_written |\n+---------+--------+-------+---------------+\n| Chun    | SQL    |    75 |             2 |\n| Chun    | Tuning |    73 |             2 |\n| Esben   | SQL    |    43 |             2 |\n| Esben   | Tuning |    31 |             2 |\n| Kaolin  | SQL    |    56 |             2 |\n| Kaolin  | Tuning |    88 |             2 |\n| Tatiana | SQL    |    87 |             1 |\n+---------+--------+-------+---------------+\n\nURL: https://mariadb.com/kb/en/count/','','https://mariadb.com/kb/en/count/'),
(318,'OPEN',24,'Syntax\n------\n\n<= MariaDB 10.2\n\nOPEN cursor_name\n\nFrom MariaDB 10.3\n\nOPEN cursor_name [expression[,...]];\n\nDescription\n-----------\n\nThis statement opens a cursor which was previously declared with DECLARE\nCURSOR.\n\nThe query associated to the DECLARE CURSOR is executed when OPEN is executed.\nIt is important to remember this if the query produces an error, or calls\nfunctions which have side effects.\n\nThis is necessary in order to FETCH rows from a cursor.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/open/','','https://mariadb.com/kb/en/open/'),
(319,'FETCH',24,'Syntax\n------\n\nFETCH cursor_name INTO var_name [, var_name] ...\n\nDescription\n-----------\n\nThis statement fetches the next row (if a row exists) using the specified open\ncursor, and advances the cursor pointer.\n\nvar_name can be a local variable, but not a user-defined variable.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE value\n02000. To detect this condition, you can set up a handler for it (or for a NOT\nFOUND condition).\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/fetch/','','https://mariadb.com/kb/en/fetch/'),
(320,'CLOSE',24,'Syntax\n------\n\nCLOSE cursor_name\n\nDescription\n-----------\n\nThis statement closes a previously opened cursor. The cursor must have been\npreviously opened or else an error occurs.\n\nIf not closed explicitly, a cursor is closed at the end of the compound\nstatement in which it was declared.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/close/','','https://mariadb.com/kb/en/close/'),
(321,'BUFFER',25,'A synonym for ST_BUFFER.\n\nURL: https://mariadb.com/kb/en/buffer/','','https://mariadb.com/kb/en/buffer/'),
(322,'CONVEXHULL',25,'A synonym for ST_CONVEXHULL.\n\nURL: https://mariadb.com/kb/en/convexhull/','','https://mariadb.com/kb/en/convexhull/'),
(323,'GEOMETRYCOLLECTION',25,'Syntax\n------\n\nGeometryCollection(g1,g2,...)\n\nDescription\n-----------\n\nConstructs a WKB GeometryCollection. If any argument is not a well-formed WKB\nrepresentation of a geometry, the return value is NULL.\n\nExamples\n--------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nURL: https://mariadb.com/kb/en/geometrycollection/','','https://mariadb.com/kb/en/geometrycollection/'),
(180,'COUNT DISTINCT',16,'Syntax\n------\n\nCOUNT(DISTINCT expr,[expr...])\n\nDescription\n-----------\n\nReturns a count of the number of different non-NULL values.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nAlthough, from MariaDB 10.2.0, COUNT can be used as a window function, COUNT\nDISTINCT cannot be.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT COUNT(*) FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n|        8 |\n+----------+\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n|                      4 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/count-distinct/','','https://mariadb.com/kb/en/count-distinct/'),
(181,'GROUP_CONCAT',16,'Syntax\n------\n\nGROUP_CONCAT(expr)\n\nDescription\n-----------\n\nThis function returns a string result with the concatenated non-NULL values\nfrom a group. It returns NULL if there are no non-NULL values.\n\nThe maximum returned length in bytes is determined by the group_concat_max_len\nserver system variable, which defaults to 1M (>= MariaDB 10.2.4) or 1K (<=\nMariaDB 10.2.3).\n\nIf group_concat_max_len <= 512, the return type is VARBINARY or VARCHAR;\notherwise, the return type is BLOB or TEXT. The choice between binary or\nnon-binary types depends from the input.\n\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n      [ORDER BY {unsigned_integer | col_name | expr}\n        [ASC | DESC] [,col_name ...]]\n      [SEPARATOR str_val]\n      [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n\nDISTINCT eliminates duplicate values from the output string.\n\nORDER BY determines the order of returned values.\n\nSEPARATOR specifies a separator between the values. The default separator is a\ncomma (,). It is possible to avoid using a separator by specifying an empty\nstring.\n\nLIMIT\n-----\n\nMariaDB starting with 10.3.3\n----------------------------\nUntil MariaDB 10.3.2, it was not possible to use the LIMIT clause with\nGROUP_CONCAT. This restriction was lifted in MariaDB 10.3.3.\n\nExamples\n--------\n\nSELECT student_name,\n   GROUP_CONCAT(test_score)\n   FROM student\n   GROUP BY student_name;\n\nGet a readable list of MariaDB users from the mysql.user table:\n\nSELECT GROUP_CONCAT(DISTINCT User ORDER BY User SEPARATOR \'\\n\')\n FROM mysql.user;\n\nIn the former example, DISTINCT is used because the same user may occur more\nthan once. The new line (\\n) used as a SEPARATOR makes the results easier to\nread.\n\nGet a readable list of hosts from which each user can connect:\n\nSELECT User, GROUP_CONCAT(Host ORDER BY Host SEPARATOR \', \') \n FROM mysql.user GROUP BY User ORDER BY User;\n\nThe former example shows the difference between the GROUP_CONCAT\'s ORDER BY\n(which sorts the concatenated hosts), and the SELECT\'s ORDER BY (which sorts\nthe rows).\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc\nDESC),\",\",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC),\",\",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3                                                               |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3                                                |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/group_concat/','','https://mariadb.com/kb/en/group_concat/'),
(182,'MAX',16,'Syntax\n------\n\nMAX([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the largest, or maximum, value of expr. MAX() can also take a string\nargument in which case it returns the maximum string value. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MAX() may produce a\ndifferent highest result than ORDER BY DESC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMAX() can be used as a window function.\n\nMAX() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MAX(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MAX(score) |\n+---------+------------+\n| Chun    |         75 |\n| Esben   |         43 |\n| Kaolin  |         88 |\n| Tatiana |         87 |\n+---------+------------+\n\nMAX string:\n\nSELECT MAX(name) FROM student;\n+-----------+\n| MAX(name) |\n+-----------+\n| Tatiana   |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MAX(SCORE) FROM student;\n+------+------+------------+\n| name | test | MAX(SCORE) |\n+------+------+------------+\n| Chun | SQL  |         88 |\n+------+------+------------+\n\nDifference between ORDER BY DESC and MAX():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MAX(grade) FROM student2;\n+------------+\n| MAX(grade) |\n+------------+\n| c          |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade DESC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| a     |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MAX(score) \n OVER (PARTITION BY name) AS highest_score FROM student_test;\n+---------+--------+-------+---------------+\n| name    | test   | score | highest_score |\n+---------+--------+-------+---------------+\n| Chun    | SQL    |    75 |            75 |\n| Chun    | Tuning |    73 |            75 |\n| Esben   | SQL    |    43 |            43 |\n| Esben   | Tuning |    31 |            43 |\n| Kaolin  | SQL    |    56 |            88 |\n| Kaolin  | Tuning |    88 |            88 |\n| Tatiana | SQL    |    87 |            87 |\n+---------+--------+-------+---------------+\n\nURL: https://mariadb.com/kb/en/max/','','https://mariadb.com/kb/en/max/'),
(183,'MIN',16,'Syntax\n------\n\nMIN([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the minimum value of expr. MIN() may take a string argument, in which\ncase it returns the minimum string value. The DISTINCT keyword can be used to\nfind the minimum of the distinct values of expr, however, this produces the\nsame result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MIN() may produce a\ndifferent lowest result than ORDER BY ASC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nMIN() can be used as a window function.\n\nMIN() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MIN(score) FROM student GROUP BY name;\n+---------+------------+\n| name    | MIN(score) |\n+---------+------------+\n| Chun    |         73 |\n| Esben   |         31 |\n| Kaolin  |         56 |\n| Tatiana |         83 |\n+---------+------------+\n\nMIN() with a string:\n\nSELECT MIN(name) FROM student;\n+-----------+\n| MIN(name) |\n+-----------+\n| Chun      |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MIN(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL  |         31 |\n+------+------+------------+\n\nDifference between ORDER BY ASC and MIN():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MIN(grade) FROM student2;\n+------------+\n| MIN(grade) |\n+------------+\n| a          |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade ASC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| b     |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MIN(score) \n OVER (PARTITION BY name) AS lowest_score FROM student_test;\n+---------+--------+-------+--------------+\n| name    | test   | score | lowest_score |\n+---------+--------+-------+--------------+\n| Chun    | SQL    |    75 |           73 |\n| Chun    | Tuning |    73 |           73 |\n| Esben   | SQL    |    43 |           31 |\n| Esben   | Tuning |    31 |           31 |\n| Kaolin  | SQL    |    56 |           56 |\n| Kaolin  | Tuning |    88 |           56 |\n| Tatiana | SQL    |    87 |           87 |\n+---------+--------+-------+--------------+\n\nURL: https://mariadb.com/kb/en/min/','','https://mariadb.com/kb/en/min/'),
(184,'STD',16,'Syntax\n------\n\nSTD(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This is an extension to\nstandard SQL. The standard SQL function STDDEV_POP() can be used instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTD() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/std/','','https://mariadb.com/kb/en/std/'),
(325,'MULTILINESTRING',25,'Syntax\n------\n\nMultiLineString(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiLineString value using WKB LineString arguments. If any\nargument is not a WKB LineString, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16\n48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), \n  Point(3, 5)), LineString(Point(2, 5),Point(5, 8),Point(21, 7))))));\n\nURL: https://mariadb.com/kb/en/multilinestring/','','https://mariadb.com/kb/en/multilinestring/'),
(326,'MULTIPOINT',25,'Syntax\n------\n\nMultiPoint(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPoint value using WKB Point arguments. If any argument\nis not a WKB Point, the return value is NULL.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nURL: https://mariadb.com/kb/en/multipoint/','','https://mariadb.com/kb/en/multipoint/'),
(328,'POINT',25,'Syntax\n------\n\nPoint(x,y)\n\nDescription\n-----------\n\nConstructs a WKB Point using the given coordinates.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'Point(1 1)\');\n\nCREATE TABLE gis_point  (g POINT);\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nURL: https://mariadb.com/kb/en/point/','','https://mariadb.com/kb/en/point/'),
(329,'PointOnSurface',25,'A synonym for ST_PointOnSurface.\n\nURL: https://mariadb.com/kb/en/pointonsurface/','','https://mariadb.com/kb/en/pointonsurface/'),
(333,'ST_INTERSECTION',25,'Syntax\n------\n\nST_INTERSECTION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the intersection, or shared portion, of geometry g1\nand geometry g2.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 1, 0 2)\');\n\nSELECT ASTEXT(ST_INTERSECTION(@g1,@g2));\n+----------------------------------+\n| ASTEXT(ST_INTERSECTION(@g1,@g2)) |\n+----------------------------------+\n| POINT(2 1)                       |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_intersection/','','https://mariadb.com/kb/en/st_intersection/'),
(185,'STDDEV',16,'Syntax\n------\n\nSTDDEV(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This function is provided\nfor compatibility with Oracle. The standard SQL function STDDEV_POP() can be\nused instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/stddev/','','https://mariadb.com/kb/en/stddev/'),
(186,'STDDEV_POP',16,'Syntax\n------\n\nSTDDEV_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent but not\nstandard SQL.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nSTDDEV_POP() can be used as a window function.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name    | test   | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun    | SQL    |    75 |        16.9466 |\n| Chun    | Tuning |    73 |        24.1247 |\n| Esben   | SQL    |    43 |        16.9466 |\n| Esben   | Tuning |    31 |        24.1247 |\n| Kaolin  | SQL    |    56 |        16.9466 |\n| Kaolin  | Tuning |    88 |        24.1247 |\n| Tatiana | SQL    |    87 |        16.9466 |\n+---------+--------+-------+----------------+\n\nURL: https://mariadb.com/kb/en/stddev_pop/','','https://mariadb.com/kb/en/stddev_pop/'),
(188,'SUM',16,'Syntax\n------\n\nSUM([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the sum of expr. If the return set has no rows, SUM() returns NULL.\nThe DISTINCT keyword can be used to sum only the distinct values of expr.\n\nSUM() can be used as a window function, although not with the DISTINCT\nspecifier.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT SUM(sales_value) FROM sales;\n+------------------+\n| SUM(sales_value) |\n+------------------+\n|               90 |\n+------------------+\n\nSELECT SUM(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| SUM(DISTINCT(sales_value)) |\n+----------------------------+\n|                         70 |\n+----------------------------+\n\nCommonly, SUM is used with a GROUP BY clause:\n\nCREATE TABLE sales (name CHAR(10), month CHAR(10), units INT);\n\nINSERT INTO sales VALUES \n (\'Chun\', \'Jan\', 75), (\'Chun\', \'Feb\', 73),\n (\'Esben\', \'Jan\', 43), (\'Esben\', \'Feb\', 31),\n (\'Kaolin\', \'Jan\', 56), (\'Kaolin\', \'Feb\', 88),\n (\'Tatiana\', \'Jan\', 87), (\'Tatiana\', \'Feb\', 83);\n\nSELECT name, SUM(units) FROM sales GROUP BY name;\n+---------+------------+\n| name    | SUM(units) |\n+---------+------------+\n| Chun    |        148 |\n| Esben   |         74 |\n| Kaolin  |        144 |\n| Tatiana |        170 |\n+---------+------------+\n\nThe GROUP BY clause is required when using an aggregate function along with\nregular column data, otherwise the result will be a mismatch, as in the\nfollowing common type of mistake:\n\nSELECT name,SUM(units) FROM sales\n;+------+------------+\n| name | SUM(units) |\n+------+------------+\n| Chun |        536 |\n+------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, SUM(score) OVER (PARTITION BY name) AS total_score\nFROM student_test;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Chun    | SQL    |    75 |         148 |\n| Chun    | Tuning |    73 |         148 |\n| Esben   | SQL    |    43 |          74 |\n| Esben   | Tuning |    31 |          74 |\n| Kaolin  | SQL    |    56 |         144 |\n| Kaolin  | Tuning |    88 |         144 |\n| Tatiana | SQL    |    87 |          87 |\n+---------+--------+-------+-------------+\n\nURL: https://mariadb.com/kb/en/sum/','','https://mariadb.com/kb/en/sum/'),
(334,'ST_POINTONSURFACE',25,'MariaDB starting with 10.1.2\n----------------------------\nST_POINTONSURFACE() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_PointOnSurface(g)\nPointOnSurface(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a POINT guaranteed to intersect a surface. However,\nsee MDEV-7514.\n\nST_PointOnSurface() and PointOnSurface() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_pointonsurface/','','https://mariadb.com/kb/en/st_pointonsurface/'),
(345,'FLUSH',26,'Syntax\n------\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n  flush_option [, flush_option] ...\n\nor when flushing tables:\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] TABLES [table_list]  [table_flush_option]\n\nwhere table_list is a list of tables separated by , (comma).\n\nDescription\n-----------\n\nThe FLUSH statement clears or reloads various internal caches used by MariaDB.\nTo execute FLUSH, you must have the RELOAD privilege. See GRANT.\n\nThe RESET statement is similar to FLUSH. See RESET.\n\nYou cannot issue a FLUSH statement from within a stored function or a trigger.\nDoing so within a stored procedure is permitted, as long as it is not called\nby a stored function or trigger. See Stored Routine Limitations, Stored\nFunction Limitations and Trigger Limitations.\n\nIf a listed table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nBy default, FLUSH statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nThe different flush options are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| CHANGED_PAGE_BITMAPS      | XtraDB only. Internal command used for backup  |\n|                           | purposes. See the Information Schema           |\n|                           | CHANGED_PAGE_BITMAPS Table.                    |\n+---------------------------+------------------------------------------------+\n| CLIENT_STATISTICS         | Reset client statistics (see SHOW              |\n|                           | CLIENT_STATISTICS).                            |\n+---------------------------+------------------------------------------------+\n| DES_KEY_FILE              | Reloads the DES key file (Specified with the   |\n|                           | --des-key-file startup option).                |\n+---------------------------+------------------------------------------------+\n| HOSTS                     | Flush the hostname cache (used for converting  |\n|                           | ip to host names and for unblocking blocked    |\n|                           | hosts. See max_connect_errors and              |\n|                           | performance_schema.host_cache                  |\n+---------------------------+------------------------------------------------+\n| INDEX_STATISTICS          | Reset index statistics (see SHOW               |\n|                           | INDEX_STATISTICS).                             |\n+---------------------------+------------------------------------------------+\n| [ERROR | ENGINE |         | Close and reopen the specified log type, or    |\n| GENERAL | SLOW | BINARY   | all log types if none are specified. FLUSH     |\n| | RELAY] LOGS             | RELAY LOGS [connection-name] can be used to    |\n|                           | flush the relay logs for a specific            |\n|                           | connection. Only one connection can be         |\n|                           | specified per FLUSH command. See Multi-source  |\n|                           | replication. FLUSH ENGINE LOGS will delete     |\n|                           | all unneeded Aria redo logs. FLUSH BINARY      |\n|                           | LOGS DELETE_DOMAIN_ID=(list-of-domains) can    |\n|                           | be used to discard obsolete GTID domains from  |\n|                           | the server\'s binary log state. In order for    |\n|                           | this to be successful, no event group from     |\n|                           | the listed GTID domains can be present in      |\n|                           | existing binary log files. If some still       |\n|                           | exist, then they must be purged prior to       |\n|                           | executing this command. If the command         |\n|                           | completes successfully, then it also rotates   |\n|                           | the binary log.                                |\n+---------------------------+------------------------------------------------+\n| MASTER                    | Deprecated option, use RESET MASTER instead.   |\n+---------------------------+------------------------------------------------+\n| PRIVILEGES                | Reload all privileges from the privilege       |\n|                           | tables in the mysql database. If the server    |\n|                           | is started with --skip-grant-table option,     |\n|                           | this will activate the privilege tables again. |\n+---------------------------+------------------------------------------------+\n| QUERY CACHE               | Defragment the query cache to better utilize   |\n|                           | its memory. If you want to reset the query     |\n|                           | cache, you can do it with RESET QUERY CACHE.   |\n+---------------------------+------------------------------------------------+\n| QUERY_RESPONSE_TIME       | See the QUERY_RESPONSE_TIME plugin.            |\n+---------------------------+------------------------------------------------+\n| SLAVE                     | Deprecated option, use RESET REPLICA or RESET  |\n|                           | SLAVE instead.                                 |\n+---------------------------+------------------------------------------------+\n| SSL                       | Used to dynamically reinitialize the server\'s  |\n|                           | TLS context by reloading the files defined by  |\n|                           | several TLS system variables. See FLUSH SSL    |\n|                           | for more information.                          |\n+---------------------------+------------------------------------------------+\n| STATUS                    | Resets all server status variables that can    |\n|                           | be reset to 0. Not all global status           |\n|                           | variables support this, so not all global      |\n|                           | values are reset. See FLUSH STATUS for more    |\n|                           | information.                                   |\n+---------------------------+------------------------------------------------+\n| TABLE                     | Close tables given as options or all open      |\n|                           | tables if no table list was used. From         |\n|                           | MariaDB 10.4.1, using without any table list   |\n|                           | will only close tables not in use, and tables  |\n|                           | not locked by the FLUSH TABLES connection. If  |\n|                           | there are no locked tables, FLUSH TABLES will  |\n|                           | be instant and will not cause any waits, as    |\n|                           | it no longer waits for tables in use. When a   |\n|                           | table list is provided, from MariaDB 10.4.1,   |\n|                           | the server will wait for the end of any        |\n|                           | transactions that are using the tables.        |\n|                           | Previously, FLUSH TABLES only waited for the   |\n|                           | statements to complete.                        |\n+---------------------------+------------------------------------------------+\n| TABLES                    | Same as FLUSH TABLE.                           |\n+---------------------------+------------------------------------------------+\n| TABLES ... FOR EXPORT     | For InnoDB tables, flushes table changes to    |\n|                           | disk to permit binary table copies while the   |\n|                           | server is running. See FLUSH TABLES ... FOR    |\n|                           | EXPORT for more.                               |\n+---------------------------+------------------------------------------------+\n| TABLES WITH READ LOCK     | Closes all open tables. New tables are only    |\n|                           | allowed to be opened with read locks until an  |\n|                           | UNLOCK TABLES is given.                        |\n+---------------------------+------------------------------------------------+\n| TABLES WITH READ LOCK     | As TABLES WITH READ LOCK but also disable all  |\n| AND DISABLE CHECKPOINT    | checkpoint writes by transactional table       |\n|                           | engines. This is useful when doing a disk      |\n|                           | snapshot of all tables.                        |\n+---------------------------+------------------------------------------------+\n| TABLE_STATISTICS          | Reset table statistics (see SHOW               |\n|                           | TABLE_STATISTICS).                             |\n+---------------------------+------------------------------------------------+\n| USER_RESOURCES            | Resets all per hour user resources. This       |\n|                           | enables clients that have exhausted their      |\n|                           | resources to connect again.                    |\n+---------------------------+------------------------------------------------+\n| USER_STATISTICS           | Reset user statistics (see SHOW                |\n|                           | USER_STATISTICS).                              |\n+---------------------------+------------------------------------------------+\n| USER_VARIABLES            | Reset user variables (see User-defined         |\n|                           | variables).                                    |\n+---------------------------+------------------------------------------------+\n\nYou can also use the mariadb-admin client to flush things. Use mariadb-admin\n--help to examine what flush commands it supports.\n\nFLUSH RELAY LOGS\n----------------\n\nFLUSH RELAY LOGS \'connection_name\';\n\nCompatibility with MySQL\n------------------------\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after the FLUSH command.\n\nFor example, one can now use:\n\nFLUSH RELAY LOGS FOR CHANNEL \'connection_name\';\n\nFLUSH STATUS\n------------\n\nServer status variables can be reset by executing the following:\n\nFLUSH STATUS;\n\nGlobal Status Variables that Support FLUSH STATUS\n-------------------------------------------------\n\nNot all global status variables support being reset by FLUSH STATUS.\nCurrently, the following status variables are reset by FLUSH STATUS:\n\n* Aborted_clients\n* Aborted_connects\n* Binlog_cache_disk_use\n* Binlog_cache_use\n* Binlog_stmt_cache_disk_use\n* Binlog_stmt_cache_use\n* Connection_errors_accept\n* Connection_errors_internal\n* Connection_errors_max_connections\n* Connection_errors_peer_address\n* Connection_errors_select\n* Connection_errors_tcpwrap\n* Created_tmp_files\n* Delayed_errors\n* Delayed_writes\n* Feature_check_constraint\n* Feature_delay_key_write\n* Max_used_connections\n* Opened_plugin_libraries\n* Performance_schema_accounts_lost\n* Performance_schema_cond_instances_lost\n* Performance_schema_digest_lost\n* Performance_schema_file_handles_lost\n* Performance_schema_file_instances_lost\n* Performance_schema_hosts_lost\n* Performance_schema_locker_lost\n* Performance_schema_mutex_instances_lost\n* Performance_schema_rwlock_instances_lost\n* Performance_schema_session_connect_attrs_lost\n* Performance_schema_socket_instances_lost\n* Performance_schema_stage_classes_lost\n* Performance_schema_statement_classes_lost\n* Performance_schema_table_handles_lost\n* Performance_schema_table_instances_lost\n* Performance_schema_thread_instances_lost\n* Performance_schema_users_lost\n* Qcache_hits\n* Qcache_inserts\n* Qcache_lowmem_prunes\n* Qcache_not_cached\n* Rpl_semi_sync_master_no_times\n* Rpl_semi_sync_master_no_tx\n* Rpl_semi_sync_master_timefunc_failures\n* Rpl_semi_sync_master_wait_pos_backtraverse\n* Rpl_semi_sync_master_yes_tx\n* Rpl_transactions_multi_engine\n* Server_audit_writes_failed\n* Slave_retried_transactions\n* Slow_launch_threads\n* Ssl_accept_renegotiates\n* Ssl_accepts\n* Ssl_callback_cache_hits\n* Ssl_client_connects\n* Ssl_connect_renegotiates\n* Ssl_ctx_verify_depth\n* Ssl_ctx_verify_mode\n* Ssl_finished_accepts\n* Ssl_finished_connects\n* Ssl_session_cache_hits\n* Ssl_session_cache_misses\n* Ssl_session_cache_overflows\n* Ssl_session_cache_size\n* Ssl_session_cache_timeouts\n* Ssl_sessions_reused\n* Ssl_used_session_cache_entries\n* Subquery_cache_hit\n* Subquery_cache_miss\n* Table_locks_immediate\n* Table_locks_waited\n* Tc_log_max_pages_used\n* Tc_log_page_waits\n* Transactions_gtid_foreign_engine\n* Transactions_multi_engine\n\nThe different usage of FLUSH TABLES\n-----------------------------------\n\nThe purpose of FLUSH TABLES\n---------------------------\n\nThe purpose of FLUSH TABLES is to clean up the open table cache and table\ndefinition cache from not in use tables. This frees up memory and file\ndescriptors. Normally this is not needed as the caches works on a FIFO bases,\nbut can be useful if the server seams to use up to much memory for some reason.\n\nThe purpose of FLUSH TABLES WITH READ LOCK \n-------------------------------------------\n\nFLUSH TABLES WITH READ LOCK is useful if you want to take a backup of some\ntables. When FLUSH TABLES WITH READ LOCK returns, all write access to tables\nare blocked and all tables are marked as \'properly closed\' on disk. The tables\ncan still be used for read operations.\n\nThe purpose of FLUSH TABLES table_list\n--------------------------------------\n\nFLUSH TABLES table_list is useful if you want to copy a table object/files to\nor from the server. This command puts a lock that stops new users of the table\nand will wait until everyone has stopped using the table. The table is then\nremoved from the table definition and table cache.\n\nNote that it\'s up to the user to ensure that no one is accessing the table\nbetween FLUSH TABLES and the table is copied to or from the server. This can\nbe secured by using LOCK TABLES.\n\nIf there are any tables locked by the connection that is using FLUSH TABLES\nall the locked tables will be closed as part of the flush and reopened and\nrelocked before FLUSH TABLES returns. This allows one to copy the table after\nFLUSH TABLES returns without having any writes on the table. For now this\nworks works with most tables, except InnoDB as InnoDB may do background purges\non the table even while it\'s write locked.\n\nThe purpose of FLUSH TABLES table_list WITH READ LOCK\n-----------------------------------------------------\n\nFLUSH TABLES table_list WITH READ LOCK should work as FLUSH TABLES WITH READ\nLOCK, but only those tables that are listed will be properly closed. However\nin practice this works exactly like FLUSH TABLES WITH READ LOCK as the FLUSH\ncommand has anyway to wait for all WRITE operations to end because we are\ndepending on a global read lock for this code. In the future we should\nconsider fixing this to instead use meta data locks.\n\nImplementation of FLUSH TABLES commands in MariaDB 10.4.8 and above\n-------------------------------------------------------------------\n\nImplementation of FLUSH TABLES\n------------------------------\n\n* Free memory and file descriptors not in use\n\nImplementation of FLUSH TABLES WITH READ LOCK\n---------------------------------------------\n\n* Lock all tables read only for simple old style backup.\n* All background writes are suspended and tables are marked as closed.\n* No statement requiring table changes are allowed for any user until UNLOCK\nTABLES.\n\nInstead of using FLUSH TABLE WITH READ LOCK one should in most cases instead\nuse BACKUP STAGE BLOCK_COMMIT.\n\nImplementation of FLUSH TABLES table_list\n-----------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list.\n* Lock given tables as read only.\n* Wait until all translations has ended that uses any of the given tables.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n\nImplementation of FLUSH TABLES table_list FOR EXPORT\n----------------------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list\n* Lock given tables as read.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n* Check that all tables supports FOR EXPORT\n* No changes to these tables allowed until UNLOCK TABLES\n\nThis is basically the same behavior as in old MariaDB version if one first\nlock the tables, then do FLUSH TABLES. The tables will be copyable until\nUNLOCK TABLES.\n\nFLUSH SSL\n---------\n\nMariaDB starting with 10.4\n--------------------------\nThe FLUSH SSL command was first added in MariaDB 10.4.\n\nIn MariaDB 10.4 and later, the FLUSH SSL command can be used to dynamically\nreinitialize the server\'s TLS context. This is most useful if you need to\nreplace a certificate that is about to expire without restarting the server.\n\nThis operation is performed by reloading the files defined by the following\nTLS system variables:\n\n* ssl_cert\n* ssl_key\n* ssl_ca\n* ssl_capath\n* ssl_crl\n* ssl_crlpath\n\nThese TLS system variables are not dynamic, so their values can not be changed\nwithout restarting the server.\n\nIf you want to dynamically reinitialize the server\'s TLS context, then you\nneed to change the certificate and key files at the relevant paths defined by\nthese TLS system variables, without actually changing the values of the\nvariables. See MDEV-19341 for more information.\n\nReducing Memory Usage\n---------------------\n\nTo flush some of the global caches that take up memory, you could execute the\nfollowing command:\n\nFLUSH LOCAL HOSTS,\n QUERY CACHE,\n TABLE_STATISTICS,\n INDEX_STATISTICS,\n USER_STATISTICS;\n\nURL: https://mariadb.com/kb/en/flush/','','https://mariadb.com/kb/en/flush/'),
(346,'FLUSH QUERY CACHE',26,'Description\n-----------\n\nYou can defragment the query cache to better utilize its memory with the FLUSH\nQUERY CACHE statement. The statement does not remove any queries from the\ncache.\n\nThe RESET QUERY CACHE statement removes all query results from the query\ncache. The FLUSH TABLES statement also does this.\n\nURL: https://mariadb.com/kb/en/flush-query-cache/','','https://mariadb.com/kb/en/flush-query-cache/'),
(189,'VARIANCE',16,'Syntax\n------\n\nVARIANCE(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. This is an extension to\nstandard SQL. The standard SQL function VAR_POP() can be used instead.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVARIANCE() can be used as a window function.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|      1.0000 |\n+-------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n|    200.5000 |\n+-------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         287.1875 |\n| Chun    | Tuning |    73 |         582.0000 |\n| Esben   | SQL    |    43 |         287.1875 |\n| Esben   | Tuning |    31 |         582.0000 |\n| Kaolin  | SQL    |    56 |         287.1875 |\n| Kaolin  | Tuning |    88 |         582.0000 |\n| Tatiana | SQL    |    87 |         287.1875 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/variance/','','https://mariadb.com/kb/en/variance/'),
(190,'VAR_POP',16,'Syntax\n------\n\nVAR_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. It considers rows as the\nwhole population, not as a sample, so it has the number of rows as the\ndenominator. You can also use VARIANCE(), which is equivalent but is not\nstandard SQL.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_POP() can be used as a window function.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|     1.0000 |\n+------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n|   200.5000 |\n+------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         287.1875 |\n| Esben   | SQL    |    43 |         287.1875 |\n| Kaolin  | SQL    |    56 |         287.1875 |\n| Tatiana | SQL    |    87 |         287.1875 |\n| Chun    | Tuning |    73 |         582.0000 |\n| Esben   | Tuning |    31 |         582.0000 |\n| Kaolin  | Tuning |    88 |         582.0000 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/var_pop/','','https://mariadb.com/kb/en/var_pop/'),
(349,'SHOW SLAVE STATUS',26,'Syntax\n------\n\nSHOW SLAVE [\"connection_name\"] STATUS [FOR CHANNEL \"connection_name\"]\nSHOW REPLICA [\"connection_name\"] STATUS -- From MariaDB 10.5.1\n\nor\n\nSHOW ALL SLAVES STATUS\nSHOW ALL REPLICAS STATUS -- From MariaDB 10.5.1\n\nDescription\n-----------\n\nThis statement is to be run on a replica and provides status information on\nessential parameters of the replica threads.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege, or, from\nMariaDB 10.5.9, the REPLICA MONITOR privilege.\n\nMulti-Source\n------------\n\nThe ALL and \"connection_name\" options allow you to connect to many primaries\nat the same time.\n\nALL SLAVES (or ALL REPLICAS from MariaDB 10.5.1) gives you a list of all\nconnections to the primary nodes.\n\nThe rows will be sorted according to Connection_name.\n\nIf you specify a connection_name, you only get the information about that\nconnection. If connection_name is not used, then the name set by\ndefault_master_connection is used. If the connection name doesn\'t exist you\nwill get an error: There is no master connection for \'xxx\'.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nto using the channel_name directly after SHOW SLAVE.\n\nColumn Descriptions\n-------------------\n\n+---------------------+------------------------------------------------------+\n| Name                | Description                                          |\n+---------------------+------------------------------------------------------+\n| Connection_name     | Name of the primary connection. Returned with SHOW   |\n|                     | ALL SLAVES STATUS (or SHOW ALL REPLICAS STATUS from  |\n|                     | MariaDB 10.5.1) only.                                |\n+---------------------+------------------------------------------------------+\n| Slave_SQL_State     | State of SQL thread. Returned with SHOW ALL SLAVES   |\n|                     | STATUS (or SHOW ALL REPLICAS STATUS from MariaDB     |\n|                     | 10.5.1) only. See Slave SQL Thread States.           |\n+---------------------+------------------------------------------------------+\n| Slave_IO_State      | State of I/O thread. See Slave I/O Thread States.    |\n+---------------------+------------------------------------------------------+\n| Master_host         | Master host that the replica is connected to.        |\n+---------------------+------------------------------------------------------+\n| Master_user         | Account user name being used to connect to the       |\n|                     | primary.                                             |\n+---------------------+------------------------------------------------------+\n| Master_port         | The port being used to connect to the primary.       |\n+---------------------+------------------------------------------------------+\n| Connect_Retry       | Time in seconds between retries to connect. The      |\n|                     | default is 60. The CHANGE MASTER TO statement can    |\n|                     | set this. The master-retry-count option determines   |\n|                     | the maximum number of reconnection attempts.         |\n+---------------------+------------------------------------------------------+\n| Master_Log_File     | Name of the primary binary log file that the I/O     |\n|                     | thread is currently reading from.                    |\n+---------------------+------------------------------------------------------+\n| Read_Master_Log_Pos | Position up to which the I/O thread has read in the  |\n|                     | current primary binary log file.                     |\n+---------------------+------------------------------------------------------+\n| Relay_Log_File      | Name of the relay log file that the SQL thread is    |\n|                     | currently processing.                                |\n+---------------------+------------------------------------------------------+\n| Relay_Log_Pos       | Position up to which the SQL thread has finished     |\n|                     | processing in the current relay log file.            |\n+---------------------+------------------------------------------------------+\n| Relay_Master_Log_Fi | Name of the primary binary log file that contains    |\n| e                   | the most recent event executed by the SQL thread.    |\n+---------------------+------------------------------------------------------+\n| Slave_IO_Running    | Whether the replica I/O thread is running and        |\n|                     | connected (Yes), running but not connected to a      |\n|                     | primary (Connecting) or not running (No).            |\n+---------------------+------------------------------------------------------+\n| Slave_SQL_Running   | Whether or not the SQL thread is running.            |\n+---------------------+------------------------------------------------------+\n| Replicate_Rewrite_D | Databases specified for replicating  and rewriting   |\n|                     | with the replicate_rewrite_db option. Added in       |\n|                     | MariaDB 10.11                                        |\n+---------------------+------------------------------------------------------+\n| Replicate_Do_DB     | Databases specified for replicating with the         |\n|                     | replicate_do_db option.                              |\n+---------------------+------------------------------------------------------+\n| Replicate_Ignore_DB | Databases specified for ignoring with the            |\n|                     | replicate_ignore_db option.                          |\n+---------------------+------------------------------------------------------+\n| Replicate_Do_Table  | Tables specified for replicating with the            |\n|                     | replicate_do_table option.                           |\n+---------------------+------------------------------------------------------+\n| Replicate_Ignore_Ta | Tables specified for ignoring with the               |\n| le                  | replicate_ignore_table option.                       |\n+---------------------+------------------------------------------------------+\n| Replicate_Wild_Do_T | Tables specified for replicating with the            |\n| ble                 | replicate_wild_do_table option.                      |\n+---------------------+------------------------------------------------------+\n| Replicate_Wild_Igno | Tables specified for ignoring with the               |\n| e_Table             | replicate_wild_ignore_table option.                  |\n+---------------------+------------------------------------------------------+\n| Last_Errno          | Alias for Last_SQL_Errno (see below)                 |\n+---------------------+------------------------------------------------------+\n| Last Error          | Alias for Last_SQL_Error (see below)                 |\n+---------------------+------------------------------------------------------+\n| Skip_Counter        | Number of events that a replica skips from the       |\n|                     | master, as recorded in the sql_slave_skip_counter    |\n|                     | system variable.                                     |\n+---------------------+------------------------------------------------------+\n| Exec_Master_Log_Pos | Position up to which the SQL thread has processed    |\n|                     | in the current master binary log file. Can be used   |\n|                     | to start a new replica from a current replica with   |\n|                     | the CHANGE MASTER TO ... MASTER_LOG_POS option.      |\n+---------------------+------------------------------------------------------+\n| Relay_Log_Space     | Total size of all relay log files combined.          |\n+---------------------+------------------------------------------------------+\n| Until_Condition     |                                                      |\n+---------------------+------------------------------------------------------+\n| Until_Log_File      | The MASTER_LOG_FILE value of the START SLAVE UNTIL   |\n|                     | condition.                                           |\n+---------------------+------------------------------------------------------+\n| Until_Log_Pos       | The MASTER_LOG_POS value of the START SLAVE UNTIL    |\n|                     | condition.                                           |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Allowed  | Whether an SSL connection is permitted (Yes), not    |\n|                     | permitted (No) or permitted but without the replica  |\n|                     | having SSL support enabled (Ignored)                 |\n+---------------------+------------------------------------------------------+\n| Master_SSL_CA_File  | The MASTER_SSL_CA option of the CHANGE MASTER TO     |\n|                     | statement.                                           |\n+---------------------+------------------------------------------------------+\n| Master_SSL_CA_Path  | The MASTER_SSL_CAPATH option of the CHANGE MASTER    |\n|                     | TO statement.                                        |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Cert     | The MASTER_SSL_CERT option of the CHANGE MASTER TO   |\n|                     | statement.                                           |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Cipher   | The MASTER_SSL_CIPHER option of the CHANGE MASTER    |\n|                     | TO statement.                                        |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Key      | The MASTER_SSL_KEY option of the CHANGE MASTER TO    |\n|                     | statement.                                           |\n+---------------------+------------------------------------------------------+\n| Seconds_Behind_Mast | Difference between the timestamp logged on the       |\n| r                   | master for the event that the replica is currently   |\n|                     | processing, and the current timestamp on the         |\n|                     | replica. Zero if the replica is not currently        |\n|                     | processing an event. With serial replication,        |\n|                     | seconds_behind_master is updated when the SQL        |\n|                     | thread begins executing a transaction. With          |\n|                     | parallel replication, seconds_behind_master is       |\n|                     | updated only after transactions commit. Starting in  |\n|                     | MariaDB 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.8.7,  |\n|                     | 10.9.5, 10.10.3, and 10.11.2, an exception is drawn  |\n|                     | on the parallel replica to additionally update       |\n|                     | seconds_behind_master when the first transaction     |\n|                     | received after idling is queued to a worker for      |\n|                     | execution, to provide a reliable initial value for   |\n|                     | the duration until a transaction commits.            |\n|                     | Additional behaviors to be aware of are as follows:  |\n|                     | 1) Seconds_Behind_Master will update for ignored     |\n|                     | events, e.g. those skipped due to                    |\n|                     | sql_slave_skip_counter. 2) On the serial replica,    |\n|                     | transactions with prior timestamps can update        |\n|                     | Seconds_Behind_Master such that it can go            |\n|                     | backwards, though this is not true for the parallel  |\n|                     | replica. 3) When configured with MASTER_DELAY, as a  |\n|                     | replicated transaction begins executing (i.e. on a   |\n|                     | serial or post-idle parallel replica),               |\n|                     | Seconds_Behind_Master will update before delaying,   |\n|                     | and while delaying occurs will grow to encompass     |\n|                     | the configured value. 4) There is a known issue,     |\n|                     | tracked by MDEV-17516, such that                     |\n|                     | Seconds_Behind_Master will initially present as 0    |\n|                     | on replica restart until a replicated transaction    |\n|                     | begins executing, even if the last replica session   |\n|                     | was lagging behind when stopped.                     |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Verify_S | The MASTER_SSL_VERIFY_SERVER_CERT option of the      |\n| rver_Cert           | CHANGE MASTER TO statement.                          |\n+---------------------+------------------------------------------------------+\n| Last_IO_Errno       | Error code of the most recent error that caused the  |\n|                     | I/O thread to stop (also recorded in the replica\'s   |\n|                     | error log). 0 means no error. RESET SLAVE or RESET   |\n|                     | MASTER will reset this value.                        |\n+---------------------+------------------------------------------------------+\n| Last_IO_Error       | Error message of the most recent error that caused   |\n|                     | the I/O thread to stop (also recorded in the         |\n|                     | replica\'s error log). An empty string means no       |\n|                     | error. RESET SLAVE or RESET MASTER will reset this   |\n|                     | value.                                               |\n+---------------------+------------------------------------------------------+\n| Last_SQL_Errno      | Error code of the most recent error that caused the  |\n|                     | SQL thread to stop (also recorded in the replica\'s   |\n|                     | error log). 0 means no error. RESET SLAVE or RESET   |\n|                     | MASTER will reset this value.                        |\n+---------------------+------------------------------------------------------+\n| Last_SQL_Error      | Error message of the most recent error that caused   |\n|                     | the SQL thread to stop (also recorded in the         |\n|                     | replica\'s error log). An empty string means no       |\n|                     | error. RESET SLAVE or RESET MASTER will reset this   |\n|                     | value.                                               |\n+---------------------+------------------------------------------------------+\n| Replicate_Ignore_Se | List of server_ids that are currently being ignored  |\n| ver_Ids             | for replication purposes, or an empty string for     |\n|                     | none, as specified in the IGNORE_SERVER_IDS option   |\n|                     | of the CHANGE MASTER TO statement.                   |\n+---------------------+------------------------------------------------------+\n| Master_Server_Id    | The master\'s server_id value.                        |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Crl      | The MASTER_SSL_CRL option of the CHANGE MASTER TO    |\n|                     | statement.                                           |\n+---------------------+------------------------------------------------------+\n| Master_SSL_Crlpath  | The MASTER_SSL_CRLPATH option of the CHANGE MASTER   |\n|                     | TO statement.                                        |\n+---------------------+------------------------------------------------------+\n| Using_Gtid          | Whether or not global transaction ID\'s are being     |\n|                     | used for replication (can be No, Slave_Pos, or       |\n|                     | Current_Pos).                                        |\n+---------------------+------------------------------------------------------+\n| Gtid_IO_Pos         | Current global transaction ID value.                 |\n+---------------------+------------------------------------------------------+\n| Retried_transaction | Number of retried transactions for this connection.  |\n|                     | Returned with SHOW ALL SLAVES STATUS only.           |\n+---------------------+------------------------------------------------------+\n| Max_relay_log_size  | Max relay log size for this connection. Returned     |\n|                     | with SHOW ALL SLAVES STATUS only.                    |\n+---------------------+------------------------------------------------------+\n| Executed_log_entrie | How many log entries the replica has executed.       |\n|                     | Returned with SHOW ALL SLAVES STATUS only.           |\n+---------------------+------------------------------------------------------+\n| Slave_received_hear | How many heartbeats we have got from the master.     |\n| beats               | Returned with SHOW ALL SLAVES STATUS only.           |\n+---------------------+------------------------------------------------------+\n| Slave_heartbeat_per | How often to request a heartbeat packet from the     |\n| od                  | master (in seconds). Returned with SHOW ALL SLAVES   |\n|                     | STATUS only.                                         |\n+---------------------+------------------------------------------------------+\n| Gtid_Slave_Pos      | GTID of the last event group replicated on a         |\n|                     | replica server, for each replication domain, as      |\n|                     | stored in the gtid_slave_pos system variable.        |\n|                     | Returned with SHOW ALL SLAVES STATUS only.           |\n+---------------------+------------------------------------------------------+\n| SQL_Delay           | Value specified by MASTER_DELAY in CHANGE MASTER     |\n|                     | (or 0 if none).                                      |\n+---------------------+------------------------------------------------------+\n| SQL_Remaining_Delay | When the replica is delaying the execution of an     |\n|                     | event due to MASTER_DELAY, this is the number of     |\n|                     | seconds of delay remaining before the event will be  |\n|                     | applied. Otherwise, the value is NULL.               |\n+---------------------+------------------------------------------------------+\n| Slave_SQL_Running_S | The state of the SQL driver threads, same as in      |\n| ate                 | SHOW PROCESSLIST. When the replica is delaying the   |\n|                     | execution of an event due to MASTER_DELAY, this      |\n|                     | field displays: \"Waiting until MASTER_DELAY seconds  |\n|                     | after master executed event\".                        |\n+---------------------+------------------------------------------------------+\n| Slave_DDL_Groups    | This status variable counts the occurrence of DDL    |\n|                     | statements.  This is a replica-side counter for      |\n|                     | optimistic parallel replication.                     |\n+---------------------+------------------------------------------------------+\n| Slave_Non_Transacti | This status variable counts the occurrence of        |\n| nal_Groups          | non-transactional event groups.  This is a           |\n|                     | replica-side counter for optimistic parallel         |\n|                     | replication.                                         |\n+---------------------+------------------------------------------------------+\n| Slave_Transactional | This status variable counts the occurrence of        |\n| Groups              | transactional event groups.  This is a replica-side  |\n|                     | counter for optimistic parallel replication.         |\n+---------------------+------------------------------------------------------+\n\nSHOW REPLICA STATUS\n-------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA STATUS is an alias for SHOW SLAVE STATUS from MariaDB 10.5.1.\n\nExamples\n--------\n\nIf you issue this statement using the mariadb client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout.\n\nSHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n       Slave_IO_State: Waiting for master to send event\n         Master_Host: db01.example.com\n         Master_User: replicant\n         Master_Port: 3306\n        Connect_Retry: 60\n       Master_Log_File: mariadb-bin.000010\n     Read_Master_Log_Pos: 548\n       Relay_Log_File: relay-bin.000004\n        Relay_Log_Pos: 837\n    Relay_Master_Log_File: mariadb-bin.000010\n      Slave_IO_Running: Yes\n      Slave_SQL_Running: Yes\n       Replicate_Do_DB:\n     Replicate_Ignore_DB:\n     Replicate_Do_Table:\n   Replicate_Ignore_Table:\n   Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n         Last_Errno: 0\n         Last_Error:\n        Skip_Counter: 0\n     Exec_Master_Log_Pos: 548\n       Relay_Log_Space: 1497\n       Until_Condition: None\n       Until_Log_File:\n        Until_Log_Pos: 0\n     Master_SSL_Allowed: No\n     Master_SSL_CA_File:\n     Master_SSL_CA_Path:\n       Master_SSL_Cert:\n      Master_SSL_Cipher:\n       Master_SSL_Key:\n    Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n        Last_IO_Errno: 0\n        Last_IO_Error:\n       Last_SQL_Errno: 0\n       Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n      Master_Server_Id: 101\n       Master_SSL_Crl:\n     Master_SSL_Crlpath:\n         Using_Gtid: No\n         Gtid_IO_Pos:\n\nSHOW ALL SLAVES STATUS\\G\n*************************** 1. row ***************************\n       Connection_name:\n       Slave_SQL_State: Slave has read all relay log; waiting for the\nslave I/O thread to update it\n       Slave_IO_State: Waiting for master to send event\n         Master_Host: db01.example.com\n         Master_User: replicant\n         Master_Port: 3306\n        Connect_Retry: 60\n       Master_Log_File: mariadb-bin.000010\n     Read_Master_Log_Pos: 3608\n       Relay_Log_File: relay-bin.000004\n        Relay_Log_Pos: 3897\n    Relay_Master_Log_File: mariadb-bin.000010\n      Slave_IO_Running: Yes\n      Slave_SQL_Running: Yes\n       Replicate_Do_DB:\n     Replicate_Ignore_DB:\n     Replicate_Do_Table:\n   Replicate_Ignore_Table:\n   Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n         Last_Errno: 0\n         Last_Error:\n        Skip_Counter: 0\n     Exec_Master_Log_Pos: 3608\n       Relay_Log_Space: 4557\n       Until_Condition: None\n       Until_Log_File:\n        Until_Log_Pos: 0\n     Master_SSL_Allowed: No\n     Master_SSL_CA_File:\n     Master_SSL_CA_Path:\n       Master_SSL_Cert:\n      Master_SSL_Cipher:\n       Master_SSL_Key:\n    Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n        Last_IO_Errno: 0\n        Last_IO_Error:\n       Last_SQL_Errno: 0\n       Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n      Master_Server_Id: 101\n       Master_SSL_Crl:\n     Master_SSL_Crlpath:\n         Using_Gtid: No\n         Gtid_IO_Pos:\n    Retried_transactions: 0\n     Max_relay_log_size: 104857600\n    Executed_log_entries: 40\n  Slave_received_heartbeats: 11\n   Slave_heartbeat_period: 1800.000\n       Gtid_Slave_Pos: 0-101-2320\n\nYou can also access some of the variables directly from status variables:\n\nSET @@default_master_connection=\"test\" ;\nshow status like \"%slave%\"\n\nVariable_name   Value\nCom_show_slave_hosts    0\nCom_show_slave_status   0\nCom_start_all_slaves    0\nCom_start_slave 0\nCom_stop_all_slaves     0\nCom_stop_slave  0\nRpl_semi_sync_slave_status      OFF\nSlave_connections       0\nSlave_heartbeat_period  1800.000\nSlave_open_temp_tables  0\nSlave_received_heartbeats       0\nSlave_retried_transactions      0\nSlave_running   OFF\nSlaves_connected        0\nSlaves_running  1\n\nURL: https://mariadb.com/kb/en/show-replica-status/','','https://mariadb.com/kb/en/show-replica-status/'),
(357,'SET SQL_LOG_BIN',26,'Syntax\n------\n\nSET [SESSION] sql_log_bin = {0|1}\n\nDescription\n-----------\n\nSets the sql_log_bin system variable, which disables or enables binary logging\nfor the current connection, if the client has the SUPER privilege. The\nstatement is refused with an error if the client does not have that privilege.\n\nBefore MariaDB 5.5 and before MySQL 5.6 one could also set sql_log_bin as a\nglobal variable. This was disabled as this was too dangerous as it could\ndamage replication.\n\nURL: https://mariadb.com/kb/en/set-sql_log_bin/','','https://mariadb.com/kb/en/set-sql_log_bin/'),
(393,'SHOW PROFILES',26,'Syntax\n------\n\nSHOW PROFILES\n\nDescription\n-----------\n\nThe SHOW PROFILES statement displays profiling information that indicates\nresource usage for statements executed during the course of the current\nsession. It is used together with SHOW PROFILE.\n\nURL: https://mariadb.com/kb/en/show-profiles/','','https://mariadb.com/kb/en/show-profiles/'),
(394,'SHOW QUERY_RESPONSE_TIME',26,'It is possible to use SHOW QUERY_RESPONSE_TIME as an alternative for\nretrieving information from the QUERY_RESPONSE_TIME plugin.\n\nThis was introduced as part of the Information Schema plugin extension.\n\nURL: https://mariadb.com/kb/en/show-query_response_time/','','https://mariadb.com/kb/en/show-query_response_time/'),
(405,'BINLOG',26,'Syntax\n------\n\nBINLOG \'str\'\n\nDescription\n-----------\n\nBINLOG is an internal-use statement. It is generated by the mariadb-binlog\nprogram as the printable representation of certain events in binary log files.\nThe \'str\' value is a base 64-encoded string that the server decodes to\ndetermine the data change indicated by the corresponding event. This statement\nrequires the SUPER privilege (<= MariaDB 10.5.1) or the BINLOG REPLAY\nprivilege (>= MariaDB 10.5.2).\n\nURL: https://mariadb.com/kb/en/binlog/','','https://mariadb.com/kb/en/binlog/'),
(410,'LOAD INDEX',26,'Syntax\n------\n\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n  [[INDEX|KEY] (index_name[, index_name] ...)]\n  [IGNORE LEAVES]\n\nDescription\n-----------\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key cache\nto which it has been assigned by an explicit CACHE INDEX statement, or into\nthe default key cache otherwise. LOAD INDEX INTO CACHE is used only for MyISAM\nor Aria tables.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of the\nindex to be preloaded.\n\nURL: https://mariadb.com/kb/en/load-index/','','https://mariadb.com/kb/en/load-index/'),
(191,'VAR_SAMP',16,'Syntax\n------\n\nVAR_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample variance of expr. That is, the denominator is the number of\nrows minus one.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nVAR_SAMP() can be used as a window function.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a        |        0.8165 |         1.0000 |     0.6667 |\n| b        |       18.0400 |        20.1693 |   325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_SAMP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name    | test   | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun    | SQL    |    75 |         382.9167 |\n| Chun    | Tuning |    73 |         873.0000 |\n| Esben   | SQL    |    43 |         382.9167 |\n| Esben   | Tuning |    31 |         873.0000 |\n| Kaolin  | SQL    |    56 |         382.9167 |\n| Kaolin  | Tuning |    88 |         873.0000 |\n| Tatiana | SQL    |    87 |         382.9167 |\n+---------+--------+-------+------------------+\n\nURL: https://mariadb.com/kb/en/var_samp/','','https://mariadb.com/kb/en/var_samp/'),
(194,'CHARSET',17,'Syntax\n------\n\nCHARSET(str)\n\nDescription\n-----------\n\nReturns the character set of the string argument. If str is not a string, it\nis considered as a binary string (so the function returns \'binary\'). This\napplies to NULL, too. The return value is a string in the utf8 character set.\n\nExamples\n--------\n\nSELECT CHARSET(\'abc\');\n+----------------+\n| CHARSET(\'abc\') |\n+----------------+\n| latin1         |\n+----------------+\n\nSELECT CHARSET(CONVERT(\'abc\' USING utf8));\n+------------------------------------+\n| CHARSET(CONVERT(\'abc\' USING utf8)) |\n+------------------------------------+\n| utf8                               |\n+------------------------------------+\n\nSELECT CHARSET(USER());\n+-----------------+\n| CHARSET(USER()) |\n+-----------------+\n| utf8            |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/charset/','','https://mariadb.com/kb/en/charset/'),
(195,'COERCIBILITY',17,'Syntax\n------\n\nCOERCIBILITY(str)\n\nDescription\n-----------\n\nReturns the collation coercibility value of the string argument. Coercibility\ndefines what will be converted to what in case of collation conflict, with an\nexpression with higher coercibility being converted to the collation of an\nexpression with lower coercibility.\n\n+-----------------------------+---------------------------+------------------+\n| Coercibility                | Description               | Example          |\n+-----------------------------+---------------------------+------------------+\n| 0                           | Explicit                  | Value using a    |\n|                             |                           | COLLATE clause   |\n+-----------------------------+---------------------------+------------------+\n| 1                           | No collation              | Concatenated     |\n|                             |                           | strings using    |\n|                             |                           | different        |\n|                             |                           | collations       |\n+-----------------------------+---------------------------+------------------+\n| 2                           | Implicit                  | Column value     |\n+-----------------------------+---------------------------+------------------+\n| 3                           | Constant                  | USER() return    |\n|                             |                           | value            |\n+-----------------------------+---------------------------+------------------+\n| 4                           | Coercible                 | Literal string   |\n+-----------------------------+---------------------------+------------------+\n| 5                           | Ignorable                 | NULL or derived  |\n|                             |                           | from NULL        |\n+-----------------------------+---------------------------+------------------+\n\nExamples\n--------\n\nSELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n+-----------------------------------------------+\n| COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci) |\n+-----------------------------------------------+\n|                                             0 |\n+-----------------------------------------------+\n\nSELECT COERCIBILITY(USER());\n+----------------------+\n| COERCIBILITY(USER()) |\n+----------------------+\n|                    3 |\n+----------------------+\n\nSELECT COERCIBILITY(\'abc\');\n+---------------------+\n| COERCIBILITY(\'abc\') |\n+---------------------+\n|                   4 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/coercibility/','','https://mariadb.com/kb/en/coercibility/'),
(414,'SHOW FUNCTION CODE',26,'Syntax\n------\n\nSHOW FUNCTION CODE func_name\n\nDescription\n-----------\n\nSHOW FUNCTION CODE shows a representation of the internal implementation of\nthe stored function.\n\nIt is similar to SHOW PROCEDURE CODE but for stored functions.\n\nURL: https://mariadb.com/kb/en/show-function-code/','','https://mariadb.com/kb/en/show-function-code/'),
(444,'LOCK IN SHARE MODE',27,'InnoDB supports row-level locking. Selected rows can be locked using LOCK IN\nSHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the rows read\nby the query, and it will be released when the current transaction is\ncommitted.\n\nWhen LOCK IN SHARE MODE is specified in a SELECT statement, MariaDB will wait\nuntil all transactions that have modified the rows are committed. Then, a\nwrite lock is acquired. All transactions can read the rows, but if they want\nto modify them, they have to wait until your transaction is committed.\n\nIf autocommit is set to 1 (the default), the LOCK IN SHARE MODE and FOR UPDATE\nclauses have no effect.\n\nURL: https://mariadb.com/kb/en/lock-in-share-mode/','','https://mariadb.com/kb/en/lock-in-share-mode/'),
(446,'PROCEDURE',27,'The PROCEDURE clause of SELECT passes the whole result set to a Procedure\nwhich will process it. These Procedures are not Stored Procedures, and can\nonly be written in the C language, so it is necessary to recompile the server.\n\nCurrently, the only available procedure is ANALYSE, which examines the\nresultset and suggests the optimal datatypes for each column. It is defined in\nthe sql/sql_analyse.cc file, and can be used as an example to create more\nProcedures.\n\nThis clause cannot be used in a view\'s definition.\n\nURL: https://mariadb.com/kb/en/procedure/','','https://mariadb.com/kb/en/procedure/'),
(198,'CURRENT_ROLE',17,'Syntax\n------\n\nCURRENT_ROLE, CURRENT_ROLE()\n\nDescription\n-----------\n\nReturns the current role name. This determines your access privileges. The\nreturn value is a string in the utf8 character set.\n\nIf there is no current role, NULL is returned.\n\nThe output of SELECT CURRENT_ROLE is equivalent to the contents of the\nENABLED_ROLES Information Schema table.\n\nUSER() returns the combination of user and host used to login. CURRENT_USER()\nreturns the account used to determine current connection\'s privileges.\n\nExamples\n--------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL         |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff        |\n+--------------+\n\nURL: https://mariadb.com/kb/en/current_role/','','https://mariadb.com/kb/en/current_role/'),
(199,'CURRENT_USER',17,'Syntax\n------\n\nCURRENT_USER, CURRENT_USER()\n\nDescription\n-----------\n\nReturns the user name and host name combination for the MariaDB account that\nthe server used to authenticate the current client. This account determines\nyour access privileges. The return value is a string in the utf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\nCURRENT_ROLE() returns the current active role.\n\nExamples\n--------\n\nshell> mysql --user=\"anonymous\"\n\nselect user(),current_user();\n+---------------------+----------------+\n| user()              | current_user() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost     |\n+---------------------+----------------+\n\nWhen calling CURRENT_USER() in a stored procedure, it returns the owner of the\nstored procedure, as defined with DEFINER.\n\nURL: https://mariadb.com/kb/en/current_user/','','https://mariadb.com/kb/en/current_user/'),
(200,'DATABASE',17,'Syntax\n------\n\nDATABASE()\nSCHEMA()\n\nDescription\n-----------\n\nReturns the default (current) database name as a string in the utf8 character\nset. If there is no default database, DATABASE() returns NULL. Within a stored\nroutine, the default database is the database that the routine is associated\nwith, which is not necessarily the same as the database that is the default in\nthe calling context.\n\nSCHEMA() is a synonym for DATABASE().\n\nTo select a default database, the USE statement can be run. Another way to set\nthe default database is specifying its name at mariadb command line client\nstartup.\n\nExamples\n--------\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| NULL       |\n+------------+\n\nUSE test;\nDatabase changed\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| test       |\n+------------+\n\nURL: https://mariadb.com/kb/en/database/','','https://mariadb.com/kb/en/database/'),
(203,'FOUND_ROWS',17,'Syntax\n------\n\nFOUND_ROWS()\n\nDescription\n-----------\n\nA SELECT statement may include a LIMIT clause to restrict the number of rows\nthe server returns to the client. In some cases, it is desirable to know how\nmany rows the statement would have returned without the LIMIT, but without\nrunning the statement again. To obtain this row count, include a\nSQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke\nFOUND_ROWS() afterwards.\n\nYou can also use FOUND_ROWS() to obtain the number of rows returned by a\nSELECT which does not contain a LIMIT clause. In this case you don\'t need to\nuse the SQL_CALC_FOUND_ROWS option. This can be useful for example in a stored\nprocedure.\n\nAlso, this function works with some other statements which return a resultset,\nincluding SHOW, DESC and HELP. For DELETE ... RETURNING you should use\nROW_COUNT(). It also works as a prepared statement, or after executing a\nprepared statement.\n\nStatements which don\'t return any results don\'t affect FOUND_ROWS() - the\nprevious value will still be returned.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows selected by the last query in the procedure, not by the whole procedure.\n\nStatements using the FOUND_ROWS() function are not safe for replication.\n\nExamples\n--------\n\nSHOW ENGINES\\G\n*************************** 1. row ***************************\n   Engine: CSV\n  Support: YES\n  Comment: Stores tables as CSV files\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 2. row ***************************\n   Engine: MRG_MyISAM\n  Support: YES\n  Comment: Collection of identical MyISAM tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n\n...\n\n*************************** 8. row ***************************\n   Engine: PERFORMANCE_SCHEMA\n  Support: YES\n  Comment: Performance Schema\nTransactions: NO\n     XA: NO\n Savepoints: NO\n8 rows in set (0.000 sec)\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n|           8 |\n+--------------+\n\nSELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10;\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n|           23 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/found_rows/','','https://mariadb.com/kb/en/found_rows/'),
(447,'DUAL',27,'Description\n-----------\n\nYou are allowed to specify DUAL as a dummy table name in situations where no\ntables are referenced, such as the following SELECT statement:\n\nSELECT 1 + 1 FROM DUAL;\n+-------+\n| 1 + 1 |\n+-------+\n|     2 |\n+-------+\n\nDUAL is purely for the convenience of people who require that all SELECT\nstatements should have FROM and possibly other clauses. MariaDB ignores the\nclauses. MariaDB does not require FROM DUAL if no tables are referenced.\n\nFROM DUAL could be used when you only SELECT computed values, but require a\nWHERE clause, perhaps to test that a script correctly handles empty resultsets:\n\nSELECT 1 FROM DUAL WHERE FALSE;\nEmpty set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/dual/','','https://mariadb.com/kb/en/dual/'),
(452,'LOAD DATA INFILE',27,'Syntax\n------\n\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n  [REPLACE | IGNORE]\n  INTO TABLE tbl_name\n  [CHARACTER SET charset_name]\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\n  [IGNORE number {LINES|ROWS}]\n  [(col_name_or_user_var,...)]\n  [SET col_name = expr,...]\n\nDescription\n-----------\n\nLOAD DATA INFILE is unsafe for statement-based replication.\n\nReads rows from a text file into the designated table on the database at a\nvery high speed. The file name must be given as a literal string.\n\nFiles are written to disk using the SELECT INTO OUTFILE statement. You can\nthen read the files back into a table using the LOAD DATA INFILE statement.\nThe FIELDS and LINES clauses are the same in both statements. These clauses\nare optional, but if both are specified then the FIELDS clause must precede\nLINES.\n\nExecuting this statement activates INSERT triggers.\n\nOne must have the FILE privilege to be able to execute LOAD DATA INFILE. This\nis to ensure normal users cannot read system files. LOAD DATA LOCAL INFILE\ndoes not have this requirement.\n\nIf the secure_file_priv system variable is set (by default it is not), the\nloaded file must be present in the specified directory.\n\nNote that MariaDB\'s systemd unit file restricts access to /home, /root, and\n/run/user by default. See Configuring access to home directories.\n\nLOAD DATA LOCAL INFILE\n----------------------\n\nWhen you execute the LOAD DATA INFILE statement, MariaDB Server attempts to\nread the input file from its own file system. By contrast, when you execute\nthe LOAD DATA LOCAL INFILE statement, the client attempts to read the input\nfile from its file system, and it sends the contents of the input file to the\nMariaDB Server. This allows you to load files from the client\'s local file\nsystem into the database.\n\nIf you don\'t want to permit this operation (perhaps for security reasons), you\ncan disable the LOAD DATA LOCAL INFILE statement on either the server or the\nclient.\n\n* The LOAD DATA LOCAL INFILE statement can be disabled on the server by\nsetting the local_infile system variable to 0.\n* The LOAD DATA LOCAL INFILE statement can be disabled on the client. If you\nare using MariaDB Connector/C, this can be done by unsetting the\nCLIENT_LOCAL_FILES capability flag with the mysql_real_connect function or by\nunsetting the MYSQL_OPT_LOCAL_INFILE option with mysql_optionsv function. If\nyou are using a different client or client library, then see the documentation\nfor your specific client or client library to determine how it handles the\nLOAD DATA LOCAL INFILE statement.\n\nIf the LOAD DATA LOCAL INFILE statement is disabled by either the server or\nthe client and if the user attempts to execute it, then the server will cause\nthe statement to fail with the following error message:\n\nThe used command is not allowed with this MariaDB version\n\nNote that it is not entirely accurate to say that the MariaDB version does not\nsupport the command. It would be more accurate to say that the MariaDB\nconfiguration does not support the command. See MDEV-20500 for more\ninformation.\n\nFrom MariaDB 10.5.2, the error message is more accurate:\n\nThe used command is not allowed because the MariaDB server or client \n has disabled the local infile capability\n\nREPLACE and IGNORE\n------------------\n\nIf you load data from a file into a table that already contains data and has a\nprimary key, you may encounter issues where the statement attempts to insert a\nrow with a primary key that already exists. When this happens, the statement\nfails with Error 1064, protecting the data already on the table. If you want\nMariaDB to overwrite duplicates, use the REPLACE keyword.\n\nThe REPLACE keyword works like the REPLACE statement. Here, the statement\nattempts to load the data from the file. If the row does not exist, it adds it\nto the table. If the row contains an existing primary key, it replaces the\ntable data. That is, in the event of a conflict, it assumes the file contains\nthe desired row.\n\nThis operation can cause a degradation in load speed by a factor of 20 or more\nif the part that has already been loaded is larger than the capacity of the\nInnoDB Buffer Pool. This happens because it causes a lot of turnaround in the\nbuffer pool.\n\nUse the IGNORE keyword when you want to skip any rows that contain a\nconflicting primary key. Here, the statement attempts to load the data from\nthe file. If the row does not exist, it adds it to the table. If the row\ncontains an existing primary key, it ignores the addition request and moves on\nto the next. That is, in the event of a conflict, it assumes the table\ncontains the desired row.\n\nCharacter-sets\n--------------\n\nWhen the statement opens the file, it attempts to read the contents using the\ndefault character-set, as defined by the character_set_database system\nvariable.\n\nIn the cases where the file was written using a character-set other than the\ndefault, you can specify the character-set to use with the CHARACTER SET\nclause in the statement. It ignores character-sets specified by the SET NAMES\nstatement and by the character_set_client system variable. Setting the\nCHARACTER SET clause to a value of binary indicates \"no conversion.\"\n\nThe statement interprets all fields in the file as having the same\ncharacter-set, regardless of the column data type. To properly interpret file\ncontents, you must ensure that it was written with the correct character-set.\nIf you write a data file with mariadb-dump -T or with the SELECT INTO OUTFILE\nstatement with the mariadb client, be sure to use the --default-character-set\noption, so that the output is written with the desired character-set.\n\nWhen using mixed character sets, use the CHARACTER SET clause in both SELECT\nINTO OUTFILE and LOAD DATA INFILE to ensure that MariaDB correctly interprets\nthe escape sequences.\n\nThe character_set_filesystem system variable controls the interpretation of\nthe filename.\n\nIt is currently not possible to load data files that use the ucs2 character\nset.\n\nPreprocessing Inputs\n--------------------\n\ncol_name_or_user_var can be a column name, or a user variable. In the case of\na variable, the SET statement can be used to preprocess the value before\nloading into the table.\n\nPriority and Concurrency\n------------------------\n\nIn storage engines that perform table-level locking (MyISAM, MEMORY and\nMERGE), using the LOW_PRIORITY keyword, MariaDB delays insertions until no\nother clients are reading from the table. Alternatively, when using the MyISAM\nstorage engine, you can use the CONCURRENT keyword to perform concurrent\ninsertion.\n\nThe LOW_PRIORITY and CONCURRENT keywords are mutually exclusive. They cannot\nbe used in the same statement.\n\nProgress Reporting\n------------------\n\nThe LOAD DATA INFILE statement supports progress reporting. You may find this\nuseful when dealing with long-running operations. Using another client you can\nissue a SHOW PROCESSLIST query to check the progress of the data load.\n\nUsing mariadb-import\n--------------------\n\nMariaDB ships with a separate utility for loading data from files:\nmariadb-import (or mysqlimport before MariaDB 10.5). It operates by sending\nLOAD DATA INFILE statements to the server.\n\nUsing mariadb-import you can compress the file using the --compress option, to\nget better performance over slow networks, providing both the client and\nserver support the compressed protocol. Use the --local option to load from\nthe local file system.\n\nIndexing\n--------\n\nIn cases where the storage engine supports ALTER TABLE... DISABLE KEYS\nstatements (MyISAM and Aria), the LOAD DATA INFILE statement automatically\ndisables indexes during the execution.\n\nExamples\n--------\n\nYou have a file with this content (note the the separator is \',\', not tab,\nwhich is the default):\n\n2,2\n3,3\n4,4\n5,5\n6,8\n\nCREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY (a));\nLOAD DATA LOCAL INFILE \n \'/tmp/loaddata7.dat\' INTO TABLE t1 FIELDS TERMINATED BY \',\' (a,b) SET c=a+b;\nSELECT * FROM t1;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|    2 |    2 |    4 |\n|    3 |    3 |    6 |\n|    4 |    4 |    8 |\n|    5 |    5 |   10 |\n|    6 |    8 |   14 |\n+------+------+------+\n\nAnother example, given the following data (the separator is a tab):\n\n1       a\n2       b\n\nThe value of the first column is doubled before loading:\n\nLOAD DATA INFILE \'ld.txt\' INTO TABLE ld (@i,v) SET i=@i*2;\n\nSELECT * FROM ld;\n+------+------+\n| i    | v    |\n+------+------+\n|    2 | a    |\n|    4 | b    |\n+------+------+\n\nURL: https://mariadb.com/kb/en/load-data-infile/','','https://mariadb.com/kb/en/load-data-infile/'),
(462,'DO',27,'Syntax\n------\n\nDO expr [, expr] ...\n\nDescription\n-----------\n\nDO executes the expressions but does not return any results. In most respects,\nDO is shorthand for SELECT expr, ..., but has the advantage that it is\nslightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nURL: https://mariadb.com/kb/en/do/','','https://mariadb.com/kb/en/do/'),
(466,'Useful MariaDB Queries',27,'This page is intended to be a quick reference of commonly-used and/or useful\nqueries in MariaDB.\n\nCreating a Table\n----------------\n\nCREATE TABLE t1 ( a INT );\nCREATE TABLE t2 ( b INT );\nCREATE TABLE student_tests (\n name CHAR(10), test CHAR(10), \n score TINYINT, test_date DATE\n);\n\nSee CREATE TABLE for more.\n\nInserting Records\n-----------------\n\nINSERT INTO t1 VALUES (1), (2), (3);\nINSERT INTO t2 VALUES (2), (4);\n\nINSERT INTO student_tests \n (name, test, score, test_date) VALUES\n (\'Chun\', \'SQL\', 75, \'2012-11-05\'), \n (\'Chun\', \'Tuning\', 73, \'2013-06-14\'),\n (\'Esben\', \'SQL\', 43, \'2014-02-11\'), \n (\'Esben\', \'Tuning\', 31, \'2014-02-09\'), \n (\'Kaolin\', \'SQL\', 56, \'2014-01-01\'),\n (\'Kaolin\', \'Tuning\', 88, \'2013-12-29\'), \n (\'Tatiana\', \'SQL\', 87, \'2012-04-28\'), \n (\'Tatiana\', \'Tuning\', 83, \'2013-09-30\');\n\nSee INSERT for more.\n\nUsing AUTO_INCREMENT\n--------------------\n\nThe AUTO_INCREMENT attribute is used to automatically generate a unique\nidentity for new rows.\n\nCREATE TABLE student_details (\n id INT NOT NULL AUTO_INCREMENT, name CHAR(10), \n date_of_birth DATE, PRIMARY KEY (id)\n);\n\nWhen inserting, the id field can be omitted, and is automatically created.\n\nINSERT INTO student_details (name,date_of_birth) VALUES \n (\'Chun\', \'1993-12-31\'), \n (\'Esben\',\'1946-01-01\'),\n (\'Kaolin\',\'1996-07-16\'),\n (\'Tatiana\', \'1988-04-13\');\n\nSELECT * FROM student_details;\n+----+---------+---------------+\n| id | name    | date_of_birth |\n+----+---------+---------------+\n|  1 | Chun    | 1993-12-31    |\n|  2 | Esben   | 1946-01-01    |\n|  3 | Kaolin  | 1996-07-16    |\n|  4 | Tatiana | 1988-04-13    |\n+----+---------+---------------+\n\nSee AUTO_INCREMENT for more.\n\nQuerying from two tables on a common value\n------------------------------------------\n\nSELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.b;\n\nThis kind of query is called a join - see JOINS for more.\n\nFinding the Maximum Value\n-------------------------\n\nSELECT MAX(a) FROM t1;\n+--------+\n| MAX(a) |\n+--------+\n|      3 |\n+--------+\n\nSee the MAX() function for more, as well as Finding the maximum value and\ngrouping the results below for a more practical example.\n\nFinding the Minimum Value\n-------------------------\n\nSELECT MIN(a) FROM t1;\n+--------+\n| MIN(a) |\n+--------+\n|      1 |\n+--------+\n\nSee the MIN() function for more.\n\nFinding the Average Value\n-------------------------\n\nSELECT AVG(a) FROM t1;\n+--------+\n| AVG(a) |\n+--------+\n| 2.0000 |\n+--------+\n\nSee the AVG() function for more.\n\nFinding the Maximum Value and Grouping the Results\n--------------------------------------------------\n\nSELECT name, MAX(score) FROM student_tests GROUP BY name;\n+---------+------------+\n| name    | MAX(score) |\n+---------+------------+\n| Chun    |         75 |\n| Esben   |         43 |\n| Kaolin  |         88 |\n| Tatiana |         87 |\n+---------+------------+\n\nSee the MAX() function for more.\n\nOrdering Results\n----------------\n\nSELECT name, test, score FROM student_tests ORDER BY score DESC;\n+---------+--------+-------+\n| name    | test   | score |\n+---------+--------+-------+\n| Kaolin  | Tuning |    88 |\n| Tatiana | SQL    |    87 |\n| Tatiana | Tuning |    83 |\n| Chun    | SQL    |    75 |\n| Chun    | Tuning |    73 |\n| Kaolin  | SQL    |    56 |\n| Esben   | SQL    |    43 |\n| Esben   | Tuning |    31 |\n+---------+--------+-------+\n\nSee ORDER BY for more.\n\nFinding the Row with the Minimum of a Particular Column\n-------------------------------------------------------\n\nIn this example, we want to find the lowest test score for any student.\n\nSELECT name,test, score FROM student_tests WHERE score=(SELECT MIN(score) FROM\nstudent);\n+-------+--------+-------+\n| name  | test   | score |\n+-------+--------+-------+\n| Esben | Tuning |    31 |\n+-------+--------+-------+\n\nFinding Rows with the Maximum Value of a Column by Group\n--------------------------------------------------------\n\nThis example returns the best test results of each student:\n\nSELECT name, test, score FROM student_tests st1 WHERE score = (\n SELECT MAX(score) FROM student st2 WHERE st1.name = st2.name\n); \n+---------+--------+-------+\n| name    | test   | score |\n+---------+--------+-------+\n| Chun    | SQL    |    75 |\n| Esben   | SQL    |    43 |\n| Kaolin  | Tuning |    88 |\n| Tatiana | SQL    |    87 |\n+---------+--------+-------+\n\nCalculating Age\n---------------\n\nThe TIMESTAMPDIFF function can be used to calculate someone\'s age:\n\nSELECT CURDATE() AS today;\n+------------+\n| today      |\n+------------+\n| 2014-02-17 |\n+------------+\n\nSELECT name, date_of_birth, TIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS\nage \n FROM student_details;\n+---------+---------------+------+\n| name    | date_of_birth | age  |\n+---------+---------------+------+\n| Chun    | 1993-12-31    |   20 |\n| Esben   | 1946-01-01    |   68 |\n| Kaolin  | 1996-07-16    |   18 |\n| Tatiana | 1988-04-13    |   26 |\n+---------+---------------+------+\n\nSee TIMESTAMPDIFF() for more.\n\nUsing User-defined Variables\n----------------------------\n\nThis example sets a user-defined variable with the average test score, and\nthen uses it in a later query to return all results above the average.\n\nSELECT @avg_score:= AVG(score) FROM student_tests;\n+-------------------------+\n| @avg_score:= AVG(score) |\n+-------------------------+\n|            67.000000000 |\n+-------------------------+\n\nSELECT * FROM student_tests WHERE score > @avg_score;\n+---------+--------+-------+------------+\n| name    | test   | score | test_date  |\n+---------+--------+-------+------------+\n| Chun    | SQL    |    75 | 2012-11-05 |\n| Chun    | Tuning |    73 | 2013-06-14 |\n| Kaolin  | Tuning |    88 | 2013-12-29 |\n| Tatiana | SQL    |    87 | 2012-04-28 |\n| Tatiana | Tuning |    83 | 2013-09-30 |\n+---------+--------+-------+------------+\n\nUser-defined variables can also be used to add an incremental counter to a\nresultset:\n\nSET @count = 0;\n\nSELECT @count := @count + 1 AS counter, name, date_of_birth FROM\nstudent_details;\n+---------+---------+---------------+\n| counter | name    | date_of_birth |\n+---------+---------+---------------+\n|       1 | Chun    | 1993-12-31    |\n|       2 | Esben   | 1946-01-01    |\n|       3 | Kaolin  | 1996-07-16    |\n|       4 | Tatiana | 1988-04-13    |\n+---------+---------+---------------+\n\nSee User-defined Variables for more.\n\nView Tables in Order of Size\n----------------------------\n\nReturns a list of all tables in the database, ordered by size:\n\nSELECT table_schema as `DB`, table_name AS `Table`, \n ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size (MB)`\n FROM information_schema.TABLES\n ORDER BY (data_length + index_length) DESC;\n\n+--------------------+---------------------------------------+-----------+\n| DB                 | Table                                 | Size (MB) |\n+--------------------+---------------------------------------+-----------+\n| wordpress          | wp_simple_history_contexts            |      7.05 |\n| wordpress          | wp_posts                              |      6.59 |\n| wordpress          | wp_simple_history                     |      3.05 |\n| wordpress          | wp_comments                           |      2.73 |\n| wordpress          | wp_commentmeta                        |      2.47 |\n| wordpress          | wp_simple_login_log                   |      2.03 |\n...\n\nRemoving Duplicates\n-------------------\n\nMariaDB starting with 10.3\n--------------------------\nThe following syntax is only valid MariaDB 10.3 and beyond:\n\nThis example assumes there\'s a unique ID, but that all other fields are\nidentical. In the example below, there are 4 records, 3 of which are\nduplicates, so two of the three duplicates need to be removed. The\nintermediate SELECT is not necessary, but demonstrates what is being returned.\n\nCREATE TABLE t (id INT, f1 VARCHAR(2));\n\nINSERT INTO t VALUES (1,\'a\'), (2,\'a\'), (3,\'b\'), (4,\'a\');\n\nSELECT * FROM t t1, t t2 WHERE t1.f1=t2.f1 AND t1.id<>t2.id AND t1.id=(\n SELECT MAX(id) FROM t tab WHERE tab.f1=t1.f1\n);\n+------+------+------+------+\n| id   | f1   | id   | f1   |\n+------+------+------+------+\n|    4 | a    |    1 | a    |\n|    4 | a    |    2 | a    |\n+------+------+------+------+\n\nDELETE FROM t WHERE id IN (\n SELECT t2.id FROM t t1, t t2 WHERE t1.f1=t2.f1 AND t1.id<>t2.id AND t1.id=(\n  SELECT MAX(id) FROM t tab WHERE tab.f1=t1.f1\n )\n);\nQuery OK, 2 rows affected (0.120 sec)\n\nSELECT * FROM t;\n+------+------+\n| id   | f1   |\n+------+------+\n|    3 | b    |\n|    4 | a    |\n+------+------\n\nURL: https://mariadb.com/kb/en/useful-mariadb-queries/','','https://mariadb.com/kb/en/useful-mariadb-queries/'),
(470,'EXPLAIN',28,'Syntax\n------\n\nEXPLAIN tbl_name [col_name | wild]\n\nOr\n\nEXPLAIN [EXTENDED | PARTITIONS | FORMAT=JSON] \n {SELECT select_options | UPDATE update_options | DELETE delete_options}\n\nDescription\n-----------\n\nThe EXPLAIN statement can be used either as a synonym for DESCRIBE or as a way\nto obtain information about how MariaDB executes a SELECT, UPDATE or DELETE\nstatement:\n\n* \'EXPLAIN tbl_name\' is synonymous with \n \'DESCRIBE tbl_name\' or\n \'SHOW COLUMNS FROM tbl_name\'.\n* When you precede a SELECT, UPDATE or a DELETE statement with the keyword \n EXPLAIN, MariaDB displays information from the optimizer\n about the query execution plan. That is, MariaDB explains how it would\n process the SELECT, UPDATE or DELETE, including information about how tables\n are joined and in which order. EXPLAIN EXTENDED can be\n used to provide additional information.\n* EXPLAIN PARTITIONS is useful only when examining queries involving\npartitioned tables. For details, see Partition pruning and selection.\n* ANALYZE statement performs the query as well as producing EXPLAIN output,\nand provides actual as well as estimated statistics.\n* EXPLAIN output can be printed in the slow query log. See EXPLAIN in the Slow\nQuery Log for details.\n\nSHOW EXPLAIN shows the output of a running statement. In some cases, its\noutput can be closer to reality than EXPLAIN.\n\nThe ANALYZE statement runs a statement and returns information about its\nexecution plan. It also shows additional columns, to check how much the\noptimizer\'s estimation about filtering and found rows are close to reality.\n\nThere is an online EXPLAIN Analyzer that you can use to share EXPLAIN and\nEXPLAIN EXTENDED output with others.\n\nEXPLAIN can acquire metadata locks in the same way that SELECT does, as it\nneeds to know table metadata and, sometimes, data as well.\n\nColumns in EXPLAIN ... SELECT\n-----------------------------\n\n+--------------------------------------+--------------------------------------+\n| Column name                          | Description                          |\n+--------------------------------------+--------------------------------------+\n| id                                   | Sequence number that shows in which  |\n|                                      | order tables are joined.             |\n+--------------------------------------+--------------------------------------+\n| select_type                          | What kind of SELECT the table comes  |\n|                                      | from.                                |\n+--------------------------------------+--------------------------------------+\n| table                                | Alias name of table. Materialized    |\n|                                      | temporary tables for sub queries     |\n|                                      | are named <subquery#>                |\n+--------------------------------------+--------------------------------------+\n| type                                 | How rows are found from the table    |\n|                                      | (join type).                         |\n+--------------------------------------+--------------------------------------+\n| possible_keys                        | keys in table that could be used to  |\n|                                      | find rows in the table               |\n+--------------------------------------+--------------------------------------+\n| key                                  | The name of the key that is used to  |\n|                                      | retrieve rows. NULL is no key was    |\n|                                      | used.                                |\n+--------------------------------------+--------------------------------------+\n| key_len                              | How many bytes of the key that was   |\n|                                      | used (shows if we are using only     |\n|                                      | parts of the multi-column key).      |\n+--------------------------------------+--------------------------------------+\n| ref                                  | The reference that is used as the    |\n|                                      | key value.                           |\n+--------------------------------------+--------------------------------------+\n| rows                                 | An estimate of how many rows we      |\n|                                      | will find in the table for each key  |\n|                                      | lookup.                              |\n+--------------------------------------+--------------------------------------+\n| Extra                                | Extra information about this join.   |\n+--------------------------------------+--------------------------------------+\n\nHere are descriptions of the values for some of the more complex columns in\nEXPLAIN ... SELECT:\n\n\"Select_type\" Column\n--------------------\n\nThe select_type column can have the following values:\n\n+-----------------+-----------------------------------+-----------------------+\n| Value           | Description                       | Comment               |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT       | The SUBQUERY is DEPENDENT.        |                       |\n| SUBQUERY        |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT UNION | The UNION is DEPENDENT.           |                       |\n+-----------------+-----------------------------------+-----------------------+\n| DERIVED         | The SELECT is DERIVED from the    |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| MATERIALIZED    | The SUBQUERY is MATERIALIZED.     | Materialized tables   |\n|                 |                                   | will be populated at  |\n|                 |                                   | first access and      |\n|                 |                                   | will be accessed by   |\n|                 |                                   | the primary key (=    |\n|                 |                                   | one key lookup).      |\n|                 |                                   | Number of rows in     |\n|                 |                                   | EXPLAIN shows the     |\n|                 |                                   | cost of populating    |\n|                 |                                   | the table             |\n+-----------------+-----------------------------------+-----------------------+\n| PRIMARY         | The SELECT is in the outermost    |                       |\n|                 | query, but there is also a        |                       |\n|                 | SUBQUERY within it.               |                       |\n+-----------------+-----------------------------------+-----------------------+\n| SIMPLE          | It is a simple SELECT query       |                       |\n|                 | without any SUBQUERY or UNION.    |                       |\n+-----------------+-----------------------------------+-----------------------+\n| SUBQUERY        | The SELECT is a SUBQUERY of the   |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE     | The SUBQUERY is UNCACHEABLE.      |                       |\n| SUBQUERY        |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE     | The UNION is UNCACHEABLE.         |                       |\n| UNION           |                                   |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNION           | The SELECT is a UNION of the      |                       |\n|                 | PRIMARY.                          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| UNION RESULT    | The result of the UNION.          |                       |\n+-----------------+-----------------------------------+-----------------------+\n| LATERAL DERIVED | The SELECT uses a Lateral         |                       |\n|                 | Derived optimization              |                       |\n+-----------------+-----------------------------------+-----------------------+\n\n\"Type\" Column\n-------------\n\nThis column contains information on how the table is accessed.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| ALL                    | A full table scan is done for the table (all      |\n|                        | rows are read). This is bad if the table is       |\n|                        | large and the table is joined against a previous  |\n|                        | table!  This happens when the optimizer could     |\n|                        | not find any usable index to access rows.         |\n+------------------------+---------------------------------------------------+\n| const                  | There is only one possibly matching row in the    |\n|                        | table. The row is read before the optimization    |\n|                        | phase and all columns in the table are treated    |\n|                        | as constants.                                     |\n+------------------------+---------------------------------------------------+\n| eq_ref                 | A unique index is used to find the rows. This is  |\n|                        | the best possible plan to find the row.           |\n+------------------------+---------------------------------------------------+\n| fulltext               | A fulltext index is used to access the rows.      |\n+------------------------+---------------------------------------------------+\n| index_merge            | A \'range\' access is done for for several index    |\n|                        | and the found rows are merged. The key column     |\n|                        | shows which keys are used.                        |\n+------------------------+---------------------------------------------------+\n| index_subquery         | This is similar as ref, but used for sub queries  |\n|                        | that are transformed to key lookups.              |\n+------------------------+---------------------------------------------------+\n| index                  | A full scan over the used index.  Better than     |\n|                        | ALL but still bad if index is large and the       |\n|                        | table is joined against a previous table.         |\n+------------------------+---------------------------------------------------+\n| range                  | The table will be accessed with a key over one    |\n|                        | or more value ranges.                             |\n+------------------------+---------------------------------------------------+\n| ref_or_null            | Like \'ref\' but in addition another search for     |\n|                        | the \'null\' value is done if the first value was   |\n|                        | not found. This happens usually with sub queries. |\n+------------------------+---------------------------------------------------+\n| ref                    | A non unique index or prefix of an unique index   |\n|                        | is used to find the rows. Good if the prefix      |\n|                        | doesn\'t match many rows.                          |\n+------------------------+---------------------------------------------------+\n| system                 | The table has 0 or 1 rows.                        |\n+------------------------+---------------------------------------------------+\n| unique_subquery        | This is similar as eq_ref, but used for sub       |\n|                        | queries that are transformed to key lookups       |\n+------------------------+---------------------------------------------------+\n\n\"Extra\" Column\n--------------\n\nThis column consists of one or more of the following values, separated by \';\'\n\nNote that some of these values are detected after the optimization phase.\n\nThe optimization phase can do the following changes to the WHERE clause:\n\n* Add the expressions from the ON and USING clauses to the WHERE\n clause.\n* Constant propagation:  If there is column=constant, replace all column\n instances with this constant.\n* Replace all columns from \'const\' tables with their values.\n* Remove the used key columns from the WHERE (as this will be tested as\n part of the key lookup).\n* Remove impossible constant sub expressions.\n For example WHERE \'(a=1 and a=2) OR b=1\' becomes \'b=1\'.\n* Replace columns with other columns that has identical values:\n Example:  WHERE a=b and a=c may be treated\n as \'WHERE a=b and a=c and b=c\'.\n* Add extra conditions to detect impossible row conditions earlier. This\n happens mainly with OUTER JOIN where we in some cases add detection\n of NULL values in the WHERE (Part of \'Not exists\' optimization).\n This can cause an unexpected \'Using where\' in the Extra column.\n* For each table level we remove expressions that have already been tested when\n we read the previous row. Example: When joining tables t1 with t2\n using the following WHERE \'t1.a=1 and t1.a=t2.b\', we don\'t have to\n test \'t1.a=1\' when checking rows in t2 as we already know that this\n expression is true.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| const row not found    | The table was a system table (a table with        |\n|                        | should exactly one row), but no row was found.    |\n+------------------------+---------------------------------------------------+\n| Distinct               | If distinct optimization (remove duplicates) was  |\n|                        | used. This is marked only for the last table in   |\n|                        | the SELECT.                                       |\n+------------------------+---------------------------------------------------+\n| Full scan on NULL key  | The table is a part of the sub query and if the   |\n|                        | value that is used to match the sub query will    |\n|                        | be NULL, we will do a full table scan.            |\n+------------------------+---------------------------------------------------+\n| Impossible HAVING      | The used HAVING clause is always false so the     |\n|                        | SELECT will return no rows.                       |\n+------------------------+---------------------------------------------------+\n| Impossible WHERE       | The used WHERE clause is always false so the      |\n| noticed after reading  | SELECT will return no rows. This case was         |\n| const tables.          | detected after we had read all \'const\' tables     |\n|                        | and used the column values as constant in the     |\n|                        | WHERE clause. For example: WHERE const_column=5   |\n|                        | and const_column had a value of 4.                |\n+------------------------+---------------------------------------------------+\n| Impossible WHERE       | The used WHERE clause is always false so the      |\n|                        | SELECT will return no rows. For example: WHERE    |\n|                        | 1=2                                               |\n+------------------------+---------------------------------------------------+\n| No matching min/max    | During early optimization of MIN()/MAX() values   |\n| row                    | it was detected that no row could match the       |\n|                        | WHERE clause. The MIN()/MAX() function will       |\n|                        | return NULL.                                      |\n+------------------------+---------------------------------------------------+\n| no matching row in     | The table was a const table (a table with only    |\n| const table            | one possible matching row), but no row was found. |\n+------------------------+---------------------------------------------------+\n| No tables used         | The SELECT was a sub query that did not use any   |\n|                        | tables. For example a there was no FROM clause    |\n|                        | or a FROM DUAL clause.                            |\n+------------------------+---------------------------------------------------+\n| Not exists             | Stop searching after more row if we find one      |\n|                        | single matching row. This optimization is used    |\n|                        | with LEFT JOIN where one is explicitly searching  |\n|                        | for rows that doesn\'t exists in the LEFT JOIN     |\n|                        | TABLE. Example: SELECT * FROM t1 LEFT JOIN t2 on  |\n|                        | (...) WHERE t2.not_null_column IS NULL.  As       |\n|                        | t2.not_null_column can only be NULL if there was  |\n|                        | no matching row for on condition, we can stop     |\n|                        | searching if we find a single matching row.       |\n+------------------------+---------------------------------------------------+\n| Open_frm_only          | For information_schema tables.  Only the frm      |\n|                        | (table definition file was opened) was opened     |\n|                        | for each matching row.                            |\n+------------------------+---------------------------------------------------+\n| Open_full_table        | For information_schema tables. A full table open  |\n|                        | for each matching row is done to retrieve the     |\n|                        | requested information. (Slow)                     |\n+------------------------+---------------------------------------------------+\n| Open_trigger_only      | For information_schema tables. Only the trigger   |\n|                        | file definition was opened for each matching row. |\n+------------------------+---------------------------------------------------+\n| Range checked for      | This only happens when there was no good default  |\n| each record (index     | index to use but there may some index that could  |\n| map: ...)              | be used when we can treat all columns from        |\n|                        | previous table as constants.  For each row        |\n|                        | combination the optimizer will decide which       |\n|                        | index to use (if any) to fetch a row from this    |\n|                        | table. This is not fast, but faster than a full   |\n|                        | table scan that is the only other choice. The     |\n|                        | index map is a bitmask that shows which index     |\n|                        | are considered for each row condition.            |\n+------------------------+---------------------------------------------------+\n| Scanned 0/1/all        | For information_schema tables. Shows how many     |\n| databases              | times we had to do a directory scan.              |\n+------------------------+---------------------------------------------------+\n| Select tables          | All tables in the join was optimized away. This   |\n| optimized away         | happens when we are only using COUNT(*), MIN()    |\n|                        | and MAX() functions in the SELECT and we where    |\n|                        | able to replace all of these with constants.      |\n+------------------------+---------------------------------------------------+\n| Skip_open_table        | For information_schema tables. The queried table  |\n|                        | didn\'t need to be opened.                         |\n+------------------------+---------------------------------------------------+\n| unique row not found   | The table was detected to be a const table (a     |\n|                        | table with only one possible matching row)        |\n|                        | during the early optimization phase, but no row   |\n|                        | was found.                                        |\n+------------------------+---------------------------------------------------+\n| Using filesort         | Filesort is needed to resolve the query. This     |\n|                        | means an extra phase where we first collect all   |\n|                        | columns to sort, sort them with a disk based      |\n|                        | merge sort and then use the sorted set to         |\n|                        | retrieve the rows in sorted order. If the column  |\n|                        | set is small, we store all the columns in the     |\n|                        | sort file to not have to go to the database to    |\n|                        | retrieve them again.                              |\n+------------------------+---------------------------------------------------+\n| Using index            | Only the index is used to retrieve the needed     |\n|                        | information from the table. There is no need to   |\n|                        | perform an extra seek to retrieve the actual      |\n|                        | record.                                           |\n+------------------------+---------------------------------------------------+\n| Using index condition  | Like \'Using where\' but the where condition is     |\n|                        | pushed down to the table engine for internal      |\n|                        | optimization at the index level.                  |\n+------------------------+---------------------------------------------------+\n| Using index            | Like \'Using index condition\' but in addition we   |\n| condition(BKA)         | use batch key access to retrieve rows.            |\n+------------------------+---------------------------------------------------+\n| Using index for        | The index is being used to resolve a GROUP BY or  |\n| group-by               | DISTINCT query. The rows are not read.  This is   |\n|                        | very efficient if the table has a lot of          |\n|                        | identical index entries as duplicates are         |\n|                        | quickly jumped over.                              |\n+------------------------+---------------------------------------------------+\n| Using intersect(...)   | For index_merge joins. Shows which index are      |\n|                        | part of the intersect.                            |\n+------------------------+---------------------------------------------------+\n| Using join buffer      | We store previous row combinations in a row       |\n|                        | buffer to be able to match each row against all   |\n|                        | of the rows combinations in the join buffer at    |\n|                        | one go.                                           |\n+------------------------+---------------------------------------------------+\n| Using sort_union(...)  | For index_merge joins. Shows which index are      |\n|                        | part of the union.                                |\n+------------------------+---------------------------------------------------+\n| Using temporary        | A temporary table is created to hold the result.  |\n|                        | This typically happens if you are using GROUP     |\n|                        | BY, DISTINCT or ORDER BY.                         |\n+------------------------+---------------------------------------------------+\n| Using where            | A WHERE expression (in additional to the          |\n|                        | possible key lookup) is used to check if the row  |\n|                        | should be accepted. If you don\'t have \'Using      |\n|                        | where\' together with a join type of ALL, you are  |\n|                        | probably doing something wrong!                   |\n+------------------------+---------------------------------------------------+\n| Using where with       | Like \'Using where\' but the where condition is     |\n| pushed condition       | pushed down to the table engine for internal      |\n|                        | optimization at the row level.                    |\n+------------------------+---------------------------------------------------+\n| Using buffer           | The UPDATE statement will first buffer the rows,  |\n|                        | and then run the updates, rather than do updates  |\n|                        | on the fly. See Using Buffer UPDATE Algorithm     |\n|                        | for a detailed explanation.                       |\n+------------------------+---------------------------------------------------+\n\nEXPLAIN EXTENDED\n----------------\n\nThe EXTENDED keyword adds another column, filtered, to the output. This is a\npercentage estimate of the table rows that will be filtered by the condition.\n\nAn EXPLAIN EXTENDED will always throw a warning, as it adds extra Message\ninformation to a subsequent SHOW WARNINGS statement. This includes what the\nSELECT query would look like after optimizing and rewriting rules are applied\nand how the optimizer qualifies columns and tables.\n\nExamples\n--------\n\nAs synonym for DESCRIBE or SHOW COLUMNS FROM:\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | YES  |     | NULL    |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | YES  |     | NULL    |                |\n+------------+----------+------+-----+---------+----------------+\n\nA simple set of examples to see how EXPLAIN can identify poor index usage:\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example;\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| Table             | Non_unique | Key_name      | Seq_in_index | Column_name \n | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |\nIndex_comment |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| employees_example |          0 | PRIMARY       |            1 | id          \n | A         |           7 |     NULL | NULL   |      | BTREE      |         |\n       |\n| employees_example |          0 | employee_code |            1 |\nemployee_code | A         |           7 |     NULL | NULL   |      | BTREE    \n |         |               |\n| employees_example |          1 | first_name    |            1 | first_name  \n | A         |        NULL |     NULL | NULL   |      | BTREE      |         |\n       |\n| employees_example |          1 | first_name    |            2 | last_name   \n | A         |        NULL |     NULL | NULL   |      | BTREE      |         |\n       |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n\nSELECT on a primary key:\n\nEXPLAIN SELECT * FROM employees_example WHERE id=1;\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n| id   | select_type | table             | type  | possible_keys | key     |\nkey_len | ref   | rows | Extra |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n|    1 | SIMPLE      | employees_example | const | PRIMARY       | PRIMARY | 4\n   | const |    1 |       |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n\nThe type is const, which means that only one possible result could be\nreturned. Now, returning the same record but searching by their phone number:\n\nEXPLAIN SELECT * FROM employees_example WHERE home_phone=\'326-555-3492\';\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n| id   | select_type | table             | type | possible_keys | key  |\nkey_len | ref  | rows | Extra       |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n|    1 | SIMPLE      | employees_example | ALL  | NULL          | NULL | NULL \n | NULL |    6 | Using where |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n\nHere, the type is All, which means no index could be used. Looking at the rows\ncount, a full table scan (all six rows) had to be performed in order to\nretrieve the record. If it\'s a requirement to search by phone number, an index\nwill have to be created.\n\nSHOW EXPLAIN example:\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id   | select_type | table | type  | possible_keys | key  | key_len | ref  |\nrows    | Extra       |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n|    1 | SIMPLE      | tbl   | index | NULL          | a    | 5       | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nExample of ref_or_null Optimization\n-----------------------------------\n\nSELECT * FROM table_name\n WHERE key_column=expr OR key_column IS NULL;\n\nref_or_null is something that often happens when you use subqueries with NOT\nIN as then one has to do an extra check for NULL values if the first value\ndidn\'t have a matching row.\n\nURL: https://mariadb.com/kb/en/explain/','','https://mariadb.com/kb/en/explain/'),
(471,'EXPLAIN ANALYZE',28,'The syntax for the EXPLAIN ANALYZE feature was changed to ANALYZE statement,\navailable since MariaDB 10.1.0. See ANALYZE statement.\n\nURL: https://mariadb.com/kb/en/explain-analyze/','','https://mariadb.com/kb/en/explain-analyze/'),
(476,'Binary Literals',29,'Binary literals can be written in one of the following formats: b\'value\',\nB\'value\' or 0bvalue, where value is a string composed by 0 and 1 digits.\n\nBinary literals are interpreted as binary strings, and are convenient to\nrepresent VARBINARY, BINARY or BIT values.\n\nTo convert a binary literal into an integer, just add 0.\n\nExamples\n--------\n\nPrinting the value as a binary string:\n\nSELECT 0b1000001;\n+-----------+\n| 0b1000001 |\n+-----------+\n| A         |\n+-----------+\n\nConverting the same value into a number:\n\nSELECT 0b1000001+0;\n+-------------+\n| 0b1000001+0 |\n+-------------+\n|          65 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/binary-literals/','','https://mariadb.com/kb/en/binary-literals/'),
(201,'DECODE_HISTOGRAM',17,'Syntax\n------\n\nDECODE_HISTOGRAM(hist_type,histogram)\n\nDescription\n-----------\n\nReturns a string of comma separated numeric values corresponding to a\nprobability distribution represented by the histogram of type hist_type\n(SINGLE_PREC_HB or DOUBLE_PREC_HB). The hist_type and histogram would be\ncommonly used from the mysql.column_stats table.\n\nSee Histogram Based Statistics for details.\n\nExamples\n--------\n\nCREATE TABLE origin (\n i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n v INT UNSIGNED NOT NULL\n);\n\nINSERT INTO origin(v) VALUES \n (1),(2),(3),(4),(5),(10),(20),\n (30),(40),(50),(60),(70),(80),\n (90),(100),(200),(400),(800);\n\nSET histogram_size=10,histogram_type=SINGLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table       | Op      | Msg_type | Msg_text                                |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status   | Engine-independent statistics collected |\n| test.origin | analyze | status   | OK                                      |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,hist_type,\n hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| db_name | table_name | column_name | hist_type      | hex(histogram)       |\ndecode_histogram(hist_type,histogram)                             |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| test    | origin     | i           | SINGLE_PREC_HB | 0F2D3C5A7887A5C3D2F0 |\n0.059,0.118,0.059,0.118,0.118,0.059,0.118,0.118,0.059,0.118,0.059 |\n| test    | origin     | v           | SINGLE_PREC_HB | 000001060C0F161C1F7F |\n0.000,0.000,0.004,0.020,0.024,0.012,0.027,0.024,0.012,0.376,0.502 |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n\nSET histogram_size=20,histogram_type=DOUBLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table       | Op      | Msg_type | Msg_text                                |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status   | Engine-independent statistics collected |\n| test.origin | analyze | status   | OK                                      |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,\n hist_type,hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| db_name | table_name | column_name | hist_type      | hex(histogram)        \n         | decode_histogram(hist_type,histogram)\n              |\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| test    | origin     | i           | DOUBLE_PREC_HB |\n0F0F2D2D3C3C5A5A78788787A5A5C3C3D2D2F0F0 |\n0.05882,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765\n0.05882 |\n| test    | origin     | v           | DOUBLE_PREC_HB |\n5200F600480116067E0CB30F1B16831CB81FD67F |\n0.00125,0.00250,0.00125,0.01877,0.02502,0.01253,0.02502,0.02502,0.01253,0.37546\n0.50063 |\n\nURL: https://mariadb.com/kb/en/decode_histogram/','','https://mariadb.com/kb/en/decode_histogram/'),
(206,'PROCEDURE ANALYSE',17,'Syntax\n------\n\nanalyse([max_elements[,max_memory]])\n\nDescription\n-----------\n\nThis procedure is defined in the sql/sql_analyse.cc file. It examines the\nresult from a query and returns an analysis of the results that suggests\noptimal data types for each column. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query, and\npropose an optimal data type for the columns. This can be helpful for checking\nyour existing tables, or after importing new data. You may need to try\ndifferent settings for the arguments so that PROCEDURE ANALYSE() does not\nsuggest the ENUM data type when it is not appropriate.\n\nThe arguments are optional and are used as follows:\n\n* max_elements (default 256) is the maximum number of distinct values that\nanalyse notices per column. This is used by analyse to check whether the\noptimal data type should be of type ENUM; if there are more than max_elements\ndistinct values, then ENUM is not a suggested type.\n* max_memory (default 8192) is the maximum amount of memory that analyse\nshould allocate per column while trying to find all distinct values.\n\nURL: https://mariadb.com/kb/en/procedure-analyse/','','https://mariadb.com/kb/en/procedure-analyse/'),
(477,'Boolean Literals',29,'In MariaDB, FALSE is a synonym of 0 and TRUE is a synonym of 1. These\nconstants are case insensitive, so TRUE, True, and true are equivalent.\n\nThese terms are not synonyms of 0 and 1 when used with the IS operator. So,\nfor example, 10 IS TRUE returns 1, while 10 = TRUE returns 0 (because 1 != 10).\n\nThe IS operator accepts a third constant exists: UNKNOWN. It is always a\nsynonym of NULL.\n\nTRUE and FALSE are reserved words, while UNKNOWN is not.\n\nURL: https://mariadb.com/kb/en/sql-language-structure-boolean-literals/','','https://mariadb.com/kb/en/sql-language-structure-boolean-literals/'),
(483,'Reserved Words',29,'The following is a list of all reserved words in MariaDB.\n\nReserved words cannot be used as Identifiers, unless they are quoted.\n\nThe definitive list of reserved words for each version can be found by\nexamining the sql/lex.h and sql/sql_yacc.yy files.\n\nReserved Words\n--------------\n\n+--------------------------------------------+--------------------------------+\n| Keyword                                    | Notes                          |\n+--------------------------------------------+--------------------------------+\n| ACCESSIBLE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| ADD                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ALL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ALTER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ANALYZE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| AND                                        |                                |\n+--------------------------------------------+--------------------------------+\n| AS                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ASC                                        |                                |\n+--------------------------------------------+--------------------------------+\n| ASENSITIVE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| BEFORE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BETWEEN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| BIGINT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BINARY                                     |                                |\n+--------------------------------------------+--------------------------------+\n| BLOB                                       |                                |\n+--------------------------------------------+--------------------------------+\n| BOTH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| BY                                         |                                |\n+--------------------------------------------+--------------------------------+\n| CALL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CASCADE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| CASE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CHANGE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CHAR                                       |                                |\n+--------------------------------------------+--------------------------------+\n| CHARACTER                                  |                                |\n+--------------------------------------------+--------------------------------+\n| CHECK                                      |                                |\n+--------------------------------------------+--------------------------------+\n| COLLATE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| COLUMN                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CONDITION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| CONSTRAINT                                 |                                |\n+--------------------------------------------+--------------------------------+\n| CONTINUE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| CONVERT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| CREATE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| CROSS                                      |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_DATE                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_ROLE                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_TIME                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_TIMESTAMP                          |                                |\n+--------------------------------------------+--------------------------------+\n| CURRENT_USER                               |                                |\n+--------------------------------------------+--------------------------------+\n| CURSOR                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DATABASE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DATABASES                                  |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_HOUR                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_MICROSECOND                            |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_MINUTE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| DAY_SECOND                                 |                                |\n+--------------------------------------------+--------------------------------+\n| DEC                                        |                                |\n+--------------------------------------------+--------------------------------+\n| DECIMAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DECLARE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DEFAULT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DELAYED                                    |                                |\n+--------------------------------------------+--------------------------------+\n| DELETE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DELETE_DOMAIN_ID                           |                                |\n+--------------------------------------------+--------------------------------+\n| DESC                                       |                                |\n+--------------------------------------------+--------------------------------+\n| DESCRIBE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DETERMINISTIC                              |                                |\n+--------------------------------------------+--------------------------------+\n| DISTINCT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| DISTINCTROW                                |                                |\n+--------------------------------------------+--------------------------------+\n| DIV                                        |                                |\n+--------------------------------------------+--------------------------------+\n| DO_DOMAIN_IDS                              |                                |\n+--------------------------------------------+--------------------------------+\n| DOUBLE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| DROP                                       |                                |\n+--------------------------------------------+--------------------------------+\n| DUAL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| EACH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSEIF                                     |                                |\n+--------------------------------------------+--------------------------------+\n| ENCLOSED                                   |                                |\n+--------------------------------------------+--------------------------------+\n| ESCAPED                                    |                                |\n+--------------------------------------------+--------------------------------+\n| EXCEPT                                     | Added in MariaDB 10.3.0        |\n+--------------------------------------------+--------------------------------+\n| EXISTS                                     |                                |\n+--------------------------------------------+--------------------------------+\n| EXIT                                       |                                |\n+--------------------------------------------+--------------------------------+\n| EXPLAIN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| FALSE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FETCH                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT4                                     |                                |\n+--------------------------------------------+--------------------------------+\n| FLOAT8                                     |                                |\n+--------------------------------------------+--------------------------------+\n| FOR                                        |                                |\n+--------------------------------------------+--------------------------------+\n| FORCE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| FOREIGN                                    |                                |\n+--------------------------------------------+--------------------------------+\n| FROM                                       |                                |\n+--------------------------------------------+--------------------------------+\n| FULLTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| GENERAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| GRANT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| GROUP                                      |                                |\n+--------------------------------------------+--------------------------------+\n| HAVING                                     |                                |\n+--------------------------------------------+--------------------------------+\n| HIGH_PRIORITY                              |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_MICROSECOND                           |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_MINUTE                                |                                |\n+--------------------------------------------+--------------------------------+\n| HOUR_SECOND                                |                                |\n+--------------------------------------------+--------------------------------+\n| IF                                         |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE_DOMAIN_IDS                          |                                |\n+--------------------------------------------+--------------------------------+\n| IGNORE_SERVER_IDS                          |                                |\n+--------------------------------------------+--------------------------------+\n| IN                                         |                                |\n+--------------------------------------------+--------------------------------+\n| INDEX                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INFILE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| INNER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INOUT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| INSENSITIVE                                |                                |\n+--------------------------------------------+--------------------------------+\n| INSERT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| INT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| INT1                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT2                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT3                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT4                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INT8                                       |                                |\n+--------------------------------------------+--------------------------------+\n| INTEGER                                    |                                |\n+--------------------------------------------+--------------------------------+\n| INTERSECT                                  | Added in MariaDB 10.3.0        |\n+--------------------------------------------+--------------------------------+\n| INTERVAL                                   |                                |\n+--------------------------------------------+--------------------------------+\n| INTO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| IS                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ITERATE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| JOIN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| KEY                                        |                                |\n+--------------------------------------------+--------------------------------+\n| KEYS                                       |                                |\n+--------------------------------------------+--------------------------------+\n| KILL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LEADING                                    |                                |\n+--------------------------------------------+--------------------------------+\n| LEAVE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LEFT                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LIKE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LIMIT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LINEAR                                     |                                |\n+--------------------------------------------+--------------------------------+\n| LINES                                      |                                |\n+--------------------------------------------+--------------------------------+\n| LOAD                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LOCALTIME                                  |                                |\n+--------------------------------------------+--------------------------------+\n| LOCALTIMESTAMP                             |                                |\n+--------------------------------------------+--------------------------------+\n| LOCK                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LONG                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LONGBLOB                                   |                                |\n+--------------------------------------------+--------------------------------+\n| LONGTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| LOOP                                       |                                |\n+--------------------------------------------+--------------------------------+\n| LOW_PRIORITY                               |                                |\n+--------------------------------------------+--------------------------------+\n| MASTER_HEARTBEAT_PERIOD                    |                                |\n+--------------------------------------------+--------------------------------+\n| MASTER_SSL_VERIFY_SERVER_CERT              |                                |\n+--------------------------------------------+--------------------------------+\n| MATCH                                      |                                |\n+--------------------------------------------+--------------------------------+\n| MAXVALUE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMBLOB                                 |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMINT                                  |                                |\n+--------------------------------------------+--------------------------------+\n| MEDIUMTEXT                                 |                                |\n+--------------------------------------------+--------------------------------+\n| MIDDLEINT                                  |                                |\n+--------------------------------------------+--------------------------------+\n| MINUTE_MICROSECOND                         |                                |\n+--------------------------------------------+--------------------------------+\n| MINUTE_SECOND                              |                                |\n+--------------------------------------------+--------------------------------+\n| MOD                                        |                                |\n+--------------------------------------------+--------------------------------+\n| MODIFIES                                   |                                |\n+--------------------------------------------+--------------------------------+\n| NATURAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| NOT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| NO_WRITE_TO_BINLOG                         |                                |\n+--------------------------------------------+--------------------------------+\n| NULL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| NUMERIC                                    |                                |\n+--------------------------------------------+--------------------------------+\n| OFFSET                                     | Added in MariaDB 10.6.0        |\n+--------------------------------------------+--------------------------------+\n| ON                                         |                                |\n+--------------------------------------------+--------------------------------+\n| OPTIMIZE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| OPTION                                     |                                |\n+--------------------------------------------+--------------------------------+\n| OPTIONALLY                                 |                                |\n+--------------------------------------------+--------------------------------+\n| OR                                         |                                |\n+--------------------------------------------+--------------------------------+\n| ORDER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| OUT                                        |                                |\n+--------------------------------------------+--------------------------------+\n| OUTER                                      |                                |\n+--------------------------------------------+--------------------------------+\n| OUTFILE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| OVER                                       |                                |\n+--------------------------------------------+--------------------------------+\n| PAGE_CHECKSUM                              |                                |\n+--------------------------------------------+--------------------------------+\n| PARSE_VCOL_EXPR                            |                                |\n+--------------------------------------------+--------------------------------+\n| PARTITION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| POSITION                                   |                                |\n+--------------------------------------------+--------------------------------+\n| PRECISION                                  |                                |\n+--------------------------------------------+--------------------------------+\n| PRIMARY                                    |                                |\n+--------------------------------------------+--------------------------------+\n| PROCEDURE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| PURGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| RANGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| READ                                       |                                |\n+--------------------------------------------+--------------------------------+\n| READS                                      |                                |\n+--------------------------------------------+--------------------------------+\n| READ_WRITE                                 |                                |\n+--------------------------------------------+--------------------------------+\n| REAL                                       |                                |\n+--------------------------------------------+--------------------------------+\n| RECURSIVE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| REF_SYSTEM_ID                              |                                |\n+--------------------------------------------+--------------------------------+\n| REFERENCES                                 |                                |\n+--------------------------------------------+--------------------------------+\n| REGEXP                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RELEASE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| RENAME                                     |                                |\n+--------------------------------------------+--------------------------------+\n| REPEAT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| REPLACE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| REQUIRE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| RESIGNAL                                   |                                |\n+--------------------------------------------+--------------------------------+\n| RESTRICT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| RETURN                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RETURNING                                  |                                |\n+--------------------------------------------+--------------------------------+\n| REVOKE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| RIGHT                                      |                                |\n+--------------------------------------------+--------------------------------+\n| RLIKE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ROW_NUMBER                                 | From MariaDB 10.7              |\n+--------------------------------------------+--------------------------------+\n| ROWS                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SCHEMA                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SCHEMAS                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SECOND_MICROSECOND                         |                                |\n+--------------------------------------------+--------------------------------+\n| SELECT                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SENSITIVE                                  |                                |\n+--------------------------------------------+--------------------------------+\n| SEPARATOR                                  |                                |\n+--------------------------------------------+--------------------------------+\n| SET                                        |                                |\n+--------------------------------------------+--------------------------------+\n| SHOW                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SIGNAL                                     |                                |\n+--------------------------------------------+--------------------------------+\n| SLOW                                       |                                |\n+--------------------------------------------+--------------------------------+\n| SMALLINT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SPATIAL                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SPECIFIC                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SQL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| SQLEXCEPTION                               |                                |\n+--------------------------------------------+--------------------------------+\n| SQLSTATE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| SQLWARNING                                 |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_BIG_RESULT                             |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_CALC_FOUND_ROWS                        |                                |\n+--------------------------------------------+--------------------------------+\n| SQL_SMALL_RESULT                           |                                |\n+--------------------------------------------+--------------------------------+\n| SSL                                        |                                |\n+--------------------------------------------+--------------------------------+\n| STARTING                                   |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_AUTO_RECALC                          |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_PERSISTENT                           |                                |\n+--------------------------------------------+--------------------------------+\n| STATS_SAMPLE_PAGES                         |                                |\n+--------------------------------------------+--------------------------------+\n| STRAIGHT_JOIN                              |                                |\n+--------------------------------------------+--------------------------------+\n| TABLE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| TERMINATED                                 |                                |\n+--------------------------------------------+--------------------------------+\n| THEN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| TINYBLOB                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TINYINT                                    |                                |\n+--------------------------------------------+--------------------------------+\n| TINYTEXT                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TO                                         |                                |\n+--------------------------------------------+--------------------------------+\n| TRAILING                                   |                                |\n+--------------------------------------------+--------------------------------+\n| TRIGGER                                    |                                |\n+--------------------------------------------+--------------------------------+\n| TRUE                                       |                                |\n+--------------------------------------------+--------------------------------+\n| UNDO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| UNION                                      |                                |\n+--------------------------------------------+--------------------------------+\n| UNIQUE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| UNLOCK                                     |                                |\n+--------------------------------------------+--------------------------------+\n| UNSIGNED                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UPDATE                                     |                                |\n+--------------------------------------------+--------------------------------+\n| USAGE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| USE                                        |                                |\n+--------------------------------------------+--------------------------------+\n| USING                                      |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_DATE                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_TIME                                   |                                |\n+--------------------------------------------+--------------------------------+\n| UTC_TIMESTAMP                              |                                |\n+--------------------------------------------+--------------------------------+\n| VALUES                                     |                                |\n+--------------------------------------------+--------------------------------+\n| VARBINARY                                  |                                |\n+--------------------------------------------+--------------------------------+\n| VARCHAR                                    |                                |\n+--------------------------------------------+--------------------------------+\n| VARCHARACTER                               |                                |\n+--------------------------------------------+--------------------------------+\n| VARYING                                    |                                |\n+--------------------------------------------+--------------------------------+\n| WHEN                                       |                                |\n+--------------------------------------------+--------------------------------+\n| WHERE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| WHILE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| WINDOW                                     | Only disallowed for table      |\n|                                            | aliases.                       |\n+--------------------------------------------+--------------------------------+\n| WITH                                       |                                |\n+--------------------------------------------+--------------------------------+\n| WRITE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| XOR                                        |                                |\n+--------------------------------------------+--------------------------------+\n| YEAR_MONTH                                 |                                |\n+--------------------------------------------+--------------------------------+\n| ZEROFILL                                   |                                |\n+--------------------------------------------+--------------------------------+\n\nExceptions\n----------\n\nSome keywords are exceptions for historical reasons, and are permitted as\nunquoted identifiers. These include:\n\n+-----------------------------------------------------------------------------+\n| Keyword                                                                     |\n+-----------------------------------------------------------------------------+\n| ACTION                                                                      |\n+-----------------------------------------------------------------------------+\n| BIT                                                                         |\n+-----------------------------------------------------------------------------+\n| DATE                                                                        |\n+-----------------------------------------------------------------------------+\n| ENUM                                                                        |\n+-----------------------------------------------------------------------------+\n| NO                                                                          |\n+-----------------------------------------------------------------------------+\n| TEXT                                                                        |\n+-----------------------------------------------------------------------------+\n| TIME                                                                        |\n+-----------------------------------------------------------------------------+\n| TIMESTAMP                                                                   |\n+-----------------------------------------------------------------------------+\n\nOracle Mode\n-----------\n\nIn Oracle mode, from MariaDB 10.3, there are a number of extra reserved words:\n\n+--------------------------------------------+--------------------------------+\n| Keyword                                    | Notes                          |\n+--------------------------------------------+--------------------------------+\n| BODY                                       |                                |\n+--------------------------------------------+--------------------------------+\n| ELSIF                                      |                                |\n+--------------------------------------------+--------------------------------+\n| GOTO                                       |                                |\n+--------------------------------------------+--------------------------------+\n| HISTORY                                    | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| MINUS                                      | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| OTHERS                                     |                                |\n+--------------------------------------------+--------------------------------+\n| PACKAGE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| PERIOD                                     | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| RAISE                                      |                                |\n+--------------------------------------------+--------------------------------+\n| ROWNUM                                     | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| ROWTYPE                                    |                                |\n+--------------------------------------------+--------------------------------+\n| SYSDATE                                    | From MariaDB 10.6.1            |\n+--------------------------------------------+--------------------------------+\n| SYSTEM                                     | <= MariaDB 10.3.6 only. Note   |\n|                                            | however that SYSTEM sometimes  |\n|                                            | needs to be quoted to avoid    |\n|                                            | confusion with                 |\n|                                            | System-versioned tables.       |\n+--------------------------------------------+--------------------------------+\n| SYSTEM_TIME                                | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| VERSIONING                                 | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n| WITHOUT                                    | <= MariaDB 10.3.6 only         |\n+--------------------------------------------+--------------------------------+\n\nFunction Names\n--------------\n\nIf the IGNORE_SPACE SQL_MODE flag is set, function names become reserved words.\n\nURL: https://mariadb.com/kb/en/reserved-words/','','https://mariadb.com/kb/en/reserved-words/'),
(488,'SQL_MODE=ORACLE',29,'From MariaDB 10.3, setting the sql_mode system variable to Oracle allows the\nserver to understand a subset of Oracle\'s PL/SQL language. For example:\n\nSET SQL_MODE=\'ORACLE\';\n\nAll traditional MariaDB SQL/PSM syntax should work as before, as long as it\ndoes not conflict with Oracle\'s PL/SQL syntax. All MariaDB functions should be\nsupported in both normal and Oracle modes.\n\nPrior to MariaDB 10.3, MariaDB does not support Oracle\'s PL/SQL language, and\nSET SQL_MODE=ORACLE is only an alias for the following sql_mode in those\nversions:\n\nSET SQL_MODE=\'PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS,\nNO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER\';\n\nFrom MariaDB 10.3, SET SQL_MODE=ORACLE is same as:\n\nSET SQL_MODE=\'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,\nNO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT\';\n\nSupported Syntax in Oracle Mode\n-------------------------------\n\nStored Procedures and Stored Functions\n--------------------------------------\n\nOracle mode makes the following changes to Stored Procedures and Stored\nFunctions:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 (param OUT INT)     | ANSI uses (OUT param INT)         |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 (a IN OUT INT)      | ANSI uses (INOUT param INT)       |\n+-----------------------------------------+-----------------------------------+\n| AS before function body                 | CREATE FUNCTION f1 RETURN NUMBER  |\n|                                         | AS BEGIN...                       |\n+-----------------------------------------+-----------------------------------+\n| IS before function body                 | CREATE FUNCTION f1 RETURN NUMBER  |\n|                                         | IS BEGIN...                       |\n+-----------------------------------------+-----------------------------------+\n| If function has no parameters then      | Example: CREATE PROCEDURE p1 AS   |\n| parentheses must be omitted             | BEGIN NULL; END;                  |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS BEGIN END p1;    | Optional routine name after END   |\n|                                         | keyword. MDEV-12089               |\n+-----------------------------------------+-----------------------------------+\n| CREATE FUNCTION f1(a VARCHAR)           | VARCHAR can be used without       |\n|                                         | length for routine parameters     |\n|                                         | and RETURN clause. The length is  |\n|                                         | inherited from the argument at    |\n|                                         | call time. MDEV-10596             |\n+-----------------------------------------+-----------------------------------+\n| CREATE AGGREGATE FUNCTION f1( )         | Creates an aggregate function,    |\n|                                         | which performs the function       |\n|                                         | against a set of rows and         |\n|                                         | returns one aggregate result.     |\n+-----------------------------------------+-----------------------------------+\n| No CALL needed in Stored Procedures     | In Oracle mode one can call       |\n|                                         | other stored procedures with      |\n|                                         | name only. MDEV-12107             |\n+-----------------------------------------+-----------------------------------+\n| RETURN. Can also be used in stored      | ANSI uses RETURNS. MariaDB mode   |\n| procedures                              | only supports RETURNS in stored   |\n|                                         | functions                         |\n+-----------------------------------------+-----------------------------------+\n\nCursors\n-------\n\nOracle mode makes the following changes to Cursors:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS CURSOR cur IS    | Explicit cursor with FOR loop.    |\n| (SELECT a, b FROM t1); BEGIN  FOR rec   | MDEV-10581                        |\n| IN cur ...                              |                                   |\n+-----------------------------------------+-----------------------------------+\n| CREATE PROCEDURE p1 AS rec IN (SELECT   | Implicit cursor with FOR loop.    |\n| a, b FROM t1)                           | MDEV-12098                        |\n+-----------------------------------------+-----------------------------------+\n| CURSOR c(prm_a VARCHAR2, prm_b          | Cursor with parameters.           |\n| VARCHAR2) ... OPEN c(1,2)               | MDEV-10597                        |\n+-----------------------------------------+-----------------------------------+\n| CURSOR c(prm_a VARCHAR2, prm_b          | Cursor with parameters and FOR    |\n| VARCHAR2) ... FOR rec in c(1,2)         | loop. MDEV-12314                  |\n+-----------------------------------------+-----------------------------------+\n| s %ISOPEN, %ROWCOUNT, %FOUND, %NOTFOUND | Explicit cursor attributes.       |\n|                                         | MDEV-10582                        |\n+-----------------------------------------+-----------------------------------+\n\nLOOP\n----\n\nOracle mode makes the following changes to LOOP:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| FOR i IN 1..10 LOOP ... END LOOP        | Numeric FOR loop. MDEV-10580      |\n+-----------------------------------------+-----------------------------------+\n| GOTO                                    | GOTO statement.  MDEV-10697       |\n+-----------------------------------------+-----------------------------------+\n| <<label>> used with GOTO                | ANSI uses label:. MDEV-10697      |\n+-----------------------------------------+-----------------------------------+\n| To leave loop block: EXIT [ label ] [   | ANSI syntax is IF bool_expr THEN  |\n| WHEN bool_expr ]                        | LEAVE label                       |\n+-----------------------------------------+-----------------------------------+\n| [<<label>>] WHILE boolean_expression    | Oracle style WHILE loop           |\n| LOOP statement... END LOOP [ label ] ;  |                                   |\n+-----------------------------------------+-----------------------------------+\n| CONTINUE [ label ] [ WHEN               | CONTINUE is only valid inside a   |\n| boolean_expression]                     | loop                              |\n+-----------------------------------------+-----------------------------------+\n\nVariables\n---------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| var:= 10; Can also be used   | 10.3            | MariaDB uses SET var=    |\n| with MariaDB systemvariables |                 | 10;                      |\n+------------------------------+-----------------+--------------------------+\n| var INT := 10                | 10.3            | Default variable value   |\n+------------------------------+-----------------+--------------------------+\n| var1                         | 10.3            | Take data type from a    |\n| table_name.column_name%TYPE  |                 | table column. MDEV-10577 |\n+------------------------------+-----------------+--------------------------+\n| var2 var1%TYPE               | 10.3            | Take data type from      |\n|                              |                 | another variable         |\n+------------------------------+-----------------+--------------------------+\n| rec1 table_name%ROWTYPE      | 10.3            | Take ROW structure from  |\n|                              |                 | a table. MDEV-12133      |\n+------------------------------+-----------------+--------------------------+\n| rec2 rec1%ROWTYPE            | 10.3            | Take ROW structure from  |\n|                              |                 | ROW variable             |\n+------------------------------+-----------------+--------------------------+\n| CURSOR c1 IS SELECT a,b      | 10.3            | Take ROW structure from  |\n| FROM t1; rec1 c1%ROWTYPE;    |                 | a cursor. MDEV-12011     |\n+------------------------------+-----------------+--------------------------+\n| Variables can be declared    | 10.3            | In MariaDB mode,         |\n| after cursor declarations    |                 | variables must be        |\n|                              |                 | declared before          |\n|                              |                 | cursors. MDEV-10598      |\n+------------------------------+-----------------+--------------------------+\n| Triggers uses :NEW and :OLD  | 10.3            | ANSI uses NEW and OLD.   |\n|                              |                 | MDEV-10579               |\n+------------------------------+-----------------+--------------------------+\n| SQLCODE                      | 10.3            | Returns the number code  |\n|                              |                 | of the most recent       |\n|                              |                 | exception. Can only be   |\n|                              |                 | used in Stored           |\n|                              |                 | Procedures. MDEV-10578   |\n+------------------------------+-----------------+--------------------------+\n| SQLERRM                      | 10.3            | Returns the error        |\n|                              |                 | message associdated to   |\n|                              |                 | it\'s error number        |\n|                              |                 | argument or SQLCODE if   |\n|                              |                 | no argument is given.    |\n|                              |                 | Can only be used in      |\n|                              |                 | Stored Procedures.       |\n|                              |                 | MDEV-10578               |\n+------------------------------+-----------------+--------------------------+\n| SQL%ROWCOUNT                 | 10.3            | Almost same as           |\n|                              |                 | ROW_COUNT(). MDEV-10583  |\n+------------------------------+-----------------+--------------------------+\n| ROWNUM                       | 10.6.1          | Returns number of        |\n|                              |                 | accepted rows            |\n+------------------------------+-----------------+--------------------------+\n\nExceptions\n----------\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| BEGIN ... EXCEPTION WHEN OTHERS THEN    | Exception handlers are declared   |\n| BEGIN ..  END; END;                     | at the end of a block             |\n+-----------------------------------------+-----------------------------------+\n| TOO_MANY_ROWS, NO_DATA_FOUND,           | Predefined exceptions. MDEV-10839 |\n| DUP_VAL_ON_INDEX                        |                                   |\n+-----------------------------------------+-----------------------------------+\n| RAISE TOO_MANY_ROWS ; .... EXCEPTION    | Exception can be used with RAISE  |\n| WHEN TOO_MANY_ROWS THEN ...             | and EXCEPTION...WHEN. MDEV-10840  |\n+-----------------------------------------+-----------------------------------+\n| CREATE OR REPLACE FUNCTION f1 (a INT)   | User defined exceptions.          |\n| RETURN INT AS e1 EXCEPTION...           | MDEV-10587                        |\n+-----------------------------------------+-----------------------------------+\n\nBEGIN Blocks\n------------\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| BEGIN to start a block                  | MariaDB uses BEGIN NOT ATOMIC     |\n|                                         | for anyonymous blocks. MDEV-10655 |\n+-----------------------------------------+-----------------------------------+\n| DECLARE is used before BEGIN            | DECLARE a INT; b VARCHAR(10);     |\n|                                         | BEGIN v:= 10; END;                |\n+-----------------------------------------+-----------------------------------+\n| WHEN DUP_VAL_ON_INDEX THEN NULL ;       | Do not require BEGIN..END in      |\n| NULL; WHEN OTHERS THEN NULL             | multi-statement exception         |\n|                                         | handlers in THEN clause.          |\n|                                         | MDEV-12088                        |\n+-----------------------------------------+-----------------------------------+\n\nSimple Syntax Compatibility\n---------------------------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| ELSIF                        | 10.3            | ANSI uses ELSEIF         |\n+------------------------------+-----------------+--------------------------+\n| SELECT UNIQUE                | 10.3            | Same as SELECT           |\n|                              |                 | DISTINCT. MDEV-12086     |\n+------------------------------+-----------------+--------------------------+\n| TRUNCATE TABLE t1 [DROP      | 10.3            | DROP STORAGE and REUSE   |\n| STORAGE] or [REUSE STORAGE]  |                 | STORAGE are allowed as   |\n|                              |                 | optional keywords for    |\n|                              |                 | TRUNCATE TABLE.          |\n|                              |                 | MDEV-10588               |\n+------------------------------+-----------------+--------------------------+\n| Subqueries in a FROM clause  | 10.6            | SELECT * FROM (SELECT 1  |\n| without an alias             |                 | FROM DUAL), (SELECT 2    |\n|                              |                 | FROM DUAL)               |\n+------------------------------+-----------------+--------------------------+\n| UNION, EXCEPT and INTERSECT  | 10.3            | INTERSECT has higher     |\n| all have the same            |                 | precedence than UNION    |\n| precedence.                  |                 | and EXCEPT in            |\n|                              |                 | non-Oracle modes.        |\n+------------------------------+-----------------+--------------------------+\n| MINUS                        | 10.6            | MINUS is a synonym for   |\n|                              |                 | EXCEPT.                  |\n+------------------------------+-----------------+--------------------------+\n\nFunctions\n---------\n\n+------------------------------+-----------------+--------------------------+\n| Oracle syntax                | Version         | Description              |\n+------------------------------+-----------------+--------------------------+\n| ADD_MONTHS()                 | 10.6.1          | Added as a wrapper for   |\n|                              |                 | DATE_ADD() to enhance    |\n|                              |                 | Oracle compatibility.    |\n|                              |                 | All modes.               |\n+------------------------------+-----------------+--------------------------+\n| CAST(expr as VARCHAR(N))     | 10.3            | Cast expression to a     |\n|                              |                 | VARCHAR(N). MDEV-11275   |\n+------------------------------+-----------------+--------------------------+\n| DECODE                       | 10.3            | In Oracle mode,          |\n|                              |                 | compares and matches     |\n|                              |                 | search expressions       |\n+------------------------------+-----------------+--------------------------+\n| LENGTH() is same as          | 10.3            | MariaDB translates       |\n| CHAR_LENGTH()                |                 | LENGTH() to              |\n|                              |                 | OCTET_LENGTH(). In all   |\n|                              |                 | modes one can use        |\n|                              |                 | LENGTHB() as a synonym   |\n|                              |                 | to OCTET_LENGTH()        |\n+------------------------------+-----------------+--------------------------+\n| CHR(num)                     | 10.3            | Returns a VARCHAR(1)     |\n|                              |                 | with character set and   |\n|                              |                 | collation according to   |\n|                              |                 | @@character_set_database |\n|                              |                 | and @@collation_database |\n+------------------------------+-----------------+--------------------------+\n| substr(\'abc\',0 ,3) same as   | 10.3            | Position 0 for substr()  |\n| substr(\'abc\', 1 ,3)          |                 | is same as position 1    |\n+------------------------------+-----------------+--------------------------+\n| SYS_GUID                     | 10.6.1          | Generates a globally     |\n|                              |                 | unique identifier.       |\n|                              |                 | Similar to UUID but      |\n|                              |                 | without the -. All       |\n|                              |                 | modes.                   |\n+------------------------------+-----------------+--------------------------+\n| TO_CHAR                      | 10.6.1          | Added to enhance Oracle  |\n|                              |                 | compatibility. All       |\n|                              |                 | modes.                   |\n+------------------------------+-----------------+--------------------------+\n| TRIM, LTRIM, RTRIM, LPAD     | 10.3            | Returns NULL instead of  |\n| and RPAD                     |                 | an empty string if       |\n|                              |                 | returning an empty       |\n|                              |                 | result. These functions  |\n|                              |                 | can also be accessed     |\n|                              |                 | outside of ORACLE mode   |\n|                              |                 | by suffixing _ORACLE     |\n|                              |                 | onto the end of the      |\n|                              |                 | function name, such as   |\n|                              |                 | TRIM_ORACLE.             |\n+------------------------------+-----------------+--------------------------+\n\nPrepared Statements\n-------------------\n\nOracle mode makes the following changes to Prepared Statements:\n\n+-----------------------------------------+-----------------------------------+\n| Oracle syntax                           | Description                       |\n+-----------------------------------------+-----------------------------------+\n| PREPARE stmt FROM \'SELECT :1, :2\'       | ANSI uses ?. MDEV-10801           |\n+-----------------------------------------+-----------------------------------+\n| EXECUTE IMMEDIATE \'INSERT INTO t1       | Dynamic placeholders. MDEV-10801  |\n| SELECT (:x,:y) FROM DUAL\' USING 10,20   |                                   |\n+-----------------------------------------+-----------------------------------+\n\nSynonyms for Basic SQL Types\n----------------------------\n\n+--------------------------------+-------------------------------------------+\n| Oracle type                    | MariaDB synonym                           |\n+--------------------------------+-------------------------------------------+\n| VARCHAR2                       | VARCHAR                                   |\n+--------------------------------+-------------------------------------------+\n| NUMBER                         | DECIMAL                                   |\n+--------------------------------+-------------------------------------------+\n| DATE (with time portion)       | MariaDB DATETIME                          |\n+--------------------------------+-------------------------------------------+\n| RAW                            | VARBINARY                                 |\n+--------------------------------+-------------------------------------------+\n| CLOB                           | LONGTEXT                                  |\n+--------------------------------+-------------------------------------------+\n| BLOB                           | LONGBLOB                                  |\n+--------------------------------+-------------------------------------------+\n\nThis was implemented as part of MDEV-10343.\n\nIf one does a SHOW CREATE TABLE in ORACLE mode on a table that has a native\nMariaDB DATE column, it will be displayed as mariadb_schema.date to not\nconflict with the Oracle DATE type.\n\nPackages\n--------\n\nThe following syntax has been supported since MariaDB 10.3.5:\n\n* CREATE PACKAGE\n* CREATE PACKAGE BODY\n* DROP PACKAGE\n* DROP PACKAGE BODY\n* SHOW CREATE PACKAGE\n* SHOW CREATE PACKAGE BODY\n\nNULL Handling\n-------------\n\nOracle mode makes the following changes to NULL handling:\n\nNULL As a Statement\n-------------------\n\nNULL can be used as a statement:\n\nIF a=10 THEN NULL; ELSE NULL; END IF\n\nTranslating Empty String Literals to NULL\n-----------------------------------------\n\nIn Oracle, empty string (\'\') and NULL are the same thing,\n\nBy using sql_mode=EMPTY_STRING_IS_NULL you can get a similar experience in\nMariaDB:\n\nSET sql_mode=EMPTY_STRING_IS_NULL;\nSELECT \'\' IS NULL; -- returns TRUE\nINSERT INTO t1 VALUES (\'\'); -- inserts NULL\n\nConcat Operator Ignores NULL\n----------------------------\n\nCONCAT() and || ignore NULL in Oracle mode. Can also be accessed outside of\nORACLE mode by using CONCAT_OPERATOR_ORACLE. MDEV-11880 and MDEV-12143.\n\nReserved Words\n--------------\n\nThere are a number of extra reserved words in Oracle mode.\n\nSHOW CREATE TABLE\n-----------------\n\nThe SHOW CREATE TABLE statement will not display MariaDB-specific table\noptions, such as AUTO_INCREMENT or CHARSET, when Oracle mode is set.\n\nURL: https://mariadb.com/kb/en/sql_modeoracle/','','https://mariadb.com/kb/en/sql_modeoracle/'),
(489,'CONTAINS',30,'Syntax\n------\n\nContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2. CONTAINS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_CONTAINS() uses object shapes.\n\nThis tests the opposite relationship to Within().\n\nURL: https://mariadb.com/kb/en/contains/','','https://mariadb.com/kb/en/contains/'),
(490,'CROSSES',30,'Syntax\n------\n\nCrosses(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon or a\nMultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise, returns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nCROSSES() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_CROSSES() uses object shapes.\n\nURL: https://mariadb.com/kb/en/crosses/','','https://mariadb.com/kb/en/crosses/'),
(202,'DEFAULT',17,'Syntax\n------\n\nDEFAULT(col_name)\n\nDescription\n-----------\n\nReturns the default value for a table column. If the column has no default\nvalue (and is not NULLABLE - NULLABLE fields have a NULL default), an error is\nreturned.\n\nFor integer columns using AUTO_INCREMENT, 0 is returned.\n\nWhen using DEFAULT as a value to set in an INSERT or UPDATE statement, you can\nuse the bare keyword DEFAULT without the parentheses and argument to refer to\nthe column in context. You can only use DEFAULT as a bare keyword if you are\nusing it alone without a surrounding expression or function.\n\nExamples\n--------\n\nSelect only non-default values for a column:\n\nSELECT i FROM t WHERE i != DEFAULT(i);\n\nUpdate values to be one greater than the default value:\n\nUPDATE t SET i = DEFAULT(i)+1 WHERE i < 100;\n\nWhen referring to the default value exactly in UPDATE or INSERT, you can omit\nthe argument:\n\nINSERT INTO t (i) VALUES (DEFAULT);\nUPDATE t SET i = DEFAULT WHERE i < 100;\n\nCREATE OR REPLACE TABLE t (\n i INT NOT NULL AUTO_INCREMENT,\n j INT NOT NULL,\n k INT DEFAULT 3,\n l INT NOT NULL DEFAULT 4,\n m INT,\n PRIMARY KEY (i)\n);\n\nDESC t;\n+-------+---------+------+-----+---------+----------------+\n| Field | Type    | Null | Key | Default | Extra          |\n+-------+---------+------+-----+---------+----------------+\n| i     | int(11) | NO   | PRI | NULL    | auto_increment |\n| j     | int(11) | NO   |     | NULL    |                |\n| k     | int(11) | YES  |     | 3       |                |\n| l     | int(11) | NO   |     | 4       |                |\n| m     | int(11) | YES  |     | NULL    |                |\n+-------+---------+------+-----+---------+----------------+\n\nINSERT INTO t (j) VALUES (1);\nINSERT INTO t (j,m) VALUES (2,2);\nINSERT INTO t (j,l,m) VALUES (3,3,3);\n\nSELECT * FROM t;\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n| 3 | 3 |    3 | 3 |    3 |\n+---+---+------+---+------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m) FROM t;\n+------------+------------+-------------+------------+\n| DEFAULT(i) | DEFAULT(k) | DEFAULT (l) | DEFAULT(m) |\n+------------+------------+-------------+------------+\n|          0 |          3 |           4 |       NULL |\n|          0 |          3 |           4 |       NULL |\n|          0 |          3 |           4 |       NULL |\n+------------+------------+-------------+------------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m), DEFAULT(j)  FROM t;\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE i = DEFAULT(i);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE j = DEFAULT(j);\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE k = DEFAULT(k);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n| 3 | 3 |    3 | 3 |    3 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE l = DEFAULT(l);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n| 2 | 2 |    3 | 4 |    2 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE m = DEFAULT(m);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE m <=> DEFAULT(m);\n+---+---+------+---+------+\n| i | j | k    | l | m    |\n+---+---+------+---+------+\n| 1 | 1 |    3 | 4 | NULL |\n+---+---+------+---+------+\n\nURL: https://mariadb.com/kb/en/default/','','https://mariadb.com/kb/en/default/'),
(208,'ROW_COUNT',17,'Syntax\n------\n\nROW_COUNT()\n\nDescription\n-----------\n\nROW_COUNT() returns the number of rows updated, inserted or deleted by the\npreceding statement. This is the same as the row count that the mariadb client\ndisplays and the value from the mysql_affected_rows() C API function.\n\nGenerally:\n\n* For statements which return a result set (such as SELECT, SHOW, DESC or\nHELP), returns -1, even when the result set is empty. This is also true for\nadministrative statements, such as OPTIMIZE.\n* For DML statements other than SELECT and for ALTER TABLE, returns the number\nof affected rows.\n* For DDL statements (including TRUNCATE) and for other statements which don\'t\nreturn any result set (such as USE, DO, SIGNAL or DEALLOCATE PREPARE), returns\n0.\n\nFor UPDATE, affected rows is by default the number of rows that were actually\nchanged. If the CLIENT_FOUND_ROWS flag to mysql_real_connect() is specified\nwhen connecting to mysqld, affected rows is instead the number of rows matched\nby the WHERE clause.\n\nFor REPLACE, deleted rows are also counted. So, if REPLACE deletes a row and\nadds a new row, ROW_COUNT() returns 2.\n\nFor INSERT ... ON DUPLICATE KEY, updated rows are counted twice. So, if INSERT\nadds a new rows and modifies another row, ROW_COUNT() returns 3.\n\nROW_COUNT() does not take into account rows that are not directly\ndeleted/updated by the last statement. This means that rows deleted by foreign\nkeys or triggers are not counted.\n\nWarning: You can use ROW_COUNT() with prepared statements, but you need to\ncall it after EXECUTE, not after DEALLOCATE PREPARE, because the row count for\nallocate prepare is always 0.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows affected by the last statement in the procedure, not by the whole\nprocedure.\n\nWarning: After INSERT DELAYED, ROW_COUNT() returns the number of the rows you\ntried to insert, not the number of the successful writes.\n\nThis information can also be found in the diagnostics area.\n\nStatements using the ROW_COUNT() function are not safe for replication.\n\nExamples\n--------\n\nCREATE TABLE t (A INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           3 |\n+-------------+\n\nDELETE FROM t WHERE A IN(1,2);\n\nSELECT ROW_COUNT(); \n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           2 |\n+-------------+\n\nExample with prepared statements:\n\nSET @q = \'INSERT INTO t VALUES(1),(2),(3);\';\n\nPREPARE stmt FROM @q;\n\nEXECUTE stmt;\nQuery OK, 3 rows affected (0.39 sec)\nRecords: 3  Duplicates: 0  Warnings: 0\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n|           3 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/row_count/','','https://mariadb.com/kb/en/row_count/'),
(491,'DISJOINT',30,'Syntax\n------\n\nDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does not\nintersect) g2.\n\nDISJOINT() tests the opposite relationship to INTERSECTS().\n\nDISJOINT() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_DISJOINT() uses object shapes.\n\nURL: https://mariadb.com/kb/en/disjoint/','','https://mariadb.com/kb/en/disjoint/'),
(492,'EQUALS',30,'Syntax\n------\n\nEquals(g1,g2)\n\nFrom MariaDB 10.2.3:\n\nMBREQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nEQUALS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_EQUALS() uses object shapes.\n\nFrom MariaDB 10.2.3, MBREQUALS is a synonym for Equals.\n\nURL: https://mariadb.com/kb/en/equals/','','https://mariadb.com/kb/en/equals/'),
(493,'INTERSECTS',30,'Syntax\n------\n\nINTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nINTERSECTS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_INTERSECTS() uses object shapes.\n\nINTERSECTS() tests the opposite relationship to DISJOINT().\n\nURL: https://mariadb.com/kb/en/intersects/','','https://mariadb.com/kb/en/intersects/'),
(204,'LAST_INSERT_ID',17,'Syntax\n------\n\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nDescription\n-----------\n\nLAST_INSERT_ID() (no arguments) returns the first automatically generated\nvalue successfully inserted for an AUTO_INCREMENT column as a result of the\nmost recently executed INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nIf one gives an argument to LAST_INSERT_ID(), then it will return the value of\nthe expression and the next call to LAST_INSERT_ID() will return the same\nvalue. The value will also be sent to the client and can be accessed by the\nmysql_insert_id function.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT value, you\ncan get the value like this:\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                9 |\n+------------------+\n\nYou can also use LAST_INSERT_ID() to delete the last inserted row:\n\nDELETE FROM product WHERE id = LAST_INSERT_ID();\n\nIf no rows were successfully inserted, LAST_INSERT_ID() returns 0.\n\nThe value of LAST_INSERT_ID() will be consistent across all versions if all\nrows in the INSERT or UPDATE statement were successful.\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value with one\nstatement, and then refer to LAST_INSERT_ID() in a multiple-row INSERT\nstatement that inserts rows into a table with its own AUTO_INCREMENT column.\nThe value of LAST_INSERT_ID() will remain stable in the second statement; its\nvalue for the second and later rows is not affected by the earlier row\ninsertions. (However, if you mix references to LAST_INSERT_ID() and\nLAST_INSERT_ID(expr), the effect is undefined.)\n\nIf the previous statement returned an error, the value of LAST_INSERT_ID() is\nundefined. For transactional tables, if the statement is rolled back due to an\nerror, the value of LAST_INSERT_ID() is left undefined. For manual ROLLBACK,\nthe value of LAST_INSERT_ID() is not restored to that before the transaction;\nit remains as it was at the point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a trigger, the\nvalue of LAST_INSERT_ID() changes the same way as for statements executed\noutside the body of these kinds of objects. The effect of a stored routine or\ntrigger upon the value of LAST_INSERT_ID() that is seen by following\nstatements depends on the kind of routine:\n\n* If a stored procedure executes statements that change the value of\nLAST_INSERT_ID(), the new value will be seen by statements that follow the\nprocedure call.\n\n* For stored functions and triggers that change the value, the value is\nrestored when the function or trigger ends, so following statements will not\nsee a changed value.\n\nExamples\n--------\n\nCREATE TABLE t (\n id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n f VARCHAR(1))\nENGINE = InnoDB;\n\nINSERT INTO t(f) VALUES(\'a\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                1 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'b\');\n\nINSERT INTO t(f) VALUES(\'c\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                3 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'d\'),(\'e\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                4 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n|                 12 |\n+--------------------+\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|               12 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'f\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n|                6 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n|  6 | f    |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n|                 12 |\n+--------------------+\n\nINSERT INTO t(f) VALUES(\'g\');\n\nSELECT * FROM t;\n+----+------+\n| id | f    |\n+----+------+\n|  1 | a    |\n|  2 | b    |\n|  3 | c    |\n|  4 | d    |\n|  5 | e    |\n|  6 | f    |\n|  7 | g    |\n+----+------+\n\nURL: https://mariadb.com/kb/en/last_insert_id/','','https://mariadb.com/kb/en/last_insert_id/'),
(212,'USER',17,'Syntax\n------\n\nUSER()\n\nDescription\n-----------\n\nReturns the current MariaDB user name and host name, given when authenticating\nto MariaDB, as a string in the utf8 character set.\n\nNote that the value of USER() may differ from the value of CURRENT_USER(),\nwhich is the user used to authenticate the current client. CURRENT_ROLE()\nreturns the current active role.\n\nSYSTEM_USER() and SESSION_USER are synonyms for USER().\n\nStatements using the USER() function or one of its synonyms are not safe for\nstatement level replication.\n\nExamples\n--------\n\nshell> mysql --user=\"anonymous\"\n\nSELECT USER(),CURRENT_USER();\n+---------------------+----------------+\n| USER()              | CURRENT_USER() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost     |\n+---------------------+----------------+\n\nTo select only the IP address, use SUBSTRING_INDEX(),\n\nSELECT SUBSTRING_INDEX(USER(), \'@\', -1);\n+----------------------------------+\n| SUBSTRING_INDEX(USER(), \'@\', -1) |\n+----------------------------------+\n| 192.168.0.101                    |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/user/','','https://mariadb.com/kb/en/user/'),
(494,'OVERLAPS',30,'Syntax\n------\n\nOVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their intersection\nresults in a geometry of the same dimension but not equal to either of the\ngiven geometries.\n\nOVERLAPS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_OVERLAPS() uses object shapes.\n\nURL: https://mariadb.com/kb/en/overlaps/','','https://mariadb.com/kb/en/overlaps/'),
(497,'ST_DIFFERENCE',30,'Syntax\n------\n\nST_DIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry representing the point set difference of the given geometry\nvalues.\n\nExample\n-------\n\nSET @g1 = POINT(10,10), @g2 = POINT(20,20);\n\nSELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(10 10)                       |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_difference/','','https://mariadb.com/kb/en/st_difference/'),
(499,'ST_DISTANCE',30,'Syntax\n------\n\nST_DISTANCE(g1,g2)\n\nDescription\n-----------\n\nReturns the distance between two geometries, or null if not given valid inputs.\n\nExample\n-------\n\nSELECT ST_Distance(POINT(1,2),POINT(2,2));\n+------------------------------------+\n| ST_Distance(POINT(1,2),POINT(2,2)) |\n+------------------------------------+\n|                                  1 |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_distance/','','https://mariadb.com/kb/en/st_distance/'),
(205,'LAST_VALUE',17,'Syntax\n------\n\nLAST_VALUE(expr,[expr,...])\n\nLAST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nLAST_VALUE() evaluates all expressions and returns the last.\n\nThis is useful together with setting user variables to a value with\n@var:=expr, for example when you want to get data of rows updated/deleted\nwithout having to do two queries against the table.\n\nLAST_VALUE can be used as a window function.\n\nReturns NULL if no last value exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (a int, b int);\nINSERT INTO t1 VALUES(1,10),(2,20);\nDELETE FROM t1 WHERE a=1 AND last_value(@a:=a,@b:=b,1);\nSELECT @a,@b;\n+------+------+\n| @a   | @b   |\n+------+------+\n|    1 |   10 |\n+------+------+\n\nAs a window function:\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1,    \'one\',    0.1,  0.001),\n( 2, 0, 2,    \'two\',    0.2,  0.002),\n( 3, 0, 3,    \'three\',  0.3,  0.003),\n( 4, 1, 2,    \'three\',  0.4,  0.004),\n( 5, 1, 1,    \'two\',    0.5,  0.005),\n( 6, 1, 1,    \'one\',    0.6,  0.006),\n( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n( 9, 2, 2,    NULL,     0.7,  0.009),\n(10, 2, 0,    \'n_four\', 0.8,  0.010),\n(11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n     LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n     FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n     LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 |         1 |       11 |         11 |        11 |\n| 10 |         1 |       10 |         11 |        10 |\n|  9 |         1 |        9 |         11 |         9 |\n|  8 |         1 |        8 |         11 |         8 |\n|  7 |         1 |        7 |         11 |         7 |\n|  6 |         1 |        6 |         11 |         6 |\n|  5 |         1 |        5 |         11 |         5 |\n|  4 |         1 |        4 |         11 |         4 |\n|  3 |         1 |        3 |         11 |         3 |\n|  2 |         1 |        2 |         11 |         2 |\n|  1 |         1 |        1 |         11 |         1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nl_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nl_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nl_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i    | f_1f | l_1f | f_1p1f | l_1p1f | f_2p1p | l_2p1p | f_1f2f | l_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n|    1 |    1 |    2 |      1 |      2 |   NULL |   NULL |      2 |      3 |\n|    2 |    2 |    3 |      1 |      3 |      1 |      1 |      3 |      4 |\n|    3 |    3 |    4 |      2 |      4 |      1 |      2 |      4 |      5 |\n|    4 |    4 |    5 |      3 |      5 |      2 |      3 |      5 |      6 |\n|    5 |    5 |    6 |      4 |      6 |      3 |      4 |      6 |      7 |\n|    6 |    6 |    7 |      5 |      7 |      4 |      5 |      7 |      8 |\n|    7 |    7 |    8 |      6 |      8 |      5 |      6 |      8 |      9 |\n|    8 |    8 |    9 |      7 |      9 |      6 |      7 |      9 |     10 |\n|    9 |    9 |   10 |      8 |     10 |      7 |      8 |     10 |     10 |\n|   10 |   10 |   10 |      9 |     10 |      8 |      9 |   NULL |   NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\nURL: https://mariadb.com/kb/en/last_value/','','https://mariadb.com/kb/en/last_value/'),
(213,'VERSION',17,'Syntax\n------\n\nVERSION()\n\nDescription\n-----------\n\nReturns a string that indicates the MariaDB server version. The string uses\nthe utf8 character set.\n\nExamples\n--------\n\nSELECT VERSION();\n+----------------+\n| VERSION()      |\n+----------------+\n| 10.4.7-MariaDB |\n+----------------+\n\nThe VERSION() string may have one or more of the following suffixes:\n\n+---------------------------+------------------------------------------------+\n| Suffix                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| -embedded                 | The server is an embedded server               |\n|                           | (libmariadbd).                                 |\n+---------------------------+------------------------------------------------+\n| -log                      | General logging, slow logging or binary        |\n|                           | (replication) logging is enabled.              |\n+---------------------------+------------------------------------------------+\n| -debug                    | The server is compiled for debugging.          |\n+---------------------------+------------------------------------------------+\n| -valgrind                 | The server is compiled to be instrumented      |\n|                           | with valgrind.                                 |\n+---------------------------+------------------------------------------------+\n\nChanging the Version String\n---------------------------\n\nSome old legacy code may break because they are parsing the VERSION string and\nexpecting a MySQL string or a simple version string like Joomla til API17, see\nMDEV-7780.\n\nOne can fool these applications by setting the version string from the command\nline or the my.cnf files with --version=....\n\nURL: https://mariadb.com/kb/en/version/','','https://mariadb.com/kb/en/version/'),
(500,'ST_DISTANCE_SPHERE',30,'MariaDB starting with 10.2.38\n-----------------------------\nST_DISTANCE_SPHERE was introduced in MariaDB 10.2.38, MariaDB 10.3.29, MariaDB\n10.4.19 and MariaDB 10.5.10.\n\nSyntax\n------\n\nST_DISTANCE_SPHERE(g1,g2,[r])\n\nDescription\n-----------\n\nReturns the spherical distance between two geometries (point or multipoint) on\na sphere with the optional radius r (default is the Earth radius if r is not\nspecified), or NULL if not given valid inputs.\n\nExample\n-------\n\nset @zenica   = ST_GeomFromText(\'POINT(17.907743 44.203438)\');\nset @sarajevo = ST_GeomFromText(\'POINT(18.413076 43.856258)\');\nSELECT ST_Distance_Sphere(@zenica, @sarajevo);\n55878.59337591705\n\nURL: https://mariadb.com/kb/en/st_distance_sphere/','','https://mariadb.com/kb/en/st_distance_sphere/'),
(503,'ST_LENGTH',30,'Syntax\n------\n\nST_LENGTH(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT ST_LENGTH(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_LENGTH(ST_GeomFromText(@ls)) |\n+---------------------------------+\n|                2.82842712474619 |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/st_length/','','https://mariadb.com/kb/en/st_length/'),
(207,'ROWNUM',17,'MariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6.1, the ROWNUM() function is supported.\n\nSyntax\n------\n\nROWNUM()\n\nIn Oracle mode one can just use ROWNUM, without the parentheses.\n\nDescription\n-----------\n\nROWNUM() returns the current number of accepted rows in the current context.\nIt main purpose is to emulate the ROWNUM pseudo column in Oracle. For MariaDB\nnative applications, we recommend the usage of LIMIT, as it is easier to use\nand gives more predictable results than the usage of ROWNUM().\n\nThe main difference between using LIMIT and ROWNUM() to limit the rows in the\nresult is that LIMIT works on the result set while ROWNUM works on the number\nof accepted rows (before any ORDER or GROUP BY clauses).\n\nThe following queries will return the same results:\n\nSELECT * from t1 LIMIT 10;\nSELECT * from t1 WHERE ROWNUM() <= 10;\n\nWhile the following may return different results based on in which orders the\nrows are found:\n\nSELECT * from t1 ORDER BY a LIMIT 10;\nSELECT * from t1 ORDER BY a WHERE ROWNUM() <= 10;\n\nThe recommended way to use ROWNUM to limit the number of returned rows and get\npredictable results is to have the query in a subquery and test for ROWNUM()\nin the outer query:\n\nSELECT * FROM (select * from t1 ORDER BY a) WHERE ROWNUM() <= 10;\n\nROWNUM() can be used in the following contexts:\n\n* SELECT\n* INSERT\n* UPDATE\n* DELETE\n* LOAD DATA INFILE\n\nUsed in other contexts, ROWNUM() will return 0.\n\nExamples\n--------\n\nINSERT INTO t1 VALUES (1,ROWNUM()),(2,ROWNUM()),(3,ROWNUM());\n\nINSERT INTO t1 VALUES (1),(2) returning a, ROWNUM();\n\nUPDATE t1 SET row_num_column=ROWNUM();\n\nDELETE FROM t1 WHERE a < 10 AND ROWNUM() < 2;\n\nLOAD DATA INFILE \'filename\' into table t1 fields terminated by \',\' \n lines terminated by \"\\r\\n\" (a,b) set c=ROWNUM();\n\nOptimizations\n-------------\n\nIn many cases where ROWNUM() is used, MariaDB will use the same optimizations\nit uses with LIMIT.\n\nLIMIT optimization is possible when using ROWNUM in the following manner:\n\n* When one is in a top level WHERE clause comparing ROWNUM() with a numerical\nconstant using any of the following expressions:\nROWNUM() < number\nROWNUM() <= number\nROWNUM() = 1\nROWNUM() can be also be the right argument to the comparison function.\n\nIn the above cases, LIMIT optimization can be done in the following cases:\n\n* For the current sub query when the ROWNUM comparison is done on the top\nlevel:\n\nSELECT * from t1 WHERE ROWNUM() <= 2 AND t1.a > 0\n\n* For an inner sub query, when the upper level has only a ROWNUM() comparison\nin the WHERE clause:\n\nSELECT * from (select * from t1) as t WHERE ROWNUM() <= 2\n\nOther Changes Related to ROWNUM\n-------------------------------\n\nWhen ROWNUM() is used anywhere in a query, the optimization to ignore ORDER BY\nin subqueries are disabled.\n\nThis was done to get the following common Oracle query to work as expected:\n\nselect * from (select * from t1 order by a desc) as t where rownum() <= 2;\n\nBy default MariaDB ignores any ORDER BY in subqueries both because the SQL\nstandard defines results sets in subqueries to be un-ordered and because of\nperformance reasons (especially when using views in subqueries). See MDEV-3926\n\"Wrong result with GROUP BY ... WITH ROLLUP\" for a discussion of this topic.\n\nOther Considerations\n--------------------\n\nWhile MariaDB tries to emulate Oracle\'s usage of ROWNUM() as closely as\npossible, there are cases where the result is different:\n\n* When the optimizer finds rows in a different order (because of different\nstorage methods or optimization). This may also happen in Oracle if one adds\nor deletes an index, in which case the rows may be found in a different order.\n\nNote that usage of ROWNUM() in functions or stored procedures will use their\nown context, not the caller\'s context.\n\nURL: https://mariadb.com/kb/en/rownum/','','https://mariadb.com/kb/en/rownum/'),
(215,'Assignment Operator (=)',18,'Syntax\n------\n\nidentifier = expr\n\nDescription\n-----------\n\nThe equal sign is used as both an assignment operator in certain contexts, and\nas a comparison operator. When used as assignment operator, the value on the\nright is assigned to the variable (or column, in some contexts) on the left.\n\nSince its use can be ambiguous, unlike the := assignment operator, the =\nassignment operator cannot be used in all contexts, and is only valid as part\nof a SET statement, or the SET clause of an UPDATE statement\n\nThis operator works with both user-defined variables and local variables.\n\nExamples\n--------\n\nUPDATE table_name SET x = 2 WHERE x > 100;\n\nSET @x = 1, @y := 2;\n\nURL: https://mariadb.com/kb/en/assignment-operators-assignment-operator/','','https://mariadb.com/kb/en/assignment-operators-assignment-operator/'),
(216,'Not Equal Operator',19,'Syntax\n------\n\n<>, !=\n\nDescription\n-----------\n\nNot equal operator. Evaluates both SQL expressions and returns 1 if they are\nnot equal and 0 if they are equal, or NULL if either expression is NULL. If\nthe expressions return different data types, (for instance, a number and a\nstring), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) != (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a != t2.x) OR (t1.b != t2.y)\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT \'.01\' <> \'0.01\';\n+-----------------+\n| \'.01\' <> \'0.01\' |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT .01 <> \'0.01\';\n+---------------+\n| .01 <> \'0.01\' |\n+---------------+\n|             0 |\n+---------------+\n\nSELECT \'zapp\' <> \'zappp\';\n+-------------------+\n| \'zapp\' <> \'zappp\' |\n+-------------------+\n|                 1 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/not-equal/','','https://mariadb.com/kb/en/not-equal/'),
(504,'ST_OVERLAPS',30,'Syntax\n------\n\nST_OVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially overlaps geometry g2.\n\nThe term spatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal to\neither of the given geometries.\n\nST_OVERLAPS() uses object shapes, while OVERLAPS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nURL: https://mariadb.com/kb/en/st-overlaps/','','https://mariadb.com/kb/en/st-overlaps/'),
(507,'TOUCHES',30,'Syntax\n------\n\nTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two geometries\nspatially touch if the interiors of the geometries do not intersect, but the\nboundary of one of the geometries intersects either the boundary or the\ninterior of the other.\n\nTOUCHES() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_TOUCHES() uses object shapes.\n\nURL: https://mariadb.com/kb/en/touches/','','https://mariadb.com/kb/en/touches/'),
(516,'CURRENT_DATE',31,'Syntax\n------\n\nCURRENT_DATE, CURRENT_DATE()\n\nDescription\n-----------\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: https://mariadb.com/kb/en/current_date/','','https://mariadb.com/kb/en/current_date/'),
(517,'CURRENT_TIME',31,'Syntax\n------\n\nCURRENT_TIME\nCURRENT_TIME([precision])\n\nDescription\n-----------\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: https://mariadb.com/kb/en/current_time/','','https://mariadb.com/kb/en/current_time/'),
(518,'CURRENT_TIMESTAMP',31,'Syntax\n------\n\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\n\nDescription\n-----------\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/current_timestamp/','','https://mariadb.com/kb/en/current_timestamp/'),
(217,'<',19,'Syntax\n------\n\n<\n\nDescription\n-----------\n\nLess than operator. Evaluates both SQL expressions and returns 1 if the left\nvalue is less than the right value and 0 if it is not, or NULL if either\nexpression is NULL. If the expressions return different data types, (for\ninstance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) < (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b < t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 < 2;\n+-------+\n| 2 < 2 |\n+-------+\n|     0 |\n+-------+\n\nType conversion:\n\nSELECT 3<\'4\';\n+-------+\n| 3<\'4\' |\n+-------+\n|     1 |\n+-------+\n\nCase insensitivity - see Character Sets and Collations:\n\nSELECT \'a\'<\'A\';\n+---------+\n| \'a\'<\'A\' |\n+---------+\n|       0 |\n+---------+\n\nURL: https://mariadb.com/kb/en/less-than/','','https://mariadb.com/kb/en/less-than/'),
(218,'<=',19,'Syntax\n------\n\n<=\n\nDescription\n-----------\n\nLess than or equal operator. Evaluates both SQL expressions and returns 1 if\nthe left value is less than or equal to the right value and 0 if it is not, or\nNULL if either expression is NULL. If the expressions return different data\ntypes, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b <= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 0.1 <= 2;\n+----------+\n| 0.1 <= 2 |\n+----------+\n|        1 |\n+----------+\n\nSELECT \'a\'<=\'A\';\n+----------+\n| \'a\'<=\'A\' |\n+----------+\n|        1 |\n+----------+\n\nURL: https://mariadb.com/kb/en/less-than-or-equal/','','https://mariadb.com/kb/en/less-than-or-equal/'),
(219,'<=>',19,'Syntax\n------\n\n<=>\n\nDescription\n-----------\n\nNULL-safe equal operator. It performs an equality comparison like the =\noperator, but returns 1 rather than NULL if both operands are NULL, and 0\nrather than NULL if one operand is NULL.\n\na <=> b is equivalent to a = b OR (a IS NULL AND b IS NULL).\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <=> (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a <=> t2.x) AND (t1.b <=> t2.y)\nFROM t1 INNER JOIN t2;\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n+---------+---------------+------------+\n| 1 <=> 1 | NULL <=> NULL | 1 <=> NULL |\n+---------+---------------+------------+\n|       1 |             1 |          0 |\n+---------+---------------+------------+\n\nSELECT 1 = 1, NULL = NULL, 1 = NULL;\n+-------+-------------+----------+\n| 1 = 1 | NULL = NULL | 1 = NULL |\n+-------+-------------+----------+\n|     1 |        NULL |     NULL |\n+-------+-------------+----------+\n\nURL: https://mariadb.com/kb/en/null-safe-equal/','','https://mariadb.com/kb/en/null-safe-equal/'),
(220,'=',19,'Syntax\n------\n\nleft_expr = right_expr\n\nDescription\n-----------\n\nEqual operator. Evaluates both SQL expressions and returns 1 if they are\nequal, 0 if they are not equal, or NULL if either expression is NULL. If the\nexpressions return different data types (for example, a number and a string),\na type conversion is performed.\n\nWhen used in row comparisons these two queries are synonymous and return the\nsame results:\n\nSELECT (t1.a, t1.b) = (t2.x, t2.y) FROM t1 INNER JOIN t2;\n\nSELECT (t1.a = t2.x) AND (t1.b = t2.y) FROM t1 INNER JOIN t2;\n\nTo perform a NULL-safe comparison, use the <=> operator.\n\n= can also be used as an assignment operator.\n\nExamples\n--------\n\nSELECT 1 = 0;\n+-------+\n| 1 = 0 |\n+-------+\n|     0 |\n+-------+\n\nSELECT \'0\' = 0;\n+---------+\n| \'0\' = 0 |\n+---------+\n|       1 |\n+---------+\n\nSELECT \'0.0\' = 0;\n+-----------+\n| \'0.0\' = 0 |\n+-----------+\n|         1 |\n+-----------+\n\nSELECT \'0.01\' = 0;\n+------------+\n| \'0.01\' = 0 |\n+------------+\n|          0 |\n+------------+\n\nSELECT \'.01\' = 0.01;\n+--------------+\n| \'.01\' = 0.01 |\n+--------------+\n|            1 |\n+--------------+\n\nSELECT (5 * 2) = CONCAT(\'1\', \'0\');\n+----------------------------+\n| (5 * 2) = CONCAT(\'1\', \'0\') |\n+----------------------------+\n|                          1 |\n+----------------------------+\n\nSELECT 1 = NULL;\n+----------+\n| 1 = NULL |\n+----------+\n|     NULL |\n+----------+\n\nSELECT NULL = NULL;\n+-------------+\n| NULL = NULL |\n+-------------+\n|        NULL |\n+-------------+\n\nURL: https://mariadb.com/kb/en/equal/','','https://mariadb.com/kb/en/equal/'),
(221,'>',19,'Syntax\n------\n\n>\n\nDescription\n-----------\n\nGreater than operator. Evaluates both SQL expressions and returns 1 if the\nleft value is greater than the right value and 0 if it is not, or NULL if\neither expression is NULL. If the expressions return different data types,\n(for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) > (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b > t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 > 2;\n+-------+\n| 2 > 2 |\n+-------+\n|     0 |\n+-------+\n\nSELECT \'b\' > \'a\';\n+-----------+\n| \'b\' > \'a\' |\n+-----------+\n|         1 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/greater-than/','','https://mariadb.com/kb/en/greater-than/'),
(519,'CURTIME',31,'Syntax\n------\n\nCURTIME([precision])\n\nDescription\n-----------\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context. The\nvalue is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT CURTIME();\n+-----------+\n| CURTIME() |\n+-----------+\n| 12:45:39  |\n+-----------+\n\nSELECT CURTIME() + 0;\n+---------------+\n| CURTIME() + 0 |\n+---------------+\n| 124545.000000 |\n+---------------+\n\nWith precision:\n\nSELECT CURTIME(2);\n+-------------+\n| CURTIME(2)  |\n+-------------+\n| 09:49:08.09 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/curtime/','','https://mariadb.com/kb/en/curtime/'),
(520,'DATE FUNCTION',31,'Syntax\n------\n\nDATE(expr)\n\nDescription\n-----------\n\nExtracts the date part of the date or datetime expression expr. Returns NULL\nand throws a warning when passed an invalid date.\n\nExamples\n--------\n\nSELECT DATE(\'2013-07-18 12:21:32\');\n+-----------------------------+\n| DATE(\'2013-07-18 12:21:32\') |\n+-----------------------------+\n| 2013-07-18                  |\n+-----------------------------+\n\nURL: https://mariadb.com/kb/en/date-function/','','https://mariadb.com/kb/en/date-function/'),
(523,'DATE_FORMAT',31,'Syntax\n------\n\nDATE_FORMAT(date, format[, locale])\n\nDescription\n-----------\n\nFormats the date value according to the format string.\n\nThe language used for the names is controlled by the value of the\nlc_time_names system variable. See server locale for more on the supported\nlocales.\n\nThe options that can be used by DATE_FORMAT(), as well as its inverse\nSTR_TO_DATE() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Monday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nTo get a date in one of the standard formats, GET_FORMAT() can be used.\n\nExamples\n--------\n\nSELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\') |\n+------------------------------------------------+\n| Sunday October 2009                            |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\') |\n+------------------------------------------------+\n| 22:23:00                                       |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\') |\n+------------------------------------------------------------+\n| 4th 00 Thu 04 10 Oct 277                                   |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\') |\n+------------------------------------------------------------+\n| 22 22 10 10:23:00 PM 22:23:00 00 6                         |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n+------------------------------------+\n| DATE_FORMAT(\'1999-01-01\', \'%X %V\') |\n+------------------------------------+\n| 1998 52                            |\n+------------------------------------+\n\nSELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n+---------------------------------+\n| DATE_FORMAT(\'2006-06-00\', \'%d\') |\n+---------------------------------+\n| 00                              |\n+---------------------------------+\n\nOptionally, the locale can be explicitly specified as the third DATE_FORMAT()\nargument. Doing so makes the function independent from the session settings,\nand the three argument version of DATE_FORMAT() can be used in virtual indexed\nand persistent generated-columns:\n\nSELECT DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\');\n+------------------------------------------+\n| DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\') |\n+------------------------------------------+\n| Κυριακή                                  |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/date_format/','','https://mariadb.com/kb/en/date_format/'),
(525,'DAY',31,'Syntax\n------\n\nDAY(date)\n\nDescription\n-----------\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: https://mariadb.com/kb/en/day/','','https://mariadb.com/kb/en/day/'),
(529,'DAYOFYEAR',31,'Syntax\n------\n\nDAYOFYEAR(date)\n\nDescription\n-----------\n\nReturns the day of the year for date, in the range 1 to 366.\n\nExamples\n--------\n\nSELECT DAYOFYEAR(\'2018-02-16\');\n+-------------------------+\n| DAYOFYEAR(\'2018-02-16\') |\n+-------------------------+\n|                      47 |\n+-------------------------+\n\nURL: https://mariadb.com/kb/en/dayofyear/','','https://mariadb.com/kb/en/dayofyear/'),
(531,'FROM_DAYS',31,'Syntax\n------\n\nFROM_DAYS(N)\n\nDescription\n-----------\n\nGiven a day number N, returns a DATE value. The day count is based on the\nnumber of days from the start of the standard calendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the TO_DAYS() function.\n\nExamples\n--------\n\nSELECT FROM_DAYS(730669);\n+-------------------+\n| FROM_DAYS(730669) |\n+-------------------+\n| 2000-07-03        |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/from_days/','','https://mariadb.com/kb/en/from_days/'),
(222,'>=',19,'Syntax\n------\n\n>=\n\nDescription\n-----------\n\nGreater than or equal operator. Evaluates both SQL expressions and returns 1\nif the left value is greater than or equal to the right value and 0 if it is\nnot, or NULL if either expression is NULL. If the expressions return different\ndata types, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) >= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b >= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 >= 2;\n+--------+\n| 2 >= 2 |\n+--------+\n|      1 |\n+--------+\n\nSELECT \'A\' >= \'a\';\n+------------+\n| \'A\' >= \'a\' |\n+------------+\n|          1 |\n+------------+\n\nURL: https://mariadb.com/kb/en/greater-than-or-equal/','','https://mariadb.com/kb/en/greater-than-or-equal/'),
(223,'BETWEEN AND',19,'Syntax\n------\n\nexpr BETWEEN min AND max\n\nDescription\n-----------\n\nIf expr is greater than or equal to min and expr is less than or equal to max,\nBETWEEN returns 1, otherwise it returns 0. This is equivalent to the\nexpression (min <= expr AND expr <= max) if all the arguments are of the same\ntype. Otherwise type conversion takes place according to the rules described\nat Type Conversion, but applied to all the three arguments.\n\nExamples\n--------\n\nSELECT 1 BETWEEN 2 AND 3;\n+-------------------+\n| 1 BETWEEN 2 AND 3 |\n+-------------------+\n|                 0 |\n+-------------------+\n\nSELECT \'b\' BETWEEN \'a\' AND \'c\';\n+-------------------------+\n| \'b\' BETWEEN \'a\' AND \'c\' |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT 2 BETWEEN 2 AND \'3\';\n+---------------------+\n| 2 BETWEEN 2 AND \'3\' |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSELECT 2 BETWEEN 2 AND \'x-3\';\n+-----------------------+\n| 2 BETWEEN 2 AND \'x-3\' |\n+-----------------------+\n|                     0 |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'x-3\'\n\nNULL:\n\nSELECT 1 BETWEEN 1 AND NULL;\n+----------------------+\n| 1 BETWEEN 1 AND NULL |\n+----------------------+\n|                 NULL |\n+----------------------+\n\nDATE, DATETIME and TIMESTAMP examples. Omitting the time component compares\nagainst 00:00, so later times on the same date are not returned:\n\nCREATE TABLE `x` (\n a date ,\n b datetime,\n c timestamp\n)\n\nINSERT INTO x VALUES \n (\'2018-11-11\', \'2018-11-11 05:15\', \'2018-11-11 05:15\'), \n (\'2018-11-12\', \'2018-11-12 05:15\', \'2018-11-12 05:15\');\n\nSELECT * FROM x WHERE a BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n| 2018-11-12 | 2018-11-12 05:15:00 | 2018-11-12 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE b BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE c BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a          | b                   | c                   |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\nURL: https://mariadb.com/kb/en/between-and/','','https://mariadb.com/kb/en/between-and/'),
(224,'COALESCE',19,'Syntax\n------\n\nCOALESCE(value,...)\n\nDescription\n-----------\n\nReturns the first non-NULL value in the list, or NULL if there are no non-NULL\nvalues. At least one parameter must be passed.\n\nThe function is useful when substituting a default value for null values when\ndisplaying data.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT COALESCE(NULL,1);\n+------------------+\n| COALESCE(NULL,1) |\n+------------------+\n|                1 |\n+------------------+\n\nSELECT COALESCE(NULL,NULL,NULL);\n+--------------------------+\n| COALESCE(NULL,NULL,NULL) |\n+--------------------------+\n|                     NULL |\n+--------------------------+\n\nWhen two arguments are given, COALESCE() is the same as IFNULL():\n\nSET @a=NULL, @b=1;\n\nSELECT COALESCE(@a, @b), IFNULL(@a, @b);\n+------------------+----------------+\n| COALESCE(@a, @b) | IFNULL(@a, @b) |\n+------------------+----------------+\n|                1 |              1 |\n+------------------+----------------+\n\nHex type confusion:\n\nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61));\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|   49 | a    |\n|    1 | a    |\n+------+------+\n\nThe reason for the differing results above is that when 0x31 is inserted\ndirectly to the column, it\'s treated as a number (see Hexadecimal Literals),\nwhile when 0x31 is passed to COALESCE(), it\'s treated as a string, because:\n\n* HEX values have a string data type by default.\n* COALESCE() has the same data type as the argument.\n\nSubstituting zero for NULL (in this case when the aggregate function returns\nNULL after finding no rows):\n\nSELECT SUM(score) FROM student;\n+------------+\n| SUM(score) |\n+------------+\n|       NULL |\n+------------+\n\nSELECT COALESCE(SUM(score),0) FROM student;\n+------------------------+\n| COALESCE(SUM(score),0) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/coalesce/','','https://mariadb.com/kb/en/coalesce/'),
(532,'FROM_UNIXTIME',31,'Syntax\n------\n\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nDescription\n-----------\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether\nthe function is used in a string or numeric context. The value is expressed in\nthe current time zone. unix_timestamp is an internal timestamp value such as\nis produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format string,\nwhich is used the same way as listed in the entry for the DATE_FORMAT()\nfunction.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a timestamp beyond this will result in NULL being returned.\nUse DATETIME as a storage type if you require dates beyond this.\n\nThe options that can be used by FROM_UNIXTIME(), as well as DATE_FORMAT() and\nSTR_TO_DATE(), are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nPerformance Considerations\n--------------------------\n\nIf your session time zone is set to SYSTEM (the default), FROM_UNIXTIME() will\ncall the OS function to convert the data using the system time zone. At least\non Linux, the corresponding function (localtime_r) uses a global mutex inside\nglibc that can cause contention under high concurrent load.\n\nSet your time zone to a named time zone to avoid this issue. See mysql time\nzone tables for details on how to do this.\n\nExamples\n--------\n\nSELECT FROM_UNIXTIME(1196440219);\n+---------------------------+\n| FROM_UNIXTIME(1196440219) |\n+---------------------------+\n| 2007-11-30 11:30:19       |\n+---------------------------+\n\nSELECT FROM_UNIXTIME(1196440219) + 0;\n+-------------------------------+\n| FROM_UNIXTIME(1196440219) + 0 |\n+-------------------------------+\n|         20071130113019.000000 |\n+-------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\');\n+---------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\') |\n+---------------------------------------------------------+\n| 2010 27th March 01:03:47 2010                           |\n+---------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/from_unixtime/','','https://mariadb.com/kb/en/from_unixtime/'),
(536,'LOCALTIME',31,'Syntax\n------\n\nLOCALTIME\nLOCALTIME([precision])\n\nDescription\n-----------\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/localtime/','','https://mariadb.com/kb/en/localtime/'),
(537,'LOCALTIMESTAMP',31,'Syntax\n------\n\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: https://mariadb.com/kb/en/localtimestamp/','','https://mariadb.com/kb/en/localtimestamp/'),
(541,'MINUTE',31,'Syntax\n------\n\nMINUTE(time)\n\nDescription\n-----------\n\nReturns the minute for time, in the range 0 to 59.\n\nExamples\n--------\n\nSELECT MINUTE(\'2013-08-03 11:04:03\');\n+-------------------------------+\n| MINUTE(\'2013-08-03 11:04:03\') |\n+-------------------------------+\n|                             4 |\n+-------------------------------+\n\nSELECT MINUTE (\'23:12:50\');\n+---------------------+\n| MINUTE (\'23:12:50\') |\n+---------------------+\n|                  12 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/minute/','','https://mariadb.com/kb/en/minute/'),
(542,'MONTH',31,'Syntax\n------\n\nMONTH(date)\n\nDescription\n-----------\n\nReturns the month for date in the range 1 to 12 for January to December, or 0\nfor dates such as \'0000-00-00\' or \'2008-00-00\' that have a zero month part.\n\nExamples\n--------\n\nSELECT MONTH(\'2019-01-03\');\n+---------------------+\n| MONTH(\'2019-01-03\') |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSELECT MONTH(\'2019-00-03\');\n+---------------------+\n| MONTH(\'2019-00-03\') |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/month/','','https://mariadb.com/kb/en/month/'),
(226,'IN',19,'Syntax\n------\n\nexpr IN (value,...)\n\nDescription\n-----------\n\nReturns 1 if expr is equal to any of the values in the IN list, else returns\n0. If all values are constants, they are evaluated according to the type of\nexpr and sorted. The search for the item then is done using a binary search.\nThis means IN is very quick if the IN value list consists entirely of\nconstants. Otherwise, type conversion takes place according to the rules\ndescribed at Type Conversion, but applied to all the arguments.\n\nIf expr is NULL, IN always returns NULL. If at least one of the values in the\nlist is NULL, and one of the comparisons is true, the result is 1. If at least\none of the values in the list is NULL and none of the comparisons is true, the\nresult is NULL.\n\nExamples\n--------\n\nSELECT 2 IN (0,3,5,7);\n+----------------+\n| 2 IN (0,3,5,7) |\n+----------------+\n|              0 |\n+----------------+\n\nSELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n+----------------------------------+\n| \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\') |\n+----------------------------------+\n|                                1 |\n+----------------------------------+\n\nType conversion:\n\nSELECT 1 IN (\'1\', \'2\', \'3\');\n+----------------------+\n| 1 IN (\'1\', \'2\', \'3\') |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT NULL IN (1, 2, 3);\n+-------------------+\n| NULL IN (1, 2, 3) |\n+-------------------+\n|              NULL |\n+-------------------+\n\nSELECT 1 IN (1, 2, NULL);\n+-------------------+\n| 1 IN (1, 2, NULL) |\n+-------------------+\n|                 1 |\n+-------------------+\n\nSELECT 5 IN (1, 2, NULL);\n+-------------------+\n| 5 IN (1, 2, NULL) |\n+-------------------+\n|              NULL |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/in/','','https://mariadb.com/kb/en/in/'),
(227,'INTERVAL',19,'Syntax\n------\n\nINTERVAL(N,N1,N2,N3,...)\n\nDescription\n-----------\n\nReturns the index of the last argument that is less than the first argument or\nis NULL.\n\nReturns 0 if N < N1, 1 if N < N2, 2 if N < N3 and so on or -1 if N is NULL.\nAll arguments are treated as integers. It is required that N1 < N2 < N3 < ...\n< Nn for this function to work correctly. This is because a fast binary search\nis used.\n\nExamples\n--------\n\nSELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n+--------------------------------------+\n| INTERVAL(23, 1, 15, 17, 30, 44, 200) |\n+--------------------------------------+\n|                                    3 |\n+--------------------------------------+\n\nSELECT INTERVAL(10, 1, 10, 100, 1000);\n+--------------------------------+\n| INTERVAL(10, 1, 10, 100, 1000) |\n+--------------------------------+\n|                              2 |\n+--------------------------------+\n\nSELECT INTERVAL(22, 23, 30, 44, 200);\n+-------------------------------+\n| INTERVAL(22, 23, 30, 44, 200) |\n+-------------------------------+\n|                             0 |\n+-------------------------------+\n\nSELECT INTERVAL(10, 2, NULL);\n+-----------------------+\n| INTERVAL(10, 2, NULL) |\n+-----------------------+\n|                     2 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/interval/','','https://mariadb.com/kb/en/interval/'),
(228,'IS',19,'Syntax\n------\n\nIS boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nThere is an important difference between using IS TRUE or comparing a value\nwith TRUE using =. When using =, only 1 equals to TRUE. But when using IS\nTRUE, all values which are logically true (like a number > 1) return TRUE.\n\nExamples\n--------\n\nSELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n+-----------+------------+-----------------+\n| 1 IS TRUE | 0 IS FALSE | NULL IS UNKNOWN |\n+-----------+------------+-----------------+\n|         1 |          1 |               1 |\n+-----------+------------+-----------------+\n\nDifference between = and IS TRUE:\n\nSELECT 2 = TRUE, 2 IS TRUE;\n+----------+-----------+\n| 2 = TRUE | 2 IS TRUE |\n+----------+-----------+\n|        0 |         1 |\n+----------+-----------+\n\nURL: https://mariadb.com/kb/en/is/','','https://mariadb.com/kb/en/is/'),
(229,'IS NOT',19,'Syntax\n------\n\nIS NOT boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nExamples\n--------\n\nSELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n+------------------+------------------+---------------------+\n| 1 IS NOT UNKNOWN | 0 IS NOT UNKNOWN | NULL IS NOT UNKNOWN |\n+------------------+------------------+---------------------+\n|                1 |                1 |                   0 |\n+------------------+------------------+---------------------+\n\nSELECT NULL IS NOT TRUE, NULL IS NOT FALSE;\n+------------------+-------------------+\n| NULL IS NOT TRUE | NULL IS NOT FALSE |\n+------------------+-------------------+\n|                1 |                 1 |\n+------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/is-not/','','https://mariadb.com/kb/en/is-not/'),
(543,'MONTHNAME',31,'Syntax\n------\n\nMONTHNAME(date)\n\nDescription\n-----------\n\nReturns the full name of the month for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT MONTHNAME(\'2019-02-03\');\n+-------------------------+\n| MONTHNAME(\'2019-02-03\') |\n+-------------------------+\n| February                |\n+-------------------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT MONTHNAME(\'2019-05-21\');\n+-------------------------+\n| MONTHNAME(\'2019-05-21\') |\n+-------------------------+\n| mai                     |\n+-------------------------+\n\nURL: https://mariadb.com/kb/en/monthname/','','https://mariadb.com/kb/en/monthname/'),
(547,'QUARTER',31,'Syntax\n------\n\nQUARTER(date)\n\nDescription\n-----------\n\nReturns the quarter of the year for date, in the range 1 to 4. Returns 0 if\nmonth contains a zero value, or NULL if the given value is not otherwise a\nvalid date (zero values are accepted).\n\nExamples\n--------\n\nSELECT QUARTER(\'2008-04-01\');\n+-----------------------+\n| QUARTER(\'2008-04-01\') |\n+-----------------------+\n|                     2 |\n+-----------------------+\n\nSELECT QUARTER(\'2019-00-01\');\n+-----------------------+\n| QUARTER(\'2019-00-01\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/quarter/','','https://mariadb.com/kb/en/quarter/'),
(548,'SECOND',31,'Syntax\n------\n\nSECOND(time)\n\nDescription\n-----------\n\nReturns the second for a given time (which can include microseconds), in the\nrange 0 to 59, or NULL if not given a valid time value.\n\nExamples\n--------\n\nSELECT SECOND(\'10:05:03\');\n+--------------------+\n| SECOND(\'10:05:03\') |\n+--------------------+\n|                  3 |\n+--------------------+\n\nSELECT SECOND(\'10:05:01.999999\');\n+---------------------------+\n| SECOND(\'10:05:01.999999\') |\n+---------------------------+\n|                         1 |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/second/','','https://mariadb.com/kb/en/second/'),
(550,'STR_TO_DATE',31,'Syntax\n------\n\nSTR_TO_DATE(str,format)\n\nDescription\n-----------\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string str and a\nformat string format. STR_TO_DATE() returns a DATETIME value if the format\nstring contains both date and time parts, or a DATE or TIME value if the\nstring contains only date or time parts.\n\nThe date, time, or datetime values contained in str should be given in the\nformat indicated by format. If str contains an illegal date, time, or datetime\nvalue, STR_TO_DATE() returns NULL. An illegal value also produces a warning.\n\nUnder specific SQL_MODE settings an error may also be generated if the str\nisn\'t a valid date:\n\n* ALLOW_INVALID_DATES\n* NO_ZERO_DATE\n* NO_ZERO_IN_DATE\n\nThe options that can be used by STR_TO_DATE(), as well as its inverse\nDATE_FORMAT() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| %a                        | Short weekday name in current locale           |\n|                           | (Variable lc_time_names).                      |\n+---------------------------+------------------------------------------------+\n| %b                        | Short form month name in current locale. For   |\n|                           | locale en_US this is one of:                   |\n|                           | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov    |\n|                           | or Dec.                                        |\n+---------------------------+------------------------------------------------+\n| %c                        | Month with 1 or 2 digits.                      |\n+---------------------------+------------------------------------------------+\n| %D                        | Day with English suffix \'th\', \'nd\', \'st\' or    |\n|                           | \'rd\'\'. (1st, 2nd, 3rd...).                     |\n+---------------------------+------------------------------------------------+\n| %d                        | Day with 2 digits.                             |\n+---------------------------+------------------------------------------------+\n| %e                        | Day with 1 or 2 digits.                        |\n+---------------------------+------------------------------------------------+\n| %f                        | Microseconds 6 digits.                         |\n+---------------------------+------------------------------------------------+\n| %H                        | Hour with 2 digits between 00-23.              |\n+---------------------------+------------------------------------------------+\n| %h                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %I                        | Hour with 2 digits between 01-12.              |\n+---------------------------+------------------------------------------------+\n| %i                        | Minute with 2 digits.                          |\n+---------------------------+------------------------------------------------+\n| %j                        | Day of the year (001-366)                      |\n+---------------------------+------------------------------------------------+\n| %k                        | Hour with 1 digits between 0-23.               |\n+---------------------------+------------------------------------------------+\n| %l                        | Hour with 1 digits between 1-12.               |\n+---------------------------+------------------------------------------------+\n| %M                        | Full month name in current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %m                        | Month with 2 digits.                           |\n+---------------------------+------------------------------------------------+\n| %p                        | AM/PM according to current locale (Variable    |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %r                        | Time in 12 hour format, followed by AM/PM.     |\n|                           | Short for \'%I:%i:%S %p\'.                       |\n+---------------------------+------------------------------------------------+\n| %S                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %s                        | Seconds with 2 digits.                         |\n+---------------------------+------------------------------------------------+\n| %T                        | Time in 24 hour format. Short for \'%H:%i:%S\'.  |\n+---------------------------+------------------------------------------------+\n| %U                        | Week number (00-53), when first day of the     |\n|                           | week is Sunday.                                |\n+---------------------------+------------------------------------------------+\n| %u                        | Week number (00-53), when first day of the     |\n|                           | week is Monday.                                |\n+---------------------------+------------------------------------------------+\n| %V                        | Week number (01-53), when first day of the     |\n|                           | week is Sunday. Used with %X.                  |\n+---------------------------+------------------------------------------------+\n| %v                        | Week number (01-53), when first day of the     |\n|                           | week is Monday. Used with %x.                  |\n+---------------------------+------------------------------------------------+\n| %W                        | Full weekday name in current locale (Variable  |\n|                           | lc_time_names).                                |\n+---------------------------+------------------------------------------------+\n| %w                        | Day of the week. 0 = Sunday, 6 = Saturday.     |\n+---------------------------+------------------------------------------------+\n| %X                        | Year with 4 digits when first day of the week  |\n|                           | is Sunday. Used with %V.                       |\n+---------------------------+------------------------------------------------+\n| %x                        | Year with 4 digits when first day of the week  |\n|                           | is Monday. Used with %v.                       |\n+---------------------------+------------------------------------------------+\n| %Y                        | Year with 4 digits.                            |\n+---------------------------+------------------------------------------------+\n| %y                        | Year with 2 digits.                            |\n+---------------------------+------------------------------------------------+\n| %#                        | For str_to_date(), skip all numbers.           |\n+---------------------------+------------------------------------------------+\n| %.                        | For str_to_date(), skip all punctation         |\n|                           | characters.                                    |\n+---------------------------+------------------------------------------------+\n| %@                        | For str_to_date(), skip all alpha characters.  |\n+---------------------------+------------------------------------------------+\n| %%                        | A literal % character.                         |\n+---------------------------+------------------------------------------------+\n\nExamples\n--------\n\nSELECT STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\');\n+---------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\') |\n+---------------------------------------------------------+\n| 2014-06-02                                              |\n+---------------------------------------------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\');\n+--------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\') |\n+--------------------------------------------------------------+\n| NULL                                                         |\n+--------------------------------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Level   | Code | Message                                                    \n           |\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Warning | 1411 | Incorrect datetime value: \'Wednesday23423, June 2, 2014\'\nfor function str_to_date |\n+---------+------+-------------------------------------------------------------\n---------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\');\n+----------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\') |\n+----------------------------------------------------------------+\n| 2014-06-02                                                     |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/str_to_date/','','https://mariadb.com/kb/en/str_to_date/'),
(554,'TIME Function',31,'Syntax\n------\n\nTIME(expr)\n\nDescription\n-----------\n\nExtracts the time part of the time or datetime expression expr and returns it\nas a string.\n\nExamples\n--------\n\nSELECT TIME(\'2003-12-31 01:02:03\');\n+-----------------------------+\n| TIME(\'2003-12-31 01:02:03\') |\n+-----------------------------+\n| 01:02:03                    |\n+-----------------------------+\n\nSELECT TIME(\'2003-12-31 01:02:03.000123\');\n+------------------------------------+\n| TIME(\'2003-12-31 01:02:03.000123\') |\n+------------------------------------+\n| 01:02:03.000123                    |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/time-function/','','https://mariadb.com/kb/en/time-function/'),
(231,'IS NULL',19,'Syntax\n------\n\nIS NULL\n\nDescription\n-----------\n\nTests whether a value is NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n+-----------+-----------+--------------+\n| 1 IS NULL | 0 IS NULL | NULL IS NULL |\n+-----------+-----------+--------------+\n|         0 |         0 |            1 |\n+-----------+-----------+--------------+\n\nCompatibility\n-------------\n\nSome ODBC applications use the syntax auto_increment_field IS NOT NULL to find\nthe latest row that was inserted with an autogenerated key value. If your\napplications need this, you can set the sql_auto_is_null variable to 1.\n\nSET @@sql_auto_is_null=1;\nCREATE TABLE t1 (auto_increment_column INT NOT NULL AUTO_INCREMENT PRIMARY\nKEY);\nINSERT INTO t1 VALUES (NULL);\nSELECT * FROM t1 WHERE auto_increment_column IS NULL;\n\n+-----------------------+\n| auto_increment_column |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/is-null/','','https://mariadb.com/kb/en/is-null/'),
(233,'LEAST',19,'Syntax\n------\n\nLEAST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the smallest (minimum-valued) argument.\nThe arguments are compared using the following rules:\n\n* If the return value is used in an INTEGER context or all arguments are\ninteger-valued, they are compared as integers.\n* If the return value is used in a REAL context or all arguments are\nreal-valued, they are compared as reals.\n* If any argument is a case-sensitive string, the arguments are compared as\ncase-sensitive strings.\n* In all other cases, the arguments are compared as case-insensitive strings.\n\nLEAST() returns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT LEAST(2,0);\n+------------+\n| LEAST(2,0) |\n+------------+\n|          0 |\n+------------+\n\nSELECT LEAST(34.0,3.0,5.0,767.0);\n+---------------------------+\n| LEAST(34.0,3.0,5.0,767.0) |\n+---------------------------+\n|                       3.0 |\n+---------------------------+\n\nSELECT LEAST(\'B\',\'A\',\'C\');\n+--------------------+\n| LEAST(\'B\',\'A\',\'C\') |\n+--------------------+\n| A                  |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/least/','','https://mariadb.com/kb/en/least/'),
(234,'NOT BETWEEN',19,'Syntax\n------\n\nexpr NOT BETWEEN min AND max\n\nDescription\n-----------\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nNote that the meaning of the alternative form NOT expr BETWEEN min AND max is\naffected by the HIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nExamples\n--------\n\nSELECT 1 NOT BETWEEN 2 AND 3;\n+-----------------------+\n| 1 NOT BETWEEN 2 AND 3 |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT \'b\' NOT BETWEEN \'a\' AND \'c\';\n+-----------------------------+\n| \'b\' NOT BETWEEN \'a\' AND \'c\' |\n+-----------------------------+\n|                           0 |\n+-----------------------------+\n\nNULL:\n\nSELECT 1 NOT BETWEEN 1 AND NULL;\n+--------------------------+\n| 1 NOT BETWEEN 1 AND NULL |\n+--------------------------+\n|                     NULL |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/not-between/','','https://mariadb.com/kb/en/not-between/'),
(235,'NOT IN',19,'Syntax\n------\n\nexpr NOT IN (value,...)\n\nDescription\n-----------\n\nThis is the same as NOT (expr IN (value,...)).\n\nExamples\n--------\n\nSELECT 2 NOT IN (0,3,5,7);\n+--------------------+\n| 2 NOT IN (0,3,5,7) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSELECT \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\');\n+--------------------------------------+\n| \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\') |\n+--------------------------------------+\n|                                    0 |\n+--------------------------------------+\n\nSELECT 1 NOT IN (\'1\', \'2\', \'3\');\n+--------------------------+\n| 1 NOT IN (\'1\', \'2\', \'3\') |\n+--------------------------+\n|                        0 |\n+--------------------------+\n\nNULL:\n\nSELECT NULL NOT IN (1, 2, 3);\n+-----------------------+\n| NULL NOT IN (1, 2, 3) |\n+-----------------------+\n|                  NULL |\n+-----------------------+\n\nSELECT 1 NOT IN (1, 2, NULL);\n+-----------------------+\n| 1 NOT IN (1, 2, NULL) |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT 5 NOT IN (1, 2, NULL);\n+-----------------------+\n| 5 NOT IN (1, 2, NULL) |\n+-----------------------+\n|                  NULL |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/not-in/','','https://mariadb.com/kb/en/not-in/'),
(243,'Parentheses',20,'Parentheses are sometimes called precedence operators - this means that they\ncan be used to change the other operator\'s precedence in an expression. The\nexpressions that are written between parentheses are computed before the\nexpressions that are written outside. Parentheses must always contain an\nexpression (that is, they cannot be empty), and can be nested.\n\nFor example, the following expressions could return different results:\n\n* NOT a OR b\n* NOT (a OR b)\n\nIn the first case, NOT applies to a, so if a is FALSE or b is TRUE, the\nexpression returns TRUE. In the second case, NOT applies to the result of a OR\nb, so if at least one of a or b is TRUE, the expression is TRUE.\n\nWhen the precedence of operators is not intuitive, you can use parentheses to\nmake it immediately clear for whoever reads the statement.\n\nThe precedence of the NOT operator can also be affected by the\nHIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nOther uses\n----------\n\nParentheses must always be used to enclose subqueries.\n\nParentheses can also be used in a JOIN statement between multiple tables to\ndetermine which tables must be joined first.\n\nAlso, parentheses are used to enclose the list of parameters to be passed to\nbuilt-in functions, user-defined functions and stored routines. However, when\nno parameter is passed to a stored procedure, parentheses are optional. For\nbuiltin functions and user-defined functions, spaces are not allowed between\nthe function name and the open parenthesis, unless the IGNORE_SPACE SQL_MODE\nis set. For stored routines (and for functions if IGNORE_SPACE is set) spaces\nare allowed before the open parenthesis, including tab characters and new line\ncharacters.\n\nSyntax errors\n-------------\n\nIf there are more open parentheses than closed parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \'\'\na\nt line 1\n\nNote the empty string.\n\nIf there are more closed parentheses than open parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \')\'\nat line 1\n\nNote the quoted closed parenthesis.\n\nURL: https://mariadb.com/kb/en/parentheses/','','https://mariadb.com/kb/en/parentheses/'),
(559,'TIME_FORMAT',31,'Syntax\n------\n\nTIME_FORMAT(time,format)\n\nDescription\n-----------\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, and seconds. Other\nspecifiers produce a NULL value or 0.\n\nExamples\n--------\n\nSELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n+--------------------------------------------+\n| TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\') |\n+--------------------------------------------+\n| 100 100 04 04 4                            |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/time_format/','','https://mariadb.com/kb/en/time_format/'),
(245,'ANALYZE TABLE',21,'Syntax\n------\n\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [,tbl_name ...]\n [PERSISTENT FOR\n  { ALL\n   | COLUMNS ([col_name [,col_name ...]]) INDEXES ([index_name [,index_name\n...]])\n  }\n ]\n\nDescription\n-----------\n\nANALYZE TABLE analyzes and stores the key distribution for a table (index\nstatistics). This statement works with MyISAM, Aria and InnoDB tables. During\nthe analysis, InnoDB will allow reads/writes, and MyISAM/Aria reads/inserts.\nFor MyISAM tables, this statement is equivalent to using myisamchk --analyze.\n\nFor more information on how the analysis works within InnoDB, see InnoDB\nLimitations.\n\nMariaDB uses the stored key distribution to decide the order in which tables\nshould be joined when you perform a join on something other than a constant.\nIn addition, key distributions can be used when deciding which indexes to use\nfor a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, ANALYZE TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, ANALYZE TABLE statements are not logged to the binary\nlog if read_only is set. See also Read-Only Replicas.\n\nANALYZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... ANALYZE PARTITION to analyze one or more partitions.\n\nThe Aria storage engine supports progress reporting for the ANALYZE TABLE\nstatement.\n\nEngine-Independent Statistics\n-----------------------------\n\nANALYZE TABLE supports engine-independent statistics. See Engine-Independent\nTable Statistics: Collecting Statistics with the ANALYZE TABLE Statement for\nmore information.\n\nUseful Variables\n----------------\n\nFor calculating the number of duplicates, ANALYZE TABLE uses a buffer of\nsort_buffer_size bytes per column. You can slightly increase the speed of\nANALYZE TABLE by increasing this variable.\n\nExamples\n--------\n\n-- update all engine-independent statistics for all columns and indexes\nANALYZE TABLE tbl PERSISTENT FOR ALL;\n\n-- update specific columns and indexes:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...) INDEXES\n(idx1,idx2,...);\n\n-- empty lists are allowed:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...) INDEXES ();\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES (idx1,idx2,...);\n\n-- the following will only update mysql.table_stats fields:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES ();\n\n-- when use_stat_tables is set to \'COMPLEMENTARY\' or \'PREFERABLY\', \n-- a simple ANALYZE TABLE  collects engine-independent statistics for all\ncolumns and indexes.\nSET SESSION use_stat_tables=\'COMPLEMENTARY\';\nANALYZE TABLE tbl;\n\nURL: https://mariadb.com/kb/en/analyze-table/','','https://mariadb.com/kb/en/analyze-table/'),
(248,'CHECKSUM TABLE',21,'Syntax\n------\n\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nDescription\n-----------\n\nCHECKSUM TABLE reports a table checksum. This is very useful if you want to\nknow if two tables are the same (for example on a master and slave).\n\nWith QUICK, the live table checksum is reported if it is available, or NULL\notherwise. This is very fast. A live checksum is enabled by specifying the\nCHECKSUM=1 table option when you create the table; currently, this is\nsupported only for Aria and MyISAM tables.\n\nWith EXTENDED, the entire table is read row by row and the checksum is\ncalculated. This can be very slow for large tables.\n\nIf neither QUICK nor EXTENDED is specified, MariaDB returns a live checksum if\nthe table storage engine supports it and scans the table otherwise.\n\nCHECKSUM TABLE requires the SELECT privilege for the table.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a warning.\n\nThe table row format affects the checksum value. If the row format changes,\nthe checksum will change. This means that when a table created with a\nMariaDB/MySQL version is upgraded to another version, the checksum value will\nprobably change.\n\nTwo identical tables should always match to the same checksum value; however,\nalso for non-identical tables there is a very slight chance that they will\nreturn the same value as the hashing algorithm is not completely\ncollision-free.\n\nIdentical Tables\n----------------\n\nIdentical tables mean that the CREATE statement is identical and that the\nfollowing variable, which affects the storage formats, was the same when the\ntables were created:\n\n* mysql56-temporal-format\n\nDifferences Between MariaDB and MySQL\n-------------------------------------\n\nCHECKSUM TABLE may give a different result as MariaDB doesn\'t ignore NULLs in\nthe columns as MySQL 5.1 does (Later MySQL versions should calculate checksums\nthe same way as MariaDB). You can get the \'old style\' checksum in MariaDB by\nstarting mysqld with the --old option. Note however that that the MyISAM and\nAria storage engines in MariaDB are using the new checksum internally, so if\nyou are using --old, the CHECKSUM command will be slower as it needs to\ncalculate the checksum row by row. Starting from MariaDB Server 10.9, --old is\ndeprecated and will be removed in a future release. Set --old-mode or OLD_MODE\nto COMPAT_5_1_CHECKSUM to get \'old style\' checksum.\n\nURL: https://mariadb.com/kb/en/checksum-table/','','https://mariadb.com/kb/en/checksum-table/'),
(564,'UTC_DATE',31,'Syntax\n------\n\nUTC_DATE, UTC_DATE()\n\nDescription\n-----------\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric context.\n\nExamples\n--------\n\nSELECT UTC_DATE(), UTC_DATE() + 0;\n+------------+----------------+\n| UTC_DATE() | UTC_DATE() + 0 |\n+------------+----------------+\n| 2010-03-27 |       20100327 |\n+------------+----------------+\n\nURL: https://mariadb.com/kb/en/utc_date/','','https://mariadb.com/kb/en/utc_date/'),
(565,'UTC_TIME',31,'Syntax\n------\n\nUTC_TIME\nUTC_TIME([precision])\n\nDescription\n-----------\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIME(), UTC_TIME() + 0;\n+------------+----------------+\n| UTC_TIME() | UTC_TIME() + 0 |\n+------------+----------------+\n| 17:32:34   |  173234.000000 |\n+------------+----------------+\n\nWith precision:\n\nSELECT UTC_TIME(5);\n+----------------+\n| UTC_TIME(5)    |\n+----------------+\n| 07:52:50.78369 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/utc_time/','','https://mariadb.com/kb/en/utc_time/'),
(573,'AsBinary',32,'A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/wkb-asbinary/','','https://mariadb.com/kb/en/wkb-asbinary/'),
(574,'AsWKB',32,'A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/aswkb/','','https://mariadb.com/kb/en/aswkb/'),
(575,'MLineFromWKB',32,'Syntax\n------\n\nMLineFromWKB(wkb[,srid])\nMultiLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKB representation and SRID.\n\nMLineFromWKB() and MultiLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16\n0,16 23,16 48))\'));\n\nSELECT ST_AsText(MLineFromWKB(@g));\n+--------------------------------------------------------+\n| ST_AsText(MLineFromWKB(@g))                            |\n+--------------------------------------------------------+\n| MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) |\n+--------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/mlinefromwkb/','','https://mariadb.com/kb/en/mlinefromwkb/'),
(246,'CHECK TABLE',21,'Syntax\n------\n\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nDescription\n-----------\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nArchive, Aria, CSV, InnoDB and MyISAM tables. For Aria and MyISAM tables, the\nkey statistics are updated as well. For CSV, see also Checking and Repairing\nCSV Tables.\n\nAs an alternative, myisamchk is a commandline tool for checking MyISAM tables\nwhen the tables are not being accessed. For Aria tables, there is a similar\ntool: aria_chk.\n\nFor checking dynamic columns integrity, COLUMN_CHECK() can be used.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is also supported for partitioned tables. You can use ALTER TABLE\n... CHECK PARTITION to check one or more partitions.\n\nThe meaning of the different options are as follows - note that this can vary\na bit between storage engines:\n\n+-----+----------------------------------------------------------------------+\n| FOR | Do a very quick check if the storage format for the table has        |\n| UPG | changed so that one needs to do a REPAIR. This is only needed when   |\n| ADE | one upgrades between major versions of MariaDB or MySQL. This is     |\n|     | usually done by running mariadb-upgrade.                             |\n+-----+----------------------------------------------------------------------+\n| FAS | Only check tables that has not been closed properly or are marked    |\n|     | as corrupt. Only supported by the MyISAM and Aria engines. For       |\n|     | other engines the table is checked normally                          |\n+-----+----------------------------------------------------------------------+\n| CHA | Check only tables that has changed since last REPAIR / CHECK. Only   |\n| GED | supported by the MyISAM and Aria engines. For other engines the      |\n|     | table is checked normally.                                           |\n+-----+----------------------------------------------------------------------+\n| QUI | Do a fast check. For MyISAM and Aria, this means skipping the check  |\n| K   | of the delete link chain, which may take some time.                  |\n+-----+----------------------------------------------------------------------+\n| MED | Scan also the data files. Checks integrity between data and index    |\n| UM  | files with checksums. In most cases this should find all possible    |\n|     | errors.                                                              |\n+-----+----------------------------------------------------------------------+\n| EXT | Does a full check to verify every possible error. For InnoDB, Aria,  |\n| NDE | and MyISAM, verify for each row that all its keys exists, and for    |\n|     | those index keys, they point back to the primary clustered key.      |\n|     | This may take a long time on large tables. This option was           |\n|     | previously ignored by InnoDB before MariaDB 10.6.11, MariaDB         |\n|     | 10.7.7, MariaDB 10.8.6 and MariaDB 10.9.4.                           |\n+-----+----------------------------------------------------------------------+\n\nFor most cases running CHECK TABLE without options or MEDIUM should be good\nenough.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf you want to know if two tables are identical, take a look at CHECKSUM TABLE.\n\nInnoDB\n------\n\nIf CHECK TABLE finds an error in an InnoDB table, MariaDB might shutdown to\nprevent the error propagation. In this case, the problem will be reported in\nthe error log. Otherwise the table or an index might be marked as corrupted,\nto prevent use. This does not happen with some minor problems, like a wrong\nnumber of entries in a secondary index. Those problems are reported in the\noutput of CHECK TABLE.\n\nEach tablespace contains a header with metadata. This header is not checked by\nthis statement.\n\nDuring the execution of CHECK TABLE, other threads may be blocked.\n\nURL: https://mariadb.com/kb/en/check-table/','','https://mariadb.com/kb/en/check-table/'),
(250,'REPAIR TABLE',21,'Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n  tbl_name [, tbl_name] ...\n  [QUICK] [EXTENDED] [USE_FRM]\n\nDescription\n-----------\n\nREPAIR TABLE repairs a possibly corrupted table. By default, it has the same\neffect as\n\nmyisamchk --recover tbl_name\n\nor\n\naria_chk --recover tbl_name\n\nSee aria_chk and myisamchk for more.\n\nREPAIR TABLE works for Archive, Aria, CSV and MyISAM tables. For InnoDB, see\nrecovery modes. For CSV, see also Checking and Repairing CSV Tables. For\nArchive, this statement also improves compression. If the storage engine does\nnot support this statement, a warning is issued.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, REPAIR TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, REPAIR TABLE statements are not logged to the binary log\nif read_only is set. See also Read-Only Replicas.\n\nWhen an index is recreated, the storage engine may use a configurable buffer\nin the process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for ALTER TABLE.\n\nREPAIR TABLE is also supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nALTER TABLE ... REPAIR PARTITION can be used to repair one or more partitions.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nURL: https://mariadb.com/kb/en/repair-table/','','https://mariadb.com/kb/en/repair-table/'),
(576,'MPointFromWKB',32,'Syntax\n------\n\nMPointFromWKB(wkb[,srid])\nMultiPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nMPointFromWKB() and MultiPointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4,\n6 6, 6 9, 4 9, 1 5 )\'));\n\nSELECT ST_AsText(MPointFromWKB(@g));\n+-----------------------------------------------------+\n| ST_AsText(MPointFromWKB(@g))                        |\n+-----------------------------------------------------+\n| MULTIPOINT(1 1,2 2,5 3,7 2,9 3,8 4,6 6,6 9,4 9,1 5) |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/mpointfromwkb/','','https://mariadb.com/kb/en/mpointfromwkb/'),
(577,'MPolyFromWKB',32,'Syntax\n------\n\nMPolyFromWKB(wkb[,srid])\nMultiPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nMPolyFromWKB() and MultiPolygonFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\'));\n\nSELECT ST_AsText(MPolyFromWKB(@g))\\G\n*************************** 1. row ***************************\nST_AsText(MPolyFromWKB(@g)): MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\n\nURL: https://mariadb.com/kb/en/mpolyfromwkb/','','https://mariadb.com/kb/en/mpolyfromwkb/'),
(249,'OPTIMIZE TABLE',21,'Syntax\n------\n\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n  tbl_name [, tbl_name] ...\n  [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nOPTIMIZE TABLE has two main functions. It can either be used to defragment\ntables, or to update the InnoDB fulltext index.\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDefragmenting\n-------------\n\nOPTIMIZE TABLE works for InnoDB (before MariaDB 10.1.1, only if the\ninnodb_file_per_table server system variable is set), Aria, MyISAM and ARCHIVE\ntables, and should be used if you have deleted a large part of a table or if\nyou have made many changes to a table with variable-length rows (tables that\nhave VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained\nin a linked list and subsequent INSERT operations reuse old row positions.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, OPTIMIZE TABLE statements are written to the binary log and will\nbe replicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure\nthe statement is not written to the binary log.\n\nOPTIMIZE TABLE statements are not logged to the binary log if read_only is\nset. See also Read-Only Replicas.\n\nOPTIMIZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... OPTIMIZE PARTITION to optimize one or more partitions.\n\nYou can use OPTIMIZE TABLE to reclaim the unused space and to defragment the\ndata file. With other storage engines, OPTIMIZE TABLE does nothing by default,\nand returns this message: \" The storage engine for the table doesn\'t support\noptimize\". However, if the server has been started with the --skip-new option,\nOPTIMIZE TABLE is linked to ALTER TABLE, and recreates the table. This\noperation frees the unused space and updates index statistics.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf a MyISAM table is fragmented, concurrent inserts will not be performed\nuntil an OPTIMIZE TABLE statement is executed on that table, unless the\nconcurrent_insert server system variable is set to ALWAYS.\n\nUpdating an InnoDB fulltext index\n---------------------------------\n\nWhen rows are added or deleted to an InnoDB fulltext index, the index is not\nimmediately re-organized, as this can be an expensive operation. Change\nstatistics are stored in a separate location . The fulltext index is only\nfully re-organized when an OPTIMIZE TABLE statement is run.\n\nBy default, an OPTIMIZE TABLE will defragment a table. In order to use it to\nupdate fulltext index statistics, the innodb_optimize_fulltext_only system\nvariable must be set to 1. This is intended to be a temporary setting, and\nshould be reset to 0 once the fulltext index has been re-organized.\n\nSince fulltext re-organization can take a long time, the\ninnodb_ft_num_word_optimize variable limits the re-organization to a number of\nwords (2000 by default). You can run multiple OPTIMIZE statements to fully\nre-organize the index.\n\nDefragmenting InnoDB tablespaces\n--------------------------------\n\nMariaDB 10.1.1 merged the Facebook/Kakao defragmentation patch, allowing one\nto use OPTIMIZE TABLE to defragment InnoDB tablespaces. For this functionality\nto be enabled, the innodb_defragment system variable must be enabled. No new\ntables are created and there is no need to copy data from old tables to new\ntables. Instead, this feature loads n pages (determined by\ninnodb-defragment-n-pages) and tries to move records so that pages would be\nfull of records and then frees pages that are fully empty after the operation.\nNote that tablespace files (including ibdata1) will not shrink as the result\nof defragmentation, but one will get better memory utilization in the InnoDB\nbuffer pool as there are fewer data pages in use.\n\nSee Defragmenting InnoDB Tablespaces for more details.\n\nURL: https://mariadb.com/kb/en/optimize-table/','','https://mariadb.com/kb/en/optimize-table/'),
(251,'REPAIR VIEW',21,'Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] VIEW  view_name[, view_name] ... [FROM\nMYSQL]\n\nDescription\n-----------\n\nThe REPAIR VIEW statement was introduced to assist with fixing MDEV-6916, an\nissue introduced in MariaDB 5.2 where the view algorithms were swapped\ncompared to their MySQL on disk representation. It checks whether the view\nalgorithm is correct. It is run as part of mariadb-upgrade, and should not\nnormally be required in regular use.\n\nBy default it corrects the checksum and if necessary adds the mariadb-version\nfield. If the optional FROM MYSQL clause is used, and no mariadb-version field\nis present, the MERGE and TEMPTABLE algorithms are toggled.\n\nBy default, REPAIR VIEW statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nURL: https://mariadb.com/kb/en/repair-view/','','https://mariadb.com/kb/en/repair-view/'),
(578,'GeomCollFromWKB',32,'A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-geomcollfromwkb/','','https://mariadb.com/kb/en/wkb-geomcollfromwkb/'),
(579,'GeometryCollectionFromWKB',32,'A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/geometrycollectionfromwkb/','','https://mariadb.com/kb/en/geometrycollectionfromwkb/'),
(580,'GeometryFromWKB',32,'A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/geometryfromwkb/','','https://mariadb.com/kb/en/geometryfromwkb/'),
(581,'GeomFromWKB',32,'A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-geomfromwkb/','','https://mariadb.com/kb/en/wkb-geomfromwkb/'),
(582,'LineFromWKB',32,'A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-linefromwkb/','','https://mariadb.com/kb/en/wkb-linefromwkb/'),
(583,'LineStringFromWKB',32,'A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/linestringfromwkb/','','https://mariadb.com/kb/en/linestringfromwkb/'),
(584,'MultiLineStringFromWKB',32,'A synonym for MLineFromWKB().\n\nURL: https://mariadb.com/kb/en/multilinestringfromwkb/','','https://mariadb.com/kb/en/multilinestringfromwkb/'),
(585,'MultiPointFromWKB',32,'A synonym for MPointFromWKB.\n\nURL: https://mariadb.com/kb/en/multipointfromwkb/','','https://mariadb.com/kb/en/multipointfromwkb/'),
(586,'MultiPolygonFromWKB',32,'Synonym for MPolyFromWKB.\n\nURL: https://mariadb.com/kb/en/multipolygonfromwkb/','','https://mariadb.com/kb/en/multipolygonfromwkb/'),
(587,'PointFromWKB',32,'A synonym for ST_PointFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-pointfromwkb/','','https://mariadb.com/kb/en/wkb-pointfromwkb/'),
(588,'PolyFromWKB',32,'A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/wkb-polyfromwkb/','','https://mariadb.com/kb/en/wkb-polyfromwkb/'),
(589,'PolygonFromWKB',32,'A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/polygonfromwkb/','','https://mariadb.com/kb/en/polygonfromwkb/'),
(590,'ST_AsBinary',32,'Syntax\n------\n\nST_AsBinary(g)\nAsBinary(g)\nST_AsWKB(g)\nAsWKB(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKB representation and\nreturns the binary result.\n\nST_AsBinary(), AsBinary(), ST_AsWKB() and AsWKB() are synonyms,\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,0 1,1 1,1 0,0 0))\');\nSELECT ST_AsBinary(@poly);\n\nSELECT ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly)));\n+--------------------------------------------+\n| ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly))) |\n+--------------------------------------------+\n| POLYGON((0 0,0 1,1 1,1 0,0 0))             |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_asbinary/','','https://mariadb.com/kb/en/st_asbinary/'),
(252,'mysql.func Table',22,'The mysql.func table stores information about user-defined functions (UDFs)\ncreated with the CREATE FUNCTION UDF statement.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, this table uses the Aria storage engine.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, this table uses the MyISAM storage engine.\n\nThe mysql.func table contains the following fields:\n\n+----------+---------+---------+-------+--------------+---------------------+\n| Field    | Type    | Null    | Key   | Default      | Description         |\n+----------+---------+---------+-------+--------------+---------------------+\n| name     | char(64 | NO      | PRI   |              | UDF name            |\n|          |         |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| ret      | tinyint | NO      |       | 0            |                     |\n|          | 1)      |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| dl       | char(12 | NO      |       |              | Shared library name |\n|          | )       |         |       |              |                     |\n+----------+---------+---------+-------+--------------+---------------------+\n| type     | enum(\'f | NO      |       | NULL         | Type, either        |\n|          | nction\' |         |       |              | function or         |\n|          | \'aggreg |         |       |              | aggregate.          |\n|          | te\')    |         |       |              | Aggregate           |\n|          |         |         |       |              | functions are       |\n|          |         |         |       |              | summary functions   |\n|          |         |         |       |              | such as SUM() and   |\n|          |         |         |       |              | AVG().              |\n+----------+---------+---------+-------+--------------+---------------------+\n\nExample\n-------\n\nSELECT * FROM mysql.func;\n+------------------------------+-----+--------------+-----------+\n| name                         | ret | dl           | type      |\n+------------------------------+-----+--------------+-----------+\n| spider_direct_sql            |   2 | ha_spider.so | function  |\n| spider_bg_direct_sql         |   2 | ha_spider.so | aggregate |\n| spider_ping_table            |   2 | ha_spider.so | function  |\n| spider_copy_tables           |   2 | ha_spider.so | function  |\n| spider_flush_table_mon_cache |   2 | ha_spider.so | function  |\n+------------------------------+-----+--------------+-----------+\n\nURL: https://mariadb.com/kb/en/mysqlfunc-table/','','https://mariadb.com/kb/en/mysqlfunc-table/'),
(254,'DROP FUNCTION UDF',22,'Syntax\n------\n\nDROP FUNCTION [IF EXISTS] function_name\n\nDescription\n-----------\n\nThis statement drops the user-defined function (UDF) named function_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql database.\nThis is because DROP FUNCTION removes the row from the mysql.func system table\nthat records the function\'s name, type and shared library name.\n\nFor dropping a stored function, see DROP FUNCTION.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nDROP FUNCTION jsoncontains_path;\n\nIF EXISTS:\n\nDROP FUNCTION jsoncontains_path;\nERROR 1305 (42000): FUNCTION test.jsoncontains_path does not exist\n\nDROP FUNCTION IF EXISTS jsoncontains_path;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------------+\n| Level | Code | Message                                        |\n+-------+------+------------------------------------------------+\n| Note  | 1305 | FUNCTION test.jsoncontains_path does not exist |\n+-------+------+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-function-udf/','','https://mariadb.com/kb/en/drop-function-udf/'),
(257,'User-Defined Functions Security',22,'The MariaDB server imposes a number of limitations on user-defined functions\nfor security purposes.\n\n* The INSERT privilege for the mysql database is required to run CREATE\nFUNCTION, as a record will be added to the mysql.func-table.\n* The DELETE privilege for the mysql database is required to run DROP FUNCTION\nas the corresponding record will be removed from the mysql.func-table.\n* UDF object files can only be placed in the plugin directory, as specified by\nthe value of the plugin_dir system variable.\n* At least one symbol, beyond the required x() - corresponding to an SQL\nfunction X()) - is required. These can be x_init(), x_deinit(), xxx_reset(),\nx_clear() and x_add() functions (see Creating User-defined Functions). The\nallow-suspicious-udfs mysqld option (by default unset) provides a workaround,\npermitting only one symbol to be used. This is not recommended, as it opens\nthe possibility of loading shared objects that are not legitimate user-defined\nfunctions.\n\nURL: https://mariadb.com/kb/en/user-defined-functions-security/','','https://mariadb.com/kb/en/user-defined-functions-security/'),
(591,'ST_AsWKB',32,'A synonym for ST_AsBinary().\n\nURL: https://mariadb.com/kb/en/st_aswkb/','','https://mariadb.com/kb/en/st_aswkb/'),
(593,'ST_GeometryCollectionFromWKB',32,'A synonym for ST_GeomCollFromWKB.\n\nURL: https://mariadb.com/kb/en/st_geometrycollectionfromwkb/','','https://mariadb.com/kb/en/st_geometrycollectionfromwkb/'),
(594,'ST_GeometryFromWKB',32,'A synonym for ST_GeomFromWKB.\n\nURL: https://mariadb.com/kb/en/st_geometryfromwkb/','','https://mariadb.com/kb/en/st_geometryfromwkb/'),
(595,'ST_GeomFromWKB',32,'Syntax\n------\n\nST_GeomFromWKB(wkb[,srid])\nST_GeometryFromWKB(wkb[,srid])\nGeomFromWKB(wkb[,srid])\nGeometryFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKB representation and SRID.\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB() and GeometryFromWKB()\nare synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LINESTRING(0 4, 4 6)\'));\n\nSELECT ST_AsText(ST_GeomFromWKB(@g));\n+-------------------------------+\n| ST_AsText(ST_GeomFromWKB(@g)) |\n+-------------------------------+\n| LINESTRING(0 4,4 6)           |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomfromwkb/','','https://mariadb.com/kb/en/st_geomfromwkb/'),
(596,'ST_LineFromWKB',32,'Syntax\n------\n\nST_LineFromWKB(wkb[,srid])\nLineFromWKB(wkb[,srid])\nST_LineStringFromWKB(wkb[,srid])\nLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nST_LineFromWKB(), LineFromWKB(), ST_LineStringFromWKB(), and\nLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LineString(0 4,4 6)\'));\n\nSELECT ST_AsText(ST_LineFromWKB(@g)) AS l;\n+---------------------+\n| l                   |\n+---------------------+\n| LINESTRING(0 4,4 6) |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st_linefromwkb/','','https://mariadb.com/kb/en/st_linefromwkb/'),
(597,'ST_LineStringFromWKB',32,'A synonym for ST_LineFromWKB.\n\nURL: https://mariadb.com/kb/en/st_linestringfromwkb/','','https://mariadb.com/kb/en/st_linestringfromwkb/'),
(253,'CREATE FUNCTION UDF',22,'Syntax\n------\n\nCREATE [OR REPLACE] [AGGREGATE] FUNCTION [IF NOT EXISTS] function_name\n  RETURNS {STRING|INTEGER|REAL|DECIMAL}\n  SONAME shared_library_name\n\nDescription\n-----------\n\nA user-defined function (UDF) is a way to extend MariaDB with a new function\nthat works like a native (built-in) MariaDB function such as ABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to invoke the\nfunction.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary becauseCREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and shared\nlibrary name. If you do not have this table, you should run the\nmariadb-upgrade command to create it.\n\nUDFs need to be written in C, C++ or another language that uses C calling\nconventions, MariaDB needs to have been dynamically compiled, and your\noperating system must support dynamic loading.\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see http://www.mysqludf.org/.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFor creating a stored function as opposed to a user-defined function, see\nCREATE FUNCTION.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nRETURNS\n-------\n\nThe RETURNS clause indicates the type of the function\'s return value, and can\nbe one of STRING, INTEGER, REAL or DECIMAL. DECIMAL functions currently return\nstring values and should be written like STRING functions.\n\nshared_library_name\n-------------------\n\nshared_library_name is the basename of the shared object file that contains\nthe code that implements the function. The file must be located in the plugin\ndirectory. This directory is given by the value of the plugin_dir system\nvariable. Note that before MariaDB/MySQL 5.1, the shared object could be\nlocated in any directory that was searched by your system\'s dynamic linker.\n\nAGGREGATE\n---------\n\nAggregate functions are summary functions such as SUM() and AVG().\n\nMariaDB starting with 10.4\n--------------------------\nAggregate UDF functions can be used as window functions.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION name ...;\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified function already exists. Cannot be used together\nwith OR REPLACE.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nERROR 1125 (HY000): Function \'jsoncontains_path\' already exists\n\nCREATE OR REPLACE FUNCTION jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE FUNCTION IF NOT EXISTS jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message                                     |\n+-------+------+---------------------------------------------+\n| Note  | 1125 | Function \'jsoncontains_path\' already exists |\n+-------+------+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/create-function-udf/','','https://mariadb.com/kb/en/create-function-udf/'),
(259,'TINYINT',23,'Syntax\n------\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA very small integer. The signed range is -128 to 127. The unsigned range is 0\nto 255. For details on the attributes, see Numeric Data Type Overview.\n\nINT1 is a synonym for TINYINT. BOOL and BOOLEAN are synonyms for TINYINT(1).\n\nExamples\n--------\n\nCREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c TINYINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |   10 |  010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |   10 |  010 |\n|  127 |  128 |  128 |\n+------+------+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.11 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |    0 |  000 |\n|  -10 |   10 |  000 |\n|  -10 |   10 |  010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nQuery OK, 1 row affected, 1 warning (0.19 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a    | b    | c    |\n+------+------+------+\n|  -10 |    0 |  000 |\n|  -10 |   10 |  000 |\n|  -10 |   10 |  010 |\n|  127 |  128 |  128 |\n|  127 |  128 |  128 |\n+------+------+------+\n\nURL: https://mariadb.com/kb/en/tinyint/','','https://mariadb.com/kb/en/tinyint/'),
(598,'ST_PointFromWKB',32,'Syntax\n------\n\nST_PointFromWKB(wkb[,srid])\nPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKB representation and SRID.\n\nST_PointFromWKB() and PointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PointFromText(\'POINT(0 4)\'));\n\nSELECT ST_AsText(ST_PointFromWKB(@g)) AS p;\n+------------+\n| p          |\n+------------+\n| POINT(0 4) |\n+------------+\n\nURL: https://mariadb.com/kb/en/st_pointfromwkb/','','https://mariadb.com/kb/en/st_pointfromwkb/'),
(599,'ST_PolyFromWKB',32,'Syntax\n------\n\nST_PolyFromWKB(wkb[,srid])\nST_PolygonFromWKB(wkb[,srid])\nPolyFromWKB(wkb[,srid])\nPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB() and PolygonFromWKB() are\nsynonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PolyFromText(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1\n1))\'));\n\nSELECT ST_AsText(ST_PolyFromWKB(@g)) AS p;\n+----------------------------------------+\n| p                                      |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_polyfromwkb/','','https://mariadb.com/kb/en/st_polyfromwkb/'),
(255,'Creating User-Defined Functions',22,'User-defined functions allow MariaDB to be extended with a new function that\nworks like a native (built-in) MariaDB function such as ABS() or CONCAT().\nThere are alternative ways to add a new function: writing a native function\n(which requires modifying and compiling the server source code), or writing a\nstored function.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFunctions are written in C or C++, and to make use of them, the operating\nsystem must support dynamic loading.\n\nEach new SQL function requires corresponding functions written in C/C++. In\nthe list below, at least the main function - x() - and one other, are\nrequired. x should be replaced by the name of the function you are creating.\n\nAll functions need to be thread-safe, so not global or static variables that\nchange can be allocated. Memory is allocated in x_init()/ and freed in\nx_deinit().\n\nSimple Functions\n----------------\n\nx()\n---\n\nRequired for all UDFs; this is where the results are calculated.\n\n+------------------------------------------+----------------------------------+\n| C/C++ type                               | SQL type                         |\n+------------------------------------------+----------------------------------+\n| char *                                   | STRING                           |\n+------------------------------------------+----------------------------------+\n| long long                                | INTEGER                          |\n+------------------------------------------+----------------------------------+\n| double                                   | REAL                             |\n+------------------------------------------+----------------------------------+\n\nDECIMAL functions return string values, and so should be written accordingly.\nIt is not possible to create ROW functions.\n\nx_init()\n--------\n\nInitialization function for x(). Can be used for the following:\n\n* Check the number of arguments to X() (the SQL equivalent).\n* Verify the argument types, or to force arguments to be of a particular type\nafter the function is called.\n* Specify whether the result can be NULL.\n* Specify the maximum result length.\n* For REAL functions, specify the maximum number of decimals for the result.\n* Allocate any required memory.\n\nx_deinit()\n----------\n\nDe-initialization function for x(). Used to de-allocate memory that was\nallocated in x_init().\n\nDescription\n-----------\n\nEach time the SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n* See User-defined Functions Calling Sequences for more details on the\nfunctions.\n\nAggregate Functions\n-------------------\n\nThe following functions are required for aggregate functions, such as AVG()\nand SUM(). When using CREATE FUNCTION, the AGGREGATE keyword is required.\n\nx_clear()\n---------\n\nUsed to reset the current aggregate, but without inserting the argument as the\ninitial aggregate value for the new group.\n\nx_add()\n-------\n\nUsed to add the argument to the current aggregate.\n\nx_remove()\n----------\n\nStarting from MariaDB 10.4, improves the support of window functions (so it is\nnot obligatory to add it) and should remove the argument from the current\naggregate.\n\nDescription\n-----------\n\nEach time the aggregate SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* The table is sorted according to the GROUP BY expression.\n* x_clear() is called for the first row of each new group.\n* x_add() is called once per row for each row in the same group.\n* x() is called when the group changes, or after the last row, to get the\naggregate result. \n* The latter three steps are repeated until all rows have been processed.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\nExamples\n--------\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see https://github.com/mysqludf.\n\nURL: https://mariadb.com/kb/en/creating-user-defined-functions/','','https://mariadb.com/kb/en/creating-user-defined-functions/'),
(600,'ST_PolygonFromWKB',32,'A synonym for ST_PolyFromWKB.\n\nURL: https://mariadb.com/kb/en/st_polygonfromwkb/','','https://mariadb.com/kb/en/st_polygonfromwkb/'),
(604,'BOUNDARY',35,'A synonym for ST_BOUNDARY.\n\nURL: https://mariadb.com/kb/en/geometry-properties-boundary/','','https://mariadb.com/kb/en/geometry-properties-boundary/'),
(605,'DIMENSION',35,'A synonym for ST_DIMENSION.\n\nURL: https://mariadb.com/kb/en/dimension/','','https://mariadb.com/kb/en/dimension/'),
(606,'ENVELOPE',35,'A synonym for ST_ENVELOPE.\n\nURL: https://mariadb.com/kb/en/geometry-properties-envelope/','','https://mariadb.com/kb/en/geometry-properties-envelope/'),
(607,'GeometryN',35,'A synonym for ST_GeometryN.\n\nURL: https://mariadb.com/kb/en/geometry-properties-geometryn/','','https://mariadb.com/kb/en/geometry-properties-geometryn/'),
(608,'GeometryType',35,'A synonym for ST_GeometryType.\n\nURL: https://mariadb.com/kb/en/geometry-properties-geometrytype/','','https://mariadb.com/kb/en/geometry-properties-geometrytype/'),
(609,'IsClosed',35,'A synonym for ST_IsClosed.\n\nURL: https://mariadb.com/kb/en/isclosed/','','https://mariadb.com/kb/en/isclosed/'),
(610,'IsEmpty',35,'A synonym for ST_IsEmpty.\n\nURL: https://mariadb.com/kb/en/geometry-properties-isempty/','','https://mariadb.com/kb/en/geometry-properties-isempty/'),
(611,'IsRing',35,'A synonym for ST_IsRing.\n\nURL: https://mariadb.com/kb/en/isring/','','https://mariadb.com/kb/en/isring/'),
(612,'IsSimple',35,'A synonym for ST_IsSImple.\n\nURL: https://mariadb.com/kb/en/geometry-properties-issimple/','','https://mariadb.com/kb/en/geometry-properties-issimple/'),
(613,'NumGeometries',35,'A synonym for ST_NumGeometries.\n\nURL: https://mariadb.com/kb/en/geometry-properties-numgeometries/','','https://mariadb.com/kb/en/geometry-properties-numgeometries/'),
(614,'SRID',35,'A synonym for ST_SRID.\n\nURL: https://mariadb.com/kb/en/geometry-properties-srid/','','https://mariadb.com/kb/en/geometry-properties-srid/'),
(618,'ST_GEOMETRYN',35,'Syntax\n------\n\nST_GeometryN(gc,N)\nGeometryN(gc,N)\n\nDescription\n-----------\n\nReturns the N-th geometry in the GeometryCollection gc. Geometries are\nnumbered beginning with 1.\n\nST_GeometryN() and GeometryN() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(12 14, 9 11))\';\n\nSELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1)                             |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geometryn/','','https://mariadb.com/kb/en/st_geometryn/'),
(256,'User-Defined Functions Calling Sequences',22,'The functions described in Creating User-defined Functions are expanded on\nthis page. They are declared as follows:\n\nSimple Functions\n----------------\n\nx()\n---\n\nIf x() returns an integer, it is declared as follows:\n\nlong long x(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nIf x() returns a string (DECIMAL functions also return string values), it is\ndeclared as follows:\n\nchar *x(UDF_INIT *initid, UDF_ARGS *args,\n     char *result, unsigned long *length,\n     char *is_null, char *error);\n\nIf x() returns a real, it is declared as follows:\n\ndouble x(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nx_init()\n--------\n\nmy_bool x_init(UDF_INIT *initid, UDF_ARGS *args, char *message);\n\nx_deinit()\n----------\n\nvoid x_deinit(UDF_INIT *initid);\n\nDescription\n-----------\n\ninitid is a parameter passed to all three functions that points to a UDF_INIT\nstructure, used for communicating information between the functions. Its\nstructure members are:\n\n* my_bool maybe_null\nmaybe_null should be set to 1 if x_init can return a NULL value, Defaults to 1\nif any arguments are declared maybe_null.\n\n* unsigned int decimals\nNumber of decimals after the decimal point. The default, if an explicit number\nof decimals is passed in the arguments to the main function, is the maximum\nnumber of decimals, so if 9.5, 9.55 and 9.555 are passed to the function, the\ndefault would be three (based on 9.555, the maximum).  If there are no\nexplicit number of decimals, the default is set to 31, or one more than the\nmaximum for the DOUBLE, FLOAT and DECIMAL types. This default can be changed\nin the function to suit the actual calculation.\n\n* unsigned int max_length\nMaximum length of the result. For integers, the default is 21. For strings,\nthe length of the longest argument. For reals, the default is 13 plus the\nnumber of decimals indicated by initid->decimals. The length includes any\nsigns or decimal points. Can also be set to 65KB or 16MB in order to return a\nBLOB. The memory remains unallocated, but this is used to decide on the data\ntype to use if the data needs to be temporarily stored.\n\n* char *ptr\nA pointer for use as required by the function. Commonly, initid->ptr is used\nto communicate allocated memory, with x_init() allocating the memory and\nassigning it to this pointer, x() using it, and x_deinit() de-allocating it.\n\n* my_bool const_item\nShould be set to 1 in x_init() if x() always returns the same value, otherwise\n0.\n\nAggregate Functions\n-------------------\n\nx_clear()\n---------\n\nx_clear() is a required function for aggregate functions, and is declared as\nfollows:\n\nvoid x_clear(UDF_INIT *initid, char *is_null, char *error);\n\nIt is called when the summary results need to be reset, that is at the\nbeginning of each new group. but also to reset the values when there were no\nmatching rows.\n\nis_null is set to point to CHAR(0) before calling x_clear().\n\nIn the case of an error, you can store the value to which the error argument\npoints (a single-byte variable, not a string string buffer) in the variable.\n\nx_reset()\n---------\n\nx_reset() is declared as follows:\n\nvoid x_reset(UDF_INIT *initid, UDF_ARGS *args,\n       char *is_null, char *error);\n\nIt is called on finding the first row in a new group. Should reset the summary\nvariables, and then use UDF_ARGS as the first value in the group\'s internal\nsummary value. The function is not required if the UDF interface uses\nx_clear().\n\nx_add()\n-------\n\nx_add() is declared as follows:\n\nvoid x_add(UDF_INIT *initid, UDF_ARGS *args,\n      char *is_null, char *error);\n\nIt is called for all rows belonging to the same group, and should be used to\nadd the value in UDF_ARGS to the internal summary variable.\n\nx_remove()\n----------\n\nx_remove() was added in MariaDB 10.4 and is declared as follows (same as\nx_add()):\n\nvoid x_remove(UDF_INIT* initid, UDF_ARGS* args,\n       char* is_null, char *error );\n\nIt adds more efficient support of aggregate UDFs as window functions.\nx_remove() should \"subtract\" the row (reverse x_add()). In MariaDB 10.4\naggregate UDFs will work as WINDOW functions without x_remove() but it will\nnot be so efficient.\n\nIf x_remove() supported (defined) detected automatically.\n\nURL: https://mariadb.com/kb/en/user-defined-functions-calling-sequences/','','https://mariadb.com/kb/en/user-defined-functions-calling-sequences/'),
(260,'BOOLEAN',23,'Syntax\n------\n\nBOOL, BOOLEAN\n\nDescription\n-----------\n\nThese types are synonyms for TINYINT(1). A value of zero is considered false.\nNon-zero values are considered true.\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0. See Boolean\nLiterals, as well as the IS operator for testing values against a boolean.\n\nExamples\n--------\n\nCREATE TABLE boo (i BOOLEAN);\n\nDESC boo;\n+-------+------------+------+-----+---------+-------+\n| Field | Type       | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| i     | tinyint(1) | YES  |     | NULL    |       |\n+-------+------------+------+-----+---------+-------+\n\nSELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false                  |\n+------------------------+\n\nSELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nSELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true                   |\n+------------------------+\n\nTRUE and FALSE as aliases for 1 and 0:\n\nSELECT IF(0 = FALSE, \'true\', \'false\');\n\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true                           |\n+--------------------------------+\n\nSELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true                          |\n+-------------------------------+\n\nSELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false                         |\n+-------------------------------+\n\nSELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false                          |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: https://mariadb.com/kb/en/boolean/','','https://mariadb.com/kb/en/boolean/'),
(619,'ST_GEOMETRYTYPE',35,'Syntax\n------\n\nST_GeometryType(g)\nGeometryType(g)\n\nDescription\n-----------\n\nReturns as a string the name of the geometry type of which the geometry\ninstance g is a member. The name corresponds to one of the instantiable\nGeometry subclasses.\n\nST_GeometryType() and GeometryType() are synonyms.\n\nExamples\n--------\n\nSELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT                                    |\n+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geometrytype/','','https://mariadb.com/kb/en/st_geometrytype/'),
(621,'ST_ISEMPTY',35,'Syntax\n------\n\nST_IsEmpty(g)\nIsEmpty(g)\n\nDescription\n-----------\n\nIsEmpty is a function defined by the OpenGIS specification, but is not fully\nimplemented by MariaDB or MySQL.\n\nSince MariaDB and MySQL do not support GIS EMPTY values such as POINT EMPTY,\nas implemented it simply returns 1 if the geometry value g is invalid, 0 if it\nis valid, and NULL if the argument is NULL.\n\nST_IsEmpty() and IsEmpty() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_isempty/','','https://mariadb.com/kb/en/st_isempty/'),
(258,'Numeric Data Type Overview',23,'There are a number of numeric data types:\n\n* TINYINT\n* BOOLEAN - Synonym for TINYINT(1)\n* INT1 - Synonym for TINYINT\n* SMALLINT\n* INT2 - Synonym for SMALLINT\n* MEDIUMINT\n* INT3 - Synonym for MEDIUMINT\n* INT, INTEGER\n* INT4 - Synonym for INT\n* BIGINT\n* INT8 - Synonym for BIGINT\n* DECIMAL, DEC, NUMERIC, FIXED\n* FLOAT\n* DOUBLE, DOUBLE PRECISION, REAL\n* BIT\n\nSee the specific articles for detailed information on each.\n\nSIGNED, UNSIGNED and ZEROFILL\n-----------------------------\n\nMost numeric types can be defined as SIGNED, UNSIGNED or ZEROFILL, for example:\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nIf SIGNED, or no attribute, is specified, a portion of the numeric type will\nbe reserved for the sign (plus or minus). For example, a TINYINT SIGNED can\nrange from -128 to 127.\n\nIf UNSIGNED is specified, no portion of the numeric type is reserved for the\nsign, so for integer types range can be larger. For example, a TINYINT\nUNSIGNED can range from 0 to 255. Floating point and fixed-point types also\ncan be UNSIGNED, but this only prevents negative values from being stored and\ndoesn\'t alter the range.\n\nIf ZEROFILL is specified, the column will be set to UNSIGNED and the spaces\nused by default to pad the field are replaced with zeros. ZEROFILL is ignored\nin expressions or as part of a UNION. ZEROFILL is a non-standard MySQL and\nMariaDB enhancement.\n\nNote that although the preferred syntax indicates that the attributes are\nexclusive, more than one attribute can be specified.\n\nUntil MariaDB 10.2.7 (MDEV-8659), any combination of the attributes could be\nused in any order, with duplicates. In this case:\n\n* the presence of ZEROFILL makes the column UNSIGNED ZEROFILL.\n* the presence of UNSIGNED makes the column UNSIGNED.\n\nFrom MariaDB 10.2.8, only the following combinations are supported:\n\n* SIGNED\n* UNSIGNED\n* ZEROFILL\n* UNSIGNED ZEROFILL\n* ZEROFILL UNSIGNED\n\nThe latter two should be replaced with simply ZEROFILL, but are still accepted\nby the parser.\n\nExamples\n--------\n\nCREATE TABLE zf (\n i1 TINYINT SIGNED,\n i2 TINYINT UNSIGNED,\n i3 TINYINT ZEROFILL\n);\n\nINSERT INTO zf VALUES (2,2,2);\n\nSELECT * FROM zf;\n+------+------+------+\n| i1   | i2   | i3   |\n+------+------+------+\n|    2 |    2 |  002 |\n+------+------+------+\n\nRange\n-----\n\nWhen attempting to add a value that is out of the valid range for the numeric\ntype, MariaDB will react depending on the strict SQL_MODE setting.\n\nIf strict_mode has been set (the default from MariaDB 10.2.4), MariaDB will\nreturn an error.\n\nIf strict_mode has not been set (the default until MariaDB 10.2.3), MariaDB\nwill adjust the number to fit in the field, returning a warning.\n\nExamples\n--------\n\nWith strict_mode set:\n\nSHOW VARIABLES LIKE \'sql_mode\';\n+---------------+--------------------------------------------------------------\n----------------------------+\n| Variable_name | Value                                                       \n              |\n+---------------+--------------------------------------------------------------\n----------------------------+\n| sql_mode      |\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+---------------+--------------------------------------------------------------\n----------------------------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nERROR 1264 (22003): Out of range value for column \'i1\' at row 1\n\nSELECT * FROM ranges;\nEmpty set (0.10 sec)\n\nWith strict_mode unset:\n\nSHOW VARIABLES LIKE \'sql_mode%\';\n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| sql_mode      |       |\n+---------------+-------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level   | Code | Message                                     |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'i1\' at row 1 |\n| Warning | 1264 | Out of range value for column \'i3\' at row 1 |\n+---------+------+---------------------------------------------+\n2 rows in set (0.00 sec)\n\nSELECT * FROM ranges;\n+------+------+------+\n| i1   | i2   | i3   |\n+------+------+------+\n|  127 |  257 |  255 |\n+------+------+------+\n\nAuto_increment\n--------------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. For more details, see auto_increment.\n\nURL: https://mariadb.com/kb/en/numeric-data-type-overview/','','https://mariadb.com/kb/en/numeric-data-type-overview/'),
(261,'SMALLINT',23,'Syntax\n------\n\nSMALLINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small integer. The signed range is -32768 to 32767. The unsigned range is 0\nto 65535.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the SMALLINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nINT2 is a synonym for SMALLINT.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE smallints (a SMALLINT,b SMALLINT UNSIGNED,c SMALLINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a     | b     | c     |\n+-------+-------+-------+\n|   -10 |    10 | 00010 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.09 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a     | b     | c     |\n+-------+-------+-------+\n|   -10 |     0 | 00000 |\n|   -10 |    10 | 00000 |\n|   -10 |    10 | 00010 |\n| 32767 | 32768 | 32768 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\nURL: https://mariadb.com/kb/en/smallint/','','https://mariadb.com/kb/en/smallint/'),
(622,'ST_IsRing',35,'MariaDB starting with 10.1.2\n----------------------------\nThe ST_IsRing function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_IsRing(g)\nIsRing(g)\n\nDescription\n-----------\n\nReturns true if a given LINESTRING is a ring, that is, both ST_IsClosed and\nST_IsSimple. A simple curve does not pass through the same point more than\nonce. However, see MDEV-7510.\n\nSt_IsRing() and IsRing() are synonyms.\n\nURL: https://mariadb.com/kb/en/st_isring/','','https://mariadb.com/kb/en/st_isring/'),
(262,'MEDIUMINT',23,'Syntax\n------\n\nMEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The unsigned\nrange is 0 to 16777215.\n\nZEROFILL pads the integer with zeroes and assumes UNSIGNED (even if UNSIGNED\nis not specified).\n\nINT3 is a synonym for MEDIUMINT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT\nZEROFILL);\n\nDESCRIBE mediumints;\n+-------+--------------------------------+------+-----+---------+-------+\n| Field | Type                           | Null | Key | Default | Extra |\n+-------+--------------------------------+------+-----+---------+-------+\n| a     | mediumint(9)                   | YES  |     | NULL    |       |\n| b     | mediumint(8) unsigned          | YES  |     | NULL    |       |\n| c     | mediumint(8) unsigned zerofill | YES  |     | NULL    |       |\n+-------+--------------------------------+------+-----+---------+-------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a       | b       | c        |\n+---------+---------+----------+\n|     -10 |      10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.05 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nQuery OK, 1 row affected, 1 warning (0.05 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a       | b       | c        |\n+---------+---------+----------+\n|     -10 |       0 | 00000000 |\n|     -10 |       0 | 00000000 |\n|     -10 |      10 | 00000000 |\n|     -10 |      10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\nURL: https://mariadb.com/kb/en/mediumint/','','https://mariadb.com/kb/en/mediumint/'),
(263,'INT',23,'Syntax\n------\n\nINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\nINTEGER[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size integer. When marked UNSIGNED, it ranges from 0 to 4294967295,\notherwise its range is -2147483648 to 2147483647 (SIGNED is the default). If a\ncolumn has been set to ZEROFILL, all values will be prepended by zeros so that\nthe INT value contains a number of M digits. INTEGER is a synonym for INT.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nINT4 is a synonym for INT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE ints (a INT,b INT UNSIGNED,c INT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO ints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO ints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,10);\n\nINSERT INTO ints VALUES (2147483648,2147483648,2147483648);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO ints VALUES (2147483647,2147483648,2147483648);\n\nSELECT * FROM ints;\n+------------+------------+------------+\n| a          | b          | c          |\n+------------+------------+------------+\n|        -10 |         10 | 0000000010 |\n| 2147483647 | 2147483648 | 2147483648 |\n+------------+------------+------------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO ints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.10 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO ints VALUES (-10,10,10);\n\nINSERT INTO ints VALUES (2147483648,2147483648,2147483648);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO ints VALUES (2147483647,2147483648,2147483648);\n\nSELECT * FROM ints;\n+------------+------------+------------+\n| a          | b          | c          |\n+------------+------------+------------+\n|        -10 |          0 | 0000000000 |\n|        -10 |         10 | 0000000000 |\n|        -10 |         10 | 0000000010 |\n| 2147483647 | 2147483648 | 2147483648 |\n| 2147483647 | 2147483648 | 2147483648 |\n+------------+------------+------------+\n\nURL: https://mariadb.com/kb/en/int/','','https://mariadb.com/kb/en/int/'),
(623,'ST_IsSimple',35,'Syntax\n------\n\nST_IsSimple(g)\nIsSimple(g)\n\nDescription\n-----------\n\nReturns true if the given Geometry has no anomalous geometric points, false if\nit does, or NULL if given a NULL value.\n\nST_IsSimple() and IsSimple() are synonyms.\n\nExamples\n--------\n\nA POINT is always simple.\n\nSET @g = \'Point(1 2)\';\n\nSELECT ST_ISSIMPLE(GEOMFROMTEXT(@g));\n+-------------------------------+\n| ST_ISSIMPLE(GEOMFROMTEXT(@g)) |\n+-------------------------------+\n|                             1 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/st_issimple/','','https://mariadb.com/kb/en/st_issimple/'),
(624,'ST_NUMGEOMETRIES',35,'Syntax\n------\n\nST_NumGeometries(gc)\nNumGeometries(gc)\n\nDescription\n-----------\n\nReturns the number of geometries in the GeometryCollection gc.\n\nST_NumGeometries() and NumGeometries() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\n\nSELECT NUMGEOMETRIES(GeomFromText(@gc));\n+----------------------------------+\n| NUMGEOMETRIES(GeomFromText(@gc)) |\n+----------------------------------+\n|                                2 |\n+----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_numgeometries/','','https://mariadb.com/kb/en/st_numgeometries/'),
(625,'ST_RELATE',35,'MariaDB starting with 10.1.2\n----------------------------\nThe ST_RELATE() function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_Relate(g1, g2, i)\n\nDescription\n-----------\n\nReturns true if Geometry g1 is spatially related to Geometryg2 by testing for\nintersections between the interior, boundary and exterior of the two\ngeometries as specified by the values in intersection matrix pattern i.\n\nURL: https://mariadb.com/kb/en/st_relate/','','https://mariadb.com/kb/en/st_relate/'),
(626,'ST_SRID',35,'Syntax\n------\n\nST_SRID(g)\nSRID(g)\n\nDescription\n-----------\n\nReturns an integer indicating the Spatial Reference System ID for the geometry\nvalue g.\n\nIn MariaDB, the SRID value is just an integer associated with the geometry\nvalue. All calculations are done assuming Euclidean (planar) geometry.\n\nST_SRID() and SRID() are synonyms.\n\nExamples\n--------\n\nSELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n|                                           101 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_srid/','','https://mariadb.com/kb/en/st_srid/'),
(264,'BIGINT',23,'Syntax\n------\n\nBIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the BIGINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nSERIAL is an alias for:\n\nBIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE\n\nINT8 is a synonym for BIGINT.\n\nExamples\n--------\n\nCREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a                   | b                   | c                    |\n+---------------------+---------------------+----------------------+\n|                 -10 |                  10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a                   | b                   | c                    |\n+---------------------+---------------------+----------------------+\n|                 -10 |                   0 | 00000000000000000000 |\n|                 -10 |                  10 | 00000000000000000000 |\n|                 -10 |                  10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nURL: https://mariadb.com/kb/en/bigint/','','https://mariadb.com/kb/en/bigint/'),
(265,'DECIMAL',23,'Syntax\n------\n\nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA packed \"exact\" fixed-point number. M is the total number of digits (the\nprecision) and D is the number of digits after the decimal point (the scale).\n\n* The decimal point and (for negative numbers) the \"-\" sign are not\ncounted in M. \n* If D is 0, values have no decimal point or fractional\npart and on INSERT the value will be rounded to the nearest DECIMAL. \n* The maximum number of digits (M) for DECIMAL is 65. \n* The maximum number of supported decimals (D) is 30 before MariadB 10.2.1 and\n38 afterwards. \n* If D is omitted, the default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with a\nprecision of 65 digits.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nDEC, NUMERIC and FIXED are synonyms, as well as NUMBER in Oracle mode from\nMariaDB 10.3.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6  Duplicates: 0  Warnings: 2\n\nNote (Code 1265): Data truncated for column \'d\' at row 5\nNote (Code 1265): Data truncated for column \'d\' at row 6\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO t1 VALUES (-7);\nERROR 1264 (22003): Out of range value for column \'d\' at row 1\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO t1 VALUES (-7);\nQuery OK, 1 row affected, 1 warning (0.02 sec)\nWarning (Code 1264): Out of range value for column \'d\' at row 1\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n| 0000000000 |\n+------------+\n\nURL: https://mariadb.com/kb/en/decimal/','','https://mariadb.com/kb/en/decimal/'),
(628,'NOT REGEXP',36,'Syntax\n------\n\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nDescription\n-----------\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: https://mariadb.com/kb/en/not-regexp/','','https://mariadb.com/kb/en/not-regexp/'),
(633,'ASCII',36,'Syntax\n------\n\nASCII(str)\n\nDescription\n-----------\n\nReturns the numeric ASCII value of the leftmost character of the string\nargument. Returns 0 if the given string is empty and NULL if it is NULL.\n\nASCII() works for 8-bit characters.\n\nExamples\n--------\n\nSELECT ASCII(9);\n+----------+\n| ASCII(9) |\n+----------+\n|       57 |\n+----------+\n\nSELECT ASCII(\'9\');\n+------------+\n| ASCII(\'9\') |\n+------------+\n|         57 |\n+------------+\n\nSELECT ASCII(\'abc\');\n+--------------+\n| ASCII(\'abc\') |\n+--------------+\n|           97 |\n+--------------+\n\nURL: https://mariadb.com/kb/en/ascii/','','https://mariadb.com/kb/en/ascii/'),
(634,'BIN',36,'Syntax\n------\n\nBIN(N)\n\nDescription\n-----------\n\nReturns a string representation of the binary value of the given longlong\n(that is, BIGINT) number. This is equivalent to CONV(N,10,2). The argument\nshould be positive. If it is a FLOAT, it will be truncated. Returns NULL if\nthe argument is NULL.\n\nExamples\n--------\n\nSELECT BIN(12);\n+---------+\n| BIN(12) |\n+---------+\n| 1100    |\n+---------+\n\nURL: https://mariadb.com/kb/en/bin/','','https://mariadb.com/kb/en/bin/'),
(636,'BIT_LENGTH',36,'Syntax\n------\n\nBIT_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument in bits. If the argument is\nnot a string, it will be converted to string. If the argument is NULL, it\nreturns NULL.\n\nExamples\n--------\n\nSELECT BIT_LENGTH(\'text\');\n+--------------------+\n| BIT_LENGTH(\'text\') |\n+--------------------+\n|                 32 |\n+--------------------+\n\nSELECT BIT_LENGTH(\'\');\n+----------------+\n| BIT_LENGTH(\'\') |\n+----------------+\n|              0 |\n+----------------+\n\nCompatibility\n-------------\n\nPostgreSQL and Sybase support BIT_LENGTH().\n\nURL: https://mariadb.com/kb/en/bit_length/','','https://mariadb.com/kb/en/bit_length/'),
(266,'FLOAT',23,'Syntax\n------\n\nFLOAT[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small (single-precision) floating-point number (see DOUBLE for a\nregular-size floating point number). Allowable values are:\n\n* -3.402823466E+38 to -1.175494351E-38\n* 0\n* 1.175494351E-38 to 3.402823466E+38.\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A single-precision floating-point number is accurate to\napproximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all calculations\nin MariaDB are done with double precision. See Floating Point Accuracy.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nURL: https://mariadb.com/kb/en/float/','','https://mariadb.com/kb/en/float/'),
(267,'DOUBLE',23,'Syntax\n------\n\nDOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size (double-precision) floating-point number (see FLOAT for a\nsingle-precision floating-point number).\n\nAllowable values are:\n\n* -1.7976931348623157E+308 to -2.2250738585072014E-308\n* 0\n* 2.2250738585072014E-308 to 1.7976931348623157E+308\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A double-precision floating-point number is accurate to\napproximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nREAL and DOUBLE PRECISION are synonyms, unless the REAL_AS_FLOAT SQL mode is\nenabled, in which case REAL is a synonym for FLOAT rather than DOUBLE.\n\nSee Floating Point Accuracy for issues when using floating-point numbers.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DOUBLE(5,0) zerofill);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\n\nSELECT * FROM t1;\n+-------+\n| d     |\n+-------+\n| 00001 |\n| 00002 |\n| 00003 |\n| 00004 |\n+-------+\n\nURL: https://mariadb.com/kb/en/double/','','https://mariadb.com/kb/en/double/'),
(268,'BIT',23,'Syntax\n------\n\nBIT[(M)]\n\nDescription\n-----------\n\nA bit-field type. M indicates the number of bits per value, from 1 to 64. The\ndefault is 1 if M is omitted.\n\nBit values can be inserted with b\'value\' notation, where value is the bit\nvalue in 0\'s and 1\'s.\n\nBit fields are automatically zero-padded from the left to the full length of\nthe bit, so for example in a BIT(4) field, \'10\' is equivalent to \'0010\'.\n\nBits are returned as binary, so to display them, either add 0, or use a\nfunction such as HEX, OCT or BIN to convert them.\n\nExamples\n--------\n\nCREATE TABLE b ( b1 BIT(8) );\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO b VALUES (b\'11111111\');\n\nINSERT INTO b VALUES (b\'01010101\');\n\nINSERT INTO b VALUES (b\'1111111111111\');\nERROR 1406 (22001): Data too long for column \'b1\' at row 1\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1)  |\n+------+---------+---------+----------+\n|  255 | FF      | 377     | 11111111 |\n|   85 | 55      | 125     | 1010101  |\n+------+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO b VALUES (b\'11111111\'),(b\'01010101\'),(b\'1111111111111\');\nQuery OK, 3 rows affected, 1 warning (0.10 sec)\nRecords: 3  Duplicates: 0  Warnings: 1\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level   | Code | Message                                     |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'b1\' at row 3 |\n+---------+------+---------------------------------------------+\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1)  |\n+------+---------+---------+----------+\n|  255 | FF      | 377     | 11111111 |\n|   85 | 55      | 125     | 1010101  |\n|  255 | FF      | 377     | 11111111 |\n+------+---------+---------+----------+\n\nURL: https://mariadb.com/kb/en/bit/','','https://mariadb.com/kb/en/bit/'),
(269,'Floating-point Accuracy',23,'Due to their nature, not all floating-point numbers can be stored with exact\nprecision. Hardware architecture, the CPU or even the compiler version and\noptimization level may affect the precision.\n\nIf you are comparing DOUBLEs or FLOATs with numeric decimals, it is not safe\nto use the equality operator.\n\nSometimes, changing a floating-point number from single-precision (FLOAT) to\ndouble-precision (DOUBLE) will fix the problem.\n\nExample\n-------\n\nf1, f2 and f3 have seemingly identical values across each row, but due to\nfloating point accuracy, the results may be unexpected.\n\nCREATE TABLE fpn (id INT, f1 FLOAT, f2 DOUBLE, f3 DECIMAL (10,3));\nINSERT INTO fpn VALUES (1,2,2,2),(2,0.1,0.1,0.1);\n\nSELECT * FROM fpn WHERE f1*f1 = f2*f2;\n+------+------+------+-------+\n| id   | f1   | f2   | f3    |\n+------+------+------+-------+\n|    1 |    2 |    2 | 2.000 |\n+------+------+------+-------+\n\nThe reason why only one instead of two rows was returned becomes clear when we\nsee how the floating point squares were evaluated.\n\nSELECT f1*f1, f2*f2, f3*f3 FROM fpn;\n+----------------------+----------------------+----------+\n| f1*f1                | f2*f2                | f3*f3    |\n+----------------------+----------------------+----------+\n|                    4 |                    4 | 4.000000 |\n| 0.010000000298023226 | 0.010000000000000002 | 0.010000 |\n+----------------------+----------------------+----------+\n\nURL: https://mariadb.com/kb/en/floating-point-accuracy/','','https://mariadb.com/kb/en/floating-point-accuracy/'),
(652,'INSTR',36,'Syntax\n------\n\nINSTR(str,substr)\n\nDescription\n-----------\n\nReturns the position of the first occurrence of substring substr in string\nstr. This is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nINSTR() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT INSTR(\'foobarbar\', \'bar\');\n+---------------------------+\n| INSTR(\'foobarbar\', \'bar\') |\n+---------------------------+\n|                         4 |\n+---------------------------+\n\nSELECT INSTR(\'My\', \'Maria\');\n+----------------------+\n| INSTR(\'My\', \'Maria\') |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/instr/','','https://mariadb.com/kb/en/instr/'),
(653,'LCASE',36,'Syntax\n------\n\nLCASE(str)\n\nDescription\n-----------\n\nLCASE() is a synonym for LOWER().\n\nURL: https://mariadb.com/kb/en/lcase/','','https://mariadb.com/kb/en/lcase/'),
(654,'LEFT',36,'Syntax\n------\n\nLEFT(str,len)\n\nDescription\n-----------\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT LEFT(\'MariaDB\', 5);\n+--------------------+\n| LEFT(\'MariaDB\', 5) |\n+--------------------+\n| Maria              |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/left/','','https://mariadb.com/kb/en/left/'),
(270,'BINARY',23,'This page describes the BINARY data type. For details about the operator, see\nBinary Operator.\n\nSyntax\n------\n\nBINARY(M)\n\nDescription\n-----------\n\nThe BINARY type is similar to the CHAR type, but stores binary byte strings\nrather than non-binary character strings. M represents the column length in\nbytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nBINARY values are right-padded with 0x00 (the zero byte) to the specified\nlength when inserted. The padding is not removed on select, so this needs to\nbe taken into account when sorting and comparing, where all bytes are\nsignificant. The zero byte, 0x00 is less than a space for comparison purposes.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE bins (a BINARY(10));\n\nINSERT INTO bins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM bins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO bins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM bins ORDER BY a;\n+------+\n| a    |\n+------+\n| A    |\n| B    |\n| a    |\n| b    |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM bins ORDER BY CAST(a AS CHAR);\n+------+\n| a    |\n+------+\n| a    |\n| A    |\n| b    |\n| B    |\n+------+\n\nThe field is a BINARY(10), so padding of two \'\\0\'s are inserted, causing\ncomparisons that don\'t take this into account to fail:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'12345678\');\n\nSELECT a = \'12345678\', a = \'12345678\\0\\0\' from bins;\n+----------------+--------------------+\n| a = \'12345678\' | a = \'12345678\\0\\0\' |\n+----------------+--------------------+\n|              0 |                  1 |\n+----------------+--------------------+\n\nURL: https://mariadb.com/kb/en/binary/','','https://mariadb.com/kb/en/binary/'),
(271,'BLOB',23,'Syntax\n------\n\nBLOB[(M)]\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each BLOB value\nis stored using a two-byte length prefix that indicates the number of bytes in\nthe value.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest BLOB type large enough to hold values M\nbytes long.\n\nBLOBS can also be used to store dynamic columns.\n\nBLOB and TEXT columns can both be assigned a DEFAULT value.\n\nIndexing\n--------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on a column that uses\nthe BLOB data type. In previous releases this was not possible, as the index\nwould only guarantee the uniqueness of a fixed number of characters.\n\nOracle Mode\n-----------\n\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\nURL: https://mariadb.com/kb/en/blob/','','https://mariadb.com/kb/en/blob/'),
(273,'CHAR',23,'This article covers the CHAR data type. See CHAR Function for the function.\n\nSyntax\n------\n\n[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA fixed-length string that is always right-padded with spaces to the specified\nlength when stored. M represents the column length in characters. The range of\nM is 0 to 255. If M is omitted, the length is 1.\n\nCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nCHAR(0).\n\nNote: Trailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nBefore MariaDB 10.2, all collations were of type PADSPACE, meaning that CHAR\n(as well as VARCHAR and TEXT) values are compared without regard for trailing\nspaces. This does not apply to the LIKE pattern-matching operator, which takes\ninto account trailing spaces.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (c CHAR(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT c=\'Maria\',c=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| c=\'Maria\' | c=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT c LIKE \'Maria\',c LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| c LIKE \'Maria\' | c LIKE \'Maria   \' |\n+----------------+-------------------+\n|              1 |                 0 |\n+----------------+-------------------+\n\nNO PAD Collations\n-----------------\n\nNO PAD collations regard trailing spaces as normal characters. You can get a\nlist of all NO PAD collations by querying the Information Schema Collations\ntable, for example:\n\nSELECT collation_name FROM information_schema.collations \n WHERE collation_name LIKE \"%nopad%\";\n+------------------------------+\n| collation_name               |\n+------------------------------+\n| big5_chinese_nopad_ci        |\n| big5_nopad_bin               |\n...\n\nURL: https://mariadb.com/kb/en/char/','','https://mariadb.com/kb/en/char/'),
(665,'MID',36,'Syntax\n------\n\nMID(str,pos,len)\n\nDescription\n-----------\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nExamples\n--------\n\nSELECT MID(\'abcd\',4,1);\n+-----------------+\n| MID(\'abcd\',4,1) |\n+-----------------+\n| d               |\n+-----------------+\n\nSELECT MID(\'abcd\',2,2);\n+-----------------+\n| MID(\'abcd\',2,2) |\n+-----------------+\n| bc              |\n+-----------------+\n\nA negative starting position:\n\nSELECT MID(\'abcd\',-2,4);\n+------------------+\n| MID(\'abcd\',-2,4) |\n+------------------+\n| cd               |\n+------------------+\n\nURL: https://mariadb.com/kb/en/mid/','','https://mariadb.com/kb/en/mid/'),
(667,'NOT LIKE',36,'Syntax\n------\n\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: https://mariadb.com/kb/en/not-like/','','https://mariadb.com/kb/en/not-like/'),
(669,'ORD',36,'Syntax\n------\n\nORD(str)\n\nDescription\n-----------\n\nIf the leftmost character of the string str is a multi-byte character, returns\nthe code for that character, calculated from the numeric values of its\nconstituent bytes using this formula:\n\n(1st byte code)\n+ (2nd byte code x 256)\n+ (3rd byte code x 256 x 256) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns the\nsame value as the ASCII() function.\n\nExamples\n--------\n\nSELECT ORD(\'2\');\n+----------+\n| ORD(\'2\') |\n+----------+\n|       50 |\n+----------+\n\nURL: https://mariadb.com/kb/en/ord/','','https://mariadb.com/kb/en/ord/'),
(670,'POSITION',36,'Syntax\n------\n\nPOSITION(substr IN str)\n\nDescription\n-----------\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nIt\'s part of ODBC 3.0.\n\nURL: https://mariadb.com/kb/en/position/','','https://mariadb.com/kb/en/position/'),
(671,'QUOTE',36,'Syntax\n------\n\nQUOTE(str)\n\nDescription\n-----------\n\nQuotes a string to produce a result that can be used as a properly escaped\ndata value in an SQL statement. The string is returned enclosed by single\nquotes and with each instance of single quote (\"\'\"), backslash (\"\\\"), ASCII\nNUL, and Control-Z preceded by a backslash. If the argument is NULL, the\nreturn value is the word \"NULL\" without enclosing single quotes.\n\nExamples\n--------\n\nSELECT QUOTE(\"Don\'t!\");\n+-----------------+\n| QUOTE(\"Don\'t!\") |\n+-----------------+\n| \'Don\\\'t!\'       |\n+-----------------+\n\nSELECT QUOTE(NULL); \n+-------------+\n| QUOTE(NULL) |\n+-------------+\n| NULL        |\n+-------------+\n\nURL: https://mariadb.com/kb/en/quote/','','https://mariadb.com/kb/en/quote/'),
(275,'ENUM',23,'Syntax\n------\n\nENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nAn enumeration. A string object that can have only one value, chosen from the\nlist of values \'value1\', \'value2\', ..., NULL or the special \'\' error value. In\ntheory, an ENUM column can have a maximum of 65,535 distinct values; in\npractice, the real maximum depends on many factors. ENUM values are\nrepresented internally as integers.\n\nTrailing spaces are automatically stripped from ENUM values on table creation.\n\nENUMs require relatively little storage space compared to strings, either one\nor two bytes depending on the number of enumeration values.\n\nNULL and empty values\n---------------------\n\nAn ENUM can also contain NULL and empty values. If the ENUM column is declared\nto permit NULL values, NULL becomes a valid value, as well as the default\nvalue (see below). If strict SQL Mode is not enabled, and an invalid value is\ninserted into an ENUM, a special empty string, with an index value of zero\n(see Numeric index, below), is inserted, with a warning. This may be\nconfusing, because the empty string is also a possible value, and the only\ndifference if that is this case its index is not 0. Inserting will fail with\nan error if strict mode is active.\n\nIf a DEFAULT clause is missing, the default value will be:\n\n* NULL if the column is nullable;\n* otherwise, the first value in the enumeration.\n\nNumeric index\n-------------\n\nENUM values are indexed numerically in the order they are defined, and sorting\nwill be performed in this numeric order. We suggest not using ENUM to store\nnumerals, as there is little to no storage space benefit, and it is easy to\nconfuse the enum integer with the enum numeral value by leaving out the quotes.\n\nAn ENUM defined as ENUM(\'apple\',\'orange\',\'pear\') would have the following\nindex values:\n\n+--------------------------------------+--------------------------------------+\n| Index                                | Value                                |\n+--------------------------------------+--------------------------------------+\n| NULL                                 | NULL                                 |\n+--------------------------------------+--------------------------------------+\n| 0                                    | \'\'                                   |\n+--------------------------------------+--------------------------------------+\n| 1                                    | \'apple\'                              |\n+--------------------------------------+--------------------------------------+\n| 2                                    | \'orange\'                             |\n+--------------------------------------+--------------------------------------+\n| 3                                    | \'pear\'                               |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nCREATE TABLE fruits (\n id INT NOT NULL auto_increment PRIMARY KEY,\n fruit ENUM(\'apple\',\'orange\',\'pear\'),\n bushels INT);\n\nDESCRIBE fruits;\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| Field   | Type                          | Null | Key | Default | Extra      \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| id      | int(11)                       | NO   | PRI | NULL    |\nauto_increment |\n| fruit   | enum(\'apple\',\'orange\',\'pear\') | YES  |     | NULL    |            \n |\n| bushels | int(11)                       | YES  |     | NULL    |            \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n\nINSERT INTO fruits\n  (fruit,bushels) VALUES\n  (\'pear\',20),\n  (\'apple\',100),\n  (\'orange\',25);\n\nINSERT INTO fruits\n  (fruit,bushels) VALUES\n  (\'avocado\',10);\nERROR 1265 (01000): Data truncated for column \'fruit\' at row 1\n\nSELECT * FROM fruits;\n+----+--------+---------+\n| id | fruit  | bushels |\n+----+--------+---------+\n|  1 | pear   |      20 |\n|  2 | apple  |     100 |\n|  3 | orange |      25 |\n+----+--------+---------+\n\nSelecting by numeric index:\n\nSELECT * FROM fruits WHERE fruit=2;\n+----+--------+---------+\n| id | fruit  | bushels |\n+----+--------+---------+\n|  3 | orange |      25 |\n+----+--------+---------+\n\nSorting is according to the index value:\n\nCREATE TABLE enums (a ENUM(\'2\',\'1\'));\n\nINSERT INTO enums VALUES (\'1\'),(\'2\');\n\nSELECT * FROM enums ORDER BY a ASC;\n+------+\n| a    |\n+------+\n| 2    |\n| 1    |\n+------+\n\nIt\'s easy to get confused between returning the enum integer with the stored\nvalue, so we don\'t suggest using ENUM to store numerals. The first example\nreturns the 1st indexed field (\'2\' has an index value of 1, as it\'s defined\nfirst), while the second example returns the string value \'1\'.\n\nSELECT * FROM enums WHERE a=1;\n+------+\n| a    |\n+------+\n| 2    |\n+------+\n\nSELECT * FROM enums WHERE a=\'1\';\n+------+\n| a    |\n+------+\n| 1    |\n+------+\n\nURL: https://mariadb.com/kb/en/enum/','','https://mariadb.com/kb/en/enum/'),
(672,'REPEAT Function',36,'Syntax\n------\n\nREPEAT(str,count)\n\nDescription\n-----------\n\nReturns a string consisting of the string str repeated count times. If count\nis less than 1, returns an empty string. Returns NULL if str or count are NULL.\n\nExamples\n--------\n\nSELECT QUOTE(REPEAT(\'MariaDB \',4));\n+------------------------------------+\n| QUOTE(REPEAT(\'MariaDB \',4))        |\n+------------------------------------+\n| \'MariaDB MariaDB MariaDB MariaDB \' |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/repeat-function/','','https://mariadb.com/kb/en/repeat-function/'),
(673,'REPLACE Function',36,'Syntax\n------\n\nREPLACE(str,from_str,to_str)\n\nDescription\n-----------\n\nReturns the string str with all occurrences of the string from_str replaced by\nthe string to_str. REPLACE() performs a case-sensitive match when searching\nfor from_str.\n\nExamples\n--------\n\nSELECT REPLACE(\'www.mariadb.org\', \'w\', \'Ww\');\n+---------------------------------------+\n| REPLACE(\'www.mariadb.org\', \'w\', \'Ww\') |\n+---------------------------------------+\n| WwWwWw.mariadb.org                    |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/replace-function/','','https://mariadb.com/kb/en/replace-function/'),
(674,'REVERSE',36,'Syntax\n------\n\nREVERSE(str)\n\nDescription\n-----------\n\nReturns the string str with the order of the characters reversed.\n\nExamples\n--------\n\nSELECT REVERSE(\'desserts\');\n+---------------------+\n| REVERSE(\'desserts\') |\n+---------------------+\n| stressed            |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/reverse/','','https://mariadb.com/kb/en/reverse/'),
(675,'RIGHT',36,'Syntax\n------\n\nRIGHT(str,len)\n\nDescription\n-----------\n\nReturns the rightmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT RIGHT(\'MariaDB\', 2);\n+---------------------+\n| RIGHT(\'MariaDB\', 2) |\n+---------------------+\n| DB                  |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/right/','','https://mariadb.com/kb/en/right/'),
(680,'SOUNDS LIKE',36,'Syntax\n------\n\nexpr1 SOUNDS LIKE expr2\n\nDescription\n-----------\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nExample\n-------\n\nSELECT givenname, surname FROM users WHERE givenname SOUNDS LIKE \"robert\";\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto   | Castro  |\n+-----------+---------+\n\nURL: https://mariadb.com/kb/en/sounds-like/','','https://mariadb.com/kb/en/sounds-like/'),
(276,'INET4',23,'MariaDB starting with 10.10.0\n-----------------------------\nThe INET4 data type was added in MariaDB 10.10.0\n\nSyntax\n------\n\nINET4\n\nDescription\n-----------\n\nINET4 is a data type to store IPv4 addresses, as 4-byte binary strings.\n\nExamples\n--------\n\nCREATE OR REPLACE TABLE t1 (a INET4);\n\nINSERT INTO t1 VALUES(\'0.0.0.0\'), (\'255.10.0.0\'), (\'255.255.255.255\');\n\nINSERT INTO t1 VALUES (0xa0000001);\nINSERT INTO t1 VALUES (0xf0000000);\nINSERT INTO t1 VALUES (0xff000001);\n\nSELECT HEX(a), a FROM t1 ORDER BY a;\n+----------+-----------------+\n| HEX(a)   | a               |\n+----------+-----------------+\n| 00000000 | 0.0.0.0         |\n| A0000001 | 160.0.0.1       |\n| F0000000 | 240.0.0.0       |\n| FF000001 | 255.0.0.1       |\n| FF0A0000 | 255.10.0.0      |\n| FFFFFFFF | 255.255.255.255 |\n+----------+-----------------+\n\nURL: https://mariadb.com/kb/en/inet4/','','https://mariadb.com/kb/en/inet4/'),
(278,'JSON Data Type',23,'The JSON alias was added to make it possible to use JSON columns in statement\nbased replication from MySQL to MariaDB and to make it possible for MariaDB to\nread mysqldumps from MySQL.\n\nJSON is an alias for LONGTEXT introduced for compatibility reasons with\nMySQL\'s JSON data type. MariaDB implements this as a LONGTEXT rather, as the\nJSON data type contradicts the SQL standard, and MariaDB\'s benchmarks indicate\nthat performance is at least equivalent.\n\nIn order to ensure that a a valid json document is inserted, the JSON_VALID\nfunction can be used as a CHECK constraint. This constraint is automatically\nincluded for types using the JSON alias from MariaDB 10.4.3.\n\nExamples\n--------\n\nCREATE TABLE t (j JSON);\n\nDESC t;\n+-------+----------+------+-----+---------+-------+\n| Field | Type     | Null | Key | Default | Extra |\n+-------+----------+------+-----+---------+-------+\n| j     | longtext | YES  |     | NULL    |       |\n+-------+----------+------+-----+---------+-------+\n\nWith validation:\n\nCREATE TABLE t2 (\n j JSON\n CHECK (JSON_VALID(j))\n);\n\nINSERT INTO t2 VALUES (\'invalid\');\nERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`\n\nINSERT INTO t2 VALUES (\'{\"id\": 1, \"name\": \"Monty\"}\');\nQuery OK, 1 row affected (0.13 sec)\n\nReplicating JSON Data Between MySQL and MariaDB\n-----------------------------------------------\n\nThe JSON type in MySQL stores the JSON object in a compact form, not as\nLONGTEXT as in MariaDB. This means that row based replication will not work\nfor JSON types from MySQL to MariaDB.\n\nThere are a a few different ways to solve this:\n\n* Use statement based replication.\n* Change the JSON column to type TEXT in MySQL\n* If you must use row-based replication and cannot change the MySQL master\nfrom JSON to TEXT, you can try to introduce an intermediate MySQL slave and\nchange the column type from JSON to TEXT on it. Then you replicate from this\nintermediate slave to MariaDB.\n\nConverting a MySQL TABLE with JSON Fields to MariaDB\n----------------------------------------------------\n\nMariaDB can\'t directly access MySQL\'s JSON format.\n\nThere are a a few different ways to move the table to MariaDB:\n\n* From MariaDB 10.5.7, see the you can use the mysql_json plugin. See Making\nMariaDB understand MySQL JSON.\n* Change the JSON column to type TEXT in MySQL.  After this, MariaDB can\ndirectly use the table without any need for a dump and restore.\n* Use mysqldump to copy the table.\n\nDifferences Between MySQL JSON Strings and MariaDB JSON Strings\n---------------------------------------------------------------\n\n* In MySQL, JSON is an object and is compared according to json values. In\nMariaDB JSON strings are normal strings and compared as strings. One exception\nis when using JSON_EXTRACT() in which case strings are unescaped before\ncomparison.\n\nURL: https://mariadb.com/kb/en/json-data-type/','','https://mariadb.com/kb/en/json-data-type/'),
(282,'LONGTEXT',23,'Syntax\n------\n\nLONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns also\ndepends on the configured maximum packet size in the client/server protocol\nand available memory. Each LONGTEXT value is stored using a four-byte length\nprefix that indicates the number of bytes in the value.\n\nFrom MariaDB 10.2.7, JSON is an alias for LONGTEXT. See JSON Data Type for\ndetails.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CLOB is a synonym for LONGTEXT.\n\nURL: https://mariadb.com/kb/en/longtext/','','https://mariadb.com/kb/en/longtext/'),
(287,'VARBINARY',23,'Syntax\n------\n\nVARBINARY(M)\n\nDescription\n-----------\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary byte\nstrings rather than non-binary character strings. M represents the maximum\ncolumn length in bytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nUnlike BINARY values, VARBINARYs are not right-padded when inserting.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, RAW is a synonym for VARBINARY.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE varbins (a VARBINARY(10));\n\nINSERT INTO varbins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM varbins;\n+------------+\n| a          |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO varbins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE varbins;\n\nINSERT INTO varbins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM varbins ORDER BY a;\n+------+\n| a    |\n+------+\n| A    |\n| B    |\n| a    |\n| b    |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM varbins ORDER BY CAST(a AS CHAR);\n+------+\n| a    |\n+------+\n| a    |\n| A    |\n| b    |\n| B    |\n+------+\n\nURL: https://mariadb.com/kb/en/varbinary/','','https://mariadb.com/kb/en/varbinary/'),
(681,'SPACE',36,'Syntax\n------\n\nSPACE(N)\n\nDescription\n-----------\n\nReturns a string consisting of N space characters. If N is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT QUOTE(SPACE(6));\n+-----------------+\n| QUOTE(SPACE(6)) |\n+-----------------+\n| \'      \'        |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/space/','','https://mariadb.com/kb/en/space/'),
(683,'SUBSTR',36,'Description\n-----------\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: https://mariadb.com/kb/en/substr/','','https://mariadb.com/kb/en/substr/'),
(689,'UCASE',36,'Syntax\n------\n\nUCASE(str)\n\nDescription\n-----------\n\nUCASE() is a synonym for UPPER().\n\nURL: https://mariadb.com/kb/en/ucase/','','https://mariadb.com/kb/en/ucase/'),
(693,'UPPER',36,'Syntax\n------\n\nUPPER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to uppercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nSELECT UPPER(surname), givenname FROM users ORDER BY surname;\n+----------------+------------+\n| UPPER(surname) | givenname  |\n+----------------+------------+\n| ABEL           | Jacinto    |\n| CASTRO         | Robert     |\n| COSTA          | Phestos    |\n| MOSCHELLA      | Hippolytos |\n+----------------+------------+\n\nUPPER() is ineffective when applied to binary strings (BINARY, VARBINARY,\nBLOB). The description of LOWER() shows how to perform lettercase conversion\nof binary strings.\n\nURL: https://mariadb.com/kb/en/upper/','','https://mariadb.com/kb/en/upper/'),
(283,'ROW',23,'MariaDB starting with 10.3.0\n----------------------------\nThe ROW data type was introduced in MariaDB 10.3.0.\n\nSyntax\n------\n\nROW (<field name> <data type> [{, <field name> <data type>}... ])\n\nDescription\n-----------\n\nROW is a data type for stored procedure variables.\n\nFeatures\n--------\n\nROW fields as normal variables\n------------------------------\n\nROW fields (members) act as normal variables, and are able to appear in all\nquery parts where a stored procedure variable is allowed:\n\n* Assignment is using the := operator and the SET command:\n\na.x:= 10;\na.x:= b.x;\nSET a.x= 10, a.y=20, a.z= b.z;\n\n* Passing to functions and operators:\n\nSELECT f1(rec.a), rec.a<10;\n\n* Clauses (select list, WHERE, HAVING, LIMIT, etc...,):\n\nSELECT var.a, t1.b FROM t1 WHERE t1.b=var.b LIMIT var.c;\n\n* INSERT values:\n\nINSERT INTO t1 VALUES (rec.a, rec.b, rec.c);\n\n* SELECT .. INTO targets\n\nSELECT a,b INTO rec.a, rec.b FROM t1 WHERE t1.id=10;\n\n* Dynamic SQL out parameters (EXECUTE and EXECUTE IMMEDIATE)\n\nEXECUTE IMMEDIATE \'CALL proc_with_out_param(?)\' USING rec.a;\n\nROW type variables as FETCH targets\n-----------------------------------\n\nROW type variables are allowed as FETCH targets:\n\nFETCH cur INTO rec;\n\nwhere cur is a CURSOR and rec is a ROW type stored procedure variable.\n\nNote, currently an attempt to use FETCH for a ROW type variable returns this\nerror:\n\nERROR 1328 (HY000): Incorrect number of FETCH variables\n\nFETCH from a cursor cur into a ROW variable rec works as follows:\n\n* The number of fields in cur must match the number of fields in rec.\n Otherwise, an error is reported.\n\n* Assignment is done from left to right. The first cursor field is assigned to\n the first variable field, the second cursor field is assigned to the second\n variable field, etc.\n\n* Field names in rec are not important and can differ from field names\n in cur.\n\nSee FETCH Examples (below) for examples of using this with sql_mode=ORACLE and\nsql_mode=DEFAULT.\n\nROW type variables as SELECT...INTO targets\n-------------------------------------------\n\nROW type variables are allowed as SELECT..INTO targets with some differences\ndepending on which sql_mode is in use.\n\n* When using sql_mode=ORACLE, table%ROWTYPE and cursor%ROWTYPE\n variables can be used as SELECT...INTO targets.\n\n* Using multiple ROW variables in the SELECT..INTO list will report an\n error.\n\n* Using ROW variables with a different column count than in\n the SELECT..INTO list will report an error.\n\nSee SELECT...INTO Examples (below) for examples of using this with\nsql_mode=ORACLE and sql_mode=DEFAULT.\n\nFeatures not implemented\n------------------------\n\nThe following features are planned, but not implemented yet:\n\n* Returning a ROW type expression from a stored function (see MDEV-12252).\nThis will need some grammar change to support field names after parentheses:\n\nSELECT f1().x FROM DUAL;\n\n* Returning a ROW type expression from a built-in hybrid type function, such\nas CASE, IF, etc. \n* ROW of ROWs\n\nExamples\n--------\n\nDeclaring a ROW in a stored procedure\n-------------------------------------\n\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE r ROW (c1 INT, c2 VARCHAR(10));\n SET r.c1= 10;\n SET r.c2= \'test\';\n INSERT INTO t1 VALUES (r.c1, r.c2);\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nFETCH Examples\n--------------\n\nA complete FETCH example for sql_mode=ORACLE:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=oracle;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec ROW(a INT, b VARCHAR(32));\n CURSOR c IS SELECT a,b FROM t1;\nBEGIN\n OPEN c;\n LOOP\n  FETCH c INTO rec;\n  EXIT WHEN c%NOTFOUND;\n  SELECT (\'rec=(\' || rec.a ||\',\'|| rec.b||\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nA complete FETCH example for sql_mode=DEFAULT:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=DEFAULT;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE rec ROW(a INT, b VARCHAR(32));\n DECLARE c CURSOR FOR SELECT a,b FROM t1;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n OPEN c;\nread_loop:\n LOOP\n  FETCH c INTO rec;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  SELECT CONCAT(\'rec=(\',rec.a,\',\',rec.b,\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nSELECT...INTO Examples\n----------------------\n\nA SELECT...INTO example for sql_mode=DEFAULT:\n\nSET sql_mode=DEFAULT;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE rec1 ROW(a INT, b VARCHAR(32));\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nA SELECT...INTO example for sql_mode=ORACLE:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 ROW(a INT, b VARCHAR(32));\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using table%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 t1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using cursor%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n CURSOR cur1 IS SELECT * FROM t1;\n rec1 cur1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n|     10 | b10    |\n+--------+--------+\n\nURL: https://mariadb.com/kb/en/row/','','https://mariadb.com/kb/en/row/'),
(696,'_rowid',37,'Syntax\n------\n\n_rowid\n\nDescription\n-----------\n\nThe _rowid pseudo column is mapped to the primary key in the related table.\nThis can be used as a replacement of the rowid pseudo column in other\ndatabases. Another usage is to simplify sql queries as one doesn\'t have to\nknow the name of the primary key.\n\nExamples\n--------\n\ncreate table t1 (a int primary key, b varchar(80));\ninsert into t1 values (1,\"one\"),(2,\"two\");\nselect * from t1 where _rowid=1;\n\n+---+------+\n| a | b    |\n+---+------+\n| 1 | one  |\n+---+------+\n\nupdate t1 set b=\"three\" where _rowid=2;\nselect * from t1 where _rowid>=1 and _rowid<=10;\n\n+---+-------+\n| a | b     |\n+---+-------+\n| 1 | one   |\n| 2 | three |\n+---+-------+\n\nURL: https://mariadb.com/kb/en/_rowid/','','https://mariadb.com/kb/en/_rowid/'),
(284,'TEXT',23,'Syntax\n------\n\nTEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach TEXT value is stored using a two-byte length prefix that indicates the\nnumber of bytes in the value. If you need a bigger storage, consider using\nMEDIUMTEXT instead.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest TEXT type large enough to hold values M\ncharacters long.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat TEXT (as well as VARCHAR and CHAR values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces.\n\nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT\nvalue. This restriction was lifted in MariaDB 10.2.1.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (d TEXT(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT d=\'Maria\',d=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| d=\'Maria\' | d=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT d LIKE \'Maria\',d LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| d LIKE \'Maria\' | d LIKE \'Maria   \' |\n+----------------+-------------------+\n|              0 |                 1 |\n+----------------+-------------------+\n\nIndexing\n--------\n\nTEXT columns can only be indexed over a specified length. This means that they\ncannot be used as the primary key of a table norm until MariaDB 10.4, can a\nunique index be created on them.\n\nMariaDB starting with 10.4\n--------------------------\nStarting with MariaDB 10.4, a unique index can be created on a TEXT column.\n\nInternally, this uses hash indexing to quickly check the values and if a hash\ncollision is found, the actual stored values are compared in order to retain\nthe uniqueness.\n\nDifference between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength.  The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\nURL: https://mariadb.com/kb/en/text/','','https://mariadb.com/kb/en/text/'),
(291,'DATE',23,'Syntax\n------\n\nDATE\n\nDescription\n-----------\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MariaDB displays\nDATE values in \'YYYY-MM-DD\' format, but can be assigned dates in looser\nformats, including strings or numbers, as long as they make sense. These\ninclude a short year, YY-MM-DD, no delimiters, YYMMDD, or any other acceptable\ndelimiter, for example YYYY/MM/DD. For details, see date and time literals.\n\n\'0000-00-00\' is a permitted special value (zero-date), unless the NO_ZERO_DATE\nSQL_MODE is used. Also, individual components of a date can be set to 0 (for\nexample: \'2015-00-12\'), unless the NO_ZERO_IN_DATE SQL_MODE is used. In many\ncases, the result of en expression involving a zero-date, or a date with\nzero-parts, is NULL. If the ALLOW_INVALID_DATES SQL_MODE is enabled, if the\nday part is in the range between 1 and 31, the date does not produce any\nerror, even for months that have less than 31 days.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATE);\n\nINSERT INTO t1 VALUES (\"2010-01-12\"), (\"2011-2-28\"), (\'120314\'),(\'13*04*21\');\n\nSELECT * FROM t1;\n+------------+\n| d          |\n+------------+\n| 2010-01-12 |\n| 2011-02-28 |\n| 2012-03-14 |\n| 2013-04-21 |\n+------------+\n\nURL: https://mariadb.com/kb/en/date/','','https://mariadb.com/kb/en/date/'),
(697,'ALTER TABLE',38,'Syntax\n------\n\nALTER [ONLINE] [IGNORE] TABLE [IF EXISTS] tbl_name\n  [WAIT n | NOWAIT]\n  alter_specification [, alter_specification] ...\nalter_specification:\n  table_option ...\n | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition\n    [FIRST | AFTER col_name ]\n | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition,...)\n | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n    UNIQUE [INDEX|KEY] [index_name]\n    [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n    (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n    (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n    FOREIGN KEY [IF NOT EXISTS] [index_name] (index_col_name,...)\n    reference_definition\n | ADD PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\n | ALTER [COLUMN] col_name SET DEFAULT literal | (expression)\n | ALTER [COLUMN] col_name DROP DEFAULT\n | ALTER {INDEX|KEY} index_name [NOT] INVISIBLE\n | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name column_definition\n    [FIRST|AFTER col_name]\n | MODIFY [COLUMN] [IF EXISTS] col_name column_definition\n    [FIRST | AFTER col_name]\n | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} [IF EXISTS] index_name\n | DROP FOREIGN KEY [IF EXISTS] fk_symbol\n | DROP CONSTRAINT [IF EXISTS] constraint_name\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | RENAME COLUMN old_col_name TO new_col_name\n | RENAME {INDEX|KEY} old_index_name TO new_index_name\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | FORCE\n | partition_options\n | CONVERT TABLE normal_table TO partition_definition\n | CONVERT PARTITION partition_name TO TABLE tbl_name\n | ADD PARTITION [IF NOT EXISTS] (partition_definition)\n | DROP PARTITION [IF EXISTS] partition_names\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n | ANALYZE PARTITION partition_names\n | CHECK PARTITION partition_names\n | OPTIMIZE PARTITION partition_names\n | REBUILD PARTITION partition_names\n | REPAIR PARTITION partition_names\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | REMOVE PARTITIONING\n | ADD SYSTEM VERSIONING\n | DROP SYSTEM VERSIONING\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\nindex_type:\n  USING {BTREE | HASH | RTREE}\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\ntable_options:\n  table_option [[,] table_option] ...\n\nDescription\n-----------\n\nALTER TABLE enables you to change the structure of an existing table. For\nexample, you can add or delete columns, create or destroy indexes, change the\ntype of existing columns, or rename columns or the table itself. You can also\nchange the comment for the table and the storage engine of the table.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nWhen adding a UNIQUE index on a column (or a set of columns) which have\nduplicated values, an error will be produced and the statement will be\nstopped. To suppress the error and force the creation of UNIQUE indexes,\ndiscarding duplicates, the IGNORE option can be specified. This can be useful\nif a column (or a set of columns) should be UNIQUE but it contains duplicate\nvalues; however, this technique provides no control on which rows are\npreserved and which are deleted. Also, note that IGNORE is accepted but\nignored in ALTER TABLE ... EXCHANGE PARTITION statements.\n\nThis statement can also be used to rename a table. For details see RENAME\nTABLE.\n\nWhen an index is created, the storage engine may use a configurable buffer in\nthe process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for REPAIR TABLE. InnoDB allocates three\nbuffers whose size is defined by innodb_sort_buffer_size.\n\nPrivileges\n----------\n\nExecuting the ALTER TABLE statement generally requires at least the ALTER\nprivilege for the table or the database..\n\nIf you are renaming a table, then it also requires the DROP, CREATE and INSERT\nprivileges for the table or the database as well.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nALTER ONLINE TABLE\n------------------\n\nALTER ONLINE TABLE also works for partitioned tables.\n\nOnline ALTER TABLE is available by executing the following:\n\nALTER ONLINE TABLE ...;\n\nThis statement has the following semantics:\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... LOCK=NONE;\n\nSee the LOCK alter specification for more information.\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... ALGORITHM=INPLACE;\n\nSee the ALGORITHM alter specification for more information.\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nIF EXISTS\n---------\n\nThe IF EXISTS and IF NOT EXISTS clauses are available for the following:\n\nADD COLUMN       [IF NOT EXISTS]\nADD INDEX        [IF NOT EXISTS]\nADD FOREIGN KEY  [IF NOT EXISTS]\nADD PARTITION    [IF NOT EXISTS]\nCREATE INDEX     [IF NOT EXISTS]\nDROP COLUMN      [IF EXISTS]\nDROP INDEX       [IF EXISTS]\nDROP FOREIGN KEY [IF EXISTS]\nDROP PARTITION   [IF EXISTS]\nCHANGE COLUMN    [IF EXISTS]\nMODIFY COLUMN    [IF EXISTS]\nDROP INDEX       [IF EXISTS]\nWhen IF EXISTS and IF NOT EXISTS are used in clauses, queries will not report\nerrors when the condition is triggered for that clause. A warning with the\nsame message text will be issued and the ALTER will move on to the next clause\nin the statement (or end if finished).\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this is directive is used after ALTER ... TABLE, one will not get an error\nif the table doesn\'t exist.\n\nColumn Definitions\n------------------\n\nSee CREATE TABLE: Column Definitions for information about column definitions.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nThe CREATE INDEX and DROP INDEX statements can also be used to add or remove\nan index.\n\nCharacter Sets and Collations\n-----------------------------\n\nCONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n[DEFAULT] CHARACTER SET [=] charset_name\n[DEFAULT] COLLATE [=] collation_name\nSee Setting Character Sets and Collations for details on setting the character\nsets and collations.\n\nAlter Specifications\n--------------------\n\nTable Options\n-------------\n\nSee CREATE TABLE: Table Options for information about table options.\n\nADD COLUMN\n----------\n\n... ADD COLUMN [IF NOT EXISTS]  (col_name column_definition,...)\nAdds a column to the table. The syntax is the same as in CREATE TABLE. If you\nare using IF NOT_EXISTS the column will not be added if it was not there\nalready. This is very useful when doing scripts to modify tables.\n\nThe FIRST and AFTER clauses affect the physical order of columns in the\ndatafile. Use FIRST to add a column in the first (leftmost) position, or AFTER\nfollowed by a column name to add the new column in any other position. Note\nthat, nowadays, the physical position of a column is usually irrelevant.\n\nSee also Instant ADD COLUMN for InnoDB.\n\nDROP COLUMN\n-----------\n\n... DROP COLUMN [IF EXISTS] col_name [CASCADE|RESTRICT]\nDrops the column from the table. If you are using IF EXISTS you will not get\nan error if the column didn\'t exist. If the column is part of any index, the\ncolumn will be dropped from them, except if you add a new column with\nidentical name at the same time. The index will be dropped if all columns from\nthe index were dropped. If the column was used in a view or trigger, you will\nget an error next time the view or trigger is accessed. Dropping a column that\nis part of a multi-column UNIQUE constraint is not permitted. For example:\n\nCREATE TABLE a (\n a int,\n b int,\n primary key (a,b)\n);\n\nALTER TABLE x DROP COLUMN a;\n[42000][1072] Key column \'A\' doesn\'t exist in table\n\nThe reason is that dropping column a would result in the new constraint that\nall values in column b be unique. In order to drop the column, an explicit\nDROP PRIMARY KEY and ADD PRIMARY KEY would be required. Up until MariaDB\n10.2.7, the column was dropped and the additional constraint applied,\nresulting in the following structure:\n\nALTER TABLE x DROP COLUMN a;\nQuery OK, 0 rows affected (0.46 sec)\n\nDESC x;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| b     | int(11) | NO   | PRI | NULL    |       |\n+-------+---------+------+-----+---------+-------+\n\nMariaDB starting with 10.4.0\n----------------------------\nMariaDB 10.4.0 supports instant DROP COLUMN. DROP COLUMN of an indexed column\nwould imply DROP INDEX (and in the case of a non-UNIQUE multi-column index,\npossibly ADD INDEX). These will not be allowed with ALGORITHM=INSTANT, but\nunlike before, they can be allowed with ALGORITHM=NOCOPY\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nMODIFY COLUMN\n-------------\n\nAllows you to modify the type of a column. The column will be at the same\nplace as the original column and all indexes on the column will be kept. Note\nthat when modifying column, you should specify all attributes for the new\ncolumn.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY((a));\nALTER TABLE t1 MODIFY a BIGINT UNSIGNED AUTO_INCREMENT;\n\nCHANGE COLUMN\n-------------\n\nWorks like MODIFY COLUMN except that you can also change the name of the\ncolumn. The column will be at the same place as the original column and all\nindex on the column will be kept.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a));\nALTER TABLE t1 CHANGE a b BIGINT UNSIGNED AUTO_INCREMENT;\n\nALTER COLUMN\n------------\n\nThis lets you change column options.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, b varchar(50), PRIMARY KEY(a));\nALTER TABLE t1 ALTER b SET DEFAULT \'hello\';\n\nRENAME INDEX/KEY\n----------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename an index using the RENAME INDEX\n(or RENAME KEY) syntax, for example:\n\nALTER TABLE t1 RENAME INDEX i_old TO i_new;\n\nRENAME COLUMN\n-------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename a column using the RENAME COLUMN\nsyntax, for example:\n\nALTER TABLE t1 RENAME COLUMN c_old TO c_new;\n\nADD PRIMARY KEY\n---------------\n\nAdd a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nDROP PRIMARY KEY\n----------------\n\nDrop a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nADD FOREIGN KEY\n---------------\n\nAdd a foreign key.\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed.  The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL.  (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is implemented only for the legacy PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nDROP FOREIGN KEY\n----------------\n\nDrop a foreign key.\n\nSee Foreign Keys for more information.\n\nADD INDEX\n---------\n\nAdd a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nDROP INDEX\n----------\n\nDrop a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nADD UNIQUE INDEX\n----------------\n\nAdd a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nDROP UNIQUE INDEX\n-----------------\n\nDrop a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nADD FULLTEXT INDEX\n------------------\n\nAdd a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nDROP FULLTEXT INDEX\n-------------------\n\nDrop a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nADD SPATIAL INDEX\n-----------------\n\nAdd a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nDROP SPATIAL INDEX\n------------------\n\nDrop a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nENABLE/ DISABLE KEYS\n--------------------\n\nDISABLE KEYS will disable all non unique keys for the table for storage\nengines that support this (at least MyISAM and Aria). This can be used to\nspeed up inserts into empty tables.\n\nENABLE KEYS will enable all disabled keys.\n\nRENAME TO\n---------\n\nRenames the table. See also RENAME TABLE.\n\nADD CONSTRAINT\n--------------\n\nModifies the table adding a constraint on a particular column or columns.\n\nALTER TABLE table_name \nADD CONSTRAINT [constraint_name] CHECK(expression);\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDF\'s.\n\nCREATE TABLE account_ledger (\n	id INT PRIMARY KEY AUTO_INCREMENT,\n	transaction_name VARCHAR(100),\n	credit_account VARCHAR(100),\n	credit_amount INT,\n	debit_account VARCHAR(100),\n	debit_amount INT);\n\nALTER TABLE account_ledger \nADD CONSTRAINT is_balanced \n  CHECK((debit_amount + credit_amount) = 0);\n\nThe constraint_name is optional. If you don\'t provide one in the ALTER TABLE\nstatement, MariaDB auto-generates a name for you. This is done so that you can\nremove it later using DROP CONSTRAINT clause.\n\nYou can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. You may find this useful when loading a table\nthat violates some constraints that you want to later find and fix in SQL.\n\nTo view constraints on a table, query information_schema.TABLE_CONSTRAINTS:\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'account_ledger\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME     | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| is_balanced     | account_ledger | CHECK           |\n+-----------------+----------------+-----------------+\n\nDROP CONSTRAINT\n---------------\n\nDROP CONSTRAINT for UNIQUE and FOREIGN KEY constraints was introduced in\nMariaDB 10.2.22 and MariaDB 10.3.13.\n\nDROP CONSTRAINT for CHECK constraints was introduced in MariaDB 10.2.1\n\nModifies the table, removing the given constraint.\n\nALTER TABLE table_name\nDROP CONSTRAINT constraint_name;\n\nWhen you add a constraint to a table, whether through a CREATE TABLE or ALTER\nTABLE...ADD CONSTRAINT statement, you can either set a constraint_name\nyourself, or allow MariaDB to auto-generate one for you. To view constraints\non a table, query information_schema.TABLE_CONSTRAINTS. For instance,\n\nCREATE TABLE t (\n a INT,\n b INT,\n c INT,\n CONSTRAINT CHECK(a > b),\n CONSTRAINT check_equals CHECK(a = c));\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'t\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME     | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| check_equals    | t              | CHECK           |\n| CONSTRAINT_1    | t              | CHECK           |\n+-----------------+----------------+-----------------+\n\nTo remove a constraint from the table, issue an ALTER TABLE...DROP CONSTRAINT\nstatement. For example,\n\nALTER TABLE t DROP CONSTRAINT is_unique;\n\nADD SYSTEM VERSIONING\n---------------------\n\nAdd system versioning. See System-versioned tables.\n\nDROP SYSTEM VERSIONING\n----------------------\n\nDrop system versioning. See System-versioned tables.\n\nADD PERIOD FOR SYSTEM_TIME\n--------------------------\n\nSee System-versioned tables.\n\nFORCE\n-----\n\nALTER TABLE ... FORCE can force MariaDB to re-build the table.\n\nIn MariaDB 5.5 and before, this could only be done by setting the ENGINE table\noption to its old value. For example, for an InnoDB table, one could execute\nthe following:\n\nALTER TABLE tab_name ENGINE = InnoDB;\n\nThe FORCE option can be used instead. For example, :\n\nALTER TABLE tab_name FORCE;\n\nWith InnoDB, the table rebuild will only reclaim unused space (i.e. the space\npreviously used for deleted rows) if the innodb_file_per_table system variable\nis set to ON (the default). If the system variable is OFF, then the space will\nnot be reclaimed, but it will be-re-used for new data that\'s later added.\n\nCONVERT TABLE / CONVERT PARTITION\n---------------------------------\n\nCONVERT TABLE and CONVERT PARTITION was introduced in MariaDB 10.7.1.\n\nCONVERT PARTITION can be used to remove a partition from a table and make this\nan ordinary table. For example:\n\nALTER TABLE partitioned_table CONVERT PARTITION part1 TO TABLE normal_table;\n\nCONVERT PARTITION will take an existing table and move this to another table\nas its own partition with a specified partition definition. For example the\nfollowing moves normal_table to a partition of partitioned_table with a\ndefinition that its values, based on the PARTITION BY of the\npartitioned_table, are less than 12345.\n\nALTER TABLE partitioned_table CONVERT TABLE normal_table TO PARTITION part1\nVALUES LESS THAN (12345);\n\nEXCHANGE PARTITION\n------------------\n\nThis is used to exchange the contents of a partition with another table.\n\nThis is performed by swapping the tablespaces of the partition with the other\ntable.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nDISCARD TABLESPACE\n------------------\n\nThis is used to discard an InnoDB table\'s tablespace.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nIMPORT TABLESPACE\n-----------------\n\nThis is used to import an InnoDB table\'s tablespace. The tablespace should\nhave been copied from its original server after executing FLUSH TABLES FOR\nEXPORT.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nALTER TABLE ... IMPORT only applies to InnoDB tables. Most other popular\nstorage engines, such as Aria and MyISAM, will recognize their data files as\nsoon as they\'ve been placed in the proper directory under the datadir, and no\nspecial DDL is required to import them.\n\nALGORITHM\n---------\n\nThe ALTER TABLE statement supports the ALGORITHM clause. This clause is one of\nthe clauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent algorithms. An algorithm can be explicitly chosen for an ALTER TABLE\noperation by setting the ALGORITHM clause. The supported values are:\n\n* ALGORITHM=DEFAULT - This implies the default behavior for the specific\nstatement, such as if no ALGORITHM clause is specified.\n* ALGORITHM=COPY\n* ALGORITHM=INPLACE\n* ALGORITHM=NOCOPY - This was added in MariaDB 10.3.7.\n* ALGORITHM=INSTANT - This was added in MariaDB 10.3.7.\n\nSee InnoDB Online DDL Overview: ALGORITHM for information on how the ALGORITHM\nclause affects InnoDB.\n\nALGORITHM=DEFAULT\n-----------------\n\nThe default behavior, which occurs if ALGORITHM=DEFAULT is specified, or if\nALGORITHM is not specified at all, usually only makes a copy if the operation\ndoesn\'t support being done in-place at all. In this case, the most efficient\navailable algorithm will usually be used.\n\nHowever, in MariaDB 10.3.6 and before, if the value of the old_alter_table\nsystem variable is set to ON, then the default behavior is to perform ALTER\nTABLE operations by making a copy of the table using the old algorithm.\n\nIn MariaDB 10.3.7 and later, the old_alter_table system variable is\ndeprecated. Instead, the alter_algorithm system variable defines the default\nalgorithm for ALTER TABLE operations.\n\nALGORITHM=COPY\n--------------\n\nALGORITHM=COPY is the name for the original ALTER TABLE algorithm from early\nMariaDB versions.\n\nWhen ALGORITHM=COPY is set, MariaDB essentially does the following operations:\n\n-- Create a temporary table with the new definition\nCREATE TEMPORARY TABLE tmp_tab (\n...\n);\n\n-- Copy the data from the original table\nINSERT INTO tmp_tab\n SELECT * FROM original_tab;\n\n-- Drop the original table\nDROP TABLE original_tab;\n\n-- Rename the temporary table, so that it replaces the original one\nRENAME TABLE tmp_tab TO original_tab;\n\nThis algorithm is very inefficient, but it is generic, so it works for all\nstorage engines.\n\nIf ALGORITHM=COPY is specified, then the copy algorithm will be used even if\nit is not necessary. This can result in a lengthy table copy. If multiple\nALTER TABLE operations are required that each require the table to be rebuilt,\nthen it is best to specify all operations in a single ALTER TABLE statement,\nso that the table is only rebuilt once.\n\nALGORITHM=INPLACE\n-----------------\n\nALGORITHM=COPY can be incredibly slow, because the whole table has to be\ncopied and rebuilt. ALGORITHM=INPLACE was introduced as a way to avoid this by\nperforming operations in-place and avoiding the table copy and rebuild, when\npossible.\n\nWhen ALGORITHM=INPLACE is set, the underlying storage engine uses\noptimizations to perform the operation while avoiding the table copy and\nrebuild. However, INPLACE is a bit of a misnomer, since some operations may\nstill require the table to be rebuilt for some storage engines. Regardless,\nseveral operations can be performed without a full copy of the table for some\nstorage engines.\n\nA more accurate name would have been ALGORITHM=ENGINE, where ENGINE refers to\nan \"engine-specific\" algorithm.\n\nIf an ALTER TABLE operation supports ALGORITHM=INPLACE, then it can be\nperformed using optimizations by the underlying storage engine, but it may\nrebuilt.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INPLACE for more.\n\nALGORITHM=NOCOPY\n----------------\n\nALGORITHM=NOCOPY was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto rebuild the clustered index, because when the clustered index has to be\nrebuilt, the whole table has to be rebuilt. ALGORITHM=NOCOPY was introduced as\na way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=NOCOPY, then it can be\nperformed without rebuilding the clustered index.\n\nIf ALGORITHM=NOCOPY is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=NOCOPY, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to rebuild the\nclustered index, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=NOCOPY for more.\n\nALGORITHM=INSTANT\n-----------------\n\nALGORITHM=INSTANT was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto modify data files. ALGORITHM=INSTANT was introduced as a way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=INSTANT, then it can be\nperformed without modifying any data files.\n\nIf ALGORITHM=INSTANT is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=INSTANT, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to modify data\nfiles, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INSTANT for more.\n\nLOCK\n----\n\nThe ALTER TABLE statement supports the LOCK clause. This clause is one of the\nclauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent locking strategies. A locking strategy can be explicitly chosen for\nan ALTER TABLE operation by setting the LOCK clause. The supported values are:\n\n* DEFAULT: Acquire the least restrictive lock on the table that is supported\nfor the specific operation. Permit the maximum amount of concurrency that is\nsupported for the specific operation.\n* NONE: Acquire no lock on the table. Permit all concurrent DML. If this\nlocking strategy is not permitted for an operation, then an error is raised.\n* SHARED: Acquire a read lock on the table. Permit read-only concurrent DML.\nIf this locking strategy is not permitted for an operation, then an error is\nraised.\n* EXCLUSIVE: Acquire a write lock on the table. Do not permit concurrent DML.\n\nDifferent storage engines support different locking strategies for different\noperations. If a specific locking strategy is chosen for an ALTER TABLE\noperation, and that table\'s storage engine does not support that locking\nstrategy for that specific operation, then an error will be raised.\n\nIf the LOCK clause is not explicitly set, then the operation uses LOCK=DEFAULT.\n\nALTER ONLINE TABLE is equivalent to LOCK=NONE. Therefore, the ALTER ONLINE\nTABLE statement can be used to ensure that your ALTER TABLE operation allows\nall concurrent DML.\n\nSee InnoDB Online DDL Overview: LOCK for information on how the LOCK clause\naffects InnoDB.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for ALTER TABLE statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mariadb client, then the progress report might look like this::\n\nALTER TABLE test ENGINE=Aria;\nStage: 1 of 2 \'copy to tmp table\'    46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nAborting ALTER TABLE Operations\n-------------------------------\n\nIf an ALTER TABLE operation is being performed and the connection is killed,\nthe changes will be rolled back in a controlled manner. The rollback can be a\nslow operation as the time it takes is relative to how far the operation has\nprogressed.\n\nAborting ALTER TABLE ... ALGORITHM=COPY was made faster in MariaDB 10.2.13 by\nremoving excessive undo logging (MDEV-11415). This significantly shortened the\ntime it takes to abort a running ALTER TABLE operation, compared with earlier\nreleases.\n\nAtomic ALTER TABLE\n------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, ALTER TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-25180). This means that if there is a crash\n(server down or power outage) during an ALTER TABLE operation, after recovery,\neither the old table and associated triggers and status will be intact, or the\nnew table will be active.\n\nIn older MariaDB versions one could get leftover #sql-alter..\',\n\'#sql-backup..\' or \'table_name.frm˝\' files if the system crashed during the\nALTER TABLE operation.\n\nSee Atomic DDL for more information.\n\nReplication\n-----------\n\nMariaDB starting with 10.8.1\n----------------------------\nBefore MariaDB 10.8.1, ALTER TABLE got fully executed on the primary first,\nand only then was it replicated and started executing on replicas. From\nMariaDB 10.8.1, ALTER TABLE gains an option to replicate sooner and begin\nexecuting on replicas when it merely starts executing on the primary, not when\nit finishes. This way the replication lag caused by a heavy ALTER TABLE can be\ncompletely eliminated (MDEV-11675).\n\nExamples\n--------\n\nAdding a new column:\n\nALTER TABLE t1 ADD x INT;\n\nDropping a column:\n\nALTER TABLE t1 DROP x;\n\nModifying the type of a column:\n\nALTER TABLE t1 MODIFY x bigint unsigned;\n\nChanging the name and type of a column:\n\nALTER TABLE t1 CHANGE a b bigint unsigned auto_increment;\n\nCombining multiple clauses in a single ALTER TABLE statement, separated by\ncommas:\n\nALTER TABLE t1 DROP x, ADD x2 INT,  CHANGE y y2 INT;\n\nChanging the storage engine and adding a comment:\n\nALTER TABLE t1 \n ENGINE = InnoDB\n COMMENT = \'First of three tables containing usage info\';\n\nRebuilding the table (the previous example will also rebuild the table if it\nwas already InnoDB):\n\nALTER TABLE t1 FORCE;\n\nDropping an index:\n\nALTER TABLE rooms DROP INDEX u;\n\nAdding a unique index:\n\nALTER TABLE rooms ADD UNIQUE INDEX u(room_number);\n\nFrom MariaDB 10.5.3, adding a primary key for an application-time period table\nwith a WITHOUT OVERLAPS constraint:\n\nALTER TABLE rooms ADD PRIMARY KEY(room_number, p WITHOUT OVERLAPS);\n\nFrom MariaDB 10.8.1, ALTER query can be replicated faster with the setting of\n\nSET @@SESSION.binlog_alter_two_phase = true;\n\nprior the ALTER query. Binlog would contain two event groups\n\n| master-bin.000001 | 495 | Gtid              |         1 |         537 | GTID\n0-1-2 START ALTER                                        |\n| master-bin.000001 | 537 | Query             |         1 |         655 | use\n`test`; alter table t add column b int, algorithm=inplace |\n| master-bin.000001 | 655 | Gtid              |         1 |         700 | GTID\n0-1-3 COMMIT ALTER id=2                                  |\n| master-bin.000001 | 700 | Query             |         1 |         835 | use\n`test`; alter table t add column b int, algorithm=inplace |\n\nof which the first one gets delivered to replicas before ALTER is taken to\nactual execution on the primary.\n\nURL: https://mariadb.com/kb/en/alter-table/','','https://mariadb.com/kb/en/alter-table/'),
(701,'ALTER LOGFILE GROUP',38,'Syntax\n------\n\nALTER LOGFILE GROUP logfile_group\n  ADD UNDOFILE \'file_name\'\n  [INITIAL_SIZE [=] size]\n  [WAIT]\n  ENGINE [=] engine_name\n\nThe ALTER LOGFILE GROUP statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. See MDEV-19295 for more\ninformation.\n\nURL: https://mariadb.com/kb/en/alter-logfile-group/','','https://mariadb.com/kb/en/alter-logfile-group/'),
(703,'ALTER SERVER',38,'Syntax\n------\n\nALTER SERVER server_name\n  OPTIONS (option [, option] ...)\n\nDescription\n-----------\n\nAlters the server information for server_name, adjusting the specified options\nas per the CREATE SERVER command. The corresponding fields in the\nmysql.servers table are updated accordingly. This statement requires the SUPER\nprivilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.\n\nALTER SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nExamples\n--------\n\nALTER SERVER s OPTIONS (USER \'sally\');\n\nURL: https://mariadb.com/kb/en/alter-server/','','https://mariadb.com/kb/en/alter-server/'),
(704,'ALTER TABLESPACE',38,'The ALTER TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/alter-tablespace/','','https://mariadb.com/kb/en/alter-tablespace/'),
(706,'CREATE TABLE',38,'Syntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n  (create_definition,...) [table_options    ]... [partition_options]\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n  [(create_definition,...)] [table_options   ]... [partition_options]\n  select_statement\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_table_name | (LIKE old_table_name) }\nselect_statement:\n  [IGNORE | REPLACE] [AS] SELECT ...   (Some legal select statement)\n\nDescription\n-----------\n\nUse the CREATE TABLE statement to create a table with the given name.\n\nIn its most basic form, the CREATE TABLE statement provides a table name\nfollowed by a list of columns, indexes, and constraints. By default, the table\nis created in the default database. Specify a database with db_name.tbl_name.\nIf you quote the table name, you must quote the database name and table name\nseparately as `db_name`.`tbl_name`. This is particularly useful for CREATE\nTABLE ... SELECT, because it allows to create a table into a database, which\ncontains data from other databases. See Identifier Qualifiers.\n\nIf a table with the same name exists, error 1050 results. Use IF NOT EXISTS to\nsuppress this error and issue a note instead. Use SHOW WARNINGS to see notes.\n\nThe CREATE TABLE statement automatically commits the current transaction,\nexcept when using the TEMPORARY keyword.\n\nFor valid identifiers to use as table names, see Identifier Names.\n\nNote: if the default_storage_engine is set to ColumnStore then it needs\nsetting on all UMs. Otherwise when the tables using the default engine are\nreplicated across UMs they will use the wrong engine. You should therefore not\nuse this option as a session variable with ColumnStore.\n\nMicrosecond precision can be between 0-6. If no precision is specified it is\nassumed to be 0, for backward compatibility reasons.\n\nPrivileges\n----------\n\nExecuting the CREATE TABLE statement requires the CREATE privilege for the\ntable or the database.\n\nCREATE OR REPLACE\n-----------------\n\nIf the OR REPLACE clause is used and the table already exists, then instead of\nreturning an error, the server will drop the existing table and replace it\nwith the newly defined table.\n\nThis syntax was originally added to make replication more robust if it has to\nrollback and repeat statements such as CREATE ... SELECT on replicas.\n\nCREATE OR REPLACE TABLE table_name (a int);\n\nis basically the same as:\n\nDROP TABLE IF EXISTS table_name;\nCREATE TABLE table_name (a int);\n\nwith the following exceptions:\n\n* If table_name was locked with LOCK TABLES it will continue to be locked\nafter the statement.\n* Temporary tables are only dropped if the TEMPORARY keyword was used.  (With\nDROP TABLE,  temporary tables are preferred to be dropped before normal\ntables).\n\nThings to be Aware of With CREATE OR REPLACE\n--------------------------------------------\n\n* The table is dropped first (if it existed), after that the CREATE is done.\nBecause of this, if the CREATE fails, then the table will not exist anymore\nafter the statement.  If the table was used with LOCK TABLES it will be\nunlocked.\n* One can\'t use OR REPLACE together with IF EXISTS.\n* Slaves in replication will by default use CREATE OR REPLACE when replicating\nCREATE statements that don\'\'t use IF EXISTS. This can be changed by setting\nthe variable slave-ddl-exec-mode to STRICT.\n\nCREATE TABLE IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the table will only be created if a\ntable with the same name does not already exist. If the table already exists,\nthen a warning will be triggered by default.\n\nCREATE TEMPORARY TABLE\n----------------------\n\nUse the TEMPORARY keyword to create a temporary table that is only available\nto the current session. Temporary tables are dropped when the session ends.\nTemporary table names are specific to the session. They will not conflict with\nother temporary tables from other sessions even if they share the same name.\nThey will shadow names of non-temporary tables or views, if they are\nidentical. A temporary table can have the same name as a non-temporary table\nwhich is located in the same database. In that case, their name will reference\nthe temporary table when used in SQL statements. You must have the CREATE\nTEMPORARY TABLES privilege on the database to create temporary tables. If no\nstorage engine is specified, the default_tmp_storage_engine setting will\ndetermine the engine.\n\nROCKSDB temporary tables cannot be created by setting the\ndefault_tmp_storage_engine system variable, or using CREATE TEMPORARY TABLE\nLIKE. Before MariaDB 10.7, they could be specified, but would silently fail,\nand a MyISAM table would be created instead. From MariaDB 10.7 an error is\nreturned. Explicitly creating a temporary table with ENGINE=ROCKSDB has never\nbeen permitted.\n\nCREATE TABLE ... LIKE\n---------------------\n\nUse the LIKE clause instead of a full table definition to create a table with\nthe same definition as another table, including columns, indexes, and table\noptions. Foreign key definitions, as well as any DATA DIRECTORY or INDEX\nDIRECTORY table options specified on the original table, will not be created.\n\nCREATE TABLE ... SELECT\n-----------------------\n\nYou can create a table containing data from other tables using the CREATE ...\nSELECT statement. Columns will be created in the table for each field returned\nby the SELECT query.\n\nYou can also define some columns normally and add other columns from a SELECT.\nYou can also create columns in the normal way and assign them some values\nusing the query, this is done to force a certain type or other field\ncharacteristics. The columns that are not named in the query will be placed\nbefore the others. For example:\n\nCREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM\n  SELECT 5 AS b, c, d FROM another_table;\n\nRemember that the query just returns data. If you want to use the same\nindexes, or the same columns attributes ([NOT] NULL, DEFAULT, AUTO_INCREMENT)\nin the new table, you need to specify them manually. Types and sizes are not\nautomatically preserved if no data returned by the SELECT requires the full\nsize, and VARCHAR could be converted into CHAR. The CAST() function can be\nused to forcee the new table to use certain types.\n\nAliases (AS) are taken into account, and they should always be used when you\nSELECT an expression (function, arithmetical operation, etc).\n\nIf an error occurs during the query, the table will not be created at all.\n\nIf the new table has a primary key or UNIQUE indexes, you can use the IGNORE\nor REPLACE keywords to handle duplicate key errors during the query. IGNORE\nmeans that the newer values must not be inserted an identical value exists in\nthe index. REPLACE means that older values must be overwritten.\n\nIf the columns in the new table are more than the rows returned by the query,\nthe columns populated by the query will be placed after other columns. Note\nthat if the strict SQL_MODE is on, and the columns that are not names in the\nquery do not have a DEFAULT value, an error will raise and no rows will be\ncopied.\n\nConcurrent inserts are not used during the execution of a CREATE ... SELECT.\n\nIf the table already exists, an error similar to the following will be\nreturned:\n\nERROR 1050 (42S01): Table \'t\' already exists\n\nIf the IF NOT EXISTS clause is used and the table exists, a note will be\nproduced instead of an error.\n\nTo insert rows from a query into an existing table, INSERT ... SELECT can be\nused.\n\nColumn Definitions\n------------------\n\ncreate_definition:\n { col_name column_definition | index_definition | period_definition | CHECK\n(expr) }\ncolumn_definition:\n data_type\n  [NOT NULL | NULL] [DEFAULT default_value | (expression)]\n  [ON UPDATE [NOW | CURRENT_TIMESTAMP] [(precision)]]\n  [AUTO_INCREMENT] [ZEROFILL] [UNIQUE [KEY] | [PRIMARY] KEY]\n  [INVISIBLE] [{WITH|WITHOUT} SYSTEM VERSIONING]\n  [COMMENT \'string\'] [REF_SYSTEM_ID = value]\n  [reference_definition]\n | data_type [GENERATED ALWAYS]\n AS { { ROW {START|END} } | { (expression) [VIRTUAL | PERSISTENT | STORED] } }\n   [UNIQUE [KEY]] [COMMENT \'string\']\nconstraint_definition:\n CONSTRAINT [constraint_name] CHECK (expression)\nNote: Until MariaDB 10.4, MariaDB accepts the shortcut format with a\nREFERENCES clause only in ALTER TABLE and CREATE TABLE statements, but that\nsyntax does nothing. For example:\n\nCREATE TABLE b(for_key INT REFERENCES a(not_key));\n\nMariaDB simply parses it without returning any error or warning, for\ncompatibility with other DBMS\'s. Before MariaDB 10.2.1 this was also true for\nCHECK constraints. However, only the syntax described below creates foreign\nkeys.\n\nFrom MariaDB 10.5, MariaDB will attempt to apply the constraint. See Foreign\nKeys examples.\n\nEach definition either creates a column in the table or specifies and index or\nconstraint on one or more columns. See Indexes below for details on creating\nindexes.\n\nCreate a column by specifying a column name and a data type, optionally\nfollowed by column options. See Data Types for a full list of data types\nallowed in MariaDB.\n\nNULL and NOT NULL\n-----------------\n\nUse the NULL or NOT NULL options to specify that values in the column may or\nmay not be NULL, respectively. By default, values may be NULL. See also NULL\nValues in MariaDB.\n\nDEFAULT Column Option\n---------------------\n\nSpecify a default value using the DEFAULT clause. If you don\'t specify DEFAULT\nthen the following rules apply:\n\n* If the column is not defined with NOT NULL, AUTO_INCREMENT or TIMESTAMP, an\nexplicit DEFAULT NULL will be added.\nNote that in MySQL and in MariaDB before 10.1.6, you may get an explicit\nDEFAULT for primary key parts, if not specified with NOT NULL.\n\nThe default value will be used if you INSERT a row without specifying a value\nfor that column, or if you specify DEFAULT for that column. Before MariaDB\n10.2.1 you couldn\'t usually provide an expression or function to evaluate at\ninsertion time. You had to provide a constant default value instead. The one\nexception is that you may use CURRENT_TIMESTAMP as the default value for a\nTIMESTAMP column to use the current timestamp at insertion time.\n\nCURRENT_TIMESTAMP may also be used as the default value for a DATETIME\n\nYou can use most functions in DEFAULT. Expressions should have parentheses\naround them. If you use a non deterministic function in DEFAULT then all\ninserts to the table will be replicated in row mode. You can even refer to\nearlier columns in the DEFAULT expression (excluding AUTO_INCREMENT columns):\n\nCREATE TABLE t1 (a int DEFAULT (1+1), b int DEFAULT (a+1));\nCREATE TABLE t2 (a bigint primary key DEFAULT UUID_SHORT());\n\nThe DEFAULT clause cannot contain any stored functions or subqueries, and a\ncolumn used in the clause must already have been defined earlier in the\nstatement.\n\nIt is possible to assign BLOB or TEXT columns a DEFAULT value. In versions\nprior to MariaDB 10.2.1, assigning a default to these columns was not possible.\n\nYou can also use DEFAULT (NEXT VALUE FOR sequence)\n\nAUTO_INCREMENT Column Option\n----------------------------\n\nUse AUTO_INCREMENT to create a column whose value can can be set automatically\nfrom a simple counter. You can only use AUTO_INCREMENT on a column with an\ninteger type. The column must be a key, and there can only be one\nAUTO_INCREMENT column in a table. If you insert a row without specifying a\nvalue for that column (or if you specify 0, NULL, or DEFAULT as the value),\nthe actual value will be taken from the counter, with each insertion\nincrementing the counter by one. You can still insert a value explicitly. If\nyou insert a value that is greater than the current counter value, the counter\nis set based on the new value. An AUTO_INCREMENT column is implicitly NOT\nNULL. Use LAST_INSERT_ID to get the AUTO_INCREMENT value most recently used by\nan INSERT statement.\n\nZEROFILL Column Option\n----------------------\n\nIf the ZEROFILL column option is specified for a column using a numeric data\ntype, then the column will be set to UNSIGNED and the spaces used by default\nto pad the field are replaced with zeros. ZEROFILL is ignored in expressions\nor as part of a UNION. ZEROFILL is a non-standard MySQL and MariaDB\nenhancement.\n\nPRIMARY KEY Column Option\n-------------------------\n\nUse PRIMARY KEY to make a column a primary key. A primary key is a special\ntype of a unique key. There can be at most one primary key per table, and it\nis implicitly NOT NULL.\n\nSpecifying a column as a unique key creates a unique index on that column. See\nthe Index Definitions section below for more information.\n\nUNIQUE KEY Column Option\n------------------------\n\nUse UNIQUE KEY (or just UNIQUE) to specify that all values in the column must\nbe distinct from each other. Unless the column is NOT NULL, there may be\nmultiple rows with NULL in the column.\n\nSpecifying a column as a unique key creates a unique index on that column.\n\nSee the Index Definitions section below for more information.\n\nCOMMENT Column Option\n---------------------\n\nYou can provide a comment for each column using the COMMENT clause. The\nmaximum length is 1024 characters. Use the SHOW FULL COLUMNS statement to see\ncolumn comments.\n\nREF_SYSTEM_ID\n-------------\n\nREF_SYSTEM_ID can be used to specify Spatial Reference System IDs for spatial\ndata type columns. For example:\n\nCREATE TABLE t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101);\n\nGenerated Columns\n-----------------\n\nA generated column is a column in a table that cannot explicitly be set to a\nspecific value in a DML query. Instead, its value is automatically generated\nbased on an expression. This expression might generate the value based on the\nvalues of other columns in the table, or it might generate the value by\ncalling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n* PERSISTENT or STORED: This type\'s value is actually stored in the table.\n* VIRTUAL: This type\'s value is not stored at all. Instead, the value is\ngenerated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual\ncolumns.\n\nFor a complete description about generated columns and their limitations, see\nGenerated (Virtual and Persistent/Stored) Columns.\n\nCOMPRESSED\n----------\n\nCertain columns may be compressed. See Storage-Engine Independent Column\nCompression.\n\nINVISIBLE\n---------\n\nColumns may be made invisible, and hidden in certain contexts. See Invisible\nColumns.\n\nWITH SYSTEM VERSIONING Column Option\n------------------------------------\n\nColumns may be explicitly marked as included from system versioning. See\nSystem-versioned tables for details.\n\nWITHOUT SYSTEM VERSIONING Column Option\n---------------------------------------\n\nColumns may be explicitly marked as excluded from system versioning. See\nSystem-versioned tables for details.\n\nIndex Definitions\n-----------------\n\nindex_definition:\n  {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option]\n...\n {{{|}}} {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type]\n(index_col_name,...) [index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...)\nreference_definition\n\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\n\nindex_type:\n  USING {BTREE | HASH | RTREE}\n\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n {{{|}}} index_type\n {{{|}}} WITH PARSER parser_name\n {{{|}}} COMMENT \'string\'\n {{{|}}} CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nreference_definition:\n  REFERENCES tbl_name (index_col_name,...)\n   [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n   [ON DELETE reference_option]\n   [ON UPDATE reference_option]\n\nreference_option:\n  RESTRICT | CASCADE | SET NULL | NO ACTION\n\nINDEX and KEY are synonyms.\n\nIndex names are optional, if not specified an automatic name will be assigned.\nIndex name are needed to drop indexes and appear in error messages when a\nconstraint is violated.\n\nIndex Categories\n----------------\n\nPlain Indexes\n-------------\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the \"specialized\" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nPRIMARY KEY\n-----------\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nignored, and the name of the index is always PRIMARY. From MariaDB 10.3.18 and\nMariaDB 10.4.8, a warning is explicitly issued if a name is specified. Before\nthen, the name was silently ignored.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nUNIQUE\n------\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nMariaDB starting with 10.5\n--------------------------\nUnique, if index type is not specified, is normally a BTREE index that can\nalso be used by the optimizer to find rows. If the key is longer than the max\nkey length for the used storage engine, a HASH key will be created. This\nenables MariaDB to enforce uniqueness for any type or number of columns.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nFOREIGN KEY\n-----------\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed.  The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL.  (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is currently implemented only for the PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nFULLTEXT\n--------\n\nUse the FULLTEXT keyword to create full-text indexes.\n\nSee Full-Text Indexes for more information.\n\nSPATIAL\n-------\n\nUse the SPATIAL keyword to create geometric indexes.\n\nSee SPATIAL INDEX for more information.\n\nIndex Options\n-------------\n\nKEY_BLOCK_SIZE Index Option\n---------------------------\n\nThe KEY_BLOCK_SIZE index option is similar to the KEY_BLOCK_SIZE table option.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\nHowever, this does not happen if you just set the KEY_BLOCK_SIZE index option\nfor one or more indexes in the table. The InnoDB storage engine ignores the\nKEY_BLOCK_SIZE index option. However, the SHOW CREATE TABLE statement may\nstill report it for the index.\n\nFor information about the KEY_BLOCK_SIZE index option, see the KEY_BLOCK_SIZE\ntable option below.\n\nIndex Types\n-----------\n\nEach storage engine supports some or all index types. See Storage Engine Index\nTypes for details on permitted index types for each storage engine.\n\nDifferent index types are optimized for different kind of operations:\n\n* BTREE is the default type, and normally is the best choice. It is supported\nby all storage engines. It can be used to compare a column\'s value with a\nvalue using the =, >, >=, <, <=, BETWEEN, and LIKE operators. BTREE can also\nbe used to find NULL values. Searches against an index prefix are possible.\n* HASH is only supported by the MEMORY storage engine. HASH indexes can only\nbe used for =, <=, and >= comparisons. It can not be used for the ORDER BY\nclause. Searches against an index prefix are not possible.\n* RTREE is the default for SPATIAL indexes, but if the storage engine does not\nsupport it BTREE can be used.\n\nIndex columns names are listed between parenthesis. After each column, a\nprefix length can be specified. If no length is specified, the whole column\nwill be indexed. ASC and DESC can be specified for compatibility with are\nDBMS\'s, but have no meaning in MariaDB.\n\nWITH PARSER Index Option\n------------------------\n\nThe WITH PARSER index option only applies to FULLTEXT indexes and contains the\nfulltext parser name. The fulltext parser must be an installed plugin.\n\nCOMMENT Index Option\n--------------------\n\nA comment of up to 1024 characters is permitted with the COMMENT index option.\n\nThe COMMENT index option allows you to specify a comment with user-readable\ntext describing what the index is for. This information is not used by the\nserver itself.\n\nCLUSTERING Index Option\n-----------------------\n\nThe CLUSTERING index option is only valid for tables using the TokuDB storage\nengine.\n\nIGNORED / NOT IGNORED\n---------------------\n\nMariaDB starting with 10.6.0\n----------------------------\nFrom MariaDB 10.6.0, indexes can be specified to be ignored by the optimizer.\nSee Ignored Indexes.\n\nPeriods\n-------\n\nperiod_definition:\n  PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\nMariaDB supports a subset of the standard syntax for periods. At the moment\nit\'s only used for creating System-versioned tables. Both columns must be\ncreated, must be either of a TIMESTAMP(6) or BIGINT UNSIGNED type, and be\ngenerated as ROW START and ROW END accordingly. See System-versioned tables\nfor details.\n\nThe table must also have the WITH SYSTEM VERSIONING clause.\n\nConstraint Expressions\n----------------------\n\nNote: Before MariaDB 10.2.1, constraint expressions were accepted in the\nsyntax but ignored.\n\nMariaDB 10.2.1 introduced two ways to define a constraint:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraints fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDFs.\n\ncreate table t1 (a int check(a>0) ,b int check (b> 0), constraint abc check\n(a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get a auto generated name. This is done so that you can\nlater delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. This is useful for example when loading a\ntable that violates some constraints that you want to later find and fix in\nSQL.\n\nSee CONSTRAINT for more information.\n\nTable Options\n-------------\n\nFor each individual table you create (or alter), you can set some table\noptions. The general syntax for setting options is:\n\n<OPTION_NAME> = <option_value>, [<OPTION_NAME> = <option_value> ...]\n\nThe equal sign is optional.\n\nSome options are supported by the server and can be used for all tables, no\nmatter what storage engine they use; other options can be specified for all\nstorage engines, but have a meaning only for some engines. Also, engines can\nextend CREATE TABLE with new options.\n\nIf the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is enabled, wrong table options\ngenerate a warning; otherwise, they generate an error.\n\ntable_option:    \n  [STORAGE] ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTED [=] {YES | NO}\n | ENCRYPTION_KEY_ID [=] value\n | IETF_QUOTES [=] {YES | NO}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PAGE_CHECKSUM [=] {0 | 1}\n | PAGE_COMPRESSED [=] {0 | 1}\n | PAGE_COMPRESSION_LEVEL [=] {0 .. 9}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT|PAGE}\n | SEQUENCE [=] {0|1}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] {DEFAULT|value}\n | TABLESPACE tablespace_name\n | TRANSACTIONAL [=]  {0 | 1}\n | UNION [=] (tbl_name[,tbl_name]...)\n | WITH SYSTEM VERSIONING\n\n[STORAGE] ENGINE\n----------------\n\n[STORAGE] ENGINE specifies a storage engine for the table. If this option is\nnot used, the default storage engine is used instead. That is, the\ndefault_storage_engine session option value if it is set, or the value\nspecified for the --default-storage-engine mysqld startup option, or the\ndefault storage engine, InnoDB. If the specified storage engine is not\ninstalled and active, the default value will be used, unless the\nNO_ENGINE_SUBSTITUTION SQL MODE is set (default). This is only true for CREATE\nTABLE, not for ALTER TABLE. For a list of storage engines that are present in\nyour server, issue a SHOW ENGINES.\n\nAUTO_INCREMENT\n--------------\n\nAUTO_INCREMENT specifies the initial value for the AUTO_INCREMENT primary key.\nThis works for MyISAM, Aria, InnoDB, MEMORY, and ARCHIVE tables. You can\nchange this option with ALTER TABLE, but in that case the new value must be\nhigher than the highest value which is present in the AUTO_INCREMENT column.\nIf the storage engine does not support this option, you can insert (and then\ndelete) a row having the wanted value - 1 in the AUTO_INCREMENT column.\n\nAVG_ROW_LENGTH\n--------------\n\nAVG_ROW_LENGTH is the average rows size. It only applies to tables using\nMyISAM and Aria storage engines that have the ROW_FORMAT table option set to\nFIXED format.\n\nMyISAM uses MAX_ROWS and AVG_ROW_LENGTH to decide the maximum size of a table\n(default: 256TB, or the maximum file size allowed by the system).\n\n[DEFAULT] CHARACTER SET/CHARSET\n-------------------------------\n\n[DEFAULT] CHARACTER SET (or [DEFAULT] CHARSET) is used to set a default\ncharacter set for the table. This is the character set used for all columns\nwhere an explicit character set is not specified. If this option is omitted or\nDEFAULT is specified, database\'s default character set will be used. See\nSetting Character Sets and Collations for details on setting the character\nsets.\n\nCHECKSUM/TABLE_CHECKSUM\n-----------------------\n\nCHECKSUM (or TABLE_CHECKSUM) can be set to 1 to maintain a live checksum for\nall table\'s rows. This makes write operations slower, but CHECKSUM TABLE will\nbe very fast. This option is only supported for MyISAM and Aria tables.\n\n[DEFAULT] COLLATE\n-----------------\n\n[DEFAULT] COLLATE is used to set a default collation for the table. This is\nthe collation used for all columns where an explicit character set is not\nspecified. If this option is omitted or DEFAULT is specified, database\'s\ndefault option will be used. See Setting Character Sets and Collations for\ndetails on setting the collations\n\nCOMMENT\n-------\n\nCOMMENT is a comment for the table. The maximum length is 2048 characters.\nAlso used to define table parameters when creating a Spider table.\n\nCONNECTION\n----------\n\nCONNECTION is used to specify a server name or a connection string for a\nSpider, CONNECT, Federated or FederatedX table.\n\nDATA DIRECTORY/INDEX DIRECTORY\n------------------------------\n\nDATA DIRECTORY and INDEX DIRECTORY are supported for MyISAM and Aria, and DATA\nDIRECTORY is also supported by InnoDB if the innodb_file_per_table server\nsystem variable is enabled, but only in CREATE TABLE, not in ALTER TABLE. So,\ncarefully choose a path for InnoDB tables at creation time, because it cannot\nbe changed without dropping and re-creating the table. These options specify\nthe paths for data files and index files, respectively. If these options are\nomitted, the database\'s directory will be used to store data files and index\nfiles. Note that these table options do not work for partitioned tables (use\nthe partition options instead), or if the server has been invoked with the\n--skip-symbolic-links startup option. To avoid the overwriting of old files\nwith the same name that could be present in the directories, you can use the\n--keep_files_on_create option (an error will be issued if files already\nexist). These options are ignored if the NO_DIR_IN_CREATE SQL_MODE is enabled\n(useful for replication slaves). Also note that symbolic links cannot be used\nfor InnoDB tables.\n\nDATA DIRECTORY works by creating symlinks from where the table would normally\nhave been (inside the datadir) to where the option specifies. For security\nreasons, to avoid bypassing the privilege system, the server does not permit\nsymlinks inside the datadir. Therefore, DATA DIRECTORY cannot be used to\nspecify a location inside the datadir. An attempt to do so will result in an\nerror 1210 (HY000) Incorrect arguments to DATA DIRECTORY.\n\nDELAY_KEY_WRITE\n---------------\n\nDELAY_KEY_WRITE is supported by MyISAM and Aria, and can be set to 1 to speed\nup write operations. In that case, when data are modified, the indexes are not\nupdated until the table is closed. Writing the changes to the index file\naltogether can be much faster. However, note that this option is applied only\nif the delay_key_write server variable is set to \'ON\'. If it is \'OFF\' the\ndelayed index writes are always disabled, and if it is \'ALL\' the delayed index\nwrites are always used, disregarding the value of DELAY_KEY_WRITE.\n\nENCRYPTED\n---------\n\nThe ENCRYPTED table option can be used to manually set the encryption status\nof an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTED table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nENCRYPTION_KEY_ID\n-----------------\n\nThe ENCRYPTION_KEY_ID table option can be used to manually set the encryption\nkey of an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTION_KEY_ID table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nIETF_QUOTES\n-----------\n\nFor the CSV storage engine, the IETF_QUOTES option, when set to YES, enables\nIETF-compatible parsing of embedded quote and comma characters. Enabling this\noption for a table improves compatibility with other tools that use CSV, but\nis not compatible with MySQL CSV tables, or MariaDB CSV tables created without\nthis option. Disabled by default.\n\nINSERT_METHOD\n-------------\n\nINSERT_METHOD is only used with MERGE tables. This option determines in which\nunderlying table the new rows should be inserted. If you set it to \'NO\' (which\nis the default) no new rows can be added to the table (but you will still be\nable to perform INSERTs directly against the underlying tables). FIRST means\nthat the rows are inserted into the first table, and LAST means that thet are\ninserted into the last table.\n\nKEY_BLOCK_SIZE\n--------------\n\nKEY_BLOCK_SIZE is used to determine the size of key blocks, in bytes or\nkilobytes. However, this value is just a hint, and the storage engine could\nmodify or ignore it. If KEY_BLOCK_SIZE is set to 0, the storage engine\'s\ndefault value will be used.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\n\nMIN_ROWS/MAX_ROWS\n-----------------\n\nMIN_ROWS and MAX_ROWS let the storage engine know how many rows you are\nplanning to store as a minimum and as a maximum. These values will not be used\nas real limits, but they help the storage engine to optimize the table.\nMIN_ROWS is only used by MEMORY storage engine to decide the minimum memory\nthat is always allocated. MAX_ROWS is used to decide the minimum size for\nindexes.\n\nPACK_KEYS\n---------\n\nPACK_KEYS can be used to determine whether the indexes will be compressed. Set\nit to 1 to compress all keys. With a value of 0, compression will not be used.\nWith the DEFAULT value, only long strings will be compressed. Uncompressed\nkeys are faster.\n\nPAGE_CHECKSUM\n-------------\n\nPAGE_CHECKSUM is only applicable to Aria tables, and determines whether\nindexes and data should use page checksums for extra safety.\n\nPAGE_COMPRESSED\n---------------\n\nPAGE_COMPRESSED is used to enable InnoDB page compression for InnoDB tables.\n\nPAGE_COMPRESSION_LEVEL\n----------------------\n\nPAGE_COMPRESSION_LEVEL is used to set the compression level for InnoDB page\ncompression for InnoDB tables. The table must also have the PAGE_COMPRESSED\ntable option set to 1.\n\nValid values for PAGE_COMPRESSION_LEVEL are 1 (the best speed) through 9 (the\nbest compression), .\n\nPASSWORD\n--------\n\nPASSWORD is unused.\n\nRAID_TYPE\n---------\n\nRAID_TYPE is an obsolete option, as the raid support has been disabled since\nMySQL 5.0.\n\nROW_FORMAT\n----------\n\nThe ROW_FORMAT table option specifies the row format for the data file.\nPossible values are engine-dependent.\n\nSupported MyISAM Row Formats\n----------------------------\n\nFor MyISAM, the supported row formats are:\n\n* FIXED\n* DYNAMIC\n* COMPRESSED\n\nThe COMPRESSED row format can only be set by the myisampack command line tool.\n\nSee MyISAM Storage Formats for more information.\n\nSupported Aria Row Formats\n--------------------------\n\nFor Aria, the supported row formats are:\n\n* PAGE\n* FIXED\n* DYNAMIC.\n\nSee Aria Storage Formats for more information.\n\nSupported InnoDB Row Formats\n----------------------------\n\nFor InnoDB, the supported row formats are:\n\n* COMPACT\n* REDUNDANT\n* COMPRESSED\n* DYNAMIC.\n\nIf the ROW_FORMAT table option is set to FIXED for an InnoDB table, then the\nserver will either return an error or a warning depending on the value of the\ninnodb_strict_mode system variable. If the innodb_strict_mode system variable\nis set to OFF, then a warning is issued, and MariaDB will create the table\nusing the default row format for the specific MariaDB server version. If the\ninnodb_strict_mode system variable is set to ON, then an error will be raised.\n\nSee InnoDB Storage Formats for more information.\n\nOther Storage Engines and ROW_FORMAT\n------------------------------------\n\nOther storage engines do not support the ROW_FORMAT table option.\n\nSEQUENCE\n--------\n\nIf the table is a sequence, then it will have the SEQUENCE set to 1.\n\nSTATS_AUTO_RECALC\n-----------------\n\nSTATS_AUTO_RECALC indicates whether to automatically recalculate persistent\nstatistics (see STATS_PERSISTENT, below) for an InnoDB table. If set to 1,\nstatistics will be recalculated when more than 10% of the data has changed.\nWhen set to 0, stats will be recalculated only when an ANALYZE TABLE is run.\nIf set to DEFAULT, or left out, the value set by the innodb_stats_auto_recalc\nsystem variable applies. See InnoDB Persistent Statistics.\n\nSTATS_PERSISTENT\n----------------\n\nSTATS_PERSISTENT indicates whether the InnoDB statistics created by ANALYZE\nTABLE will remain on disk or not. It can be set to 1 (on disk), 0 (not on\ndisk, the pre-MariaDB 10 behavior), or DEFAULT (the same as leaving out the\noption), in which case the value set by the innodb_stats_persistent system\nvariable will apply. Persistent statistics stored on disk allow the statistics\nto survive server restarts, and provide better query plan stability. See\nInnoDB Persistent Statistics.\n\nSTATS_SAMPLE_PAGES\n------------------\n\nSTATS_SAMPLE_PAGES indicates how many pages are used to sample index\nstatistics. If 0 or DEFAULT, the default value, the innodb_stats_sample_pages\nvalue is used. See InnoDB Persistent Statistics.\n\nTRANSACTIONAL\n-------------\n\nTRANSACTIONAL is only applicable for Aria tables. In future Aria tables\ncreated with this option will be fully transactional, but currently this\nprovides a form of crash protection. See Aria Storage Engine for more details.\n\nUNION\n-----\n\nUNION must be specified when you create a MERGE table. This option contains a\ncomma-separated list of MyISAM tables which are accessed by the new table. The\nlist is enclosed between parenthesis. Example: UNION = (t1,t2)\n\nWITH SYSTEM VERSIONING\n----------------------\n\nWITH SYSTEM VERSIONING is used for creating System-versioned tables.\n\nPartitions\n----------\n\npartition_options:\n  PARTITION BY\n    { [LINEAR] HASH(expr)\n    | [LINEAR] KEY(column_list)\n    | RANGE(expr)\n    | LIST(expr)\n    | SYSTEM_TIME [INTERVAL time_quantity time_unit] [LIMIT num] }\n  [PARTITIONS num]\n  [SUBPARTITION BY\n    { [LINEAR] HASH(expr)\n    | [LINEAR] KEY(column_list) }\n   [SUBPARTITIONS num]\n  ]\n  [(partition_definition [, partition_definition] ...)]\npartition_definition:\n  PARTITION partition_name\n    [VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]\n    [[STORAGE] ENGINE [=] engine_name]\n    [COMMENT [=] \'comment_text\' ]\n    [DATA DIRECTORY [=] \'data_dir\']\n    [INDEX DIRECTORY [=] \'index_dir\']\n    [MAX_ROWS [=] max_number_of_rows]\n    [MIN_ROWS [=] min_number_of_rows]\n    [TABLESPACE [=] tablespace_name]\n    [NODEGROUP [=] node_group_id]\n    [(subpartition_definition [, subpartition_definition] ...)]\nsubpartition_definition:\n  SUBPARTITION logical_name\n    [[STORAGE] ENGINE [=] engine_name]\n    [COMMENT [=] \'comment_text\' ]\n    [DATA DIRECTORY [=] \'data_dir\']\n    [INDEX DIRECTORY [=] \'index_dir\']\n    [MAX_ROWS [=] max_number_of_rows]\n    [MIN_ROWS [=] min_number_of_rows]\n    [TABLESPACE [=] tablespace_name]\n    [NODEGROUP [=] node_group_id]\nIf the PARTITION BY clause is used, the table will be partitioned. A partition\nmethod must be explicitly indicated for partitions and subpartitions.\nPartition methods are:\n\n* [LINEAR] HASH creates a hash key which will be used to read and write rows.\nThe partition function can be any valid SQL expression which returns an\nINTEGER number. Thus, it is possible to use the HASH method on an integer\ncolumn, or on functions which accept integer columns as an argument. However,\nVALUES LESS THAN and VALUES IN clauses can not be used with HASH. An example:\n\nCREATE TABLE t1 (a INT, b CHAR(5), c DATETIME)\n  PARTITION BY HASH ( YEAR(c) );\n\n[LINEAR] HASH can be used for subpartitions, too.\n\n* [LINEAR] KEY is similar to HASH, but the index has an even distribution of\ndata. Also, the expression can only be a column or a list of columns. VALUES\nLESS THAN and VALUES IN clauses can not be used with KEY.\n* RANGE partitions the rows using on a range of values, using the VALUES LESS\nTHAN operator. VALUES IN is not allowed with RANGE. The partition function can\nbe any valid SQL expression which returns a single value.\n* LIST assigns partitions based on a table\'s column with a restricted set of\npossible values. It is similar to RANGE, but VALUES IN must be used for at\nleast 1 columns, and VALUES LESS THAN is disallowed.\n* SYSTEM_TIME partitioning is used for System-versioned tables to store\nhistorical data separately from current data.\n\nOnly HASH and KEY can be used for subpartitions, and they can be [LINEAR].\n\nIt is possible to define up to 1024 partitions and subpartitions.\n\nThe number of defined partitions can be optionally specified as PARTITION\ncount. This can be done to avoid specifying all partitions individually. But\nyou can also declare each individual partition and, additionally, specify a\nPARTITIONS count clause; in the case, the number of PARTITIONs must equal\ncount.\n\nAlso see Partitioning Types Overview.\n\nSequences\n---------\n\nCREATE TABLE can also be used to create a SEQUENCE. See CREATE SEQUENCE and\nSequence Overview.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL. CREATE TABLE is atomic, except for CREATE\nOR REPLACE, which is only crash safe.\n\nExamples\n--------\n\ncreate table if not exists test (\na bigint auto_increment primary key,\nname varchar(128) charset utf8,\nkey name (name(32))\n) engine=InnoDB default charset latin1;\n\nThis example shows a couple of things:\n\n* Usage of IF NOT EXISTS; If the table already existed, it will not be\ncreated.  There will not be any error for the client, just a warning.\n* How to create a PRIMARY KEY that is automatically generated.\n* How to specify a table-specific character set and another for a column.\n* How to create an index (name) that is only partly indexed (to save space).\n\nThe following clauses will work from MariaDB 10.2.1 only.\n\nCREATE TABLE t1(\n a int DEFAULT (1+1),\n b int DEFAULT (a+1),\n expires DATETIME DEFAULT(NOW() + INTERVAL 1 YEAR),\n x BLOB DEFAULT USER()\n);\n\nURL: https://mariadb.com/kb/en/create-table/','','https://mariadb.com/kb/en/create-table/'),
(712,'CREATE FUNCTION',38,'Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = {user | CURRENT_USER | role | CURRENT_ROLE }]\n  [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name ([func_parameter[,...]])\n  RETURNS type\n  [characteristic ...]\n  RETURN func_body\nfunc_parameter:\n  [ IN | OUT | INOUT | IN OUT ]  param_name type\ntype:\n  Any valid MariaDB data type\ncharacteristic:\n  LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\nfunc_body:\n  Valid SQL procedure statement\n\nDescription\n-----------\n\nUse the CREATE FUNCTION statement to create a new stored function. You must\nhave the CREATE ROUTINE database privilege to use CREATE FUNCTION. A function\ntakes any number of arguments and returns a value from the function body. The\nfunction body can be any valid SQL expression as you would use, for example,\nin any select expression. If you have the appropriate privileges, you can call\nthe function exactly as you would any built-in function. See Security below\nfor details on privileges.\n\nYou can also use a variant of the CREATE FUNCTION statement to install a\nuser-defined function (UDF) defined by a plugin. See CREATE FUNCTION (UDF) for\ndetails.\n\nYou can use a SELECT statement for the function body by enclosing it in\nparentheses, exactly as you would to use a subselect for any other expression.\nThe SELECT statement must return a single value. If more than one column is\nreturned when the function is called, error 1241 results. If more than one row\nis returned when the function is called, error 1242 results. Use a LIMIT\nclause to ensure only one row is returned.\n\nYou can also replace the RETURN clause with a BEGIN...END compound statement.\nThe compound statement must contain a RETURN statement. When the function is\ncalled, the RETURN statement immediately returns its result, and any\nstatements after RETURN are effectively ignored.\n\nBy default, a function is associated with the current database. To associate\nthe function explicitly with a given database, specify the fully-qualified\nname as db_name.func_name when you create it. If the function name is the same\nas the name of a built-in function, you must use the fully qualified name when\nyou call it.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nIN | OUT | INOUT | IN OUT\n-------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter qualifiers for IN, OUT, INOUT, and IN OUT were added in\na 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only in\nprocedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions\nwith more than one return value. This allows functions to be more complex and\nnested.\n\nDELIMITER $$\nCREATE FUNCTION add_func3(IN a INT, IN b INT, OUT c INT) RETURNS INT\nBEGIN\n SET c = 100;\n RETURN a + b;\nEND;\n$$\nDELIMITER ;\n\nSET @a = 2;\nSET @b = 3;\nSET @c = 0;\nSET @res= add_func3(@a, @b, @c);\n\nSELECT add_func3(@a, @b, @c);\nERROR 4186 (HY000): OUT or INOUT argument 3 for function add_func3 is not\nallowed here\n\nDELIMITER $$\nCREATE FUNCTION add_func4(IN a INT, IN b INT, d INT) RETURNS INT\nBEGIN\n DECLARE c, res INT;\n SET res = add_func3(a, b, c) + d;\n if (c > 99) then\n  return  3;\n else\n  return res;\n end if;\nEND;\n$$\n\nDELIMITER ;\n\nSELECT add_func4(1,2,3);\n+------------------+\n| add_func4(1,2,3) |\n+------------------+\n|                3 |\n+------------------+\n\nAGGREGATE\n---------\n\nIt is possible to create stored aggregate functions as well. See Stored\nAggregate Functions for details.\n\nRETURNS\n-------\n\nThe RETURNS clause specifies the return type of the function. NULL values are\npermitted with all return types.\n\nWhat happens if the RETURN clause returns a value of a different type? It\ndepends on the SQL_MODE in effect at the moment of the function creation.\n\nIf the SQL_MODE is strict (STRICT_ALL_TABLES or STRICT_TRANS_TABLES flags are\nspecified), a 1366 error will be produced.\n\nOtherwise, the value is coerced to the proper type. For example, if a function\nspecifies an ENUM or SET value in the RETURNS clause, but the RETURN clause\nreturns an integer, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nMariaDB stores the SQL_MODE system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nLANGUAGE SQL\n------------\n\nLANGUAGE SQL is a standard SQL clause, and it can be used in MariaDB for\nportability. However that clause has no meaning, because SQL is the only\nsupported language for stored functions.\n\nA function is deterministic if it can produce only one result for a given list\nof parameters. If the result may be affected by stored data, server variables,\nrandom numbers or any value that is not explicitly passed, then the function\nis not deterministic. Also, a function is non-deterministic if it uses\nnon-deterministic functions like NOW() or CURRENT_TIMESTAMP(). The optimizer\nmay choose a faster execution plan if it known that the function is\ndeterministic. In such cases, you should declare the routine using the\nDETERMINISTIC keyword. If you want to explicitly state that the function is\nnot deterministic (which is the default) you can use the NOT DETERMINISTIC\nkeywords.\n\nIf you declare a non-deterministic function as DETERMINISTIC, you may get\nincorrect results. If you declare a deterministic function as NOT\nDETERMINISTIC, in some cases the queries will be slower.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION function_name ...;\n\nwith the exception that any existing privileges for the function are not\ndropped.\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the function already exists. Cannot be used together with OR\nREPLACE.\n\n[NOT] DETERMINISTIC\n-------------------\n\nThe [NOT] DETERMINISTIC clause also affects binary logging, because the\nSTATEMENT format can not be used to store or replicate non-deterministic\nstatements.\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA\n-----------------\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA\n--------------\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL\n------------\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL\n------\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nOracle Mode\n-----------\n\nA subset of Oracle\'s PL/SQL language is supported in addition to the\ntraditional SQL/PSM-based MariaDB syntax. See Oracle mode for details on\nchanges when running Oracle mode.\n\nSecurity\n--------\n\nYou must have the EXECUTE privilege on a function to call it. MariaDB\nautomatically grants the EXECUTE and ALTER ROUTINE privileges to the account\nthat called CREATE FUNCTION, even if the DEFINER clause was used.\n\nEach function has an account associated as the definer. By default, the\ndefiner is the account that created the function. Use the DEFINER clause to\nspecify a different account as the definer. You must have the SUPER privilege,\nor, from MariaDB 10.5.2, the SET USER privilege, to use the DEFINER clause.\nSee Account Names for details on specifying accounts.\n\nThe SQL SECURITY clause specifies what privileges are used when a function is\ncalled. If SQL SECURITY is INVOKER, the function body will be evaluated using\nthe privileges of the user calling the function. If SQL SECURITY is DEFINER,\nthe function body is always evaluated using the privileges of the definer\naccount. DEFINER is the default.\n\nThis allows you to create functions that grant limited access to certain data.\nFor example, say you have a table that stores some employee information, and\nthat you\'ve granted SELECT privileges only on certain columns to the user\naccount roger.\n\nCREATE TABLE employees (name TINYTEXT, dept TINYTEXT, salary INT);\nGRANT SELECT (name, dept) ON employees TO roger;\n\nTo allow the user the get the maximum salary for a department, define a\nfunction and grant the EXECUTE privilege:\n\nCREATE FUNCTION max_salary (dept TINYTEXT) RETURNS INT RETURN\n (SELECT MAX(salary) FROM employees WHERE employees.dept = dept);\nGRANT EXECUTE ON FUNCTION max_salary TO roger;\n\nSince SQL SECURITY defaults to DEFINER, whenever the user roger calls this\nfunction, the subselect will execute with your privileges. As long as you have\nprivileges to select the salary of each employee, the caller of the function\nwill be able to get the maximum salary for each department without being able\nto see individual salaries.\n\nCharacter sets and collations\n-----------------------------\n\nFunction return types can be declared to use any valid character set and\ncollation. If used, the COLLATE attribute needs to be preceded by a CHARACTER\nSET attribute.\n\nIf the character set and collation are not specifically set in the statement,\nthe database defaults at the time of creation will be used. If the database\ndefaults change at a later stage, the stored function character set/collation\nwill not be changed at the same time; the stored function needs to be dropped\nand recreated to ensure the same character set/collation as the database is\nused.\n\nExamples\n--------\n\nThe following example function takes a parameter, performs an operation using\nan SQL function, and returns the result.\n\nCREATE FUNCTION hello (s CHAR(20))\n  RETURNS CHAR(50) DETERMINISTIC\n  RETURN CONCAT(\'Hello, \',s,\'!\');\n\nSELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world!  |\n+----------------+\n\nYou can use a compound statement in a function to manipulate data with\nstatements like INSERT and UPDATE. The following example creates a counter\nfunction that uses a temporary table to store the current value. Because the\ncompound statement contains statements terminated with semicolons, you have to\nfirst change the statement delimiter with the DELIMITER statement to allow the\nsemicolon to be used in the function body. See Delimiters in the mariadb\nclient for more.\n\nCREATE TEMPORARY TABLE counter (c INT);\nINSERT INTO counter VALUES (0);\nDELIMITER //\nCREATE FUNCTION counter () RETURNS INT\n BEGIN\n  UPDATE counter SET c = c + 1;\n  RETURN (SELECT c FROM counter LIMIT 1);\n END //\nDELIMITER ;\n\nCharacter set and collation:\n\nCREATE FUNCTION hello2 (s CHAR(20))\n RETURNS CHAR(50) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\' DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n\nURL: https://mariadb.com/kb/en/create-function/','','https://mariadb.com/kb/en/create-function/'),
(716,'CREATE PROCEDURE',38,'Syntax\n------\n\nCREATE\n  [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PROCEDURE [IF NOT EXISTS] sp_name ([proc_parameter[,...]])\n  [characteristic ...] routine_body\n\nproc_parameter:\n  [ IN | OUT | INOUT ] param_name type\n\ntype:\n  Any valid MariaDB data type\n\ncharacteristic:\n  LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nroutine_body:\n  Valid SQL procedure statement\n\nDescription\n-----------\n\nCreates a stored procedure. By default, a routine is associated with the\ndefault database. To associate the routine explicitly with a given database,\nspecify the name as db_name.sp_name when you create it.\n\nWhen the routine is invoked, an implicit USE db_name is performed (and undone\nwhen the routine terminates). The causes the routine to have the given default\ndatabase while it executes. USE statements within stored routines are\ndisallowed.\n\nWhen a stored procedure has been created, you invoke it by using the CALL\nstatement (see CALL).\n\nTo execute the CREATE PROCEDURE statement, it is necessary to have the CREATE\nROUTINE privilege. By default, MariaDB automatically grants the ALTER ROUTINE\nand EXECUTE privileges to the routine creator. See also Stored Routine\nPrivileges.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be used\nwhen checking access privileges at routine execution time, as described here.\nRequires the SUPER privilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIf the routine name is the same as the name of a built-in SQL function, you\nmust use a space between the name and the following parenthesis when defining\nthe routine, or a syntax error occurs. This is also true when you invoke the\nroutine later. For this reason, we suggest that it is better to avoid re-using\nthe names of existing SQL functions for your own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always allowable to have spaces after a routine name,\nregardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as procedure names, see Identifier Names.\n\nThings to be Aware of With CREATE OR REPLACE\n--------------------------------------------\n\n* One can\'t use OR REPLACE together with IF EXISTS.\n\nCREATE PROCEDURE IF NOT EXISTS\n------------------------------\n\nIf the IF NOT EXISTS clause is used, then the procedure will only be created\nif a procedure with the same name does not already exist. If the procedure\nalready exists, then a warning will be triggered by default.\n\nIN/OUT/INOUT\n------------\n\nEach parameter is an IN parameter by default. To specify otherwise for a\nparameter, use the keyword OUT or INOUT before the parameter name.\n\nAn IN parameter passes a value into a procedure. The procedure might modify\nthe value, but the modification is not visible to the caller when the\nprocedure returns. An OUT parameter passes a value from the procedure back to\nthe caller. Its initial value is NULL within the procedure, and its value is\nvisible to the caller when the procedure returns. An INOUT parameter is\ninitialized by the caller, can be modified by the procedure, and any change\nmade by the procedure is visible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the CALL\nstatement that invokes the procedure so that you can obtain its value when the\nprocedure returns. If you are calling the procedure from within another stored\nprocedure or function, you can also pass a routine parameter or local routine\nvariable as an IN or INOUT parameter.\n\nDETERMINISTIC/NOT DETERMINISTIC\n-------------------------------\n\nDETERMINISTIC and NOT DETERMINISTIC apply only to functions. Specifying\nDETERMINISTC or NON-DETERMINISTIC in procedures has no effect. The default\nvalue is NOT DETERMINISTIC. Functions are DETERMINISTIC when they always\nreturn the same value for the same input. For example, a truncate or substring\nfunction. Any function involving data, therefore, is always NOT DETERMINISTIC.\n\nCONTAINS SQL/NO SQL/READS SQL DATA/MODIFIES SQL DATA\n----------------------------------------------------\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nThe routine_body consists of a valid SQL procedure statement. This can be a\nsimple statement such as SELECT or INSERT, or it can be a compound statement\nwritten using BEGIN and END. Compound statements can contain declarations,\nloops, and other control structure statements. See Programmatic and Compound\nStatements for syntax details.\n\nMariaDB allows routines to contain DDL statements, such as CREATE and DROP.\nMariaDB also allows stored procedures (but not stored functions) to contain\nSQL transaction statements such as COMMIT.\n\nFor additional information about statements that are not allowed in stored\nroutines, see Stored Routine Limitations.\n\nInvoking stored procedure from within programs\n----------------------------------------------\n\nFor information about invoking stored procedures from within programs written\nin a language that has a MariaDB/MySQL interface, see CALL.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP PROCEDURE IF EXISTS name;\nCREATE PROCEDURE name ...;\n\nwith the exception that any existing privileges for the procedure are not\ndropped.\n\nsql_mode\n--------\n\nMariaDB stores the sql_mode system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nCharacter Sets and Collations\n-----------------------------\n\nProcedure parameters can be declared with any character set/collation. If the\ncharacter set and collation are not specifically set, the database defaults at\nthe time of creation will be used. If the database defaults change at a later\nstage, the stored procedure character set/collation will not be changed at the\nsame time; the stored procedure needs to be dropped and recreated to ensure\nthe same character set/collation as the database is used.\n\nOracle Mode\n-----------\n\nA subset of Oracle\'s PL/SQL language is supported in addition to the\ntraditional SQL/PSM-based MariaDB syntax. See Oracle mode for details on\nchanges when running Oracle mode.\n\nExamples\n--------\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter. It uses the DELIMITER command to set a new delimiter for the\nduration of the process — see Delimiters in the mariadb client.\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc (OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCALL simpleproc(@a);\n\nSELECT @a;\n+------+\n| @a   |\n+------+\n|    1 |\n+------+\n\nCharacter set and collation:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCREATE OR REPLACE:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\nQuery OK, 0 rows affected (0.03 sec)\n\nURL: https://mariadb.com/kb/en/create-procedure/','','https://mariadb.com/kb/en/create-procedure/'),
(718,'CREATE TABLESPACE',38,'The CREATE TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/create-tablespace/','','https://mariadb.com/kb/en/create-tablespace/'),
(720,'CREATE VIEW',38,'Syntax\n------\n\nCREATE\n  [OR REPLACE]\n  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  [SQL SECURITY { DEFINER | INVOKER }]\n  VIEW [IF NOT EXISTS] view_name [(column_list)]\n  AS select_statement\n  [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThe CREATE VIEW statement creates a new view, or replaces an existing one if\nthe OR REPLACE clause is given. If the view does not exist, CREATE OR REPLACE\nVIEW is the same as CREATE VIEW. If the view does exist, CREATE OR REPLACE\nVIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition of the\nview. (When you select from the view, you select in effect using the SELECT\nstatement.) select_statement can select from base tables or other views.\n\nThe view definition is \"frozen\" at creation time, so changes to the underlying\ntables afterwards do not affect the view definition. For example, if a view is\ndefined as SELECT * on a table, new columns added to the table later do not\nbecome part of the view. A SHOW CREATE VIEW shows that such queries are\nrewritten and column names are included in the view definition.\n\nThe view definition must be a query that does not return errors at view\ncreation times. However, the base tables used by the views might be altered\nlater and the query may not be valid anymore. In this case, querying the view\nwill result in an error. CHECK TABLE helps in finding this kind of problems.\n\nThe ALGORITHM clause affects how MariaDB processes the view. The DEFINER and\nSQL SECURITY clauses specify the security context to be used when checking\naccess privileges at view invocation time. The WITH CHECK OPTION clause can be\ngiven to constrain inserts or updates to rows in tables referenced by the\nview. These clauses are described later in this section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the view, and\nsome privilege for each column selected by the SELECT statement. For columns\nused elsewhere in the SELECT statement you must have the SELECT privilege. If\nthe OR REPLACE clause is present, you must also have the DROP privilege for\nthe view.\n\nA view belongs to a database. By default, a new view is created in the default\ndatabase. To create the view explicitly in a given database, specify the name\nas db_name.view_name when you create it.\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nBase tables and views share the same namespace within a database, so a\ndatabase cannot contain a base table and a view that have the same name.\n\nViews must have unique column names with no duplicates, just like base tables.\nBy default, the names of the columns retrieved by the SELECT statement are\nused for the view column names. To define explicit names for the view columns,\nthe optional column_list clause can be given as a list of comma-separated\nidentifiers. The number of names in column_list must be the same as the number\nof columns retrieved by the SELECT statement.\n\nMySQL until 5.1.28\n------------------\nPrior to MySQL 5.1.29, When you modify an existing view, the current view\ndefinition is backed up and saved. It is stored in that table\'s database\ndirectory, in a subdirectory named arc. The backup file for a view v is named\nv.frm-00001. If you alter the view again, the next backup is named\nv.frm-00002. The three latest view backup definitions are stored. Backed up\nview definitions are not preserved by mysqldump, or any other such programs,\nbut you can retain them using a file copy operation. However, they are not\nneeded for anything but to provide you with a backup of your previous view\ndefinition. It is safe to remove these backup definitions, but only while\nmysqld is not running. If you delete the arc subdirectory or its files while\nmysqld is running, you will receive an error the next time you try to alter\nthe view:\n\nMariaDB [test]> ALTER VIEW v AS SELECT * FROM t; \nERROR 6 (HY000): Error on delete of \'.\\test\\arc/v.frm-0004\' (Errcode: 2)\n\nColumns retrieved by the SELECT statement can be simple references to table\ncolumns. They can also be expressions that use functions, constant values,\noperators, and so forth.\n\nUnqualified table or view names in the SELECT statement are interpreted with\nrespect to the default database. A view can refer to tables or views in other\ndatabases by qualifying the table or view name with the proper database name.\n\nA view can be created from many kinds of SELECT statements. It can refer to\nbase tables or other views. It can use joins, UNION, and subqueries. The\nSELECT need not even refer to any tables. The following example defines a view\nthat selects two columns from another table, as well as an expression\ncalculated from those columns:\n\nCREATE TABLE t (qty INT, price INT);\n\nINSERT INTO t VALUES(3, 50);\n\nCREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\n\nSELECT * FROM v;\n+------+-------+-------+\n| qty  | price | value |\n+------+-------+-------+\n|    3 |    50 |   150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\n* The SELECT statement cannot contain a subquery in the FROM clause.\n* The SELECT statement cannot refer to system or user variables.\n* Within a stored program, the definition cannot refer to program parameters\nor local variables.\n* The SELECT statement cannot refer to prepared statement parameters.\n* Any table or view referred to in the definition must exist. However, after a\nview has been created, it is possible to drop a table or view that the\ndefinition refers to. In this case, use of the view results in an error. To\ncheck a view definition for problems of this kind, use the CHECK TABLE\nstatement.\n* The definition cannot refer to a TEMPORARY table, and you cannot create a\nTEMPORARY view.\n* Any tables named in the view definition must exist at definition time.\n* You cannot associate a trigger with a view.\n* For valid identifiers to use as view names, see Identifier Names.\n\nORDER BY is allowed in a view definition, but it is ignored if you select from\na view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the options\nor clauses of the statement that references the view, but the effect is\nundefined. For example, if a view definition includes a LIMIT clause, and you\nselect from the view using a statement that has its own LIMIT clause, it is\nundefined which limit applies. This same principle applies to options such as\nALL, DISTINCT, or SQL_SMALL_RESULT that follow the SELECT keyword, and to\nclauses such as INTO, FOR UPDATE, and LOCK IN SHARE MODE.\n\nThe PROCEDURE clause cannot be used in a view definition, and it cannot be\nused if a view is referenced in the FROM clause.\n\nIf you create a view and then change the query processing environment by\nchanging system variables, that may affect the results that you get from the\nview:\n\nCREATE VIEW v (mycol) AS SELECT \'abc\';\n\nSET sql_mode = \'\';\n\nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol | \n+-------+\n\nSET sql_mode = \'ANSI_QUOTES\';\n\nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc   | \n+-------+\n\nThe DEFINER and SQL SECURITY clauses determine which MariaDB account to use\nwhen checking access privileges for the view when a statement is executed that\nreferences the view. They were added in MySQL 5.1.2. The legal SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the view,\nrespectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MariaDB\naccount in \'user_name\'@\'host_name\' format (the same format used in the GRANT\nstatement). The user_name and host_name values both are required. The definer\ncan also be given as CURRENT_USER or CURRENT_USER(). The default DEFINER value\nis the user who executes the CREATE VIEW statement. This is the same as\nspecifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the legal DEFINER\nuser values:\n\n* If you do not have the SUPER privilege, or, from MariaDB 10.5.2, the SET\nUSER privilege, the only legal user value is your own account, either\nspecified literally or by using CURRENT_USER. You cannot set the definer to\nsome other account.\n* If you have the SUPER privilege, or, from MariaDB 10.5.2, the SET USER\nprivilege, you can specify any syntactically legal account name. If the\naccount does not actually exist, a warning is generated.\n* If the SQL SECURITY value is DEFINER but the definer account does not exist\nwhen the view is referenced, an error occurs.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value by\ndefault. For views defined with the SQL SECURITY INVOKER characteristic,\nCURRENT_USER returns the account for the view\'s invoker. For information about\nuser auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.1/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This also\naffects a view defined within such a program, if the view definition contains\na DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\n* At view definition time, the view creator must have the privileges needed to\nuse the top-level objects accessed by the view. For example, if the view\ndefinition refers to table columns, the creator must have privileges for the\ncolumns, as described previously. If the definition refers to a stored\nfunction, only the privileges needed to invoke the function can be checked.\nThe privileges required when the function runs can be checked only as it\nexecutes: For different invocations of the function, different execution paths\nwithin the function might be taken.\n* When a view is referenced, privileges for objects accessed by the view are\nchecked against the privileges held by the view creator or invoker, depending\non whether the SQL SECURITY characteristic is DEFINER or INVOKER, respectively.\n* If reference to a view causes execution of a stored function, privilege\nchecking for statements executed within the function depend on whether the\nfunction is defined with a SQL SECURITY characteristic of DEFINER or INVOKER.\nIf the security characteristic is DEFINER, the function runs with the\nprivileges of its creator. If the characteristic is INVOKER, the function runs\nwith the privileges determined by the view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function might\ninvoke other stored routines. For example, the following view invokes a stored\nfunction f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be checked\nwhen f() executes. This might mean that privileges are needed for p1() or\np2(), depending on the execution path within f(). Those privileges must be\nchecked at runtime, and the user who must possess the privileges is determined\nby the SQL SECURITY values of the view v and the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to standard SQL.\nIn standard SQL, views are handled using the rules for SQL SECURITY INVOKER.\n\nIf you invoke a view that was created before MySQL 5.1.2, it is treated as\nthough it was created with a SQL SECURITY DEFINER clause and with a DEFINER\nvalue that is the same as your account. However, because the actual definer is\nunknown, MySQL issues a warning. To make the warning go away, it is sufficient\nto re-create the view so that the view definition includes a DEFINER clause.\n\nThe optional ALGORITHM clause is an extension to standard SQL. It affects how\nMariaDB processes the view. ALGORITHM takes three values: MERGE, TEMPTABLE, or\nUNDEFINED. The default algorithm is UNDEFINED if no ALGORITHM clause is\npresent. See View Algorithms for more information.\n\nSome views are updatable. That is, you can use them in statements such as\nUPDATE, DELETE, or INSERT to update the contents of the underlying table. For\na view to be updatable, there must be a one-to-one relationship between the\nrows in the view and the rows in the underlying table. There are also certain\nother constructs that make a view non-updatable. See Inserting and Updating\nwith Views.\n\nWITH CHECK OPTION\n-----------------\n\nThe WITH CHECK OPTION clause can be given for an updatable view to prevent\ninserts or updates to rows except those for which the WHERE clause in the\nselect_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and CASCADED\nkeywords determine the scope of check testing when the view is defined in\nterms of another view. The LOCAL keyword restricts the CHECK OPTION only to\nthe view being defined. CASCADED causes the checks for underlying views to be\nevaluated as well. When neither keyword is given, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION clause,\nsee Inserting and Updating with Views.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified view already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE VIEW is atomic.\n\nExamples\n--------\n\nCREATE TABLE t (a INT, b INT) ENGINE = InnoDB;\n\nINSERT INTO t VALUES (1,1), (2,2), (3,3);\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n\nSELECT * FROM v;\n+------+------+\n| a    | a2   |\n+------+------+\n|    1 |    2 |\n|    2 |    4 |\n|    3 |    6 |\n+------+------+\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nERROR 1050 (42S01): Table \'v\' already exists\n\nCREATE OR REPLACE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected (0.04 sec)\n\nCREATE VIEW IF NOT EXISTS v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------+\n| Level | Code | Message                  |\n+-------+------+--------------------------+\n| Note  | 1050 | Table \'v\' already exists |\n+-------+------+--------------------------+\n\nURL: https://mariadb.com/kb/en/create-view/','','https://mariadb.com/kb/en/create-view/'),
(721,'Generated (Virtual and Persistent/Stored) Columns',38,'Syntax\n------\n\n<type>  [GENERATED ALWAYS]  AS   ( <expression> )\n[VIRTUAL | PERSISTENT | STORED]  [UNIQUE] [UNIQUE KEY] [COMMENT <text>]\n\nMariaDB\'s generated columns syntax is designed to be similar to the syntax for\nMicrosoft SQL Server\'s computed columns and Oracle Database\'s virtual columns.\nIn MariaDB 10.2 and later, the syntax is also compatible with the syntax for\nMySQL\'s generated columns.\n\nDescription\n-----------\n\nA generated column is a column in a table that cannot explicitly be set to a\nspecific value in a DML query. Instead, its value is automatically generated\nbased on an expression. This expression might generate the value based on the\nvalues of other columns in the table, or it might generate the value by\ncalling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n* PERSISTENT (a.k.a. STORED): This type\'s value is actually stored in the\ntable.\n* VIRTUAL: This type\'s value is not stored at all. Instead, the value is\ngenerated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual\ncolumns.\n\nSupported Features\n------------------\n\nStorage Engine Support\n----------------------\n\n* Generated columns can only be used with storage engines which support them.\nIf you try to use a storage engine that does not support them, then you will\nsee an error similar to the following:\n\nERROR 1910 (HY000): TokuDB storage engine does not support computed columns\n\n* InnoDB, Aria, MyISAM and CONNECT support generated columns.\n\n* A column in a MERGE table can be built on a PERSISTENT generated column.\nHowever, a column in a MERGE table can not be defined as a VIRTUAL and\nPERSISTENT generated column.\n\nData Type Support\n-----------------\n\n* All data types are supported when defining generated columns.\n\n* Using the ZEROFILL column option is supported when defining generated\ncolumns.\n\n* Using the AUTO_INCREMENT column option is not supported when defining\ngenerated columns. Until MariaDB 10.2.25, it was supported, but this support\nwas removed, because it would not work correctly. See MDEV-11117.\n\nIndex Support\n-------------\n\n* Using a generated column as a table\'s primary key is not supported. See\nMDEV-5590 for more information. If you try to use one as a primary key, then\nyou will see an error similar to the following:\n\nERROR 1903 (HY000): Primary key cannot be defined upon a computed column\n\n* Using PERSISTENT generated columns as part of a foreign key is supported.\n\n* Referencing PERSISTENT generated columns as part of a foreign key is also\nsupported.\nHowever, using the ON UPDATE CASCADE, ON UPDATE SET NULL, or ON DELETE SET\nNULL clauses is not supported. If you try to use an unsupported clause, then\nyou will see an error similar to the following:\n\nERROR 1905 (HY000): Cannot define foreign key with ON UPDATE SET NULL clause\non a computed column\n\n* Defining indexes on both VIRTUAL and PERSISTENT generated columns is\nsupported.\nIf an index is defined on a generated column, then the optimizer considers\nusing it in the same way as indexes based on \"real\" columns.\n\nStatement Support\n-----------------\n\n* Generated columns are used in DML queries just as if they were \"real\"\ncolumns.\nHowever, VIRTUAL and PERSISTENT generated columns differ in how their data is\nstored.\nValues for PERSISTENT generated columns are generated whenever a DML queries\ninserts or updates the row with the special DEFAULT value. This generates the\ncolumns value, and it is stored in the table like the other \"real\" columns.\nThis value can be read by other DML queries just like the other \"real\" columns.\nValues for VIRTUAL generated columns are not stored in the table. Instead, the\nvalue is generated dynamically whenever the column is queried. If other\ncolumns in a row are queried, but the VIRTUAL generated column is not one of\nthe queried columns, then the column\'s value is not generated.\n\n* The SELECT statement supports generated columns.\n\n* Generated columns can be referenced in the INSERT, UPDATE, and DELETE\nstatements.\nHowever, VIRTUAL or PERSISTENT generated columns cannot be explicitly set to\nany other values than NULL or DEFAULT. If a generated column is explicitly set\nto any other value, then the outcome depends on whether strict mode is enabled\nin sql_mode. If it is not enabled, then a warning will be raised and the\ndefault generated value will be used instead. If it is enabled, then an error\nwill be raised instead.\n\n* The CREATE TABLE statement has limited support for generated columns.\nIt supports defining generated columns in a new table.\nIt supports using generated columns to partition tables.\nIt does not support using the versioning clauses with generated columns.\n\n* The ALTER TABLE statement has limited support for generated columns.\nIt supports the MODIFY and CHANGE clauses for PERSISTENT generated columns.\nIt does not support the MODIFY clause for VIRTUAL generated columns if\nALGORITHM is not set to COPY. See MDEV-15476 for more information.\nIt does not support the  CHANGE clause for VIRTUAL generated columns if\nALGORITHM is not set to COPY. See MDEV-17035 for more information.\nIt does not support altering a table if ALGORITHM is not set to COPY if the\ntable has a VIRTUAL generated column that is indexed. See MDEV-14046 for more\ninformation.\nIt does not support adding a VIRTUAL generated column with the ADD clause if\nthe same statement is also adding other columns if ALGORITHM is not set to\nCOPY. See MDEV-17468 for more information.\nIt also does not support altering an existing column into a VIRTUAL generated\ncolumn.\nIt supports using generated columns to partition tables.\nIt does not support using the versioning clauses with generated columns.\n\n* The SHOW CREATE TABLE statement supports generated columns.\n\n* The DESCRIBE statement can be used to check whether a table has generated\ncolumns.\nYou can tell which columns are generated by looking for the ones where the\nExtra column is set to either VIRTUAL or PERSISTENT. For example:\n\nDESCRIBE table1;\n+-------+-------------+------+-----+---------+------------+\n| Field | Type        | Null | Key | Default | Extra      |\n+-------+-------------+------+-----+---------+------------+\n| a     | int(11)     | NO   |     | NULL    |            |\n| b     | varchar(32) | YES  |     | NULL    |            |\n| c     | int(11)     | YES  |     | NULL    | VIRTUAL    |\n| d     | varchar(5)  | YES  |     | NULL    | PERSISTENT |\n+-------+-------------+------+-----+---------+------------+\n\n* Generated columns can be properly referenced in the NEW and OLD rows in\ntriggers.\n\n* Stored procedures support generated columns.\n\n* The HANDLER statement supports generated columns.\n\nExpression Support\n------------------\n\n* Most legal, deterministic expressions which can be calculated are supported\nin expressions for generated columns.\n\n* Most built-in functions are supported in expressions for generated columns.\nHowever, some built-in functions can\'t be supported for technical reasons. For\nexample,  If you try to use an unsupported function in an expression, an error\nis generated similar to the following:\n\nERROR 1901 (HY000): Function or expression \'dayname()\' cannot be used in the\nGENERATED ALWAYS AS clause of `v`\n\n* Subqueries are not supported in expressions for generated columns because\nthe underlying data can change.\n\n* Using anything that depends on data outside the row is not supported in\nexpressions for generated columns.\n\n* Stored functions are not supported in expressions for generated columns. See\nMDEV-17587 for more information.\n\n* Non-deterministic built-in functions are supported in expressions for not\nindexed VIRTUAL generated columns.\n\n* Non-deterministic built-in functions are not supported in expressions for\nPERSISTENT or indexed VIRTUAL generated columns.\n\n* User-defined functions (UDFs) are supported in expressions for generated\ncolumns.\nHowever, MariaDB can\'t check whether a UDF is deterministic, so it is up to\nthe user to be sure that they do not use non-deterministic UDFs with VIRTUAL\ngenerated columns.\n\n* Defining a generated column based on other generated columns defined before\nit in the table definition is supported. For example:\n\nCREATE TABLE t1 (a int as (1), b int as (a));\n\n* However, defining a generated column based on other generated columns\ndefined after in the table definition is not supported in expressions for\ngeneration columns because generated columns are calculated in the order they\nare defined.\n\n* Using an expression that exceeds 255 characters in length is supported in\nexpressions for generated columns. The new limit for the entire table\ndefinition, including all expressions for generated columns, is 65,535 bytes.\n\n* Using constant expressions is supported in expressions for generated\ncolumns. For example:\n\nCREATE TABLE t1 (a int as (1));\n\nMaking Stored Values Consistent\n-------------------------------\n\nWhen a generated column is PERSISTENT or indexed, the value of the expression\nneeds to be consistent regardless of the SQL Mode flags in the current\nsession. If it is not, then the table will be seen as corrupted when the value\nthat should actually be returned by the computed expression and the value that\nwas previously stored and/or indexed using a different sql_mode setting\ndisagree.\n\nThere are currently two affected classes of inconsistencies: character padding\nand unsigned subtraction:\n\n* For a VARCHAR or TEXT generated column the length of the value returned can\nvary depending on the PAD_CHAR_TO_FULL_LENGTH sql_mode flag.  To make the\nvalue consistent, create the generated column using an RTRIM() or RPAD()\nfunction.  Alternately, create the generated column as a CHAR column so that\nits data is always fully padded.\n\n* If a SIGNED generated column is based on the subtraction of an UNSIGNED\nvalue, the resulting value can vary depending on how large the value is and\nthe NO_UNSIGNED_SUBTRACTION sql_mode flag.  To make the value consistent, use\nCAST() to ensure that each UNSIGNED operand is SIGNED before the subtraction.\n\nMariaDB starting with 10.5\n--------------------------\nBeginning in MariaDB 10.5, there is a fatal error generated when trying to\ncreate a generated column whose value can change depending on the SQL Mode\nwhen its data is PERSISTENT or indexed.\n\nFor an existing generated column that has a potentially inconsistent value, a\nwarning about a bad expression is generated the first time it is used (if\nwarnings are enabled).\n\nBeginning in MariaDB 10.4.8, MariaDB 10.3.18, and MariaDB 10.2.27 a\npotentially inconsistent generated column outputs a warning when created or\nfirst used (without restricting their creation).\n\nHere is an example of two tables that would be rejected in MariaDB 10.5 and\nwarned about in the other listed versions:\n\nCREATE TABLE bad_pad (\n txt CHAR(5),\n -- CHAR -> VARCHAR or CHAR -> TEXT can\'t be persistent or indexed:\n vtxt VARCHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE bad_sub (\n num1 BIGINT UNSIGNED,\n num2 BIGINT UNSIGNED,\n -- The resulting value can vary for some large values\n vnum BIGINT AS (num1 - num2) VIRTUAL,\n KEY(vnum)\n);\n\nThe warnings for the above tables look like this:\n\nWarning (Code 1901): Function or expression \'`txt`\' cannot be used in the\nGENERATED ALWAYS AS clause of `vtxt`\nWarning (Code 1105): Expression depends on the @@sql_mode value\nPAD_CHAR_TO_FULL_LENGTH\n\nWarning (Code 1901): Function or expression \'`num1` - `num2`\' cannot be used\nin the GENERATED ALWAYS AS clause of `vnum`\nWarning (Code 1105): Expression depends on the @@sql_mode value\nNO_UNSIGNED_SUBTRACTION\n\nTo work around the issue, force the padding or type to make the generated\ncolumn\'s expression return a consistent value. For example:\n\nCREATE TABLE good_pad (\n txt CHAR(5),\n -- Using RTRIM() or RPAD() makes the value consistent:\n vtxt VARCHAR(5) AS (RTRIM(txt)) PERSISTENT,\n -- When not persistent or indexed, it is OK for the value to vary by mode:\n vtxt2 VARCHAR(5) AS (txt) VIRTUAL,\n -- CHAR -> CHAR is always OK:\n txt2 CHAR(5) AS (txt) PERSISTENT\n);\n\nCREATE TABLE good_sub (\n num1 BIGINT UNSIGNED,\n num2 BIGINT UNSIGNED,\n -- The indexed value will always be consistent in this expression:\n vnum BIGINT AS (CAST(num1 AS SIGNED) - CAST(num2 AS SIGNED)) VIRTUAL,\n KEY(vnum)\n);\n\nMySQL Compatibility Support\n---------------------------\n\n* The STORED keyword is supported as an alias for the PERSISTENT keyword.\n\n* Tables created with MySQL 5.7 or later that contain MySQL\'s generated\ncolumns can be imported into MariaDB without a dump and restore.\n\nImplementation Differences\n--------------------------\n\nGenerated columns are subject to various constraints in other DBMSs that are\nnot present in MariaDB\'s implementation. Generated columns may also be called\ncomputed columns or virtual columns in different implementations. The various\ndetails for a specific implementation can be found in the documentation for\neach specific DBMS.\n\nImplementation Differences Compared to Microsoft SQL Server\n-----------------------------------------------------------\n\nMariaDB\'s generated columns implementation does not enforce the following\nrestrictions that are present in Microsoft SQL Server\'s computed columns\nimplementation:\n\n* MariaDB allows server variables in generated column expressions, including\nthose that change dynamically, such as warning_count.\n* MariaDB allows the CONVERT_TZ() function to be called with a named time zone\nas an argument, even though time zone names and time offsets are configurable.\n* MariaDB allows the CAST() function to be used with non-unicode character\nsets, even though character sets are configurable and differ between\nbinaries/versions.\n* MariaDB allows FLOAT expressions to be used in generated columns. Microsoft\nSQL Server considers these expressions to be \"imprecise\" due to potential\ncross-platform differences in floating-point implementations and precision.\n* Microsoft SQL Server requires the ARITHABORT mode to be set, so that\ndivision by zero returns an error, and not a NULL.\n* Microsoft SQL Server requires QUOTED_IDENTIFIER to be set in sql_mode. In\nMariaDB, if data is inserted without ANSI_QUOTES set in sql_mode, then it will\nbe processed and stored differently in a generated column that contains quoted\nidentifiers.\n\nMicrosoft SQL Server enforces the above restrictions by doing one of the\nfollowing things:\n\n* Refusing to create computed columns.\n* Refusing to allow updates to a table containing them.\n* Refusing to use an index over such a column if it can not be guaranteed that\nthe expression is fully deterministic.\n\nIn MariaDB, as long as the sql_mode, language, and other settings that were in\neffect during the CREATE TABLE remain unchanged, the generated column\nexpression will always be evaluated the same. If any of these things change,\nthen please be aware that the generated column expression might not be\nevaluated the same way as it previously was.\n\nIf you try to update a virtual column, you will get an error if the default\nstrict mode is enabled in sql_mode, or a warning otherwise.\n\nDevelopment History\n-------------------\n\nGenerated columns was originally developed by Andrey Zhakov. It was then\nmodified by Sanja Byelkin and Igor Babaev at Monty Program for inclusion in\nMariaDB. Monty did the work on MariaDB 10.2 to lift a some of the old\nlimitations.\n\nExamples\n--------\n\nHere is an example table that uses both VIRTUAL and PERSISTENT virtual columns:\n\nUSE TEST;\n\nCREATE TABLE table1 (\n  a INT NOT NULL,\n  b VARCHAR(32),\n  c INT AS (a mod 10) VIRTUAL,\n  d VARCHAR(5) AS (left(b,5)) PERSISTENT);\n\nIf you describe the table, you can easily see which columns are virtual by\nlooking in the \"Extra\" column:\n\nDESCRIBE table1;\n+-------+-------------+------+-----+---------+------------+\n| Field | Type        | Null | Key | Default | Extra      |\n+-------+-------------+------+-----+---------+------------+\n| a     | int(11)     | NO   |     | NULL    |            |\n| b     | varchar(32) | YES  |     | NULL    |            |\n| c     | int(11)     | YES  |     | NULL    | VIRTUAL    |\n| d     | varchar(5)  | YES  |     | NULL    | PERSISTENT |\n+-------+-------------+------+-----+---------+------------+\n\nTo find out what function(s) generate the value of the virtual column you can\nuse SHOW CREATE TABLE:\n\nSHOW CREATE TABLE table1;\n\n| table1 | CREATE TABLE `table1` (\n `a` int(11) NOT NULL,\n `b` varchar(32) DEFAULT NULL,\n `c` int(11) AS (a mod 10) VIRTUAL,\n `d` varchar(5) AS (left(b,5)) PERSISTENT\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 |\n\nIf you try to insert non-default values into a virtual column, you will\nreceive a warning and what you tried to insert will be ignored and the derived\nvalue inserted instead:\n\nWARNINGS;\nShow warnings enabled.\n\nINSERT INTO table1 VALUES (1, \'some text\',default,default);\nQuery OK, 1 row affected (0.00 sec)\n\nINSERT INTO table1 VALUES (2, \'more text\',5,default);\nQuery OK, 1 row affected, 1 warning (0.00 sec)\n\nWarning (Code 1645): The value specified for computed column \'c\' in table\n\'table1\' has been ignored.\n\nINSERT INTO table1 VALUES (123, \'even more text\',default,\'something\');\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n\nWarning (Code 1645): The value specified for computed column \'d\' in table\n\'table1\' has been ignored.\nWarning (Code 1265): Data truncated for column \'d\' at row 1\n\nSELECT * FROM table1;\n+-----+----------------+------+-------+\n| a   | b              | c    | d     |\n+-----+----------------+------+-------+\n|   1 | some text      |    1 | some  |\n|   2 | more text      |    2 | more  |\n| 123 | even more text |    3 | even  |\n+-----+----------------+------+-------+\n3 rows in set (0.00 sec)\n\nIf the ZEROFILL clause is specified, it should be placed directly after the\ntype definition, before the AS (<expression>):\n\nCREATE TABLE table2 (a INT, b INT ZEROFILL AS (a*2) VIRTUAL);\nINSERT INTO table2 (a) VALUES (1);\n\nSELECT * FROM table2;\n+------+------------+\n| a    | b          |\n+------+------------+\n|    1 | 0000000002 |\n+------+------------+\n1 row in set (0.00 sec)\n\nYou can also use virtual columns to implement a \"poor man\'s partial index\".\nSee example at the end of Unique Index.\n\nURL: https://mariadb.com/kb/en/generated-columns/','','https://mariadb.com/kb/en/generated-columns/'),
(727,'DROP PACKAGE',38,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE statement drops a stored package entirely:\n\n* Drops the package specification (earlier created using the CREATE PACKAGE\nstatement).\n* Drops the package implementation, if the implementation was already created\nusing the CREATE PACKAGE BODY statement.\n\nURL: https://mariadb.com/kb/en/drop-package/','','https://mariadb.com/kb/en/drop-package/'),
(288,'VARCHAR',23,'Syntax\n------\n\n[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,532. The effective maximum length of a\nVARCHAR is subject to the maximum row size and the character set used. For\nexample, utf8 characters can require up to three bytes per character, so a\nVARCHAR column that uses the utf8 character set can be declared to be a\nmaximum of 21,844 characters.\n\nNote: For the ColumnStore engine, M represents the maximum column length in\nbytes.\n\nMariaDB stores VARCHAR values as a one-byte or two-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A VARCHAR\ncolumn uses one length byte if values require no more than 255 bytes, two\nlength bytes if values may require more than 255 bytes.\n\nMariaDB follows the standard SQL specification, and does not remove trailing\nspaces from VARCHAR values.\n\nVARCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nVARCHAR(0).\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the standard\nSQL way to define that a VARCHAR column should use some predefined character\nset. MariaDB uses utf8 as this predefined character set, as does MySQL 4.1 and\nup. NVARCHAR is shorthand for NATIONAL VARCHAR.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat VARCHAR (as well as CHAR and TEXT values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces. From MariaDB 10.2, a number of NO\nPAD collations are available.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nThe following are equivalent:\n\nVARCHAR(30) CHARACTER SET utf8\nNATIONAL VARCHAR(30)\nNVARCHAR(30)\nNCHAR VARCHAR(30)\nNATIONAL CHARACTER VARYING(30)\nNATIONAL CHAR VARYING(30)\n\nTrailing spaces:\n\nCREATE TABLE strtest (v VARCHAR(10));\nINSERT INTO strtest VALUES(\'Maria   \');\n\nSELECT v=\'Maria\',v=\'Maria   \' FROM strtest;\n+-----------+--------------+\n| v=\'Maria\' | v=\'Maria   \' |\n+-----------+--------------+\n|         1 |            1 |\n+-----------+--------------+\n\nSELECT v LIKE \'Maria\',v LIKE \'Maria   \' FROM strtest;\n+----------------+-------------------+\n| v LIKE \'Maria\' | v LIKE \'Maria   \' |\n+----------------+-------------------+\n|              0 |                 1 |\n+----------------+-------------------+\n\nTruncation\n----------\n\n* Depending on whether or not strict sql mode is set, you will either get a\nwarning or an error if you try to insert a string that is too long into a\nVARCHAR column. If the extra characters are spaces, the spaces that can\'t fit\nwill be removed and you will always get a warning, regardless of the sql mode\nsetting.\n\nDifference Between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, VARCHAR2 is a synonym.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength.  The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\nURL: https://mariadb.com/kb/en/varchar/','','https://mariadb.com/kb/en/varchar/'),
(295,'YEAR Data Type',23,'Syntax\n------\n\nYEAR[(4)]\n\nDescription\n-----------\n\nA year in two-digit or four-digit format. The default is four-digit format.\nNote that the two-digit format has been deprecated since MariaDB 5.5.27.\n\nIn four-digit format, the allowable values are 1901 to 2155, and 0000. In\ntwo-digit format, the allowable values are 70 to 69, representing years from\n1970 to 2069. MariaDB displays YEAR values in YYYY format, but allows you to\nassign values to YEAR columns using either strings or numbers.\n\nInserting numeric zero has a different result for YEAR(4) and YEAR(2). For\nYEAR(2), the value 00 reflects the year 2000. For YEAR(4), the value 0000\nreflects the year zero. This only applies to numeric zero. String zero always\nreflects the year 2000.\n\nExamples\n--------\n\nAccepting a string or a number:\n\nCREATE TABLE y(y YEAR);\n\nINSERT INTO y VALUES (1990),(\'2012\');\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nERROR 1264 (22003): Out of range value for column \'y\' at row 1\n\nINSERT INTO y VALUES (\'2013-12-12\');\nERROR 1265 (01000): Data truncated for column \'y\' at row 1\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nQuery OK, 2 rows affected, 2 warnings (0.05 sec)\nRecords: 2  Duplicates: 0  Warnings: 2\n\nSHOW WARNINGS;\n+---------+------+--------------------------------------------+\n| Level   | Code | Message                                    |\n+---------+------+--------------------------------------------+\n| Warning | 1264 | Out of range value for column \'y\' at row 1 |\n| Warning | 1264 | Out of range value for column \'y\' at row 2 |\n+---------+------+--------------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n+------+\n\nTruncating:\n\nINSERT INTO y VALUES (\'2013-12-12\');\nQuery OK, 1 row affected, 1 warning (0.05 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1265 | Data truncated for column \'y\' at row 1 |\n+---------+------+----------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y    |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n| 2013 |\n+------+\n\nDifference between YEAR(2) and YEAR(4), and string and numeric zero:\n\nCREATE TABLE y2(y YEAR(4), y2 YEAR(2));\nQuery OK, 0 rows affected, 1 warning (0.40 sec)\n\nNote (Code 1287): \'YEAR(2)\' is deprecated and will be removed in a future\nrelease. \n Please use YEAR(4) instead\n\nINSERT INTO y2 VALUES(0,0),(\'0\',\'0\');\n\nSELECT YEAR(y),YEAR(y2) FROM y2;\n+---------+----------+\n| YEAR(y) | YEAR(y2) |\n+---------+----------+\n|       0 |     2000 |\n|    2000 |     2000 |\n+---------+----------+\n\nURL: https://mariadb.com/kb/en/year-data-type/','','https://mariadb.com/kb/en/year-data-type/'),
(290,'UUID Data Type',23,'MariaDB starting with 10.7.0\n----------------------------\nThe UUID data type was added in a MariaDB 10.7.0 preview.\n\nSyntax\n------\n\nUUID\n\nDescription\n-----------\n\nThe UUID data type is intended for the storage of 128-bit UUID (Universally\nUnique Identifier) data. See the UUID function page for more details on UUIDs\nthemselves.\n\nRetrieval\n---------\n\nData retrieved by this data type is in the string representation defined in\nRFC4122.\n\nCasting\n-------\n\nString literals of hexadecimal characters and CHAR/VARCHAR/TEXT can be cast to\nthe UUID data type. Likewise hexadecimal literals, binary-literals, and\nBINARY/VARBINARY/BLOB types can also be cast to UUID.\n\nThe data type will not accept a short UUID generated with the UUID_SHORT\nfunction, but will accept a value without the - character generated by the\nSYS_GUID function (or inserted directly). Hyphens can be partially omitted as\nwell, or included after any group of two digits.\n\nThe type does not accept UUIDs in braces, permitted by some implementations.\n\nStorage\n-------\n\nUUID are stored in an index friendly manner, the order of a UUID of\nllllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn is stored as:\n\nnnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll\n\nThis provides a sorting order, if a UUIDv1 (node and timestamp) is used, of\nthe node, followed by the timestamp.\n\nExamples\n--------\n\nCREATE TABLE t1 (id UUID);\n\nDirectly Inserting via string literals:\n\nINSERT INTO t1 VALUES(\'123e4567-e89b-12d3-a456-426655440000\');\n\nDirectly Inserting via hexadecimal literals:\n\nINSERT INTO t1 VALUES (x\'fffffffffffffffffffffffffffffffe\');\n\nGenerating and inserting via the UUID function.\n\nINSERT INTO t1 VALUES (UUID());\n\nRetrieval:\n\nSELECT * FROM t1;\n+--------------------------------------+\n| id                                   |\n+--------------------------------------+\n| 123e4567-e89b-12d3-a456-426655440000 |\n| ffffffff-ffff-ffff-ffff-fffffffffffe |\n| 93aac041-1a14-11ec-ab4e-f859713e4be4 |\n+--------------------------------------+\n\nThe UUID_SHORT function does not generate valid full-length UUID:\n\nINSERT INTO t1 VALUES (UUID_SHORT());\nERROR 1292 (22007): Incorrect uuid value: \'99440417627439104\' \n for column `test`.`t1`.`id` at row 1\n\nAccepting a value without the - character, either directly or generated by the\nSYS_GUID function:\n\nINSERT INTO t1 VALUES (SYS_GUID());\n\nSELECT * FROM t1;\n+--------------------------------------+\n| id                                   |\n+--------------------------------------+\n| 123e4567-e89b-12d3-a456-426655440000 |\n| ffffffff-ffff-ffff-ffff-fffffffffffe |\n| 93aac041-1a14-11ec-ab4e-f859713e4be4 |\n| ea0368d3-1a14-11ec-ab4e-f859713e4be4 |\n+--------------------------------------+\n\nSELECT SYS_GUID();\n+----------------------------------+\n| SYS_GUID()                       |\n+----------------------------------+\n| ff5b6bcc1a1411ecab4ef859713e4be4 |\n+----------------------------------+\n\nINSERT INTO t1 VALUES (\'ff5b6bcc1a1411ecab4ef859713e4be4\');\n\nSELECT * FROM t1;\n+--------------------------------------+\n| id                                   |\n+--------------------------------------+\n| 123e4567-e89b-12d3-a456-426655440000 |\n| ffffffff-ffff-ffff-ffff-fffffffffffe |\n| 93aac041-1a14-11ec-ab4e-f859713e4be4 |\n| ea0368d3-1a14-11ec-ab4e-f859713e4be4 |\n| ff5b6bcc-1a14-11ec-ab4e-f859713e4be4 |\n+--------------------------------------+\n\nValid and invalid hyphen and brace usage:\n\nTRUNCATE t1;\n\nINSERT INTO t1 VALUES (\'f8aa-ed66-1a1b-11ec-ab4e-f859-713e-4be4\');\n\nINSERT INTO t1 VALUES (\'1b80667f1a1c-11ecab4ef859713e4be4\');\n\nINSERT INTO t1 VALUES (\'2fd6c945-1a-1c-11ec-ab4e-f859713e4be4\');\n\nINSERT INTO t1 VALUES (\'49-c9-f9-59-1a-1c-11ec-ab4e-f859713e4be4\');\n\nINSERT INTO t1 VALUES (\'57-96-da-c1-1a-1c-11-ec-ab-4e-f8-59-71-3e-4b-e4\');\n\nINSERT INTO t1 VALUES (\'6-eb74f8f-1a1c-11ec-ab4e-f859713e4be4\');\n\nINSERT INTO t1 VALUES (\'{29bad136-1a1d-11ec-ab4e-f859713e4be4}\');\nERROR 1292 (22007): Incorrect uuid value:\n\'{29bad136-1a1d-11ec-ab4e-f859713e4be4}\' \n for column `test`.`t1`.`id` at row 1\n\nSELECT * FROM t1;\n+--------------------------------------+\n| id                                   |\n+--------------------------------------+\n| f8aaed66-1a1b-11ec-ab4e-f859713e4be4 |\n| 1b80667f-1a1c-11ec-ab4e-f859713e4be4 |\n| 2fd6c945-1a1c-11ec-ab4e-f859713e4be4 |\n| 49c9f959-1a1c-11ec-ab4e-f859713e4be4 |\n| 5796dac1-1a1c-11ec-ab4e-f859713e4be4 |\n| 6eb74f8f-1a1c-11ec-ab4e-f859713e4be4 |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/uuid-data-type/','','https://mariadb.com/kb/en/uuid-data-type/'),
(297,'Using Compound Statements Outside of Stored Programs',24,'Compound statements can also be used outside of stored programs.\n\ndelimiter |\nIF @have_innodb THEN\n CREATE TABLE IF NOT EXISTS innodb_index_stats (\n  database_name    VARCHAR(64) NOT NULL,\n  table_name       VARCHAR(64) NOT NULL,\n  index_name       VARCHAR(64) NOT NULL,\n  last_update      TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE\nCURRENT_TIMESTAMP,\n  stat_name        VARCHAR(64) NOT NULL,\n  stat_value       BIGINT UNSIGNED NOT NULL,\n  sample_size      BIGINT UNSIGNED,\n  stat_description VARCHAR(1024) NOT NULL,\n  PRIMARY KEY (database_name, table_name, index_name, stat_name)\n ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;\nEND IF|\nQuery OK, 0 rows affected, 2 warnings (0.00 sec)\n\nNote, that using compound statements this way is subject to following\nlimitations:\n\n* Only BEGIN, IF, CASE, LOOP, WHILE, REPEAT statements may start a compound\nstatement outside of stored programs.\n* BEGIN must use the BEGIN NOT ATOMIC syntax (otherwise it\'ll be confused with\nBEGIN that starts a transaction).\n* A compound statement might not start with a label.\n* A compound statement is parsed completely—note \"2 warnings\" in the above\nexample, even if the condition was false (InnoDB was, indeed, disabled), and\nthe CREATE TABLE statement was not executed, it was still parsed and the\nparser produced \"Unknown storage engine\" warning.\n\nInside a compound block first three limitations do not apply, one can use\nanything that can be used inside a stored program — including labels,\ncondition handlers, variables, and so on:\n\nBEGIN NOT ATOMIC\n  DECLARE foo CONDITION FOR 1146;\n  DECLARE x INT DEFAULT 0;\n  DECLARE CONTINUE HANDLER FOR SET x=1;\n  INSERT INTO test.t1 VALUES (\"hndlr1\", val, 2);\n  END|\n\nExample how to use IF:\n\nIF (1>0) THEN BEGIN NOT ATOMIC SELECT 1; END ; END IF;;\n\nExample of how to use WHILE loop:\n\nDELIMITER |\nBEGIN NOT ATOMIC\n  DECLARE x INT DEFAULT 0;\n  WHILE x <= 10 DO\n    SET x = x + 1;\n    SELECT x;\n  END WHILE;\nEND|\nDELIMITER ;\n\nURL:\nhttps://mariadb.com/kb/en/using-compound-statements-outside-of-stored-programs/','','https://mariadb.com/kb/en/using-compound-statements-outside-of-stored-programs/'),
(728,'DROP PACKAGE BODY',38,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE BODY [IF EXISTS]  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE BODY statement drops the package body (i.e the\nimplementation), previously created using the CREATE PACKAGE BODY statement.\n\nNote, DROP PACKAGE BODY drops only the package implementation, but does not\ndrop the package specification. Use DROP PACKAGE to drop the package entirely\n(i.e. both implementation and specification).\n\nURL: https://mariadb.com/kb/en/drop-package-body/','','https://mariadb.com/kb/en/drop-package-body/'),
(292,'TIME',23,'Syntax\n------\n\nTIME [(<microsecond precision>)]\n\nDescription\n-----------\n\nA time. The range is \'-838:59:59.999999\' to \'838:59:59.999999\'. Microsecond\nprecision can be from 0-6; if not specified 0 is used. Microseconds have been\navailable since MariaDB 5.3.\n\nMariaDB displays TIME values in \'HH:MM:SS.ssssss\' format, but allows\nassignment of times in looser formats, including \'D HH:MM:SS\', \'HH:MM:SS\',\n\'HH:MM\', \'D HH:MM\', \'D HH\', \'SS\', or \'HHMMSS\', as well as permitting dropping\nof any leading zeros when a delimiter is provided, for example \'3:9:10\'. For\ndetails, see date and time literals.\n\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store TIMEs using the same low-level format MySQL 5.6\nuses.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mariadb-dump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_time\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_time\nCreate Table: CREATE TABLE `mariadb5312_time` (\n `t0` time /* mariadb-5.3 */ DEFAULT NULL,\n `t6` time(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote, columns with the current format are not marked with a comment.\n\nExamples\n--------\n\nINSERT INTO time VALUES (\'90:00:00\'), (\'800:00:00\'), (800), (22), (151413),\n(\'9:6:3\'), (\'12 09\');\n\nSELECT * FROM time;\n+-----------+\n| t         |\n+-----------+\n| 90:00:00  |\n| 800:00:00 |\n| 00:08:00  |\n| 00:00:22  |\n| 15:14:13  |\n| 09:06:03  |\n| 297:00:00 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/time/','','https://mariadb.com/kb/en/time/'),
(298,'BEGIN END',24,'Syntax\n------\n\n[begin_label:] BEGIN [NOT ATOMIC]\n  [statement_list]\nEND [end_label]\n\nNOT ATOMIC is required when used outside of a stored procedure. Inside stored\nprocedures or within an anonymous block, BEGIN alone starts a new anonymous\nblock.\n\nDescription\n-----------\n\nBEGIN ... END syntax is used for writing compound statements. A compound\nstatement can contain multiple statements, enclosed by the BEGIN and END\nkeywords. statement_list represents a list of one or more statements, each\nterminated by a semicolon (i.e., ;) statement delimiter. statement_list is\noptional, which means that the empty compound statement (BEGIN END) is legal.\n\nNote that END will perform a commit. If you are running in autocommit mode,\nevery statement will be committed separately. If you are not running in\nautocommit mode, you must execute a COMMIT or ROLLBACK after END to get the\ndatabase up to date.\n\nUse of multiple statements requires that a client is able to send statement\nstrings containing the ; statement delimiter. This is handled in the mysql\ncommand-line client with the DELIMITER command. Changing the ;\nend-of-statement delimiter (for example, to //) allows ; to be used in a\nprogram body.\n\nA compound statement within a stored program can be labeled. end_label cannot\nbe given unless begin_label also is present. If both are present, they must be\nthe same.\n\nBEGIN ... END constructs can be nested. Each block can define its own\nvariables, a CONDITION, a HANDLER and a CURSOR, which don\'t exist in the outer\nblocks. The most local declarations override the outer objects which use the\nsame name (see example below).\n\nThe declarations order is the following:\n\n* DECLARE local variables;\n* DECLARE CONDITIONs;\n* DECLARE CURSORs;\n* DECLARE HANDLERs;\n\nNote that DECLARE HANDLER contains another BEGIN ... END construct.\n\nHere is an example of a very simple, anonymous block:\n\nBEGIN NOT ATOMIC\nSET @a=1;\nCREATE TABLE test.t1(a INT);\nEND|\n\nBelow is an example of nested blocks in a stored procedure:\n\nCREATE PROCEDURE t( )\nBEGIN\n DECLARE x TINYINT UNSIGNED DEFAULT 1;\n BEGIN\n   DECLARE x CHAR(2) DEFAULT \'02\';\n   DECLARE y TINYINT UNSIGNED DEFAULT 10;\n   SELECT x, y;\n END;\n SELECT x;\nEND;\n\nIn this example, a TINYINT variable, x is declared in the outter block. But in\nthe inner block x is re-declared as a CHAR and an y variable is declared. The\ninner SELECT shows the \"new\" value of x, and the value of y. But when x is\nselected in the outer block, the \"old\" value is returned. The final SELECT\ndoesn\'t try to read y, because it doesn\'t exist in that context.\n\nURL: https://mariadb.com/kb/en/begin-end/','','https://mariadb.com/kb/en/begin-end/'),
(731,'DROP TABLESPACE',38,'The DROP TABLESPACE statement is not supported by MariaDB. It was originally\ninherited from MySQL NDB Cluster. In MySQL 5.7 and later, the statement is\nalso supported for InnoDB. However, MariaDB has chosen not to include that\nspecific feature. See MDEV-19294 for more information.\n\nURL: https://mariadb.com/kb/en/drop-tablespace/','','https://mariadb.com/kb/en/drop-tablespace/'),
(735,'Dynamic Columns',38,'Dynamic columns allow one to store different sets of columns for each row in a\ntable. It works by storing a set of columns in a blob and having a small set\nof functions to manipulate it. Dynamic columns should be used when it is not\npossible to use regular columns. A typical use case is when one needs to store\nitems that may have many different attributes (like size, color, weight, etc),\nand the set of possible attributes is very large and/or unknown in advance. In\nthat case, attributes can be put into dynamic columns.\n\nDynamic Columns Basics\n----------------------\n\nThe table should have a blob column which will be used as storage for dynamic\ncolumns:\n\ncreate table assets (\n item_name varchar(32) primary key, -- A common attribute for all items\n dynamic_cols  blob  -- Dynamic columns will be stored here\n);\n\nOnce created, one can access dynamic columns via dynamic column functions:\n\nInsert a row with two dynamic columns: color=blue, size=XL\n\nINSERT INTO assets VALUES \n (\'MariaDB T-shirt\', COLUMN_CREATE(\'color\', \'blue\', \'size\', \'XL\'));\n\nInsert another row with dynamic columns: color=black, price=500\n\nINSERT INTO assets VALUES\n (\'Thinkpad Laptop\', COLUMN_CREATE(\'color\', \'black\', \'price\', 500));\n\nSelect dynamic column \'color\' for all items:\n\nSELECT item_name, COLUMN_GET(dynamic_cols, \'color\' as char) \n AS color FROM assets;\n+-----------------+-------+\n| item_name       | color |\n+-----------------+-------+\n| MariaDB T-shirt | blue  |\n| Thinkpad Laptop | black |\n+-----------------+-------+\n\nIt is possible to add and remove dynamic columns from a row:\n\n-- Remove a column:\nUPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, \"price\") \nWHERE COLUMN_GET(dynamic_cols, \'color\' as char)=\'black\';\n\n-- Add a column:\nUPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, \'warranty\', \'3 years\')\nWHERE item_name=\'Thinkpad Laptop\';\n\nYou can also list all columns, or get them together with their values in JSON\nformat:\n\nSELECT item_name, column_list(dynamic_cols) FROM assets;\n+-----------------+---------------------------+\n| item_name       | column_list(dynamic_cols) |\n+-----------------+---------------------------+\n| MariaDB T-shirt | `size`,`color`            |\n| Thinkpad Laptop | `color`,`warranty`        |\n+-----------------+---------------------------+\n\nSELECT item_name, COLUMN_JSON(dynamic_cols) FROM assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nDynamic Columns Reference\n-------------------------\n\nThe rest of this page is a complete reference of dynamic columns in MariaDB\n\nDynamic Columns Functions\n-------------------------\n\nCOLUMN_CREATE\n-------------\n\nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value \n [as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name, value \n [as type]]...);\n\nReturn a dynamic columns blob that stores the specified columns with values.\n\nThe return value is suitable for\n\n* \nstoring in a table\nfurther modification with other dynamic columns functions\n\nThe as type part allows one to specify the value type. In most cases, this is\nredundant because MariaDB will be able to deduce the type of the value.\nExplicit type specification may be needed when the type of the value is not\napparent. For example, a literal \'2012-12-01\' has a CHAR type by default, one\nwill need to specify \'2012-12-01\' AS DATE to have it stored as a date. See the\nDatatypes section for further details. Note also MDEV-597.\n\nTypical usage:\n\n-- MariaDB 5.3+:\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(1 /*column id*/, \"value\");\n-- MariaDB 10.0.1+:\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(\"column_name\", \"value\");\n\nCOLUMN_ADD\n----------\n\nCOLUMN_ADD(dyncol_blob, column_nr, value [as type], \n [column_nr, value [as type]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type], \n [column_name, value [as type]]...);\n\nAdds or updates dynamic columns.\n\n* \ndyncol_blob must be either a valid dynamic columns blob (for example,\nCOLUMN_CREATE returns such blob), or an empty string.\ncolumn_name specifies the name of the column to be added. If dyncol_blob\nalready has a column with this name, it will be overwritten.\nvalue specifies the new value for the column.  Passing a NULL value will cause\nthe column to be deleted.\nas type is optional. See #datatypes section for a discussion about types.\n\nThe return value is a dynamic column blob after the modifications.\n\nTypical usage:\n\n-- MariaDB 5.3+:\nUPDATE tbl SET dyncol_blob=COLUMN_ADD(dyncol_blob, 1 /*column id*/, \"value\") \n WHERE id=1;\n-- MariaDB 10.0.1+:\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, \"column_name\", \"value\") \n WHERE id=1;\n\nNote: COLUMN_ADD() is a regular function (just like CONCAT()), hence, in order\nto update the value in the table you have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col, ....) pattern.\n\nCOLUMN_GET\n----------\n\nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n\nGet the value of a dynamic column by its name. If no column with the given\nname exists, NULL will be returned.\n\ncolumn_name as type requires that one specify the datatype of the dynamic\ncolumn they are reading.\n\nThis may seem counter-intuitive: why would one need to specify which datatype\nthey\'re retrieving? Can\'t the dynamic columns system figure the datatype from\nthe data being stored?\n\nThe answer is: SQL is a statically-typed language. The SQL interpreter needs\nto know the datatypes of all expressions before the query is run (for example,\nwhen one is using prepared statements and runs \"select COLUMN_GET(...)\", the\nprepared statement API requires the server to inform the client about the\ndatatype of the column being read before the query is executed and the server\ncan see what datatype the column actually has).\n\nSee the Datatypes section for more information about datatypes.\n\nCOLUMN_DELETE\n-------------\n\nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n\nDelete a dynamic column with the specified name. Multiple names can be given.\n\nThe return value is a dynamic column blob after the modification.\n\nCOLUMN_EXISTS\n-------------\n\nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n\nCheck if a column with name column_name exists in dyncol_blob. If yes, return\n1, otherwise return 0.\n\nCOLUMN_LIST\n-----------\n\nCOLUMN_LIST(dyncol_blob);\n\nReturn a comma-separated list of column names. The names are quoted with\nbackticks.\n\nSELECT column_list(column_create(\'col1\',\'val1\',\'col2\',\'val2\'));\n+---------------------------------------------------------+\n| column_list(column_create(\'col1\',\'val1\',\'col2\',\'val2\')) |\n+---------------------------------------------------------+\n| `col1`,`col2`                                           |\n+---------------------------------------------------------+\n\nCOLUMN_CHECK\n------------\n\nCOLUMN_CHECK(dyncol_blob);\n\nCheck if dyncol_blob is a valid packed dynamic columns blob. Return value of 1\nmeans the blob is valid, return value of 0 means it is not.\n\nRationale: Normally, one works with valid dynamic column blobs. Functions like\nCOLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE always return valid dynamic column\nblobs. However, if a dynamic column blob is accidentally truncated, or\ntranscoded from one character set to another, it will be corrupted. This\nfunction can be used to check if a value in a blob field is a valid dynamic\ncolumn blob.\n\nNote: It is possible that a truncation cut a Dynamic Column \"clearly\" so that\nCOLUMN_CHECK will not notice the corruption, but in any case of truncation a\nwarning is issued during value storing.\n\nCOLUMN_JSON\n-----------\n\nCOLUMN_JSON(dyncol_blob);\n\nReturn a JSON representation of data in dyncol_blob.\n\nExample:\n\nSELECT item_name, COLUMN_JSON(dynamic_cols) FROM assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nLimitation: COLUMN_JSON will decode nested dynamic columns at a nesting level\nof not more than 10 levels deep. Dynamic columns that are nested deeper than\n10 levels will be shown as BINARY string, without encoding.\n\nNesting Dynamic Columns\n-----------------------\n\nIt is possible to use nested dynamic columns by putting one dynamic column\nblob inside another. The COLUMN_JSON function will display nested columns.\n\nSET @tmp= column_create(\'parent_column\', \n column_create(\'child_column\', 12345));\nQuery OK, 0 rows affected (0.00 sec)\n\nSELECT column_json(@tmp);\n+------------------------------------------+\n| column_json(@tmp)                        |\n+------------------------------------------+\n| {\"parent_column\":{\"child_column\":12345}} |\n+------------------------------------------+\n\nSELECT column_get(column_get(@tmp, \'parent_column\' AS char), \n \'child_column\' AS int);\n+------------------------------------------------------------------------------\n\n| column_get(column_get(@tmp, \'parent_column\' as char), \'child_column\' as int)\n|\n+------------------------------------------------------------------------------\n\n|                                                                        12345\n|\n+------------------------------------------------------------------------------\n\nIf you are trying to get a nested dynamic column as a string use \'as BINARY\'\nas the last argument of COLUMN_GET (otherwise problems with character set\nconversion and illegal symbols are possible):\n\nselect column_json( column_get(\n column_create(\'test1\',\n  column_create(\'key1\',\'value1\',\'key2\',\'value2\',\'key3\',\'value3\')),\n \'test1\' as BINARY));\n\nDatatypes\n---------\n\nIn SQL, one needs to define the type of each column in a table. Dynamic\ncolumns do not provide any way to declare a type in advance (\"whenever there\nis a column \'weight\', it should be integer\" is not possible). However, each\nparticular dynamic column value is stored together with its datatype.\n\nThe set of possible datatypes is mostly the same as that used by the SQL CAST\nand CONVERT functions. However, note that there are currently some differences\n- see MDEV-597.\n\n+--------+----------------------------------------------+-------------------+\n| type   | dynamic column internal type                 | description       |\n+--------+----------------------------------------------+-------------------+\n| BINARY | DYN_COL_STRING                               | (variable length  |\n| (N)]   |                                              | string with       |\n|        |                                              | binary charset)   |\n+--------+----------------------------------------------+-------------------+\n| CHAR[( | DYN_COL_STRING                               | (variable length  |\n| )]     |                                              | string with       |\n|        |                                              | charset)          |\n+--------+----------------------------------------------+-------------------+\n| DATE   | DYN_COL_DATE                                 | (date - 3 bytes)  |\n+--------+----------------------------------------------+-------------------+\n| DATETI | DYN_COL_DATETIME                             | (date and time    |\n| E[(D)] |                                              | (with             |\n|        |                                              | microseconds) -   |\n|        |                                              | 9 bytes)          |\n+--------+----------------------------------------------+-------------------+\n| DECIMA | DYN_COL_DECIMAL                              | (variable length  |\n| [(M[,D |                                              | binary decimal    |\n| )]     |                                              | representation    |\n|        |                                              | with MariaDB      |\n|        |                                              | limitation)       |\n+--------+----------------------------------------------+-------------------+\n| DOUBLE | DYN_COL_DOUBLE                               | (64 bit           |\n| (M,D)] |                                              | double-precision  |\n|        |                                              | floating point)   |\n+--------+----------------------------------------------+-------------------+\n| INTEGE | DYN_COL_INT                                  | (variable         |\n|        |                                              | length, up to 64  |\n|        |                                              | bit signed        |\n|        |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n| SIGNED | DYN_COL_INT                                  | (variable         |\n| [INTEG |                                              | length, up to 64  |\n| R]     |                                              | bit signed        |\n|        |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n| TIME[( | DYN_COL_TIME                                 | (time (with       |\n| )]     |                                              | microseconds,     |\n|        |                                              | may be negative)  |\n|        |                                              | - 6 bytes)        |\n+--------+----------------------------------------------+-------------------+\n| UNSIGN | DYN_COL_UINT                                 | (variable         |\n| D      |                                              | length, up to     |\n| [INTEG |                                              | 64bit unsigned    |\n| R]     |                                              | integer)          |\n+--------+----------------------------------------------+-------------------+\n\nA Note About Lengths\n--------------------\n\nIf you\'re running queries like\n\nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n\nwithout specifying a maximum length (i.e. using #as CHAR#, not as CHAR(n)),\nMariaDB will report the maximum length of the resultset column to be\n53,6870,911 (bytes or characters?) for MariaDB 5.3-10.0.0 and 16,777,216 for\nMariaDB 10.0.1+. This may cause excessive memory usage in some client\nlibraries, because they try to pre-allocate a buffer of maximum resultset\nwidth. If you suspect you\'re hitting this problem, use CHAR(n) whenever you\'re\nusing COLUMN_GET in the select list.\n\nMariaDB 5.3 vs MariaDB 10.0\n---------------------------\n\nThe dynamic columns feature was introduced into MariaDB in two steps:\n\n* MariaDB 5.3 was the first version to support dynamic columns. Only numbers\n could be used as column names in this version.\n* In MariaDB 10.0.1, column names can be either numbers or strings.\n Also, the COLUMN_JSON and COLUMN_CHECK functions were added.\n\nSee also Dynamic Columns in MariaDB 10.\n\nClient-side API\n---------------\n\nIt is also possible to create or parse dynamic columns blobs on the client\nside. libmysql client library now includes an API for writing/reading dynamic\ncolumn blobs. See dynamic-columns-api for details.\n\nLimitations\n-----------\n\n+---------------------------------------------------+------------------------+\n| Description                                       | Limit                  |\n+---------------------------------------------------+------------------------+\n| Max number of columns                             | 65535                  |\n+---------------------------------------------------+------------------------+\n| Max total length of packed dynamic column         | max_allowed_packet     |\n|                                                   | (1G)                   |\n+---------------------------------------------------+------------------------+\n\nURL: https://mariadb.com/kb/en/dynamic-columns/','','https://mariadb.com/kb/en/dynamic-columns/'),
(738,'Sequence Overview',39,'This page is about sequence objects. For details about the storage engine, see\nSequence Storage Engine.\n\nIntroduction\n------------\n\nA sequence is an object that generates a sequence of numeric values, as\nspecified by the CREATE SEQUENCE statement.\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to the CACHE value in the CREATE SEQUENCE\nstatement, by default 1000) it can in some cases be much faster than AUTO\nINCREMENT. Another benefit is that one can access the last value generated by\nall used sequences, which solves one of the limitations with LAST_INSERT_ID().\n\nCreating a Sequence\n-------------------\n\nThe CREATE SEQUENCE statement is used to create a sequence. Here is an example\nof a sequence starting at 100, incrementing by 10 each time:\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nThe CREATE SEQUENCE statement, along with defaults, can be viewd with the SHOW\nCREATE SEQUENCE STATEMENT, for example:\n\nSHOW CREATE SEQUENCE s\\G\n*************************** 1. row ***************************\n   Table: s\nCreate Table: CREATE SEQUENCE `s` start with 100 minvalue 1 maxvalue\n9223372036854775806 \n increment by 10 cache 1000 nocycle ENGINE=InnoDB\n\nUsing Sequence Objects\n----------------------\n\nTo get the next value from a sequence, use\n\nNEXT VALUE FOR sequence_name\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nFor retrieving the last value used by the current connection from a sequence\nuse:\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nFor example:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        100 |\n+------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nSELECT LASTVAL(s);\n+------------+\n| LASTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nUsing Sequences in DEFAULT\n--------------------------\n\nSequences can be used in DEFAULT:\n\ncreate sequence s1;\ncreate table t1 (a int primary key default (next value for s1), b int);\ninsert into t1 (b) values (1),(2);\nselect * from t1;\n+---+------+\n| a | b    |\n+---+------+\n| 1 |    1 |\n| 2 |    2 |\n+---+------+\n\nChanging a Sequence\n-------------------\n\nThe ALTER SEQUENCE statement is used for changing sequences. For example, to\nrestart the sequence at another value:\n\nALTER SEQUENCE s RESTART 50;\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|         50 |\n+------------+\n\nThe SETVAL function can also be used to set the next value to be returned for\na SEQUENCE, for example:\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n|            100 |\n+----------------+\n\nSETVAL can only be used to increase the sequence value. Attempting to set a\nlower value will fail, returning NULL:\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n|          NULL |\n+---------------+\n\nDropping a Sequence\n-------------------\n\nThe DROP SEQUENCE statement is used to drop a sequence, for example:\n\nDROP SEQUENCE s;\n\nReplication\n-----------\n\nIf one wants to use Sequences in a master-master setup or with Galera one\nshould use INCREMENT=0. This will tell the Sequence to use\nauto_increment_increment and auto_increment_offset to generate unique values\nfor each server.\n\nStandards Compliance\n--------------------\n\nMariaDB supports both ANSI SQL and Oracle syntax for sequences.\n\nHowever as SEQUENCE is implemented as a special kind of table, it uses the\nsame namespace as tables. The benefits are that sequences show up in SHOW\nTABLES, and one can also create a sequence with CREATE TABLE and drop it with\nDROP TABLE. One can SELECT from it as from any other table. This ensures that\nall old tools that work with tables should work with sequences.\n\nSince sequence objects act as regular tables in many contexts, they will be\naffected by LOCK TABLES. This is not the case in other DBMS, such as Oracle,\nwhere LOCK TABLE does not affect sequences.\n\nNotes\n-----\n\nOne of the goals with the Sequence implementation is that all old tools, such\nas mariadb-dump (previously mysqldump), should work unchanged, while still\nkeeping the normal usage of sequence standard compatibly.\n\nTo make this possible, sequence is currently implemented as a table with a few\nexclusive properties.\n\nThe special properties for sequence tables are:\n\n* A sequence table has always one row.\n* When one creates a sequence, either with CREATE TABLE or CREATE SEQUENCE,\none row will be inserted.\n* If one tries to insert into a sequence table, the single row will be\nupdated.  This allows mariadb-dump to work but also gives the additional\nbenefit that one can change all properties of a sequence with a single insert.\nNew applications should of course also use ALTER SEQUENCE.\n* UPDATE or DELETE can\'t be performed on Sequence objects.\n* Doing a select on the sequence shows the current state of the sequence,\nexcept the values that are reserved in the cache.  The next_value column shows\nthe next value not reserved by the cache.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the Sequence object. In effect, this\nwill discard the cached values.\n* A number of normal table operations work on Sequence tables. See next\nsection.\n\nTable Operations that Work with Sequences\n-----------------------------------------\n\n* SHOW CREATE TABLE sequence_name. This shows the table structure that is\nbehind the SEQUENCE including the field names that can be used with SELECT or\neven CREATE TABLE.\n* CREATE TABLE sequence-structure ... SEQUENCE=1\n* ALTER TABLE sequence RENAME TO sequence2\n* RENAME TABLE sequence_name TO new_sequence_name\n* DROP TABLE sequence_name. This is allowed mainly to get old tools like\nmariadb-dump to work with sequence tables.\n* SHOW TABLES\n\nImplementation\n--------------\n\nInternally, sequence tables are created as a normal table without rollback\n(the InnoDB, Aria and MySAM engines support this), wrapped by a sequence\nengine object. This allowed us to create sequences with almost no performance\nimpact for normal tables. (The cost is one \'if\' per insert if the binary log\nis enabled).\n\nUnderlying Table Structure\n--------------------------\n\nThe following example shows the table structure of sequences and how it can be\nused as a table. (Output of results are slightly edited to make them easier to\nread)\n\ncreate sequence t1;\nshow create sequence t1\\G\n*************************** 1. row ***************************\n CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806\n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nshow create table t1\\G\n*************************** 1. row ***************************\nCreate Table: CREATE TABLE `t1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, 1 if the sequence should begin a new cycle when maximum_value is\npassed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nselect * from t1\\G\nnext_not_cached_value: 1\n minimum_value: 1\n maximum_value: 9223372036854775806\n start_value: 1\n increment: 1\n cache_size: 1000\n cycle_option: 0\n cycle_count: 0\n\nThe cycle_count column is incremented every time the sequence wraps around.\n\nCredits\n-------\n\n* Thanks to Jianwe Zhao from Aliyun for his work on SEQUENCE in AliSQL, which\ngave ideas and inspiration for this work.\n* Thanks to Peter Gulutzan,who helped test and gave useful comments about the\nimplementation.\n\nURL: https://mariadb.com/kb/en/sequence-overview/','','https://mariadb.com/kb/en/sequence-overview/'),
(748,'JSON_ARRAY',40,'Syntax\n------\n\nJSON_ARRAY([value[, value2] ...])\n\nDescription\n-----------\n\nReturns a JSON array containing the listed values. The list can be empty.\n\nExample\n-------\n\nSELECT Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL);\n+--------------------------------------------------+\n| Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL) |\n+--------------------------------------------------+\n| [56, 3.1416, \"My name is \\\"Foo\\\"\", null]         |\n+--------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array/','','https://mariadb.com/kb/en/json_array/'),
(751,'JSON_COMPACT',40,'Syntax\n------\n\nJSON_COMPACT(json_doc)\n\nDescription\n-----------\n\nRemoves all unnecessary spaces so the json document is as short as possible.\n\nExample\n-------\n\nSET @j = \'{ \"A\": 1, \"B\": [2, 3]}\';\n\nSELECT JSON_COMPACT(@j), @j;\n+-------------------+------------------------+\n| JSON_COMPACT(@j)  | @j                     |\n+-------------------+------------------------+\n| {\"A\":1,\"B\":[2,3]} | { \"A\": 1, \"B\": [2, 3]} |\n+-------------------+------------------------+\n\nURL: https://mariadb.com/kb/en/json_compact/','','https://mariadb.com/kb/en/json_compact/'),
(293,'DATETIME',23,'Syntax\n------\n\nDATETIME [(microsecond precision)]\n\nDescription\n-----------\n\nA date and time combination.\n\nMariaDB displays DATETIME values in \'YYYY-MM-DD HH:MM:SS.ffffff\' format, but\nallows assignment of values to DATETIME columns using either strings or\nnumbers. For details, see date and time literals.\n\nDATETIME columns also accept CURRENT_TIMESTAMP as the default value.\n\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store DATETMEs using the same low-level format MySQL\n5.6 uses. For more information, see Internal Format, below.\n\nFor storage requirements, see Data Type Storage Requirements.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the DATETIME data type in a format that\nsupports values between 1000-01-01 00:00:00.000000 and 9999-12-31\n23:59:59.999999.\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nMariaDB also supports \'0000-00-00\' as a special zero-date value, unless\nNO_ZERO_DATE is specified in the SQL_MODE. Similarly, individual components of\na date can be set to 0 (for example: \'2015-00-12\'), unless NO_ZERO_IN_DATE is\nspecified in the SQL_MODE. In many cases, the result of en expression\ninvolving a zero-date, or a date with zero-parts, is NULL. If the\nALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is in the range\nbetween 1 and 31, the date does not produce any error, even for months that\nhave less than 31 days.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a DATETIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name           | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON    |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col DATETIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_datetime\\G\n*************************** 1. row ***************************\n   Table: mariadb5312_datetime\nCreate Table: CREATE TABLE `mariadb5312_datetime` (\n `dt0` datetime /* mariadb-5.3 */ DEFAULT NULL,\n `dt6` datetime(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\n\nINSERT INTO t1 VALUES (\"2011-03-11\"), (\"2012-04-19 13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-03-11 00:00:00 |\n| 2012-04-19 13:08:22 |\n| 2013-07-18 13:44:22 |\n+---------------------+\n\nCREATE TABLE t2 (d DATETIME(6));\n\nINSERT INTO t2 VALUES (\"2011-03-11\"), (\"2012-04-19 13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n\nSELECT * FROM t2;\n+----------------------------+\n| d                          |\n+----------------------------+\n| 2011-03-11 00:00:00.000000 |\n| 2012-04-19 13:08:22.000000 |\n| 2013-07-18 13:44:22.123456 |\n+----------------------------++\n\nStrings used in datetime context are automatically converted to datetime(6).\nIf you want to have a datetime without seconds, you should use\nCONVERT(..,datetime).\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime);\n+-----------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime) |\n+-----------------------------------------+\n| 2007-11-30 10:30:19                     |\n+-----------------------------------------+\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime(6));\n+--------------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime(6)) |\n+--------------------------------------------+\n| 2007-11-30 10:30:19.000000                 |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/datetime/','','https://mariadb.com/kb/en/datetime/'),
(762,'JSON_LOOSE',40,'Syntax\n------\n\nJSON_LOOSE(json_doc)\n\nDescription\n-----------\n\nAdds spaces to a JSON document to make it look more readable.\n\nExample\n-------\n\nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n\nSELECT JSON_LOOSE(@j), @j;\n+-----------------------+--------------------+\n| JSON_LOOSE(@j)        | @j                 |\n+-----------------------+--------------------+\n| {\"A\": 1, \"B\": [2, 3]} | { \"A\":1,\"B\":[2,3]} |\n+-----------------------+--------------------+\n\nURL: https://mariadb.com/kb/en/json_loose/','','https://mariadb.com/kb/en/json_loose/'),
(763,'JSON_MERGE',40,'Syntax\n------\n\nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents.\n\nReturns the merged result,or NULL if any argument is NULL.\n\nAn error occurs if any of the arguments are not valid JSON documents.\n\nJSON_MERGE has been deprecated since MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5. JSON_MERGE_PATCH is an RFC 7396-compliant replacement, and\nJSON_MERGE_PRESERVE is a synonym.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[3, 4]\';\n\nSELECT JSON_MERGE(@json1,@json2);\n+---------------------------+\n| JSON_MERGE(@json1,@json2) |\n+---------------------------+\n| [1, 2, 3, 4]              |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge/','','https://mariadb.com/kb/en/json_merge/'),
(767,'JSON_OBJECT',40,'Syntax\n------\n\nJSON_OBJECT([key, value[, key, value] ...])\n\nDescription\n-----------\n\nReturns a JSON object containing the given key/value pairs. The key/value list\ncan be empty.\n\nAn error will occur if there are an odd number of arguments, or any key name\nis NULL.\n\nExample\n-------\n\nSELECT JSON_OBJECT(\"id\", 1, \"name\", \"Monty\");\n+---------------------------------------+\n| JSON_OBJECT(\"id\", 1, \"name\", \"Monty\") |\n+---------------------------------------+\n| {\"id\": 1, \"name\": \"Monty\"}            |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_object/','','https://mariadb.com/kb/en/json_object/'),
(296,'AUTO_INCREMENT',23,'Description\n-----------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. When you insert a new record to the table (or upon adding an\nAUTO_INCREMENT attribute with the ALTER TABLE statement), and the\nauto_increment field is NULL or DEFAULT (in the case of an INSERT), the value\nwill automatically be incremented. This also applies to 0, unless the\nNO_AUTO_VALUE_ON_ZERO SQL_MODE is enabled.\n\nAUTO_INCREMENT columns start from 1 by default. The automatically generated\nvalue can never be lower than 0.\n\nEach table can have only one AUTO_INCREMENT column. It must defined as a key\n(not necessarily the PRIMARY KEY or UNIQUE key). In some storage engines\n(including the default InnoDB), if the key consists of multiple columns, the\nAUTO_INCREMENT column must be the first column. Storage engines that permit\nthe column to be placed elsewhere are Aria, MyISAM, MERGE, Spider, TokuDB,\nBLACKHOLE, FederatedX and Federated.\n\nCREATE TABLE animals (\n  id MEDIUMINT NOT NULL AUTO_INCREMENT,\n  name CHAR(30) NOT NULL,\n  PRIMARY KEY (id)\n );\n\nINSERT INTO animals (name) VALUES\n  (\'dog\'),(\'cat\'),(\'penguin\'),\n  (\'fox\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n+----+---------+\n| id | name    |\n+----+---------+\n|  1 | dog     |\n|  2 | cat     |\n|  3 | penguin |\n|  4 | fox     |\n|  5 | whale   |\n|  6 | ostrich |\n+----+---------+\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nCREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB;\n\nSHOW CREATE TABLE t \\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `c` char(1) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSetting or Changing the Auto_Increment Value\n--------------------------------------------\n\nYou can use an ALTER TABLE statement to assign a new value to the\nauto_increment table option, or set the insert_id server system variable to\nchange the next AUTO_INCREMENT value inserted by the current session.\n\nLAST_INSERT_ID() can be used to see the last AUTO_INCREMENT value inserted by\nthe current session.\n\nALTER TABLE animals AUTO_INCREMENT=8;\n\nINSERT INTO animals (name) VALUES (\'aardvark\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n+----+-----------+\n\nSET insert_id=12;\n\nINSERT INTO animals (name) VALUES (\'gorilla\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name      |\n+----+-----------+\n|  1 | dog       |\n|  2 | cat       |\n|  3 | penguin   |\n|  4 | fox       |\n|  5 | whale     |\n|  6 | ostrich   |\n|  8 | aardvark  |\n| 12 | gorilla   |\n+----+-----------+\n\nInnoDB\n------\n\nUntil MariaDB 10.2.3, InnoDB used an auto-increment counter that is stored in\nmemory. When the server restarts, the counter is re-initialized to the highest\nvalue used in the table, which cancels the effects of any AUTO_INCREMENT = N\noption in the table statements.\n\nFrom MariaDB 10.2.4, this restriction has been lifted and AUTO_INCREMENT is\npersistent.\n\nSee also AUTO_INCREMENT Handling in InnoDB.\n\nSetting Explicit Values\n-----------------------\n\nIt is possible to specify a value for an AUTO_INCREMENT column. If the key is\nprimary or unique, the value must not already exist in the key.\n\nIf the new value is higher than the current maximum value, the AUTO_INCREMENT\nvalue is updated, so the next value will be higher. If the new value is lower\nthan the current maximum value, the AUTO_INCREMENT value remains unchanged.\n\nThe following example demonstrates these behaviors:\n\nCREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE =\nInnoDB;\n\nINSERT INTO t VALUES (NULL);\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n+----+\n\nINSERT INTO t VALUES (10); -- higher value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n| 10 |\n+----+\n\nINSERT INTO t VALUES (2); -- lower value\nINSERT INTO t VALUES (NULL); -- auto value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n|  1 |\n|  2 |\n| 10 |\n| 11 |\n+----+\n\nThe ARCHIVE storage engine does not allow to insert a value that is lower than\nthe current maximum.\n\nMissing Values\n--------------\n\nAn AUTO_INCREMENT column normally has missing values. This happens because if\na row is deleted, or an AUTO_INCREMENT value is explicitly updated, old values\nare never re-used. The REPLACE statement also deletes a row, and its value is\nwasted. With InnoDB, values can be reserved by a transaction; but if the\ntransaction fails (for example, because of a ROLLBACK) the reserved value will\nbe lost.\n\nThus AUTO_INCREMENT values can be used to sort results in a chronological\norder, but not to create a numeric sequence.\n\nReplication\n-----------\n\nTo make master-master or Galera safe to use AUTO_INCREMENT one should use the\nsystem variables auto_increment_increment and auto_increment_offset to\ngenerate unique values for each server.\n\nCHECK Constraints, DEFAULT Values and Virtual Columns\n-----------------------------------------------------\n\nMariaDB starting with 10.2.6\n----------------------------\nFrom MariaDB 10.2.6 auto_increment columns are no longer permitted in CHECK\nconstraints, DEFAULT value expressions and virtual columns. They were\npermitted in earlier versions, but did not work correctly. See MDEV-11117.\n\nGenerating Auto_Increment Values When Adding the Attribute\n----------------------------------------------------------\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (0),(0),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 1 |\n| 2 |\n| 3 |\n+---+\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (5),(0),(8),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 5 |\n| 6 |\n| 8 |\n| 9 |\n+---+\n\nIf the NO_AUTO_VALUE_ON_ZERO SQL_MODE is set, zero values will not be\nautomatically incremented:\n\nSET SQL_MODE=\'no_auto_value_on_zero\';\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (3), (0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 0 |\n| 3 |\n+---+\n\nURL: https://mariadb.com/kb/en/auto_increment/','','https://mariadb.com/kb/en/auto_increment/'),
(769,'JSON_PRETTY',40,'JSON_PRETTY was added as an alias for JSON_DETAILED in MariaDB 10.10.3,\nMariaDB 10.9.5, MariaDB 10.8.7, MariaDB 10.7.8, MariaDB 10.6.12, MariaDB\n10.5.19 and MariaDB 10.4.28.\n\nURL: https://mariadb.com/kb/en/json_pretty/','','https://mariadb.com/kb/en/json_pretty/'),
(776,'JSON_SET',40,'Syntax\n------\n\nJSON_SET(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nUpdates or inserts data into a JSON document, returning the result, or NULL if\nany of the arguments are NULL or the optional path fails to find an object.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or wildcard.\n\nJSON_SET can update or insert data, while JSON_REPLACE can only update, and\nJSON_INSERT only insert.\n\nExamples\n--------\n\nSELECT JSON_SET(Priv, \'$.locked\', \'true\') FROM mysql.global_priv\n\nURL: https://mariadb.com/kb/en/json_set/','','https://mariadb.com/kb/en/json_set/'),
(782,'Window Functions Overview',41,'Introduction\n------------\n\nWindow functions allow calculations to be performed across a set of rows\nrelated to the current row.\n\nSyntax\n------\n\nfunction (expression) OVER (\n [ PARTITION BY expression_list ]\n [ ORDER BY order_list [ frame_clause ] ] )\n\nfunction:\n A valid window function\n\nexpression_list:\n expression | column_name [, expr_list ]\n\norder_list:\n expression | column_name [ ASC | DESC ]\n [, ... ]\n\nframe_clause:\n {ROWS | RANGE} {frame_border | BETWEEN frame_border AND frame_border}\n\nframe_border:\n | UNBOUNDED PRECEDING\n | UNBOUNDED FOLLOWING\n | CURRENT ROW\n | expr PRECEDING\n | expr FOLLOWING\n\nDescription\n-----------\n\nIn some ways, window functions are similar to aggregate functions in that they\nperform calculations across a set of rows. However, unlike aggregate\nfunctions, the output is not grouped into a single row.\n\nNon-aggregate window functions include\n\n* CUME_DIST\n* DENSE_RANK\n* FIRST_VALUE\n* LAG\n* LAST_VALUE\n* LEAD\n* MEDIAN\n* NTH_VALUE\n* NTILE\n* PERCENT_RANK\n* PERCENTILE_CONT\n* PERCENTILE_DISC\n* RANK, ROW_NUMBER\n\nAggregate functions that can also be used as window functions include\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* MAX\n* MIN\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nWindow function queries are characterised by the OVER keyword, following which\nthe set of rows used for the calculation is specified. By default, the set of\nrows used for the calculation (the \"window) is the entire dataset, which can\nbe ordered with the ORDER BY clause. The PARTITION BY clause is used to reduce\nthe window to a particular group within the dataset.\n\nFor example, given the following data:\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nthe following two queries return the average partitioned by test and by name\nrespectively:\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY test) \n AS average_by_test FROM student;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         65.2500 |\n| Chun    | Tuning |    73 |         68.7500 |\n| Esben   | SQL    |    43 |         65.2500 |\n| Esben   | Tuning |    31 |         68.7500 |\n| Kaolin  | SQL    |    56 |         65.2500 |\n| Kaolin  | Tuning |    88 |         68.7500 |\n| Tatiana | SQL    |    87 |         65.2500 |\n| Tatiana | Tuning |    83 |         68.7500 |\n+---------+--------+-------+-----------------+\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY name) \n AS average_by_name FROM student;\n+---------+--------+-------+-----------------+\n| name    | test   | score | average_by_name |\n+---------+--------+-------+-----------------+\n| Chun    | SQL    |    75 |         74.0000 |\n| Chun    | Tuning |    73 |         74.0000 |\n| Esben   | SQL    |    43 |         37.0000 |\n| Esben   | Tuning |    31 |         37.0000 |\n| Kaolin  | SQL    |    56 |         72.0000 |\n| Kaolin  | Tuning |    88 |         72.0000 |\n| Tatiana | SQL    |    87 |         85.0000 |\n| Tatiana | Tuning |    83 |         85.0000 |\n+---------+--------+-------+-----------------+\n\nIt is also possible to specify which rows to include for the window function\n(for example, the current row and all preceding rows). See Window Frames for\nmore details.\n\nScope\n-----\n\nWindow functions were introduced in SQL:2003, and their definition was\nexpanded in subsequent versions of the standard. The last expansion was in the\nlatest version of the standard, SQL:2011.\n\nMost database products support a subset of the standard, they implement some\nfunctions defined as late as in SQL:2011, and at the same time leave some\nparts of SQL:2008 unimplemented.\n\nMariaDB:\n\n* Supports ROWS and RANGE-type frames\nAll kinds of frame bounds are supported, including RANGE PRECEDING|FOLLOWING n\nframe bounds (unlike PostgreSQL or MS SQL Server)\nDoes not yet support DATE[TIME] datatype and arithmetic for RANGE-type frames\n(MDEV-9727)\n\n* Does not support GROUPS-type frames (it seems that no popular database\nsupports it, either)\n\n* Does not support frame exclusion (no other database seems to support it,\neither) (MDEV-9724)\n* Does not support explicit NULLS FIRST or NULLS LAST.\n* Does not support nested navigation in window functions (this is\nVALUE_OF(expr AT row_marker [, default_value) syntax)\n\n* The following window functions are supported:\n\"Streamable\" window functions: ROW_NUMBER, RANK, DENSE_RANK, \nWindow functions that can be streamed once the number of rows in partition is\nknown: PERCENT_RANK, CUME_DIST, NTILE\n\n* Aggregate functions that are currently supported as window functions are:\nCOUNT, SUM, AVG, BIT_OR, BIT_AND, BIT_XOR.\n* Aggregate functions with the DISTINCT specifier (e.g. COUNT( DISTINCT x))\nare not supported as window functions.\n\nLinks\n-----\n\n* MDEV-6115 is the main jira task for window functions development. Other\ntasks are are attached as sub-tasks\n* bb-10.2-mdev9543 is the feature tree for window functions. Development is\nongoing, and this tree has the newest changes.\n* Testcases are in mysql-test/t/win*.test\n\nExamples\n--------\n\nGiven the following sample data:\n\nCREATE TABLE users (\n email VARCHAR(30),\n first_name VARCHAR(30),\n last_name VARCHAR(30),\n account_type VARCHAR(30)\n);\n\nINSERT INTO users VALUES \n (\'admin@boss.org\', \'Admin\', \'Boss\', \'admin\'),\n (\'bob.carlsen@foo.bar\', \'Bob\', \'Carlsen\', \'regular\'),\n (\'eddie.stevens@data.org\', \'Eddie\', \'Stevens\', \'regular\'),\n (\'john.smith@xyz.org\', \'John\', \'Smith\', \'regular\'),\n (\'root@boss.org\', \'Root\', \'Chief\', \'admin\')\n\nFirst, let\'s order the records by email alphabetically, giving each an\nascending rnum value starting with 1. This will make use of the ROW_NUMBER\nwindow function:\n\nSELECT row_number() OVER (ORDER BY email) AS rnum,\n  email, first_name, last_name, account_type\nFROM users ORDER BY email;\n+------+------------------------+------------+-----------+--------------+\n| rnum | email                  | first_name | last_name | account_type |\n+------+------------------------+------------+-----------+--------------+\n|    1 | admin@boss.org         | Admin      | Boss      | admin        |\n|    2 | bob.carlsen@foo.bar    | Bob        | Carlsen   | regular      |\n|    3 | eddie.stevens@data.org | Eddie      | Stevens   | regular      |\n|    4 | john.smith@xyz.org     | John       | Smith     | regular      |\n|    5 | root@boss.org          | Root       | Chief     | admin        |\n+------+------------------------+------------+-----------+--------------\n\nWe can generate separate sequences based on account type, using the PARTITION\nBY clause:\n\nSELECT row_number() OVER (PARTITION BY account_type ORDER BY email) AS rnum, \n email, first_name, last_name, account_type\nFROM users ORDER BY account_type,email;\n+------+------------------------+------------+-----------+--------------+\n| rnum | email                  | first_name | last_name | account_type |\n+------+------------------------+------------+-----------+--------------+\n|    1 | admin@boss.org         | Admin      | Boss      | admin        |\n|    2 | root@boss.org          | Root       | Chief     | admin        |\n|    1 | bob.carlsen@foo.bar    | Bob        | Carlsen   | regular      |\n|    2 | eddie.stevens@data.org | Eddie      | Stevens   | regular      |\n|    3 | john.smith@xyz.org     | John       | Smith     | regular      |\n+------+------------------------+------------+-----------+--------------+\n\nGiven the following structure and data, we want to find the top 5 salaries\nfrom each department.\n\nCREATE TABLE employee_salaries (dept VARCHAR(20), name VARCHAR(20), salary\nINT(11));\n\nINSERT INTO employee_salaries VALUES\n(\'Engineering\', \'Dharma\', 3500),\n(\'Engineering\', \'Binh\', 3000),\n(\'Engineering\', \'Adalynn\', 2800),\n(\'Engineering\', \'Samuel\', 2500),\n(\'Engineering\', \'Cveta\', 2200),\n(\'Engineering\', \'Ebele\', 1800),\n(\'Sales\', \'Carbry\', 500),\n(\'Sales\', \'Clytemnestra\', 400),\n(\'Sales\', \'Juraj\', 300),\n(\'Sales\', \'Kalpana\', 300),\n(\'Sales\', \'Svantepolk\', 250),\n(\'Sales\', \'Angelo\', 200);\n\nWe could do this without using window functions, as follows:\n\nselect dept, name, salary\nfrom employee_salaries as t1\nwhere (select count(t2.salary)\n   from employee_salaries as t2\n   where t1.name != t2.name and\n      t1.dept = t2.dept and\n      t2.salary > t1.salary) < 5\norder by dept, salary desc;\n\n+-------------+--------------+--------+\n| dept        | name         | salary |\n+-------------+--------------+--------+\n| Engineering | Dharma       |   3500 |\n| Engineering | Binh         |   3000 |\n| Engineering | Adalynn      |   2800 |\n| Engineering | Samuel       |   2500 |\n| Engineering | Cveta        |   2200 |\n| Sales       | Carbry       |    500 |\n| Sales       | Clytemnestra |    400 |\n| Sales       | Juraj        |    300 |\n| Sales       | Kalpana      |    300 |\n| Sales       | Svantepolk   |    250 |\n+-------------+--------------+--------+\n\nThis has a number of disadvantages:\n\n* if there is no index, the query could take a long time if the\nemployee_salary_table is large\n* Adding and maintaining indexes adds overhead, and even with indexes on dept\nand salary, each subquery execution adds overhead by performing a lookup\nthrough the index.\n\nLet\'s try achieve the same with window functions. First, generate a rank for\nall employees, using the RANK function.\n\nselect rank() over (partition by dept order by salary desc) as ranking,\n  dept, name, salary\n  from employee_salaries\n  order by dept, ranking;\n+---------+-------------+--------------+--------+\n| ranking | dept        | name         | salary |\n+---------+-------------+--------------+--------+\n|       1 | Engineering | Dharma       |   3500 |\n|       2 | Engineering | Binh         |   3000 |\n|       3 | Engineering | Adalynn      |   2800 |\n|       4 | Engineering | Samuel       |   2500 |\n|       5 | Engineering | Cveta        |   2200 |\n|       6 | Engineering | Ebele        |   1800 |\n|       1 | Sales       | Carbry       |    500 |\n|       2 | Sales       | Clytemnestra |    400 |\n|       3 | Sales       | Juraj        |    300 |\n|       3 | Sales       | Kalpana      |    300 |\n|       5 | Sales       | Svantepolk   |    250 |\n|       6 | Sales       | Angelo       |    200 |\n+---------+-------------+--------------+--------+\n\nEach department has a separate sequence of ranks due to the PARTITION BY\nclause. This particular sequence of values for rank() is given by the ORDER BY\nclause inside the window function’s OVER clause. Finally, to get our results\nin a readable format we order the data by dept and the newly generated ranking\ncolumn.\n\nNow, we need to reduce the results to find only the top 5 per department. Here\nis a common mistake:\n\nselect\nrank() over (partition by dept order by salary desc) as ranking,\ndept, name, salary\nfrom employee_salaries\nwhere ranking <= 5\norder by dept, ranking;\n\nERROR 1054 (42S22): Unknown column \'ranking\' in \'where clause\'\n\nTrying to filter only the first 5 values per department by putting a where\nclause in the statement does not work, due to the way window functions are\ncomputed. The computation of window functions happens after all WHERE, GROUP\nBY and HAVING clauses have been completed, right before ORDER BY, so the WHERE\nclause has no idea that the ranking column exists. It is only present after we\nhave filtered and grouped all the rows.\n\nTo counteract this problem, we need to wrap our query into a derived table. We\ncan then attach a where clause to it:\n\nselect *from (select rank() over (partition by dept order by salary desc) as\nranking,\n dept, name, salary\nfrom employee_salaries) as salary_ranks\nwhere (salary_ranks.ranking <= 5)\n order by dept, ranking;\n+---------+-------------+--------------+--------+\n| ranking | dept        | name         | salary |\n+---------+-------------+--------------+--------+\n|       1 | Engineering | Dharma       |   3500 |\n|       2 | Engineering | Binh         |   3000 |\n|       3 | Engineering | Adalynn      |   2800 |\n|       4 | Engineering | Samuel       |   2500 |\n|       5 | Engineering | Cveta        |   2200 |\n|       1 | Sales       | Carbry       |    500 |\n|       2 | Sales       | Clytemnestra |    400 |\n|       3 | Sales       | Juraj        |    300 |\n|       3 | Sales       | Kalpana      |    300 |\n|       5 | Sales       | Svantepolk   |    250 |\n+---------+-------------+--------------+--------+\n\nURL: https://mariadb.com/kb/en/window-functions-overview/','','https://mariadb.com/kb/en/window-functions-overview/'),
(789,'NTH_VALUE',41,'Syntax\n------\n\nNTH_VALUE (expr[, num_row]) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nThe NTH_VALUE function returns the value evaluated at row number num_row of\nthe window frame, starting from 1, or NULL if the row does not exist.\n\nURL: https://mariadb.com/kb/en/nth_value/','','https://mariadb.com/kb/en/nth_value/'),
(299,'CASE Statement',24,'Syntax\n------\n\nCASE case_value\n  WHEN when_value THEN statement_list\n  [WHEN when_value THEN statement_list] ...\n  [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n  WHEN search_condition THEN statement_list\n  [WHEN search_condition THEN statement_list] ...\n  [ELSE statement_list]\nEND CASE\n\nDescription\n-----------\n\nThe text on this page describes the CASE statement for stored programs. See\nthe CASE OPERATOR for details on the CASE operator outside of stored programs.\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct. If a search_condition evaluates to true, the corresponding SQL\nstatement list is executed. If no search condition matches, the statement list\nin the ELSE clause is executed. Each statement_list consists of one or more\nstatements.\n\nThe CASE statement cannot have an ELSE NULL clause, and it is terminated with\nEND CASE instead of END. implements a complex conditional construct. If a\nsearch_condition evaluates to true, the corresponding SQL statement list is\nexecuted. If no search condition matches, the statement list in the ELSE\nclause is executed. Each statement_list consists of one or more statements.\n\nIf no when_value or search_condition matches the value tested and the CASE\nstatement contains no ELSE clause, a Case not found for CASE statement error\nresults.\n\nEach statement_list consists of one or more statements; an empty\nstatement_list is not allowed. To handle situations where no value is matched\nby any WHEN clause, use an ELSE containing an empty BEGIN ... END block, as\nshown in this example:\n\nDELIMITER |\nCREATE PROCEDURE p()\nBEGIN\n DECLARE v INT DEFAULT 1;\n CASE v\n  WHEN 2 THEN SELECT v;\n  WHEN 3 THEN SELECT 0;\n  ELSE BEGIN END;\n END CASE;\nEND;\n|\n\nThe indentation used here in the ELSE clause is for purposes of clarity only,\nand is not otherwise significant. See Delimiters in the mariadb client for\nmore on the use of the delimiter command.\n\nNote: The syntax of the CASE statement used inside stored programs differs\nslightly from that of the SQL CASE expression described in CASE OPERATOR. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated with END\nCASE instead of END.\n\nURL: https://mariadb.com/kb/en/case-statement/','','https://mariadb.com/kb/en/case-statement/'),
(300,'DECLARE CONDITION',24,'Syntax\n------\n\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n  SQLSTATE [VALUE] sqlstate_value\n | mysql_error_code\n\nDescription\n-----------\n\nThe DECLARE ... CONDITION statement defines a named error condition. It\nspecifies a condition that needs specific handling and associates a name with\nthat condition. Later, the name can be used in a DECLARE ... HANDLER, SIGNAL\nor RESIGNAL statement (as long as the statement is located in the same BEGIN\n... END block).\n\nConditions must be declared after local variables, but before CURSORs and\nHANDLERs.\n\nA condition_value for DECLARE ... CONDITION can be an SQLSTATE value (a\n5-character string literal) or a MySQL error code (a number). You should not\nuse SQLSTATE value \'00000\' or MySQL error code 0, because those indicate\nsucess rather than an error condition. If you try, or if you specify an\ninvalid SQLSTATE value, an error like this is produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'00000\'\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nURL: https://mariadb.com/kb/en/declare-condition/','','https://mariadb.com/kb/en/declare-condition/'),
(302,'DECLARE Variable',24,'Syntax\n------\n\nDECLARE var_name [, var_name] ... [[ROW] TYPE OF]] type [DEFAULT value]\n\nDescription\n-----------\n\nThis statement is used to declare local variables within stored programs. To\nprovide a default value for the variable, include a DEFAULT clause. The value\ncan be specified as an expression (even subqueries are permitted); it need not\nbe a constant. If the DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect to\ndata type and overflow checking. See CREATE PROCEDURE.\n\nLocal variables must be declared before CONDITIONs, CURSORs and HANDLERs.\n\nLocal variable names are not case sensitive.\n\nThe scope of a local variable is within the BEGIN ... END block where it is\ndeclared. The variable can be referred to in blocks nested within the\ndeclaring block, except those blocks that declare a variable with the same\nname.\n\nTYPE OF / ROW TYPE OF\n---------------------\n\nMariaDB starting with 10.3\n--------------------------\nTYPE OF and ROW TYPE OF anchored data types for stored routines were\nintroduced in MariaDB 10.3.\n\nAnchored data types allow a data type to be defined based on another object,\nsuch as a table row, rather than specifically set in the declaration. If the\nanchor object changes, so will the anchored data type. This can lead to\nroutines being easier to maintain, so that if the data type in the table is\nchanged, it will automatically be changed in the routine as well.\n\nVariables declared with ROW TYPE OF will have the same features as implicit\nROW variables. It is not possible to use ROW TYPE OF variables in a LIMIT\nclause.\n\nThe real data type of TYPE OF and ROW TYPE OF table_name will become known at\nthe very beginning of the stored routine call. ALTER TABLE or DROP TABLE\nstatements performed inside the current routine on the tables that appear in\nanchors won\'t affect the data type of the anchored variables, even if the\nvariable is declared after an ALTER TABLE or DROP TABLE statement.\n\nThe real data type of a ROW TYPE OF cursor_name variable will become known\nwhen execution enters into the block where the variable is declared. Data type\ninstantiation will happen only once. In a cursor ROW TYPE OF variable that is\ndeclared inside a loop, its data type will become known on the very first\niteration and won\'t change on further loop iterations.\n\nThe tables referenced in TYPE OF and ROW TYPE OF declarations will be checked\nfor existence at the beginning of the stored routine call. CREATE PROCEDURE or\nCREATE FUNCTION will not check the referenced tables for existence.\n\nExamples\n--------\n\nTYPE OF and ROW TYPE OF from MariaDB 10.3:\n\nDECLARE tmp TYPE OF t1.a; -- Get the data type from the column {{a}} in the\ntable {{t1}}\n\nDECLARE rec1 ROW TYPE OF t1; -- Get the row data type from the table {{t1}}\n\nDECLARE rec2 ROW TYPE OF cur1; -- Get the row data type from the cursor\n{{cur1}}\n\nURL: https://mariadb.com/kb/en/declare-variable/','','https://mariadb.com/kb/en/declare-variable/'),
(796,'Aggregate Functions as Window Functions',41,'It is possible to use aggregate functions as window functions. An aggregate\nfunction used as a window function must have the OVER clause. For example,\nhere\'s COUNT() used as a window function:\n\nselect COUNT(*) over  (order by column) from table;\n\nMariaDB currently allows these aggregate functions to be used as window\nfunctions:\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* JSON_ARRAYAGG\n* JSON_OBJECTAGG\n* MAX\n* MIN\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nURL: https://mariadb.com/kb/en/aggregate-functions-as-window-functions/','','https://mariadb.com/kb/en/aggregate-functions-as-window-functions/');
INSERT INTO `help_topic` VALUES
(797,'ColumnStore Window Functions',41,'Introduction\n------------\n\nMariaDB ColumnStore provides support for window functions broadly following\nthe SQL 2003 specification. A window function allows for calculations relating\nto a window of data surrounding the current row in a result set. This\ncapability provides for simplified queries in support of common business\nquestions such as cumulative totals, rolling averages, and top 10 lists.\n\nAggregate functions are utilized for window functions however differ in\nbehavior from a group by query because the rows remain ungrouped. This\nprovides support for cumulative sums and rolling averages, for example.\n\nTwo key concepts for window functions are Partition and Frame:\n\n* A Partition is a group of rows, or window, that have the same value for a\nspecific column, for example a Partition can be created over a time period\nsuch as a quarter or lookup values.\n* The Frame for each row  is a subset of the row\'s Partition. The frame\ntypically is dynamic allowing for a sliding frame of rows within the\nPartition. The Frame determines the range of rows for the windowing function.\nA Frame could be defined as the last X rows and next Y rows all the way up to\nthe entire Partition.\n\nWindow functions are applied after joins, group by, and having clauses are\ncalculated.\n\nSyntax\n------\n\nA window function is applied in the select clause using the following syntax:\n\nfunction_name ([expression [, expression ... ]]) OVER ( window_definition )\n\nwhere window_definition is defined as:\n\n[ PARTITION BY expression [, ...] ]\n[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ]\n[ frame_clause ]\n\nPARTITION BY:\n\n* Divides the window result set into groups based on one or more expressions.\n* An expression may be a constant, column, and non window function expressions.\n* A query is not limited to a single partition by clause. Different partition\nclauses can be used across different window function applications.\n* The partition by columns do not need to be in the select list but do need to\nbe available from the query result set.\n* If there is no PARTITION BY clause, all rows of the result set define the\ngroup.\n\nORDER BY\n\n* Defines the ordering of values within the partition.\n* Can be ordered by multiple keys which may be a constant, column or non\nwindow function expression.\n* The order by columns do not need to be in the select list but need to be\navailable from the query result set.\n* Use of a select column alias from the query is not supported.\n* ASC (default) and DESC options allow for ordering ascending or descending.\n* NULLS FIRST and NULL_LAST options specify whether null values come first or\nlast in the ordering sequence. NULLS_FIRST is the default for ASC order, and\nNULLS_LAST is the default for DESC order.\n\nand the optional frame_clause is defined as:\n\n{ RANGE | ROWS } frame_start\n{ RANGE | ROWS } BETWEEN frame_start AND frame_end\n\nand the optional frame_start and frame_end are defined as (value being a\nnumeric expression):\n\nUNBOUNDED PRECEDING\nvalue PRECEDING\nCURRENT ROW\nvalue FOLLOWING\nUNBOUNDED FOLLOWING\n\nRANGE/ROWS:\n\n* Defines the windowing clause for calculating the set of rows that the\nfunction applies to for calculating a given rows window function result.\n* Requires an ORDER BY clause to define the row order for the window.\n* ROWS specify the window in physical units, i.e. result set rows and must be\na constant or expression evaluating to a positive numeric value.\n* RANGE specifies the window as a logical offset. If the the expression\nevaluates to a numeric value then the ORDER BY expression must be a numeric or\nDATE type. If the expression evaluates to an interval value then the ORDER BY\nexpression must be a DATE data type.\n* UNBOUNDED PRECEDING indicates the window starts at the first row of the\npartition.\n* UNBOUNDED FOLLOWING indicates the window ends at the last row of the\npartition.\n* CURRENT ROW specifies the window start or ends at the current row or value.\n* If omitted, the default is ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW.\n\nSupported Functions\n-------------------\n\n+--------------------------------+-------------------------------------------+\n| Function                       | Description                               |\n+--------------------------------+-------------------------------------------+\n| AVG()                          | The average of all input values.          |\n+--------------------------------+-------------------------------------------+\n| COUNT()                        | Number of input rows.                     |\n+--------------------------------+-------------------------------------------+\n| CUME_DIST()                    | Calculates the cumulative distribution,   |\n|                                | or relative rank, of the current row to   |\n|                                | other rows in the same partition. Number  |\n|                                | of peer or preceding rows / number of     |\n|                                | rows in partition.                        |\n+--------------------------------+-------------------------------------------+\n| DENSE_RANK()                   | Ranks items in a group leaving no gaps    |\n|                                | in ranking sequence when there are ties.  |\n+--------------------------------+-------------------------------------------+\n| FIRST_VALUE()                  | The value evaluated at the row that is    |\n|                                | the first row of the window frame         |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| LAG()                          | The value evaluated at the row that is    |\n|                                | offset rows before the current row        |\n|                                | within the partition; if there is no      |\n|                                | such row, instead return default. Both    |\n|                                | offset and default are evaluated with     |\n|                                | respect to the current row. If omitted,   |\n|                                | offset defaults to 1 and default to       |\n|                                | null. LAG provides access to more than    |\n|                                | one row of a table at the same time       |\n|                                | without a self-join. Given a series of    |\n|                                | rows returned from a query and a          |\n|                                | position of the cursor, LAG provides      |\n|                                | access to a row at a given physical       |\n|                                | offset prior to that position.            |\n+--------------------------------+-------------------------------------------+\n| LAST_VALUE()                   | The value evaluated at the row that is    |\n|                                | the last row of the window frame          |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| LEAD()                         | Provides access to a row at a given       |\n|                                | physical offset beyond that position.     |\n|                                | Returns value evaluated at the row that   |\n|                                | is offset rows after the current row      |\n|                                | within the partition; if there is no      |\n|                                | such row, instead return default. Both    |\n|                                | offset and default are evaluated with     |\n|                                | respect to the current row. If omitted,   |\n|                                | offset defaults to 1 and default to null. |\n+--------------------------------+-------------------------------------------+\n| MAX()                          | Maximum value of expression across all    |\n|                                | input values.                             |\n+--------------------------------+-------------------------------------------+\n| MEDIAN()                       | An inverse distribution function that     |\n|                                | assumes a continuous distribution model.  |\n|                                | It takes a numeric or datetime value and  |\n|                                | returns the middle value or an            |\n|                                | interpolated value that would be the      |\n|                                | middle value once the values are sorted.  |\n|                                | Nulls are ignored in the calculation.     |\n+--------------------------------+-------------------------------------------+\n| MIN()                          | Minimum value of expression across all    |\n|                                | input values.                             |\n+--------------------------------+-------------------------------------------+\n| NTH_VALUE()                    | The value evaluated at the row that is    |\n|                                | the nth row of the window frame           |\n|                                | (counting from 1); null if no such row.   |\n+--------------------------------+-------------------------------------------+\n| NTILE()                        | Divides an ordered data set into a        |\n|                                | number of buckets indicated by expr and   |\n|                                | assigns the appropriate bucket number to  |\n|                                | each row. The buckets are numbered 1      |\n|                                | through expr. The expr value must         |\n|                                | resolve to a positive constant for each   |\n|                                | partition. Integer ranging from 1 to the  |\n|                                | argument value, dividing the partition    |\n|                                | as equally as possible.                   |\n+--------------------------------+-------------------------------------------+\n| PERCENT_RANK()                 | relative rank of the current row: (rank   |\n|                                | - 1) / (total rows - 1).                  |\n+--------------------------------+-------------------------------------------+\n| PERCENTILE_CONT()              | An inverse distribution function that     |\n|                                | assumes a continuous distribution model.  |\n|                                | It takes a percentile value and a sort    |\n|                                | specification, and returns an             |\n|                                | interpolated value that would fall into   |\n|                                | that percentile value with respect to     |\n|                                | the sort specification. Nulls are         |\n|                                | ignored in the calculation.               |\n+--------------------------------+-------------------------------------------+\n| PERCENTILE_DISC()              | An inverse distribution function that     |\n|                                | assumes a discrete distribution model.    |\n|                                | It takes a percentile value and a sort    |\n|                                | specification and returns an element      |\n|                                | from the set. Nulls are ignored in the    |\n|                                | calculation.                              |\n+--------------------------------+-------------------------------------------+\n| RANK()                         | rank of the current row with gaps; same   |\n|                                | as row_number of its first peer.          |\n+--------------------------------+-------------------------------------------+\n| ROW_NUMBER()                   | number of the current row within its      |\n|                                | partition, counting from 1                |\n+--------------------------------+-------------------------------------------+\n| STDDEV() STDDEV_POP()          | Computes the population standard          |\n|                                | deviation and returns the square root of  |\n|                                | the population variance.                  |\n+--------------------------------+-------------------------------------------+\n| STDDEV_SAMP()                  | Computes the cumulative sample standard   |\n|                                | deviation and returns the square root of  |\n|                                | the sample variance.                      |\n+--------------------------------+-------------------------------------------+\n| SUM()                          | Sum of expression across all input        |\n|                                | values.                                   |\n+--------------------------------+-------------------------------------------+\n| VARIANCE() VAR_POP()           | Population variance of the input values   |\n|                                | (square of the population standard        |\n|                                | deviation).                               |\n+--------------------------------+-------------------------------------------+\n| VAR_SAMP()                     | Sample variance of the input values       |\n|                                | (square of the sample standard            |\n|                                | deviation).                               |\n+--------------------------------+-------------------------------------------+\n\nExamples\n--------\n\nExample Schema\n--------------\n\nThe examples are all based on the following simplified sales opportunity table:\n\ncreate table opportunities (\nid int,\naccountName varchar(20),\nname varchar(128),\nowner varchar(7),\namount decimal(10,2),\ncloseDate date,\nstageName varchar(11)\n) engine=columnstore;\n\nSome example values are (thanks to https://www.mockaroo.com for sample data\ngeneration):\n\n+----+---------------+------+--------+---------+-------------+-------------+\n| id | accountName   | name | owner  | amount  | closeDate   | stageName   |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 1  | Browseblab    | Mult | Bob    | 26444.8 | 2016-10-20  | Negotiating |\n|    |               | -lat |        |         |             |             |\n|    |               | ral  |        |         |             |             |\n|    |               | exec |        |         |             |             |\n|    |               | tive |        |         |             |             |\n|    |               | func |        |         |             |             |\n|    |               | ion  |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 2  | Mita          | Orga | Maria  | 477878. | 2016-11-28  | ClosedWon   |\n|    |               | ic   |        | 1       |             |             |\n|    |               | dema |        |         |             |             |\n|    |               | d-dr |        |         |             |             |\n|    |               | ven  |        |         |             |             |\n|    |               | benc |        |         |             |             |\n|    |               | mark |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 3  | Miboo         | De-e | Olivie | 80181.7 | 2017-01-05  | ClosedWon   |\n|    |               | gine |        |         |             |             |\n|    |               | red  |        |         |             |             |\n|    |               | hybr |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | grou |        |         |             |             |\n|    |               | ware |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 4  | Youbridge     | Ente | Chris  | 946245. | 2016-07-02  | ClosedWon   |\n|    |               | pris |        | 9       |             |             |\n|    |               | -wid |        |         |             |             |\n|    |               |      |        |         |             |             |\n|    |               | bott |        |         |             |             |\n|    |               | m-li |        |         |             |             |\n|    |               | e    |        |         |             |             |\n|    |               | Grap |        |         |             |             |\n|    |               | ic   |        |         |             |             |\n|    |               | Inte |        |         |             |             |\n|    |               | face |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 5  | Skyba         | Reve | Maria  | 696241. | 2017-02-17  | Negotiating |\n|    |               | se-e |        | 2       |             |             |\n|    |               | gine |        |         |             |             |\n|    |               | red  |        |         |             |             |\n|    |               | fres |        |         |             |             |\n|    |               | -thi |        |         |             |             |\n|    |               | king |        |         |             |             |\n|    |               | stan |        |         |             |             |\n|    |               | ardi |        |         |             |             |\n|    |               | atio |        |         |             |             |\n|    |               |      |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 6  | Eayo          | Fund | Bob    | 765605. | 2016-08-27  | Prospecting |\n|    |               | ment |        | 2       |             |             |\n|    |               | l    |        |         |             |             |\n|    |               | well |        |         |             |             |\n|    |               | modu |        |         |             |             |\n|    |               | ated |        |         |             |             |\n|    |               | arti |        |         |             |             |\n|    |               | icia |        |         |             |             |\n|    |               |      |        |         |             |             |\n|    |               | inte |        |         |             |             |\n|    |               | lige |        |         |             |             |\n|    |               | ce   |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 7  | Yotz          | Exte | Chris  | 319624. | 2017-01-06  | ClosedLost  |\n|    |               | ded  |        | 0       |             |             |\n|    |               | seco |        |         |             |             |\n|    |               | dary |        |         |             |             |\n|    |               | infr |        |         |             |             |\n|    |               | stru |        |         |             |             |\n|    |               | ture |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 8  | Oloo          | Conf | Chris  | 321016. | 2017-03-08  | ClosedLost  |\n|    |               | gura |        | 6       |             |             |\n|    |               | le   |        |         |             |             |\n|    |               | web- |        |         |             |             |\n|    |               | nabl |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | data |        |         |             |             |\n|    |               | ware |        |         |             |             |\n|    |               | ouse |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 9  | Kaymbo        | Mult | Bob    | 690881. | 2017-01-02  | Developing  |\n|    |               | -lat |        | 1       |             |             |\n|    |               | ral  |        |         |             |             |\n|    |               | web- |        |         |             |             |\n|    |               | nabl |        |         |             |             |\n|    |               | d    |        |         |             |             |\n|    |               | defi |        |         |             |             |\n|    |               | itio |        |         |             |             |\n|    |               |      |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n| 10 | Rhyloo        | Publ | Chris  | 965477. | 2016-11-07  | Prospecting |\n|    |               | c-ke |        | 4       |             |             |\n|    |               |      |        |         |             |             |\n|    |               | cohe |        |         |             |             |\n|    |               | ent  |        |         |             |             |\n|    |               | infr |        |         |             |             |\n|    |               | stru |        |         |             |             |\n|    |               | ture |        |         |             |             |\n+----+---------------+------+--------+---------+-------------+-------------+\n\nThe schema, sample data, and queries are available as an attachment to this\narticle.\n\nCumulative Sum and Running Max Example\n--------------------------------------\n\nWindow functions can be used to achieve cumulative / running calculations on a\ndetail report. In this case a won opportunity report for a 7 day period adds\ncolumns to show the accumulated won amount as well as the current highest\nopportunity amount in preceding rows.\n\nselect owner, \naccountName, \nCloseDate, \namount, \nsum(amount) over (order by CloseDate rows between unbounded preceding and\ncurrent row) cumeWon, \nmax(amount) over (order by CloseDate rows between unbounded preceding and\ncurrent row) runningMax\nfrom opportunities \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\' \norder by CloseDate;\n\nwith example results:\n\n+--------+---------------+-------------+---------+----------+--------------+\n| owner  | accountName   | CloseDate   | amount  | cumeWon  | runningMax   |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Babbleopia    | 2016-10-02  | 437636. | 437636.4 | 437636.47    |\n|        |               |             | 7       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Thoughtworks  | 2016-10-04  | 146086. | 583722.9 | 437636.47    |\n|        |               |             | 1       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Devpulse      | 2016-10-05  | 834235. | 1417958. | 834235.93    |\n|        |               |             | 3       | 1        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Linkbridge    | 2016-10-07  | 539977. | 2458738. | 834235.93    |\n|        |               |             | 5       | 5        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Trupe         | 2016-10-07  | 500802. | 1918761. | 834235.93    |\n|        |               |             | 9       | 0        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Latz          | 2016-10-08  | 857254. | 3315993. | 857254.87    |\n|        |               |             | 7       | 2        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Avamm         | 2016-10-09  | 699566. | 4015560. | 857254.87    |\n|        |               |             | 6       | 8        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n\nPartitioned Cumulative Sum and Running Max Example\n--------------------------------------------------\n\nThe above example can be partitioned, so that the window functions are over a\nparticular field grouping such as owner and accumulate within that grouping.\nThis is achieved by adding the syntax \"partition by <columns>\" in the window\nfunction clause.\n\nselect owner,  \naccountName,  \nCloseDate,  \namount,  \nsum(amount) over (partition by owner order by CloseDate rows between unbounded\npreceding and current row) cumeWon,  \nmax(amount) over (partition by owner order by CloseDate rows between unbounded\npreceding and current row) runningMax \nfrom opportunities  \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\'  \norder by owner, CloseDate;\n\nwith example results:\n\n+--------+---------------+-------------+---------+----------+--------------+\n| owner  | accountName   | CloseDate   | amount  | cumeWon  | runningMax   |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Babbleopia    | 2016-10-02  | 437636. | 437636.4 | 437636.47    |\n|        |               |             | 7       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Thoughtworks  | 2016-10-04  | 146086. | 583722.9 | 437636.47    |\n|        |               |             | 1       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Bill   | Latz          | 2016-10-08  | 857254. | 1440977. | 857254.87    |\n|        |               |             | 7       | 5        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Linkbridge    | 2016-10-07  | 539977. | 539977.4 | 539977.45    |\n|        |               |             | 5       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Chris  | Avamm         | 2016-10-09  | 699566. | 1239544. | 699566.86    |\n|        |               |             | 6       | 1        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Devpulse      | 2016-10-05  | 834235. | 834235.9 | 834235.93    |\n|        |               |             | 3       |          |              |\n+--------+---------------+-------------+---------+----------+--------------+\n| Olivie | Trupe         | 2016-10-07  | 500802. | 1335038. | 834235.93    |\n|        |               |             | 9       | 2        |              |\n+--------+---------------+-------------+---------+----------+--------------+\n\nRanking / Top Results\n---------------------\n\nThe rank window function allows for ranking or assigning a numeric order value\nbased on the window function definition. Using the Rank() function will result\nin the same value for ties / equal values and the next rank value skipped. The\nDense_Rank() function behaves similarly except the next consecutive number is\nused after a tie rather than skipped. The Row_Number() function will provide a\nunique ordering value. The example query shows the Rank() function being\napplied to rank sales reps by the number of opportunities for Q4 2016.\n\nselect owner, \nwonCount, \nrank() over (order by wonCount desc) rank \nfrom (\n select owner,\n count(*) wonCount\n from opportunities\n where stageName=\'ClosedWon\'\n and closeDate >= \'2016-10-01\' and closeDate < \'2016-12-31\'\n group by owner\n) t\norder by rank;\n\nwith example results (note the query is technically incorrect by using\ncloseDate < \'2016-12-31\' however this creates a tie scenario for illustrative\npurposes):\n\n+----------------------+----------------------------------+------------------+\n| owner                | wonCount                         | rank             |\n+----------------------+----------------------------------+------------------+\n| Bill                 | 19                               | 1                |\n+----------------------+----------------------------------+------------------+\n| Chris                | 15                               | 2                |\n+----------------------+----------------------------------+------------------+\n| Maria                | 14                               | 3                |\n+----------------------+----------------------------------+------------------+\n| Bob                  | 14                               | 3                |\n+----------------------+----------------------------------+------------------+\n| Olivier              | 10                               | 5                |\n+----------------------+----------------------------------+------------------+\n\nIf the dense_rank function is used the rank values would be 1,2,3,3,4 and for\nthe row_number function the values would be 1,2,3,4,5.\n\nFirst and Last Values\n---------------------\n\nThe first_value and last_value functions allow determining the first and last\nvalues of a given range. Combined with a group by this allows summarizing\nopening and closing values. The example shows a more complex case where\ndetailed information is presented for first and last opportunity by quarter.\n\nselect a.year, \na.quarter, \nf.accountName firstAccountName, \nf.owner firstOwner, \nf.amount firstAmount, \nl.accountName lastAccountName, \nl.owner lastOwner, \nl.amount lastAmount \nfrom (\n select year,\n quarter,\n min(firstId) firstId,\n min(lastId) lastId\n from (\n  select year(closeDate) year,\n  quarter(closeDate) quarter,\n  first_value(id) over (partition by year(closeDate), quarter(closeDate)\norder by closeDate rows between unbounded preceding and current row) firstId, \n  last_value(id) over (partition by year(closeDate), quarter(closeDate)\norder by closeDate rows between current row and unbounded following) lastId \n  from opportunities  where stageName=\'ClosedWon\'\n ) t\n group by year, quarter order by year,quarter\n) a \njoin opportunities f on a.firstId = f.id \njoin opportunities l on a.lastId = l.id \norder by year, quarter;\n\nwith example results:\n\n+----+------+------------+--------+---------+-----------+-------+--------+\n| ye | quar | firstAccou | firstO | firstAm | lastAccou | lastO | lastAm |\n| r  | er   | tName      | ner    | unt     | tName     | ner   | unt    |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 3    | Skidoo     | Bill   | 523295. | Skipstorm | Bill  | 151420 |\n| 6  |      |            |        | 7       |           |       | 86     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 4    | Skimia     | Chris  | 961513. | Avamm     | Maria | 112493 |\n| 6  |      |            |        | 9       |           |       | 65     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n| 20 | 1    | Yombu      | Bob    | 536875. | Skaboo    | Chris | 270273 |\n| 7  |      |            |        | 1       |           |       | 08     |\n+----+------+------------+--------+---------+-----------+-------+--------+\n\nPrior and Next Example\n----------------------\n\nSometimes it useful to understand the previous and next values in the context\nof a given row. The lag and lead window functions provide this capability. By\ndefault the offset is one providing the prior or next value but can also be\nprovided to get a larger offset. The example query is a report of\nopportunities by account name showing the opportunity amount, and the prior\nand next opportunity amount for that account by close date.\n\nselect accountName, \ncloseDate,  \namount currentOppAmount, \nlag(amount) over (partition by accountName order by closeDate) priorAmount,\nlead(amount) over (partition by accountName order by closeDate) nextAmount \nfrom opportunities \norder by accountName, closeDate \nlimit 9;\n\nwith example results:\n\n+--------------+-----------+-------------------+--------------+-------------+\n| accountName  | closeDate | currentOppAmount  | priorAmount  | nextAmount  |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-09-1 | 645098.45         | NULL         | 161086.82   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-10-1 | 161086.82         | 645098.45    | 350235.75   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-12-1 | 350235.75         | 161086.82    | 878595.89   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2016-12-3 | 878595.89         | 350235.75    | 922322.39   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abata        | 2017-01-2 | 922322.39         | 878595.89    | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Abatz        | 2016-10-1 | 795424.15         | NULL         | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-07-0 | 288974.84         | NULL         | 914461.49   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-09-0 | 914461.49         | 288974.84    | 176645.52   |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n| Agimba       | 2016-09-2 | 176645.52         | 914461.49    | NULL        |\n|              |           |                   |              |             |\n+--------------+-----------+-------------------+--------------+-------------+\n\nQuartiles Example\n-----------------\n\nThe NTile window function allows for breaking up a data set into portions\nassigned a numeric value to each portion of the range. NTile(4) breaks the\ndata up into quartiles (4 sets). The example query produces a report of all\nopportunities summarizing the quartile boundaries of amount values.\n\nselect t.quartile, \nmin(t.amount) min, \nmax(t.amount) max \nfrom (\n select amount,\n ntile(4) over (order by amount asc) quartile\n from opportunities\n where closeDate >= \'2016-10-01\' and closeDate <= \'2016-12-31\'\n ) t\ngroup by quartile \norder by quartile;\n\nWith example results:\n\n+-----------------------------------------+----------------+----------------+\n| quartile                                | min            | max            |\n+-----------------------------------------+----------------+----------------+\n| 1                                       | 6337.15        | 287634.01      |\n+-----------------------------------------+----------------+----------------+\n| 2                                       | 288796.14      | 539977.45      |\n+-----------------------------------------+----------------+----------------+\n| 3                                       | 540070.04      | 748727.51      |\n+-----------------------------------------+----------------+----------------+\n| 4                                       | 753670.77      | 998864.47      |\n+-----------------------------------------+----------------+----------------+\n\nPercentile Example\n------------------\n\nThe percentile functions have a slightly different syntax from other window\nfunctions as can be seen in the example below. These functions can be only\napplied against numeric values. The argument to the function is the percentile\nto evaluate. Following \'within group\' is the sort expression which indicates\nthe sort column and optionally order. Finally after \'over\' is an optional\npartition by clause, for no partition clause use \'over ()\'. The example below\nutilizes the value 0.5 to calculate the median opportunity amount in the rows.\nThe values differ sometimes because percentile_cont will return the average of\nthe 2 middle rows for an even data set while percentile_desc returns the first\nencountered in the sort.\n\nselect owner,  \naccountName,  \nCloseDate,  \namount,\npercentile_cont(0.5) within group (order by amount) over (partition by owner)\npct_cont,\npercentile_disc(0.5) within group (order by amount) over (partition by owner)\npct_disc\nfrom opportunities  \nwhere stageName=\'ClosedWon\' \nand closeDate >= \'2016-10-02\' and closeDate <= \'2016-10-09\'  \norder by owner, CloseDate;\n\nWith example results:\n\n+--------+----------------+-------------+---------+------------+------------+\n| owner  | accountName    | CloseDate   | amount  | pct_cont   | pct_disc   |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Babbleopia     | 2016-10-02  | 437636. | 437636.470 | 437636.47  |\n|        |                |             | 7       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Thoughtworks   | 2016-10-04  | 146086. | 437636.470 | 437636.47  |\n|        |                |             | 1       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Bill   | Latz           | 2016-10-08  | 857254. | 437636.470 | 437636.47  |\n|        |                |             | 7       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Chris  | Linkbridge     | 2016-10-07  | 539977. | 619772.155 | 539977.45  |\n|        |                |             | 5       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Chris  | Avamm          | 2016-10-09  | 699566. | 619772.155 | 539977.45  |\n|        |                |             | 6       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Olivie | Devpulse       | 2016-10-05  | 834235. | 667519.110 | 500802.29  |\n|        |                |             | 3       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n| Olivie | Trupe          | 2016-10-07  | 500802. | 667519.110 | 500802.29  |\n|        |                |             | 9       | 000000     |            |\n+--------+----------------+-------------+---------+------------+------------+\n\nURL: https://mariadb.com/kb/en/window-functions-columnstore-window-functions/','','https://mariadb.com/kb/en/window-functions-columnstore-window-functions/'),
(802,'SPIDER_FLUSH_TABLE_MON_CACHE',42,'Syntax\n------\n\nSPIDER_FLUSH_TABLE_MON_CACHE()\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used for\nrefreshing monitoring server information. It returns a value of 1.\n\nExamples\n--------\n\nSELECT SPIDER_FLUSH_TABLE_MON_CACHE();\n+--------------------------------+\n| SPIDER_FLUSH_TABLE_MON_CACHE() |\n+--------------------------------+\n|                              1 |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/spider_flush_table_mon_cache/','','https://mariadb.com/kb/en/spider_flush_table_mon_cache/'),
(301,'DECLARE HANDLER',24,'Syntax\n------\n\nDECLARE handler_type HANDLER\n  FOR condition_value [, condition_value] ...\n  statement\n\nhandler_type:\n  CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n  SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n | mariadb_error_code\n\nDescription\n-----------\n\nThe DECLARE ... HANDLER statement specifies handlers that each may deal with\none or more conditions. If one of these conditions occurs, the specified\nstatement is executed. statement can be a simple statement (for example, SET\nvar_name = value), or it can be a compound statement written using BEGIN and\nEND.\n\nHandlers must be declared after local variables, a CONDITION and a CURSOR.\n\nFor a CONTINUE handler, execution of the current program continues after\nexecution of the handler statement. For an EXIT handler, execution terminates\nfor the BEGIN ... END compound statement in which the handler is declared.\n(This is true even if the condition occurs in an inner block.) The UNDO\nhandler type statement is not supported.\n\nIf a condition occurs for which no handler has been declared, the default\naction is EXIT.\n\nA condition_value for DECLARE ... HANDLER can be any of the following values:\n\n* An SQLSTATE value (a 5-character string literal) or a MariaDB error\ncode (a number). You should not use SQLSTATE value \'00000\' or MariaDB\nerror code 0, because those indicate sucess rather than an error\ncondition. For a list of SQLSTATE values and MariaDB error codes, see\nMariaDB Error Codes.\n* A condition name previously specified with DECLARE ... CONDITION. It must be\nin the same stored program. See DECLARE CONDITION.\n* SQLWARNING is shorthand for the class of SQLSTATE values that begin\nwith \'01\'.\n* NOT FOUND is shorthand for the class of SQLSTATE values that begin\nwith \'02\'. This is relevant only the context of cursors and is used to\ncontrol what happens when a cursor reaches the end of a data set. If\nno more rows are available, a No Data condition occurs with SQLSTATE\nvalue 02000. To detect this condition, you can set up a handler for it\n(or for a NOT FOUND condition). An example is shown in Cursor Overview. This\ncondition also occurs for SELECT ... INTO var_list statements that retrieve no\nrows.\n* SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\nnot begin with \'00\', \'01\', or \'02\'.\n\nWhen an error raises, in some cases it could be handled by multiple HANDLERs.\nFor example, there may be an handler for 1050 error, a separate handler for\nthe 42S01 SQLSTATE, and another separate handler for the SQLEXCEPTION class:\nin theory all occurrences of HANDLER may catch the 1050 error, but MariaDB\nchooses the HANDLER with the highest precedence. Here are the precedence rules:\n\n* Handlers which refer to an error code have the highest precedence.\n* Handlers which refer to a SQLSTATE come next.\n* Handlers which refer to an error class have the lowest precedence.\n\nIn some cases, a statement could produce multiple errors. If this happens, in\nsome cases multiple handlers could have the highest precedence. In such cases,\nthe choice of the handler is indeterminate.\n\nNote that if an error occurs within a CONTINUE HANDLER block, it can be\nhandled by another HANDLER. However, a HANDLER which is already in the stack\n(that is, it has been called to handle an error and its execution didn\'t\nfinish yet) cannot handle new errors—this prevents endless loops. For example,\nsuppose that a stored procedure contains a CONTINUE HANDLER for SQLWARNING and\nanother CONTINUE HANDLER for NOT FOUND. At some point, a NOT FOUND error\noccurs, and the execution enters the NOT FOUND HANDLER. But within that\nhandler, a warning occurs, and the execution enters the SQLWARNING HANDLER. If\nanother NOT FOUND error occurs, it cannot be handled again by the NOT FOUND\nHANDLER, because its execution is not finished.\n\nWhen a DECLARE HANDLER block can handle more than one error condition, it may\nbe useful to know which errors occurred. To do so, you can use the GET\nDIAGNOSTICS statement.\n\nAn error that is handled by a DECLARE HANDLER construct can be issued again\nusing the RESIGNAL statement.\n\nBelow is an example using DECLARE HANDLER:\n\nCREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\n\nDELIMITER //\n\nCREATE PROCEDURE handlerdemo ( )\n  BEGIN\n   DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n   SET @x = 1;\n   INSERT INTO test.t VALUES (1);\n   SET @x = 2;\n   INSERT INTO test.t VALUES (1);\n   SET @x = 3;\n  END;\n  //\n\nDELIMITER ;\n\nCALL handlerdemo( );\n\nSELECT @x;\n+------+\n| @x   |\n+------+\n|    3 |\n+------+\n\nURL: https://mariadb.com/kb/en/declare-handler/','','https://mariadb.com/kb/en/declare-handler/'),
(303,'FOR',24,'MariaDB starting with 10.3\n--------------------------\nFOR loops were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nInteger range FOR loop:\n\n[begin_label:]\nFOR var_name IN [ REVERSE ] lower_bound .. upper_bound\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop (Oracle mode)\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nLOOP\n statement_list\nEND LOOP [ end_label ]\n\nImplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN ( select_statement )\nDO statement_list\nEND FOR [ end_label ]\n\nDescription\n-----------\n\nFOR loops allow code to be executed a fixed number of times.\n\nIn an integer range FOR loop, MariaDB will compare the lower bound and upper\nbound values, and assign the lower bound value to a counter. If REVERSE is not\nspecified, and the upper bound value is greater than or equal to the counter,\nthe counter will be incremented and the statement will continue, after which\nthe loop is entered again. If the upper bound value is greater than the\ncounter, the loop will be exited.\n\nIf REVERSE is specified, the counter is decremented, and the upper bound value\nneeds to be less than or equal for the loop to continue.\n\nExamples\n--------\n\nIntger range FOR loop:\n\nCREATE TABLE t1 (a INT);\n\nDELIMITER //\n\nFOR i IN 1..3\nDO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n//\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nREVERSE integer range FOR loop:\n\nCREATE OR REPLACE TABLE t1 (a INT);\n\nDELIMITER //\nFOR i IN REVERSE 4..12\n  DO\n  INSERT INTO t1 VALUES (i);\nEND FOR;\n//\nQuery OK, 9 rows affected (0.422 sec)\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|   12 |\n|   11 |\n|   10 |\n|    9 |\n|    8 |\n|    7 |\n|    6 |\n|    5 |\n|    4 |\n+------+\n\nExplicit cursor in Oracle mode:\n\nSET sql_mode=ORACLE;\n\nCREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(32));\n\nINSERT INTO t1 VALUES (10,\'b0\');\nINSERT INTO t1 VALUES (11,\'b1\');\nINSERT INTO t1 VALUES (12,\'b2\');\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1(pa INT) AS \n CURSOR cur(va INT) IS\n  SELECT a, b FROM t1 WHERE a=va;\nBEGIN\n FOR rec IN cur(pa)\n LOOP\n  SELECT rec.a, rec.b;\n END LOOP;\nEND;\n//\n\nDELIMITER ;\n\nCALL p1(10);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    10 | b0    |\n+-------+-------+\n\nCALL p1(11);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    11 | b1    |\n+-------+-------+\n\nCALL p1(12);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n|    12 | b2    |\n+-------+-------+\n\nCALL p1(13);\nQuery OK, 0 rows affected (0.000 sec)\n\nURL: https://mariadb.com/kb/en/for/','','https://mariadb.com/kb/en/for/'),
(306,'ITERATE',24,'Syntax\n------\n\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements. ITERATE\nmeans \"do the loop again\", and uses the statement\'s label to determine which\nstatements to repeat. The label must be in the same stored program, not in a\ncaller procedure.\n\nIf you try to use ITERATE with a non-existing label, or if the label is\nassociated to a construct which is not a loop, the following error will be\nproduced:\n\nERROR 1308 (42000): ITERATE with no matching label: <label_name>\n\nBelow is an example of how ITERATE might be used:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n  SET p1 = p1 + 1;\n  IF p1 < 10 THEN ITERATE label1; END IF;\n  LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND\n\nURL: https://mariadb.com/kb/en/iterate/','','https://mariadb.com/kb/en/iterate/'),
(307,'Labels',24,'Syntax\n------\n\nlabel: <construct>\n[label]\n\nLabels are MariaDB identifiers which can be used to identify a BEGIN ... END\nconstruct or a loop. They have a maximum length of 16 characters and can be\nquoted with backticks (i.e.., `).\n\nLabels have a start part and an end part. The start part must precede the\nportion of code it refers to, must be followed by a colon (:) and can be on\nthe same or different line. The end part is optional and adds nothing, but can\nmake the code more readable. If used, the end part must precede the\nconstruct\'s delimiter (;). Constructs identified by a label can be nested.\nEach construct can be identified by only one label.\n\nLabels need not be unique in the stored program they belong to. However, a\nlabel for an inner loop cannot be identical to a label for an outer loop. In\nthis case, the following error would be produced:\n\nERROR 1309 (42000): Redefining label <label_name>\n\nLEAVE and ITERATE statements can be used to exit or repeat a portion of code\nidentified by a label. They must be in the same Stored Routine, Trigger or\nEvent which contains the target label.\n\nBelow is an example using a simple label that is used to exit a LOOP:\n\nCREATE PROCEDURE `test_sp`()\nBEGIN\n `my_label`:\n LOOP\n   SELECT \'looping\';\n   LEAVE `my_label`;\n END LOOP;\n SELECT \'out of loop\';\nEND;\n\nThe following label is used to exit a procedure, and has an end part:\n\nCREATE PROCEDURE `test_sp`()\n`my_label`:\nBEGIN\n IF @var = 1 THEN\n   LEAVE `my_label`;\n END IF;\n DO something();\nEND `my_label`;\n\nURL: https://mariadb.com/kb/en/labels/','','https://mariadb.com/kb/en/labels/'),
(308,'LEAVE',24,'Syntax\n------\n\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the given\nlabel. The label must be in the same stored program, not in a caller\nprocedure. LEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE). In Stored Procedures, Triggers and Events, LEAVE can refer to\nthe outmost BEGIN ... END construct; in that case, the program exits the\nprocedure. In Stored Functions, RETURN can be used instead.\n\nNote that LEAVE cannot be used to exit a DECLARE HANDLER block.\n\nIf you try to LEAVE a non-existing label, or if you try to LEAVE a HANDLER\nblock, the following error will be produced:\n\nERROR 1308 (42000): LEAVE with no matching label: <label_name>\n\nThe following example uses LEAVE to exit the procedure if a condition is true:\n\nCREATE PROCEDURE proc(IN p TINYINT)\nCONTAINS SQL\n`whole_proc`:\nBEGIN\n SELECT 1;\n IF p < 1 THEN\n   LEAVE `whole_proc`;\n END IF;\n SELECT 2;\nEND;\n\nCALL proc(0);\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nURL: https://mariadb.com/kb/en/leave/','','https://mariadb.com/kb/en/leave/'),
(310,'REPEAT LOOP',24,'Syntax\n------\n\n[begin_label:] REPEAT\n  statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition is true. Thus, a REPEAT always enters the loop at least once.\nstatement_list consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter.\n\nA REPEAT statement can be labeled. end_label cannot be given unless\nbegin_label also is present. If both are present, they must be the same.\n\nSee Delimiters in the mariadb client for more on client delimiter usage.\n\nDELIMITER //\n\nCREATE PROCEDURE dorepeat(p1 INT)\n BEGIN\n  SET @x = 0;\n  REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;\n END\n//\n\nCALL dorepeat(1000)//\n\nSELECT @x//\n+------+\n| @x   |\n+------+\n| 1001 |\n+------+\n\nURL: https://mariadb.com/kb/en/repeat-loop/','','https://mariadb.com/kb/en/repeat-loop/'),
(313,'SELECT INTO',24,'Syntax\n------\n\nSELECT col_name [, col_name] ...\n  INTO var_name [, var_name] ...\n  table_expr\n\nDescription\n-----------\n\nSELECT ... INTO enables selected columns to be stored directly into variables.\nNo resultset is produced. The query should return a single row. If the query\nreturns no rows, a warning with error code 1329 occurs (No data), and the\nvariable values remain unchanged. If the query returns multiple rows, error\n1172 occurs (Result consisted of more than one row). If it is possible that\nthe statement may retrieve multiple rows, you can use LIMIT 1 to limit the\nresult set to a single row.\n\nThe INTO clause can also be specified at the end of the statement.\n\nIn the context of such statements that occur as part of events executed by the\nEvent Scheduler, diagnostics messages (not only errors, but also warnings) are\nwritten to the error log, and, on Windows, to the application event log.\n\nThis statement can be used with both local variables and user-defined\nvariables.\n\nFor the complete syntax, see SELECT.\n\nAnother way to set a variable\'s value is the SET statement.\n\nSELECT ... INTO results are not stored in the query cache even if SQL_CACHE is\nspecified.\n\nExamples\n--------\n\nSELECT id, data INTO @x,@y \nFROM test.t1 LIMIT 1;\nSELECT * from t1 where t1.a=@x and t1.b=@y\n\nIf you want to use this construct with UNION you have to use the syntax:\n\nSELECT  * INTO @x FROM (SELECT t1.a FROM t1 UNION SELECT t2.a FROM t2);\n\nURL: https://mariadb.com/kb/en/selectinto/','','https://mariadb.com/kb/en/selectinto/'),
(804,'COLUMN_CHECK',43,'Syntax\n------\n\nCOLUMN_CHECK(dyncol_blob);\n\nDescription\n-----------\n\nCheck if dyncol_blob is a valid packed dynamic columns blob. Return value of 1\nmeans the blob is valid, return value of 0 means it is not.\n\nRationale: Normally, one works with valid dynamic column blobs. Functions like\nCOLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE always return valid dynamic column\nblobs. However, if a dynamic column blob is accidentally truncated, or\ntranscoded from one character set to another, it will be corrupted. This\nfunction can be used to check if a value in a blob field is a valid dynamic\ncolumn blob.\n\nURL: https://mariadb.com/kb/en/column_check/','','https://mariadb.com/kb/en/column_check/'),
(806,'COLUMN_DELETE',43,'Syntax\n------\n\nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n\nDescription\n-----------\n\nDeletes a dynamic column with the specified name. Multiple names can be given.\nThe return value is a dynamic column blob after the modification.\n\nURL: https://mariadb.com/kb/en/column_delete/','','https://mariadb.com/kb/en/column_delete/'),
(807,'COLUMN_EXISTS',43,'Syntax\n------\n\nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n\nDescription\n-----------\n\nChecks if a column with name column_name exists in dyncol_blob. If yes, return\n1, otherwise return 0. See dynamic columns for more information.\n\nURL: https://mariadb.com/kb/en/column_exists/','','https://mariadb.com/kb/en/column_exists/'),
(311,'RESIGNAL',24,'Syntax\n------\n\nRESIGNAL [error_condition]\n  [SET error_property\n  [, error_property] ...]\n\nerror_condition:\n  SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n  error_property_name = <error_property_value>\n\nerror_property_name:\n  CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nDescription\n-----------\n\nThe syntax of RESIGNAL and its semantics are very similar to SIGNAL. This\nstatement can only be used within an error HANDLER. It produces an error, like\nSIGNAL. RESIGNAL clauses are the same as SIGNAL, except that they all are\noptional, even SQLSTATE. All the properties which are not specified in\nRESIGNAL, will be identical to the properties of the error that was received\nby the error HANDLER. For a description of the clauses, see diagnostics area.\n\nNote that RESIGNAL does not empty the diagnostics area: it just appends\nanother error condition.\n\nRESIGNAL, without any clauses, produces an error which is identical to the\nerror that was received by HANDLER.\n\nIf used out of a HANDLER construct, RESIGNAL produces the following error:\n\nERROR 1645 (0K000): RESIGNAL when handler not active\n\nIn MariaDB 5.5, if a HANDLER contained a CALL to another procedure, that\nprocedure could use RESIGNAL. Since MariaDB 10.0, trying to do this raises the\nabove error.\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nThe following procedure tries to query two tables which don\'t exist, producing\na 1146 error in both cases. Those errors will trigger the HANDLER. The first\ntime the error will be ignored and the client will not receive it, but the\nsecond time, the error is re-signaled, so the client will receive it.\n\nCREATE PROCEDURE test_error( )\nBEGIN\n DECLARE CONTINUE HANDLER\n   FOR 1146\n BEGIN\n IF @hide_errors IS FALSE THEN\n   RESIGNAL;\n END IF;\n END;\n SET @hide_errors = TRUE;\n SELECT \'Next error will be ignored\' AS msg;\n SELECT `c` FROM `temptab_one`;\n SELECT \'Next error won\'\'t be ignored\' AS msg;\n SET @hide_errors = FALSE;\n SELECT `c` FROM `temptab_two`;\nEND;\n\nCALL test_error( );\n\n+----------------------------+\n| msg                        |\n+----------------------------+\n| Next error will be ignored |\n+----------------------------+\n\n+-----------------------------+\n| msg                         |\n+-----------------------------+\n| Next error won\'t be ignored |\n+-----------------------------+\n\nERROR 1146 (42S02): Table \'test.temptab_two\' doesn\'t exist\n\nThe following procedure re-signals an error, modifying only the error message\nto clarify the cause of the problem.\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n   RESIGNAL SET\n   MESSAGE_TEXT = \'`temptab` does not exist\';\n END;\n SELECT `c` FROM `temptab`;\nEND;\n\nCALL test_error( );\nERROR 1146 (42S02): `temptab` does not exist\n\nAs explained above, this works on MariaDB 5.5, but produces a 1645 error since\n10.0.\n\nCREATE PROCEDURE handle_error()\nBEGIN\n RESIGNAL;\nEND;\nCREATE PROCEDURE p()\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION CALL p();\n SIGNAL SQLSTATE \'45000\';\nEND;\n\nURL: https://mariadb.com/kb/en/resignal/','','https://mariadb.com/kb/en/resignal/'),
(317,'DECLARE CURSOR',24,'Syntax\n------\n\n<= MariaDB 10.2\n\nDECLARE cursor_name CURSOR FOR select_statement\n\nFrom MariaDB 10.3\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n  name type [collate clause]\n\nFrom MariaDB 10.8\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n  [IN] name type [collate clause]\n\nDescription\n-----------\n\nThis statement declares a cursor. Multiple cursors may be declared in a stored\nprogram, but each cursor in a given block must have a unique name.\n\nselect_statement is not executed until the OPEN statement is executed. It is\nimportant to remember this if the query produces an error, or calls functions\nwhich have side effects.\n\nA SELECT associated to a cursor can use variables, but the query itself cannot\nbe a variable, and cannot be dynamically composed. The SELECT statement cannot\nhave an INTO clause.\n\nCursors must be declared before HANDLERs, but after local variables and\nCONDITIONs.\n\nParameters\n----------\n\nMariaDB starting with 10.3.0\n----------------------------\nFrom MariaDB 10.3.0, cursors can have parameters. This is a non-standard SQL\nextension. Cursor parameters can appear in any part of the DECLARE CURSOR\nselect_statement where a stored procedure variable is allowed (select list,\nWHERE, HAVING, LIMIT etc).\n\nIN\n--\n\nMariaDB starting with 10.8.0\n----------------------------\nFrom MariaDB 10.8.0 preview release, the IN qualifier is supported in the\ncursor_format_parameter part of the syntax.\n\nSee Cursor Overview for an example.\n\nURL: https://mariadb.com/kb/en/declare-cursor/','','https://mariadb.com/kb/en/declare-cursor/'),
(810,'COLUMN_LIST',43,'Syntax\n------\n\nCOLUMN_LIST(dyncol_blob);\n\nDescription\n-----------\n\nReturns a comma-separated list of column names. The names are quoted with\nbackticks.\n\nSee dynamic columns for more information.\n\nURL: https://mariadb.com/kb/en/column_list/','','https://mariadb.com/kb/en/column_list/'),
(811,'WSREP_LAST_SEEN_GTID',44,'MariaDB starting with 10.4.2\n----------------------------\nWSREP_LAST_SEEN_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_LAST_SEEN_GTID()\n\nDescription\n-----------\n\nReturns the Global Transaction ID of the most recent write transaction\nobserved by the client.\n\nThe result can be useful to determine the transaction to provide to\nWSREP_SYNC_WAIT_UPTO_GTID for waiting and unblocking purposes.\n\nURL: https://mariadb.com/kb/en/wsrep_last_seen_gtid/','','https://mariadb.com/kb/en/wsrep_last_seen_gtid/'),
(812,'WSREP_LAST_WRITTEN_GTID',44,'MariaDB starting with 10.4.2\n----------------------------\nWSREP_LAST_WRITTEN_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_LAST_WRITTEN_GTID()\n\nDescription\n-----------\n\nReturns the Global Transaction ID of the most recent write transaction\nperformed by the client.\n\nURL: https://mariadb.com/kb/en/wsrep_last_written_gtid/','','https://mariadb.com/kb/en/wsrep_last_written_gtid/'),
(814,'System-Versioned Tables',45,'MariaDB supports temporal data tables in the form of system-versioning tables\n(allowing you to query and operate on historic data, discussed below),\napplication-time periods (allow you to query and operate on a temporal range\nof data), and bitemporal tables (which combine both system-versioning and\napplication-time periods).\n\nSystem-Versioned Tables\n-----------------------\n\nSystem-versioned tables store the history of all changes, not only data which\nis currently valid. This allows data analysis for any point in time, auditing\nof changes and comparison of data from different points in time. Typical uses\ncases are:\n\n* Forensic analysis & legal requirements to store data for N years.\n* Data analytics (retrospective, trends etc.), e.g. to get your staff\ninformation as of one year ago.\n* Point-in-time recovery - recover a table state as of particular point in\ntime.\n\nSystem-versioned tables were first introduced in the SQL:2011 standard.\n\nCreating a System-Versioned Table\n---------------------------------\n\nThe CREATE TABLE syntax has been extended to permit creating a\nsystem-versioned table. To be system-versioned, according to SQL:2011, a table\nmust have two generated columns, a period, and a special table option clause:\n\nCREATE TABLE t(\n x INT,\n start_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW START,\n end_timestamp TIMESTAMP(6) GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME(start_timestamp, end_timestamp)\n) WITH SYSTEM VERSIONING;\n\nIn MariaDB one can also use a simplified syntax:\n\nCREATE TABLE t (\n x INT\n) WITH SYSTEM VERSIONING;\n\nIn the latter case no extra columns will be created and they won\'t clutter the\noutput of, say, SELECT * FROM t. The versioning information will still be\nstored, and it can be accessed via the pseudo-columns ROW_START and ROW_END:\n\nSELECT x, ROW_START, ROW_END FROM t;\n\nAdding or Removing System Versioning To/From a Table\n----------------------------------------------------\n\nAn existing table can be altered to enable system versioning for it.\n\nCREATE TABLE t(\n x INT\n);\n\nALTER TABLE t ADD SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING\n\nSimilarly, system versioning can be removed from a table:\n\nALTER TABLE t DROP SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nOne can also add system versioning with all columns created explicitly:\n\nALTER TABLE t ADD COLUMN ts TIMESTAMP(6) GENERATED ALWAYS AS ROW START,\n       ADD COLUMN te TIMESTAMP(6) GENERATED ALWAYS AS ROW END,\n       ADD PERIOD FOR SYSTEM_TIME(ts, te),\n       ADD SYSTEM VERSIONING;\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `x` int(11) DEFAULT NULL,\n `ts` timestamp(6) GENERATED ALWAYS AS ROW START,\n `te` timestamp(6) GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME (`ts`, `te`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING\n\nInserting Data\n--------------\n\nWhen data is inserted into a system-versioned table, it is given a row_start\nvalue of the current timestamp, and a row_end value of\nFROM_UNIXTIME(2147483647.999999). The current timestamp can be adjusted by\nsetting the timestamp system variable, for example:\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2022-10-24 23:09:38 |\n+---------------------+\n\nINSERT INTO t VALUES(1);\n\nSET @@timestamp = UNIX_TIMESTAMP(\'2033-10-24\');\n\nINSERT INTO t VALUES(2);\n\nSET @@timestamp = default;\n\nINSERT INTO t VALUES(3);\n\nSELECT a,row_start,row_end FROM t;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:09:38.951347 | 2038-01-19 05:14:07.999999 |\n|    2 | 2033-10-24 00:00:00.000000 | 2038-01-19 05:14:07.999999 |\n|    3 | 2022-10-24 23:09:38.961857 | 2038-01-19 05:14:07.999999 |\n+------+----------------------------+----------------------------+\n\nQuerying Historical Data\n------------------------\n\nSELECT\n------\n\nTo query the historical data one uses the clause FOR SYSTEM_TIME directly\nafter the table name (before the table alias, if any). SQL:2011 provides three\nsyntactic extensions:\n\n* AS OF is used to see the table as it was at a specific point in time in the\npast:\n\nSELECT * FROM t FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09 08:07:06\';\n\n* BETWEEN start AND end will show all rows that were visible at any point\nbetween two specified points in time. It works inclusively, a row visible\nexactly at start or exactly at end will be shown too.\n\nSELECT * FROM t FOR SYSTEM_TIME BETWEEN (NOW() - INTERVAL 1 YEAR) AND NOW();\n\n* FROM start TO end will also show all rows that were visible at any point\nbetween two specified points in time, including start, but excluding end.\n\nSELECT * FROM t FOR SYSTEM_TIME FROM \'2016-01-01 00:00:00\' TO \'2017-01-01\n00:00:00\';\n\nAdditionally MariaDB implements a non-standard extension:\n\n* ALL will show all rows, historical and current.\n\nSELECT * FROM t FOR SYSTEM_TIME ALL;\n\nIf the FOR SYSTEM_TIME clause is not used, the table will show the current\ndata. This is usually the same as if one had specified FOR SYSTEM_TIME AS OF\nCURRENT_TIMESTAMP, unless one has adjusted the row_start value (until MariaDB\n10.11, only possible by setting the secure_timestamp variable). For example:\n\nCREATE OR REPLACE TABLE t (a int) WITH SYSTEM VERSIONING;\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2022-10-24 23:43:37 |\n+---------------------+\n\nINSERT INTO t VALUES (1);\n\nSET @@timestamp = UNIX_TIMESTAMP(\'2033-03-03\');\n\nINSERT INTO t VALUES (2);\n\nDELETE FROM t;\n\nSET @@timestamp = default;\n\nSELECT a, row_start, row_end FROM t FOR SYSTEM_TIME ALL;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:43:37.192725 | 2033-03-03 00:00:00.000000 |\n|    2 | 2033-03-03 00:00:00.000000 | 2033-03-03 00:00:00.000000 |\n+------+----------------------------+----------------------------+\n2 rows in set (0.000 sec)\n\nSELECT a, row_start, row_end FROM t FOR SYSTEM_TIME AS OF CURRENT_TIMESTAMP;\n+------+----------------------------+----------------------------+\n| a    | row_start                  | row_end                    |\n+------+----------------------------+----------------------------+\n|    1 | 2022-10-24 23:43:37.192725 | 2033-03-03 00:00:00.000000 |\n+------+----------------------------+----------------------------+\n1 row in set (0.000 sec)\n\nSELECT a, row_start, row_end FROM t;\nEmpty set (0.001 sec)\n\nViews and Subqueries\n--------------------\n\nWhen a system-versioned tables is used in a view or in a subquery in the from\nclause, FOR SYSTEM_TIME can be used directly in the view or subquery body, or\n(non-standard) applied to the whole view when it\'s being used in a SELECT:\n\nCREATE VIEW v1 AS SELECT * FROM t FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09\n08:07:06\';\n\nOr\n\nCREATE VIEW v1 AS SELECT * FROM t;\nSELECT * FROM v1 FOR SYSTEM_TIME AS OF TIMESTAMP\'2016-10-09 08:07:06\';\n\nUse in Replication and Binary Logs\n----------------------------------\n\nTables that use system-versioning implicitly add the row_end column to the\nPrimary Key. While this is generally not an issue for most use cases, it can\nlead to problems when re-applying write statements from the binary log or in\nreplication environments, where a primary retries an SQL statement on the\nreplica.\n\nSpecifically, these writes include a value on the row_end column containing\nthe timestamp from when the write was initially made. The re-occurrence of the\nPrimary Key with the old system-versioning columns raises an error due to the\nduplication.\n\nTo mitigate this with MariaDB Replication, set the secure_timestamp system\nvariable to YES on the replica. When set, the replica uses its own system\nclock when applying to the row log, meaning that the primary can retry as many\ntimes as needed without causing a conflict. The retries generate new\nhistorical rows with new values for the row_start and row_end columns.\n\nTransaction-Precise History in InnoDB\n-------------------------------------\n\nA point in time when a row was inserted or deleted does not necessarily mean\nthat a change became visible at the same moment. With transactional tables, a\nrow might have been inserted in a long transaction, and became visible hours\nafter it was inserted.\n\nFor some applications — for example, when doing data analytics on one-year-old\ndata — this distinction does not matter much. For others — forensic analysis —\nit might be crucial.\n\nMariaDB supports transaction-precise history (only for the InnoDB storage\nengine) that allows seeing the data exactly as it would\'ve been seen by a new\nconnection doing a SELECT at the specified point in time — rows inserted\nbefore that point, but committed after will not be shown.\n\nTo use transaction-precise history, InnoDB needs to remember not timestamps,\nbut transaction identifier per row. This is done by creating generated columns\nas BIGINT UNSIGNED, not TIMESTAMP(6):\n\nCREATE TABLE t(\n x INT,\n start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START,\n end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END,\n PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)\n) WITH SYSTEM VERSIONING;\n\nThese columns must be specified explicitly, but they can be made INVISIBLE to\navoid cluttering SELECT * output.\n\nWhen one uses transaction-precise history, one can optionally use transaction\nidentifiers in the FOR SYSTEM_TIME clause:\n\nSELECT * FROM t FOR SYSTEM_TIME AS OF TRANSACTION 12345;\n\nThis will show the data, exactly as it was seen by the transaction with the\nidentifier 12345.\n\nStoring the History Separately\n------------------------------\n\nWhen the history is stored together with the current data, it increases the\nsize of the table, so current data queries — table scans and index searches —\nwill take more time, because they will need to skip over historical data. If\nmost queries on that table use only current data, it might make sense to store\nthe history separately, to reduce the overhead from versioning.\n\nThis is done by partitioning the table by SYSTEM_TIME. Because of the\npartition pruning optimization, all current data queries will only access one\npartition, the one that stores current data.\n\nThis example shows how to create such a partitioned table:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME (\n  PARTITION p_hist HISTORY,\n  PARTITION p_cur CURRENT\n );\n\nIn this example all history will be stored in the partition p_hist while all\ncurrent data will be in the partition p_cur. The table must have exactly one\ncurrent partition and at least one historical partition.\n\nPartitioning by SYSTEM_TIME also supports automatic partition rotation. One\ncan rotate historical partitions by time or by size. This example shows how to\nrotate partitions by size:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME LIMIT 100000 (\n  PARTITION p0 HISTORY,\n  PARTITION p1 HISTORY,\n  PARTITION pcur CURRENT\n );\n\nMariaDB will start writing history rows into partition p0, and when it reaches\na size of 100000 rows, MariaDB will switch to partition p1. There are only two\nhistorical partitions, so when p1 overflows, MariaDB will issue a warning, but\nwill continue writing into it.\n\nSimilarly, one can rotate partitions by time:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK (\n  PARTITION p0 HISTORY,\n  PARTITION p1 HISTORY,\n  PARTITION p2 HISTORY,\n  PARTITION pcur CURRENT\n );\n\nThis means that the history for the first week after the table was created\nwill be stored in p0. The history for the second week — in p1, and all later\nhistory will go into p2. One can see the exact rotation time for each\npartition in the INFORMATION_SCHEMA.PARTITIONS table.\n\nIt is possible to combine partitioning by SYSTEM_TIME and subpartitions:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME\n  SUBPARTITION BY KEY (x)\n  SUBPARTITIONS 4 (\n  PARTITION ph HISTORY,\n  PARTITION pc CURRENT\n );\n\nDefault Partitions\n------------------\n\nMariaDB starting with 10.5.0\n----------------------------\nSince partitioning by current and historical data is such a typical usecase,\nfrom MariaDB 10.5, it is possible to use a simplified statement to do so. For\nexample, instead of\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME (\n  PARTITION p0 HISTORY,\n  PARTITION pn CURRENT\n);\n\nyou can use\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME;\n\nYou can also specify the number of partitions, which is useful if you want to\nrotate history by time, for example:\n\nCREATE TABLE t (x INT) WITH SYSTEM VERSIONING \n PARTITION BY SYSTEM_TIME\n  INTERVAL 1 MONTH\n  PARTITIONS 12;\n\nSpecifying the number of partitions without specifying a rotation condition\nwill result in a warning:\n\nCREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME PARTITIONS 12;\nQuery OK, 0 rows affected, 1 warning (0.518 sec)\n\nWarning (Code 4115): Maybe missing parameters: no rotation condition for\nmultiple HISTORY partitions.\n\nwhile specifying only 1 partition will result in an error:\n\nCREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME PARTITIONS 1;\nERROR 4128 (HY000): Wrong partitions for `t`: must have at least one HISTORY\nand exactly one last CURRENT\n\nAutomatically Creating Partitions\n---------------------------------\n\nMariaDB starting with 10.9.1\n----------------------------\nFrom MariaDB 10.9.1, the AUTO keyword can be used to automatically create\nhistory partitions.\n\nFor example\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n  PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 MONTH\n STARTS \'2021-01-01 00:00:00\' AUTO PARTITIONS 12;\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME LIMIT 1000 AUTO;\n\nOr with explicit partitions:\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO\n (PARTITION p0 HISTORY, PARTITION pn CURRENT);\n\nTo disable or enable auto-creation one can use ALTER TABLE by adding or\nremoving AUTO from the partitioning specification:\n\nCREATE TABLE t1 (x int) WITH SYSTEM VERSIONING\n PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n\n# Disables auto-creation:\nALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR;\n\n# Enables auto-creation:\nALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;\n\nIf the rest of the partitioning specification is identical to CREATE TABLE, no\nrepartitioning will be done (for details see MDEV-27328).\n\nRemoving Old History\n--------------------\n\nBecause it stores all the history, a system-versioned table might grow very\nlarge over time. There are many options to trim down the space and remove the\nold history.\n\nOne can completely drop the versioning from the table and add it back again,\nthis will delete all the history:\n\nALTER TABLE t DROP SYSTEM VERSIONING;\nALTER TABLE t ADD SYSTEM VERSIONING;\n\nIt might be a rather time-consuming operation, though, as the table will need\nto be rebuilt, possibly twice (depending on the storage engine).\n\nAnother option would be to use partitioning and drop some of historical\npartitions:\n\nALTER TABLE t DROP PARTITION p0;\n\nNote, that one cannot drop a current partition or the only historical\npartition.\n\nAnd the third option; one can use a variant of the DELETE statement to prune\nthe history:\n\nDELETE HISTORY FROM t;\n\nor only old history up to a specific point in time:\n\nDELETE HISTORY FROM t BEFORE SYSTEM_TIME \'2016-10-09 08:07:06\';\n\nor to a specific transaction (with BEFORE SYSTEM_TIME TRANSACTION xxx).\n\nTo protect the integrity of the history, this statement requires a special\nDELETE HISTORY privilege.\n\nCurrently, using the DELETE HISTORY statement with a BEFORE SYSTEM_TIME\ngreater than the ROW_END of the active records (as a TIMESTAMP, this has a\nmaximum value of \'2038-01-19 03:14:07\' UTC) will result in the historical\nrecords being dropped, and the active records being deleted and moved to\nhistory. See MDEV-25468.\n\nPrior to MariaDB 10.4.5, the TRUNCATE TABLE statement drops all historical\nrecords from a system-versioned-table.\n\nFrom MariaDB 10.4.5, historic data is protected from TRUNCATE statements, as\nper the SQL standard, and an Error 4137 is instead raised:\n\nTRUNCATE t;\nERROR 4137 (HY000): System-versioned tables do not support TRUNCATE TABLE\n\nExcluding Columns From Versioning\n---------------------------------\n\nAnother MariaDB extension allows to version only a subset of columns in a\ntable. This is useful, for example, if you have a table with user information\nthat should be versioned, but one column is, let\'s say, a login counter that\nis incremented often and is not interesting to version. Such a column can be\nexcluded from versioning by declaring it WITHOUT VERSIONING\n\nCREATE TABLE t (\n x INT,\n y INT WITHOUT SYSTEM VERSIONING\n) WITH SYSTEM VERSIONING;\n\nA column can also be declared WITH VERSIONING, that will automatically make\nthe table versioned. The statement below is equivalent to the one above:\n\nCREATE TABLE t (\n x INT WITH SYSTEM VERSIONING,\n y INT\n);\n\nChanges in other sections: https://mariadb.com/kb/en/create-table/\nhttps://mariadb.com/kb/en/alter-table/ https://mariadb.com/kb/en/join-syntax/\nhttps://mariadb.com/kb/en/partitioning-types-overview/\nhttps://mariadb.com/kb/en/date-and-time-units/\nhttps://mariadb.com/kb/en/delete/ https://mariadb.com/kb/en/grant/\n\nthey all reference back to this page\n\nAlso, TODO:\n\n* limitations (size, speed, adding history to unique not nullable columns)\n\nSystem Variables\n----------------\n\nThere are a number of system variables related to system-versioned tables:\n\nsystem_versioning_alter_history\n-------------------------------\n\n* Description: SQL:2011 does not allow ALTER TABLE on system-versioned tables.\nWhen this variable is set to ERROR, an attempt to alter a system-versioned\ntable will result in an error. When this variable is set to KEEP, ALTER TABLE\nwill be allowed, but the history will become incorrect — querying historical\ndata will show the new table structure. This mode is still useful, for\nexample, when adding new columns to a table. Note that if historical data\ncontains or would contain nulls, attempting to ALTER these columns to be NOT\nNULL will return an error (or warning if strict_mode is not set).\n* Commandline: --system-versioning-alter-history=value\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Enum\n* Default Value: ERROR\n* Valid Values: ERROR, KEEP\n\nsystem_versioning_asof\n----------------------\n\n* Description: If set to a specific timestamp value, an implicit FOR\nSYSTEM_TIME AS OF clause will be applied to all queries. This is useful if one\nwants to do many queries for history at the specific point in time. Set it to\nDEFAULT to restore the default behavior. Has no effect on DML, so queries such\nas INSERT .. SELECT and REPLACE .. SELECT need to state AS OF explicitly.\n* Commandline: None\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Varchar\n* Default Value: DEFAULT\n\nsystem_versioning_innodb_algorithm_simple\n-----------------------------------------\n\n* Description: Never fully implemented and removed in the following release.\n* Commandline: --system-versioning-innodb-algorithm-simple[={0|1}]\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Boolean\n* Default Value: ON\n* Introduced: MariaDB 10.3.4\n* Removed: MariaDB 10.3.5\n\nsystem_versioning_insert_history\n--------------------------------\n\n* Description: Allows direct inserts into ROW_START and ROW_END columns if\nsecure_timestamp allows changing timestamp.\n* Commandline: --system-versioning-insert-history[={0|1}]\n* Scope: Global, Session\n* Dynamic: Yes\n* Type: Boolean\n* Default Value: OFF\n* Introduced: MariaDB 10.11.0\n\nLimitations\n-----------\n\n* Versioning clauses can not be applied to generated (virtual and persistent)\ncolumns.\n* Before MariaDB 10.11, mariadb-dump did not read historical rows from\nversioned tables, and so historical data would not be backed up. Also, a\nrestore of the timestamps would not be possible as they cannot be defined by\nan insert/a user. From MariaDB 10.11, use the -H or --dump-history options to\ninclude the history.\n\nURL: https://mariadb.com/kb/en/system-versioned-tables/','','https://mariadb.com/kb/en/system-versioned-tables/'),
(815,'Application-Time Periods',45,'MariaDB starting with 10.4.3\n----------------------------\nSupport for application-time period-versioning was added in MariaDB 10.4.3.\n\nExtending system-versioned tables, MariaDB 10.4 supports application-time\nperiod tables. Time periods are defined by a range between two temporal\ncolumns. The columns must be of the same temporal data type, i.e. DATE,\nTIMESTAMP or DATETIME (TIME and YEAR are not supported), and of the same width.\n\nUsing time periods implicitly defines the two columns as NOT NULL. It also\nadds a constraint to check whether the first value is less than the second\nvalue. The constraint is invisible to SHOW CREATE TABLE statements. The name\nof this constraint is prefixed by the time period name, to avoid conflict with\nother constraints.\n\nCreating Tables with Time Periods\n---------------------------------\n\nTo create a table with a time period, use a CREATE TABLE statement with the\nPERIOD table option.\n\nCREATE TABLE t1(\n name VARCHAR(50),\n date_1 DATE,\n date_2 DATE,\n PERIOD FOR date_period(date_1, date_2));\n\nThis creates a table with a time_period period and populates the table with\nsome basic temporal values.\n\nExamples are available in the MariaDB Server source code, at\nmysql-test/suite/period/r/create.result.\n\nAdding and Removing Time Periods\n--------------------------------\n\nThe ALTER TABLE statement now supports syntax for adding and removing time\nperiods from a table. To add a period, use the ADD PERIOD clause.\n\nFor example:\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE\n );\n\nALTER TABLE rooms ADD PERIOD FOR p(checkin,checkout);\n\nTo remove a period, use the DROP PERIOD clause:\n\nALTER TABLE rooms DROP PERIOD FOR p;\n\nBoth ADD PERIOD and DROP PERIOD clauses include an option to handle whether\nthe period already exists:\n\nALTER TABLE rooms ADD PERIOD IF NOT EXISTS FOR p(checkin,checkout);\n\nALTER TABLE rooms DROP PERIOD IF EXISTS FOR p;\n\nDeletion by Portion\n-------------------\n\nYou can also remove rows that fall within certain time periods.\n\nWhen MariaDB executes a DELETE FOR PORTION statement, it removes the row:\n\n* When the row period falls completely within the delete period, it removes\nthe row.\n* When the row period overlaps the delete period, it shrinks the row, removing\nthe overlap from the first or second row period value.\n* When the delete period falls completely within the row period, it splits the\nrow into two rows.  The first row runs from the starting row period to the\nstarting delete period.  The second runs from the ending delete period to the\nending row period.\n\nTo test this, first populate the table with some data to operate on:\n\nCREATE TABLE t1(\n name VARCHAR(50),\n date_1 DATE,\n date_2 DATE,\n PERIOD FOR date_period(date_1, date_2));\n\nINSERT INTO t1 (name, date_1, date_2) VALUES\n  (\'a\', \'1999-01-01\', \'2000-01-01\'),\n  (\'b\', \'1999-01-01\', \'2018-12-12\'),\n  (\'c\', \'1999-01-01\', \'2017-01-01\'),\n  (\'d\', \'2017-01-01\', \'2019-01-01\');\n\nSELECT * FROM t1;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2017-01-01 |\n| d    | 2017-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nThen, run the DELETE FOR PORTION statement:\n\nDELETE FROM t1\nFOR PORTION OF date_period\n  FROM \'2001-01-01\' TO \'2018-01-01\';\nQuery OK, 3 rows affected (0.028 sec)\n\nSELECT * FROM t1 ORDER BY name;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2001-01-01 |\n| b    | 2018-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2001-01-01 |\n| d    | 2018-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nHere:\n\n* a is unchanged, as the range falls entirely out of the specified portion to\nbe deleted.\n* b, with values ranging from 1999 to 2018, is split into two rows, 1999 to\n2000 and 2018-01 to 2018-12.\n* c, with values ranging from 1999 to 2017, where only the upper value falls\nwithin the portion to be deleted, has been shrunk to 1999 to 2001.\n* d, with values ranging from 2017 to 2019, where only the lower value falls\nwithin the portion to be deleted, has been shrunk to 2018 to 2019.\n\nThe DELETE FOR PORTION statement has the following restrictions\n\n* The FROM...TO clause must be constant\n* Multi-delete is not supported\n\nIf there are DELETE or INSERT triggers, it works as follows: any matched row\nis deleted, and then one or two rows are inserted. If the record is deleted\ncompletely, nothing is inserted.\n\nUpdating by Portion\n-------------------\n\nThe UPDATE syntax now supports UPDATE FOR PORTION, which modifies rows based\non their occurrence in a range:\n\nTo test it, first populate the table with some data:\n\nTRUNCATE t1;\n\nINSERT INTO t1 (name, date_1, date_2) VALUES\n  (\'a\', \'1999-01-01\', \'2000-01-01\'),\n  (\'b\', \'1999-01-01\', \'2018-12-12\'),\n  (\'c\', \'1999-01-01\', \'2017-01-01\'),\n  (\'d\', \'2017-01-01\', \'2019-01-01\');\n\nSELECT * FROM t1;\n+------+------------+------------+\n| name | date_1     | date_2     |\n+------+------------+------------+\n| a    | 1999-01-01 | 2000-01-01 |\n| b    | 1999-01-01 | 2018-12-12 |\n| c    | 1999-01-01 | 2017-01-01 |\n| d    | 2017-01-01 | 2019-01-01 |\n+------+------------+------------+\n\nThen run the update:\n\nUPDATE t1 FOR PORTION OF date_period\n FROM \'2000-01-01\' TO \'2018-01-01\'\nSET name = CONCAT(name,\'_original\');\n\nSELECT * FROM t1 ORDER BY name;\n+------------+------------+------------+\n| name       | date_1     | date_2     |\n+------------+------------+------------+\n| a          | 1999-01-01 | 2000-01-01 |\n| b          | 1999-01-01 | 2000-01-01 |\n| b          | 2018-01-01 | 2018-12-12 |\n| b_original | 2000-01-01 | 2018-01-01 |\n| c          | 1999-01-01 | 2000-01-01 |\n| c_original | 2000-01-01 | 2017-01-01 |\n| d          | 2018-01-01 | 2019-01-01 |\n| d_original | 2017-01-01 | 2018-01-01 |\n+------------+------------+------------+\n\n* a is unchanged, as the range falls entirely out of the specified portion to\nbe deleted.\n* b, with values ranging from 1999 to 2018, is split into two rows, 1999 to\n2000 and 2018-01 to 2018-12.\n* c, with values ranging from 1999 to 2017, where only the upper value falls\nwithin the portion to be deleted, has been shrunk to 1999 to 2001.\n* d, with values ranging from 2017 to 2019, where only the lower value falls\nwithin the portion to be deleted, has been shrunk to 2018 to 2019. \n* Original rows affected by the update have \"_original\" appended to the name.\n\nThe UPDATE FOR PORTION statement has the following limitations:\n\n* The operation cannot modify the two temporal columns used by the time period\n* The operation cannot reference period values in the SET expression\n* FROM...TO expressions must be constant\n\nWITHOUT OVERLAPS\n----------------\n\nMariaDB starting with 10.5.3\n----------------------------\nMariaDB 10.5 introduced a new clause, WITHOUT OVERLAPS, which allows one to\ncreate an index specifying that application time periods should not overlap.\n\nAn index constrained by WITHOUT OVERLAPS is required to be either a primary\nkey or a unique index.\n\nTake the following example, an application time period table for a booking\nsystem:\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE,\n PERIOD FOR p(checkin,checkout)\n );\n\nINSERT INTO rooms VALUES \n (1, \'Regina\', \'2020-10-01\', \'2020-10-03\'),\n (2, \'Cochise\', \'2020-10-02\', \'2020-10-05\'),\n (1, \'Nowell\', \'2020-10-03\', \'2020-10-07\'),\n (2, \'Eusebius\', \'2020-10-04\', \'2020-10-06\');\n\nOur system is not intended to permit overlapping bookings, so the fourth\nrecord above should not have been inserted. Using WITHOUT OVERLAPS in a unique\nindex (in this case based on a combination of room number and the application\ntime period) allows us to specify this constraint in the table definition.\n\nCREATE OR REPLACE TABLE rooms (\n room_number INT,\n guest_name VARCHAR(255),\n checkin DATE,\n checkout DATE,\n PERIOD FOR p(checkin,checkout),\n UNIQUE (room_number, p WITHOUT OVERLAPS)\n );\n\nINSERT INTO rooms VALUES \n (1, \'Regina\', \'2020-10-01\', \'2020-10-03\'),\n (2, \'Cochise\', \'2020-10-02\', \'2020-10-05\'),\n (1, \'Nowell\', \'2020-10-03\', \'2020-10-07\'),\n (2, \'Eusebius\', \'2020-10-04\', \'2020-10-06\');\nERROR 1062 (23000): Duplicate entry \'2-2020-10-06-2020-10-04\' for key\n\'room_number\'\n\nFurther Examples\n----------------\n\nThe implicit change from NULL to NOT NULL:\n\nCREATE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime DEFAULT NULL,\n `d2` datetime DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\nALTER TABLE t2 ADD PERIOD FOR p(d1,d2);\n\nSHOW CREATE TABLE t2\\G\n*************************** 1. row ***************************\n   Table: t2\nCreate Table: CREATE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime NOT NULL,\n `d2` datetime NOT NULL,\n PERIOD FOR `p` (`d1`, `d2`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nDue to this constraint, trying to add a time period where null data already\nexists will fail.\n\nCREATE OR REPLACE TABLE `t2` (\n `id` int(11) DEFAULT NULL,\n `d1` datetime DEFAULT NULL,\n `d2` datetime DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\nINSERT INTO t2(id) VALUES(1);\n\nALTER TABLE t2 ADD PERIOD FOR p(d1,d2);\nERROR 1265 (01000): Data truncated for column \'d1\' at row 1\n\nURL: https://mariadb.com/kb/en/application-time-periods/','','https://mariadb.com/kb/en/application-time-periods/'),
(817,'ST_AsGeoJSON',46,'Syntax\n------\n\nST_AsGeoJSON(g[, max_decimals[, options]])\n\nDescription\n-----------\n\nReturns the given geometry g as a GeoJSON element. The optional max_decimals\nlimits the maximum number of decimals displayed.\n\nThe optional options flag can be set to 1 to add a bounding box to the output.\n\nExamples\n--------\n\nSELECT ST_AsGeoJSON(ST_GeomFromText(\'POINT(5.3 7.2)\'));\n+-------------------------------------------------+\n| ST_AsGeoJSON(ST_GeomFromText(\'POINT(5.3 7.2)\')) |\n+-------------------------------------------------+\n| {\"type\": \"Point\", \"coordinates\": [5.3, 7.2]}    |\n+-------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/geojson-st_asgeojson/','','https://mariadb.com/kb/en/geojson-st_asgeojson/'),
(820,'Addition Operator (+)',48,'Syntax\n------\n\n+\n\nDescription\n-----------\n\nAddition.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 3+5;\n+-----+\n| 3+5 |\n+-----+\n|   8 |\n+-----+\n\nURL: https://mariadb.com/kb/en/addition-operator/','','https://mariadb.com/kb/en/addition-operator/'),
(314,'SIGNAL',24,'Syntax\n------\n\nSIGNAL error_condition\n  [SET error_property\n  [, error_property] ...]\n\nerror_condition:\n  SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n  error_property_name = <error_property_value>\n\nerror_property_name:\n  CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nSIGNAL empties the diagnostics area and produces a custom error. This\nstatement can be used anywhere, but is generally useful when used inside a\nstored program. When the error is produced, it can be caught by a HANDLER. If\nnot, the current stored program, or the current statement, will terminate with\nthe specified error.\n\nSometimes an error HANDLER just needs to SIGNAL the same error it received,\noptionally with some changes. Usually the RESIGNAL statement is the most\nconvenient way to do this.\n\nerror_condition can be an SQLSTATE value or a named error condition defined\nvia DECLARE CONDITION. SQLSTATE must be a constant string consisting of five\ncharacters. These codes are standard to ODBC and ANSI SQL. For customized\nerrors, the recommended SQLSTATE is \'45000\'. For a list of SQLSTATE values\nused by MariaDB, see the MariaDB Error Codes page. The SQLSTATE can be read\nvia the API method mysql_sqlstate( ).\n\nTo specify error properties user-defined variables and local variables can be\nused, as well as character set conversions (but you can\'t set a collation).\n\nThe error properties, their type and their default values are explained in the\ndiagnostics area page.\n\nErrors\n------\n\nIf the SQLSTATE is not valid, the following error like this will be produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'123456\'\n\nIf a property is specified more than once, an error like this will be produced:\n\nERROR 1641 (42000): Duplicate condition information item \'MESSAGE_TEXT\'\n\nIf you specify a condition name which is not declared, an error like this will\nbe produced:\n\nERROR 1319 (42000): Undefined CONDITION: cond_name\n\nIf MYSQL_ERRNO is out of range, you will get an error like this:\n\nERROR 1231 (42000): Variable \'MYSQL_ERRNO\' can\'t be set to the value of \'0\'\n\nExamples\n--------\n\nHere\'s what happens if SIGNAL is used in the client to generate errors:\n\nSIGNAL SQLSTATE \'01000\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n\n+---------+------+------------------------------------------+\n| Level   | Code | Message                                  |\n+---------+------+------------------------------------------+\n| Warning | 1642 | Unhandled user-defined warning condition |\n+---------+------+------------------------------------------+\n1 row in set (0.06 sec)\n\nSIGNAL SQLSTATE \'02000\';\nERROR 1643 (02000): Unhandled user-defined not found condition\n\nHow to specify MYSQL_ERRNO and MESSAGE_TEXT properties:\n\nSIGNAL SQLSTATE \'45000\' SET MYSQL_ERRNO=30001, MESSAGE_TEXT=\'H\nello, world!\';\n\nERROR 30001 (45000): Hello, world!\n\nThe following code shows how to use user variables, local variables and\ncharacter set conversion with SIGNAL:\n\nCREATE PROCEDURE test_error(x INT)\nBEGIN\n DECLARE errno SMALLINT UNSIGNED DEFAULT 31001;\n SET @errmsg = \'Hello, world!\';\n IF x = 1 THEN\n   SIGNAL SQLSTATE \'45000\' SET\n   MYSQL_ERRNO = errno,\n   MESSAGE_TEXT = @errmsg;\n ELSE\n   SIGNAL SQLSTATE \'45000\' SET\n   MYSQL_ERRNO = errno,\n   MESSAGE_TEXT = _utf8\'Hello, world!\';\n END IF;\nEND;\n\nHow to use named error conditions:\n\nCREATE PROCEDURE test_error(n INT)\nBEGIN\n DECLARE `too_big` CONDITION FOR SQLSTATE \'45000\';\n IF n > 10 THEN\n   SIGNAL `too_big`;\n END IF;\nEND;\n\nIn this example, we\'ll define a HANDLER for an error code. When the error\noccurs, we SIGNAL a more informative error which makes sense for our procedure:\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE EXIT HANDLER\n FOR 1146\n BEGIN\n   SIGNAL SQLSTATE \'45000\' SET\n   MESSAGE_TEXT = \'Temporary tables not found; did you call init()\nprocedure?\';\n END;\n -- this will produce a 1146 error\n SELECT `c` FROM `temptab`;\nEND;\n\nURL: https://mariadb.com/kb/en/signal/','','https://mariadb.com/kb/en/signal/'),
(324,'LINESTRING',25,'Syntax\n------\n\nLineString(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB LineString value from a number of WKB Point arguments. If any\nargument is not a WKB Point, the return value is NULL. If the number of Point\narguments is less than two, the return value is NULL.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3)                          |\n+-------------------------------------+\n\nCREATE TABLE gis_line  (g LINESTRING);\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nURL: https://mariadb.com/kb/en/linestring/','','https://mariadb.com/kb/en/linestring/'),
(822,'Modulo Operator (%)',48,'Syntax\n------\n\nN % M\n\nDescription\n-----------\n\nModulo operator. Returns the remainder of N divided by M. See also MOD.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n|        42 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/modulo-operator/','','https://mariadb.com/kb/en/modulo-operator/'),
(825,'CHANGE MASTER TO',49,'The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nCHANGE MASTER [\'connection_name\'] TO master_def  [, master_def] ... \n [FOR CHANNEL \'channel_name\']\n\nmaster_def:\n  MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_DELAY = interval\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_USE_GTID = {current_pos|slave_pos|no}\n | MASTER_DEMOTE_TO_SLAVE = bool\n | IGNORE_SERVER_IDS = (server_id_list)\n | DO_DOMAIN_IDS = ([N,..])\n | IGNORE_DOMAIN_IDS = ([N,..])\n\nDescription\n-----------\n\nThe CHANGE MASTER statement sets the options that a replica uses to connect to\nand replicate from a primary.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nto using the channel_name directly after CHANGE MASTER.\n\nMulti-Source Replication\n------------------------\n\nIf you are using multi-source replication, then you need to specify a\nconnection name when you execute CHANGE MASTER. There are two ways to do this:\n\n* Setting the default_master_connection system variable prior to executing\nCHANGE MASTER.\n* Setting the connection_name parameter when executing CHANGE MASTER.\n\ndefault_master_connection\n-------------------------\n\nSET default_master_connection = \'gandalf\';\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nconnection_name\n---------------\n\nSTOP SLAVE \'gandalf\';\nCHANGE MASTER \'gandalf\' TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE \'gandalf\';\n\nOptions\n-------\n\nConnection Options\n------------------\n\nMASTER_USER\n-----------\n\nThe MASTER_USER option for CHANGE MASTER defines the user account that the\nreplica will use to connect to the primary.\n\nThis user account will need the REPLICATION SLAVE privilege (or, from MariaDB\n10.5.1, the REPLICATION REPLICA on the primary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_USER string is 96 characters until MariaDB\n10.5, and 128 characters from MariaDB 10.6.\n\nMASTER_PASSWORD\n---------------\n\nThe MASTER_PASSWORD option for CHANGE MASTER defines the password that the\nreplica will use to connect to the primary as the user account defined by the\nMASTER_USER option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_PASSWORD string is 32 characters. The\neffective maximum length of the string depends on how many bytes are used per\ncharacter and can be up to 96 characters.\n\nDue to MDEV-29994, the password can be silently truncated to 41 characters\nwhen MariaDB is restarted. For this reason it is recommended to use a password\nthat is shorter than this.\n\nMASTER_HOST\n-----------\n\nThe MASTER_HOST option for CHANGE MASTER defines the hostname or IP address of\nthe primary.\n\nIf you set the value of the MASTER_HOST option to the empty string, then that\nis not the same as not setting the option\'s value at all. If you set the value\nof the MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwill fail with an error. In MariaDB 5.3 and before, if you set the value of\nthe MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwould succeed, but the subsequent START SLAVE command would fail.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_HOST option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nThe maximum length of the MASTER_HOST string is 60 characters until MariaDB\n10.5, and 255 characters from MariaDB 10.6.\n\nMASTER_PORT\n-----------\n\nThe MASTER_PORT option for CHANGE MASTER defines the TCP/IP port of the\nprimary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_PORT=3307,\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_PORT option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nMASTER_CONNECT_RETRY\n--------------------\n\nThe MASTER_CONNECT_RETRY option for CHANGE MASTER defines how many seconds\nthat the replica will wait between connection retries. The default is 60.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_CONNECT_RETRY=20;\nSTART SLAVE;\n\nThe number of connection attempts is limited by the master_retry_count option.\nIt can be set either on the command-line or in a server option group in an\noption file prior to starting up the server. For example:\n\n[mariadb]\n...\nmaster_retry_count=4294967295\n\nMASTER_BIND\n-----------\n\nThe MASTER_BIND option for CHANGE MASTER is only supported by MySQL 5.6.2 and\nlater and by MySQL NDB Cluster 7.3.1 and later. This option is not supported\nby MariaDB. See MDEV-19248 for more information.\n\nThe MASTER_BIND option for CHANGE MASTER can be used on replicas that have\nmultiple network interfaces to choose which network interface the replica will\nuse to connect to the primary.\n\nMASTER_HEARTBEAT_PERIOD\n-----------------------\n\nThe MASTER_HEARTBEAT_PERIOD option for CHANGE MASTER can be used to set the\ninterval in seconds between replication heartbeats. Whenever the primary\'s\nbinary log is updated with an event, the waiting period for the next heartbeat\nis reset.\n\nThis option\'s interval argument has the following characteristics:\n\n* It is a decimal value with a range of 0 to 4294967 seconds.\n* It has a resolution of hundredths of a second.\n* Its smallest valid non-zero value is 0.001.\n* Its default value is the value of the slave_net_timeout system variable\ndivided by 2.\n* If it\'s set to 0, then heartbeats are disabled.\n\nHeartbeats are sent by the primary only if there are no unsent events in the\nbinary log file for a period longer than the interval.\n\nIf the RESET SLAVE statement is executed, then the heartbeat interval is reset\nto the default.\n\nIf the slave_net_timeout system variable is set to a value that is lower than\nthe current heartbeat interval, then a warning will be issued.\n\nTLS Options\n-----------\n\nThe TLS options are used for providing information about TLS. The options can\nbe set even on replicas that are compiled without TLS support. The TLS options\nare saved to either the default master.info file or the file that is\nconfigured by the master_info_file option, but these TLS options are ignored\nunless the replica supports TLS.\n\nSee Replication with Secure Connections for more information.\n\nMASTER_SSL\n----------\n\nThe MASTER_SSL option for CHANGE MASTER tells the replica whether to force TLS\nfor the connection. The valid values are 0 or 1. Required to be set to 1 for\nthe other MASTER_SSL* options to have any effect.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL=1;\nSTART SLAVE;\n\nMASTER_SSL_CA\n-------------\n\nThe MASTER_SSL_CA option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more X509 certificates for trusted Certificate\nAuthorities (CAs) to use for TLS. This option requires that you use the\nabsolute path, not a relative path.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA string is 511 characters.\n\nMASTER_SSL_CAPATH\n-----------------\n\nThe MASTER_SSL_CAPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one X509\ncertificate for a trusted Certificate Authority (CA) to use for TLS. This\noption requires that you use the absolute path, not a relative path. The\ndirectory specified by this option needs to be run through the openssl rehash\ncommand.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CAPATH=\'/etc/my.cnf.d/certificates/ca/\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA_PATH string is 511 characters.\n\nMASTER_SSL_CERT\n---------------\n\nThe MASTER_SSL_CERT option for CHANGE MASTER defines a path to the X509\ncertificate file to use for TLS. This option requires that you use the\nabsolute path, not a relative path.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CERT string is 511 characters.\n\nMASTER_SSL_CRL\n--------------\n\nThe MASTER_SSL_CRL option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more revoked X509 certificates to use for TLS. This\noption requires that you use the absolute path, not a relative path.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRL=\'/etc/my.cnf.d/certificates/crl.pem\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL string is 511 characters.\n\nMASTER_SSL_CRLPATH\n------------------\n\nThe MASTER_SSL_CRLPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one revoked X509\ncertificate to use for TLS. This option requires that you use the absolute\npath, not a relative path. The directory specified by this variable needs to\nbe run through the openssl rehash command.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRLPATH=\'/etc/my.cnf.d/certificates/crl/\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL_PATH string is 511 characters.\n\nMASTER_SSL_KEY\n--------------\n\nThe MASTER_SSL_KEY option for CHANGE MASTER defines a path to a private key\nfile to use for TLS. This option requires that you use the absolute path, not\na relative path.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_KEY string is 511 characters.\n\nMASTER_SSL_CIPHER\n-----------------\n\nThe MASTER_SSL_CIPHER option for CHANGE MASTER defines the list of permitted\nciphers or cipher suites to use for TLS. Besides cipher names, if MariaDB was\ncompiled with OpenSSL, this option could be set to \"SSLv3\" or \"TLSv1.2\" to\nallow all SSLv3 or all TLSv1.2 ciphers. Note that the TLSv1.3 ciphers cannot\nbe excluded when using OpenSSL, even by using this option. See Using TLSv1.3\nfor details.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CIPHER=\'TLSv1.2\';\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CIPHER string is 511 characters.\n\nMASTER_SSL_VERIFY_SERVER_CERT\n-----------------------------\n\nThe MASTER_SSL_VERIFY_SERVER_CERT option for CHANGE MASTER enables server\ncertificate verification. This option is disabled by default.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Server Certificate Verification for more\ninformation.\n\nBinary Log Options\n------------------\n\nThese options are related to the binary log position on the primary.\n\nMASTER_LOG_FILE\n---------------\n\nThe MASTER_LOG_FILE option for CHANGE MASTER can be used along with\nMASTER_LOG_POS to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nMASTER_LOG_POS\n--------------\n\nThe MASTER_LOG_POS option for CHANGE MASTER can be used along with\nMASTER_LOG_FILE to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nRelay Log Options\n-----------------\n\nThese options are related to the relay log position on the replica.\n\nRELAY_LOG_FILE\n--------------\n\nThe RELAY_LOG_FILE option for CHANGE MASTER can be used along with the\nRELAY_LOG_POS option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nRELAY_LOG_POS\n-------------\n\nThe RELAY_LOG_POS option for CHANGE MASTER can be used along with the\nRELAY_LOG_FILE option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nGTID Options\n------------\n\nMASTER_USE_GTID\n---------------\n\nThe MASTER_USE_GTID option for CHANGE MASTER can be used to configure the\nreplica to use the global transaction ID (GTID) when connecting to a primary.\nThe possible values are:\n\n* current_pos - Replicate in GTID mode and use gtid_current_pos as the\nposition to start downloading transactions from the primary. Deprecated from\nMariaDB 10.10. Using to transition to primary can break the replication state\nif the replica executes local transactions due to actively updating\ngtid_current_pos with gtid_binlog_pos and gtid_slave_pos. Use the new, safe,\nMASTER_DEMOTE_TO_SLAVE=<bool> option instead.\n* slave_pos - Replicate in GTID mode and use gtid_slave_pos as the position to\nstart downloading transactions from the primary. From MariaDB 10.5.1,\nreplica_pos is an alias for slave_pos.\n* no - Don\'t replicate in GTID mode.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USE_GTID = current_pos;\nSTART SLAVE;\n\nOr:\n\nSTOP SLAVE;\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID = slave_pos;\nSTART SLAVE;\n\nMASTER_DEMOTE_TO_SLAVE\n----------------------\n\nMariaDB starting with 10.10\n---------------------------\nUsed to transition a primary to become a replica. Replaces the old\nMASTER_USE_GTID=current_pos with a safe alternative by forcing users to set\nUsing_Gtid=Slave_Pos and merging gtid_binlog_pos into gtid_slave_pos once at\nCHANGE MASTER TO time. If gtid_slave_pos is more recent than gtid_binlog_pos\n(as in the case of chain replication), the replication state should be\npreserved.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_DEMOTE_TO_SLAVE = 1;\nSTART SLAVE;\n\nReplication Filter Options\n--------------------------\n\nAlso see Replication filters.\n\nIGNORE_SERVER_IDS\n-----------------\n\nThe IGNORE_SERVER_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events that originated from certain servers.\nFiltered binary log events will not get logged to the replica’s relay log, and\nthey will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\nserver_id values. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = (3,5);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = ();\nSTART SLAVE;\n\nDO_DOMAIN_IDS\n-------------\n\nThe DO_DOMAIN_IDS option for CHANGE MASTER can be used to configure a replica\nto only apply binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the DO_DOMAIN_IDS\noption, and the IGNORE_DOMAIN_IDS option was previously set, then you need to\nclear the value of the IGNORE_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (),\n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option can only be specified if the replica is replicating\nin GTID mode. Therefore, the MASTER_USE_GTID option must also be set to some\nvalue other than no in order to use this option.\n\nIGNORE_DOMAIN_IDS\n-----------------\n\nThe IGNORE_DOMAIN_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the IGNORE_DOMAIN_IDS\noption, and the DO_DOMAIN_IDS option was previously set, then you need to\nclear the value of the DO_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (),\n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe IGNORE_DOMAIN_IDS option can only be specified if the replica is\nreplicating in GTID mode. Therefore, the MASTER_USE_GTID option must also be\nset to some value other than no in order to use this option.\n\nDelayed Replication Options\n---------------------------\n\nMASTER_DELAY\n------------\n\nThe MASTER_DELAY option for CHANGE MASTER can be used to enable delayed\nreplication. This option specifies the time in seconds (at least) that a\nreplica should lag behind the primary up to a maximum value of 2147483647, or\nabout 68 years. Before executing an event, the replica will first wait, if\nnecessary, until the given time has passed since the event was created on the\nprimary. The result is that the replica will reflect the state of the primary\nsome time back in the past. The default is zero, no delay.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_DELAY=3600;\nSTART SLAVE;\n\nChanging Option Values\n----------------------\n\nIf you don\'t specify a given option when executing the CHANGE MASTER\nstatement, then the option keeps its old value in most cases. Most of the\ntime, there is no need to specify the options that do not need to change. For\nexample, if the password for the user account that the replica uses to connect\nto its primary has changed, but no other options need to change, then you can\njust change the MASTER_PASSWORD option by executing the following commands:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThere are some cases where options are implicitly reset, such as when the\nMASTER_HOST and MASTER_PORT options are changed.\n\nOption Persistence\n------------------\n\nThe values of the MASTER_LOG_FILE and MASTER_LOG_POS options (i.e. the binary\nlog position on the primary) and most other options are written to either the\ndefault master.info file or the file that is configured by the\nmaster_info_file option. The replica\'s I/O thread keeps this binary log\nposition updated as it downloads events only when MASTER_USE_GTID option is\nset to NO. Otherwise the file is not updated on a per event basis.\n\nThe master_info_file option can be set either on the command-line or in a\nserver option group in an option file prior to starting up the server. For\nexample:\n\n[mariadb]\n...\nmaster_info_file=/mariadb/myserver1-master.info\n\nThe values of the RELAY_LOG_FILE and RELAY_LOG_POS options (i.e. the relay log\nposition) are written to either the default relay-log.info file or the file\nthat is configured by the relay_log_info_file system variable. The replica\'s\nSQL thread keeps this relay log position updated as it applies events.\n\nThe relay_log_info_file system variable can be set either on the command-line\nor in a server option group in an option file prior to starting up the server.\nFor example:\n\n[mariadb]\n...\nrelay_log_info_file=/mariadb/myserver1-relay-log.info\n\nGTID Persistence\n----------------\n\nIf the replica is replicating binary log events that contain GTIDs, then the\nreplica\'s SQL thread will write every GTID that it applies to the\nmysql.gtid_slave_pos table. This GTID can be inspected and modified through\nthe gtid_slave_pos system variable.\n\nIf the replica has the log_slave_updates system variable enabled and if the\nreplica has the binary log enabled, then every write by the replica\'s SQL\nthread will also go into the replica\'s binary log. This means that GTIDs of\nreplicated transactions would be reflected in the value of the gtid_binlog_pos\nsystem variable.\n\nCreating a Replica from a Backup\n--------------------------------\n\nThe CHANGE MASTER statement is useful for setting up a replica when you have a\nbackup of the primary and you also have the binary log position or GTID\nposition corresponding to the backup.\n\nAfter restoring the backup on the replica, you could execute something like\nthis to use the binary log position:\n\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nOr you could execute something like this to use the GTID position:\n\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nSee Setting up a Replication Slave with Mariabackup for more information on\nhow to do this with Mariabackup.\n\nExample\n-------\n\nThe following example changes the primary and primary\'s binary log\ncoordinates. This is used when you want to set up the replica to replicate the\nprimary:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\nSTART SLAVE;\n\nURL: https://mariadb.com/kb/en/change-master-to/','','https://mariadb.com/kb/en/change-master-to/'),
(829,'RESET MASTER',49,'RESET MASTER [TO #]\n\nDeletes all binary log files listed in the index file, resets the binary log\nindex file to be empty, and creates a new binary log file with a suffix of\n.000001.\n\nIf TO # is given, then the first new binary log file will start from number #.\n\nThis statement is for use only when the master is started for the first time,\nand should never be used if any slaves are actively replicating from the\nbinary log.\n\nURL: https://mariadb.com/kb/en/reset-master/','','https://mariadb.com/kb/en/reset-master/'),
(316,'Cursor Overview',24,'Description\n-----------\n\nA cursor is a structure that allows you to go over records sequentially, and\nperform processing based on the result.\n\nMariaDB permits cursors inside stored programs, and MariaDB cursors are\nnon-scrollable, read-only and asensitive.\n\n* Non-scrollable means that the rows can only be fetched in the order\nspecified by the SELECT statement. Rows cannot be skipped, you cannot jump to\na specific row, and you cannot fetch rows in reverse order.\n* Read-only means that data cannot be updated through the cursor.\n* Asensitive means that the cursor points to the actual underlying data. This\nkind of cursor is quicker than the alternative, an insensitive cursor, as no\ndata is copied to a temporary table. However, changes to the data being used\nby the cursor will affect the cursor data.\n\nCursors are created with a DECLARE CURSOR statement and opened with an OPEN\nstatement. Rows are read with a FETCH statement before the cursor is finally\nclosed with a CLOSE statement.\n\nWhen FETCH is issued and there are no more rows to extract, the following\nerror is produced:\n\nERROR 1329 (02000): No data - zero rows fetched, selected, or processed\n\nTo avoid problems, a DECLARE HANDLER statement is generally used. The HANDLER\nshould handler the 1329 error, or the \'02000\' SQLSTATE, or the NOT FOUND error\nclass.\n\nOnly SELECT statements are allowed for cursors, and they cannot be contained\nin a variable - so, they cannot be composed dynamically. However, it is\npossible to SELECT from a view. Since the CREATE VIEW statement can be\nexecuted as a prepared statement, it is possible to dynamically create the\nview that is queried by the cursor.\n\nFrom MariaDB 10.3.0, cursors can have parameters. Cursor parameters can appear\nin any part of the DECLARE CURSOR select_statement where a stored procedure\nvariable is allowed (select list, WHERE, HAVING, LIMIT etc). See DECLARE\nCURSOR and OPEN for syntax, and below for an example:\n\nExamples\n--------\n\nCREATE TABLE c1(i INT);\n\nCREATE TABLE c2(i INT);\n\nCREATE TABLE c3(i INT);\n\nDELIMITER //\n\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE x, y INT;\n DECLARE cur1 CURSOR FOR SELECT i FROM test.c1;\n DECLARE cur2 CURSOR FOR SELECT i FROM test.c2;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\nOPEN cur1;\n OPEN cur2;\n\nread_loop: LOOP\n  FETCH cur1 INTO x;\n  FETCH cur2 INTO y;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  IF x < y THEN\n   INSERT INTO test.c3 VALUES (x);\n  ELSE\n   INSERT INTO test.c3 VALUES (y);\n  END IF;\n END LOOP;\n\nCLOSE cur1;\n CLOSE cur2;\nEND; //\n\nDELIMITER ;\n\nINSERT INTO c1 VALUES(5),(50),(500);\n\nINSERT INTO c2 VALUES(10),(20),(30);\n\nCALL p1;\n\nSELECT * FROM c3;\n+------+\n| i    |\n+------+\n|    5 |\n|   20 |\n|   30 |\n+------+\n\nFrom MariaDB 10.3.0\n\nDROP PROCEDURE IF EXISTS p1;\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(10));\n\nINSERT INTO t1 VALUES (1,\'old\'),(2,\'old\'),(3,\'old\'),(4,\'old\'),(5,\'old\');\n\nDELIMITER //\n\nCREATE PROCEDURE p1(min INT,max INT)\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE va INT;\n DECLARE cur CURSOR(pmin INT, pmax INT) FOR SELECT a FROM t1 WHERE a BETWEEN\npmin AND pmax;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=TRUE;\n OPEN cur(min,max);\n read_loop: LOOP\n  FETCH cur INTO va;\n  IF done THEN\n   LEAVE read_loop;\n  END IF;\n  INSERT INTO t1 VALUES (va,\'new\');\n END LOOP;\n CLOSE cur;\nEND;\n//\n\nDELIMITER ;\n\nCALL p1(2,4);\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|    1 | old  |\n|    2 | old  |\n|    3 | old  |\n|    4 | old  |\n|    5 | old  |\n|    2 | new  |\n|    3 | new  |\n|    4 | new  |\n+------+------+\n\nURL: https://mariadb.com/kb/en/cursor-overview/','','https://mariadb.com/kb/en/cursor-overview/'),
(327,'MULTIPOLYGON',25,'Syntax\n------\n\nMultiPolygon(poly1,poly2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPolygon value from a set of WKB Polygon arguments. If\nany argument is not a WKB Polygon, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),\n  ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),\n    ((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(\n   Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\nURL: https://mariadb.com/kb/en/multipolygon/','','https://mariadb.com/kb/en/multipolygon/'),
(330,'POLYGON',25,'Syntax\n------\n\nPolygon(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB Polygon value from a number of WKB LineString arguments. If\nany argument does not represent the WKB of a LinearRing (that is, not a closed\nand simple LineString) the return value is NULL.\n\nNote that according to the OpenGIS standard, a POLYGON should have exactly one\nExteriorRing and all other rings should lie within that ExteriorRing and thus\nbe the InteriorRings. Practically, however, some systems, including MariaDB\'s,\npermit polygons to have several \'ExteriorRings\'. In the case of there being\nmultiple, non-overlapping exterior rings ST_NUMINTERIORRINGS() will return 1.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\nCREATE TABLE gis_polygon   (g POLYGON);\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n  (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n|                1 |\n+------------------+\n\nURL: https://mariadb.com/kb/en/polygon/','','https://mariadb.com/kb/en/polygon/'),
(331,'ST_BUFFER',25,'Syntax\n------\n\nST_BUFFER(g1,r)\nBUFFER(g1,r)\n\nDescription\n-----------\n\nReturns a geometry that represents all points whose distance from geometry g1\nis less than or equal to distance, or radius, r.\n\nUses for this function could include creating for example a new geometry\nrepresenting a buffer zone around an island.\n\nBUFFER() is a synonym.\n\nExamples\n--------\n\nDetermining whether a point is within a buffer zone:\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(8 8)\');\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,5));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,5)) |\n+---------------------------------+\n|                               1 |\n+---------------------------------+\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,1));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,1)) |\n+---------------------------------+\n|                               0 |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/st_buffer/','','https://mariadb.com/kb/en/st_buffer/'),
(332,'ST_CONVEXHULL',25,'MariaDB starting with 10.1.2\n----------------------------\nST_ConvexHull() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_ConvexHull(g)\nConvexHull(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a geometry that is the minimum convex geometry\nenclosing all geometries within the set. Returns NULL if the geometry value is\nNULL or an empty value.\n\nST_ConvexHull() and ConvexHull() are synonyms.\n\nExamples\n--------\n\nThe ConvexHull of a single point is simply the single point:\n\nSET @g = ST_GEOMFROMTEXT(\'Point(0 0)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POINT(0 0)                   |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint(0 0, 1 2, 2 3)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POLYGON((0 0,1 2,2 3,0 0))   |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+----------------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g))           |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_convexhull/','','https://mariadb.com/kb/en/st_convexhull/'),
(335,'ST_SYMDIFFERENCE',25,'Syntax\n------\n\nST_SYMDIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that represents the portions of geometry g1 and geometry g2\nthat don\'t intersect.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(10 20, 10 40)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(10 15, 10 25)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+----------------------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2))            |\n+----------------------------------------------+\n| MULTILINESTRING((10 15,10 20),(10 25,10 40)) |\n+----------------------------------------------+\n\nSET @g2 = ST_GeomFromText(\'LINESTRING(10 20, 10 41)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+-----------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+-----------------------------------+\n| LINESTRING(10 40,10 41)           |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_symdifference/','','https://mariadb.com/kb/en/st_symdifference/'),
(336,'ST_UNION',25,'Syntax\n------\n\nST_UNION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the union of the geometry g1 and geometry g2.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT (0 2)\');\n\nSET @g2 = GEOMFROMTEXT(\'POINT (2 0)\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+---------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+---------------------------+\n| MULTIPOINT(2 0,0 2)       |\n+---------------------------+\n\nSET @g1 = GEOMFROMTEXT(\'POLYGON((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GEOMFROMTEXT(\'POLYGON((2 2,4 2,4 4,2 4,2 2))\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+------------------------------------------------+\n| ASTEXT(ST_UNION(@g1,@g2))                      |\n+------------------------------------------------+\n| POLYGON((0 0,0 3,2 3,2 4,4 4,4 2,3 2,3 0,0 0)) |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_union/','','https://mariadb.com/kb/en/st_union/'),
(337,'SHOW GRANTS',26,'Syntax\n------\n\nSHOW GRANTS [FOR user|role]\n\nDescription\n-----------\n\nThe SHOW GRANTS statement lists privileges granted to a particular user or\nrole.\n\nUsers\n-----\n\nThe statement lists the GRANT statement or statements that must be issued to\nduplicate the privileges that are granted to a MariaDB user account. The\naccount is named using the same format as for the GRANT statement; for\nexample, \'jeffrey\'@\'localhost\'. If you specify only the user name part of the\naccount name, a host name part of \'%\' is used. For additional information\nabout specifying account names, see GRANT.\n\nSHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost                                           |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to connect to\nthe server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is used in\nDEFINER context (such as within a stored procedure that is defined with SQL\nSECURITY DEFINER), the grants displayed are those of the definer and not the\ninvoker.\n\nNote that the DELETE HISTORY privilege, introduced in MariaDB 10.3.4, was\ndisplayed as DELETE VERSIONING ROWS when running SHOW GRANTS until MariaDB\n10.3.15 (MDEV-17655).\n\nRoles\n-----\n\nSHOW GRANTS can also be used to view the privileges granted to a role.\n\nExample\n-------\n\nSHOW GRANTS FOR journalist;\n+------------------------------------------+\n| Grants for journalist                    |\n+------------------------------------------+\n| GRANT USAGE ON *.* TO \'journalist\'       |\n| GRANT DELETE ON `test`.* TO \'journalist\' |\n+------------------------------------------+\n\nFOR PUBLIC\n----------\n\nMariaDB starting with 10.11\n---------------------------\nGRANT ... TO PUBLIC was introduced in MariaDB 10.11 to grant privileges to all\nusers. SHOW GRANTS FOR PUBLIC shows all these grants.\n\nSHOW GRANTS FOR public;\n+------------------------------------------------+\n| Grants for PUBLIC                              |\n+------------------------------------------------+\n| GRANT ALL PRIVILEGES ON `dev_db`.* TO `PUBLIC` |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-grants/','','https://mariadb.com/kb/en/show-grants/'),
(338,'SHOW CREATE USER',26,'Syntax\n------\n\nSHOW CREATE USER user_name\n\nDescription\n-----------\n\nShows the CREATE USER statement that created the given user. The statement\nrequires the SELECT privilege for the mysql database, except for the current\nuser.\n\nExamples\n--------\n\nCREATE USER foo4@test require cipher \'text\' \n issuer \'foo_issuer\' subject \'foo_subject\';\n\nSHOW CREATE USER foo4@test\\G\n*************************** 1. row ***************************\nCREATE USER \'foo4\'@\'test\' \n REQUIRE ISSUER \'foo_issuer\'\n SUBJECT \'foo_subject\'\n CIPHER \'text\'\n\nUser Password Expiry:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost                                  |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-create-user/','','https://mariadb.com/kb/en/show-create-user/'),
(340,'SHOW CREATE TABLE',26,'Syntax\n------\n\nSHOW CREATE TABLE tbl_name\n\nDescription\n-----------\n\nShows the CREATE TABLE statement that created the given table. The statement\nrequires the SELECT privilege for the table. This statement also works with\nviews and SEQUENCE.\n\nSHOW CREATE TABLE quotes table and column names according to the value of the\nsql_quote_show_create server system variable.\n\nCertain SQL_MODE values can result in parts of the original CREATE statement\nnot being included in the output. MariaDB-specific table options, column\noptions, and index options are not included in the output of this statement if\nthe NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and NO_KEY_OPTIONS SQL_MODE flags are\nused. All MariaDB-specific table attributes are also not shown when a\nnon-MariaDB/MySQL emulation mode is used, which includes ANSI, DB2,\nPOSTGRESQL, MSSQL, MAXDB or ORACLE.\n\nInvalid table options, column options and index options are normally commented\nout (note, that it is possible to create a table with invalid options, by\naltering a table of a different engine, where these options were valid). To\nhave them uncommented, enable the IGNORE_BAD_TABLE_OPTIONS SQL_MODE. Remember\nthat replaying a CREATE TABLE statement with uncommented invalid options will\nfail with an error, unless the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n\nNote that SHOW CREATE TABLE is not meant to provide metadata about a table. It\nprovides information about how the table was declared, but the real table\nstructure could differ a bit. For example, if an index has been declared as\nHASH, the CREATE TABLE statement returned by SHOW CREATE TABLE will declare\nthat index as HASH; however, it is possible that the index is in fact a BTREE,\nbecause the storage engine does not support HASH.\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 permits TEXT and BLOB data types to be assigned a DEFAULT\nvalue. As a result, from MariaDB 10.2.1, SHOW CREATE TABLE will append a\nDEFAULT NULL to nullable TEXT or BLOB fields if no specific default is\nprovided.\n\nMariaDB starting with 10.2.2\n----------------------------\nFrom MariaDB 10.2.2, numbers are no longer quoted in the DEFAULT clause in\nSHOW CREATE statement. Previously, MariaDB quoted numbers.\n\nIndex Order\n-----------\n\nIndexes are sorted and displayed in the following order, which may differ from\nthe order of the CREATE TABLE statement.\n\n* PRIMARY KEY\n* UNIQUE keys where all column are NOT NULL\n* UNIQUE keys that don\'t contain partial segments\n* Other UNIQUE keys\n* LONG UNIQUE keys\n* Normal keys\n* Fulltext keys\n\nSee sql/sql_table.cc for details.\n\nExamples\n--------\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE `t` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `s` char(60) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nWith sql_quote_show_create off:\n\nSHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n   Table: t\nCreate Table: CREATE TABLE t (\n id int(11) NOT NULL AUTO_INCREMENT,\n s char(60) DEFAULT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nUnquoted numeric DEFAULTs, from MariaDB 10.2.2:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\\G\n*************************** 1. row ***************************\n   Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT 1\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nQuoted numeric DEFAULTs, until MariaDB 10.2.1:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\\G\n*************************** 1. row ***************************\n   Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT \'1\'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSQL_MODE impacting the output:\n\nSELECT @@sql_mode;\n+------------------------------------------------------------------------------\n------------+\n| @@sql_mode                                                                  \n      |\n+------------------------------------------------------------------------------\n------------+\n|\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+------------------------------------------------------------------------------\n------------+\n\nCREATE TABLE `t1` (\n   `id` int(11) NOT NULL AUTO_INCREMENT,\n   `msg` varchar(100) DEFAULT NULL,\n   PRIMARY KEY (`id`)\n  ) ENGINE=InnoDB DEFAULT CHARSET=latin1\n;\n\nSHOW CREATE TABLE t1\\G\n*************************** 1. row ***************************\n   Table: t1\nCreate Table: CREATE TABLE `t1` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `msg` varchar(100) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSET SQL_MODE=ORACLE;\n\nSHOW CREATE TABLE t1\\G\n*************************** 1. row ***************************\n   Table: t1\nCreate Table: CREATE TABLE \"t1\" (\n \"id\" int(11) NOT NULL,\n \"msg\" varchar(100) DEFAULT NULL,\n PRIMARY KEY (\"id\")\n\nURL: https://mariadb.com/kb/en/show-create-table/','','https://mariadb.com/kb/en/show-create-table/'),
(339,'SHOW COLUMNS',26,'Syntax\n------\n\nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW COLUMNS displays information about the columns in a given table. It also\nworks for views. The LIKE clause, if present on its own, indicates which\ncolumn names to match. The WHERE and LIKE clauses can be given to select rows\nusing more general conditions, as discussed in Extended SHOW.\n\nIf the data types differ from what you expect them to be based on a CREATE\nTABLE statement, note that MariaDB sometimes changes data types when you\ncreate or alter a table. The conditions under which this occurs are described\nin the Silent Column Changes article.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. In other words, these two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for non-binary string columns, or NULL for\nother columns. This value is displayed only if you use the FULL keyword.\n\nThe Null field contains YES if NULL values can be stored in the column, NO if\nnot.\n\nThe Key field indicates whether the column is indexed:\n\n* If Key is empty, the column either is not indexed or is indexed only as a\n secondary column in a multiple-column, non-unique index.\n* If Key is PRI, the column is a PRIMARY KEY or\n is one of the columns in a multiple-column PRIMARY KEY.\n* If Key is UNI, the column is the first column of a unique-valued\n index that cannot contain NULL values.\n* If Key is MUL, multiple occurrences of a given value are allowed\n within the column. The column is the first column of a non-unique index or a\n unique-valued index that can contain NULL values.\n\nIf more than one of the Key values applies to a given column of a table, Key\ndisplays the one with the highest priority, in the order PRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values and\nthere is no PRIMARY KEY in the table. A UNIQUE index may display as MUL if\nseveral columns form a composite UNIQUE index; although the combination of the\ncolumns is unique, each column can still hold multiple occurrences of a given\nvalue.\n\nThe Default field indicates the default value that is assigned to the column.\n\nThe Extra field contains any additional information that is available about a\ngiven column.\n\n+------------------------+---------------------------------------------------+\n| Value                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| AUTO_INCREMENT         | The column was created with the AUTO_INCREMENT    |\n|                        | keyword.                                          |\n+------------------------+---------------------------------------------------+\n| PERSISTENT             | The column was created with the PERSISTENT        |\n|                        | keyword. (New in 5.3)                             |\n+------------------------+---------------------------------------------------+\n| VIRTUAL                | The column was created with the VIRTUAL keyword.  |\n|                        | (New in 5.3)                                      |\n+------------------------+---------------------------------------------------+\n| on update              | The column is a TIMESTAMP column that is          |\n| CURRENT_TIMESTAMP      | automatically updated on INSERT and UPDATE.       |\n+------------------------+---------------------------------------------------+\n\nPrivileges indicates the privileges you have for the column. This value is\ndisplayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed only if\nyou use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. Also DESCRIBE and EXPLAIN can be\nused as shortcuts.\n\nYou can also list a table\'s columns with:\n\nmariadb-show db_name tbl_name\n\nSee the mariadb-show command for more details.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS. The\ninformation_schema.COLUMNS table provides similar, but more complete,\ninformation.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements also\nprovide information about tables.\n\nExamples\n--------\n\nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n\nSHOW COLUMNS FROM employees WHERE Type LIKE \'Varchar%\';\n+---------------+-------------+------+-----+---------+-------+\n| Field         | Type        | Null | Key | Default | Extra |\n+---------------+-------------+------+-----+---------+-------+\n| first_name    | varchar(30) | NO   | MUL | NULL    |       |\n| last_name     | varchar(40) | NO   |     | NULL    |       |\n| position      | varchar(25) | NO   |     | NULL    |       |\n| home_address  | varchar(50) | NO   |     | NULL    |       |\n| home_phone    | varchar(12) | NO   |     | NULL    |       |\n| employee_code | varchar(25) | NO   | UNI | NULL    |       |\n+---------------+-------------+------+-----+---------+-------+\n\nURL: https://mariadb.com/kb/en/show-columns/','','https://mariadb.com/kb/en/show-columns/'),
(341,'SHOW INDEX',26,'Syntax\n------\n\nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n\nDescription\n-----------\n\nSHOW INDEX returns table index information. The format resembles that of the\nSQLStatistics call in ODBC.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n\nYou can also list a table\'s indexes with the mariadb-show command:\n\nmariadb-show -k db_name tbl_name\n\nThe information_schema.STATISTICS table stores similar information.\n\nThe following fields are returned by SHOW INDEX.\n\n+------------------------+---------------------------------------------------+\n| Field                  | Description                                       |\n+------------------------+---------------------------------------------------+\n| Table                  | Table name                                        |\n+------------------------+---------------------------------------------------+\n| Non_unique             | 1 if the index permits duplicate values, 0 if     |\n|                        | values must be unique.                            |\n+------------------------+---------------------------------------------------+\n| Key_name               | Index name. The primary key is always named       |\n|                        | PRIMARY.                                          |\n+------------------------+---------------------------------------------------+\n| Seq_in_index           | The column\'s sequence in the index, beginning     |\n|                        | with 1.                                           |\n+------------------------+---------------------------------------------------+\n| Column_name            | Column name.                                      |\n+------------------------+---------------------------------------------------+\n| Collation              | Either A, if the column is sorted in ascending    |\n|                        | order in the index, or NULL if it\'s not sorted.   |\n+------------------------+---------------------------------------------------+\n| Cardinality            | Estimated number of unique values in the index.   |\n|                        | The cardinality statistics are calculated at      |\n|                        | various times, and can help the optimizer make    |\n|                        | improved decisions.                               |\n+------------------------+---------------------------------------------------+\n| Sub_part               | NULL if the entire column is included in the      |\n|                        | index, or the number of included characters if    |\n|                        | not.                                              |\n+------------------------+---------------------------------------------------+\n| Packed                 | NULL if the index is not packed, otherwise how    |\n|                        | the index is packed.                              |\n+------------------------+---------------------------------------------------+\n| Null                   | NULL if NULL values are permitted in the column,  |\n|                        | an empty string if NULLs are not permitted.       |\n+------------------------+---------------------------------------------------+\n| Index_type             | The index type, which can be BTREE, FULLTEXT,     |\n|                        | HASH or RTREE. See Storage Engine Index Types.    |\n+------------------------+---------------------------------------------------+\n| Comment                | Other information, such as whether the index is   |\n|                        | disabled.                                         |\n+------------------------+---------------------------------------------------+\n| Index_comment          | Contents of the COMMENT attribute when the index  |\n|                        | was created.                                      |\n+------------------------+---------------------------------------------------+\n| Ignored                | Whether or not an index will be ignored by the    |\n|                        | optimizer. See Ignored Indexes. From MariaDB      |\n|                        | 10.6.0.                                           |\n+------------------------+---------------------------------------------------+\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example\\G\n*************************** 1. row ***************************\n    Table: employees_example\n Non_unique: 0\n  Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: id\n  Collation: A\n Cardinality: 6\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 2. row ***************************\n    Table: employees_example\n Non_unique: 0\n  Key_name: employee_code\n Seq_in_index: 1\n Column_name: employee_code\n  Collation: A\n Cardinality: 6\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 3. row ***************************\n    Table: employees_example\n Non_unique: 1\n  Key_name: first_name\n Seq_in_index: 1\n Column_name: first_name\n  Collation: A\n Cardinality: NULL\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n*************************** 4. row ***************************\n    Table: employees_example\n Non_unique: 1\n  Key_name: first_name\n Seq_in_index: 2\n Column_name: last_name\n  Collation: A\n Cardinality: NULL\n  Sub_part: NULL\n   Packed: NULL\n    Null:\n Index_type: BTREE\n   Comment:\nIndex_comment: \n   Ignored: NO\n\nURL: https://mariadb.com/kb/en/show-index/','','https://mariadb.com/kb/en/show-index/'),
(342,'SHOW EXPLAIN',26,'Syntax\n------\n\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id>;\nEXPLAIN [FORMAT=JSON] FOR CONNECTION <connection_id>;\n\nDescription\n-----------\n\nThe SHOW EXPLAIN command allows one to get an EXPLAIN (that is, a description\nof a query plan) of a query running in a certain connection.\n\nSHOW EXPLAIN FOR <connection_id>;\n\nwill produce an EXPLAIN output for the query that connection number\nconnection_id is running. The connection id can be obtained with SHOW\nPROCESSLIST.\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id   | select_type | table | type  | possible_keys | key  | key_len | ref  |\nrows    | Extra       |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n|    1 | SIMPLE      | tbl   | index | NULL          | a    | 5       | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nThe output is always accompanied with a warning which shows the query the\ntarget connection is running (this shows what the EXPLAIN is for):\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1003 | select sum(a) from tbl |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\nEXPLAIN FOR CONNECTION\n----------------------\n\nMariaDB starting with 10.9\n--------------------------\nThe EXPLAIN FOR CONNECTION syntax was added for MySQL compatibility.\n\nFORMAT=JSON\n-----------\n\nMariaDB starting with 10.9\n--------------------------\nSHOW EXPLAIN [FORMAT=JSON] FOR <connection_id> extends SHOW EXPLAIN to return\nmore detailed JSON output.\n\nPossible Errors\n---------------\n\nThe output can be only produced if the target connection is currently running\na query, which has a ready query plan. If this is not the case, the output\nwill be:\n\nSHOW EXPLAIN FOR 2;\nERROR 1932 (HY000): Target is not running an EXPLAINable command\n\nYou will get this error when:\n\n* the target connection is not running a command for which one can run EXPLAIN\n* the target connection is running a command for which one can run EXPLAIN, but\nthere is no query plan yet (for example, tables are open and locks are\n acquired before the query plan is produced)\n\nDifferences Between SHOW EXPLAIN and EXPLAIN Outputs\n----------------------------------------------------\n\nBackground\n----------\n\nIn MySQL, EXPLAIN execution takes a slightly different route from the way the\nreal query (typically the SELECT) is optimized. This is unfortunate, and has\ncaused a number of bugs in EXPLAIN. (For example, see MDEV-326, MDEV-410, and\nlp:1013343. lp:992942 is not directly about EXPLAIN, but it also would not\nhave existed if MySQL didn\'t try to delete parts of a query plan in the middle\nof the query)\n\nSHOW EXPLAIN examines a running SELECT, and hence its output may be slightly\ndifferent from what EXPLAIN SELECT would produce. We did our best to make sure\nthat either the difference is negligible, or SHOW EXPLAIN\'s output is closer\nto reality than EXPLAIN\'s output.\n\nList of Recorded Differences\n----------------------------\n\n* SHOW EXPLAIN may have Extra=\'no matching row in const table\', where  EXPLAIN\nwould produce Extra=\'Impossible WHERE ...\'\n* For queries with subqueries, SHOW EXPLAIN may print select_type==PRIMARY\nwhere regular EXPLAIN used to print select_type==SIMPLE, or vice versa.\n\nRequired Permissions\n--------------------\n\nRunning SHOW EXPLAIN requires the same permissions as running SHOW PROCESSLIST\nwould.\n\nURL: https://mariadb.com/kb/en/show-explain/','','https://mariadb.com/kb/en/show-explain/'),
(344,'BACKUP LOCK',26,'MariaDB starting with 10.4.2\n----------------------------\nThe BACKUP LOCK command was introduced in MariaDB 10.4.2.\n\nBACKUP LOCK blocks a table from DDL statements. This is mainly intended to be\nused by tools like mariabackup that need to ensure there are no DDLs on a\ntable while the table files are opened. For example, for an Aria table that\nstores data in 3 files with extensions .frm, .MAI and .MAD. Normal read/write\noperations can continue as normal.\n\nSyntax\n------\n\nTo lock a table:\n\nBACKUP LOCK table_name\n\nTo unlock a table:\n\nBACKUP UNLOCK\n\nUsage in a Backup Tool\n----------------------\n\nBACKUP LOCK [database.]table_name;\n - Open all files related to a table (for example, t.frm, t.MAI and t.MYD)\nBACKUP UNLOCK;\n- Copy data\n- Close files\n\nThis ensures that all files are from the same generation, that is created at\nthe same time by the MariaDB server. This works, because the open files will\npoint to the original table files which will not be affected if there is any\nALTER TABLE while copying the files.\n\nPrivileges\n----------\n\nBACKUP LOCK requires the RELOAD privilege.\n\nNotes\n-----\n\n* The idea is that the BACKUP LOCK should be held for as short a time as\npossible by the backup tool. The time to take an uncontested lock is very\nshort! One can easily do 50,000 locks/unlocks per second on low end hardware.\n* One should use different connections for BACKUP STAGE commands and BACKUP\nLOCK.\n\nImplementation\n--------------\n\n* Internally, BACKUP LOCK is implemented by taking an MDLSHARED_HIGH_PRIO MDL\nlock on the table object, which protects the table from any DDL operations.\n\nURL: https://mariadb.com/kb/en/backup-lock/','','https://mariadb.com/kb/en/backup-lock/'),
(343,'BACKUP STAGE',26,'MariaDB starting with 10.4.1\n----------------------------\nThe BACKUP STAGE commands were introduced in MariaDB 10.4.1.\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool.\n\nSyntax\n------\n\nBACKUP STAGE [START | FLUSH | BLOCK_DDL | BLOCK_COMMIT | END ]\n\nIn the following text, a transactional table means InnoDB or \"InnoDB-like\nengine with redo log that can lock redo purges and can be copied without locks\nby an outside process\".\n\nGoals with BACKUP STAGE Commands\n--------------------------------\n\n* To be able to do a majority of the backup with the minimum possible server\nlocks. Especially for transactional tables (InnoDB, MyRocks etc) there is only\nneed for a very short block of new commits while copying statistics and log\ntables.\n* DDL are only needed to be blocked for a very short duration of the backup\nwhile mariabackup is copying the tables affected by DDL during the initial\npart of the backup.\n* Most non transactional tables (those that are not in use) will be copied\nduring BACKUP STAGE START.  The exceptions are system statistic and log tables\nthat are not blocked during the backup until BLOCK_COMMIT.\n* Should work efficiently with backup tools that use disk snapshots.\n* Should work as efficiently as possible for all table types that store data\non the local disks.\n* As little copying as possible under higher level stages/locks. For example,\n.frm (dictionary) and .trn (trigger) files should be copying while copying the\ntable data.\n\nBACKUP STAGE Commands\n---------------------\n\nBACKUP STAGE START\n------------------\n\nThe START stage is designed for the following tasks:\n\n* Blocks purge of redo files for storage engines that needs this (Aria)\n* Start logging of DDL commands into \'datadir\'/ddl.log. This may take a short\ntime as the command has to wait until there are no active DDL commands.\n\nBACKUP STAGE FLUSH\n------------------\n\nThe FLUSH stage is designed for the following tasks:\n\n* FLUSH all changes for inactive non-transactional tables, except for\nstatistics and log tables.\n* Close all tables that are not in use, to ensure they are marked as closed\nfor the backup.\n* BLOCK all new write locks for all non transactional tables (except\nstatistics and log tables).  The command will not wait for tables that are in\nuse by read-only transactions.\n\nDDLs don\'t have to be blocked at this stage as they can\'t cause the table to\nbe in an inconsistent state. This is true also for non-transactional tables.\n\nBACKUP STAGE BLOCK_DDL\n----------------------\n\nThe BLOCK_DDL stage is designed for the following tasks:\n\n* Wait for all statements using write locked non-transactional tables to end.\n* Blocks CREATE TABLE, DROP TABLE, TRUNCATE TABLE, and RENAME TABLE.\n* Blocks also start off a new ALTER TABLE and the final rename phase of ALTER\nTABLE. Running ALTER TABLES are not blocked.\n\nBACKUP STAGE BLOCK_COMMIT\n-------------------------\n\nThe BLOCK_COMMIT stage is designed for the following tasks:\n\n* Lock the binary log and commit/rollback to ensure that no changes are\ncommitted to any tables. If there are active commits or data to be copied to\nthe binary log this will be allowed to finish.  Active transactions will not\naffect BLOCK_COMMIT.\n* This doesn\'t lock temporary tables that are not used by replication. However\nthese will be blocked when it\'s time to write to the binary log.\n* Lock system log tables and statistics tables, flush them and mark them\nclosed.\n\nWhen the BLOCK_COMMIT\'s stages return, this is the \'backup time\'. Everything\ncommitted will be in the backup and everything not committed will roll back.\n\nTransactional engines will continue to do changes to the redo log during the\nBLOCK COMMIT stage, but this is not important as all of these will roll back\nlater as the changes will not be committed.\n\nBACKUP STAGE END\n----------------\n\nThe END stage is designed for the following tasks:\n\n* End DDL logging\n* Free resources\n\nUsing BACKUP STAGE Commands with Backup Tools\n---------------------------------------------\n\nUsing BACKUP STAGE Commands with Mariabackup\n--------------------------------------------\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool. How Mariabackup uses these commands depends on\nwhether you are using the version that is bundled with MariaDB Community\nServer or the version that is bundled with MariaDB Enterprise Server. See\nMariabackup and BACKUP STAGE Commands for some examples on how Mariabackup\nuses these commands.\n\nIf you would like to use a version of Mariabackup that uses the BACKUP STAGE\ncommands in an efficient way, then one option is to use MariaDB Enterprise\nBackup that is bundled with MariaDB Enterprise Server.\n\nUsing BACKUP STAGE Commands with Storage Snapshots\n--------------------------------------------------\n\nThe BACKUP STAGE commands are a set of commands to make it possible to make an\nefficient external backup tool. These commands could even be used by tools\nthat perform backups by taking a snapshot of a file system, SAN, or some other\nkind of storage device. See Storage Snapshots and BACKUP STAGE Commands for\nsome examples on how to use each BACKUP STAGE command in an efficient way.\n\nPrivileges\n----------\n\nBACKUP STAGE requires the RELOAD privilege.\n\nNotes\n-----\n\n* Only one connection can run BACKUP STAGE START. If a second connection\ntries, it will wait until the first one has executed BACKUP STAGE END.\n* If the user skips a BACKUP STAGE, then all intermediate backup stages will\nautomatically be run. This will allow us to add new stages within the BACKUP\nSTAGE hierarchy in the future with even more precise locks without causing\nproblems for tools using an earlier version of the BACKUP STAGE implementation.\n* One can use the max_statement_time or lock_wait_timeout system variables to\nensure that a BACKUP STAGE command doesn\'t block the server too long.\n* DDL logging will only be available in MariaDB Enterprise Server 10.2 and\nlater.\n* A disconnect will automatically release backup stages.\n* There is no easy way to see which is the current stage.\n\nURL: https://mariadb.com/kb/en/backup-stage/','','https://mariadb.com/kb/en/backup-stage/'),
(347,'FLUSH TABLES FOR EXPORT',26,'Syntax\n------\n\nFLUSH TABLES table_name [, table_name] FOR EXPORT\n\nDescription\n-----------\n\nFLUSH TABLES ... FOR EXPORT flushes changes to the specified tables to disk so\nthat binary copies can be made while the server is still running. This works\nfor Archive, Aria, CSV, InnoDB, MyISAM, MERGE, and XtraDB tables.\n\nThe table is read locked until one has issued UNLOCK TABLES.\n\nIf a storage engine does not support FLUSH TABLES FOR EXPORT, a 1031 error\n(SQLSTATE \'HY000\') is produced.\n\nIf FLUSH TABLES ... FOR EXPORT is in effect in the session, the following\nstatements will produce an error if attempted:\n\n* FLUSH TABLES WITH READ LOCK\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* Any statement trying to update any table\n\nIf any of the following statements is in effect in the session, attempting\nFLUSH TABLES ... FOR EXPORT will produce an error.\n\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* LOCK TABLES ... READ\n* LOCK TABLES ... WRITE\n\nFLUSH FOR EXPORT is not written to the binary log.\n\nThis statement requires the RELOAD and the LOCK TABLES privileges.\n\nIf one of the specified tables cannot be locked, none of the tables will be\nlocked.\n\nIf a table does not exist, an error like the following will be produced:\n\nERROR 1146 (42S02): Table \'test.xxx\' doesn\'t exist\n\nIf a table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nExample\n-------\n\nFLUSH TABLES test.t1 FOR EXPORT;\n#  Copy files related to the table (see below)\nUNLOCK TABLES;\n\nFor a full description, please see copying MariaDB tables.\n\nURL: https://mariadb.com/kb/en/flush-tables-for-export/','','https://mariadb.com/kb/en/flush-tables-for-export/'),
(348,'SHOW RELAYLOG EVENTS',26,'The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSHOW RELAYLOG [\'connection_name\'] EVENTS\n  [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n  [ FOR CHANNEL \'channel_name\']\n\nDescription\n-----------\n\nOn replicas, this command shows the events in the relay log. If \'log_name\' is\nnot specified, the first relay log is shown.\n\nSyntax for the LIMIT clause is the same as for SELECT ... LIMIT.\n\nUsing the LIMIT clause is highly recommended because the SHOW RELAYLOG EVENTS\ncommand returns the complete contents of the relay log, which can be quite\nlarge.\n\nThis command does not return events related to setting user and system\nvariables. If you need those, use mariadb-binlog.\n\nOn the primary, this command does nothing.\n\nRequires the REPLICA MONITOR privilege (>= MariaDB 10.5.9), the REPLICATION\nSLAVE ADMIN privilege (>= MariaDB 10.5.2) or the REPLICATION SLAVE privilege\n(<= MariaDB 10.5.1).\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the SHOW RELAYLOG statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after SHOW RELAYLOG.\n\nURL: https://mariadb.com/kb/en/show-relaylog-events/','','https://mariadb.com/kb/en/show-relaylog-events/'),
(350,'SHOW MASTER STATUS',26,'Syntax\n------\n\nSHOW MASTER STATUS\nSHOW BINLOG STATUS -- From MariaDB 10.5.2\n\nDescription\n-----------\n\nProvides status information about the binary log files of the primary.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nTo see information about the current GTIDs in the binary log, use the\ngtid_binlog_pos variable.\n\nSHOW MASTER STATUS was renamed to SHOW BINLOG STATUS in MariaDB 10.5.2, but\nthe old name remains an alias for compatibility purposes.\n\nExample\n-------\n\nSHOW MASTER STATUS;\n+--------------------+----------+--------------+------------------+\n| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+--------------------+----------+--------------+------------------+\n| mariadb-bin.000016 |      475 |              |                  |\n+--------------------+----------+--------------+------------------+\nSELECT @@global.gtid_binlog_pos;\n+--------------------------+\n| @@global.gtid_binlog_pos |\n+--------------------------+\n| 0-1-2                    |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/show-binlog-status/','','https://mariadb.com/kb/en/show-binlog-status/'),
(351,'SHOW SLAVE HOSTS',26,'Syntax\n------\n\nSHOW SLAVE HOSTS\nSHOW REPLICA HOSTS -- from MariaDB 10.5.1\n\nDescription\n-----------\n\nThis command is run on the primary and displays a list of replicas that are\ncurrently registered with it. Only replicas started with the\n--report-host=host_name option are visible in this list.\n\nThe output looks like this:\n\nSHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id  | Host      | Port | Master_id |\n+------------+-----------+------+-----------+\n|  192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena    | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n\n* Server_id: The unique server ID of the replica server, as configured in the\nserver\'s option file, or on the command line with --server-id=value.\n* Host: The host name of the replica server, as configured in the server\'s\noption file, or on the command line with --report-host=host_name. Note that\nthis can differ from the machine name as configured in the operating system.\n* Port: The port the replica server is listening on.\n* Master_id: The unique server ID of the primary server that the replica\nserver is replicating from.\n\nSome MariaDB and MySQL versions report another variable, rpl_recovery_rank.\nThis variable was never used, and was eventually removed in MariaDB 10.1.2 .\n\nRequires the REPLICATION MASTER ADMIN privilege (>= MariaDB 10.5.2) or the\nREPLICATION SLAVE privilege (<= MariaDB 10.5.1).\n\nSHOW REPLICA HOSTS\n------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA HOSTS is an alias for SHOW SLAVE HOSTS from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/show-replica-hosts/','','https://mariadb.com/kb/en/show-replica-hosts/'),
(352,'SHOW PLUGINS',26,'Syntax\n------\n\nSHOW PLUGINS;\n\nDescription\n-----------\n\nSHOW PLUGINS displays information about installed plugins. The Library column\nindicates the plugin library - if it is NULL, the plugin is built-in and\ncannot be uninstalled.\n\nThe PLUGINS table in the information_schema database contains more detailed\ninformation.\n\nFor specific information about storage engines (a particular type of plugin),\nsee the information_schema.ENGINES table and the SHOW ENGINES statement.\n\nExamples\n--------\n\nSHOW PLUGINS;\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| Name                       | Status   | Type               | Library     |\nLicense |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| binlog                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL        |\nGPL     |\n| mysql_old_password         | ACTIVE   | AUTHENTICATION     | NULL        |\nGPL     |\n| MRG_MyISAM                 | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| MyISAM                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| CSV                        | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| MEMORY                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| FEDERATED                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| PERFORMANCE_SCHEMA         | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| Aria                       | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| InnoDB                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| INNODB_TRX                 | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n...\n| INNODB_SYS_FOREIGN         | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n| INNODB_SYS_FOREIGN_COLS    | ACTIVE   | INFORMATION SCHEMA | NULL        |\nGPL     |\n| SPHINX                     | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| ARCHIVE                    | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| BLACKHOLE                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| FEEDBACK                   | DISABLED | INFORMATION SCHEMA | NULL        |\nGPL     |\n| partition                  | ACTIVE   | STORAGE ENGINE     | NULL        |\nGPL     |\n| pam                        | ACTIVE   | AUTHENTICATION     | auth_pam.so |\nGPL     |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n\nURL: https://mariadb.com/kb/en/show-plugins/','','https://mariadb.com/kb/en/show-plugins/'),
(353,'SHOW PLUGINS SONAME',26,'Syntax\n------\n\nSHOW PLUGINS SONAME { library | LIKE \'pattern\' | WHERE expr };\n\nDescription\n-----------\n\nSHOW PLUGINS SONAME displays information about compiled-in and all server\nplugins in the plugin_dir directory, including plugins that haven\'t been\ninstalled.\n\nExamples\n--------\n\nSHOW PLUGINS SONAME \'ha_example.so\';\n+----------+---------------+----------------+---------------+---------+\n| Name     | Status        | Type           | Library       | License |\n+----------+---------------+----------------+---------------+---------+\n| EXAMPLE  | NOT INSTALLED | STORAGE ENGINE | ha_example.so | GPL     |\n| UNUSABLE | NOT INSTALLED | DAEMON         | ha_example.so | GPL     |\n+----------+---------------+----------------+---------------+---------+\n\nThere is also a corresponding information_schema table, called ALL_PLUGINS,\nwhich contains more complete information.\n\nURL: https://mariadb.com/kb/en/show-plugins-soname/','','https://mariadb.com/kb/en/show-plugins-soname/'),
(355,'SET CHARACTER SET',26,'Syntax\n------\n\nSET {CHARACTER SET | CHARSET}\n  {charset_name | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client and character_set_results session system\nvariables to the specified character set and collation_connection to the value\nof collation_database, which implicitly sets character_set_connection to the\nvalue of character_set_database.\n\nThis maps all strings sent between the current client and the server with the\ngiven mapping.\n\nExample\n-------\n\nSHOW VARIABLES LIKE \'character_set\\_%\';\n+--------------------------+--------+\n| Variable_name            | Value  |\n+--------------------------+--------+\n| character_set_client     | utf8   |\n| character_set_connection | utf8   |\n| character_set_database   | latin1 |\n| character_set_filesystem | binary |\n| character_set_results    | utf8   |\n| character_set_server     | latin1 |\n| character_set_system     | utf8   |\n+--------------------------+--------+\n\nSHOW VARIABLES LIKE \'collation%\';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | utf8_general_ci   |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nSET CHARACTER SET utf8mb4;\n\nSHOW VARIABLES LIKE \'character_set\\_%\';\n+--------------------------+---------+\n| Variable_name            | Value   |\n+--------------------------+---------+\n| character_set_client     | utf8mb4 |\n| character_set_connection | latin1  |\n| character_set_database   | latin1  |\n| character_set_filesystem | binary  |\n| character_set_results    | utf8mb4 |\n| character_set_server     | latin1  |\n| character_set_system     | utf8    |\n+--------------------------+---------+\n\nSHOW VARIABLES LIKE \'collation%\';\n+----------------------+-------------------+\n| Variable_name        | Value             |\n+----------------------+-------------------+\n| collation_connection | latin1_swedish_ci |\n| collation_database   | latin1_swedish_ci |\n| collation_server     | latin1_swedish_ci |\n+----------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/set-character-set/','','https://mariadb.com/kb/en/set-character-set/'),
(354,'SET',26,'Syntax\n------\n\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n   user_var_name = expr\n  | [GLOBAL | SESSION] system_var_name = expr\n  | [@@global. | @@session. | @@]system_var_name = expr\n\nOne can also set a user variable in any expression with this syntax:\n\nuser_var_name:= expr\n\nDescription\n-----------\n\nThe SET statement assigns values to different types of variables that affect\nthe operation of the server or your client. Older versions of MySQL employed\nSET OPTION, but this syntax was deprecated in favor of SET without OPTION, and\nwas removed in MariaDB 10.0.\n\nChanging a system variable by using the SET statement does not make the change\npermanently. To do so, the change must be made in a configuration file.\n\nFor setting variables on a per-query basis, see SET STATEMENT.\n\nSee SHOW VARIABLES for documentation on viewing server system variables.\n\nSee Server System Variables for a list of all the system variables.\n\nGLOBAL / SESSION\n----------------\n\nWhen setting a system variable, the scope can be specified as either GLOBAL or\nSESSION.\n\nA global variable change affects all new sessions. It does not affect any\ncurrently open sessions, including the one that made the change.\n\nA session variable change affects the current session only.\n\nIf the variable has a session value, not specifying either GLOBAL or SESSION\nwill be the same as specifying SESSION. If the variable only has a global\nvalue, not specifying GLOBAL or SESSION will apply to the change to the global\nvalue.\n\nDEFAULT\n-------\n\nSetting a global variable to DEFAULT will restore it to the server default,\nand setting a session variable to DEFAULT will restore it to the current\nglobal value.\n\nExamples\n--------\n\n* innodb_sync_spin_loops is a global variable.\n* skip_parallel_replication is a session variable.\n* max_error_count is both global and session.\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 64           |\n| SKIP_PARALLEL_REPLICATION | OFF           | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSetting the session values:\n\nSET max_error_count=128;Query OK, 0 rows affected (0.000 sec)\n\nSET skip_parallel_replication=ON;Query OK, 0 rows affected (0.000 sec)\n\nSET innodb_sync_spin_loops=60;\nERROR 1229 (HY000): Variable \'innodb_sync_spin_loops\' is a GLOBAL variable \n and should be set with SET GLOBAL\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 128           | 64           |\n| SKIP_PARALLEL_REPLICATION | ON            | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSetting the global values:\n\nSET GLOBAL max_error_count=256;\n\nSET GLOBAL skip_parallel_replication=ON;\nERROR 1228 (HY000): Variable \'skip_parallel_replication\' is a SESSION variable \n and can\'t be used with SET GLOBAL\n\nSET GLOBAL innodb_sync_spin_loops=120;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 128           | 256          |\n| SKIP_PARALLEL_REPLICATION | ON            | NULL         |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 120          |\n+---------------------------+---------------+--------------+\n\nSHOW VARIABLES will by default return the session value unless the variable is\nglobal only.\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 128   |\n+-----------------+-------+\n\nSHOW VARIABLES LIKE \'skip_parallel_replication\';\n+---------------------------+-------+\n| Variable_name             | Value |\n+---------------------------+-------+\n| skip_parallel_replication | ON    |\n+---------------------------+-------+\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name          | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 120   |\n+------------------------+-------+\n\nUsing the inplace syntax:\n\nSELECT (@a:=1);\n+---------+\n| (@a:=1) |\n+---------+\n|       1 |\n+---------+\n\nSELECT @a;\n+------+\n| @a   |\n+------+\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/set/','','https://mariadb.com/kb/en/set/'),
(356,'SET NAMES',26,'Syntax\n------\n\nSET NAMES {\'charset_name\'\n  [COLLATE \'collation_name\'] | DEFAULT}\n\nDescription\n-----------\n\nSets the character_set_client, character_set_connection, character_set_results\nand, implicitly, the collation_connection session system variables to the\nspecified character set and collation.\n\nThis determines which character set the client will use to send statements to\nthe server, and the server will use for sending results back to the client.\n\nucs2, utf16, utf16le and utf32 are not valid character sets for SET NAMES, as\nthey cannot be used as client character sets.\n\nThe collation clause is optional. If not defined (or if DEFAULT is specified),\nthe default collation for the character set will be used.\n\nQuotes are optional for the character set or collation clauses.\n\nExamples\n--------\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-----------------+\n| VARIABLE_NAME            | SESSION_VALUE   |\n+--------------------------+-----------------+\n| CHARACTER_SET_RESULTS    | utf8            |\n| CHARACTER_SET_CONNECTION | utf8            |\n| CHARACTER_SET_CLIENT     | utf8            |\n| COLLATION_CONNECTION     | utf8_general_ci |\n+--------------------------+-----------------+\n\nSET NAMES big5;\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-----------------+\n| VARIABLE_NAME            | SESSION_VALUE   |\n+--------------------------+-----------------+\n| CHARACTER_SET_RESULTS    | big5            |\n| CHARACTER_SET_CONNECTION | big5            |\n| CHARACTER_SET_CLIENT     | big5            |\n| COLLATION_CONNECTION     | big5_chinese_ci |\n+--------------------------+-----------------+\n\nSET NAMES \'latin1\' COLLATE \'latin1_bin\';\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+---------------+\n| VARIABLE_NAME            | SESSION_VALUE |\n+--------------------------+---------------+\n| CHARACTER_SET_RESULTS    | latin1        |\n| CHARACTER_SET_CONNECTION | latin1        |\n| CHARACTER_SET_CLIENT     | latin1        |\n| COLLATION_CONNECTION     | latin1_bin    |\n+--------------------------+---------------+\n\nSET NAMES DEFAULT;\n\nSELECT VARIABLE_NAME, SESSION_VALUE \n FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'character_set_c%\' OR\n VARIABLE_NAME LIKE \'character_set_re%\' OR\n VARIABLE_NAME LIKE \'collation_c%\';\n+--------------------------+-------------------+\n| VARIABLE_NAME            | SESSION_VALUE     |\n+--------------------------+-------------------+\n| CHARACTER_SET_RESULTS    | latin1            |\n| CHARACTER_SET_CONNECTION | latin1            |\n| CHARACTER_SET_CLIENT     | latin1            |\n| COLLATION_CONNECTION     | latin1_swedish_ci |\n+--------------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/set-names/','','https://mariadb.com/kb/en/set-names/'),
(358,'SET STATEMENT',26,'MariaDB starting with 10.1.2\n----------------------------\nPer-query variables were introduced in MariaDB 10.1.2\n\nSET STATEMENT can be used to set the value of a system variable for the\nduration of the statement. It is also possible to set multiple variables.\n\nSyntax\n------\n\nSET STATEMENT var1=value1 [, var2=value2, ...] \n FOR <statement>\n\nwhere varN is a system variable (list of allowed variables is provided below),\nand valueN is a constant literal.\n\nDescription\n-----------\n\nSET STATEMENT var1=value1 FOR stmt\n\nis roughly equivalent to\n\nSET @save_value=@@var1;\nSET SESSION var1=value1;\nstmt;\nSET SESSION var1=@save_value;\n\nThe server parses the whole statement before executing it, so any variables\nset in this fashion that affect the parser may not have the expected effect.\nExamples include the charset variables, sql_mode=ansi_quotes, etc.\n\nExamples\n--------\n\nOne can limit statement execution time max_statement_time:\n\nSET STATEMENT max_statement_time=1000 FOR SELECT ... ;\n\nOne can switch on/off individual optimizations:\n\nSET STATEMENT optimizer_switch=\'materialization=off\' FOR SELECT ....;\n\nIt is possible to enable MRR/BKA for a query:\n\nSET STATEMENT  join_cache_level=6, optimizer_switch=\'mrr=on\'  FOR SELECT ...\n\nNote that it makes no sense to try to set a session variable inside a SET\nSTATEMENT:\n\n#USELESS STATEMENT\nSET STATEMENT sort_buffer_size = 100000 for SET SESSION sort_buffer_size =\n200000;\n\nFor the above, after setting sort_buffer_size to 200000 it will be reset to\nits original state (the state before the SET STATEMENT started) after the\nstatement execution.\n\nLimitations\n-----------\n\nThere are a number of variables that cannot be set on per-query basis. These\ninclude:\n\n* autocommit\n* character_set_client\n* character_set_connection\n* character_set_filesystem\n* collation_connection\n* default_master_connection\n* debug_sync\n* interactive_timeout\n* gtid_domain_id\n* last_insert_id\n* log_slow_filter\n* log_slow_rate_limit\n* log_slow_verbosity\n* long_query_time\n* min_examined_row_limit\n* profiling\n* profiling_history_size\n* query_cache_type\n* rand_seed1\n* rand_seed2\n* skip_replication\n* slow_query_log\n* sql_log_off\n* tx_isolation\n* wait_timeout\n\nSource\n------\n\n* The feature was originally implemented as a Google Summer of Code 2009\nproject by Joseph Lukas. \n* Percona Server 5.6 included it as Per-query variable statement\n* MariaDB ported the patch and fixed many bugs. The task in MariaDB Jira is\nMDEV-5231.\n\nURL: https://mariadb.com/kb/en/set-statement/','','https://mariadb.com/kb/en/set-statement/'),
(359,'SET Variable',26,'Syntax\n------\n\nSET var_name = expr [, var_name = expr] ...\n\nDescription\n-----------\n\nThe SET statement in stored programs is an extended version of the general SET\nstatement. Referenced variables may be ones declared inside a stored program,\nglobal system variables, or user-defined variables.\n\nThe SET statement in stored programs is implemented as part of the\npre-existing SET syntax. This allows an extended syntax of SET a=x, b=y, ...\nwhere different variable types (locally declared variables, global and session\nserver variables, user-defined variables) can be mixed. This also allows\ncombinations of local variables and some options that make sense only for\nsystem variables; in that case, the options are recognized but ignored.\n\nSET can be used with both local variables and user-defined variables.\n\nWhen setting several variables using the columns returned by a query, SELECT\nINTO should be preferred.\n\nTo set many variables to the same value, the LAST_VALUE( ) function can be\nused.\n\nBelow is an example of how a user-defined variable may be set:\n\nSET @x = 1;\n\nURL: https://mariadb.com/kb/en/set-variable/','','https://mariadb.com/kb/en/set-variable/'),
(360,'About SHOW',26,'SHOW has many forms that provide information about databases, tables, columns,\nor status information about the server. These include:\n\n* SHOW AUTHORS\n* SHOW CHARACTER SET [like_or_where]\n* SHOW COLLATION [like_or_where]\n* SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\n* SHOW CONTRIBUTORS\n* SHOW CREATE DATABASE db_name\n* SHOW CREATE EVENT event_name\n* SHOW CREATE PACKAGE package_name\n* SHOW CREATE PACKAGE BODY package_name\n* SHOW CREATE PROCEDURE proc_name\n* SHOW CREATE TABLE tbl_name\n* SHOW CREATE TRIGGER trigger_name\n* SHOW CREATE VIEW view_name\n* SHOW DATABASES [like_or_where]\n* SHOW ENGINE engine_name {STATUS | MUTEX}\n* SHOW [STORAGE] ENGINES\n* SHOW ERRORS [LIMIT [offset,] row_count]\n* SHOW [FULL] EVENTS\n* SHOW FUNCTION CODE func_name\n* SHOW FUNCTION STATUS [like_or_where]\n* SHOW GRANTS FOR user\n* SHOW INDEX FROM tbl_name [FROM db_name]\n* SHOW INNODB STATUS\n* SHOW OPEN TABLES [FROM db_name] [like_or_where]\n* SHOW PLUGINS\n* SHOW PROCEDURE CODE proc_name\n* SHOW PROCEDURE STATUS [like_or_where]\n* SHOW PRIVILEGES\n* SHOW [FULL] PROCESSLIST\n* SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\n* SHOW PROFILES\n* SHOW [GLOBAL | SESSION] STATUS [like_or_where]\n* SHOW TABLE STATUS [FROM db_name] [like_or_where]\n* SHOW TABLES [FROM db_name] [like_or_where]\n* SHOW TRIGGERS [FROM db_name] [like_or_where]\n* SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\n* SHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n  LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\' part,\n\'pattern\' is a string that can contain the SQL \"%\" and \"_\" wildcard\ncharacters. The pattern is useful for restricting statement output to matching\nvalues.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See Extended Show.\n\nURL: https://mariadb.com/kb/en/about-show/','','https://mariadb.com/kb/en/about-show/'),
(363,'SHOW BINARY LOGS',26,'Syntax\n------\n\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nDescription\n-----------\n\nLists the binary log files on the server. This statement is used as part of\nthe procedure described in PURGE BINARY LOGS, that shows how to determine\nwhich logs can be purged.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nExamples\n--------\n\nSHOW BINARY LOGS;\n+--------------------+-----------+\n| Log_name           | File_size |\n+--------------------+-----------+\n| mariadb-bin.000001 |     19039 |\n| mariadb-bin.000002 |    717389 |\n| mariadb-bin.000003 |       300 |\n| mariadb-bin.000004 |       333 |\n| mariadb-bin.000005 |       899 |\n| mariadb-bin.000006 |       125 |\n| mariadb-bin.000007 |     18907 |\n| mariadb-bin.000008 |     19530 |\n| mariadb-bin.000009 |       151 |\n| mariadb-bin.000010 |       151 |\n| mariadb-bin.000011 |       125 |\n| mariadb-bin.000012 |       151 |\n| mariadb-bin.000013 |       151 |\n| mariadb-bin.000014 |       125 |\n| mariadb-bin.000015 |       151 |\n| mariadb-bin.000016 |       314 |\n+--------------------+-----------+\n\nURL: https://mariadb.com/kb/en/show-binary-logs/','','https://mariadb.com/kb/en/show-binary-logs/'),
(364,'SHOW BINLOG EVENTS',26,'Syntax\n------\n\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nDescription\n-----------\n\nShows the events in the binary log. If you do not specify \'log_name\', the\nfirst binary log is displayed.\n\nRequires the BINLOG MONITOR privilege (>= MariaDB 10.5.2) or the REPLICATION\nSLAVE privilege (<= MariaDB 10.5.1).\n\nExample\n-------\n\nSHOW BINLOG EVENTS IN \'mysql_sandbox10019-bin.000002\';\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| Log_name                      | Pos | Event_type        | Server_id |\nEnd_log_pos | Info                                           |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| mysql_sandbox10019-bin.000002 |   4 | Format_desc       |         1 |       \n 248 | Server ver: 10.0.19-MariaDB-log, Binlog ver: 4 |\n| mysql_sandbox10019-bin.000002 | 248 | Gtid_list         |         1 |       \n 273 | []                                             |\n| mysql_sandbox10019-bin.000002 | 273 | Binlog_checkpoint |         1 |       \n 325 | mysql_sandbox10019-bin.000002                  |\n| mysql_sandbox10019-bin.000002 | 325 | Gtid              |         1 |       \n 363 | GTID 0-1-1                                     |\n| mysql_sandbox10019-bin.000002 | 363 | Query             |         1 |       \n 446 | CREATE DATABASE blog                           |\n| mysql_sandbox10019-bin.000002 | 446 | Gtid              |         1 |       \n 484 | GTID 0-1-2                                     |\n| mysql_sandbox10019-bin.000002 | 484 | Query             |         1 |       \n 571 | use `blog`; CREATE TABLE bb (id INT)           |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-binlog-events/','','https://mariadb.com/kb/en/show-binlog-events/'),
(361,'Extended Show',26,'The following SHOW statements can be extended by using a WHERE clause and a\nLIKE clause to refine the results:\n\n* SHOW CHARACTER SET\n* SHOW COLLATION\n* SHOW COLUMNS\n* SHOW DATABASES\n* SHOW FUNCTION STATUS\n* SHOW INDEX\n* SHOW OPEN TABLES\n* SHOW PACKAGE STATUS\n* SHOW PACKAGE BODY STATUS\n* SHOW INDEX\n* SHOW PROCEDURE STATUS\n* SHOW STATUS\n* SHOW TABLE STATUS\n* SHOW TABLES\n* SHOW TRIGGERS\n* SHOW VARIABLES\n\nAs with a regular SELECT, the WHERE clause can be used for the specific\ncolumns returned, and the LIKE clause with the regular wildcards.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nShowing the tables beginning with a only.\n\nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n+----------------------+\n\nVariables whose name starts with aria and with a valued of greater than 8192:\n\nSHOW VARIABLES WHERE Variable_name LIKE \'aria%\' AND Value >8192;\n+------------------------------+---------------------+\n| Variable_name                | Value               |\n+------------------------------+---------------------+\n| aria_checkpoint_log_activity | 1048576             |\n| aria_log_file_size           | 1073741824          |\n| aria_max_sort_file_size      | 9223372036853727232 |\n| aria_pagecache_buffer_size   | 134217728           |\n| aria_sort_buffer_size        | 134217728           |\n+------------------------------+---------------------+\n\nShortcut, just returning variables whose name begins with aria.\n\nSHOW VARIABLES LIKE \'aria%\';\n+------------------------------------------+---------------------+\n| Variable_name                            | Value               |\n+------------------------------------------+---------------------+\n| aria_block_size                          | 8192                |\n| aria_checkpoint_interval                 | 30                  |\n| aria_checkpoint_log_activity             | 1048576             |\n| aria_force_start_after_recovery_failures | 0                   |\n| aria_group_commit                        | none                |\n| aria_group_commit_interval               | 0                   |\n| aria_log_file_size                       | 1073741824          |\n| aria_log_purge_type                      | immediate           |\n| aria_max_sort_file_size                  | 9223372036853727232 |\n| aria_page_checksum                       | ON                  |\n| aria_pagecache_age_threshold             | 300                 |\n| aria_pagecache_buffer_size               | 134217728           |\n| aria_pagecache_division_limit            | 100                 |\n| aria_recover                             | NORMAL              |\n| aria_repair_threads                      | 1                   |\n| aria_sort_buffer_size                    | 134217728           |\n| aria_stats_method                        | nulls_unequal       |\n| aria_sync_log_dir                        | NEWFILE             |\n| aria_used_for_temp_tables                | ON                  |\n+------------------------------------------+---------------------+\n\nURL: https://mariadb.com/kb/en/extended-show/','','https://mariadb.com/kb/en/extended-show/'),
(365,'SHOW CHARACTER SET',26,'Syntax\n------\n\nSHOW CHARACTER SET\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW CHARACTER SET statement shows all available character sets. The LIKE\nclause, if present on its own, indicates which character set names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema CHARACTER_SETS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncharacter set at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description                 | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1  | cp1252 West European        | latin1_swedish_ci |      1 |\n| latin2  | ISO 8859-2 Central European | latin2_general_ci |      1 |\n| latin5  | ISO 8859-9 Turkish          | latin5_turkish_ci |      1 |\n| latin7  | ISO 8859-13 Baltic          | latin7_general_ci |      1 |\n+---------+-----------------------------+-------------------+--------+\n\nSHOW CHARACTER SET WHERE Maxlen LIKE \'2\';\n+---------+---------------------------+-------------------+--------+\n| Charset | Description               | Default collation | Maxlen |\n+---------+---------------------------+-------------------+--------+\n| big5    | Big5 Traditional Chinese  | big5_chinese_ci   |      2 |\n| sjis    | Shift-JIS Japanese        | sjis_japanese_ci  |      2 |\n| euckr   | EUC-KR Korean             | euckr_korean_ci   |      2 |\n| gb2312  | GB2312 Simplified Chinese | gb2312_chinese_ci |      2 |\n| gbk     | GBK Simplified Chinese    | gbk_chinese_ci    |      2 |\n| ucs2    | UCS-2 Unicode             | ucs2_general_ci   |      2 |\n| cp932   | SJIS for Windows Japanese | cp932_japanese_ci |      2 |\n+---------+---------------------------+-------------------+--------+\n\nURL: https://mariadb.com/kb/en/show-character-set/','','https://mariadb.com/kb/en/show-character-set/'),
(362,'SHOW AUTHORS',26,'Syntax\n------\n\nSHOW AUTHORS\n\nDescription\n-----------\n\nThe SHOW AUTHORS statement displays information about the people who work on\nMariaDB. For each author, it displays Name, Location, and Comment values. All\ncolumns are encoded as latin1.\n\nThese include:\n\n* First the active people in MariaDB are listed.\n* Then the active people in MySQL.\n* Last the people that have contributed to MariaDB/MySQL in the past.\n\nThe order is somewhat related to importance of the contribution given to the\nMariaDB project, but this is not 100% accurate. There is still room for\nimprovement and debate...\n\nExample\n-------\n\nSHOW AUTHORS\\G\n*************************** 1. row ***************************\n  Name: Michael (Monty) Widenius\nLocation: Tusby, Finland\n Comment: Lead developer and main author\n*************************** 2. row ***************************\n  Name: Sergei Golubchik\nLocation: Kerpen, Germany\n Comment: Architect, Full-text search, precision math, plugin framework,\nmerges etc\n*************************** 3. row ***************************\n  Name: Igor Babaev\nLocation: Bellevue, USA\n Comment: Optimizer, keycache, core work\n*************************** 4. row ***************************\n  Name: Sergey Petrunia\nLocation: St. Petersburg, Russia\n Comment: Optimizer\n*************************** 5. row ***************************\n  Name: Oleksandr Byelkin\nLocation: Lugansk, Ukraine\n Comment: Query Cache (4.0), Subqueries (4.1), Views (5.0)\n*************************** 6. row ***************************\n  Name: Timour Katchaounov\nLocation: Sofia , Bulgaria\n Comment: Optimizer\n*************************** 7. row ***************************\n  Name: Kristian Nielsen\nLocation: Copenhagen, Denmark\n Comment: Replication, Async client prototocol, General buildbot stuff\n*************************** 8. row ***************************\n  Name: Alexander (Bar) Barkov\nLocation: Izhevsk, Russia\n Comment: Unicode and character sets\n*************************** 9. row ***************************\n  Name: Alexey Botchkov (Holyfoot)\nLocation: Izhevsk, Russia\n Comment: GIS extensions, embedded server, precision math\n*************************** 10. row ***************************\n  Name: Daniel Bartholomew\nLocation: Raleigh, USA\n Comment: MariaDB documentation, Buildbot, releases\n*************************** 11. row ***************************\n  Name: Colin Charles\nLocation: Selangor, Malesia\n Comment: MariaDB documentation, talks at a LOT of conferences\n*************************** 12. row ***************************\n  Name: Sergey Vojtovich\nLocation: Izhevsk, Russia\n Comment: initial implementation of plugin architecture, maintained native\nstorage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache\n*************************** 13. row ***************************\n  Name: Vladislav Vaintroub\nLocation: Mannheim, Germany\n Comment: MariaDB Java connector, new thread pool, Windows optimizations\n*************************** 14. row ***************************\n  Name: Elena Stepanova\nLocation: Sankt Petersburg, Russia\n Comment: QA, test cases\n*************************** 15. row ***************************\n  Name: Georg Richter\nLocation: Heidelberg, Germany\n Comment: New LGPL C connector, PHP connector\n*************************** 16. row ***************************\n  Name: Jan Lindström\nLocation: Ylämylly, Finland\n Comment: Working on InnoDB\n*************************** 17. row ***************************\n  Name: Lixun Peng\nLocation: Hangzhou, China\n Comment: Multi Source replication\n*************************** 18. row ***************************\n  Name: Olivier Bertrand\nLocation: Paris, France\n Comment: CONNECT storage engine\n*************************** 19. row ***************************\n  Name: Kentoku Shiba\nLocation: Tokyo, Japan\n Comment: Spider storage engine, metadata_lock_info Information schema\n*************************** 20. row ***************************\n  Name: Percona\nLocation: CA, USA\n Comment: XtraDB, microslow patches, extensions to slow log\n*************************** 21. row ***************************\n  Name: Vicentiu Ciorbaru\nLocation: Bucharest, Romania\n Comment: Roles\n*************************** 22. row ***************************\n  Name: Sudheera Palihakkara\nLocation: \n Comment: PCRE Regular Expressions\n*************************** 23. row ***************************\n  Name: Pavel Ivanov\nLocation: USA\n Comment: Some patches and bug fixes\n*************************** 24. row ***************************\n  Name: Konstantin Osipov\nLocation: Moscow, Russia\n Comment: Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)\n*************************** 25. row ***************************\n  Name: Ian Gilfillan\nLocation: South Africa\n Comment: MariaDB documentation\n*************************** 26. row ***************************\n  Name: Federico Razolli\nLocation: Italy\n Comment: MariaDB documentation Italian translation\n*************************** 27. row ***************************\n  Name: Guilhem Bichot\nLocation: Bordeaux, France\n Comment: Replication (since 4.0)\n*************************** 28. row ***************************\n  Name: Andrei Elkin\nLocation: Espoo, Finland\n Comment: Replication\n*************************** 29. row ***************************\n  Name: Dmitri Lenev\nLocation: Moscow, Russia\n Comment: Time zones support (4.1), Triggers (5.0)\n*************************** 30. row ***************************\n  Name: Marc Alff\nLocation: Denver, CO, USA\n Comment: Signal, Resignal, Performance schema\n*************************** 31. row ***************************\n  Name: Mikael Ronström\nLocation: Stockholm, Sweden\n Comment: NDB Cluster, Partitioning, online alter table\n*************************** 32. row ***************************\n  Name: Ingo Strüwing\nLocation: Berlin, Germany\n Comment: Bug fixing in MyISAM, Merge tables etc\n*************************** 33. row ***************************\n  Name: Marko Mäkelä\nLocation: Helsinki, Finland\n Comment: InnoDB core developer\n...\n\nURL: https://mariadb.com/kb/en/show-authors/','','https://mariadb.com/kb/en/show-authors/'),
(366,'SHOW CLIENT_STATISTICS',26,'Syntax\n------\n\nSHOW CLIENT_STATISTICS\n\nDescription\n-----------\n\nThe SHOW CLIENT_STATISTICS statement is part of the User Statistics feature.\nIt was removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.CLIENT_STATISTICS table holds statistics about client\nconnections.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.CLIENT_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW CLIENT_STATISTICS\\G\n*************************** 1. row ***************************\n        Client: localhost\n  Total_connections: 35\nConcurrent_connections: 0\n    Connected_time: 708\n      Busy_time: 2.5557979999999985\n       Cpu_time: 0.04123740000000002\n    Bytes_received: 3883\n      Bytes_sent: 21595\n Binlog_bytes_written: 0\n      Rows_read: 18\n      Rows_sent: 115\n     Rows_deleted: 0\n    Rows_inserted: 0\n     Rows_updated: 0\n   Select_commands: 70\n   Update_commands: 0\n    Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n  Denied_connections: 0\n   Lost_connections: 0\n    Access_denied: 0\n    Empty_queries: 35\n\nURL: https://mariadb.com/kb/en/show-client-statistics/','','https://mariadb.com/kb/en/show-client-statistics/'),
(367,'SHOW CONTRIBUTORS',26,'Syntax\n------\n\nSHOW CONTRIBUTORS\n\nDescription\n-----------\n\nThe SHOW CONTRIBUTORS statement displays information about the companies and\npeople who financially contribute to MariaDB. For each contributor, it\ndisplays Name, Location, and Comment values. All columns are encoded as latin1.\n\nIt displays all members and sponsors of the MariaDB Foundation as well as\nother financial contributors.\n\nExample\n-------\n\nSHOW CONTRIBUTORS;\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Name                | Location                      | Comment               \n                  |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Alibaba Cloud       | https://www.alibabacloud.com/ | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Tencent Cloud       | https://cloud.tencent.com     | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Microsoft           | https://microsoft.com/        | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| MariaDB Corporation | https://mariadb.com           | Founding member,\nPlatinum Sponsor of the MariaDB Foundation |\n| ServiceNow          | https://servicenow.com        | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Intel               | https://www.intel.com         | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| SIT                 | https://sit.org               | Platinum Sponsor of\nthe MariaDB Foundation                  |\n| Visma               | https://visma.com             | Gold Sponsor of the\nMariaDB Foundation                      |\n| DBS                 | https://dbs.com               | Gold Sponsor of the\nMariaDB Foundation                      |\n| IBM                 | https://www.ibm.com           | Gold Sponsor of the\nMariaDB Foundation                      |\n| Automattic          | https://automattic.com        | Silver Sponsor of the\nMariaDB Foundation                    |\n| Percona             | https://www.percona.com/      | Sponsor of the MariaDB\nFoundation                           |\n| Galera Cluster      | https://galeracluster.com     | Sponsor of the MariaDB\nFoundation                           |\n| Google              | USA                           | Sponsoring encryption,\nparallel replication and GTID        |\n| Facebook            | USA                           | Sponsoring\nnon-blocking API, LIMIT ROWS EXAMINED etc        |\n| Ronald Bradford     | Brisbane, Australia           | EFF contribution for\nUC2006 Auction                         |\n| Sheeri Kritzer      | Boston, Mass. USA             | EFF contribution for\nUC2006 Auction                         |\n| Mark Shuttleworth   | London, UK.                   | EFF contribution for\nUC2006 Auction                         |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-contributors/','','https://mariadb.com/kb/en/show-contributors/'),
(368,'SHOW CREATE DATABASE',26,'Syntax\n------\n\nSHOW CREATE {DATABASE | SCHEMA} db_name\n\nDescription\n-----------\n\nShows the CREATE DATABASE statement that creates the given database. SHOW\nCREATE SCHEMA is a synonym for SHOW CREATE DATABASE. SHOW CREATE DATABASE\nquotes database names according to the value of the sql_quote_show_create\nserver system variable.\n\nExamples\n--------\n\nSHOW CREATE DATABASE test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nSHOW CREATE SCHEMA test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database                                                 |\n+----------+-----------------------------------------------------------------+\n| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nWith sql_quote_show_create off:\n\nSHOW CREATE DATABASE test;\n+----------+---------------------------------------------------------------+\n| Database | Create Database                                               |\n+----------+---------------------------------------------------------------+\n| test     | CREATE DATABASE test /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+---------------------------------------------------------------+\n\nWith a comment, from MariaDB 10.5:\n\nSHOW CREATE DATABASE p;\n+----------+-------------------------------------------------------------------\n------------------+\n| Database | Create Database                                                  \n         |\n+----------+-------------------------------------------------------------------\n------------------+\n| p        | CREATE DATABASE `p` /*!40100 DEFAULT CHARACTER SET latin1 */\nCOMMENT \'presentations\' |\n+----------+-------------------------------------------------------------------\n------------------+\n\nURL: https://mariadb.com/kb/en/show-create-database/','','https://mariadb.com/kb/en/show-create-database/'),
(369,'SHOW CREATE EVENT',26,'Syntax\n------\n\nSHOW CREATE EVENT event_name\n\nDescription\n-----------\n\nThis statement displays the CREATE EVENT statement needed to re-create a given\nevent, as well as the SQL_MODE that was used when the trigger has been created\nand the character set used by the connection. To find out which events are\npresent, use SHOW EVENTS.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nThe information_schema.EVENTS table provides similar, but more complete,\ninformation.\n\nExamples\n--------\n\nSHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n       Event: e_daily\n      sql_mode:\n     time_zone: SYSTEM\n    Create Event: CREATE EVENT `e_daily`\n            ON SCHEDULE EVERY 1 DAY\n            STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n            ON COMPLETION NOT PRESERVE\n            ENABLE\n            COMMENT \'Saves total number of sessions then\n                clears the table each day\'\n            DO BEGIN\n             INSERT INTO site_activity.totals (time, total)\n              SELECT CURRENT_TIMESTAMP, COUNT(*)\n              FROM site_activity.sessions;\n             DELETE FROM site_activity.sessions;\n            END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-event/','','https://mariadb.com/kb/en/show-create-event/'),
(370,'SHOW CREATE FUNCTION',26,'Syntax\n------\n\nSHOW CREATE FUNCTION func_name\n\nDescription\n-----------\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored functions.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExample\n-------\n\nSHOW CREATE FUNCTION VatCents\\G\n*************************** 1. row ***************************\n      Function: VatCents\n      sql_mode:\n  Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION\n`VatCents`(price DECIMAL(10,2)) RETURNS int(11)\n  DETERMINISTIC\nBEGIN\n DECLARE x INT;\n SET x = price * 114;\n RETURN x;\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-function/','','https://mariadb.com/kb/en/show-create-function/'),
(371,'SHOW CREATE PACKAGE',26,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package specification.\n\nExamples\n--------\n\nSHOW CREATE PACKAGE employee_tools\\G\n*************************** 1. row ***************************\n      Package: employee_tools\n      sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n   Create Package: CREATE DEFINER=\"root\"@\"localhost\" PACKAGE\n\"employee_tools\" AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-package/','','https://mariadb.com/kb/en/show-create-package/'),
(372,'SHOW CREATE PACKAGE BODY',26,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE BODY  [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package body (i.e. the\nimplementation).\n\nExamples\n--------\n\nSHOW CREATE PACKAGE BODY employee_tools\\G\n*************************** 1. row ***************************\n    Package body: employee_tools\n      sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package Body: CREATE DEFINER=\"root\"@\"localhost\" PACKAGE BODY\n\"employee_tools\" AS\n\nstdRaiseAmount DECIMAL(10,2):=500;\n\nPROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n  INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\nPROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n  eid INT;\n BEGIN\n  INSERT INTO employee (name, salary) VALUES (ename, esalary);\n  eid:= last_insert_id();\n  log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n  nSalary DECIMAL(10,2);\n BEGIN\n  SELECT salary INTO nSalary FROM employee WHERE id=eid;\n  log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n  RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n  UPDATE employee SET salary=salary+amount WHERE id=eid;\n  log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n  raiseSalary(eid, stdRaiseAmount);\n  log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN  \n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-create-package-body/','','https://mariadb.com/kb/en/show-create-package-body/'),
(373,'SHOW CREATE PROCEDURE',26,'Syntax\n------\n\nSHOW CREATE PROCEDURE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns the exact string that can be\nused to re-create the named stored procedure, as well as the SQL_MODE that was\nused when the trigger has been created and the character set used by the\nconnection.. A similar statement, SHOW CREATE FUNCTION, displays information\nabout stored functions.\n\nBoth statements require that you are the owner of the routine or have the\nSELECT privilege on the mysql.proc table. When neither is true, the statements\ndisplay NULL for the Create Procedure or Create Function field.\n\nWarning Users with SELECT privileges on mysql.proc or USAGE privileges on *.*\ncan view the text of routines, even when they do not have privileges for the\nfunction or procedure itself.\n\nThe output of these statements is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nHere\'s a comparison of the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION\nstatements.\n\nSHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n     Procedure: simpleproc\n      sql_mode:\n  Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n           BEGIN\n           SELECT COUNT(*) INTO param1 FROM t;\n           END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nSHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n      Function: hello\n      sql_mode:\n  Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n           RETURNS CHAR(50)\n           RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nWhen the user issuing the statement does not have privileges on the routine,\nattempting to CALL the procedure raises Error 1370.\n\nCALL test.prc1();\nError 1370 (42000): execute command denieed to user \'test_user\'@\'localhost\'\nfor routine \'test\'.\'prc1\'\n\nIf the user neither has privilege to the routine nor the SELECT privilege on\nmysql.proc table, it raises Error 1305, informing them that the procedure does\nnot exist.\n\nSHOW CREATE TABLES test.prc1\\G\nError 1305 (42000): PROCEDURE prc1 does not exist\n\nURL: https://mariadb.com/kb/en/show-create-procedure/','','https://mariadb.com/kb/en/show-create-procedure/'),
(374,'SHOW CREATE SEQUENCE',26,'Syntax\n------\n\nSHOW CREATE SEQUENCE sequence_name;\n\nDescription\n-----------\n\nShows the CREATE SEQUENCE statement that created the given sequence. The\nstatement requires the SELECT privilege for the table.\n\nExample\n-------\n\nCREATE SEQUENCE s1 START WITH 50;\nSHOW CREATE SEQUENCE s1\\G;\n*************************** 1. row ***************************\n   Table: s1\nCreate Table: CREATE SEQUENCE `s1` start with 50 minvalue 1 maxvalue\n9223372036854775806 \n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nNotes\n-----\n\nIf you want to see the underlying table structure used for the SEQUENCE you\ncan use SHOW CREATE TABLE on the SEQUENCE. You can also use SELECT to read the\ncurrent recorded state of the SEQUENCE:\n\nSHOW CREATE TABLE s1\\G\n*************************** 1. row ***************************\n   Table: s1\nCreate Table: CREATE TABLE `s1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated \n  or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, \n  1 if the sequence should begin a new cycle when maximum_value is passed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nSELECT * FROM s1\\G\n*************************** 1. row ***************************\nnext_not_cached_value: 50\n    minimum_value: 1\n    maximum_value: 9223372036854775806\n     start_value: 50\n      increment: 1\n     cache_size: 1000\n    cycle_option: 0\n     cycle_count: 0\n\nURL: https://mariadb.com/kb/en/show-create-sequence/','','https://mariadb.com/kb/en/show-create-sequence/'),
(375,'SHOW CREATE TRIGGER',26,'Syntax\n------\n\nSHOW CREATE TRIGGER trigger_name\n\nDescription\n-----------\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger, as well as the SQL_MODE that was used when the trigger has been\ncreated and the character set used by the connection.\n\nThe TRIGGER privilege is required on the table the trigger is defined for to\nexecute this statement.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nSHOW CREATE TRIGGER example\\G\n*************************** 1. row ***************************\n       Trigger: example\n       sql_mode:\nONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,STRICT_ALL_TABLES\n,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO\n\nENGINE_SUBSTITUTION\nSQL Original Statement: CREATE DEFINER=`root`@`localhost` TRIGGER example\nBEFORE\n INSERT ON t FOR EACH ROW\nBEGIN\n    SET NEW.c = NEW.c * 2;\nEND\n character_set_client: cp850\n collation_connection: cp850_general_ci\n Database Collation: utf8_general_ci\n Created: 2016-09-29 13:53:34.35\n\nMariaDB starting with 10.2.3\n----------------------------\nThe Created column was added in MySQL 5.7 and MariaDB 10.2.3 as part of\nintroducing multiple trigger events per action.\n\nURL: https://mariadb.com/kb/en/show-create-trigger/','','https://mariadb.com/kb/en/show-create-trigger/'),
(376,'SHOW CREATE VIEW',26,'Syntax\n------\n\nSHOW CREATE VIEW view_name\n\nDescription\n-----------\n\nThis statement shows a CREATE VIEW statement that creates the given view, as\nwell as the character set used by the connection when the view was created.\nThis statement also works with views.\n\nSHOW CREATE VIEW quotes table, column and stored function names according to\nthe value of the sql_quote_show_create server system variable.\n\nExamples\n--------\n\nSHOW CREATE VIEW example\\G\n*************************** 1. row ***************************\n        View: example\n    Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL\nSECURITY DEFINER VIEW `example` AS (select `t`.`id` AS `id`,`t`.`s` AS `s` from\n`t`)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nWith sql_quote_show_create off:\n\nSHOW CREATE VIEW example\\G\n*************************** 1. row ***************************\n        View: example\n    Create View: CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL\nSECU\nRITY DEFINER VIEW example AS (select t.id AS id,t.s AS s from t)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nGrants\n------\n\nTo be able to see a view, you need to have the SHOW VIEW and the SELECT\nprivilege on the view:\n\nGRANT SHOW VIEW,SELECT ON test_database.test_view TO \'test\'@\'localhost\';\n\nURL: https://mariadb.com/kb/en/show-create-view/','','https://mariadb.com/kb/en/show-create-view/'),
(377,'SHOW DATABASES',26,'Syntax\n------\n\nSHOW {DATABASES | SCHEMAS}\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW DATABASES lists the databases on the MariaDB server host. SHOW SCHEMAS is\na synonym for SHOW DATABASES. The LIKE clause, if present on its own,\nindicates which database names to match. The WHERE and LIKE clauses can be\ngiven to select rows using more general conditions, as discussed in Extended\nSHOW.\n\nYou see only those databases for which you have some kind of privilege, unless\nyou have the global SHOW DATABASES privilege. You can also get this list using\nthe mariadb-show command.\n\nIf the server was started with the --skip-show-database option, you cannot use\nthis statement at all unless you have the SHOW DATABASES privilege.\n\nThe list of results returned by SHOW DATABASES is based on directories in the\ndata directory, which is how MariaDB implements databases. It\'s possible that\noutput includes directories that do not correspond to actual databases.\n\nThe Information Schema SCHEMATA table also contains database information.\n\nExamples\n--------\n\nSHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| test               |\n+--------------------+\n\nSHOW DATABASES LIKE \'m%\';\n+---------------+\n| Database (m%) |\n+---------------+\n| mysql         |\n+---------------+\n\nURL: https://mariadb.com/kb/en/show-databases/','','https://mariadb.com/kb/en/show-databases/'),
(380,'SHOW ENGINES',26,'Syntax\n------\n\nSHOW [STORAGE] ENGINES\n\nDescription\n-----------\n\nSHOW ENGINES displays status information about the server\'s storage engines.\nThis is particularly useful for checking whether a storage engine is\nsupported, or to see what the default engine is. SHOW TABLE TYPES is a\ndeprecated synonym.\n\nThe information_schema.ENGINES table provides the same information.\n\nSince storage engines are plugins, different information about them is also\nshown in the information_schema.PLUGINS table and by the SHOW PLUGINS\nstatement.\n\nNote that both MySQL\'s InnoDB and Percona\'s XtraDB replacement are labeled as\nInnoDB. However, if XtraDB is in use, it will be specified in the COMMENT\nfield. See XtraDB and InnoDB. The same applies to FederatedX.\n\nThe output consists of the following columns:\n\n* Engine indicates the engine\'s name.\n* Support indicates whether the engine is installed, and whether it is the\ndefault engine for the current session.\n* Comment is a brief description.\n* Transactions, XA and Savepoints indicate whether transactions, XA\ntransactions and transaction savepoints are supported by the engine.\n\nExamples\n--------\n\nSHOW ENGINES\\G\n*************************** 1. row ***************************\n   Engine: InnoDB\n  Support: DEFAULT\n  Comment: Supports transactions, row-level locking, and foreign keys\nTransactions: YES\n     XA: YES\n Savepoints: YES\n*************************** 2. row ***************************\n   Engine: CSV\n  Support: YES\n  Comment: CSV storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 3. row ***************************\n   Engine: MyISAM\n  Support: YES\n  Comment: MyISAM storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 4. row ***************************\n   Engine: BLACKHOLE\n  Support: YES\n  Comment: /dev/null storage engine (anything you write to it disappears)\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 5. row ***************************\n   Engine: FEDERATED\n  Support: YES\n  Comment: FederatedX pluggable storage engine\nTransactions: YES\n     XA: NO\n Savepoints: YES\n*************************** 6. row ***************************\n   Engine: MRG_MyISAM\n  Support: YES\n  Comment: Collection of identical MyISAM tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 7. row ***************************\n   Engine: ARCHIVE\n  Support: YES\n  Comment: Archive storage engine\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 8. row ***************************\n   Engine: MEMORY\n  Support: YES\n  Comment: Hash based, stored in memory, useful for temporary tables\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 9. row ***************************\n   Engine: PERFORMANCE_SCHEMA\n  Support: YES\n  Comment: Performance Schema\nTransactions: NO\n     XA: NO\n Savepoints: NO\n*************************** 10. row ***************************\n   Engine: Aria\n  Support: YES\n  Comment: Crash-safe tables with MyISAM heritage\nTransactions: NO\n     XA: NO\n Savepoints: NO\n10 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/show-engines/','','https://mariadb.com/kb/en/show-engines/'),
(378,'SHOW ENGINE',26,'Syntax\n------\n\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nDescription\n-----------\n\nSHOW ENGINE displays operational information about a storage engine. The\nfollowing statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\nSHOW ENGINE ROCKSDB STATUS\n\nIf the Sphinx Storage Engine is installed, the following is also supported:\n\nSHOW ENGINE SPHINX STATUS\n\nSee SHOW ENGINE SPHINX STATUS.\n\nOlder (and now removed) synonyms were SHOW INNODB STATUS for SHOW ENGINE\nINNODB STATUS and SHOW MUTEX STATUS for SHOW ENGINE INNODB MUTEX.\n\nSHOW ENGINE INNODB STATUS\n-------------------------\n\nSHOW ENGINE INNODB STATUS displays extensive information from the standard\nInnoDB Monitor about the state of the InnoDB storage engine. See SHOW ENGINE\nINNODB STATUS for more.\n\nSHOW ENGINE INNODB MUTEX\n------------------------\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics.\n\nThe statement displays the following output fields:\n\n* Type: Always InnoDB.\n* Name: The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number is dependent on the\nMariaDB version.\n* Status: This field displays the following values if UNIV_DEBUG was defined\nat compilation time (for example, in include/univ.h in the InnoDB part of the\nsource tree). Only the os_waits value is displayed if UNIV_DEBUG was not\ndefined. Without UNIV_DEBUG, the information on which the output is based is\ninsufficient to distinguish regular mutexes and mutexes that protect\n rw-locks (which allow multiple readers or a single writer). Consequently, the\n output may appear to contain multiple rows for the same mutex.\ncount indicates how many times the mutex was requested.\nspin_waits indicates how many times the spinlock had to run.\nspin_rounds indicates the number of spinlock rounds. (spin_rounds divided by\n spin_waits provides the average round count.)\nos_waits indicates the number of operating system waits. This occurs when\n the spinlock did not work (the mutex was not locked during the spinlock and\n it was necessary to yield to the operating system and wait).\nos_yields indicates the number of times a the thread trying to lock a mutex\n gave up its timeslice and yielded to the operating system (on the\n presumption that allowing other threads to run will free the mutex so that\n it can be locked).\nos_wait_times indicates the amount of time (in ms) spent in operating system\n waits, if the timed_mutexes system variable is 1 (ON). If timed_mutexes is 0\n (OFF), timing is disabled, so os_wait_times is 0. timed_mutexes is off by\n default.\n\nInformation from this statement can be used to diagnose system problems. For\nexample, large values of spin_waits and spin_rounds may indicate scalability\nproblems.\n\nThe information_schema.INNODB_MUTEXES table provides similar information.\n\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n-------------------------------------\n\nThis statement shows how much memory is used for performance_schema tables and\ninternal buffers.\n\nThe output contains the following fields:\n\n* Type: Always performance_schema.\n* Name: The name of a table, the name of an internal buffer, or the\nperformance_schema word, followed by a dot and an attribute. Internal buffers\nnames are enclosed by parenthesis. performance_schema means that the attribute\nrefers to the whole database (it is a total). \n* Status: The value for the attribute.\n\nThe following attributes are shown, in this order, for all tables:\n\n* row_size: The memory used for an individual record. This value will never\nchange.\n* row_count: The number of rows in the table or buffer. For some tables, this\nvalue depends on a server system variable.\n* memory: For tables and performance_schema, this is the result of row_size *\nrow_count.\n\nFor internal buffers, the attributes are:\n\n* count\n* size\n\nSHOW ENGINE ROCKSDB STATUS\n--------------------------\n\nSee also MyRocks Performance Troubleshooting\n\nURL: https://mariadb.com/kb/en/show-engine/','','https://mariadb.com/kb/en/show-engine/'),
(381,'SHOW ERRORS',26,'Syntax\n------\n\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) ERRORS\n\nDescription\n-----------\n\nThis statement is similar to SHOW WARNINGS, except that instead of displaying\nerrors, warnings, and notes, it displays only errors.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You can also\nretrieve this number from the error_count variable.\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nThe value of error_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nExamples\n--------\n\nSELECT f();\nERROR 1305 (42000): FUNCTION f does not exist\n\nSHOW COUNT(*) ERRORS;\n+-----------------------+\n| @@session.error_count |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSHOW ERRORS;\n+-------+------+---------------------------+\n| Level | Code | Message                   |\n+-------+------+---------------------------+\n| Error | 1305 | FUNCTION f does not exist |\n+-------+------+---------------------------+\n\nURL: https://mariadb.com/kb/en/show-errors/','','https://mariadb.com/kb/en/show-errors/'),
(379,'SHOW ENGINE INNODB STATUS',26,'SHOW ENGINE INNODB STATUS is a specific form of the SHOW ENGINE statement that\ndisplays the InnoDB Monitor output, which is extensive InnoDB information\nwhich can be useful in diagnosing problems.\n\nThe following sections are displayed\n\n* Status: Shows the timestamp, monitor name and the number of seconds, or the\nelapsed time between the current time and the time the InnoDB Monitor output\nwas last displayed. The per-second averages are based upon this time.\n* BACKGROUND THREAD: srv_master_thread lines show work performed by the main\nbackground thread.\n* SEMAPHORES: Threads waiting for a semaphore and stats on how the number of\ntimes threads have needed a spin or a wait on a mutex or rw-lock semaphore. If\nthis number of threads is large, there may be I/O or contention issues.\nReducing the size of the innodb_thread_concurrency system variable may help if\ncontention is related to thread scheduling. Spin rounds per wait shows the\nnumber of spinlock rounds per OS wait for a mutex. \n* LATEST FOREIGN KEY ERROR: Only shown if there has been a foreign key\nconstraint error, it displays the failed statement and information about the\nconstraint and the related tables.\n* LATEST DETECTED DEADLOCK: Only shown if there has been a deadlock, it\ndisplays the transactions involved in the deadlock and the statements being\nexecuted, held and required locked and the transaction rolled back to.\n* TRANSACTIONS: The output of this section can help identify lock contention,\nas well as reasons for the deadlocks.\n* FILE I/O: InnoDB thread information as well as pending I/O operations and\nI/O performance statistics.\n* INSERT BUFFER AND ADAPTIVE HASH INDEX: InnoDB insert buffer (old name for\nthe change buffer) and adaptive hash index status information, including the\nnumber of each type of operation performed, and adaptive hash index\nperformance.\n* LOG: InnoDB log information, including current log sequence number, how far\nthe log has been flushed to disk, the position at which InnoDB last took a\ncheckpoint, pending writes and write performance statistics.\n* BUFFER POOL AND MEMORY: Information on buffer pool pages read and written,\nwhich allows you to see the number of data file I/O operations performed by\nyour queries. See InnoDB Buffer Pool for more. Similar information is also\navailable from the INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS table.\n* ROW OPERATIONS:Information about the main thread, including the number and\nperformance rate for each type of row operation.\n\nIf the innodb_status_output_locks system variable is set to 1, extended lock\ninformation will be displayed.\n\nExample output:\n\n=====================================\n2019-09-06 12:44:13 0x7f93cc236700 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 4 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 2 srv_active, 0 srv_shutdown, 83698 srv_idle\nsrv_master_thread log flush and writes: 83682\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 15\nOS WAIT ARRAY INFO: signal count 8\nRW-shared spins 0, rounds 20, OS waits 7\nRW-excl spins 0, rounds 0, OS waits 0\nRW-sx spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 20.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx\n------------\nTRANSACTIONS\n------------\nTrx id counter 236\nPurge done for trx\'s n:o < 236 undo n:o < 0 state: running\nHistory list length 22\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 421747401994584, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n---TRANSACTION 421747401990328, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n--------\nFILE I/O\n--------\nI/O thread 0 state: waiting for completed aio requests (insert buffer thread)\nI/O thread 1 state: waiting for completed aio requests (log thread)\nI/O thread 2 state: waiting for completed aio requests (read thread)\nI/O thread 3 state: waiting for completed aio requests (read thread)\nI/O thread 4 state: waiting for completed aio requests (read thread)\nI/O thread 5 state: waiting for completed aio requests (read thread)\nI/O thread 6 state: waiting for completed aio requests (write thread)\nI/O thread 7 state: waiting for completed aio requests (write thread)\nI/O thread 8 state: waiting for completed aio requests (write thread)\nI/O thread 9 state: waiting for completed aio requests (write thread)\nPending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,\n ibuf aio reads:, log i/o\'s:, sync i/o\'s:\nPending flushes (fsync) log: 0; buffer pool: 0\n286 OS file reads, 171 OS file writes, 22 OS fsyncs\n0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\n insert 0, delete mark 0, delete 0\ndiscarded operations:\n insert 0, delete mark 0, delete 0\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\n0.00 hash searches/s, 0.00 non-hash searches/s\n---\nLOG\n---\nLog sequence number 445926\nLog flushed up to   445926\nPages flushed up to 445926\nLast checkpoint at  445917\n0 pending log flushes, 0 pending chkp writes\n18 log i/o\'s done, 0.00 log i/o\'s/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal large memory allocated 167772160\nDictionary memory allocated 50768\nBuffer pool size   8012\nFree buffers       7611\nDatabase pages     401\nOld database pages 0\nModified db pages  0\nPercent of dirty pages(LRU & free pages): 0.000\nMax dirty pages percent: 75.000\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs/s, 0.00 non-youngs/s\nPages read 264, created 137, written 156\n0.00 reads/s, 0.00 creates/s, 0.00 writes/s\nNo buffer pool page gets since the last printout\nPages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead\n0.00/s\nLRU len: 401, unzip_LRU len: 0\nI/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n0 read views open inside InnoDB\nProcess ID=4267, Main thread ID=140272021272320, state: sleeping\nNumber of rows inserted 1, updated 0, deleted 0, read 1\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\nNumber of system rows inserted 0, updated 0, deleted 0, read 0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n\nURL: https://mariadb.com/kb/en/show-engine-innodb-status/','','https://mariadb.com/kb/en/show-engine-innodb-status/'),
(382,'SHOW EVENTS',26,'Syntax\n------\n\nSHOW EVENTS [{FROM | IN} schema_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nShows information about Event Manager events (created with CREATE EVENT).\nRequires the EVENT privilege. Without any arguments, SHOW EVENTS lists all of\nthe events in the current schema:\n\nSELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora    | myschema |\n+----------------+----------+\n\nSHOW EVENTS\\G\n*************************** 1. row ***************************\n         Db: myschema\n        Name: e_daily\n      Definer: jon@ghidora\n     Time zone: SYSTEM\n        Type: RECURRING\n     Execute at: NULL\n   Interval value: 10\n   Interval field: SECOND\n       Starts: 2006-02-09 10:41:23\n        Ends: NULL\n       Status: ENABLED\n     Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see the event action, use SHOW CREATE EVENT instead, or look at the\ninformation_schema.EVENTS table.\n\nTo see events for a specific schema, use the FROM clause. For example, to see\nevents for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The WHERE\nclause can be given to select rows using more general conditions, as discussed\nin Extended Show.\n\nURL: https://mariadb.com/kb/en/show-events/','','https://mariadb.com/kb/en/show-events/'),
(383,'SHOW FUNCTION STATUS',26,'Syntax\n------\n\nSHOW FUNCTION STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored functions.\n\nThe LIKE clause, if present on its own, indicates which function names to\nmatch.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe information_schema.ROUTINES table contains more detailed information.\n\nExamples\n--------\n\nShowing all stored functions:\n\nSHOW FUNCTION STATUS\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions whose name starts with \'V\':\n\nSHOW FUNCTION STATUS LIKE \'V%\' \\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions with a security type of \'DEFINER\':\n\nSHOW FUNCTION STATUS WHERE Security_type LIKE \'DEFINER\' \\G\n*************************** 1. row ***************************\n         Db: test\n        Name: VatCents\n        Type: FUNCTION\n      Definer: root@localhost\n      Modified: 2013-06-01 12:40:31\n      Created: 2013-06-01 12:40:31\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-function-status/','','https://mariadb.com/kb/en/show-function-status/'),
(384,'SHOW LOCALES',26,'SHOW LOCALES was introduced as part of the Information Schema plugin extension.\n\nSHOW LOCALES is used to return locales information as part of the Locales\nplugin. While the information_schema.LOCALES table has 8 columns, the SHOW\nLOCALES statement will only display 4 of them:\n\nExample\n-------\n\nSHOW LOCALES;\n+-----+-------+-------------------------------------+------------------------+\n| Id  | Name  | Description                         | Error_Message_Language |\n+-----+-------+-------------------------------------+------------------------+\n|   0 | en_US | English - United States             | english                |\n|   1 | en_GB | English - United Kingdom            | english                |\n|   2 | ja_JP | Japanese - Japan                    | japanese               |\n|   3 | sv_SE | Swedish - Sweden                    | swedish                |\n...\n\nURL: https://mariadb.com/kb/en/show-locales/','','https://mariadb.com/kb/en/show-locales/'),
(385,'SHOW OPEN TABLES',26,'Syntax\n------\n\nSHOW OPEN TABLES [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open in the\ntable cache. See http://dev.mysql.com/doc/refman/5.1/en/table-cache.html.\n\nThe FROM and LIKE clauses may be used.\n\nThe FROM clause, if present, restricts the tables shown to those present in\nthe db_name database.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+------------------------------------------------+\n| Column                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| Database                  | Database name.                                 |\n+---------------------------+------------------------------------------------+\n| Name                      | Table name.                                    |\n+---------------------------+------------------------------------------------+\n| In_use                    | Number of  table instances being used.         |\n+---------------------------+------------------------------------------------+\n| Name_locked               | 1 if the table is name-locked, e.g. if it is   |\n|                           | being dropped or renamed, otherwise 0.         |\n+---------------------------+------------------------------------------------+\n\nBefore MariaDB 5.5, each use of, for example, LOCK TABLE ... WRITE would\nincrement In_use for that table. With the implementation of the metadata\nlocking improvements in MariaDB 5.5, LOCK TABLE... WRITE acquires a strong MDL\nlock, and concurrent connections will wait on this MDL lock, so any subsequent\nLOCK TABLE... WRITE will not increment In_use.\n\nExample\n-------\n\nSHOW OPEN TABLES;\n+----------+---------------------------+--------+-------------+\n| Database | Table                     | In_use | Name_locked |\n+----------+---------------------------+--------+-------------+\n...\n| test     | xjson                     |      0 |           0 |\n| test     | jauthor                   |      0 |           0 |\n| test     | locks                     |      1 |           0 |\n...\n+----------+---------------------------+--------+-------------+\n\nURL: https://mariadb.com/kb/en/show-open-tables/','','https://mariadb.com/kb/en/show-open-tables/'),
(386,'SHOW PACKAGE BODY STATUS',26,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE BODY STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE BODY STATUS statement returns characteristics of stored\npackage bodies (implementations), such as the database, name, type, creator,\ncreation and modification dates, and character set information. A similar\nstatement, SHOW PACKAGE STATUS, displays information about stored package\nspecifications.\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE BODY STATUS LIKE \'pkg1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: pkg1\n        Type: PACKAGE BODY\n      Definer: root@localhost\n      Modified: 2018-02-27 14:44:14\n      Created: 2018-02-27 14:44:14\n   Security_type: DEFINER\n      Comment: This is my first package body\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-package-body-status/','','https://mariadb.com/kb/en/show-package-body-status/'),
(387,'SHOW PACKAGE STATUS',26,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE STATUS statement returns characteristics of stored package\nspecifications, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nPACKAGE BODY STATUS, displays information about stored package bodies (i.e.\nimplementations).\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE STATUS LIKE \'pkg1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: pkg1\n        Type: PACKAGE\n      Definer: root@localhost\n      Modified: 2018-02-27 14:38:15\n      Created: 2018-02-27 14:38:15\n   Security_type: DEFINER\n      Comment: This is my first package\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-package-status/','','https://mariadb.com/kb/en/show-package-status/'),
(389,'SHOW PROCEDURE CODE',26,'Syntax\n------\n\nSHOW PROCEDURE CODE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension that is available only for servers that\nhave been built with debugging support. It displays a representation of the\ninternal implementation of the named stored procedure. A similar statement,\nSHOW FUNCTION CODE, displays information about stored functions.\n\nBoth statements require that you be the owner of the routine or have SELECT\naccess to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result set. Each\nrow in the result set corresponds to one \"instruction\" in the routine. The\nfirst column is Pos, which is an ordinal number beginning with 0. The second\ncolumn is Instruction, which contains an SQL statement (usually changed from\nthe original source), or a directive which has meaning only to the\nstored-routine handler.\n\nExamples\n--------\n\nDELIMITER //\n\nCREATE PROCEDURE p1 ()\n BEGIN\n  DECLARE fanta INT DEFAULT 55;\n  DROP TABLE t2;\n  LOOP\n   INSERT INTO t3 VALUES (fanta);\n   END LOOP;\n END//\nQuery OK, 0 rows affected (0.00 sec)\n\nSHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction                            |\n+-----+----------------------------------------+\n|   0 | set fanta@0 55                         |\n|   1 | stmt 9 \"DROP TABLE t2\"                 |\n|   2 | stmt 5 \"INSERT INTO t3 VALUES (fanta)\" |\n|   3 | jump 2                                 |\n+-----+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/show-procedure-code/','','https://mariadb.com/kb/en/show-procedure-code/'),
(390,'SHOW PROCEDURE STATUS',26,'Syntax\n------\n\nSHOW PROCEDURE STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns characteristics of a stored\nprocedure, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nFUNCTION STATUS, displays information about stored functions.\n\nThe LIKE clause, if present, indicates which procedure or function names to\nmatch. The WHERE and LIKE clauses can be given to select rows using more\ngeneral conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PROCEDURE STATUS LIKE \'p1\'\\G\n*************************** 1. row ***************************\n         Db: test\n        Name: p1\n        Type: PROCEDURE\n      Definer: root@localhost\n      Modified: 2010-08-23 13:23:03\n      Created: 2010-08-23 13:23:03\n   Security_type: DEFINER\n      Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nURL: https://mariadb.com/kb/en/show-procedure-status/','','https://mariadb.com/kb/en/show-procedure-status/'),
(388,'SHOW PRIVILEGES',26,'Syntax\n------\n\nSHOW PRIVILEGES\n\nDescription\n-----------\n\nSHOW PRIVILEGES shows the list of system privileges that the MariaDB server\nsupports. The exact list of privileges depends on the version of your server.\n\nNote that before MariaDB 10.3.23, MariaDB 10.4.13 and MariaDB 10.5.2 , the\nDelete history privilege displays as Delete versioning rows (MDEV-20382).\n\nExample\n-------\n\nFrom MariaDB 10.5.9\n\nSHOW PRIVILEGES;\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Privilege                | Context                               | Comment  \n                            |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Alter                    | Tables                                | To alter\nthe table                                                 |\n| Alter routine            | Functions,Procedures                  | To alter\nor drop stored functions/procedures                       |\n| Create                   | Databases,Tables,Indexes              | To create\nnew databases and tables                                 |\n| Create routine           | Databases                             | To use\nCREATE FUNCTION/PROCEDURE                                   |\n| Create temporary tables  | Databases                             | To use\nCREATE TEMPORARY TABLE                                      |\n| Create view              | Tables                                | To create\nnew views                                                |\n| Create user              | Server Admin                          | To create\nnew users                                                |\n| Delete                   | Tables                                | To delete\nexisting rows                                            |\n| Delete history           | Tables                                | To delete\nversioning table historical rows                         |\n| Drop                     | Databases,Tables                      | To drop\ndatabases, tables, and views                               |\n| Event                    | Server Admin                          | To\ncreate, alter, drop and execute events                          |\n| Execute                  | Functions,Procedures                  | To\nexecute stored routines                                         |\n| File                     | File access on server                 | To read\nand write files on the server                              |\n| Grant option             | Databases,Tables,Functions,Procedures | To give\nto other users those privileges you possess                |\n| Index                    | Tables                                | To create\nor drop indexes                                          |\n| Insert                   | Tables                                | To insert\ndata into tables                                         |\n| Lock tables              | Databases                             | To use\nLOCK TABLES (together with SELECT privilege)                |\n| Process                  | Server Admin                          | To view\nthe plain text of currently executing queries              |\n| Proxy                    | Server Admin                          | To make\nproxy user possible                                        |\n| References               | Databases,Tables                      | To have\nreferences on tables                                       |\n| Reload                   | Server Admin                          | To reload\nor refresh tables, logs and privileges                   |\n| Binlog admin             | Server                                | To purge\nbinary logs                                               |\n| Binlog monitor           | Server                                | To use\nSHOW BINLOG STATUS and SHOW BINARY LOG                      |\n| Binlog replay            | Server                                | To use\nBINLOG (generated by mariadb-binlog)                        |\n| Replication master admin | Server                                | To\nmonitor connected slaves                                        |\n| Replication slave admin  | Server                                | To\nstart/stop slave and apply binlog events                        |\n| Slave monitor            | Server                                | To use\nSHOW SLAVE STATUS and SHOW RELAYLOG EVENTS                  |\n| Replication slave        | Server Admin                          | To read\nbinary log events from the master                          |\n| Select                   | Tables                                | To\nretrieve rows from table                                        |\n| Show databases           | Server Admin                          | To see\nall databases with SHOW DATABASES                           |\n| Show view                | Tables                                | To see\nviews with SHOW CREATE VIEW                                 |\n| Shutdown                 | Server Admin                          | To shut\ndown the server                                            |\n| Super                    | Server Admin                          | To use\nKILL thread, SET GLOBAL, CHANGE MASTER, etc.                |\n| Trigger                  | Tables                                | To use\ntriggers                                                    |\n| Create tablespace        | Server Admin                          | To\ncreate/alter/drop tablespaces                                   |\n| Update                   | Tables                                | To update\nexisting rows                                            |\n| Set user                 | Server                                | To create\nviews and stored routines with a different definer       |\n| Federated admin          | Server                                | To\nexecute the CREATE SERVER, ALTER SERVER, DROP SERVER statements |\n| Connection admin         | Server                                | To bypass\nconnection limits and kill other users\' connections      |\n| Read_only admin          | Server                                | To\nperform write operations even if @@read_only=ON                 |\n| Usage                    | Server Admin                          | No\nprivileges - allow connect only                                 |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n41 rows in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/show-privileges/','','https://mariadb.com/kb/en/show-privileges/'),
(391,'SHOW PROCESSLIST',26,'Syntax\n------\n\nSHOW [FULL] PROCESSLIST\n\nDescription\n-----------\n\nSHOW PROCESSLIST shows you which threads are running. You can also get this\ninformation from the information_schema.PROCESSLIST table or the mariadb-admin\nprocesslist command. If you have the PROCESS privilege, you can see all\nthreads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using). If you do not use the\nFULL keyword, only the first 100 characters of each statement are shown in the\nInfo field.\n\nThe columns shown in SHOW PROCESSLIST are:\n\n+---------------------+------------------------------------------------------+\n| Name                | Description                                          |\n+---------------------+------------------------------------------------------+\n| ID                  | The client\'s process ID.                             |\n+---------------------+------------------------------------------------------+\n| USER                | The username associated with the process.            |\n+---------------------+------------------------------------------------------+\n| HOST                | The host the client is connected to.                 |\n+---------------------+------------------------------------------------------+\n| DB                  | The default database of the process (NULL if no      |\n|                     | default).                                            |\n+---------------------+------------------------------------------------------+\n| COMMAND             | The command type. See Thread Command Values.         |\n+---------------------+------------------------------------------------------+\n| TIME                | The amount of time, in seconds, the process has      |\n|                     | been in its current state. For a replica SQL thread  |\n|                     | before MariaDB 10.1, this is the time in seconds     |\n|                     | between the last replicated event\'s timestamp and    |\n|                     | the replica machine\'s real time.                     |\n+---------------------+------------------------------------------------------+\n| STATE               | See Thread States.                                   |\n+---------------------+------------------------------------------------------+\n| INFO                | The statement being executed.                        |\n+---------------------+------------------------------------------------------+\n| PROGRESS            | The total progress of the process (0-100%) (see      |\n|                     | Progress Reporting).                                 |\n+---------------------+------------------------------------------------------+\n\nSee TIME_MS column in information_schema.PROCESSLIST for differences in the\nTIME column between MariaDB and MySQL.\n\nThe information_schema.PROCESSLIST table contains the following additional\ncolumns:\n\n+---------------------+------------------------------------------------------+\n| Name                | Description                                          |\n+---------------------+------------------------------------------------------+\n| TIME_MS             | The amount of time, in milliseconds, the process     |\n|                     | has been in its current state.                       |\n+---------------------+------------------------------------------------------+\n| STAGE               | The stage the process is currently in.               |\n+---------------------+------------------------------------------------------+\n| MAX_STAGE           | The maximum number of stages.                        |\n+---------------------+------------------------------------------------------+\n| PROGRESS            | The progress of the process within the current       |\n|                     | stage (0-100%).                                      |\n+---------------------+------------------------------------------------------+\n| MEMORY_USED         | The amount of memory used by the process.            |\n+---------------------+------------------------------------------------------+\n| EXAMINED_ROWS       | The number of rows the process has examined.         |\n+---------------------+------------------------------------------------------+\n| QUERY_ID            | Query ID.                                            |\n+---------------------+------------------------------------------------------+\n\nNote that the PROGRESS field from the information schema, and the PROGRESS\nfield from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows\nthe total progress, while the information schema shows the progress for the\ncurrent stage only.\n\nThreads can be killed using their thread_id or their query_id, with the KILL\nstatement.\n\nSince queries on this table are locking, if the performance_schema is enabled,\nyou may want to query the THREADS table instead.\n\nExamples\n--------\n\nSHOW PROCESSLIST;\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n| Id | User            | Host      | db   | Command | Time | State            \n  | Info             | Progress |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n|  2 | event_scheduler | localhost | NULL | Daemon  | 2693 | Waiting on empty\nqueue | NULL             |    0.000 |\n|  4 | root            | localhost | NULL | Query   |    0 | Table lock       \n  | SHOW PROCESSLIST |    0.000 |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n\nURL: https://mariadb.com/kb/en/show-processlist/','','https://mariadb.com/kb/en/show-processlist/'),
(392,'SHOW PROFILE',26,'Syntax\n------\n\nSHOW PROFILE [type [, type] ... ]\n  [FOR QUERY n]\n  [LIMIT row_count [OFFSET offset]]\n\ntype:\n  ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nDescription\n-----------\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling information\nthat indicates resource usage for statements executed during the course of the\ncurrent session.\n\nProfiling is controlled by the profiling session variable, which has a default\nvalue of 0 (OFF). Profiling is enabled by setting profiling to 1 or ON:\n\nSET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nmaster. The size of the list is controlled by the profiling_history_size\nsession variable, which has a default value of 15. The maximum value is 100.\nSetting the value to 0 has the practical effect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILES and SHOW PROFILE, so you will\nfind neither of those statements in the profile list. Malformed statements are\nprofiled. For example, SHOW PROFILING is an illegal statement, and a syntax\nerror occurs if you try to execute it, but it will show up in the profiling\nlist.\n\nSHOW PROFILE displays detailed information about a single statement. Without\nthe FOR QUERY n clause, the output pertains to the most recently executed\nstatement. If FOR QUERY n is included, SHOW PROFILE displays information for\nstatement n. The values of n correspond to the Query_ID values displayed by\nSHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to row_count rows.\nIf LIMIT is given, OFFSET offset may be added to begin the output offset rows\ninto the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The Status\nvalues are like the State values displayed by SHOW PROCESSLIST, although there\nmight be some minor differences in interpretation for the two statements for\nsome status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional types of\ninformation:\n\n* ALL displays all information\n* BLOCK IO displays counts for block input and output operations\n* CONTEXT SWITCHES displays counts for voluntary and involuntary context\nswitches\n* CPU displays user and system CPU usage times\n* IPC displays counts for messages sent and received\n* MEMORY is not currently implemented\n* PAGE FAULTS displays counts for major and minor page faults\n* SOURCE displays the names of functions from the source code, together with\nthe name and line number of the file in which the function occurs\n* SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nThe information_schema.PROFILING table contains similar information.\n\nExamples\n--------\n\nSELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n|           0 |\n+-------------+\n\nSET profiling = 1;\n\nUSE test;\n\nDROP TABLE IF EXISTS t1;\n\nCREATE TABLE T1 (id INT);\n\nSHOW PROFILES;\n+----------+------------+--------------------------+\n| Query_ID | Duration   | Query                    |\n+----------+------------+--------------------------+\n|        1 | 0.00009200 | SELECT DATABASE()        |\n|        2 | 0.00023800 | show databases           |\n|        3 | 0.00018900 | show tables              |\n|        4 | 0.00014700 | DROP TABLE IF EXISTS t1  |\n|        5 | 0.24476900 | CREATE TABLE T1 (id INT) |\n+----------+------------+--------------------------+\n\nSHOW PROFILE;\n+----------------------+----------+\n| Status               | Duration |\n+----------------------+----------+\n| starting             | 0.000042 |\n| checking permissions | 0.000044 |\n| creating table       | 0.244645 |\n| After create         | 0.000013 |\n| query end            | 0.000003 |\n| freeing items        | 0.000016 |\n| logging slow query   | 0.000003 |\n| cleaning up          | 0.000003 |\n+----------------------+----------+\n\nSHOW PROFILE FOR QUERY 4;\n+--------------------+----------+\n| Status             | Duration |\n+--------------------+----------+\n| starting           | 0.000126 |\n| query end          | 0.000004 |\n| freeing items      | 0.000012 |\n| logging slow query | 0.000003 |\n| cleaning up        | 0.000002 |\n+--------------------+----------+\n\nSHOW PROFILE CPU FOR QUERY 5;\n+----------------------+----------+----------+------------+\n| Status               | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| starting             | 0.000042 | 0.000000 |   0.000000 |\n| checking permissions | 0.000044 | 0.000000 |   0.000000 |\n| creating table       | 0.244645 | 0.000000 |   0.000000 |\n| After create         | 0.000013 | 0.000000 |   0.000000 |\n| query end            | 0.000003 | 0.000000 |   0.000000 |\n| freeing items        | 0.000016 | 0.000000 |   0.000000 |\n| logging slow query   | 0.000003 | 0.000000 |   0.000000 |\n| cleaning up          | 0.000003 | 0.000000 |   0.000000 |\n+----------------------+----------+----------+------------+\n\nURL: https://mariadb.com/kb/en/show-profile/','','https://mariadb.com/kb/en/show-profile/'),
(395,'SHOW STATUS',26,'Syntax\n------\n\nSHOW [GLOBAL | SESSION] STATUS\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW STATUS provides server status information. This information also can be\nobtained using the mariadb-admin extended-status command, or by querying the\nInformation Schema GLOBAL_STATUS and SESSION_STATUS tables. The LIKE clause,\nif present, indicates which variable names to match. The WHERE clause can be\ngiven to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for all\nconnections to MariaDB. With SESSION, it displays the status values for the\ncurrent connection. If no modifier is present, the default is SESSION. LOCAL\nis a synonym for SESSION. If you see a lot of 0 values, the reason is probably\nthat you have used SHOW STATUS with a new connection instead of SHOW GLOBAL\nSTATUS.\n\nSome status variables have only a global value. For these, you get the same\nvalue for both GLOBAL and SESSION.\n\nSee Server Status Variables for a full list, scope and description of the\nvariables that can be viewed with SHOW STATUS.\n\nThe LIKE clause, if present on its own, indicates which variable name to match.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nSHOW GLOBAL STATUS;\n+--------------------------------------------------------------+---------------\n------------------------+\n| Variable_name                                                | Value        \n            |\n+--------------------------------------------------------------+---------------\n------------------------+\n| Aborted_clients                                              | 0            \n            |\n| Aborted_connects                                             | 0            \n            |\n| Access_denied_errors                                         | 0            \n            |\n| Acl_column_grants                                            | 0            \n            |\n| Acl_database_grants                                          | 2            \n            |\n| Acl_function_grants                                          | 0            \n            |\n| Acl_procedure_grants                                         | 0            \n            |\n| Acl_proxy_users                                              | 2            \n            |\n| Acl_role_grants                                              | 0            \n            |\n| Acl_roles                                                    | 0            \n            |\n| Acl_table_grants                                             | 0            \n            |\n| Acl_users                                                    | 6            \n            |\n| Aria_pagecache_blocks_not_flushed                            | 0            \n            |\n| Aria_pagecache_blocks_unused                                 | 15706        \n            |\n...\n| wsrep_local_index                                            |\n18446744073709551615                   |\n| wsrep_provider_name                                          |              \n            |\n| wsrep_provider_vendor                                        |              \n            |\n| wsrep_provider_version                                       |              \n            |\n| wsrep_ready                                                  | OFF          \n            |\n| wsrep_thread_count                                           | 0            \n            |\n+--------------------------------------------------------------+---------------\n------------------------+\n516 rows in set (0.00 sec)\n\nExample of filtered output:\n\nSHOW STATUS LIKE \'Key%\';\n+------------------------+--------+\n| Variable_name          | Value  |\n+------------------------+--------+\n| Key_blocks_not_flushed | 0      |\n| Key_blocks_unused      | 107163 |\n| Key_blocks_used        | 0      |\n| Key_blocks_warm        | 0      |\n| Key_read_requests      | 0      |\n| Key_reads              | 0      |\n| Key_write_requests     | 0      |\n| Key_writes             | 0      |\n+------------------------+--------+\n8 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/show-status/','','https://mariadb.com/kb/en/show-status/'),
(397,'SHOW TABLES',26,'Syntax\n------\n\nSHOW [FULL] TABLES [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLES lists the tables (until MariaDB 11.2.0, only non-TEMPORARY tables\nare shown), sequences and views in a given database.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW. For example, when searching for\ntables in the test database, the column name for use in the WHERE and LIKE\nclauses will be Tables_in_test\n\nThe FULL modifier is supported such that SHOW FULL TABLES displays a second\noutput column. Values for the second column, Table_type, are BASE TABLE for a\ntable, VIEW for a view and SEQUENCE for a sequence.\n\nYou can also get this information using:\n\nmariadb-show db_name\n\nSee mariadb-show for more details.\n\nIf you have no privileges for a base table or view, it does not show up in the\noutput from SHOW TABLES or mariadb-show db_name.\n\nThe information_schema.TABLES table, as well as the SHOW TABLE STATUS\nstatement, provide extended information about tables.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n| t1                   |\n| view1                |\n+----------------------+\n\nShowing the tables beginning with a only.\n\nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test       |\n+----------------------+\n| animal_count         |\n| animals              |\n| are_the_mooses_loose |\n| aria_test2           |\n+----------------------+\n\nShowing tables and table types:\n\nSHOW FULL TABLES;\n+----------------+------------+\n| Tables_in_test | Table_type |\n+----------------+------------+\n| s1             | SEQUENCE   |\n| student        | BASE TABLE |\n| v1             | VIEW       |\n+----------------+------------+\n\nShowing temporary tables: <= MariaDB 11.1\n\nCREATE TABLE t (t int(11));\nCREATE TEMPORARY TABLE t (t int(11));\nCREATE TEMPORARY TABLE te (t int(11));\n\nSHOW TABLES;\n+----------------+\n| Tables_in_test |\n+----------------+\n| t              |\n+----------------+\n\nFrom MariaDB 11.2.0:\n\nCREATE TABLE t (t int(11));\nCREATE TEMPORARY TABLE t (t int(11));\nCREATE TEMPORARY TABLE te (t int(11));\n\nSHOW TABLES;\n+----------------+\n| Tables_in_test |\n+----------------+\n| te             |\n| t              |\n| t              |\n+----------------+\n\nURL: https://mariadb.com/kb/en/show-tables/','','https://mariadb.com/kb/en/show-tables/'),
(396,'SHOW TABLE STATUS',26,'Syntax\n------\n\nSHOW TABLE STATUS [{FROM | IN} db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLE STATUS works like SHOW TABLES, but provides more extensive\ninformation about each table (until MariaDB 11.2.0, only non-TEMPORARY tables\nare shown).\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+------------------------------------------------+\n| Column                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| Name                      | Table name.                                    |\n+---------------------------+------------------------------------------------+\n| Engine                    | Table storage engine.                          |\n+---------------------------+------------------------------------------------+\n| Version                   | Version number from the table\'s .frm file.     |\n+---------------------------+------------------------------------------------+\n| Row_format                | Row format (see InnoDB, Aria and MyISAM row    |\n|                           | formats).                                      |\n+---------------------------+------------------------------------------------+\n| Rows                      | Number of rows in the table. Some engines,     |\n|                           | such as InnoDB may store an estimate.          |\n+---------------------------+------------------------------------------------+\n| Avg_row_length            | Average row length in the table.               |\n+---------------------------+------------------------------------------------+\n| Data_length               | For InnoDB, the index size, in pages,          |\n|                           | multiplied by the page size. For Aria and      |\n|                           | MyISAM, length of the data file, in bytes.     |\n|                           | For MEMORY, the approximate allocated memory.  |\n+---------------------------+------------------------------------------------+\n| Max_data_length           | Maximum length of the data file, ie the total  |\n|                           | number of bytes that could be stored in the    |\n|                           | table. Not used in InnoDB.                     |\n+---------------------------+------------------------------------------------+\n| Index_length              | Length of the index file.                      |\n+---------------------------+------------------------------------------------+\n| Data_free                 | Bytes allocated but unused. For InnoDB tables  |\n|                           | in a shared tablespace, the free space of the  |\n|                           | shared tablespace with small safety margin.    |\n|                           | An estimate in the case of partitioned tables  |\n|                           | - see the PARTITIONS table.                    |\n+---------------------------+------------------------------------------------+\n| Auto_increment            | Next AUTO_INCREMENT value.                     |\n+---------------------------+------------------------------------------------+\n| Create_time               | Time the table was created. Some engines just  |\n|                           | return the ctime information from the file     |\n|                           | system layer here, in that case the value is   |\n|                           | not necessarily the table creation time but    |\n|                           | rather the time the file system metadata for   |\n|                           | it had last changed.                           |\n+---------------------------+------------------------------------------------+\n| Update_time               | Time the table was last updated. On Windows,   |\n|                           | the timestamp is not updated on update, so     |\n|                           | MyISAM values will be inaccurate. In InnoDB,   |\n|                           | if shared tablespaces are used, will be NULL,  |\n|                           | while buffering can also delay the update, so  |\n|                           | the value will differ from the actual time of  |\n|                           | the last UPDATE, INSERT or DELETE.             |\n+---------------------------+------------------------------------------------+\n| Check_time                | Time the table was last checked. Not kept by   |\n|                           | all storage engines, in which case will be     |\n|                           | NULL.                                          |\n+---------------------------+------------------------------------------------+\n| Collation                 | Character set and collation.                   |\n+---------------------------+------------------------------------------------+\n| Checksum                  | Live checksum value, if any.                   |\n+---------------------------+------------------------------------------------+\n| Create_options            | Extra CREATE TABLE options.                    |\n+---------------------------+------------------------------------------------+\n| Comment                   | Table comment provided when MariaDB created    |\n|                           | the table.                                     |\n+---------------------------+------------------------------------------------+\n| Max_index_length          | Maximum index length (supported by MyISAM and  |\n|                           | Aria tables).                                  |\n+---------------------------+------------------------------------------------+\n| Temporary                 | Until MariaDB 11.2.0, placeholder to signal    |\n|                           | that a table is a temporary table and always   |\n|                           | \"N\", except \"Y\" for generated                  |\n|                           | information_schema tables and NULL for views.  |\n|                           | From MariaDB 11.2.0, will also be set to \"Y\"   |\n|                           | for local temporary tables.                    |\n+---------------------------+------------------------------------------------+\n\nSimilar information can be found in the information_schema.TABLES table as\nwell as by using mariadb-show:\n\nmariadb-show --status db_name\n\nViews\n-----\n\nFor views, all columns in SHOW TABLE STATUS are NULL except \'Name\' and\n\'Comment\'\n\nExample\n-------\n\nshow table status\\G\n*************************** 1. row ***************************\n     Name: bus_routes\n    Engine: InnoDB\n    Version: 10\n  Row_format: Dynamic\n     Rows: 5\n Avg_row_length: 3276\n  Data_length: 16384\nMax_data_length: 0\n Index_length: 0\n   Data_free: 0\n Auto_increment: NULL\n  Create_time: 2017-05-24 11:17:46\n  Update_time: NULL\n  Check_time: NULL\n   Collation: latin1_swedish_ci\n   Checksum: NULL\n Create_options: \n    Comment:\n\nURL: https://mariadb.com/kb/en/show-table-status/','','https://mariadb.com/kb/en/show-table-status/'),
(398,'SHOW TABLE_STATISTICS',26,'Syntax\n------\n\nSHOW TABLE_STATISTICS\n\nDescription\n-----------\n\nThe SHOW TABLE_STATISTICS statementis part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.TABLE_STATISTICS table shows statistics on table usage\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.TABLE_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW TABLE_STATISTICS\\G\n*************************** 1. row ***************************\n     Table_schema: mysql\n      Table_name: proxies_priv\n       Rows_read: 2\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 2. row ***************************\n     Table_schema: test\n      Table_name: employees_example\n       Rows_read: 7\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 3. row ***************************\n     Table_schema: mysql\n      Table_name: user\n       Rows_read: 16\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 4. row ***************************\n     Table_schema: mysql\n      Table_name: db\n       Rows_read: 2\n     Rows_changed: 0\nRows_changed_x_#indexes: 0\n\nURL: https://mariadb.com/kb/en/show-table-statistics/','','https://mariadb.com/kb/en/show-table-statistics/'),
(399,'SHOW TRIGGERS',26,'Syntax\n------\n\nSHOW TRIGGERS [FROM db_name]\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a database\n(the default database unless a FROM clause is given). This statement requires\nthe TRIGGER privilege (prior to MySQL 5.1.22, it required the SUPER privilege).\n\nThe LIKE clause, if present on its own, indicates which table names to match\nand causes the statement to display triggers for those tables. The WHERE and\nLIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nSimilar information is stored in the information_schema.TRIGGERS table.\n\nMariaDB starting with 10.2.3\n----------------------------\nIf there are multiple triggers for the same action, then the triggers are\nshown in action order.\n\nExamples\n--------\n\nFor the trigger defined at Trigger Overview:\n\nSHOW triggers Like \'animals\' \\G\n*************************** 1. row ***************************\n      Trigger: the_mooses_are_loose\n       Event: INSERT\n       Table: animals\n     Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n       Timing: AFTER\n      Created: 2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nListing all triggers associated with a certain table:\n\nSHOW TRIGGERS FROM test WHERE `Table` = \'user\' \\G\n*************************** 1. row ***************************\n      Trigger: user_ai\n       Event: INSERT\n       Table: user\n     Statement: BEGIN END\n       Timing: AFTER\n      Created:  2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@%\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nSHOW triggers WHERE Event Like \'Insert\' \\G\n*************************** 1. row ***************************\n      Trigger: the_mooses_are_loose\n       Event: INSERT\n       Table: animals\n     Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n       Timing: AFTER\n      Created: 2016-09-29 13:53:34.35\n      sql_mode:\n      Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n* character_set_client is the session value of the character_set_client system\nvariable when the trigger was created. \n* collation_connection is the session value of the collation_connection system\nvariable when the trigger was\n created. \n* Database Collation is the collation of the database \n with which the trigger is associated.\n\nThese columns were added in MariaDB/MySQL 5.1.21.\n\nOld triggers created before MySQL 5.7 and MariaDB 10.2.3 has NULL in the\nCreated column.\n\nURL: https://mariadb.com/kb/en/show-triggers/','','https://mariadb.com/kb/en/show-triggers/'),
(400,'SHOW USER_STATISTICS',26,'Syntax\n------\n\nSHOW USER_STATISTICS\n\nDescription\n-----------\n\nThe SHOW USER_STATISTICS statement is part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.USER_STATISTICS table holds statistics about user activity.\nYou can use this table to find out such things as which user is causing the\nmost load and which users are being abusive. You can also use this table to\nmeasure how close to capacity the server may be.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.USER_STATISTICS table for more\ninformation.\n\nExample\n-------\n\nSHOW USER_STATISTICS\\G\n*************************** 1. row ***************************\n         User: root\n  Total_connections: 1\nConcurrent_connections: 0\n    Connected_time: 3297\n      Busy_time: 0.14113400000000006\n       Cpu_time: 0.017637000000000003\n    Bytes_received: 969\n      Bytes_sent: 22355\n Binlog_bytes_written: 0\n      Rows_read: 10\n      Rows_sent: 67\n     Rows_deleted: 0\n    Rows_inserted: 0\n     Rows_updated: 0\n   Select_commands: 7\n   Update_commands: 0\n    Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n  Denied_connections: 0\n   Lost_connections: 0\n    Access_denied: 0\n    Empty_queries: 7\n\nURL: https://mariadb.com/kb/en/show-user-statistics/','','https://mariadb.com/kb/en/show-user-statistics/'),
(401,'SHOW VARIABLES',26,'Syntax\n------\n\nSHOW [GLOBAL | SESSION] VARIABLES\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW VARIABLES shows the values of MariaDB system variables. This information\nalso can be obtained using the mariadb-admin variables command. The LIKE\nclause, if present, indicates which variable names to match. The WHERE clause\ncan be given to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are used for\nnew connections to MariaDB. With SESSION, it displays the values that are in\neffect for the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION. With a LIKE clause, the statement\ndisplays only rows for those variables with names that match the pattern. To\nobtain the row for a specific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'maria_group_commit\';\nSHOW SESSION VARIABLES LIKE \'maria_group_commit\';\n\nTo get a list of variables whose name match a pattern, use the \"%\" wildcard\ncharacter in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%maria%\';\nSHOW GLOBAL VARIABLES LIKE \'%maria%\';\n\nWildcard characters can be used in any position within the pattern to be\nmatched. Strictly speaking, because \"_\" is a wildcard that matches any single\ncharacter, you should escape it as \"\\_\" to match it literally. In practice,\nthis is rarely necessary.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nSee SET for information on setting server system variables.\n\nSee Server System Variables for a list of all the variables that can be set.\n\nYou can also see the server variables by querying the Information Schema\nGLOBAL_VARIABLES and SESSION_VARIABLES tables.\n\nExamples\n--------\n\nSHOW VARIABLES LIKE \'aria%\';\n+------------------------------------------+---------------------+\n| Variable_name                            | Value               |\n+------------------------------------------+---------------------+\n| aria_block_size                          | 8192                |\n| aria_checkpoint_interval                 | 30                  |\n| aria_checkpoint_log_activity             | 1048576             |\n| aria_force_start_after_recovery_failures | 0                   |\n| aria_group_commit                        | none                |\n| aria_group_commit_interval               | 0                   |\n| aria_log_file_size                       | 1073741824          |\n| aria_log_purge_type                      | immediate           |\n| aria_max_sort_file_size                  | 9223372036853727232 |\n| aria_page_checksum                       | ON                  |\n| aria_pagecache_age_threshold             | 300                 |\n| aria_pagecache_buffer_size               | 134217728           |\n| aria_pagecache_division_limit            | 100                 |\n| aria_recover                             | NORMAL              |\n| aria_repair_threads                      | 1                   |\n| aria_sort_buffer_size                    | 134217728           |\n| aria_stats_method                        | nulls_unequal       |\n| aria_sync_log_dir                        | NEWFILE             |\n| aria_used_for_temp_tables                | ON                  |\n+------------------------------------------+---------------------+\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 64           |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME             | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT           | 64            | 128          |\n| INNODB_SYNC_SPIN_LOOPS    | NULL          | 30           |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 64    |\n+-----------------+-------+\n\nSHOW GLOBAL VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name   | Value |\n+-----------------+-------+\n| max_error_count | 128   |\n+-----------------+-------+\n\nBecause the following variable only has a global scope, the global value is\nreturned even when specifying SESSION (in this case by default):\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name          | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 30    |\n+------------------------+-------+\n\nURL: https://mariadb.com/kb/en/show-variables/','','https://mariadb.com/kb/en/show-variables/'),
(402,'SHOW WARNINGS',26,'Syntax\n------\n\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) WARNINGS\n\nDescription\n-----------\n\nSHOW WARNINGS shows the error, warning, and note messages that resulted from\nthe last statement that generated messages in the current session. It shows\nnothing if the last statement used a table and generated no messages. (That\nis, a statement that uses a table but generates no messages clears the message\nlist.) Statements that do not use tables and do not generate messages have no\neffect on the message list.\n\nA note is different to a warning in that it only appears if the sql_notes\nvariable is set to 1 (the default), and is not converted to an error if strict\nmode is enabled.\n\nA related statement, SHOW ERRORS, shows only the errors.\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of errors,\nwarnings, and notes. You can also retrieve this number from the warning_count\nvariable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nThe value of warning_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nSHOW WARNINGS can be used after EXPLAIN EXTENDED to see how a query is\ninternally rewritten by MariaDB.\n\nIf the sql_notes server variable is set to 1, Notes are included in the output\nof SHOW WARNINGS; if it is set to 0, this statement will not show (or count)\nNotes.\n\nThe results of SHOW WARNINGS and SHOW COUNT(*) WARNINGS are directly sent to\nthe client. If you need to access those information in a stored program, you\ncan use the GET DIAGNOSTICS statement instead.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nThe mariadb client also has a number of options related to warnings. The \\W\ncommand will show warnings after every statement, while \\w will disable this.\nStarting the client with the --show-warnings option will show warnings after\nevery statement.\n\nMariaDB implements a stored routine error stack trace. SHOW WARNINGS can also\nbe used to show more information. See the example below.\n\nExamples\n--------\n\nSELECT 1/0;\n+------+\n| 1/0  |\n+------+\n| NULL |\n+------+\n\nSHOW COUNT(*) WARNINGS;\n+-------------------------+\n| @@session.warning_count |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSHOW WARNINGS;\n+---------+------+---------------+\n| Level   | Code | Message       |\n+---------+------+---------------+\n| Warning | 1365 | Division by 0 |\n+---------+------+---------------+\n\nStack Trace\n-----------\n\nDisplaying a stack trace:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\n BEGIN\n  DECLARE c CURSOR FOR SELECT * FROM not_existing;\n  OPEN c;\n  CLOSE c;\n END;\n$$\nCREATE OR REPLACE PROCEDURE p2()\n BEGIN\n  CALL p1;\n END;\n$$\nDELIMITER ;\nCALL p2;\nERROR 1146 (42S02): Table \'test.not_existing\' doesn\'t exist\n\nSHOW WARNINGS;\n+-------+------+-----------------------------------------+\n| Level | Code | Message                                 |\n+-------+------+-----------------------------------------+\n| Error | 1146 | Table \'test.not_existing\' doesn\'t exist |\n| Note  | 4091 | At line 6 in test.p1                    |\n| Note  | 4091 | At line 4 in test.p2                    |\n+-------+------+-----------------------------------------+\n\nSHOW WARNINGS displays a stack trace, showing where the error actually\nhappened:\n\n* Line 4 in test.p1 is the OPEN command which actually raised the error\n* Line 3 in test.p2 is the CALL statement, calling p1 from p2.\n\nURL: https://mariadb.com/kb/en/show-warnings/','','https://mariadb.com/kb/en/show-warnings/'),
(403,'SHOW WSREP_MEMBERSHIP',26,'SHOW WSREP_MEMBERSHIP is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_MEMBERSHIP\n\nDescription\n-----------\n\nThe SHOW WSREP_MEMBERSHIP statement returns Galera node cluster membership\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_MEMBERSHIP table. Only users with the SUPER privilege\ncan access this information.\n\nExamples\n--------\n\nSHOW WSREP_MEMBERSHIP;\n+-------+--------------------------------------+----------+-----------------+\n| Index | Uuid                                 | Name     | Address         |\n+-------+--------------------------------------+----------+-----------------+\n|     0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 |\n|     1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 |\n|     2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 |\n+-------+--------------------------------------+----------+-----------------+\n\nURL: https://mariadb.com/kb/en/show-wsrep_membership/','','https://mariadb.com/kb/en/show-wsrep_membership/'),
(404,'SHOW WSREP_STATUS',26,'SHOW WSREP_STATUS is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_STATUS\n\nDescription\n-----------\n\nThe SHOW WSREP_STATUS statement returns Galera node and cluster status\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_STATUS table. Only users with the SUPER privilege can\naccess this information.\n\nExamples\n--------\n\nSHOW WSREP_STATUS;\n+------------+-------------+----------------+--------------+\n| Node_Index | Node_Status | Cluster_Status | Cluster_Size |\n+------------+-------------+----------------+--------------+\n|          0 | Synced      | Primary        |            3 |\n+------------+-------------+----------------+--------------+\n\nURL: https://mariadb.com/kb/en/show-wsrep_status/','','https://mariadb.com/kb/en/show-wsrep_status/'),
(406,'PURGE BINARY LOGS',26,'Syntax\n------\n\nPURGE { BINARY | MASTER } LOGS\n  { TO \'log_name\' | BEFORE datetime_expr }\n\nDescription\n-----------\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed in the\nlog index file prior to the specified log file name or date. BINARY and MASTER\nare synonyms. Deleted log files also are removed from the list recorded in the\nindex file, so that the given log file becomes the first in the list.\n\nThe datetime expression is in the format \'YYYY-MM-DD hh:mm:ss\'.\n\nIf a replica is active but has yet to read from a binary log file you attempt\nto delete, the statement will fail with an error. However, if the replica is\nnot connected and has yet to read from a log file you delete, the file will be\ndeleted, but the replica will be unable to continue replicating once it\nconnects again.\n\nThis statement has no effect if the server was not started with the --log-bin\noption to enable binary logging.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which\nfiles they are reading, use SHOW SLAVE STATUS (or SHOW REPLICA STATUS from\nMariaDB 10.5.1). You can only delete the files that are older than the oldest\nfile that is used by the slaves.\n\nTo delete all binary log files, use RESET MASTER. To move to a new log file\n(for example if you want to remove the current log file), use FLUSH LOGS\nbefore you execute PURGE LOGS.\n\nIf the expire_logs_days server system variable is not set to 0, the server\nautomatically deletes binary log files after the given number of days. From\nMariaDB 10.6, the binlog_expire_logs_seconds variable allows more precise\ncontrol over binlog deletion, and takes precedence if both are non-zero.\n\nRequires the SUPER privilege or, from MariaDB 10.5.2, the BINLOG ADMIN\nprivilege, to run.\n\nExamples\n--------\n\nPURGE BINARY LOGS TO \'mariadb-bin.000063\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-21\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-22 09:55:22\';\n\nURL: https://mariadb.com/kb/en/purge-binary-logs/','','https://mariadb.com/kb/en/purge-binary-logs/'),
(407,'CACHE INDEX',26,'Syntax\n------\n\nCACHE INDEX                      \n tbl_index_list [, tbl_index_list] ...\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\nDescription\n-----------\n\nThe CACHE INDEX statement assigns table indexes to a specific key cache. It is\nused only for MyISAM tables.\n\nA default key cache exists and cannot be destroyed. To create more key caches,\nthe key_buffer_size server system variable.\n\nThe associations between tables indexes and key caches are lost on server\nrestart. To recreate them automatically, it is necessary to configure caches\nin a configuration file and include some CACHE INDEX (and optionally LOAD\nINDEX) statements in the init file.\n\nExamples\n--------\n\nThe following statement assigns indexes from the tables t1, t2, and t3 to the\nkey cache named hot_cache:\n\nCACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table   | Op                 | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status   | OK       |\n| test.t2 | assign_to_keycache | status   | OK       |\n| test.t3 | assign_to_keycache | status   | OK       |\n+---------+--------------------+----------+----------+\n\nImplementation (for MyISAM)\n---------------------------\n\nNormally CACHE INDEX should not take a long time to execute. Internally it\'s\nimplemented the following way:\n\n* Find the right key cache (under LOCK_global_system_variables)\n* Open the table with a TL_READ_NO_INSERT lock.\n* Flush the original key cache for the given file (under key cache lock)\n* Flush the new key cache for the given file (safety)\n* Move the file to the new key cache (under file share lock)\n\nThe only possible long operations are getting the locks for the table and\nflushing the original key cache, if there were many key blocks for the file in\nit.\n\nWe plan to also add CACHE INDEX for Aria tables if there is a need for this.\n\nURL: https://mariadb.com/kb/en/cache-index/','','https://mariadb.com/kb/en/cache-index/'),
(408,'HELP Command',26,'Syntax\n------\n\nHELP search_string\n\nDescription\n-----------\n\nThe HELP command can be used in any MariaDB client, such as the mariadb\ncommand-line client, to get basic syntax help and a short description for most\ncommands and functions.\n\nIf you provide an argument to the HELP command, the mariadb client uses it as\na search string to access server-side help. The proper operation of this\ncommand requires that the help tables in the mysql database be initialized\nwith help topic information.\n\nIf there is no match for the search string, the search fails. Use HELP\ncontents to see a list of the help categories:\n\nHELP contents\nYou asked for help about help category: \"Contents\"\nFor more information, type \'help <item>\', where <item> is one of the following\ncategories:\n Account Management\n Administration\n Compound Statements\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Help Metadata\n Language Structure\n Plugins\n Procedures\n Sequences\n Table Maintenance\n Transactions\n User-Defined Functions\n Utility\n\nIf a search string matches multiple items, MariaDB shows a list of matching\ntopics:\n\nHELP drop\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following\ntopics:\n ALTER TABLE\n DROP DATABASE\n DROP EVENT\n DROP FUNCTION\n DROP FUNCTION UDF\n DROP INDEX\n DROP PACKAGE\n DROP PACKAGE BODY\n DROP PROCEDURE\n DROP ROLE\n DROP SEQUENCE\n DROP SERVER\n DROP TABLE\n DROP TRIGGER\n DROP USER\n DROP VIEW\n\nThen you can enter a topic as the search string to see the help entry for that\ntopic.\n\nThe help is provided with the MariaDB server and makes use of four help tables\nfound in the mysql database: help_relation, help_topic, help_category and\nhelp_keyword. These tables are populated by the mariadb-install-db or\nfill_help_table.sql scripts.\n\nURL: https://mariadb.com/kb/en/help-command/','','https://mariadb.com/kb/en/help-command/'),
(409,'KILL [CONNECTION | QUERY]',26,'Syntax\n------\n\nKILL [HARD | SOFT] { {CONNECTION|QUERY} thread_id | QUERY ID query_id | USER\nuser_name }\n\nDescription\n-----------\n\nEach connection to mysqld runs in a separate thread. You can see which threads\nare running with the SHOW PROCESSLIST statement and kill a thread with the\nKILL thread_id statement. KILL allows the optional CONNECTION or QUERY\nmodifier:\n\n* KILL CONNECTION is the same as KILL with no\n modifier: It terminates the connection associated with the given thread or\nquery id.\n* KILL QUERY terminates the statement that the connection thread_id is\n currently executing, but leaves the connection itself intact.\n* KILL QUERY ID terminates the query by query_id, leaving the connection\nintact.\n\nIf a connection is terminated that has an active transaction, the transaction\nwill be rolled back. If only a query is killed, the current transaction will\nstay active. See also idle_transaction_timeout.\n\nIf you have the PROCESS privilege, you can see all threads. If you have the\nSUPER privilege, or, from MariaDB 10.5.2, the CONNECTION ADMIN privilege, you\ncan kill all threads and statements. Otherwise, you can see and kill only your\nown threads and statements.\n\nKilling queries that repair or create indexes on MyISAM and Aria tables may\nresult in corrupted tables. Use the SOFT option to avoid this!\n\nThe HARD option (default) kills a command as soon as possible. If you use\nSOFT, then critical operations that may leave a table in an inconsistent state\nwill not be interrupted. Such operations include REPAIR and INDEX creation for\nMyISAM and Aria tables (REPAIR TABLE, OPTIMIZE TABLE).\n\nKILL ... USER username will kill all connections/queries for a given user.\nUSER can be specified one of the following ways:\n\n* username  (Kill without regard to hostname)\n* username@hostname\n* CURRENT_USER or CURRENT_USER()\n\nIf you specify a thread id and that thread does not exist, you get the\nfollowing error:\n\nERROR 1094 (HY000): Unknown thread id: <thread_id>\n\nIf you specify a query id that doesn\'t exist, you get the following error:\n\nERROR 1957 (HY000): Unknown query id: <query_id>\n\nHowever, if you specify a user name, no error is issued for non-connected (or\neven non-existing) users. To check if the connection/query has been killed,\nyou can use the ROW_COUNT() function.\n\nA client whose connection is killed receives the following error:\n\nERROR 1317 (70100): Query execution was interrupted\n\nTo obtain a list of existing sessions, use the SHOW PROCESSLIST statement or\nquery the Information Schema PROCESSLIST table.\n\nNote: You cannot use KILL with the Embedded MariaDB Server library because the\nembedded server merely runs inside the threads of the host application. It\ndoes not create any connection threads of its own.\n\nNote: You can also use mariadb-admin kill thread_id [,thread_id...] to kill\nconnections. To get a list of running queries, use mariadb-admin processlist.\nSee mariadb-admin.\n\nPercona Toolkit contains a program, pt-kill that can be used to automatically\nkill connections that match certain criteria. For example, it can be used to\nterminate idle connections, or connections that have been busy for more than\n60 seconds.\n\nURL: https://mariadb.com/kb/en/kill/','','https://mariadb.com/kb/en/kill/'),
(411,'RESET',26,'Syntax\n------\n\nRESET reset_option [, reset_option] ...\n\nDescription\n-----------\n\nThe RESET statement is used to clear the state of various server operations.\nYou must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement.\n\nThe different RESET options are:\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| SLAVE                     | Deletes all relay logs from the slave and      |\n| [\"connection_name\"] [ALL] | reset the replication position in the master   |\n|                           | binary log.                                    |\n+---------------------------+------------------------------------------------+\n| MASTER                    | Deletes all old binary logs, makes the binary  |\n|                           | index file (--log-bin-index) empty and         |\n|                           | creates a new binary log file.  This is        |\n|                           | useful when you want to reset the master to    |\n|                           | an initial state. If you want to just delete   |\n|                           | old, not used binary logs, you should use the  |\n|                           | PURGE BINARY LOGS command.                     |\n+---------------------------+------------------------------------------------+\n| QUERY CACHE               | Removes all queries from the query cache. See  |\n|                           | also FLUSH QUERY CACHE.                        |\n+---------------------------+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/reset/','','https://mariadb.com/kb/en/reset/'),
(412,'SHUTDOWN',26,'Syntax\n------\n\nSHUTDOWN [WAIT FOR ALL { SLAVES | REPLICAS } ]\n\nDescription\n-----------\n\nThe SHUTDOWN command shuts the server down.\n\nWAIT FOR ALL REPLICAS / SLAVES\n------------------------------\n\nMariaDB starting with 10.4.4\n----------------------------\nThe WAIT FOR ALL SLAVES option was first added in MariaDB 10.4.4. WAIT FOR ALL\nREPLICAS has been a synonym since MariaDB 10.5.1.\n\nWhen a primary server is shutdown and it goes through the normal shutdown\nprocess, the primary kills client threads in random order. By default, the\nprimary also considers its binary log dump threads to be regular client\nthreads. As a consequence, the binary log dump threads can be killed while\nclient threads still exist, and this means that data can be written on the\nprimary during a normal shutdown that won\'t be replicated. This is true even\nif semi-synchronous replication is being used.\n\nIn MariaDB 10.4 and later, this problem can be solved by shutting down the\nserver with the SHUTDOWN command and by providing the WAIT FOR ALL\nREPLICAS/WAIT FOR ALL SLAVES option to the command. For example:\n\nSHUTDOWN WAIT FOR ALL REPLICAS;\n\nWhen the WAIT FOR ALL REPLICAS option is provided, the server only kills its\nbinary log dump threads after all client threads have been killed, and it only\ncompletes the shutdown after the last binary log has been sent to all\nconnected replicas.\n\nSee Replication Threads: Binary Log Dump Threads and the Shutdown Process for\nmore information.\n\nRequired Permissions\n--------------------\n\nOne must have a SHUTDOWN privilege (see GRANT) to use this command. It is the\nsame privilege one needs to use the mariadb-admin shutdown command.\n\nShutdown for Upgrades\n---------------------\n\nIf you are doing a shutdown to migrate to another major version of MariaDB,\nplease ensure that the innodb_fast_shutdown variable is not 2 (fast crash\nshutdown). The default of this variable is 1.\n\nExample\n-------\n\nThe following example shows how to create an event which turns off the server\nat a certain time:\n\nCREATE EVENT `test`.`shutd`\n  ON SCHEDULE\n    EVERY 1 DAY\n    STARTS \'2014-01-01 20:00:00\'\n  COMMENT \'Shutdown Maria when the office is closed\'\nDO BEGIN\n  SHUTDOWN;\nEND;\n\nOther Ways to Stop mysqld\n-------------------------\n\nYou can use the mariadb-admin shutdown command to take down mysqld cleanly.\n\nYou can also use the system kill command on Unix with signal SIGTERM (15)\n\nkill -SIGTERM pid-of-mysqld-process\n\nYou can find the process number of the server process in the file that ends\nwith .pid in your data directory.\n\nThe above is identical to mariadb-admin shutdown.\n\nOn windows you should use:\n\nNET STOP MySQL\n\nURL: https://mariadb.com/kb/en/shutdown/','','https://mariadb.com/kb/en/shutdown/'),
(413,'USE [DATABASE]',26,'Syntax\n------\n\nUSE db_name\n\nIn MariaDB 11.3 one can also use\n\nUSE DATABASE db_name;\n\nDescription\n-----------\n\nThe \'USE db_name\' statement tells MariaDB to use the db_name database as the\ndefault (current) database for subsequent statements. The database remains the\ndefault until the end of the session or another USE statement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable;   # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable;   # selects from db2.mytable\n\nThe DATABASE() function (SCHEMA() is a synonym) returns the default database.\n\nAnother way to set the default database is specifying its name at mariadb\ncommand line client startup.\n\nOne cannot use USE DATABASE to a database one has no privileges to. The reason\nis that a user with no privileges to a database should not be able to know if\na database exists or not.\n\nURL: https://mariadb.com/kb/en/use-database/','','https://mariadb.com/kb/en/use-database/'),
(421,'JOIN Syntax',27,'Description\n-----------\n\nMariaDB supports the following JOIN syntaxes for the table_references part of\nSELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n  table_reference [, table_reference] ...\n\ntable_reference:\n  table_factor\n | join_table\n\ntable_factor:\n  tbl_name [PARTITION (partition_list)]\n    [query_system_time_period_specification] [[AS] alias] [index_hint_list]\n | table_subquery [query_system_time_period_specification] [AS] alias\n | ( table_references )\n | { ON table_reference LEFT OUTER JOIN table_reference\n    ON conditional_expr }\n\njoin_table:\n  table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n  ON conditional_expr\n | USING (column_list)\n\nquery_system_time_period_specification:\n  FOR SYSTEM_TIME AS OF point_in_time\n | FOR SYSTEM_TIME BETWEEN point_in_time AND point_in_time\n | FOR SYSTEM_TIME FROM point_in_time TO point_in_time\n | FOR SYSTEM_TIME ALL\n\npoint_in_time:\n  [TIMESTAMP] expression\n | TRANSACTION expression\n\nindex_hint_list:\n  index_hint [, index_hint] ...\n\nindex_hint:\n  USE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n   [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n  index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nEach table can also be specified as db_name.tabl_name. This allows to write\nqueries which involve multiple databases. See Identifier Qualifiers for syntax\ndetails.\n\nThe syntax of table_factor is extended in comparison with the SQL Standard.\nThe latter accepts only table_reference, not a list of them inside a pair of\nparentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n        ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n        ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MariaDB, CROSS JOIN is a syntactic equivalent to INNER JOIN (they can\nreplace each other). In standard SQL, they are not equivalent. INNER JOIN is\nused with an ON clause, CROSS JOIN is used otherwise.\n\nIn general, parentheses can be ignored in join expressions containing only\ninner join operations. MariaDB also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.1/en/nested-join-optimization.html).\n\nSee System-versioned tables for more information about FOR SYSTEM_TIME syntax.\n\nIndex hints can be specified to affect how the MariaDB optimizer makes use of\nindexes. For more information, see How to force query plans.\n\nExamples\n--------\n\nSELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n\nURL: https://mariadb.com/kb/en/join-syntax/','','https://mariadb.com/kb/en/join-syntax/'),
(415,'SHOW COLLATION',26,'Syntax\n------\n\nSHOW COLLATION\n  [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe output from SHOW COLLATION includes all available collations. The LIKE\nclause, if present on its own, indicates which collation names to match. The\nWHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema COLLATIONS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncollation at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW COLLATION LIKE \'latin1%\';\n+-------------------------+---------+------+---------+----------+---------+\n| Collation               | Charset | Id   | Default | Compiled | Sortlen |\n+-------------------------+---------+------+---------+----------+---------+\n| latin1_german1_ci       | latin1  |    5 |         | Yes      |       1 |\n| latin1_swedish_ci       | latin1  |    8 | Yes     | Yes      |       1 |\n| latin1_danish_ci        | latin1  |   15 |         | Yes      |       1 |\n| latin1_german2_ci       | latin1  |   31 |         | Yes      |       2 |\n| latin1_bin              | latin1  |   47 |         | Yes      |       1 |\n| latin1_general_ci       | latin1  |   48 |         | Yes      |       1 |\n| latin1_general_cs       | latin1  |   49 |         | Yes      |       1 |\n| latin1_spanish_ci       | latin1  |   94 |         | Yes      |       1 |\n| latin1_swedish_nopad_ci | latin1  | 1032 |         | Yes      |       1 |\n| latin1_nopad_bin        | latin1  | 1071 |         | Yes      |       1 |\n+-------------------------+---------+------+---------+----------+---------+\n\nSHOW COLLATION WHERE Sortlen LIKE \'8\' AND Charset LIKE \'utf8mb4\';\n+------------------------------+---------+------+---------+----------+---------\n\n| Collation                    | Charset | Id   | Default | Compiled | Sortlen\n|\n+------------------------------+---------+------+---------+----------+---------\n\n| utf8mb4_unicode_ci           | utf8mb4 |  224 |         | Yes      |       8\n|\n| utf8mb4_icelandic_ci         | utf8mb4 |  225 |         | Yes      |       8\n|\n| utf8mb4_latvian_ci           | utf8mb4 |  226 |         | Yes      |       8\n|\n| utf8mb4_romanian_ci          | utf8mb4 |  227 |         | Yes      |       8\n|\n| utf8mb4_slovenian_ci         | utf8mb4 |  228 |         | Yes      |       8\n|\n| utf8mb4_polish_ci            | utf8mb4 |  229 |         | Yes      |       8\n|\n| utf8mb4_estonian_ci          | utf8mb4 |  230 |         | Yes      |       8\n|\n| utf8mb4_spanish_ci           | utf8mb4 |  231 |         | Yes      |       8\n|\n| utf8mb4_swedish_ci           | utf8mb4 |  232 |         | Yes      |       8\n|\n| utf8mb4_turkish_ci           | utf8mb4 |  233 |         | Yes      |       8\n|\n| utf8mb4_czech_ci             | utf8mb4 |  234 |         | Yes      |       8\n|\n| utf8mb4_danish_ci            | utf8mb4 |  235 |         | Yes      |       8\n|\n| utf8mb4_lithuanian_ci        | utf8mb4 |  236 |         | Yes      |       8\n|\n| utf8mb4_slovak_ci            | utf8mb4 |  237 |         | Yes      |       8\n|\n| utf8mb4_spanish2_ci          | utf8mb4 |  238 |         | Yes      |       8\n|\n| utf8mb4_roman_ci             | utf8mb4 |  239 |         | Yes      |       8\n|\n| utf8mb4_persian_ci           | utf8mb4 |  240 |         | Yes      |       8\n|\n| utf8mb4_esperanto_ci         | utf8mb4 |  241 |         | Yes      |       8\n|\n| utf8mb4_hungarian_ci         | utf8mb4 |  242 |         | Yes      |       8\n|\n| utf8mb4_sinhala_ci           | utf8mb4 |  243 |         | Yes      |       8\n|\n| utf8mb4_german2_ci           | utf8mb4 |  244 |         | Yes      |       8\n|\n| utf8mb4_croatian_mysql561_ci | utf8mb4 |  245 |         | Yes      |       8\n|\n| utf8mb4_unicode_520_ci       | utf8mb4 |  246 |         | Yes      |       8\n|\n| utf8mb4_vietnamese_ci        | utf8mb4 |  247 |         | Yes      |       8\n|\n| utf8mb4_croatian_ci          | utf8mb4 |  608 |         | Yes      |       8\n|\n| utf8mb4_myanmar_ci           | utf8mb4 |  609 |         | Yes      |       8\n|\n| utf8mb4_unicode_nopad_ci     | utf8mb4 | 1248 |         | Yes      |       8\n|\n| utf8mb4_unicode_520_nopad_ci | utf8mb4 | 1270 |         | Yes      |       8\n|\n+------------------------------+---------+------+---------+----------+---------\n\nURL: https://mariadb.com/kb/en/show-collation/','','https://mariadb.com/kb/en/show-collation/'),
(422,'Scalar Subqueries',27,'A scalar subquery is a subquery that returns a single value. This is the\nsimplest form of a subquery, and can be used in most places a literal or\nsingle column value is valid.\n\nThe data type, length and character set and collation are all taken from the\nresult returned by the subquery. The result of a subquery can always be NULL,\nthat is, no result returned. Even if the original value is defined as NOT\nNULL, this is disregarded.\n\nA subquery cannot be used where only a literal is expected, for example LOAD\nDATA INFILE expects a literal string containing the file name, and LIMIT\nrequires a literal integer.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num TINYINT);\n\nINSERT INTO sq1 VALUES (1);\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq1));\n\nSELECT * FROM sq2;\n+------+\n| num  |\n+------+\n|   10 |\n+------+\n\nInserting a second row means the subquery is no longer a scalar, and this\nparticular query is not valid:\n\nINSERT INTO sq1 VALUES (2);\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq1));\nERROR 1242 (21000): Subquery returns more than 1 row\n\nNo rows in the subquery, so the scalar is NULL:\n\nINSERT INTO sq2 VALUES (10* (SELECT num FROM sq3 WHERE num=\'3\'));\n\nSELECT * FROM sq2;\n+------+\n| num  |\n+------+\n|   10 |\n| NULL |\n+------+\n\nA more traditional scalar subquery, as part of a WHERE clause:\n\nSELECT * FROM sq1 WHERE num = (SELECT MAX(num)/10 FROM sq2); \n+------+\n| num  |\n+------+\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/subqueries-scalar-subqueries/','','https://mariadb.com/kb/en/subqueries-scalar-subqueries/'),
(416,'DELETE',27,'Syntax\n------\n\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] \n FROM tbl_name [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n [RETURNING select_expr\n  [, select_expr ...]]\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n  tbl_name[.*] [, tbl_name[.*]] ...\n  FROM table_references\n  [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n  FROM tbl_name[.*] [, tbl_name[.*]] ...\n  USING table_references\n  [WHERE where_condition]\n\nTrimming history:\n\nDELETE HISTORY\n FROM tbl_name [PARTITION (partition_list)]\n [BEFORE SYSTEM_TIME [TIMESTAMP|TRANSACTION] expression]\n\nDescription\n-----------\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| LOW_PRIORITY              | Wait until all SELECT\'s are done before        |\n|                           | starting the statement. Used with storage      |\n|                           | engines that uses table locking (MyISAM, Aria  |\n|                           | etc). See HIGH_PRIORITY and LOW_PRIORITY       |\n|                           | clauses for details.                           |\n+---------------------------+------------------------------------------------+\n| QUICK                     | Signal the storage engine that it should       |\n|                           | expect that a lot of rows are deleted. The     |\n|                           | storage engine engine can do things to speed   |\n|                           | up the DELETE like ignoring merging of data    |\n|                           | blocks until all rows are deleted from the     |\n|                           | block (instead of when a block is half full).  |\n|                           | This speeds up things at the expanse of lost   |\n|                           | space in data blocks. At least MyISAM and      |\n|                           | Aria support this feature.                     |\n+---------------------------+------------------------------------------------+\n| IGNORE                    | Don\'t stop the query even if a not-critical    |\n|                           | error occurs (like data overflow). See How     |\n|                           | IGNORE works for a full description.           |\n+---------------------------+------------------------------------------------+\n\nFor the single-table syntax, the DELETE statement deletes rows from tbl_name\nand returns a count of the number of deleted rows. This count can be obtained\nby calling the ROW_COUNT() function. The WHERE clause, if given, specifies the\nconditions that identify which rows to delete. With no WHERE clause, all rows\nare deleted. If the ORDER BY clause is specified, the rows are deleted in the\norder that is specified. The LIMIT clause places a limit on the number of rows\nthat can be deleted.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the rows that\nsatisfy the conditions. In this case, ORDER BY and LIMIT> cannot be used. A\nDELETE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\ndeleted. It is specified as described in SELECT.\n\nCurrently, you cannot delete from a table and select from the same table in a\nsubquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You need only\nthe SELECT privilege for any columns that are only read, such as those named\nin the WHERE clause. See GRANT.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A faster\nway to do this, when you do not need to know the number of deleted rows, is to\nuse TRUNCATE TABLE. However, within a transaction or if you have a lock on the\ntable, TRUNCATE TABLE cannot be used whereas DELETE can. See TRUNCATE TABLE,\nand LOCK.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Deletion by Portion.\n\nRETURNING\n---------\n\nIt is possible to return a resultset of the deleted rows for a single table to\nthe client by using the syntax DELETE ... RETURNING select_expr [,\nselect_expr2 ...]]\n\nAny of SQL expression that can be calculated from a single row fields is\nallowed. Subqueries are allowed. The AS keyword is allowed, so it is possible\nto use aliases.\n\nThe use of aggregate functions is not allowed. RETURNING cannot be used in\nmulti-table DELETEs.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nSame Source and Target Table\n----------------------------\n\nUntil MariaDB 10.3.1, deleting from a table with the same source and target\nwas not possible. From MariaDB 10.3.1, this is now possible. For example:\n\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nMariaDB starting with 10.3.4\n----------------------------\n\nDELETE HISTORY\n--------------\n\nOne can use DELETE HISTORY to delete historical information from\nSystem-versioned tables.\n\nExamples\n--------\n\nHow to use the ORDER BY and LIMIT clauses:\n\nDELETE FROM page_hit ORDER BY timestamp LIMIT 1000000;\n\nHow to use the RETURNING clause:\n\nDELETE FROM t RETURNING f1;\n+------+\n| f1   |\n+------+\n|    5 |\n|   50 |\n|  500 |\n+------+\n\nThe following statement joins two tables: one is only used to satisfy a WHERE\ncondition, but no row is deleted from it; rows from the other table are\ndeleted, instead.\n\nDELETE post FROM blog INNER JOIN post WHERE blog.id = post.blog_id;\n\nDeleting from the Same Source and Target\n----------------------------------------\n\nCREATE TABLE t1 (c1 INT, c2 INT);\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nUntil MariaDB 10.3.1, this returned:\n\nERROR 1093 (HY000): Table \'t1\' is specified twice, both as a target for\n\'DELETE\' \n and as a separate source for\n\nFrom MariaDB 10.3.1:\n\nQuery OK, 0 rows affected (0.00 sec)\n\nURL: https://mariadb.com/kb/en/delete/','','https://mariadb.com/kb/en/delete/'),
(417,'REPLACE',27,'Syntax\n------\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nDescription\n-----------\n\nREPLACE works exactly like INSERT, except that if an old row in the table has\nthe same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row\nis deleted before the new row is inserted. If the table has more than one\nUNIQUE keys, it is possible that the new row conflicts with more than one row.\nIn this case, all conflicting rows will be deleted.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use REPLACE ... SELECT to copy rows between different databases.\n\nMariaDB starting with 10.5.0\n----------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.0\n\nBasically it works like this:\n\nBEGIN;\nSELECT 1 FROM t1 WHERE key=# FOR UPDATE;\nIF found-row\n DELETE FROM t1 WHERE key=# ;\nENDIF\nINSERT INTO t1 VALUES (...);\nEND;\n\nThe above can be replaced with:\n\nREPLACE INTO t1 VALUES (...)\n\nREPLACE is a MariaDB/MySQL extension to the SQL standard. It either inserts,\nor deletes and inserts. For other MariaDB/MySQL extensions to standard SQL ---\nthat also handle duplicate values --- see IGNORE and INSERT ON DUPLICATE KEY\nUPDATE.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE\nstatement makes no sense. It becomes equivalent to INSERT, because there is no\nindex to be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values sSee Partition Pruning and\nSelection for details.pecified in the REPLACE statement. Any missing columns\nare set to their default values, just as happens for INSERT. You cannot refer\nto values from the current row and use them in the new row. If you use an\nassignment such as \'SET col = col + 1\', the reference to the column name on\nthe right hand side is treated as DEFAULT(col), so the assignment is\nequivalent to \'SET col = DEFAULT(col) + 1\'.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for the\ntable.\n\nThere are some gotchas you should be aware of, before using REPLACE:\n\n* If there is an AUTO_INCREMENT field, a new value will be generated.\n* If there are foreign keys, ON DELETE action will be activated by REPLACE.\n* Triggers on DELETE and INSERT will be activated by REPLACE.\n\nTo avoid some of these behaviors, you can use INSERT ... ON DUPLICATE KEY\nUPDATE.\n\nThis statement activates INSERT and DELETE triggers. See Trigger Overview for\ndetails.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nREPLACE RETURNING\n-----------------\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in REPLACE...SEL==\nDescription\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in\nREPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the REPLACE table. ECT...RETURNING if the table in the RETURNING\nclause is not the same as the REPLACE table.\n\nURL: https://mariadb.com/kb/en/replace/','','https://mariadb.com/kb/en/replace/'),
(418,'UPDATE',27,'Syntax\n------\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference \n [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n  SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...\n  [WHERE where_condition]\n\nDescription\n-----------\n\nFor the single-table syntax, the UPDATE statement updates columns of existing\nrows in the named table with new values. The SET clause indicates which\ncolumns to modify and the values they should be given. Each value can be given\nas an expression, or the keyword DEFAULT to set a column explicitly to its\ndefault value. The WHERE clause, if given, specifies the conditions that\nidentify which rows to update. With no WHERE clause, all rows are updated. If\nthe ORDER BY clause is specified, the rows are updated in the order that is\nspecified. The LIMIT clause places a limit on the number of rows that can be\nupdated.\n\nUntil MariaDB 10.3.2, for the multiple-table syntax, UPDATE updates rows in\neach table named in table_references that satisfy the conditions. In this\ncase, ORDER BY and LIMIT cannot be used. This restriction was lifted in\nMariaDB 10.3.2 and both clauses can be used with multiple-table updates. An\nUPDATE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\nupdated.\n\ntable_references and where_condition are as specified as described in SELECT.\n\nFor single-table updates, assignments are evaluated in left-to-right order,\nwhile for multi-table updates, there is no guarantee of a particular order. If\nthe SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB 10.3.5) is set,\nUPDATE statements evaluate all assignments simultaneously.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE that\nare actually updated. You need only the SELECT privilege for any columns that\nare read but not modified. See GRANT.\n\nThe UPDATE statement supports the following modifiers:\n\n* If you use the LOW_PRIORITY keyword, execution of\n the UPDATE is delayed until no other clients are reading from\n the table. This affects only storage engines that use only table-level\n locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and LOW_PRIORITY clauses\nfor details.\n* If you use the IGNORE keyword, the update statement does \n not abort even if errors occur during the update. Rows for which\n duplicate-key conflicts occur are not updated. Rows for which columns are\n updated to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Updating by Portion.\n\nUPDATE Statements With the Same Source and Target\n-------------------------------------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nFrom MariaDB 10.3.2, UPDATE statements may have the same source and target.\n\nFor example, given the following table:\n\nDROP TABLE t1;\nCREATE TABLE t1 (c1 INT, c2 INT);\nINSERT INTO t1 VALUES (10,10), (20,20);\n\nUntil MariaDB 10.3.1, the following UPDATE statement would not work:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\nERROR 1093 (HY000): Table \'t1\' is specified twice, \n both as a target for \'UPDATE\' and as a separate source for data\n\nFrom MariaDB 10.3.2, the statement executes successfully:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\n\nSELECT * FROM t1;\n+------+------+\n| c1   | c2   |\n+------+------+\n|   10 |   10 |\n|   21 |   20 |\n+------+------+\n\nExample\n-------\n\nSingle-table syntax:\n\nUPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100;\n\nMultiple-table syntax:\n\nUPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE\ntab1.id = tab2.id;\n\nURL: https://mariadb.com/kb/en/update/','','https://mariadb.com/kb/en/update/'),
(423,'Row Subqueries',27,'A row subquery is a subquery returning a single row, as opposed to a scalar\nsubquery, which returns a single column from a row, or a literal.\n\nExamples\n--------\n\nCREATE TABLE staff (name VARCHAR(10), age TINYINT);\n\nCREATE TABLE customer (name VARCHAR(10), age TINYINT);\n\nINSERT INTO staff VALUES (\'Bilhah\',37), (\'Valerius\',61), (\'Maia\',25);\n\nINSERT INTO customer VALUES (\'Thanasis\',48), (\'Valerius\',61), (\'Brion\',51);\n\nSELECT * FROM staff WHERE (name,age) = (SELECT name,age FROM customer WHERE\nname=\'Valerius\');\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nFinding all rows in one table also in another:\n\nSELECT name,age FROM staff WHERE (name,age) IN (SELECT name,age FROM customer);\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nURL: https://mariadb.com/kb/en/subqueries-row-subqueries/','','https://mariadb.com/kb/en/subqueries-row-subqueries/'),
(419,'IGNORE',27,'The IGNORE option tells the server to ignore some common errors.\n\nIGNORE can be used with the following statements:\n\n* DELETE\n* INSERT (see also INSERT IGNORE)\n* LOAD DATA INFILE\n* UPDATE\n* ALTER TABLE\n* CREATE TABLE ... SELECT\n* INSERT ... SELECT\n\nThe logic used:\n\n* Variables out of ranges are replaced with the maximum/minimum value.\n\n* SQL_MODEs STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE,\nNO_ZERO_DATE are ignored.\n\n* Inserting NULL in a NOT NULL field will insert 0 ( in a numerical\n field), 0000-00-00 ( in a date field) or an empty string ( in a character\n field).\n\n* Rows that cause a duplicate key error or break a foreign key constraint are\n not inserted, updated, or deleted.\n\nThe following errors are ignored:\n\n+---------------------+---------------------------------+--------------------+\n| Error number        | Symbolic error name             | Description        |\n+---------------------+---------------------------------+--------------------+\n| 1022                | ER_DUP_KEY                      | Can\'t write;       |\n|                     |                                 | duplicate key in   |\n|                     |                                 | table \'%s\'         |\n+---------------------+---------------------------------+--------------------+\n| 1048                | ER_BAD_NULL_ERROR               | Column \'%s\'        |\n|                     |                                 | cannot be null     |\n+---------------------+---------------------------------+--------------------+\n| 1062                | ER_DUP_ENTRY                    | Duplicate entry    |\n|                     |                                 | \'%s\' for key %d    |\n+---------------------+---------------------------------+--------------------+\n| 1242                | ER_SUBQUERY_NO_1_ROW            | Subquery returns   |\n|                     |                                 | more than 1 row    |\n+---------------------+---------------------------------+--------------------+\n| 1264                | ER_WARN_DATA_OUT_OF_RANGE       | Out of range       |\n|                     |                                 | value for column   |\n|                     |                                 | \'%s\' at row %ld    |\n+---------------------+---------------------------------+--------------------+\n| 1265                | WARN_DATA_TRUNCATED             | Data truncated     |\n|                     |                                 | for column \'%s\'    |\n|                     |                                 | at row %ld         |\n+---------------------+---------------------------------+--------------------+\n| 1292                | ER_TRUNCATED_WRONG_VALUE        | Truncated          |\n|                     |                                 | incorrect %s       |\n|                     |                                 | value: \'%s\'        |\n+---------------------+---------------------------------+--------------------+\n| 1366                | ER_TRUNCATED_WRONG_VALUE_FOR_FI | Incorrect integer  |\n|                     | LD                              | value              |\n+---------------------+---------------------------------+--------------------+\n| 1369                | ER_VIEW_CHECK_FAILED            | CHECK OPTION       |\n|                     |                                 | failed \'%s.%s\'     |\n+---------------------+---------------------------------+--------------------+\n| 1451                | ER_ROW_IS_REFERENCED_2          | Cannot delete or   |\n|                     |                                 | update a parent    |\n|                     |                                 | row                |\n+---------------------+---------------------------------+--------------------+\n| 1452                | ER_NO_REFERENCED_ROW_2          | Cannot add or      |\n|                     |                                 | update a child     |\n|                     |                                 | row: a foreign     |\n|                     |                                 | key constraint     |\n|                     |                                 | fails (%s)         |\n+---------------------+---------------------------------+--------------------+\n| 1526                | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no       |\n|                     |                                 | partition for      |\n|                     |                                 | value %s           |\n+---------------------+---------------------------------+--------------------+\n| 1586                | ER_DUP_ENTRY_WITH_KEY_NAME      | Duplicate entry    |\n|                     |                                 | \'%s\' for key \'%s\'  |\n+---------------------+---------------------------------+--------------------+\n| 1591                | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no       |\n|                     | SILENT                          | partition for      |\n|                     |                                 | some existing      |\n|                     |                                 | values             |\n+---------------------+---------------------------------+--------------------+\n| 1748                | ER_ROW_DOES_NOT_MATCH_GIVEN_PAR | Found a row not    |\n|                     | ITION_SET                       | matching the       |\n|                     |                                 | given partition    |\n|                     |                                 | set                |\n+---------------------+---------------------------------+--------------------+\n\nIgnored errors normally generate a warning.\n\nA property of the IGNORE clause consists in causing transactional engines and\nnon-transactional engines (like InnoDB and Aria) to behave the same way. For\nexample, normally a multi-row insert which tries to violate a UNIQUE contraint\nis completely rolled back on InnoDB, but might be partially executed on Aria.\nWith the IGNORE clause, the statement will be partially executed in both\nengines.\n\nDuplicate key errors also generate warnings. The OLD_MODE server variable can\nbe used to prevent this.\n\nURL: https://mariadb.com/kb/en/ignore/','','https://mariadb.com/kb/en/ignore/'),
(420,'SELECT',27,'Syntax\n------\n\nSELECT\n  [ALL | DISTINCT | DISTINCTROW]\n  [HIGH_PRIORITY]\n  [STRAIGHT_JOIN]\n  [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n  [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n  select_expr [, select_expr ...]\n  [ FROM table_references\n   [WHERE where_condition]\n   [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]]\n   [HAVING where_condition]\n   [ORDER BY {col_name | expr | position} [ASC | DESC], ...]\n   [LIMIT {[offset,] row_count | row_count OFFSET offset  [ROWS EXAMINED\nrows_limit] } |\n    [OFFSET start { ROW | ROWS }]\n    [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }]\n]\n   procedure|[PROCEDURE procedure_name(argument_list)]\n   [INTO OUTFILE \'file_name\' [CHARACTER SET charset_name] [export_options] |\n    INTO DUMPFILE \'file_name\' | INTO var_name [, var_name] ]\n   [FOR UPDATE lock_option | LOCK IN SHARE MODE lock_option]\nexport_options:\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\nlock_option:\n  [WAIT n | NOWAIT | SKIP LOCKED]\n\nDescription\n-----------\n\nSELECT is used to retrieve rows selected from one or more tables, and can\ninclude UNION statements and subqueries.\n\n* Each select_expr expression indicates a column or data that you want to\nretrieve. You\nmust have at least one select expression. See Select Expressions below.\n\n* The FROM clause indicates the table or tables from which to retrieve rows.\nUse either a single table name or a JOIN expression. See JOIN\nfor details. If no table is involved, FROM DUAL can be specified.\n\n* Each table can also be specified as db_name.tabl_name. Each column can also\nbe specified as tbl_name.col_name or even db_name.tbl_name.col_name. This\nallows one to write queries which involve multiple databases. See Identifier\nQualifiers for syntax details.\n\n* The WHERE clause, if given, indicates the condition or\n conditions that rows must satisfy to be selected.\n where_condition is an expression that evaluates to true for\n each row to be selected. The statement selects all rows if there is no WHERE\n clause.\nIn the WHERE clause, you can use any of the functions and\n operators that MariaDB supports, except for aggregate (summary) functions.\nSee Functions and Operators and Functions and Modifiers for use with GROUP BY\n(aggregate).\n\n* Use the ORDER BY clause to order the results.\n\n* Use the LIMIT clause allows you to restrict the results to only\na certain number of rows, optionally with an offset.\n\n* Use the GROUP BY and HAVING clauses to group\nrows together when they have columns or computed values in common.\n\nSELECT can also be used to retrieve rows computed without reference to any\ntable.\n\nSelect Expressions\n------------------\n\nA SELECT statement must contain one or more select expressions, separated by\ncommas. Each select expression can be one of the following:\n\n* The name of a column.\n* Any expression using functions and operators.\n* * to select all columns from all tables in the FROM clause.\n* tbl_name.* to select all columns from just the table tbl_name.\n\nWhen specifying a column, you can either use just the column name or qualify\nthe column name with the name of the table using tbl_name.col_name. The\nqualified form is useful if you are joining multiple tables in the FROM\nclause. If you do not qualify the column names when selecting from multiple\ntables, MariaDB will try to find the column in each table. It is an error if\nthat column name exists in multiple tables.\n\nYou can quote column names using backticks. If you are qualifying column names\nwith table names, quote each part separately as `tbl_name`.`col_name`.\n\nIf you use any grouping functions in any of the select expressions, all rows\nin your results will be implicitly grouped, as if you had used GROUP BY NULL.\n\nDISTINCT\n--------\n\nA query may produce some identical rows. By default, all rows are retrieved,\neven when their values are the same. To explicitly specify that you want to\nretrieve identical rows, use the ALL option. If you want duplicates to be\nremoved from the resultset, use the DISTINCT option. DISTINCTROW is a synonym\nfor DISTINCT. See also COUNT DISTINCT and SELECT UNIQUE in Oracle mode.\n\nINTO\n----\n\nThe INTO clause is used to specify that the query results should be written to\na file or variable.\n\n* SELECT INTO OUTFILE - formatting and writing the result to an external file.\n* SELECT INTO DUMPFILE - binary-safe writing of the unformatted results to an\nexternal file.\n* SELECT INTO Variable - selecting and setting variables.\n\nThe reverse of SELECT INTO OUTFILE is LOAD DATA.\n\nLIMIT\n-----\n\nRestricts the number of returned rows. See LIMIT and LIMIT ROWS EXAMINED for\ndetails.\n\nLOCK IN SHARE MODE/FOR UPDATE\n-----------------------------\n\nSee LOCK IN SHARE MODE and FOR UPDATE for details on the respective locking\nclauses.\n\nOFFSET ... FETCH\n----------------\n\nMariaDB starting with 10.6\n--------------------------\nSee SELECT ... OFFSET ... FETCH.\n\nORDER BY\n--------\n\nOrder a resultset. See ORDER BY for details.\n\nPARTITION\n---------\n\nSpecifies to the optimizer which partitions are relevant for the query. Other\npartitions will not be read. See Partition Pruning and Selection for details.\n\nPROCEDURE\n---------\n\nPasses the whole result set to a C Procedure. See PROCEDURE and PROCEDURE\nANALYSE (the only built-in procedure not requiring the server to be\nrecompiled).\n\nSKIP LOCKED\n-----------\n\nMariaDB starting with 10.6\n--------------------------\nThe SKIP LOCKED clause was introduced in MariaDB 10.6.0.\n\nThis causes those rows that couldn\'t be locked (LOCK IN SHARE MODE or FOR\nUPDATE) to be excluded from the result set. An explicit NOWAIT is implied\nhere. This is only implemented on InnoDB tables and ignored otherwise.\n\nSQL_CALC_FOUND_ROWS\n-------------------\n\nWhen SQL_CALC_FOUND_ROWS is used, then MariaDB will calculate how many rows\nwould have been in the result, if there would be no LIMIT clause. The result\ncan be found by calling the function FOUND_ROWS() in your next sql statement.\n\nmax_statement_time clause\n-------------------------\n\nBy using max_statement_time in conjunction with SET STATEMENT, it is possible\nto limit the execution time of individual queries. For example:\n\nSET STATEMENT max_statement_time=100 FOR \n SELECT field1 FROM table_name ORDER BY field1;\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nExamples\n--------\n\nSELECT f1,f2 FROM t1 WHERE (f3<=10) AND (f4=\'y\');\n\nSee Getting Data from MariaDB (Beginner tutorial), or the various\nsub-articles, for more examples.\n\nURL: https://mariadb.com/kb/en/select/','','https://mariadb.com/kb/en/select/'),
(424,'Subqueries and ALL',27,'Subqueries using the ALL keyword will return true if the comparison returns\ntrue for each row returned by the subquery, or the subquery returns no rows.\n\nSyntax\n------\n\nscalar_expression comparison_operator ALL <Table subquery>\n\n* scalar_expression may be any expression that evaluates to a single\nvalue\n* comparison_operator may be any one of: =, >, <, >=, <=, <> or !=\n\nALL returns:\n\n* NULL if the comparison operator returns NULL for at least one row returned\nby the Table subquery or scalar_expression returns NULL.\n* FALSE if the comparison operator returns FALSE for at least one row returned\nby the Table subquery.\n* TRUE if the comparison operator returns TRUE for all rows returned by the\nTable subquery, or if Table subquery returns no rows.\n\nNOT IN is an alias for <> ALL.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(60);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nSince 100 > all of 40,50 and 60, the evaluation is true and the row is returned\n\nAdding a second row to sq1, where the evaluation for that record is false:\n\nINSERT INTO sq1 VALUES(30);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nAdding a new row to sq2, causing all evaluations to be false:\n\nINSERT INTO sq2 VALUES(120);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\nEmpty set (0.00 sec)\n\nWhen the subquery returns no results, the evaluation is still true:\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2 WHERE num2 > 300);\n+------+\n| num  |\n+------+\n|  100 |\n|   30 |\n+------+\n\nEvaluating against a NULL will cause the result to be unknown, or not true,\nand therefore return no rows:\n\nINSERT INTO sq2 VALUES (NULL);\n\nSELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2);\n\nURL: https://mariadb.com/kb/en/subqueries-and-all/','','https://mariadb.com/kb/en/subqueries-and-all/'),
(425,'Subqueries and ANY',27,'Subqueries using the ANY keyword will return true if the comparison returns\ntrue for at least one row returned by the subquery.\n\nSyntax\n------\n\nThe required syntax for an ANY or SOME quantified comparison is:\n\nscalar_expression comparison_operator ANY <Table subquery>\n\nOr:\n\nscalar_expression comparison_operator SOME <Table subquery>\n\n* scalar_expression may be any expression that evaluates to a\nsingle value.\n* comparison_operator may be any one of =, >, <, >=, <=, <> or !=.\n\nANY returns:\n\n* TRUE if the comparison operator returns TRUE for at least one row returned\nby the Table subquery.\n* FALSE if the comparison operator returns FALSE for all rows returned by the\nTable subquery, or Table subquery has zero rows.\n* NULL if the comparison operator returns NULL for at least one row returned\nby the Table subquery and doesn\'t returns TRUE for any of them, or if\nscalar_expression returns NULL.\n\nSOME is a synmonym for ANY, and IN is a synonym for = ANY\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(120);\n\nSELECT * FROM sq1 WHERE num > ANY (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\n100 is greater than two of the three values, and so the expression evaluates\nas true.\n\nSOME is a synonym for ANY:\n\nSELECT * FROM sq1 WHERE num < SOME (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nIN is a synonym for = ANY, and here there are no matches, so no results are\nreturned:\n\nSELECT * FROM sq1 WHERE num IN (SELECT * FROM sq2);\nEmpty set (0.00 sec)\n\nINSERT INTO sq2 VALUES(100);\nQuery OK, 1 row affected (0.05 sec)\n\nSELECT * FROM sq1 WHERE num <> ANY (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nReading this query, the results may be counter-intuitive. It may seem to read\nas \"SELECT * FROM sq1 WHERE num does not match any results in sq2. Since it\ndoes match 100, it could seem that the results are incorrect. However, the\nquery returns a result if the match does not match any of sq2. Since 100\nalready does not match 40, the expression evaluates to true immediately,\nregardless of the 100\'s matching. It may be more easily readable to use SOME\nin a case such as this:\n\nSELECT * FROM sq1 WHERE num <> SOME (SELECT * FROM sq2);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nURL: https://mariadb.com/kb/en/subqueries-and-any/','','https://mariadb.com/kb/en/subqueries-and-any/'),
(426,'Subqueries and EXISTS',27,'Syntax\n------\n\nSELECT ... WHERE EXISTS <Table subquery>\n\nDescription\n-----------\n\nSubqueries using the EXISTS keyword will return true if the subquery returns\nany rows. Conversely, subqueries using NOT EXISTS will return true only if the\nsubquery returns no rows from the table.\n\nEXISTS subqueries ignore the columns specified by the SELECT of the subquery,\nsince they\'re not relevant. For example,\n\nSELECT col1 FROM t1 WHERE EXISTS (SELECT * FROM t2);\n\nand\n\nSELECT col1 FROM t1 WHERE EXISTS (SELECT col2 FROM t2);\n\nproduce identical results.\n\nExamples\n--------\n\nCREATE TABLE sq1 (num TINYINT);\n\nCREATE TABLE sq2 (num2 TINYINT);\n\nINSERT INTO sq1 VALUES(100);\n\nINSERT INTO sq2 VALUES(40),(50),(60);\n\nSELECT * FROM sq1 WHERE EXISTS (SELECT * FROM sq2 WHERE num2>50);\n+------+\n| num  |\n+------+\n|  100 |\n+------+\n\nSELECT * FROM sq1 WHERE NOT EXISTS (SELECT * FROM sq2 GROUP BY num2 HAVING\nMIN(num2)=40);\nEmpty set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/subqueries-and-exists/','','https://mariadb.com/kb/en/subqueries-and-exists/'),
(427,'Subqueries in a FROM Clause',27,'Although subqueries are more commonly placed in a WHERE clause, they can also\nform part of the FROM clause. Such subqueries are commonly called derived\ntables.\n\nIf a subquery is used in this way, you must also use an AS clause to name the\nresult of the subquery.\n\nORACLE mode\n-----------\n\nMariaDB starting with 10.6.0\n----------------------------\nFrom MariaDB 10.6.0, anonymous subqueries in a FROM clause (no AS clause) are\npermitted in ORACLE mode.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nAssume that, given the data above, you want to return the average total for\nall students. In other words, the average of Chun\'s 148 (75+73), Esben\'s 74\n(43+31), etc.\n\nYou cannot do the following:\n\nSELECT AVG(SUM(score)) FROM student GROUP BY name;\nERROR 1111 (HY000): Invalid use of group function\n\nA subquery in the FROM clause is however permitted:\n\nSELECT AVG(sq_sum) FROM (SELECT SUM(score) AS sq_sum FROM student GROUP BY\nname) AS t;\n+-------------+\n| AVG(sq_sum) |\n+-------------+\n|    134.0000 |\n+-------------+\n\nFrom MariaDB 10.6 in ORACLE mode, the following is permitted:\n\nSELECT * FROM (SELECT 1 FROM DUAL), (SELECT 2 FROM DUAL);\n\nURL: https://mariadb.com/kb/en/subqueries-in-a-from-clause/','','https://mariadb.com/kb/en/subqueries-in-a-from-clause/'),
(428,'Subqueries and JOINs',27,'A subquery can quite often, but not in all cases, be rewritten as a JOIN.\n\nRewriting Subqueries as JOINS\n-----------------------------\n\nA subquery using IN can be rewritten with the DISTINCT keyword, for example:\n\nSELECT * FROM table1 WHERE col1 IN (SELECT col1 FROM table2);\n\ncan be rewritten as:\n\nSELECT DISTINCT table1.* FROM table1, table2 WHERE table1.col1=table2.col1;\n\nNOT IN or NOT EXISTS queries can also be rewritten. For example, these two\nqueries returns the same result:\n\nSELECT * FROM table1 WHERE col1 NOT IN (SELECT col1 FROM table2);\nSELECT * FROM table1 WHERE NOT EXISTS (SELECT col1 FROM table2 WHERE\ntable1.col1=table2.col1);\n\nand both can be rewritten as:\n\nSELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE\ntable2.id IS NULL;\n\nSubqueries that can be rewritten as a LEFT JOIN are sometimes more efficient.\n\nUsing Subqueries instead of JOINS\n---------------------------------\n\nThere are some scenarios, though, which call for subqueries rather than joins:\n\n* When you want duplicates, but not false duplicates. Suppose Table_1\n has three rows — {1,1,2}\n — and Table_2 has two rows\n — {1,2,2}. If you need to list the rows\n in Table_1 which are also in Table_2, only this\n subquery-based SELECT statement will give the right answer\n (1,1,2):\n\nSELECT Table_1.column_1 \nFROM   Table_1 \nWHERE  Table_1.column_1 IN \n (SELECT Table_2.column_1\n  FROM   Table_2);\n\n* This SQL statement won\'t work:\n\nSELECT Table_1.column_1 \nFROM   Table_1,Table_2 \nWHERE  Table_1.column_1 = Table_2.column_1;\n\n* because the result will be {1,1,2,2}\n — and the duplication of 2 is an error.  This SQL\n statement won\'t work either:\n\nSELECT DISTINCT Table_1.column_1 \nFROM   Table_1,Table_2 \nWHERE  Table_1.column_1 = Table_2.column_1;\n\n* because the result will be {1,2} — and\n the removal of the duplicated 1 is an error too.\n\n* When the outermost statement is not a query. The SQL statement:\n\nUPDATE Table_1 SET column_1 = (SELECT column_1 FROM Table_2);\n\n* can\'t be expressed using a join unless some rare SQL3 features are used.\n\n* When the join is over an expression. The SQL statement:\n\nSELECT * FROM Table_1 \nWHERE column_1 + 5 =\n (SELECT MAX(column_1) FROM Table_2);\n\n* is hard to express with a join. In fact, the only way we can think of is\n this SQL statement:\n\nSELECT Table_1.*\nFROM   Table_1, \n   (SELECT MAX(column_1) AS max_column_1 FROM Table_2) AS Table_2\nWHERE  Table_1.column_1 + 5 = Table_2.max_column_1;\n\n* which still involves a parenthesized query, so nothing is gained from the\n transformation.\n\n* When you want to see the exception. For example, suppose the question is:\n what books are longer than Das Kapital? These two queries are effectively\n almost the same:\n\nSELECT DISTINCT Bookcolumn_1.*                     \nFROM   Books AS Bookcolumn_1 JOIN Books AS Bookcolumn_2 USING(page_count) \nWHERE  title = \'Das Kapital\';\n\nSELECT DISTINCT Bookcolumn_1.* \nFROM   Books AS Bookcolumn_1 \nWHERE  Bookcolumn_1.page_count > \n (SELECT DISTINCT page_count\n FROM   Books AS Bookcolumn_2\n WHERE  title = \'Das Kapital\');\n\n* The difference is between these two SQL statements is, if there are two\n editions of Das Kapital (with different page counts), then the self-join\n example will return the books which are  longer than the shortest edition\n of Das Kapital. That might be the wrong answer, since the original\n question didn\'t ask for \"... longer than ANY book named Das Kapital\"\n (it seems to contain a false assumption that there\'s only one edition).\n\nURL: https://mariadb.com/kb/en/subqueries-and-joins/','','https://mariadb.com/kb/en/subqueries-and-joins/'),
(429,'Subquery Limitations',27,'There are a number of limitations regarding subqueries, which are discussed\nbelow. The following tables and data will be used in the examples that follow:\n\nCREATE TABLE staff(name VARCHAR(10),age TINYINT);\n\nCREATE TABLE customer(name VARCHAR(10),age TINYINT);\n\nINSERT INTO staff VALUES \n(\'Bilhah\',37), (\'Valerius\',61), (\'Maia\',25);\n\nINSERT INTO customer VALUES \n(\'Thanasis\',48), (\'Valerius\',61), (\'Brion\',51);\n\nORDER BY and LIMIT\n------------------\n\nTo use ORDER BY or limit LIMIT in subqueries both must be used.. For example:\n\nSELECT * FROM staff WHERE name IN (SELECT name FROM customer ORDER BY name);\n+----------+------+\n| name     | age  |\n+----------+------+\n| Valerius |   61 |\n+----------+------+\n\nis valid, but\n\nSELECT * FROM staff WHERE name IN (SELECT NAME FROM customer ORDER BY name\nLIMIT 1);\nERROR 1235 (42000): This version of MariaDB doesn\'t \n yet support \'LIMIT & IN/ALL/ANY/SOME subquery\'\n\nis not.\n\nModifying and Selecting from the Same Table\n-------------------------------------------\n\nIt\'s not possible to both modify and select from the same table in a subquery.\nFor example:\n\nDELETE FROM staff WHERE name = (SELECT name FROM staff WHERE age=61);\nERROR 1093 (HY000): Table \'staff\' is specified twice, both \n as a target for \'DELETE\' and as a separate source for data\n\nRow Comparison Operations\n-------------------------\n\nThere is only partial support for row comparison operations. The expression in\n\nexpr op {ALL|ANY|SOME} subquery,\n\nmust be scalar and the subquery can only return a single column.\n\nHowever, because of the way IN is implemented (it is rewritten as a sequence\nof = comparisons and AND), the expression in\n\nexpression [NOT] IN subquery\n\nis permitted to be an n-tuple and the subquery can return rows of n-tuples.\n\nFor example:\n\nSELECT * FROM staff WHERE (name,age) NOT IN (\n SELECT name,age FROM customer WHERE age >=51]\n);\n+--------+------+\n| name   | age  |\n+--------+------+\n| Bilhah |   37 |\n| Maia   |   25 |\n+--------+------+\n\nis permitted, but\n\nSELECT * FROM staff WHERE (name,age) = ALL (\n SELECT name,age FROM customer WHERE age >=51\n);\nERROR 1241 (21000): Operand should contain 1 column(s)\n\nis not.\n\nCorrelated Subqueries\n---------------------\n\nSubqueries in the FROM clause cannot be correlated subqueries. They cannot be\nevaluated for each row of the outer query since they are evaluated to produce\na result set during when the query is executed.\n\nStored Functions\n----------------\n\nA subquery can refer to a stored function which modifies data. This is an\nextension to the SQL standard, but can result in indeterminate outcomes. For\nexample, take:\n\nSELECT ... WHERE x IN (SELECT f() ...);\n\nwhere f() inserts rows. The function f() could be executed a different number\nof times depending on how the optimizer chooses to handle the query.\n\nThis sort of construct is therefore not safe to use in replication that is not\nrow-based, as there could be different results on the master and the slave.\n\nURL: https://mariadb.com/kb/en/subquery-limitations/','','https://mariadb.com/kb/en/subquery-limitations/'),
(433,'Precedence Control in Table Operations',27,'MariaDB starting with 10.4.0\n----------------------------\nBeginning in MariaDB 10.4, you can control the ordering of execution on table\noperations using parentheses.\n\nSyntax\n------\n\n(  expression )\n[ORDER BY [column[, column...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nUsing parentheses in your SQL allows you to control the order of execution for\nSELECT statements and Table Value Constructor, including UNION, EXCEPT, and\nINTERSECT operations. MariaDB executes the parenthetical expression before the\nrest of the statement. You can then use ORDER BY and LIMIT clauses the further\norganize the result-set.\n\nNote: In practice, the Optimizer may rearrange the exact order in which\nMariaDB executes different parts of the statement. When it calculates the\nresult-set, however, it returns values as though the parenthetical expression\nwere executed first.\n\nExample\n-------\n\nCREATE TABLE test.t1 (num INT);\n\nINSERT INTO test.t1 VALUES (1),(2),(3);\n\n(SELECT * FROM test.t1 \n UNION \n VALUES (10)) \nINTERSECT \nVALUES (1),(3),(10),(11);\n+------+\n| num  |\n+------+\n|    1 |\n|    3 |\n|   10 |\n+------+\n\n((SELECT * FROM test.t1 \n UNION\n VALUES (10))\n INTERSECT \n VALUES (1),(3),(10),(11)) \nORDER BY 1 DESC;\n+------+\n| num  |\n+------+\n|   10 |\n|    3 |\n|    1 |\n+------+\n\nURL: https://mariadb.com/kb/en/precedence-control-in-table-operations/','','https://mariadb.com/kb/en/precedence-control-in-table-operations/'),
(438,'Non-Recursive Common Table Expressions Overview',27,'Common Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. There are two kinds of CTEs:\nNon-Recursive, which this article covers; and Recursive.\n\nNon-Recursive CTEs\n------------------\n\nThe WITH keyword signifies a CTE. It is given a name, followed by a body (the\nmain query) as follows:\n\nCTEs are similar to derived tables. For example\n\nWITH engineers AS \n ( SELECT * FROM employees\n  WHERE dept = \'Engineering\' )\n\nSELECT * FROM engineers\nWHERE ...\n\nSELECT * FROM\n ( SELECT * FROM employees\n  WHERE dept = \'Engineering\' ) AS engineers\nWHERE\n...\n\nA non-recursive CTE is basically a query-local VIEW. There are several\nadvantages and caveats to them. The syntax is more readable than nested FROM\n(SELECT ...). A CTE can refer to another and it can be referenced from\nmultiple places.\n\nA CTE referencing Another CTE\n-----------------------------\n\nUsing this format makes for a more readable SQL than a nested FROM(SELECT ...)\nclause. Below is an example of this:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') ),\neu_engineers AS ( SELECT * FROM engineers WHERE country IN(\'NL\',...) )\nSELECT\n...\nFROM eu_engineers;\n\nMultiple Uses of a CTE\n----------------------\n\nThis can be an \'anti-self join\', for example:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') )\n\nSELECT * FROM engineers E1\nWHERE NOT EXISTS\n (SELECT 1 FROM engineers E2\n  WHERE E2.country=E1.country\n  AND E2.name <> E1.name );\n\nOr, for year-over-year comparisons, for example:\n\nWITH sales_product_year AS (\nSELECT product, YEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year )\n\nSELECT *\nFROM sales_product_year CUR,\nsales_product_year PREV,\nWHERE CUR.product=PREV.product \nAND  CUR.year=PREV.year + 1 \nAND CUR.total_amt > PREV.total_amt\n\nAnother use is to compare individuals against their group. Below is an example\nof how this might be executed:\n\nWITH sales_product_year AS (\nSELECT product,\nYEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year\n)\n\nSELECT * \nFROM sales_product_year S1\nWHERE\ntotal_amt > \n  (SELECT 0.1 * SUM(total_amt)\n  FROM sales_product_year S2\n  WHERE S2.year = S1.year)\n\nURL: https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/'),
(430,'UNION',27,'UNION is used to combine the results from multiple SELECT statements into a\nsingle result set.\n\nSyntax\n------\n\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nUNION is used to combine the results from multiple SELECT statements into a\nsingle result set.\n\nThe column names from the first SELECT statement are used as the column names\nfor the results returned. Selected columns listed in corresponding positions\nof each SELECT statement should have the same data type. (For example, the\nfirst column selected by the first statement should have the same type as the\nfirst column selected by the other statements.)\n\nIf they don\'t, the type and length of the columns in the result take into\naccount the values returned by all of the SELECTs, so there is no need for\nexplicit casting. Note that currently this is not the case for recursive CTEs\n- see MDEV-12325.\n\nTable names can be specified as db_name.tbl_name. This permits writing UNIONs\nwhich involve multiple databases. See Identifier Qualifiers for syntax details.\n\nUNION queries cannot be used with aggregate functions.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nALL/DISTINCT\n------------\n\nThe ALL keyword causes duplicate rows to be preserved. The DISTINCT keyword\n(the default if the keyword is omitted) causes duplicate rows to be removed by\nthe results.\n\nUNION ALL and UNION DISTINCT can both be present in a query. In this case,\nUNION DISTINCT will override any UNION ALLs to its left.\n\nMariaDB starting with 10.1.1\n----------------------------\nUntil MariaDB 10.1.1, all UNION ALL statements required the server to create a\ntemporary table. Since MariaDB 10.1.1, the server can in most cases execute\nUNION ALL without creating a temporary table, improving performance (see\nMDEV-334).\n\nORDER BY and LIMIT\n------------------\n\nIndividual SELECTs can contain their own ORDER BY and LIMIT clauses. In this\ncase, the individual queries need to be wrapped between parentheses. However,\nthis does not affect the order of the UNION, so they only are useful to limit\nthe record read by one SELECT.\n\nThe UNION can have global ORDER BY and LIMIT clauses, which affect the whole\nresultset. If the columns retrieved by individual SELECT statements have an\nalias (AS), the ORDER BY must use that alias, not the real column names.\n\nHIGH_PRIORITY\n-------------\n\nSpecifying a query as HIGH_PRIORITY will not work inside a UNION. If applied\nto the first SELECT, it will be ignored. Applying to a later SELECT results in\na syntax error:\n\nERROR 1234 (42000): Incorrect usage/placement of \'HIGH_PRIORITY\'\n\nSELECT ... INTO ...\n-------------------\n\nIndividual SELECTs cannot be written INTO DUMPFILE or INTO OUTFILE. If the\nlast SELECT statement specifies INTO DUMPFILE or INTO OUTFILE, the entire\nresult of the UNION will be written. Placing the clause after any other SELECT\nwill result in a syntax error.\n\nIf the result is a single row, SELECT ... INTO @var_name can also be used.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nExamples\n--------\n\nUNION between tables having different column names:\n\n(SELECT e_name AS name, email FROM employees)\nUNION\n(SELECT c_name AS name, email FROM customers);\n\nSpecifying the UNION\'s global order and limiting total rows:\n\n(SELECT name, email FROM employees)\nUNION\n(SELECT name, email FROM customers)\nORDER BY name LIMIT 10;\n\nAdding a constant row:\n\n(SELECT \'John Doe\' AS name, \'john.doe@example.net\' AS email)\nUNION\n(SELECT name, email FROM customers);\n\nDiffering types:\n\nSELECT CAST(\'x\' AS CHAR(1)) UNION SELECT REPEAT(\'y\',4);\n+----------------------+\n| CAST(\'x\' AS CHAR(1)) |\n+----------------------+\n| x                    |\n| yyyy                 |\n+----------------------+\n\nReturning the results in order of each individual SELECT by use of a sort\ncolumn:\n\n(SELECT 1 AS sort_column, e_name AS name, email FROM employees)\nUNION\n(SELECT 2, c_name AS name, email FROM customers) ORDER BY sort_column;\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    1 |\n|    6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    6 |\n+------+\n\nURL: https://mariadb.com/kb/en/union/','','https://mariadb.com/kb/en/union/'),
(431,'EXCEPT',27,'The result of EXCEPT is all records of the left SELECT result set except\nrecords which are in right SELECT result set, i.e. it is subtraction of two\nresult sets. From MariaDB 10.6.1, MINUS is a synonym when SQL_MODE=ORACLE is\nset.\n\nSyntax\n------\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) \n SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) \n SELECT ...]\n[ORDER BY [{col_name | expr | position} [ASC | DESC] \n [, {col_name | expr | position} [ASC | DESC] ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}\n| OFFSET start { ROW | ROWS }\n| FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } ]\n\nPlease note:\n\n* Brackets for explicit operation precedence are not supported; use a subquery\nin the FROM clause as a workaround).\n\nDescription\n-----------\n\nMariaDB has supported EXCEPT and INTERSECT in addition to UNION since MariaDB\n10.3.\n\nThe queries before and after EXCEPT must be SELECT or VALUES statements.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\nNote that the alternative SELECT ... OFFSET ... FETCH syntax is only\nsupported. This allows us to use the WITH TIES clause.\n\nEXCEPT implicitly supposes a DISTINCT operation.\n\nThe result of EXCEPT is all records of the left SELECT result except records\nwhich are in right SELECT result set, i.e. it is subtraction of two result\nsets.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nEXCEPT ALL and EXCEPT DISTINCT were introduced in MariaDB 10.5.0. The ALL\noperator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are not employees:\n\n(SELECT e_name AS name, email FROM customers)\nEXCEPT\n(SELECT c_name AS name, email FROM employees);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) EXCEPT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) EXCEPT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n+------+\n\nHere is an example that makes use of the SEQUENCE storage engine and the\nVALUES statement, to generate a numeric sequence and remove some arbitrary\nnumbers from it:\n\n(SELECT seq FROM seq_1_to_10) EXCEPT VALUES (2), (3), (4);\n+-----+\n| seq |\n+-----+\n|   1 |\n|   5 |\n|   6 |\n|   7 |\n|   8 |\n|   9 |\n|  10 |\n+-----+\n\nURL: https://mariadb.com/kb/en/except/','','https://mariadb.com/kb/en/except/'),
(441,'SELECT INTO OUTFILE',27,'Syntax\n------\n\nSELECT ... INTO OUTFILE \'file_name\'\n    [CHARACTER SET charset_name]\n    [export_options]\n\nexport_options:\n  [{FIELDS | COLUMNS}\n    [TERMINATED BY \'string\']\n    [[OPTIONALLY] ENCLOSED BY \'char\']\n    [ESCAPED BY \'char\']\n  ]\n  [LINES\n    [STARTING BY \'string\']\n    [TERMINATED BY \'string\']\n  ]\n\nDescription\n-----------\n\nSELECT INTO OUTFILE writes the resulting rows to a file, and allows the use of\ncolumn and row terminators to specify a particular output format. The default\nis to terminate fields with tabs (\\t) and lines with newlines (\\n).\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nThe LOAD DATA INFILE statement complements SELECT INTO OUTFILE.\n\nCharacter-sets\n--------------\n\nThe CHARACTER SET clause specifies the character set in which the results are\nto be written. Without the clause, no conversion takes place (the binary\ncharacter set). In this case, if there are multiple character sets, the output\nwill contain these too, and may not easily be able to be reloaded.\n\nIn cases where you have two servers using different character-sets, using\nSELECT INTO OUTFILE to transfer data from one to the other can have unexpected\nresults. To ensure that MariaDB correctly interprets the escape sequences, use\nthe CHARACTER SET clause on both the SELECT INTO OUTFILE statement and the\nsubsequent LOAD DATA INFILE statement.\n\nExample\n-------\n\nThe following example produces a file in the CSV format:\n\nSELECT customer_id, firstname, surname from customer\n INTO OUTFILE \'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\"\'\n LINES TERMINATED BY \'\\n\';\n\nThe following ANSI syntax is also supported for simple SELECT without UNION\n\nSELECT customer_id, firstname, surname INTO OUTFILE \'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\"\'\n LINES TERMINATED BY \'\\n\'\n FROM customers;\n\nIf you want to use the ANSI syntax with UNION or similar construct you have to\nuse the syntax:\n\nSELECT  * INTO OUTFILE \"/tmp/skr3\" FROM (SELECT * FROM t1 UNION SELECT * FROM\nt1);\n\nURL: https://mariadb.com/kb/en/select-into-outfile/','','https://mariadb.com/kb/en/select-into-outfile/'),
(432,'INTERSECT',27,'MariaDB starting with 10.3.0\n----------------------------\nINTERSECT was introduced in MariaDB 10.3.0.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nSyntax\n------\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nMariaDB has supported INTERSECT (as well as EXCEPT) in addition to UNION since\nMariaDB 10.3.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\n\nINTERSECT implicitly supposes a DISTINCT operation.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nINTERSECT has higher precedence than UNION and EXCEPT (unless running running\nin Oracle mode, in which case all three have the same precedence). If possible\nit will be executed linearly but if not it will be translated to a subquery in\nthe FROM clause:\n\n(select a,b from t1)\nunion\n(select c,d from t2)\nintersect\n(select e,f from t3)\nunion\n(select 4,4);\n\nwill be translated to:\n\n(select a,b from t1)\nunion\nselect c,d from\n ((select c,d from t2)\n intersect\n (select e,f from t3)) dummy_subselect\nunion\n(select 4,4)\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nINTERSECT ALL and INTERSECT DISTINCT were introduced in MariaDB 10.5.0. The\nALL operator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are employees:\n\n(SELECT e_name AS name, email FROM employees)\nINTERSECT\n(SELECT c_name AS name, email FROM customers);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n|    3 |\n|    3 |\n|    3 |\n|    3 |\n|    4 |\n|    5 |\n|    6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i    |\n+------+\n|    3 |\n|    3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a    |\n+------+\n|    1 |\n|    6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    6 |\n+------+\n\nURL: https://mariadb.com/kb/en/intersect/','','https://mariadb.com/kb/en/intersect/'),
(442,'SELECT INTO DUMPFILE',27,'Syntax\n------\n\nSELECT ... INTO DUMPFILE \'file_path\'\n\nDescription\n-----------\n\nSELECT ... INTO DUMPFILE is a SELECT clause which writes the resultset into a\nsingle unformatted row, without any separators, in a file. The results will\nnot be returned to the client.\n\nfile_path can be an absolute path, or a relative path starting from the data\ndirectory. It can only be specified as a string literal, not as a variable.\nHowever, the statement can be dynamically composed and executed as a prepared\nstatement to work around this limitation.\n\nThis statement is binary-safe and so is particularly useful for writing BLOB\nvalues to file. It can be used, for example, to copy an image or an audio\ndocument from the database to a file. SELECT ... INTO FILE can be used to save\na text file.\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nExample\n-------\n\nSELECT _utf8\'Hello world!\' INTO DUMPFILE \'/tmp/world\';\n\nSELECT LOAD_FILE(\'/tmp/world\') AS world;\n+--------------+\n| world        |\n+--------------+\n| Hello world! |\n+--------------+\n\nURL: https://mariadb.com/kb/en/select-into-dumpfile/','','https://mariadb.com/kb/en/select-into-dumpfile/'),
(434,'LIMIT',27,'Description\n-----------\n\nUse the LIMIT clause to restrict the number of returned rows. When you use a\nsingle integer n with LIMIT, the first n rows will be returned. Use the ORDER\nBY clause to control which rows come first. You can also select a number of\nrows after an offset using either of the following:\n\nLIMIT offset, row_count\nLIMIT row_count OFFSET offset\n\nWhen you provide an offset m with a limit n, the first m rows will be ignored,\nand the following n rows will be returned.\n\nExecuting an UPDATE with the LIMIT clause is not safe for replication. LIMIT 0\nis an exception to this rule (see MDEV-6170).\n\nThere is a LIMIT ROWS EXAMINED optimization which provides the means to\nterminate the execution of SELECT statements which examine too many rows, and\nthus use too many resources. See LIMIT ROWS EXAMINED.\n\nMulti-Table Updates\n-------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use LIMIT (or ORDER BY) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nGROUP_CONCAT\n------------\n\nMariaDB starting with 10.3.2\n----------------------------\nStarting from MariaDB 10.3.3, it is possible to use LIMIT with GROUP_CONCAT().\n\nExamples\n--------\n\nCREATE TABLE members (name VARCHAR(20));\nINSERT INTO members VALUES(\'Jagdish\'),(\'Kenny\'),(\'Rokurou\'),(\'Immaculada\');\n\nSELECT * FROM members;\n+------------+\n| name       |\n+------------+\n| Jagdish    |\n| Kenny      |\n| Rokurou    |\n| Immaculada |\n+------------+\n\nSelect the first two names (no ordering specified):\n\nSELECT * FROM members LIMIT 2;\n+---------+\n| name    |\n+---------+\n| Jagdish |\n| Kenny   |\n+---------+\n\nAll the names in alphabetical order:\n\nSELECT * FROM members ORDER BY name;\n+------------+\n| name       |\n+------------+\n| Immaculada |\n| Jagdish    |\n| Kenny      |\n| Rokurou    |\n+------------+\n\nThe first two names, ordered alphabetically:\n\nSELECT * FROM members ORDER BY name LIMIT 2;\n+------------+\n| name       |\n+------------+\n| Immaculada |\n| Jagdish    |\n+------------+\n\nThe third name, ordered alphabetically (the first name would be offset zero,\nso the third is offset two):\n\nSELECT * FROM members ORDER BY name LIMIT 2,1;\n+-------+\n| name  |\n+-------+\n| Kenny |\n+-------+\n\nFrom MariaDB 10.3.2, LIMIT can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id  >= 1)\n  ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |  100 |\n|          2 |  100 |\n|          3 |   98 |\n|          4 |   98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |    5 |\n|          2 |    5 |\n|          3 |    7 |\n|          4 |    7 |\n+------------+------+\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc\nDESC),\",\",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC),\",\",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3                                                               |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3                                                |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/limit/','','https://mariadb.com/kb/en/limit/'),
(443,'FOR UPDATE',27,'InnoDB supports row-level locking. Selected rows can be locked using LOCK IN\nSHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the rows read\nby the query, and it will be released when the current transaction is\ncommitted.\n\nThe FOR UPDATE clause of SELECT applies only when autocommit is set to 0 or\nthe SELECT is enclosed in a transaction. A lock is acquired on the rows, and\nother transactions are prevented from writing the rows, acquire locks, and\nfrom reading them (unless their isolation level is READ UNCOMMITTED).\n\nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have\nno effect.\n\nIf the isolation level is set to SERIALIZABLE, all plain SELECT statements are\nconverted to SELECT ... LOCK IN SHARE MODE.\n\nExample\n-------\n\nSELECT * FROM trans WHERE period=2001 FOR UPDATE;\n\nURL: https://mariadb.com/kb/en/for-update/','','https://mariadb.com/kb/en/for-update/'),
(435,'ORDER BY',27,'Description\n-----------\n\nUse the ORDER BY clause to order a resultset, such as that are returned from a\nSELECT statement. You can specify just a column or use any expression with\nfunctions. If you are using the GROUP BY clause, you can use grouping\nfunctions in ORDER BY. Ordering is done after grouping.\n\nYou can use multiple ordering expressions, separated by commas. Rows will be\nsorted by the first expression, then by the second expression if they have the\nsame value for the first, and so on.\n\nYou can use the keywords ASC and DESC after each ordering expression to force\nthat ordering to be ascending or descending, respectively. Ordering is\nascending by default.\n\nYou can also use a single integer as the ordering expression. If you use an\ninteger n, the results will be ordered by the nth column in the select\nexpression.\n\nWhen string values are compared, they are compared as if by the STRCMP\nfunction. STRCMP ignores trailing whitespace and may normalize characters and\nignore case, depending on the collation in use.\n\nDuplicated entries in the ORDER BY clause are removed.\n\nORDER BY can also be used to order the activities of a DELETE or UPDATE\nstatement (usually with the LIMIT clause).\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use ORDER BY (or LIMIT) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nMariaDB starting with 10.5\n--------------------------\nFrom MariaDB 10.5, MariaDB allows packed sort keys and values of non-sorted\nfields in the sort buffer. This can make filesort temporary files much smaller\nwhen VARCHAR, CHAR or BLOBs are used, notably speeding up some ORDER BY sorts.\n\nExamples\n--------\n\nCREATE TABLE seq (i INT, x VARCHAR(1));\nINSERT INTO seq VALUES (1,\'a\'), (2,\'b\'), (3,\'b\'), (4,\'f\'), (5,\'e\');\n\nSELECT * FROM seq ORDER BY i;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | b    |\n|    4 | f    |\n|    5 | e    |\n+------+------+\n\nSELECT * FROM seq ORDER BY i DESC;\n+------+------+\n| i    | x    |\n+------+------+\n|    5 | e    |\n|    4 | f    |\n|    3 | b    |\n|    2 | b    |\n|    1 | a    |\n+------+------+\n\nSELECT * FROM seq ORDER BY x,i;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | b    |\n|    5 | e    |\n|    4 | f    |\n+------+------+\n\nORDER BY in an UPDATE statement, in conjunction with LIMIT:\n\nUPDATE seq SET x=\'z\' WHERE x=\'b\' ORDER BY i DESC LIMIT 1;\n\nSELECT * FROM seq;\n+------+------+\n| i    | x    |\n+------+------+\n|    1 | a    |\n|    2 | b    |\n|    3 | z    |\n|    4 | f    |\n|    5 | e    |\n+------+------+\n\nFrom MariaDB 10.3.2, ORDER BY can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id  >= 1)\n  ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |  100 |\n|          2 |  100 |\n|          3 |   98 |\n|          4 |   98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty  |\n+------------+------+\n|          1 |    5 |\n|          2 |    5 |\n|          3 |    7 |\n|          4 |    7 |\n+------------+------+\n\nURL: https://mariadb.com/kb/en/order-by/','','https://mariadb.com/kb/en/order-by/'),
(445,'Optimizer Hints',27,'Optimizer hints\n---------------\n\nThere are some options available in SELECT to affect the execution plan. These\nare known as optimizer hints.\n\nHIGH PRIORITY\n-------------\n\nHIGH_PRIORITY gives the statement a higher priority. If the table is locked,\nhigh priority SELECTs will be executed as soon as the lock is released, even\nif other statements are queued. HIGH_PRIORITY applies only if the storage\nengine only supports table-level locking (MyISAM, MEMORY, MERGE). See\nHIGH_PRIORITY and LOW_PRIORITY clauses for details.\n\nSQL_CACHE / SQL_NO_CACHE\n------------------------\n\nIf the query_cache_type system variable is set to 2 or DEMAND, and the current\nstatement is cacheable, SQL_CACHE causes the query to be cached and\nSQL_NO_CACHE causes the query not to be cached. For UNIONs, SQL_CACHE or\nSQL_NO_CACHE should be specified for the first query. See also The Query Cache\nfor more detail and a list of the types of statements that aren\'t cacheable.\n\nSQL_BUFFER_RESULT\n-----------------\n\nSQL_BUFFER_RESULT forces the optimizer to use a temporary table to process the\nresult. This is useful to free locks as soon as possible.\n\nSQL_SMALL_RESULT / SQL_BIG_RESULT\n---------------------------------\n\nSQL_SMALL_RESULT and SQL_BIG_RESULT tell the optimizer whether the result is\nvery big or not. Usually, GROUP BY and DISTINCT operations are performed using\na temporary table. Only if the result is very big, using a temporary table is\nnot convenient. The optimizer automatically knows if the result is too big,\nbut you can force the optimizer to use a temporary table with\nSQL_SMALL_RESULT, or avoid the temporary table using SQL_BIG_RESULT.\n\nSTRAIGHT_JOIN\n-------------\n\nSTRAIGHT_JOIN applies to the JOIN queries, and tells the optimizer that the\ntables must be read in the order they appear in the SELECT. For const and\nsystem table this options is sometimes ignored.\n\nSQL_CALC_FOUND_ROWS\n-------------------\n\nSQL_CALC_FOUND_ROWS is only applied when using the LIMIT clause. If this\noption is used, MariaDB will count how many rows would match the query,\nwithout the LIMIT clause. That number can be retrieved in the next query,\nusing FOUND_ROWS().\n\nUSE/FORCE/IGNORE INDEX\n----------------------\n\nUSE INDEX, FORCE INDEX and IGNORE INDEX constrain the query planning to a\nspecific index.\n\nFor further information about some of these options, see How to force query\nplans.\n\nURL: https://mariadb.com/kb/en/optimizer-hints/','','https://mariadb.com/kb/en/optimizer-hints/'),
(436,'GROUP BY',27,'Use the GROUP BY clause in a SELECT statement to group rows together that have\nthe same value in one or more column, or the same computed value using\nexpressions with any functions and operators except grouping functions. When\nyou use a GROUP BY clause, you will get a single result row for each group of\nrows that have the same value for the expression given in GROUP BY.\n\nWhen grouping rows, grouping values are compared as if by the = operator. For\nstring values, the = operator ignores trailing whitespace and may normalize\ncharacters and ignore case, depending on the collation in use.\n\nYou can use any of the grouping functions in your select expression. Their\nvalues will be calculated based on all the rows that have been grouped\ntogether for each result row. If you select a non-grouped column or a value\ncomputed from a non-grouped column, it is undefined which row the returned\nvalue is taken from. This is not permitted if the ONLY_FULL_GROUP_BY SQL_MODE\nis used.\n\nYou can use multiple expressions in the GROUP BY clause, separated by commas.\nRows are grouped together if they match on each of the expressions.\n\nYou can also use a single integer as the grouping expression. If you use an\ninteger n, the results will be grouped by the nth column in the select\nexpression.\n\nThe WHERE clause is applied before the GROUP BY clause. It filters\nnon-aggregated rows before the rows are grouped together. To filter grouped\nrows based on aggregate values, use the HAVING clause. The HAVING clause takes\nany expression and evaluates it as a boolean, just like the WHERE clause. You\ncan use grouping functions in the HAVING clause. As with the select\nexpression, if you reference non-grouped columns in the HAVING clause, the\nbehavior is undefined.\n\nBy default, if a GROUP BY clause is present, the rows in the output will be\nsorted by the expressions used in the GROUP BY. You can also specify ASC or\nDESC (ascending, descending) after those expressions, like in ORDER BY. The\ndefault is ASC.\n\nIf you want the rows to be sorted by another field, you can add an explicit\nORDER BY. If you don\'t want the result to be ordered, you can add ORDER BY\nNULL.\n\nWITH ROLLUP\n-----------\n\nThe WITH ROLLUP modifer adds extra rows to the resultset that represent\nsuper-aggregate summaries. For a full description with examples, see SELECT\nWITH ROLLUP.\n\nGROUP BY Examples\n-----------------\n\nConsider the following table that records how many times each user has played\nand won a game:\n\nCREATE TABLE plays (name VARCHAR(16), plays INT, wins INT);\nINSERT INTO plays VALUES \n (\"John\", 20, 5),\n (\"Robert\", 22, 8),\n (\"Wanda\", 32, 8),\n (\"Susan\", 17, 3);\n\nGet a list of win counts along with a count:\n\nSELECT wins, COUNT(*) FROM plays GROUP BY wins;\n+------+----------+\n| wins | COUNT(*) |\n+------+----------+\n|    3 |        1 |\n|    5 |        1 |\n|    8 |        2 |\n+------+----------+\n3 rows in set (0.00 sec)\n\nThe GROUP BY expression can be a computed value, and can refer back to an\nidentifer specified with AS. Get a list of win averages along with a count:\n\nSELECT (wins / plays) AS winavg, COUNT(*) FROM plays GROUP BY winavg;\n+--------+----------+\n| winavg | COUNT(*) |\n+--------+----------+\n| 0.1765 |        1 |\n| 0.2500 |        2 |\n| 0.3636 |        1 |\n+--------+----------+\n3 rows in set (0.00 sec)\n\nYou can use any grouping function in the select expression. For each win\naverage as above, get a list of the average play count taken to get that\naverage:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.1765 |    17.0000 |\n| 0.2500 |    26.0000 |\n| 0.3636 |    22.0000 |\n+--------+------------+\n3 rows in set (0.00 sec)\n\nYou can filter on aggregate information using the HAVING clause. The HAVING\nclause is applied after GROUP BY and allows you to filter on aggregate data\nthat is not available to the WHERE clause. Restrict the above example to\nresults that involve an average number of plays over 20:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg HAVING AVG(plays) > 20;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.2500 |    26.0000 |\n| 0.3636 |    22.0000 |\n+--------+------------+\n2 rows in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/group-by/','','https://mariadb.com/kb/en/group-by/'),
(448,'SELECT ... OFFSET ... FETCH',27,'MariaDB starting with 10.6.0\n----------------------------\nSELECT ... OFFSET ... FETCH was introduced in MariaDB 10.6.\n\nSyntax\n------\n\nOFFSET start { ROW | ROWS }\nFETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }\n\nDescription\n-----------\n\nThe OFFSET clause allows one to return only those elements of a resultset that\ncome after a specified offset. The FETCH clause specifies the number of rows\nto return, while ONLY or WITH TIES specifies whether or not to also return any\nfurther results that tie for last place according to the ordered resultset.\n\nEither the singular ROW or the plural ROWS can be used after the OFFSET and\nFETCH clauses; the choice has no impact on the results.\n\nIn the case of WITH TIES, an ORDER BY clause is required, otherwise an ERROR\nwill be returned.\n\nSELECT i FROM t1 FETCH FIRST 2 ROWS WITH TIES;\nERROR 4180 (HY000): FETCH ... WITH TIES requires ORDER BY clause to be present\n\nExamples\n--------\n\nGiven a table with 6 rows:\n\nCREATE OR REPLACE TABLE t1 (i INT);\nINSERT INTO t1 VALUES (1),(2),(3),(4), (4), (5);\nSELECT i FROM t1 ORDER BY i ASC;\n+------+\n| i    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n|    4 |\n|    4 |\n|    5 |\n+------+\n\nOFFSET 2 allows one to skip the first two results.\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 2 ROWS;\n+------+\n| i    |\n+------+\n|    3 |\n|    4 |\n|    4 |\n|    5 |\n+------+\n\nFETCH FIRST 3 ROWS ONLY limits the results to three rows only\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 1 ROWS FETCH FIRST 3 ROWS ONLY;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n+------+\n\nThe same outcome can also be achieved with the LIMIT clause:\n\nSELECT i FROM t1 ORDER BY i ASC LIMIT 3 OFFSET 1;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n+------+\n\nWITH TIES ensures the tied result 4 is also returned.\n\nSELECT i FROM t1 ORDER BY i ASC OFFSET 1 ROWS FETCH FIRST 3 ROWS WITH TIES;\n+------+\n| i    |\n+------+\n|    2 |\n|    3 |\n|    4 |\n|    4 |\n+------+\n\nURL: https://mariadb.com/kb/en/select-offset-fetch/','','https://mariadb.com/kb/en/select-offset-fetch/'),
(437,'WITH',27,'MariaDB starting with 10.2.1\n----------------------------\nCommon Table Expressions were introduced in MariaDB 10.2.1.\n\nSyntax\n------\n\nWITH [RECURSIVE] table_reference [(columns_list)] AS  (\n SELECT ...\n)\n[CYCLE cycle_column_list RESTRICT]\nSELECT ...\n\nDescription\n-----------\n\nThe WITH keyword signifies a Common Table Expression (CTE). It allows you to\nrefer to a subquery expression many times in a query, as if having a temporary\ntable that only exists for the duration of a query.\n\nThere are two kinds of CTEs:\n\n* Non-Recursive\n* Recursive (signified by the RECURSIVE keyword, supported since MariaDB\n10.2.2)\n\nYou can use table_reference as any normal table in the external SELECT part.\nYou can also use WITH in subqueries, as well as with EXPLAIN and SELECT.\n\nPoorly-formed recursive CTEs can in theory cause infinite loops. The\nmax_recursive_iterations system variable limits the number of recursions.\n\nCYCLE ... RESTRICT\n------------------\n\nMariaDB starting with 10.5.2\n----------------------------\nThe CYCLE clause enables CTE cycle detection, avoiding excessive or infinite\nloops, MariaDB supports a relaxed, non-standard grammar.\n\nThe SQL Standard permits a CYCLE clause, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list>\nSET <cycle mark column> TO <cycle mark value> DEFAULT <non-cycle mark value>\nUSING <path column>\n\nwhere all clauses are mandatory.\n\nMariaDB does not support this, but from 10.5.2 permits a non-standard relaxed\ngrammar, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list> RESTRICT\n\nWith the use of CYCLE ... RESTRICT it makes no difference whether the CTE uses\nUNION ALL or UNION DISTINCT anymore. UNION ALL means \"all rows, but without\ncycles\", which is exactly what the CYCLE clause enables. And UNION DISTINCT\nmeans all rows should be different, which, again, is what will happen — as\nuniqueness is enforced over a subset of columns, complete rows will\nautomatically all be different.\n\nExamples\n--------\n\nBelow is an example with the WITH at the top level:\n\nWITH t AS (SELECT a FROM t1 WHERE b >= \'c\') \n SELECT * FROM t2, t WHERE t2.c = t.a;\n\nThe example below uses WITH in a subquery:\n\nSELECT t1.a, t1.b FROM t1, t2\n WHERE t1.a > t2.c\n  AND t2.c IN(WITH t AS (SELECT * FROM t1 WHERE t1.a < 5)\n        SELECT t2.c FROM t2, t WHERE t2.c = t.a);\n\nBelow is an example of a Recursive CTE:\n\nWITH RECURSIVE ancestors AS \n ( SELECT * FROM folks\n WHERE name=\"Alex\"\n UNION\n SELECT f.*\n FROM folks AS f, ancestors AS a\n WHERE f.id = a.father OR f.id = a.mother )\nSELECT * FROM ancestors;\n\nTake the following structure, and data,\n\nCREATE TABLE t1 (from_ int, to_ int);\nINSERT INTO t1 VALUES (1,2), (1,100), (2,3), (3,4), (4,1);\nSELECT * FROM t1;\n+-------+------+\n| from_ | to_  |\n+-------+------+\n|     1 |    2 |\n|     1 |  100 |\n|     2 |    3 |\n|     3 |    4 |\n|     4 |    1 |\n+-------+------+\n\nGiven the above, the following query would theoretically result in an infinite\nloop due to the last record in t1 (note that max_recursive_iterations is set\nto 10 for the purposes of this example, to avoid the excessive number of\ncycles):\n\nSET max_recursive_iterations=10;\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION DISTINCT SELECT depth+1, t1.from_, t1.to_\n  FROM t1, cte  WHERE t1.from_ = cte.to_\n) \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_  |\n+-------+-------+------+\n|     0 |     1 |    1 |\n|     1 |     1 |    2 |\n|     1 |     1 |  100 |\n|     2 |     2 |    3 |\n|     3 |     3 |    4 |\n|     4 |     4 |    1 |\n|     5 |     1 |    2 |\n|     5 |     1 |  100 |\n|     6 |     2 |    3 |\n|     7 |     3 |    4 |\n|     8 |     4 |    1 |\n|     9 |     1 |    2 |\n|     9 |     1 |  100 |\n|    10 |     2 |    3 |\n+-------+-------+------+\n\nHowever, the CYCLE ... RESTRICT clause (from MariaDB 10.5.2) can overcome this:\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION SELECT depth+1, t1.from_, t1.to_\n  FROM t1, cte WHERE t1.from_ = cte.to_\n) \nCYCLE from_, to_ RESTRICT \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_  |\n+-------+-------+------+\n|     0 |     1 |    1 |\n|     1 |     1 |    2 |\n|     1 |     1 |  100 |\n|     2 |     2 |    3 |\n|     3 |     3 |    4 |\n|     4 |     4 |    1 |\n+-------+-------+------+\n\nURL: https://mariadb.com/kb/en/with/','','https://mariadb.com/kb/en/with/'),
(451,'INSERT SELECT',27,'Syntax\n------\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [(col_name,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nDescription\n-----------\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table from one\nor more other tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers). This allows to copy rows between different databases.\n\nIf the new table has a primary key or UNIQUE indexes, you can use IGNORE to\nhandle duplicate key errors during the query. The newer values will not be\ninserted if an identical value already exists.\n\nREPLACE can be used instead of INSERT to prevent duplicates on UNIQUE indexes\nby deleting old values. In that case, ON DUPLICATE KEY UPDATE cannot be used.\n\nINSERT ... SELECT works for tables which already exist. To create a table for\na given resultset, you can use CREATE TABLE ... SELECT.\n\nURL: https://mariadb.com/kb/en/insert-select/','','https://mariadb.com/kb/en/insert-select/'),
(439,'Recursive Common Table Expressions Overview',27,'Common Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. CTEs first appeared in the SQL\nstandard in 1999, and the first implementations began appearing in 2007.\n\nThere are two kinds of CTEs:\n\n* Non-recursive\n* Recursive, which this article covers.\n\nSQL is generally poor at recursive structures.\n\nCTEs permit a query to reference itself. A recursive CTE will repeatedly\nexecute subsets of the data until it obtains the complete result set. This\nmakes it particularly useful for handing hierarchical or tree-structured data.\nmax_recursive_iterations avoids infinite loops.\n\nSyntax example\n--------------\n\nWITH RECURSIVE signifies a recursive CTE. It is given a name, followed by a\nbody (the main query) as follows:\n\nComputation\n-----------\n\nGiven the following structure:\n\nFirst execute the anchor part of the query:\n\nNext, execute the recursive part of the query:\n\nSummary so far\n--------------\n\nwith recursive R as (\n select anchor_data\n union [all]\n select recursive_part\n from R, ...\n)\nselect ...\n\n* Compute anchor_data\n* Compute recursive_part to get the new data\n* if (new data is non-empty) goto 2;\n\nCAST to avoid truncating data\n-----------------------------\n\nAs currently implemented by MariaDB and by the SQL Standard, data may be\ntruncated if not correctly cast. It is necessary to CAST the column to the\ncorrect width if the CTE\'s recursive part produces wider values for a column\nthan the CTE\'s nonrecursive part. Some other DBMS give an error in this\nsituation, and MariaDB\'s behavior may change in future - see MDEV-12325. See\nthe examples below.\n\nExamples\n--------\n\nTransitive closure - determining bus destinations\n-------------------------------------------------\n\nSample data:\n\nCREATE TABLE bus_routes (origin varchar(50), dst varchar(50));\nINSERT INTO bus_routes VALUES \n (\'New York\', \'Boston\'),\n (\'Boston\', \'New York\'),\n (\'New York\', \'Washington\'),\n (\'Washington\', \'Boston\'),\n (\'Washington\', \'Raleigh\');\n\nNow, we want to return the bus destinations with New York as the origin:\n\nWITH RECURSIVE bus_dst as ( \n  SELECT origin as dst FROM bus_routes WHERE origin=\'New York\'\n UNION\n  SELECT bus_routes.dst FROM bus_routes JOIN bus_dst ON bus_dst.dst=\nbus_routes.origin \n) \nSELECT * FROM bus_dst;\n+------------+\n| dst        |\n+------------+\n| New York   |\n| Boston     |\n| Washington |\n| Raleigh    |\n+------------+\n\nThe above example is computed as follows:\n\nFirst, the anchor data is calculated:\n\n* Starting from New York\n* Boston and Washington are added\n\nNext, the recursive part:\n\n* Starting from Boston and then Washington\n* Raleigh is added\n* UNION excludes nodes that are already present.\n\nComputing paths - determining bus routes\n----------------------------------------\n\nThis time, we are trying to get bus routes such as \"New York -> Washington ->\nRaleigh\".\n\nUsing the same sample data as the previous example:\n\nWITH RECURSIVE paths (cur_path, cur_dest) AS (\n  SELECT origin, origin FROM bus_routes WHERE origin=\'New York\'\n UNION\n  SELECT CONCAT(paths.cur_path, \',\', bus_routes.dst), bus_routes.dst\n  FROM paths\n  JOIN bus_routes\n   ON paths.cur_dest = bus_routes.origin AND\n    NOT FIND_IN_SET(bus_routes.dst, paths.cur_path)\n) \nSELECT * FROM paths;\n+-----------------------------+------------+\n| cur_path                    | cur_dest   |\n+-----------------------------+------------+\n| New York                    | New York   |\n| New York,Boston             | Boston     |\n| New York,Washington         | Washington |\n| New York,Washington,Boston  | Boston     |\n| New York,Washington,Raleigh | Raleigh    |\n+-----------------------------+------------+\n\nCAST to avoid data truncation\n-----------------------------\n\nIn the following example, data is truncated because the results are not\nspecifically cast to a wide enough type:\n\nWITH RECURSIVE tbl AS (\n SELECT NULL AS col\n UNION\n SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n)\nSELECT col FROM tbl\n+------+\n| col  |\n+------+\n| NULL |\n|      |\n+------+\n\nExplicitly use CAST to overcome this:\n\nWITH RECURSIVE tbl AS (\n SELECT CAST(NULL AS CHAR(50)) AS col\n UNION SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n)  \nSELECT * FROM tbl;\n+---------------------+\n| col                 |\n+---------------------+\n| NULL                |\n| THIS NEVER SHOWS UP |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/recursive-common-table-expressions-overview/'),
(453,'LOAD XML',27,'Syntax\n------\n\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n  [REPLACE | IGNORE]\n  INTO TABLE [db_name.]tbl_name\n  [CHARACTER SET charset_name]\n  [ROWS IDENTIFIED BY \'<tagname>\']\n  [IGNORE number {LINES | ROWS}]\n  [(column_or_user_var,...)]\n  [SET col_name = expr,...]\n\nDescription\n-----------\n\nThe LOAD XML statement reads data from an XML file into a table. The file_name\nmust be given as a literal string. The tagname in the optional ROWS IDENTIFIED\nBY clause must also be given as a literal string, and must be surrounded by\nangle brackets (< and >).\n\nLOAD XML acts as the complement of running the mariadb client in XML output\nmode (that is, starting the client with the --xml option). To write data from\na table to an XML file, use a command such as the following one from the\nsystem shell:\n\nshell> mariadb --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default, the <row>\nelement is considered to be the equivalent of a database table row; this can\nbe changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\n* Column names as attributes and column values as attribute values:\n\n<row column1=\"value1\" column2=\"value2\" .../>\n\n* Column names as tags and column values as the content of these tags:\n\n<row>\n <column1>value1</column1>\n <column2>value2</column2>\n</row>\n\n* Column names are the name attributes of <field> tags, and values are\n the contents of these tags:\n\n<row>\n <field name=\'column1\'>value1</field>\n <field name=\'column2\'>value2</field>\n</row>\n\nThis is the format used by other tools, such as mariadb-dump.\n\nAll 3 formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it correctly.\nTags are matched based on the tag or attribute name and the column name.\n\nThe following clauses work essentially the same way for LOAD XML as they do\nfor LOAD DATA:\n\n* LOW_PRIORITY or CONCURRENT\n* LOCAL\n* REPLACE or IGNORE\n* CHARACTER SET\n* (column_or_user_var,...)\n* SET\n\nSee LOAD DATA for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first number\nrows in the XML file to be skipped. It is analogous to the LOAD DATA\nstatement\'s IGNORE ... LINES clause.\n\nIf the LOW_PRIORITY keyword is used, insertions are delayed until no other\nclients are reading from the table. The CONCURRENT keyword allows the use of\nconcurrent inserts. These clauses cannot be specified together.\n\nThis statement activates INSERT triggers.\n\nURL: https://mariadb.com/kb/en/load-xml/','','https://mariadb.com/kb/en/load-xml/'),
(440,'SELECT WITH ROLLUP',27,'Syntax\n------\n\nSee SELECT for the full syntax.\n\nDescription\n-----------\n\nThe WITH ROLLUP modifier adds extra rows to the resultset that represent\nsuper-aggregate summaries. The super-aggregated column is represented by a\nNULL value. Multiple aggregates over different columns will be added if there\nare multiple GROUP BY columns.\n\nThe LIMIT clause can be used at the same time, and is applied after the WITH\nROLLUP rows have been added.\n\nWITH ROLLUP cannot be used with ORDER BY. Some sorting is still possible by\nusing ASC or DESC clauses with the GROUP BY column, although the\nsuper-aggregate rows will always be added last.\n\nExamples\n--------\n\nThese examples use the following sample table\n\nCREATE TABLE booksales ( \n country VARCHAR(35), genre ENUM(\'fiction\',\'non-fiction\'), year YEAR, sales\nINT);\n\nINSERT INTO booksales VALUES\n (\'Senegal\',\'fiction\',2014,12234), (\'Senegal\',\'fiction\',2015,15647),\n (\'Senegal\',\'non-fiction\',2014,64980), (\'Senegal\',\'non-fiction\',2015,78901),\n (\'Paraguay\',\'fiction\',2014,87970), (\'Paraguay\',\'fiction\',2015,76940),\n (\'Paraguay\',\'non-fiction\',2014,8760), (\'Paraguay\',\'non-fiction\',2015,9030);\n\nThe addition of the WITH ROLLUP modifier in this example adds an extra row\nthat aggregates both years:\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 |     173944 |\n| 2015 |     180518 |\n+------+------------+\n2 rows in set (0.08 sec)\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year WITH ROLLUP;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 |     173944 |\n| 2015 |     180518 |\n| NULL |     354462 |\n+------+------------+\n\nIn the following example, each time the genre, the year or the country change,\nanother super-aggregate row is added:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n+----------+------+-------------+------------+\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Paraguay | 2015 | NULL        |      85970 |\n| Paraguay | NULL | NULL        |     182700 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2014 | NULL        |      77214 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n| Senegal  | 2015 | NULL        |      94548 |\n| Senegal  | NULL | NULL        |     171762 |\n| NULL     | NULL | NULL        |     354462 |\n+----------+------+-------------+------------+\n\nThe LIMIT clause, applied after WITH ROLLUP:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP LIMIT 4;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | 2015 | fiction     |      76940 |\n+----------+------+-------------+------------+\n\nSorting by year descending:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year DESC, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country  | year | genre       | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2015 | fiction     |      76940 |\n| Paraguay | 2015 | non-fiction |       9030 |\n| Paraguay | 2015 | NULL        |      85970 |\n| Paraguay | 2014 | fiction     |      87970 |\n| Paraguay | 2014 | non-fiction |       8760 |\n| Paraguay | 2014 | NULL        |      96730 |\n| Paraguay | NULL | NULL        |     182700 |\n| Senegal  | 2015 | fiction     |      15647 |\n| Senegal  | 2015 | non-fiction |      78901 |\n| Senegal  | 2015 | NULL        |      94548 |\n| Senegal  | 2014 | fiction     |      12234 |\n| Senegal  | 2014 | non-fiction |      64980 |\n| Senegal  | 2014 | NULL        |      77214 |\n| Senegal  | NULL | NULL        |     171762 |\n| NULL     | NULL | NULL        |     354462 |\n+----------+------+-------------+------------+\n\nURL: https://mariadb.com/kb/en/select-with-rollup/','','https://mariadb.com/kb/en/select-with-rollup/'),
(449,'INSERT',27,'Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n  [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nThe INSERT statement is used to insert new rows into an existing table. The\nINSERT ... VALUES and INSERT ... SET forms of the statement insert rows based\non explicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed further\nin the INSERT ... SELECT article.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use INSERT ... SELECT to copy rows between different databases.\n\nThe PARTITION clause can be used in both the INSERT and the SELECT part. See\nPartition Pruning and Selection for details.\n\nMariaDB starting with 10.5\n--------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.\n\nThe columns list is optional. It specifies which values are explicitly\ninserted, and in which order. If this clause is not specified, all values must\nbe explicitly specified, in the same order they are listed in the table\ndefinition.\n\nThe list of value follow the VALUES or VALUE keyword (which are\ninterchangeable, regardless how much values you want to insert), and is\nwrapped by parenthesis. The values must be listed in the same order as the\ncolumns list. It is possible to specify more than one list to insert more than\none rows with a single statement. If many rows are inserted, this is a speed\noptimization.\n\nFor one-row statements, the SET clause may be more simple, because you don\'t\nneed to remember the columns order. All values are specified in the form col =\nexpr.\n\nValues can also be specified in the form of a SQL expression or subquery.\nHowever, the subquery cannot access the same table that is named in the INTO\nclause.\n\nIf you use the LOW_PRIORITY keyword, execution of the INSERT is delayed until\nno other clients are reading from the table. If you use the HIGH_PRIORITY\nkeyword, the statement has the same priority as SELECTs. This affects only\nstorage engines that use only table-level locking (MyISAM, MEMORY, MERGE).\nHowever, if one of these keywords is specified, concurrent inserts cannot be\nused. See HIGH_PRIORITY and LOW_PRIORITY clauses for details.\n\nINSERT DELAYED\n--------------\n\nFor more details on the DELAYED option, see INSERT DELAYED.\n\nHIGH PRIORITY and LOW PRIORITY\n------------------------------\n\nSee HIGH_PRIORITY and LOW_PRIORITY.\n\nDefaults and Duplicate Values\n-----------------------------\n\nSee INSERT - Default & Duplicate Values for details..\n\nINSERT IGNORE\n-------------\n\nSee INSERT IGNORE.\n\nINSERT ON DUPLICATE KEY UPDATE\n------------------------------\n\nSee INSERT ON DUPLICATE KEY UPDATE.\n\nExamples\n--------\n\nSpecifying the column names:\n\nINSERT INTO person (first_name, last_name) VALUES (\'John\', \'Doe\');\n\nInserting more than 1 row at a time:\n\nINSERT INTO tbl_name VALUES (1, \"row 1\"), (2, \"row 2\");\n\nUsing the SET clause:\n\nINSERT INTO person SET first_name = \'John\', last_name = \'Doe\';\n\nSELECTing from another table:\n\nINSERT INTO contractor SELECT * FROM person WHERE status = \'c\';\n\nSee INSERT ON DUPLICATE KEY UPDATE and INSERT IGNORE for further examples.\n\nINSERT ... RETURNING\n--------------------\n\nINSERT ... RETURNING returns a resultset of the inserted rows.\n\nThis returns the listed columns for all the rows that are inserted, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple INSERT statement\n\nINSERT INTO t2 VALUES (1,\'Dog\'),(2,\'Lion\'),(3,\'Tiger\'),(4,\'Leopard\') \nRETURNING id2,id2+id2,id2&id2,id2||id2;\n+-----+---------+---------+----------+\n| id2 | id2+id2 | id2&id2 | id2||id2 |\n+-----+---------+---------+----------+\n|   1 |       2 |       1 |        1 |\n|   2 |       4 |       2 |        1 |\n|   3 |       6 |       3 |        1 |\n|   4 |       8 |       4 |        1 |\n+-----+---------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\n\nPREPARE stmt FROM \"INSERT INTO t1 SET id1=1, animal1=\'Bear\' RETURNING f(id1),\nUPPER(animal1)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f(id1)  | UPPER(animal1) |\n+---------+----------------+\n|       2 | BEAR           |\n+---------+----------------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used.\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values, and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used or it can be used in\nINSERT...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the INSERT table.\n\nURL: https://mariadb.com/kb/en/insert/','','https://mariadb.com/kb/en/insert/'),
(450,'INSERT DELAYED',27,'Syntax\n------\n\nINSERT DELAYED ...\n\nDescription\n-----------\n\nThe DELAYED option for the INSERT statement is a MariaDB/MySQL extension to\nstandard SQL that is very useful if you have clients that cannot or need not\nwait for the INSERT to complete. This is a common situation when you use\nMariaDB for logging and you also periodically run SELECT and UPDATE statements\nthat take a long time to complete.\n\nWhen a client uses INSERT DELAYED, it gets an okay from the server at once,\nand the row is queued to be inserted when the table is not in use by any other\nthread.\n\nAnother major benefit of using INSERT DELAYED is that inserts from many\nclients are bundled together and written in one block. This is much faster\nthan performing many separate inserts.\n\nNote that INSERT DELAYED is slower than a normal INSERT if the table is not\notherwise in use. There is also the additional overhead for the server to\nhandle a separate thread for each table for which there are delayed rows. This\nmeans that you should use INSERT DELAYED only when you are really sure that\nyou need it.\n\nThe queued rows are held only in memory until they are inserted into the\ntable. This means that if you terminate mysqld forcibly (for example, with\nkill -9) or if mysqld dies unexpectedly, any queued rows that have not been\nwritten to disk are lost.\n\nThe number of concurrent INSERT DELAYED threads is limited by the\nmax_delayed_threads server system variables. If it is set to 0, INSERT DELAYED\nis disabled. The session value can be equal to the global value, or 0 to\ndisable this statement for the current session. If this limit has been\nreached, the DELAYED clause will be silently ignore for subsequent statements\n(no error will be produced).\n\nLimitations\n-----------\n\nThere are some limitations on the use of DELAYED:\n\n* INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE,\n and BLACKHOLE tables. If you execute INSERT DELAYED with another storage\nengine, you will get an error like this: ERROR 1616 (HY000): DELAYED option\nnot supported for table \'tab_name\'\n* For MyISAM tables, if there are no free blocks in the middle of the data\n file, concurrent SELECT and INSERT statements are supported. Under these\n circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n* INSERT DELAYED should be used only for\n INSERT statements that specify value lists. The server\n ignores DELAYED for INSERT ... SELECT\n or INSERT ... ON DUPLICATE KEY UPDATE statements.\n* Because the INSERT DELAYED statement returns immediately,\n before the rows are inserted, you cannot use\n LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n* DELAYED rows are not visible to SELECT\n statements until they actually have been inserted.\n* After INSERT DELAYED, ROW_COUNT() returns the number of the rows you tried\nto insert, not the number of the successful writes.\n* DELAYED is ignored on slave replication servers, so that \n INSERT DELAYED is treated as a normal\n INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than\n the master. INSERT DELAYED statements are not safe for replication.\n* Pending INSERT DELAYED statements are lost if a table is\n write locked and ALTER TABLE is used to modify the table structure.\n* INSERT DELAYED is not supported for views. If you try, you will get an error\nlike this: ERROR 1347 (HY000): \'view_name\' is not BASE TABLE\n* INSERT DELAYED is not supported for partitioned tables.\n* INSERT DELAYED is not supported within stored programs.\n* INSERT DELAYED does not work with triggers.\n* INSERT DELAYED does not work if there is a check constraint in place.\n* INSERT DELAYED does not work if skip-new mode is active.\n\nURL: https://mariadb.com/kb/en/insert-delayed/','','https://mariadb.com/kb/en/insert-delayed/'),
(454,'Concurrent Inserts',27,'The MyISAM storage engine supports concurrent inserts. This feature allows\nSELECT statements to be executed during INSERT operations, reducing contention.\n\nWhether concurrent inserts can be used or not depends on the value of the\nconcurrent_insert server system variable:\n\n* NEVER (0) disables concurrent inserts.\n* AUTO (1) allows concurrent inserts only when the target table has no free\nblocks (no data in the middle of the table has been deleted after the last\nOPTIMIZE TABLE). This is the default.\n* ALWAYS (2) always enables concurrent inserts, in which case new rows are\nadded at the end of a table if the table is being used by another thread.\n\nIf the binary log is used, CREATE TABLE ... SELECT and INSERT ... SELECT\nstatements cannot use concurrent inserts. These statements acquire a read lock\non the table, so concurrent inserts will need to wait. This way the log can be\nsafely used to restore data.\n\nConcurrent inserts are not used by replicas with the row based replication\n(see binary log formats).\n\nIf an INSERT statement contain the HIGH_PRIORITY clause, concurrent inserts\ncannot be used. INSERT ... DELAYED is usually unneeded if concurrent inserts\nare enabled.\n\nLOAD DATA INFILE uses concurrent inserts if the CONCURRENT keyword is\nspecified and concurrent_insert is not NEVER. This makes the statement slower\n(even if no other sessions access the table) but reduces contention.\n\nLOCK TABLES allows non-conflicting concurrent inserts if a READ LOCAL lock is\nused. Concurrent inserts are not allowed if the LOCAL keyword is omitted.\n\nNotes\n-----\n\nThe decision to enable concurrent insert for a table is done when the table is\nopened. If you change the value of concurrent_insert it will only affect new\nopened tables. If you want it to work for also for tables in use or cached,\nyou should do FLUSH TABLES after setting the variable.\n\nURL: https://mariadb.com/kb/en/concurrent-inserts/','','https://mariadb.com/kb/en/concurrent-inserts/'),
(455,'HIGH_PRIORITY and LOW_PRIORITY',27,'The InnoDB storage engine uses row-level locking to ensure data integrity.\nHowever some storage engines (such as MEMORY, MyISAM, Aria and MERGE) lock the\nwhole table to prevent conflicts. These storage engines use two separate\nqueues to remember pending statements; one is for SELECTs and the other one is\nfor write statements (INSERT, DELETE, UPDATE). By default, the latter has a\nhigher priority.\n\nTo give write operations a lower priority, the low_priority_updates server\nsystem variable can be set to ON. The option is available on both the global\nand session levels, and it can be set at startup or via the SET statement.\n\nWhen too many table locks have been set by write statements, some pending\nSELECTs are executed. The maximum number of write locks that can be acquired\nbefore this happens is determined by the max_write_lock_count server system\nvariable, which is dynamic.\n\nIf write statements have a higher priority (default), the priority of\nindividual write statements (INSERT, REPLACE, UPDATE, DELETE) can be changed\nvia the LOW_PRIORITY attribute, and the priority of a SELECT statement can be\nraised via the HIGH_PRIORITY attribute. Also, LOCK TABLES supports a\nLOW_PRIORITY attribute for WRITE locks.\n\nIf read statements have a higher priority, the priority of an INSERT can be\nchanged via the HIGH_PRIORITY attribute. However, the priority of other write\nstatements cannot be raised individually.\n\nThe use of LOW_PRIORITY or HIGH_PRIORITY for an INSERT prevents Concurrent\nInserts from being used.\n\nURL: https://mariadb.com/kb/en/high_priority-and-low_priority/','','https://mariadb.com/kb/en/high_priority-and-low_priority/'),
(456,'INSERT - Default & Duplicate Values',27,'Default Values\n--------------\n\nIf the SQL_MODE contains STRICT_TRANS_TABLES and you are inserting into a\ntransactional table (like InnoDB), or if the SQL_MODE contains\nSTRICT_ALL_TABLES, all NOT NULL columns which do not have a DEFAULT value (and\nare not AUTO_INCREMENT) must be explicitly referenced in INSERT statements. If\nnot, an error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nIn all other cases, if a NOT NULL column without a DEFAULT value is not\nreferenced, an empty value will be inserted (for example, 0 for INTEGER\ncolumns and \'\' for CHAR columns). See NULL Values in MariaDB:Inserting for\nexamples.\n\nIf a NOT NULL column having a DEFAULT value is not referenced, NULL will be\ninserted.\n\nIf a NULL column having a DEFAULT value is not referenced, its default value\nwill be inserted. It is also possible to explicitly assign the default value\nusing the DEFAULT keyword or the DEFAULT() function.\n\nIf the DEFAULT keyword is used but the column does not have a DEFAULT value,\nan error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nDuplicate Values\n----------------\n\nBy default, if you try to insert a duplicate row and there is a UNIQUE index,\nINSERT stops and an error like this is produced:\n\nERROR 1062 (23000): Duplicate entry \'dup_value\' for key \'col\'\n\nTo handle duplicates you can use the IGNORE clause, INSERT ON DUPLICATE KEY\nUPDATE or the REPLACE statement. Note that the IGNORE and DELAYED options are\nignored when you use ON DUPLICATE KEY UPDATE.\n\nURL: https://mariadb.com/kb/en/insert-default-duplicate-values/','','https://mariadb.com/kb/en/insert-default-duplicate-values/'),
(457,'INSERT IGNORE',27,'Ignoring Errors\n---------------\n\nNormally INSERT stops and rolls back when it encounters an error.\n\nBy using the IGNORE keyword all errors are converted to warnings, which will\nnot stop inserts of additional rows.\n\nInvalid values are changed to the closest valid value and inserted, with a\nwarning produced.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nPrior to MySQL and MariaDB 5.5.28, no warnings were issued for duplicate key\nerrors when using IGNORE. You can get the old behavior if you set OLD_MODE to\nNO_DUP_KEY_WARNINGS_WITH_IGNORE.\n\nSee IGNORE for a full description of effects.\n\nExamples\n--------\n\nCREATE TABLE t1 (x INT UNIQUE);\n\nINSERT INTO t1 VALUES(1),(2);\n\nINSERT INTO t1 VALUES(2),(3);\nERROR 1062 (23000): Duplicate entry \'2\' for key \'x\'\nSELECT * FROM t1;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n+------+\n\nINSERT IGNORE INTO t1 VALUES(2),(3);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------+\n| Level   | Code | Message                         |\n+---------+------+---------------------------------+\n| Warning | 1062 | Duplicate entry \'2\' for key \'x\' |\n+---------+------+---------------------------------+\n\nSELECT * FROM t1;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nConverting values:\n\nCREATE OR REPLACE TABLE t2(id INT, t VARCHAR(2) NOT NULL, n INT NOT NULL);\n\nINSERT INTO t2(id) VALUES (1),(2);\nERROR 1364 (HY000): Field \'t\' doesn\'t have a default value\n\nINSERT IGNORE INTO t2(id) VALUES (1),(2);\nQuery OK, 2 rows affected, 2 warnings (0.026 sec)\nRecords: 2  Duplicates: 0  Warnings: 2\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1364 | Field \'t\' doesn\'t have a default value |\n| Warning | 1364 | Field \'n\' doesn\'t have a default value |\n+---------+------+----------------------------------------+\n\nSELECT * FROM t2;\n+------+---+---+\n| id   | t | n |\n+------+---+---+\n|    1 |   | 0 |\n|    2 |   | 0 |\n+------+---+---+\n\nSee INSERT ON DUPLICATE KEY UPDATE for further examples using that syntax.\n\nURL: https://mariadb.com/kb/en/insert-ignore/','','https://mariadb.com/kb/en/insert-ignore/'),
(458,'INSERT ON DUPLICATE KEY UPDATE',27,'Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n  col=expr\n   [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ]\n\nDescription\n-----------\n\nINSERT ... ON DUPLICATE KEY UPDATE is a MariaDB/MySQL extension to the INSERT\nstatement that, if it finds a duplicate unique or primary key, will instead\nperform an UPDATE.\n\nThe row/s affected value is reported as 1 if a row is inserted, and 2 if a row\nis updated, unless the API\'s CLIENT_FOUND_ROWS flag is set.\n\nIf more than one unique index is matched, only the first is updated. It is not\nrecommended to use this statement on tables with more than one unique index.\n\nIf the table has an AUTO_INCREMENT primary key and the statement inserts or\nupdates a row, the LAST_INSERT_ID() function returns its AUTO_INCREMENT value.\n\nThe VALUES() function can only be used in a ON DUPLICATE KEY UPDATE clause and\nhas no meaning in any other context. It returns the column values from the\nINSERT portion of the statement. This function is particularly useful for\nmulti-rows inserts.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nSee Partition Pruning and Selection for details on the PARTITION clause.\n\nThis statement activates INSERT and UPDATE triggers. See Trigger Overview for\ndetails.\n\nSee also a similar statement, REPLACE.\n\nExamples\n--------\n\nCREATE TABLE ins_duplicate (id INT PRIMARY KEY, animal VARCHAR(30));\nINSERT INTO ins_duplicate VALUES (1,\'Aardvark\'), (2,\'Cheetah\'), (3,\'Zebra\');\n\nIf there is no existing key, the statement runs as a regular INSERT:\n\nINSERT INTO ins_duplicate VALUES (4,\'Gorilla\') \n ON DUPLICATE KEY UPDATE animal=\'Gorilla\';\nQuery OK, 1 row affected (0.07 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Aardvark |\n|  2 | Cheetah  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n+----+----------+\n\nA regular INSERT with a primary key value of 1 will fail, due to the existing\nkey:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\');\nERROR 1062 (23000): Duplicate entry \'1\' for key \'PRIMARY\'\n\nHowever, we can use an INSERT ON DUPLICATE KEY UPDATE instead:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\') \n ON DUPLICATE KEY UPDATE animal=\'Antelope\';\nQuery OK, 2 rows affected (0.09 sec)\n\nNote that there are two rows reported as affected, but this refers only to the\nUPDATE.\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Antelope |\n|  2 | Cheetah  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n+----+----------+\n\nAdding a second unique column:\n\nALTER TABLE ins_duplicate ADD id2 INT;\nUPDATE ins_duplicate SET id2=id+10;\nALTER TABLE ins_duplicate ADD UNIQUE KEY(id2);\n\nWhere two rows match the unique keys match, only the first is updated. This\ncan be unsafe and is not recommended unless you are certain what you are doing.\n\nINSERT INTO ins_duplicate VALUES (2,\'Lion\',13) \n ON DUPLICATE KEY UPDATE animal=\'Lion\';\nQuery OK, 2 rows affected (0.004 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+------+\n| id | animal   | id2  |\n+----+----------+------+\n|  1 | Antelope |   11 |\n|  2 | Lion     |   12 |\n|  3 | Zebra    |   13 |\n|  4 | Gorilla  |   14 |\n+----+----------+------+\n\nAlthough the third row with an id of 3 has an id2 of 13, which also matched,\nit was not updated.\n\nChanging id to an auto_increment field. If a new row is added, the\nauto_increment is moved forward. If the row is updated, it remains the same.\n\nALTER TABLE `ins_duplicate` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT;\nALTER TABLE ins_duplicate DROP id2;\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (2,\'Leopard\') \n ON DUPLICATE KEY UPDATE animal=\'Leopard\';\nQuery OK, 2 rows affected (0.00 sec)\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (5,\'Wild Dog\') \n ON DUPLICATE KEY UPDATE animal=\'Wild Dog\';\nQuery OK, 1 row affected (0.09 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal   |\n+----+----------+\n|  1 | Antelope |\n|  2 | Leopard  |\n|  3 | Zebra    |\n|  4 | Gorilla  |\n|  5 | Wild Dog |\n+----+----------+\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n|              6 |\n+----------------+\n\nRefering to column values from the INSERT portion of the statement:\n\nINSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n  ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\nSee the VALUES() function for more.\n\nURL: https://mariadb.com/kb/en/insert-on-duplicate-key-update/','','https://mariadb.com/kb/en/insert-on-duplicate-key-update/'),
(459,'INSERT...RETURNING',27,'MariaDB starting with 10.5.0\n----------------------------\nINSERT ... RETURNING was added in MariaDB 10.5.0, and returns a resultset of\nthe inserted rows.\n\nSyntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n  [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n  [ ON DUPLICATE KEY UPDATE\n   col=expr\n    [, col=expr] ... ] [RETURNING select_expr\n   [, select_expr ...]]\n\nDescription\n-----------\n\nINSERT ... RETURNING returns a resultset of the inserted rows.\n\nThis returns the listed columns for all the rows that are inserted, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple INSERT statements:\n\nCREATE OR REPLACE TABLE t2 (id INT, animal VARCHAR(20), t TIMESTAMP);\n\nINSERT INTO t2 (id) VALUES (2),(3) RETURNING id,t;\n+------+---------------------+\n| id   | t                   |\n+------+---------------------+\n|    2 | 2021-04-28 00:59:32 |\n|    3 | 2021-04-28 00:59:32 |\n+------+---------------------+\n\nINSERT INTO t2(id,animal) VALUES\n(1,\'Dog\'),(2,\'Lion\'),(3,\'Tiger\'),(4,\'Leopard\')  \n RETURNING id,id+id,id&id,id||id;\n+------+-------+-------+--------+\n| id   | id+id | id&id | id||id |\n+------+-------+-------+--------+\n|    1 |     2 |     1 |      1 |\n|    2 |     4 |     2 |      1 |\n|    3 |     6 |     3 |      1 |\n|    4 |     8 |     4 |      1 |\n+------+-------+-------+--------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\n\nPREPARE stmt FROM \"INSERT INTO t1 SET id1=1, animal1=\'Bear\' RETURNING f(id1),\nUPPER(animal1)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f(id1)  | UPPER(animal1) |\n+---------+----------------+\n|       2 | BEAR           |\n+---------+----------------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used.\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values, and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used or it can be used in\nINSERT...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the INSERT table.\n\nURL: https://mariadb.com/kb/en/insertreturning/','','https://mariadb.com/kb/en/insertreturning/'),
(460,'REPLACE...RETURNING',27,'MariaDB starting with 10.5.0\n----------------------------\nREPLACE ... RETURNING was added in MariaDB 10.5.0, and returns a resultset of\nthe replaced rows.\n\nSyntax\n------\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)]\n  SET col={expr | DEFAULT}, ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n  [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n  SELECT ...\n[RETURNING select_expr \n   [, select_expr ...]]\n\nDescription\n-----------\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n|   1 |     2 |       1 |        1 |\n|   2 |     4 |       2 |        1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n  BEGIN\n   RETURN (SELECT arg+arg);\n  END|\n\nDELIMITER ;\nPREPARE stmt FROM \"REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)\";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n|       6 | FOX            |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n|      1 |\n|      1 |\n|      1 |\n|      1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in\nREPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the REPLACE table.\n\nURL: https://mariadb.com/kb/en/replacereturning/','','https://mariadb.com/kb/en/replacereturning/'),
(461,'CALL',27,'Syntax\n------\n\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nDescription\n-----------\n\nThe CALL statement invokes a stored procedure that was defined previously with\nCREATE PROCEDURE.\n\nStored procedure names can be specified as database_name.procedure_name.\nProcedure names and database names can be quoted with backticks (). This is\nnecessary if they are reserved words, or contain special characters. See\nidentifier qualifiers for details.\n\nCALL p() and CALL p are equivalent.\n\nIf parentheses are used, any number of spaces, tab characters and newline\ncharacters are allowed between the procedure\'s name and the open parenthesis.\n\nCALL can pass back values to its caller using parameters that are declared as\nOUT or INOUT parameters. If no value is assigned to an OUT parameter, NULL is\nassigned (and its former value is lost). To pass such values from another\nstored program you can use user-defined variables, local variables or\nroutine\'s parameters; in other contexts, you can only use user-defined\nvariables.\n\nCALL can also be executed as a prepared statement. Placeholders can be used\nfor IN parameters in all versions of MariaDB; for OUT and INOUT parameters,\nplaceholders can be used since MariaDB 5.5.\n\nWhen the procedure returns, a client program can also obtain the number of\nrows affected for the final statement executed within the routine: At the SQL\nlevel, call the ROW_COUNT() function; from the C API, call the\nmysql_affected_rows() function.\n\nIf the CLIENT_MULTI_RESULTS API flag is set, CALL can return any number of\nresultsets and the called stored procedure can execute prepared statements. If\nit is not set, at most one resultset can be returned and prepared statements\ncannot be used within procedures.\n\nURL: https://mariadb.com/kb/en/call/','','https://mariadb.com/kb/en/call/'),
(463,'Comment Syntax',27,'There are three supported comment styles in MariaDB:\n\n* From a \'#\' to the end of a line:SELECT * FROM users; # This is a comment\n\n* From a \'-- \' to the end of a line. The space after the two dashes is\nrequired (as in MySQL).SELECT * FROM users; -- This is a comment\n\n* C style comments from an opening \'/*\' to a closing \'*/\'. Comments of this\nform can span multiple lines:SELECT * FROM users; /* This is a\nmulti-line\ncomment */\n\nNested comments are possible in some situations, but they are not supported or\nrecommended.\n\nExecutable Comments\n-------------------\n\nAs an aid to portability between different databases, MariaDB supports\nexecutable comments. These special comments allow you to embed SQL code which\nwill not execute when run on other databases, but will execute when run on\nMariaDB.\n\nMariaDB supports both MySQL\'s executable comment format, and a slightly\nmodified version specific to MariaDB. This way, if you have SQL code that\nworks on MySQL and MariaDB, but not other databases, you can wrap it in a\nMySQL executable comment, and if you have code that specifically takes\nadvantage of features only available in MariaDB you can use the MariaDB\nspecific format to hide the code from MySQL.\n\nExecutable Comment Syntax\n-------------------------\n\nMySQL and MariaDB executable comment syntax:\n\n/*! MySQL or MariaDB-specific code */\n\nCode that should be executed only starting from a specific MySQL or MariaDB\nversion:\n\n/*!##### MySQL or MariaDB-specific code */\n\nThe numbers, represented by \'######\' in the syntax examples above specify the\nspecific the minimum versions of MySQL and MariaDB that should execute the\ncomment. The first number is the major version, the second 2 numbers are the\nminor version and the last 2 is the patch level.\n\nFor example, if you want to embed some code that should only execute on MySQL\nor MariaDB starting from 5.1.0, you would do the following:\n\n/*!50100 MySQL and MariaDB 5.1.0 (and above) code goes here. */\n\nMariaDB-only executable comment syntax (starting from MariaDB 5.3.1):\n\n/*M! MariaDB-specific code */\n/*M!###### MariaDB-specific code */\n\nMariaDB ignores MySQL-style executable comments that have a version number in\nthe range 50700..99999. This is needed to skip features introduced in\nMySQL-5.7 that are not ported to MariaDB 10.x yet.\n\n/*!50701 MariaDB-10.x ignores MySQL-5.7 specific code */\n\nNote: comments which have a version number in the range 50700..99999 that use\nMariaDB-style executable comment syntax are still executed.\n\n/*M!50701 MariaDB-10.x does not ignore this */\n\nStatement delimiters cannot be used within executable comments.\n\nExamples\n--------\n\nIn MySQL all the following will return 2: In MariaDB, the last 2 queries would\nreturn 3.\n\nSELECT 2 /* +1 */;\nSELECT 1 /*! +1 */;\nSELECT 1 /*!50101 +1 */;\nSELECT 2 /*M! +1 */;\nSELECT 2 /*M!50301 +1 */;\n\nThe following executable statement will not work due to the delimiter inside\nthe executable portion:\n\n/*M!100100 select 1 ; */\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat corresponds to your MariaDB server version for the right syntax to use\nnear \'\' at line 1\n\nInstead, the delimiter should be placed outside the executable portion:\n\n/*M!100100 select 1 */;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nURL: https://mariadb.com/kb/en/comment-syntax/','','https://mariadb.com/kb/en/comment-syntax/'),
(464,'HANDLER Commands',27,'Syntax\n------\n\nHANDLER tbl_name OPEN [ [AS] alias]\nHANDLER tbl_name READ index_name { = | >= | <= | < } (value1,value2,...)\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n  [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name CLOSE\n\nDescription\n-----------\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces for key lookups and key or table scans. It is available for at\nleast Aria, Memory, MyISAM and InnoDB tables (and should work with most\n\'normal\' storage engines, but not with system tables, MERGE or views).\n\nHANDLER ... OPEN opens a table, allowing it to be accessible to subsequent\nHANDLER ... READ statements. The table can either be opened using an alias\n(which must then be used by HANDLER ... READ, or a table name.\n\nThe table object is only closed when HANDLER ... CLOSE is called by the\nsession, and is not shared by other sessions.\n\nPrepared statements work with HANDLER READ, which gives a much higher\nperformance (50% speedup) as there is no parsing and all data is transformed\nin binary (without conversions to text, as with the normal protocol).\n\nThe HANDLER command does not work with partitioned tables.\n\nKey Lookup\n----------\n\nA key lookup is started with:\n\nHANDLER tbl_name READ index_name { = | >= | <= | < }  (value,value) [LIMIT...]\n\nThe values stands for the value of each of the key columns. For most key types\n(except for HASH keys in MEMORY storage engine) you can use a prefix subset of\nit\'s columns.\n\nIf you are using LIMIT, then in case of >= or > then there is an implicit NEXT\nimplied, while if you are using <= or < then there is an implicit PREV implied.\n\nAfter the initial read, you can use\n\nHANDLER tbl_name READ index_name NEXT [ LIMIT ... ]\nor\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nto scan the rows in key order.\n\nNote that the row order is not defined for keys with duplicated values and\nwill vary from engine to engine.\n\nKey Scans\n---------\n\nYou can scan a table in key order by doing:\n\nHANDLER tbl_name READ index_name FIRST [ LIMIT ... ]\nHANDLER tbl_name READ index_name NEXT  [ LIMIT ... ]\n\nor, if the handler supports backwards key scans (most do):\n\nHANDLER tbl_name READ index_name LAST [ LIMIT ... ]\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nTable Scans\n-----------\n\nYou can scan a table in row order by doing:\n\nHANDLER tbl_name READ FIRST [ LIMIT ... ]\nHANDLER tbl_name READ NEXT  [ LIMIT ... ]\n\nLimitations\n-----------\n\nAs this is a direct interface to the storage engine, some limitations may\napply for what you can do and what happens if the table changes. Here follows\nsome of the common limitations:\n\nFinding \'Old Rows\'\n------------------\n\nHANDLER READ is not transaction safe, consistent or atomic. It\'s ok for the\nstorage engine to returns rows that existed when you started the scan but that\nwere later deleted. This can happen as the storage engine may cache rows as\npart of the scan from a previous read.\n\nYou may also find rows committed since the scan originally started.\n\nInvisible Columns\n-----------------\n\nHANDLER ... READ also reads the data of invisible-columns.\n\nSystem-Versioned Tables\n-----------------------\n\nHANDLER ... READ reads everything from system-versioned tables, and so\nincludes row_start and row_end fields, as well as all rows that have since\nbeen deleted or changed, including when history partitions are used.\n\nOther Limitations\n-----------------\n\n* If you do an ALTER TABLE, all your HANDLERs for that table are automatically\nclosed.\n* If you do an ALTER TABLE for a table that is used by some other connection\nwith HANDLER, the ALTER TABLE will wait for the HANDLER to be closed.\n* For HASH keys, you must use all key parts when searching for a row.\n* For HASH keys, you can\'t do a key scan of all values. You can only find all\nrows with the same key value.\n* While each HANDLER READ command is atomic, if you do a scan in many steps,\nthen some engines may give you error 1020 if the table changed between the\ncommands. Please refer to the specific engine handler page if this happens.\n\nError Codes\n-----------\n\n* Error 1031 (ER_ILLEGAL_HA) Table storage engine for \'t1\' doesn\'t have this\noption\nIf you get this for HANDLER OPEN it means the storage engine doesn\'t support\nHANDLER calls.\nIf you get this for HANDLER READ it means you are trying to use an incomplete\nHASH key.\n\n* Error 1020 (ER_CHECKREAD) Record has changed since last read in table \'...\'\nThis means that the table changed between two reads and the handler can\'t\nhandle this case for the given scan.\n\nURL: https://mariadb.com/kb/en/handler-commands/','','https://mariadb.com/kb/en/handler-commands/'),
(465,'HANDLER for MEMORY Tables',27,'This article explains how to use HANDLER commands efficiently with MEMORY/HEAP\ntables.\n\nIf you want to scan a table for over different key values, not just search for\nexact key values, you should create your keys with \'USING BTREE\':\n\nCREATE TABLE t1 (a INT, b INT, KEY(a), KEY b USING BTREE (b)) engine=memory;\n\nIn the above table, a is a HASH key that only supports exact matches (=) while\nb is a BTREE key that you can use to scan the table in key order, starting\nfrom start or from a given key value.\n\nThe limitations for HANDLER READ with Memory|HEAP tables are:\n\nLimitations for HASH keys\n-------------------------\n\n* You must use all key parts when searching for a row.\n* You can\'t do a key scan of all values. You can only find all rows with the\nsame key value.\n* READ NEXT gives error 1031 if the tables changed since last read.\n\nLimitations for BTREE keys\n--------------------------\n\n* READ NEXT gives error 1031 if the tables changed since last read. This\nlimitation can be lifted in the future.\n\nLimitations for table scans\n---------------------------\n\n* READ NEXT gives error 1031 if the table was truncated since last READ call.\n\nURL: https://mariadb.com/kb/en/handler-for-memory-tables/','','https://mariadb.com/kb/en/handler-for-memory-tables/'),
(467,'ANALYZE FORMAT=JSON',28,'ANALYZE FORMAT=JSON is a mix of the EXPLAIN FORMAT=JSON and ANALYZE statement\nfeatures. The ANALYZE FORMAT=JSON $statement will execute $statement, and then\nprint the output of EXPLAIN FORMAT=JSON, amended with data from the query\nexecution.\n\nBasic Execution Data\n--------------------\n\nYou can get the following also from tabular ANALYZE statement form:\n\n* r_rows  is provided for any node that reads rows. It shows how many rows\nwere read, on average \n* r_filtered is provided whenever there is a condition that is checked.  It\nshows the percentage of rows left after checking the condition.\n\nAdvanced Execution Data\n-----------------------\n\nThe most important data not available in the regular tabula ANALYZE statement\nare:\n\n* r_loops field.  This shows how many times the node was executed. Most query\nplan elements have this field.\n* r_total_time_ms field. It shows how much time in total, in milliseconds, was\nspent executing this node. If the node has subnodes, their execution time is\nincluded.\n* r_buffer_size field. Query plan nodes that make use of buffers report the\nsize of buffer that was was used.\n\nSHOW ANALYZE FORMAT=JSON\n------------------------\n\nMariaDB starting with 10.9\n--------------------------\nSHOW ANALYZE FORMAT=JSON for <connection_id> extends ANALYZE [FORMAT=JSON]\n<select> to allow one to analyze a query currently running in another\nconnection.\n\nData About Individual Query Plan Nodes\n--------------------------------------\n\n* filesort node reports whether sorting was done with LIMIT n parameter, and\nhow many rows were in the sort result. \n* block-nl-join node has r_loops field, which allows to tell whether Using\njoin buffer was efficient \n* range-checked-for-each-record reports counters that show the result of the\ncheck. \n* expression-cache is used for subqueries, and it reports how many times the\ncache was used, and what cache hit ratio was.\n* union_result node has r_rows so one can see how many rows were produced\nafter UNION operation\n* and so forth\n\nUse Cases\n---------\n\nSee Examples of ANALYZE FORMAT=JSON.\n\nURL: https://mariadb.com/kb/en/analyze-format-json/','','https://mariadb.com/kb/en/analyze-format-json/'),
(468,'ANALYZE FORMAT=JSON Examples',28,'Example #1\n----------\n\nCustomers who have ordered more than 1M goods.\n\nANALYZE FORMAT=JSON\nSELECT COUNT(*)\nFROM customer\nWHERE\n (SELECT SUM(o_totalprice) FROM orders WHERE o_custkey=c_custkey) > 1000*1000;\n\nThe query takes 40 seconds over cold cache\n\nEXPLAIN: {\n \"query_block\": {\n  \"select_id\": 1,\n  \"r_loops\": 1,\n  \"r_total_time_ms\": 39872,\n  \"table\": {\n   \"table_name\": \"customer\",\n   \"access_type\": \"index\",\n   \"key\": \"i_c_nationkey\",\n   \"key_length\": \"5\",\n   \"used_key_parts\": [\"c_nationkey\"],\n   \"r_loops\": 1,\n   \"rows\": 150303,\n   \"r_rows\": 150000,\n   \"r_total_time_ms\": 270.3,\n   \"filtered\": 100,\n   \"r_filtered\": 60.691,\n   \"attached_condition\": \"((subquery#2) > <cache>((1000 * 1000)))\",\n   \"using_index\": true\n  },\n  \"subqueries\": [\n   {\n    \"query_block\": {\n     \"select_id\": 2,\n     \"r_loops\": 150000,\n     \"r_total_time_ms\": 39531,\n     \"table\": {\n      \"table_name\": \"orders\",\n      \"access_type\": \"ref\",\n      \"possible_keys\": [\"i_o_custkey\"],\n      \"key\": \"i_o_custkey\",\n      \"key_length\": \"5\",\n      \"used_key_parts\": [\"o_custkey\"],\n      \"ref\": [\"dbt3sf1.customer.c_custkey\"],\n      \"r_loops\": 150000,\n      \"rows\": 7,\n      \"r_rows\": 10,\n      \"r_total_time_ms\": 39208,\n      \"filtered\": 100,\n      \"r_filtered\": 100\n     }\n    }\n   }\n  ]\n }\n}\nANALYZE shows that 39.2 seconds were spent in the subquery, which was executed\n150K times (for every row of outer table).\n\nURL: https://mariadb.com/kb/en/analyze-formatjson-examples/','','https://mariadb.com/kb/en/analyze-formatjson-examples/'),
(472,'EXPLAIN FORMAT=JSON',28,'Synopsis\n--------\n\nEXPLAIN FORMAT=JSON is a variant of EXPLAIN command that produces output in\nJSON form. The output always has one row which has only one column titled\n\"JSON\". The contents are a JSON representation of the query plan, formatted\nfor readability:\n\nEXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE col1=1\\G\n\n*************************** 1. row ***************************\nEXPLAIN: {\n \"query_block\": {\n  \"select_id\": 1,\n  \"table\": {\n   \"table_name\": \"t1\",\n   \"access_type\": \"ALL\",\n   \"rows\": 1000,\n   \"filtered\": 100,\n   \"attached_condition\": \"(t1.col1 = 1)\"\n  }\n }\n}\n\nOutput is different from MySQL\n------------------------------\n\nThe output of MariaDB\'s EXPLAIN FORMAT=JSON is different from EXPLAIN\nFORMAT=JSON in MySQL.The reasons for that are:\n\n* MySQL\'s output has deficiencies. Some are listed here: EXPLAIN FORMAT=JSON\nin MySQL\n* The output of MySQL\'s EXPLAIN FORMAT=JSON is not defined. Even MySQL\nWorkbench has trouble parsing it (see this blog post).\n* MariaDB has query optimizations that MySQL does not have. Ergo, MariaDB\ngenerates query plans that MySQL does not generate.\n\nA (as yet incomplete) list of how MariaDB\'s output is different from MySQL can\nbe found here: EXPLAIN FORMAT=JSON differences from MySQL.\n\nOutput Format\n-------------\n\nTODO: MariaDB\'s output format description.\n\nURL: https://mariadb.com/kb/en/explain-format-json/','','https://mariadb.com/kb/en/explain-format-json/'),
(469,'ANALYZE Statement',28,'Description\n-----------\n\nThe ANALYZE statement is similar to the EXPLAIN statement. ANALYZE statement\nwill invoke the optimizer, execute the statement, and then produce EXPLAIN\noutput instead of the result set. The EXPLAIN output will be annotated with\nstatistics from statement execution.\n\nThis lets one check how close the optimizer\'s estimates about the query plan\nare to the reality. ANALYZE produces an overview, while the ANALYZE\nFORMAT=JSON command provides a more detailed view of the query plan and the\nquery execution.\n\nThe syntax is\n\nANALYZE explainable_statement;\n\nwhere the statement is any statement for which one can run EXPLAIN.\n\nCommand Output\n--------------\n\nConsider an example:\n\nANALYZE SELECT * FROM tbl1 \nWHERE key1 \n BETWEEN 10 AND 200 AND\n col1 LIKE \'foo%\'\\G\n\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: tbl1\n    type: range\npossible_keys: key1\n     key: key1\n   key_len: 5\n     ref: NULL\n    rows: 181\n   r_rows: 181\n  filtered: 100.00\n r_filtered: 10.50\n    Extra: Using index condition; Using where\n\nCompared to EXPLAIN, ANALYZE produces two extra columns:\n\n* r_rows is an observation-based counterpart of the rows column. It shows how\nmany rows were actually read from the table. \n* r_filtered is an observation-based counterpart of the filtered column. It\nshows which fraction of rows was left after applying the WHERE condition.\n\nInterpreting the Output\n-----------------------\n\nJoins\n-----\n\nLet\'s consider a more complicated example.\n\nANALYZE SELECT *\nFROM orders, customer \nWHERE\n customer.c_custkey=orders.o_custkey AND\n customer.c_acctbal < 0 AND\n orders.o_totalprice > 200*1000\n\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n| id | select_type | table    | type | possible_keys | key         | key_len |\nref                | rows   | r_rows | filtered | r_filtered | Extra       |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n|  1 | SIMPLE      | customer | ALL  | PRIMARY,...   | NULL        | NULL    |\nNULL               | 149095 | 150000 |    18.08 |       9.13 | Using where |\n|  1 | SIMPLE      | orders   | ref  | i_o_custkey   | i_o_custkey | 5       |\ncustomer.c_custkey |      7 |     10 |   100.00 |      30.03 | Using where |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n\nHere, one can see that\n\n* For table customer, customer.rows=149095,  customer.r_rows=150000. The\nestimate for number of rows we will read was fairly precise\n* customer.filtered=18.08, customer.r_filtered=9.13.  The optimizer somewhat\noverestimated the number of records that will match selectivity of condition\nattached to `customer` table (in general, when you have a full scan and\nr_filtered is less than 15%, it\'s time to consider adding an appropriate\nindex).\n* For table orders,  orders.rows=7, orders.r_rows=10.  This means that on\naverage, there are 7 orders for a given c_custkey, but in our case there were\n10, which is close to the expectation (when this number is consistently far\nfrom the expectation, it may be time to run ANALYZE TABLE, or even edit the\ntable statistics manually to get better query plans).\n* orders.filtered=100, orders.r_filtered=30.03. The optimizer didn\'t have any\nway to estimate which fraction of records will be left after it checks the\ncondition that is attached to table orders (it\'s orders.o_totalprice >\n200*1000). So, it used 100%. In reality, it is 30%. 30% is typically not\nselective enough to warrant adding new indexes. For joins with many tables, it\nmight be worth to collect and use column statistics for columns in question,\nthis may help the optimizer to pick a better query plan.\n\nMeaning of NULL in r_rows and r_filtered\n----------------------------------------\n\nLet\'s modify the previous example slightly\n\nANALYZE SELECT * \nFROM orders, customer \nWHERE\n customer.c_custkey=orders.o_custkey AND\n customer.c_acctbal < -0 AND\n customer.c_comment LIKE \'%foo%\' AND\n orders.o_totalprice > 200*1000;\n\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n| id | select_type | table    | type | possible_keys | key         | key_len |\nref                | rows   | r_rows | filtered | r_filtered | Extra       |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n|  1 | SIMPLE      | customer | ALL  | PRIMARY,...   | NULL        | NULL    |\nNULL               | 149095 | 150000 |    18.08 |       0.00 | Using where |\n|  1 | SIMPLE      | orders   | ref  | i_o_custkey   | i_o_custkey | 5       |\ncustomer.c_custkey |      7 |   NULL |   100.00 |       NULL | Using where |\n+----+-------------+----------+------+---------------+-------------+---------+-\n------------------+--------+--------+----------+------------+-------------+\n\nHere, one can see that orders.r_rows=NULL and orders.r_filtered=NULL. This\nmeans that table orders was not scanned even once. Indeed, we can also see\ncustomer.r_filtered=0.00. This shows that a part of WHERE attached to table\n`customer` was never satisfied (or, satisfied in less than 0.01% of cases).\n\nANALYZE FORMAT=JSON\n-------------------\n\nANALYZE FORMAT=JSON produces JSON output. It produces much more information\nthan tabular ANALYZE.\n\nNotes\n-----\n\n* ANALYZE UPDATE or ANALYZE DELETE will actually make updates/deletes (ANALYZE\nSELECT will perform the select operation and then discard the resultset).\n* PostgreSQL has a similar command, EXPLAIN ANALYZE.\n* The EXPLAIN in the slow query log feature allows MariaDB to have ANALYZE\noutput of slow queries printed into the slow query log (see MDEV-6388).\n\nURL: https://mariadb.com/kb/en/analyze-statement/','','https://mariadb.com/kb/en/analyze-statement/'),
(473,'DESCRIBE',28,'Syntax\n------\n\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDescription\n-----------\n\nDESCRIBE provides information about the columns in a table. It is a shortcut\nfor SHOW COLUMNS FROM. These statements also display information for views.\n\ncol_name can be a column name, or a string containing the SQL \"%\" and \"_\"\nwildcard characters to obtain output only for the columns with names matching\nthe string. There is no need to enclose the string within quotes unless it\ncontains spaces or other special characters.\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | YES  |     | NULL    |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | YES  |     | NULL    |                |\n+------------+----------+------+-----+---------+----------------+\n\nThe description for SHOW COLUMNS provides more information about the output\ncolumns.\n\nURL: https://mariadb.com/kb/en/describe/','','https://mariadb.com/kb/en/describe/'),
(475,'Identifier Case-sensitivity',29,'Whether objects are case-sensitive or not is partly determined by the\nunderlying operating system. Unix-based systems are case-sensitive, Windows is\nnot, while Mac OS X is usually case-insensitive by default, but devices can be\nconfigured as case-sensitive using Disk Utility.\n\nDatabase, table, table aliases and trigger names are affected by the systems\ncase-sensitivity, while index, column, column aliases, stored routine and\nevent names are never case sensitive.\n\nLog file group name are case sensitive.\n\nThe lower_case_table_names server system variable plays a key role. It\ndetermines whether table names, aliases and database names are compared in a\ncase-sensitive manner. If set to 0 (the default on Unix-based systems), table\nnames and aliases and database names are compared in a case-sensitive manner.\nIf set to 1 (the default on Windows), names are stored in lowercase and not\ncompared in a case-sensitive manner. If set to 2 (the default on Mac OS X),\nnames are stored as declared, but compared in lowercase.\n\nIt is thus possible to make Unix-based systems behave like Windows and ignore\ncase-sensitivity, but the reverse is not true, as the underlying Windows\nfilesystem can not support this.\n\nEven on case-insensitive systems, you are required to use the same case\nconsistently within the same statement. The following statement fails, as it\nrefers to the table name in a different case.\n\nSELECT * FROM a_table WHERE A_table.id>10;\n\nFor a full list of identifier naming rules, see Identifier Names.\n\nPlease note that lower_case_table_names is a database initialization\nparameter. This means that, along with innodb_page_size, this variable must be\nset before running mariadb-install-db, and will not change the behavior of\nservers unless applied before the creation of core system databases.\n\nURL: https://mariadb.com/kb/en/identifier-case-sensitivity/','','https://mariadb.com/kb/en/identifier-case-sensitivity/'),
(479,'Hexadecimal Literals',29,'Hexadecimal literals can be written using any of the following syntaxes:\n\n* x\'value\'\n* X\'value\' (SQL standard)\n* 0xvalue (ODBC)\n\nvalue is a sequence of hexadecimal digits (from 0 to 9 and from A to F). The\ncase of the digits does not matter. With the first two syntaxes, value must\nconsist of an even number of digits. With the last syntax, digits can be even,\nand they are treated as if they had an extra 0 at the beginning.\n\nNormally, hexadecimal literals are interpreted as binary string, where each\npair of digits represents a character. When used in a numeric context, they\nare interpreted as integers. (See the example below). In no case can a\nhexadecimal literal be a decimal number.\n\nThe first two syntaxes; X\'value\' and x\'value, follow the SQL standard, and\nbehave as a string in all contexts in MariaDB since MariaDB 10.0.3 and MariaDB\n5.5.31 (fixing MDEV-4489). The latter syntax, 0xvalue, is a MySQL/MariaDB\nextension for hex hybrids and behaves as a string or as a number depending on\ncontext. MySQL treats all syntaxes the same, so there may be different results\nin MariaDB and MySQL (see below).\n\nExamples\n--------\n\nRepresenting the a character with the three syntaxes explained above:\n\nSELECT x\'61\', X\'61\', 0x61;\n+-------+-------+------+\n| x\'61\' | X\'61\' | 0x61 |\n+-------+-------+------+\n| a     | a     | a    |\n+-------+-------+------+\n\nHexadecimal literals in a numeric context:\n\nSELECT 0 + 0xF, -0xF;\n+---------+------+\n| 0 + 0xF | -0xF |\n+---------+------+\n|      15 |  -15 |\n+---------+------+\n\nFun with Types\n--------------\n\nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61));\n\nSELECT * FROM t1;\n+------+------+\n| a    | b    |\n+------+------+\n|   49 | a    |\n|    1 | a    |\n+------+------+\n\nThe reason for the differing results above is that when 0x31 is inserted\ndirectly to the column, it\'s treated as a number, while when 0x31 is passed to\nCOALESCE(), it\'s treated as a string, because:\n\n* HEX values have a string data type by default.\n* COALESCE() has the same data type as the argument.\n\nDifferences Between MariaDB and MySQL\n-------------------------------------\n\nSELECT x\'0a\'+0;\n+---------+\n| x\'0a\'+0 |\n+---------+\n|       0 |\n+---------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'\\x0A\'\n\nSELECT X\'0a\'+0;\n+---------+\n| X\'0a\'+0 |\n+---------+\n|       0 |\n+---------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'\\x0A\'\n\nSELECT 0x0a+0;\n+--------+\n| 0x0a+0 |\n+--------+\n|     10 |\n+--------+\n\nIn MySQL (up until at least MySQL 8.0.26):\n\nSELECT x\'0a\'+0;\n+---------+\n| x\'0a\'+0 |\n+---------+\n|      10 |\n+---------+\n\nSELECT X\'0a\'+0;\n+---------+\n| X\'0a\'+0 |\n+---------+\n|      10 |\n+---------+\n\nSELECT 0x0a+0;\n+--------+\n| 0x0a+0 |\n+--------+\n|     10 |\n+--------+\n\nURL: https://mariadb.com/kb/en/hexadecimal-literals/','','https://mariadb.com/kb/en/hexadecimal-literals/'),
(474,'Identifier Names',29,'Databases, tables, indexes, columns, aliases, views, stored routines,\ntriggers, events, variables, partitions, tablespaces, savepoints, labels,\nusers, roles, are collectively known as identifiers, and have certain rules\nfor naming.\n\nIdentifiers may be quoted using the backtick character - `. Quoting is\noptional for identifiers that don\'t contain special characters, or for\nidentifiers that are not reserved words. If the ANSI_QUOTES SQL_MODE flag is\nset, double quotes (\") can also be used to quote identifiers. If the MSSQL\nflag is set, square brackets ([ and ]) can be used for quoting.\n\nEven when using reserved words as names, fully qualified names do not need to\nbe quoted. For example, test.select has only one possible meaning, so it is\ncorrectly parsed even without quotes.\n\nUnquoted\n--------\n\nThe following characters are valid, and allow identifiers to be unquoted:\n\n* ASCII: [0-9,a-z,A-Z$_] (numerals 0-9, basic Latin letters, both lowercase\nand uppercase, dollar sign, underscore)\n* Extended: U+0080 .. U+FFFF\n\nQuoted\n------\n\nThe following characters are valid, but identifiers using them must be quoted:\n\n* ASCII: U+0001 .. U+007F (full Unicode Basic Multilingual Plane (BMP) except\nfor U+0000)\n* Extended: U+0080 .. U+FFFF \n* Identifier quotes can themselves be used as part of an identifier, as long\nas they are quoted.\n\nFurther Rules\n-------------\n\nThere are a number of other rules for identifiers:\n\n* Identifiers are stored as Unicode (UTF-8)\n* Identifiers may or may not be case-sensitive. See Indentifier\nCase-sensitivity.\n* Database, table and column names can\'t end with space characters\n* Identifier names may begin with a numeral, but can\'t only contain numerals\nunless quoted.\n* An identifier starting with a numeral, followed by an \'e\', may be parsed as\na floating point number, and needs to be quoted.\n* Identifiers are not permitted to contain the ASCII NUL character (U+0000)\nand supplementary characters (U+10000 and higher).\n* Names such as 5e6, 9e are not prohibited, but it\'s strongly recommended not\nto use them, as they could lead to ambiguity in certain contexts, being\ntreated as a number or expression.\n* User variables cannot be used as part of an identifier, or as an identifier\nin an SQL statement.\n\nQuote Character\n---------------\n\nThe regular quote character is the backtick character - `, but if the\nANSI_QUOTES SQL_MODE option is specified, a regular double quote - \" may be\nused as well.\n\nThe backtick character can be used as part of an identifier. In that case the\nidentifier needs to be quoted. The quote character can be the backtick, but in\nthat case, the backtick in the name must be escaped with another backtick.\n\nMaximum Length\n--------------\n\n* Databases, tables, columns, indexes, constraints, stored routines, triggers,\nevents, views, tablespaces, servers and log file groups have a maximum length\nof 64 characters.\n* Compound statement labels have a maximum length of 16 characters\n* Aliases have a maximum length of 256 characters, except for column aliases\nin CREATE VIEW statements, which are checked against the maximum column length\nof 64 characters (not the maximum alias length of 256 characters).\n* Users have a maximum length of 80 characters.\n* Roles have a maximum length of 128 characters.\n* Multi-byte characters do not count extra towards towards the character limit.\n\nMultiple Identifiers\n--------------------\n\nMariaDB allows the column name to be used on its own if the reference will be\nunambiguous, or the table name to be used with the column name, or all three\nof the database, table and column names. A period is used to separate the\nidentifiers, and the period can be surrounded by spaces.\n\nExamples\n--------\n\nUsing the period to separate identifiers:\n\nCREATE TABLE t1 (i int);\n\nINSERT INTO t1(i) VALUES (10);\n\nSELECT i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nSELECT t1.i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nSELECT test.t1.i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nThe period can be separated by spaces:\n\nSELECT test . t1 . i FROM t1;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nResolving ambiguity:\n\nCREATE TABLE t2 (i int);\n\nSELECT i FROM t1 LEFT JOIN t2 ON t1.i=t2.i;\nERROR 1052 (23000): Column \'i\' in field list is ambiguous\n\nSELECT t1.i FROM t1 LEFT JOIN t2 ON t1.i=t2.i;\n+------+\n| i    |\n+------+\n|   10 |\n+------+\n\nCreating a table with characters that require quoting:\n\nCREATE TABLE 123% (i int);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'123% (i int)\' at line 1\n\nCREATE TABLE `123%` (i int);\nQuery OK, 0 rows affected (0.85 sec)\n\nCREATE TABLE `TABLE` (i int);\nQuery OK, 0 rows affected (0.36 sec)\n\nUsing double quotes as a quoting character:\n\nCREATE TABLE \"SELECT\" (i int);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'\"SELECT\" (i int)\' at line 1\n\nSET sql_mode=\'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE TABLE \"SELECT\" (i int);\nQuery OK, 0 rows affected (0.46 sec)\n\nUsing an identifier quote as part of an identifier name:\n\nSHOW VARIABLES LIKE \'sql_mode\';\n+---------------+-------------+\n| Variable_name | Value       |\n+---------------+-------------+\n| sql_mode      | ANSI_QUOTES |\n+---------------+-------------+\n\nCREATE TABLE \"fg`d\" (i int);\nQuery OK, 0 rows affected (0.34 sec)\n\nCreating the table named * (Unicode number: U+002A) requires quoting.\n\nCREATE TABLE `*` (a INT);\n\nFloating point ambiguity:\n\nCREATE TABLE 8984444cce5d (x INT);\nQuery OK, 0 rows affected (0.38 sec)\n\nCREATE TABLE 8981e56cce5d (x INT);\nERROR 1064 (42000): You have an error in your SQL syntax; \n check the manual that corresponds to your MariaDB server version for the\nright syntax \n to use near \'8981e56cce5d (x INT)\' at line 1\n\nCREATE TABLE `8981e56cce5d` (x INT);\nQuery OK, 0 rows affected (0.39 sec)\n\nURL: https://mariadb.com/kb/en/identifier-names/','','https://mariadb.com/kb/en/identifier-names/'),
(478,'Date and Time Literals',29,'Standard syntaxes\n-----------------\n\nMariaDB supports the SQL standard and ODBC syntaxes for DATE, TIME and\nTIMESTAMP literals.\n\nSQL standard syntax:\n\n* DATE \'string\'\n* TIME \'string\'\n* TIMESTAMP \'string\'\n\nODBC syntax:\n\n* {d \'string\'}\n* {t \'string\'}\n* {ts \'string\'}\n\nThe timestamp literals are treated as DATETIME literals, because in MariaDB\nthe range of DATETIME is closer to the TIMESTAMP range in the SQL standard.\n\nstring is a string in a proper format, as explained below.\n\nDATE literals\n-------------\n\nA DATE string is a string in one of the following formats: \'YYYY-MM-DD\' or\n\'YY-MM-DD\'. Note that any punctuation character can be used as delimiter. All\ndelimiters must consist of 1 character. Different delimiters can be used in\nthe same string. Delimiters are optional (but if one delimiter is used, all\ndelimiters must be used).\n\nA DATE literal can also be an integer, in one of the following formats:\nYYYYMMDD or YYMMDD.\n\nAll the following DATE literals are valid, and they all represent the same\nvalue:\n\n\'19940101\'\n\'940101\'\n\'1994-01-01\'\n\'94/01/01\'\n\'1994-01/01\'\n\'94:01!01\'\n19940101\n940101\n\nDATETIME literals\n-----------------\n\nA DATETIME string is a string in one of the following formats: \'YYYY-MM-DD\nHH:MM:SS\' or \'YY-MM-DD HH:MM:SS\'. Note that any punctuation character can be\nused as delimiter for the date part and for the time part. All delimiters must\nconsist of 1 character. Different delimiters can be used in the same string.\nThe hours, minutes and seconds parts can consist of one character. For this\nreason, delimiters are mandatory for DATETIME literals.\n\nThe delimiter between the date part and the time part can be a T or any\nsequence of space characters (including tabs, new lines and carriage returns).\n\nA DATETIME literal can also be a number, in one of the following formats:\nYYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD or YYMMDD. In this case, all the time\nsubparts must consist of 2 digits.\n\nAll the following DATE literals are valid, and they all represent the same\nvalue:\n\n\'1994-01-01T12:30:03\'\n\'1994/01/01\\n\\t 12+30+03\'\n\'1994/01\\\\01\\n\\t 12+30-03\'\n\'1994-01-01 12:30:3\'\n\nTIME literals\n-------------\n\nA TIME string is a string in one of the following formats: \'D HH:MM:SS\',\n\'HH:MM:SS, \'D HH:MM\', \'HH:MM\', \'D HH\', or \'SS\'. D is a value from 0 to 34\nwhich represents days. : is the only allowed delimiter for TIME literals.\nDelimiters are mandatory, with an exception: the \'HHMMSS\' format is allowed.\nWhen delimiters are used, each part of the literal can consist of one\ncharacter.\n\nA TIME literal can also be a number in one of the following formats: HHMMSS,\nMMSS, or SS.\n\nThe following literals are equivalent:\n\n\'09:05:00\'\n\'9:05:0\'\n\'9:5:0\'\n\'090500\'\n\n2-digit years\n-------------\n\nThe year part in DATE and DATETIME literals is determined as follows:\n\n* 70 - 99 = 1970 - 1999\n* 00 - 69 = 2000 - 2069\n\nMicroseconds\n------------\n\nDATETIME and TIME literals can have an optional microseconds part. For both\nstring and numeric forms, it is expressed as a decimal part. Up to 6 decimal\ndigits are allowed. Examples:\n\n\'12:30:00.123456\'\n123000.123456\n\nSee Microseconds in MariaDB for details.\n\nDate and time literals and the SQL_MODE\n---------------------------------------\n\nUnless the SQL_MODE NO_ZERO_DATE flag is set, some special values are allowed:\nthe \'0000-00-00\' DATE, the \'00:00:00\' TIME, and the 0000-00-00 00:00:00\nDATETIME.\n\nIf the ALLOW_INVALID_DATES flag is set, the invalid dates (for example, 30th\nFebruary) are allowed. If not, if the NO_ZERO_DATE is set, an error is\nproduced; otherwise, a zero-date is returned.\n\nUnless the NO_ZERO_IN_DATE flag is set, each subpart of a date or time value\n(years, hours...) can be set to 0.\n\nURL: https://mariadb.com/kb/en/date-and-time-literals/','','https://mariadb.com/kb/en/date-and-time-literals/'),
(480,'Identifier Qualifiers',29,'Qualifiers are used within SQL statements to reference data structures, such\nas databases, tables, or columns. For example, typically a SELECT query\ncontains references to some columns and at least one table.\n\nQualifiers can be composed by one or more identifiers, where the initial parts\naffect the context within which the final identifier is interpreted:\n\n* For a database, only the database identifier needs to be specified.\n* For objects which are contained in a database (like tables, views,\nfunctions, etc) the database identifier can be specified. If no database is\nspecified, the current database is assumed (see USE and DATABASE() for more\ndetails). If there is no default database and no database is specified, an\nerror is issued.\n* For column names, the table and the database are generally obvious from the\ncontext of the statement. It is however possible to specify the table\nidentifier, or the database identifier plus the table identifier.\n* An identifier is fully-qualified if it contains all possible qualifiers, for\nexample, the following column is fully qualified: db_name.tbl_name.col_name.\n\nIf a qualifier is composed by more than one identifier, a dot (.) must be used\nas a separator. All identifiers can be quoted individually. Extra spacing\n(including new lines and tabs) is allowed.\n\nAll the following examples are valid:\n\n* db_name.tbl_name.col_name\n* tbl_name\n* `db_name`.`tbl_name`.`col_name`\n* `db_name` . `tbl_name`\n* db_name. tbl_name\n\nIf a table identifier is prefixed with a dot (.), the default database is\nassumed. This syntax is supported for ODBC compliance, but has no practical\neffect on MariaDB. These qualifiers are equivalent:\n\n* tbl_name\n* . tbl_name\n* .`tbl_name`\n* . `tbl_name`\n\nFor DML statements, it is possible to specify a list of the partitions using\nthe PARTITION clause. See Partition Pruning and Selection for details.\n\nURL: https://mariadb.com/kb/en/identifier-qualifiers/','','https://mariadb.com/kb/en/identifier-qualifiers/'),
(481,'Identifier to File Name Mapping',29,'Some identifiers map to a file name on the filesystem. Databases each have\ntheir own directory, while, depending on the storage engine, table names and\nindex names may map to a file name.\n\nNot all characters that are allowed in table names can be used in file names.\nEvery filesystem has its own rules of what characters can be used in file\nnames. To let the user create tables using all characters allowed in the SQL\nStandard and to not depend on whatever particular filesystem a particular\ndatabase resides, MariaDB encodes \"potentially unsafe\" characters in the table\nname to derive the corresponding file name.\n\nThis is implemented using a special character set. MariaDB converts a table\nname to the \"filename\" character set to get the file name for this table. And\nit converts the file name from the \"filename\" character set to, for example,\nutf8 to get the table name for this file name.\n\nThe conversion rules are as follows: if the identifier is made up only of\nbasic Latin numbers, letters and/or the underscore character, the encoding\nmatches the name (see however Identifier Case Sensitivity). Otherwise they are\nencoded according to the following table:\n\n+-----------------+------------+-----------+--------+-----------+-----------+\n| Code Range      | Pattern    | Number    | Used   | Unused    | Blocks    |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 00C0..017F      | [@][0..4][ | 5*20= 100 | 97     | 3         | Latin-1   |\n|                 | ..z]       |           |        |           | Supplemen |\n|                 |            |           |        |           |  + Latin  |\n|                 |            |           |        |           | Extended- |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0370..03FF      | [@][5..9][ | 5*20= 100 | 88     | 12        | Greek     |\n|                 | ..z]       |           |        |           | and       |\n|                 |            |           |        |           | Coptic    |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0400..052F      | [@][g..z][ | 20*7= 140 | 137    | 3         | Cyrillic  |\n|                 | ..6]       |           |        |           | +         |\n|                 |            |           |        |           | Cyrillic  |\n|                 |            |           |        |           | Supplemen |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0530..058F      | [@][g..z][ | 20*2= 40  | 38     | 2         | Armenian  |\n|                 | ..8]       |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 2160..217F      | [@][g..z][ | 20*1= 20  | 16     | 4         | Number    |\n|                 | ]          |           |        |           | Forms     |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 0180..02AF      | [@][g..z][ | 20*11=220 | 203    | 17        | Latin     |\n|                 | ..k]       |           |        |           | Extended- |\n|                 |            |           |        |           |  + IPA    |\n|                 |            |           |        |           | Extension |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 1E00..1EFF      | [@][g..z][ | 20*7= 140 | 136    | 4         | Latin     |\n|                 | ..r]       |           |        |           | Extended  |\n|                 |            |           |        |           | Additiona |\n|                 |            |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 1F00..1FFF      | [@][g..z][ | 20*8= 160 | 144    | 16        | Greek     |\n|                 | ..z]       |           |        |           | Extended  |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| .... ....       | [@][a..f][ | 6*20= 120 | 0      | 120       | RESERVED  |\n|                 | ..z]       |           |        |           |           |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| 24B6..24E9      | [@][@][a.. | 26        | 26     | 0         | Enclosed  |\n|                 | ]          |           |        |           | Alphanume |\n|                 |            |           |        |           | ics       |\n+-----------------+------------+-----------+--------+-----------+-----------+\n| FF21..FF5A      | [@][a..z][ | 26        | 26     | 0         | Halfwidth |\n|                 | ]          |           |        |           | and       |\n|                 |            |           |        |           | Fullwidth |\n|                 |            |           |        |           | forms     |\n+-----------------+------------+-----------+--------+-----------+-----------+\n\nCode Range values are UCS-2.\n\nAll of this encoding happens transparently at the filesystem level with one\nexception. Until MySQL 5.1.6, an old encoding was used. Identifiers created in\na version before MySQL 5.1.6, and which haven\'t been updated to the new\nencoding, the server prefixes mysql50 to their name.\n\nExamples\n--------\n\nFind the file name for a table with a non-Latin1 name:\n\nselect cast(convert(\"this_is_таблица\" USING filename) as binary);\n+------------------------------------------------------------------+\n| cast(convert(\"this_is_таблица\" USING filename) as binary)        |\n+------------------------------------------------------------------+\n| this_is_@y0@g0@h0@r0@o0@i1@g0                                    |\n+------------------------------------------------------------------+\n\nFind the table name for a file name:\n\nselect convert(_filename \"this_is_@y0@g0@h0@r0@o0@i1@g0\" USING utf8);\n+---------------------------------------------------------------+\n| convert(_filename \"this_is_@y0@g0@h0@r0@o0@i1@g0\" USING utf8) |\n+---------------------------------------------------------------+\n| this_is_таблица                                               |\n+---------------------------------------------------------------+\n\nAn old table created before MySQL 5.1.6, with the old encoding:\n\nSHOW TABLES;\n+--------------------+\n| Tables_in_test     |\n+--------------------+\n| #mysql50#table@1   |\n+--------------------+\n\nThe prefix needs to be supplied to reference this table:\n\nSHOW COLUMNS FROM `table@1`;\nERROR 1146 (42S02): Table \'test.table@1\' doesn\'t exist\n\nSHOW COLUMNS FROM `#mysql50#table@1`;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| i     | int(11) | YES  |     | NULL    |       |\n+-------+---------+------+-----+---------+-------+\n\nURL: https://mariadb.com/kb/en/identifier-to-file-name-mapping/','','https://mariadb.com/kb/en/identifier-to-file-name-mapping/'),
(482,'Numeric Literals',29,'Numeric literals are written as a sequence of digits from 0 to 9. Initial\nzeros are ignored. A sign can always precede the digits, but it is optional\nfor positive numbers. In decimal numbers, the integer part and the decimal\npart are divided with a dot (.).\n\nIf the integer part is zero, it can be omitted, but the literal must begin\nwith a dot.\n\nThe notation with exponent can be used. The exponent is preceded by an E or e\ncharacter. The exponent can be preceded by a sign and must be an integer. A\nnumber N with an exponent part X, is calculated as N * POW(10, X).\n\nIn some cases, adding zeroes at the end of a decimal number can increment the\nprecision of the expression where the number is used. For example, PI() by\ndefault returns a number with 6 decimal digits. But the PI()+0.0000000000\nexpression (with 10 zeroes) returns a number with 10 decimal digits.\n\nHexadecimal literals are interpreted as numbers when used in numeric contexts.\n\nExamples\n--------\n\n10\n+10\n-10\n\nAll these literals are equivalent:\n\n0.1\n.1\n+0.1\n+.1\n\nWith exponents:\n\n0.2E3 -- 0.2 * POW(10, 3) = 200\n.2e3\n.2e+2\n1.1e-10 -- 0.00000000011\n-1.1e10 -- -11000000000\n\nURL: https://mariadb.com/kb/en/numeric-iterals/','','https://mariadb.com/kb/en/numeric-iterals/'),
(484,'String Literals',29,'Strings are sequences of characters and are enclosed with quotes.\n\nThe syntax is:\n\n[_charset_name]\'string\' [COLLATE collation_name]\n\nFor example:\n\n\'The MariaDB Foundation\'\n_utf8 \'Foundation\' COLLATE utf8_unicode_ci;\n\nStrings can either be enclosed in single quotes or in double quotes (the same\ncharacter must be used to both open and close the string).\n\nThe ANSI SQL-standard does not permit double quotes for enclosing strings, and\nalthough MariaDB does by default, if the MariaDB server has enabled the\nANSI_QUOTES_SQL SQL_MODE, double quotes will be treated as being used for\nidentifiers instead of strings.\n\nStrings that are next to each other are automatically concatenated. For\nexample:\n\n\'The \' \'MariaDB \' \'Foundation\'\n\nand\n\n\'The MariaDB Foundation\'\n\nare equivalent.\n\nThe \\ (backslash character) is used to escape characters (unless the SQL_MODE\nhasn\'t been set to NO_BACKSLASH_ESCAPES). For example:\n\n\'MariaDB\'s new features\'\n\nis not a valid string because of the single quote in the middle of the string,\nwhich is treated as if it closes the string, but is actually meant as part of\nthe string, an apostrophe. The backslash character helps in situations like\nthis:\n\n\'MariaDB\\\'s new features\'\n\nis now a valid string, and if displayed, will appear without the backslash.\n\nSELECT \'MariaDB\\\'s new features\';\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n\nAnother way to escape the quoting character is repeating it twice:\n\nSELECT \'I\'\'m here\', \"\"\"Double\"\"\";\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n\nEscape Sequences\n----------------\n\nThere are other escape sequences also. Here is a full list:\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence                               | Character                   |\n+-----------------------------------------------+-----------------------------+\n| \\0                                            | ASCII NUL (0x00).           |\n+-----------------------------------------------+-----------------------------+\n| \\\'                                            | Single quote (\"\'\").         |\n+-----------------------------------------------+-----------------------------+\n| \\\"                                            | Double quote (\"\"\").         |\n+-----------------------------------------------+-----------------------------+\n| \\b                                            | Backspace.                  |\n+-----------------------------------------------+-----------------------------+\n| \\n                                            | Newline, or linefeed,.      |\n+-----------------------------------------------+-----------------------------+\n| \\r                                            | Carriage return.            |\n+-----------------------------------------------+-----------------------------+\n| \\t                                            | Tab.                        |\n+-----------------------------------------------+-----------------------------+\n| \\Z                                            | ASCII 26 (Control+Z). See   |\n|                                               | note following the table.   |\n+-----------------------------------------------+-----------------------------+\n| \\\\                                            | Backslash (\"\\\").            |\n+-----------------------------------------------+-----------------------------+\n| \\%                                            | \"%\" character. See note     |\n|                                               | following the table.        |\n+-----------------------------------------------+-----------------------------+\n| \\_                                            | A \"_\" character. See note   |\n|                                               | following the table.        |\n+-----------------------------------------------+-----------------------------+\n\nEscaping the % and _ characters can be necessary when using the LIKE operator,\nwhich treats them as special characters.\n\nThe ASCII 26 character (\\Z) needs to be escaped when included in a batch file\nwhich needs to be executed in Windows. The reason is that ASCII 26, in\nWindows, is the end of file (EOF).\n\nBackslash (\\), if not used as an escape character, must always be escaped.\nWhen followed by a character that is not in the above table, backslashes will\nsimply be ignored.\n\nURL: https://mariadb.com/kb/en/string-literals/','','https://mariadb.com/kb/en/string-literals/'),
(485,'Table Value Constructors',29,'MariaDB starting with 10.3.3\n----------------------------\nTable Value Constructors were introduced in MariaDB 10.3.3\n\nSyntax\n------\n\nVALUES ( row_value[, row_value...]), (...)...\n\nDescription\n-----------\n\nIn Unions, Views, and sub-queries, a Table Value Constructor (TVC) allows you\nto inject arbitrary values into the result-set. The given values must have the\nsame number of columns as the result-set, otherwise it returns Error 1222.\n\nExamples\n--------\n\nUsing TVC\'s with UNION operations:\n\nCREATE TABLE test.t1 (val1 INT, val2 INT);\nINSERT INTO test.t1 VALUES(5, 8), (3, 4), (1, 2);\n\nSELECT * FROM test.t1\nUNION\nVALUES (70, 90), (100, 110);\n\n+------+------+\n| val1 | val2 |\n+------+------+\n|    5 |    8 | \n|    3 |    4 |\n|    1 |    2 |\n|   70 |   90 |\n|  100 |  110 |\n+------+------+\n\nUsing TVC\'s with a CREATE VIEW statement:\n\nCREATE VIEW v1 AS VALUES (7, 9), (9, 10);\n\nSELECT * FROM v1;\n+---+----+\n| 7 |  9 |\n+---+----+\n| 7 |  9 |\n| 9 | 10 |\n+---+----+\n\nUsing TVC with an ORDER BY clause:\n\nSELECT * FROM test.t1\nUNION\nVALUES (10, 20), (30, 40), (50, 60), (70, 80)\nORDER BY val1 DESC;\n\nUsing TVC with LIMIT clause:\n\nSELECT * FROM test.t1\nUNION\nVALUES (10, 20), (30, 40), (50, 60), (70, 80)\nLIMIT 2 OFFSET 4;\n\n+------+------+\n| val1 | val2 |\n+------+------+\n|   30 |   40 | \n|   50 |   60 |\n+------+------+\n\nURL: https://mariadb.com/kb/en/table-value-constructors/','','https://mariadb.com/kb/en/table-value-constructors/'),
(486,'User-Defined Variables',29,'User-defined variables are variables which can be created by the user and\nexist in the session. This means that no one can access user-defined variables\nthat have been set by another user, and when the session is closed these\nvariables expire. However, these variables can be shared between several\nqueries and stored programs.\n\nUser-defined variables names must be preceded by a single at character (@).\nWhile it is safe to use a reserved word as a user-variable name, the only\nallowed characters are ASCII letters, digits, dollar sign ($), underscore (_)\nand dot (.). If other characters are used, the name can be quoted in one of\nthe following ways:\n\n* @`var_name`\n* @\'var_name\'\n* @\"var_name\"\n\nThese characters can be escaped as usual.\n\nUser-variables names are case insensitive, though they were case sensitive in\nMySQL 4.1 and older versions.\n\nUser-defined variables cannot be declared. They can be read even if no value\nhas been set yet; in that case, they are NULL. To set a value for a\nuser-defined variable you can use:\n\n* SET statement;\n* := operator within a SQL statement;\n* SELECT ... INTO.\n\nSince user-defined variables type cannot be declared, the only way to force\ntheir type is using CAST() or CONVERT():\n\nSET @str = CAST(123 AS CHAR(5));\n\nIf a variable has not been used yet, its value is NULL:\n\nSELECT @x IS NULL;\n+------------+\n| @x IS NULL |\n+------------+\n|          1 |\n+------------+\n\nIt is unsafe to read a user-defined variable and set its value in the same\nstatement (unless the command is SET), because the order of these actions is\nundefined.\n\nUser-defined variables can be used in most MariaDB\'s statements and clauses\nwhich accept an SQL expression. However there are some exceptions, like the\nLIMIT clause.\n\nThey must be used to PREPARE a prepared statement:\n\n@sql = \'DELETE FROM my_table WHERE c>1;\';\nPREPARE stmt FROM @sql;\nEXECUTE stmt;\nDEALLOCATE PREPARE stmt;\n\nAnother common use is to include a counter in a query:\n\nSET @var = 0;\nSELECT a, b, c, (@var:=@var+1) AS counter FROM my_table;\n\nInformation Schema\n------------------\n\nUser-defined variables can be viewed in the Information Schema USER_VARIABLES\nTable (as part of the User Variables plugin) from MariaDB 10.2.\n\nFlushing User-Defined Variables\n-------------------------------\n\nUser-defined variables are reset and the Information Schema table emptied with\nthe FLUSH USER_VARIABLES statement.\n\nSET @str = CAST(123 AS CHAR(5));\n\nSELECT * FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\n+---------------+----------------+---------------+--------------------+\n| VARIABLE_NAME | VARIABLE_VALUE | VARIABLE_TYPE | CHARACTER_SET_NAME |\n+---------------+----------------+---------------+--------------------+\n| str           | 123            | VARCHAR       | utf8mb3            |\n+---------------+----------------+---------------+--------------------+\n\nFLUSH USER_VARIABLES;\n\nSELECT * FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME;\nEmpty set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/user-defined-variables/','','https://mariadb.com/kb/en/user-defined-variables/'),
(487,'Delimiters',29,'The default delimiter in the mariadb client is the semicolon.\n\nWhen creating stored programs from the command-line, it is likely you will\nneed to differentiate between the regular delimiter and a delimiter inside a\nBEGIN END block. To understand better, consider the following example:\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\n DECLARE x TINYINT;\n SET x = 42;\n RETURN x;\nEND;\n\nIf you enter the above line by line, the mariadb client will treat the first\nsemicolon, at the end of the DECLARE x TINYINT line, as the end of the\nstatement. Since that\'s only a partial definition, it will throw a syntax\nerror, as follows:\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\nDECLARE x TINYINT;\nERROR 1064 (42000): You have an error in your SQL syntax; \ncheck the manual that corresponds to your MariaDB server version\n for the right syntax to use near \'\' at line 3\n\nThe solution is to specify a distinct delimiter for the duration of the\nprocess, using the DELIMITER command. The delimiter can be any set of\ncharacters you choose, but it needs to be a distinctive set of characters that\nwon\'t cause further confusion. // is a common choice, and used throughout the\nKnowledge Base.\n\nHere\'s how the function could be successfully entered from the mariadb client\nwith the new delimiter.\n\nDELIMITER //\n\nCREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC\nBEGIN\n DECLARE x TINYINT;\n SET x = 42;\n RETURN x;\nEND\n\n//\n\nDELIMITER ;\n\nAt the end, the delimiter is restored to the default semicolon. The \\g and \\G\ndelimiters can always be used, even when a custom delimiter is specified.\n\nURL: https://mariadb.com/kb/en/delimiters/','','https://mariadb.com/kb/en/delimiters/'),
(495,'ST_CONTAINS',30,'Syntax\n------\n\nST_CONTAINS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2.\n\nST_CONTAINS() uses object shapes, while CONTAINS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_CONTAINS tests the opposite relationship to ST_WITHIN().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(175 151)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st-contains/','','https://mariadb.com/kb/en/st-contains/'),
(496,'ST_CROSSES',30,'Syntax\n------\n\nST_CROSSES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if geometry g1 spatially crosses geometry g2. Returns NULL if g1 is\na Polygon or a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nST_CROSSES() uses object shapes, while CROSSES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(176 149, 176 151)\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st-crosses/','','https://mariadb.com/kb/en/st-crosses/'),
(498,'ST_DISJOINT',30,'Syntax\n------\n\nST_DISJOINT(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially disjoint from\n(does not intersect with) geometry g2.\n\nST_DISJOINT() uses object shapes, while DISJOINT(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_DISJOINT() tests the opposite relationship to ST_INTERSECTS().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n|                    0 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/st_disjoint/','','https://mariadb.com/kb/en/st_disjoint/'),
(501,'ST_EQUALS',30,'Syntax\n------\n\nST_EQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially equal to geometry\ng2.\n\nST_EQUALS() uses object shapes, while EQUALS(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(176 151, 174 149)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 2)\');\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n|                  0 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/st-equals/','','https://mariadb.com/kb/en/st-equals/'),
(502,'ST_INTERSECTS',30,'Syntax\n------\n\nST_INTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nST_INTERSECTS() uses object shapes, while INTERSECTS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_INTERSECTS() tests the opposite relationship to ST_DISJOINT().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n|                      1 |\n+------------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/st-intersects/','','https://mariadb.com/kb/en/st-intersects/'),
(505,'ST_TOUCHES',30,'Syntax\n------\n\nST_TOUCHES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially touches geometry g2.\nTwo geometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either the\nboundary or the interior of the other.\n\nST_TOUCHES() uses object shapes, while TOUCHES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n|                   1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n|                   0 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/st-touches/','','https://mariadb.com/kb/en/st-touches/'),
(506,'ST_WITHIN',30,'Syntax\n------\n\nST_WITHIN(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially within geometry g2.\n\nThis tests the opposite relationship as ST_CONTAINS().\n\nST_WITHIN() uses object shapes, while WITHIN(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n|                  1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(176 151)\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n|                  0 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/st-within/','','https://mariadb.com/kb/en/st-within/'),
(508,'WITHIN',30,'Syntax\n------\n\nWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This tests the\nopposite relationship as Contains().\n\nWITHIN() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_WITHIN() uses object shapes.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT(174 149)\');\nSET @g2 = GEOMFROMTEXT(\'POINT(176 151)\');\nSET @g3 = GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))\');\n\nSELECT within(@g1,@g3);\n+-----------------+\n| within(@g1,@g3) |\n+-----------------+\n|               1 |\n+-----------------+\n\nSELECT within(@g2,@g3);\n+-----------------+\n| within(@g2,@g3) |\n+-----------------+\n|               0 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/within/','','https://mariadb.com/kb/en/within/'),
(511,'ADD_MONTHS',31,'MariaDB starting with 10.6.1\n----------------------------\nThe ADD_MONTHS function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility. Similar functionality can be achieved with the DATE_ADD\nfunction.\n\nSyntax\n------\n\nADD_MONTHS(date, months)\n\nDescription\n-----------\n\nADD_MONTHS adds an integer months to a given date (DATE, DATETIME or\nTIMESTAMP), returning the resulting date.\n\nmonths can be positive or negative.\n\nThe resulting day component will remain the same as that specified in date,\nunless the resulting month has fewer days than the day component of the given\ndate, in which case the day will be the last day of the resulting month.\n\nReturns NULL if given an invalid date, or a NULL argument.\n\nExamples\n--------\n\nSELECT ADD_MONTHS(\'2012-01-31\', 2);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', -5);\n+------------------------------+\n| ADD_MONTHS(\'2012-01-31\', -5) |\n+------------------------------+\n| 2011-08-31                   |\n+------------------------------+\n\nSELECT ADD_MONTHS(\'2011-01-31\', 1);\n+-----------------------------+\n| ADD_MONTHS(\'2011-01-31\', 1) |\n+-----------------------------+\n| 2011-02-28                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 1);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 1) |\n+-----------------------------+\n| 2012-02-29                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 2);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 2) |\n+-----------------------------+\n| 2012-03-31                  |\n+-----------------------------+\n\nSELECT ADD_MONTHS(\'2012-01-31\', 3);\n+-----------------------------+\n| ADD_MONTHS(\'2012-01-31\', 3) |\n+-----------------------------+\n| 2012-04-30                  |\n+-----------------------------+\n\nURL: https://mariadb.com/kb/en/add_months/','','https://mariadb.com/kb/en/add_months/'),
(512,'ADDDATE',31,'Syntax\n------\n\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE() is a\nsynonym for DATE_ADD(). The related function SUBDATE() is a synonym for\nDATE_SUB(). For information on the INTERVAL unit argument, see the discussion\nfor DATE_ADD().\n\nWhen invoked with the days form of the second argument, MariaDB treats it as\nan integer number of days to be added to expr.\n\nExamples\n--------\n\nSELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2008-02-02                              |\n+-----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| ADDDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2008-02-02                             |\n+----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', 31);\n+---------------------------+\n| ADDDATE(\'2008-01-02\', 31) |\n+---------------------------+\n| 2008-02-02                |\n+---------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, ADDDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d                   | ADDDATE(d, 10)      |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-02-09 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-25 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-05-01 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-11-09 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-02-09 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-17 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, ADDDATE(d, INTERVAL 10 HOUR) from t1;\n+---------------------+------------------------------+\n| d                   | ADDDATE(d, INTERVAL 10 HOUR) |\n+---------------------+------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-31 07:31:07          |\n| 1983-10-15 06:42:51 | 1983-10-15 16:42:51          |\n| 2011-04-21 12:34:56 | 2011-04-21 22:34:56          |\n| 2011-10-30 06:31:41 | 2011-10-30 16:31:41          |\n| 2011-01-30 14:03:25 | 2011-01-31 00:03:25          |\n| 2004-10-07 11:19:34 | 2004-10-07 21:19:34          |\n+---------------------+------------------------------+\n\nURL: https://mariadb.com/kb/en/adddate/','','https://mariadb.com/kb/en/adddate/'),
(509,'Microseconds in MariaDB',31,'The TIME, DATETIME, and TIMESTAMP types, along with the temporal functions,\nCAST and dynamic columns, support microseconds. The datetime precision of a\ncolumn can be specified when creating the table with CREATE TABLE, for example:\n\nCREATE TABLE example(\n col_microsec DATETIME(6),\n col_millisec TIME(3)\n);\n\nGenerally, the precision can be specified for any TIME, DATETIME, or TIMESTAMP\ncolumn, in parentheses, after the type name. The datetime precision specifies\nnumber of digits after the decimal dot and can be any integer number from 0 to\n6. If no precision is specified it is assumed to be 0, for backward\ncompatibility reasons.\n\nA datetime precision can be specified wherever a type name is used. For\nexample:\n\n* when declaring arguments of stored routines.\n* when specifying a return type of a stored function.\n* when declaring variables.\n* in a CAST function:create function example(x datetime(5)) returns time(4)\nbegin\n declare y timestamp(6);\n return cast(x as time(2));\nend;\n\n%f is used as the formatting option for microseconds in the STR_TO_DATE,\nDATE_FORMAT and FROM_UNIXTIME functions, for example:\n\nSELECT STR_TO_DATE(\'20200809 020917076\',\'%Y%m%d %H%i%s%f\');\n+-----------------------------------------------------+\n| STR_TO_DATE(\'20200809 020917076\',\'%Y%m%d %H%i%s%f\') |\n+-----------------------------------------------------+\n| 2020-08-09 02:09:17.076000                          |\n+-----------------------------------------------------+\n\nAdditional Information\n----------------------\n\n* when comparing anything to a temporal value (DATETIME, TIME, DATE, or\nTIMESTAMP), both values are compared as temporal values, not as strings.\n* The INFORMATION_SCHEMA.COLUMNS table has a new column DATETIME_PRECISION\n* NOW(), CURTIME(), UTC_TIMESTAMP(), UTC_TIME(), CURRENT_TIME(),\nCURRENT_TIMESTAMP(), LOCALTIME() and LOCALTIMESTAMP() now accept datetime\nprecision as an optional argument. For example:SELECT CURTIME(4);\n--> 10:11:12.3456\n\n* TIME_TO_SEC() and UNIX_TIMESTAMP() preserve microseconds of the argument.\nThese functions will return a decimal number if the result non-zero datetime\nprecision and an integer otherwise (for backward compatibility).SELECT\nTIME_TO_SEC(\'10:10:10.12345\');\n--> 36610.12345\n\n* Current versions of this patch fix a bug in the following optimization: in\n certain queries with DISTINCT MariaDB can ignore this clause if it can\n prove that all result rows are unique anyway, for example, when a primary key\n is compared with a constant. Sometimes this optimization was applied\n incorrectly, though — for example, when comparing a\n string with a date constant. This is now fixed.\n* DATE_ADD() and DATE_SUB() functions can now take a TIME\n expression as an argument (not just DATETIME as before).SELECT\nTIME(\'10:10:10\') + INTERVAL 100 MICROSECOND;\n--> 10:10:10.000100\n\n* The event_time field in the mysql.general_log table and the start_time,\nquery_time, and lock_time fields in the mysql.slow_log table now store values\nwith microsecond precision.\n* This patch fixed a bug when comparing a temporal value using the BETWEEN\noperator and one of the operands is NULL.\n* The old syntax TIMESTAMP(N), where N is the display width, is no longer\nsupported. It was deprecated in MySQL 4.1.0 (released on\n 2003-04-03).\n* when a DATETIME value is compared to a TIME value, the latter is treated as\na full datetime with a zero date part, similar to comparing DATE to a\nDATETIME, or to comparing DECIMAL numbers.\n Earlier versions of MariaDB used to compare only the time part of both\noperands in such a case.\n* In MariaDB, an extra column TIME_MS has been added to the\nINFORMATION_SCHEMA.PROCESSLIST table, as well as to the output of SHOW FULL\nPROCESSLIST.\n\nNote: When you convert a temporal value to a value with a smaller precision,\nit will be truncated, not rounded. This is done to guarantee that the date\npart is not changed. For example:\n\nSELECT CAST(\'2009-12-31 23:59:59.998877\' as DATETIME(3));\n-> 2009-12-31 23:59:59.998\n\nMySQL 5.6 Microseconds\n----------------------\n\nMySQL 5.6 introduced microseconds using a slightly different implementation to\nMariaDB 5.3. Since MariaDB 10.1, MariaDB has defaulted to the MySQL format, by\nmeans of the --mysql56-temporal-format variable. The MySQL version requires\nslightly more storage but has some advantages in permitting the eventual\nsupport of negative dates, and in replication.\n\nURL: https://mariadb.com/kb/en/microseconds-in-mariadb/','','https://mariadb.com/kb/en/microseconds-in-mariadb/'),
(513,'ADDTIME',31,'Syntax\n------\n\nADDTIME(expr1,expr2)\n\nDescription\n-----------\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or\ndatetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n+---------------------------------------------------------+\n| ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\') |\n+---------------------------------------------------------+\n| 2008-01-02 01:01:01.000001                              |\n+---------------------------------------------------------+\n\nSELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| 03:00:01.999997                               |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/addtime/','','https://mariadb.com/kb/en/addtime/'),
(510,'Date and Time Units',31,'The INTERVAL keyword can be used to add or subtract a time interval of time to\na DATETIME, DATE or TIME value.\n\nThe syntax is:\n\nINTERVAL time_quantity time_unit\n\nFor example, the SECOND unit is used below by the DATE_ADD() function:\n\nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n\nThe following units are valid:\n\n+---------------------+------------------------------------------------------+\n| Unit                | Description                                          |\n+---------------------+------------------------------------------------------+\n| MICROSECOND         | Microseconds                                         |\n+---------------------+------------------------------------------------------+\n| SECOND              | Seconds                                              |\n+---------------------+------------------------------------------------------+\n| MINUTE              | Minutes                                              |\n+---------------------+------------------------------------------------------+\n| HOUR                | Hours                                                |\n+---------------------+------------------------------------------------------+\n| DAY                 | Days                                                 |\n+---------------------+------------------------------------------------------+\n| WEEK                | Weeks                                                |\n+---------------------+------------------------------------------------------+\n| MONTH               | Months                                               |\n+---------------------+------------------------------------------------------+\n| QUARTER             | Quarters                                             |\n+---------------------+------------------------------------------------------+\n| YEAR                | Years                                                |\n+---------------------+------------------------------------------------------+\n| SECOND_MICROSECOND  | Seconds.Microseconds                                 |\n+---------------------+------------------------------------------------------+\n| MINUTE_MICROSECOND  | Minutes.Seconds.Microseconds                         |\n+---------------------+------------------------------------------------------+\n| MINUTE_SECOND       | Minutes.Seconds                                      |\n+---------------------+------------------------------------------------------+\n| HOUR_MICROSECOND    | Hours.Minutes.Seconds.Microseconds                   |\n+---------------------+------------------------------------------------------+\n| HOUR_SECOND         | Hours.Minutes.Seconds                                |\n+---------------------+------------------------------------------------------+\n| HOUR_MINUTE         | Hours.Minutes                                        |\n+---------------------+------------------------------------------------------+\n| DAY_MICROSECOND     | Days Hours.Minutes.Seconds.Microseconds              |\n+---------------------+------------------------------------------------------+\n| DAY_SECOND          | Days Hours.Minutes.Seconds                           |\n+---------------------+------------------------------------------------------+\n| DAY_MINUTE          | Days Hours.Minutes                                   |\n+---------------------+------------------------------------------------------+\n| DAY_HOUR            | Days Hours                                           |\n+---------------------+------------------------------------------------------+\n| YEAR_MONTH          | Years-Months                                         |\n+---------------------+------------------------------------------------------+\n\nThe time units containing an underscore are composite; that is, they consist\nof multiple base time units. For base time units, time_quantity is an integer\nnumber. For composite units, the quantity must be expressed as a string with\nmultiple integer numbers separated by any punctuation character.\n\nExample of composite units:\n\nINTERVAL \'2:2\' YEAR_MONTH\nINTERVAL \'1:30:30\' HOUR_SECOND\nINTERVAL \'1!30!30\' HOUR_SECOND -- same as above\n\nTime units can be used in the following contexts:\n\n* after a + or a - operator;\n* with the following DATE or TIME functions: ADDDATE(), SUBDATE(), DATE_ADD(),\nDATE_SUB(), TIMESTAMPADD(), TIMESTAMPDIFF(), EXTRACT();\n* in the ON SCHEDULE clause of CREATE EVENT and ALTER EVENT.\n* when defining a partitioning BY SYSTEM_TIME\n\nURL: https://mariadb.com/kb/en/date-and-time-units/','','https://mariadb.com/kb/en/date-and-time-units/'),
(514,'CONVERT_TZ',31,'Syntax\n------\n\nCONVERT_TZ(dt,from_tz,to_tz)\n\nDescription\n-----------\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by from_tz\nto the time zone given by to_tz and returns the resulting value.\n\nIn order to use named time zones, such as GMT, MET or Africa/Johannesburg, the\ntime_zone tables must be loaded (see mysql_tzinfo_to_sql).\n\nNo conversion will take place if the value falls outside of the supported\nTIMESTAMP range (\'1970-01-01 00:00:01\' to \'2038-01-19 05:14:07\' UTC) when\nconverted from from_tz to UTC.\n\nThis function returns NULL if the arguments are invalid (or named time zones\nhave not been loaded).\n\nSee time zones for more information.\n\nExamples\n--------\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 2016-01-01 22:00:00                                 |\n+-----------------------------------------------------+\n\nUsing named time zones (with the time zone tables loaded):\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\');\n+---------------------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\') |\n+---------------------------------------------------------------+\n| 2016-01-01 14:00:00                                           |\n+---------------------------------------------------------------+\n\nThe value is out of the TIMESTAMP range, so no conversion takes place:\n\nSELECT CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 1969-12-31 22:00:00                                 |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/convert_tz/','','https://mariadb.com/kb/en/convert_tz/'),
(515,'CURDATE',31,'Syntax\n------\n\nCURDATE()\nCURRENT_DATE\nCURRENT_DATE()\n\nDescription\n-----------\n\nCURDATE returns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or numeric\ncontext.\n\nCURRENT_DATE and CURRENT_DATE() are synonyms.\n\nExamples\n--------\n\nSELECT CURDATE();\n+------------+\n| CURDATE()  |\n+------------+\n| 2019-03-05 |\n+------------+\n\nIn a numeric context (note this is not performing date calculations):\n\nSELECT CURDATE() +0;\n+--------------+\n| CURDATE() +0 |\n+--------------+\n|     20190305 |\n+--------------+\n\nData calculation:\n\nSELECT CURDATE() - INTERVAL 5 DAY;\n+----------------------------+\n| CURDATE() - INTERVAL 5 DAY |\n+----------------------------+\n| 2019-02-28                 |\n+----------------------------+\n\nURL: https://mariadb.com/kb/en/curdate/','','https://mariadb.com/kb/en/curdate/'),
(521,'DATEDIFF',31,'Syntax\n------\n\nDATEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nDATEDIFF() returns (expr1 – expr2) expressed as a value in days from one date\nto the other. expr1 and expr2 are date or date-and-time expressions. Only the\ndate parts of the values are used in the calculation.\n\nExamples\n--------\n\nSELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n+----------------------------------------------+\n| DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\') |\n+----------------------------------------------+\n|                                            1 |\n+----------------------------------------------+\n\nSELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n+----------------------------------------------+\n| DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\') |\n+----------------------------------------------+\n|                                          -31 |\n+----------------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2011-05-23 10:56:05 |\n+---------------------+\n\nSELECT d, DATEDIFF(NOW(),d) FROM t1;\n+---------------------+-------------------+\n| d                   | DATEDIFF(NOW(),d) |\n+---------------------+-------------------+\n| 2007-01-30 21:31:07 |              1574 |\n| 1983-10-15 06:42:51 |             10082 |\n| 2011-04-21 12:34:56 |                32 |\n| 2011-10-30 06:31:41 |              -160 |\n| 2011-01-30 14:03:25 |               113 |\n| 2004-10-07 11:19:34 |              2419 |\n+---------------------+-------------------+\n\nURL: https://mariadb.com/kb/en/datediff/','','https://mariadb.com/kb/en/datediff/'),
(522,'DATE_ADD',31,'Syntax\n------\n\nDATE_ADD(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a \"-\" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nExamples\n--------\n\nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00                       |\n+-------------------------------------------+\n\nSELECT INTERVAL 1 DAY + \'2008-12-31\';\n+-------------------------------+\n| INTERVAL 1 DAY + \'2008-12-31\' |\n+-------------------------------+\n| 2009-01-01                    |\n+-------------------------------+\n\nSELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n+----------------------------------+\n| \'2005-01-01\' - INTERVAL 1 SECOND |\n+----------------------------------+\n| 2004-12-31 23:59:59              |\n+----------------------------------+\n\nSELECT DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND);\n+----------------------------------------------------+\n| DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND) |\n+----------------------------------------------------+\n| 2001-01-01 00:00:00                                |\n+----------------------------------------------------+\n\nSELECT DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY);\n+-------------------------------------------------+\n| DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY) |\n+-------------------------------------------------+\n| 2011-01-01 23:59:59                             |\n+-------------------------------------------------+\n\nSELECT DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND);\n+---------------------------------------------------------------+\n| DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND) |\n+---------------------------------------------------------------+\n| 2101-01-01 00:01:00                                           |\n+---------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR);\n+------------------------------------------------------------+\n| DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR) |\n+------------------------------------------------------------+\n| 1899-12-30 14:00:00                                        |\n+------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND);\n+------------------------------------------------------------------------------\n-+\n| DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND) |\n+------------------------------------------------------------------------------\n-+\n| 1993-01-01 00:00:01.000001                                                  \n |\n+------------------------------------------------------------------------------\n-+\n\nURL: https://mariadb.com/kb/en/date_add/','','https://mariadb.com/kb/en/date_add/'),
(524,'DATE_SUB',31,'Syntax\n------\n\nDATE_SUB(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a \"-\" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nSee also DATE_ADD().\n\nExamples\n--------\n\nSELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 1997-12-02                              |\n+-----------------------------------------+\n\nSELECT DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND);\n+----------------------------------------------------------------+\n| DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND) |\n+----------------------------------------------------------------+\n| 2004-12-30 22:58:59                                            |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/date_sub/','','https://mariadb.com/kb/en/date_sub/'),
(526,'DAYNAME',31,'Syntax\n------\n\nDAYNAME(date)\n\nDescription\n-----------\n\nReturns the name of the weekday for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT DAYNAME(\'2007-02-03\');\n+-----------------------+\n| DAYNAME(\'2007-02-03\') |\n+-----------------------+\n| Saturday              |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, DAYNAME(d) FROM t1;\n+---------------------+------------+\n| d                   | DAYNAME(d) |\n+---------------------+------------+\n| 2007-01-30 21:31:07 | Tuesday    |\n| 1983-10-15 06:42:51 | Saturday   |\n| 2011-04-21 12:34:56 | Thursday   |\n| 2011-10-30 06:31:41 | Sunday     |\n| 2011-01-30 14:03:25 | Sunday     |\n| 2004-10-07 11:19:34 | Thursday   |\n+---------------------+------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT DAYNAME(\'2013-04-01\');\n+-----------------------+\n| DAYNAME(\'2013-04-01\') |\n+-----------------------+\n| lundi                 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/dayname/','','https://mariadb.com/kb/en/dayname/'),
(527,'DAYOFMONTH',31,'Syntax\n------\n\nDAYOFMONTH(date)\n\nDescription\n-----------\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for dates\nsuch as \'0000-00-00\' or \'2008-00-00\' which have a zero day part.\n\nDAY() is a synonym.\n\nExamples\n--------\n\nSELECT DAYOFMONTH(\'2007-02-03\');\n+--------------------------+\n| DAYOFMONTH(\'2007-02-03\') |\n+--------------------------+\n|                        3 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d FROM t1 where DAYOFMONTH(d) = 30;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/dayofmonth/','','https://mariadb.com/kb/en/dayofmonth/'),
(528,'DAYOFWEEK',31,'Syntax\n------\n\nDAYOFWEEK(date)\n\nDescription\n-----------\n\nReturns the day of the week index for the date (1 = Sunday, 2 = Monday, ..., 7\n= Saturday). These index values correspond to the ODBC standard.\n\nThis contrasts with WEEKDAY() which follows a different index numbering (0 =\nMonday, 1 = Tuesday, ... 6 = Sunday).\n\nExamples\n--------\n\nSELECT DAYOFWEEK(\'2007-02-03\');\n+-------------------------+\n| DAYOFWEEK(\'2007-02-03\') |\n+-------------------------+\n|                       7 |\n+-------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, DAYNAME(d), DAYOFWEEK(d), WEEKDAY(d) from t1;\n+---------------------+------------+--------------+------------+\n| d                   | DAYNAME(d) | DAYOFWEEK(d) | WEEKDAY(d) |\n+---------------------+------------+--------------+------------+\n| 2007-01-30 21:31:07 | Tuesday    |            3 |          1 |\n| 1983-10-15 06:42:51 | Saturday   |            7 |          5 |\n| 2011-04-21 12:34:56 | Thursday   |            5 |          3 |\n| 2011-10-30 06:31:41 | Sunday     |            1 |          6 |\n| 2011-01-30 14:03:25 | Sunday     |            1 |          6 |\n| 2004-10-07 11:19:34 | Thursday   |            5 |          3 |\n+---------------------+------------+--------------+------------+\n\nURL: https://mariadb.com/kb/en/dayofweek/','','https://mariadb.com/kb/en/dayofweek/'),
(530,'EXTRACT',31,'Syntax\n------\n\nEXTRACT(unit FROM date)\n\nDescription\n-----------\n\nThe EXTRACT() function extracts the required unit from the date. See Date and\nTime Units for a complete list of permitted units.\n\nIn MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM ...) was changed to\nreturn a value from 0 to 23, adhering to the SQL standard. Until MariaDB\n10.0.6 and MariaDB 5.5.34, and in all versions of MySQL at least as of MySQL\n5.7, it could return a value > 23. HOUR() is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nExamples\n--------\n\nSELECT EXTRACT(YEAR FROM \'2009-07-02\');\n+---------------------------------+\n| EXTRACT(YEAR FROM \'2009-07-02\') |\n+---------------------------------+\n|                            2009 |\n+---------------------------------+\n\nSELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n|                                         200907 |\n+------------------------------------------------+\n\nSELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n|                                          20102 |\n+------------------------------------------------+\n\nSELECT EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\');\n+--------------------------------------------------------+\n| EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\') |\n+--------------------------------------------------------+\n|                                                    123 |\n+--------------------------------------------------------+\n\nFrom MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM...) returns a value\nfrom 0 to 23, as per the SQL standard. HOUR is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n|                             2 |               26 |\n+-------------------------------+------------------+\n\nURL: https://mariadb.com/kb/en/extract/','','https://mariadb.com/kb/en/extract/'),
(533,'GET_FORMAT',31,'Syntax\n------\n\nGET_FORMAT({DATE|DATETIME|TIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nDescription\n-----------\n\nReturns a format string. This function is useful in combination with the\nDATE_FORMAT() and the STR_TO_DATE() functions.\n\nPossible result formats are:\n\n+--------------------------------------+--------------------------------------+\n| Function Call                        | Result Format                        |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'EUR\')               | \'%d.%m.%Y\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'USA\')               | \'%m.%d.%Y\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'JIS\')               | \'%Y-%m-%d\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'ISO\')               | \'%Y-%m-%d\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'INTERNAL\')          | \'%Y%m%d\'                             |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'EUR\')           | \'%Y-%m-%d %H.%i.%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'USA\')           | \'%Y-%m-%d %H.%i.%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'JIS\')           | \'%Y-%m-%d %H:%i:%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'ISO\')           | \'%Y-%m-%d %H:%i:%s\'                  |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'INTERNAL\')      | \'%Y%m%d%H%i%s\'                       |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'EUR\')               | \'%H.%i.%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'USA\')               | \'%h:%i:%s %p\'                        |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'JIS\')               | \'%H:%i:%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'ISO\')               | \'%H:%i:%s\'                           |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'INTERNAL\')          | \'%H%i%s\'                             |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nObtaining the string matching to the standard European date format:\n\nSELECT GET_FORMAT(DATE, \'EUR\');\n+-------------------------+\n| GET_FORMAT(DATE, \'EUR\') |\n+-------------------------+\n| %d.%m.%Y                |\n+-------------------------+\n\nUsing the same string to format a date:\n\nSELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n+--------------------------------------------------+\n| DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\')) |\n+--------------------------------------------------+\n| 03.10.2003                                       |\n+--------------------------------------------------+\n\nSELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n+--------------------------------------------------+\n| STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\')) |\n+--------------------------------------------------+\n| 2003-10-31                                       |\n+--------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/get_format/','','https://mariadb.com/kb/en/get_format/'),
(534,'HOUR',31,'Syntax\n------\n\nHOUR(time)\n\nDescription\n-----------\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much larger,\nso HOUR can return values greater than 23.\n\nThe return value is always positive, even if a negative TIME value is provided.\n\nExamples\n--------\n\nSELECT HOUR(\'10:05:03\');\n+------------------+\n| HOUR(\'10:05:03\') |\n+------------------+\n|               10 |\n+------------------+\n\nSELECT HOUR(\'272:59:59\');\n+-------------------+\n| HOUR(\'272:59:59\') |\n+-------------------+\n|               272 |\n+-------------------+\n\nDifference between EXTRACT (HOUR FROM ...) (>= MariaDB 10.0.7 and MariaDB\n5.5.35) and HOUR:\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n|                             2 |               26 |\n+-------------------------------+------------------+\n\nURL: https://mariadb.com/kb/en/hour/','','https://mariadb.com/kb/en/hour/'),
(535,'LAST_DAY',31,'Syntax\n------\n\nLAST_DAY(date)\n\nDescription\n-----------\n\nTakes a date or datetime value and returns the corresponding value for the\nlast day of the month. Returns NULL if the argument is invalid.\n\nExamples\n--------\n\nSELECT LAST_DAY(\'2003-02-05\');\n+------------------------+\n| LAST_DAY(\'2003-02-05\') |\n+------------------------+\n| 2003-02-28             |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-02-05\');\n+------------------------+\n| LAST_DAY(\'2004-02-05\') |\n+------------------------+\n| 2004-02-29             |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-01-01 01:01:01\');\n+---------------------------------+\n| LAST_DAY(\'2004-01-01 01:01:01\') |\n+---------------------------------+\n| 2004-01-31                      |\n+---------------------------------+\n\nSELECT LAST_DAY(\'2003-03-32\');\n+------------------------+\n| LAST_DAY(\'2003-03-32\') |\n+------------------------+\n| NULL                   |\n+------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Incorrect datetime value: \'2003-03-32\'\n\nURL: https://mariadb.com/kb/en/last_day/','','https://mariadb.com/kb/en/last_day/'),
(538,'MAKEDATE',31,'Syntax\n------\n\nMAKEDATE(year,dayofyear)\n\nDescription\n-----------\n\nReturns a date, given year and day-of-year values. dayofyear must be greater\nthan 0 or the result is NULL.\n\nExamples\n--------\n\nSELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n+-------------------+-------------------+\n| MAKEDATE(2011,31) | MAKEDATE(2011,32) |\n+-------------------+-------------------+\n| 2011-01-31        | 2011-02-01        |\n+-------------------+-------------------+\n\nSELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n+--------------------+--------------------+\n| MAKEDATE(2011,365) | MAKEDATE(2014,365) |\n+--------------------+--------------------+\n| 2011-12-31         | 2014-12-31         |\n+--------------------+--------------------+\n\nSELECT MAKEDATE(2011,0);\n+------------------+\n| MAKEDATE(2011,0) |\n+------------------+\n| NULL             |\n+------------------+\n\nURL: https://mariadb.com/kb/en/makedate/','','https://mariadb.com/kb/en/makedate/'),
(539,'MAKETIME',31,'Syntax\n------\n\nMAKETIME(hour,minute,second)\n\nDescription\n-----------\n\nReturns a time value calculated from the hour, minute, and second arguments.\n\nIf minute or second are out of the range 0 to 60, NULL is returned. The hour\ncan be in the range -838 to 838, outside of which the value is truncated with\na warning.\n\nExamples\n--------\n\nSELECT MAKETIME(13,57,33);\n+--------------------+\n| MAKETIME(13,57,33) |\n+--------------------+\n| 13:57:33           |\n+--------------------+\n\nSELECT MAKETIME(-13,57,33);\n+---------------------+\n| MAKETIME(-13,57,33) |\n+---------------------+\n| -13:57:33           |\n+---------------------+\n\nSELECT MAKETIME(13,67,33);\n+--------------------+\n| MAKETIME(13,67,33) |\n+--------------------+\n| NULL               |\n+--------------------+\n\nSELECT MAKETIME(-1000,57,33);\n+-----------------------+\n| MAKETIME(-1000,57,33) |\n+-----------------------+\n| -838:59:59            |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------------+\n| Level   | Code | Message                                       |\n+---------+------+-----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'-1000:57:33\' |\n+---------+------+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/maketime/','','https://mariadb.com/kb/en/maketime/'),
(540,'MICROSECOND',31,'Syntax\n------\n\nMICROSECOND(expr)\n\nDescription\n-----------\n\nReturns the microseconds from the time or datetime expression expr as a number\nin the range from 0 to 999999.\n\nIf expr is a time with no microseconds, zero is returned, while if expr is a\ndate with no time, zero with a warning is returned.\n\nExamples\n--------\n\nSELECT MICROSECOND(\'12:00:00.123456\');\n+--------------------------------+\n| MICROSECOND(\'12:00:00.123456\') |\n+--------------------------------+\n|                         123456 |\n+--------------------------------+\n\nSELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n+-------------------------------------------+\n| MICROSECOND(\'2009-12-31 23:59:59.000010\') |\n+-------------------------------------------+\n|                                        10 |\n+-------------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07 12:13:14\');\n+------------------------------------+\n| MICROSECOND(\'2013-08-07 12:13:14\') |\n+------------------------------------+\n|                                  0 |\n+------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07\');\n+---------------------------+\n| MICROSECOND(\'2013-08-07\') |\n+---------------------------+\n|                         0 |\n+---------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------------+\n| Level   | Code | Message                                      |\n+---------+------+----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'2013-08-07\' |\n+---------+------+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/microsecond/','','https://mariadb.com/kb/en/microsecond/'),
(544,'NOW',31,'Syntax\n------\n\nNOW([precision])\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\nLOCALTIME, LOCALTIME([precision])\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context. The value is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nNOW() (or its synonyms) can be used as the default value for TIMESTAMP columns\nas well as, since MariaDB 10.0.1, DATETIME columns. Before MariaDB 10.0.1, it\nwas only possible for a single TIMESTAMP column per table to contain the\nCURRENT_TIMESTAMP as its default.\n\nWhen displayed in the INFORMATION_SCHEMA.COLUMNS table, a default CURRENT\nTIMESTAMP is displayed as CURRENT_TIMESTAMP up until MariaDB 10.2.2, and as\ncurrent_timestamp() from MariaDB 10.2.3, due to to MariaDB 10.2 accepting\nexpressions in the DEFAULT clause.\n\nChanging the timestamp system variable with a SET timestamp statement affects\nthe value returned by NOW(), but not by SYSDATE().\n\nExamples\n--------\n\nSELECT NOW();\n+---------------------+\n| NOW()               |\n+---------------------+\n| 2010-03-27 13:13:25 |\n+---------------------+\n\nSELECT NOW() + 0;\n+-----------------------+\n| NOW() + 0             |\n+-----------------------+\n| 20100327131329.000000 |\n+-----------------------+\n\nWith precision:\n\nSELECT CURRENT_TIMESTAMP(2);\n+------------------------+\n| CURRENT_TIMESTAMP(2)   |\n+------------------------+\n| 2018-07-10 09:47:26.24 |\n+------------------------+\n\nUsed as a default TIMESTAMP:\n\nCREATE TABLE t (createdTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);\n\nFrom MariaDB 10.2.2:\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\\G\n*************************** 1. row ***************************\n     TABLE_CATALOG: def\n      TABLE_SCHEMA: test\n       TABLE_NAME: t\n      COLUMN_NAME: ts\n    ORDINAL_POSITION: 1\n     COLUMN_DEFAULT: current_timestamp()\n...\n\n<= MariaDB 10.2.1\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\\G\n*************************** 1. row ***************************\n     TABLE_CATALOG: def\n      TABLE_SCHEMA: test\n       TABLE_NAME: t\n      COLUMN_NAME: createdTS\n    ORDINAL_POSITION: 1\n     COLUMN_DEFAULT: CURRENT_TIMESTAMP\n...\n\nURL: https://mariadb.com/kb/en/now/','','https://mariadb.com/kb/en/now/'),
(545,'PERIOD_ADD',31,'Syntax\n------\n\nPERIOD_ADD(P,N)\n\nDescription\n-----------\n\nAdds N months to period P. P is in the format YYMM or YYYYMM, and is not a\ndate value. If P contains a two-digit year, values from 00 to 69 are converted\nto from 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nReturns a value in the format YYYYMM.\n\nExamples\n--------\n\nSELECT PERIOD_ADD(200801,2);\n+----------------------+\n| PERIOD_ADD(200801,2) |\n+----------------------+\n|               200803 |\n+----------------------+\n\nSELECT PERIOD_ADD(6910,2);\n+--------------------+\n| PERIOD_ADD(6910,2) |\n+--------------------+\n|             206912 |\n+--------------------+\n\nSELECT PERIOD_ADD(7010,2);\n+--------------------+\n| PERIOD_ADD(7010,2) |\n+--------------------+\n|             197012 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/period_add/','','https://mariadb.com/kb/en/period_add/'),
(546,'PERIOD_DIFF',31,'Syntax\n------\n\nPERIOD_DIFF(P1,P2)\n\nDescription\n-----------\n\nReturns the number of months between periods P1 and P2. P1 and P2 can be in\nthe format YYMM or YYYYMM, and are not date values.\n\nIf P1 or P2 contains a two-digit year, values from 00 to 69 are converted to\nfrom 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nExamples\n--------\n\nSELECT PERIOD_DIFF(200802,200703);\n+----------------------------+\n| PERIOD_DIFF(200802,200703) |\n+----------------------------+\n|                         11 |\n+----------------------------+\n\nSELECT PERIOD_DIFF(6902,6803);\n+------------------------+\n| PERIOD_DIFF(6902,6803) |\n+------------------------+\n|                     11 |\n+------------------------+\n\nSELECT PERIOD_DIFF(7002,6803);\n+------------------------+\n| PERIOD_DIFF(7002,6803) |\n+------------------------+\n|                  -1177 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/period_diff/','','https://mariadb.com/kb/en/period_diff/'),
(549,'SEC_TO_TIME',31,'Syntax\n------\n\nSEC_TO_TIME(seconds)\n\nDescription\n-----------\n\nReturns the seconds argument, converted to hours, minutes, and seconds, as a\nTIME value. The range of the result is constrained to that of the TIME data\ntype. A warning occurs if the argument corresponds to a value outside that\nrange.\n\nThe time will be returned in the format hh:mm:ss, or hhmmss if used in a\nnumeric calculation.\n\nExamples\n--------\n\nSELECT SEC_TO_TIME(12414);\n+--------------------+\n| SEC_TO_TIME(12414) |\n+--------------------+\n| 03:26:54           |\n+--------------------+\n\nSELECT SEC_TO_TIME(12414)+0;\n+----------------------+\n| SEC_TO_TIME(12414)+0 |\n+----------------------+\n|                32654 |\n+----------------------+\n\nSELECT SEC_TO_TIME(9999999);\n+----------------------+\n| SEC_TO_TIME(9999999) |\n+----------------------+\n| 838:59:59            |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------+\n| Level   | Code | Message                                   |\n+---------+------+-------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'9999999\' |\n+---------+------+-------------------------------------------+\n\nURL: https://mariadb.com/kb/en/sec_to_time/','','https://mariadb.com/kb/en/sec_to_time/'),
(551,'SUBDATE',31,'Syntax\n------\n\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE() is a\nsynonym for DATE_SUB(). See Date and Time Units for a complete list of\npermitted units.\n\nThe second form allows the use of an integer value for days. In such cases, it\nis interpreted as the number of days to be subtracted from the date or\ndatetime expression expr.\n\nExamples\n--------\n\nSELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2007-12-02                              |\n+-----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| SUBDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2007-12-02                             |\n+----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n+------------------------------------+\n| SUBDATE(\'2008-01-02 12:00:00\', 31) |\n+------------------------------------+\n| 2007-12-02 12:00:00                |\n+------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, SUBDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d                   | SUBDATE(d, 10)      |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-01-20 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-05 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-11 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-20 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-20 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-09-27 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, SUBDATE(d, INTERVAL 10 MINUTE) from t1;\n+---------------------+--------------------------------+\n| d                   | SUBDATE(d, INTERVAL 10 MINUTE) |\n+---------------------+--------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-30 21:21:07            |\n| 1983-10-15 06:42:51 | 1983-10-15 06:32:51            |\n| 2011-04-21 12:34:56 | 2011-04-21 12:24:56            |\n| 2011-10-30 06:31:41 | 2011-10-30 06:21:41            |\n| 2011-01-30 14:03:25 | 2011-01-30 13:53:25            |\n| 2004-10-07 11:19:34 | 2004-10-07 11:09:34            |\n+---------------------+--------------------------------+\n\nURL: https://mariadb.com/kb/en/subdate/','','https://mariadb.com/kb/en/subdate/'),
(552,'SUBTIME',31,'Syntax\n------\n\nSUBTIME(expr1,expr2)\n\nDescription\n-----------\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format as\nexpr1. expr1 is a time or datetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n+--------------------------------------------------------+\n| SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\') |\n+--------------------------------------------------------+\n| 2007-12-30 22:58:58.999997                             |\n+--------------------------------------------------------+\n\nSELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| -00:59:59.999999                              |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/subtime/','','https://mariadb.com/kb/en/subtime/'),
(553,'SYSDATE',31,'Syntax\n------\n\nSYSDATE([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the time at\nwhich the statement began to execute. (Within a stored routine or trigger,\nNOW() returns the time at which the routine or triggering statement began to\nexecute.)\n\nIn addition, changing the timestamp system variable with a SET timestamp\nstatement affects the value returned by NOW() but not by SYSDATE(). This means\nthat timestamp settings in the binary log have no effect on invocations of\nSYSDATE().\n\nBecause SYSDATE() can return different values even within the same statement,\nand is not affected by SET TIMESTAMP, it is non-deterministic and therefore\nunsafe for replication if statement-based binary logging is used. If that is a\nproblem, you can use row-based logging, or start the server with the mysqld\noption --sysdate-is-now to cause SYSDATE() to be an alias for NOW(). The\nnon-deterministic nature of SYSDATE() also means that indexes cannot be used\nfor evaluating expressions that refer to it, and that statements using the\nSYSDATE() function are unsafe for statement-based replication.\n\nExamples\n--------\n\nDifference between NOW() and SYSDATE():\n\nSELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW()               | SLEEP(2) | NOW()               |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:40 |        0 | 2010-03-27 13:23:40 |\n+---------------------+----------+---------------------+\n\nSELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE()           | SLEEP(2) | SYSDATE()           |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:52 |        0 | 2010-03-27 13:23:54 |\n+---------------------+----------+---------------------+\n\nWith precision:\n\nSELECT SYSDATE(4);\n+--------------------------+\n| SYSDATE(4)               |\n+--------------------------+\n| 2018-07-10 10:17:13.1689 |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/sysdate/','','https://mariadb.com/kb/en/sysdate/'),
(555,'TIMEDIFF',31,'Syntax\n------\n\nTIMEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and expr2\nare time or date-and-time expressions, but both must be of the same type.\n\nExamples\n--------\n\nSELECT TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\');\n+---------------------------------------------------------------+\n| TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\') |\n+---------------------------------------------------------------+\n| -00:00:00.000001                                              |\n+---------------------------------------------------------------+\n\nSELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\');\n+----------------------------------------------------------------------+\n| TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\') |\n+----------------------------------------------------------------------+\n| 46:58:57.999999                                                      |\n+----------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/timediff/','','https://mariadb.com/kb/en/timediff/'),
(556,'TIMESTAMP FUNCTION',31,'Syntax\n------\n\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nDescription\n-----------\n\nWith a single argument, this function returns the date or datetime expression\nexpr as a datetime value. With two arguments, it adds the time expression\nexpr2 to the date or datetime expression expr1 and returns the result as a\ndatetime value.\n\nExamples\n--------\n\nSELECT TIMESTAMP(\'2003-12-31\');\n+-------------------------+\n| TIMESTAMP(\'2003-12-31\') |\n+-------------------------+\n| 2003-12-31 00:00:00     |\n+-------------------------+\n\nSELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\');\n+--------------------------------------------+\n| TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\') |\n+--------------------------------------------+\n| 2003-12-31 18:30:00                        |\n+--------------------------------------------+\n\nURL: https://mariadb.com/kb/en/timestamp-function/','','https://mariadb.com/kb/en/timestamp-function/'),
(557,'TIMESTAMPADD',31,'Syntax\n------\n\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nDescription\n-----------\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument, which\nshould be one of the following values: MICROSECOND, SECOND, MINUTE, HOUR, DAY,\nWEEK, MONTH, QUARTER, or YEAR.\n\nThe unit value may be specified using one of keywords as shown, or with a\nprefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nBefore MariaDB 5.5, FRAC_SECOND was permitted as a synonym for MICROSECOND.\n\nExamples\n--------\n\nSELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n+-------------------------------------+\n| TIMESTAMPADD(MINUTE,1,\'2003-01-02\') |\n+-------------------------------------+\n| 2003-01-02 00:01:00                 |\n+-------------------------------------+\n\nSELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n+-----------------------------------+\n| TIMESTAMPADD(WEEK,1,\'2003-01-02\') |\n+-----------------------------------+\n| 2003-01-09                        |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/timestampadd/','','https://mariadb.com/kb/en/timestampadd/'),
(558,'TIMESTAMPDIFF',31,'Syntax\n------\n\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nDescription\n-----------\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be a date\nand the other a datetime; a date value is treated as a datetime having the\ntime part \'00:00:00\' where necessary. The unit for the result (an integer) is\ngiven by the unit argument. The legal values for unit are the same as those\nlisted in the description of the TIMESTAMPADD() function, i.e MICROSECOND,\nSECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.\n\nTIMESTAMPDIFF can also be used to calculate age.\n\nExamples\n--------\n\nSELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n+------------------------------------------------+\n| TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\') |\n+------------------------------------------------+\n|                                              3 |\n+------------------------------------------------+\n\nSELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n+-----------------------------------------------+\n| TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\') |\n+-----------------------------------------------+\n|                                            -1 |\n+-----------------------------------------------+\n\nSELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n+----------------------------------------------------------+\n| TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\') |\n+----------------------------------------------------------+\n|                                                   128885 |\n+----------------------------------------------------------+\n\nCalculating age:\n\nSELECT CURDATE();\n+------------+\n| CURDATE()  |\n+------------+\n| 2019-05-27 |\n+------------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-06-06\', CURDATE()) AS age;\n+------+\n| age  |\n+------+\n|   47 |\n+------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-05-06\', CURDATE()) AS age;\n+------+\n| age  |\n+------+\n|   48 |\n+------+\n\nAge as of 2014-08-02:\n\nSELECT name, date_of_birth, TIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS\nage \n FROM student_details;\n+---------+---------------+------+\n| name    | date_of_birth | age  |\n+---------+---------------+------+\n| Chun    | 1993-12-31    |   20 |\n| Esben   | 1946-01-01    |   68 |\n| Kaolin  | 1996-07-16    |   18 |\n| Tatiana | 1988-04-13    |   26 |\n+---------+---------------+------+\n\nURL: https://mariadb.com/kb/en/timestampdiff/','','https://mariadb.com/kb/en/timestampdiff/'),
(560,'TIME_TO_SEC',31,'Syntax\n------\n\nTIME_TO_SEC(time)\n\nDescription\n-----------\n\nReturns the time argument, converted to seconds.\n\nThe value returned by TIME_TO_SEC is of type DOUBLE. Before MariaDB 5.3 (and\nMySQL 5.6), the type was INT. The returned value preserves microseconds of the\nargument. See also Microseconds in MariaDB.\n\nExamples\n--------\n\nSELECT TIME_TO_SEC(\'22:23:00\');\n+-------------------------+\n| TIME_TO_SEC(\'22:23:00\') |\n+-------------------------+\n|                   80580 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'00:39:38\');\n+-------------------------+\n| TIME_TO_SEC(\'00:39:38\') |\n+-------------------------+\n|                    2378 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'09:12:55.2355\');\n+------------------------------+\n| TIME_TO_SEC(\'09:12:55.2355\') |\n+------------------------------+\n|                   33175.2355 |\n+------------------------------+\n1 row in set (0.000 sec)\n\nURL: https://mariadb.com/kb/en/time_to_sec/','','https://mariadb.com/kb/en/time_to_sec/'),
(561,'TO_DAYS',31,'Syntax\n------\n\nTO_DAYS(date)\n\nDescription\n-----------\n\nGiven a date date, returns the number of days since the start of the current\ncalendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the FROM_DAYS() function.\n\nExamples\n--------\n\nSELECT TO_DAYS(\'2007-10-07\');\n+-----------------------+\n| TO_DAYS(\'2007-10-07\') |\n+-----------------------+\n|                733321 |\n+-----------------------+\n\nSELECT TO_DAYS(\'0000-01-01\');\n+-----------------------+\n| TO_DAYS(\'0000-01-01\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nSELECT TO_DAYS(950501);\n+-----------------+\n| TO_DAYS(950501) |\n+-----------------+\n|          728779 |\n+-----------------+\n\nURL: https://mariadb.com/kb/en/to_days/','','https://mariadb.com/kb/en/to_days/'),
(562,'TO_SECONDS',31,'Syntax\n------\n\nTO_SECONDS(expr)\n\nDescription\n-----------\n\nReturns the number of seconds from year 0 till expr, or NULL if expr is not a\nvalid date or datetime.\n\nExamples\n--------\n\nSELECT TO_SECONDS(\'2013-06-13\');\n+--------------------------+\n| TO_SECONDS(\'2013-06-13\') |\n+--------------------------+\n|              63538300800 |\n+--------------------------+\n\nSELECT TO_SECONDS(\'2013-06-13 21:45:13\');\n+-----------------------------------+\n| TO_SECONDS(\'2013-06-13 21:45:13\') |\n+-----------------------------------+\n|                       63538379113 |\n+-----------------------------------+\n\nSELECT TO_SECONDS(NOW());\n+-------------------+\n| TO_SECONDS(NOW()) |\n+-------------------+\n|       63543530875 |\n+-------------------+\n\nSELECT TO_SECONDS(20130513);\n+----------------------+\n| TO_SECONDS(20130513) |\n+----------------------+\n|          63535622400 |\n+----------------------+\n1 row in set (0.00 sec)\n\nSELECT TO_SECONDS(130513);\n+--------------------+\n| TO_SECONDS(130513) |\n+--------------------+\n|        63535622400 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/to_seconds/','','https://mariadb.com/kb/en/to_seconds/'),
(563,'UNIX_TIMESTAMP',31,'Syntax\n------\n\nUNIX_TIMESTAMP()\nUNIX_TIMESTAMP(date)\n\nDescription\n-----------\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP() is\ncalled with a date argument, it returns the value of the argument as seconds\nsince \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a DATETIME string,\na TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD. The server\ninterprets date as a value in the current time zone and converts it to an\ninternal value in UTC. Clients can set their time zone as described in time\nzones.\n\nThe inverse function of UNIX_TIMESTAMP() is FROM_UNIXTIME()\n\nUNIX_TIMESTAMP() supports microseconds.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a date beyond this will result in NULL being returned. Use\nDATETIME as a storage type if you require dates beyond this.\n\nError Handling\n--------------\n\nReturns NULL for wrong arguments to UNIX_TIMESTAMP(). In MySQL and MariaDB\nbefore 5.3 wrong arguments to UNIX_TIMESTAMP() returned 0.\n\nCompatibility\n-------------\n\nAs you can see in the examples above, UNIX_TIMESTAMP(constant-date-string)\nreturns a timestamp with 6 decimals while MariaDB 5.2 and before returns it\nwithout decimals. This can cause a problem if you are using UNIX_TIMESTAMP()\nas a partitioning function. You can fix this by using\nFLOOR(UNIX_TIMESTAMP(..)) or changing the date string to a date number, like\n20080101000000.\n\nExamples\n--------\n\nSELECT UNIX_TIMESTAMP();\n+------------------+\n| UNIX_TIMESTAMP() |\n+------------------+\n|       1269711082 |\n+------------------+\n\nSELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n+---------------------------------------+\n| UNIX_TIMESTAMP(\'2007-11-30 10:30:19\') |\n+---------------------------------------+\n|                     1196436619.000000 |\n+---------------------------------------+\n\nSELECT UNIX_TIMESTAMP(\"2007-11-30 10:30:19.123456\");\n+----------------------------------------------+\n| unix_timestamp(\"2007-11-30 10:30:19.123456\") |\n+----------------------------------------------+\n|                            1196411419.123456 |\n+----------------------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'));\n+------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')) |\n+------------------------------------------------------+\n| 2007-11-30 10:30:19.000000                           |\n+------------------------------------------------------+\n\nSELECT FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')));\n+-------------------------------------------------------------+\n| FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'))) |\n+-------------------------------------------------------------+\n| 2007-11-30 10:30:19                                         |\n+-------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/unix_timestamp/','','https://mariadb.com/kb/en/unix_timestamp/'),
(566,'UTC_TIMESTAMP',31,'Syntax\n------\n\nUTC_TIMESTAMP\nUTC_TIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n+---------------------+-----------------------+\n| UTC_TIMESTAMP()     | UTC_TIMESTAMP() + 0   |\n+---------------------+-----------------------+\n| 2010-03-27 17:33:16 | 20100327173316.000000 |\n+---------------------+-----------------------+\n\nWith precision:\n\nSELECT UTC_TIMESTAMP(4);\n+--------------------------+\n| UTC_TIMESTAMP(4)         |\n+--------------------------+\n| 2018-07-10 07:51:09.1019 |\n+--------------------------+\n\nURL: https://mariadb.com/kb/en/utc_timestamp/','','https://mariadb.com/kb/en/utc_timestamp/'),
(567,'WEEK',31,'Syntax\n------\n\nWEEK(date[,mode])\n\nDescription\n-----------\n\nThis function returns the week number for date. The two-argument form of\nWEEK() allows you to specify whether the week starts on Sunday or Monday and\nwhether the return value should be in the range from 0 to 53 or from 1 to 53.\nIf the mode argument is omitted, the value of the default_week_format system\nvariable is used.\n\nModes\n-----\n\n+-------+---------------------+--------+------------------------------------+\n| Mode  | 1st day of week     | Range  | Week 1 is the 1st week with        |\n+-------+---------------------+--------+------------------------------------+\n| 0     | Sunday              | 0-53   | a Sunday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 1     | Monday              | 0-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 2     | Sunday              | 1-53   | a Sunday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 3     | Monday              | 1-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 4     | Sunday              | 0-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 5     | Monday              | 0-53   | a Monday in this year              |\n+-------+---------------------+--------+------------------------------------+\n| 6     | Sunday              | 1-53   | more than 3 days this year         |\n+-------+---------------------+--------+------------------------------------+\n| 7     | Monday              | 1-53   | a Monday in this year              |\n+-------+---------------------+--------+------------------------------------+\n\nWith the mode value of 3, which means \'more than 3 days this year\', weeks are\nnumbered according to ISO 8601:1988.\n\nExamples\n--------\n\nSELECT WEEK(\'2008-02-20\');\n+--------------------+\n| WEEK(\'2008-02-20\') |\n+--------------------+\n|                  7 |\n+--------------------+\n\nSELECT WEEK(\'2008-02-20\',0);\n+----------------------+\n| WEEK(\'2008-02-20\',0) |\n+----------------------+\n|                    7 |\n+----------------------+\n\nSELECT WEEK(\'2008-02-20\',1);\n+----------------------+\n| WEEK(\'2008-02-20\',1) |\n+----------------------+\n|                    8 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',0);\n+----------------------+\n| WEEK(\'2008-12-31\',0) |\n+----------------------+\n|                   52 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',1);\n+----------------------+\n| WEEK(\'2008-12-31\',1) |\n+----------------------+\n|                   53 |\n+----------------------+\n\nSELECT WEEK(\'2019-12-30\',3);\n+----------------------+\n| WEEK(\'2019-12-30\',3) |\n+----------------------+\n|                    1 |\n+----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d, WEEK(d,0), WEEK(d,1) from t1;\n+---------------------+-----------+-----------+\n| d                   | WEEK(d,0) | WEEK(d,1) |\n+---------------------+-----------+-----------+\n| 2007-01-30 21:31:07 |         4 |         5 |\n| 1983-10-15 06:42:51 |        41 |        41 |\n| 2011-04-21 12:34:56 |        16 |        16 |\n| 2011-10-30 06:31:41 |        44 |        43 |\n| 2011-01-30 14:03:25 |         5 |         4 |\n| 2004-10-07 11:19:34 |        40 |        41 |\n+---------------------+-----------+-----------+\n\nURL: https://mariadb.com/kb/en/week/','','https://mariadb.com/kb/en/week/'),
(568,'WEEKDAY',31,'Syntax\n------\n\nWEEKDAY(date)\n\nDescription\n-----------\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 = Sunday).\n\nThis contrasts with DAYOFWEEK() which follows the ODBC standard (1 = Sunday, 2\n= Monday, ..., 7 = Saturday).\n\nExamples\n--------\n\nSELECT WEEKDAY(\'2008-02-03 22:23:00\');\n+--------------------------------+\n| WEEKDAY(\'2008-02-03 22:23:00\') |\n+--------------------------------+\n|                              6 |\n+--------------------------------+\n\nSELECT WEEKDAY(\'2007-11-06\');\n+-----------------------+\n| WEEKDAY(\'2007-11-06\') |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT d FROM t1 where WEEKDAY(d) = 6;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nURL: https://mariadb.com/kb/en/weekday/','','https://mariadb.com/kb/en/weekday/'),
(569,'WEEKOFYEAR',31,'Syntax\n------\n\nWEEKOFYEAR(date)\n\nDescription\n-----------\n\nReturns the calendar week of the date as a number in the range from 1 to 53.\nWEEKOFYEAR() is a compatibility function that is equivalent to WEEK(date,3).\n\nExamples\n--------\n\nSELECT WEEKOFYEAR(\'2008-02-20\');\n+--------------------------+\n| WEEKOFYEAR(\'2008-02-20\') |\n+--------------------------+\n|                        8 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nselect * from t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT d, WEEKOFYEAR(d), WEEK(d,3) from t1;\n+---------------------+---------------+-----------+\n| d                   | WEEKOFYEAR(d) | WEEK(d,3) |\n+---------------------+---------------+-----------+\n| 2007-01-30 21:31:07 |             5 |         5 |\n| 1983-10-15 06:42:51 |            41 |        41 |\n| 2011-04-21 12:34:56 |            16 |        16 |\n| 2011-10-30 06:31:41 |            43 |        43 |\n| 2011-01-30 14:03:25 |             4 |         4 |\n| 2004-10-07 11:19:34 |            41 |        41 |\n+---------------------+---------------+-----------+\n\nURL: https://mariadb.com/kb/en/weekofyear/','','https://mariadb.com/kb/en/weekofyear/'),
(570,'YEAR',31,'Syntax\n------\n\nYEAR(date)\n\nDescription\n-----------\n\nReturns the year for the given date, in the range 1000 to 9999, or 0 for the\n\"zero\" date.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT * FROM t1 WHERE YEAR(d) = 2011;\n+---------------------+\n| d                   |\n+---------------------+\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nSELECT YEAR(\'1987-01-01\');\n+--------------------+\n| YEAR(\'1987-01-01\') |\n+--------------------+\n|               1987 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/year/','','https://mariadb.com/kb/en/year/'),
(571,'YEARWEEK',31,'Syntax\n------\n\nYEARWEEK(date), YEARWEEK(date,mode)\n\nDescription\n-----------\n\nReturns year and week for a date. The mode argument works exactly like the\nmode argument to WEEK(). The year in the result may be different from the year\nin the date argument for the first and the last week of the year.\n\nExamples\n--------\n\nSELECT YEARWEEK(\'1987-01-01\');\n+------------------------+\n| YEARWEEK(\'1987-01-01\') |\n+------------------------+\n|                 198652 |\n+------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\n\nSELECT * FROM t1;\n+---------------------+\n| d                   |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n6 rows in set (0.02 sec)\n\nSELECT YEARWEEK(d) FROM t1 WHERE YEAR(d) = 2011;\n+-------------+\n| YEARWEEK(d) |\n+-------------+\n|      201116 |\n|      201144 |\n|      201105 |\n+-------------+\n3 rows in set (0.03 sec)\n\nURL: https://mariadb.com/kb/en/yearweek/','','https://mariadb.com/kb/en/yearweek/'),
(572,'Well-Known Binary (WKB) Format',32,'WKB stands for Well-Known Binary, a format for representing geographical and\ngeometrical data.\n\nWKB uses 1-byte unsigned integers, 4-byte unsigned integers, and 8-byte\ndouble-precision numbers.\n\n* The first byte indicates the byte order. 00 for big endian, or 01 for little\nendian.\n* The next 4 bytes indicate the geometry type. Values from 1 to 7 indicate\nwhether the type is Point, LineString, Polygon, MultiPoint, MultiLineString,\nMultiPolygon, or GeometryCollection respectively. \n* The 8-byte floats represent the co-ordinates.\n\nTake the following example, a sequence of 21 bytes each represented by two hex\ndigits:\n\n000000000140000000000000004010000000000000\n\n* It\'s big endian\n000000000140000000000000004010000000000000\n\n* It\'s a POINT\n000000000140000000000000004010000000000000\n\n* The X co-ordinate is 2.0\n000000000140000000000000004010000000000000\n\n* The Y-co-ordinate is 4.0\n000000000140000000000000004010000000000000\n\nURL: https://mariadb.com/kb/en/well-known-binary-wkb-format/','','https://mariadb.com/kb/en/well-known-binary-wkb-format/'),
(592,'ST_GeomCollFromWKB',32,'Syntax\n------\n\nST_GeomCollFromWKB(wkb[,srid])\nST_GeometryCollectionFromWKB(wkb[,srid])\nGeomCollFromWKB(wkb[,srid])\nGeometryCollectionFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and SRID.\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(), GeomCollFromWKB() and\nGeometryCollectionFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_GeomFromText(\'GEOMETRYCOLLECTION(\n POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10))\'));\n\nSELECT ST_AsText(ST_GeomCollFromWKB(@g));\n+----------------------------------------------------------------+\n| ST_AsText(ST_GeomCollFromWKB(@g))                              |\n+----------------------------------------------------------------+\n| GEOMETRYCOLLECTION(POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10)) |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomcollfromwkb/','','https://mariadb.com/kb/en/st_geomcollfromwkb/'),
(601,'Geometry Types',34,'Description\n-----------\n\nMariaDB provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently, spatial\ncolumns are supported for MyISAM, InnoDB and ARCHIVE tables. See also SPATIAL\nINDEX.\n\nThe basic geometry type is GEOMETRY. But the type can be more specific. The\nfollowing types are supported:\n\n+-----------------------------------------------------------------------------+\n| Geometry Types                                                              |\n+-----------------------------------------------------------------------------+\n| POINT                                                                       |\n+-----------------------------------------------------------------------------+\n| LINESTRING                                                                  |\n+-----------------------------------------------------------------------------+\n| POLYGON                                                                     |\n+-----------------------------------------------------------------------------+\n| MULTIPOINT                                                                  |\n+-----------------------------------------------------------------------------+\n| MULTILINESTRING                                                             |\n+-----------------------------------------------------------------------------+\n| MULTIPOLYGON                                                                |\n+-----------------------------------------------------------------------------+\n| GEOMETRYCOLLECTION                                                          |\n+-----------------------------------------------------------------------------+\n| GEOMETRY                                                                    |\n+-----------------------------------------------------------------------------+\n\nExamples\n--------\n\nNote: For clarity, only one type is listed per table in the examples below,\nbut a table row can contain multiple types. For example:\n\nCREATE TABLE object (shapeA POLYGON, shapeB LINESTRING);\n\nPOINT\n-----\n\nCREATE TABLE gis_point  (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n  (PointFromText(\'POINT(10 10)\')),\n  (PointFromText(\'POINT(20 10)\')),\n  (PointFromText(\'POINT(20 20)\')),\n  (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nLINESTRING\n----------\n\nCREATE TABLE gis_line  (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n  (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n  (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n  (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nPOLYGON\n-------\n\nCREATE TABLE gis_polygon   (g POLYGON);\nSHOW FIELDS FROM gis_polygon;\nINSERT INTO gis_polygon VALUES\n  (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n  (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n  (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nMULTIPOINT\n----------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n  (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n  (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n  (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nMULTILINESTRING\n---------------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n  (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n  (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n  (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)),\nLineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\nMULTIPOLYGON\n------------\n\nCREATE TABLE gis_multi_polygon  (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n  (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n  (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3,\n3), Point(3, 0), Point(0, 3)))))));\n\nGEOMETRYCOLLECTION\n------------------\n\nCREATE TABLE gis_geometrycollection  (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n  (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n  (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n  (GeomFromText(\'GeometryCollection()\')),\n  (GeomFromText(\'GeometryCollection EMPTY\'));\n\nGEOMETRY\n--------\n\nCREATE TABLE gis_geometry (g GEOMETRY);\nSHOW FIELDS FROM gis_geometry;\nINSERT into gis_geometry SELECT * FROM gis_point;\nINSERT into gis_geometry SELECT * FROM gis_line;\nINSERT into gis_geometry SELECT * FROM gis_polygon;\nINSERT into gis_geometry SELECT * FROM gis_multi_point;\nINSERT into gis_geometry SELECT * FROM gis_multi_line;\nINSERT into gis_geometry SELECT * FROM gis_multi_polygon;\nINSERT into gis_geometry SELECT * FROM gis_geometrycollection;\n\nURL: https://mariadb.com/kb/en/geometry-types/','','https://mariadb.com/kb/en/geometry-types/'),
(602,'Geometry Hierarchy',34,'Description\n-----------\n\nGeometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and two-dimensional\ngeometric objects that exist in two-dimensional coordinate space. All\ninstantiable geometry classes are defined so that valid instances of a\ngeometry class are topologically closed (that is, all defined geometries\ninclude their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\n* Point represents zero-dimensional objects.\n* Curve represents one-dimensional objects, and has subclass LineString, with\nsub-subclasses Line and LinearRing.\n* Surface is designed for two-dimensional objects and has subclass Polygon.\n* GeometryCollection has specialized zero-, one-, and two-dimensional\ncollection classes named MultiPoint, MultiLineString, and MultiPolygon for\nmodeling geometries corresponding to collections of Points, LineStrings, and\nPolygons, respectively. MultiCurve and MultiSurface are introduced as abstract\nsuperclasses that generalize the collection interfaces to handle Curves and\nSurfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnon-instantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint, MultiLineString,\nand MultiPolygon are instantiable classes.\n\nURL: https://mariadb.com/kb/en/geometry-hierarchy/','','https://mariadb.com/kb/en/geometry-hierarchy/'),
(603,'SPATIAL INDEX',34,'Description\n-----------\n\nOn MyISAM, Aria and InnoDB tables, MariaDB can create spatial indexes (an\nR-tree index) using syntax similar to that for creating regular indexes, but\nextended with the SPATIAL keyword. Currently, columns in spatial indexes must\nbe declared NOT NULL.\n\nSpatial indexes can be created when the table is created, or added after the\nfact like so:\n\n* with CREATE TABLE: CREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g));\n\n* with ALTER TABLE: ALTER TABLE geom ADD SPATIAL INDEX(g);\n\n* with CREATE INDEX: CREATE SPATIAL INDEX sp_index ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnon-spatial indexing of spatial columns, the engine creates a B-tree index. A\nB-tree index on spatial values is useful for exact-value lookups, but not for\nrange scans.\n\nFor more information on indexing spatial columns, see CREATE INDEX.\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\n* with ALTER TABLE: ALTER TABLE geom DROP INDEX g;\n\n* with DROP INDEX: DROP INDEX sp_index ON geom;\n\nData-at-Rest Encyption\n----------------------\n\nBefore MariaDB 10.4.3, InnoDB\'s spatial indexes could not be encrypted. If an\nInnoDB table was encrypted and if it contained spatial indexes, then those\nindexes would be unencrypted.\n\nIn MariaDB 10.4.3 and later, if innodb_checksum_algorithm is set to full_crc32\nor strict_full_crc32, and if the table does not use ROW_FORMAT=COMPRESSED,\nthen InnoDB spatial indexes will be encrypted if the table is encrypted.\n\nSee MDEV-12026 for more information.\n\nURL: https://mariadb.com/kb/en/spatial-index/','','https://mariadb.com/kb/en/spatial-index/'),
(615,'ST_BOUNDARY',35,'MariaDB starting with 10.1.2\n----------------------------\nThe ST_BOUNDARY function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_BOUNDARY(g)\nBOUNDARY(g)\n\nDescription\n-----------\n\nReturns a geometry that is the closure of the combinatorial boundary of the\ngeometry value g.\n\nBOUNDARY() is a synonym.\n\nExamples\n--------\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\')));\n+----------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\'))) |\n+----------------------------------------------------------------------+\n| MULTIPOINT(3 3,-3 3)                                                 |\n+----------------------------------------------------------------------+\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3\n3))\')));\n+--------------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3 3))\'))) |\n+--------------------------------------------------------------------------+\n| LINESTRING(3 3,0 0,-3 3,3 3)                                             |\n+--------------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_boundary/','','https://mariadb.com/kb/en/st_boundary/'),
(616,'ST_DIMENSION',35,'Syntax\n------\n\nST_Dimension(g)\nDimension(g)\n\nDescription\n-----------\n\nReturns the inherent dimension of the geometry value g. The result can be\n\n+------------------------------------+---------------------------------------+\n| Dimension                          | Definition                            |\n+------------------------------------+---------------------------------------+\n| -1                                 | empty geometry                        |\n+------------------------------------+---------------------------------------+\n| 0                                  | geometry with no length or area       |\n+------------------------------------+---------------------------------------+\n| 1                                  | geometry with no area but nonzero     |\n|                                    | length                                |\n+------------------------------------+---------------------------------------+\n| 2                                  | geometry with nonzero area            |\n+------------------------------------+---------------------------------------+\n\nST_Dimension() and Dimension() are synonyms.\n\nExamples\n--------\n\nSELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n|                                              1 |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_dimension/','','https://mariadb.com/kb/en/st_dimension/'),
(617,'ST_ENVELOPE',35,'Syntax\n------\n\nST_ENVELOPE(g)\nENVELOPE(g)\n\nDescription\n-----------\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g. The\nresult is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nST_ENVELOPE() and ENVELOPE() are synonyms.\n\nExamples\n--------\n\nSELECT AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\')));\n+----------------------------------------------------------+\n| AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\'))) |\n+----------------------------------------------------------+\n| POLYGON((1 1,4 1,4 4,1 4,1 1))                           |\n+----------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/st_envelope/','','https://mariadb.com/kb/en/st_envelope/'),
(620,'ST_ISCLOSED',35,'Syntax\n------\n\nST_IsClosed(g)\nIsClosed(g)\n\nDescription\n-----------\n\nReturns 1 if a given LINESTRING\'s start and end points are the same, or 0 if\nthey are not the same. Before MariaDB 10.1.5, returns NULL if not given a\nLINESTRING. After MariaDB 10.1.5, returns -1.\n\nST_IsClosed() and IsClosed() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 0)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n|                              1 |\n+--------------------------------+\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 1)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n|                              0 |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/st_isclosed/','','https://mariadb.com/kb/en/st_isclosed/'),
(627,'LOAD_FILE',36,'Syntax\n------\n\nLOAD_FILE(file_name)\n\nDescription\n-----------\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify the\nfull path name to the file, and you must have the FILE privilege. The file\nmust be readable by all and it must be less than the size, in bytes, of the\nmax_allowed_packet system variable. If the secure_file_priv system variable is\nset to a non-empty directory name, the file to be loaded must be located in\nthat directory.\n\nIf the file does not exist or cannot be read because one of the preceding\nconditions is not satisfied, the function returns NULL.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nStatements using the LOAD_FILE() function are not safe for statement based\nreplication. This is because the slave will execute the LOAD_FILE() command\nitself. If the file doesn\'t exist on the slave, the function will return NULL.\n\nExamples\n--------\n\nUPDATE t SET blob_col=LOAD_FILE(\'/tmp/picture\') WHERE id=1;\n\nURL: https://mariadb.com/kb/en/load_file/','','https://mariadb.com/kb/en/load_file/'),
(630,'REGEXP_INSTR',36,'Syntax\n------\n\nREGEXP_INSTR(subject, pattern)\n\nReturns the position of the first occurrence of the regular expression pattern\nin the string subject, or 0 if pattern was not found.\n\nThe positions start with 1 and are measured in characters (i.e. not in bytes),\nwhich is important for multi-byte character sets. You can cast a multi-byte\ncharacter set to BINARY to get offsets in bytes.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_INSTR was introduced as part of this\nenhancement.\n\nExamples\n--------\n\nSELECT REGEXP_INSTR(\'abc\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'abc\',\'x\');\n-> 0\n\nSELECT REGEXP_INSTR(\'BJÖRN\',\'N\');\n-> 5\n\nCasting a multi-byte character set as BINARY to get offsets in bytes:\n\nSELECT REGEXP_INSTR(BINARY \'BJÖRN\',\'N\') AS cast_utf8_to_binary;\n-> 6\n\nCase sensitivity:\n\nSELECT REGEXP_INSTR(\'ABC\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(BINARY\'ABC\',\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\',\'(?-i)b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'(?i)b\');\n-> 2\n\nURL: https://mariadb.com/kb/en/regexp_instr/','','https://mariadb.com/kb/en/regexp_instr/'),
(631,'REGEXP_REPLACE',36,'Syntax\n------\n\nREGEXP_REPLACE(subject, pattern, replace)\n\nDescription\n-----------\n\nREGEXP_REPLACE returns the string subject with all occurrences of the regular\nexpression pattern replaced by the string replace. If no occurrences are\nfound, then subject is returned as is.\n\nThe replace string can have backreferences to the subexpressions in the form\n\\N, where N is a number from 1 to 9.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_REPLACE was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_REPLACE(\'ab12cd\',\'[0-9]\',\'\') AS remove_digits;\n-> abcd\n\nSELECT\nREGEXP_REPLACE(\'<html><head><title>title</title><body>body</body></htm>\',\n\'<.+?>\',\' \')\nAS strip_html;\n-> title  body\n\nBackreferences to the subexpressions in the form \\N, where N is a number from\n1 to 9:\n\nSELECT REGEXP_REPLACE(\'James Bond\',\'^(.*) (.*)$\',\'\\\\2, \\\\1\') AS reorder_name;\n-> Bond, James\n\nCase insensitive and case sensitive matches:\n\nSELECT REGEXP_REPLACE(\'ABC\',\'b\',\'-\') AS case_insensitive;\n-> A-C\n\nSELECT REGEXP_REPLACE(\'ABC\' COLLATE utf8_bin,\'b\',\'-\') AS case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'b\',\'-\') AS binary_data;\n-> ABC\n\nOverwriting the collation case sensitivity using the (?i) and (?-i) PCRE flags.\n\nSELECT REGEXP_REPLACE(\'ABC\',\'(?-i)b\',\'-\') AS force_case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'(?i)b\',\'-\') AS force_case_insensitive;\n-> A-C\n\nURL: https://mariadb.com/kb/en/regexp_replace/','','https://mariadb.com/kb/en/regexp_replace/'),
(629,'REGEXP',36,'Syntax\n------\n\nexpr REGEXP pat, expr RLIKE pat\n\nDescription\n-----------\n\nPerforms a pattern match of a string expression expr against a pattern pat.\nThe pattern can be an extended regular expression. See Regular Expressions\nOverview for details on the syntax for regular expressions (see also PCRE\nRegular Expressions).\n\nReturns 1 if expr matches pat or 0 if it doesn\'t match. If either expr or pat\nare NULL, the result is NULL.\n\nThe negative form NOT REGEXP also exists, as an alias for NOT (string REGEXP\npattern). RLIKE and NOT RLIKE are synonyms for REGEXP and NOT REGEXP,\noriginally provided for mSQL compatibility.\n\nThe pattern need not be a literal string. For example, it can be specified as\na string expression or table column.\n\nNote: Because MariaDB uses the C escape syntax in strings (for example, \"\\n\"\nto represent the newline character), you must double any \"\\\" that you use in\nyour REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nMariaDB 10.0.5 moved to the PCRE regex library - see PCRE Regular Expressions\nfor enhancements to REGEXP introduced in MariaDB 10.0.5.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT \'Monty!\' REGEXP \'m%y%%\';\n+-------------------------+\n| \'Monty!\' REGEXP \'m%y%%\' |\n+-------------------------+\n|                       0 |\n+-------------------------+\n\nSELECT \'Monty!\' REGEXP \'.*\';\n+----------------------+\n| \'Monty!\' REGEXP \'.*\' |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n+---------------------------------------+\n| \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\' |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n\nSELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n+----------------+-----------------------+\n| \'a\' REGEXP \'A\' | \'a\' REGEXP BINARY \'A\' |\n+----------------+-----------------------+\n|              1 |                     0 |\n+----------------+-----------------------+\n\nSELECT \'a\' REGEXP \'^[a-d]\';\n+---------------------+\n| \'a\' REGEXP \'^[a-d]\' |\n+---------------------+\n|                   1 |\n+---------------------+\n\ndefault_regex_flags examples\n----------------------------\n\nMariaDB 10.0.11 introduced the default_regex_flags variable to address the\nremaining compatibilities between PCRE and the old regex library.\n\nThe default behaviour (multiline match is off)\n\nSELECT \'a\\nb\\nc\' RLIKE \'^b$\';\n+---------------------------+\n| \'(?m)a\\nb\\nc\' RLIKE \'^b$\' |\n+---------------------------+\n|                         0 |\n+---------------------------+\n\nEnabling the multiline option using the PCRE option syntax:\n\nSELECT \'a\\nb\\nc\' RLIKE \'(?m)^b$\';\n+---------------------------+\n| \'a\\nb\\nc\' RLIKE \'(?m)^b$\' |\n+---------------------------+\n|                         1 |\n+---------------------------+\n\nEnabling the multiline option using default_regex_flags\n\nSET default_regex_flags=\'MULTILINE\';\nSELECT \'a\\nb\\nc\' RLIKE \'^b$\';\n+-----------------------+\n| \'a\\nb\\nc\' RLIKE \'^b$\' |\n+-----------------------+\n|                     1 |\n+-----------------------+\n\nURL: https://mariadb.com/kb/en/regexp/','','https://mariadb.com/kb/en/regexp/'),
(632,'REGEXP_SUBSTR',36,'Syntax\n------\n\nREGEXP_SUBSTR(subject,pattern)\n\nDescription\n-----------\n\nReturns the part of the string subject that matches the regular expression\npattern, or an empty string if pattern was not found.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_SUBSTR was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_SUBSTR(\'ab12cd\',\'[0-9]+\');\n-> 12\n\nSELECT REGEXP_SUBSTR(\n \'See https://mariadb.org/en/foundation/ for details\',\n \'https?://[^/]*\');\n-> https://mariadb.org\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n->\n\nSELECT REGEXP_SUBSTR(BINARY\'ABC\',\'b\');\n->\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'(?i)b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'(?+i)b\');\n-> B\n\nURL: https://mariadb.com/kb/en/regexp_substr/','','https://mariadb.com/kb/en/regexp_substr/'),
(635,'BINARY Operator',36,'This page describes the BINARY operator. For details about the data type, see\nBinary Data Type.\n\nSyntax\n------\n\nBINARY\n\nDescription\n-----------\n\nThe BINARY operator casts the string following it to a binary string. This is\nan easy way to force a column comparison to be done byte by byte rather than\ncharacter by character. This causes the comparison to be case sensitive even\nif the column isn\'t defined as BINARY or BLOB.\n\nBINARY also causes trailing spaces to be significant.\n\nExamples\n--------\n\nSELECT \'a\' = \'A\';\n+-----------+\n| \'a\' = \'A\' |\n+-----------+\n|         1 |\n+-----------+\n\nSELECT BINARY \'a\' = \'A\';\n+------------------+\n| BINARY \'a\' = \'A\' |\n+------------------+\n|                0 |\n+------------------+\n\nSELECT \'a\' = \'a \';\n+------------+\n| \'a\' = \'a \' |\n+------------+\n|          1 |\n+------------+\n\nSELECT BINARY \'a\' = \'a \';\n+-------------------+\n| BINARY \'a\' = \'a \' |\n+-------------------+\n|                 0 |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/binary-operator/','','https://mariadb.com/kb/en/binary-operator/'),
(637,'CAST',36,'Syntax\n------\n\nCAST(expr AS type)\n\nDescription\n-----------\n\nThe CAST() function takes a value of one type and produces a value of another\ntype, similar to the CONVERT() function.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME\n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER\nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nThe main difference between CAST and CONVERT() is that CONVERT(expr,type) is\nODBC syntax while CAST(expr as type) and CONVERT(... USING ...) are SQL92\nsyntax.\n\nIn MariaDB 10.4 and later, you can use the CAST() function with the INTERVAL\nkeyword.\n\nUntil MariaDB 5.5.31, X\'HHHH\', the standard SQL syntax for binary string\nliterals, erroneously worked in the same way as 0xHHHH. In 5.5.31 it was\nintentionally changed to behave as a string in all contexts (and never as a\nnumber).\n\nThis introduced an incompatibility with previous versions of MariaDB, and all\nversions of MySQL (see the example below).\n\nExamples\n--------\n\nSimple casts:\n\nSELECT CAST(\"abc\" AS BINARY);\nSELECT CAST(\"1\" AS UNSIGNED INTEGER);\nSELECT CAST(123 AS CHAR CHARACTER SET utf8)\n\nNote that when one casts to CHAR without specifying the character set, the\ncollation_connection character set collation will be used. When used with CHAR\nCHARACTER SET, the default collation for that character set will be used.\n\nSELECT COLLATION(CAST(123 AS CHAR));\n+------------------------------+\n| COLLATION(CAST(123 AS CHAR)) |\n+------------------------------+\n| latin1_swedish_ci            |\n+------------------------------+\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8));\n+-------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8)) |\n+-------------------------------------------------+\n| utf8_general_ci                                 |\n+-------------------------------------------------+\n\nIf you also want to change the collation, you have to use the COLLATE operator:\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) \n COLLATE utf8_unicode_ci);\n+-------------------------------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) |\n+-------------------------------------------------------------------------+\n| utf8_unicode_ci                                                         |\n+-------------------------------------------------------------------------+\n\nUsing CAST() to order an ENUM field as a CHAR rather than the internal\nnumerical value:\n\nCREATE TABLE enum_list (enum_field enum(\'c\',\'a\',\'b\'));\n\nINSERT INTO enum_list (enum_field) \nVALUES(\'c\'),(\'a\'),(\'c\'),(\'b\');\n\nSELECT * FROM enum_list \nORDER BY enum_field;\n+------------+\n| enum_field |\n+------------+\n| c          |\n| c          |\n| a          |\n| b          |\n+------------+\n\nSELECT * FROM enum_list \nORDER BY CAST(enum_field AS CHAR);\n+------------+\n| enum_field |\n+------------+\n| a          |\n| b          |\n| c          |\n| c          |\n+------------+\n\nFrom MariaDB 5.5.31, the following will trigger warnings, since x\'aa\' and\n\'X\'aa\' no longer behave as a number. Previously, and in all versions of MySQL,\nno warnings are triggered since they did erroneously behave as a number:\n\nSELECT CAST(0xAA AS UNSIGNED), CAST(x\'aa\' AS UNSIGNED), CAST(X\'aa\' AS\nUNSIGNED);\n+------------------------+-------------------------+-------------------------+\n| CAST(0xAA AS UNSIGNED) | CAST(x\'aa\' AS UNSIGNED) | CAST(X\'aa\' AS UNSIGNED) |\n+------------------------+-------------------------+-------------------------+\n|                    170 |                       0 |                       0 |\n+------------------------+-------------------------+-------------------------+\n1 row in set, 2 warnings (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\\xAA\'\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\\xAA\'\n\nCasting to intervals:\n\nSELECT CAST(2019-01-04 INTERVAL AS DAY_SECOND(2)) AS \"Cast\";\n\n+-------------+\n| Cast        |\n+-------------+\n| 00:20:17.00 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/cast/','','https://mariadb.com/kb/en/cast/'),
(638,'CHAR Function',36,'Syntax\n------\n\nCHAR(N,... [USING charset_name])\n\nDescription\n-----------\n\nCHAR() interprets each argument as an INT and returns a string consisting of\nthe characters given by the code values of those integers. NULL values are\nskipped. By default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nSELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary              | utf8                           |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given character\nset, a warning is issued. Also, if strict SQL mode is enabled, the result from\nCHAR() becomes NULL.\n\nExamples\n--------\n\nSELECT CHAR(77,97,114,\'105\',97,\'68\',66);\n+----------------------------------+\n| CHAR(77,97,114,\'105\',97,\'68\',66) |\n+----------------------------------+\n| MariaDB                          |\n+----------------------------------+\n\nSELECT CHAR(77,77.3,\'77.3\');\n+----------------------+\n| CHAR(77,77.3,\'77.3\') |\n+----------------------+\n| MMM                  |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'77.3\'\n\nURL: https://mariadb.com/kb/en/char-function/','','https://mariadb.com/kb/en/char-function/'),
(639,'CHAR_LENGTH',36,'Syntax\n------\n\nCHAR_LENGTH(str)\nCHARACTER_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument, measured in characters. A\nmulti-byte character counts as a single character. This means that for a\nstring containing five two-byte characters, LENGTH() (or OCTET_LENGTH() in\nOracle mode) returns 10, whereas CHAR_LENGTH() returns 5. If the argument is\nNULL, it returns NULL.\n\nIf the argument is not a string value, it is converted into a string.\n\nIt is synonymous with the CHARACTER_LENGTH() function.\n\nExamples\n--------\n\nSELECT CHAR_LENGTH(\'MariaDB\');\n+------------------------+\n| CHAR_LENGTH(\'MariaDB\') |\n+------------------------+\n|                      7 |\n+------------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/char_length/','','https://mariadb.com/kb/en/char_length/'),
(640,'CHR',36,'MariaDB starting with 10.3.1\n----------------------------\nThe CHR() function was introduced in MariaDB 10.3.1 to provide Oracle\ncompatibility\n\nSyntax\n------\n\nCHR(N)\n\nDescription\n-----------\n\nCHR() interprets each argument N as an integer and returns a VARCHAR(1) string\nconsisting of the character given by the code values of the integer. The\ncharacter set and collation of the string are set according to the values of\nthe character_set_database and collation_database system variables.\n\nCHR() is similar to the CHAR() function, but only accepts a single argument.\n\nCHR() is available in all sql_modes.\n\nExamples\n--------\n\nSELECT CHR(67);\n+---------+\n| CHR(67) |\n+---------+\n| C       |\n+---------+\n\nSELECT CHR(\'67\');\n+-----------+\n| CHR(\'67\') |\n+-----------+\n| C         |\n+-----------+\n\nSELECT CHR(\'C\');\n+----------+\n| CHR(\'C\') |\n+----------+\n|          |\n+----------+\n1 row in set, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect INTEGER value: \'C\' |\n+---------+------+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/chr/','','https://mariadb.com/kb/en/chr/'),
(641,'CONCAT',36,'Syntax\n------\n\nCONCAT(str1,str2,...)\n\nDescription\n-----------\n\nReturns the string that results from concatenating the arguments. May have one\nor more arguments. If all arguments are non-binary strings, the result is a\nnon-binary string. If the arguments include any binary strings, the result is\na binary string. A numeric argument is converted to its equivalent binary\nstring form; if you want to avoid that, you can use an explicit type cast, as\nin this example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n\nA NULL parameter hides all information contained in other parameters from the\nresult. Sometimes this is not desirable; to avoid this, you can:\n\n* Use the CONCAT_WS() function with an empty separator, because that function\nis NULL-safe.\n* Use IFNULL() to turn NULLs into empty strings.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CONCAT ignores NULL.\n\nExamples\n--------\n\nSELECT CONCAT(\'Ma\', \'ria\', \'DB\');\n+---------------------------+\n| CONCAT(\'Ma\', \'ria\', \'DB\') |\n+---------------------------+\n| MariaDB                   |\n+---------------------------+\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| NULL                            |\n+---------------------------------+\n\nSELECT CONCAT(42.0);\n+--------------+\n| CONCAT(42.0) |\n+--------------+\n| 42.0         |\n+--------------+\n\nUsing IFNULL() to handle NULLs:\n\nSELECT CONCAT(\'The value of @v is: \', IFNULL(@v, \'\'));\n+------------------------------------------------+\n| CONCAT(\'The value of @v is: \', IFNULL(@v, \'\')) |\n+------------------------------------------------+\n| The value of @v is:                            |\n+------------------------------------------------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| MariaDB                         |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/concat/','','https://mariadb.com/kb/en/concat/'),
(642,'CONCAT_WS',36,'Syntax\n------\n\nCONCAT_WS(separator,str1,str2,...)\n\nDescription\n-----------\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form of\nCONCAT(). The first argument is the separator for the rest of the arguments.\nThe separator is added between the strings to be concatenated. The separator\ncan be a string, as can the rest of the arguments.\n\nIf the separator is NULL, the result is NULL; all other NULL values are\nskipped. This makes CONCAT_WS() suitable when you want to concatenate some\nvalues and avoid losing all information if one of them is NULL.\n\nExamples\n--------\n\nSELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n+-------------------------------------------------------+\n| CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\') |\n+-------------------------------------------------------+\n| First name,Second name,Last Name                      |\n+-------------------------------------------------------+\n\nSELECT CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\');\n+------------------------------------+\n| CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\') |\n+------------------------------------+\n| Floor-Room                         |\n+------------------------------------+\n\nIn some cases, remember to include a space in the separator string:\n\nSET @a = \'gnu\', @b = \'penguin\', @c = \'sea lion\';\nQuery OK, 0 rows affected (0.00 sec)\n\nSELECT CONCAT_WS(\', \', @a, @b, @c);\n+-----------------------------+\n| CONCAT_WS(\', \', @a, @b, @c) |\n+-----------------------------+\n| gnu, penguin, sea lion      |\n+-----------------------------+\n\nUsing CONCAT_WS() to handle NULLs:\n\nSET @a = \'a\', @b = NULL, @c = \'c\';\n\nSELECT CONCAT_WS(\'\', @a, @b, @c);\n+---------------------------+\n| CONCAT_WS(\'\', @a, @b, @c) |\n+---------------------------+\n| ac                        |\n+---------------------------+\n\nURL: https://mariadb.com/kb/en/concat_ws/','','https://mariadb.com/kb/en/concat_ws/'),
(643,'CONVERT',36,'Syntax\n------\n\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nDescription\n-----------\n\nThe	CONVERT() and CAST() functions take a value of one type and produce a\nvalue of another type.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME\n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER\nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nNote that in MariaDB, INT and INTEGER are the same thing.\n\nBINARY produces a string with the BINARY data type. If the optional length is\ngiven, BINARY(N) causes the cast to use no more than N bytes of the argument.\nValues shorter than the given number in bytes are padded with 0x00 bytes to\nmake them equal the length value.\n\nCHAR(N) causes the cast to use no more than the number of characters given in\nthe argument.\n\nThe main difference between the CAST() and CONVERT() is that\nCONVERT(expr,type) is ODBC syntax while CAST(expr as type) and CONVERT(...\nUSING ...) are SQL92 syntax.\n\nCONVERT() with USING is used to convert data between different character sets.\nIn MariaDB, transcoding names are the same as the corresponding character set\nnames. For example, this statement converts the string \'abc\' in the default\ncharacter set to the corresponding string in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nExamples\n--------\n\nSELECT enum_col FROM tbl_name \nORDER BY CAST(enum_col AS CHAR);\n\nConverting a BINARY to string to permit the LOWER function to work:\n\nSET @x = \'AardVark\';\n\nSET @x = BINARY \'AardVark\';\n\nSELECT LOWER(@x), LOWER(CONVERT (@x USING latin1));\n+-----------+----------------------------------+\n| LOWER(@x) | LOWER(CONVERT (@x USING latin1)) |\n+-----------+----------------------------------+\n| AardVark  | aardvark                         |\n+-----------+----------------------------------+\n\nURL: https://mariadb.com/kb/en/convert/','','https://mariadb.com/kb/en/convert/'),
(644,'ELT',36,'Syntax\n------\n\nELT(N, str1[, str2, str3,...])\n\nDescription\n-----------\n\nTakes a numeric argument and a series of string arguments. Returns the string\nthat corresponds to the given numeric position. For instance, it returns str1\nif N is 1, str2 if N is 2, and so on. If the numeric argument is a FLOAT,\nMariaDB rounds it to the nearest INTEGER. If the numeric argument is less than\n1, greater than the total number of arguments, or not a number, ELT() returns\nNULL. It must have at least two arguments.\n\nIt is complementary to the FIELD() function.\n\nExamples\n--------\n\nSELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| ej                                 |\n+------------------------------------+\n\nSELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| foo                                |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/elt/','','https://mariadb.com/kb/en/elt/'),
(645,'EXPORT_SET',36,'Syntax\n------\n\nEXPORT_SET(bits, on, off[, separator[, number_of_bits]])\n\nDescription\n-----------\n\nTakes a minimum of three arguments. Returns a string where each bit in the\ngiven bits argument is returned, with the string values given for on and off.\n\nBits are examined from right to left, (from low-order to high-order bits).\nStrings are added to the result from left to right, separated by a separator\nstring (defaults as \',\'). You can optionally limit the number of bits the\nEXPORT_SET() function examines using the number_of_bits option.\n\nIf any of the arguments are set as NULL, the function returns NULL.\n\nExamples\n--------\n\nSELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n+-----------------------------+\n| EXPORT_SET(5,\'Y\',\'N\',\',\',4) |\n+-----------------------------+\n| Y,N,Y,N                     |\n+-----------------------------+\n\nSELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n+------------------------------+\n| EXPORT_SET(6,\'1\',\'0\',\',\',10) |\n+------------------------------+\n| 0,1,1,0,0,0,0,0,0,0          |\n+------------------------------+\n\nURL: https://mariadb.com/kb/en/export_set/','','https://mariadb.com/kb/en/export_set/'),
(646,'EXTRACTVALUE',36,'Syntax\n------\n\nEXTRACTVALUE(xml_frag, xpath_expr)\n\nDescription\n-----------\n\nThe EXTRACTVALUE() function takes two string arguments: a fragment of XML\nmarkup and an XPath expression, (also known as a locator). It returns the text\n(That is, CDDATA), of the first text node which is a child of the element or\nelements matching the XPath expression.\n\nIn cases where a valid XPath expression does not match any text nodes in a\nvalid XML fragment, (including the implicit /text() expression), the\nEXTRACTVALUE() function returns an empty string.\n\nInvalid Arguments\n-----------------\n\nWhen either the XML fragment or the XPath expression is NULL, the\nEXTRACTVALUE() function returns NULL. When the XML fragment is invalid, it\nraises a warning Code 1525:\n\nWarning (Code 1525): Incorrect XML value: \'parse error at line 1 pos 11:\nunexpected END-OF-INPUT\'\n\nWhen the XPath value is invalid, it generates an Error 1105:\n\nERROR 1105 (HY000): XPATH syntax error: \')\'\n\nExplicit text() Expressions\n---------------------------\n\nThis function is the equivalent of performing a match using the XPath\nexpression after appending /text(). In other words:\n\nSELECT\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case\')\n  AS \'Base Example\',\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case/text()\')\n  AS \'text() Example\';\n+--------------+----------------+\n| Base Example | text() Example |\n+--------------+----------------+\n| example      | example        |\n+--------------+----------------+\n\nCount Matches\n-------------\n\nWhen EXTRACTVALUE() returns multiple matches, it returns the content of the\nfirst child text node of each matching element, in the matched order, as a\nsingle, space-delimited string.\n\nBy design, the EXTRACTVALUE() function makes no distinction between a match on\nan empty element and no match at all. If you need to determine whether no\nmatching element was found in the XML fragment or if an element was found that\ncontained no child text nodes, use the XPath count() function.\n\nFor instance, when looking for a value that exists, but contains no child text\nnodes, you would get a count of the number of matching instances:\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/case\')\n  AS \'Empty Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/case)\')\n  AS \'count() Example\';\n+---------------+-----------------+\n| Empty Example | count() Example |\n+---------------+-----------------+\n|               |               1 |\n+---------------+-----------------+\n\nAlternatively, when looking for a value that doesn\'t exist, count() returns 0.\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/person\')\n  AS \'No Match Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/person)\')\n  AS \'count() Example\';\n+------------------+-----------------+\n| No Match Example | count() Example |\n+------------------+-----------------+\n|                  |                0|\n+------------------+-----------------+\n\nMatches\n-------\n\nImportant: The EXTRACTVALUE() function only returns CDDATA. It does not return\ntags that the element might contain or the text that these child elements\ncontain.\n\nSELECT\n\nEXTRACTVALUE(\'<cases><case>Person<email>x@example.com</email></case></cases>\',\n\'/cases\')\n AS Case;\n+--------+\n| Case   |\n+--------+\n| Person |\n+--------+\n\nNote, in the above example, while the XPath expression matches to the parent\n<case> instance, it does not return the contained <email> tag or its content.\n\nExamples\n--------\n\nSELECT\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\')            AS val1,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\')          AS val2,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\')           AS val3,\n  ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\')            AS val4,\n  ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5    |\n+------+------+------+------+---------+\n| ccc  | ddd  | ddd  |      | ddd eee |\n+------+------+------+------+---------+\n\nURL: https://mariadb.com/kb/en/extractvalue/','','https://mariadb.com/kb/en/extractvalue/'),
(647,'FIELD',36,'Syntax\n------\n\nFIELD(pattern, str1[,str2,...])\n\nDescription\n-----------\n\nReturns the index position of the string or number matching the given pattern.\nReturns 0 in the event that none of the arguments match the pattern. Raises an\nError 1582 if not given at least two arguments.\n\nWhen all arguments given to the FIELD() function are strings, they are treated\nas case-insensitive. When all the arguments are numbers, they are treated as\nnumbers. Otherwise, they are treated as doubles.\n\nIf the given pattern occurs more than once, the	FIELD() function only returns\nthe index of the first instance. If the given pattern is NULL, the function\nreturns 0, as a NULL pattern always fails to match.\n\nThis function is complementary to the ELT() function.\n\nExamples\n--------\n\nSELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\') \n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n|             2 |\n+---------------+\n\nSELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\')\n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n|             0 |\n+---------------+\n\nSELECT FIELD(1, 2, 3, 4, 5, 1) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n|             5 |\n+---------------+\n\nSELECT FIELD(NULL, 2, 3) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n|             0 |\n+---------------+\n\nSELECT FIELD(\'fail\') AS \'Field Results\';\nError 1582 (42000): Incorrect parameter count in call\nto native function \'field\'\n\nURL: https://mariadb.com/kb/en/field/','','https://mariadb.com/kb/en/field/'),
(648,'FIND_IN_SET',36,'Syntax\n------\n\nFIND_IN_SET(pattern, strlist)\n\nDescription\n-----------\n\nReturns the index position where the given pattern occurs in a string list.\nThe first argument is the pattern you want to search for. The second argument\nis a string containing comma-separated variables. If the second argument is of\nthe SET data-type, the function is optimized to use bit arithmetic.\n\nIf the pattern does not occur in the string list or if the string list is an\nempty string, the function returns 0. If either argument is NULL, the function\nreturns NULL. The function does not return the correct result if the pattern\ncontains a comma (\",\") character.\n\nExamples\n--------\n\nSELECT FIND_IN_SET(\'b\',\'a,b,c,d\') AS \"Found Results\";\n+---------------+\n| Found Results |\n+---------------+\n|             2 |\n+---------------+\n\nURL: https://mariadb.com/kb/en/find_in_set/','','https://mariadb.com/kb/en/find_in_set/'),
(649,'FORMAT',36,'Syntax\n------\n\nFORMAT(num, decimal_position[, locale])\n\nDescription\n-----------\n\nFormats the given number for display as a string, adding separators to\nappropriate position and rounding the results to the given decimal position.\nFor instance, it would format 15233.345 to 15,233.35.\n\nIf the given decimal position is 0, it rounds to return no decimal point or\nfractional part. You can optionally specify a locale value to format numbers\nto the pattern appropriate for the given region.\n\nExamples\n--------\n\nSELECT FORMAT(1234567890.09876543210, 4) AS \'Format\';\n+--------------------+\n| Format             |\n+--------------------+\n| 1,234,567,890.0988 |\n+--------------------+\n\nSELECT FORMAT(1234567.89, 4) AS \'Format\';\n+----------------+\n| Format         |\n+----------------+\n| 1,234,567.8900 |\n+----------------+\n\nSELECT FORMAT(1234567.89, 0) AS \'Format\';\n+-----------+\n| Format    |\n+-----------+\n| 1,234,568 |\n+-----------+\n\nSELECT FORMAT(123456789,2,\'rm_CH\') AS \'Format\';\n+----------------+\n| Format         |\n+----------------+\n| 123\'456\'789,00 |\n+----------------+\n\nURL: https://mariadb.com/kb/en/format/','','https://mariadb.com/kb/en/format/'),
(650,'FROM_BASE64',36,'Syntax\n------\n\nFROM_BASE64(str)\n\nDescription\n-----------\n\nDecodes the given base-64 encode string, returning the result as a binary\nstring. Returns NULL if the given string is NULL or if it\'s invalid.\n\nIt is the reverse of the TO_BASE64 function.\n\nThere are numerous methods to base-64 encode a string. MariaDB uses the\nfollowing:\n\n* It encodes alphabet value 64 as \'+\'.\n* It encodes alphabet value 63 as \'/\'.\n* It codes output in groups of four printable characters.  Each three byte of\ndata encoded uses four characters.  If the final group is incomplete, it pads\nthe difference with the \'=\' character.\n* It divides long output, adding a new line very 76 characters.\n* In decoding, it recognizes and ignores newlines, carriage returns, tabs and\nspace whitespace characters.\n\nSELECT TO_BASE64(\'Maria\') AS \'Input\';\n+-----------+\n| Input     |\n+-----------+\n| TWFyaWE=  |\n+-----------+\n\nSELECT FROM_BASE64(\'TWFyaWE=\') AS \'Output\';\n+--------+\n| Output |\n+--------+\n| Maria  |\n+--------+\n\nURL: https://mariadb.com/kb/en/from_base64/','','https://mariadb.com/kb/en/from_base64/'),
(651,'HEX',36,'Syntax\n------\n\nHEX(N_or_S)\n\nDescription\n-----------\n\nIf N_or_S is a number, returns a string representation of the hexadecimal\nvalue of N, where N is a longlong (BIGINT) number. This is equivalent to\nCONV(N,10,16).\n\nIf N_or_S is a string, returns a hexadecimal string representation of N_or_S\nwhere each byte of each character in N_or_S is converted to two hexadecimal\ndigits. If N_or_S is NULL, returns NULL. The inverse of this operation is\nperformed by the UNHEX() function.\n\nMariaDB starting with 10.5.0\n----------------------------\nHEX() with an INET6 argument returns a hexadecimal representation of the\nunderlying 16-byte binary string.\n\nExamples\n--------\n\nSELECT HEX(255);\n+----------+\n| HEX(255) |\n+----------+\n| FF       |\n+----------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB          |\n+------------------+\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nFrom MariaDB 10.5.0:\n\nSELECT HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6));\n+----------------------------------------------+\n| HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6)) |\n+----------------------------------------------+\n| 20010DB8000000000000FF0000428329             |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/hex/','','https://mariadb.com/kb/en/hex/'),
(655,'INSERT Function',36,'Syntax\n------\n\nINSERT(str,pos,len,newstr)\n\nDescription\n-----------\n\nReturns the string str, with the substring beginning at position pos and len\ncharacters long replaced by the string newstr. Returns the original string if\npos is not within the length of the string. Replaces the rest of the string\nfrom position pos if len is not within the length of the rest of the string.\nReturns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n+-----------------------------------+\n| INSERT(\'Quadratic\', 3, 4, \'What\') |\n+-----------------------------------+\n| QuWhattic                         |\n+-----------------------------------+\n\nSELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n+------------------------------------+\n| INSERT(\'Quadratic\', -1, 4, \'What\') |\n+------------------------------------+\n| Quadratic                          |\n+------------------------------------+\n\nSELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n+-------------------------------------+\n| INSERT(\'Quadratic\', 3, 100, \'What\') |\n+-------------------------------------+\n| QuWhat                              |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/insert-function/','','https://mariadb.com/kb/en/insert-function/'),
(656,'LENGTH',36,'Syntax\n------\n\nLENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the string str.\n\nIn the default mode, when Oracle mode from MariaDB 10.3 is not set, the length\nis measured in bytes. In this case, a multi-byte character counts as multiple\nbytes. This means that for a string containing five two-byte characters,\nLENGTH() returns 10, whereas CHAR_LENGTH() returns 5.\n\nWhen running Oracle mode from MariaDB 10.3, the length is measured in\ncharacters, and LENGTH is a synonym for CHAR_LENGTH().\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nSELECT LENGTH(\'MariaDB\');\n+-------------------+\n| LENGTH(\'MariaDB\') |\n+-------------------+\n|                 7 |\n+-------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/length/','','https://mariadb.com/kb/en/length/'),
(657,'LENGTHB',36,'MariaDB starting with 10.3.1\n----------------------------\nIntroduced in MariaDB 10.3.1 as part of the Oracle compatibility enhancements.\n\nSyntax\n------\n\nLENGTHB(str)\n\nDescription\n-----------\n\nLENGTHB() returns the length of the given string, in bytes. When Oracle mode\nis not set, this is a synonym for LENGTH.\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, LENGTHB() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/lengthb/','','https://mariadb.com/kb/en/lengthb/'),
(659,'LOCATE',36,'Syntax\n------\n\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nDescription\n-----------\n\nThe first syntax returns the position of the first occurrence of substring\nsubstr in string str. The second syntax returns the position of the first\noccurrence of substring substr in string str, starting at position pos.\nReturns 0 if substr is not in str.\n\nLOCATE() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nINSTR() is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nExamples\n--------\n\nSELECT LOCATE(\'bar\', \'foobarbar\');\n+----------------------------+\n| LOCATE(\'bar\', \'foobarbar\') |\n+----------------------------+\n|                          4 |\n+----------------------------+\n\nSELECT LOCATE(\'My\', \'Maria\');\n+-----------------------+\n| LOCATE(\'My\', \'Maria\') |\n+-----------------------+\n|                     0 |\n+-----------------------+\n\nSELECT LOCATE(\'bar\', \'foobarbar\', 5);\n+-------------------------------+\n| LOCATE(\'bar\', \'foobarbar\', 5) |\n+-------------------------------+\n|                             7 |\n+-------------------------------+\n\nURL: https://mariadb.com/kb/en/locate/','','https://mariadb.com/kb/en/locate/'),
(658,'LIKE',36,'Syntax\n------\n\nexpr LIKE pat [ESCAPE \'escape_char\']\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nTests whether expr matches the pattern pat. Returns either 1 (TRUE) or 0\n(FALSE). Both expr and pat may be any valid expression and are evaluated to\nstrings. Patterns may use the following wildcard characters:\n\n* % matches any number of characters, including zero.\n* _ matches any single character.\n\nUse NOT LIKE to test if a string does not match a pattern. This is equivalent\nto using the NOT operator on the entire LIKE expression.\n\nIf either the expression or the pattern is NULL, the result is NULL.\n\nLIKE performs case-insensitive substring matches if the collation for the\nexpression and pattern is case-insensitive. For case-sensitive matches,\ndeclare either argument to use a binary collation using COLLATE, or coerce\neither of them to a BINARY string using CAST. Use SHOW COLLATION to get a list\nof available collations. Collations ending in _bin are case-sensitive.\n\nNumeric arguments are coerced to binary strings.\n\nThe _ wildcard matches a single character, not byte. It will only match a\nmulti-byte character if it is valid in the expression\'s character set. For\nexample, _ will match _utf8\"€\", but it will not match _latin1\"€\" because the\nEuro sign is not a valid latin1 character. If necessary, use CONVERT to use\nthe expression in a different character set.\n\nIf you need to match the characters _ or %, you must escape them. By default,\nyou can prefix the wildcard characters the backslash character \\ to escape\nthem. The backslash is used both to encode special characters like newlines\nwhen a string is parsed as well as to escape wildcards in a pattern after\nparsing. Thus, to match an actual backslash, you sometimes need to\ndouble-escape it as \"\\\\\\\\\".\n\nTo avoid difficulties with the backslash character, you can change the\nwildcard escape character using ESCAPE in a LIKE expression. The argument to\nESCAPE must be a single-character string.\n\nExamples\n--------\n\nSelect the days that begin with \"T\":\n\nCREATE TABLE t1 (d VARCHAR(16));\nINSERT INTO t1 VALUES \n (\"Monday\"), (\"Tuesday\"), (\"Wednesday\"),\n (\"Thursday\"), (\"Friday\"), (\"Saturday\"), (\"Sunday\");\nSELECT * FROM t1 WHERE d LIKE \"T%\";\n\nSELECT * FROM t1 WHERE d LIKE \"T%\";\n+----------+\n| d        |\n+----------+\n| Tuesday  |\n| Thursday |\n+----------+\n\nSelect the days that contain the substring \"es\":\n\nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n\nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n+-----------+\n| d         |\n+-----------+\n| Tuesday   |\n| Wednesday |\n+-----------+\n\nSelect the six-character day names:\n\nSELECT * FROM t1 WHERE d like \"___day\";\n\nSELECT * FROM t1 WHERE d like \"___day\";\n+---------+\n| d       |\n+---------+\n| Monday  |\n| Friday  |\n| Sunday  |\n+---------+\n\nWith the default collations, LIKE is case-insensitive:\n\nSELECT * FROM t1 where d like \"t%\";\n\nSELECT * FROM t1 where d like \"t%\";\n+----------+\n| d        |\n+----------+\n| Tuesday  |\n| Thursday |\n+----------+\n\nUse COLLATE to specify a binary collation, forcing case-sensitive matches:\n\nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\n\nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\nEmpty set (0.00 sec)\n\nYou can include functions and operators in the expression to match. Select\ndates based on their day name:\n\nCREATE TABLE t2 (d DATETIME);\nINSERT INTO t2 VALUES\n  (\"2007-01-30 21:31:07\"),\n  (\"1983-10-15 06:42:51\"),\n  (\"2011-04-21 12:34:56\"),\n  (\"2011-10-30 06:31:41\"),\n  (\"2011-01-30 14:03:25\"),\n  (\"2004-10-07 11:19:34\");\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n+------------------+\n| d                |\n+------------------+\n| 2007-01-30 21:31 |\n| 2011-04-21 12:34 |\n| 2004-10-07 11:19 |\n+------------------+\n3 rows in set, 7 warnings (0.00 sec)\n\nOptimizing LIKE\n---------------\n\n* MariaDB can use indexes for LIKE on string columns in the case where the\nLIKE doesn\'t start with % or _.\n* Starting from MariaDB 10.0, one can set  the\noptimizer_use_condition_selectivity variable to 5. If this is done, then the\noptimizer will read optimizer_selectivity_sampling_limit rows to calculate the\nselectivity of the LIKE expression before starting to calculate the query\nplan. This can help speed up some LIKE queries by providing the optimizer with\nmore information about your data.\n\nURL: https://mariadb.com/kb/en/like/','','https://mariadb.com/kb/en/like/'),
(660,'LOWER',36,'Syntax\n------\n\nLOWER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to lowercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nExamples\n--------\n\nSELECT LOWER(\'QUADRATICALLY\');\n+------------------------+\n| LOWER(\'QUADRATICALLY\') |\n+------------------------+\n| quadratically          |\n+------------------------+\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY,\nVARBINARY, BLOB). To perform lettercase conversion, CONVERT the string to a\nnon-binary string:\n\nSET @str = BINARY \'North Carolina\';\n\nSELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+----------------+-----------------------------------+\n| LOWER(@str)    | LOWER(CONVERT(@str USING latin1)) |\n+----------------+-----------------------------------+\n| North Carolina | north carolina                    |\n+----------------+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/lower/','','https://mariadb.com/kb/en/lower/'),
(661,'LPAD',36,'Syntax\n------\n\nLPAD(str, len [,padstr])\n\nDescription\n-----------\n\nReturns the string str, left-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the LPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (zero length),\nreturns either an empty string or, from MariaDB 10.3.6 with SQL_MODE=Oracle,\nNULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT LPAD(\'hello\',10,\'.\');\n+----------------------+\n| LPAD(\'hello\',10,\'.\') |\n+----------------------+\n| .....hello           |\n+----------------------+\n\nSELECT LPAD(\'hello\',2,\'.\');\n+---------------------+\n| LPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he                  |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT LPAD(\'hello\',10);\n+------------------+\n| LPAD(\'hello\',10) |\n+------------------+\n|      hello       |\n+------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LPAD(\'\',0),LPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| LPAD(\'\',0) | LPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n|            | NULL              |\n+------------+-------------------+\n\nURL: https://mariadb.com/kb/en/lpad/','','https://mariadb.com/kb/en/lpad/'),
(662,'LTRIM',36,'Syntax\n------\n\nLTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with leading space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(LTRIM(\'   MariaDB   \'));\n+-------------------------------+\n| QUOTE(LTRIM(\'   MariaDB   \')) |\n+-------------------------------+\n| \'MariaDB   \'                  |\n+-------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LTRIM(\'\'),LTRIM_ORACLE(\'\');\n+-----------+------------------+\n| LTRIM(\'\') | LTRIM_ORACLE(\'\') |\n+-----------+------------------+\n|           | NULL             |\n+-----------+------------------+\n\nURL: https://mariadb.com/kb/en/ltrim/','','https://mariadb.com/kb/en/ltrim/'),
(663,'MAKE_SET',36,'Syntax\n------\n\nMAKE_SET(bits,str1,str2,...)\n\nDescription\n-----------\n\nReturns a set value (a string containing substrings separated by \",\"\ncharacters) consisting of the strings that have the corresponding bit in bits\nset. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL values in str1,\nstr2, ... are not appended to the result.\n\nExamples\n--------\n\nSELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n+-------------------------+\n| MAKE_SET(1,\'a\',\'b\',\'c\') |\n+-------------------------+\n| a                       |\n+-------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n+----------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\') |\n+----------------------------------------+\n| hello,world                            |\n+----------------------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n+---------------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\') |\n+---------------------------------------------+\n| hello                                       |\n+---------------------------------------------+\n\nSELECT QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\'));\n+--------------------------------+\n| QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\')) |\n+--------------------------------+\n| \'\'                             |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/make_set/','','https://mariadb.com/kb/en/make_set/'),
(664,'MATCH AGAINST',36,'Syntax\n------\n\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nDescription\n-----------\n\nA special construct used to perform a fulltext search on a fulltext index.\n\nSee Fulltext Index Overview for a full description, and Full-text Indexes for\nmore articles on the topic.\n\nExamples\n--------\n\nCREATE TABLE ft_myisam(copy TEXT,FULLTEXT(copy)) ENGINE=MyISAM;\n\nINSERT INTO ft_myisam(copy) VALUES (\'Once upon a time\'), (\'There was a wicked\nwitch\'), \n (\'Who ate everybody up\');\n\nSELECT * FROM ft_myisam WHERE MATCH(copy) AGAINST(\'wicked\');\n+--------------------------+\n| copy                     |\n+--------------------------+\n| There was a wicked witch |\n+--------------------------+\n\nSELECT id, body, MATCH (title,body) AGAINST\n  (\'Security implications of running MySQL as root\'\n  IN NATURAL LANGUAGE MODE) AS score\n  FROM articles WHERE MATCH (title,body) AGAINST\n  (\'Security implications of running MySQL as root\'\n  IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body                                | score           |\n+----+-------------------------------------+-----------------+\n|  4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n|  6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n\nURL: https://mariadb.com/kb/en/match-against/','','https://mariadb.com/kb/en/match-against/'),
(666,'NATURAL_SORT_KEY',36,'MariaDB starting with 10.7.0\n----------------------------\nNATURAL_SORT_KEY was added in MariaDB 10.7.0.\n\nSyntax\n------\n\nNATURAL_SORT_KEY(str)\n\nDescription\n-----------\n\nThe NATURAL_SORT_KEY function is used for sorting that is closer to natural\nsorting. Strings are sorted in alphabetical order, while numbers are treated\nin a way such that, for example, 10 is greater than 2, whereas in other forms\nof sorting, 2 would be greater than 10, just like z is greater than ya.\n\nThere are multiple natural sort implementations, differing in the way they\nhandle leading zeroes, fractions, i18n, negatives, decimals and so on.\n\nMariaDB\'s implementation ignores leading zeroes when performing the sort.\n\nYou can use also use NATURAL_SORT_KEY with generated columns. The value is not\nstored permanently in the table. When using a generated column, the virtual\ncolumn must be longer than the base column to cater for embedded numbers in\nthe string and MDEV-24582.\n\nExamples\n--------\n\nStrings and Numbers\n-------------------\n\nCREATE TABLE t1 (c TEXT);\n\nINSERT INTO t1 VALUES (\'b1\'),(\'a2\'),(\'a11\'),(\'a1\');\n\nSELECT c FROM t1;\n+------+\n| c    |\n+------+\n| b1   |\n| a2   |\n| a11  |\n| a1   |\n+------+\n\nSELECT c FROM t1 ORDER BY c;\n+------+\n| c    |\n+------+\n| a1   |\n| a11  |\n| a2   |\n| b1   |\n+------+\n\nUnsorted, regular sort and natural sort:\n\nTRUNCATE t1;\n\nINSERT INTO t1 VALUES \n (\'5.5.31\'),(\'10.7.0\'),(\'10.2.1\'),\n (\'10.1.22\'),(\'10.3.32\'),(\'10.2.12\');\n\nSELECT c FROM t1;\n+---------+\n| c       |\n+---------+\n| 5.5.31  |\n| 10.7.0  |\n| 10.2.1  |\n| 10.1.22 |\n| 10.3.32 |\n| 10.2.12 |\n+---------+\n\nSELECT c FROM t1 ORDER BY c;\n+---------+\n| c       |\n+---------+\n| 10.1.22 |\n| 10.2.1  |\n| 10.2.12 |\n| 10.3.32 |\n| 10.7.0  |\n| 5.5.31  |\n+---------+\n\nSELECT c FROM t1 ORDER BY NATURAL_SORT_KEY(c);\n+---------+\n| c       |\n+---------+\n| 5.5.31  |\n| 10.1.22 |\n| 10.2.1  |\n| 10.2.12 |\n| 10.3.32 |\n| 10.7.0  |\n+---------+\n\nIPs\n---\n\nSorting IPs, unsorted, regular sort and natural sort::\n\nTRUNCATE t1;\n\nINSERT INTO t1 VALUES \n (\'192.167.3.1\'),(\'192.167.1.12\'),(\'100.200.300.400\'),\n (\'100.50.60.70\'),(\'100.8.9.9\'),(\'127.0.0.1\'),(\'0.0.0.0\');\n\nSELECT c FROM t1;\n+-----------------+\n| c               |\n+-----------------+\n| 192.167.3.1     |\n| 192.167.1.12    |\n| 100.200.300.400 |\n| 100.50.60.70    |\n| 100.8.9.9       |\n| 127.0.0.1       |\n| 0.0.0.0         |\n+-----------------+\n\nSELECT c FROM t1 ORDER BY c;\n+-----------------+\n| c               |\n+-----------------+\n| 0.0.0.0         |\n| 100.200.300.400 |\n| 100.50.60.70    |\n| 100.8.9.9       |\n| 127.0.0.1       |\n| 192.167.1.12    |\n| 192.167.3.1     |\n+-----------------+\n\nSELECT c FROM t1 ORDER BY NATURAL_SORT_KEY(c);\n+-----------------+\n| c               |\n+-----------------+\n| 0.0.0.0         |\n| 100.8.9.9       |\n| 100.50.60.70    |\n| 100.200.300.400 |\n| 127.0.0.1       |\n| 192.167.1.12    |\n| 192.167.3.1     |\n+-----------------+\n\nGenerated Columns\n-----------------\n\nUsing with a generated column:\n\nCREATE TABLE t(c VARCHAR(3), k VARCHAR(4) AS (NATURAL_SORT_KEY(c)) INVISIBLE);\n\nINSERT INTO t(c) VALUES (\'b1\'),(\'a2\'),(\'a11\'),(\'a10\');\n\nSELECT * FROM t ORDER by k;\n+------+\n| c    |\n+------+\n| a2   |\n| a10  |\n| a11  |\n| b1   |\n+------+\n\nNote that if the virtual column is not longer, results may not be as expected:\n\nCREATE TABLE t2(c VARCHAR(3), k VARCHAR(3) AS (NATURAL_SORT_KEY(c)) INVISIBLE);\n\nINSERT INTO t2(c) VALUES (\'b1\'),(\'a2\'),(\'a11\'),(\'a10\');\n\nSELECT * FROM t2 ORDER by k;\n+------+\n| c    |\n+------+\n| a2   |\n| a11  |\n| a10  |\n| b1   |\n+------+\n\nLeading Zeroes\n--------------\n\nIgnoring leading zeroes can lead to undesirable results in certain contexts.\nFor example:\n\nCREATE TABLE t3 (a VARCHAR(4));\n\nINSERT INTO t3 VALUES \n (\'a1\'), (\'a001\'), (\'a10\'), (\'a001\'), (\'a10\'),\n (\'a01\'), (\'a01\'), (\'a01b\'), (\'a01b\'), (\'a1\');\n\nSELECT a FROM t3 ORDER BY a;\n+------+\n| a    |\n+------+\n| a001 |\n| a001 |\n| a01  |\n| a01  |\n| a01b |\n| a01b |\n| a1   |\n| a1   |\n| a10  |\n| a10  |\n+------+\n10 rows in set (0.000 sec)\n\nSELECT a FROM t3 ORDER BY NATURAL_SORT_KEY(a);\n+------+\n| a    |\n+------+\n| a1   |\n| a01  |\n| a01  |\n| a001 |\n| a001 |\n| a1   |\n| a01b |\n| a01b |\n| a10  |\n| a10  |\n+------+\n\nThis may not be what we were hoping for in a \'natural\' sort. A workaround is\nto sort by both NATURAL_SORT_KEY and regular sort.\n\nSELECT a FROM t3 ORDER BY NATURAL_SORT_KEY(a), a;\n+------+\n| a    |\n+------+\n| a001 |\n| a001 |\n| a01  |\n| a01  |\n| a1   |\n| a1   |\n| a01b |\n| a01b |\n| a10  |\n| a10  |\n+------+\n\nURL: https://mariadb.com/kb/en/natural_sort_key/','','https://mariadb.com/kb/en/natural_sort_key/'),
(668,'OCTET_LENGTH',36,'Syntax\n------\n\nOCTET_LENGTH(str)\n\nDescription\n-----------\n\nOCTET_LENGTH() returns the length of the given string, in octets (bytes). This\nis a synonym for LENGTHB(), and, when Oracle mode from MariaDB 10.3 is not\nset, a synonym for LENGTH().\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, OCTET_LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            2 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\')  | LENGTH(\'π\')  | LENGTHB(\'π\')  | OCTET_LENGTH(\'π\')  |\n+-------------------+--------------+---------------+--------------------+\n|                 1 |            1 |             2 |                  2 |\n+-------------------+--------------+---------------+--------------------+\n\nURL: https://mariadb.com/kb/en/octet_length/','','https://mariadb.com/kb/en/octet_length/'),
(676,'RPAD',36,'Syntax\n------\n\nRPAD(str, len [, padstr])\n\nDescription\n-----------\n\nReturns the string str, right-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the RPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (a length of\nzero), returns either an empty string, or, from MariaDB 10.3.6 with\nSQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT RPAD(\'hello\',10,\'.\');\n+----------------------+\n| RPAD(\'hello\',10,\'.\') |\n+----------------------+\n| hello.....           |\n+----------------------+\n\nSELECT RPAD(\'hello\',2,\'.\');\n+---------------------+\n| RPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he                  |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT RPAD(\'hello\',30);\n+--------------------------------+\n| RPAD(\'hello\',30)               |\n+--------------------------------+\n| hello                          |\n+--------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RPAD(\'\',0),RPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| RPAD(\'\',0) | RPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n|            | NULL              |\n+------------+-------------------+\n\nURL: https://mariadb.com/kb/en/rpad/','','https://mariadb.com/kb/en/rpad/'),
(677,'RTRIM',36,'Syntax\n------\n\nRTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with trailing space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(RTRIM(\'MariaDB    \'));\n+-----------------------------+\n| QUOTE(RTRIM(\'MariaDB    \')) |\n+-----------------------------+\n| \'MariaDB\'                   |\n+-----------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RTRIM(\'\'),RTRIM_ORACLE(\'\');\n+-----------+------------------+\n| RTRIM(\'\') | RTRIM_ORACLE(\'\') |\n+-----------+------------------+\n|           | NULL             |\n+-----------+------------------+\n\nURL: https://mariadb.com/kb/en/rtrim/','','https://mariadb.com/kb/en/rtrim/'),
(678,'SFORMAT',36,'MariaDB starting with 10.7.0\n----------------------------\nSFORMAT was added in MariaDB 10.7.0.\n\nDescription\n-----------\n\nThe SFORMAT function takes an input string and a formatting specification and\nreturns the string formatted using the rules the user passed in the\nspecification.\n\nIt uses the fmtlib library for Python-like (as well as Rust, C++20, etc)\nstring formatting.\n\nOnly fmtlib 7.0.0+ is supported.\n\nThere is no native support for temporal and decimal values:\n\n* TIME_RESULT is handled as STRING_RESULT\n* DECIMAL_RESULT as REAL_RESULT\n\nExamples\n--------\n\nSELECT SFORMAT(\"The answer is {}.\", 42);\n+----------------------------------+\n| SFORMAT(\"The answer is {}.\", 42) |\n+----------------------------------+\n| The answer is 42.                |\n+----------------------------------+\n\nCREATE TABLE test_sformat(mdb_release char(6), mdev int, feature char(20));\n\nINSERT INTO test_sformat VALUES(\'10.7.0\', 25015, \'Python style sformat\'), \n (\'10.7.0\', 4958, \'UUID\');\n\nSELECT * FROM test_sformat;\n+-------------+-------+----------------------+\n| mdb_release | mdev  | feature              |\n+-------------+-------+----------------------+\n| 10.7.0      | 25015 | Python style sformat |\n| 10.7.0      |  4958 | UUID                 |\n+-------------+-------+----------------------+\n\nSELECT SFORMAT(\'MariaDB Server {} has a preview for MDEV-{} which is about\n{}\', \n mdb_release, mdev, feature) AS \'Preview Release Examples\'\n FROM test_sformat;\n+------------------------------------------------------------------------------\n---------+\n| Preview Release Examples                                                    \n     |\n+------------------------------------------------------------------------------\n---------+\n| MariaDB Server 10.7.0 has a preview for MDEV-25015 which is about Python\nstyle sformat |\n| MariaDB Server 10.7.0 has a preview for MDEV-4958 which is about UUID       \n     |\n+------------------------------------------------------------------------------\n---------+\n\nURL: https://mariadb.com/kb/en/sformat/','','https://mariadb.com/kb/en/sformat/'),
(679,'SOUNDEX',36,'Syntax\n------\n\nSOUNDEX(str)\n\nDescription\n-----------\n\nReturns a soundex string from str. Two strings that sound almost the same\nshould have identical soundex strings. A standard soundex string is four\ncharacters long, but the SOUNDEX() function returns an arbitrarily long\nstring. You can use SUBSTRING() on the result to get a standard soundex\nstring. All non-alphabetic characters in str are ignored. All international\nalphabetic characters outside the A-Z range are treated as vowels.\n\nImportant: When using SOUNDEX(), you should be aware of the following details:\n\n* This function, as currently implemented, is intended to work well with\n strings that are in the English language only. Strings in other languages may\n not produce reasonable results.\n\n* This function implements the original Soundex algorithm, not the more\npopular enhanced version (also described by D. Knuth). The difference is that\noriginal version discards vowels first and duplicates second, whereas the\nenhanced version discards duplicates first and vowels second.\n\nExamples\n--------\n\nSOUNDEX(\'Hello\');\n+------------------+\n| SOUNDEX(\'Hello\') |\n+------------------+\n| H400             |\n+------------------+\n\nSELECT SOUNDEX(\'MariaDB\');\n+--------------------+\n| SOUNDEX(\'MariaDB\') |\n+--------------------+\n| M631               |\n+--------------------+\n\nSELECT SOUNDEX(\'Knowledgebase\');\n+--------------------------+\n| SOUNDEX(\'Knowledgebase\') |\n+--------------------------+\n| K543212                  |\n+--------------------------+\n\nSELECT givenname, surname FROM users WHERE SOUNDEX(givenname) =\nSOUNDEX(\"robert\");\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto   | Castro  |\n+-----------+---------+\n\nURL: https://mariadb.com/kb/en/soundex/','','https://mariadb.com/kb/en/soundex/'),
(682,'STRCMP',36,'Syntax\n------\n\nSTRCMP(expr1,expr2)\n\nDescription\n-----------\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first argument is\nsmaller than the second according to the current sort order, and 1 if the\nstrings are otherwise not the same. Returns NULL is either argument is NULL.\n\nExamples\n--------\n\nSELECT STRCMP(\'text\', \'text2\');\n+-------------------------+\n| STRCMP(\'text\', \'text2\') |\n+-------------------------+\n|                      -1 |\n+-------------------------+\n\nSELECT STRCMP(\'text2\', \'text\');\n+-------------------------+\n| STRCMP(\'text2\', \'text\') |\n+-------------------------+\n|                       1 |\n+-------------------------+\n\nSELECT STRCMP(\'text\', \'text\');\n+------------------------+\n| STRCMP(\'text\', \'text\') |\n+------------------------+\n|                      0 |\n+------------------------+\n\nURL: https://mariadb.com/kb/en/strcmp/','','https://mariadb.com/kb/en/strcmp/'),
(684,'SUBSTRING',36,'Syntax\n------\n\nSUBSTRING(str,pos), \nSUBSTRING(str FROM pos), \nSUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nSUBSTR(str,pos), \nSUBSTR(str FROM pos), \nSUBSTR(str,pos,len),\nSUBSTR(str FROM pos FOR len)\n\nDescription\n-----------\n\nThe forms without a len argument return a substring from string str starting\nat position pos.\n\nThe forms with a len argument return a substring len characters long from\nstring str, starting at position pos.\n\nThe forms that use FROM are standard SQL syntax.\n\nIt is also possible to use a negative value for pos. In this case, the\nbeginning of the substring is pos characters from the end of the string,\nrather than the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nBy default, the position of the first character in the string from which the\nsubstring is to be extracted is reckoned as 1. For Oracle-compatibility, from\nMariaDB 10.3.3, when sql_mode is set to \'oracle\', position zero is treated as\nposition 1 (although the first character is still reckoned as 1).\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT SUBSTRING(\'Knowledgebase\',5);\n+------------------------------+\n| SUBSTRING(\'Knowledgebase\',5) |\n+------------------------------+\n| ledgebase                    |\n+------------------------------+\n\nSELECT SUBSTRING(\'MariaDB\' FROM 6);\n+-----------------------------+\n| SUBSTRING(\'MariaDB\' FROM 6) |\n+-----------------------------+\n| DB                          |\n+-----------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\',3,7);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\',3,7) |\n+--------------------------------+\n| owledge                        |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -4);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\', -4) |\n+--------------------------------+\n| base                           |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -8, 4);\n+-----------------------------------+\n| SUBSTRING(\'Knowledgebase\', -8, 4) |\n+-----------------------------------+\n| edge                              |\n+-----------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4);\n+------------------------------------------+\n| SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4) |\n+------------------------------------------+\n| edge                                     |\n+------------------------------------------+\n\nOracle mode from MariaDB 10.3.3:\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n|                   |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab                |\n+-------------------+\n\nSET sql_mode=\'oracle\';\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| abc               |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab                |\n+-------------------+\n\nURL: https://mariadb.com/kb/en/substring/','','https://mariadb.com/kb/en/substring/'),
(685,'SUBSTRING_INDEX',36,'Syntax\n------\n\nSUBSTRING_INDEX(str,delim,count)\n\nDescription\n-----------\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the final\ndelimiter (counting from the left) is returned. If count is negative,\neverything to the right of the final delimiter (counting from the right) is\nreturned. SUBSTRING_INDEX() performs a case-sensitive match when searching for\ndelim.\n\nIf any argument is NULL, returns NULL.\n\nFor example\n\nSUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2)\n\nmeans \"Return all of the characters up to the 2nd occurrence of .\"\n\nExamples\n--------\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2);\n+--------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2) |\n+--------------------------------------------+\n| www.mariadb                                |\n+--------------------------------------------+\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2);\n+---------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2) |\n+---------------------------------------------+\n| mariadb.org                                 |\n+---------------------------------------------+\n\nURL: https://mariadb.com/kb/en/substring_index/','','https://mariadb.com/kb/en/substring_index/'),
(686,'TO_BASE64',36,'Syntax\n------\n\nTO_BASE64(str)\n\nDescription\n-----------\n\nConverts the string argument str to its base-64 encoded form, returning the\nresult as a character string in the connection character set and collation.\n\nThe argument str will be converted to string first if it is not a string. A\nNULL argument will return a NULL result.\n\nThe reverse function, FROM_BASE64(), decodes an encoded base-64 string.\n\nThere are a numerous different methods to base-64 encode a string. The\nfollowing are used by MariaDB and MySQL:\n\n* Alphabet value 64 is encoded as \'+\'.\n* Alphabet value 63 is encoded as \'/\'.\n* Encoding output is made up of groups of four printable characters, with each\nthree bytes of data encoded using four characters. If the final group is not\ncomplete, it is padded with \'=\' characters to make up a length of four.\n* To divide long output, a newline is added after every 76 characters.\n* Decoding will recognize and ignore newlines, carriage returns, tabs, and\nspaces.\n\nExamples\n--------\n\nSELECT TO_BASE64(\'Maria\');\n+--------------------+\n| TO_BASE64(\'Maria\') |\n+--------------------+\n| TWFyaWE=           |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/to_base64/','','https://mariadb.com/kb/en/to_base64/'),
(687,'TO_CHAR',36,'MariaDB starting with 10.6.1\n----------------------------\nThe TO_CHAR function was introduced in MariaDB 10.6.1 to enhance Oracle\ncompatibility.\n\nSyntax\n------\n\nTO_CHAR(expr[, fmt])\n\nDescription\n-----------\n\nThe TO_CHAR function converts an expr of type date, datetime, time or\ntimestamp to a string. The optional fmt argument supports\nYYYY/YYY/YY/RRRR/RR/MM/MON/MONTH/MI/DD/DY/HH/HH12/HH24/SS and special\ncharacters. The default value is \"YYYY-MM-DD HH24:MI:SS\".\n\nIn Oracle, TO_CHAR can also be used to convert numbers to strings, but this is\nnot supported in MariaDB and will give an error.\n\nExamples\n--------\n\nSELECT TO_CHAR(\'1980-01-11 04:50:39\', \'YYYY-MM-DD\');\n+----------------------------------------------+\n| TO_CHAR(\'1980-01-11 04:50:39\', \'YYYY-MM-DD\') |\n+----------------------------------------------+\n| 1980-01-11                                   |\n+----------------------------------------------+\n\nSELECT TO_CHAR(\'1980-01-11 04:50:39\', \'HH24-MI-SS\');\n+----------------------------------------------+\n| TO_CHAR(\'1980-01-11 04:50:39\', \'HH24-MI-SS\') |\n+----------------------------------------------+\n| 04-50-39                                     |\n+----------------------------------------------+\n\nSELECT TO_CHAR(\'00-01-01 00:00:00\', \'YY-MM-DD HH24:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'00-01-01 00:00:00\', \'YY-MM-DD HH24:MI:SS\') |\n+-----------------------------------------------------+\n| 00-01-01 00:00:00                                   |\n+-----------------------------------------------------+\n\nSELECT TO_CHAR(\'99-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'99-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\') |\n+-----------------------------------------------------+\n| 99-12-31 23:59:59                                   |\n+-----------------------------------------------------+\n\nSELECT TO_CHAR(\'9999-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\');\n+-------------------------------------------------------+\n| TO_CHAR(\'9999-12-31 23:59:59\', \'YY-MM-DD HH24:MI:SS\') |\n+-------------------------------------------------------+\n| 99-12-31 23:59:59                                     |\n+-------------------------------------------------------+\n\nSELECT TO_CHAR(\'21-01-03 08:30:00\', \'Y-MONTH-DY HH:MI:SS\');\n+-----------------------------------------------------+\n| TO_CHAR(\'21-01-03 08:30:00\', \'Y-MONTH-DY HH:MI:SS\') |\n+-----------------------------------------------------+\n| 1-January  -Sun 08:30:00                            |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/to_char/','','https://mariadb.com/kb/en/to_char/'),
(688,'TRIM',36,'Syntax\n------\n\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)\n\nFrom MariaDB 10.3.6\n\nTRIM_ORACLE([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nDescription\n-----------\n\nReturns the string str with all remstr prefixes or suffixes removed. If none\nof the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr\nis optional and, if not specified, spaces are removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\nSQL_MODE=Oracle is not set by default.\n\nThe Oracle mode version of the function can be accessed in any mode by using\nTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT TRIM(\'  bar   \')\\G\n*************************** 1. row ***************************\nTRIM(\'  bar   \'): bar\n\nSELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row ***************************\nTRIM(LEADING \'x\' FROM \'xxxbarxxx\'): barxxx\n\nSELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row ***************************\nTRIM(BOTH \'x\' FROM \'xxxbarxxx\'): bar\n\nSELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\')\\G\n*************************** 1. row ***************************\nTRIM(TRAILING \'xyz\' FROM \'barxxyz\'): barx\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle not set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n|          | NULL            |\n+----------+-----------------+\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n| NULL     | NULL            |\n+----------+-----------------+\n\nURL: https://mariadb.com/kb/en/trim/','','https://mariadb.com/kb/en/trim/'),
(690,'UNCOMPRESSED_LENGTH',36,'Syntax\n------\n\nUNCOMPRESSED_LENGTH(compressed_string)\n\nDescription\n-----------\n\nReturns the length that the compressed string had before being compressed with\nCOMPRESS().\n\nUNCOMPRESSED_LENGTH() returns NULL or an incorrect result if the string is not\ncompressed.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n+-----------------------------------------------+\n| UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30))) |\n+-----------------------------------------------+\n|                                            30 |\n+-----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/uncompressed_length/','','https://mariadb.com/kb/en/uncompressed_length/'),
(691,'UNHEX',36,'Syntax\n------\n\nUNHEX(str)\n\nDescription\n-----------\n\nPerforms the inverse operation of HEX(str). That is, it interprets each pair\nof hexadecimal digits in the argument as a number and converts it to the\ncharacter represented by the number. The resulting characters are returned as\na binary string.\n\nIf str is NULL, UNHEX() returns NULL.\n\nExamples\n--------\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nSELECT UNHEX(\'4D617269614442\');\n+-------------------------+\n| UNHEX(\'4D617269614442\') |\n+-------------------------+\n| MariaDB                 |\n+-------------------------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB          |\n+------------------+\n\nSELECT UNHEX(HEX(\'string\'));\n+----------------------+\n| UNHEX(HEX(\'string\')) |\n+----------------------+\n| string               |\n+----------------------+\n\nSELECT HEX(UNHEX(\'1267\'));\n+--------------------+\n| HEX(UNHEX(\'1267\')) |\n+--------------------+\n| 1267               |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/unhex/','','https://mariadb.com/kb/en/unhex/'),
(692,'UPDATEXML',36,'Syntax\n------\n\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nDescription\n-----------\n\nThis function replaces a single portion of a given fragment of XML markup\nxml_target with a new XML fragment new_xml, and then returns the changed XML.\nThe portion of xml_target that is replaced matches an XPath expression\nxpath_expr supplied by the user. If no expression matching xpath_expr is\nfound, or if multiple matches are found, the function returns the original\nxml_target XML fragment. All three arguments should be strings.\n\nExamples\n--------\n\nSELECT\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n  UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n  UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n  \\G\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n1 row in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/updatexml/','','https://mariadb.com/kb/en/updatexml/'),
(699,'ALTER EVENT',38,'Modifies one or more characteristics of an existing event.\n\nSyntax\n------\n\nALTER\n  [DEFINER = { user | CURRENT_USER }]\n  EVENT event_name\n  [ON SCHEDULE schedule]\n  [ON COMPLETION [NOT] PRESERVE]\n  [RENAME TO new_event_name]\n  [ENABLE | DISABLE | DISABLE ON SLAVE]\n  [COMMENT \'comment\']\n  [DO sql_statement]\n\nDescription\n-----------\n\nThe ALTER EVENT statement is used to change one or more of the characteristics\nof an existing event without the need to drop and recreate it. The syntax for\neach of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE / DISABLE,\nand DO clauses is exactly the same as when used with CREATE EVENT.\n\nThis statement requires the EVENT privilege. When a user executes a successful\nALTER EVENT statement, that user becomes the definer for the affected event.\n\n(In MySQL 5.1.11 and earlier, an event could be altered only by its definer,\nor by a user having the SUPER privilege.)\n\nALTER EVENT works only with an existing event:\n\nALTER EVENT no_such_event ON SCHEDULE EVERY \'2:3\' DAY_HOUR;\nERROR 1539 (HY000): Unknown event \'no_such_event\'\n\nExamples\n--------\n\nALTER EVENT myevent \n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 HOUR\n DO\n  UPDATE myschema.mytable SET mycol = mycol + 1;\n\nURL: https://mariadb.com/kb/en/alter-event/','','https://mariadb.com/kb/en/alter-event/'),
(700,'ALTER FUNCTION',38,'Syntax\n------\n\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n  { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored function.\nMore than one change may be specified in an ALTER FUNCTION statement. However,\nyou cannot change the parameters or body of a stored function using this\nstatement; to make such changes, you must drop and re-create the function\nusing DROP FUNCTION and CREATE FUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That privilege is\ngranted automatically to the function creator.) If binary logging is enabled,\nthe ALTER FUNCTION statement might also require the SUPER privilege, as\ndescribed in Binary Logging of Stored Routines.\n\nExample\n-------\n\nALTER FUNCTION hello SQL SECURITY INVOKER;\n\nURL: https://mariadb.com/kb/en/alter-function/','','https://mariadb.com/kb/en/alter-function/'),
(694,'WEIGHT_STRING',36,'Syntax\n------\n\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n levels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nDescription\n-----------\n\nReturns a binary string representing the string\'s sorting and comparison\nvalue. A string with a lower result means that for sorting purposes the string\nappears before a string with a higher result.\n\nWEIGHT_STRING() is particularly useful when adding new collations, for testing\npurposes.\n\nIf str is a non-binary string (CHAR, VARCHAR or TEXT), WEIGHT_STRING returns\nthe string\'s collation weight. If str is a binary string (BINARY, VARBINARY or\nBLOB), the return value is simply the input value, since the weight for each\nbyte in a binary string is the byte value.\n\nWEIGHT_STRING() returns NULL if given a NULL input.\n\nThe optional AS clause permits casting the input string to a binary or\nnon-binary string, as well as to a particular length.\n\nAS BINARY(N) measures the length in bytes rather than characters, and right\npads with 0x00 bytes to the desired length.\n\nAS CHAR(N) measures the length in characters, and right pads with spaces to\nthe desired length.\n\nN has a minimum value of 1, and if it is less than the length of the input\nstring, the string is truncated without warning.\n\nThe optional LEVEL clause specifies that the return value should contain\nweights for specific collation levels. The levels specifier can either be a\nsingle integer, a comma-separated list of integers, or a range of integers\nseparated by a dash (whitespace is ignored). Integers can range from 1 to a\nmaximum of 6, dependent on the collation, and need to be listed in ascending\norder.\n\nIf the LEVEL clause is no provided, a default of 1 to the maximum for the\ncollation is assumed.\n\nIf the LEVEL is specified without using a range, an optional modifier is\npermitted.\n\nASC, the default, returns the weights without any modification.\n\nDESC returns bitwise-inverted weights.\n\nREVERSE returns the weights in reverse order.\n\nExamples\n--------\n\nThe examples below use the HEX() function to represent non-printable results\nin hexadecimal format.\n\nSELECT HEX(WEIGHT_STRING(\'x\'));\n+-------------------------+\n| HEX(WEIGHT_STRING(\'x\')) |\n+-------------------------+\n| 0058                    |\n+-------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS BINARY(4)));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS BINARY(4))) |\n+--------------------------------------+\n| 78000000                             |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS CHAR(4)));\n+------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS CHAR(4))) |\n+------------------------------------+\n| 0058002000200020                   |\n+------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)) |\n+--------------------------------------+\n| AA22EE                               |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC));\n+-------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)) |\n+-------------------------------------------+\n| 55DD11                                    |\n+-------------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE));\n+----------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)) |\n+----------------------------------------------+\n| EE22AA                                       |\n+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/weight_string/','','https://mariadb.com/kb/en/weight_string/'),
(702,'ALTER PROCEDURE',38,'Syntax\n------\n\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n  { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a stored\nprocedure using this statement. To make such changes, you must drop and\nre-create the procedure using either CREATE OR REPLACE PROCEDURE (since\nMariaDB 10.1.3) or DROP PROCEDURE and CREATE PROCEDURE (MariaDB 10.1.2 and\nbefore).\n\nYou must have the ALTER ROUTINE privilege for the procedure. By default, that\nprivilege is granted automatically to the procedure creator. See Stored\nRoutine Privileges.\n\nExample\n-------\n\nALTER PROCEDURE simpleproc SQL SECURITY INVOKER;\n\nURL: https://mariadb.com/kb/en/alter-procedure/','','https://mariadb.com/kb/en/alter-procedure/'),
(705,'ALTER VIEW',38,'Syntax\n------\n\nALTER\n  [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n  [DEFINER = { user | CURRENT_USER }]\n  [SQL SECURITY { DEFINER | INVOKER }]\n  VIEW view_name [(column_list)]\n  AS select_statement\n  [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThis statement changes the definition of a view, which must exist. The syntax\nis similar to that for CREATE VIEW and the effect is the same as for CREATE OR\nREPLACE VIEW if the view exists. This statement requires the CREATE VIEW and\nDROP privileges for the view, and some privilege for each column referred to\nin the SELECT statement. ALTER VIEW is allowed only to the definer or users\nwith the SUPER privilege.\n\nExample\n-------\n\nALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;\n\nURL: https://mariadb.com/kb/en/alter-view/','','https://mariadb.com/kb/en/alter-view/'),
(695,'Type Conversion',36,'Implicit type conversion takes place when MariaDB is using operands or\ndifferent types, in order to make the operands compatible.\n\nIt is best practice not to rely upon implicit conversion; rather use CAST to\nexplicitly convert types.\n\nRules for Conversion on Comparison\n----------------------------------\n\n* If  either argument is NULL, the result of the comparison is NULL unless the\nNULL-safe <=> equality comparison operator is used.\n* If both arguments are integers, they are compared as integers.\n* If both arguments are strings, they are compared as strings.\n* If one argument is decimal and the other argument is decimal or integer,\nthey are compared as decimals.\n* If one argument is decimal and the other argument is a floating point, they\nare compared as floating point values.\n* If one argument is string and the other argument is integer, they are\ncompared as decimals. This conversion was added in MariaDB 10.3.36. Prior to\n10.3.36, this combination was compared as floating point values, which did not\nalways work well for huge 64-bit integers because of a possible precision loss\non conversion to double.\n* If a hexadecimal argument is not compared to a number, it is treated as a\nbinary string.\n* If a constant is compared to a TIMESTAMP or DATETIME, the constant is\nconverted to a timestamp, unless used as an argument to the IN function.\n* In other cases, arguments are compared as floating point, or real, numbers.\n\nNote that if a string column is being compared with a numeric value, MariaDB\nwill not use the index on the column, as there are numerous alternatives that\nmay evaluate as equal (see examples below).\n\nComparison Examples\n-------------------\n\nConverting a string to a number:\n\nSELECT 15+\'15\';\n+---------+\n| 15+\'15\' |\n+---------+\n|      30 |\n+---------+\n\nConverting a number to a string:\n\nSELECT CONCAT(15,\'15\');\n+-----------------+\n| CONCAT(15,\'15\') |\n+-----------------+\n| 1515            |\n+-----------------+\n\nFloating point number errors:\n\nSELECT \'9746718491924563214\' = 9746718491924563213;\n+---------------------------------------------+\n| \'9746718491924563214\' = 9746718491924563213 |\n+---------------------------------------------+\n|                                           1 |\n+---------------------------------------------+\n\nNumeric equivalence with strings:\n\nSELECT \'5\' = 5;\n+---------+\n| \'5\' = 5 |\n+---------+\n|       1 |\n+---------+\n\nSELECT \'   5\' = 5;\n+------------+\n| \'   5\' = 5 |\n+------------+\n|          1 |\n+------------+\n\nSELECT \'   5  \' = 5;\n+--------------+\n| \'   5  \' = 5 |\n+--------------+\n|            1 |\n+--------------+\n1 row in set, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------------------------+\n| Level | Code | Message                                    |\n+-------+------+--------------------------------------------+\n| Note  | 1292 | Truncated incorrect DOUBLE value: \'   5  \' |\n+-------+------+--------------------------------------------+\n\nAs a result of the above, MariaDB cannot use the index when comparing a string\nwith a numeric value in the example below:\n\nCREATE TABLE t (a VARCHAR(10), b VARCHAR(10), INDEX idx_a (a));\n\nINSERT INTO t VALUES \n (\'1\', \'1\'), (\'2\', \'2\'), (\'3\', \'3\'),\n (\'4\', \'4\'), (\'5\', \'5\'), (\'1\', \'5\');\n\nEXPLAIN SELECT * FROM t WHERE a = \'3\' \\G\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: t\n    type: ref\npossible_keys: idx_a\n     key: idx_a\n   key_len: 13\n     ref: const\n    rows: 1\n    Extra: Using index condition\n\nEXPLAIN SELECT * FROM t WHERE a = 3 \\G\n*************************** 1. row ***************************\n     id: 1\n select_type: SIMPLE\n    table: t\n    type: ALL\npossible_keys: idx_a\n     key: NULL\n   key_len: NULL\n     ref: NULL\n    rows: 6\n    Extra: Using where\n\nRules for Conversion on Dyadic Arithmetic Operations\n----------------------------------------------------\n\nImplicit type conversion also takes place on dyadic arithmetic operations\n(+,-,*,/). MariaDB chooses the minimum data type that is guaranteed to fit the\nresult and converts both arguments to the result data type.\n\nFor addition (+), subtraction (-) and multiplication (*), the result data type\nis chosen as follows:\n\n* If either of the arguments is an approximate number (float, double), the\nresult is double.\n* If either of the arguments is a string (char, varchar, text), the result is\ndouble.\n* If either of the arguments is a decimal number, the result is decimal.\n* If either of the arguments is of a temporal type with a non-zero fractional\nsecond precision (time(N), datetime(N), timestamp(N)), the result is decimal.\n* If either of the arguments is of a temporal type with a zero fractional\nsecond precision (time(0), date, datetime(0), timestamp(0)), the result may\nvary between int, int unsigned, bigint or bigint unsigned, depending on the\nexact data type combination.\n* If both arguments are integer numbers (tinyint, smallint, mediumint,\nbigint), the result may vary between int, int unsigned, bigint or bigint\nunsigned, depending of the exact data types and their signs.\n\nFor division (/), the result data type is chosen as follows:\n\n* If either of the arguments is an approximate number (float, double), the\nresult is double.\n* If either of the arguments is a string (char, varchar, text), the result is\ndouble.\n* Otherwise, the result is decimal.\n\nArithmetic Examples\n-------------------\n\nNote, the above rules mean that when an argument of a temporal data type\nappears in addition or subtraction, it\'s treated as a number by default.\n\nSELECT TIME\'10:20:30\' + 1;\n+--------------------+\n| TIME\'10:20:30\' + 1 |\n+--------------------+\n|             102031 |\n+--------------------+\n\nIn order to do temporal addition or subtraction instead, use the DATE_ADD() or\nDATE_SUB() functions, or an INTERVAL expression as the second argument:\n\nSELECT TIME\'10:20:30\' + INTERVAL 1 SECOND;\n+------------------------------------+\n| TIME\'10:20:30\' + INTERVAL 1 SECOND |\n+------------------------------------+\n| 10:20:31                           |\n+------------------------------------+\n\nSELECT \"2.2\" + 3;\n+-----------+\n| \"2.2\" + 3 |\n+-----------+\n|       5.2 |\n+-----------+\n\nSELECT 2.2 + 3;\n+---------+\n| 2.2 + 3 |\n+---------+\n| 5.2     |\n+---------+\n\nSELECT 2.2 / 3;\n+---------+\n| 2.2 / 3 |\n+---------+\n| 0.73333 |\n+---------+\n\nSELECT \"2.2\" / 3;\n+--------------------+\n| \"2.2\" / 3          |\n+--------------------+\n| 0.7333333333333334 |\n+--------------------+\n\nURL: https://mariadb.com/kb/en/type-conversion/','','https://mariadb.com/kb/en/type-conversion/'),
(698,'ALTER DATABASE',38,'Modifies a database, changing its overall characteristics.\n\nSyntax\n------\n\nALTER {DATABASE | SCHEMA} [db_name]\n  alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n  UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n  [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the database\ndirectory. To use ALTER DATABASE, you need the ALTER privilege on the\ndatabase. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe CHARACTER SET clause changes the default database character set. The\nCOLLATE clause changes the default database collation. See Character Sets and\nCollations for more.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements.\n\nChanging the default character set/collation of a database does not change the\ncharacter set/collation of any stored procedures or stored functions that were\npreviously created, and relied on the defaults. These need to be dropped and\nrecreated in order to apply the character set/collation changes.\n\nThe database name can be omitted from the first syntax, in which case the\nstatement applies to the default database.\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause was added in\nMySQL 5.1.23. It updates the name of the directory associated with the\ndatabase to use the encoding implemented in MySQL 5.1 for mapping database\nnames to database directory names (see Identifier to File Name Mapping). This\nclause is for use under these conditions:\n\n* It is intended when upgrading MySQL to 5.1 or later from older versions.\n* It is intended to update a database directory name to the current encoding\nformat if the name contains special characters that need encoding.\n* The statement is used by mariadb-check (as invoked by mariadb-upgrade).\n\nFor example,if a database in MySQL 5.0 has a name of a-b-c, the name contains\ninstance of the `-\' character. In 5.0, the database directory is also named\na-b-c, which is not necessarily safe for all file systems. In MySQL 5.1 and\nup, the same database name is encoded as a@002db@002dc to produce a file\nsystem-neutral directory name.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an older\nversion,the server displays a name such as a-b-c (which is in the old format)\nas #mysql50#a-b-c, and you must refer to the name using the #mysql50# prefix.\nUse UPGRADE DATA DIRECTORY NAME in this case to explicitly tell the server to\nre-encode the database directory name to the current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c without\nthe special #mysql50# prefix.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nALTER DATABASE test CHARACTER SET=\'utf8\'  COLLATE=\'utf8_bin\';\n\nFrom MariaDB 10.5.0:\n\nALTER DATABASE p COMMENT=\'Presentations\';\n\nURL: https://mariadb.com/kb/en/alter-database/','','https://mariadb.com/kb/en/alter-database/'),
(708,'RENAME TABLE',38,'Syntax\n------\n\nRENAME TABLE[S] [IF EXISTS] tbl_name \n [WAIT n | NOWAIT]\n TO new_tbl_name\n  [, tbl_name2 TO new_tbl_name2] ...\n\nDescription\n-----------\n\nThis statement renames one or more tables or views, but not the privileges\nassociated with them.\n\nIF EXISTS\n---------\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this directive is used, one will not get an error if the table to be\nrenamed doesn\'t exist.\n\nThe rename operation is done atomically, which means that no other session can\naccess any of the tables while the rename is running. For example, if you have\nan existing table old_table, you can create another table new_table that has\nthe same structure but is empty, and then replace the existing table with the\nempty one as follows (assuming that backup_table does not already exist):\n\nCREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n\ntbl_name can optionally be specified as db_name.tbl_name. See Identifier\nQualifiers. This allows to use RENAME to move a table from a database to\nanother (as long as they are on the same filesystem):\n\nRENAME TABLE db1.t TO db2.t;\n\nNote that moving a table to another database is not possible if it has some\ntriggers. Trying to do so produces the following error:\n\nERROR 1435 (HY000): Trigger in wrong schema\n\nAlso, views cannot be moved to another database:\n\nERROR 1450 (HY000): Changing schema from \'old_db\' to \'new_db\' is not allowed.\n\nMultiple tables can be renamed in a single statement. The presence or absence\nof the optional S (RENAME TABLE or RENAME TABLES) has no impact, whether a\nsingle or multiple tables are being renamed.\n\nIf a RENAME TABLE renames more than one table and one renaming fails, all\nrenames executed by the same statement are rolled back.\n\nRenames are always executed in the specified order. Knowing this, it is also\npossible to swap two tables\' names:\n\nRENAME TABLE t1 TO tmp_table,\n  t2 TO t1,\n  tmp_table TO t2;\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nPrivileges\n----------\n\nExecuting the RENAME TABLE statement requires the DROP, CREATE and INSERT\nprivileges for the table or the database.\n\nAtomic RENAME TABLE\n-------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, RENAME TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-23842). This means that if there is a crash\n(server down or power outage) during RENAME TABLE, all tables will revert to\ntheir original names and any changes to trigger files will be reverted.\n\nIn older MariaDB version there was a small chance that, during a server crash\nhappening in the middle of RENAME TABLE, some tables could have been renamed\n(in the worst case partly) while others would not be renamed.\n\nSee Atomic DDL for more information.\n\nURL: https://mariadb.com/kb/en/rename-table/','','https://mariadb.com/kb/en/rename-table/'),
(707,'DROP TABLE',38,'Syntax\n------\n\nDROP [TEMPORARY] TABLE [IF EXISTS] [/*COMMENT TO SAVE*/]\n  tbl_name [, tbl_name] ...\n  [WAIT n|NOWAIT]\n  [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP TABLE removes one or more tables. You must have the DROP privilege for\neach table. All table data and the table definition are removed, as well as\ntriggers associated to the table, so be careful with this statement! If any of\nthe tables named in the argument list do not exist, MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another thread is using the table in an explicit transaction or an\nautocommit transaction, then the thread acquires a metadata lock (MDL) on the\ntable. The DROP TABLE statement will wait in the \"Waiting for table metadata\nlock\" thread state until the MDL is released. MDLs are released in the\nfollowing cases:\n\n* If an MDL is acquired in an explicit transaction, then the MDL will be\nreleased when the transaction ends.\n* If an MDL is acquired in an autocommit transaction, then the MDL will be\nreleased when the statement ends.\n* Transactional and non-transactional tables are handled the same.\n\nNote that for a partitioned table, DROP TABLE permanently removes the table\ndefinition, all of its partitions, and all of the data which was stored in\nthose partitions. It also removes the partitioning definition (.par) file\nassociated with the dropped table.\n\nFor each referenced table, DROP TABLE drops a temporary table with that name,\nif it exists. If it does not exist, and the TEMPORARY keyword is not used, it\ndrops a non-temporary table with the same name, if it exists. The TEMPORARY\nkeyword ensures that a non-temporary table will not accidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not exist.\nA NOTE is generated for each non-existent table when using IF EXISTS. See SHOW\nWARNINGS.\n\nIf a foreign key references this table, the table cannot be dropped. In this\ncase, it is necessary to drop the foreign key first.\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nThe comment before the table names (/*COMMENT TO SAVE*/) is stored in the\nbinary log. That feature can be used by replication tools to send their\ninternal messages.\n\nIt is possible to specify table names as db_name.tab_name. This is useful to\ndelete tables from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nNote: DROP TABLE automatically commits the current active transaction, unless\nyou use the TEMPORARY keyword.\n\nMariaDB starting with 10.5.4\n----------------------------\nFrom MariaDB 10.5.4, DROP TABLE reliably deletes table remnants inside a\nstorage engine even if the .frm file is missing. Before then, a missing .frm\nfile would result in the statement failing.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDROP TABLE in replication\n-------------------------\n\nDROP TABLE has the following characteristics in replication:\n\n* DROP TABLE IF EXISTS are always logged.\n* DROP TABLE without IF EXISTS for tables that don\'t exist are not written to\nthe binary log.\n* Dropping of TEMPORARY tables are prefixed in the log with TEMPORARY. These\ndrops are only logged when running statement or mixed mode replication.\n* One DROP TABLE statement can be logged with up to 3 different DROP\nstatements:\nDROP TEMPORARY TABLE list_of_non_transactional_temporary_tables\nDROP TEMPORARY TABLE list_of_transactional_temporary_tables\nDROP TABLE list_of_normal_tables\n\nDROP TABLE on the primary is treated on the replica as DROP TABLE IF EXISTS.\nYou can change that by setting slave-ddl-exec-mode to STRICT.\n\nDropping an Internal #sql-... Table\n-----------------------------------\n\nFrom MariaDB 10.6, DROP TABLE is atomic and the following does not apply.\nUntil MariaDB 10.5, if the mariadbd/mysqld process is killed during an ALTER\nTABLE you may find a table named #sql-... in your data directory. In MariaDB\n10.3, InnoDB tables with this prefix will be deleted automatically during\nstartup. From MariaDB 10.4, these temporary tables will always be deleted\nautomatically.\n\nIf you want to delete one of these tables explicitly you can do so by using\nthe following syntax:\n\nDROP TABLE `#mysql50##sql-...`;\n\nWhen running an ALTER TABLE…ALGORITHM=INPLACE that rebuilds the table, InnoDB\nwill create an internal #sql-ib table. Until MariaDB 10.3.2, for these tables,\nthe .frm file will be called something else. In order to drop such a table\nafter a server crash, you must rename the #sql*.frm file to match the\n#sql-ib*.ibd file.\n\nFrom MariaDB 10.3.3, the same name as the .frm file is used for the\nintermediate copy of the table. The #sql-ib names are used by TRUNCATE and\ndelayed DROP.\n\nFrom MariaDB 10.2.19 and MariaDB 10.3.10, the #sql-ib tables will be deleted\nautomatically.\n\nDropping All Tables in a Database\n---------------------------------\n\nThe best way to drop all tables in a database is by executing DROP DATABASE,\nwhich will drop the database itself, and all tables in it.\n\nHowever, if you want to drop all tables in the database, but you also want to\nkeep the database itself and any other non-table objects in it, then you would\nneed to execute DROP TABLE to drop each individual table. You can construct\nthese DROP TABLE commands by querying the TABLES table in the\ninformation_schema database. For example:\n\nSELECT CONCAT(\'DROP TABLE IF EXISTS `\', TABLE_SCHEMA, \'`.`\', TABLE_NAME, \'`;\')\nFROM information_schema.TABLES\nWHERE TABLE_SCHEMA = \'mydb\';\n\nAtomic DROP TABLE\n-----------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, DROP TABLE for a single table is atomic (MDEV-25180) for\nmost engines, including InnoDB, MyRocks, MyISAM and Aria.\n\nThis means that if there is a crash (server down or power outage) during DROP\nTABLE, all tables that have been processed so far will be completely dropped,\nincluding related trigger files and status entries, and the binary log will\ninclude a DROP TABLE statement for the dropped tables. Tables for which the\ndrop had not started will be left intact.\n\nIn older MariaDB versions, there was a small chance that, during a server\ncrash happening in the middle of DROP TABLE, some storage engines that were\nusing multiple storage files, like MyISAM, could have only a part of its\ninternal files dropped.\n\nIn MariaDB 10.5, DROP TABLE was extended to be able to delete a table that was\nonly partly dropped (MDEV-11412) as explained above. Atomic DROP TABLE is the\nfinal piece to make DROP TABLE fully reliable.\n\nDropping multiple tables is crash-safe.\n\nSee Atomic DDL for more information.\n\nExamples\n--------\n\nDROP TABLE Employees, Customers;\n\nNotes\n-----\n\nBeware that DROP TABLE can drop both tables and sequences. This is mainly done\nto allow old tools like mariadb-dump (previously mysqldump) to work with\nsequences.\n\nURL: https://mariadb.com/kb/en/drop-table/','','https://mariadb.com/kb/en/drop-table/'),
(709,'TRUNCATE TABLE',38,'Syntax\n------\n\nTRUNCATE [TABLE] tbl_name\n [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nTRUNCATE TABLE empties a table completely. It requires the DROP privilege. See\nGRANT.\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers).\n\nLogically, TRUNCATE TABLE is equivalent to a DELETE statement that deletes all\nrows, but there are practical differences under some circumstances.\n\nTRUNCATE TABLE will fail for an InnoDB table if any FOREIGN KEY constraints\nfrom other tables reference the table, returning the error:\n\nERROR 1701 (42000): Cannot truncate a table referenced in a foreign key\nconstraint\n\nForeign Key constraints between columns in the same table are permitted.\n\nFor an InnoDB table, if there are no FOREIGN KEY constraints, InnoDB performs\nfast truncation by dropping the original table and creating an empty one with\nthe same definition, which is much faster than deleting rows one by one. The\nAUTO_INCREMENT counter is reset by TRUNCATE TABLE, regardless of whether there\nis a FOREIGN KEY constraint.\n\nThe count of rows affected by TRUNCATE TABLE is accurate only when it is\nmapped to a DELETE statement.\n\nFor other storage engines, TRUNCATE TABLE differs from DELETE in the following\nways:\n\n* Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n* Truncate operations cause an implicit commit.\n* Truncation operations cannot be performed if the session holds an\n active table lock.\n* Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is \"0 rows affected,\" which should\n be interpreted as \"no information.\"\n* As long as the table format file tbl_name.frm is valid, the\n table can be re-created as an empty table\n with TRUNCATE TABLE, even if the data or index files have become\n corrupted.\n* The table handler does not remember the last\n used AUTO_INCREMENT value, but starts counting\n from the beginning. This is true even for MyISAM and InnoDB, which normally\n do not reuse sequence values.\n* When used with partitioned tables, TRUNCATE TABLE preserves\n the partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n* Since truncation of a table does not make any use of DELETE,\n the TRUNCATE statement does not invoke ON DELETE triggers.\n* TRUNCATE TABLE will only reset the values in the Performance Schema summary\ntables to zero or null, and will not remove the rows.\n\nFor the purposes of binary logging and replication, TRUNCATE TABLE is treated\nas DROP TABLE followed by CREATE TABLE (DDL rather than DML).\n\nTRUNCATE TABLE does not work on views. Currently, TRUNCATE TABLE drops all\nhistorical records from a system-versioned table.\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nOracle-mode\n-----------\n\nOracle-mode from MariaDB 10.3 permits the optional keywords REUSE STORAGE or\nDROP STORAGE to be used.\n\nTRUNCATE [TABLE] tbl_name [{DROP | REUSE} STORAGE] [WAIT n | NOWAIT]\n\nThese have no effect on the operation.\n\nPerformance\n-----------\n\nTRUNCATE TABLE is faster than DELETE, because it drops and re-creates a table.\n\nWith InnoDB, TRUNCATE TABLE is slower if innodb_file_per_table=ON is set (the\ndefault). This is because TRUNCATE TABLE unlinks the underlying tablespace\nfile, which can be an expensive operation. See MDEV-8069 for more details.\n\nThe performance issues with innodb_file_per_table=ON can be exacerbated in\ncases where the InnoDB buffer pool is very large and\ninnodb_adaptive_hash_index=ON is set. In that case, using DROP TABLE followed\nby CREATE TABLE instead of TRUNCATE TABLE may perform better. Setting\ninnodb_adaptive_hash_index=OFF (it defaults to ON before MariaDB 10.5) can\nalso help. In MariaDB 10.2 only, from MariaDB 10.2.19, this performance can\nalso be improved by setting innodb_safe_truncate=OFF. See MDEV-9459 for more\ndetails.\n\nSetting innodb_adaptive_hash_index=OFF can also improve TRUNCATE TABLE\nperformance in general. See MDEV-16796 for more details.\n\nURL: https://mariadb.com/kb/en/truncate-table/','','https://mariadb.com/kb/en/truncate-table/'),
(710,'CREATE DATABASE',38,'Syntax\n------\n\nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n  [create_specification] ...\n\ncreate_specification:\n  [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nCREATE DATABASE creates a database with the given name. To use this statement,\nyou need the CREATE privilege for the database. CREATE SCHEMA is a synonym for\nCREATE DATABASE.\n\nFor valid identifiers to use as database names, see Identifier Names.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP DATABASE IF EXISTS db_name;\nCREATE DATABASE db_name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified database already exists.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nCREATE DATABASE db1;\nQuery OK, 1 row affected (0.18 sec)\n\nCREATE DATABASE db1;\nERROR 1007 (HY000): Can\'t create database \'db1\'; database exists\n\nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n\nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message                                      |\n+-------+------+----------------------------------------------+\n| Note  | 1007 | Can\'t create database \'db1\'; database exists |\n+-------+------+----------------------------------------------+\n\nSetting the character sets and collation. See Setting Character Sets and\nCollations for more details.\n\nCREATE DATABASE czech_slovak_names \n CHARACTER SET = \'keybcs2\'\n COLLATE = \'keybcs2_bin\';\n\nComments, from MariaDB 10.5.0:\n\nCREATE DATABASE presentations COMMENT \'Presentations for conferences\';\n\nURL: https://mariadb.com/kb/en/create-database/','','https://mariadb.com/kb/en/create-database/'),
(711,'CREATE EVENT',38,'Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  EVENT\n  [IF NOT EXISTS]\n  event_name\n  ON SCHEDULE schedule\n  [ON COMPLETION [NOT] PRESERVE]\n  [ENABLE | DISABLE | DISABLE ON SLAVE]\n  [COMMENT \'comment\']\n  DO sql_statement;\n\nschedule:\n  AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n  [STARTS timestamp [+ INTERVAL interval] ...]\n  [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n  quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n       WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n       DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nDescription\n-----------\n\nThis statement creates and schedules a new event. It requires the EVENT\nprivilege for the schema in which the event is to be created.\n\nThe minimum requirements for a valid CREATE EVENT statement are as follows:\n\n* The keywords CREATE EVENT plus an event name, which uniquely identifies\n the event in the current schema. (Prior to MySQL 5.1.12, the event name\n needed to be unique only among events created by the same user on a given\n database.)\n* An ON SCHEDULE clause, which determines when and how often the event\n executes.\n* A DO clause, which contains the SQL statement to be executed by an\n event.\n\nHere is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event executes\nonce — one hour following its creation — by running an SQL statement that\nincrements the value of the myschema.mytable table\'s mycol column by 1.\n\nThe event_name must be a valid MariaDB identifier with a maximum length of 64\ncharacters. It may be delimited using back ticks, and may be qualified with\nthe name of a database schema. An event is associated with both a MariaDB user\n(the definer) and a schema, and its name must be unique among names of events\nwithin that schema. In general, the rules governing event names are the same\nas those for names of stored routines. See Identifier Names.\n\nIf no schema is indicated as part of event_name, the default (current) schema\nis assumed.\n\nFor valid identifiers to use as event names, see Identifier Names.\n\nOR REPLACE\n----------\n\nThe OR REPLACE clause was included in MariaDB 10.1.4. If used and the event\nalready exists, instead of an error being returned, the existing event will be\ndropped and replaced by the newly defined event.\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the event already exists. Cannot be used together with OR REPLACE.\n\nON SCHEDULE\n-----------\n\nThe ON SCHEDULE clause can be used to specify when the event must be triggered.\n\nAT\n--\n\nIf you want to execute the event only once (one time event), you can use the\nAT keyword, followed by a timestamp. If you use CURRENT_TIMESTAMP, the event\nacts as soon as it is created. As a convenience, you can add one or more\nintervals to that timestamp. You can also specify a timestamp in the past, so\nthat the event is stored but not triggered, until you modify it via ALTER\nEVENT.\n\nThe following example shows how to create an event that will be triggered\ntomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nYou can also specify that an event must be triggered at a regular interval\n(recurring event). In such cases, use the EVERY clause followed by the\ninterval.\n\nIf an event is recurring, you can specify when the first execution must happen\nvia the STARTS clause and a maximum time for the last execution via the ENDS\nclause. STARTS and ENDS clauses are followed by a timestamp and, optionally,\none or more intervals. The ENDS clause can specify a timestamp in the past, so\nthat the event is stored but not executed until you modify it via ALTER EVENT.\n\nIn the following example, next month a recurring event will be triggered\nhourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nIntervals consist of a quantity and a time unit. The time units are the same\nused for other staments and time functions, except that you can\'t use\nmicroseconds for events. For simple time units, like HOUR or MINUTE, the\nquantity is an integer number, for example \'10 MINUTE\'. For composite time\nunits, like HOUR_MINUTE or HOUR_SECOND, the quantity must be a string with all\ninvolved simple values and their separators, for example \'2:30\' or \'2:30:30\'.\n\nON COMPLETION [NOT] PRESERVE\n----------------------------\n\nThe ON COMPLETION clause can be used to specify if the event must be deleted\nafter its last execution (that is, after its AT or ENDS timestamp is past). By\ndefault, events are dropped when they are expired. To explicitly state that\nthis is the desired behaviour, you can use ON COMPLETION NOT PRESERVE.\nInstead, if you want the event to be preserved, you can use ON COMPLETION\nPRESERVE.\n\nIn you specify ON COMPLETION NOT PRESERVE, and you specify a timestamp in the\npast for AT or ENDS clause, the event will be immediatly dropped. In such\ncases, you will get a Note 1558: \"Event execution time is in the past and ON\nCOMPLETION NOT PRESERVE is set. The event was dropped immediately after\ncreation\".\n\nENABLE/DISABLE/DISABLE ON SLAVE\n-------------------------------\n\nEvents are ENABLEd by default. If you want to stop MariaDB from executing an\nevent, you may specify DISABLE. When it is ready to be activated, you may\nenable it using ALTER EVENT. Another option is DISABLE ON SLAVE, which\nindicates that an event was created on a master and has been replicated to the\nslave, which is prevented from executing the event. If DISABLE ON SLAVE is\nspecifically set, the event will be disabled everywhere. It will not be\nexecuted on the mater or the slaves.\n\nCOMMENT\n-------\n\nThe COMMENT clause may be used to set a comment for the event. Maximum length\nfor comments is 64 characters. The comment is a string, so it must be quoted.\nTo see events comments, you can query the INFORMATION_SCHEMA.EVENTS table (the\ncolumn is named EVENT_COMMENT).\n\nExamples\n--------\n\nMinimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\n\nAn event that will be triggered tomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nNext month a recurring event will be triggered hourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\nERROR 1537 (HY000): Event \'myevent\' already exists\n\nCREATE OR REPLACE EVENT myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE EVENT IF NOT EXISTS myevent\n  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n  DO\n   UPDATE myschema.mytable SET mycol = mycol + 1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------------+\n| Level | Code | Message                        |\n+-------+------+--------------------------------+\n| Note  | 1537 | Event \'myevent\' already exists |\n+-------+------+--------------------------------+\n\nURL: https://mariadb.com/kb/en/create-event/','','https://mariadb.com/kb/en/create-event/'),
(713,'CREATE INDEX',38,'Syntax\n------\n\nCREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL] INDEX \n [IF NOT EXISTS] index_name\n  [index_type]\n  ON tbl_name (index_col_name,...)\n  [WAIT n | NOWAIT]\n  [index_option]\n  [algorithm_option | lock_option] ...\n\nindex_col_name:\n  col_name [(length)] [ASC | DESC]\n\nindex_type:\n  USING {BTREE | HASH | RTREE}\n\nindex_option:\n  [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nalgorithm_option:\n  ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n\nlock_option:\n  LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDescription\n-----------\n\nThe CREATE INDEX statement is used to add indexes to a table. Indexes can be\ncreated at the same as the table, with the [[|create-table|CREATE TABLE]]\nstatement. In some cases, such as for InnoDB primary keys, doing so during\ncreation is preferable, as adding a primary key will involve rebuilding the\ntable.\n\nThe statement is mapped to an ALTER TABLE statement to create indexes. See\nALTER TABLE. CREATE INDEX cannot be used to create a PRIMARY KEY; use ALTER\nTABLE instead.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nAnother shortcut, DROP INDEX, allows the removal of an index.\n\nFor valid identifiers to use as index names, see Identifier Names.\n\nNote that KEY_BLOCK_SIZE is currently ignored in CREATE INDEX, although it is\nincluded in the output of SHOW CREATE TABLE.\n\nPrivileges\n----------\n\nExecuting the CREATE INDEX statement requires the INDEX privilege for the\ntable or the database.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nCREATE OR REPLACE INDEX\n-----------------------\n\nIf the OR REPLACE clause is used and if the index already exists, then instead\nof returning an error, the server will drop the existing index and replace it\nwith the newly defined index.\n\nCREATE INDEX IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the index will only be created if an\nindex with the same name does not already exist. If the index already exists,\nthen a warning will be triggered by default.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nALGORITHM\n---------\n\nSee ALTER TABLE: ALGORITHM for more information.\n\nLOCK\n----\n\nSee ALTER TABLE: LOCK for more information.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for CREATE INDEX statement for clients\nthat support the new progress reporting protocol. For example, if you were\nusing the mariadb client, then the progress report might look like this::\n\nCREATE INDEX i ON tab (num);\nStage: 1 of 2 \'copy to tmp table\'    46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nWITHOUT OVERLAPS\n----------------\n\nMariaDB starting with 10.5.3\n----------------------------\nThe WITHOUT OVERLAPS clause allows one to constrain a primary or unique index\nsuch that application-time periods cannot overlap.\n\nExamples\n--------\n\nCreating a unique index:\n\nCREATE UNIQUE INDEX HomePhone ON Employees(Home_Phone);\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX xi ON xx5 (x);\nERROR 1061 (42000): Duplicate key name \'xi\'\n\nCREATE OR REPLACE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX IF NOT EXISTS xi ON xx5 (x);\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message                 |\n+-------+------+-------------------------+\n| Note  | 1061 | Duplicate key name \'xi\' |\n+-------+------+-------------------------+\n\nFrom MariaDB 10.5.3, creating a unique index for an application-time period\ntable with a WITHOUT OVERLAPS constraint:\n\nCREATE UNIQUE INDEX u ON rooms (room_number, p WITHOUT OVERLAPS);\n\nURL: https://mariadb.com/kb/en/create-index/','','https://mariadb.com/kb/en/create-index/'),
(714,'CREATE PACKAGE',38,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE\n  [ OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PACKAGE [ IF NOT EXISTS ]\n  [ db_name . ] package_name\n  [ package_characteristic ... ]\n{ AS | IS }\n  [ package_specification_element ... ]\nEND [ package_name ]\n\npackage_characteristic:\n  COMMENT \'string\'\n | SQL SECURITY { DEFINER | INVOKER }\n\npackage_specification_element:\n  FUNCTION_SYM package_specification_function ;\n | PROCEDURE_SYM package_specification_procedure ;\n\npackage_specification_function:\n  func_name [ ( func_param [, func_param]... ) ]\n  RETURNS func_return_type\n  [ package_routine_characteristic... ]\n\npackage_specification_procedure:\n  proc_name [ ( proc_param [, proc_param]... ) ]\n  [ package_routine_characteristic... ]\n\nfunc_return_type:\n  type\n\nfunc_param:\n  param_name [ IN | OUT | INOUT | IN OUT ] type\n\nproc_param:\n  param_name [ IN | OUT | INOUT | IN OUT ] type\n\ntype:\n  Any valid MariaDB explicit or anchored data type\n\npackage_routine_characteristic:\n   COMMENT  \'string\'\n  | LANGUAGE SQL\n  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n  | SQL SECURITY { DEFINER | INVOKER }\n\nDescription\n-----------\n\nThe CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE creates the specification for a stored package (a\ncollection of logically related stored objects). A stored package\nspecification declares public routines (procedures and functions) of the\npackage, but does not implement these routines.\n\nA package whose specification was created by the CREATE PACKAGE statement,\nshould later be implemented using the CREATE PACKAGE BODY statement.\n\nFunction parameter quantifiers IN | OUT | INOUT | IN OUT\n--------------------------------------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter quantifiers for IN, OUT, INOUT, and IN OUT where added\nin a 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only\nin procedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions and\nprocedures with more than one return value. This allows functions and\nprocedures to be more complex and nested.\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nDELIMITER ;\n\nURL: https://mariadb.com/kb/en/create-package/','','https://mariadb.com/kb/en/create-package/'),
(715,'CREATE PACKAGE BODY',38,'MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE [ OR REPLACE ]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  PACKAGE BODY\n  [ IF NOT EXISTS ]\n  [ db_name . ] package_name\n  [ package_characteristic... ]\n{ AS | IS }\n  package_implementation_declare_section\n  package_implementation_executable_section\nEND [ package_name]\n\npackage_implementation_declare_section:\n  package_implementation_item_declaration\n   [ package_implementation_item_declaration... ]\n   [ package_implementation_routine_definition... ]\n | package_implementation_routine_definition\n   [ package_implementation_routine_definition...]\n\npackage_implementation_item_declaration:\n  variable_declaration ;\n\nvariable_declaration:\n  variable_name[,...] type [:= expr ]\n\npackage_implementation_routine_definition:\n  FUNCTION package_specification_function\n   [ package_implementation_function_body ] ;\n | PROCEDURE package_specification_procedure\n   [ package_implementation_procedure_body ] ;\n\npackage_implementation_function_body:\n  { AS | IS } package_routine_body [func_name]\n\npackage_implementation_procedure_body:\n  { AS | IS } package_routine_body [proc_name]\n\npackage_routine_body:\n  [ package_routine_declarations ]\n  BEGIN\n   statements [ EXCEPTION exception_handlers ]\n  END\n\npackage_routine_declarations:\n  package_routine_declaration \';\' [package_routine_declaration \';\']...\n\npackage_routine_declaration:\n     variable_declaration\n    | condition_name CONDITION FOR condition_value\n    | user_exception_name EXCEPTION\n    | CURSOR_SYM cursor_name\n     [ ( cursor_formal_parameters ) ]\n     IS select_statement\n    ;\n\npackage_implementation_executable_section:\n     END\n    | BEGIN\n      statement ; [statement ; ]...\n     [EXCEPTION exception_handlers]\n     END\n\nexception_handlers:\n     exception_handler [exception_handler...]\n\nexception_handler:\n     WHEN_SYM condition_value [, condition_value]...\n      THEN_SYM statement ; [statement ;]...\n\ncondition_value:\n     condition_name\n    | user_exception_name\n    | SQLWARNING\n    | SQLEXCEPTION\n    | NOT FOUND\n    | OTHERS_SYM\n    | SQLSTATE [VALUE] sqlstate_value\n    | mariadb_error_code\n\nDescription\n-----------\n\nThe CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE BODY statement creates the package body for a stored\npackage. The package specification must be previously created using the CREATE\nPACKAGE statement.\n\nA package body provides implementations of the package public routines and can\noptionally have:\n\n* package-wide private variables\n* package private routines\n* forward declarations for private routines\n* an executable initialization section\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nCREATE PACKAGE BODY employee_tools AS\n -- package body variables\n stdRaiseAmount DECIMAL(10,2):=500;\n\n-- private routines\n PROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n  INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\n-- public routines\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n  eid INT;\n BEGIN\n  INSERT INTO employee (name, salary) VALUES (ename, esalary);\n  eid:= last_insert_id();\n  log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n  nSalary DECIMAL(10,2);\n BEGIN\n  SELECT salary INTO nSalary FROM employee WHERE id=eid;\n  log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n  RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n  UPDATE employee SET salary=salary+amount WHERE id=eid;\n  log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n  raiseSalary(eid, stdRaiseAmount);\n  log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN\n -- This code is executed when the current session\n -- accesses any of the package routines for the first time\n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND;\n$$\n\nDELIMITER ;\n\nURL: https://mariadb.com/kb/en/create-package-body/','','https://mariadb.com/kb/en/create-package-body/'),
(723,'DROP DATABASE',38,'Syntax\n------\n\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDescription\n-----------\n\nDROP DATABASE drops all tables in the database and deletes the database. Be\nvery careful with this statement! To use DROP DATABASE, you need the DROP\nprivilege on the database. DROP SCHEMA is a synonym for DROP DATABASE.\n\nImportant: When a database is dropped, user privileges on the database are not\nautomatically dropped. See GRANT.\n\nIF EXISTS\n---------\n\nUse IF EXISTS to prevent an error from occurring for databases that do not\nexist. A NOTE is generated for each non-existent database when using IF\nEXISTS. See SHOW WARNINGS.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL.\n\nDROP DATABASE is implemented as\n\nloop over all tables\n DROP TABLE table\n\nEach individual DROP TABLE is atomic while DROP DATABASE as a whole is\ncrash-safe.\n\nExamples\n--------\n\nDROP DATABASE bufg;\nQuery OK, 0 rows affected (0.39 sec)\n\nDROP DATABASE bufg;\nERROR 1008 (HY000): Can\'t drop database \'bufg\'; database doesn\'t exist\n\n\\W\nShow warnings enabled.\n\nDROP DATABASE IF EXISTS bufg;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\nNote (Code 1008): Can\'t drop database \'bufg\'; database doesn\'t exist\n\nURL: https://mariadb.com/kb/en/drop-database/','','https://mariadb.com/kb/en/drop-database/'),
(717,'CREATE SERVER',38,'Syntax\n------\n\nCREATE [OR REPLACE] SERVER [IF NOT EXISTS] server_name\n  FOREIGN DATA WRAPPER wrapper_name\n  OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nDescription\n-----------\n\nThis statement creates the definition of a server for use with the Spider,\nConnect, FEDERATED or FederatedX storage engine. The CREATE SERVER statement\ncreates a new row within the servers table within the mysql database. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nThe server_name should be a unique reference to the server. Server definitions\nare global within the scope of the server, it is not possible to qualify the\nserver definition to a specific database. server_name has a maximum length of\n64 characters (names longer than 64 characters are silently truncated), and is\ncase insensitive. You may specify the name as a quoted string.\n\nThe wrapper_name may be quoted with single quotes. Supported values are:\n\n* mysql\n* mariadb (in MariaDB 10.3 and later)\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are silently\ntruncated to 64 characters. Numeric literals must be a number between 0 and\n9999, default value is 0.\n\nNote: The OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table that\ncan later be used with the CREATE TABLE statement when creating a Spider,\nConnect, FederatedX or FEDERATED table. The options that you specify will be\nused to populate the columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nDROP SERVER removes a previously created server definition.\n\nCREATE SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nFor valid identifiers to use as server names, see Identifier Names.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP SERVER IF EXISTS name;\nCREATE SERVER server_name ...;\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the server already exists. Cannot be used together with OR REPLACE.\n\nExamples\n--------\n\nCREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nERROR 1476 (HY000): The foreign server, s, you are trying to create already\nexists\n\nCREATE OR REPLACE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE SERVER IF NOT EXISTS s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------------------\n+\n| Level | Code | Message                                                      \n |\n+-------+------+---------------------------------------------------------------\n+\n| Note  | 1476 | The foreign server, s, you are trying to create already\nexists |\n+-------+------+---------------------------------------------------------------\n+\n\nURL: https://mariadb.com/kb/en/create-server/','','https://mariadb.com/kb/en/create-server/'),
(724,'DROP EVENT',38,'Syntax\n------\n\nDROP EVENT [IF EXISTS] event_name\n\nDescription\n-----------\n\nThis statement drops the event named event_name. The event immediately ceases\nbeing active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown event\n\'event_name\' results. You can override this and cause the statement to\ngenerate a NOTE for non-existent events instead by using IF EXISTS. See SHOW\nWARNINGS.\n\nThis statement requires the EVENT privilege. In MySQL 5.1.11 and earlier, an\nevent could be dropped only by its definer, or by a user having the SUPER\nprivilege.\n\nExamples\n--------\n\nDROP EVENT myevent3;\n\nUsing the IF EXISTS clause:\n\nDROP EVENT IF EXISTS myevent3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message                       |\n+-------+------+-------------------------------+\n| Note  | 1305 | Event myevent3 does not exist |\n+-------+------+-------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-event/','','https://mariadb.com/kb/en/drop-event/'),
(719,'CREATE TRIGGER',38,'Syntax\n------\n\nCREATE [OR REPLACE]\n  [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n  TRIGGER [IF NOT EXISTS] trigger_name trigger_time trigger_event\n  ON tbl_name FOR EACH ROW\n [{ FOLLOWS | PRECEDES } other_trigger_name ]\n trigger_stmt;\n\nDescription\n-----------\n\nThis statement creates a new trigger. A trigger is a named database object\nthat is associated with a table, and that activates when a particular event\noccurs for the table. The trigger becomes associated with the table named\ntbl_name, which must refer to a permanent table. You cannot associate a\ntrigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated with\nthe trigger.\n\nYou can have multiple triggers for the same trigger_time and trigger_event.\n\nFor valid identifiers to use as trigger names, see Identifier Names.\n\nOR REPLACE\n----------\n\nIf used and the trigger already exists, instead of an error being returned,\nthe existing trigger will be dropped and replaced by the newly defined trigger.\n\nDEFINER\n-------\n\nThe DEFINER clause determines the security context to be used when checking\naccess privileges at trigger activation time. Usage requires the SUPER\nprivilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, the trigger will only be created if a\ntrigger of the same name does not exist. If the trigger already exists, by\ndefault a warning will be returned.\n\ntrigger_time\n------------\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to indicate\nthat the trigger activates before or after each row to be modified.\n\ntrigger_event\n-------------\n\ntrigger_event indicates the kind of statement that activates the trigger. The\ntrigger_event can be one of the following:\n\n* INSERT: The trigger is activated whenever a new row is inserted into the\ntable; for example, through INSERT, LOAD DATA, and REPLACE statements.\n* UPDATE: The trigger is activated whenever a row is modified; for example,\nthrough UPDATE statements.\n* DELETE: The trigger is activated whenever a row is deleted from the table;\nfor example, through DELETE and REPLACE statements. However, DROP TABLE and\nTRUNCATE statements on the table do not activate this trigger, because they do\nnot use DELETE. Dropping a partition does not activate DELETE triggers, either.\n\nFOLLOWS/PRECEDES other_trigger_name\n-----------------------------------\n\nThe FOLLOWS other_trigger_name and PRECEDES other_trigger_name options were\nadded in MariaDB 10.2.3 as part of supporting multiple triggers per action\ntime. This is the same syntax used by MySQL 5.7, although MySQL 5.7 does not\nhave multi-trigger support.\n\nFOLLOWS adds the new trigger after another trigger while PRECEDES adds the new\ntrigger before another trigger. If neither option is used, the new trigger is\nadded last for the given action and time.\n\nFOLLOWS and PRECEDES are not stored in the trigger definition. However the\ntrigger order is guaranteed to not change over time. mariadb-dump and other\nbackup methods will not change trigger order. You can verify the trigger order\nfrom the ACTION_ORDER column in INFORMATION_SCHEMA.TRIGGERS table.\n\nSELECT trigger_name, action_order FROM information_schema.triggers \n WHERE event_object_table=\'t1\';\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE TRIGGER is atomic.\n\nExamples\n--------\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n\nOR REPLACE and IF NOT EXISTS\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nERROR 1359 (HY000): Trigger already exists\n\nCREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals  FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected (0.12 sec)\n\nCREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n  UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1359 | Trigger already exists |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\nURL: https://mariadb.com/kb/en/create-trigger/','','https://mariadb.com/kb/en/create-trigger/'),
(725,'DROP FUNCTION',38,'Syntax\n------\n\nDROP FUNCTION [IF EXISTS] f_name\n\nDescription\n-----------\n\nThe DROP FUNCTION statement is used to drop a stored function or a\nuser-defined function (UDF). That is, the specified routine is removed from\nthe server, along with all privileges specific to the function. You must have\nthe ALTER ROUTINE privilege for the routine in order to drop it. If the\nautomatic_sp_privileges server system variable is set, both the ALTER ROUTINE\nand EXECUTE privileges are granted automatically to the routine creator - see\nStored Routine Privileges.\n\nIF EXISTS\n---------\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the function does not exist. A NOTE is produced that can be\nviewed with SHOW WARNINGS.\n\nFor dropping a user-defined functions (UDF), see DROP FUNCTION UDF.\n\nExamples\n--------\n\nDROP FUNCTION hello;\nQuery OK, 0 rows affected (0.042 sec)\n\nDROP FUNCTION hello;\nERROR 1305 (42000): FUNCTION test.hello does not exist\n\nDROP FUNCTION IF EXISTS hello;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message                            |\n+-------+------+------------------------------------+\n| Note  | 1305 | FUNCTION test.hello does not exist |\n+-------+------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-function/','','https://mariadb.com/kb/en/drop-function/'),
(722,'Invisible Columns',38,'MariaDB starting with 10.3.3\n----------------------------\nInvisible columns (sometimes also called hidden columns) first appeared in\nMariaDB 10.3.3.\n\nColumns can be given an INVISIBLE attribute in a CREATE TABLE or ALTER TABLE\nstatement. These columns will then not be listed in the results of a SELECT *\nstatement, nor do they need to be assigned a value in an INSERT statement,\nunless INSERT explicitly mentions them by name.\n\nSince SELECT * does not return the invisible columns, new tables or views\ncreated in this manner will have no trace of the invisible columns. If\nspecifically referenced in the SELECT statement, the columns will be brought\ninto the view/new table, but the INVISIBLE attribute will not.\n\nInvisible columns can be declared as NOT NULL, but then require a DEFAULT\nvalue.\n\nIt is not possible for all columns in a table to be invisible.\n\nExamples\n--------\n\nCREATE TABLE t (x INT INVISIBLE);\nERROR 1113 (42000): A table must have at least 1 column\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL);\nERROR 4106 (HY000): Invisible column `z` must have a default value\n\nCREATE TABLE t (x INT, y INT INVISIBLE, z INT INVISIBLE NOT NULL DEFAULT 4);\n\nINSERT INTO t VALUES (1),(2);\n\nINSERT INTO t (x,y) VALUES (3,33);\n\nSELECT * FROM t;\n+------+\n| x    |\n+------+\n|    1 |\n|    2 |\n|    3 |\n+------+\n\nSELECT x,y,z FROM t;\n+------+------+---+\n| x    | y    | z |\n+------+------+---+\n|    1 | NULL | 4 |\n|    2 | NULL | 4 |\n|    3 |   33 | 4 |\n+------+------+---+\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    |           |\n| y     | int(11) | YES  |     | NULL    | INVISIBLE |\n| z     | int(11) | NO   |     | 4       | INVISIBLE |\n+-------+---------+------+-----+---------+-----------+\n\nALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL\nDEFAULT 4;\n\nDESC t;\n+-------+---------+------+-----+---------+-----------+\n| Field | Type    | Null | Key | Default | Extra     |\n+-------+---------+------+-----+---------+-----------+\n| x     | int(11) | YES  |     | NULL    | INVISIBLE |\n| y     | int(11) | YES  |     | NULL    |           |\n| z     | int(11) | NO   |     | 4       |           |\n+-------+---------+------+-----+---------+-----------+\n\nCreating a view from a table with hidden columns:\n\nCREATE VIEW v1 AS SELECT * FROM t;\n\nDESC v1;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| y     | int(11) | YES  |     | NULL    |       |\n| z     | int(11) | NO   |     | 4       |       |\n+-------+---------+------+-----+---------+-------+\n\nCREATE VIEW v2 AS SELECT x,y,z FROM t;\n\nDESC v2;\n+-------+---------+------+-----+---------+-------+\n| Field | Type    | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| x     | int(11) | YES  |     | NULL    |       |\n| y     | int(11) | YES  |     | NULL    |       |\n| z     | int(11) | NO   |     | 4       |       |\n+-------+---------+------+-----+---------+-------+\n\nAdding a Surrogate Primary Key:\n\ncreate table t1 (x bigint unsigned not null, y varchar(16), z text);\n\ninsert into t1 values (123, \'qq11\', \'ipsum\');\n\ninsert into t1 values (123, \'qq22\', \'lorem\');\n\nalter table t1 add pkid serial primary key invisible first;\n\ninsert into t1 values (123, \'qq33\', \'amet\');\n\nselect * from t1;\n+-----+------+-------+\n| x   | y    | z     |\n+-----+------+-------+\n| 123 | qq11 | ipsum |\n| 123 | qq22 | lorem |\n| 123 | qq33 | amet  |\n+-----+------+-------+\n\nselect pkid, z from t1;\n+------+-------+\n| pkid | z     |\n+------+-------+\n|    1 | ipsum |\n|    2 | lorem |\n|    3 | amet  |\n+------+-------+\n\nURL: https://mariadb.com/kb/en/invisible-columns/','','https://mariadb.com/kb/en/invisible-columns/'),
(726,'DROP INDEX',38,'Syntax\n------\n\nDROP INDEX [IF EXISTS] index_name ON tbl_name \n  [WAIT n |NOWAIT]\n\nDescription\n-----------\n\nDROP INDEX drops the index named index_name from the table tbl_name. This\nstatement is mapped to an ALTER TABLE statement to drop the index.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nSee ALTER TABLE.\n\nAnother shortcut, CREATE INDEX, allows the creation of an index.\n\nTo remove the primary key, `PRIMARY` must be specified as index_name. Note\nthat the quotes are necessary, because PRIMARY is a keyword.\n\nPrivileges\n----------\n\nExecuting the DROP INDEX statement requires the INDEX privilege for the table\nor the database.\n\nOnline DDL\n----------\n\nOnline DDL is used by default with InnoDB, when the drop index operation\nsupports it.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nDROP INDEX IF EXISTS ...\n------------------------\n\nIf the IF EXISTS clause is used, then MariaDB will return a warning instead of\nan error if the index does not exist.\n\nWAIT/NOWAIT\n-----------\n\nSets the lock wait timeout. See WAIT and NOWAIT.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for DROP INDEX statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mariadb client, then the progress report might look like this::\n\nURL: https://mariadb.com/kb/en/drop-index/','','https://mariadb.com/kb/en/drop-index/'),
(729,'DROP PROCEDURE',38,'Syntax\n------\n\nDROP PROCEDURE [IF EXISTS] sp_name\n\nDescription\n-----------\n\nThis statement is used to drop a stored procedure. That is, the specified\nroutine is removed from the server along with all privileges specific to the\nprocedure. You must have the ALTER ROUTINE privilege for the routine. If the\nautomatic_sp_privileges server system variable is set, that privilege and\nEXECUTE are granted automatically to the routine creator - see Stored Routine\nPrivileges.\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the procedure or function does not exist. A NOTE is produced that\ncan be viewed with SHOW WARNINGS.\n\nWhile this statement takes effect immediately, threads which are executing a\nprocedure can continue execution.\n\nExamples\n--------\n\nDROP PROCEDURE simpleproc;\n\nIF EXISTS:\n\nDROP PROCEDURE simpleproc;\nERROR 1305 (42000): PROCEDURE test.simpleproc does not exist\n\nDROP PROCEDURE IF EXISTS simpleproc;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------+\n| Level | Code | Message                                  |\n+-------+------+------------------------------------------+\n| Note  | 1305 | PROCEDURE test.simpleproc does not exist |\n+-------+------+------------------------------------------+\n\nURL: https://mariadb.com/kb/en/drop-procedure/','','https://mariadb.com/kb/en/drop-procedure/'),
(730,'DROP SERVER',38,'Syntax\n------\n\nDROP SERVER [ IF EXISTS ] server_name\n\nDescription\n-----------\n\nDrops the server definition for the server named server_name. The\ncorresponding row within the mysql.servers table will be deleted. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nDropping a server for a table does not affect any FederatedX, FEDERATED,\nConnect or Spider tables that used this connection information when they were\ncreated.\n\nDROP SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will not return an error if the\nserver does not exist. Unlike all other statements, DROP SERVER IF EXISTS does\nnot issue a note if the server does not exist. See MDEV-9400.\n\nExamples\n--------\n\nDROP SERVER s;\n\nIF EXISTS:\n\nDROP SERVER s;\nERROR 1477 (HY000): The foreign server name you are trying to reference \n does not exist. Data source error:  s\n\nDROP SERVER IF EXISTS s;\nQuery OK, 0 rows affected (0.00 sec)\n\nURL: https://mariadb.com/kb/en/drop-server/','','https://mariadb.com/kb/en/drop-server/'),
(732,'DROP TRIGGER',38,'Syntax\n------\n\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nDescription\n-----------\n\nThis statement drops a trigger. The schema (database) name is optional. If the\nschema is omitted, the trigger is dropped from the default schema. Its use\nrequires the TRIGGER privilege for the table associated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that does not\nexist. A NOTE is generated for a non-existent trigger when using IF EXISTS.\nSee SHOW WARNINGS.\n\nNote: Triggers for a table are also dropped if you drop the table.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP TRIGGER is atomic.\n\nExamples\n--------\n\nDROP TRIGGER test.example_trigger;\n\nUsing the IF EXISTS clause:\n\nDROP TRIGGER IF EXISTS test.example_trigger;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message                |\n+-------+------+------------------------+\n| Note  | 1360 | Trigger does not exist |\n+-------+------+------------------------+\n\nURL: https://mariadb.com/kb/en/drop-trigger/','','https://mariadb.com/kb/en/drop-trigger/'),
(733,'DROP VIEW',38,'Syntax\n------\n\nDROP VIEW [IF EXISTS]\n  view_name [, view_name] ...\n  [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP VIEW removes one or more views. You must have the DROP privilege for each\nview. If any of the views named in the argument list do not exist, MariaDB\nreturns an error indicating by name which non-existing views it was unable to\ndrop, but it also drops all of the views in the list that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that don\'t\nexist. When this clause is given, a NOTE is generated for each non-existent\nview. See SHOW WARNINGS.\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nIt is possible to specify view names as db_name.view_name. This is useful to\ndelete views from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nIf a view references another view, it will be possible to drop the referenced\nview. However, the other view will reference a view which does not exist any\nmore. Thus, querying it will produce an error similar to the following:\n\nERROR 1356 (HY000): View \'db_name.view_name\' references invalid table(s) or \ncolumn(s) or function(s) or definer/invoker of view lack rights to use them\n\nThis problem is reported in the output of CHECK TABLE.\n\nNote that it is not necessary to use DROP VIEW to replace an existing view,\nbecause CREATE VIEW has an OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP VIEW for a singular view is\natomic. Dropping multiple views is crash-safe.\n\nExamples\n--------\n\nDROP VIEW v,v2;\n\nGiven views v and v2, but no view v3\n\nDROP VIEW v,v2,v3;\nERROR 1051 (42S02): Unknown table \'v3\'\n\nDROP VIEW IF EXISTS v,v2,v3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message                 |\n+-------+------+-------------------------+\n| Note  | 1051 | Unknown table \'test.v3\' |\n+-------+------+-------------------------+\n\nURL: https://mariadb.com/kb/en/drop-view/','','https://mariadb.com/kb/en/drop-view/'),
(734,'CONSTRAINT',38,'MariaDB supports the implementation of constraints at the table-level using\neither CREATE TABLE or ALTER TABLE statements. A table constraint restricts\nthe data you can add to the table. If you attempt to insert invalid data on a\ncolumn, MariaDB throws an error.\n\nSyntax\n------\n\n[CONSTRAINT [symbol]] constraint_expression\n\nconstraint_expression:\n | PRIMARY KEY [index_type] (index_col_name, ...) [index_option] ...\n | FOREIGN KEY [index_name] (index_col_name, ...)\n   REFERENCES tbl_name (index_col_name, ...)\n   [ON DELETE reference_option]\n   [ON UPDATE reference_option]\n | UNIQUE [INDEX|KEY] [index_name]\n   [index_type] (index_col_name, ...) [index_option] ...\n | CHECK (check_constraints)\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_option:\n | KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES|NO}\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nDescription\n-----------\n\nConstraints provide restrictions on the data you can add to a table. This\nallows you to enforce data integrity from MariaDB, rather than through\napplication logic. When a statement violates a constraint, MariaDB throws an\nerror.\n\nThere are four types of table constraints:\n\n+------------------------------------+---------------------------------------+\n| Constraint                         | Description                           |\n+------------------------------------+---------------------------------------+\n| PRIMARY KEY                        | Sets the column for referencing       |\n|                                    | rows.  Values must be unique and not  |\n|                                    | null.                                 |\n+------------------------------------+---------------------------------------+\n| FOREIGN KEY                        | Sets the column to reference the      |\n|                                    | primary key on another table.         |\n+------------------------------------+---------------------------------------+\n| UNIQUE                             | Requires values in column or columns  |\n|                                    | only occur once in the table.         |\n+------------------------------------+---------------------------------------+\n| CHECK                              | Checks whether the data meets the     |\n|                                    | given condition.                      |\n+------------------------------------+---------------------------------------+\n\nThe Information Schema TABLE_CONSTRAINTS Table contains information about\ntables that have constraints.\n\nFOREIGN KEY Constraints\n-----------------------\n\nInnoDB supports foreign key constraints. The syntax for a foreign key\nconstraint definition in InnoDB looks like this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n  [index_name] (index_col_name, ...)\n  REFERENCES tbl_name (index_col_name,...)\n  [ON DELETE reference_option]\n  [ON UPDATE reference_option]\n\nreference_option:\n  RESTRICT | CASCADE | SET NULL | NO ACTION\n\nThe Information Schema REFERENTIAL_CONSTRAINTS table has more information\nabout foreign keys.\n\nCHECK Constraints\n-----------------\n\nConstraints are enforced. Before MariaDB 10.2.1 constraint expressions were\naccepted in the syntax but ignored.\n\nYou can define constraints in 2 different ways:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint expression returns false, then the\nrow will not be inserted or updated. One can use most deterministic functions\nin a constraint, including UDFs.\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get an automatically generated name. This is done so that\nyou can later delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the\ncheck_constraint_checks variable to OFF. This is useful for example when\nloading a table that violates some constraints that you want to later find and\nfix in SQL.\n\nReplication\n-----------\n\nIn row-based replication, only the master checks constraints, and failed\nstatements will not be replicated. In statement-based replication, the slaves\nwill also check constraints. Constraints should therefore be identical, as\nwell as deterministic, in a replication environment.\n\nAuto_increment\n--------------\n\nauto_increment columns are not permitted in check constraints. Before MariaDB\n10.2.6, they were permitted, but would not work correctly. See MDEV-11117.\n\nExamples\n--------\n\nCREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n           price DECIMAL,\n           PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n           PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n              product_category INT NOT NULL,\n              product_id INT NOT NULL,\n              customer_id INT NOT NULL,\n              PRIMARY KEY(no),\n              INDEX (product_category, product_id),\n              FOREIGN KEY (product_category, product_id)\n               REFERENCES product(category, id)\n               ON UPDATE CASCADE ON DELETE RESTRICT,\n              INDEX (customer_id),\n              FOREIGN KEY (customer_id)\n               REFERENCES customer(id)) ENGINE=INNODB;\n\nThe following examples will work from MariaDB 10.2.1 onwards.\n\nNumeric constraints and comparisons:\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nINSERT INTO t1(a) VALUES (1);\nERROR 4022 (23000): CONSTRAINT `a` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (3,4);\nERROR 4022 (23000): CONSTRAINT `a_greater` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (4,3);\nQuery OK, 1 row affected (0.04 sec)\n\nDropping a constraint:\n\nALTER TABLE t1 DROP CONSTRAINT a_greater;\n\nAdding a constraint:\n\nALTER TABLE t1 ADD CONSTRAINT a_greater CHECK (a>b);\n\nDate comparisons and character length:\n\nCREATE TABLE t2 (name VARCHAR(30) CHECK (CHAR_LENGTH(name)>2), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `name` failed for `test`.`t2`\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', NULL, \'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2015-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `end_date` failed for `test`.`t2`\n\nA misplaced parenthesis:\n\nCREATE TABLE t3 (name VARCHAR(30) CHECK (CHAR_LENGTH(name>2)), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\nQuery OK, 0 rows affected (0.32 sec)\n\nINSERT INTO t3(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level   | Code | Message                                |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'Io\' |\n+---------+------+----------------------------------------+\n\nCompare the definition of table t2 to table t3. CHAR_LENGTH(name)>2 is very\ndifferent to CHAR_LENGTH(name>2) as the latter mistakenly performs a numeric\ncomparison on the name field, leading to unexpected results.\n\nURL: https://mariadb.com/kb/en/constraint/','','https://mariadb.com/kb/en/constraint/'),
(736,'Dynamic Columns from MariaDB 10',38,'MariaDB starting with 10.0.1\n----------------------------\nMariaDB 10.0.1 introduced the following improvements to the dynamic columns\nfeature.\n\nColumn Name Support\n-------------------\n\nIt is possible to refer to column by names. Names can be used everywhere where\nin MariaDB 5.3 one could use only strings:\n\n* Create a dynamic column blob:\n\nCOLUMN_CREATE(\'int_col\', 123 as int, \'double_col\', 3.14 as double,\n\'string_col\', \'text-data\' as char);\n\n* Set a column value:\n\nCOLUMN_ADD(dyncol_blob, \'intcol\', 1234);\n\n* Get a column value:\n\nCOLUMN_GET(dynstr, \'column1\' as char(10));\n\n* Check whether a column exists\n\nCOLUMN_EXISTS(dyncol_blob, \'column_name\');\n\nChanges in Behavior\n-------------------\n\n* Column list output now includes quoting:\n\nselect column_list(column_create(1, 22, 2, 23));\n+------------------------------------------+\n| column_list(column_create(1, 22, 2, 23)) |\n+------------------------------------------+\n| `1`,`2`                                  |\n+------------------------------------------+\nselect column_list(column_create(\'column1\', 22, \'column2\', 23)); \n+----------------------------------------------------------+\n| column_list(column_create(\'column1\', 22, \'column2\', 23)) |\n+----------------------------------------------------------+\n| `column1`,`column2`                                      |\n+----------------------------------------------------------+\n\n* Column name interpretation has been changed so that the string now is not\nconverted to a number. So some \"magic\" tricks will not work any more, for\nexample, \"1test\" and \"1\" now become different column names:\n\nselect column_list(column_add(column_create(\'1a\', 22), \'1b\', 23));\n+------------------------------------------------------------+\n| column_list(column_add(column_create(\'1a\', 22), \'1b\', 23)) |\n+------------------------------------------------------------+\n| `1a`,`1b`                                                  |\n+------------------------------------------------------------+\n\n* Old behavior:\n\nselect column_list(column_add(column_create(\'1a\', 22), \'1b\', 23));\n+------------------------------------------------------------+\n| column_list(column_add(column_create(\'1a\', 22), \'1b\', 23)) |\n+------------------------------------------------------------+\n| 1                                                          |\n+------------------------------------------------------------+\n\nNew Functions\n-------------\n\nThe following new functions have been added to dynamic columns in MariaDB 10\n\nCOLUMN_CHECK\n------------\n\nCOLUMN_CHECK is used to check a column\'s integrity. When it encounters an\nerror it does not return illegal format errors but returns false instead. It\nalso checks integrity more thoroughly and finds errors in the dynamic column\ninternal structures which might not be found by other functions.\n\nselect column_check(column_create(\'column1\', 22));\n+--------------------------------------------+\n| column_check(column_create(\'column1\', 22)) |\n+--------------------------------------------+\n|                                          1 |\n+--------------------------------------------+\nselect column_check(\'abracadabra\');\n+-----------------------------+\n| column_check(\'abracadabra\') |\n+-----------------------------+\n|                           0 |\n+-----------------------------+\n\nCOLUMN_JSON\n-----------\n\nCOLUMN_JSON converts all dynamic column record content to a JSON object.\n\nselect column_json(column_create(\'column1\', 1, \'column2\', \"two\"));\n+------------------------------------------------------------+\n| column_json(column_create(\'column1\', 1, \'column2\', \"two\")) |\n+------------------------------------------------------------+\n| {\"column1\":1,\"column2\":\"two\"}                              |\n+------------------------------------------------------------+\n\nOther Changes\n-------------\n\n* All API functions has prefix mariadb_dyncol_ (old prefix dynamic_column_ is\ndepricated\n* API changed to be able to work with the new format (*_named functions).\n* Removed \'delete\' function because deleting could be done by adding NULL\nvalue.\n* \'Time\' and \'datetime\' in the new format are stored without microseconds if\nthey are 0.\n* New function added to API (except that two which are representing SQL level\nfunctions):\n\'Unpack\' the dynamic columns content to an arrays of values and names.\n3 functions to get any column value as string, integer (long long) or floating\npoint (double).\n\n* New type of \"dynamic column\" row added on the API level (in SQL level output\nit is a string but if you use dynamic column functions to construct object it\nwill be added as dynamic column value) which allow to add dynamic columns\ninside dynamic columns. JSON function represent such recursive constructions\ncorrectly but limit depth of representation as current implementation limit\n(internally depth of dynamic columns embedding is not limited).\n\nInterface with Cassandra\n------------------------\n\nCassandraSE is no longer actively being developed and has been removed in\nMariaDB 10.6. See MDEV-23024.\n\nSome internal changes were added to dynamic columns to allow them to serve as\nan interface to Apache Cassandra dynamic columns. The Cassandra engine may\npack all columns which were not mentioned in the MariaDB interface table\ndefinition and even bring changes in the dynamic column contents back to the\ncassandra columns family (the table analog in cassandra).\n\nURL: https://mariadb.com/kb/en/dynamic-columns-from-mariadb-10/','','https://mariadb.com/kb/en/dynamic-columns-from-mariadb-10/'),
(737,'MERGE',38,'Description\n-----------\n\nThe MERGE storage engine, also known as the MRG_MyISAM engine, is a collection\nof identical MyISAM tables that can be used as one. \"Identical\" means that all\ntables have identical column and index information. You cannot merge MyISAM\ntables in which the columns are listed in a different order, do not have\nexactly the same columns, or have the indexes in different order. However, any\nor all of the MyISAM tables can be compressed with myisampack. Columns names\nand indexes names can be different, as long as data types and NULL/NOT NULL\nclauses are the same. Differences in table options such as AVG_ROW_LENGTH,\nMAX_ROWS, or PACK_KEYS do not matter.\n\nEach index in a MERGE table must match an index in underlying MyISAM tables,\nbut the opposite is not true. Also, a MERGE table cannot have a PRIMARY KEY or\nUNIQUE indexes, because it cannot enforce uniqueness over all underlying\ntables.\n\nThe following options are meaningful for MERGE tables:\n\n* UNION. This option specifies the list of the underlying MyISAM tables. The\nlist is enclosed between parentheses and separated with commas.\n* INSERT_METHOD. This options specifies whether, and how, INSERTs are allowed\nfor the table. Allowed values are: NO (INSERTs are not allowed), FIRST (new\nrows will be written into the first table specified in the UNION list), LAST\n(new rows will be written into the last table specified in the UNION list).\nThe default value is NO.\n\nIf you define a MERGE table with a definition which is different from the\nunderlying MyISAM tables, or one of the underlying tables is not MyISAM, the\nCREATE TABLE statement will not return any error. But any statement which\ninvolves the table will produce an error like the following:\n\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined \n or of non-MyISAM type or doesn\'t exist\n\nA CHECK TABLE will show more information about the problem.\n\nThe error is also produced if the table is properly define, but an underlying\ntable\'s definition changes at some point in time.\n\nIf you try to insert a new row into a MERGE table with INSERT_METHOD=NO, you\nwill get an error like the following:\n\nERROR 1036 (HY000): Table \'tbl_name\' is read only\n\nIt is possible to build a MERGE table on MyISAM tables which have one or more\nvirtual columns. MERGE itself does not support virtual columns, thus such\ncolumns will be seen as regular columns. The data types and sizes will still\nneed to be identical, and they cannot be NOT NULL.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n  a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n  message CHAR(20)) ENGINE=MyISAM;\n\nCREATE TABLE t2 (\n  a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n  message CHAR(20)) ENGINE=MyISAM;\n\nINSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\n\nINSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\n\nCREATE TABLE total (\n  a INT NOT NULL AUTO_INCREMENT,\n  message CHAR(20), INDEX(a))\n  ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n\nSELECT * FROM total;\n+---+---------+\n| a | message |\n+---+---------+\n| 1 | Testing |\n| 2 | table   |\n| 3 | t1      |\n| 1 | Testing |\n| 2 | table   |\n| 3 | t2      |\n+---+---------+\n\nIn the following example, we\'ll create three MyISAM tables, and then a MERGE\ntable on them. However, one of them uses a different data type for the column\nb, so a SELECT will produce an error:\n\nCREATE TABLE t1 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t2 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t3 (\n a INT,\n b TINYINT\n) ENGINE = MyISAM;\n\nCREATE TABLE t_mrg (\n a INT,\n b INT\n) ENGINE = MERGE,UNION=(t1,t2,t3);\n\nSELECT * FROM t_mrg;\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined\n or of non-MyISAM type or doesn\'t exist\n\nTo find out what\'s wrong, we\'ll use a CHECK TABLE:\n\nCHECK TABLE t_mrg\\G\n*************************** 1. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: Error\nMsg_text: Table \'test.t3\' is differently defined or of non-MyISAM type or\ndoesn\'t exist\n*************************** 2. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: Error\nMsg_text: Unable to open underlying table which is differently defined or of\nnon-MyISAM type or doesn\'t exist\n*************************** 3. row ***************************\n Table: test.t_mrg\n   Op: check\nMsg_type: error\nMsg_text: Corrupt\n\nNow, we know that the problem is in t3\'s definition.\n\nURL: https://mariadb.com/kb/en/merge/','','https://mariadb.com/kb/en/merge/'),
(741,'DROP SEQUENCE',39,'Syntax\n------\n\nDROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]\n  sequence_name [, sequence_name] ...\n\nDescription\n-----------\n\nDROP SEQUENCE removes one or more sequences created with CREATE SEQUENCE. You\nmust have the DROP privilege for each sequence. MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another connection is using the sequence, a metadata lock is active, and\nthis statement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nFor each referenced sequence, DROP SEQUENCE drops a temporary sequence with\nthat name, if it exists. If it does not exist, and the TEMPORARY keyword is\nnot used, it drops a non-temporary sequence with the same name, if it exists.\nThe TEMPORARY keyword ensures that a non-temporary sequence will not\naccidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for sequences that do not\nexist. A NOTE is generated for each non-existent sequence when using IF\nEXISTS. See SHOW WARNINGS.\n\nDROP SEQUENCE requires the DROP privilege.\n\nNotes\n-----\n\nDROP SEQUENCE only removes sequences, not tables. However, DROP TABLE can\nremove both sequences and tables.\n\nURL: https://mariadb.com/kb/en/drop-sequence/','','https://mariadb.com/kb/en/drop-sequence/'),
(739,'CREATE SEQUENCE',39,'Syntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] \n[ CACHE [=] cache | NOCACHE ] [ CYCLE | NOCYCLE] \n[table_options]\nThe options for CREATE SEQUENCE can be given in any order, optionally followed\nby table_options.\n\ntable_options can be any of the normal table options in CREATE TABLE but the\nmost usable ones are ENGINE=... and COMMENT=.\n\nNOMAXVALUE and NOMINVALUE are there to allow one to create SEQUENCEs using the\nOracle syntax.\n\nDescription\n-----------\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to CACHE) it can in some cases be much faster than\nAUTO INCREMENT. Another benefit is that one can access the last value\ngenerated by all used sequences, which solves one of the limitations with\nLAST_INSERT_ID().\n\nCREATE SEQUENCE requires the CREATE privilege.\n\nDROP SEQUENCE can be used to drop a sequence, and ALTER SEQUENCE to change it.\n\nArguments to Create\n-------------------\n\nThe following options may be used:\n\n+---------------+------------------------------+----------------------------+\n| Option        | Default value                | Description                |\n+---------------+------------------------------+----------------------------+\n| INCREMENT     | 1                            | Increment to use for       |\n|               |                              | values. May be negative.   |\n|               |                              | Setting an increment of 0  |\n|               |                              | causes the sequence to     |\n|               |                              | use the value of the       |\n|               |                              | auto_increment_increment   |\n|               |                              | system variable at the     |\n|               |                              | time of creation, which    |\n|               |                              | is always a positive       |\n|               |                              | number. (see MDEV-16035).  |\n+---------------+------------------------------+----------------------------+\n| MINVALUE      | 1 if INCREMENT > 0 and       | Minimum value for the      |\n|               | -9223372036854775807 if      | sequence                   |\n|               | INCREMENT < 0                |                            |\n+---------------+------------------------------+----------------------------+\n| MAXVALUE      | 9223372036854775806 if       | Max value for sequence     |\n|               | INCREMENT > 0 and -1 if      |                            |\n|               | INCREMENT < 0                |                            |\n+---------------+------------------------------+----------------------------+\n| START         | MINVALUE if INCREMENT > 0    | First value that the       |\n|               | and MAX_VALUE if INCREMENT<  | sequence will generate     |\n|               | 0                            |                            |\n+---------------+------------------------------+----------------------------+\n| CACHE         | 1000                         | Number of values that      |\n|               |                              | should be cached. 0 if no  |\n|               |                              | CACHE.  The underlying     |\n|               |                              | table will be updated      |\n|               |                              | first time a new sequence  |\n|               |                              | number is generated and    |\n|               |                              | each time the cache runs   |\n|               |                              | out.                       |\n+---------------+------------------------------+----------------------------+\n\nIf CYCLE is used then the sequence should start again from MINVALUE after it\nhas run out of values. Default value is NOCYCLE.\n\nConstraints on Create Arguments\n-------------------------------\n\nTo be able to create a legal sequence, the following must hold:\n\n* MAXVALUE >= start\n* MAXVALUE > MINVALUE\n* START >= MINVALUE\n* MAXVALUE <= 9223372036854775806  (LONGLONG_MAX-1)\n* MINVALUE >= -9223372036854775807 (LONGLONG_MIN+1)\n\nNote that sequences can\'t generate the maximum/minimum 64 bit number because\nof the constraint of MINVALUE and MAXVALUE.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE SEQUENCE is atomic.\n\nExamples\n--------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nCREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;\n\nThe following statement fails, as the increment conflicts with the defaults\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10;\nERROR 4082 (HY000): Sequence \'test.s3\' values are conflicting\n\nThe sequence can be created by specifying workable minimum and maximum values:\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10 MINVALUE=-100 MAXVALUE=1000;\n\nURL: https://mariadb.com/kb/en/create-sequence/','','https://mariadb.com/kb/en/create-sequence/'),
(740,'ALTER SEQUENCE',39,'Syntax\n------\n\nALTER SEQUENCE [IF EXISTS] sequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ]\n[ RESTART [[WITH | =] restart]\n\nALTER SEQUENCE allows one to change any values for a SEQUENCE created with\nCREATE SEQUENCE.\n\nThe options for ALTER SEQUENCE can be given in any order.\n\nDescription\n-----------\n\nALTER SEQUENCE changes the parameters of an existing sequence generator. Any\nparameters not specifically set in the ALTER SEQUENCE command retain their\nprior settings.\n\nALTER SEQUENCE requires the ALTER privilege.\n\nArguments to ALTER SEQUENCE\n---------------------------\n\nThe following options may be used:\n\n+---------------+-------------------------------+---------------------------+\n| Option        | Default value                 | Description               |\n+---------------+-------------------------------+---------------------------+\n| INCREMENT     | 1                             | Increment to use for      |\n|               |                               | values. May be negative.  |\n+---------------+-------------------------------+---------------------------+\n| MINVALUE      | 1 if INCREMENT > 0 and        | Minimum value for the     |\n|               | -9223372036854775807 if       | sequence.                 |\n|               | INCREMENT < 0                 |                           |\n+---------------+-------------------------------+---------------------------+\n| MAXVALUE      | 9223372036854775806 if        | Max value for sequence.   |\n|               | INCREMENT > 0 and -1 if       |                           |\n|               | INCREMENT < 0                 |                           |\n+---------------+-------------------------------+---------------------------+\n| START         | MINVALUE if INCREMENT > 0     | First value that the      |\n|               | and MAX_VALUE if INCREMENT< 0 | sequence will generate.   |\n+---------------+-------------------------------+---------------------------+\n| CACHE         | 1000                          | Number of values that     |\n|               |                               | should be cached. 0 if    |\n|               |                               | no CACHE.  The            |\n|               |                               | underlying table will be  |\n|               |                               | updated first time a new  |\n|               |                               | sequence number is        |\n|               |                               | generated and each time   |\n|               |                               | the cache runs out.       |\n+---------------+-------------------------------+---------------------------+\n| CYCLE         | 0 (= NO CYCLE)                | 1 if the sequence should  |\n|               |                               | start again from          |\n|               |                               | MINVALUE# after it has    |\n|               |                               | run out of values.        |\n+---------------+-------------------------------+---------------------------+\n| RESTART       | START if restart value not    | If  RESTART option is     |\n|               | is given                      | used, NEXT VALUE will     |\n|               |                               | return the restart value. |\n+---------------+-------------------------------+---------------------------+\n\nThe optional clause RESTART [ WITH restart ] sets the next value for the\nsequence. This is equivalent to calling the SETVAL() function with the is_used\nargument as 0. The specified value will be returned by the next call of\nnextval. Using RESTART with no restart value is equivalent to supplying the\nstart value that was recorded by CREATE SEQUENCE or last set by ALTER SEQUENCE\nSTART WITH.\n\nALTER SEQUENCE will not allow you to change the sequence so that it\'s\ninconsistent. For example:\n\nCREATE SEQUENCE s1;\nALTER SEQUENCE s1 MINVALUE 10;\nERROR 4061 (HY000): Sequence \'test.t1\' values are conflicting\n\nALTER SEQUENCE s1 MINVALUE 10 RESTART 10;\nERROR 4061 (HY000): Sequence \'test.t1\' values are conflicting\n\nALTER SEQUENCE s1 MINVALUE 10 START 10 RESTART 10;\n\nINSERT\n------\n\nTo allow SEQUENCE objects to be backed up by old tools, like mariadb-dump, one\ncan use SELECT to read the current state of a SEQUENCE object and use an\nINSERT to update the SEQUENCE object. INSERT is only allowed if all fields are\nspecified:\n\nCREATE SEQUENCE s1;\nINSERT INTO s1 VALUES(1000,10,2000,1005,1,1000,0,0);\nSELECT * FROM s1;\n\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n| next_value | min_value | max_value | start | increment | cache | cycle |\nround |\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n|       1000 |        10 |      2000 |  1005 |         1 |  1000 |     0 |    \n0 |\n+------------+-----------+-----------+-------+-----------+-------+-------+-----\n-+\n\nSHOW CREATE SEQUENCE s1;\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n| Table | Create Table                                                        \n                    |\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n| s1    | CREATE SEQUENCE `s1` start with 1005 minvalue 10 maxvalue 2000\nincrement by 1 cache 1000 nocycle ENGINE=Aria |\n+-------+----------------------------------------------------------------------\n---------------------------------------+\n\nNotes\n-----\n\nALTER SEQUENCE will instantly affect all future SEQUENCE operations. This is\nin contrast to some other databases where the changes requested by ALTER\nSEQUENCE will not be seen until the sequence cache has run out.\n\nALTER SEQUENCE will take a full table lock of the sequence object during its\n(brief) operation. This ensures that ALTER SEQUENCE is replicated correctly.\nIf you only want to set the next sequence value to a higher value than\ncurrent, then you should use SETVAL() instead, as this is not blocking.\n\nIf you want to change storage engine, sequence comment or rename the sequence,\nyou can use ALTER TABLE for this.\n\nURL: https://mariadb.com/kb/en/alter-sequence/','','https://mariadb.com/kb/en/alter-sequence/'),
(742,'NEXT VALUE for sequence_name',39,'MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3\n\nSyntax\n------\n\nNEXT VALUE FOR sequence\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nNEXT VALUE FOR is ANSI SQL syntax while NEXTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGenerate next value for a SEQUENCE.\n\n* You can greatly speed up NEXT VALUE by creating the sequence with the CACHE\noption. If not, every NEXT VALUE usage will cause changes in the stored\nSEQUENCE table.\n* When using NEXT VALUE the value will be reserved at once and will not be\nreused, except if the SEQUENCE was created with CYCLE. This means that when\nyou are using SEQUENCEs you have to expect gaps in the generated sequence\nnumbers.\n* If one updates the SEQUENCE with SETVAL() or ALTER SEQUENCE ... RESTART,\nNEXT VALUE FOR will notice this and start from the next requested value.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the SEQUENCE object. In effect, this\nwill discard the cached values.\n* A server restart (or closing the current connection) also causes a drop of\nall cached values. The cached sequence numbers are reserved only for the\ncurrent connection.\n* NEXT VALUE requires the INSERT privilege.\n\nMariaDB starting with 10.3.3\n----------------------------\n* You can also use NEXT VALUE FOR sequence for column DEFAULT.\n\nURL: https://mariadb.com/kb/en/next-value-for-sequence_name/','','https://mariadb.com/kb/en/next-value-for-sequence_name/'),
(743,'PREVIOUS VALUE FOR sequence_name',39,'MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nPREVIOUS VALUE FOR is IBM DB2 syntax while LASTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGet last value in the current connection generated from a sequence.\n\n* If the sequence has not yet been used by the connection, PREVIOUS VALUE FOR\nreturns NULL (the same thing applies with a new connection which doesn\'t see a\nlast value for an existing sequence).\n* If a SEQUENCE has been dropped and re-created then it\'s treated as a new\nSEQUENCE and PREVIOUS VALUE FOR will return NULL.\n* FLUSH TABLES has no effect on PREVIOUS VALUE FOR.\n* Previous values for all used sequences are stored per connection until\nconnection ends.\n* PREVIOUS VALUE FOR requires the SELECT privilege.\n\nExample\n-------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                 NULL |\n+----------------------+\n\n# The function works for sequences only, if the table is used an error is\ngenerated\nSELECT PREVIOUS VALUE FOR t;\nERROR 4089 (42S02): \'test.t\' is not a SEQUENCE\n\n# Call the NEXT VALUE FOR s:\nSELECT NEXT VALUE FOR s;\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n|              100 |\n+------------------+\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                  100 |\n+----------------------+\n\nNow try to start the new connection and check that the last value is still\nNULL, before updating the value in the new connection after the output of the\nnew connection gets current value (110 in the example below). Note that first\nconnection cannot see this change and the result of last value still remains\nthe same (100 in the example above).\n\n$ .mysql -uroot test -e\"SELECT PREVIOUS VALUE FOR s; SELECT NEXT VALUE FOR s;\nSELECT PREVIOUS VALUE FOR s;\"\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                 NULL |\n+----------------------+\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n|              110 |\n+------------------+\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n|                  110 |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/previous-value-for-sequence_name/','','https://mariadb.com/kb/en/previous-value-for-sequence_name/'),
(745,'JSON_ARRAYAGG',40,'MariaDB starting with 10.5.0\n----------------------------\nJSON_ARRAYAGG was added in MariaDB 10.5.0.\n\nSyntax\n------\n\nJSON_ARRAYAGG(column_or_expression)\n\nDescription\n-----------\n\nJSON_ARRAYAGG returns a JSON array containing an element for each value in a\ngiven set of JSON or SQL values. It acts on a column or an expression that\nevaluates to a single value.\n\nReturns NULL in the case of an error, or if the result contains no rows.\n\nJSON_ARRAYAGG cannot currently be used as a window function.\n\nThe full syntax is as follows:\n\nJSON_ARRAYAGG([DISTINCT] expr [,expr ...]\n      [ORDER BY {unsigned_integer | col_name | expr}\n        [ASC | DESC] [,col_name ...]]\n      [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n\nExamples\n--------\n\nCREATE TABLE t1 (a INT, b INT);\n\nINSERT INTO t1 VALUES (1, 1),(2, 1), (1, 1),(2, 1), (3, 2),(2, 2),(2, 2),(2,\n2);\n\nSELECT JSON_ARRAYAGG(a), JSON_ARRAYAGG(b) FROM t1;\n+-------------------+-------------------+\n| JSON_ARRAYAGG(a)  | JSON_ARRAYAGG(b)  |\n+-------------------+-------------------+\n| [1,2,1,2,3,2,2,2] | [1,1,1,1,2,2,2,2] |\n+-------------------+-------------------+\n\nSELECT JSON_ARRAYAGG(a), JSON_ARRAYAGG(b) FROM t1 GROUP BY b;\n+------------------+------------------+\n| JSON_ARRAYAGG(a) | JSON_ARRAYAGG(b) |\n+------------------+------------------+\n| [1,2,1,2]        | [1,1,1,1]        |\n| [3,2,2,2]        | [2,2,2,2]        |\n+------------------+------------------+\n\nURL: https://mariadb.com/kb/en/json_arrayagg/','','https://mariadb.com/kb/en/json_arrayagg/'),
(744,'SETVAL',39,'MariaDB starting with 10.3.1\n----------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nSETVAL(sequence_name, next_value, [is_used, [round]])\n\nDescription\n-----------\n\nSet the next value to be returned for a SEQUENCE.\n\nThis function is compatible with PostgreSQL syntax, extended with the round\nargument.\n\nIf the is_used argument is not given or is 1 or true, then the next used value\nwill one after the given value. If is_used is 0 or false then the next\ngenerated value will be the given value.\n\nIf round is used then it will set the round value (or the internal cycle\ncount, starting at zero) for the sequence. If round is not used, it\'s assumed\nto be 0.\n\nnext_value must be an integer literal.\n\nFor SEQUENCE tables defined with CYCLE (see CREATE SEQUENCE) one should use\nboth next_value and round to define the next value. In this case the current\nsequence value is defined to be round, next_value.\n\nThe result returned by SETVAL() is next_value or NULL if the given next_value\nand round is smaller than the current value.\n\nSETVAL() will not set the SEQUENCE value to a something that is less than its\ncurrent value. This is needed to ensure that SETVAL() is replication safe. If\nyou want to set the SEQUENCE to a smaller number use ALTER SEQUENCE.\n\nIf CYCLE is used, first round and then next_value are compared to see if the\nvalue is bigger than the current value.\n\nInternally, in the MariaDB server, SETVAL() is used to inform slaves that a\nSEQUENCE has changed value. The slave may get SETVAL() statements out of\norder, but this is ok as only the biggest one will have an effect.\n\nSETVAL requires the INSERT privilege.\n\nExamples\n--------\n\nSELECT setval(foo, 42);           -- Next nextval will return 43\nSELECT setval(foo, 42, true);     -- Same as above\nSELECT setval(foo, 42, false);    -- Next nextval will return 42\n\nSETVAL setting higher and lower values on a sequence with an increment of 10:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|         50 |\n+------------+\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n|            100 |\n+----------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        110 |\n+------------+\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n|          NULL |\n+---------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n|        120 |\n+------------+\n\nExample demonstrating round:\n\nCREATE OR REPLACE SEQUENCE s1\n START WITH 1\n MINVALUE 1\n MAXVALUE 99\n INCREMENT BY 1\n CACHE 20\n CYCLE;\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n|                   99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           1 |\n+-------------+\n\nThe following statement returns NULL, as the given next_value and round is\nsmaller than the current value.\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n|                 NULL |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           2 |\n+-------------+\n\nIncreasing the round from zero to 1 will allow next_value to be returned.\n\nSELECT SETVAL(s1, 99, 1, 1);\n+----------------------+\n| SETVAL(s1, 99, 1, 1) |\n+----------------------+\n|                   99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n|           1 |\n+-------------+\n\nURL: https://mariadb.com/kb/en/setval/','','https://mariadb.com/kb/en/setval/'),
(746,'JSON_OBJECTAGG',40,'MariaDB starting with 10.5.0\n----------------------------\nJSON_OBJECTAGG was added in MariaDB 10.5.0.\n\nSyntax\n------\n\nJSON_OBJECTAGG(key, value)\n\nDescription\n-----------\n\nJSON_OBJECTAGG returns a JSON object containing key-value pairs. It takes two\nexpressions that evaluate to a single value, or two column names, as\narguments, the first used as a key, and the second as a value.\n\nReturns NULL in the case of an error, or if the result contains no rows.\n\nJSON_OBJECTAGG cannot currently be used as a window function.\n\nExamples\n--------\n\nselect * from t1;\n+------+-------+\n| a    | b     |\n+------+-------+\n|    1 | Hello |\n|    1 | World |\n|    2 | This  |\n+------+-------+\n\nSELECT JSON_OBJECTAGG(a, b) FROM t1;\n+----------------------------------------+\n| JSON_OBJECTAGG(a, b)                   |\n+----------------------------------------+\n| {\"1\":\"Hello\", \"1\":\"World\", \"2\":\"This\"} |\n+----------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_objectagg/','','https://mariadb.com/kb/en/json_objectagg/'),
(749,'JSON_ARRAY_APPEND',40,'Syntax\n------\n\nJSON_ARRAY_APPEND(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nAppends values to the end of the specified arrays within a JSON document,\nreturning the result, or NULL if any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[0]\', 5)\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [[1, 5], 2, [3, 4]]                 |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, [2, 6], [3, 4]]                 |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, [2, 6], [3, 4, 7]]                         |\n+------------------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$\', 5);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$\', 5) |\n+----------------------------------+\n| [1, 2, [3, 4], 5]                |\n+----------------------------------+\n\nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$.B\', 5);\n+------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$.B\', 5) |\n+------------------------------------+\n| {\"A\": 1, \"B\": [2, 5], \"C\": [3, 4]} |\n+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array_append/','','https://mariadb.com/kb/en/json_array_append/'),
(747,'JSONPath Expressions',40,'A number of JSON functions accept JSON Path expressions. MariaDB defines this\npath as follows:\n\nJSON Path Syntax\n----------------\n\npath : [\'lax\'] \'$\' [step]*\n\nThe path starts with an optional path mode. At the moment, MariaDB supports\nonly the \"lax\" mode, which is also the mode that is used when it is not\nexplicitly specified.\n\nThe $ symbol represents the context item. The search always starts from the\ncontext item; because of that, the path always starts with $.\n\nThen, it is followed by zero or more steps, which select element(s) in the\nJSON document. A step may be one of the following:\n\n* Object member selector\n* Array element selector\n* Wildcard selector\n\nObject Member Selector\n----------------------\n\nTo select member(s) in a JSON object, one can use one of the following:\n\n* .memberName selects the value of the member with name memberName.\n* .\"memberName\" - the same as above but allows one to select a member with a\nname that\'s not a valid identifier (that is, has space, dot, and/or other\ncharacters)\n* .* - selects the values of all members of the object.\n\nIf the current item is an array (instead of an object), nothing will be\nselected.\n\nArray Element Selector\n----------------------\n\nTo select elements of an array, one can use one of the following:\n\n* [N] selects element number N in the array. The elements are counted from\nzero.\n* [*] selects all elements in the array.\n\nIf the current item is an object (instead of an array), nothing will be\nselected.\n\nStarting from MariaDB server 10.9, JSON path also supports negative index in\narray, \'last\' keyword and range notation (\'to\' keyword) for accessing array\nelements. Negative index starts from -1.\n\n* [-N] selects n th element from end.\n* [last-N] selects n th element from the last element.\n* [M to N] selects range of elements starting from index M to N.\n\nExample:\n\nSET @json=\'{\n      \"A\": [0,\n         [1, 2, 3],\n         [4, 5, 6],\n         \"seven\",\n         0.8,\n         true,\n         false,\n         \"eleven\",\n         [12, [13, 14], {\"key1\":\"value1\"},[15]],\n         true],\n      \"B\": {\"C\": 1},\n      \"D\": 2\n     }\';\nSELECT JSON_EXTRACT(@json, \'$.A[-8][1]\');\n+--------------------------------------------------+\n| JSON_EXTRACT(@json, \'$.A[-8][1]\')                |\n+--------------------------------------------------+\n| 5                                                |\n+--------------------------------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$.A[last-7][1]\');\n+-----------------------------------------------+\n| SELECT JSON_EXTRACT(@json, \'$.A[last-7][1]\'); |\n+-----------------------------------------------+\n| 5                                             |\n+-----------------------------------------------+\n\nSET @json= \'[\n      [1, {\"key1\": \"value1\"}, 3],\n      [false, 5, 6],\n      [7, 8, [9, {\"key2\": 2}, 11]],\n      [15, 1.34, [14], [\"string1\", [16, {\"key1\":[1,2,3,[4,5,6]]}, 18]]],\n      [19, 20],\n      21, 22\n      ]\';\n\nSELECT JSON_EXTRACT(@json, \'$[0 to 3][2]\');\n+-----------------------------------------------+\n| JSON_EXTRACT(@json, \'$[0 to 3][2]\')           |\n+-----------------------------------------------+\n| [3, 6, [9, {\"key2\": 2}, 11], [14]]            |\n+-----------------------------------------------+\n\nThis will produce output for first index of eighth from last element of a two\ndimensional array.\n\nNote: In range notation, when M > N ( when M,N are greater than or equal to 0)\nor (size of array - M or size of array - N when M, N are less than 0), then it\nis treated as an impossible range and NULL is returned.\n\nSET @json= \'[1, 2, 3, 4, 5]\';\nSELECT JSON_EXTRACT(@json, \'$[4 to 2]\');\n+-----------------------------------+\n| JSON_EXTRACT(@json, \'$[4 to 2]\')  |\n+-----------------------------------+\n| NULL                              |\n+-----------------------------------+\n\nWildcard\n--------\n\nThe wildcard step, **, recursively selects all child elements of the current\nelement. Both array elements and object members are selected.\n\nThe wildcard step must not be the last step in the JSONPath expression. It\nmust be followed by an array or object member selector step.\n\nFor example:\n\nselect json_extract(@json_doc, \'$**.price\');\n\nwill select all object members in the document that are named price, while\n\nselect json_extract(@json_doc, \'$**[2]\');\n\nwill select the second element in each of the arrays present in the document.\n\nCompatibility\n-------------\n\nMariaDB\'s JSONPath syntax supports a subset of JSON Path\'s definition in the\nSQL Standard. The most notable things not supported are the strict mode and\nfilters.\n\nMariaDB\'s JSONPath is close to MySQL\'s JSONPath. The wildcard step ( ** ) is a\nnon-standard extension that has the same meaning as in MySQL. The difference\nbetween MariaDB and MySQL\'s JSONPath is: MySQL doesn\'t allow one to specify\nthe mode explicitly (but uses lax mode implicitly).\n\nURL: https://mariadb.com/kb/en/jsonpath-expressions/','','https://mariadb.com/kb/en/jsonpath-expressions/'),
(750,'JSON_ARRAY_INSERT',40,'Syntax\n------\n\nJSON_ARRAY_INSERT(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nInserts a value into a JSON document, returning the modified document, or NULL\nif any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[0]\', 5);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [5, 1, 2, [3, 4]]                   |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, 6, 2, [3, 4]]                   |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, 6, 7, 2, [3, 4]]                           |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_array_insert/','','https://mariadb.com/kb/en/json_array_insert/'),
(752,'JSON_CONTAINS',40,'Syntax\n------\n\nJSON_CONTAINS(json_doc, val[, path])\n\nDescription\n-----------\n\nReturns whether or not the specified value is found in the given JSON document\nor, optionally, at the specified path within the document. Returns 1 if it\ndoes, 0 if not and NULL if any of the arguments are null. An error occurs if\nthe document or path is not valid, or contains the * or ** wildcards.\n\nExamples\n--------\n\nSET @json = \'{\"A\": 0, \"B\": {\"C\": 1}, \"D\": 2}\';\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.A\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.A\') |\n+----------------------------------+\n|                                0 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.D\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.D\') |\n+----------------------------------+\n|                                1 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\') |\n+-----------------------------------------+\n|                                       0 |\n+-----------------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\') |\n+-----------------------------------------+\n|                                       1 |\n+-----------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_contains/','','https://mariadb.com/kb/en/json_contains/'),
(753,'JSON_CONTAINS_PATH',40,'Syntax\n------\n\nJSON_CONTAINS_PATH(json_doc, return_arg, path[, path] ...)\n\nDescription\n-----------\n\nIndicates whether the given JSON document contains data at the specified path\nor paths. Returns 1 if it does, 0 if not and NULL if any of the arguments are\nnull.\n\nThe return_arg can be one or all:\n\n* one - Returns 1 if at least one path exists within the JSON document. \n* all - Returns 1 only if all paths exist within the JSON document.\n\nExamples\n--------\n\nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n\nSELECT JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n|                                              1 |\n+------------------------------------------------+\n1 row in set (0.00 sec)\n\nSELECT JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n|                                              0 |\n+------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_contains_path/','','https://mariadb.com/kb/en/json_contains_path/'),
(754,'JSON_DEPTH',40,'Syntax\n------\n\nJSON_DEPTH(json_doc)\n\nDescription\n-----------\n\nReturns the maximum depth of the given JSON document, or NULL if the argument\nis null. An error will occur if the argument is an invalid JSON document.\n\n* Scalar values or empty arrays or objects have a depth of 1.\n* Arrays or objects that are not empty but contain only elements or member\nvalues of depth 1 will have a depth of 2.\n* In other cases, the depth will be greater than 2.\n\nExamples\n--------\n\nSELECT JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\'), JSON_DEPTH(\'{}\');\n+------------------+--------------------+------------------+\n| JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') | JSON_DEPTH(\'{}\') |\n+------------------+--------------------+------------------+\n|                1 |                  1 |                1 |\n+------------------+--------------------+------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, 3]\'), JSON_DEPTH(\'[[], {}, []]\');\n+-------------------------+----------------------------+\n| JSON_DEPTH(\'[1, 2, 3]\') | JSON_DEPTH(\'[[], {}, []]\') |\n+-------------------------+----------------------------+\n|                       2 |                          2 |\n+-------------------------+----------------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\');\n+---------------------------------------+\n| JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\') |\n+---------------------------------------+\n|                                     3 |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_depth/','','https://mariadb.com/kb/en/json_depth/'),
(755,'JSON_DETAILED',40,'Syntax\n------\n\nJSON_DETAILED(json_doc[, tab_size])\nJSON_PRETTY(json_doc[, tab_size])\n\nDescription\n-----------\n\nRepresents JSON in the most understandable way emphasizing nested structures.\n\nJSON_PRETTY was added as an alias for JSON_DETAILED in MariaDB 10.10.3,\nMariaDB 10.9.5, MariaDB 10.8.7, MariaDB 10.7.8, MariaDB 10.6.12, MariaDB\n10.5.19 and MariaDB 10.4.28.\n\nExample\n-------\n\nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n\nSELECT @j;\n+--------------------+\n| @j                 |\n+--------------------+\n| { \"A\":1,\"B\":[2,3]} |\n+--------------------+\n\nSELECT JSON_DETAILED(@j);\n+------------------------------------------------------------+\n| JSON_DETAILED(@j)                                          |\n+------------------------------------------------------------+\n| {\n  \"A\": 1,\n  \"B\":\n  [\n    2,\n    3\n  ]\n} |\n+------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_detailed/','','https://mariadb.com/kb/en/json_detailed/'),
(756,'JSON_EQUALS',40,'MariaDB starting with 10.7.0\n----------------------------\nJSON_EQUALS was added in MariaDB 10.7.0\n\nSyntax\n------\n\nJSON_EQUALS(json1, json2)\n\nDescription\n-----------\n\nChecks if there is equality between two json objects. Returns 1 if it there\nis, 0 if not, or NULL if any of the arguments are null.\n\nExamples\n--------\n\nSELECT JSON_EQUALS(\'{\"a\"   :[1, 2, 3],\"b\":[4]}\', \'{\"b\":[4],\"a\":[1, 2, 3.0]}\');\n+------------------------------------------------------------------------+\n| JSON_EQUALS(\'{\"a\"   :[1, 2, 3],\"b\":[4]}\', \'{\"b\":[4],\"a\":[1, 2, 3.0]}\') |\n+------------------------------------------------------------------------+\n|                                                                      1 |\n+------------------------------------------------------------------------+\n\nSELECT JSON_EQUALS(\'{\"a\":[1, 2, 3]}\', \'{\"a\":[1, 2, 3.01]}\');\n+------------------------------------------------------+\n| JSON_EQUALS(\'{\"a\":[1, 2, 3]}\', \'{\"a\":[1, 2, 3.01]}\') |\n+------------------------------------------------------+\n|                                                    0 |\n+------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_equals/','','https://mariadb.com/kb/en/json_equals/'),
(757,'JSON_EXISTS',40,'Syntax\n------\n\nDescription\n-----------\n\nDetermines whether a specified JSON value exists in the given data. Returns 1\nif found, 0 if not, or NULL if any of the inputs were NULL.\n\nExamples\n--------\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2\") |\n+------------------------------------------------------------+\n|                                                          1 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key3\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key3\") |\n+------------------------------------------------------------+\n|                                                          0 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[1]\");\n+---------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[1]\") |\n+---------------------------------------------------------------+\n|                                                             1 |\n+---------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[10]\");\n+----------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\', \"$.key2[10]\") |\n+----------------------------------------------------------------+\n|                                                              0 |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_exists/','','https://mariadb.com/kb/en/json_exists/'),
(758,'JSON_EXTRACT',40,'Syntax\n------\n\nJSON_EXTRACT(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nExtracts data from a JSON document. The extracted data is selected from the\nparts matching the path arguments. Returns all matched values; either as a\nsingle matched value, or, if the arguments could return multiple values, a\nresult autowrapped as an array in the matching order.\n\nReturns NULL if no paths match or if any of the arguments are NULL.\n\nAn error will occur if any path argument is not a valid path, or if the\njson_doc argument is not a valid JSON document.\n\nThe path expression be a JSONPath expression as supported by MariaDB\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_EXTRACT(@json, \'$[1]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[1]\') |\n+-----------------------------+\n| 2                           |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[2]\') |\n+-----------------------------+\n| [3, 4]                      |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2][1]\');\n+--------------------------------+\n| JSON_EXTRACT(@json, \'$[2][1]\') |\n+--------------------------------+\n| 4                              |\n+--------------------------------+\n\nURL: https://mariadb.com/kb/en/json_extract/','','https://mariadb.com/kb/en/json_extract/'),
(759,'JSON_INSERT',40,'Syntax\n------\n\nJSON_INSERT(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nInserts data into a JSON document, returning the resulting document or NULL if\neither of the json_doc or path arguments are null.\n\nAn error will occur if the JSON document is invalid, or if any of the paths\nare invalid or contain a * or ** wildcard.\n\nJSON_INSERT can only insert data while JSON_REPLACE can only update. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSET @json = \'{ \"A\": 0, \"B\": [1, 2]}\';\n\nSELECT JSON_INSERT(@json, \'$.C\', \'[3, 4]\');\n+--------------------------------------+\n| JSON_INSERT(@json, \'$.C\', \'[3, 4]\')  |\n+--------------------------------------+\n| { \"A\": 0, \"B\": [1, 2], \"C\":\"[3, 4]\"} |\n+--------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_insert/','','https://mariadb.com/kb/en/json_insert/'),
(760,'JSON_KEYS',40,'Syntax\n------\n\nJSON_KEYS(json_doc[, path])\n\nDescription\n-----------\n\nReturns the keys as a JSON array from the top-level value of a JSON object or,\nif the optional path argument is provided, the top-level keys from the path.\n\nExcludes keys from nested sub-objects in the top level value. The resulting\narray will be empty if the selected object is empty.\n\nReturns NULL if any of the arguments are null, a given path does not locate an\nobject, or if the json_doc argument is not an object.\n\nAn error will occur if JSON document is invalid, the path is invalid or if the\npath contains a * or ** wildcard.\n\nExamples\n--------\n\nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\');\n+--------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\') |\n+--------------------------------------+\n| [\"A\", \"B\"]                           |\n+--------------------------------------+\n\nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\');\n+-----------------------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\') |\n+-----------------------------------------------------+\n| [\"D\"]                                               |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_keys/','','https://mariadb.com/kb/en/json_keys/'),
(761,'JSON_LENGTH',40,'Syntax\n------\n\nJSON_LENGTH(json_doc[, path])\n\nDescription\n-----------\n\nReturns the length of a JSON document, or, if the optional path argument is\ngiven, the length of the value within the document specified by the path.\n\nReturns NULL if any of the arguments argument are null or the path argument\ndoes not identify a value in the document.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nLength will be determined as follow:\n\n* A scalar\'s length is always 1.\n* If an array, the number of elements in the array.\n* If an object, the number of members in the object.\n\nThe length of nested arrays or objects are not counted.\n\nExamples\n--------\n\nURL: https://mariadb.com/kb/en/json_length/','','https://mariadb.com/kb/en/json_length/'),
(764,'JSON_MERGE_PATCH',40,'MariaDB starting with 10.3.16\n-----------------------------\nJSON_MERGE_PATCH was introduced in MariaDB 10.3.16 and MariaDB 10.4.5.\n\nSyntax\n------\n\nJSON_MERGE_PATCH(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents, returning the merged result, or NULL if any\nargument is NULL.\n\nJSON_MERGE_PATCH is an RFC 7396-compliant replacement for JSON_MERGE, which\nhas been deprecated.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[2, 3]\';\nSELECT JSON_MERGE_PATCH(@json1,@json2),JSON_MERGE_PRESERVE(@json1,@json2);\n+---------------------------------+------------------------------------+\n| JSON_MERGE_PATCH(@json1,@json2) | JSON_MERGE_PRESERVE(@json1,@json2) |\n+---------------------------------+------------------------------------+\n| [2, 3]                          | [1, 2, 2, 3]                       |\n+---------------------------------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge_patch/','','https://mariadb.com/kb/en/json_merge_patch/'),
(765,'JSON_MERGE_PRESERVE',40,'MariaDB starting with 10.3.16\n-----------------------------\nJSON_MERGE_PRESERVE was introduced in MariaDB 10.3.16 and MariaDB 10.4.5.\n\nSyntax\n------\n\nJSON_MERGE_PRESERVE(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents, returning the merged result, or NULL if any\nargument is NULL.\n\nJSON_MERGE_PRESERVE was introduced in MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5 as a synonym for JSON_MERGE, which has been deprecated.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[2, 3]\';\nSELECT JSON_MERGE_PATCH(@json1,@json2),JSON_MERGE_PRESERVE(@json1,@json2);\n+---------------------------------+------------------------------------+\n| JSON_MERGE_PATCH(@json1,@json2) | JSON_MERGE_PRESERVE(@json1,@json2) |\n+---------------------------------+------------------------------------+\n| [2, 3]                          | [1, 2, 2, 3]                       |\n+---------------------------------+------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_merge_preserve/','','https://mariadb.com/kb/en/json_merge_preserve/'),
(766,'JSON_NORMALIZE',40,'MariaDB starting with 10.7.0\n----------------------------\nJSON_NORMALIZE was added in MariaDB 10.7.0.\n\nSyntax\n------\n\nJSON_NORMALIZE(json)\n\nDescription\n-----------\n\nRecursively sorts keys and removes spaces, allowing comparison of json\ndocuments for equality.\n\nExamples\n--------\n\nWe may wish our application to use the database to enforce a unique constraint\non the JSON contents, and we can do so using the JSON_NORMALIZE function in\ncombination with a unique key.\n\nFor example, if we have a table with a JSON column:\n\nCREATE TABLE t1 (\n id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n val JSON,\n /* other columns here */\n PRIMARY KEY (id)\n);\n\nAdd a unique constraint using JSON_NORMALIZE like this:\n\nALTER TABLE t1\n ADD COLUMN jnorm JSON AS (JSON_NORMALIZE(val)) VIRTUAL,\n ADD UNIQUE KEY (jnorm);\n\nWe can test this by first inserting a row as normal:\n\nINSERT INTO t1 (val) VALUES (\'{\"name\":\"alice\",\"color\":\"blue\"}\');\n\nAnd then seeing what happens with a different string which would produce the\nsame JSON object:\n\nINSERT INTO t1 (val) VALUES (\'{ \"color\": \"blue\", \"name\": \"alice\" }\');\nERROR 1062 (23000): Duplicate entry \'{\"color\":\"blue\",\"name\":\"alice\"}\' for key\n\'jnorm\'\n\nURL: https://mariadb.com/kb/en/json_normalize/','','https://mariadb.com/kb/en/json_normalize/'),
(768,'JSON_OVERLAPS',40,'MariaDB starting with 10.9\n--------------------------\nJSON_OVERLAPS was added in MariaDB 10.9.\n\nSyntax\n------\n\nJSON_OVERLAPS(json_doc1, json_doc2)\n\nDescription\n-----------\n\nJSON_OVERLAPS() compares two json documents and returns true if they have at\nleast one common key-value pair between two objects, array element common\nbetween two arrays, or array element common with scalar if one of the\narguments is a scalar and other is an array. If two json documents are\nscalars, it returns true if they have same type and value.\n\nIf none of the above conditions are satisfied then it returns false.\n\nExamples\n--------\n\nSELECT JSON_OVERLAPS(\'false\', \'false\');\n+---------------------------------+\n| JSON_OVERLAPS(\'false\', \'false\') |\n+---------------------------------+\n| 1                               |\n+---------------------------------+\n\nSELECT JSON_OVERLAPS(\'true\', \'[\"abc\", 1, 2, true, false]\');\n+----------------------------------------------------+\n| JSON_OVERLAPS(\'true\',\'[\"abc\", 1, 2, true, false]\') |\n+----------------------------------------------------+\n| 1                                                  |\n+----------------------------------------------------+\n\nSELECT JSON_OVERLAPS(\'{\"A\": 1, \"B\": {\"C\":2}}\', \'{\"A\": 2, \"B\": {\"C\":2}}\') AS\nis_overlap;\n+---------------------+\n| is_overlap          |\n+---------------------+\n| 1                   |\n+---------------------+\n\nPartial match is considered as no-match.\n\nExamples\n--------\n\nSELECT JSON_OVERLAPS(\'[1, 2, true, false, null]\', \'[3, 4, [1]]\') AS is_overlap;\n+--------------------- +\n| is_overlap           |\n+----------------------+\n| 0                    |\n+----------------------+\n\nURL: https://mariadb.com/kb/en/json_overlaps/','','https://mariadb.com/kb/en/json_overlaps/'),
(770,'JSON_QUERY',40,'Syntax\n------\n\nJSON_QUERY(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns an object or array specified by the path.\nReturns NULL if not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\', \'$.key1\');\n+-----------------------------------------------------+\n| json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\', \'$.key1\') |\n+-----------------------------------------------------+\n| {\"a\":1, \"b\":[1,2]}                                  |\n+-----------------------------------------------------+\n\nselect json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\', \'$.key1\') |\n+-------------------------------------------------------+\n| [1,2,3]                                               |\n+-------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_query/','','https://mariadb.com/kb/en/json_query/'),
(771,'JSON_QUOTE',40,'Syntax\n------\n\nJSON_QUOTE(json_value)\n\nDescription\n-----------\n\nQuotes a string as a JSON value, usually for producing valid JSON string\nliterals for inclusion in JSON documents. Wraps the string with double quote\ncharacters and escapes interior quotes and other special characters, returning\na utf8mb4 string.\n\nReturns NULL if the argument is NULL.\n\nExamples\n--------\n\nSELECT JSON_QUOTE(\'A\'), JSON_QUOTE(\"B\"), JSON_QUOTE(\'\"C\"\');\n+-----------------+-----------------+-------------------+\n| JSON_QUOTE(\'A\') | JSON_QUOTE(\"B\") | JSON_QUOTE(\'\"C\"\') |\n+-----------------+-----------------+-------------------+\n| \"A\"             | \"B\"             | \"\\\"C\\\"\"           |\n+-----------------+-----------------+-------------------+\n\nURL: https://mariadb.com/kb/en/json_quote/','','https://mariadb.com/kb/en/json_quote/'),
(772,'JSON_REMOVE',40,'Syntax\n------\n\nJSON_REMOVE(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nRemoves data from a JSON document returning the result, or NULL if any of the\narguments are null. If the element does not exist in the document, no changes\nare made.\n\nThe function returns NULL and throws a warning if the JSON document is\ninvalid, the path is invalid, contains a range, or contains a * or ** wildcard.\n\nPath arguments are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nExamples\n--------\n\nSELECT JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\');\n+-------------------------------------------------------+\n| JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\', \'$.C\') |\n+-------------------------------------------------------+\n| {\"A\": 1, \"B\": 2}                                      |\n+-------------------------------------------------------+\n\nSELECT JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"], \"E\"]\', \'$[1]\');\n+----------------------------------------------------+\n| JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"], \"E\"]\', \'$[1]\') |\n+----------------------------------------------------+\n| [\"A\", [\"C\", \"D\"], \"E\"]                             |\n+----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_remove/','','https://mariadb.com/kb/en/json_remove/'),
(773,'JSON_REPLACE',40,'Syntax\n------\n\nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nReplaces existing values in a JSON document, returning the result, or NULL if\nany of the arguments are NULL.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nPaths and values are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nJSON_REPLACE can only update data, while JSON_INSERT can only insert. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSELECT JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\', \'$.B[1]\', 4);\n+-----------------------------------------------------+\n| JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\', \'$.B[1]\', 4) |\n+-----------------------------------------------------+\n| { \"A\": 1, \"B\": [2, 4]}                              |\n+-----------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_replace/','','https://mariadb.com/kb/en/json_replace/'),
(774,'JSON_SCHEMA_VALID',40,'MariaDB starting with 11.1\n--------------------------\nJSON_SCHEMA_VALID was introduced in MariaDB 11.1.\n\nSyntax\n------\n\nJSON_SCHEMA_VALID(schema, json);\n\nDescription\n-----------\n\nJSON_SCHEMA_VALID allows MariaDB to support JSON schema validation. If a given\njson is valid against a schema it returns true. When JSON does not validate\nagainst the schema, it does not return a message about which keyword it failed\nagainst and only returns false.\n\nThe function supports JSON Schema Draft 2020 with a few exceptions:\n\n* External resources are not supported\n* Hyper schema keywords are not supported\n* Formats like date, email etc are treated as annotations.\n\nExamples\n--------\n\nTo create validation rules for json field\n\nCREATE TABLE obj_table(val_obj JSON CHECK(JSON_SCHEMA_VALID(\'{\n \"type\":\"object\",\n  \"properties\": {\n   \"number1\":{\n    \"type\":\"number\",\n    \"maximum\":5,\n    \"const\":4\n   },\n   \"string1\":{\n    \"type\":\"string\",\n    \"maxLength\":5,\n    \"minLength\":3\n   },\n  \"object1\":{\n   \"type\":\"object\",\n   \"properties\":{\n    \"key1\": {\"type\":\"string\"},\n    \"key2\":{\"type\":\"array\"},\n    \"key3\":{\"type\":\"number\", \"minimum\":3}\n   },\n   \"dependentRequired\": { \"key1\":[\"key3\"] }\n  }\n },\n \"required\":[\"number1\",\"object1\"]\n }\', val_obj)));\n\nINSERT INTO obj_table VALUES(\n \'{\"number1\":4, \"string1\":\"abcd\",\n \"object1\":{\"key1\":\"val1\", \"key2\":[1,2,3, \"string1\"], \"key3\":4}}\'\n);\n\nINSERT INTO obj_table VALUES(\n \'{\"number1\":3, \"string1\":\"abcd\",\n \"object1\":{\"key1\":\"val1\", \"key2\":[1,2,3, \"string1\"], \"key3\":4}}\'\n);\nERROR 4025 (23000): CONSTRAINT `obj_table.val_obj` failed for\n`test`.`obj_table`\n\nSELECT * FROM obj_table;\n+------------------------------------------------------------------------------\n-------------------+\n| val_obj                                                                     \n          |\n+------------------------------------------------------------------------------\n-------------------+\n| {\"number1\":4, \"string1\":\"abcd\", \"object1\":{\"key1\":\"val1\", \"key2\":[1,2,3,\n\"string1\"], \"key3\":4}} |\n+------------------------------------------------------------------------------\n-------------------+\n\nSET @schema= \'{\n \"properties\" : {\n  \"number1\":{ \"maximum\":10 },\n  \"string1\" : { \"maxLength\": 3}\n }\n}\';\n\nSELECT JSON_SCHEMA_VALID(@schema, \'{ \"number1\":25, \"string1\":\"ab\" }\');\n+----------------------------------------------------------------+\n| JSON_SCHEMA_VALID(@schema, \'{ \"number1\":25, \"string1\":\"ab\" }\') |\n+----------------------------------------------------------------+\n|                                                              0 |\n+----------------------------------------------------------------+\n\nSELECT JSON_SCHEMA_VALID(@schema, \'{ \"number1\":10, \"string1\":\"ab\" }\');\n+----------------------------------------------------------------+\n| JSON_SCHEMA_VALID(@schema, \'{ \"number1\":10, \"string1\":\"ab\" }\') |\n+----------------------------------------------------------------+\n|                                                              1 |\n+----------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_schema_valid/','','https://mariadb.com/kb/en/json_schema_valid/'),
(775,'JSON_SEARCH',40,'Syntax\n------\n\nJSON_SEARCH(json_doc, return_arg, search_str[, escape_char[, path] ...])\n\nDescription\n-----------\n\nReturns the path to the given string within a JSON document, or NULL if any of\njson_doc, search_str or a path argument is NULL; if the search string is not\nfound, or if no path exists within the document.\n\nA warning will occur if the JSON document is not valid, any of the path\narguments are not valid, if return_arg is neither one nor all, or if the\nescape character is not a constant. NULL will be returned.\n\nreturn_arg can be one of two values:\n\n* \'one: Terminates after finding the first match, so will return one path\nstring. If there is more than one match, it is undefined which is considered\nfirst.\n* all: Returns all matching path strings, without duplicates. Multiple strings\nare autowrapped as an array. The order is undefined.\n\nExamples\n--------\n\nSET @json = \'[\"A\", [{\"B\": \"1\"}], {\"C\":\"AB\"}, {\"D\":\"BC\"}]\';\n\nSELECT JSON_SEARCH(@json, \'one\', \'AB\');\n+---------------------------------+\n| JSON_SEARCH(@json, \'one\', \'AB\') |\n+---------------------------------+\n| \"$[2].C\"                        |\n+---------------------------------+\n\nURL: https://mariadb.com/kb/en/json_search/','','https://mariadb.com/kb/en/json_search/'),
(778,'JSON_TYPE',40,'Syntax\n------\n\nJSON_TYPE(json_val)\n\nDescription\n-----------\n\nReturns the type of a JSON value (as a string), or NULL if the argument is\nnull.\n\nAn error will occur if the argument is an invalid JSON value.\n\nThe following is a complete list of the possible return types:\n\n+-----------------------------------+-----------------+-----------------------+\n| Return type                       | Value           | Example               |\n+-----------------------------------+-----------------+-----------------------+\n| ARRAY                             | JSON array      | [1, 2, {\"key\":        |\n|                                   |                 | \"value\"}]             |\n+-----------------------------------+-----------------+-----------------------+\n| OBJECT                            | JSON object     | {\"key\":\"value\"}       |\n+-----------------------------------+-----------------+-----------------------+\n| BOOLEAN                           | JSON            | true, false           |\n|                                   | true/false      |                       |\n|                                   | literals        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| DOUBLE                            | A number with   | 1.2                   |\n|                                   | at least one    |                       |\n|                                   | floating point  |                       |\n|                                   | decimal.        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| INTEGER                           | A number        | 1                     |\n|                                   | without a       |                       |\n|                                   | floating point  |                       |\n|                                   | decimal.        |                       |\n+-----------------------------------+-----------------+-----------------------+\n| NULL                              | JSON null       | null                  |\n|                                   | literal (this   |                       |\n|                                   | is returned as  |                       |\n|                                   | a string, not   |                       |\n|                                   | to be confused  |                       |\n|                                   | with the SQL    |                       |\n|                                   | NULL value!)    |                       |\n+-----------------------------------+-----------------+-----------------------+\n| STRING                            | JSON String     | \"a sample string\"     |\n+-----------------------------------+-----------------+-----------------------+\n\nExamples\n--------\n\nSELECT JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\');\n+---------------------------------------+\n| JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\') |\n+---------------------------------------+\n| OBJECT                                |\n+---------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_type/','','https://mariadb.com/kb/en/json_type/'),
(779,'JSON_UNQUOTE',40,'Syntax\n------\n\nJSON_UNQUOTE(val)\n\nDescription\n-----------\n\nUnquotes a JSON value, returning a string, or NULL if the argument is null.\n\nAn error will occur if the given value begins and ends with double quotes and\nis an invalid JSON string literal.\n\nIf the given value is not a JSON string, value is passed through unmodified.\n\nCertain character sequences have special meanings within a string. Usually, a\nbackslash is ignored, but the escape sequences in the table below are\nrecognised by MariaDB, unless the SQL Mode is set to NO_BACKSLASH_ESCAPES SQL.\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence                               | Character                   |\n+-----------------------------------------------+-----------------------------+\n| \\\"                                            | Double quote (\")            |\n+-----------------------------------------------+-----------------------------+\n| \\b                                            | Backslash                   |\n+-----------------------------------------------+-----------------------------+\n| \\f                                            | Formfeed                    |\n+-----------------------------------------------+-----------------------------+\n| \\n                                            | Newline (linefeed)          |\n+-----------------------------------------------+-----------------------------+\n| \\r                                            | Carriage return             |\n+-----------------------------------------------+-----------------------------+\n| \\t                                            | Tab                         |\n+-----------------------------------------------+-----------------------------+\n| \\\\                                            | Backslash (\\)               |\n+-----------------------------------------------+-----------------------------+\n| \\uXXXX                                        | UTF-8 bytes for Unicode     |\n|                                               | value XXXX                  |\n+-----------------------------------------------+-----------------------------+\n\nExamples\n--------\n\nSELECT JSON_UNQUOTE(\'\"Monty\"\');\n+-------------------------+\n| JSON_UNQUOTE(\'\"Monty\"\') |\n+-------------------------+\n| Monty                   |\n+-------------------------+\n\nWith the default SQL Mode:\n\nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Sng	ing                   |\n+-----------------------------+\n\nSetting NO_BACKSLASH_ESCAPES:\n\nSET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\n\nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Si\\bng\\ting                 |\n+-----------------------------+\n\nURL: https://mariadb.com/kb/en/json_unquote/','','https://mariadb.com/kb/en/json_unquote/'),
(777,'JSON_TABLE',40,'MariaDB starting with 10.6.0\n----------------------------\nJSON_TABLE was added in MariaDB 10.6.0.\n\nJSON_TABLE is a table function that converts JSON data into a relational form.\n\nSyntax\n------\n\nJSON_TABLE(json_doc, \n     context_path COLUMNS (column_list)\n) [AS] alias\n\ncolumn_list:\n  column[, column][, ...]\n\ncolumn:\n  name FOR ORDINALITY\n  |  name type PATH path_str [on_empty] [on_error]\n  |  name type EXISTS PATH path_str\n  |  NESTED PATH path_str COLUMNS (column_list)\n\non_empty:\n  {NULL | DEFAULT string | ERROR} ON EMPTY\n\non_error:\n  {NULL | DEFAULT string | ERROR} ON ERROR\n\nDescription\n-----------\n\nJSON_TABLE can be used in contexts where a table reference can be used; in the\nFROM clause of a SELECT statement, and in multi-table UPDATE/DELETE statements.\n\njson_doc is the JSON document to extract data from. In the simplest case, it\nis a string literal containing JSON. In more complex cases it can be an\narbitrary expression returning JSON. The expression may have references to\ncolumns of other tables. However, one can only refer to tables that precede\nthis JSON_TABLE invocation. For RIGHT JOIN, it is assumed that its outer side\nprecedes the inner. All tables in outer selects are also considered preceding.\n\ncontext_path is a JSON Path expression pointing to a collection of nodes in\njson_doc that will be used as the source of rows.\n\nThe COLUMNS clause declares the names and types of the columns that JSON_TABLE\nreturns, as well as how the values of the columns are produced.\n\nColumn Definitions\n------------------\n\nThe following types of columns are supported:\n\nPath Columns\n------------\n\nname type PATH path_str [on_empty] [on_error]\n\nLocates the JSON node pointed to by path_str and returns its value. The\npath_str is evaluated using the current row source node as the context node.\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\", \"price\":\"1000\"},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n name  varchar(10) path \'$.name\',\n color varchar(10) path \'$.color\',\n price decimal(8,2) path \'$.price\' )\n) as jt;\n+--------+-------+---------+\n| name   | color | price   |\n+--------+-------+---------+\n| Laptop | black | 1000.00 |\n| Jeans  | blue  |    NULL |\n+--------+-------+---------+\n\nThe on_empty and on_error clauses specify the actions to be performed when the\nvalue was not found or there was an error condition. See the ON EMPTY and ON\nERROR clauses section for details.\n\nORDINALITY Columns\n------------------\n\nname FOR ORDINALITY\n\nCounts the rows, starting from 1.\n\nExample:\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\"},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n id for ordinality,\n name  varchar(10) path \'$.name\')\n) as jt;\n+------+--------+\n| id   | name   |\n+------+--------+\n|    1 | Laptop |\n|    2 | Jeans  |\n+------+--------+\n\nEXISTS PATH Columns\n-------------------\n\nname type EXISTS PATH path_str\n\nChecks whether the node pointed to by value_path exists. The value_path is\nevaluated using the current row source node as the context node.\n\nset @json=\'\n[\n {\"name\":\"Laptop\", \"color\":\"black\", \"price\":1000},\n {\"name\":\"Jeans\",  \"color\":\"blue\"}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n name  varchar(10) path \'$.name\',\n has_price integer exists path \'$.price\')\n) as jt;\n+--------+-----------+\n| name   | has_price |\n+--------+-----------+\n| Laptop |         1 |\n| Jeans  |         0 |\n+--------+-----------+\n\nNESTED PATHs\n------------\n\nNESTED PATH converts nested JSON structures into multiple rows.\n\nNESTED PATH path COLUMNS (column_list)\n\nIt finds the sequence of JSON nodes pointed to by path and uses it to produce\nrows. For each found node, a row is generated with column values as specified\nby the NESTED PATH\'s COLUMNS clause. If path finds no nodes, only one row is\ngenerated with all columns having NULL values.\n\nFor example, consider a JSON document that contains an array of items, and\neach item, in turn, is expected to have an array of its available sizes:\n\nset @json=\'\n[\n {\"name\":\"Jeans\",  \"sizes\": [32, 34, 36]},\n {\"name\":\"T-Shirt\", \"sizes\":[\"Medium\", \"Large\"]},\n {\"name\":\"Cellphone\"}\n]\';\n\nNESTED PATH allows one to produce a separate row for each size each item has:\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n  name  varchar(10) path \'$.name\',\n  nested path \'$.sizes[*]\' columns (\n   size varchar(32) path \'$\'\n  )\n )\n) as jt;\n+-----------+--------+\n| name      | size   |\n+-----------+--------+\n| Jeans     | 32     |\n| Jeans     | 34     |\n| Jeans     | 36     |\n| T-Shirt   | Medium |\n| T-Shirt   | Large  |\n| Cellphone | NULL   |\n+-----------+--------+\n\nNESTED PATH clauses can be nested within one another. They can also be located\nnext to each other. In that case, the nested path clauses will produce records\none at a time. The ones that are not producing records will have all columns\nset to NULL.\n\nExample:\n\nset @json=\'\n[\n {\"name\":\"Jeans\",  \"sizes\": [32, 34, 36], \"colors\":[\"black\", \"blue\"]}\n]\';\n\nselect * from json_table(@json, \'$[*]\' \n columns(\n  name  varchar(10) path \'$.name\',\n  nested path \'$.sizes[*]\' columns (\n   size varchar(32) path \'$\'\n  ),\n  nested path \'$.colors[*]\' columns (\n   color varchar(32) path \'$\'\n  )\n )\n) as jt;\n\n+-------+------+-------+\n| name  | size | color |\n+-------+------+-------+\n| Jeans | 32   | NULL  |\n| Jeans | 34   | NULL  |\n| Jeans | 36   | NULL  |\n| Jeans | NULL | black |\n| Jeans | NULL | blue  |\n+-------+------+-------+\n\nON EMPTY and ON ERROR Clauses\n-----------------------------\n\nThe ON EMPTY clause specifies what will be done when the element specified by\nthe search path is missing in the JSON document.\n\non_empty:\n  {NULL | DEFAULT string | ERROR} ON EMPTY\n\nWhen ON EMPTY clause is not present, NULL ON EMPTY is implied.\n\non_error:\n  {NULL | DEFAULT string | ERROR} ON ERROR\n\nThe ON ERROR clause specifies what should be done if a JSON structure error\noccurs when trying to extract the value pointed to by the path expression. A\nJSON structure error here occurs only when one attempts to convert a JSON\nnon-scalar (array or object) into a scalar value. When the ON ERROR clause is\nnot present, NULL ON ERROR is implied.\n\nNote: A datatype conversion error (e.g. attempt to store a non-integer value\ninto an integer field, or a varchar column being truncated) is not considered\na JSON error and so will not trigger the ON ERROR behavior. It will produce\nwarnings, in the same way as CAST(value AS datatype) would.\n\nReplication\n-----------\n\nIn the current code, evaluation of JSON_TABLE is deterministic, that is, for a\ngiven input string JSON_TABLE will always produce the same set of rows in the\nsame order. However, one can think of JSON documents that one can consider\nidentical which will produce different output. In order to be future-proof and\nwithstand changes like:\n\n* sorting JSON object members by name (like MySQL does)\n* changing the way duplicate object members are handled\nthe function is marked as unsafe for statement-based replication.\n\nExtracting a Subdocument into a Column\n--------------------------------------\n\nMariaDB starting with 10.6.9\n----------------------------\nPrior to MariaDB 10.6.9, JSON_TABLE did not allow one to extract a JSON\n\"subdocument\" into a JSON column.\n\nSELECT * FROM JSON_TABLE(\'{\"foo\": [1,2,3,4]}\',\'$\' columns( jscol json path\n\'$.foo\') ) AS T;\n+-------+\n| jscol |\n+-------+\n| NULL  |\n+-------+\n\nThis is supported from MariaDB 10.6.9:\n\nSELECT * FROM JSON_TABLE(\'{\"foo\": [1,2,3,4]}\',\'$\' columns( jscol json path\n\'$.foo\') ) AS T;\n+-----------+\n| jscol     |\n+-----------+\n| [1,2,3,4] |\n+-----------+\n\nURL: https://mariadb.com/kb/en/json_table/','','https://mariadb.com/kb/en/json_table/'),
(780,'JSON_VALID',40,'Syntax\n------\n\nJSON_VALID(value)\n\nDescription\n-----------\n\nIndicates whether the given value is a valid JSON document or not. Returns 1\nif valid, 0 if not, and NULL if the argument is NULL.\n\nFrom MariaDB 10.4.3, the JSON_VALID function is automatically used as a CHECK\nconstraint for the JSON data type alias in order to ensure that a valid json\ndocument is inserted.\n\nExamples\n--------\n\nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\');\n+------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\') |\n+------------------------------------------+\n|                                        1 |\n+------------------------------------------+\n\nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\", \"oddfield\"}\');\n+------------------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\", \"oddfield\"}\') |\n+------------------------------------------------------+\n|                                                    0 |\n+------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/json_valid/','','https://mariadb.com/kb/en/json_valid/'),
(781,'JSON_VALUE',40,'Syntax\n------\n\nJSON_VALUE(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns the scalar specified by the path. Returns NULL\nif not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_value(\'{\"key1\":123}\', \'$.key1\');\n+--------------------------------------+\n| json_value(\'{\"key1\":123}\', \'$.key1\') |\n+--------------------------------------+\n| 123                                  |\n+--------------------------------------+\n\nselect json_value(\'{\"key1\": [1,2,3], \"key1\":123}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_value(\'{\"key1\": [1,2,3], \"key1\":123}\', \'$.key1\') |\n+-------------------------------------------------------+\n| 123                                                   |\n+-------------------------------------------------------+\n\nIn the SET statement below, two escape characters are needed, as a single\nescape character would be applied by the SQL parser in the SET statement, and\nthe escaped character would not form part of the saved value.\n\nSET @json = \'{\"key1\":\"60\\\\\" Table\", \"key2\":\"1\"}\';\n\nSELECT JSON_VALUE(@json,\'$.key1\') AS Name , json_value(@json,\'$.key2\') as ID;\n+-----------+------+\n| Name      | ID   |\n+-----------+------+\n| 60\" Table | 1    |\n+-----------+------+\n\nURL: https://mariadb.com/kb/en/json_value/','','https://mariadb.com/kb/en/json_value/'),
(784,'DENSE_RANK',41,'Syntax\n------\n\nDENSE_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nDENSE_RANK() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving the same result. Unlike the RANK() function,\nthere are no skipped values if the preceding results are identical. It is also\nsimilar to the ROW_NUMBER() function except that in that function, identical\nvalues will receive a different row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/dense_rank/','','https://mariadb.com/kb/en/dense_rank/'),
(786,'LAG',41,'Syntax\n------\n\nLAG (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ]\n < ORDER BY order_list >\n)\n\nDescription\n-----------\n\nThe LAG function accesses data from a previous row according to the ORDER BY\nclause without the need for a self-join. The specific row is determined by the\noffset (default 1), which specifies the number of rows behind the current row\nto use. An offset of 0 is the current row.\n\nExamples\n--------\n\nCREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10,\n3), e real);\n\nINSERT INTO t1 VALUES\n ( 1, 0, 1,    \'one\',    0.1,  0.001),\n ( 2, 0, 2,    \'two\',    0.2,  0.002),\n ( 3, 0, 3,    \'three\',  0.3,  0.003),\n ( 4, 1, 2,    \'three\',  0.4,  0.004),\n ( 5, 1, 1,    \'two\',    0.5,  0.005),\n ( 6, 1, 1,    \'one\',    0.6,  0.006),\n ( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n ( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n ( 9, 2, 2,    NULL,     0.7,  0.009),\n (10, 2, 0,    \'n_four\', 0.8,  0.010),\n (11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, LAG(pk) OVER (ORDER BY pk) AS l,\n LAG(pk,1) OVER (ORDER BY pk) AS l1,\n LAG(pk,2) OVER (ORDER BY pk) AS l2,\n LAG(pk,0) OVER (ORDER BY pk) AS l0,\n LAG(pk,-1) OVER (ORDER BY pk) AS lm1,\n LAG(pk,-2) OVER (ORDER BY pk) AS lm2\nFROM t1;\n+----+------+------+------+------+------+------+\n| pk | l    | l1   | l2   | l0   | lm1  | lm2  |\n+----+------+------+------+------+------+------+\n|  1 | NULL | NULL | NULL |    1 |    2 |    3 |\n|  2 |    1 |    1 | NULL |    2 |    3 |    4 |\n|  3 |    2 |    2 |    1 |    3 |    4 |    5 |\n|  4 |    3 |    3 |    2 |    4 |    5 |    6 |\n|  5 |    4 |    4 |    3 |    5 |    6 |    7 |\n|  6 |    5 |    5 |    4 |    6 |    7 |    8 |\n|  7 |    6 |    6 |    5 |    7 |    8 |    9 |\n|  8 |    7 |    7 |    6 |    8 |    9 |   10 |\n|  9 |    8 |    8 |    7 |    9 |   10 |   11 |\n| 10 |    9 |    9 |    8 |   10 |   11 | NULL |\n| 11 |   10 |   10 |    9 |   11 | NULL | NULL |\n+----+------+------+------+------+------+------+\n\nURL: https://mariadb.com/kb/en/lag/','','https://mariadb.com/kb/en/lag/'),
(783,'CUME_DIST',41,'Syntax\n------\n\nCUME_DIST() OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nCUME_DIST() is a window function that returns the cumulative distribution of a\ngiven row. The following formula is used to calculate the value:\n\n(number of rows <= current row) / (total rows)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n  rank() over (order by a) as rank,\n  percent_rank() over (order by a) as pct_rank,\n  cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a    | b    | rank | pct_rank     | cume_dist    |\n+----+------+------+------+--------------+--------------+\n|  1 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  2 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  3 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  4 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  5 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  6 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  7 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  8 |    2 |   10 |    5 | 0.4444444444 | 0.8000000000 |\n|  9 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n| 10 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n   percent_rank() over (order by pk) as pct_rank,\n   cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 0.1000000000 |\n|  2 |    0 |   10 | 0.1111111111 | 0.2000000000 |\n|  3 |    1 |   10 | 0.2222222222 | 0.3000000000 |\n|  4 |    1 |   10 | 0.3333333333 | 0.4000000000 |\n|  5 |    2 |   20 | 0.4444444444 | 0.5000000000 |\n|  6 |    2 |   20 | 0.5555555556 | 0.6000000000 |\n|  7 |    2 |   20 | 0.6666666667 | 0.7000000000 |\n|  8 |    2 |   10 | 0.7777777778 | 0.8000000000 |\n|  9 |    4 |   20 | 0.8888888889 | 0.9000000000 |\n| 10 |    4 |   20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n    percent_rank() over (partition by a order by a) as pct_rank,\n    cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  2 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  3 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  4 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  5 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  6 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  7 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  8 |    2 |   10 | 0.0000000000 | 1.0000000000 |\n|  9 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n| 10 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nURL: https://mariadb.com/kb/en/cume_dist/','','https://mariadb.com/kb/en/cume_dist/'),
(787,'LEAD',41,'Syntax\n------\n\nLEAD (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nThe LEAD function accesses data from a following row in the same result set\nwithout the need for a self-join. The specific row is determined by the offset\n(default 1), which specifies the number of rows ahead the current row to use.\nAn offset of 0 is the current row.\n\nExample\n-------\n\nCREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10,\n3), e real);\n\nINSERT INTO t1 VALUES\n ( 1, 0, 1,    \'one\',    0.1,  0.001),\n ( 2, 0, 2,    \'two\',    0.2,  0.002),\n ( 3, 0, 3,    \'three\',  0.3,  0.003),\n ( 4, 1, 2,    \'three\',  0.4,  0.004),\n ( 5, 1, 1,    \'two\',    0.5,  0.005),\n ( 6, 1, 1,    \'one\',    0.6,  0.006),\n ( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n ( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n ( 9, 2, 2,    NULL,     0.7,  0.009),\n (10, 2, 0,    \'n_four\', 0.8,  0.010),\n (11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, LEAD(pk) OVER (ORDER BY pk) AS l,\n LEAD(pk,1) OVER (ORDER BY pk) AS l1,\n LEAD(pk,2) OVER (ORDER BY pk) AS l2,\n LEAD(pk,0) OVER (ORDER BY pk) AS l0,\n LEAD(pk,-1) OVER (ORDER BY pk) AS lm1,\n LEAD(pk,-2) OVER (ORDER BY pk) AS lm2\nFROM t1;\n+----+------+------+------+------+------+------+\n| pk | l    | l1   | l2   | l0   | lm1  | lm2  |\n+----+------+------+------+------+------+------+\n|  1 |    2 |    2 |    3 |    1 | NULL | NULL |\n|  2 |    3 |    3 |    4 |    2 |    1 | NULL |\n|  3 |    4 |    4 |    5 |    3 |    2 |    1 |\n|  4 |    5 |    5 |    6 |    4 |    3 |    2 |\n|  5 |    6 |    6 |    7 |    5 |    4 |    3 |\n|  6 |    7 |    7 |    8 |    6 |    5 |    4 |\n|  7 |    8 |    8 |    9 |    7 |    6 |    5 |\n|  8 |    9 |    9 |   10 |    8 |    7 |    6 |\n|  9 |   10 |   10 |   11 |    9 |    8 |    7 |\n| 10 |   11 |   11 | NULL |   10 |    9 |    8 |\n| 11 | NULL | NULL | NULL |   11 |   10 |    9 |\n+----+------+------+------+------+------+------+\n\nURL: https://mariadb.com/kb/en/lead/','','https://mariadb.com/kb/en/lead/'),
(785,'FIRST_VALUE',41,'Syntax\n------\n\nFIRST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nFIRST_VALUE returns the first result from an ordered set, or NULL if no such\nresult exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1,    \'one\',    0.1,  0.001),\n( 2, 0, 2,    \'two\',    0.2,  0.002),\n( 3, 0, 3,    \'three\',  0.3,  0.003),\n( 4, 1, 2,    \'three\',  0.4,  0.004),\n( 5, 1, 1,    \'two\',    0.5,  0.005),\n( 6, 1, 1,    \'one\',    0.6,  0.006),\n( 7, 2, NULL, \'n_one\',  0.5,  0.007),\n( 8, 2, 1,    \'n_two\',  NULL, 0.008),\n( 9, 2, 2,    NULL,     0.7,  0.009),\n(10, 2, 0,    \'n_four\', 0.8,  0.010),\n(11, 2, 10,   NULL,     0.9,  NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n     LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n     FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n     LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 |         1 |       11 |         11 |        11 |\n| 10 |         1 |       10 |         11 |        10 |\n|  9 |         1 |        9 |         11 |         9 |\n|  8 |         1 |        8 |         11 |         8 |\n|  7 |         1 |        7 |         11 |         7 |\n|  6 |         1 |        6 |         11 |         6 |\n|  5 |         1 |        5 |         11 |         5 |\n|  4 |         1 |        4 |         11 |         4 |\n|  3 |         1 |        3 |         11 |         3 |\n|  2 |         1 |        2 |         11 |         2 |\n|  1 |         1 |        1 |         11 |         1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nl_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nl_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nl_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i    | f_1f | l_1f | f_1p1f | l_1p1f | f_2p1p | l_2p1p | f_1f2f | l_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n|    1 |    1 |    2 |      1 |      2 |   NULL |   NULL |      2 |      3 |\n|    2 |    2 |    3 |      1 |      3 |      1 |      1 |      3 |      4 |\n|    3 |    3 |    4 |      2 |      4 |      1 |      2 |      4 |      5 |\n|    4 |    4 |    5 |      3 |      5 |      2 |      3 |      5 |      6 |\n|    5 |    5 |    6 |      4 |      6 |      3 |      4 |      6 |      7 |\n|    6 |    6 |    7 |      5 |      7 |      4 |      5 |      7 |      8 |\n|    7 |    7 |    8 |      6 |      8 |      5 |      6 |      8 |      9 |\n|    8 |    8 |    9 |      7 |      9 |      6 |      7 |      9 |     10 |\n|    9 |    9 |   10 |      8 |     10 |      7 |      8 |     10 |     10 |\n|   10 |   10 |   10 |      9 |     10 |      8 |      9 |   NULL |   NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\nURL: https://mariadb.com/kb/en/first_value/','','https://mariadb.com/kb/en/first_value/'),
(788,'Median Window Function',41,'MariaDB starting with 10.3.3\n----------------------------\nThe MEDIAN() window function was first introduced with in MariaDB 10.3.3.\n\nSyntax\n------\n\nMEDIAN(median expression) OVER (\n [ PARTITION BY partition_expression ]\n)\n\nDescription\n-----------\n\nMEDIAN() is a window function that returns the median value of a range of\nvalues.\n\nIt is a specific case of PERCENTILE_CONT, with an argument of 0.5 and the\nORDER BY column the one in MEDIAN\'s argument.\n\nMEDIAN(<median-arg>) OVER ( [ PARTITION BY partition_expression] )\n\nIs equivalent to:\n\nPERCENTILE_CONT(0.5) WITHIN \n GROUP (ORDER BY <median-arg>) OVER ( [ PARTITION BY partition_expression ])\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, median(star_rating) OVER (PARTITION BY name) FROM book_rating;\n+-----------------------+----------------------------------------------+\n| name                  | median(star_rating) OVER (PARTITION BY name) |\n+-----------------------+----------------------------------------------+\n| Lord of the Ladybirds |                                 4.0000000000 |\n| Lord of the Ladybirds |                                 4.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n| Lady of the Flies     |                                 2.0000000000 |\n+-----------------------+----------------------------------------------+\n\nURL: https://mariadb.com/kb/en/median/','','https://mariadb.com/kb/en/median/'),
(790,'NTILE',41,'Syntax\n------\n\nNTILE (expr) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nNTILE() is a window function that returns an integer indicating which group a\ngiven row falls into. The number of groups is specified in the argument\n(expr), starting at one. Ordered rows in the partition are divided into the\nspecified number of groups with as equal a size as possible.\n\nExamples\n--------\n\ncreate table t1 (\n  pk int primary key,\n  a int,\n  b int\n );\n\ninsert into t1 values\n  (11 , 0, 10),\n  (12 , 0, 10),\n  (13 , 1, 10),\n  (14 , 1, 10),\n  (18 , 2, 10),\n  (15 , 2, 20),\n  (16 , 2, 20),\n  (17 , 2, 20),\n  (19 , 4, 20),\n  (20 , 4, 20);\n\nselect pk, a, b,\n  ntile(1) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a    | b    | ntile(1) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 |    0 |   10 |                           1 |\n| 12 |    0 |   10 |                           1 |\n| 13 |    1 |   10 |                           1 |\n| 14 |    1 |   10 |                           1 |\n| 15 |    2 |   20 |                           1 |\n| 16 |    2 |   20 |                           1 |\n| 17 |    2 |   20 |                           1 |\n| 18 |    2 |   10 |                           1 |\n| 19 |    4 |   20 |                           1 |\n| 20 |    4 |   20 |                           1 |\n+----+------+------+-----------------------------+\n\nselect pk, a, b,\n  ntile(4) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a    | b    | ntile(4) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 |    0 |   10 |                           1 |\n| 12 |    0 |   10 |                           1 |\n| 13 |    1 |   10 |                           1 |\n| 14 |    1 |   10 |                           2 |\n| 15 |    2 |   20 |                           2 |\n| 16 |    2 |   20 |                           2 |\n| 17 |    2 |   20 |                           3 |\n| 18 |    2 |   10 |                           3 |\n| 19 |    4 |   20 |                           4 |\n| 20 |    4 |   20 |                           4 |\n+----+------+------+-----------------------------+\n\nURL: https://mariadb.com/kb/en/ntile/','','https://mariadb.com/kb/en/ntile/'),
(791,'PERCENT_RANK',41,'Syntax\n------\n\nPERCENT_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nPERCENT_RANK() is a window function that returns the relative percent rank of\na given row. The following formula is used to calculate the percent rank:\n\n(rank - 1) / (number of rows in the window or partition - 1)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n  rank() over (order by a) as rank,\n  percent_rank() over (order by a) as pct_rank,\n  cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a    | b    | rank | pct_rank     | cume_dist    |\n+----+------+------+------+--------------+--------------+\n|  1 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  2 |    0 |   10 |    1 | 0.0000000000 | 0.2000000000 |\n|  3 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  4 |    1 |   10 |    3 | 0.2222222222 | 0.4000000000 |\n|  5 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  6 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  7 |    2 |   20 |    5 | 0.4444444444 | 0.8000000000 |\n|  8 |    2 |   10 |    5 | 0.4444444444 | 0.8000000000 |\n|  9 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n| 10 |    4 |   20 |    9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n   percent_rank() over (order by pk) as pct_rank,\n   cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 0.1000000000 |\n|  2 |    0 |   10 | 0.1111111111 | 0.2000000000 |\n|  3 |    1 |   10 | 0.2222222222 | 0.3000000000 |\n|  4 |    1 |   10 | 0.3333333333 | 0.4000000000 |\n|  5 |    2 |   20 | 0.4444444444 | 0.5000000000 |\n|  6 |    2 |   20 | 0.5555555556 | 0.6000000000 |\n|  7 |    2 |   20 | 0.6666666667 | 0.7000000000 |\n|  8 |    2 |   10 | 0.7777777778 | 0.8000000000 |\n|  9 |    4 |   20 | 0.8888888889 | 0.9000000000 |\n| 10 |    4 |   20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n    percent_rank() over (partition by a order by a) as pct_rank,\n    cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a    | b    | pct_rank     | cume_dist    |\n+----+------+------+--------------+--------------+\n|  1 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  2 |    0 |   10 | 0.0000000000 | 1.0000000000 |\n|  3 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  4 |    1 |   10 | 0.0000000000 | 1.0000000000 |\n|  5 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  6 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  7 |    2 |   20 | 0.0000000000 | 1.0000000000 |\n|  8 |    2 |   10 | 0.0000000000 | 1.0000000000 |\n|  9 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n| 10 |    4 |   20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nURL: https://mariadb.com/kb/en/percent_rank/','','https://mariadb.com/kb/en/percent_rank/'),
(792,'PERCENTILE_CONT',41,'MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_CONT() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_CONT() (standing for continuous percentile) is a window function\nwhich returns a value which corresponds to the given fraction in the sort\norder. If required, it will interpolate between adjacent input items.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition, denoted by N\n* RN = p*(N-1), where p denotes the argument to the PERCENTILE_CONT function\n* calculate the FRN(floor row number) and CRN(column row number for the group(\nFRN= floor(RN) and CRN = ceil(RN))\n* look up rows FRN and CRN\n* If (CRN = FRN = RN) then the result is (value of expression from row at RN)\n* Otherwise the result is\n* (CRN - RN) * (value of expression for row at FRN) +\n* (RN - FRN) * (value of expression for row at CRN)\n\nThe MEDIAN function is a specific case of PERCENTILE_CONT, equivalent to\nPERCENTILE_CONT(0.5).\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n| Lady of the Flies     | 2.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 5.0000000000 |\n| Lord of the Ladybirds | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n| Lady of the Flies     | 5.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 3.0000000000 |\n| Lord of the Ladybirds | 3.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n| Lady of the Flies     | 1.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name                  | pc           |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.2000000000 |\n| Lord of the Ladybirds | 4.2000000000 |\n| Lady of the Flies     | 2.6000000000 |\n| Lady of the Flies     | 2.6000000000 |\n| Lady of the Flies     | 2.6000000000 |\n+-----------------------+--------------+\n\nURL: https://mariadb.com/kb/en/percentile_cont/','','https://mariadb.com/kb/en/percentile_cont/'),
(793,'PERCENTILE_DISC',41,'MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_DISC() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_DISC() (standing for discrete percentile) is a window function\nwhich returns the first value in the set whose ordered position is the same or\nmore than the specified fraction.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition.\n* Walk through the partition, in order, until finding the the first row with\nCUME_DIST() >= function_argument.\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY star_rating)\n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    3 |\n| Lord of the Ladybirds |    3 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    3 |\n| Lord of the Ladybirds |    3 |\n| Lady of the Flies     |    1 |\n| Lady of the Flies     |    1 |\n| Lady of the Flies     |    1 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    5 |\n| Lord of the Ladybirds |    5 |\n| Lady of the Flies     |    5 |\n| Lady of the Flies     |    5 |\n| Lady of the Flies     |    5 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name                  | pc   |\n+-----------------------+------+\n| Lord of the Ladybirds |    5 |\n| Lord of the Ladybirds |    5 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n| Lady of the Flies     |    2 |\n+-----------------------+------\n\nURL: https://mariadb.com/kb/en/percentile_disc/','','https://mariadb.com/kb/en/percentile_disc/'),
(794,'RANK',41,'Syntax\n------\n\nRANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nRANK() is a window function that displays the number of a given row, starting\nat one and following the ORDER BY sequence of the window function, with\nidentical values receiving the same result. It is similar to the ROW_NUMBER()\nfunction except that in that function, identical values will receive a\ndifferent row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/rank/','','https://mariadb.com/kb/en/rank/'),
(795,'ROW_NUMBER',41,'Syntax\n------\n\nROW_NUMBER() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nROW_NUMBER() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving different row numbers. It is similar to the\nRANK() and DENSE_RANK() functions except that in that function, identical\nvalues will receive the same rank for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course  | mark | name    |\n+------+------------+---------+---------+------+---------+\n|    1 |          1 |       1 | Biology |   70 | Roger   |\n|    2 |          2 |       2 | Biology |   60 | Bilal   |\n|    1 |          1 |       1 | Maths   |   70 | Voitto  |\n|    2 |          2 |       2 | Maths   |   60 | Thulile |\n|    2 |          2 |       3 | Maths   |   60 | Pritha  |\n|    4 |          3 |       4 | Maths   |   55 | Chun    |\n+------+------------+---------+---------+------+---------+\n\nURL: https://mariadb.com/kb/en/row_number/','','https://mariadb.com/kb/en/row_number/'),
(799,'SPIDER_BG_DIRECT_SQL',42,'Syntax\n------\n\nSPIDER_BG_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nExecutes the given SQL statement in the background on the remote server, as\ndefined in the parameters listing. If the query returns a result-set, it\nsttores the results in the given temporary table. When the given SQL statement\nexecutes successfully, this function returns the number of called UDF\'s. It\nreturns 0 when the given SQL statement fails.\n\nThis function is a UDF installed with the Spider storage engine.\n\nExamples\n--------\n\nSELECT SPIDER_BG_DIRECT_SQL(\'SELECT * FROM example_table\',  \'\', \n \'srv \"node1\", port \"8607\"\') AS \"Direct Query\";\n+--------------+\n| Direct Query | \n+--------------+\n|            1 |\n+--------------+\n\nParameters\n----------\n\nerror_rw_mode\n-------------\n\n* Description: Returns empty results on network error.\n0 : Return error on getting network error.\n1: Return 0 records on getting network error.\n\n* Default Table Value: 0\n* DSN Parameter Name: erwm\n\nURL: https://mariadb.com/kb/en/spider_bg_direct_sql/','','https://mariadb.com/kb/en/spider_bg_direct_sql/'),
(800,'SPIDER_COPY_TABLES',42,'Syntax\n------\n\nSPIDER_COPY_TABLES(spider_table_name, \n source_link_id, destination_link_id_list [,parameters])\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function copies table\ndata from source_link_id to destination_link_id_list. The service does not\nneed to be stopped in order to copy.\n\nIf the Spider table is partitioned, the name must be of the format\ntable_name#P#partition_name. The partition name can be viewed in the\nmysql.spider_tables table, for example:\n\nSELECT table_name FROM mysql.spider_tables;\n+-------------+\n| table_name  |\n+-------------+\n| spt_a#P#pt1 |\n| spt_a#P#pt2 |\n| spt_a#P#pt3 |\n+-------------+\n\nReturns 1 if the data was copied successfully, or 0 if copying the data failed.\n\nURL: https://mariadb.com/kb/en/spider_copy_tables/','','https://mariadb.com/kb/en/spider_copy_tables/'),
(798,'Window Frames',41,'Syntax\n------\n\nframe_clause:\n {ROWS | RANGE} {frame_border | BETWEEN frame_border AND frame_border}\n\nframe_border:\n | UNBOUNDED PRECEDING\n | UNBOUNDED FOLLOWING\n | CURRENT ROW\n | expr PRECEDING\n | expr FOLLOWING\n\nDescription\n-----------\n\nA basic overview of window functions is described in Window Functions\nOverview. Window frames expand this functionality by allowing the function to\ninclude a specified a number of rows around the current row.\n\nThese include:\n\n* All rows before the current row (UNBOUNDED PRECEDING), for example RANGE\nBETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\n* All rows after the current row (UNBOUNDED FOLLOWING), for example RANGE\nBETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING\n* A set number of rows before the current row (expr PRECEDING) for example\nRANGE BETWEEN 6 PRECEDING AND CURRENT ROW\n* A set number of rows after the current row (expr PRECEDING AND expr\nFOLLOWING)  for example RANGE BETWEEN CURRENT ROW AND 2 FOLLOWING\n* A specified number of rows both before and after the current row, for\nexample RANGE BETWEEN 6 PRECEDING AND 3 FOLLOWING\n\nThe following functions operate on window frames:\n\n* AVG\n* BIT_AND\n* BIT_OR\n* BIT_XOR\n* COUNT\n* LEAD\n* MAX\n* MIN\n* NTILE\n* STD\n* STDDEV\n* STDDEV_POP\n* STDDEV_SAMP\n* SUM\n* VAR_POP\n* VAR_SAMP\n* VARIANCE\n\nWindow frames are determined by the frame_clause in the window function\nrequest.\n\nTake the following example:\n\nCREATE TABLE `student_test` (\n name char(10),\n test char(10),\n score tinyint(4)\n);\n\nINSERT INTO student_test VALUES \n  (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n  (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n  (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n  (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, SUM(score) \n OVER () AS total_score\n FROM student_test;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Chun    | SQL    |    75 |         453 |\n| Chun    | Tuning |    73 |         453 |\n| Esben   | SQL    |    43 |         453 |\n| Esben   | Tuning |    31 |         453 |\n| Kaolin  | SQL    |    56 |         453 |\n| Kaolin  | Tuning |    88 |         453 |\n| Tatiana | SQL    |    87 |         453 |\n+---------+--------+-------+-------------+\n\nBy not specifying an OVER clause, the SUM function is run over the entire\ndataset. However, if we specify an ORDER BY condition based on score (and\norder the entire result in the same way for clarity), the following result is\nreturned:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score) AS total_score\n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |         130 |\n| Chun    | Tuning |    73 |         203 |\n| Chun    | SQL    |    75 |         278 |\n| Tatiana | SQL    |    87 |         365 |\n| Kaolin  | Tuning |    88 |         453 |\n+---------+--------+-------+-------------+\n\nThe total_score column represents a running total of the current row, and all\nprevious rows. The window frame in this example expands as the function\nproceeds.\n\nThe above query makes use of the default to define the window frame. It could\nbe written explicitly as follows:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |         130 |\n| Chun    | Tuning |    73 |         203 |\n| Chun    | SQL    |    75 |         278 |\n| Tatiana | SQL    |    87 |         365 |\n| Kaolin  | Tuning |    88 |         453 |\n+---------+--------+-------+-------------+\n\nLet\'s look at some alternatives:\n\nFirstly, applying the window function to the current row and all following\nrows can be done with the use of UNBOUNDED FOLLOWING:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |         453 |\n| Esben   | SQL    |    43 |         422 |\n| Kaolin  | SQL    |    56 |         379 |\n| Chun    | Tuning |    73 |         323 |\n| Chun    | SQL    |    75 |         250 |\n| Tatiana | SQL    |    87 |         175 |\n| Kaolin  | Tuning |    88 |          88 |\n+---------+--------+-------+-------------+\n\nIt\'s possible to specify a number of rows, rather than the entire unbounded\nfollowing or preceding set. The following example takes the current row, as\nwell as the previous row:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          31 |\n| Esben   | SQL    |    43 |          74 |\n| Kaolin  | SQL    |    56 |          99 |\n| Chun    | Tuning |    73 |         129 |\n| Chun    | SQL    |    75 |         148 |\n| Tatiana | SQL    |    87 |         162 |\n| Kaolin  | Tuning |    88 |         175 |\n+---------+--------+-------+-------------+\n\nThe current row and the following row:\n\nSELECT name, test, score, SUM(score) \n OVER (ORDER BY score ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\ntotal_score \n FROM student_test ORDER BY score;\n+---------+--------+-------+-------------+\n| name    | test   | score | total_score |\n+---------+--------+-------+-------------+\n| Esben   | Tuning |    31 |          74 |\n| Esben   | SQL    |    43 |         130 |\n| Kaolin  | SQL    |    56 |         172 |\n| Chun    | Tuning |    73 |         204 |\n| Chun    | SQL    |    75 |         235 |\n| Tatiana | SQL    |    87 |         250 |\n| Kaolin  | Tuning |    88 |         175 |\n+---------+--------+-------+-------------+\n\nURL: https://mariadb.com/kb/en/window-frames/','','https://mariadb.com/kb/en/window-frames/'),
(801,'SPIDER_DIRECT_SQL',42,'Syntax\n------\n\nSPIDER_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used to\nexecute the SQL string sql on the remote server, as defined in parameters. If\nany resultsets are returned, they are stored in the tmp_table_list.\n\nThe function returns 1 if the SQL executes successfully, or 0 if it fails.\n\nExamples\n--------\n\nSELECT SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv \"node1\", port \"8607\"\');\n+----------------------------------------------------------------------+\n| SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv \"node1\", port \"8607\"\') |\n+----------------------------------------------------------------------+\n|                                                                    1 |\n+----------------------------------------------------------------------+\n\nURL: https://mariadb.com/kb/en/spider_direct_sql/','','https://mariadb.com/kb/en/spider_direct_sql/'),
(803,'COLUMN_ADD',43,'Syntax\n------\n\nCOLUMN_ADD(dyncol_blob, column_nr, value [as type], [column_nr, value [as\ntype]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type], [column_name, value [as\ntype]]...);\n\nDescription\n-----------\n\nAdds or updates dynamic columns.\n\n* dyncol_blob must be either a valid dynamic columns blob (for example,\nCOLUMN_CREATE returns such blob), or an empty string.\n* column_name specifies the name of the column to be added. If dyncol_blob\nalready has a column with this name, it will be overwritten.\n* value specifies the new value for the column.  Passing a NULL value will\ncause the column to be deleted.\n* as type is optional. See #datatypes section for a discussion about types.\n\nThe return value is a dynamic column blob after the modifications.\n\nExamples\n--------\n\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, \"column_name\", \"value\")\nWHERE id=1;\n\nNote: COLUMN_ADD() is a regular function (just like CONCAT()), hence, in order\nto update the value in the table you have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col, ....) pattern.\n\nURL: https://mariadb.com/kb/en/column_add/','','https://mariadb.com/kb/en/column_add/'),
(805,'COLUMN_CREATE',43,'Syntax\n------\n\nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value [as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name, value [as type]]...);\n\nDescription\n-----------\n\nReturns a dynamic columns blob that stores the specified columns with values.\n\nThe return value is suitable for\n\n* storing in a table\n* further modification with other dynamic columns functions\n\nThe as type part allows one to specify the value type. In most cases, this is\nredundant because MariaDB will be able to deduce the type of the value.\nExplicit type specification may be needed when the type of the value is not\napparent. For example, a literal \'2012-12-01\' has a CHAR type by default, one\nwill need to specify \'2012-12-01\' AS DATE to have it stored as a date. See\nDynamic Columns:Datatypes for further details.\n\nExamples\n--------\n\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(\"column_name\", \"value\");\n\nURL: https://mariadb.com/kb/en/column_create/','','https://mariadb.com/kb/en/column_create/'),
(808,'COLUMN_GET',43,'Syntax\n------\n\nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n\nDescription\n-----------\n\nGets the value of a dynamic column by its name. If no column with the given\nname exists, NULL will be returned.\n\ncolumn_name as type requires that one specify the datatype of the dynamic\ncolumn they are reading.\n\nThis may seem counter-intuitive: why would one need to specify which datatype\nthey\'re retrieving? Can\'t the dynamic columns system figure the datatype from\nthe data being stored?\n\nThe answer is: SQL is a statically-typed language. The SQL interpreter needs\nto know the datatypes of all expressions before the query is run (for example,\nwhen one is using prepared statements and runs \"select COLUMN_GET(...)\", the\nprepared statement API requires the server to inform the client about the\ndatatype of the column being read before the query is executed and the server\ncan see what datatype the column actually has).\n\nLengths\n-------\n\nIf you\'re running queries like:\n\nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n\nwithout specifying a maximum length (i.e. using as CHAR, not as CHAR(n)),\nMariaDB will report the maximum length of the resultset column to be\n16,777,216. This may cause excessive memory usage in some client libraries,\nbecause they try to pre-allocate a buffer of maximum resultset width. To avoid\nthis problem, use CHAR(n) whenever you\'re using COLUMN_GET in the select list.\n\nSee Dynamic Columns:Datatypes for more information about datatypes.\n\nURL: https://mariadb.com/kb/en/column_get/','','https://mariadb.com/kb/en/column_get/'),
(809,'COLUMN_JSON',43,'Syntax\n------\n\nCOLUMN_JSON(dyncol_blob)\n\nDescription\n-----------\n\nReturns a JSON representation of data in dyncol_blob. Can also be used to\ndisplay nested columns. See dynamic columns for more information.\n\nExample\n-------\n\nselect item_name, COLUMN_JSON(dynamic_cols) from assets;\n+-----------------+----------------------------------------+\n| item_name       | COLUMN_JSON(dynamic_cols)              |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"}           |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3 years\"} |\n+-----------------+----------------------------------------+\n\nLimitation: COLUMN_JSON will decode nested dynamic columns at a nesting level\nof not more than 10 levels deep. Dynamic columns that are nested deeper than\n10 levels will be shown as BINARY string, without encoding.\n\nURL: https://mariadb.com/kb/en/column_json/','','https://mariadb.com/kb/en/column_json/'),
(813,'WSREP_SYNC_WAIT_UPTO_GTID',44,'MariaDB starting with 10.4.2\n----------------------------\nWSREP_SYNC_WAIT_UPTO_GTID was added as part of Galera 4 in MariaDB 10.4.2.\n\nSyntax\n------\n\nWSREP_SYNC_WAIT_UPTO_GTID(gtid[,timeout])\n\nDescription\n-----------\n\nBlocks the client until the transaction specified by the given Global\nTransaction ID is applied and committed by the node.\n\nThe optional timeout argument can be used to specify a block timeout in\nseconds. If not provided, the timeout will be indefinite.\n\nReturns the node that applied and committed the Global Transaction ID,\nER_LOCAL_WAIT_TIMEOUT if the function is timed out before this, or\nER_WRONG_ARGUMENTS if the function is given an invalid GTID.\n\nThe result from WSREP_LAST_SEEN_GTID can be useful to determine the\ntransaction to provide to WSREP_SYNC_WAIT_UPTO_GTID for waiting and unblocking\npurposes.\n\nURL: https://mariadb.com/kb/en/wsrep_sync_wait_upto_gtid/','','https://mariadb.com/kb/en/wsrep_sync_wait_upto_gtid/'),
(816,'Bitemporal Tables',45,'MariaDB starting with 10.4.3\n----------------------------\nBitemporal tables are tables that use versioning both at the system and\napplication-time period levels.\n\nUsing Bitemporal Tables\n-----------------------\n\nTo create a bitemporal table, use:\n\nCREATE TABLE test.t3 (\n date_1 DATE,\n date_2 DATE,\n row_start TIMESTAMP(6) AS ROW START INVISIBLE,\n row_end TIMESTAMP(6) AS ROW END INVISIBLE,\n PERIOD FOR application_time(date_1, date_2),\n PERIOD FOR system_time(row_start, row_end))\nWITH SYSTEM VERSIONING;\n\nNote that, while system_time here is also a time period, it cannot be used in\nDELETE FOR PORTION or UPDATE FOR PORTION statements.\n\nDELETE FROM test.t3 \nFOR PORTION OF system_time \n  FROM \'2000-01-01\' TO \'2018-01-01\';\nERROR 42000: You have an error in your SQL syntax; check the manual that\ncorresponds \n to your MariaDB server version for the right syntax to use near\n \'of system_time from \'2000-01-01\' to \'2018-01-01\'\' at line 1\n\nURL: https://mariadb.com/kb/en/bitemporal-tables/','','https://mariadb.com/kb/en/bitemporal-tables/'),
(818,'ST_GeomFromGeoJSON',46,'MariaDB starting with 10.2.4\n----------------------------\nST_GeomFromGeoJSON was added in MariaDB 10.2.4\n\nSyntax\n------\n\nST_GeomFromGeoJSON(g[, option])\n\nDescription\n-----------\n\nGiven a GeoJSON input g, returns a geometry object. The option specifies what\nto do if g contains geometries with coordinate dimensions higher than 2.\n\n+---------------------------+------------------------------------------------+\n| Option                    | Description                                    |\n+---------------------------+------------------------------------------------+\n| 1                         | Return an error (the default)                  |\n+---------------------------+------------------------------------------------+\n| 2 - 4                     | The document is accepted, but the coordinates  |\n|                           | for higher coordinate dimensions are stripped  |\n|                           | off.                                           |\n+---------------------------+------------------------------------------------+\n\nNote that this function did not work correctly before MariaDB 10.2.8 - see\nMDEV-12180.\n\nExamples\n--------\n\nSET @j = \'{ \"type\": \"Point\", \"coordinates\": [5.3, 15.0]}\';\n\nSELECT ST_AsText(ST_GeomFromGeoJSON(@j));\n+-----------------------------------+\n| ST_AsText(ST_GeomFromGeoJSON(@j)) |\n+-----------------------------------+\n| POINT(5.3 15)                     |\n+-----------------------------------+\n\nURL: https://mariadb.com/kb/en/st_geomfromgeojson/','','https://mariadb.com/kb/en/st_geomfromgeojson/'),
(819,'Operator Precedence',47,'The precedence is the order in which the SQL operators are evaluated.\n\nThe following list shows the SQL operator precedence. Operators that appear\nfirst in the list have a higher precedence. Operators which are listed\ntogether have the same precedence.\n\n* INTERVAL\n* BINARY, COLLATE\n* !\n* - (unary minus), [[bitwise-not|]] (unary bit inversion)\n* || (string concatenation)\n* ^\n* *, /, DIV, %, MOD\n* -, +\n* <<, >>\n* &\n* |\n* = (comparison), <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN\n* BETWEEN, CASE, WHEN, THEN, ELSE, END\n* NOT\n* &&, AND\n* XOR\n* || (logical or), OR\n* = (assignment), :=\n\nFunctions precedence is always higher than operators precedence.\n\nIn this page CASE refers to the CASE operator, not to the CASE statement.\n\nIf the HIGH_NOT_PRECEDENCE SQL_MODE is set, NOT has the same precedence as !.\n\nThe || operator\'s precedence, as well as its meaning, depends on the\nPIPES_AS_CONCAT SQL_MODE flag: if it is on, || can be used to concatenate\nstrings (like the CONCAT() function) and has a higher precedence.\n\nThe = operator\'s precedence depends on the context - it is higher when = is\nused as a comparison operator.\n\nParenthesis can be used to modify the operators precedence in an expression.\n\nShort-circuit evaluation\n------------------------\n\nThe AND, OR, && and || operators support short-circuit evaluation. This means\nthat, in some cases, the expression on the right of those operators is not\nevaluated, because its result cannot affect the result. In the following\ncases, short-circuit evaluation is used and x() is not evaluated:\n\n* FALSE AND x()\n* FALSE && x()\n* TRUE OR x()\n* TRUE || x()\n* NULL BETWEEN x() AND x()\n\nNote however that the short-circuit evaluation does not apply to NULL AND x().\nAlso, BETWEEN\'s right operands are not evaluated if the left operand is NULL,\nbut in all other cases all the operands are evaluated.\n\nThis is a speed optimization. Also, since functions can have side-effects,\nthis behavior can be used to choose whether execute them or not using a\nconcise syntax:\n\nSELECT some_function() OR log_error();\n\nURL: https://mariadb.com/kb/en/operator-precedence/','','https://mariadb.com/kb/en/operator-precedence/'),
(821,'Division Operator (/)',48,'Syntax\n------\n\n/\n\nDescription\n-----------\n\nDivision operator. Dividing by zero will return NULL. By default, returns four\ndigits after the decimal. This is determined by the server system variable\ndiv_precision_increment which by default is four. It can be set from 0 to 30.\n\nDividing by zero returns NULL. If the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is\nused (the default since MariaDB 10.2.4), a division by zero also produces a\nwarning.\n\nExamples\n--------\n\nSELECT 4/5;\n+--------+\n| 4/5    |\n+--------+\n| 0.8000 |\n+--------+\n\nSELECT 300/(2-2);\n+-----------+\n| 300/(2-2) |\n+-----------+\n|      NULL |\n+-----------+\n\nSELECT 300/7;\n+---------+\n| 300/7   |\n+---------+\n| 42.8571 |\n+---------+\n\nChanging div_precision_increment for the session from the default of four to\nsix:\n\nSET div_precision_increment = 6;\n\nSELECT 300/7;\n+-----------+\n| 300/7     |\n+-----------+\n| 42.857143 |\n+-----------+\n\nSELECT 300/7;\n+-----------+\n| 300/7     |\n+-----------+\n| 42.857143 |\n+-----------+\n\nURL: https://mariadb.com/kb/en/division-operator/','','https://mariadb.com/kb/en/division-operator/'),
(823,'Multiplication Operator (*)',48,'Syntax\n------\n\n*\n\nDescription\n-----------\n\nMultiplication operator.\n\nExamples\n--------\n\nSELECT 7*6;\n+-----+\n| 7*6 |\n+-----+\n|  42 |\n+-----+\n\nSELECT 1234567890*9876543210;\n+-----------------------+\n| 1234567890*9876543210 |\n+-----------------------+\n|  -6253480962446024716 |\n+-----------------------+\n\nSELECT 18014398509481984*18014398509481984.0;\n+---------------------------------------+\n| 18014398509481984*18014398509481984.0 |\n+---------------------------------------+\n|   324518553658426726783156020576256.0 |\n+---------------------------------------+\n\nSELECT 18014398509481984*18014398509481984;\n+-------------------------------------+\n| 18014398509481984*18014398509481984 |\n+-------------------------------------+\n|                                   0 |\n+-------------------------------------+\n\nURL: https://mariadb.com/kb/en/multiplication-operator/','','https://mariadb.com/kb/en/multiplication-operator/'),
(824,'Subtraction Operator (-)',48,'Syntax\n------\n\n-\n\nDescription\n-----------\n\nSubtraction. The operator is also used as the unary minus for changing sign.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer, unless\nthe NO_UNSIGNED_SUBTRACTION SQL_MODE is enabled, in which case the result is\nalways signed.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 96-9;\n+------+\n| 96-9 |\n+------+\n|   87 |\n+------+\n\nSELECT 15-17;\n+-------+\n| 15-17 |\n+-------+\n|    -2 |\n+-------+\n\nSELECT 3.66 + 1.333;\n+--------------+\n| 3.66 + 1.333 |\n+--------------+\n|        4.993 |\n+--------------+\n\nUnary minus:\n\nSELECT - (3+5);\n+---------+\n| - (3+5) |\n+---------+\n|      -8 |\n+---------+\n\nURL: https://mariadb.com/kb/en/subtraction-operator-/','','https://mariadb.com/kb/en/subtraction-operator-/'),
(827,'STOP SLAVE',49,'The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTOP SLAVE [\"connection_name\"] [thread_type [, thread_type] ... ] [FOR CHANNEL\n\"connection_name\"]\n\nSTOP ALL SLAVES [thread_type [, thread_type]]\n\nSTOP REPLICA [\"connection_name\"] [thread_type [, thread_type] ... ] -- from\n10.5.1\n\nSTOP ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nStops the replica threads. STOP SLAVE requires the SUPER privilege, or, from\nMariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege.\n\nLike START SLAVE, this statement may be used with the IO_THREAD and SQL_THREAD\noptions to name the thread or threads to be stopped. In almost all cases, one\nnever need to use the thread_type options.\n\nSTOP SLAVE waits until any current replication event group affecting one or\nmore non-transactional tables has finished executing (if there is any such\nreplication group), or until the user issues a KILL QUERY or KILL CONNECTION\nstatement.\n\nNote that STOP SLAVE doesn\'t delete the connection permanently. Next time you\nexecute START SLAVE or the MariaDB server restarts, the replica connection is\nrestored with it\'s original arguments. If you want to delete a connection, you\nshould execute RESET SLAVE.\n\nSTOP ALL SLAVES\n---------------\n\nSTOP ALL SLAVES stops all your running replicas. It will give you a note for\nevery stopped connection. You can check the notes with SHOW WARNINGS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless master, or the default master (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the STOP SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after STOP SLAVE.\n\nSTOP REPLICA\n------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTOP REPLICA is an alias for STOP SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/stop-replica/','','https://mariadb.com/kb/en/stop-replica/'),
(826,'START SLAVE',49,'The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTART SLAVE [\"connection_name\"] [thread_type [, thread_type] ... ] [FOR\nCHANNEL \"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL                \n  MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos [FOR CHANNEL\n\"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n  RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos [FOR CHANNEL\n\"connection_name\"]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n  MASTER_GTID_POS = <GTID position> [FOR CHANNEL \"connection_name\"]\nSTART ALL SLAVES [thread_type [, thread_type]]\n\nSTART REPLICA [\"connection_name\"] [thread_type [, thread_type] ... ] -- from\n10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL                \n  MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL\n  RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA [\"connection_name\"] [SQL_THREAD] UNTIL\n  MASTER_GTID_POS = <GTID position> -- from 10.5.1\nSTART ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nSTART SLAVE (START REPLICA from MariaDB 10.5.1) with no thread_type options\nstarts both of the replica threads (see replication). The I/O thread reads\nevents from the primary server and stores them in the relay log. The SQL\nthread reads events from the relay log and executes them. START SLAVE requires\nthe SUPER privilege, or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN\nprivilege.\n\nIf START SLAVE succeeds in starting the replica threads, it returns without\nany error. However, even in that case, it might be that the replica threads\nstart and then later stop (for example, because they do not manage to connect\nto the primary or read its binary log, or some other problem). START SLAVE\ndoes not warn you about this. You must check the replica\'s error log for error\nmessages generated by the replica threads, or check that they are running\nsatisfactorily with SHOW SLAVE STATUS (SHOW REPLICA STATUS from MariaDB\n10.5.1).\n\nSTART SLAVE UNTIL\n-----------------\n\nSTART SLAVE UNTIL refers to the SQL_THREAD replica position at which the\nSQL_THREAD replication will halt. If SQL_THREAD isn\'t specified both threads\nare started.\n\nSTART SLAVE UNTIL master_gtid_pos=xxx is also supported. See Global\nTransaction ID/START SLAVE UNTIL master_gtid_pos=xxx for more details.\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the START SLAVE statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after START SLAVE.\n\nSTART ALL SLAVES\n----------------\n\nSTART ALL SLAVES starts all configured replicas (replicas with master_host not\nempty) that were not started before. It will give a note for all started\nconnections. You can check the notes with SHOW WARNINGS.\n\nSTART REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTART REPLICA is an alias for START SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/start-replica/','','https://mariadb.com/kb/en/start-replica/'),
(828,'RESET REPLICA/SLAVE',49,'The terms master and slave have historically been used in replication, but the\nterms terms primary and replica are now preferred. The old terms are used\nstill used in parts of the documentation, and in MariaDB commands, although\nMariaDB 10.5 has begun the process of renaming. The documentation process is\nongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nRESET REPLICA [\"connection_name\"] [ALL]  [FOR CHANNEL \"connection_name\"] --\nfrom MariaDB 10.5.1         \nRESET SLAVE [\"connection_name\"] [ALL]  [FOR CHANNEL \"connection_name\"]\n\nDescription\n-----------\n\nRESET REPLICA/SLAVE makes the replica forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean start. It\ndeletes the master.info and relay-log.info files, all the relay log files, and\nstarts a new relay log file. To use RESET REPLICA/SLAVE, the replica threads\nmust be stopped (use STOP REPLICA/SLAVE if necessary).\n\nNote: All relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist on a\nreplication slave if you have issued a STOP REPLICA/SLAVE statement or if the\nslave is highly loaded.)\n\nNote: RESET REPLICA does not reset the global gtid_slave_pos variable. This\nmeans that a replica server configured with CHANGE MASTER TO\nMASTER_USE_GTID=slave_pos will not receive events with GTIDs occurring before\nthe state saved in gtid_slave_pos. If the intent is to reprocess these events,\ngtid_slave_pos must be manually reset, e.g. by executing set global\ngtid_slave_pos=\"\".\n\nConnection information stored in the master.info file is immediately reset\nusing any values specified in the corresponding startup options. This\ninformation includes values such as master host, master port, master user, and\nmaster password. If the replica SQL thread was in the middle of replicating\ntemporary tables when it was stopped, and RESET REPLICA/SLAVE is issued, these\nreplicated temporary tables are deleted on the slave.\n\nThe ALL also resets the PORT, HOST, USER and PASSWORD parameters for the\nslave. If you are using a connection name, it will permanently delete it and\nit will not show up anymore in SHOW ALL REPLICAS/SLAVE STATUS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the RESET REPLICA/SLAVE statement will apply to\nthe specified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after RESET REPLICA.\n\nRESET REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nRESET REPLICA is an alias for RESET SLAVE from MariaDB 10.5.1.\n\nURL: https://mariadb.com/kb/en/reset-replica/','','https://mariadb.com/kb/en/reset-replica/'),
(830,'EXECUTE Statement',50,'Syntax\n------\n\nEXECUTE stmt_name\n  [USING expression[, expression] ...]\n\nMariaDB starting with 10.2.3\n----------------------------\nEXECUTE with expression as parameters was introduced in MariaDB 10.2.3. Before\nthat one could only use variables (@var_name) as parameters.\n\nDescription\n-----------\n\nAfter preparing a statement with PREPARE, you execute it with an EXECUTE\nstatement that refers to the prepared statement name. If the prepared\nstatement contains any parameter markers, you must supply a USING clause that\nlists user variables containing the values to be bound to the parameters.\nParameter values can be supplied only by user variables, and the USING clause\nmust name exactly as many variables as the number of parameter markers in the\nstatement.\n\nYou can execute a given prepared statement multiple times, passing different\nvariables to it or setting the variables to different values before each\nexecution.\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing is produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nExample\n-------\n\nSee example in PREPARE.\n\nURL: https://mariadb.com/kb/en/execute-statement/','','https://mariadb.com/kb/en/execute-statement/'),
(832,'DEALLOCATE / DROP PREPARE',50,'Syntax\n------\n\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nDescription\n-----------\n\nTo deallocate a prepared statement produced with PREPARE, use a DEALLOCATE\nPREPARE statement that refers to the prepared statement name.\n\nA prepared statement is implicitly deallocated when a new PREPARE command is\nissued. In that case, there is no need to use DEALLOCATE.\n\nAttempting to execute a prepared statement after deallocating it results in an\nerror, as if it was not prepared at all:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing will be produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nDEALLOCATE PREPARE\n\nExample\n-------\n\nSee example in PREPARE.\n\nURL: https://mariadb.com/kb/en/deallocate-drop-prepare/','','https://mariadb.com/kb/en/deallocate-drop-prepare/'),
(833,'EXECUTE IMMEDIATE',50,'MariaDB starting with 10.2.3\n----------------------------\nEXECUTE IMMEDIATE was introduced in MariaDB 10.2.3.\n\nSyntax\n------\n\nEXECUTE IMMEDIATE statement\n\nDescription\n-----------\n\nEXECUTE IMMEDIATE executes a dynamic SQL statement created on the fly, which\ncan reduce performance overhead.\n\nFor example:\n\nEXECUTE IMMEDIATE \'SELECT 1\'\n\nwhich is shorthand for:\n\nprepare stmt from \"select 1\";\nexecute stmt;\ndeallocate prepare stmt;\n\nEXECUTE IMMEDIATE supports complex expressions as prepare source and\nparameters:\n\nEXECUTE IMMEDIATE CONCAT(\'SELECT COUNT(*) FROM \', \'t1\', \' WHERE a=?\') USING\n5+5;\n\nLimitations: subselects and stored function calls are not supported as a\nprepare source.\n\nThe following examples return an error:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nEXECUTE IMMEDIATE f1();\nERROR 1970 (42000): EXECUTE IMMEDIATE does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE (SELECT \'SELECT * FROM t1\');\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT \'SELECT * FROM t1\')\' at line 1\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING f1();\nERROR 1970 (42000): EXECUTE..USING does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING (SELECT 10);\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT 10)\' at line 1\n\nOne can use a user or an SP variable as a workaround:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nSET @stmt=f1();\nEXECUTE IMMEDIATE @stmt;\n\nSET @stmt=(SELECT \'SELECT 1\');\nEXECUTE IMMEDIATE @stmt;\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nSET @param=f1();\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nSET @param=(SELECT 10);\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nEXECUTE IMMEDIATE supports user variables and SP variables as OUT parameters\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1(OUT a INT)\nBEGIN\n SET a:= 10;\nEND;\n$$\nDELIMITER ;\nSET @a=2;\nEXECUTE IMMEDIATE \'CALL p1(?)\' USING @a;\nSELECT @a;\n+------+\n| @a   |\n+------+\n|   10 |\n+------+\n\nSimilar to PREPARE, EXECUTE IMMEDIATE is allowed in stored procedures but is\nnot allowed in stored functions.\n\nThis example uses EXECUTE IMMEDIATE inside a stored procedure:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\nBEGIN\n EXECUTE IMMEDIATE \'SELECT 1\';\nEND;\n$$\nDELIMITER ;\nCALL p1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nThis script returns an error:\n\nDELIMITER $$\nCREATE FUNCTION f1() RETURNS INT\nBEGIN\n EXECUTE IMMEDIATE \'DO 1\';\n RETURN 1;\nEND;\n$$\nERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger\n\nEXECUTE IMMEDIATE can use DEFAULT and IGNORE indicators as bind parameters:\n\nCREATE OR REPLACE TABLE t1 (a INT DEFAULT 10);\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING DEFAULT;\nSELECT * FROM t1;\n+------+\n| a    |\n+------+\n|   10 |\n+------+\n\nEXECUTE IMMEDIATE increments the Com_execute_immediate status variable, as\nwell as the Com_stmt_prepare, Com_stmt_execute and Com_stmt_close status\nvariables.\n\nNote, EXECUTE IMMEDIATE does not increment the Com_execute_sql status\nvariable. Com_execute_sql is used only for PREPARE..EXECUTE.\n\nThis session screenshot demonstrates how EXECUTE IMMEDIATE affects status\nvariables:\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n\n+-----------------------+----------------+\n| VARIABLE_NAME         | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 0              |\n| COM_EXECUTE_SQL       | 0              |\n| COM_STMT_CLOSE        | 0              |\n| COM_STMT_EXECUTE      | 0              |\n| COM_STMT_PREPARE      | 0              |\n+-----------------------+----------------+\n\nEXECUTE IMMEDIATE \'SELECT 1\';\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n+-----------------------+----------------+\n| VARIABLE_NAME         | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 1              |\n| COM_EXECUTE_SQL       | 0              |\n| COM_STMT_CLOSE        | 1              |\n| COM_STMT_EXECUTE      | 1              |\n| COM_STMT_PREPARE      | 1              |\n+-----------------------+----------------+\n\nURL: https://mariadb.com/kb/en/execute-immediate/','','https://mariadb.com/kb/en/execute-immediate/'),
(831,'PREPARE Statement',50,'Syntax\n------\n\nPREPARE stmt_name FROM preparable_stmt\n\nDescription\n-----------\n\nThe PREPARE statement prepares a statement and assigns it a name, stmt_name,\nby which to refer to the statement later. Statement names are not case\nsensitive. preparable_stmt is either a string literal or a user variable (not\na local variable, an SQL expression or a subquery) that contains the text of\nthe statement. The text must represent a single SQL statement, not multiple\nstatements. Within the statement, \"?\" characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query later when\nyou execute it. The \"?\" characters should not be enclosed within quotes, even\nif you intend to bind them to string values. Parameter markers can be used\nonly where expressions should appear, not for SQL keywords, identifiers, and\nso forth.\n\nThe scope of a prepared statement is the session within which it is created.\nOther sessions cannot see it.\n\nIf a prepared statement with the given name already exists, it is deallocated\nimplicitly before the new statement is prepared. This means that if the new\nstatement contains an error and cannot be prepared, an error is returned and\nno statement with the given name exists.\n\nPrepared statements can be PREPAREd and EXECUTEd in a stored procedure, but\nnot in a stored function or trigger. Also, even if the statement is PREPAREd\nin a procedure, it will not be deallocated when the procedure execution ends.\n\nA prepared statement can access user-defined variables, but not local\nvariables or procedure\'s parameters.\n\nIf the prepared statement contains a syntax error, PREPARE will fail. As a\nside effect, stored procedures can use it to check if a statement is valid.\nFor example:\n\nCREATE PROCEDURE `test_stmt`(IN sql_text TEXT)\nBEGIN\n    DECLARE EXIT HANDLER FOR SQLEXCEPTION\n    BEGIN\n        SELECT CONCAT(sql_text, \' is not valid\');\n    END;\n    SET @SQL := sql_text;\n    PREPARE stmt FROM @SQL;\n    DEALLOCATE PREPARE stmt;\nEND;\n\nThe FOUND_ROWS() and ROW_COUNT() functions, if called immediatly after\nEXECUTE, return the number of rows read or affected by the prepared\nstatements; however, if they are called after DEALLOCATE PREPARE, they provide\ninformation about this statement. If the prepared statement produces errors or\nwarnings, GET DIAGNOSTICS return information about them. DEALLOCATE PREPARE\nshouldn\'t clear the diagnostics area, unless it produces an error.\n\nA prepared statement is executed with EXECUTE and released with DEALLOCATE\nPREPARE.\n\nThe max_prepared_stmt_count server system variable determines the number of\nallowed prepared statements that can be prepared on the server. If it is set\nto 0, prepared statements are not allowed. If the limit is reached, an error\nsimilar to the following will be produced:\n\nERROR 1461 (42000): Can\'t create more than max_prepared_stmt_count statements \n (current value: 0)\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, PREPARE stmt FROM \'SELECT :1, :2\' is used,\ninstead of ?.\n\nPermitted Statements\n--------------------\n\nMariaDB starting with 10.6.2\n----------------------------\nAll statements can be prepared, except PREPARE, EXECUTE, and DEALLOCATE / DROP\nPREPARE.\n\nPrior to this, not all statements can be prepared. Only the following SQL\ncommands are permitted:\n\n* ALTER TABLE\n* ANALYZE TABLE\n* BINLOG\n* CACHE INDEX\n* CALL\n* CHANGE MASTER\n* CHECKSUM {TABLE | TABLES}\n* COMMIT\n* {CREATE | DROP} DATABASE\n* {CREATE | DROP} INDEX\n* {CREATE | RENAME | DROP} TABLE\n* {CREATE | RENAME | DROP} USER\n* {CREATE | DROP} VIEW\n* DELETE\n* DESCRIBE\n* DO\n* EXPLAIN\n* FLUSH {TABLE | TABLES | TABLES WITH READ LOCK | HOSTS | PRIVILEGES | LOGS |\nSTATUS | \n MASTER | SLAVE | DES_KEY_FILE | USER_RESOURCES | QUERY CACHE |\nTABLE_STATISTICS | \n INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS}\n* GRANT\n* INSERT\n* INSTALL {PLUGIN | SONAME}\n* HANDLER READ\n* KILL\n* LOAD INDEX INTO CACHE\n* OPTIMIZE TABLE\n* REPAIR TABLE\n* REPLACE\n* RESET {MASTER | SLAVE | QUERY CACHE}\n* REVOKE\n* ROLLBACK\n* SELECT\n* SET\n* SET GLOBAL SQL_SLAVE_SKIP_COUNTER\n* SET ROLE\n* SET SQL_LOG_BIN\n* SET TRANSACTION ISOLATION LEVEL\n* SHOW EXPLAIN\n* SHOW {DATABASES | TABLES | OPEN TABLES | TABLE STATUS | COLUMNS | INDEX |\nTRIGGERS | \n EVENTS | GRANTS | CHARACTER SET | COLLATION | ENGINES | PLUGINS [SONAME] |\nPRIVILEGES | \n PROCESSLIST | PROFILE | PROFILES | VARIABLES | STATUS | WARNINGS | ERRORS |\n TABLE_STATISTICS | INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS |\nAUTHORS | \n CONTRIBUTORS}\n* SHOW CREATE {DATABASE | TABLE | VIEW | PROCEDURE | FUNCTION | TRIGGER |\nEVENT}\n* SHOW {FUNCTION | PROCEDURE} CODE\n* SHOW BINLOG EVENTS\n* SHOW SLAVE HOSTS\n* SHOW {MASTER | BINARY} LOGS\n* SHOW {MASTER | SLAVE | TABLES | INNODB | FUNCTION | PROCEDURE} STATUS\n* SLAVE {START | STOP}\n* TRUNCATE TABLE\n* SHUTDOWN\n* UNINSTALL {PLUGIN | SONAME}\n* UPDATE\n\nSynonyms are not listed here, but can be used. For example, DESC can be used\ninstead of DESCRIBE.\n\nCompound statements can be prepared too.\n\nNote that if a statement can be run in a stored routine, it will work even if\nit is called by a prepared statement. For example, SIGNAL can\'t be directly\nprepared. However, it is allowed in stored routines. If the x() procedure\ncontains SIGNAL, you can still prepare and execute the \'CALL x();\' prepared\nstatement.\n\nPREPARE supports most kinds of expressions as well, for example:\n\nPREPARE stmt FROM CONCAT(\'SELECT * FROM \', table_name);\n\nWhen PREPARE is used with a statement which is not supported, the following\nerror is produced:\n\nERROR 1295 (HY000): This command is not supported in the prepared statement\nprotocol yet\n\nExample\n-------\n\ncreate table t1 (a int,b char(10));\ninsert into t1 values (1,\"one\"),(2, \"two\"),(3,\"three\");\nprepare test from \"select * from t1 where a=?\";\nset @param=2;\nexecute test using @param;\n+------+------+\n| a    | b    |\n+------+------+\n|    2 | two  |\n+------+------+\nset @param=3;\nexecute test using @param;\n+------+-------+\n| a    | b     |\n+------+-------+\n|    3 | three |\n+------+-------+\ndeallocate prepare test;\n\nSince identifiers are not permitted as prepared statements parameters,\nsometimes it is necessary to dynamically compose an SQL statement. This\ntechnique is called dynamic SQL). The following example shows how to use\ndynamic SQL:\n\nCREATE PROCEDURE test.stmt_test(IN tab_name VARCHAR(64))\nBEGIN\n	SET @sql = CONCAT(\'SELECT COUNT(*) FROM \', tab_name);\n	PREPARE stmt FROM @sql;\n	EXECUTE stmt;\n	DEALLOCATE PREPARE stmt;\nEND;\n\nCALL test.stmt_test(\'mysql.user\');\n+----------+\n| COUNT(*) |\n+----------+\n|        4 |\n+----------+\n\nUse of variables in prepared statements:\n\nPREPARE stmt FROM \'SELECT @x;\';\n\nSET @x = 1;\n\nEXECUTE stmt;\n+------+\n| @x   |\n+------+\n|    1 |\n+------+\n\nSET @x = 0;\n\nEXECUTE stmt;\n+------+\n| @x   |\n+------+\n|    0 |\n+------+\n\nDEALLOCATE PREPARE stmt;\n\nURL: https://mariadb.com/kb/en/prepare-statement/','','https://mariadb.com/kb/en/prepare-statement/');
/*!40000 ALTER TABLE `help_topic` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `index_stats`
--

DROP TABLE IF EXISTS `index_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `index_stats` (
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `index_name` varchar(64) NOT NULL,
  `prefix_arity` int(11) unsigned NOT NULL,
  `avg_frequency` decimal(12,4) DEFAULT NULL,
  PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Indexes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `index_stats`
--

LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `innodb_index_stats`
--

DROP TABLE IF EXISTS `innodb_index_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_index_stats` (
  `database_name` varchar(64) NOT NULL,
  `table_name` varchar(199) NOT NULL,
  `index_name` varchar(64) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `stat_name` varchar(64) NOT NULL,
  `stat_value` bigint(20) unsigned NOT NULL,
  `sample_size` bigint(20) unsigned DEFAULT NULL,
  `stat_description` varchar(1024) NOT NULL,
  PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `innodb_table_stats`
--

DROP TABLE IF EXISTS `innodb_table_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_table_stats` (
  `database_name` varchar(64) NOT NULL,
  `table_name` varchar(199) NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `n_rows` bigint(20) unsigned NOT NULL,
  `clustered_index_size` bigint(20) unsigned NOT NULL,
  `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`database_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `plugin`
--

DROP TABLE IF EXISTS `plugin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `plugin` (
  `name` varchar(64) NOT NULL DEFAULT '',
  `dl` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL plugins';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `plugin`
--

LOCK TABLES `plugin` WRITE;
/*!40000 ALTER TABLE `plugin` DISABLE KEYS */;
/*!40000 ALTER TABLE `plugin` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `proc`
--

DROP TABLE IF EXISTS `proc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `proc` (
  `db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `name` char(64) NOT NULL DEFAULT '',
  `type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
  `specific_name` char(64) NOT NULL DEFAULT '',
  `language` enum('SQL') NOT NULL DEFAULT 'SQL',
  `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
  `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
  `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
  `param_list` blob NOT NULL,
  `returns` longblob NOT NULL,
  `body` longblob NOT NULL,
  `definer` varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
  `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
  `comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `character_set_client` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `collation_connection` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `db_collation` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `body_utf8` longblob DEFAULT NULL,
  `aggregate` enum('NONE','GROUP') NOT NULL DEFAULT 'NONE',
  PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Stored Procedures';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `proc`
--

LOCK TABLES `proc` WRITE;
/*!40000 ALTER TABLE `proc` DISABLE KEYS */;
INSERT INTO `proc` VALUES
('mysql','AddGeometryColumn','PROCEDURE','AddGeometryColumn','SQL','CONTAINS_SQL','NO','INVOKER','catalog varchar(64), t_schema varchar(64),\n   t_name varchar(64), geometry_column varchar(64), t_srid int','','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' ADD \', geometry_column,\' GEOMETRY REF_SYSTEM_ID=\', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','','utf8mb3','utf8mb3_general_ci','utf8mb4_general_ci','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' ADD \', geometry_column,\' GEOMETRY REF_SYSTEM_ID=\', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','NONE'),
('mysql','DropGeometryColumn','PROCEDURE','DropGeometryColumn','SQL','CONTAINS_SQL','NO','INVOKER','catalog varchar(64), t_schema varchar(64),\n   t_name varchar(64), geometry_column varchar(64)','','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' DROP \', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','','utf8mb3','utf8mb3_general_ci','utf8mb4_general_ci','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' DROP \', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','NONE'),
('sys','extract_schema_from_file_name','FUNCTION','extract_schema_from_file_name','SQL','NO_SQL','YES','INVOKER','path VARCHAR(512)\n    ','varchar(64) CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN LEFT(SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(path, \'\\\\\', \'/\'), \'/\', -2), \'/\', 1), 64);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a raw file path, and attempts to extract the schema name from it.\n             Useful for when interacting with Performance Schema data\n             concerning IO statistics, for example.\n             Currently relies on the fact that a table data file will be within a\n             specified database directory (will not work with partitions or tables\n             that specify an individual DATA_DIRECTORY).\n             Parameters\n             path (VARCHAR(512)):\n               The full file path to a data file to extract the schema name from.\n             Returns\n             VARCHAR(64)\n             Example\n             mysql> SELECT sys.extract_schema_from_file_name(\'/var/lib/mysql/employees/employee.ibd\');\n             +----------------------------------------------------------------------------+\n             | sys.extract_schema_from_file_name(\'/var/lib/mysql/employees/employee.ibd\') |\n             +----------------------------------------------------------------------------+\n             | employees                                                                  |\n             +----------------------------------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN LEFT(SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(path, \'\\\', \'/\'), \'/\', -2), \'/\', 1), 64);\nEND','NONE'),
('sys','extract_table_from_file_name','FUNCTION','extract_table_from_file_name','SQL','NO_SQL','YES','INVOKER','path VARCHAR(512)\n    ','varchar(64) CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN LEFT(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(REPLACE(path, \'\\\\\', \'/\'), \'/\', -1), \'@0024\', \'$\'), \'.\', 1), 64);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a raw file path, and extracts the table name from it.\n             Useful for when interacting with Performance Schema data\n             concerning IO statistics, for example.\n             Parameters\n             path (VARCHAR(512)):\n               The full file path to a data file to extract the table name from.\n             Returns\n             VARCHAR(64)\n             Example\n             mysql> SELECT sys.extract_table_from_file_name(\'/var/lib/mysql/employees/employee.ibd\');\n             +---------------------------------------------------------------------------+\n             | sys.extract_table_from_file_name(\'/var/lib/mysql/employees/employee.ibd\') |\n             +---------------------------------------------------------------------------+\n             | employee                                                                  |\n             +---------------------------------------------------------------------------+\n             1 row in set (0.02 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN LEFT(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(REPLACE(path, \'\\\', \'/\'), \'/\', -1), \'@0024\', \'$\'), \'.\', 1), 64);\nEND','NONE'),
('sys','format_bytes','FUNCTION','format_bytes','SQL','NO_SQL','YES','INVOKER','bytes TEXT\n    ','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n  IF bytes IS NULL THEN RETURN NULL;\n  ELSEIF bytes >= 1125899906842624 THEN RETURN CONCAT(ROUND(bytes / 1125899906842624, 2), \' PiB\');\n  ELSEIF bytes >= 1099511627776 THEN RETURN CONCAT(ROUND(bytes / 1099511627776, 2), \' TiB\');\n  ELSEIF bytes >= 1073741824 THEN RETURN CONCAT(ROUND(bytes / 1073741824, 2), \' GiB\');\n  ELSEIF bytes >= 1048576 THEN RETURN CONCAT(ROUND(bytes / 1048576, 2), \' MiB\');\n  ELSEIF bytes >= 1024 THEN RETURN CONCAT(ROUND(bytes / 1024, 2), \' KiB\');\n  ELSE RETURN CONCAT(ROUND(bytes, 0), \' bytes\');\n  END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a raw bytes value, and converts it to a human readable format.\n             Parameters\n             bytes (TEXT):\n               A raw bytes value.\n             Returns\n             TEXT\n             Example\n             mysql> SELECT sys.format_bytes(2348723492723746) AS size;\n             +----------+\n             | size     |\n             +----------+\n             | 2.09 PiB |\n             +----------+\n             1 row in set (0.00 sec)\n             mysql> SELECT sys.format_bytes(2348723492723) AS size;\n             +----------+\n             | size     |\n             +----------+\n             | 2.14 TiB |\n             +----------+\n             1 row in set (0.00 sec)\n             mysql> SELECT sys.format_bytes(23487234) AS size;\n             +-----------+\n             | size      |\n             +-----------+\n             | 22.40 MiB |\n             +-----------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n  IF bytes IS NULL THEN RETURN NULL;\n  ELSEIF bytes >= 1125899906842624 THEN RETURN CONCAT(ROUND(bytes / 1125899906842624, 2), \' PiB\');\n  ELSEIF bytes >= 1099511627776 THEN RETURN CONCAT(ROUND(bytes / 1099511627776, 2), \' TiB\');\n  ELSEIF bytes >= 1073741824 THEN RETURN CONCAT(ROUND(bytes / 1073741824, 2), \' GiB\');\n  ELSEIF bytes >= 1048576 THEN RETURN CONCAT(ROUND(bytes / 1048576, 2), \' MiB\');\n  ELSEIF bytes >= 1024 THEN RETURN CONCAT(ROUND(bytes / 1024, 2), \' KiB\');\n  ELSE RETURN CONCAT(ROUND(bytes, 0), \' bytes\');\n  END IF;\nEND','NONE'),
('sys','ps_thread_stack','FUNCTION','ps_thread_stack','SQL','READS_SQL_DATA','NO','INVOKER','thd_id BIGINT UNSIGNED,\n        debug BOOLEAN\n    ','longtext CHARSET latin1 COLLATE latin1_swedish_ci','BEGIN\n    DECLARE json_objects LONGTEXT;\n    \n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE processlist_id = CONNECTION_ID();\n    \n    SET SESSION group_concat_max_len=@@global.max_allowed_packet;\n    SELECT GROUP_CONCAT(CONCAT( \'{\'\n              , CONCAT_WS( \', \'\n              , CONCAT(\'\"nesting_event_id\": \"\', IF(nesting_event_id IS NULL, \'0\', nesting_event_id), \'\"\')\n              , CONCAT(\'\"event_id\": \"\', event_id, \'\"\')\n              , CONCAT( \'\"timer_wait\": \', ROUND(timer_wait/1000000, 2))\n              , CONCAT( \'\"event_info\": \"\'\n                  , CASE\n                        WHEN event_name NOT LIKE \'wait/io%\' THEN REPLACE(SUBSTRING_INDEX(event_name, \'/\', -2), \'\\\\\', \'\\\\\\\\\')\n                        WHEN event_name NOT LIKE \'wait/io/file%\' OR event_name NOT LIKE \'wait/io/socket%\' THEN REPLACE(SUBSTRING_INDEX(event_name, \'/\', -4), \'\\\\\', \'\\\\\\\\\')\n                        ELSE event_name\n                    END\n                  , \'\"\'\n              )\n              , CONCAT( \'\"wait_info\": \"\', IFNULL(wait_info, \'\'), \'\"\')\n              , CONCAT( \'\"source\": \"\', IF(true AND event_name LIKE \'wait%\', IFNULL(wait_info, \'\'), \'\'), \'\"\')\n              , CASE\n                     WHEN event_name LIKE \'wait/io/file%\'      THEN \'\"event_type\": \"io/file\"\'\n                     WHEN event_name LIKE \'wait/io/table%\'     THEN \'\"event_type\": \"io/table\"\'\n                     WHEN event_name LIKE \'wait/io/socket%\'    THEN \'\"event_type\": \"io/socket\"\'\n                     WHEN event_name LIKE \'wait/synch/mutex%\'  THEN \'\"event_type\": \"synch/mutex\"\'\n                     WHEN event_name LIKE \'wait/synch/cond%\'   THEN \'\"event_type\": \"synch/cond\"\'\n                     WHEN event_name LIKE \'wait/synch/rwlock%\' THEN \'\"event_type\": \"synch/rwlock\"\'\n                     WHEN event_name LIKE \'wait/lock%\'         THEN \'\"event_type\": \"lock\"\'\n                     WHEN event_name LIKE \'statement/%\'        THEN \'\"event_type\": \"stmt\"\'\n                     WHEN event_name LIKE \'stage/%\'            THEN \'\"event_type\": \"stage\"\'\n                     WHEN event_name LIKE \'%idle%\'             THEN \'\"event_type\": \"idle\"\'\n                     ELSE \'\'\n                END\n            )\n            , \'}\'\n          )\n          ORDER BY event_id ASC SEPARATOR \',\') event\n    INTO json_objects\n    FROM (\n          \n          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id,\n                  CONCAT(sql_text, \'\\\\n\',\n                         \'errors: \', errors, \'\\\\n\',\n                         \'warnings: \', warnings, \'\\\\n\',\n                         \'lock time: \', ROUND(lock_time/1000000, 2),\'us\\\\n\',\n                         \'rows affected: \', rows_affected, \'\\\\n\',\n                         \'rows sent: \', rows_sent, \'\\\\n\',\n                         \'rows examined: \', rows_examined, \'\\\\n\',\n                         \'tmp tables: \', created_tmp_tables, \'\\\\n\',\n                         \'tmp disk tables: \', created_tmp_disk_tables, \'\\\\n\',\n                         \'select scan: \', select_scan, \'\\\\n\',\n                         \'select full join: \', select_full_join, \'\\\\n\',\n                         \'select full range join: \', select_full_range_join, \'\\\\n\',\n                         \'select range: \', select_range, \'\\\\n\',\n                         \'select range check: \', select_range_check, \'\\\\n\',\n                         \'sort merge passes: \', sort_merge_passes, \'\\\\n\',\n                         \'sort rows: \', sort_rows, \'\\\\n\',\n                         \'sort range: \', sort_range, \'\\\\n\',\n                         \'sort scan: \', sort_scan, \'\\\\n\',\n                         \'no index used: \', IF(no_index_used, \'TRUE\', \'FALSE\'), \'\\\\n\',\n                         \'no good index used: \', IF(no_good_index_used, \'TRUE\', \'FALSE\'), \'\\\\n\'\n                         ) AS wait_info\n             FROM performance_schema.events_statements_history_long WHERE thread_id = thd_id)\n          UNION\n          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info\n             FROM performance_schema.events_stages_history_long WHERE thread_id = thd_id)\n          UNION \n          (SELECT thread_id, event_id,\n                  CONCAT(event_name ,\n                         IF(event_name NOT LIKE \'wait/synch/mutex%\', IFNULL(CONCAT(\' - \', operation), \'\'), \'\'),\n                         IF(number_of_bytes IS NOT NULL, CONCAT(\' \', number_of_bytes, \' bytes\'), \'\'),\n                         IF(event_name LIKE \'wait/io/file%\', \'\\\\n\', \'\'),\n                         IF(object_schema IS NOT NULL, CONCAT(\'\\\\nObject: \', object_schema, \'.\'), \'\'),\n                         IF(object_name IS NOT NULL,\n                            IF (event_name LIKE \'wait/io/socket%\',\n                                CONCAT(IF (object_name LIKE \':0%\', @@socket, object_name)),\n                                object_name),\n                            \'\'),\n                          IF(index_name IS NOT NULL, CONCAT(\' Index: \', index_name), \'\'),\'\\\\n\'\n                         ) AS event_name,\n                  timer_wait, timer_start, nesting_event_id, source AS wait_info\n             FROM performance_schema.events_waits_history_long WHERE thread_id = thd_id)) events\n    ORDER BY event_id;\n    RETURN CONCAT(\'{\',\n                  CONCAT_WS(\',\',\n                            \'\"rankdir\": \"LR\"\',\n                            \'\"nodesep\": \"0.10\"\',\n                            CONCAT(\'\"stack_created\": \"\', NOW(), \'\"\'),\n                            CONCAT(\'\"mysql_version\": \"\', VERSION(), \'\"\'),\n                            CONCAT(\'\"mysql_user\": \"\', CURRENT_USER(), \'\"\'),\n                            CONCAT(\'\"events\": [\', IFNULL(json_objects,\'\'), \']\')\n                           ),\n                  \'}\');\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Outputs a JSON formatted stack of all statements, stages and events\n             within Performance Schema for the specified thread.\n             Parameters\n             thd_id (BIGINT UNSIGNED):\n               The id of the thread to trace. This should match the thread_id\n               column from the performance_schema.threads table.\n             in_verbose (BOOLEAN):\n               Include file:lineno information in the events.\n             Example\n             (line separation added for output)\n             mysql> SELECT sys.ps_thread_stack(37, FALSE) AS thread_stack\\G\n             *************************** 1. row ***************************\n             thread_stack: {\"rankdir\": \"LR\",\"nodesep\": \"0.10\",\"stack_created\": \"2014-02-19 13:39:03\",\n             \"mysql_version\": \"5.7.3-m13\",\"mysql_user\": \"root@localhost\",\"events\":\n             [{\"nesting_event_id\": \"0\", \"event_id\": \"10\", \"timer_wait\": 256.35, \"event_info\":\n             \"sql/select\", \"wait_info\": \"select @@version_comment limit 1\\nerrors: 0\\nwarnings: 0\\nlock time:\n             ...\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE json_objects LONGTEXT;\n    \n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE processlist_id = CONNECTION_ID();\n    \n    SET SESSION group_concat_max_len=@@global.max_allowed_packet;\n    SELECT GROUP_CONCAT(CONCAT( \'{\'\n              , CONCAT_WS( \', \'\n              , CONCAT(\'\"nesting_event_id\": \"\', IF(nesting_event_id IS NULL, \'0\', nesting_event_id), \'\"\')\n              , CONCAT(\'\"event_id\": \"\', event_id, \'\"\')\n              , CONCAT( \'\"timer_wait\": \', ROUND(timer_wait/1000000, 2))\n              , CONCAT( \'\"event_info\": \"\'\n                  , CASE\n                        WHEN event_name NOT LIKE \'wait/io%\' THEN REPLACE(SUBSTRING_INDEX(event_name, \'/\', -2), \'\\\', \'\\\\\')\n                        WHEN event_name NOT LIKE \'wait/io/file%\' OR event_name NOT LIKE \'wait/io/socket%\' THEN REPLACE(SUBSTRING_INDEX(event_name, \'/\', -4), \'\\\', \'\\\\\')\n                        ELSE event_name\n                    END\n                  , \'\"\'\n              )\n              , CONCAT( \'\"wait_info\": \"\', IFNULL(wait_info, \'\'), \'\"\')\n              , CONCAT( \'\"source\": \"\', IF(true AND event_name LIKE \'wait%\', IFNULL(wait_info, \'\'), \'\'), \'\"\')\n              , CASE\n                     WHEN event_name LIKE \'wait/io/file%\'      THEN \'\"event_type\": \"io/file\"\'\n                     WHEN event_name LIKE \'wait/io/table%\'     THEN \'\"event_type\": \"io/table\"\'\n                     WHEN event_name LIKE \'wait/io/socket%\'    THEN \'\"event_type\": \"io/socket\"\'\n                     WHEN event_name LIKE \'wait/synch/mutex%\'  THEN \'\"event_type\": \"synch/mutex\"\'\n                     WHEN event_name LIKE \'wait/synch/cond%\'   THEN \'\"event_type\": \"synch/cond\"\'\n                     WHEN event_name LIKE \'wait/synch/rwlock%\' THEN \'\"event_type\": \"synch/rwlock\"\'\n                     WHEN event_name LIKE \'wait/lock%\'         THEN \'\"event_type\": \"lock\"\'\n                     WHEN event_name LIKE \'statement/%\'        THEN \'\"event_type\": \"stmt\"\'\n                     WHEN event_name LIKE \'stage/%\'            THEN \'\"event_type\": \"stage\"\'\n                     WHEN event_name LIKE \'%idle%\'             THEN \'\"event_type\": \"idle\"\'\n                     ELSE \'\'\n                END\n            )\n            , \'}\'\n          )\n          ORDER BY event_id ASC SEPARATOR \',\') event\n    INTO json_objects\n    FROM (\n          \n          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id,\n                  CONCAT(sql_text, \'\\n\',\n                         \'errors: \', errors, \'\\n\',\n                         \'warnings: \', warnings, \'\\n\',\n                         \'lock time: \', ROUND(lock_time/1000000, 2),\'us\\n\',\n                         \'rows affected: \', rows_affected, \'\\n\',\n                         \'rows sent: \', rows_sent, \'\\n\',\n                         \'rows examined: \', rows_examined, \'\\n\',\n                         \'tmp tables: \', created_tmp_tables, \'\\n\',\n                         \'tmp disk tables: \', created_tmp_disk_tables, \'\\n\',\n                         \'select scan: \', select_scan, \'\\n\',\n                         \'select full join: \', select_full_join, \'\\n\',\n                         \'select full range join: \', select_full_range_join, \'\\n\',\n                         \'select range: \', select_range, \'\\n\',\n                         \'select range check: \', select_range_check, \'\\n\',\n                         \'sort merge passes: \', sort_merge_passes, \'\\n\',\n                         \'sort rows: \', sort_rows, \'\\n\',\n                         \'sort range: \', sort_range, \'\\n\',\n                         \'sort scan: \', sort_scan, \'\\n\',\n                         \'no index used: \', IF(no_index_used, \'TRUE\', \'FALSE\'), \'\\n\',\n                         \'no good index used: \', IF(no_good_index_used, \'TRUE\', \'FALSE\'), \'\\n\'\n                         ) AS wait_info\n             FROM performance_schema.events_statements_history_long WHERE thread_id = thd_id)\n          UNION\n          (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info\n             FROM performance_schema.events_stages_history_long WHERE thread_id = thd_id)\n          UNION \n          (SELECT thread_id, event_id,\n                  CONCAT(event_name ,\n                         IF(event_name NOT LIKE \'wait/synch/mutex%\', IFNULL(CONCAT(\' - \', operation), \'\'), \'\'),\n                         IF(number_of_bytes IS NOT NULL, CONCAT(\' \', number_of_bytes, \' bytes\'), \'\'),\n                         IF(event_name LIKE \'wait/io/file%\', \'\\n\', \'\'),\n                         IF(object_schema IS NOT NULL, CONCAT(\'\\nObject: \', object_schema, \'.\'), \'\'),\n                         IF(object_name IS NOT NULL,\n                            IF (event_name LIKE \'wait/io/socket%\',\n                                CONCAT(IF (object_name LIKE \':0%\', @@socket, object_name)),\n                                object_name),\n                            \'\'),\n                          IF(index_name IS NOT NULL, CONCAT(\' Index: \', index_name), \'\'),\'\\n\'\n                         ) AS event_name,\n                  timer_wait, timer_start, nesting_event_id, source AS wait_info\n             FROM performance_schema.events_waits_history_long WHERE thread_id = thd_id)) events\n    ORDER BY event_id;\n    RETURN CONCAT(\'{\',\n                  CONCAT_WS(\',\',\n                            \'\"rankdir\": \"LR\"\',\n                            \'\"nodesep\": \"0.10\"\',\n                            CONCAT(\'\"stack_created\": \"\', NOW(), \'\"\'),\n                            CONCAT(\'\"mysql_version\": \"\', VERSION(), \'\"\'),\n                            CONCAT(\'\"mysql_user\": \"\', CURRENT_USER(), \'\"\'),\n                            CONCAT(\'\"events\": [\', IFNULL(json_objects,\'\'), \']\')\n                           ),\n                  \'}\');\nEND','NONE'),
('sys','ps_thread_trx_info','FUNCTION','ps_thread_trx_info','SQL','READS_SQL_DATA','NO','INVOKER','in_thread_id BIGINT UNSIGNED\n    ','longtext CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    DECLARE v_output LONGTEXT DEFAULT \'{}\';\n    DECLARE v_msg_text TEXT DEFAULT \'\';\n    DECLARE v_signal_msg TEXT DEFAULT \'\';\n    DECLARE v_mysql_errno INT;\n    DECLARE v_max_output_len BIGINT;\n    DECLARE EXIT HANDLER FOR SQLWARNING, SQLEXCEPTION\n    BEGIN\n        GET DIAGNOSTICS CONDITION 1\n            v_msg_text = MESSAGE_TEXT,\n            v_mysql_errno = MYSQL_ERRNO;\n        IF v_mysql_errno = 1260 THEN\n            SET v_signal_msg = CONCAT(\'{ \"error\": \"Trx info truncated: \', v_msg_text, \'\" }\');\n        ELSE\n            SET v_signal_msg = CONCAT(\'{ \"error\": \"\', v_msg_text, \'\" }\');\n        END IF;\n        RETURN v_signal_msg;\n    END;\n    IF (@sys.ps_thread_trx_info.max_length IS NULL) THEN\n        SET @sys.ps_thread_trx_info.max_length = sys.sys_get_config(\'ps_thread_trx_info.max_length\', 65535);\n    END IF;\n    IF (@sys.ps_thread_trx_info.max_length != @@session.group_concat_max_len) THEN\n        SET @old_group_concat_max_len = @@session.group_concat_max_len;\n        SET v_max_output_len = (@sys.ps_thread_trx_info.max_length - 5);\n        SET SESSION group_concat_max_len = v_max_output_len;\n    END IF;\n    SET v_output = (\n        SELECT CONCAT(\'[\', IFNULL(GROUP_CONCAT(trx_info ORDER BY event_id), \'\'), \'\\n]\') AS trx_info\n          FROM (SELECT trxi.thread_id,\n                       trxi.event_id,\n                       GROUP_CONCAT(\n                         IFNULL(\n                           CONCAT(\'\\n  {\\n\',\n                                  \'    \"time\": \"\', IFNULL(sys.format_time(trxi.timer_wait), \'\'), \'\",\\n\',\n                                  \'    \"state\": \"\', IFNULL(trxi.state, \'\'), \'\",\\n\',\n                                  \'    \"mode\": \"\', IFNULL(trxi.access_mode, \'\'), \'\",\\n\',\n                                  \'    \"autocommitted\": \"\', IFNULL(trxi.autocommit, \'\'), \'\",\\n\',\n                                  \'    \"gtid\": \"\', IFNULL(trxi.gtid, \'\'), \'\",\\n\',\n                                  \'    \"isolation\": \"\', IFNULL(trxi.isolation_level, \'\'), \'\",\\n\',\n                                  \'    \"statements_executed\": [\', IFNULL(s.stmts, \'\'), IF(s.stmts IS NULL, \' ]\\n\', \'\\n    ]\\n\'),\n                                  \'  }\'\n                           ),\n                           \'\')\n                         ORDER BY event_id) AS trx_info\n                  FROM (\n                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level\n                           FROM performance_schema.events_transactions_current\n                          WHERE thread_id = in_thread_id\n                            AND end_event_id IS NULL)\n                        UNION\n                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level\n                           FROM performance_schema.events_transactions_history\n                          WHERE thread_id = in_thread_id)\n                       ) AS trxi\n                  LEFT JOIN (SELECT thread_id,\n                                    nesting_event_id,\n                                    GROUP_CONCAT(\n                                      IFNULL(\n                                        CONCAT(\'\\n      {\\n\',\n                                               \'        \"sql_text\": \"\', IFNULL(sys.format_statement(REPLACE(sql_text, \'\\\\\', \'\\\\\\\\\')), \'\'), \'\",\\n\',\n                                               \'        \"time\": \"\', IFNULL(sys.format_time(timer_wait), \'\'), \'\",\\n\',\n                                               \'        \"schema\": \"\', IFNULL(current_schema, \'\'), \'\",\\n\',\n                                               \'        \"rows_examined\": \', IFNULL(rows_examined, \'\'), \',\\n\',\n                                               \'        \"rows_affected\": \', IFNULL(rows_affected, \'\'), \',\\n\',\n                                               \'        \"rows_sent\": \', IFNULL(rows_sent, \'\'), \',\\n\',\n                                               \'        \"tmp_tables\": \', IFNULL(created_tmp_tables, \'\'), \',\\n\',\n                                               \'        \"tmp_disk_tables\": \', IFNULL(created_tmp_disk_tables, \'\'), \',\\n\',\n                                               \'        \"sort_rows\": \', IFNULL(sort_rows, \'\'), \',\\n\',\n                                               \'        \"sort_merge_passes\": \', IFNULL(sort_merge_passes, \'\'), \'\\n\',\n                                               \'      }\'), \'\') ORDER BY event_id) AS stmts\n                               FROM performance_schema.events_statements_history\n                              WHERE sql_text IS NOT NULL\n                                AND thread_id = in_thread_id\n                              GROUP BY thread_id, nesting_event_id\n                            ) AS s\n                    ON trxi.thread_id = s.thread_id\n                   AND trxi.event_id = s.nesting_event_id\n                 WHERE trxi.thread_id = in_thread_id\n                 GROUP BY trxi.thread_id, trxi.event_id\n                ) trxs\n          GROUP BY thread_id\n    );\n    IF (@old_group_concat_max_len IS NOT NULL) THEN\n        SET SESSION group_concat_max_len = @old_group_concat_max_len;\n    END IF;\n    RETURN v_output;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns a JSON object with info on the given threads current transaction,\n             and the statements it has already executed, derived from the\n             performance_schema.events_transactions_current and\n             performance_schema.events_statements_history tables (so the consumers\n             for these also have to be enabled within Performance Schema to get full\n             data in the object).\n             When the output exceeds the default truncation length (65535), a JSON error\n             object is returned, such as:\n             { \"error\": \"Trx info truncated: Row 6 was cut by GROUP_CONCAT()\" }\n             Similar error objects are returned for other warnings/and exceptions raised\n             when calling the function.\n             The max length of the output of this function can be controlled with the\n             ps_thread_trx_info.max_length variable set via sys_config, or the\n             @sys.ps_thread_trx_info.max_length user variable, as appropriate.\n             Parameters\n             in_thread_id (BIGINT UNSIGNED):\n               The id of the thread to return the transaction info for.\n             Example\n             SELECT sys.ps_thread_trx_info(48)\\G\n             *************************** 1. row ***************************\n             sys.ps_thread_trx_info(48): [\n               {\n                 \"time\": \"790.70 us\",\n                 \"state\": \"COMMITTED\",\n                 \"mode\": \"READ WRITE\",\n                 \"autocommitted\": \"NO\",\n                 \"gtid\": \"AUTOMATIC\",\n                 \"isolation\": \"REPEATABLE READ\",\n                 \"statements_executed\": [\n                   {\n                     \"sql_text\": \"INSERT INTO info VALUES (1, \'foo\')\",\n                     \"time\": \"471.02 us\",\n                     \"schema\": \"trx\",\n                     \"rows_examined\": 0,\n                     \"rows_affected\": 1,\n                     \"rows_sent\": 0,\n                     \"tmp_tables\": 0,\n                     \"tmp_disk_tables\": 0,\n                     \"sort_rows\": 0,\n                     \"sort_merge_passes\": 0\n                   },\n                   {\n                     \"sql_text\": \"COMMIT\",\n                     \"time\": \"254.42 us\",\n                     \"schema\": \"trx\",\n                     \"rows_examined\": 0,\n                     \"rows_affected\": 0,\n                     \"rows_sent\": 0,\n                     \"tmp_tables\": 0,\n                     \"tmp_disk_tables\": 0,\n                     \"sort_rows\": 0,\n                     \"sort_merge_passes\": 0\n                   }\n                 ]\n               },\n               {\n                 \"time\": \"426.20 us\",\n                 \"state\": \"COMMITTED\",\n                 \"mode\": \"READ WRITE\",\n                 \"autocommitted\": \"NO\",\n                 \"gtid\": \"AUTOMATIC\",\n                 \"isolation\": \"REPEATABLE READ\",\n                 \"statements_executed\": [\n                   {\n                     \"sql_text\": \"INSERT INTO info VALUES (2, \'bar\')\",\n                     \"time\": \"107.33 us\",\n                     \"schema\": \"trx\",\n                     \"rows_examined\": 0,\n                     \"rows_affected\": 1,\n                     \"rows_sent\": 0,\n                     \"tmp_tables\": 0,\n                     \"tmp_disk_tables\": 0,\n                     \"sort_rows\": 0,\n                     \"sort_merge_passes\": 0\n                   },\n                   {\n                     \"sql_text\": \"COMMIT\",\n                     \"time\": \"213.23 us\",\n                     \"schema\": \"trx\",\n                     \"rows_examined\": 0,\n                     \"rows_affected\": 0,\n                     \"rows_sent\": 0,\n                     \"tmp_tables\": 0,\n                     \"tmp_disk_tables\": 0,\n                     \"sort_rows\": 0,\n                     \"sort_merge_passes\": 0\n                   }\n                 ]\n               }\n             ]\n             1 row in set (0.03 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_output LONGTEXT DEFAULT \'{}\';\n    DECLARE v_msg_text TEXT DEFAULT \'\';\n    DECLARE v_signal_msg TEXT DEFAULT \'\';\n    DECLARE v_mysql_errno INT;\n    DECLARE v_max_output_len BIGINT;\n    DECLARE EXIT HANDLER FOR SQLWARNING, SQLEXCEPTION\n    BEGIN\n        GET DIAGNOSTICS CONDITION 1\n            v_msg_text = MESSAGE_TEXT,\n            v_mysql_errno = MYSQL_ERRNO;\n        IF v_mysql_errno = 1260 THEN\n            SET v_signal_msg = CONCAT(\'{ \"error\": \"Trx info truncated: \', v_msg_text, \'\" }\');\n        ELSE\n            SET v_signal_msg = CONCAT(\'{ \"error\": \"\', v_msg_text, \'\" }\');\n        END IF;\n        RETURN v_signal_msg;\n    END;\n    IF (@sys.ps_thread_trx_info.max_length IS NULL) THEN\n        SET @sys.ps_thread_trx_info.max_length = sys.sys_get_config(\'ps_thread_trx_info.max_length\', 65535);\n    END IF;\n    IF (@sys.ps_thread_trx_info.max_length != @@session.group_concat_max_len) THEN\n        SET @old_group_concat_max_len = @@session.group_concat_max_len;\n        SET v_max_output_len = (@sys.ps_thread_trx_info.max_length - 5);\n        SET SESSION group_concat_max_len = v_max_output_len;\n    END IF;\n    SET v_output = (\n        SELECT CONCAT(\'[\', IFNULL(GROUP_CONCAT(trx_info ORDER BY event_id), \'\'), \'\\n]\') AS trx_info\n          FROM (SELECT trxi.thread_id,\n                       trxi.event_id,\n                       GROUP_CONCAT(\n                         IFNULL(\n                           CONCAT(\'\\n  {\\n\',\n                                  \'    \"time\": \"\', IFNULL(sys.format_time(trxi.timer_wait), \'\'), \'\",\\n\',\n                                  \'    \"state\": \"\', IFNULL(trxi.state, \'\'), \'\",\\n\',\n                                  \'    \"mode\": \"\', IFNULL(trxi.access_mode, \'\'), \'\",\\n\',\n                                  \'    \"autocommitted\": \"\', IFNULL(trxi.autocommit, \'\'), \'\",\\n\',\n                                  \'    \"gtid\": \"\', IFNULL(trxi.gtid, \'\'), \'\",\\n\',\n                                  \'    \"isolation\": \"\', IFNULL(trxi.isolation_level, \'\'), \'\",\\n\',\n                                  \'    \"statements_executed\": [\', IFNULL(s.stmts, \'\'), IF(s.stmts IS NULL, \' ]\\n\', \'\\n    ]\\n\'),\n                                  \'  }\'\n                           ),\n                           \'\')\n                         ORDER BY event_id) AS trx_info\n                  FROM (\n                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level\n                           FROM performance_schema.events_transactions_current\n                          WHERE thread_id = in_thread_id\n                            AND end_event_id IS NULL)\n                        UNION\n                        (SELECT thread_id, event_id, timer_wait, state,access_mode, autocommit, gtid, isolation_level\n                           FROM performance_schema.events_transactions_history\n                          WHERE thread_id = in_thread_id)\n                       ) AS trxi\n                  LEFT JOIN (SELECT thread_id,\n                                    nesting_event_id,\n                                    GROUP_CONCAT(\n                                      IFNULL(\n                                        CONCAT(\'\\n      {\\n\',\n                                               \'        \"sql_text\": \"\', IFNULL(sys.format_statement(REPLACE(sql_text, \'\\\', \'\\\\\')), \'\'), \'\",\\n\',\n                                               \'        \"time\": \"\', IFNULL(sys.format_time(timer_wait), \'\'), \'\",\\n\',\n                                               \'        \"schema\": \"\', IFNULL(current_schema, \'\'), \'\",\\n\',\n                                               \'        \"rows_examined\": \', IFNULL(rows_examined, \'\'), \',\\n\',\n                                               \'        \"rows_affected\": \', IFNULL(rows_affected, \'\'), \',\\n\',\n                                               \'        \"rows_sent\": \', IFNULL(rows_sent, \'\'), \',\\n\',\n                                               \'        \"tmp_tables\": \', IFNULL(created_tmp_tables, \'\'), \',\\n\',\n                                               \'        \"tmp_disk_tables\": \', IFNULL(created_tmp_disk_tables, \'\'), \',\\n\',\n                                               \'        \"sort_rows\": \', IFNULL(sort_rows, \'\'), \',\\n\',\n                                               \'        \"sort_merge_passes\": \', IFNULL(sort_merge_passes, \'\'), \'\\n\',\n                                               \'      }\'), \'\') ORDER BY event_id) AS stmts\n                               FROM performance_schema.events_statements_history\n                              WHERE sql_text IS NOT NULL\n                                AND thread_id = in_thread_id\n                              GROUP BY thread_id, nesting_event_id\n                            ) AS s\n                    ON trxi.thread_id = s.thread_id\n                   AND trxi.event_id = s.nesting_event_id\n                 WHERE trxi.thread_id = in_thread_id\n                 GROUP BY trxi.thread_id, trxi.event_id\n                ) trxs\n          GROUP BY thread_id\n    );\n    IF (@old_group_concat_max_len IS NOT NULL) THEN\n        SET SESSION group_concat_max_len = @old_group_concat_max_len;\n    END IF;\n    RETURN v_output;\nEND','NONE'),
('sys','create_synonym_db','PROCEDURE','create_synonym_db','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_db_name VARCHAR(64),\n        IN in_synonym VARCHAR(64)\n    ','','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_db_name_check VARCHAR(64);\n    DECLARE v_db_err_msg TEXT;\n    DECLARE v_table VARCHAR(64);\n    DECLARE v_views_created INT DEFAULT 0;\n    DECLARE v_table_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\') DEFAULT \'\';\n    DECLARE v_temp_table TEXT;\n    DECLARE c_table_names CURSOR FOR\n        SELECT TABLE_NAME\n          FROM INFORMATION_SCHEMA.TABLES\n         WHERE TABLE_SCHEMA = in_db_name;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SELECT SCHEMA_NAME INTO v_db_name_check\n      FROM INFORMATION_SCHEMA.SCHEMATA\n     WHERE SCHEMA_NAME = in_db_name;\n    IF v_db_name_check IS NULL THEN\n        SET v_db_err_msg = CONCAT(\'Unknown database \', in_db_name);\n        SIGNAL SQLSTATE \'HY000\'\n            SET MESSAGE_TEXT = v_db_err_msg;\n    END IF;\n    SELECT SCHEMA_NAME INTO v_db_name_check\n      FROM INFORMATION_SCHEMA.SCHEMATA\n     WHERE SCHEMA_NAME = in_synonym;\n    IF v_db_name_check = in_synonym THEN\n        SET v_db_err_msg = CONCAT(\'Can\\\'t create database \', in_synonym, \'; database exists\');\n        SIGNAL SQLSTATE \'HY000\'\n            SET MESSAGE_TEXT = v_db_err_msg;\n    END IF;\n    SET @create_db_stmt := CONCAT(\'CREATE DATABASE \', sys.quote_identifier(in_synonym));\n    PREPARE create_db_stmt FROM @create_db_stmt;\n    EXECUTE create_db_stmt;\n    DEALLOCATE PREPARE create_db_stmt;\n    SET v_done = FALSE;\n    OPEN c_table_names;\n    c_table_names: LOOP\n        FETCH c_table_names INTO v_table;\n        IF v_done THEN\n            LEAVE c_table_names;\n        END IF;\n        CALL sys.table_exists(in_db_name, v_table, v_table_exists);\n        IF (v_table_exists = \'TEMPORARY\') THEN\n            SET v_temp_table =\n            CONCAT(\n                \'Table\',\n                 sys.quote_identifier(in_db_name),\n                 \'.\',\n                 sys.quote_identifier(v_table),\n                 \'shadows base table. View cannot be created! Terminating!\');\n             SIGNAL SQLSTATE \'HY000\'\n                 SET MESSAGE_TEXT = v_temp_table;\n             LEAVE c_table_names;\n        END IF;\n        SET @create_view_stmt = CONCAT(\n            \'CREATE SQL SECURITY INVOKER VIEW \',\n            sys.quote_identifier(in_synonym),\n            \'.\',\n            sys.quote_identifier(v_table),\n            \' AS SELECT * FROM \',\n            sys.quote_identifier(in_db_name),\n            \'.\',\n            sys.quote_identifier(v_table)\n        );\n        PREPARE create_view_stmt FROM @create_view_stmt;\n        EXECUTE create_view_stmt;\n        DEALLOCATE PREPARE create_view_stmt;\n        SET v_views_created = v_views_created + 1;\n    END LOOP;\n    CLOSE c_table_names;\n    SELECT CONCAT(\n        \'Created \', v_views_created, \' view\',\n        IF(v_views_created != 1, \'s\', \'\'), \' in the \',\n        sys.quote_identifier(in_synonym), \' database\'\n    ) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a source database name and synonym name, and then creates the\n             synonym database with views that point to all of the tables within\n             the source database.\n             Useful for creating a \"ps\" synonym for \"performance_schema\",\n             or \"is\" instead of \"information_schema\", for example.\n             Parameters\n             in_db_name (VARCHAR(64)):\n               The database name that you would like to create a synonym for.\n             in_synonym (VARCHAR(64)):\n               The database synonym name.\n             Example\n             mysql> SHOW DATABASES;\n             +--------------------+\n             | Database           |\n             +--------------------+\n             | information_schema |\n             | mysql              |\n             | performance_schema |\n             | sys                |\n             | test               |\n             +--------------------+\n             5 rows in set (0.00 sec)\n             mysql> CALL sys.create_synonym_db(\'performance_schema\', \'ps\');\n             +---------------------------------------+\n             | summary                               |\n             +---------------------------------------+\n             | Created 74 views in the `ps` database |\n             +---------------------------------------+\n             1 row in set (8.57 sec)\n             Query OK, 0 rows affected (8.57 sec)\n             mysql> SHOW DATABASES;\n             +--------------------+\n             | Database           |\n             +--------------------+\n             | information_schema |\n             | mysql              |\n             | performance_schema |\n             | ps                 |\n             | sys                |\n             | test               |\n             +--------------------+\n             6 rows in set (0.00 sec)\n             mysql> SHOW FULL TABLES FROM ps;\n             +------------------------------------------------------+------------+\n             | Tables_in_ps                                         | Table_type |\n             +------------------------------------------------------+------------+\n             | accounts                                             | VIEW       |\n             | cond_instances                                       | VIEW       |\n             | events_stages_current                                | VIEW       |\n             | events_stages_history                                | VIEW       |\n             ...\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_db_name_check VARCHAR(64);\n    DECLARE v_db_err_msg TEXT;\n    DECLARE v_table VARCHAR(64);\n    DECLARE v_views_created INT DEFAULT 0;\n    DECLARE v_table_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\') DEFAULT \'\';\n    DECLARE v_temp_table TEXT;\n    DECLARE c_table_names CURSOR FOR\n        SELECT TABLE_NAME\n          FROM INFORMATION_SCHEMA.TABLES\n         WHERE TABLE_SCHEMA = in_db_name;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SELECT SCHEMA_NAME INTO v_db_name_check\n      FROM INFORMATION_SCHEMA.SCHEMATA\n     WHERE SCHEMA_NAME = in_db_name;\n    IF v_db_name_check IS NULL THEN\n        SET v_db_err_msg = CONCAT(\'Unknown database \', in_db_name);\n        SIGNAL SQLSTATE \'HY000\'\n            SET MESSAGE_TEXT = v_db_err_msg;\n    END IF;\n    SELECT SCHEMA_NAME INTO v_db_name_check\n      FROM INFORMATION_SCHEMA.SCHEMATA\n     WHERE SCHEMA_NAME = in_synonym;\n    IF v_db_name_check = in_synonym THEN\n        SET v_db_err_msg = CONCAT(\'Can\'\'t create database \', in_synonym, \'; database exists\');\n        SIGNAL SQLSTATE \'HY000\'\n            SET MESSAGE_TEXT = v_db_err_msg;\n    END IF;\n    SET @create_db_stmt := CONCAT(\'CREATE DATABASE \', sys.quote_identifier(in_synonym));\n    PREPARE create_db_stmt FROM @create_db_stmt;\n    EXECUTE create_db_stmt;\n    DEALLOCATE PREPARE create_db_stmt;\n    SET v_done = FALSE;\n    OPEN c_table_names;\n    c_table_names: LOOP\n        FETCH c_table_names INTO v_table;\n        IF v_done THEN\n            LEAVE c_table_names;\n        END IF;\n        CALL sys.table_exists(in_db_name, v_table, v_table_exists);\n        IF (v_table_exists = \'TEMPORARY\') THEN\n            SET v_temp_table =\n            CONCAT(\n                \'Table\',\n                 sys.quote_identifier(in_db_name),\n                 \'.\',\n                 sys.quote_identifier(v_table),\n                 \'shadows base table. View cannot be created! Terminating!\');\n             SIGNAL SQLSTATE \'HY000\'\n                 SET MESSAGE_TEXT = v_temp_table;\n             LEAVE c_table_names;\n        END IF;\n        SET @create_view_stmt = CONCAT(\n            \'CREATE SQL SECURITY INVOKER VIEW \',\n            sys.quote_identifier(in_synonym),\n            \'.\',\n            sys.quote_identifier(v_table),\n            \' AS SELECT * FROM \',\n            sys.quote_identifier(in_db_name),\n            \'.\',\n            sys.quote_identifier(v_table)\n        );\n        PREPARE create_view_stmt FROM @create_view_stmt;\n        EXECUTE create_view_stmt;\n        DEALLOCATE PREPARE create_view_stmt;\n        SET v_views_created = v_views_created + 1;\n    END LOOP;\n    CLOSE c_table_names;\n    SELECT CONCAT(\n        \'Created \', v_views_created, \' view\',\n        IF(v_views_created != 1, \'s\', \'\'), \' in the \',\n        sys.quote_identifier(in_synonym), \' database\'\n    ) AS summary;\nEND','NONE'),
('sys','format_path','FUNCTION','format_path','SQL','NO_SQL','YES','INVOKER','in_path VARCHAR(512)\n    ','varchar(512) CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n  DECLARE v_dir VARCHAR(1024);\n  DECLARE v_path VARCHAR(512);\n  DECLARE path_separator CHAR(1) DEFAULT \'/\';\n  IF @@global.version_compile_os LIKE \'win%\' THEN\n    SET path_separator = \'\\\\\';\n  END IF;\n  IF in_path LIKE \'/private/%\' THEN\n    SET v_path = REPLACE(in_path, \'/private\', \'\');\n  ELSE\n    SET v_path = in_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_data_home_dir\'), \'\');\n  IF v_path IS NULL THEN\n    RETURN NULL;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.datadir, IF(SUBSTRING(@@global.datadir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.datadir, CONCAT(\'@@datadir\', IF(SUBSTRING(@@global.datadir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.tmpdir, IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.tmpdir, CONCAT(\'@@tmpdir\', IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_data_home_dir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_data_home_dir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_log_group_home_dir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_log_group_home_dir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'slave_load_tmpdir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@slave_load_tmpdir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir = IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_undo_directory\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_undo_directory\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.basedir, IF(SUBSTRING(@@global.basedir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.basedir, CONCAT(\'@@basedir\', IF(SUBSTRING(@@global.basedir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  RETURN v_path;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a raw path value, and strips out the datadir or tmpdir\n             replacing with @@datadir and @@tmpdir respectively.\n             Also normalizes the paths across operating systems, so backslashes\n             on Windows are converted to forward slashes\n             Parameters\n             path (VARCHAR(512)):\n               The raw file path value to format.\n             Returns\n             VARCHAR(512) CHARSET UTF8\n             Example\n             mysql> select @@datadir;\n             +-----------------------------------------------+\n             | @@datadir                                     |\n             +-----------------------------------------------+\n             | /Users/mark/sandboxes/SmallTree/AMaster/data/ |\n             +-----------------------------------------------+\n             1 row in set (0.06 sec)\n             mysql> select format_path(\'/Users/mark/sandboxes/SmallTree/AMaster/data/mysql/proc.MYD\') AS path;\n             +--------------------------+\n             | path                     |\n             +--------------------------+\n             | @@datadir/mysql/proc.MYD |\n             +--------------------------+\n             1 row in set (0.03 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n  DECLARE v_dir VARCHAR(1024);\n  DECLARE v_path VARCHAR(512);\n  DECLARE path_separator CHAR(1) DEFAULT \'/\';\n  IF @@global.version_compile_os LIKE \'win%\' THEN\n    SET path_separator = \'\\\';\n  END IF;\n  IF in_path LIKE \'/private/%\' THEN\n    SET v_path = REPLACE(in_path, \'/private\', \'\');\n  ELSE\n    SET v_path = in_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_data_home_dir\'), \'\');\n  IF v_path IS NULL THEN\n    RETURN NULL;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.datadir, IF(SUBSTRING(@@global.datadir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.datadir, CONCAT(\'@@datadir\', IF(SUBSTRING(@@global.datadir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.tmpdir, IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.tmpdir, CONCAT(\'@@tmpdir\', IF(SUBSTRING(@@global.tmpdir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_data_home_dir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_data_home_dir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_log_group_home_dir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_log_group_home_dir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir= IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'slave_load_tmpdir\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@slave_load_tmpdir\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  SET v_dir = IFNULL((SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = \'innodb_undo_directory\'), \'\');\n  IF v_path LIKE CONCAT(v_dir, IF(SUBSTRING(v_dir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, v_dir, CONCAT(\'@@innodb_undo_directory\', IF(SUBSTRING(v_dir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  IF v_path LIKE CONCAT(@@global.basedir, IF(SUBSTRING(@@global.basedir, -1) = path_separator, \'%\', CONCAT(path_separator, \'%\'))) ESCAPE \'|\' THEN\n    SET v_path = REPLACE(v_path, @@global.basedir, CONCAT(\'@@basedir\', IF(SUBSTRING(@@global.basedir, -1) = path_separator, path_separator, \'\')));\n    RETURN v_path;\n  END IF;\n  RETURN v_path;\nEND','NONE'),
('sys','format_statement','FUNCTION','format_statement','SQL','NO_SQL','YES','INVOKER','statement LONGTEXT\n    ','longtext CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n  IF @sys.statement_truncate_len IS NULL THEN\n      SET @sys.statement_truncate_len = sys_get_config(\'statement_truncate_len\', 64);\n  END IF;\n  IF CHAR_LENGTH(statement) > @sys.statement_truncate_len THEN\n      RETURN REPLACE(CONCAT(LEFT(statement, (@sys.statement_truncate_len/2)-2), \' ... \', RIGHT(statement, (@sys.statement_truncate_len/2)-2)), \'\\n\', \' \');\n  ELSE\n      RETURN REPLACE(statement, \'\\n\', \' \');\n  END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Formats a normalized statement, truncating it if it is > 64 characters long by default.\n             To configure the length to truncate the statement to by default, update the `statement_truncate_len`\n             variable with `sys_config` table to a different value. Alternatively, to change it just for just\n             your particular session, use `SET @sys.statement_truncate_len := <some new value>`.\n             Useful for printing statement related data from Performance Schema from\n             the command line.\n             Parameters\n             statement (LONGTEXT):\n               The statement to format.\n             Returns\n             LONGTEXT\n             Example\n             mysql> SELECT sys.format_statement(digest_text)\n                 ->   FROM performance_schema.events_statements_summary_by_digest\n                 ->  ORDER by sum_timer_wait DESC limit 5;\n             +-------------------------------------------------------------------+\n             | sys.format_statement(digest_text)                                 |\n             +-------------------------------------------------------------------+\n             | CREATE SQL SECURITY INVOKER VI ... KE ? AND `variable_value` > ?  |\n             | CREATE SQL SECURITY INVOKER VI ... ait` IS NOT NULL , `esc` . ... |\n             | CREATE SQL SECURITY INVOKER VI ... ait` IS NOT NULL , `sys` . ... |\n             | CREATE SQL SECURITY INVOKER VI ...  , `compressed_size` ) ) DESC  |\n             | CREATE SQL SECURITY INVOKER VI ... LIKE ? ORDER BY `timer_start`  |\n             +-------------------------------------------------------------------+\n             5 rows in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n  IF @sys.statement_truncate_len IS NULL THEN\n      SET @sys.statement_truncate_len = sys_get_config(\'statement_truncate_len\', 64);\n  END IF;\n  IF CHAR_LENGTH(statement) > @sys.statement_truncate_len THEN\n      RETURN REPLACE(CONCAT(LEFT(statement, (@sys.statement_truncate_len/2)-2), \' ... \', RIGHT(statement, (@sys.statement_truncate_len/2)-2)), \'\\n\', \' \');\n  ELSE\n      RETURN REPLACE(statement, \'\\n\', \' \');\n  END IF;\nEND','NONE'),
('sys','list_add','FUNCTION','list_add','SQL','CONTAINS_SQL','YES','INVOKER','in_list TEXT,\n        in_add_value TEXT\n    ','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    IF (in_add_value IS NULL) THEN\n        SIGNAL SQLSTATE \'02200\'\n           SET MESSAGE_TEXT = \'Function sys.list_add: in_add_value input variable should not be NULL\',\n               MYSQL_ERRNO = 1138;\n    END IF;\n    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN\n        RETURN in_add_value;\n    END IF;\n    RETURN (SELECT CONCAT(TRIM(BOTH \',\' FROM TRIM(in_list)), \',\', in_add_value));\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a list, and a value to add to the list, and returns the resulting list.\n             Useful for altering certain session variables, like sql_mode or optimizer_switch for instance.\n             Parameters\n             in_list (TEXT):\n               The comma separated list to add a value to\n             in_add_value (TEXT):\n               The value to add to the input list\n             Returns\n             TEXT\n             Example\n             mysql> select @@sql_mode;\n             +-----------------------------------------------------------------------------------+\n             | @@sql_mode                                                                        |\n             +-----------------------------------------------------------------------------------+\n             | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n             +-----------------------------------------------------------------------------------+\n             1 row in set (0.00 sec)\n             mysql> set sql_mode = sys.list_add(@@sql_mode, \'ANSI_QUOTES\');\n             Query OK, 0 rows affected (0.06 sec)\n             mysql> select @@sql_mode;\n             +-----------------------------------------------------------------------------------------------+\n             | @@sql_mode                                                                                    |\n             +-----------------------------------------------------------------------------------------------+\n             | ANSI_QUOTES,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n             +-----------------------------------------------------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    IF (in_add_value IS NULL) THEN\n        SIGNAL SQLSTATE \'02200\'\n           SET MESSAGE_TEXT = \'Function sys.list_add: in_add_value input variable should not be NULL\',\n               MYSQL_ERRNO = 1138;\n    END IF;\n    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN\n        RETURN in_add_value;\n    END IF;\n    RETURN (SELECT CONCAT(TRIM(BOTH \',\' FROM TRIM(in_list)), \',\', in_add_value));\nEND','NONE'),
('sys','diagnostics','PROCEDURE','diagnostics','SQL','READS_SQL_DATA','NO','INVOKER','\n        IN in_max_runtime int unsigned, IN in_interval int unsigned,\n        IN in_auto_config enum (\'current\', \'medium\', \'full\')\n    ','','BEGIN\n    DECLARE v_start, v_runtime, v_iter_start, v_sleep DECIMAL(20,2) DEFAULT 0.0;\n    DECLARE v_has_innodb, v_has_ndb, v_has_ps, v_has_replication, v_has_ps_replication VARCHAR(8) CHARSET utf8 DEFAULT \'NO\';\n    DECLARE v_this_thread_enabled, v_has_ps_vars, v_has_metrics ENUM(\'YES\', \'NO\');\n    DECLARE v_table_name, v_banner VARCHAR(64) CHARSET utf8;\n    DECLARE v_sql_status_summary_select, v_sql_status_summary_delta, v_sql_status_summary_from, v_no_delta_names TEXT;\n    DECLARE v_output_time, v_output_time_prev DECIMAL(20,3) UNSIGNED;\n    DECLARE v_output_count, v_count, v_old_group_concat_max_len INT UNSIGNED DEFAULT 0;\n    DECLARE v_status_summary_width TINYINT UNSIGNED DEFAULT 50;\n    DECLARE v_done BOOLEAN DEFAULT FALSE;\n    DECLARE c_ndbinfo CURSOR FOR\n        SELECT TABLE_NAME\n          FROM information_schema.TABLES\n         WHERE TABLE_SCHEMA = \'ndbinfo\'\n               AND TABLE_NAME NOT IN (\n                  \'blocks\',\n                  \'config_params\',\n                  \'dict_obj_types\',\n                  \'disk_write_speed_base\',\n                  \'memory_per_fragment\',\n                  \'memoryusage\',\n                  \'operations_per_fragment\',\n                  \'threadblocks\'\n               );\n    DECLARE c_sysviews_w_delta CURSOR FOR\n        SELECT table_name\n          FROM tmp_sys_views_delta\n         ORDER BY table_name;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    END IF;\n    IF (in_max_runtime < in_interval) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_max_runtime must be greater than or equal to in_interval\';\n    END IF;\n    IF (in_max_runtime = 0) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_max_runtime must be greater than 0\';\n    END IF;\n    IF (in_interval = 0) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_interval must be greater than 0\';\n    END IF;\n    IF (@sys.diagnostics.allow_i_s_tables IS NULL) THEN\n        SET @sys.diagnostics.allow_i_s_tables = sys.sys_get_config(\'diagnostics.allow_i_s_tables\', \'OFF\');\n    END IF;\n    IF (@sys.diagnostics.include_raw IS NULL) THEN\n        SET @sys.diagnostics.include_raw      = sys.sys_get_config(\'diagnostics.include_raw\'     , \'OFF\');\n    END IF;\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug                        = sys.sys_get_config(\'debug\'                       , \'OFF\');\n    END IF;\n    IF (@sys.statement_truncate_len IS NULL) THEN\n        SET @sys.statement_truncate_len       = sys.sys_get_config(\'statement_truncate_len\'      , \'64\' );\n    END IF;\n    SET @log_bin := @@sql_log_bin;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = 0;\n    END IF;\n    SET v_no_delta_names = CONCAT(\'s%{COUNT}.Variable_name NOT IN (\',\n        \'\'\'innodb_buffer_pool_pages_total\'\', \',\n        \'\'\'innodb_page_size\'\', \',\n        \'\'\'last_query_cost\'\', \',\n        \'\'\'last_query_partial_plans\'\', \',\n        \'\'\'qcache_total_blocks\'\', \',\n        \'\'\'slave_last_heartbeat\'\', \',\n        \'\'\'ssl_ctx_verify_depth\'\', \',\n        \'\'\'ssl_ctx_verify_mode\'\', \',\n        \'\'\'ssl_session_cache_size\'\', \',\n        \'\'\'ssl_verify_depth\'\', \',\n        \'\'\'ssl_verify_mode\'\', \',\n        \'\'\'ssl_version\'\', \',\n        \'\'\'buffer_flush_lsn_avg_rate\'\', \',\n        \'\'\'buffer_flush_pct_for_dirty\'\', \',\n        \'\'\'buffer_flush_pct_for_lsn\'\', \',\n        \'\'\'buffer_pool_pages_total\'\', \',\n        \'\'\'lock_row_lock_time_avg\'\', \',\n        \'\'\'lock_row_lock_time_max\'\', \',\n        \'\'\'innodb_page_size\'\'\',\n    \')\');\n    IF (in_auto_config <> \'current\') THEN\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'Updating Performance Schema configuration to \', in_auto_config) AS \'Debug\';\n        END IF;\n        CALL sys.ps_setup_save(0);\n        IF (in_auto_config = \'medium\') THEN\n            UPDATE performance_schema.setup_consumers\n                SET ENABLED = \'YES\'\n            WHERE NAME NOT LIKE \'%\\_history%\';\n            UPDATE performance_schema.setup_instruments\n                SET ENABLED = \'YES\',\n                    TIMED   = \'YES\'\n            WHERE NAME NOT LIKE \'wait/synch/%\';\n        ELSEIF (in_auto_config = \'full\') THEN\n            UPDATE performance_schema.setup_consumers\n                SET ENABLED = \'YES\';\n            UPDATE performance_schema.setup_instruments\n                SET ENABLED = \'YES\',\n                    TIMED   = \'YES\';\n        END IF;\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = \'YES\'\n         WHERE PROCESSLIST_ID <> CONNECTION_ID();\n    END IF;\n    SET v_start        = UNIX_TIMESTAMP(NOW(2)),\n        in_interval    = IFNULL(in_interval, 30),\n        in_max_runtime = IFNULL(in_max_runtime, 60);\n    SET v_banner = REPEAT(\n                      \'-\',\n                      LEAST(\n                         GREATEST(\n                            36,\n                            CHAR_LENGTH(VERSION()),\n                            CHAR_LENGTH(@@global.version_comment),\n                            CHAR_LENGTH(@@global.version_compile_os),\n                            CHAR_LENGTH(@@global.version_compile_machine),\n                            CHAR_LENGTH(@@global.socket),\n                            CHAR_LENGTH(@@global.datadir)\n                         ),\n                         64\n                      )\n                   );\n    SELECT \'Hostname\' AS \'Name\', @@global.hostname AS \'Value\'\n    UNION ALL\n    SELECT \'Port\' AS \'Name\', @@global.port AS \'Value\'\n    UNION ALL\n    SELECT \'Socket\' AS \'Name\', @@global.socket AS \'Value\'\n    UNION ALL\n    SELECT \'Datadir\' AS \'Name\', @@global.datadir AS \'Value\'\n    UNION ALL\n    SELECT REPEAT(\'-\', 23) AS \'Name\', v_banner AS \'Value\'\n    UNION ALL\n    SELECT \'MySQL Version\' AS \'Name\', VERSION() AS \'Value\'\n    UNION ALL\n    SELECT \'Sys Schema Version\' AS \'Name\', (SELECT sys_version FROM sys.version) AS \'Value\'\n    UNION ALL\n    SELECT \'Version Comment\' AS \'Name\', @@global.version_comment AS \'Value\'\n    UNION ALL\n    SELECT \'Version Compile OS\' AS \'Name\', @@global.version_compile_os AS \'Value\'\n    UNION ALL\n    SELECT \'Version Compile Machine\' AS \'Name\', @@global.version_compile_machine AS \'Value\'\n    UNION ALL\n    SELECT REPEAT(\'-\', 23) AS \'Name\', v_banner AS \'Value\'\n    UNION ALL\n    SELECT \'UTC Time\' AS \'Name\', UTC_TIMESTAMP() AS \'Value\'\n    UNION ALL\n    SELECT \'Local Time\' AS \'Name\', NOW() AS \'Value\'\n    UNION ALL\n    SELECT \'Time Zone\' AS \'Name\', @@global.time_zone AS \'Value\'\n    UNION ALL\n    SELECT \'System Time Zone\' AS \'Name\', @@global.system_time_zone AS \'Value\'\n    UNION ALL\n    SELECT \'Time Zone Offset\' AS \'Name\', TIMEDIFF(NOW(), UTC_TIMESTAMP()) AS \'Value\';\n    SET v_has_innodb         = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'InnoDB\'), \'NO\'),\n        v_has_ndb            = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'NDBCluster\'), \'NO\'),\n        v_has_ps             = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'PERFORMANCE_SCHEMA\'), \'NO\'),\n        v_has_ps_replication = IF(v_has_ps = \'YES\'\n                                   AND EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = \'performance_schema\' AND TABLE_NAME = \'replication_applier_status\'),\n                                   \'YES\',\n                                   \'NO\'\n                               ),\n        v_has_replication    = \'MAYBE\',\n        v_has_metrics        = IF(v_has_ps = \'YES\' OR (sys.version_major() = 5 AND sys.version_minor() = 6), \'YES\', \'NO\'),\n        v_has_ps_vars        = \'NO\';\n    \n    \n    IF (@sys.debug = \'ON\') THEN\n       SELECT v_has_innodb AS \'Has_InnoDB\', v_has_ndb AS \'Has_NDBCluster\',\n              v_has_ps AS \'Has_Performance_Schema\', v_has_ps_vars AS \'Has_P_S_SHOW_Variables\',\n              v_has_metrics AS \'Has_metrics\',\n              v_has_ps_replication \'AS Has_P_S_Replication\', v_has_replication AS \'Has_Replication\';\n    END IF;\n    IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE InnoDB STATUS\';\n        PREPARE stmt_innodb_status FROM @sys.diagnostics.sql;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE PERFORMANCE_SCHEMA STATUS\';\n        PREPARE stmt_ps_status FROM @sys.diagnostics.sql;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE NDBCLUSTER STATUS\';\n        PREPARE stmt_ndbcluster_status FROM @sys.diagnostics.sql;\n    END IF;\n    SET @sys.diagnostics.sql_gen_query_template = \'SELECT CONCAT(\n           \'\'SELECT \'\',\n           GROUP_CONCAT(\n               CASE WHEN (SUBSTRING(TABLE_NAME, 3), COLUMN_NAME) IN (\n                                (\'\'io_global_by_file_by_bytes\'\', \'\'total\'\'),\n                                (\'\'io_global_by_wait_by_bytes\'\', \'\'total_requested\'\')\n                         )\n                         THEN CONCAT(\'\'sys.format_bytes(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\n                         THEN CONCAT(\'\'sys.format_time(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, -7) = \'\'_memory\'\' OR SUBSTRING(COLUMN_NAME, -17) = \'\'_memory_allocated\'\'\n                         OR ((SUBSTRING(COLUMN_NAME, -5) = \'\'_read\'\' OR SUBSTRING(COLUMN_NAME, -8) = \'\'_written\'\' OR SUBSTRING(COLUMN_NAME, -6) = \'\'_write\'\') AND SUBSTRING(COLUMN_NAME, 1, 6) <> \'\'COUNT_\'\')\n                         THEN CONCAT(\'\'sys.format_bytes(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\n                    ELSE COLUMN_NAME\n               END\n               ORDER BY ORDINAL_POSITION\n               SEPARATOR \'\',\\n       \'\'\n           ),\n           \'\'\\n  FROM tmp_\'\', SUBSTRING(TABLE_NAME FROM 3), \'\'_%{OUTPUT}\'\'\n       ) AS Query INTO @sys.diagnostics.sql_select\n  FROM information_schema.COLUMNS\n WHERE TABLE_SCHEMA = \'\'sys\'\' AND TABLE_NAME = ?\n GROUP BY TABLE_NAME\';\n    SET @sys.diagnostics.sql_gen_query_delta = \'SELECT CONCAT(\n           \'\'SELECT \'\',\n           GROUP_CONCAT(\n               CASE WHEN FIND_IN_SET(COLUMN_NAME, diag.pk)\n                         THEN COLUMN_NAME\n                    WHEN diag.TABLE_NAME = \'\'io_global_by_file_by_bytes\'\' AND COLUMN_NAME = \'\'write_pct\'\'\n                         THEN CONCAT(\'\'IFNULL(ROUND(100-(((e.total_read-IFNULL(s.total_read, 0))\'\',\n                                     \'\'/NULLIF(((e.total_read-IFNULL(s.total_read, 0))+(e.total_written-IFNULL(s.total_written, 0))), 0))*100), 2), 0.00) AS \'\',\n                                     COLUMN_NAME)\n                    WHEN (diag.TABLE_NAME, COLUMN_NAME) IN (\n                                (\'\'io_global_by_file_by_bytes\'\', \'\'total\'\'),\n                                (\'\'io_global_by_wait_by_bytes\'\', \'\'total_requested\'\')\n                         )\n                         THEN CONCAT(\'\'sys.format_bytes(e.\'\', COLUMN_NAME, \'\'-IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, 1, 4) IN (\'\'max_\'\', \'\'min_\'\') AND SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\n                         THEN CONCAT(\'\'sys.format_time(e.\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\n                    WHEN COLUMN_NAME = \'\'avg_latency\'\'\n                         THEN CONCAT(\'\'sys.format_time((e.total_latency - IFNULL(s.total_latency, 0))\'\',\n                                     \'\'/NULLIF(e.total - IFNULL(s.total, 0), 0)) AS \'\', COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, -12) = \'\'_avg_latency\'\'\n                         THEN CONCAT(\'\'sys.format_time((e.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'_latency - IFNULL(s.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'_latency, 0))\'\',\n                                     \'\'/NULLIF(e.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'s - IFNULL(s.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'s, 0), 0)) AS \'\', COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\n                         THEN CONCAT(\'\'sys.format_time(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\n                    WHEN COLUMN_NAME IN (\'\'avg_read\'\', \'\'avg_write\'\', \'\'avg_written\'\')\n                         THEN CONCAT(\'\'sys.format_bytes(IFNULL((e.total_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'written\'\'), \'\'-IFNULL(s.total_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'written\'\'), \'\', 0))\'\',\n                                     \'\'/NULLIF(e.count_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'write\'\'), \'\'-IFNULL(s.count_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'write\'\'), \'\', 0), 0), 0)) AS \'\',\n                                     COLUMN_NAME)\n                    WHEN SUBSTRING(COLUMN_NAME, -7) = \'\'_memory\'\' OR SUBSTRING(COLUMN_NAME, -17) = \'\'_memory_allocated\'\'\n                         OR ((SUBSTRING(COLUMN_NAME, -5) = \'\'_read\'\' OR SUBSTRING(COLUMN_NAME, -8) = \'\'_written\'\' OR SUBSTRING(COLUMN_NAME, -6) = \'\'_write\'\') AND SUBSTRING(COLUMN_NAME, 1, 6) <> \'\'COUNT_\'\')\n                         THEN CONCAT(\'\'sys.format_bytes(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\n                    ELSE CONCAT(\'\'(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\n               END\n               ORDER BY ORDINAL_POSITION\n               SEPARATOR \'\',\\n       \'\'\n           ),\n           \'\'\\n  FROM tmp_\'\', diag.TABLE_NAME, \'\'_end e\n       LEFT OUTER JOIN tmp_\'\', diag.TABLE_NAME, \'\'_start s USING (\'\', diag.pk, \'\')\'\'\n       ) AS Query INTO @sys.diagnostics.sql_select\n  FROM tmp_sys_views_delta diag\n       INNER JOIN information_schema.COLUMNS c ON c.TABLE_NAME = CONCAT(\'\'x$\'\', diag.TABLE_NAME)\n WHERE c.TABLE_SCHEMA = \'\'sys\'\' AND diag.TABLE_NAME = ?\n GROUP BY diag.TABLE_NAME\';\n    IF (v_has_ps = \'YES\') THEN\n        DROP TEMPORARY TABLE IF EXISTS tmp_sys_views_delta;\n        CREATE TEMPORARY TABLE tmp_sys_views_delta (\n            TABLE_NAME varchar(64) NOT NULL,\n            order_by text COMMENT \'ORDER BY clause for the initial and overall views\',\n            order_by_delta text COMMENT \'ORDER BY clause for the delta views\',\n            where_delta text COMMENT \'WHERE clause to use for delta views to only include rows with a \"count\" > 0\',\n            limit_rows int unsigned COMMENT \'The maximum number of rows to include for the view\',\n            pk varchar(128) COMMENT \'Used with the FIND_IN_SET() function so use comma separated list without whitespace\',\n            PRIMARY KEY (TABLE_NAME)\n        );\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'Populating tmp_sys_views_delta\' AS \'Debug\';\n        END IF;\n        INSERT INTO tmp_sys_views_delta\n        VALUES (\'host_summary\'                       , \'%{TABLE}.statement_latency DESC\',\n                                                       \'(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC\',\n                                                       \'(e.statements - IFNULL(s.statements, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_file_io\'            , \'%{TABLE}.io_latency DESC\',\n                                                       \'(e.io_latency-IFNULL(s.io_latency, 0)) DESC\',\n                                                       \'(e.ios - IFNULL(s.ios, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_file_io_type\'       , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event_name\'),\n               (\'host_summary_by_stages\'             , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event_name\'),\n               (\'host_summary_by_statement_latency\'  , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_statement_type\'     , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,statement\'),\n               (\'io_by_thread_by_latency\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,thread_id,processlist_id\'),\n               (\'io_global_by_file_by_bytes\'         , \'%{TABLE}.total DESC\',\n                                                       \'(e.total-IFNULL(s.total, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', 100, \'file\'),\n               (\'io_global_by_file_by_latency\'       , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', 100, \'file\'),\n               (\'io_global_by_wait_by_bytes\'         , \'%{TABLE}.total_requested DESC\',\n                                                       \'(e.total_requested-IFNULL(s.total_requested, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_name\'),\n               (\'io_global_by_wait_by_latency\'       , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_name\'),\n               (\'schema_index_statistics\'            , \'(%{TABLE}.select_latency+%{TABLE}.insert_latency+%{TABLE}.update_latency+%{TABLE}.delete_latency) DESC\',\n                                                       \'((e.select_latency+e.insert_latency+e.update_latency+e.delete_latency)-IFNULL(s.select_latency+s.insert_latency+s.update_latency+s.delete_latency, 0)) DESC\',\n                                                       \'((e.rows_selected+e.insert_latency+e.rows_updated+e.rows_deleted)-IFNULL(s.rows_selected+s.rows_inserted+s.rows_updated+s.rows_deleted, 0)) > 0\',\n                                                       100, \'table_schema,table_name,index_name\'),\n               (\'schema_table_statistics\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) > 0\', 100, \'table_schema,table_name\'),\n               (\'schema_tables_with_full_table_scans\', \'%{TABLE}.rows_full_scanned DESC\',\n                                                       \'(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) DESC\',\n                                                       \'(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) > 0\', 100, \'object_schema,object_name\'),\n               (\'user_summary\'                       , \'%{TABLE}.statement_latency DESC\',\n                                                       \'(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC\',\n                                                       \'(e.statements - IFNULL(s.statements, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_file_io\'            , \'%{TABLE}.io_latency DESC\',\n                                                       \'(e.io_latency-IFNULL(s.io_latency, 0)) DESC\',\n                                                       \'(e.ios - IFNULL(s.ios, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_file_io_type\'       , \'%{TABLE}.user, %{TABLE}.latency DESC\',\n                                                       \'e.user, (e.latency-IFNULL(s.latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event_name\'),\n               (\'user_summary_by_stages\'             , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event_name\'),\n               (\'user_summary_by_statement_latency\'  , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_statement_type\'     , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,statement\'),\n               (\'wait_classes_global_by_avg_latency\' , \'IFNULL(%{TABLE}.total_latency / NULLIF(%{TABLE}.total, 0), 0) DESC\',\n                                                       \'IFNULL((e.total_latency-IFNULL(s.total_latency, 0)) / NULLIF((e.total - IFNULL(s.total, 0)), 0), 0) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_class\'),\n               (\'wait_classes_global_by_latency\'     , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_class\'),\n               (\'waits_by_host_by_latency\'           , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event\'),\n               (\'waits_by_user_by_latency\'           , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event\'),\n               (\'waits_global_by_latency\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'events\')\n        ;\n    END IF;\n    SELECT \'\n=======================\n     Configuration\n=======================\n\' AS \'\';\n    SELECT \'GLOBAL VARIABLES\' AS \'The following output is:\';\n    IF (v_has_ps_vars = \'YES\') THEN\n        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM performance_schema.global_variables ORDER BY VARIABLE_NAME;\n    ELSE\n        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM information_schema.GLOBAL_VARIABLES ORDER BY VARIABLE_NAME;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'Performance Schema Setup - Actors\' AS \'The following output is:\';\n        SELECT * FROM performance_schema.setup_actors;\n        SELECT \'Performance Schema Setup - Consumers\' AS \'The following output is:\';\n        SELECT NAME AS Consumer, ENABLED, sys.ps_is_consumer_enabled(NAME) AS COLLECTS\n          FROM performance_schema.setup_consumers;\n        SELECT \'Performance Schema Setup - Instruments\' AS \'The following output is:\';\n        SELECT SUBSTRING_INDEX(NAME, \'/\', 2) AS \'InstrumentClass\',\n               ROUND(100*SUM(IF(ENABLED = \'YES\', 1, 0))/COUNT(*), 2) AS \'EnabledPct\',\n               ROUND(100*SUM(IF(TIMED = \'YES\', 1, 0))/COUNT(*), 2) AS \'TimedPct\'\n          FROM performance_schema.setup_instruments\n         GROUP BY SUBSTRING_INDEX(NAME, \'/\', 2)\n         ORDER BY SUBSTRING_INDEX(NAME, \'/\', 2);\n        SELECT \'Performance Schema Setup - Objects\' AS \'The following output is:\';\n        SELECT * FROM performance_schema.setup_objects;\n        SELECT \'Performance Schema Setup - Threads\' AS \'The following output is:\';\n        SELECT `TYPE` AS ThreadType, COUNT(*) AS \'Total\', ROUND(100*SUM(IF(INSTRUMENTED = \'YES\', 1, 0))/COUNT(*), 2) AS \'InstrumentedPct\'\n          FROM performance_schema.threads\n        GROUP BY TYPE;\n    END IF;\n    IF (v_has_replication = \'NO\') THEN\n        SELECT \'No Replication Configured\' AS \'Replication Status\';\n    ELSE\n        SELECT CONCAT(\'Replication Configured: \', v_has_replication, \' - Performance Schema Replication Tables: \', v_has_ps_replication) AS \'Replication Status\';\n        IF (v_has_ps_replication = \'YES\') THEN\n            SELECT \'Replication - Connection Configuration\' AS \'The following output is:\';\n            SELECT * FROM performance_schema.replication_connection_configuration;\n        END IF;\n        IF (v_has_ps_replication = \'YES\') THEN\n            SELECT \'Replication - Applier Configuration\' AS \'The following output is:\';\n            SELECT * FROM performance_schema.replication_applier_configuration ORDER BY CHANNEL_NAME;\n        END IF;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n       SELECT \'Cluster Thread Blocks\' AS \'The following output is:\';\n       SELECT * FROM ndbinfo.threadblocks;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            SELECT \'\n========================\n     Initial Status\n========================\n\' AS \'\';\n        END IF;\n        DROP TEMPORARY TABLE IF EXISTS tmp_digests_start;\n        CALL sys.statement_performance_analyzer(\'create_tmp\', \'tmp_digests_start\', NULL);\n        CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n        CALL sys.statement_performance_analyzer(\'save\', \'tmp_digests_start\', NULL);\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, \'%{OUTPUT}\', \'start\');\n            IF (@sys.debug = \'ON\') THEN\n                SELECT \'The following query will be used to generate the query for each sys view\' AS \'Debug\';\n                SELECT @sys.diagnostics.sql AS \'Debug\';\n            END IF;\n            PREPARE stmt_gen_query FROM @sys.diagnostics.sql;\n        END IF;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            IF (@sys.debug = \'ON\') THEN\n                SELECT CONCAT(\'The following queries are for storing the initial content of \', v_table_name) AS \'Debug\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS `tmp_\', v_table_name, \'_start`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE `tmp_\', v_table_name, \'_start` SELECT * FROM `sys`.`x$\', v_table_name, \'`\'));\n            IF (@sys.diagnostics.include_raw = \'ON\') THEN\n                SET @sys.diagnostics.table_name = CONCAT(\'x$\', v_table_name);\n                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;\n                SELECT CONCAT(@sys.diagnostics.sql_select,\n                              IF(order_by IS NOT NULL, CONCAT(\'\\n ORDER BY \', REPLACE(order_by, \'%{TABLE}\', CONCAT(\'tmp_\', v_table_name, \'_start\'))), \'\'),\n                              IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                       )\n                  INTO @sys.diagnostics.sql_select\n                  FROM tmp_sys_views_delta\n                 WHERE TABLE_NAME = v_table_name;\n                SELECT CONCAT(\'Initial \', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            END IF;\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            DEALLOCATE PREPARE stmt_gen_query;\n        END IF;\n    END IF;\n    SET v_sql_status_summary_select = \'SELECT Variable_name\',\n        v_sql_status_summary_delta  = \'\',\n        v_sql_status_summary_from   = \'\';\n    REPEAT\n        SET v_output_count = v_output_count + 1;\n        IF (v_output_count > 1) THEN\n            SET v_sleep = in_interval-(UNIX_TIMESTAMP(NOW(2))-v_iter_start);\n            SELECT NOW() AS \'Time\', CONCAT(\'Going to sleep for \', v_sleep, \' seconds. Please do not interrupt\') AS \'The following output is:\';\n            DO SLEEP(in_interval);\n        END IF;\n        SET v_iter_start = UNIX_TIMESTAMP(NOW(2));\n        SELECT NOW(), CONCAT(\'Iteration Number \', IFNULL(v_output_count, \'NULL\')) AS \'The following output is:\';\n        IF (@@log_bin = 1) THEN\n            SELECT \'SHOW MASTER STATUS\' AS \'The following output is:\';\n            SHOW MASTER STATUS;\n        END IF;\n        IF (v_has_replication <> \'NO\') THEN\n            SELECT \'SHOW SLAVE STATUS\' AS \'The following output is:\';\n            SHOW SLAVE STATUS;\n        END IF;\n        SET v_table_name = CONCAT(\'tmp_metrics_\', v_output_count);\n        CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS \', v_table_name));\n        CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE \', v_table_name, \' (\n  Variable_name VARCHAR(193) NOT NULL,\n  Variable_value VARCHAR(1024),\n  Type VARCHAR(100) NOT NULL,\n  Enabled ENUM(\'\'YES\'\', \'\'NO\'\', \'\'PARTIAL\'\') NOT NULL,\n  PRIMARY KEY (Type, Variable_name)\n) ENGINE = InnoDB DEFAULT CHARSET=utf8\'));\n        IF (v_has_metrics) THEN\n            SET @sys.diagnostics.sql = CONCAT(\n                \'INSERT INTO \', v_table_name,\n                \' SELECT Variable_name, REPLACE(Variable_value, \'\'\\n\'\', \'\'\\\\\\\\n\'\') AS Variable_value, Type, Enabled FROM sys.metrics\'\n            );\n        ELSE\n            SET @sys.diagnostics.sql = CONCAT(\n                \'INSERT INTO \', v_table_name,\n                \'(SELECT LOWER(VARIABLE_NAME) AS Variable_name, REPLACE(VARIABLE_VALUE, \'\'\\n\'\', \'\'\\\\\\\\n\'\') AS Variable_value,\n                         \'\'Global Status\'\' AS Type, \'\'YES\'\' AS Enabled\n  FROM performance_schema.global_status\n) UNION ALL (\nSELECT NAME AS Variable_name, COUNT AS Variable_value,\n       CONCAT(\'\'InnoDB Metrics - \'\', SUBSYSTEM) AS Type,\n       IF(STATUS = \'\'enabled\'\', \'\'YES\'\', \'\'NO\'\') AS Enabled\n  FROM information_schema.INNODB_METRICS\n WHERE NAME NOT IN (\n     \'\'lock_row_lock_time\'\', \'\'lock_row_lock_time_avg\'\', \'\'lock_row_lock_time_max\'\', \'\'lock_row_lock_waits\'\',\n     \'\'buffer_pool_reads\'\', \'\'buffer_pool_read_requests\'\', \'\'buffer_pool_write_requests\'\', \'\'buffer_pool_wait_free\'\',\n     \'\'buffer_pool_read_ahead\'\', \'\'buffer_pool_read_ahead_evicted\'\', \'\'buffer_pool_pages_total\'\', \'\'buffer_pool_pages_misc\'\',\n     \'\'buffer_pool_pages_data\'\', \'\'buffer_pool_bytes_data\'\', \'\'buffer_pool_pages_dirty\'\', \'\'buffer_pool_bytes_dirty\'\',\n     \'\'buffer_pool_pages_free\'\', \'\'buffer_pages_created\'\', \'\'buffer_pages_written\'\', \'\'buffer_pages_read\'\',\n     \'\'buffer_data_reads\'\', \'\'buffer_data_written\'\', \'\'file_num_open_files\'\',\n     \'\'os_log_bytes_written\'\', \'\'os_log_fsyncs\'\', \'\'os_log_pending_fsyncs\'\', \'\'os_log_pending_writes\'\',\n     \'\'log_waits\'\', \'\'log_write_requests\'\', \'\'log_writes\'\', \'\'innodb_dblwr_writes\'\', \'\'innodb_dblwr_pages_written\'\', \'\'innodb_page_size\'\')\n) UNION ALL (\nSELECT \'\'NOW()\'\' AS Variable_name, NOW(3) AS Variable_value, \'\'System Time\'\' AS Type, \'\'YES\'\' AS Enabled\n) UNION ALL (\nSELECT \'\'UNIX_TIMESTAMP()\'\' AS Variable_name, ROUND(UNIX_TIMESTAMP(NOW(3)), 3) AS Variable_value, \'\'System Time\'\' AS Type, \'\'YES\'\' AS Enabled\n)\n ORDER BY Type, Variable_name;\'\n            );\n        END IF;\n        CALL sys.execute_prepared_stmt(@sys.diagnostics.sql);\n        CALL sys.execute_prepared_stmt(\n            CONCAT(\'SELECT Variable_value INTO @sys.diagnostics.output_time FROM \', v_table_name, \' WHERE Type = \'\'System Time\'\' AND Variable_name = \'\'UNIX_TIMESTAMP()\'\'\')\n        );\n        SET v_output_time = @sys.diagnostics.output_time;\n        SET v_sql_status_summary_select = CONCAT(v_sql_status_summary_select, \',\n       CONCAT(\n           LEFT(s\', v_output_count, \'.Variable_value, \', v_status_summary_width, \'),\n           IF(\', REPLACE(v_no_delta_names, \'%{COUNT}\', v_output_count), \' AND s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+(\\\\\\\\.[0-9]+)?$\'\', CONCAT(\'\' (\'\', ROUND(s\', v_output_count, \'.Variable_value/\', v_output_time, \', 2), \'\'/sec)\'\'), \'\'\'\')\n       ) AS \'\'Output \', v_output_count, \'\'\'\'),\n            v_sql_status_summary_from   = CONCAT(v_sql_status_summary_from, \'\n\',\n                                                    IF(v_output_count = 1, \'  FROM \', \'       INNER JOIN \'),\n                                                    v_table_name, \' s\', v_output_count,\n                                                    IF (v_output_count = 1, \'\', \' USING (Type, Variable_name)\'));\n        IF (v_output_count > 1) THEN\n            SET v_sql_status_summary_delta  = CONCAT(v_sql_status_summary_delta, \',\n       IF(\', REPLACE(v_no_delta_names, \'%{COUNT}\', v_output_count), \' AND s\', (v_output_count-1), \'.Variable_value REGEXP \'\'^[0-9]+(\\\\\\\\.[0-9]+)?$\'\' AND s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+(\\\\\\\\.[0-9]+)?$\'\',\n          CONCAT(IF(s\', (v_output_count-1), \'.Variable_value REGEXP \'\'^[0-9]+\\\\\\\\.[0-9]+$\'\' OR s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+\\\\\\\\.[0-9]+$\'\',\n                    ROUND((s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value), 2),\n                    (s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value)\n                   ),\n                 \'\' (\'\', ROUND((s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value)/(\', v_output_time, \'-\', v_output_time_prev, \'), 2), \'\'/sec)\'\'\n          ),\n          \'\'\'\'\n       ) AS \'\'Delta (\', (v_output_count-1), \' -> \', v_output_count, \')\'\'\');\n        END IF;\n        SET v_output_time_prev = v_output_time;\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            IF (v_has_metrics) THEN\n                SELECT \'SELECT * FROM sys.metrics\' AS \'The following output is:\';\n            ELSE\n                SELECT \'sys.metrics equivalent\' AS \'The following output is:\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'SELECT Type, Variable_name, Enabled, Variable_value FROM \', v_table_name, \' ORDER BY Type, Variable_name\'));\n        END IF;\n        IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n            SELECT \'SHOW ENGINE INNODB STATUS\' AS \'The following output is:\';\n            EXECUTE stmt_innodb_status;\n            SELECT \'InnoDB - Transactions\' AS \'The following output is:\';\n            SELECT * FROM information_schema.INNODB_TRX;\n        END IF;\n        IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n            SELECT \'SHOW ENGINE NDBCLUSTER STATUS\' AS \'The following output is:\';\n            EXECUTE stmt_ndbcluster_status;\n            SELECT \'ndbinfo.memoryusage\' AS \'The following output is:\';\n            SELECT node_id, memory_type, sys.format_bytes(used) AS used, used_pages, sys.format_bytes(total) AS total, total_pages,\n                   ROUND(100*(used/total), 2) AS \'Used %\'\n            FROM ndbinfo.memoryusage;\n            SET v_done = FALSE;\n            OPEN c_ndbinfo;\n            c_ndbinfo_loop: LOOP\n                FETCH c_ndbinfo INTO v_table_name;\n                IF v_done THEN\n                LEAVE c_ndbinfo_loop;\n                END IF;\n                SELECT CONCAT(\'SELECT * FROM ndbinfo.\', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(CONCAT(\'SELECT * FROM `ndbinfo`.`\', v_table_name, \'`\'));\n            END LOOP;\n            CLOSE c_ndbinfo;\n            SELECT * FROM information_schema.FILES;\n        END IF;\n        SELECT \'SELECT * FROM sys.processlist\' AS \'The following output is:\';\n        SELECT processlist.* FROM sys.processlist;\n        IF (v_has_ps = \'YES\') THEN\n            IF (sys.ps_is_consumer_enabled(\'events_waits_history_long\') = \'YES\') THEN\n                SELECT \'SELECT * FROM sys.latest_file_io\' AS \'The following output is:\';\n                SELECT * FROM sys.latest_file_io;\n            END IF;\n            IF (EXISTS(SELECT 1 FROM performance_schema.setup_instruments WHERE NAME LIKE \'memory/%\' AND ENABLED = \'YES\')) THEN\n                SELECT \'SELECT * FROM sys.memory_by_host_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_host_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_by_thread_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_thread_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_by_user_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_user_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_global_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_global_by_current_bytes;\n            END IF;\n        END IF;\n        SET v_runtime = (UNIX_TIMESTAMP(NOW(2)) - v_start);\n    UNTIL (v_runtime + in_interval >= in_max_runtime) END REPEAT;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'SHOW ENGINE PERFORMANCE_SCHEMA STATUS\' AS \'The following output is:\';\n        EXECUTE stmt_ps_status;\n    END IF;\n    IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n        DEALLOCATE PREPARE stmt_innodb_status;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        DEALLOCATE PREPARE stmt_ps_status;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n        DEALLOCATE PREPARE stmt_ndbcluster_status;\n    END IF;\n    SELECT \'\n============================\n     Schema Information\n============================\n\' AS \'\';\n    SELECT COUNT(*) AS \'Total Number of Tables\' FROM information_schema.TABLES;\n    IF (@sys.diagnostics.allow_i_s_tables = \'ON\') THEN\n        SELECT \'Storage Engine Usage\' AS \'The following output is:\';\n        SELECT ENGINE, COUNT(*) AS NUM_TABLES,\n                sys.format_bytes(SUM(DATA_LENGTH)) AS DATA_LENGTH,\n                sys.format_bytes(SUM(INDEX_LENGTH)) AS INDEX_LENGTH,\n                sys.format_bytes(SUM(DATA_LENGTH+INDEX_LENGTH)) AS TOTAL\n            FROM information_schema.TABLES\n            GROUP BY ENGINE;\n        SELECT \'Schema Object Overview\' AS \'The following output is:\';\n        SELECT * FROM sys.schema_object_overview;\n        SELECT \'Tables without a PRIMARY KEY\' AS \'The following output is:\';\n        SELECT TABLES.TABLE_SCHEMA, ENGINE, COUNT(*) AS NumTables\n          FROM information_schema.TABLES\n               LEFT OUTER JOIN information_schema.STATISTICS ON STATISTICS.TABLE_SCHEMA = TABLES.TABLE_SCHEMA\n                                                                AND STATISTICS.TABLE_NAME = TABLES.TABLE_NAME\n                                                                AND STATISTICS.INDEX_NAME = \'PRIMARY\'\n         WHERE STATISTICS.TABLE_NAME IS NULL\n               AND TABLES.TABLE_SCHEMA NOT IN (\'mysql\', \'information_schema\', \'performance_schema\', \'sys\')\n               AND TABLES.TABLE_TYPE = \'BASE TABLE\'\n         GROUP BY TABLES.TABLE_SCHEMA, ENGINE;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'Unused Indexes\' AS \'The following output is:\';\n        SELECT object_schema, COUNT(*) AS NumUnusedIndexes\n          FROM performance_schema.table_io_waits_summary_by_index_usage\n         WHERE index_name IS NOT NULL\n               AND count_star = 0\n               AND object_schema NOT IN (\'mysql\', \'sys\')\n               AND index_name != \'PRIMARY\'\n         GROUP BY object_schema;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'\n=========================\n     Overall Status\n=========================\n\' AS \'\';\n        SELECT \'CALL sys.ps_statement_avg_latency_histogram()\' AS \'The following output is:\';\n        CALL sys.ps_statement_avg_latency_histogram();\n        CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n        CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile\');\n        SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, \'%{OUTPUT}\', \'end\');\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'The following query will be used to generate the query for each sys view\' AS \'Debug\';\n            SELECT @sys.diagnostics.sql AS \'Debug\';\n        END IF;\n        PREPARE stmt_gen_query FROM @sys.diagnostics.sql;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            IF (@sys.debug = \'ON\') THEN\n                SELECT CONCAT(\'The following queries are for storing the final content of \', v_table_name) AS \'Debug\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS `tmp_\', v_table_name, \'_end`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE `tmp_\', v_table_name, \'_end` SELECT * FROM `sys`.`x$\', v_table_name, \'`\'));\n            IF (@sys.diagnostics.include_raw = \'ON\') THEN\n                SET @sys.diagnostics.table_name = CONCAT(\'x$\', v_table_name);\n                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;\n                SELECT CONCAT(@sys.diagnostics.sql_select,\n                                IF(order_by IS NOT NULL, CONCAT(\'\\n ORDER BY \', REPLACE(order_by, \'%{TABLE}\', CONCAT(\'tmp_\', v_table_name, \'_end\'))), \'\'),\n                                IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                        )\n                    INTO @sys.diagnostics.sql_select\n                    FROM tmp_sys_views_delta\n                    WHERE TABLE_NAME = v_table_name;\n                SELECT CONCAT(\'Overall \', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            END IF;\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        DEALLOCATE PREPARE stmt_gen_query;\n        SELECT \'\n======================\n     Delta Status\n======================\n\' AS \'\';\n        CALL sys.statement_performance_analyzer(\'delta\', \'tmp_digests_start\', \'with_runtimes_in_95th_percentile\');\n        CALL sys.statement_performance_analyzer(\'cleanup\', NULL, NULL);\n        DROP TEMPORARY TABLE tmp_digests_start;\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'The following query will be used to generate the query for each sys view delta\' AS \'Debug\';\n            SELECT @sys.diagnostics.sql_gen_query_delta AS \'Debug\';\n        END IF;\n        PREPARE stmt_gen_query_delta FROM @sys.diagnostics.sql_gen_query_delta;\n        SET v_old_group_concat_max_len = @@session.group_concat_max_len;\n        SET @@session.group_concat_max_len = 2048;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            SET @sys.diagnostics.table_name = v_table_name;\n            EXECUTE stmt_gen_query_delta USING @sys.diagnostics.table_name;\n            SELECT CONCAT(@sys.diagnostics.sql_select,\n                            IF(where_delta IS NOT NULL, CONCAT(\'\\n WHERE \', where_delta), \'\'),\n                            IF(order_by_delta IS NOT NULL, CONCAT(\'\\n ORDER BY \', order_by_delta), \'\'),\n                            IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                    )\n                INTO @sys.diagnostics.sql_select\n                FROM tmp_sys_views_delta\n                WHERE TABLE_NAME = v_table_name;\n            SELECT CONCAT(\'Delta \', v_table_name) AS \'The following output is:\';\n            CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE `tmp_\', v_table_name, \'_end`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE `tmp_\', v_table_name, \'_start`\'));\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        SET @@session.group_concat_max_len = v_old_group_concat_max_len;\n        DEALLOCATE PREPARE stmt_gen_query_delta;\n        DROP TEMPORARY TABLE tmp_sys_views_delta;\n    END IF;\n    IF (v_has_metrics) THEN\n        SELECT \'SELECT * FROM sys.metrics\' AS \'The following output is:\';\n    ELSE\n        SELECT \'sys.metrics equivalent\' AS \'The following output is:\';\n    END IF;\n    CALL sys.execute_prepared_stmt(\n        CONCAT(v_sql_status_summary_select, v_sql_status_summary_delta, \', Type, s1.Enabled\', v_sql_status_summary_from,\n               \'\n ORDER BY Type, Variable_name\'\n        )\n    );\n    SET v_count = 0;\n    WHILE (v_count < v_output_count) DO\n        SET v_count = v_count + 1;\n        SET v_table_name = CONCAT(\'tmp_metrics_\', v_count);\n        CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS \', v_table_name));\n    END WHILE;\n    IF (in_auto_config <> \'current\') THEN\n        CALL sys.ps_setup_reload_saved();\n        SET sql_log_bin = @log_bin;\n    END IF;\n    SET @sys.diagnostics.output_time            = NULL,\n        @sys.diagnostics.sql                    = NULL,\n        @sys.diagnostics.sql_gen_query_delta    = NULL,\n        @sys.diagnostics.sql_gen_query_template = NULL,\n        @sys.diagnostics.sql_select             = NULL,\n        @sys.diagnostics.table_name             = NULL;\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = @log_bin;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Create a report of the current status of the server for diagnostics purposes. Data collected includes (some items depends on versions and settings):\n                * The GLOBAL VARIABLES\n                * Several sys schema views including metrics or equivalent (depending on version and settings)\n                * Queries in the 95th percentile\n                * Several ndbinfo views for MySQL Cluster\n                * Replication (both master and slave) information.\n             Some of the sys schema views are calculated as initial (optional), overall, delta:\n                * The initial view is the content of the view at the start of this procedure.\n                  This output will be the same as the the start values used for the delta view.\n                  The initial view is included if @sys.diagnostics.include_raw = \'ON\'.\n                * The overall view is the content of the view at the end of this procedure.\n                  This output is the same as the end values used for the delta view.\n                  The overall view is always included.\n                * The delta view is the difference from the beginning to the end. Note that for min and max values\n                  they are simply the min or max value from the end view respectively, so does not necessarily reflect\n                  the minimum/maximum value in the monitored period.\n                  Note: except for the metrics views the delta is only calculation between the first and last outputs.\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Versions supported:\n                * MySQL 5.6: 5.6.10 and later\n                * MySQL 5.7: 5.7.9 and later\n             Parameters\n             in_max_runtime (INT UNSIGNED):\n               The maximum time to keep collecting data.\n               Use NULL to get the default which is 60 seconds, otherwise enter a value greater than 0.\n             in_interval (INT UNSIGNED):\n               How long to sleep between data collections.\n               Use NULL to get the default which is 30 seconds, otherwise enter a value greater than 0.\n             in_auto_config (ENUM(\'current\', \'medium\', \'full\'))\n               Automatically enable Performance Schema instruments and consumers.\n               NOTE: The more that are enabled, the more impact on the performance.\n               Supported values are:\n                  * current - use the current settings.\n                  * medium - enable some settings.\n                  * full - enables all settings. This will have a big impact on the\n                           performance - be careful using this option.\n               If another setting the \'current\' is chosen, the current settings\n               are restored at the end of the procedure.\n             Configuration Options\n             sys.diagnostics.allow_i_s_tables\n               Specifies whether it is allowed to do table scan queries on information_schema.TABLES. This can be expensive if there\n               are many tables. Set to \'ON\' to allow, \'OFF\' to not allow.\n               Default is \'OFF\'.\n             sys.diagnostics.include_raw\n               Set to \'ON\' to include the raw data (e.g. the original output of \"SELECT * FROM sys.metrics\").\n               Use this to get the initial values of the various views.\n               Default is \'OFF\'.\n             sys.statement_truncate_len\n               How much of queries in the process list output to include.\n               Default is 64.\n             sys.debug\n               Whether to provide debugging output.\n               Default is \'OFF\'. Set to \'ON\' to include.\n             Example\n             To create a report and append it to the file diag.out:\n             mysql> TEE diag.out;\n             mysql> CALL sys.diagnostics(120, 30, \'current\');\n             ...\n             mysql> NOTEE;\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_start, v_runtime, v_iter_start, v_sleep DECIMAL(20,2) DEFAULT 0.0;\n    DECLARE v_has_innodb, v_has_ndb, v_has_ps, v_has_replication, v_has_ps_replication VARCHAR(8) CHARSET utf8 DEFAULT \'NO\';\n    DECLARE v_this_thread_enabled, v_has_ps_vars, v_has_metrics ENUM(\'YES\', \'NO\');\n    DECLARE v_table_name, v_banner VARCHAR(64) CHARSET utf8;\n    DECLARE v_sql_status_summary_select, v_sql_status_summary_delta, v_sql_status_summary_from, v_no_delta_names TEXT;\n    DECLARE v_output_time, v_output_time_prev DECIMAL(20,3) UNSIGNED;\n    DECLARE v_output_count, v_count, v_old_group_concat_max_len INT UNSIGNED DEFAULT 0;\n    DECLARE v_status_summary_width TINYINT UNSIGNED DEFAULT 50;\n    DECLARE v_done BOOLEAN DEFAULT FALSE;\n    DECLARE c_ndbinfo CURSOR FOR\n        SELECT TABLE_NAME\n          FROM information_schema.TABLES\n         WHERE TABLE_SCHEMA = \'ndbinfo\'\n               AND TABLE_NAME NOT IN (\n                  \'blocks\',\n                  \'config_params\',\n                  \'dict_obj_types\',\n                  \'disk_write_speed_base\',\n                  \'memory_per_fragment\',\n                  \'memoryusage\',\n                  \'operations_per_fragment\',\n                  \'threadblocks\'\n               );\n    DECLARE c_sysviews_w_delta CURSOR FOR\n        SELECT table_name\n          FROM tmp_sys_views_delta\n         ORDER BY table_name;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    END IF;\n    IF (in_max_runtime < in_interval) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_max_runtime must be greater than or equal to in_interval\';\n    END IF;\n    IF (in_max_runtime = 0) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_max_runtime must be greater than 0\';\n    END IF;\n    IF (in_interval = 0) THEN\n        SIGNAL SQLSTATE \'45000\'\n           SET MESSAGE_TEXT = \'in_interval must be greater than 0\';\n    END IF;\n    IF (@sys.diagnostics.allow_i_s_tables IS NULL) THEN\n        SET @sys.diagnostics.allow_i_s_tables = sys.sys_get_config(\'diagnostics.allow_i_s_tables\', \'OFF\');\n    END IF;\n    IF (@sys.diagnostics.include_raw IS NULL) THEN\n        SET @sys.diagnostics.include_raw      = sys.sys_get_config(\'diagnostics.include_raw\'     , \'OFF\');\n    END IF;\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug                        = sys.sys_get_config(\'debug\'                       , \'OFF\');\n    END IF;\n    IF (@sys.statement_truncate_len IS NULL) THEN\n        SET @sys.statement_truncate_len       = sys.sys_get_config(\'statement_truncate_len\'      , \'64\' );\n    END IF;\n    SET @log_bin := @@sql_log_bin;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = 0;\n    END IF;\n    SET v_no_delta_names = CONCAT(\'s%{COUNT}.Variable_name NOT IN (\',\n        \'\'\'innodb_buffer_pool_pages_total\'\', \',\n        \'\'\'innodb_page_size\'\', \',\n        \'\'\'last_query_cost\'\', \',\n        \'\'\'last_query_partial_plans\'\', \',\n        \'\'\'qcache_total_blocks\'\', \',\n        \'\'\'slave_last_heartbeat\'\', \',\n        \'\'\'ssl_ctx_verify_depth\'\', \',\n        \'\'\'ssl_ctx_verify_mode\'\', \',\n        \'\'\'ssl_session_cache_size\'\', \',\n        \'\'\'ssl_verify_depth\'\', \',\n        \'\'\'ssl_verify_mode\'\', \',\n        \'\'\'ssl_version\'\', \',\n        \'\'\'buffer_flush_lsn_avg_rate\'\', \',\n        \'\'\'buffer_flush_pct_for_dirty\'\', \',\n        \'\'\'buffer_flush_pct_for_lsn\'\', \',\n        \'\'\'buffer_pool_pages_total\'\', \',\n        \'\'\'lock_row_lock_time_avg\'\', \',\n        \'\'\'lock_row_lock_time_max\'\', \',\n        \'\'\'innodb_page_size\'\'\',\n    \')\');\n    IF (in_auto_config <> \'current\') THEN\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'Updating Performance Schema configuration to \', in_auto_config) AS \'Debug\';\n        END IF;\n        CALL sys.ps_setup_save(0);\n        IF (in_auto_config = \'medium\') THEN\n            UPDATE performance_schema.setup_consumers\n                SET ENABLED = \'YES\'\n            WHERE NAME NOT LIKE \'%\\_history%\';\n            UPDATE performance_schema.setup_instruments\n                SET ENABLED = \'YES\',\n                    TIMED   = \'YES\'\n            WHERE NAME NOT LIKE \'wait/synch/%\';\n        ELSEIF (in_auto_config = \'full\') THEN\n            UPDATE performance_schema.setup_consumers\n                SET ENABLED = \'YES\';\n            UPDATE performance_schema.setup_instruments\n                SET ENABLED = \'YES\',\n                    TIMED   = \'YES\';\n        END IF;\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = \'YES\'\n         WHERE PROCESSLIST_ID <> CONNECTION_ID();\n    END IF;\n    SET v_start        = UNIX_TIMESTAMP(NOW(2)),\n        in_interval    = IFNULL(in_interval, 30),\n        in_max_runtime = IFNULL(in_max_runtime, 60);\n    SET v_banner = REPEAT(\n                      \'-\',\n                      LEAST(\n                         GREATEST(\n                            36,\n                            CHAR_LENGTH(VERSION()),\n                            CHAR_LENGTH(@@global.version_comment),\n                            CHAR_LENGTH(@@global.version_compile_os),\n                            CHAR_LENGTH(@@global.version_compile_machine),\n                            CHAR_LENGTH(@@global.socket),\n                            CHAR_LENGTH(@@global.datadir)\n                         ),\n                         64\n                      )\n                   );\n    SELECT \'Hostname\' AS \'Name\', @@global.hostname AS \'Value\'\n    UNION ALL\n    SELECT \'Port\' AS \'Name\', @@global.port AS \'Value\'\n    UNION ALL\n    SELECT \'Socket\' AS \'Name\', @@global.socket AS \'Value\'\n    UNION ALL\n    SELECT \'Datadir\' AS \'Name\', @@global.datadir AS \'Value\'\n    UNION ALL\n    SELECT REPEAT(\'-\', 23) AS \'Name\', v_banner AS \'Value\'\n    UNION ALL\n    SELECT \'MySQL Version\' AS \'Name\', VERSION() AS \'Value\'\n    UNION ALL\n    SELECT \'Sys Schema Version\' AS \'Name\', (SELECT sys_version FROM sys.version) AS \'Value\'\n    UNION ALL\n    SELECT \'Version Comment\' AS \'Name\', @@global.version_comment AS \'Value\'\n    UNION ALL\n    SELECT \'Version Compile OS\' AS \'Name\', @@global.version_compile_os AS \'Value\'\n    UNION ALL\n    SELECT \'Version Compile Machine\' AS \'Name\', @@global.version_compile_machine AS \'Value\'\n    UNION ALL\n    SELECT REPEAT(\'-\', 23) AS \'Name\', v_banner AS \'Value\'\n    UNION ALL\n    SELECT \'UTC Time\' AS \'Name\', UTC_TIMESTAMP() AS \'Value\'\n    UNION ALL\n    SELECT \'Local Time\' AS \'Name\', NOW() AS \'Value\'\n    UNION ALL\n    SELECT \'Time Zone\' AS \'Name\', @@global.time_zone AS \'Value\'\n    UNION ALL\n    SELECT \'System Time Zone\' AS \'Name\', @@global.system_time_zone AS \'Value\'\n    UNION ALL\n    SELECT \'Time Zone Offset\' AS \'Name\', TIMEDIFF(NOW(), UTC_TIMESTAMP()) AS \'Value\';\n    SET v_has_innodb         = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'InnoDB\'), \'NO\'),\n        v_has_ndb            = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'NDBCluster\'), \'NO\'),\n        v_has_ps             = IFNULL((SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = \'PERFORMANCE_SCHEMA\'), \'NO\'),\n        v_has_ps_replication = IF(v_has_ps = \'YES\'\n                                   AND EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = \'performance_schema\' AND TABLE_NAME = \'replication_applier_status\'),\n                                   \'YES\',\n                                   \'NO\'\n                               ),\n        v_has_replication    = \'MAYBE\',\n        v_has_metrics        = IF(v_has_ps = \'YES\' OR (sys.version_major() = 5 AND sys.version_minor() = 6), \'YES\', \'NO\'),\n        v_has_ps_vars        = \'NO\';\n    \n    \n    IF (@sys.debug = \'ON\') THEN\n       SELECT v_has_innodb AS \'Has_InnoDB\', v_has_ndb AS \'Has_NDBCluster\',\n              v_has_ps AS \'Has_Performance_Schema\', v_has_ps_vars AS \'Has_P_S_SHOW_Variables\',\n              v_has_metrics AS \'Has_metrics\',\n              v_has_ps_replication \'AS Has_P_S_Replication\', v_has_replication AS \'Has_Replication\';\n    END IF;\n    IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE InnoDB STATUS\';\n        PREPARE stmt_innodb_status FROM @sys.diagnostics.sql;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE PERFORMANCE_SCHEMA STATUS\';\n        PREPARE stmt_ps_status FROM @sys.diagnostics.sql;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n        SET @sys.diagnostics.sql = \'SHOW ENGINE NDBCLUSTER STATUS\';\n        PREPARE stmt_ndbcluster_status FROM @sys.diagnostics.sql;\n    END IF;\n    SET @sys.diagnostics.sql_gen_query_template = \'SELECT CONCAT(\\n           \'\'SELECT \'\',\\n           GROUP_CONCAT(\\n               CASE WHEN (SUBSTRING(TABLE_NAME, 3), COLUMN_NAME) IN (\\n                                (\'\'io_global_by_file_by_bytes\'\', \'\'total\'\'),\\n                                (\'\'io_global_by_wait_by_bytes\'\', \'\'total_requested\'\')\\n                         )\\n                         THEN CONCAT(\'\'sys.format_bytes(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\\n                         THEN CONCAT(\'\'sys.format_time(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, -7) = \'\'_memory\'\' OR SUBSTRING(COLUMN_NAME, -17) = \'\'_memory_allocated\'\'\\n                         OR ((SUBSTRING(COLUMN_NAME, -5) = \'\'_read\'\' OR SUBSTRING(COLUMN_NAME, -8) = \'\'_written\'\' OR SUBSTRING(COLUMN_NAME, -6) = \'\'_write\'\') AND SUBSTRING(COLUMN_NAME, 1, 6) <> \'\'COUNT_\'\')\\n                         THEN CONCAT(\'\'sys.format_bytes(\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\\n                    ELSE COLUMN_NAME\\n               END\\n               ORDER BY ORDINAL_POSITION\\n               SEPARATOR \'\',\\n       \'\'\\n           ),\\n           \'\'\\n  FROM tmp_\'\', SUBSTRING(TABLE_NAME FROM 3), \'\'_%{OUTPUT}\'\'\\n       ) AS Query INTO @sys.diagnostics.sql_select\\n  FROM information_schema.COLUMNS\\n WHERE TABLE_SCHEMA = \'\'sys\'\' AND TABLE_NAME = ?\\n GROUP BY TABLE_NAME\';\n    SET @sys.diagnostics.sql_gen_query_delta = \'SELECT CONCAT(\\n           \'\'SELECT \'\',\\n           GROUP_CONCAT(\\n               CASE WHEN FIND_IN_SET(COLUMN_NAME, diag.pk)\\n                         THEN COLUMN_NAME\\n                    WHEN diag.TABLE_NAME = \'\'io_global_by_file_by_bytes\'\' AND COLUMN_NAME = \'\'write_pct\'\'\\n                         THEN CONCAT(\'\'IFNULL(ROUND(100-(((e.total_read-IFNULL(s.total_read, 0))\'\',\\n                                     \'\'/NULLIF(((e.total_read-IFNULL(s.total_read, 0))+(e.total_written-IFNULL(s.total_written, 0))), 0))*100), 2), 0.00) AS \'\',\\n                                     COLUMN_NAME)\\n                    WHEN (diag.TABLE_NAME, COLUMN_NAME) IN (\\n                                (\'\'io_global_by_file_by_bytes\'\', \'\'total\'\'),\\n                                (\'\'io_global_by_wait_by_bytes\'\', \'\'total_requested\'\')\\n                         )\\n                         THEN CONCAT(\'\'sys.format_bytes(e.\'\', COLUMN_NAME, \'\'-IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, 1, 4) IN (\'\'max_\'\', \'\'min_\'\') AND SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\\n                         THEN CONCAT(\'\'sys.format_time(e.\'\', COLUMN_NAME, \'\') AS \'\', COLUMN_NAME)\\n                    WHEN COLUMN_NAME = \'\'avg_latency\'\'\\n                         THEN CONCAT(\'\'sys.format_time((e.total_latency - IFNULL(s.total_latency, 0))\'\',\\n                                     \'\'/NULLIF(e.total - IFNULL(s.total, 0), 0)) AS \'\', COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, -12) = \'\'_avg_latency\'\'\\n                         THEN CONCAT(\'\'sys.format_time((e.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'_latency - IFNULL(s.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'_latency, 0))\'\',\\n                                     \'\'/NULLIF(e.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'s - IFNULL(s.\'\', SUBSTRING(COLUMN_NAME FROM 1 FOR CHAR_LENGTH(COLUMN_NAME)-12), \'\'s, 0), 0)) AS \'\', COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, -8) = \'\'_latency\'\'\\n                         THEN CONCAT(\'\'sys.format_time(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\\n                    WHEN COLUMN_NAME IN (\'\'avg_read\'\', \'\'avg_write\'\', \'\'avg_written\'\')\\n                         THEN CONCAT(\'\'sys.format_bytes(IFNULL((e.total_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'written\'\'), \'\'-IFNULL(s.total_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'written\'\'), \'\', 0))\'\',\\n                                     \'\'/NULLIF(e.count_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'write\'\'), \'\'-IFNULL(s.count_\'\', IF(COLUMN_NAME = \'\'avg_read\'\', \'\'read\'\', \'\'write\'\'), \'\', 0), 0), 0)) AS \'\',\\n                                     COLUMN_NAME)\\n                    WHEN SUBSTRING(COLUMN_NAME, -7) = \'\'_memory\'\' OR SUBSTRING(COLUMN_NAME, -17) = \'\'_memory_allocated\'\'\\n                         OR ((SUBSTRING(COLUMN_NAME, -5) = \'\'_read\'\' OR SUBSTRING(COLUMN_NAME, -8) = \'\'_written\'\' OR SUBSTRING(COLUMN_NAME, -6) = \'\'_write\'\') AND SUBSTRING(COLUMN_NAME, 1, 6) <> \'\'COUNT_\'\')\\n                         THEN CONCAT(\'\'sys.format_bytes(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\\n                    ELSE CONCAT(\'\'(e.\'\', COLUMN_NAME, \'\' - IFNULL(s.\'\', COLUMN_NAME, \'\', 0)) AS \'\', COLUMN_NAME)\\n               END\\n               ORDER BY ORDINAL_POSITION\\n               SEPARATOR \'\',\\n       \'\'\\n           ),\\n           \'\'\\n  FROM tmp_\'\', diag.TABLE_NAME, \'\'_end e\\n       LEFT OUTER JOIN tmp_\'\', diag.TABLE_NAME, \'\'_start s USING (\'\', diag.pk, \'\')\'\'\\n       ) AS Query INTO @sys.diagnostics.sql_select\\n  FROM tmp_sys_views_delta diag\\n       INNER JOIN information_schema.COLUMNS c ON c.TABLE_NAME = CONCAT(\'\'x$\'\', diag.TABLE_NAME)\\n WHERE c.TABLE_SCHEMA = \'\'sys\'\' AND diag.TABLE_NAME = ?\\n GROUP BY diag.TABLE_NAME\';\n    IF (v_has_ps = \'YES\') THEN\n        DROP TEMPORARY TABLE IF EXISTS tmp_sys_views_delta;\n        CREATE TEMPORARY TABLE tmp_sys_views_delta (\n            TABLE_NAME varchar(64) NOT NULL,\n            order_by text COMMENT \'ORDER BY clause for the initial and overall views\',\n            order_by_delta text COMMENT \'ORDER BY clause for the delta views\',\n            where_delta text COMMENT \'WHERE clause to use for delta views to only include rows with a \"count\" > 0\',\n            limit_rows int unsigned COMMENT \'The maximum number of rows to include for the view\',\n            pk varchar(128) COMMENT \'Used with the FIND_IN_SET() function so use comma separated list without whitespace\',\n            PRIMARY KEY (TABLE_NAME)\n        );\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'Populating tmp_sys_views_delta\' AS \'Debug\';\n        END IF;\n        INSERT INTO tmp_sys_views_delta\n        VALUES (\'host_summary\'                       , \'%{TABLE}.statement_latency DESC\',\n                                                       \'(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC\',\n                                                       \'(e.statements - IFNULL(s.statements, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_file_io\'            , \'%{TABLE}.io_latency DESC\',\n                                                       \'(e.io_latency-IFNULL(s.io_latency, 0)) DESC\',\n                                                       \'(e.ios - IFNULL(s.ios, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_file_io_type\'       , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event_name\'),\n               (\'host_summary_by_stages\'             , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event_name\'),\n               (\'host_summary_by_statement_latency\'  , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host\'),\n               (\'host_summary_by_statement_type\'     , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,statement\'),\n               (\'io_by_thread_by_latency\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,thread_id,processlist_id\'),\n               (\'io_global_by_file_by_bytes\'         , \'%{TABLE}.total DESC\',\n                                                       \'(e.total-IFNULL(s.total, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', 100, \'file\'),\n               (\'io_global_by_file_by_latency\'       , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', 100, \'file\'),\n               (\'io_global_by_wait_by_bytes\'         , \'%{TABLE}.total_requested DESC\',\n                                                       \'(e.total_requested-IFNULL(s.total_requested, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_name\'),\n               (\'io_global_by_wait_by_latency\'       , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_name\'),\n               (\'schema_index_statistics\'            , \'(%{TABLE}.select_latency+%{TABLE}.insert_latency+%{TABLE}.update_latency+%{TABLE}.delete_latency) DESC\',\n                                                       \'((e.select_latency+e.insert_latency+e.update_latency+e.delete_latency)-IFNULL(s.select_latency+s.insert_latency+s.update_latency+s.delete_latency, 0)) DESC\',\n                                                       \'((e.rows_selected+e.insert_latency+e.rows_updated+e.rows_deleted)-IFNULL(s.rows_selected+s.rows_inserted+s.rows_updated+s.rows_deleted, 0)) > 0\',\n                                                       100, \'table_schema,table_name,index_name\'),\n               (\'schema_table_statistics\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) > 0\', 100, \'table_schema,table_name\'),\n               (\'schema_tables_with_full_table_scans\', \'%{TABLE}.rows_full_scanned DESC\',\n                                                       \'(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) DESC\',\n                                                       \'(e.rows_full_scanned-IFNULL(s.rows_full_scanned, 0)) > 0\', 100, \'object_schema,object_name\'),\n               (\'user_summary\'                       , \'%{TABLE}.statement_latency DESC\',\n                                                       \'(e.statement_latency-IFNULL(s.statement_latency, 0)) DESC\',\n                                                       \'(e.statements - IFNULL(s.statements, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_file_io\'            , \'%{TABLE}.io_latency DESC\',\n                                                       \'(e.io_latency-IFNULL(s.io_latency, 0)) DESC\',\n                                                       \'(e.ios - IFNULL(s.ios, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_file_io_type\'       , \'%{TABLE}.user, %{TABLE}.latency DESC\',\n                                                       \'e.user, (e.latency-IFNULL(s.latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event_name\'),\n               (\'user_summary_by_stages\'             , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event_name\'),\n               (\'user_summary_by_statement_latency\'  , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user\'),\n               (\'user_summary_by_statement_type\'     , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,statement\'),\n               (\'wait_classes_global_by_avg_latency\' , \'IFNULL(%{TABLE}.total_latency / NULLIF(%{TABLE}.total, 0), 0) DESC\',\n                                                       \'IFNULL((e.total_latency-IFNULL(s.total_latency, 0)) / NULLIF((e.total - IFNULL(s.total, 0)), 0), 0) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_class\'),\n               (\'wait_classes_global_by_latency\'     , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'event_class\'),\n               (\'waits_by_host_by_latency\'           , \'%{TABLE}.host, %{TABLE}.total_latency DESC\',\n                                                       \'e.host, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'host,event\'),\n               (\'waits_by_user_by_latency\'           , \'%{TABLE}.user, %{TABLE}.total_latency DESC\',\n                                                       \'e.user, (e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'user,event\'),\n               (\'waits_global_by_latency\'            , \'%{TABLE}.total_latency DESC\',\n                                                       \'(e.total_latency-IFNULL(s.total_latency, 0)) DESC\',\n                                                       \'(e.total - IFNULL(s.total, 0)) > 0\', NULL, \'events\')\n        ;\n    END IF;\n    SELECT \'\\n=======================\\n     Configuration\\n=======================\\n\' AS \'\';\n    SELECT \'GLOBAL VARIABLES\' AS \'The following output is:\';\n    IF (v_has_ps_vars = \'YES\') THEN\n        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM performance_schema.global_variables ORDER BY VARIABLE_NAME;\n    ELSE\n        SELECT LOWER(VARIABLE_NAME) AS Variable_name, VARIABLE_VALUE AS Variable_value FROM information_schema.GLOBAL_VARIABLES ORDER BY VARIABLE_NAME;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'Performance Schema Setup - Actors\' AS \'The following output is:\';\n        SELECT * FROM performance_schema.setup_actors;\n        SELECT \'Performance Schema Setup - Consumers\' AS \'The following output is:\';\n        SELECT NAME AS Consumer, ENABLED, sys.ps_is_consumer_enabled(NAME) AS COLLECTS\n          FROM performance_schema.setup_consumers;\n        SELECT \'Performance Schema Setup - Instruments\' AS \'The following output is:\';\n        SELECT SUBSTRING_INDEX(NAME, \'/\', 2) AS \'InstrumentClass\',\n               ROUND(100*SUM(IF(ENABLED = \'YES\', 1, 0))/COUNT(*), 2) AS \'EnabledPct\',\n               ROUND(100*SUM(IF(TIMED = \'YES\', 1, 0))/COUNT(*), 2) AS \'TimedPct\'\n          FROM performance_schema.setup_instruments\n         GROUP BY SUBSTRING_INDEX(NAME, \'/\', 2)\n         ORDER BY SUBSTRING_INDEX(NAME, \'/\', 2);\n        SELECT \'Performance Schema Setup - Objects\' AS \'The following output is:\';\n        SELECT * FROM performance_schema.setup_objects;\n        SELECT \'Performance Schema Setup - Threads\' AS \'The following output is:\';\n        SELECT `TYPE` AS ThreadType, COUNT(*) AS \'Total\', ROUND(100*SUM(IF(INSTRUMENTED = \'YES\', 1, 0))/COUNT(*), 2) AS \'InstrumentedPct\'\n          FROM performance_schema.threads\n        GROUP BY TYPE;\n    END IF;\n    IF (v_has_replication = \'NO\') THEN\n        SELECT \'No Replication Configured\' AS \'Replication Status\';\n    ELSE\n        SELECT CONCAT(\'Replication Configured: \', v_has_replication, \' - Performance Schema Replication Tables: \', v_has_ps_replication) AS \'Replication Status\';\n        IF (v_has_ps_replication = \'YES\') THEN\n            SELECT \'Replication - Connection Configuration\' AS \'The following output is:\';\n            SELECT * FROM performance_schema.replication_connection_configuration;\n        END IF;\n        IF (v_has_ps_replication = \'YES\') THEN\n            SELECT \'Replication - Applier Configuration\' AS \'The following output is:\';\n            SELECT * FROM performance_schema.replication_applier_configuration ORDER BY CHANNEL_NAME;\n        END IF;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n       SELECT \'Cluster Thread Blocks\' AS \'The following output is:\';\n       SELECT * FROM ndbinfo.threadblocks;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            SELECT \'\\n========================\\n     Initial Status\\n========================\\n\' AS \'\';\n        END IF;\n        DROP TEMPORARY TABLE IF EXISTS tmp_digests_start;\n        CALL sys.statement_performance_analyzer(\'create_tmp\', \'tmp_digests_start\', NULL);\n        CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n        CALL sys.statement_performance_analyzer(\'save\', \'tmp_digests_start\', NULL);\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, \'%{OUTPUT}\', \'start\');\n            IF (@sys.debug = \'ON\') THEN\n                SELECT \'The following query will be used to generate the query for each sys view\' AS \'Debug\';\n                SELECT @sys.diagnostics.sql AS \'Debug\';\n            END IF;\n            PREPARE stmt_gen_query FROM @sys.diagnostics.sql;\n        END IF;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            IF (@sys.debug = \'ON\') THEN\n                SELECT CONCAT(\'The following queries are for storing the initial content of \', v_table_name) AS \'Debug\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS `tmp_\', v_table_name, \'_start`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE `tmp_\', v_table_name, \'_start` SELECT * FROM `sys`.`x$\', v_table_name, \'`\'));\n            IF (@sys.diagnostics.include_raw = \'ON\') THEN\n                SET @sys.diagnostics.table_name = CONCAT(\'x$\', v_table_name);\n                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;\n                SELECT CONCAT(@sys.diagnostics.sql_select,\n                              IF(order_by IS NOT NULL, CONCAT(\'\\n ORDER BY \', REPLACE(order_by, \'%{TABLE}\', CONCAT(\'tmp_\', v_table_name, \'_start\'))), \'\'),\n                              IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                       )\n                  INTO @sys.diagnostics.sql_select\n                  FROM tmp_sys_views_delta\n                 WHERE TABLE_NAME = v_table_name;\n                SELECT CONCAT(\'Initial \', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            END IF;\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            DEALLOCATE PREPARE stmt_gen_query;\n        END IF;\n    END IF;\n    SET v_sql_status_summary_select = \'SELECT Variable_name\',\n        v_sql_status_summary_delta  = \'\',\n        v_sql_status_summary_from   = \'\';\n    REPEAT\n        SET v_output_count = v_output_count + 1;\n        IF (v_output_count > 1) THEN\n            SET v_sleep = in_interval-(UNIX_TIMESTAMP(NOW(2))-v_iter_start);\n            SELECT NOW() AS \'Time\', CONCAT(\'Going to sleep for \', v_sleep, \' seconds. Please do not interrupt\') AS \'The following output is:\';\n            DO SLEEP(in_interval);\n        END IF;\n        SET v_iter_start = UNIX_TIMESTAMP(NOW(2));\n        SELECT NOW(), CONCAT(\'Iteration Number \', IFNULL(v_output_count, \'NULL\')) AS \'The following output is:\';\n        IF (@@log_bin = 1) THEN\n            SELECT \'SHOW MASTER STATUS\' AS \'The following output is:\';\n            SHOW MASTER STATUS;\n        END IF;\n        IF (v_has_replication <> \'NO\') THEN\n            SELECT \'SHOW SLAVE STATUS\' AS \'The following output is:\';\n            SHOW SLAVE STATUS;\n        END IF;\n        SET v_table_name = CONCAT(\'tmp_metrics_\', v_output_count);\n        CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS \', v_table_name));\n        CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE \', v_table_name, \' (\\n  Variable_name VARCHAR(193) NOT NULL,\\n  Variable_value VARCHAR(1024),\\n  Type VARCHAR(100) NOT NULL,\\n  Enabled ENUM(\'\'YES\'\', \'\'NO\'\', \'\'PARTIAL\'\') NOT NULL,\\n  PRIMARY KEY (Type, Variable_name)\\n) ENGINE = InnoDB DEFAULT CHARSET=utf8\'));\n        IF (v_has_metrics) THEN\n            SET @sys.diagnostics.sql = CONCAT(\n                \'INSERT INTO \', v_table_name,\n                \' SELECT Variable_name, REPLACE(Variable_value, \'\'\\n\'\', \'\'\\\\n\'\') AS Variable_value, Type, Enabled FROM sys.metrics\'\n            );\n        ELSE\n            SET @sys.diagnostics.sql = CONCAT(\n                \'INSERT INTO \', v_table_name,\n                \'(SELECT LOWER(VARIABLE_NAME) AS Variable_name, REPLACE(VARIABLE_VALUE, \'\'\\n\'\', \'\'\\\\n\'\') AS Variable_value,\\n                         \'\'Global Status\'\' AS Type, \'\'YES\'\' AS Enabled\\n  FROM performance_schema.global_status\\n) UNION ALL (\\nSELECT NAME AS Variable_name, COUNT AS Variable_value,\\n       CONCAT(\'\'InnoDB Metrics - \'\', SUBSYSTEM) AS Type,\\n       IF(STATUS = \'\'enabled\'\', \'\'YES\'\', \'\'NO\'\') AS Enabled\\n  FROM information_schema.INNODB_METRICS\\n WHERE NAME NOT IN (\\n     \'\'lock_row_lock_time\'\', \'\'lock_row_lock_time_avg\'\', \'\'lock_row_lock_time_max\'\', \'\'lock_row_lock_waits\'\',\\n     \'\'buffer_pool_reads\'\', \'\'buffer_pool_read_requests\'\', \'\'buffer_pool_write_requests\'\', \'\'buffer_pool_wait_free\'\',\\n     \'\'buffer_pool_read_ahead\'\', \'\'buffer_pool_read_ahead_evicted\'\', \'\'buffer_pool_pages_total\'\', \'\'buffer_pool_pages_misc\'\',\\n     \'\'buffer_pool_pages_data\'\', \'\'buffer_pool_bytes_data\'\', \'\'buffer_pool_pages_dirty\'\', \'\'buffer_pool_bytes_dirty\'\',\\n     \'\'buffer_pool_pages_free\'\', \'\'buffer_pages_created\'\', \'\'buffer_pages_written\'\', \'\'buffer_pages_read\'\',\\n     \'\'buffer_data_reads\'\', \'\'buffer_data_written\'\', \'\'file_num_open_files\'\',\\n     \'\'os_log_bytes_written\'\', \'\'os_log_fsyncs\'\', \'\'os_log_pending_fsyncs\'\', \'\'os_log_pending_writes\'\',\\n     \'\'log_waits\'\', \'\'log_write_requests\'\', \'\'log_writes\'\', \'\'innodb_dblwr_writes\'\', \'\'innodb_dblwr_pages_written\'\', \'\'innodb_page_size\'\')\\n) UNION ALL (\\nSELECT \'\'NOW()\'\' AS Variable_name, NOW(3) AS Variable_value, \'\'System Time\'\' AS Type, \'\'YES\'\' AS Enabled\\n) UNION ALL (\\nSELECT \'\'UNIX_TIMESTAMP()\'\' AS Variable_name, ROUND(UNIX_TIMESTAMP(NOW(3)), 3) AS Variable_value, \'\'System Time\'\' AS Type, \'\'YES\'\' AS Enabled\\n)\\n ORDER BY Type, Variable_name;\'\n            );\n        END IF;\n        CALL sys.execute_prepared_stmt(@sys.diagnostics.sql);\n        CALL sys.execute_prepared_stmt(\n            CONCAT(\'SELECT Variable_value INTO @sys.diagnostics.output_time FROM \', v_table_name, \' WHERE Type = \'\'System Time\'\' AND Variable_name = \'\'UNIX_TIMESTAMP()\'\'\')\n        );\n        SET v_output_time = @sys.diagnostics.output_time;\n        SET v_sql_status_summary_select = CONCAT(v_sql_status_summary_select, \',\\n       CONCAT(\\n           LEFT(s\', v_output_count, \'.Variable_value, \', v_status_summary_width, \'),\\n           IF(\', REPLACE(v_no_delta_names, \'%{COUNT}\', v_output_count), \' AND s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+(\\\\.[0-9]+)?$\'\', CONCAT(\'\' (\'\', ROUND(s\', v_output_count, \'.Variable_value/\', v_output_time, \', 2), \'\'/sec)\'\'), \'\'\'\')\\n       ) AS \'\'Output \', v_output_count, \'\'\'\'),\n            v_sql_status_summary_from   = CONCAT(v_sql_status_summary_from, \'\\n\',\n                                                    IF(v_output_count = 1, \'  FROM \', \'       INNER JOIN \'),\n                                                    v_table_name, \' s\', v_output_count,\n                                                    IF (v_output_count = 1, \'\', \' USING (Type, Variable_name)\'));\n        IF (v_output_count > 1) THEN\n            SET v_sql_status_summary_delta  = CONCAT(v_sql_status_summary_delta, \',\\n       IF(\', REPLACE(v_no_delta_names, \'%{COUNT}\', v_output_count), \' AND s\', (v_output_count-1), \'.Variable_value REGEXP \'\'^[0-9]+(\\\\.[0-9]+)?$\'\' AND s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+(\\\\.[0-9]+)?$\'\',\\n          CONCAT(IF(s\', (v_output_count-1), \'.Variable_value REGEXP \'\'^[0-9]+\\\\.[0-9]+$\'\' OR s\', v_output_count, \'.Variable_value REGEXP \'\'^[0-9]+\\\\.[0-9]+$\'\',\\n                    ROUND((s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value), 2),\\n                    (s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value)\\n                   ),\\n                 \'\' (\'\', ROUND((s\', v_output_count, \'.Variable_value-s\', (v_output_count-1), \'.Variable_value)/(\', v_output_time, \'-\', v_output_time_prev, \'), 2), \'\'/sec)\'\'\\n          ),\\n          \'\'\'\'\\n       ) AS \'\'Delta (\', (v_output_count-1), \' -> \', v_output_count, \')\'\'\');\n        END IF;\n        SET v_output_time_prev = v_output_time;\n        IF (@sys.diagnostics.include_raw = \'ON\') THEN\n            IF (v_has_metrics) THEN\n                SELECT \'SELECT * FROM sys.metrics\' AS \'The following output is:\';\n            ELSE\n                SELECT \'sys.metrics equivalent\' AS \'The following output is:\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'SELECT Type, Variable_name, Enabled, Variable_value FROM \', v_table_name, \' ORDER BY Type, Variable_name\'));\n        END IF;\n        IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n            SELECT \'SHOW ENGINE INNODB STATUS\' AS \'The following output is:\';\n            EXECUTE stmt_innodb_status;\n            SELECT \'InnoDB - Transactions\' AS \'The following output is:\';\n            SELECT * FROM information_schema.INNODB_TRX;\n        END IF;\n        IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n            SELECT \'SHOW ENGINE NDBCLUSTER STATUS\' AS \'The following output is:\';\n            EXECUTE stmt_ndbcluster_status;\n            SELECT \'ndbinfo.memoryusage\' AS \'The following output is:\';\n            SELECT node_id, memory_type, sys.format_bytes(used) AS used, used_pages, sys.format_bytes(total) AS total, total_pages,\n                   ROUND(100*(used/total), 2) AS \'Used %\'\n            FROM ndbinfo.memoryusage;\n            SET v_done = FALSE;\n            OPEN c_ndbinfo;\n            c_ndbinfo_loop: LOOP\n                FETCH c_ndbinfo INTO v_table_name;\n                IF v_done THEN\n                LEAVE c_ndbinfo_loop;\n                END IF;\n                SELECT CONCAT(\'SELECT * FROM ndbinfo.\', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(CONCAT(\'SELECT * FROM `ndbinfo`.`\', v_table_name, \'`\'));\n            END LOOP;\n            CLOSE c_ndbinfo;\n            SELECT * FROM information_schema.FILES;\n        END IF;\n        SELECT \'SELECT * FROM sys.processlist\' AS \'The following output is:\';\n        SELECT processlist.* FROM sys.processlist;\n        IF (v_has_ps = \'YES\') THEN\n            IF (sys.ps_is_consumer_enabled(\'events_waits_history_long\') = \'YES\') THEN\n                SELECT \'SELECT * FROM sys.latest_file_io\' AS \'The following output is:\';\n                SELECT * FROM sys.latest_file_io;\n            END IF;\n            IF (EXISTS(SELECT 1 FROM performance_schema.setup_instruments WHERE NAME LIKE \'memory/%\' AND ENABLED = \'YES\')) THEN\n                SELECT \'SELECT * FROM sys.memory_by_host_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_host_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_by_thread_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_thread_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_by_user_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_by_user_by_current_bytes;\n                SELECT \'SELECT * FROM sys.memory_global_by_current_bytes\' AS \'The following output is:\';\n                SELECT * FROM sys.memory_global_by_current_bytes;\n            END IF;\n        END IF;\n        SET v_runtime = (UNIX_TIMESTAMP(NOW(2)) - v_start);\n    UNTIL (v_runtime + in_interval >= in_max_runtime) END REPEAT;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'SHOW ENGINE PERFORMANCE_SCHEMA STATUS\' AS \'The following output is:\';\n        EXECUTE stmt_ps_status;\n    END IF;\n    IF (v_has_innodb IN (\'DEFAULT\', \'YES\')) THEN\n        DEALLOCATE PREPARE stmt_innodb_status;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        DEALLOCATE PREPARE stmt_ps_status;\n    END IF;\n    IF (v_has_ndb IN (\'DEFAULT\', \'YES\')) THEN\n        DEALLOCATE PREPARE stmt_ndbcluster_status;\n    END IF;\n    SELECT \'\\n============================\\n     Schema Information\\n============================\\n\' AS \'\';\n    SELECT COUNT(*) AS \'Total Number of Tables\' FROM information_schema.TABLES;\n    IF (@sys.diagnostics.allow_i_s_tables = \'ON\') THEN\n        SELECT \'Storage Engine Usage\' AS \'The following output is:\';\n        SELECT ENGINE, COUNT(*) AS NUM_TABLES,\n                sys.format_bytes(SUM(DATA_LENGTH)) AS DATA_LENGTH,\n                sys.format_bytes(SUM(INDEX_LENGTH)) AS INDEX_LENGTH,\n                sys.format_bytes(SUM(DATA_LENGTH+INDEX_LENGTH)) AS TOTAL\n            FROM information_schema.TABLES\n            GROUP BY ENGINE;\n        SELECT \'Schema Object Overview\' AS \'The following output is:\';\n        SELECT * FROM sys.schema_object_overview;\n        SELECT \'Tables without a PRIMARY KEY\' AS \'The following output is:\';\n        SELECT TABLES.TABLE_SCHEMA, ENGINE, COUNT(*) AS NumTables\n          FROM information_schema.TABLES\n               LEFT OUTER JOIN information_schema.STATISTICS ON STATISTICS.TABLE_SCHEMA = TABLES.TABLE_SCHEMA\n                                                                AND STATISTICS.TABLE_NAME = TABLES.TABLE_NAME\n                                                                AND STATISTICS.INDEX_NAME = \'PRIMARY\'\n         WHERE STATISTICS.TABLE_NAME IS NULL\n               AND TABLES.TABLE_SCHEMA NOT IN (\'mysql\', \'information_schema\', \'performance_schema\', \'sys\')\n               AND TABLES.TABLE_TYPE = \'BASE TABLE\'\n         GROUP BY TABLES.TABLE_SCHEMA, ENGINE;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'Unused Indexes\' AS \'The following output is:\';\n        SELECT object_schema, COUNT(*) AS NumUnusedIndexes\n          FROM performance_schema.table_io_waits_summary_by_index_usage\n         WHERE index_name IS NOT NULL\n               AND count_star = 0\n               AND object_schema NOT IN (\'mysql\', \'sys\')\n               AND index_name != \'PRIMARY\'\n         GROUP BY object_schema;\n    END IF;\n    IF (v_has_ps = \'YES\') THEN\n        SELECT \'\\n=========================\\n     Overall Status\\n=========================\\n\' AS \'\';\n        SELECT \'CALL sys.ps_statement_avg_latency_histogram()\' AS \'The following output is:\';\n        CALL sys.ps_statement_avg_latency_histogram();\n        CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n        CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile\');\n        SET @sys.diagnostics.sql = REPLACE(@sys.diagnostics.sql_gen_query_template, \'%{OUTPUT}\', \'end\');\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'The following query will be used to generate the query for each sys view\' AS \'Debug\';\n            SELECT @sys.diagnostics.sql AS \'Debug\';\n        END IF;\n        PREPARE stmt_gen_query FROM @sys.diagnostics.sql;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            IF (@sys.debug = \'ON\') THEN\n                SELECT CONCAT(\'The following queries are for storing the final content of \', v_table_name) AS \'Debug\';\n            END IF;\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS `tmp_\', v_table_name, \'_end`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'CREATE TEMPORARY TABLE `tmp_\', v_table_name, \'_end` SELECT * FROM `sys`.`x$\', v_table_name, \'`\'));\n            IF (@sys.diagnostics.include_raw = \'ON\') THEN\n                SET @sys.diagnostics.table_name = CONCAT(\'x$\', v_table_name);\n                EXECUTE stmt_gen_query USING @sys.diagnostics.table_name;\n                SELECT CONCAT(@sys.diagnostics.sql_select,\n                                IF(order_by IS NOT NULL, CONCAT(\'\\n ORDER BY \', REPLACE(order_by, \'%{TABLE}\', CONCAT(\'tmp_\', v_table_name, \'_end\'))), \'\'),\n                                IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                        )\n                    INTO @sys.diagnostics.sql_select\n                    FROM tmp_sys_views_delta\n                    WHERE TABLE_NAME = v_table_name;\n                SELECT CONCAT(\'Overall \', v_table_name) AS \'The following output is:\';\n                CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            END IF;\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        DEALLOCATE PREPARE stmt_gen_query;\n        SELECT \'\\n======================\\n     Delta Status\\n======================\\n\' AS \'\';\n        CALL sys.statement_performance_analyzer(\'delta\', \'tmp_digests_start\', \'with_runtimes_in_95th_percentile\');\n        CALL sys.statement_performance_analyzer(\'cleanup\', NULL, NULL);\n        DROP TEMPORARY TABLE tmp_digests_start;\n        IF (@sys.debug = \'ON\') THEN\n            SELECT \'The following query will be used to generate the query for each sys view delta\' AS \'Debug\';\n            SELECT @sys.diagnostics.sql_gen_query_delta AS \'Debug\';\n        END IF;\n        PREPARE stmt_gen_query_delta FROM @sys.diagnostics.sql_gen_query_delta;\n        SET v_old_group_concat_max_len = @@session.group_concat_max_len;\n        SET @@session.group_concat_max_len = 2048;\n        SET v_done = FALSE;\n        OPEN c_sysviews_w_delta;\n        c_sysviews_w_delta_loop: LOOP\n            FETCH c_sysviews_w_delta INTO v_table_name;\n            IF v_done THEN\n                LEAVE c_sysviews_w_delta_loop;\n            END IF;\n            SET @sys.diagnostics.table_name = v_table_name;\n            EXECUTE stmt_gen_query_delta USING @sys.diagnostics.table_name;\n            SELECT CONCAT(@sys.diagnostics.sql_select,\n                            IF(where_delta IS NOT NULL, CONCAT(\'\\n WHERE \', where_delta), \'\'),\n                            IF(order_by_delta IS NOT NULL, CONCAT(\'\\n ORDER BY \', order_by_delta), \'\'),\n                            IF(limit_rows IS NOT NULL, CONCAT(\'\\n LIMIT \', limit_rows), \'\')\n                    )\n                INTO @sys.diagnostics.sql_select\n                FROM tmp_sys_views_delta\n                WHERE TABLE_NAME = v_table_name;\n            SELECT CONCAT(\'Delta \', v_table_name) AS \'The following output is:\';\n            CALL sys.execute_prepared_stmt(@sys.diagnostics.sql_select);\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE `tmp_\', v_table_name, \'_end`\'));\n            CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE `tmp_\', v_table_name, \'_start`\'));\n        END LOOP;\n        CLOSE c_sysviews_w_delta;\n        SET @@session.group_concat_max_len = v_old_group_concat_max_len;\n        DEALLOCATE PREPARE stmt_gen_query_delta;\n        DROP TEMPORARY TABLE tmp_sys_views_delta;\n    END IF;\n    IF (v_has_metrics) THEN\n        SELECT \'SELECT * FROM sys.metrics\' AS \'The following output is:\';\n    ELSE\n        SELECT \'sys.metrics equivalent\' AS \'The following output is:\';\n    END IF;\n    CALL sys.execute_prepared_stmt(\n        CONCAT(v_sql_status_summary_select, v_sql_status_summary_delta, \', Type, s1.Enabled\', v_sql_status_summary_from,\n               \'\\n ORDER BY Type, Variable_name\'\n        )\n    );\n    SET v_count = 0;\n    WHILE (v_count < v_output_count) DO\n        SET v_count = v_count + 1;\n        SET v_table_name = CONCAT(\'tmp_metrics_\', v_count);\n        CALL sys.execute_prepared_stmt(CONCAT(\'DROP TEMPORARY TABLE IF EXISTS \', v_table_name));\n    END WHILE;\n    IF (in_auto_config <> \'current\') THEN\n        CALL sys.ps_setup_reload_saved();\n        SET sql_log_bin = @log_bin;\n    END IF;\n    SET @sys.diagnostics.output_time            = NULL,\n        @sys.diagnostics.sql                    = NULL,\n        @sys.diagnostics.sql_gen_query_delta    = NULL,\n        @sys.diagnostics.sql_gen_query_template = NULL,\n        @sys.diagnostics.sql_select             = NULL,\n        @sys.diagnostics.table_name             = NULL;\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = @log_bin;\n    END IF;\nEND','NONE'),
('sys','ps_statement_avg_latency_histogram','PROCEDURE','ps_statement_avg_latency_histogram','SQL','READS_SQL_DATA','NO','INVOKER','','','BEGIN\nSELECT CONCAT(\'\\n\',\n       \'\\n  . = 1 unit\',\n       \'\\n  * = 2 units\',\n       \'\\n  # = 3 units\\n\',\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(0 - \',\n                                               ROUND((@bucket_size := (SELECT ROUND((MAX(avg_us) - MIN(avg_us)) / (@buckets := 16)) AS size\n                                                                         FROM sys.x$ps_digest_avg_latency_distribution)) / (@unit_div := 1000)),\n                                                (@unit := \'ms\'), \')\'),\n                        REPEAT(\' \', (@max_label_size := ((1 + LENGTH(ROUND((@bucket_size * 15) / @unit_div)) + 3 + LENGTH(ROUND(@bucket_size * 16) / @unit_div)) + 1)) - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us <= @bucket_size), 0)),\n       REPEAT(\' \', (@max_label_len := (@max_label_size + LENGTH((@total_queries := (SELECT SUM(cnt) FROM sys.x$ps_digest_avg_latency_distribution)))) + 1) - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < (@one_unit := 40), \'.\', IF(@count_in_bucket < (@two_unit := 80), \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND(@bucket_size / @unit_div), \' - \', ROUND((@bucket_size * 2) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size AND b1.avg_us <= @bucket_size * 2), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 2) / @unit_div), \' - \', ROUND((@bucket_size * 3) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 2 AND b1.avg_us <= @bucket_size * 3), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 3) / @unit_div), \' - \', ROUND((@bucket_size * 4) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 3 AND b1.avg_us <= @bucket_size * 4), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 4) / @unit_div), \' - \', ROUND((@bucket_size * 5) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 4 AND b1.avg_us <= @bucket_size * 5), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 5) / @unit_div), \' - \', ROUND((@bucket_size * 6) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 5 AND b1.avg_us <= @bucket_size * 6), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 6) / @unit_div), \' - \', ROUND((@bucket_size * 7) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 6 AND b1.avg_us <= @bucket_size * 7), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 7) / @unit_div), \' - \', ROUND((@bucket_size * 8) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 7 AND b1.avg_us <= @bucket_size * 8), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 8) / @unit_div), \' - \', ROUND((@bucket_size * 9) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 8 AND b1.avg_us <= @bucket_size * 9), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 9) / @unit_div), \' - \', ROUND((@bucket_size * 10) / @unit_div), @unit, \')\'),\n                         REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                         @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                       FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                      WHERE b1.avg_us > @bucket_size * 9 AND b1.avg_us <= @bucket_size * 10), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 10) / @unit_div), \' - \', ROUND((@bucket_size * 11) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 10 AND b1.avg_us <= @bucket_size * 11), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 11) / @unit_div), \' - \', ROUND((@bucket_size * 12) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 11 AND b1.avg_us <= @bucket_size * 12), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 12) / @unit_div), \' - \', ROUND((@bucket_size * 13) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 12 AND b1.avg_us <= @bucket_size * 13), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 13) / @unit_div), \' - \', ROUND((@bucket_size * 14) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 13 AND b1.avg_us <= @bucket_size * 14), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 14) / @unit_div), \' - \', ROUND((@bucket_size * 15) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 14 AND b1.avg_us <= @bucket_size * 15), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 15) / @unit_div), \' - \', ROUND((@bucket_size * 16) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 15 AND b1.avg_us <= @bucket_size * 16), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       \'\\n\\n  Total Statements: \', @total_queries, \'; Buckets: \', @buckets , \'; Bucket Size: \', ROUND(@bucket_size / @unit_div) , \' \', @unit, \';\\n\'\n      ) AS `Performance Schema Statement Digest Average Latency Histogram`;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Outputs a textual histogram graph of the average latency values\n             across all normalized queries tracked within the Performance Schema\n             events_statements_summary_by_digest table.\n             Can be used to show a very high level picture of what kind of\n             latency distribution statements running within this instance have.\n             Parameters\n             None.\n             Example\n             mysql> CALL sys.ps_statement_avg_latency_histogram()\\G\n             *************************** 1. row ***************************\n             Performance Schema Statement Digest Average Latency Histogram:\n               . = 1 unit\n               * = 2 units\n               # = 3 units\n             (0 - 38ms)     240 | ################################################################################\n             (38 - 77ms)    38  | ......................................\n             (77 - 115ms)   3   | ...\n             (115 - 154ms)  62  | *******************************\n             (154 - 192ms)  3   | ...\n             (192 - 231ms)  0   |\n             (231 - 269ms)  0   |\n             (269 - 307ms)  0   |\n             (307 - 346ms)  0   |\n             (346 - 384ms)  1   | .\n             (384 - 423ms)  1   | .\n             (423 - 461ms)  0   |\n             (461 - 499ms)  0   |\n             (499 - 538ms)  0   |\n             (538 - 576ms)  0   |\n             (576 - 615ms)  1   | .\n               Total Statements: 350; Buckets: 16; Bucket Size: 38 ms;\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\nSELECT CONCAT(\'\\n\',\n       \'\\n  . = 1 unit\',\n       \'\\n  * = 2 units\',\n       \'\\n  # = 3 units\\n\',\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(0 - \',\n                                               ROUND((@bucket_size := (SELECT ROUND((MAX(avg_us) - MIN(avg_us)) / (@buckets := 16)) AS size\n                                                                         FROM sys.x$ps_digest_avg_latency_distribution)) / (@unit_div := 1000)),\n                                                (@unit := \'ms\'), \')\'),\n                        REPEAT(\' \', (@max_label_size := ((1 + LENGTH(ROUND((@bucket_size * 15) / @unit_div)) + 3 + LENGTH(ROUND(@bucket_size * 16) / @unit_div)) + 1)) - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us <= @bucket_size), 0)),\n       REPEAT(\' \', (@max_label_len := (@max_label_size + LENGTH((@total_queries := (SELECT SUM(cnt) FROM sys.x$ps_digest_avg_latency_distribution)))) + 1) - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < (@one_unit := 40), \'.\', IF(@count_in_bucket < (@two_unit := 80), \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND(@bucket_size / @unit_div), \' - \', ROUND((@bucket_size * 2) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size AND b1.avg_us <= @bucket_size * 2), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 2) / @unit_div), \' - \', ROUND((@bucket_size * 3) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 2 AND b1.avg_us <= @bucket_size * 3), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 3) / @unit_div), \' - \', ROUND((@bucket_size * 4) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 3 AND b1.avg_us <= @bucket_size * 4), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 4) / @unit_div), \' - \', ROUND((@bucket_size * 5) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 4 AND b1.avg_us <= @bucket_size * 5), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 5) / @unit_div), \' - \', ROUND((@bucket_size * 6) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 5 AND b1.avg_us <= @bucket_size * 6), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 6) / @unit_div), \' - \', ROUND((@bucket_size * 7) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 6 AND b1.avg_us <= @bucket_size * 7), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 7) / @unit_div), \' - \', ROUND((@bucket_size * 8) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 7 AND b1.avg_us <= @bucket_size * 8), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 8) / @unit_div), \' - \', ROUND((@bucket_size * 9) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 8 AND b1.avg_us <= @bucket_size * 9), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 9) / @unit_div), \' - \', ROUND((@bucket_size * 10) / @unit_div), @unit, \')\'),\n                         REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                         @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                       FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                      WHERE b1.avg_us > @bucket_size * 9 AND b1.avg_us <= @bucket_size * 10), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 10) / @unit_div), \' - \', ROUND((@bucket_size * 11) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 10 AND b1.avg_us <= @bucket_size * 11), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 11) / @unit_div), \' - \', ROUND((@bucket_size * 12) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 11 AND b1.avg_us <= @bucket_size * 12), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 12) / @unit_div), \' - \', ROUND((@bucket_size * 13) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 12 AND b1.avg_us <= @bucket_size * 13), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 13) / @unit_div), \' - \', ROUND((@bucket_size * 14) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 13 AND b1.avg_us <= @bucket_size * 14), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 14) / @unit_div), \' - \', ROUND((@bucket_size * 15) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 14 AND b1.avg_us <= @bucket_size * 15), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       @label := CONCAT(@label_inner := CONCAT(\'\\n(\', ROUND((@bucket_size * 15) / @unit_div), \' - \', ROUND((@bucket_size * 16) / @unit_div), @unit, \')\'),\n                        REPEAT(\' \', @max_label_size - LENGTH(@label_inner)),\n                        @count_in_bucket := IFNULL((SELECT SUM(cnt)\n                                                      FROM sys.x$ps_digest_avg_latency_distribution AS b1\n                                                     WHERE b1.avg_us > @bucket_size * 15 AND b1.avg_us <= @bucket_size * 16), 0)),\n       REPEAT(\' \', @max_label_len - LENGTH(@label)), \'| \',\n       IFNULL(REPEAT(IF(@count_in_bucket < @one_unit, \'.\', IF(@count_in_bucket < @two_unit, \'*\', \'#\')),\n       	             IF(@count_in_bucket < @one_unit, @count_in_bucket,\n       	             	IF(@count_in_bucket < @two_unit, @count_in_bucket / 2, @count_in_bucket / 3))), \'\'),\n       \'\\n\\n  Total Statements: \', @total_queries, \'; Buckets: \', @buckets , \'; Bucket Size: \', ROUND(@bucket_size / @unit_div) , \' \', @unit, \';\\n\'\n      ) AS `Performance Schema Statement Digest Average Latency Histogram`;\nEND','NONE'),
('sys','ps_trace_statement_digest','PROCEDURE','ps_trace_statement_digest','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_digest VARCHAR(32),\n        IN in_runtime INT,\n        IN in_interval DECIMAL(2,2),\n        IN in_start_fresh BOOLEAN,\n        IN in_auto_enable BOOLEAN\n    ','','BEGIN\n    DECLARE v_start_fresh BOOLEAN DEFAULT false;\n    DECLARE v_auto_enable BOOLEAN DEFAULT false;\n    DECLARE v_explain     BOOLEAN DEFAULT true;\n    DECLARE v_this_thread_enabed ENUM(\'YES\', \'NO\');\n    DECLARE v_runtime INT DEFAULT 0;\n    DECLARE v_start INT DEFAULT 0;\n    DECLARE v_found_stmts INT;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    DROP TEMPORARY TABLE IF EXISTS stmt_trace;\n    CREATE TEMPORARY TABLE stmt_trace (\n        thread_id BIGINT UNSIGNED,\n        timer_start BIGINT UNSIGNED,\n        event_id BIGINT UNSIGNED,\n        sql_text longtext,\n        timer_wait BIGINT UNSIGNED,\n        lock_time BIGINT UNSIGNED,\n        errors BIGINT UNSIGNED,\n        mysql_errno INT,\n        rows_sent BIGINT UNSIGNED,\n        rows_affected BIGINT UNSIGNED,\n        rows_examined BIGINT UNSIGNED,\n        created_tmp_tables BIGINT UNSIGNED,\n        created_tmp_disk_tables BIGINT UNSIGNED,\n        no_index_used BIGINT UNSIGNED,\n        PRIMARY KEY (thread_id, timer_start)\n    );\n    DROP TEMPORARY TABLE IF EXISTS stmt_stages;\n    CREATE TEMPORARY TABLE stmt_stages (\n       event_id BIGINT UNSIGNED,\n       stmt_id BIGINT UNSIGNED,\n       event_name VARCHAR(128),\n       timer_wait BIGINT UNSIGNED,\n       PRIMARY KEY (event_id)\n    );\n    SET v_start_fresh = in_start_fresh;\n    IF v_start_fresh THEN\n        TRUNCATE TABLE performance_schema.events_statements_history_long;\n        TRUNCATE TABLE performance_schema.events_stages_history_long;\n    END IF;\n    SET v_auto_enable = in_auto_enable;\n    IF v_auto_enable THEN\n        CALL sys.ps_setup_save(0);\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = IF(PROCESSLIST_ID IS NOT NULL, \'YES\', \'NO\');\n        UPDATE performance_schema.setup_consumers\n           SET ENABLED = \'YES\'\n         WHERE NAME NOT LIKE \'%\\_history\'\n               AND NAME NOT LIKE \'events_wait%\'\n               AND NAME NOT LIKE \'events_transactions%\'\n               AND NAME <> \'statements_digest\';\n        UPDATE performance_schema.setup_instruments\n           SET ENABLED = \'YES\',\n               TIMED   = \'YES\'\n         WHERE NAME LIKE \'statement/%\' OR NAME LIKE \'stage/%\';\n    END IF;\n    WHILE v_runtime < in_runtime DO\n        SELECT UNIX_TIMESTAMP() INTO v_start;\n        INSERT IGNORE INTO stmt_trace\n        SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno,\n               rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used\n          FROM performance_schema.events_statements_history_long\n        WHERE digest = in_digest;\n        INSERT IGNORE INTO stmt_stages\n        SELECT stages.event_id, stmt_trace.event_id,\n               stages.event_name, stages.timer_wait\n          FROM performance_schema.events_stages_history_long AS stages\n          JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id;\n        SELECT SLEEP(in_interval) INTO @sleep;\n        SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);\n    END WHILE;\n    SELECT \"SUMMARY STATISTICS\";\n    SELECT COUNT(*) executions,\n           sys.format_time(SUM(timer_wait)) AS exec_time,\n           sys.format_time(SUM(lock_time)) AS lock_time,\n           SUM(rows_sent) AS rows_sent,\n           SUM(rows_affected) AS rows_affected,\n           SUM(rows_examined) AS rows_examined,\n           SUM(created_tmp_tables) AS tmp_tables,\n           SUM(no_index_used) AS full_scans\n      FROM stmt_trace;\n    SELECT event_name,\n           COUNT(*) as count,\n           sys.format_time(SUM(timer_wait)) as latency\n      FROM stmt_stages\n     GROUP BY event_name\n     ORDER BY SUM(timer_wait) DESC;\n    SELECT \"LONGEST RUNNING STATEMENT\";\n    SELECT thread_id,\n           sys.format_time(timer_wait) AS exec_time,\n           sys.format_time(lock_time) AS lock_time,\n           rows_sent,\n           rows_affected,\n           rows_examined,\n           created_tmp_tables AS tmp_tables,\n           no_index_used AS full_scan\n      FROM stmt_trace\n     ORDER BY timer_wait DESC LIMIT 1;\n    SELECT sql_text\n      FROM stmt_trace\n     ORDER BY timer_wait DESC LIMIT 1;\n    SELECT sql_text, event_id INTO @sql, @sql_id\n      FROM stmt_trace\n    ORDER BY timer_wait DESC LIMIT 1;\n    IF (@sql_id IS NOT NULL) THEN\n        SELECT event_name,\n               sys.format_time(timer_wait) as latency\n          FROM stmt_stages\n         WHERE stmt_id = @sql_id\n         ORDER BY event_id;\n    END IF;\n    DROP TEMPORARY TABLE stmt_trace;\n    DROP TEMPORARY TABLE stmt_stages;\n    IF (@sql IS NOT NULL) THEN\n        SET @stmt := CONCAT(\"EXPLAIN FORMAT=JSON \", @sql);\n        BEGIN\n            DECLARE CONTINUE HANDLER FOR 1064, 1146 SET v_explain = false;\n            PREPARE explain_stmt FROM @stmt;\n        END;\n        IF (v_explain) THEN\n            EXECUTE explain_stmt;\n            DEALLOCATE PREPARE explain_stmt;\n        END IF;\n    END IF;\n    IF v_auto_enable THEN\n        CALL sys.ps_setup_reload_saved();\n    END IF;\n    IF (v_this_thread_enabed = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Traces all instrumentation within Performance Schema for a specific\n             Statement Digest.\n             When finding a statement of interest within the\n             performance_schema.events_statements_summary_by_digest table, feed\n             the DIGEST MD5 value in to this procedure, set how long to poll for,\n             and at what interval to poll, and it will generate a report of all\n             statistics tracked within Performance Schema for that digest for the\n             interval.\n             It will also attempt to generate an EXPLAIN for the longest running\n             example of the digest during the interval. Note this may fail, as:\n                * Performance Schema truncates long SQL_TEXT values (and hence the\n                  EXPLAIN will fail due to parse errors)\n                * the default schema is sys (so tables that are not fully qualified\n                  in the query may not be found)\n                * some queries such as SHOW are not supported in EXPLAIN.\n             When the EXPLAIN fails, the error will be ignored and no EXPLAIN\n             output generated.\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Parameters\n             in_digest (VARCHAR(32)):\n               The statement digest identifier you would like to analyze\n             in_runtime (INT):\n               The number of seconds to run analysis for\n             in_interval (DECIMAL(2,2)):\n               The interval (in seconds, may be fractional) at which to try\n               and take snapshots\n             in_start_fresh (BOOLEAN):\n               Whether to TRUNCATE the events_statements_history_long and\n               events_stages_history_long tables before starting\n             in_auto_enable (BOOLEAN):\n               Whether to automatically turn on required consumers\n             Example\n             mysql> call ps_trace_statement_digest(\'891ec6860f98ba46d89dd20b0c03652c\', 10, 0.1, true, true);\n             +--------------------+\n             | SUMMARY STATISTICS |\n             +--------------------+\n             | SUMMARY STATISTICS |\n             +--------------------+\n             1 row in set (9.11 sec)\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             | executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             |         21 | 4.11 ms   | 2.00 ms   |         0 |            21 |          0 |          0 |\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             1 row in set (9.11 sec)\n             +------------------------------------------+-------+-----------+\n             | event_name                               | count | latency   |\n             +------------------------------------------+-------+-----------+\n             | stage/sql/checking query cache for query |    16 | 724.37 us |\n             | stage/sql/statistics                     |    16 | 546.92 us |\n             | stage/sql/freeing items                  |    18 | 520.11 us |\n             | stage/sql/init                           |    51 | 466.80 us |\n             ...\n             | stage/sql/cleaning up                    |    18 | 11.92 us  |\n             | stage/sql/executing                      |    16 | 6.95 us   |\n             +------------------------------------------+-------+-----------+\n             17 rows in set (9.12 sec)\n             +---------------------------+\n             | LONGEST RUNNING STATEMENT |\n             +---------------------------+\n             | LONGEST RUNNING STATEMENT |\n             +---------------------------+\n             1 row in set (9.16 sec)\n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             | thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |\n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             |    166646 | 618.43 us | 1.00 ms   |         0 |             1 |          0 |         0 |\n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             1 row in set (9.16 sec)\n             // Truncated for clarity...\n             +-----------------------------------------------------------------+\n             | sql_text                                                        |\n             +-----------------------------------------------------------------+\n             | select hibeventhe0_.id as id1382_, hibeventhe0_.createdTime ... |\n             +-----------------------------------------------------------------+\n             1 row in set (9.17 sec)\n             +------------------------------------------+-----------+\n             | event_name                               | latency   |\n             +------------------------------------------+-----------+\n             | stage/sql/init                           | 8.61 us   |\n             | stage/sql/Waiting for query cache lock   | 453.23 us |\n             | stage/sql/init                           | 331.07 ns |\n             | stage/sql/checking query cache for query | 43.04 us  |\n             ...\n             | stage/sql/freeing items                  | 30.46 us  |\n             | stage/sql/cleaning up                    | 662.13 ns |\n             +------------------------------------------+-----------+\n             18 rows in set (9.23 sec)\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             | id | select_type | table        | type  | possible_keys | key       | key_len | ref         | rows | Extra |\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             |  1 | SIMPLE      | hibeventhe0_ | const | fixedTime     | fixedTime | 775     | const,const |    1 | NULL  |\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             1 row in set (9.27 sec)\n             Query OK, 0 rows affected (9.28 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_start_fresh BOOLEAN DEFAULT false;\n    DECLARE v_auto_enable BOOLEAN DEFAULT false;\n    DECLARE v_explain     BOOLEAN DEFAULT true;\n    DECLARE v_this_thread_enabed ENUM(\'YES\', \'NO\');\n    DECLARE v_runtime INT DEFAULT 0;\n    DECLARE v_start INT DEFAULT 0;\n    DECLARE v_found_stmts INT;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    DROP TEMPORARY TABLE IF EXISTS stmt_trace;\n    CREATE TEMPORARY TABLE stmt_trace (\n        thread_id BIGINT UNSIGNED,\n        timer_start BIGINT UNSIGNED,\n        event_id BIGINT UNSIGNED,\n        sql_text longtext,\n        timer_wait BIGINT UNSIGNED,\n        lock_time BIGINT UNSIGNED,\n        errors BIGINT UNSIGNED,\n        mysql_errno INT,\n        rows_sent BIGINT UNSIGNED,\n        rows_affected BIGINT UNSIGNED,\n        rows_examined BIGINT UNSIGNED,\n        created_tmp_tables BIGINT UNSIGNED,\n        created_tmp_disk_tables BIGINT UNSIGNED,\n        no_index_used BIGINT UNSIGNED,\n        PRIMARY KEY (thread_id, timer_start)\n    );\n    DROP TEMPORARY TABLE IF EXISTS stmt_stages;\n    CREATE TEMPORARY TABLE stmt_stages (\n       event_id BIGINT UNSIGNED,\n       stmt_id BIGINT UNSIGNED,\n       event_name VARCHAR(128),\n       timer_wait BIGINT UNSIGNED,\n       PRIMARY KEY (event_id)\n    );\n    SET v_start_fresh = in_start_fresh;\n    IF v_start_fresh THEN\n        TRUNCATE TABLE performance_schema.events_statements_history_long;\n        TRUNCATE TABLE performance_schema.events_stages_history_long;\n    END IF;\n    SET v_auto_enable = in_auto_enable;\n    IF v_auto_enable THEN\n        CALL sys.ps_setup_save(0);\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = IF(PROCESSLIST_ID IS NOT NULL, \'YES\', \'NO\');\n        UPDATE performance_schema.setup_consumers\n           SET ENABLED = \'YES\'\n         WHERE NAME NOT LIKE \'%\\_history\'\n               AND NAME NOT LIKE \'events_wait%\'\n               AND NAME NOT LIKE \'events_transactions%\'\n               AND NAME <> \'statements_digest\';\n        UPDATE performance_schema.setup_instruments\n           SET ENABLED = \'YES\',\n               TIMED   = \'YES\'\n         WHERE NAME LIKE \'statement/%\' OR NAME LIKE \'stage/%\';\n    END IF;\n    WHILE v_runtime < in_runtime DO\n        SELECT UNIX_TIMESTAMP() INTO v_start;\n        INSERT IGNORE INTO stmt_trace\n        SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno,\n               rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used\n          FROM performance_schema.events_statements_history_long\n        WHERE digest = in_digest;\n        INSERT IGNORE INTO stmt_stages\n        SELECT stages.event_id, stmt_trace.event_id,\n               stages.event_name, stages.timer_wait\n          FROM performance_schema.events_stages_history_long AS stages\n          JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id;\n        SELECT SLEEP(in_interval) INTO @sleep;\n        SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);\n    END WHILE;\n    SELECT \"SUMMARY STATISTICS\";\n    SELECT COUNT(*) executions,\n           sys.format_time(SUM(timer_wait)) AS exec_time,\n           sys.format_time(SUM(lock_time)) AS lock_time,\n           SUM(rows_sent) AS rows_sent,\n           SUM(rows_affected) AS rows_affected,\n           SUM(rows_examined) AS rows_examined,\n           SUM(created_tmp_tables) AS tmp_tables,\n           SUM(no_index_used) AS full_scans\n      FROM stmt_trace;\n    SELECT event_name,\n           COUNT(*) as count,\n           sys.format_time(SUM(timer_wait)) as latency\n      FROM stmt_stages\n     GROUP BY event_name\n     ORDER BY SUM(timer_wait) DESC;\n    SELECT \"LONGEST RUNNING STATEMENT\";\n    SELECT thread_id,\n           sys.format_time(timer_wait) AS exec_time,\n           sys.format_time(lock_time) AS lock_time,\n           rows_sent,\n           rows_affected,\n           rows_examined,\n           created_tmp_tables AS tmp_tables,\n           no_index_used AS full_scan\n      FROM stmt_trace\n     ORDER BY timer_wait DESC LIMIT 1;\n    SELECT sql_text\n      FROM stmt_trace\n     ORDER BY timer_wait DESC LIMIT 1;\n    SELECT sql_text, event_id INTO @sql, @sql_id\n      FROM stmt_trace\n    ORDER BY timer_wait DESC LIMIT 1;\n    IF (@sql_id IS NOT NULL) THEN\n        SELECT event_name,\n               sys.format_time(timer_wait) as latency\n          FROM stmt_stages\n         WHERE stmt_id = @sql_id\n         ORDER BY event_id;\n    END IF;\n    DROP TEMPORARY TABLE stmt_trace;\n    DROP TEMPORARY TABLE stmt_stages;\n    IF (@sql IS NOT NULL) THEN\n        SET @stmt := CONCAT(\"EXPLAIN FORMAT=JSON \", @sql);\n        BEGIN\n            DECLARE CONTINUE HANDLER FOR 1064, 1146 SET v_explain = false;\n            PREPARE explain_stmt FROM @stmt;\n        END;\n        IF (v_explain) THEN\n            EXECUTE explain_stmt;\n            DEALLOCATE PREPARE explain_stmt;\n        END IF;\n    END IF;\n    IF v_auto_enable THEN\n        CALL sys.ps_setup_reload_saved();\n    END IF;\n    IF (v_this_thread_enabed = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','NONE'),
('sys','ps_trace_thread','PROCEDURE','ps_trace_thread','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_thread_id BIGINT UNSIGNED,\n        IN in_outfile VARCHAR(255),\n        IN in_max_runtime DECIMAL(20,2),\n        IN in_interval DECIMAL(20,2),\n        IN in_start_fresh BOOLEAN,\n        IN in_auto_setup BOOLEAN,\n        IN in_debug BOOLEAN\n    ','','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_start, v_runtime DECIMAL(20,2) DEFAULT 0.0;\n    DECLARE v_min_event_id bigint unsigned DEFAULT 0;\n    DECLARE v_this_thread_enabed ENUM(\'YES\', \'NO\');\n    DECLARE v_event longtext;\n    DECLARE c_stack CURSOR FOR\n        SELECT CONCAT(IF(nesting_event_id IS NOT NULL, CONCAT(nesting_event_id, \' -> \'), \'\'),\n                    event_id, \'; \', event_id, \' [label=\"\',\n                    \'(\', sys.format_time(timer_wait), \') \',\n                    IF (event_name NOT LIKE \'wait/io%\',\n                        SUBSTRING_INDEX(event_name, \'/\', -2),\n                        IF (event_name NOT LIKE \'wait/io/file%\' OR event_name NOT LIKE \'wait/io/socket%\',\n                            SUBSTRING_INDEX(event_name, \'/\', -4),\n                            event_name)\n                        ),\n                    IF (event_name LIKE \'statement/%\', IFNULL(CONCAT(\'\\\\n\', wait_info), \'\'), \'\'),\n                    IF (in_debug AND event_name LIKE \'wait%\', wait_info, \'\'),\n                    \'\", \',\n                    CASE WHEN event_name LIKE \'wait/io/file%\' THEN\n                           \'shape=box, style=filled, color=red\'\n                         WHEN event_name LIKE \'wait/io/table%\' THEN\n                           \'shape=box, style=filled, color=green\'\n                         WHEN event_name LIKE \'wait/io/socket%\' THEN\n                           \'shape=box, style=filled, color=yellow\'\n                         WHEN event_name LIKE \'wait/synch/mutex%\' THEN\n                           \'style=filled, color=lightskyblue\'\n                         WHEN event_name LIKE \'wait/synch/cond%\' THEN\n                           \'style=filled, color=darkseagreen3\'\n                         WHEN event_name LIKE \'wait/synch/rwlock%\' THEN\n                           \'style=filled, color=orchid\'\n                         WHEN event_name LIKE \'wait/lock%\' THEN\n                           \'shape=box, style=filled, color=tan\'\n                         WHEN event_name LIKE \'statement/%\' THEN\n                           CONCAT(\'shape=box, style=bold\',\n                                  CASE WHEN event_name LIKE \'statement/com/%\' THEN\n                                         \' style=filled, color=darkseagreen\'\n                                       ELSE\n                                         IF((timer_wait/1000000000000) > @@log_slow_query_time,\n                                            \' style=filled, color=red\',\n                                            \' style=filled, color=lightblue\')\n                                  END\n                           )\n                         WHEN event_name LIKE \'stage/%\' THEN\n                           \'style=filled, color=slategray3\'\n                         WHEN event_name LIKE \'%idle%\' THEN\n                           \'shape=box, style=filled, color=firebrick3\'\n                         ELSE \'\' END,\n                     \'];\\n\'\n                   ) event, event_id\n        FROM (\n             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id,\n                     CONCAT(sql_text, \'\\\\n\',\n                            \'errors: \', errors, \'\\\\n\',\n                            \'warnings: \', warnings, \'\\\\n\',\n                            \'lock time: \', sys.format_time(lock_time),\'\\\\n\',\n                            \'rows affected: \', rows_affected, \'\\\\n\',\n                            \'rows sent: \', rows_sent, \'\\\\n\',\n                            \'rows examined: \', rows_examined, \'\\\\n\',\n                            \'tmp tables: \', created_tmp_tables, \'\\\\n\',\n                            \'tmp disk tables: \', created_tmp_disk_tables, \'\\\\n\'\n                            \'select scan: \', select_scan, \'\\\\n\',\n                            \'select full join: \', select_full_join, \'\\\\n\',\n                            \'select full range join: \', select_full_range_join, \'\\\\n\',\n                            \'select range: \', select_range, \'\\\\n\',\n                            \'select range check: \', select_range_check, \'\\\\n\',\n                            \'sort merge passes: \', sort_merge_passes, \'\\\\n\',\n                            \'sort rows: \', sort_rows, \'\\\\n\',\n                            \'sort range: \', sort_range, \'\\\\n\',\n                            \'sort scan: \', sort_scan, \'\\\\n\',\n                            \'no index used: \', IF(no_index_used, \'TRUE\', \'FALSE\'), \'\\\\n\',\n                            \'no good index used: \', IF(no_good_index_used, \'TRUE\', \'FALSE\'), \'\\\\n\'\n                     ) AS wait_info\n                FROM performance_schema.events_statements_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n             UNION\n             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info\n                FROM performance_schema.events_stages_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n             UNION\n             (SELECT thread_id, event_id,\n                     CONCAT(event_name,\n                            IF(event_name NOT LIKE \'wait/synch/mutex%\', IFNULL(CONCAT(\' - \', operation), \'\'), \'\'),\n                            IF(number_of_bytes IS NOT NULL, CONCAT(\' \', number_of_bytes, \' bytes\'), \'\'),\n                            IF(event_name LIKE \'wait/io/file%\', \'\\\\n\', \'\'),\n                            IF(object_schema IS NOT NULL, CONCAT(\'\\\\nObject: \', object_schema, \'.\'), \'\'),\n                            IF(object_name IS NOT NULL,\n                               IF (event_name LIKE \'wait/io/socket%\',\n                                   CONCAT(\'\\\\n\', IF (object_name LIKE \':0%\', @@socket, object_name)),\n                                   object_name),\n                               \'\'\n                            ),\n                            IF(index_name IS NOT NULL, CONCAT(\' Index: \', index_name), \'\'), \'\\\\n\'\n                     ) AS event_name,\n                     timer_wait, timer_start, nesting_event_id, source AS wait_info\n                FROM performance_schema.events_waits_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n           ) events\n       ORDER BY event_id;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    IF (in_auto_setup) THEN\n        CALL sys.ps_setup_save(0);\n        DELETE FROM performance_schema.setup_actors;\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = IF(THREAD_ID = in_thread_id, \'YES\', \'NO\');\n        UPDATE performance_schema.setup_consumers\n           SET ENABLED = \'YES\'\n         WHERE NAME NOT LIKE \'%\\_history\';\n        UPDATE performance_schema.setup_instruments\n           SET ENABLED = \'YES\',\n               TIMED   = \'YES\';\n    END IF;\n    IF (in_start_fresh) THEN\n        TRUNCATE performance_schema.events_statements_history_long;\n        TRUNCATE performance_schema.events_stages_history_long;\n        TRUNCATE performance_schema.events_waits_history_long;\n    END IF;\n    DROP TEMPORARY TABLE IF EXISTS tmp_events;\n    CREATE TEMPORARY TABLE tmp_events (\n      event_id bigint unsigned NOT NULL,\n      event longblob,\n      PRIMARY KEY (event_id)\n    );\n    INSERT INTO tmp_events VALUES (0, CONCAT(\'digraph events { rankdir=LR; nodesep=0.10;\\n\',\n                                             \'// Stack created .....: \', NOW(), \'\\n\',\n                                             \'// MySQL version .....: \', VERSION(), \'\\n\',\n                                             \'// MySQL hostname ....: \', @@hostname, \'\\n\',\n                                             \'// MySQL port ........: \', @@port, \'\\n\',\n                                             \'// MySQL socket ......: \', @@socket, \'\\n\',\n                                             \'// MySQL user ........: \', CURRENT_USER(), \'\\n\'));\n    SELECT CONCAT(\'Data collection starting for THREAD_ID = \', in_thread_id) AS \'Info\';\n    SET v_min_event_id = 0,\n        v_start        = UNIX_TIMESTAMP(),\n        in_interval    = IFNULL(in_interval, 1.00),\n        in_max_runtime = IFNULL(in_max_runtime, 60.00);\n    WHILE (v_runtime < in_max_runtime\n           AND (SELECT INSTRUMENTED FROM performance_schema.threads WHERE THREAD_ID = in_thread_id) = \'YES\') DO\n        SET v_done = FALSE;\n        OPEN c_stack;\n        c_stack_loop: LOOP\n            FETCH c_stack INTO v_event, v_min_event_id;\n            IF v_done THEN\n                LEAVE c_stack_loop;\n            END IF;\n            IF (LENGTH(v_event) > 0) THEN\n                INSERT INTO tmp_events VALUES (v_min_event_id, v_event);\n            END IF;\n        END LOOP;\n        CLOSE c_stack;\n        SELECT SLEEP(in_interval) INTO @sleep;\n        SET v_runtime = (UNIX_TIMESTAMP() - v_start);\n    END WHILE;\n    INSERT INTO tmp_events VALUES (v_min_event_id+1, \'}\');\n    SET @query = CONCAT(\'SELECT event FROM tmp_events ORDER BY event_id INTO OUTFILE \'\'\', in_outfile, \'\'\' FIELDS ESCAPED BY \'\'\'\' LINES TERMINATED BY \'\'\'\'\');\n    PREPARE stmt_output FROM @query;\n    EXECUTE stmt_output;\n    DEALLOCATE PREPARE stmt_output;\n    SELECT CONCAT(\'Stack trace written to \', in_outfile) AS \'Info\';\n    SELECT CONCAT(\'dot -Tpdf -o /tmp/stack_\', in_thread_id, \'.pdf \', in_outfile) AS \'Convert to PDF\';\n    SELECT CONCAT(\'dot -Tpng -o /tmp/stack_\', in_thread_id, \'.png \', in_outfile) AS \'Convert to PNG\';\n    DROP TEMPORARY TABLE tmp_events;\n    IF (in_auto_setup) THEN\n        CALL sys.ps_setup_reload_saved();\n    END IF;\n    IF (v_this_thread_enabed = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Dumps all data within Performance Schema for an instrumented thread,\n             to create a DOT formatted graph file.\n             Each resultset returned from the procedure should be used for a complete graph\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Parameters\n             in_thread_id (BIGINT UNSIGNED):\n               The thread that you would like a stack trace for\n             in_outfile  (VARCHAR(255)):\n               The filename the dot file will be written to\n             in_max_runtime (DECIMAL(20,2)):\n               The maximum time to keep collecting data.\n               Use NULL to get the default which is 60 seconds.\n             in_interval (DECIMAL(20,2)):\n               How long to sleep between data collections.\n               Use NULL to get the default which is 1 second.\n             in_start_fresh (BOOLEAN):\n               Whether to reset all Performance Schema data before tracing.\n             in_auto_setup (BOOLEAN):\n               Whether to disable all other threads and enable all consumers/instruments.\n               This will also reset the settings at the end of the run.\n             in_debug (BOOLEAN):\n               Whether you would like to include file:lineno in the graph\n             Example\n             mysql> CALL sys.ps_trace_thread(25, CONCAT(\'/tmp/stack-\', REPLACE(NOW(), \' \', \'-\'), \'.dot\'), NULL, NULL, TRUE, TRUE, TRUE);\n             +-------------------+\n             | summary           |\n             +-------------------+\n             | Disabled 1 thread |\n             +-------------------+\n             1 row in set (0.00 sec)\n             +---------------------------------------------+\n             | Info                                        |\n             +---------------------------------------------+\n             | Data collection starting for THREAD_ID = 25 |\n             +---------------------------------------------+\n             1 row in set (0.03 sec)\n             +-----------------------------------------------------------+\n             | Info                                                      |\n             +-----------------------------------------------------------+\n             | Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |\n             +-----------------------------------------------------------+\n             1 row in set (60.07 sec)\n             +-------------------------------------------------------------------+\n             | Convert to PDF                                                    |\n             +-------------------------------------------------------------------+\n             | dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |\n             +-------------------------------------------------------------------+\n             1 row in set (60.07 sec)\n             +-------------------------------------------------------------------+\n             | Convert to PNG                                                    |\n             +-------------------------------------------------------------------+\n             | dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |\n             +-------------------------------------------------------------------+\n             1 row in set (60.07 sec)\n             +------------------+\n             | summary          |\n             +------------------+\n             | Enabled 1 thread |\n             +------------------+\n             1 row in set (60.32 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_start, v_runtime DECIMAL(20,2) DEFAULT 0.0;\n    DECLARE v_min_event_id bigint unsigned DEFAULT 0;\n    DECLARE v_this_thread_enabed ENUM(\'YES\', \'NO\');\n    DECLARE v_event longtext;\n    DECLARE c_stack CURSOR FOR\n        SELECT CONCAT(IF(nesting_event_id IS NOT NULL, CONCAT(nesting_event_id, \' -> \'), \'\'),\n                    event_id, \'; \', event_id, \' [label=\"\',\n                    \'(\', sys.format_time(timer_wait), \') \',\n                    IF (event_name NOT LIKE \'wait/io%\',\n                        SUBSTRING_INDEX(event_name, \'/\', -2),\n                        IF (event_name NOT LIKE \'wait/io/file%\' OR event_name NOT LIKE \'wait/io/socket%\',\n                            SUBSTRING_INDEX(event_name, \'/\', -4),\n                            event_name)\n                        ),\n                    IF (event_name LIKE \'statement/%\', IFNULL(CONCAT(\'\\n\', wait_info), \'\'), \'\'),\n                    IF (in_debug AND event_name LIKE \'wait%\', wait_info, \'\'),\n                    \'\", \',\n                    CASE WHEN event_name LIKE \'wait/io/file%\' THEN\n                           \'shape=box, style=filled, color=red\'\n                         WHEN event_name LIKE \'wait/io/table%\' THEN\n                           \'shape=box, style=filled, color=green\'\n                         WHEN event_name LIKE \'wait/io/socket%\' THEN\n                           \'shape=box, style=filled, color=yellow\'\n                         WHEN event_name LIKE \'wait/synch/mutex%\' THEN\n                           \'style=filled, color=lightskyblue\'\n                         WHEN event_name LIKE \'wait/synch/cond%\' THEN\n                           \'style=filled, color=darkseagreen3\'\n                         WHEN event_name LIKE \'wait/synch/rwlock%\' THEN\n                           \'style=filled, color=orchid\'\n                         WHEN event_name LIKE \'wait/lock%\' THEN\n                           \'shape=box, style=filled, color=tan\'\n                         WHEN event_name LIKE \'statement/%\' THEN\n                           CONCAT(\'shape=box, style=bold\',\n                                  CASE WHEN event_name LIKE \'statement/com/%\' THEN\n                                         \' style=filled, color=darkseagreen\'\n                                       ELSE\n                                         IF((timer_wait/1000000000000) > @@log_slow_query_time,\n                                            \' style=filled, color=red\',\n                                            \' style=filled, color=lightblue\')\n                                  END\n                           )\n                         WHEN event_name LIKE \'stage/%\' THEN\n                           \'style=filled, color=slategray3\'\n                         WHEN event_name LIKE \'%idle%\' THEN\n                           \'shape=box, style=filled, color=firebrick3\'\n                         ELSE \'\' END,\n                     \'];\\n\'\n                   ) event, event_id\n        FROM (\n             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id,\n                     CONCAT(sql_text, \'\\n\',\n                            \'errors: \', errors, \'\\n\',\n                            \'warnings: \', warnings, \'\\n\',\n                            \'lock time: \', sys.format_time(lock_time),\'\\n\',\n                            \'rows affected: \', rows_affected, \'\\n\',\n                            \'rows sent: \', rows_sent, \'\\n\',\n                            \'rows examined: \', rows_examined, \'\\n\',\n                            \'tmp tables: \', created_tmp_tables, \'\\n\',\n                            \'tmp disk tables: \', created_tmp_disk_tables, \'\\n\'\n                            \'select scan: \', select_scan, \'\\n\',\n                            \'select full join: \', select_full_join, \'\\n\',\n                            \'select full range join: \', select_full_range_join, \'\\n\',\n                            \'select range: \', select_range, \'\\n\',\n                            \'select range check: \', select_range_check, \'\\n\',\n                            \'sort merge passes: \', sort_merge_passes, \'\\n\',\n                            \'sort rows: \', sort_rows, \'\\n\',\n                            \'sort range: \', sort_range, \'\\n\',\n                            \'sort scan: \', sort_scan, \'\\n\',\n                            \'no index used: \', IF(no_index_used, \'TRUE\', \'FALSE\'), \'\\n\',\n                            \'no good index used: \', IF(no_good_index_used, \'TRUE\', \'FALSE\'), \'\\n\'\n                     ) AS wait_info\n                FROM performance_schema.events_statements_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n             UNION\n             (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info\n                FROM performance_schema.events_stages_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n             UNION\n             (SELECT thread_id, event_id,\n                     CONCAT(event_name,\n                            IF(event_name NOT LIKE \'wait/synch/mutex%\', IFNULL(CONCAT(\' - \', operation), \'\'), \'\'),\n                            IF(number_of_bytes IS NOT NULL, CONCAT(\' \', number_of_bytes, \' bytes\'), \'\'),\n                            IF(event_name LIKE \'wait/io/file%\', \'\\n\', \'\'),\n                            IF(object_schema IS NOT NULL, CONCAT(\'\\nObject: \', object_schema, \'.\'), \'\'),\n                            IF(object_name IS NOT NULL,\n                               IF (event_name LIKE \'wait/io/socket%\',\n                                   CONCAT(\'\\n\', IF (object_name LIKE \':0%\', @@socket, object_name)),\n                                   object_name),\n                               \'\'\n                            ),\n                            IF(index_name IS NOT NULL, CONCAT(\' Index: \', index_name), \'\'), \'\\n\'\n                     ) AS event_name,\n                     timer_wait, timer_start, nesting_event_id, source AS wait_info\n                FROM performance_schema.events_waits_history_long\n               WHERE thread_id = in_thread_id AND event_id > v_min_event_id)\n           ) events\n       ORDER BY event_id;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    IF (in_auto_setup) THEN\n        CALL sys.ps_setup_save(0);\n        DELETE FROM performance_schema.setup_actors;\n        UPDATE performance_schema.threads\n           SET INSTRUMENTED = IF(THREAD_ID = in_thread_id, \'YES\', \'NO\');\n        UPDATE performance_schema.setup_consumers\n           SET ENABLED = \'YES\'\n         WHERE NAME NOT LIKE \'%\\_history\';\n        UPDATE performance_schema.setup_instruments\n           SET ENABLED = \'YES\',\n               TIMED   = \'YES\';\n    END IF;\n    IF (in_start_fresh) THEN\n        TRUNCATE performance_schema.events_statements_history_long;\n        TRUNCATE performance_schema.events_stages_history_long;\n        TRUNCATE performance_schema.events_waits_history_long;\n    END IF;\n    DROP TEMPORARY TABLE IF EXISTS tmp_events;\n    CREATE TEMPORARY TABLE tmp_events (\n      event_id bigint unsigned NOT NULL,\n      event longblob,\n      PRIMARY KEY (event_id)\n    );\n    INSERT INTO tmp_events VALUES (0, CONCAT(\'digraph events { rankdir=LR; nodesep=0.10;\\n\',\n                                             \'// Stack created .....: \', NOW(), \'\\n\',\n                                             \'// MySQL version .....: \', VERSION(), \'\\n\',\n                                             \'// MySQL hostname ....: \', @@hostname, \'\\n\',\n                                             \'// MySQL port ........: \', @@port, \'\\n\',\n                                             \'// MySQL socket ......: \', @@socket, \'\\n\',\n                                             \'// MySQL user ........: \', CURRENT_USER(), \'\\n\'));\n    SELECT CONCAT(\'Data collection starting for THREAD_ID = \', in_thread_id) AS \'Info\';\n    SET v_min_event_id = 0,\n        v_start        = UNIX_TIMESTAMP(),\n        in_interval    = IFNULL(in_interval, 1.00),\n        in_max_runtime = IFNULL(in_max_runtime, 60.00);\n    WHILE (v_runtime < in_max_runtime\n           AND (SELECT INSTRUMENTED FROM performance_schema.threads WHERE THREAD_ID = in_thread_id) = \'YES\') DO\n        SET v_done = FALSE;\n        OPEN c_stack;\n        c_stack_loop: LOOP\n            FETCH c_stack INTO v_event, v_min_event_id;\n            IF v_done THEN\n                LEAVE c_stack_loop;\n            END IF;\n            IF (LENGTH(v_event) > 0) THEN\n                INSERT INTO tmp_events VALUES (v_min_event_id, v_event);\n            END IF;\n        END LOOP;\n        CLOSE c_stack;\n        SELECT SLEEP(in_interval) INTO @sleep;\n        SET v_runtime = (UNIX_TIMESTAMP() - v_start);\n    END WHILE;\n    INSERT INTO tmp_events VALUES (v_min_event_id+1, \'}\');\n    SET @query = CONCAT(\'SELECT event FROM tmp_events ORDER BY event_id INTO OUTFILE \'\'\', in_outfile, \'\'\' FIELDS ESCAPED BY \'\'\'\' LINES TERMINATED BY \'\'\'\'\');\n    PREPARE stmt_output FROM @query;\n    EXECUTE stmt_output;\n    DEALLOCATE PREPARE stmt_output;\n    SELECT CONCAT(\'Stack trace written to \', in_outfile) AS \'Info\';\n    SELECT CONCAT(\'dot -Tpdf -o /tmp/stack_\', in_thread_id, \'.pdf \', in_outfile) AS \'Convert to PDF\';\n    SELECT CONCAT(\'dot -Tpng -o /tmp/stack_\', in_thread_id, \'.png \', in_outfile) AS \'Convert to PNG\';\n    DROP TEMPORARY TABLE tmp_events;\n    IF (in_auto_setup) THEN\n        CALL sys.ps_setup_reload_saved();\n    END IF;\n    IF (v_this_thread_enabed = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','NONE'),
('sys','ps_setup_reset_to_default','PROCEDURE','ps_setup_reset_to_default','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n       IN in_verbose BOOLEAN\n    ','','BEGIN\n    SET @query = \'DELETE\n                    FROM performance_schema.setup_actors\n                   WHERE NOT (HOST = \'\'%\'\' AND USER = \'\'%\'\' AND ROLE = \'\'%\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_actors\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'INSERT IGNORE INTO performance_schema.setup_actors\n                  VALUES (\'\'%\'\', \'\'%\'\', \'\'%\'\', \'\'YES\'\', \'\'YES\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_actors\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.setup_instruments\n                     SET ENABLED = sys.ps_is_instrument_default_enabled(NAME),\n                         TIMED   = sys.ps_is_instrument_default_timed(NAME)\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_instruments\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.setup_consumers\n                     SET ENABLED = IF(NAME IN (\'\'events_statements_current\'\', \'\'events_transactions_current\'\', \'\'global_instrumentation\'\', \'\'thread_instrumentation\'\', \'\'statements_digest\'\'), \'\'YES\'\', \'\'NO\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_consumers\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'DELETE\n                    FROM performance_schema.setup_objects\n                   WHERE NOT (OBJECT_TYPE IN (\'\'EVENT\'\', \'\'FUNCTION\'\', \'\'PROCEDURE\'\', \'\'TABLE\'\', \'\'TRIGGER\'\') AND OBJECT_NAME = \'\'%\'\'\n                     AND (OBJECT_SCHEMA = \'\'mysql\'\'              AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\n                      OR (OBJECT_SCHEMA = \'\'performance_schema\'\' AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\n                      OR (OBJECT_SCHEMA = \'\'information_schema\'\' AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\n                      OR (OBJECT_SCHEMA = \'\'%\'\'                  AND ENABLED = \'\'YES\'\' AND TIMED = \'\'YES\'\'))\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_objects\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'INSERT IGNORE INTO performance_schema.setup_objects\n                  VALUES (\'\'EVENT\'\'    , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'EVENT\'\'    , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'EVENT\'\'    , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'EVENT\'\'    , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\n                         (\'\'FUNCTION\'\' , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'FUNCTION\'\' , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'FUNCTION\'\' , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'FUNCTION\'\' , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\n                         (\'\'PROCEDURE\'\', \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'PROCEDURE\'\', \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'PROCEDURE\'\', \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'PROCEDURE\'\', \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\n                         (\'\'TABLE\'\'    , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TABLE\'\'    , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TABLE\'\'    , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TABLE\'\'    , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\n                         (\'\'TRIGGER\'\'  , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TRIGGER\'\'  , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TRIGGER\'\'  , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\n                         (\'\'TRIGGER\'\'  , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_objects\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.threads\n                     SET INSTRUMENTED = \'\'YES\'\'\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: threads\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Resets the Performance Schema setup to the default settings.\n             Parameters\n             in_verbose (BOOLEAN):\n               Whether to print each setup stage (including the SQL) whilst running.\n             Example\n             mysql> CALL sys.ps_setup_reset_to_default(true)\\G\n             *************************** 1. row ***************************\n             status: Resetting: setup_actors\n             DELETE\n             FROM performance_schema.setup_actors\n              WHERE NOT (HOST = \'%\' AND USER = \'%\' AND ROLE = \'%\')\n             1 row in set (0.00 sec)\n             *************************** 1. row ***************************\n             status: Resetting: setup_actors\n             INSERT IGNORE INTO performance_schema.setup_actors\n             VALUES (\'%\', \'%\', \'%\')\n             1 row in set (0.00 sec)\n             ...\n             mysql> CALL sys.ps_setup_reset_to_default(false)\\G\n             Query OK, 0 rows affected (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SET @query = \'DELETE\\n                    FROM performance_schema.setup_actors\\n                   WHERE NOT (HOST = \'\'%\'\' AND USER = \'\'%\'\' AND ROLE = \'\'%\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_actors\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'INSERT IGNORE INTO performance_schema.setup_actors\\n                  VALUES (\'\'%\'\', \'\'%\'\', \'\'%\'\', \'\'YES\'\', \'\'YES\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_actors\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.setup_instruments\\n                     SET ENABLED = sys.ps_is_instrument_default_enabled(NAME),\\n                         TIMED   = sys.ps_is_instrument_default_timed(NAME)\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_instruments\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.setup_consumers\\n                     SET ENABLED = IF(NAME IN (\'\'events_statements_current\'\', \'\'events_transactions_current\'\', \'\'global_instrumentation\'\', \'\'thread_instrumentation\'\', \'\'statements_digest\'\'), \'\'YES\'\', \'\'NO\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_consumers\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'DELETE\\n                    FROM performance_schema.setup_objects\\n                   WHERE NOT (OBJECT_TYPE IN (\'\'EVENT\'\', \'\'FUNCTION\'\', \'\'PROCEDURE\'\', \'\'TABLE\'\', \'\'TRIGGER\'\') AND OBJECT_NAME = \'\'%\'\'\\n                     AND (OBJECT_SCHEMA = \'\'mysql\'\'              AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\\n                      OR (OBJECT_SCHEMA = \'\'performance_schema\'\' AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\\n                      OR (OBJECT_SCHEMA = \'\'information_schema\'\' AND ENABLED = \'\'NO\'\'  AND TIMED = \'\'NO\'\' )\\n                      OR (OBJECT_SCHEMA = \'\'%\'\'                  AND ENABLED = \'\'YES\'\' AND TIMED = \'\'YES\'\'))\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_objects\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'INSERT IGNORE INTO performance_schema.setup_objects\\n                  VALUES (\'\'EVENT\'\'    , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'EVENT\'\'    , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'EVENT\'\'    , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'EVENT\'\'    , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\\n                         (\'\'FUNCTION\'\' , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'FUNCTION\'\' , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'FUNCTION\'\' , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'FUNCTION\'\' , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\\n                         (\'\'PROCEDURE\'\', \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'PROCEDURE\'\', \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'PROCEDURE\'\', \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'PROCEDURE\'\', \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\\n                         (\'\'TABLE\'\'    , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TABLE\'\'    , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TABLE\'\'    , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TABLE\'\'    , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\'),\\n                         (\'\'TRIGGER\'\'  , \'\'mysql\'\'             , \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TRIGGER\'\'  , \'\'performance_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TRIGGER\'\'  , \'\'information_schema\'\', \'\'%\'\', \'\'NO\'\' , \'\'NO\'\' ),\\n                         (\'\'TRIGGER\'\'  , \'\'%\'\'                 , \'\'%\'\', \'\'YES\'\', \'\'YES\'\')\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: setup_objects\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\n    SET @query = \'UPDATE performance_schema.threads\\n                     SET INSTRUMENTED = \'\'YES\'\'\';\n    IF (in_verbose) THEN\n        SELECT CONCAT(\'Resetting: threads\\n\', REPLACE(@query, \'  \', \'\')) AS status;\n    END IF;\n    PREPARE reset_stmt FROM @query;\n    EXECUTE reset_stmt;\n    DEALLOCATE PREPARE reset_stmt;\nEND','NONE'),
('sys','ps_setup_show_disabled_instruments','PROCEDURE','ps_setup_show_disabled_instruments','SQL','READS_SQL_DATA','YES','INVOKER','','','BEGIN\n    SELECT name AS disabled_instruments, timed\n      FROM performance_schema.setup_instruments\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_instruments;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently disabled instruments.\n             Parameters\n             None\n             Example\n             mysql> CALL sys.ps_setup_show_disabled_instruments();\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT name AS disabled_instruments, timed\n      FROM performance_schema.setup_instruments\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_instruments;\nEND','NONE'),
('sys','format_time','FUNCTION','format_time','SQL','NO_SQL','YES','INVOKER','picoseconds TEXT\n    ','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n  IF picoseconds IS NULL THEN RETURN NULL;\n  ELSEIF picoseconds >= 604800000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 604800000000000000, 2), \' w\');\n  ELSEIF picoseconds >= 86400000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 86400000000000000, 2), \' d\');\n  ELSEIF picoseconds >= 3600000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 3600000000000000, 2), \' h\');\n  ELSEIF picoseconds >= 60000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 60000000000000, 2), \' m\');\n  ELSEIF picoseconds >= 1000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000000, 2), \' s\');\n  ELSEIF picoseconds >= 1000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000, 2), \' ms\');\n  ELSEIF picoseconds >= 1000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000, 2), \' us\');\n  ELSEIF picoseconds >= 1000 THEN RETURN CONCAT(ROUND(picoseconds / 1000, 2), \' ns\');\n  ELSE RETURN CONCAT(picoseconds, \' ps\');\n  END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a raw picoseconds value, and converts it to a human readable form.\n             Picoseconds are the precision that all latency values are printed in\n             within Performance Schema, however are not user friendly when wanting\n             to scan output from the command line.\n             Parameters\n             picoseconds (TEXT):\n               The raw picoseconds value to convert.\n             Returns\n             TEXT\n             Example\n             mysql> select format_time(342342342342345);\n             +------------------------------+\n             | format_time(342342342342345) |\n             +------------------------------+\n             | 00:05:42                     |\n             +------------------------------+\n             1 row in set (0.00 sec)\n             mysql> select format_time(342342342);\n             +------------------------+\n             | format_time(342342342) |\n             +------------------------+\n             | 342.34 us              |\n             +------------------------+\n             1 row in set (0.00 sec)\n             mysql> select format_time(34234);\n              +--------------------+\n             | format_time(34234) |\n             +--------------------+\n             | 34.23 ns           |\n             +--------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n  IF picoseconds IS NULL THEN RETURN NULL;\n  ELSEIF picoseconds >= 604800000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 604800000000000000, 2), \' w\');\n  ELSEIF picoseconds >= 86400000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 86400000000000000, 2), \' d\');\n  ELSEIF picoseconds >= 3600000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 3600000000000000, 2), \' h\');\n  ELSEIF picoseconds >= 60000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 60000000000000, 2), \' m\');\n  ELSEIF picoseconds >= 1000000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000000, 2), \' s\');\n  ELSEIF picoseconds >= 1000000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000000, 2), \' ms\');\n  ELSEIF picoseconds >= 1000000 THEN RETURN CONCAT(ROUND(picoseconds / 1000000, 2), \' us\');\n  ELSEIF picoseconds >= 1000 THEN RETURN CONCAT(ROUND(picoseconds / 1000, 2), \' ns\');\n  ELSE RETURN CONCAT(picoseconds, \' ps\');\n  END IF;\nEND','NONE'),
('sys','list_drop','FUNCTION','list_drop','SQL','CONTAINS_SQL','YES','INVOKER','in_list TEXT,\n        in_drop_value TEXT\n    ','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    IF (in_drop_value IS NULL) THEN\n        SIGNAL SQLSTATE \'02200\'\n           SET MESSAGE_TEXT = \'Function sys.list_drop: in_drop_value input variable should not be NULL\',\n               MYSQL_ERRNO = 1138;\n    END IF;\n    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN\n        RETURN in_list;\n    END IF;\n    RETURN (SELECT TRIM(BOTH \',\' FROM REPLACE(REPLACE(CONCAT(\',\', in_list), CONCAT(\',\', in_drop_value), \'\'), CONCAT(\', \', in_drop_value), \'\')));\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes a list, and a value to attempt to remove from the list, and returns the resulting list.\n             Useful for altering certain session variables, like sql_mode or optimizer_switch for instance.\n             Parameters\n             in_list (TEXT):\n               The comma separated list to drop a value from\n             in_drop_value (TEXT):\n               The value to drop from the input list\n             Returns\n             TEXT\n             Example\n             mysql> select @@sql_mode;\n             +-----------------------------------------------------------------------------------------------+\n             | @@sql_mode                                                                                    |\n             +-----------------------------------------------------------------------------------------------+\n             | ANSI_QUOTES,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n             +-----------------------------------------------------------------------------------------------+\n             1 row in set (0.00 sec)\n             mysql> set sql_mode = sys.list_drop(@@sql_mode, \'ONLY_FULL_GROUP_BY\');\n             Query OK, 0 rows affected (0.03 sec)\n             mysql> select @@sql_mode;\n             +----------------------------------------------------------------------------+\n             | @@sql_mode                                                                 |\n             +----------------------------------------------------------------------------+\n             | ANSI_QUOTES,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n             +----------------------------------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    IF (in_drop_value IS NULL) THEN\n        SIGNAL SQLSTATE \'02200\'\n           SET MESSAGE_TEXT = \'Function sys.list_drop: in_drop_value input variable should not be NULL\',\n               MYSQL_ERRNO = 1138;\n    END IF;\n    IF (in_list IS NULL OR LENGTH(in_list) = 0) THEN\n        RETURN in_list;\n    END IF;\n    RETURN (SELECT TRIM(BOTH \',\' FROM REPLACE(REPLACE(CONCAT(\',\', in_list), CONCAT(\',\', in_drop_value), \'\'), CONCAT(\', \', in_drop_value), \'\')));\nEND','NONE'),
('sys','ps_setup_show_enabled_instruments','PROCEDURE','ps_setup_show_enabled_instruments','SQL','READS_SQL_DATA','YES','INVOKER','','','BEGIN\n    SELECT name AS enabled_instruments, timed\n      FROM performance_schema.setup_instruments\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_instruments;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently enabled instruments.\n             Parameters\n             None\n             Example\n             mysql> CALL sys.ps_setup_show_enabled_instruments();\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT name AS enabled_instruments, timed\n      FROM performance_schema.setup_instruments\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_instruments;\nEND','NONE'),
('sys','statement_performance_analyzer','PROCEDURE','statement_performance_analyzer','SQL','CONTAINS_SQL','NO','INVOKER','\n        IN in_action ENUM(\'snapshot\', \'overall\', \'delta\', \'create_table\', \'create_tmp\', \'save\', \'cleanup\'),\n        IN in_table VARCHAR(129),\n        IN in_views SET (\'with_runtimes_in_95th_percentile\', \'analysis\', \'with_errors_or_warnings\', \'with_full_table_scans\', \'with_sorting\', \'with_temp_tables\', \'custom\')\n    ','','BEGIN\n    DECLARE v_table_exists, v_tmp_digests_table_exists, v_custom_view_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\') DEFAULT \'\';\n    DECLARE v_this_thread_enabled ENUM(\'YES\', \'NO\');\n    DECLARE v_force_new_snapshot BOOLEAN DEFAULT FALSE;\n    DECLARE v_digests_table VARCHAR(133);\n    DECLARE v_quoted_table, v_quoted_custom_view VARCHAR(133) DEFAULT \'\';\n    DECLARE v_table_db, v_table_name, v_custom_db, v_custom_name VARCHAR(64);\n    DECLARE v_digest_table_template, v_checksum_ref, v_checksum_table text;\n    DECLARE v_sql longtext;\n    DECLARE v_error_msg VARCHAR(128);\n    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    END IF;\n    SET @log_bin := @@sql_log_bin;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = 0;\n    END IF;\n    IF (@sys.statement_performance_analyzer.limit IS NULL) THEN\n        SET @sys.statement_performance_analyzer.limit = sys.sys_get_config(\'statement_performance_analyzer.limit\', \'100\');\n    END IF;\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug                                = sys.sys_get_config(\'debug\'                               , \'OFF\');\n    END IF;\n    IF (in_table = \'NOW()\') THEN\n        SET v_force_new_snapshot = TRUE,\n            in_table             = NULL;\n    ELSEIF (in_table IS NOT NULL) THEN\n        IF (NOT INSTR(in_table, \'.\')) THEN\n            SET v_table_db   = DATABASE(),\n                v_table_name = in_table;\n        ELSE\n            SET v_table_db   = SUBSTRING_INDEX(in_table, \'.\', 1);\n            SET v_table_name = SUBSTRING(in_table, CHAR_LENGTH(v_table_db)+2);\n        END IF;\n        SET v_quoted_table = CONCAT(\'`\', v_table_db, \'`.`\', v_table_name, \'`\');\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'in_table is: db = \'\'\', v_table_db, \'\'\', table = \'\'\', v_table_name, \'\'\'\') AS \'Debug\';\n        END IF;\n        IF (v_table_db = DATABASE() AND (v_table_name = \'tmp_digests\' OR v_table_name = \'tmp_digests_delta\')) THEN\n            SET v_error_msg = CONCAT(\'Invalid value for in_table: \', v_quoted_table, \' is reserved table name.\');\n            SIGNAL SQLSTATE \'45000\'\n               SET MESSAGE_TEXT = v_error_msg;\n        END IF;\n        CALL sys.table_exists(v_table_db, v_table_name, v_table_exists);\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'v_table_exists = \', v_table_exists) AS \'Debug\';\n        END IF;\n        IF (v_table_exists = \'BASE TABLE\') THEN\n            SET v_checksum_ref = (\n                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum\n                   FROM information_schema.COLUMNS\n                  WHERE TABLE_SCHEMA = \'performance_schema\' AND TABLE_NAME = \'events_statements_summary_by_digest\'\n                ),\n                v_checksum_table = (\n                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum\n                   FROM information_schema.COLUMNS\n                  WHERE TABLE_SCHEMA = v_table_db AND TABLE_NAME = v_table_name\n                );\n            IF (v_checksum_ref <> v_checksum_table) THEN\n                SET v_error_msg = CONCAT(\'The table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 93, CONCAT(\'...\', SUBSTRING(v_quoted_table, -90)), v_quoted_table),\n                                         \' has the wrong definition.\');\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        END IF;\n    END IF;\n    IF (in_views IS NULL OR in_views = \'\') THEN\n        SET in_views = \'with_runtimes_in_95th_percentile,analysis,with_errors_or_warnings,with_full_table_scans,with_sorting,with_temp_tables\';\n    END IF;\n    CALL sys.table_exists(DATABASE(), \'tmp_digests\', v_tmp_digests_table_exists);\n    IF (@sys.debug = \'ON\') THEN\n        SELECT CONCAT(\'v_tmp_digests_table_exists = \', v_tmp_digests_table_exists) AS \'Debug\';\n    END IF;\n    CASE\n        WHEN in_action IN (\'snapshot\', \'overall\') THEN\n            IF (in_table IS NOT NULL) THEN\n                IF (NOT v_table_exists IN (\'TEMPORARY\', \'BASE TABLE\')) THEN\n                    SET v_error_msg = CONCAT(\'The \', in_action, \' action requires in_table to be NULL, NOW() or specify an existing table.\',\n                                             \' The table \',\n                                             IF(CHAR_LENGTH(v_quoted_table) > 16, CONCAT(\'...\', SUBSTRING(v_quoted_table, -13)), v_quoted_table),\n                                             \' does not exist.\');\n                    SIGNAL SQLSTATE \'45000\'\n                       SET MESSAGE_TEXT = v_error_msg;\n                END IF;\n            END IF;\n        WHEN in_action IN (\'delta\', \'save\') THEN\n            IF (v_table_exists NOT IN (\'TEMPORARY\', \'BASE TABLE\')) THEN\n                SET v_error_msg = CONCAT(\'The \', in_action, \' action requires in_table to be an existing table.\',\n                                         IF(in_table IS NOT NULL, CONCAT(\' The table \',\n                                             IF(CHAR_LENGTH(v_quoted_table) > 39, CONCAT(\'...\', SUBSTRING(v_quoted_table, -36)), v_quoted_table),\n                                             \' does not exist.\'), \'\'));\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n            IF (in_action = \'delta\' AND v_tmp_digests_table_exists <> \'TEMPORARY\') THEN\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = \'An existing snapshot generated with the statement_performance_analyzer() must exist.\';\n            END IF;\n        WHEN in_action = \'create_tmp\' THEN\n            IF (v_table_exists = \'TEMPORARY\') THEN\n                SET v_error_msg = CONCAT(\'Cannot create the table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 72, CONCAT(\'...\', SUBSTRING(v_quoted_table, -69)), v_quoted_table),\n                                         \' as it already exists.\');\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        WHEN in_action = \'create_table\' THEN\n            IF (v_table_exists <> \'\') THEN\n                SET v_error_msg = CONCAT(\'Cannot create the table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 52, CONCAT(\'...\', SUBSTRING(v_quoted_table, -49)), v_quoted_table),\n                                         \' as it already exists\',\n                                         IF(v_table_exists = \'TEMPORARY\', \' as a temporary table.\', \'.\'));\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        WHEN in_action = \'cleanup\' THEN\n            DO (SELECT 1);\n        ELSE\n            SIGNAL SQLSTATE \'45000\'\n               SET MESSAGE_TEXT = \'Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot\';\n    END CASE;\n    SET v_digest_table_template = \'CREATE %{TEMPORARY}TABLE %{TABLE_NAME} (\n  `SCHEMA_NAME` varchar(64) DEFAULT NULL,\n  `DIGEST` varchar(32) DEFAULT NULL,\n  `DIGEST_TEXT` longtext,\n  `COUNT_STAR` bigint(20) unsigned NOT NULL,\n  `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,\n  `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,\n  `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,\n  `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,\n  `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,\n  `SUM_ERRORS` bigint(20) unsigned NOT NULL,\n  `SUM_WARNINGS` bigint(20) unsigned NOT NULL,\n  `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,\n  `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,\n  `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,\n  `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,\n  `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,\n  `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,\n  `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,\n  `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,\n  `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,\n  `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,\n  `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,\n  `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,\n  `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,\n  `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,\n  `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,\n  `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,\n  `FIRST_SEEN` timestamp NULL DEFAULT NULL,\n  `LAST_SEEN` timestamp NULL DEFAULT NULL,\n  INDEX (SCHEMA_NAME, DIGEST)\n) DEFAULT CHARSET=utf8\';\n    IF (v_force_new_snapshot\n           OR in_action = \'snapshot\'\n           OR (in_action = \'overall\' AND in_table IS NULL)\n           OR (in_action = \'save\' AND v_tmp_digests_table_exists <> \'TEMPORARY\')\n       ) THEN\n        IF (v_tmp_digests_table_exists = \'TEMPORARY\') THEN\n            IF (@sys.debug = \'ON\') THEN\n                SELECT \'DROP TEMPORARY TABLE IF EXISTS tmp_digests\' AS \'Debug\';\n            END IF;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digests;\n        END IF;\n        CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'TEMPORARY \'), \'%{TABLE_NAME}\', \'tmp_digests\'));\n        SET v_sql = CONCAT(\'INSERT INTO tmp_digests SELECT * FROM \',\n                           IF(in_table IS NULL OR in_action = \'save\', \'performance_schema.events_statements_summary_by_digest\', v_quoted_table));\n        CALL sys.execute_prepared_stmt(v_sql);\n    END IF;\n    IF (in_action IN (\'create_table\', \'create_tmp\')) THEN\n        IF (in_action = \'create_table\') THEN\n            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'\'), \'%{TABLE_NAME}\', v_quoted_table));\n        ELSE\n            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'TEMPORARY \'), \'%{TABLE_NAME}\', v_quoted_table));\n        END IF;\n    ELSEIF (in_action = \'save\') THEN\n        CALL sys.execute_prepared_stmt(CONCAT(\'DELETE FROM \', v_quoted_table));\n        CALL sys.execute_prepared_stmt(CONCAT(\'INSERT INTO \', v_quoted_table, \' SELECT * FROM tmp_digests\'));\n    ELSEIF (in_action = \'cleanup\') THEN\n        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests;\n        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests_delta;\n    ELSEIF (in_action IN (\'overall\', \'delta\')) THEN\n        IF (in_action = \'overall\') THEN\n            IF (in_table IS NULL) THEN\n                SET v_digests_table = \'tmp_digests\';\n            ELSE\n                SET v_digests_table = v_quoted_table;\n            END IF;\n        ELSE\n            SET v_digests_table = \'tmp_digests_delta\';\n            DROP TEMPORARY TABLE IF EXISTS tmp_digests_delta;\n            CREATE TEMPORARY TABLE tmp_digests_delta LIKE tmp_digests;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digests_delta\nSELECT `d_end`.`SCHEMA_NAME`,\n       `d_end`.`DIGEST`,\n       `d_end`.`DIGEST_TEXT`,\n       `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) AS \'\'COUNT_STAR\'\',\n       `d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0) AS \'\'SUM_TIMER_WAIT\'\',\n       `d_end`.`MIN_TIMER_WAIT` AS \'\'MIN_TIMER_WAIT\'\',\n       IFNULL((`d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0))/NULLIF(`d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0), 0), 0) AS \'\'AVG_TIMER_WAIT\'\',\n       `d_end`.`MAX_TIMER_WAIT` AS \'\'MAX_TIMER_WAIT\'\',\n       `d_end`.`SUM_LOCK_TIME`-IFNULL(`d_start`.`SUM_LOCK_TIME`, 0) AS \'\'SUM_LOCK_TIME\'\',\n       `d_end`.`SUM_ERRORS`-IFNULL(`d_start`.`SUM_ERRORS`, 0) AS \'\'SUM_ERRORS\'\',\n       `d_end`.`SUM_WARNINGS`-IFNULL(`d_start`.`SUM_WARNINGS`, 0) AS \'\'SUM_WARNINGS\'\',\n       `d_end`.`SUM_ROWS_AFFECTED`-IFNULL(`d_start`.`SUM_ROWS_AFFECTED`, 0) AS \'\'SUM_ROWS_AFFECTED\'\',\n       `d_end`.`SUM_ROWS_SENT`-IFNULL(`d_start`.`SUM_ROWS_SENT`, 0) AS \'\'SUM_ROWS_SENT\'\',\n       `d_end`.`SUM_ROWS_EXAMINED`-IFNULL(`d_start`.`SUM_ROWS_EXAMINED`, 0) AS \'\'SUM_ROWS_EXAMINED\'\',\n       `d_end`.`SUM_CREATED_TMP_DISK_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_DISK_TABLES`, 0) AS \'\'SUM_CREATED_TMP_DISK_TABLES\'\',\n       `d_end`.`SUM_CREATED_TMP_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_TABLES`, 0) AS \'\'SUM_CREATED_TMP_TABLES\'\',\n       `d_end`.`SUM_SELECT_FULL_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_JOIN`, 0) AS \'\'SUM_SELECT_FULL_JOIN\'\',\n       `d_end`.`SUM_SELECT_FULL_RANGE_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_RANGE_JOIN`, 0) AS \'\'SUM_SELECT_FULL_RANGE_JOIN\'\',\n       `d_end`.`SUM_SELECT_RANGE`-IFNULL(`d_start`.`SUM_SELECT_RANGE`, 0) AS \'\'SUM_SELECT_RANGE\'\',\n       `d_end`.`SUM_SELECT_RANGE_CHECK`-IFNULL(`d_start`.`SUM_SELECT_RANGE_CHECK`, 0) AS \'\'SUM_SELECT_RANGE_CHECK\'\',\n       `d_end`.`SUM_SELECT_SCAN`-IFNULL(`d_start`.`SUM_SELECT_SCAN`, 0) AS \'\'SUM_SELECT_SCAN\'\',\n       `d_end`.`SUM_SORT_MERGE_PASSES`-IFNULL(`d_start`.`SUM_SORT_MERGE_PASSES`, 0) AS \'\'SUM_SORT_MERGE_PASSES\'\',\n       `d_end`.`SUM_SORT_RANGE`-IFNULL(`d_start`.`SUM_SORT_RANGE`, 0) AS \'\'SUM_SORT_RANGE\'\',\n       `d_end`.`SUM_SORT_ROWS`-IFNULL(`d_start`.`SUM_SORT_ROWS`, 0) AS \'\'SUM_SORT_ROWS\'\',\n       `d_end`.`SUM_SORT_SCAN`-IFNULL(`d_start`.`SUM_SORT_SCAN`, 0) AS \'\'SUM_SORT_SCAN\'\',\n       `d_end`.`SUM_NO_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_INDEX_USED`, 0) AS \'\'SUM_NO_INDEX_USED\'\',\n       `d_end`.`SUM_NO_GOOD_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_GOOD_INDEX_USED`, 0) AS \'\'SUM_NO_GOOD_INDEX_USED\'\',\n       `d_end`.`FIRST_SEEN`,\n       `d_end`.`LAST_SEEN`\n  FROM tmp_digests d_end\n       LEFT OUTER JOIN \', v_quoted_table, \' d_start ON `d_start`.`DIGEST` = `d_end`.`DIGEST`\n                                                    AND (`d_start`.`SCHEMA_NAME` = `d_end`.`SCHEMA_NAME`\n                                                          OR (`d_start`.`SCHEMA_NAME` IS NULL AND `d_end`.`SCHEMA_NAME` IS NULL)\n                                                        )\n WHERE `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) > 0\');\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_runtimes_in_95th_percentile\', in_views)) THEN\n            SELECT \'Queries with Runtime in 95th Percentile\' AS \'Next Output\';\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution1;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution2;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_95th_percentile_by_avg_us;\n            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution1 (\n              cnt bigint unsigned NOT NULL,\n              avg_us decimal(21,0) NOT NULL,\n              PRIMARY KEY (avg_us)\n            ) ENGINE=InnoDB;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digest_avg_latency_distribution1\nSELECT COUNT(*) cnt,\n       ROUND(avg_timer_wait/1000000) AS avg_us\n  FROM \', v_digests_table, \'\n GROUP BY avg_us\');\n            CALL sys.execute_prepared_stmt(v_sql);\n            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution2 LIKE tmp_digest_avg_latency_distribution1;\n            INSERT INTO tmp_digest_avg_latency_distribution2 SELECT * FROM tmp_digest_avg_latency_distribution1;\n            CREATE TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us (\n              avg_us decimal(21,0) NOT NULL,\n              percentile decimal(46,4) NOT NULL,\n              PRIMARY KEY (avg_us)\n            ) ENGINE=InnoDB;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digest_95th_percentile_by_avg_us\nSELECT s2.avg_us avg_us,\n       IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM \', v_digests_table, \'), 0), 0) percentile\n  FROM tmp_digest_avg_latency_distribution1 AS s1\n       JOIN tmp_digest_avg_latency_distribution2 AS s2 ON s1.avg_us <= s2.avg_us\n GROUP BY s2.avg_us\nHAVING percentile > 0.95\n ORDER BY percentile\n LIMIT 1\');\n            CALL sys.execute_prepared_stmt(v_sql);\n            SET v_sql =\n                REPLACE(\n                    REPLACE(\n                        (SELECT VIEW_DEFINITION\n                           FROM information_schema.VIEWS\n                          WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_runtimes_in_95th_percentile\'\n                        ),\n                        \'`performance_schema`.`events_statements_summary_by_digest`\',\n                        v_digests_table\n                    ),\n                    \'sys.x$ps_digest_95th_percentile_by_avg_us\',\n                    \'`sys`.`x$ps_digest_95th_percentile_by_avg_us`\'\n              );\n            CALL sys.execute_prepared_stmt(v_sql);\n            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution1;\n            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution2;\n            DROP TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us;\n        END IF;\n        IF (FIND_IN_SET(\'analysis\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries Ordered by Total Latency\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statement_analysis\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_errors_or_warnings\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Errors\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_errors_or_warnings\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_full_table_scans\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Full Table Scan\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_full_table_scans\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_sorting\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Sorting\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_sorting\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_temp_tables\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Internal Temporary Tables\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_temp_tables\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'custom\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries Using Custom View\') AS \'Next Output\';\n            IF (@sys.statement_performance_analyzer.view IS NULL) THEN\n                SET @sys.statement_performance_analyzer.view = sys.sys_get_config(\'statement_performance_analyzer.view\', NULL);\n            END IF;\n            IF (@sys.statement_performance_analyzer.view IS NULL) THEN\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = \'The @sys.statement_performance_analyzer.view user variable must be set with the view or query to use.\';\n            END IF;\n            IF (NOT INSTR(@sys.statement_performance_analyzer.view, \' \')) THEN\n                IF (NOT INSTR(@sys.statement_performance_analyzer.view, \'.\')) THEN\n                    SET v_custom_db   = DATABASE(),\n                        v_custom_name = @sys.statement_performance_analyzer.view;\n                ELSE\n                    SET v_custom_db   = SUBSTRING_INDEX(@sys.statement_performance_analyzer.view, \'.\', 1);\n                    SET v_custom_name = SUBSTRING(@sys.statement_performance_analyzer.view, CHAR_LENGTH(v_custom_db)+2);\n                END IF;\n                CALL sys.table_exists(v_custom_db, v_custom_name, v_custom_view_exists);\n                IF (v_custom_view_exists <> \'VIEW\') THEN\n                    SIGNAL SQLSTATE \'45000\'\n                       SET MESSAGE_TEXT = \'The @sys.statement_performance_analyzer.view user variable is set but specified neither an existing view nor a query.\';\n                END IF;\n                SET v_sql =\n                    REPLACE(\n                        (SELECT VIEW_DEFINITION\n                           FROM information_schema.VIEWS\n                          WHERE TABLE_SCHEMA = v_custom_db AND TABLE_NAME = v_custom_name\n                        ),\n                        \'`performance_schema`.`events_statements_summary_by_digest`\',\n                        v_digests_table\n                    );\n            ELSE\n                SET v_sql = REPLACE(@sys.statement_performance_analyzer.view, \'`performance_schema`.`events_statements_summary_by_digest`\', v_digests_table);\n            END IF;\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n    END IF;\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = @log_bin;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Create a report of the statements running on the server.\n             The views are calculated based on the overall and/or delta activity.\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Parameters\n             in_action (ENUM(\'snapshot\', \'overall\', \'delta\', \'create_tmp\', \'create_table\', \'save\', \'cleanup\')):\n               The action to take. Supported actions are:\n                 * snapshot      Store a snapshot. The default is to make a snapshot of the current content of\n                                 performance_schema.events_statements_summary_by_digest, but by setting in_table\n                                 this can be overwritten to copy the content of the specified table.\n                                 The snapshot is stored in the sys.tmp_digests temporary table.\n                 * overall       Generate analyzis based on the content specified by in_table. For the overall analyzis,\n                                 in_table can be NOW() to use a fresh snapshot. This will overwrite an existing snapshot.\n                                 Use NULL for in_table to use the existing snapshot. If in_table IS NULL and no snapshot\n                                 exists, a new will be created.\n                                 See also in_views and @sys.statement_performance_analyzer.limit.\n                 * delta         Generate a delta analysis. The delta will be calculated between the reference table in\n                                 in_table and the snapshot. An existing snapshot must exist.\n                                 The action uses the sys.tmp_digests_delta temporary table.\n                                 See also in_views and @sys.statement_performance_analyzer.limit.\n                 * create_table  Create a regular table suitable for storing the snapshot for later use, e.g. for\n                                 calculating deltas.\n                 * create_tmp    Create a temporary table suitable for storing the snapshot for later use, e.g. for\n                                 calculating deltas.\n                 * save          Save the snapshot in the table specified by in_table. The table must exists and have\n                                 the correct structure.\n                                 If no snapshot exists, a new is created.\n                 * cleanup       Remove the temporary tables used for the snapshot and delta.\n             in_table (VARCHAR(129)):\n               The table argument used for some actions. Use the format \'db1.t1\' or \'t1\' without using any backticks (`)\n               for quoting. Periods (.) are not supported in the database and table names.\n               The meaning of the table for each action supporting the argument is:\n                 * snapshot      The snapshot is created based on the specified table. Set to NULL or NOW() to use\n                                 the current content of performance_schema.events_statements_summary_by_digest.\n                 * overall       The table with the content to create the overall analyzis for. The following values\n                                 can be used:\n                                   - A table name - use the content of that table.\n                                   - NOW()        - create a fresh snapshot and overwrite the existing snapshot.\n                                   - NULL         - use the last stored snapshot.\n                 * delta         The table name is mandatory and specified the reference view to compare the currently\n                                 stored snapshot against. If no snapshot exists, a new will be created.\n                 * create_table  The name of the regular table to create.\n                 * create_tmp    The name of the temporary table to create.\n                 * save          The name of the table to save the currently stored snapshot into.\n             in_views (SET (\'with_runtimes_in_95th_percentile\', \'analysis\', \'with_errors_or_warnings\',\n                            \'with_full_table_scans\', \'with_sorting\', \'with_temp_tables\', \'custom\'))\n               Which views to include:\n                 * with_runtimes_in_95th_percentile  Based on the sys.statements_with_runtimes_in_95th_percentile view\n                 * analysis                          Based on the sys.statement_analysis view\n                 * with_errors_or_warnings           Based on the sys.statements_with_errors_or_warnings view\n                 * with_full_table_scans             Based on the sys.statements_with_full_table_scans view\n                 * with_sorting                      Based on the sys.statements_with_sorting view\n                 * with_temp_tables                  Based on the sys.statements_with_temp_tables view\n                 * custom                            Use a custom view. This view must be specified in @sys.statement_performance_analyzer.view to an existing view or a query\n             Default is to include all except \'custom\'.\n             Configuration Options\n             sys.statement_performance_analyzer.limit\n               The maximum number of rows to include for the views that does not have a built-in limit (e.g. the 95th percentile view).\n               If not set the limit is 100.\n             sys.statement_performance_analyzer.view\n               Used together with the \'custom\' view. If the value contains a space, it is considered a query, otherwise it must be\n               an existing view querying the performance_schema.events_statements_summary_by_digest table. There cannot be any limit\n               clause including in the query or view definition if @sys.statement_performance_analyzer.limit > 0.\n               If specifying a view, use the same format as for in_table.\n             sys.debug\n               Whether to provide debugging output.\n               Default is \'OFF\'. Set to \'ON\' to include.\n             Example\n             To create a report with the queries in the 95th percentile since last truncate of performance_schema.events_statements_summary_by_digest\n             and the delta for a 1 minute period:\n                1. Create a temporary table to store the initial snapshot.\n                2. Create the initial snapshot.\n                3. Save the initial snapshot in the temporary table.\n                4. Wait one minute.\n                5. Create a new snapshot.\n                6. Perform analyzis based on the new snapshot.\n                7. Perform analyzis based on the delta between the initial and new snapshots.\n             mysql> CALL sys.statement_performance_analyzer(\'create_tmp\', \'mydb.tmp_digests_ini\', NULL);\n             Query OK, 0 rows affected (0.08 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n             Query OK, 0 rows affected (0.02 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'save\', \'mydb.tmp_digests_ini\', NULL);\n             Query OK, 0 rows affected (0.00 sec)\n             mysql> DO SLEEP(60);\n             Query OK, 0 rows affected (1 min 0.00 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n             Query OK, 0 rows affected (0.02 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile\');\n             +-----------------------------------------+\n             | Next Output                             |\n             +-----------------------------------------+\n             | Queries with Runtime in 95th Percentile |\n             +-----------------------------------------+\n             1 row in set (0.05 sec)\n             ...\n             mysql> CALL sys.statement_performance_analyzer(\'delta\', \'mydb.tmp_digests_ini\', \'with_runtimes_in_95th_percentile\');\n             +-----------------------------------------+\n             | Next Output                             |\n             +-----------------------------------------+\n             | Queries with Runtime in 95th Percentile |\n             +-----------------------------------------+\n             1 row in set (0.03 sec)\n             ...\n             To create an overall report of the 95th percentile queries and the top 10 queries with full table scans:\n             mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL);\n             Query OK, 0 rows affected (0.01 sec)\n             mysql> SET @sys.statement_performance_analyzer.limit = 10;\n             Query OK, 0 rows affected (0.00 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile,with_full_table_scans\');\n             +-----------------------------------------+\n             | Next Output                             |\n             +-----------------------------------------+\n             | Queries with Runtime in 95th Percentile |\n             +-----------------------------------------+\n             1 row in set (0.01 sec)\n             ...\n             +-------------------------------------+\n             | Next Output                         |\n             +-------------------------------------+\n             | Top 10 Queries with Full Table Scan |\n             +-------------------------------------+\n             1 row in set (0.09 sec)\n             ...\n             Use a custom view showing the top 10 query sorted by total execution time refreshing the view every minute using\n             the watch command in Linux.\n             mysql> CREATE OR REPLACE VIEW mydb.my_statements AS\n                 -> SELECT sys.format_statement(DIGEST_TEXT) AS query,\n                 ->        SCHEMA_NAME AS db,\n                 ->        COUNT_STAR AS exec_count,\n                 ->        sys.format_time(SUM_TIMER_WAIT) AS total_latency,\n                 ->        sys.format_time(AVG_TIMER_WAIT) AS avg_latency,\n                 ->        ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,\n                 ->        ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg,\n                 ->        ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0)) AS rows_affected_avg,\n                 ->        DIGEST AS digest\n                 ->   FROM performance_schema.events_statements_summary_by_digest\n                 -> ORDER BY SUM_TIMER_WAIT DESC;\n             Query OK, 0 rows affected (0.01 sec)\n             mysql> CALL sys.statement_performance_analyzer(\'create_table\', \'mydb.digests_prev\', NULL);\n             Query OK, 0 rows affected (0.10 sec)\n             shell$ watch -n 60 \"mysql sys --table -e \"\n             > SET @sys.statement_performance_analyzer.view = \'mydb.my_statements\';\n             > SET @sys.statement_performance_analyzer.limit = 10;\n             > CALL statement_performance_analyzer(\'snapshot\', NULL, NULL);\n             > CALL statement_performance_analyzer(\'delta\', \'mydb.digests_prev\', \'custom\');\n             > CALL statement_performance_analyzer(\'save\', \'mydb.digests_prev\', NULL);\n             > \"\"\n             Every 60.0s: mysql sys --table -e \"                                                                                                   ...  Mon Dec 22 10:58:51 2014\n             +----------------------------------+\n             | Next Output                      |\n             +----------------------------------+\n             | Top 10 Queries Using Custom View |\n             +----------------------------------+\n             +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+\n             | query             | db    | exec_count | total_latency | avg_latency | rows_sent_avg | rows_examined_avg | rows_affected_avg | digest                           |\n             +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+\n             ...\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_table_exists, v_tmp_digests_table_exists, v_custom_view_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\') DEFAULT \'\';\n    DECLARE v_this_thread_enabled ENUM(\'YES\', \'NO\');\n    DECLARE v_force_new_snapshot BOOLEAN DEFAULT FALSE;\n    DECLARE v_digests_table VARCHAR(133);\n    DECLARE v_quoted_table, v_quoted_custom_view VARCHAR(133) DEFAULT \'\';\n    DECLARE v_table_db, v_table_name, v_custom_db, v_custom_name VARCHAR(64);\n    DECLARE v_digest_table_template, v_checksum_ref, v_checksum_table text;\n    DECLARE v_sql longtext;\n    DECLARE v_error_msg VARCHAR(128);\n    SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID();\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n    END IF;\n    SET @log_bin := @@sql_log_bin;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = 0;\n    END IF;\n    IF (@sys.statement_performance_analyzer.limit IS NULL) THEN\n        SET @sys.statement_performance_analyzer.limit = sys.sys_get_config(\'statement_performance_analyzer.limit\', \'100\');\n    END IF;\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug                                = sys.sys_get_config(\'debug\'                               , \'OFF\');\n    END IF;\n    IF (in_table = \'NOW()\') THEN\n        SET v_force_new_snapshot = TRUE,\n            in_table             = NULL;\n    ELSEIF (in_table IS NOT NULL) THEN\n        IF (NOT INSTR(in_table, \'.\')) THEN\n            SET v_table_db   = DATABASE(),\n                v_table_name = in_table;\n        ELSE\n            SET v_table_db   = SUBSTRING_INDEX(in_table, \'.\', 1);\n            SET v_table_name = SUBSTRING(in_table, CHAR_LENGTH(v_table_db)+2);\n        END IF;\n        SET v_quoted_table = CONCAT(\'`\', v_table_db, \'`.`\', v_table_name, \'`\');\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'in_table is: db = \'\'\', v_table_db, \'\'\', table = \'\'\', v_table_name, \'\'\'\') AS \'Debug\';\n        END IF;\n        IF (v_table_db = DATABASE() AND (v_table_name = \'tmp_digests\' OR v_table_name = \'tmp_digests_delta\')) THEN\n            SET v_error_msg = CONCAT(\'Invalid value for in_table: \', v_quoted_table, \' is reserved table name.\');\n            SIGNAL SQLSTATE \'45000\'\n               SET MESSAGE_TEXT = v_error_msg;\n        END IF;\n        CALL sys.table_exists(v_table_db, v_table_name, v_table_exists);\n        IF (@sys.debug = \'ON\') THEN\n            SELECT CONCAT(\'v_table_exists = \', v_table_exists) AS \'Debug\';\n        END IF;\n        IF (v_table_exists = \'BASE TABLE\') THEN\n            SET v_checksum_ref = (\n                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum\n                   FROM information_schema.COLUMNS\n                  WHERE TABLE_SCHEMA = \'performance_schema\' AND TABLE_NAME = \'events_statements_summary_by_digest\'\n                ),\n                v_checksum_table = (\n                 SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum\n                   FROM information_schema.COLUMNS\n                  WHERE TABLE_SCHEMA = v_table_db AND TABLE_NAME = v_table_name\n                );\n            IF (v_checksum_ref <> v_checksum_table) THEN\n                SET v_error_msg = CONCAT(\'The table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 93, CONCAT(\'...\', SUBSTRING(v_quoted_table, -90)), v_quoted_table),\n                                         \' has the wrong definition.\');\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        END IF;\n    END IF;\n    IF (in_views IS NULL OR in_views = \'\') THEN\n        SET in_views = \'with_runtimes_in_95th_percentile,analysis,with_errors_or_warnings,with_full_table_scans,with_sorting,with_temp_tables\';\n    END IF;\n    CALL sys.table_exists(DATABASE(), \'tmp_digests\', v_tmp_digests_table_exists);\n    IF (@sys.debug = \'ON\') THEN\n        SELECT CONCAT(\'v_tmp_digests_table_exists = \', v_tmp_digests_table_exists) AS \'Debug\';\n    END IF;\n    CASE\n        WHEN in_action IN (\'snapshot\', \'overall\') THEN\n            IF (in_table IS NOT NULL) THEN\n                IF (NOT v_table_exists IN (\'TEMPORARY\', \'BASE TABLE\')) THEN\n                    SET v_error_msg = CONCAT(\'The \', in_action, \' action requires in_table to be NULL, NOW() or specify an existing table.\',\n                                             \' The table \',\n                                             IF(CHAR_LENGTH(v_quoted_table) > 16, CONCAT(\'...\', SUBSTRING(v_quoted_table, -13)), v_quoted_table),\n                                             \' does not exist.\');\n                    SIGNAL SQLSTATE \'45000\'\n                       SET MESSAGE_TEXT = v_error_msg;\n                END IF;\n            END IF;\n        WHEN in_action IN (\'delta\', \'save\') THEN\n            IF (v_table_exists NOT IN (\'TEMPORARY\', \'BASE TABLE\')) THEN\n                SET v_error_msg = CONCAT(\'The \', in_action, \' action requires in_table to be an existing table.\',\n                                         IF(in_table IS NOT NULL, CONCAT(\' The table \',\n                                             IF(CHAR_LENGTH(v_quoted_table) > 39, CONCAT(\'...\', SUBSTRING(v_quoted_table, -36)), v_quoted_table),\n                                             \' does not exist.\'), \'\'));\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n            IF (in_action = \'delta\' AND v_tmp_digests_table_exists <> \'TEMPORARY\') THEN\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = \'An existing snapshot generated with the statement_performance_analyzer() must exist.\';\n            END IF;\n        WHEN in_action = \'create_tmp\' THEN\n            IF (v_table_exists = \'TEMPORARY\') THEN\n                SET v_error_msg = CONCAT(\'Cannot create the table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 72, CONCAT(\'...\', SUBSTRING(v_quoted_table, -69)), v_quoted_table),\n                                         \' as it already exists.\');\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        WHEN in_action = \'create_table\' THEN\n            IF (v_table_exists <> \'\') THEN\n                SET v_error_msg = CONCAT(\'Cannot create the table \',\n                                         IF(CHAR_LENGTH(v_quoted_table) > 52, CONCAT(\'...\', SUBSTRING(v_quoted_table, -49)), v_quoted_table),\n                                         \' as it already exists\',\n                                         IF(v_table_exists = \'TEMPORARY\', \' as a temporary table.\', \'.\'));\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = v_error_msg;\n            END IF;\n        WHEN in_action = \'cleanup\' THEN\n            DO (SELECT 1);\n        ELSE\n            SIGNAL SQLSTATE \'45000\'\n               SET MESSAGE_TEXT = \'Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot\';\n    END CASE;\n    SET v_digest_table_template = \'CREATE %{TEMPORARY}TABLE %{TABLE_NAME} (\\n  `SCHEMA_NAME` varchar(64) DEFAULT NULL,\\n  `DIGEST` varchar(32) DEFAULT NULL,\\n  `DIGEST_TEXT` longtext,\\n  `COUNT_STAR` bigint(20) unsigned NOT NULL,\\n  `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,\\n  `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,\\n  `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,\\n  `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,\\n  `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL,\\n  `SUM_ERRORS` bigint(20) unsigned NOT NULL,\\n  `SUM_WARNINGS` bigint(20) unsigned NOT NULL,\\n  `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL,\\n  `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL,\\n  `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL,\\n  `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL,\\n  `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL,\\n  `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL,\\n  `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL,\\n  `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL,\\n  `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL,\\n  `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL,\\n  `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL,\\n  `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL,\\n  `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL,\\n  `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL,\\n  `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL,\\n  `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL,\\n  `FIRST_SEEN` timestamp NULL DEFAULT NULL,\\n  `LAST_SEEN` timestamp NULL DEFAULT NULL,\\n  INDEX (SCHEMA_NAME, DIGEST)\\n) DEFAULT CHARSET=utf8\';\n    IF (v_force_new_snapshot\n           OR in_action = \'snapshot\'\n           OR (in_action = \'overall\' AND in_table IS NULL)\n           OR (in_action = \'save\' AND v_tmp_digests_table_exists <> \'TEMPORARY\')\n       ) THEN\n        IF (v_tmp_digests_table_exists = \'TEMPORARY\') THEN\n            IF (@sys.debug = \'ON\') THEN\n                SELECT \'DROP TEMPORARY TABLE IF EXISTS tmp_digests\' AS \'Debug\';\n            END IF;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digests;\n        END IF;\n        CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'TEMPORARY \'), \'%{TABLE_NAME}\', \'tmp_digests\'));\n        SET v_sql = CONCAT(\'INSERT INTO tmp_digests SELECT * FROM \',\n                           IF(in_table IS NULL OR in_action = \'save\', \'performance_schema.events_statements_summary_by_digest\', v_quoted_table));\n        CALL sys.execute_prepared_stmt(v_sql);\n    END IF;\n    IF (in_action IN (\'create_table\', \'create_tmp\')) THEN\n        IF (in_action = \'create_table\') THEN\n            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'\'), \'%{TABLE_NAME}\', v_quoted_table));\n        ELSE\n            CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, \'%{TEMPORARY}\', \'TEMPORARY \'), \'%{TABLE_NAME}\', v_quoted_table));\n        END IF;\n    ELSEIF (in_action = \'save\') THEN\n        CALL sys.execute_prepared_stmt(CONCAT(\'DELETE FROM \', v_quoted_table));\n        CALL sys.execute_prepared_stmt(CONCAT(\'INSERT INTO \', v_quoted_table, \' SELECT * FROM tmp_digests\'));\n    ELSEIF (in_action = \'cleanup\') THEN\n        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests;\n        DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests_delta;\n    ELSEIF (in_action IN (\'overall\', \'delta\')) THEN\n        IF (in_action = \'overall\') THEN\n            IF (in_table IS NULL) THEN\n                SET v_digests_table = \'tmp_digests\';\n            ELSE\n                SET v_digests_table = v_quoted_table;\n            END IF;\n        ELSE\n            SET v_digests_table = \'tmp_digests_delta\';\n            DROP TEMPORARY TABLE IF EXISTS tmp_digests_delta;\n            CREATE TEMPORARY TABLE tmp_digests_delta LIKE tmp_digests;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digests_delta\\nSELECT `d_end`.`SCHEMA_NAME`,\\n       `d_end`.`DIGEST`,\\n       `d_end`.`DIGEST_TEXT`,\\n       `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) AS \'\'COUNT_STAR\'\',\\n       `d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0) AS \'\'SUM_TIMER_WAIT\'\',\\n       `d_end`.`MIN_TIMER_WAIT` AS \'\'MIN_TIMER_WAIT\'\',\\n       IFNULL((`d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0))/NULLIF(`d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0), 0), 0) AS \'\'AVG_TIMER_WAIT\'\',\\n       `d_end`.`MAX_TIMER_WAIT` AS \'\'MAX_TIMER_WAIT\'\',\\n       `d_end`.`SUM_LOCK_TIME`-IFNULL(`d_start`.`SUM_LOCK_TIME`, 0) AS \'\'SUM_LOCK_TIME\'\',\\n       `d_end`.`SUM_ERRORS`-IFNULL(`d_start`.`SUM_ERRORS`, 0) AS \'\'SUM_ERRORS\'\',\\n       `d_end`.`SUM_WARNINGS`-IFNULL(`d_start`.`SUM_WARNINGS`, 0) AS \'\'SUM_WARNINGS\'\',\\n       `d_end`.`SUM_ROWS_AFFECTED`-IFNULL(`d_start`.`SUM_ROWS_AFFECTED`, 0) AS \'\'SUM_ROWS_AFFECTED\'\',\\n       `d_end`.`SUM_ROWS_SENT`-IFNULL(`d_start`.`SUM_ROWS_SENT`, 0) AS \'\'SUM_ROWS_SENT\'\',\\n       `d_end`.`SUM_ROWS_EXAMINED`-IFNULL(`d_start`.`SUM_ROWS_EXAMINED`, 0) AS \'\'SUM_ROWS_EXAMINED\'\',\\n       `d_end`.`SUM_CREATED_TMP_DISK_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_DISK_TABLES`, 0) AS \'\'SUM_CREATED_TMP_DISK_TABLES\'\',\\n       `d_end`.`SUM_CREATED_TMP_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_TABLES`, 0) AS \'\'SUM_CREATED_TMP_TABLES\'\',\\n       `d_end`.`SUM_SELECT_FULL_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_JOIN`, 0) AS \'\'SUM_SELECT_FULL_JOIN\'\',\\n       `d_end`.`SUM_SELECT_FULL_RANGE_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_RANGE_JOIN`, 0) AS \'\'SUM_SELECT_FULL_RANGE_JOIN\'\',\\n       `d_end`.`SUM_SELECT_RANGE`-IFNULL(`d_start`.`SUM_SELECT_RANGE`, 0) AS \'\'SUM_SELECT_RANGE\'\',\\n       `d_end`.`SUM_SELECT_RANGE_CHECK`-IFNULL(`d_start`.`SUM_SELECT_RANGE_CHECK`, 0) AS \'\'SUM_SELECT_RANGE_CHECK\'\',\\n       `d_end`.`SUM_SELECT_SCAN`-IFNULL(`d_start`.`SUM_SELECT_SCAN`, 0) AS \'\'SUM_SELECT_SCAN\'\',\\n       `d_end`.`SUM_SORT_MERGE_PASSES`-IFNULL(`d_start`.`SUM_SORT_MERGE_PASSES`, 0) AS \'\'SUM_SORT_MERGE_PASSES\'\',\\n       `d_end`.`SUM_SORT_RANGE`-IFNULL(`d_start`.`SUM_SORT_RANGE`, 0) AS \'\'SUM_SORT_RANGE\'\',\\n       `d_end`.`SUM_SORT_ROWS`-IFNULL(`d_start`.`SUM_SORT_ROWS`, 0) AS \'\'SUM_SORT_ROWS\'\',\\n       `d_end`.`SUM_SORT_SCAN`-IFNULL(`d_start`.`SUM_SORT_SCAN`, 0) AS \'\'SUM_SORT_SCAN\'\',\\n       `d_end`.`SUM_NO_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_INDEX_USED`, 0) AS \'\'SUM_NO_INDEX_USED\'\',\\n       `d_end`.`SUM_NO_GOOD_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_GOOD_INDEX_USED`, 0) AS \'\'SUM_NO_GOOD_INDEX_USED\'\',\\n       `d_end`.`FIRST_SEEN`,\\n       `d_end`.`LAST_SEEN`\\n  FROM tmp_digests d_end\\n       LEFT OUTER JOIN \', v_quoted_table, \' d_start ON `d_start`.`DIGEST` = `d_end`.`DIGEST`\\n                                                    AND (`d_start`.`SCHEMA_NAME` = `d_end`.`SCHEMA_NAME`\\n                                                          OR (`d_start`.`SCHEMA_NAME` IS NULL AND `d_end`.`SCHEMA_NAME` IS NULL)\\n                                                        )\\n WHERE `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) > 0\');\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_runtimes_in_95th_percentile\', in_views)) THEN\n            SELECT \'Queries with Runtime in 95th Percentile\' AS \'Next Output\';\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution1;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution2;\n            DROP TEMPORARY TABLE IF EXISTS tmp_digest_95th_percentile_by_avg_us;\n            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution1 (\n              cnt bigint unsigned NOT NULL,\n              avg_us decimal(21,0) NOT NULL,\n              PRIMARY KEY (avg_us)\n            ) ENGINE=InnoDB;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digest_avg_latency_distribution1\\nSELECT COUNT(*) cnt,\\n       ROUND(avg_timer_wait/1000000) AS avg_us\\n  FROM \', v_digests_table, \'\\n GROUP BY avg_us\');\n            CALL sys.execute_prepared_stmt(v_sql);\n            CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution2 LIKE tmp_digest_avg_latency_distribution1;\n            INSERT INTO tmp_digest_avg_latency_distribution2 SELECT * FROM tmp_digest_avg_latency_distribution1;\n            CREATE TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us (\n              avg_us decimal(21,0) NOT NULL,\n              percentile decimal(46,4) NOT NULL,\n              PRIMARY KEY (avg_us)\n            ) ENGINE=InnoDB;\n            SET v_sql = CONCAT(\'INSERT INTO tmp_digest_95th_percentile_by_avg_us\\nSELECT s2.avg_us avg_us,\\n       IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM \', v_digests_table, \'), 0), 0) percentile\\n  FROM tmp_digest_avg_latency_distribution1 AS s1\\n       JOIN tmp_digest_avg_latency_distribution2 AS s2 ON s1.avg_us <= s2.avg_us\\n GROUP BY s2.avg_us\\nHAVING percentile > 0.95\\n ORDER BY percentile\\n LIMIT 1\');\n            CALL sys.execute_prepared_stmt(v_sql);\n            SET v_sql =\n                REPLACE(\n                    REPLACE(\n                        (SELECT VIEW_DEFINITION\n                           FROM information_schema.VIEWS\n                          WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_runtimes_in_95th_percentile\'\n                        ),\n                        \'`performance_schema`.`events_statements_summary_by_digest`\',\n                        v_digests_table\n                    ),\n                    \'sys.x$ps_digest_95th_percentile_by_avg_us\',\n                    \'`sys`.`x$ps_digest_95th_percentile_by_avg_us`\'\n              );\n            CALL sys.execute_prepared_stmt(v_sql);\n            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution1;\n            DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution2;\n            DROP TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us;\n        END IF;\n        IF (FIND_IN_SET(\'analysis\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries Ordered by Total Latency\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statement_analysis\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_errors_or_warnings\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Errors\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_errors_or_warnings\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_full_table_scans\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Full Table Scan\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_full_table_scans\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_sorting\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Sorting\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_sorting\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'with_temp_tables\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries with Internal Temporary Tables\') AS \'Next Output\';\n            SET v_sql =\n                REPLACE(\n                    (SELECT VIEW_DEFINITION\n                       FROM information_schema.VIEWS\n                      WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = \'statements_with_temp_tables\'\n                    ),\n                    \'`performance_schema`.`events_statements_summary_by_digest`\',\n                    v_digests_table\n                );\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n        IF (FIND_IN_SET(\'custom\', in_views)) THEN\n            SELECT CONCAT(\'Top \', @sys.statement_performance_analyzer.limit, \' Queries Using Custom View\') AS \'Next Output\';\n            IF (@sys.statement_performance_analyzer.view IS NULL) THEN\n                SET @sys.statement_performance_analyzer.view = sys.sys_get_config(\'statement_performance_analyzer.view\', NULL);\n            END IF;\n            IF (@sys.statement_performance_analyzer.view IS NULL) THEN\n                SIGNAL SQLSTATE \'45000\'\n                   SET MESSAGE_TEXT = \'The @sys.statement_performance_analyzer.view user variable must be set with the view or query to use.\';\n            END IF;\n            IF (NOT INSTR(@sys.statement_performance_analyzer.view, \' \')) THEN\n                IF (NOT INSTR(@sys.statement_performance_analyzer.view, \'.\')) THEN\n                    SET v_custom_db   = DATABASE(),\n                        v_custom_name = @sys.statement_performance_analyzer.view;\n                ELSE\n                    SET v_custom_db   = SUBSTRING_INDEX(@sys.statement_performance_analyzer.view, \'.\', 1);\n                    SET v_custom_name = SUBSTRING(@sys.statement_performance_analyzer.view, CHAR_LENGTH(v_custom_db)+2);\n                END IF;\n                CALL sys.table_exists(v_custom_db, v_custom_name, v_custom_view_exists);\n                IF (v_custom_view_exists <> \'VIEW\') THEN\n                    SIGNAL SQLSTATE \'45000\'\n                       SET MESSAGE_TEXT = \'The @sys.statement_performance_analyzer.view user variable is set but specified neither an existing view nor a query.\';\n                END IF;\n                SET v_sql =\n                    REPLACE(\n                        (SELECT VIEW_DEFINITION\n                           FROM information_schema.VIEWS\n                          WHERE TABLE_SCHEMA = v_custom_db AND TABLE_NAME = v_custom_name\n                        ),\n                        \'`performance_schema`.`events_statements_summary_by_digest`\',\n                        v_digests_table\n                    );\n            ELSE\n                SET v_sql = REPLACE(@sys.statement_performance_analyzer.view, \'`performance_schema`.`events_statements_summary_by_digest`\', v_digests_table);\n            END IF;\n            IF (@sys.statement_performance_analyzer.limit > 0) THEN\n                SET v_sql = CONCAT(v_sql, \' LIMIT \', @sys.statement_performance_analyzer.limit);\n            END IF;\n            CALL sys.execute_prepared_stmt(v_sql);\n        END IF;\n    END IF;\n    IF (v_this_thread_enabled = \'YES\') THEN\n        CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n    END IF;\n    IF (@log_bin = 1) THEN\n        SET sql_log_bin = @log_bin;\n    END IF;\nEND','NONE'),
('sys','ps_is_account_enabled','FUNCTION','ps_is_account_enabled','SQL','READS_SQL_DATA','YES','INVOKER','in_host VARCHAR(60),\n        in_user VARCHAR(16)\n    ','enum(\'YES\',\'NO\') CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN IF(EXISTS(SELECT 1\n                       FROM performance_schema.setup_actors\n                      WHERE (`HOST` = \'%\' OR in_host LIKE `HOST`)\n                        AND (`USER` = \'%\' OR `USER` = in_user)\n                    ),\n              \'YES\', \'NO\'\n           );\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Determines whether instrumentation of an account is enabled\n             within Performance Schema.\n             Parameters\n             in_host VARCHAR(60):\n               The hostname of the account to check.\n             in_user (VARCHAR(16)):\n               The username of the account to check.\n             Returns\n             ENUM(\'YES\', \'NO\', \'PARTIAL\')\n             Example\n             mysql> SELECT sys.ps_is_account_enabled(\'localhost\', \'root\');\n             +------------------------------------------------+\n             | sys.ps_is_account_enabled(\'localhost\', \'root\') |\n             +------------------------------------------------+\n             | YES                                            |\n             +------------------------------------------------+\n             1 row in set (0.01 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN IF(EXISTS(SELECT 1\n                       FROM performance_schema.setup_actors\n                      WHERE (`HOST` = \'%\' OR in_host LIKE `HOST`)\n                        AND (`USER` = \'%\' OR `USER` = in_user)\n                    ),\n              \'YES\', \'NO\'\n           );\nEND','NONE'),
('sys','ps_is_consumer_enabled','FUNCTION','ps_is_consumer_enabled','SQL','READS_SQL_DATA','YES','INVOKER','in_consumer varchar(64)\n   ','enum(\'YES\',\'NO\') CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN (\n        SELECT (CASE\n                   WHEN c.NAME = \'global_instrumentation\' THEN c.ENABLED\n                   WHEN c.NAME = \'thread_instrumentation\' THEN IF(cg.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   WHEN c.NAME LIKE \'%\\_digest\'           THEN IF(cg.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   WHEN c.NAME LIKE \'%\\_current\'          THEN IF(cg.ENABLED = \'YES\' AND ct.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   ELSE IF(cg.ENABLED = \'YES\' AND ct.ENABLED = \'YES\' AND c.ENABLED = \'YES\'\n                           AND ( SELECT cc.ENABLED FROM performance_schema.setup_consumers cc WHERE NAME = CONCAT(SUBSTRING_INDEX(c.NAME, \'_\', 2), \'_current\')\n                               ) = \'YES\', \'YES\', \'NO\')\n                END) AS IsEnabled\n          FROM performance_schema.setup_consumers c\n               INNER JOIN performance_schema.setup_consumers cg\n               INNER JOIN performance_schema.setup_consumers ct\n         WHERE cg.NAME       = \'global_instrumentation\'\n               AND ct.NAME   = \'thread_instrumentation\'\n               AND c.NAME    = in_consumer\n       );\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Determines whether a consumer is enabled (taking the consumer hierarchy into consideration)\n             within the Performance Schema.\n             Parameters\n             in_consumer VARCHAR(64):\n               The name of the consumer to check.\n             Returns\n             ENUM(\'YES\', \'NO\')\n             Example\n             mysql> SELECT sys.ps_is_consumer_enabled(\'events_stages_history\');\n             +-----------------------------------------------------+\n             | sys.ps_is_consumer_enabled(\'events_stages_history\') |\n             +-----------------------------------------------------+\n             | NO                                                  |\n             +-----------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN (\n        SELECT (CASE\n                   WHEN c.NAME = \'global_instrumentation\' THEN c.ENABLED\n                   WHEN c.NAME = \'thread_instrumentation\' THEN IF(cg.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   WHEN c.NAME LIKE \'%\\_digest\'           THEN IF(cg.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   WHEN c.NAME LIKE \'%\\_current\'          THEN IF(cg.ENABLED = \'YES\' AND ct.ENABLED = \'YES\' AND c.ENABLED = \'YES\', \'YES\', \'NO\')\n                   ELSE IF(cg.ENABLED = \'YES\' AND ct.ENABLED = \'YES\' AND c.ENABLED = \'YES\'\n                           AND ( SELECT cc.ENABLED FROM performance_schema.setup_consumers cc WHERE NAME = CONCAT(SUBSTRING_INDEX(c.NAME, \'_\', 2), \'_current\')\n                               ) = \'YES\', \'YES\', \'NO\')\n                END) AS IsEnabled\n          FROM performance_schema.setup_consumers c\n               INNER JOIN performance_schema.setup_consumers cg\n               INNER JOIN performance_schema.setup_consumers ct\n         WHERE cg.NAME       = \'global_instrumentation\'\n               AND ct.NAME   = \'thread_instrumentation\'\n               AND c.NAME    = in_consumer\n       );\nEND','NONE'),
('sys','table_exists','PROCEDURE','table_exists','SQL','CONTAINS_SQL','NO','INVOKER','\n        IN in_db VARCHAR(64), IN in_table VARCHAR(64),\n        OUT out_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\', \'SEQUENCE\', \'SYSTEM VIEW\')\n    ','','BEGIN\n    DECLARE v_error BOOLEAN DEFAULT FALSE;\n    DECLARE db_quoted VARCHAR(64);\n    DECLARE table_quoted VARCHAR(64);\n    DECLARE v_table_type VARCHAR(16) DEFAULT \'\';\n    DECLARE v_system_db BOOLEAN\n        DEFAULT LOWER(in_db) IN (\'information_schema\', \'performance_schema\');\n    DECLARE CONTINUE HANDLER FOR 1050 SET v_error = TRUE;\n    DECLARE CONTINUE HANDLER FOR 1146 SET v_error = TRUE;\n    SET out_exists = \'\';\n    SET db_quoted = sys.quote_identifier(in_db);\n    SET table_quoted = sys.quote_identifier(in_table);\n    IF (EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table)) THEN\n        IF v_system_db = FALSE THEN\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'CREATE TEMPORARY TABLE \',\n                                                    db_quoted,\n                                                    \'.\',\n                                                    table_quoted,\n                                                    \'(id INT PRIMARY KEY)\');\n            PREPARE stmt_create_table FROM @sys.tmp.table_exists.SQL;\n            EXECUTE stmt_create_table;\n            DEALLOCATE PREPARE stmt_create_table;\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'DROP TEMPORARY TABLE \',\n                                                                db_quoted,\n                                                                \'.\',\n                                                                table_quoted);\n            PREPARE stmt_drop_table FROM @sys.tmp.table_exists.SQL;\n            EXECUTE stmt_drop_table;\n            DEALLOCATE PREPARE stmt_drop_table;\n        END IF;\n        IF (v_error) THEN\n            SET out_exists = \'TEMPORARY\';\n        ELSE\n            SET v_table_type = (SELECT TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table);\n            IF v_table_type = \'SYSTEM VERSIONED\' THEN\n                SET out_exists = \'BASE TABLE\';\n            ELSE\n                SET out_exists = v_table_type;\n            END IF;\n        END IF;\n    ELSE\n        IF v_system_db = FALSE THEN\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'SELECT COUNT(*) FROM \',\n                                                            db_quoted,\n                                                            \'.\',\n                                                            table_quoted);\n            PREPARE stmt_select FROM @sys.tmp.table_exists.SQL;\n            IF (NOT v_error) THEN\n                DEALLOCATE PREPARE stmt_select;\n                SET out_exists = \'TEMPORARY\';\n            END IF;\n        END IF;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Tests whether the table specified in in_db and in_table exists either as a regular\n             table, or as a temporary table. The returned value corresponds to the table that\n             will be used, so if there\'s both a temporary and a permanent table with the given\n             name, then \'TEMPORARY\' will be returned.\n             Parameters\n             in_db (VARCHAR(64)):\n               The database name to check for the existence of the table in.\n             in_table (VARCHAR(64)):\n               The name of the table to check the existence of.\n             out_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\'):\n               The return value: whether the table exists. The value is one of:\n                 * \'\'             - the table does not exist neither as a base table, view, sequence nor temporary table.\n                 * \'BASE TABLE\'   - the table name exists as a permanent base table table.\n                 * \'VIEW\'         - the table name exists as a view.\n                 * \'TEMPORARY\'    - the table name exists as a temporary table.\n                 * \'SEQUENCE\'     - the table name exists as a sequence.\n                 * \'SYSTEM VIEW\'  - the table name exists as a system view.\n             Example\n             mysql> CREATE DATABASE db1;\n             Query OK, 1 row affected (0.07 sec)\n             mysql> use db1;\n             Database changed\n             mysql> CREATE TABLE t1 (id INT PRIMARY KEY);\n             Query OK, 0 rows affected (0.08 sec)\n             mysql> CREATE TABLE t2 (id INT PRIMARY KEY);\n             Query OK, 0 rows affected (0.08 sec)\n             mysql> CREATE view v_t1 AS SELECT * FROM t1;\n             Query OK, 0 rows affected (0.00 sec)\n             mysql> CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);\n             Query OK, 0 rows affected (0.00 sec)\n             mysql> CALL sys.table_exists(\'db1\', \'t1\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.00 sec)\n             +------------+\n             | @exists    |\n             +------------+\n             | TEMPORARY  |\n             +------------+\n             1 row in set (0.00 sec)\n             mysql> CALL sys.table_exists(\'db1\', \'t2\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.00 sec)\n             +------------+\n             | @exists    |\n             +------------+\n             | BASE TABLE |\n             +------------+\n             1 row in set (0.01 sec)\n             mysql> CALL sys.table_exists(\'db1\', \'v_t1\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.00 sec)\n             +---------+\n             | @exists |\n             +---------+\n             | VIEW    |\n             +---------+\n             1 row in set (0.00 sec)\n             MariaDB [sys]> CALL sys.table_exists(\'db1\', \'s\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.006 sec)\n             +----------+\n             | @exists  |\n             +----------+\n             | SEQUENCE |\n             +----------+\n             1 row in set (0.000 sec)\n             MariaDB [sys]> CALL table_exists(\'information_schema\', \'user_variables\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.003 sec)\n             +-------------+\n             | @exists     |\n             +-------------+\n             | SYSTEM VIEW |\n             +-------------+\n             1 row in set (0.001 sec)\n             mysql> CALL sys.table_exists(\'db1\', \'t3\', @exists); SELECT @exists;\n             Query OK, 0 rows affected (0.01 sec)\n             +---------+\n             | @exists |\n             +---------+\n             |         |\n             +---------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_error BOOLEAN DEFAULT FALSE;\n    DECLARE db_quoted VARCHAR(64);\n    DECLARE table_quoted VARCHAR(64);\n    DECLARE v_table_type VARCHAR(16) DEFAULT \'\';\n    DECLARE v_system_db BOOLEAN\n        DEFAULT LOWER(in_db) IN (\'information_schema\', \'performance_schema\');\n    DECLARE CONTINUE HANDLER FOR 1050 SET v_error = TRUE;\n    DECLARE CONTINUE HANDLER FOR 1146 SET v_error = TRUE;\n    SET out_exists = \'\';\n    SET db_quoted = sys.quote_identifier(in_db);\n    SET table_quoted = sys.quote_identifier(in_table);\n    IF (EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table)) THEN\n        IF v_system_db = FALSE THEN\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'CREATE TEMPORARY TABLE \',\n                                                    db_quoted,\n                                                    \'.\',\n                                                    table_quoted,\n                                                    \'(id INT PRIMARY KEY)\');\n            PREPARE stmt_create_table FROM @sys.tmp.table_exists.SQL;\n            EXECUTE stmt_create_table;\n            DEALLOCATE PREPARE stmt_create_table;\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'DROP TEMPORARY TABLE \',\n                                                                db_quoted,\n                                                                \'.\',\n                                                                table_quoted);\n            PREPARE stmt_drop_table FROM @sys.tmp.table_exists.SQL;\n            EXECUTE stmt_drop_table;\n            DEALLOCATE PREPARE stmt_drop_table;\n        END IF;\n        IF (v_error) THEN\n            SET out_exists = \'TEMPORARY\';\n        ELSE\n            SET v_table_type = (SELECT TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table);\n            IF v_table_type = \'SYSTEM VERSIONED\' THEN\n                SET out_exists = \'BASE TABLE\';\n            ELSE\n                SET out_exists = v_table_type;\n            END IF;\n        END IF;\n    ELSE\n        IF v_system_db = FALSE THEN\n            SET @sys.tmp.table_exists.SQL = CONCAT(\'SELECT COUNT(*) FROM \',\n                                                            db_quoted,\n                                                            \'.\',\n                                                            table_quoted);\n            PREPARE stmt_select FROM @sys.tmp.table_exists.SQL;\n            IF (NOT v_error) THEN\n                DEALLOCATE PREPARE stmt_select;\n                SET out_exists = \'TEMPORARY\';\n            END IF;\n        END IF;\n    END IF;\nEND','NONE'),
('sys','ps_is_instrument_default_enabled','FUNCTION','ps_is_instrument_default_enabled','SQL','READS_SQL_DATA','YES','INVOKER','in_instrument VARCHAR(128)\n    ','enum(\'YES\',\'NO\') CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    DECLARE v_enabled ENUM(\'YES\', \'NO\');\n    SET v_enabled = IF(in_instrument LIKE \'wait/io/file/%\'\n                        OR in_instrument LIKE \'wait/io/table/%\'\n                        OR in_instrument LIKE \'statement/%\'\n                        OR in_instrument LIKE \'memory/performance_schema/%\'\n                        OR in_instrument IN (\'wait/lock/table/sql/handler\', \'idle\')\n               \n                      ,\n                       \'YES\',\n                       \'NO\'\n                    );\n    RETURN v_enabled;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns whether an instrument is enabled by default in this version of MySQL.\n             Parameters\n             in_instrument VARCHAR(128):\n               The instrument to check.\n             Returns\n             ENUM(\'YES\', \'NO\')\n             Example\n             mysql> SELECT sys.ps_is_instrument_default_enabled(\'statement/sql/select\');\n             +--------------------------------------------------------------+\n             | sys.ps_is_instrument_default_enabled(\'statement/sql/select\') |\n             +--------------------------------------------------------------+\n             | YES                                                          |\n             +--------------------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_enabled ENUM(\'YES\', \'NO\');\n    SET v_enabled = IF(in_instrument LIKE \'wait/io/file/%\'\n                        OR in_instrument LIKE \'wait/io/table/%\'\n                        OR in_instrument LIKE \'statement/%\'\n                        OR in_instrument LIKE \'memory/performance_schema/%\'\n                        OR in_instrument IN (\'wait/lock/table/sql/handler\', \'idle\')\n               \n                      ,\n                       \'YES\',\n                       \'NO\'\n                    );\n    RETURN v_enabled;\nEND','NONE'),
('sys','ps_is_instrument_default_timed','FUNCTION','ps_is_instrument_default_timed','SQL','READS_SQL_DATA','YES','INVOKER','in_instrument VARCHAR(128)\n    ','enum(\'YES\',\'NO\') CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    DECLARE v_timed ENUM(\'YES\', \'NO\');\n    SET v_timed = IF(in_instrument LIKE \'wait/io/file/%\'\n                        OR in_instrument LIKE \'wait/io/table/%\'\n                        OR in_instrument LIKE \'statement/%\'\n                        OR in_instrument IN (\'wait/lock/table/sql/handler\', \'idle\')\n               \n                      ,\n                       \'YES\',\n                       \'NO\'\n                    );\n    RETURN v_timed;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns whether an instrument is timed by default in this version of MySQL.\n             Parameters\n             in_instrument VARCHAR(128):\n               The instrument to check.\n             Returns\n             ENUM(\'YES\', \'NO\')\n             Example\n             mysql> SELECT sys.ps_is_instrument_default_timed(\'statement/sql/select\');\n             +------------------------------------------------------------+\n             | sys.ps_is_instrument_default_timed(\'statement/sql/select\') |\n             +------------------------------------------------------------+\n             | YES                                                        |\n             +------------------------------------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_timed ENUM(\'YES\', \'NO\');\n    SET v_timed = IF(in_instrument LIKE \'wait/io/file/%\'\n                        OR in_instrument LIKE \'wait/io/table/%\'\n                        OR in_instrument LIKE \'statement/%\'\n                        OR in_instrument IN (\'wait/lock/table/sql/handler\', \'idle\')\n               \n                      ,\n                       \'YES\',\n                       \'NO\'\n                    );\n    RETURN v_timed;\nEND','NONE'),
('sys','ps_is_thread_instrumented','FUNCTION','ps_is_thread_instrumented','SQL','READS_SQL_DATA','NO','INVOKER','in_connection_id BIGINT UNSIGNED\n    ','enum(\'YES\',\'NO\',\'UNKNOWN\') CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    DECLARE v_enabled ENUM(\'YES\', \'NO\', \'UNKNOWN\');\n    IF (in_connection_id IS NULL) THEN\n        RETURN NULL;\n    END IF;\n    SELECT INSTRUMENTED INTO v_enabled\n      FROM performance_schema.threads\n     WHERE PROCESSLIST_ID = in_connection_id;\n    IF (v_enabled IS NULL) THEN\n        RETURN \'UNKNOWN\';\n    ELSE\n        RETURN v_enabled;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Checks whether the provided connection id is instrumented within Performance Schema.\n             Parameters\n             in_connection_id (BIGINT UNSIGNED):\n               The id of the connection to check.\n             Returns\n             ENUM(\'YES\', \'NO\', \'UNKNOWN\')\n             Example\n             mysql> SELECT sys.ps_is_thread_instrumented(CONNECTION_ID());\n             +------------------------------------------------+\n             | sys.ps_is_thread_instrumented(CONNECTION_ID()) |\n             +------------------------------------------------+\n             | YES                                            |\n             +------------------------------------------------+\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_enabled ENUM(\'YES\', \'NO\', \'UNKNOWN\');\n    IF (in_connection_id IS NULL) THEN\n        RETURN NULL;\n    END IF;\n    SELECT INSTRUMENTED INTO v_enabled\n      FROM performance_schema.threads\n     WHERE PROCESSLIST_ID = in_connection_id;\n    IF (v_enabled IS NULL) THEN\n        RETURN \'UNKNOWN\';\n    ELSE\n        RETURN v_enabled;\n    END IF;\nEND','NONE'),
('sys','ps_thread_id','FUNCTION','ps_thread_id','SQL','READS_SQL_DATA','NO','INVOKER','in_connection_id BIGINT UNSIGNED\n    ','bigint(20) unsigned','BEGIN\n    RETURN (SELECT THREAD_ID\n              FROM `performance_schema`.`threads`\n             WHERE PROCESSLIST_ID = IFNULL(in_connection_id, CONNECTION_ID())\n           );\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Return the Performance Schema THREAD_ID for the specified connection ID.\n             Parameters\n             in_connection_id (BIGINT UNSIGNED):\n               The id of the connection to return the thread id for. If NULL, the current\n               connection thread id is returned.\n             Example\n             mysql> SELECT sys.ps_thread_id(79);\n             +----------------------+\n             | sys.ps_thread_id(79) |\n             +----------------------+\n             |                   98 |\n             +----------------------+\n             1 row in set (0.00 sec)\n             mysql> SELECT sys.ps_thread_id(CONNECTION_ID());\n             +-----------------------------------+\n             | sys.ps_thread_id(CONNECTION_ID()) |\n             +-----------------------------------+\n             |                                98 |\n             +-----------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN (SELECT THREAD_ID\n              FROM `performance_schema`.`threads`\n             WHERE PROCESSLIST_ID = IFNULL(in_connection_id, CONNECTION_ID())\n           );\nEND','NONE'),
('sys','ps_thread_account','FUNCTION','ps_thread_account','SQL','READS_SQL_DATA','NO','INVOKER','in_thread_id BIGINT UNSIGNED\n    ','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN (SELECT IF(\n                      type = \'FOREGROUND\',\n                      CONCAT(processlist_user, \'@\', processlist_host),\n                      type\n                     ) AS account\n              FROM `performance_schema`.`threads`\n             WHERE thread_id = in_thread_id);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Return the user@host account for the given Performance Schema thread id.\n             Parameters\n             in_thread_id (BIGINT UNSIGNED):\n               The id of the thread to return the account for.\n             Example\n             mysql> select thread_id, processlist_user, processlist_host from performance_schema.threads where type = \'foreground\';\n              +-----------+------------------+------------------+\n              | thread_id | processlist_user | processlist_host |\n              +-----------+------------------+------------------+\n              |        23 | NULL             | NULL             |\n              |        30 | root             | localhost        |\n              |        31 | msandbox         | localhost        |\n              |        32 | msandbox         | localhost        |\n              +-----------+------------------+------------------+\n              4 rows in set (0.00 sec)\n              mysql> select sys.ps_thread_account(31);\n              +---------------------------+\n              | sys.ps_thread_account(31) |\n              +---------------------------+\n              | msandbox@localhost        |\n              +---------------------------+\n              1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN (SELECT IF(\n                      type = \'FOREGROUND\',\n                      CONCAT(processlist_user, \'@\', processlist_host),\n                      type\n                     ) AS account\n              FROM `performance_schema`.`threads`\n             WHERE thread_id = in_thread_id);\nEND','NONE'),
('sys','quote_identifier','FUNCTION','quote_identifier','SQL','NO_SQL','YES','INVOKER','in_identifier TEXT','text CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    RETURN CONCAT(\'`\', REPLACE(in_identifier, \'`\', \'``\'), \'`\');\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes an unquoted identifier (schema name, table name, etc.) and\n             returns the identifier quoted with backticks.\n             Parameters\n             in_identifier (TEXT):\n               The identifier to quote.\n             Returns\n             TEXT\n             Example\n             mysql> SELECT sys.quote_identifier(\'my_identifier\') AS Identifier;\n             +-----------------+\n             | Identifier      |\n             +-----------------+\n             | `my_identifier` |\n             +-----------------+\n             1 row in set (0.00 sec)\n             mysql> SELECT sys.quote_identifier(\'my`idenfier\') AS Identifier;\n             +----------------+\n             | Identifier     |\n             +----------------+\n             | `my``idenfier` |\n             +----------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN CONCAT(\'`\', REPLACE(in_identifier, \'`\', \'``\'), \'`\');\nEND','NONE'),
('sys','sys_get_config','FUNCTION','sys_get_config','SQL','READS_SQL_DATA','YES','INVOKER','in_variable_name VARCHAR(128),\n        in_default_value VARCHAR(128)\n    ','varchar(128) CHARSET utf8mb3 COLLATE utf8mb3_general_ci','BEGIN\n    DECLARE v_value VARCHAR(128) DEFAULT NULL;\n    DECLARE old_val INTEGER DEFAULT NULL;\n    SET v_value = (SELECT value FROM sys.sys_config WHERE variable = in_variable_name);\n    IF (v_value IS NULL) THEN\n        SET v_value = in_default_value;\n    END IF;\n    RETURN v_value;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns the value for the requested variable using the following logic:\n                1. If the option exists in sys.sys_config return the value from there.\n                2. Else fall back on the provided default value.\n             Notes for using sys_get_config():\n                * If the default value argument to sys_get_config() is NULL and case 2. is reached, NULL is returned.\n                  It is then expected that the caller is able to handle NULL for the given configuration option.\n                * The convention is to name the user variables @sys.<name of variable>. It is <name of variable> that\n                  is stored in the sys_config table and is what is expected as the argument to sys_get_config().\n                * If you want to check whether the configuration option has already been set and if not assign with\n                  the return value of sys_get_config() you can use IFNULL(...) (see example below). However this should\n                  not be done inside a loop (e.g. for each row in a result set) as for repeated calls where assignment\n                  is only needed in the first iteration using IFNULL(...) is expected to be significantly slower than\n                  using an IF (...) THEN ... END IF; block (see example below).\n             Parameters\n             in_variable_name (VARCHAR(128)):\n               The name of the config option to return the value for.\n             in_default_value (VARCHAR(128)):\n               The default value to return if the variable does not exist in sys.sys_config.\n             Returns\n             VARCHAR(128)\n             Example\n             mysql> SELECT sys.sys_get_config(\'statement_truncate_len\', 128) AS Value;\n             +-------+\n             | Value |\n             +-------+\n             | 64    |\n             +-------+\n             1 row in set (0.00 sec)\n             mysql> SET @sys.statement_truncate_len = IFNULL(@sys.statement_truncate_len, sys.sys_get_config(\'statement_truncate_len\', 64));\n             Query OK, 0 rows affected (0.00 sec)\n             IF (@sys.statement_truncate_len IS NULL) THEN\n                 SET @sys.statement_truncate_len = sys.sys_get_config(\'statement_truncate_len\', 64);\n             END IF;\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_value VARCHAR(128) DEFAULT NULL;\n    DECLARE old_val INTEGER DEFAULT NULL;\n    SET v_value = (SELECT value FROM sys.sys_config WHERE variable = in_variable_name);\n    IF (v_value IS NULL) THEN\n        SET v_value = in_default_value;\n    END IF;\n    RETURN v_value;\nEND','NONE'),
('sys','version_major','FUNCTION','version_major','SQL','NO_SQL','NO','INVOKER','','tinyint(3) unsigned','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', 1);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns the major version of MySQL Server.\n             Returns\n             TINYINT UNSIGNED\n             Example\n             mysql> SELECT VERSION(), sys.version_major();\n             +--------------------------------------+---------------------+\n             | VERSION()                            | sys.version_major() |\n             +--------------------------------------+---------------------+\n             | 5.7.9-enterprise-commercial-advanced | 5                   |\n             +--------------------------------------+---------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', 1);\nEND','NONE'),
('sys','version_minor','FUNCTION','version_minor','SQL','NO_SQL','NO','INVOKER','','tinyint(3) unsigned','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', 2), \'.\', -1);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns the minor (release series) version of MySQL Server.\n             Returns\n             TINYINT UNSIGNED\n             Example\n             mysql> SELECT VERSION(), sys.server_minor();\n             +--------------------------------------+---------------------+\n             | VERSION()                            | sys.version_minor() |\n             +--------------------------------------+---------------------+\n             | 5.7.9-enterprise-commercial-advanced | 7                   |\n             +--------------------------------------+---------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', 2), \'.\', -1);\nEND','NONE'),
('sys','version_patch','FUNCTION','version_patch','SQL','NO_SQL','NO','INVOKER','','tinyint(3) unsigned','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', -1);\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Returns the patch release version of MySQL Server.\n             Returns\n             TINYINT UNSIGNED\n             Example\n             mysql> SELECT VERSION(), sys.version_patch();\n             +--------------------------------------+---------------------+\n             | VERSION()                            | sys.version_patch() |\n             +--------------------------------------+---------------------+\n             | 5.7.9-enterprise-commercial-advanced | 9                   |\n             +--------------------------------------+---------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), \'-\', 1), \'.\', -1);\nEND','NONE'),
('sys','execute_prepared_stmt','PROCEDURE','execute_prepared_stmt','SQL','READS_SQL_DATA','NO','INVOKER','\n        IN in_query longtext CHARACTER SET UTF8\n    ','','BEGIN\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug = sys.sys_get_config(\'debug\', \'OFF\');\n    END IF;\n    IF (in_query IS NULL OR LENGTH(in_query) < 4) THEN\n       SIGNAL SQLSTATE \'45000\'\n          SET MESSAGE_TEXT = \"The @sys.execute_prepared_stmt.sql must contain a query\";\n    END IF;\n    SET @sys.execute_prepared_stmt.sql = in_query;\n    IF (@sys.debug = \'ON\') THEN\n        SELECT @sys.execute_prepared_stmt.sql AS \'Debug\';\n    END IF;\n    PREPARE sys_execute_prepared_stmt FROM @sys.execute_prepared_stmt.sql;\n    EXECUTE sys_execute_prepared_stmt;\n    DEALLOCATE PREPARE sys_execute_prepared_stmt;\n    SET @sys.execute_prepared_stmt.sql = NULL;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Takes the query in the argument and executes it using a prepared statement. The prepared statement is deallocated,\n             so the procedure is mainly useful for executing one off dynamically created queries.\n             The sys_execute_prepared_stmt prepared statement name is used for the query and is required not to exist.\n             Parameters\n             in_query (longtext CHARACTER SET UTF8):\n               The query to execute.\n             Configuration Options\n             sys.debug\n               Whether to provide debugging output.\n               Default is \'OFF\'. Set to \'ON\' to include.\n             Example\n             mysql> CALL sys.execute_prepared_stmt(\'SELECT * FROM sys.sys_config\');\n             +------------------------+-------+---------------------+--------+\n             | variable               | value | set_time            | set_by |\n             +------------------------+-------+---------------------+--------+\n             | statement_truncate_len | 64    | 2015-06-30 13:06:00 | NULL   |\n             +------------------------+-------+---------------------+--------+\n             1 row in set (0.00 sec)\n             Query OK, 0 rows affected (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    IF (@sys.debug IS NULL) THEN\n        SET @sys.debug = sys.sys_get_config(\'debug\', \'OFF\');\n    END IF;\n    IF (in_query IS NULL OR LENGTH(in_query) < 4) THEN\n       SIGNAL SQLSTATE \'45000\'\n          SET MESSAGE_TEXT = \"The @sys.execute_prepared_stmt.sql must contain a query\";\n    END IF;\n    SET @sys.execute_prepared_stmt.sql = in_query;\n    IF (@sys.debug = \'ON\') THEN\n        SELECT @sys.execute_prepared_stmt.sql AS \'Debug\';\n    END IF;\n    PREPARE sys_execute_prepared_stmt FROM @sys.execute_prepared_stmt.sql;\n    EXECUTE sys_execute_prepared_stmt;\n    DEALLOCATE PREPARE sys_execute_prepared_stmt;\n    SET @sys.execute_prepared_stmt.sql = NULL;\nEND','NONE'),
('sys','ps_setup_disable_background_threads','PROCEDURE','ps_setup_disable_background_threads','SQL','MODIFIES_SQL_DATA','NO','INVOKER','','','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE type = \'BACKGROUND\';\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' background thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Disable all background thread instrumentation within Performance Schema.\n             Parameters\n             None.\n             Example\n             mysql> CALL sys.ps_setup_disable_background_threads();\n             +--------------------------------+\n             | summary                        |\n             +--------------------------------+\n             | Disabled 18 background threads |\n             +--------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE type = \'BACKGROUND\';\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' background thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_disable_consumer','PROCEDURE','ps_setup_disable_consumer','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN consumer VARCHAR(128)\n    ','','BEGIN\n    UPDATE performance_schema.setup_consumers\n       SET enabled = \'NO\'\n     WHERE name LIKE CONCAT(\'%\', consumer, \'%\');\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' consumer\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Disables consumers within Performance Schema\n             matching the input pattern.\n             Parameters\n             consumer (VARCHAR(128)):\n               A LIKE pattern match (using \"%consumer%\") of consumers to disable\n             Example\n             To disable all consumers:\n             mysql> CALL sys.ps_setup_disable_consumer(\'\');\n             +--------------------------+\n             | summary                  |\n             +--------------------------+\n             | Disabled 15 consumers    |\n             +--------------------------+\n             1 row in set (0.02 sec)\n             To disable just the event_stage consumers:\n             mysql> CALL sys.ps_setup_disable_comsumers(\'stage\');\n             +------------------------+\n             | summary                |\n             +------------------------+\n             | Disabled 3 consumers   |\n             +------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.setup_consumers\n       SET enabled = \'NO\'\n     WHERE name LIKE CONCAT(\'%\', consumer, \'%\');\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' consumer\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_disable_instrument','PROCEDURE','ps_setup_disable_instrument','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_pattern VARCHAR(128)\n    ','','BEGIN\n    UPDATE performance_schema.setup_instruments\n       SET enabled = \'NO\', timed = \'NO\'\n     WHERE name LIKE CONCAT(\'%\', in_pattern, \'%\');\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' instrument\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Disables instruments within Performance Schema\n             matching the input pattern.\n             Parameters\n             in_pattern (VARCHAR(128)):\n               A LIKE pattern match (using \"%in_pattern%\") of events to disable\n             Example\n             To disable all mutex instruments:\n             mysql> CALL sys.ps_setup_disable_instrument(\'wait/synch/mutex\');\n             +--------------------------+\n             | summary                  |\n             +--------------------------+\n             | Disabled 155 instruments |\n             +--------------------------+\n             1 row in set (0.02 sec)\n             To disable just a specific TCP/IP based network IO instrument:\n             mysql> CALL sys.ps_setup_disable_instrument(\'wait/io/socket/sql/server_tcpip_socket\');\n             +------------------------+\n             | summary                |\n             +------------------------+\n             | Disabled 1 instruments |\n             +------------------------+\n             1 row in set (0.00 sec)\n             To disable all instruments:\n             mysql> CALL sys.ps_setup_disable_instrument(\'\');\n             +--------------------------+\n             | summary                  |\n             +--------------------------+\n             | Disabled 547 instruments |\n             +--------------------------+\n             1 row in set (0.01 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.setup_instruments\n       SET enabled = \'NO\', timed = \'NO\'\n     WHERE name LIKE CONCAT(\'%\', in_pattern, \'%\');\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' instrument\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_disable_thread','PROCEDURE','ps_setup_disable_thread','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_connection_id BIGINT\n    ','','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE processlist_id = in_connection_id;\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Disable the given connection/thread in Performance Schema.\n             Parameters\n             in_connection_id (BIGINT):\n               The connection ID (PROCESSLIST_ID from performance_schema.threads\n               or the ID shown within SHOW PROCESSLIST)\n             Example\n             mysql> CALL sys.ps_setup_disable_thread(3);\n             +-------------------+\n             | summary           |\n             +-------------------+\n             | Disabled 1 thread |\n             +-------------------+\n             1 row in set (0.01 sec)\n             To disable the current connection:\n             mysql> CALL sys.ps_setup_disable_thread(CONNECTION_ID());\n             +-------------------+\n             | summary           |\n             +-------------------+\n             | Disabled 1 thread |\n             +-------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'NO\'\n     WHERE processlist_id = in_connection_id;\n    SELECT CONCAT(\'Disabled \', @rows := ROW_COUNT(), \' thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_enable_background_threads','PROCEDURE','ps_setup_enable_background_threads','SQL','MODIFIES_SQL_DATA','NO','INVOKER','','','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'YES\'\n     WHERE type = \'BACKGROUND\';\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' background thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Enable all background thread instrumentation within Performance Schema.\n             Parameters\n             None.\n             Example\n             mysql> CALL sys.ps_setup_enable_background_threads();\n             +-------------------------------+\n             | summary                       |\n             +-------------------------------+\n             | Enabled 18 background threads |\n             +-------------------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'YES\'\n     WHERE type = \'BACKGROUND\';\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' background thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_enable_consumer','PROCEDURE','ps_setup_enable_consumer','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN consumer VARCHAR(128)\n    ','','BEGIN\n    UPDATE performance_schema.setup_consumers\n       SET enabled = \'YES\'\n     WHERE name LIKE CONCAT(\'%\', consumer, \'%\');\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' consumer\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Enables consumers within Performance Schema\n             matching the input pattern.\n             Parameters\n             consumer (VARCHAR(128)):\n               A LIKE pattern match (using \"%consumer%\") of consumers to enable\n             Example\n             To enable all consumers:\n             mysql> CALL sys.ps_setup_enable_consumer(\'\');\n             +-------------------------+\n             | summary                 |\n             +-------------------------+\n             | Enabled 10 consumers    |\n             +-------------------------+\n             1 row in set (0.02 sec)\n             Query OK, 0 rows affected (0.02 sec)\n             To enable just \"waits\" consumers:\n             mysql> CALL sys.ps_setup_enable_consumer(\'waits\');\n             +-----------------------+\n             | summary               |\n             +-----------------------+\n             | Enabled 3 consumers   |\n             +-----------------------+\n             1 row in set (0.00 sec)\n             Query OK, 0 rows affected (0.00 sec)\n             ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.setup_consumers\n       SET enabled = \'YES\'\n     WHERE name LIKE CONCAT(\'%\', consumer, \'%\');\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' consumer\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_enable_instrument','PROCEDURE','ps_setup_enable_instrument','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_pattern VARCHAR(128)\n    ','','BEGIN\n    UPDATE performance_schema.setup_instruments\n       SET enabled = \'YES\', timed = \'YES\'\n     WHERE name LIKE CONCAT(\'%\', in_pattern, \'%\');\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' instrument\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Enables instruments within Performance Schema\n             matching the input pattern.\n             Parameters\n             in_pattern (VARCHAR(128)):\n               A LIKE pattern match (using \"%in_pattern%\") of events to enable\n             Example\n             To enable all mutex instruments:\n             mysql> CALL sys.ps_setup_enable_instrument(\'wait/synch/mutex\');\n             +-------------------------+\n             | summary                 |\n             +-------------------------+\n             | Enabled 155 instruments |\n             +-------------------------+\n             1 row in set (0.02 sec)\n             Query OK, 0 rows affected (0.02 sec)\n             To enable just a specific TCP/IP based network IO instrument:\n             mysql> CALL sys.ps_setup_enable_instrument(\'wait/io/socket/sql/server_tcpip_socket\');\n             +-----------------------+\n             | summary               |\n             +-----------------------+\n             | Enabled 1 instruments |\n             +-----------------------+\n             1 row in set (0.00 sec)\n             Query OK, 0 rows affected (0.00 sec)\n             To enable all instruments:\n             mysql> CALL sys.ps_setup_enable_instrument(\'\');\n             +-------------------------+\n             | summary                 |\n             +-------------------------+\n             | Enabled 547 instruments |\n             +-------------------------+\n             1 row in set (0.01 sec)\n             Query OK, 0 rows affected (0.01 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.setup_instruments\n       SET enabled = \'YES\', timed = \'YES\'\n     WHERE name LIKE CONCAT(\'%\', in_pattern, \'%\');\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' instrument\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_enable_thread','PROCEDURE','ps_setup_enable_thread','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_connection_id BIGINT\n    ','','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'YES\'\n     WHERE processlist_id = in_connection_id;\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Enable the given connection/thread in Performance Schema.\n             Parameters\n             in_connection_id (BIGINT):\n               The connection ID (PROCESSLIST_ID from performance_schema.threads\n               or the ID shown within SHOW PROCESSLIST)\n             Example\n             mysql> CALL sys.ps_setup_enable_thread(3);\n             +------------------+\n             | summary          |\n             +------------------+\n             | Enabled 1 thread |\n             +------------------+\n             1 row in set (0.01 sec)\n             To enable the current connection:\n             mysql> CALL sys.ps_setup_enable_thread(CONNECTION_ID());\n             +------------------+\n             | summary          |\n             +------------------+\n             | Enabled 1 thread |\n             +------------------+\n             1 row in set (0.00 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    UPDATE performance_schema.threads\n       SET instrumented = \'YES\'\n     WHERE processlist_id = in_connection_id;\n    SELECT CONCAT(\'Enabled \', @rows := ROW_COUNT(), \' thread\', IF(@rows != 1, \'s\', \'\')) AS summary;\nEND','NONE'),
('sys','ps_setup_save','PROCEDURE','ps_setup_save','SQL','MODIFIES_SQL_DATA','NO','INVOKER','\n        IN in_timeout INT\n    ','','BEGIN\n    DECLARE v_lock_result INT;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT GET_LOCK(\'sys.ps_setup_save\', in_timeout) INTO v_lock_result;\n    IF v_lock_result THEN\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_actors;\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_consumers;\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;\n        DROP TEMPORARY TABLE IF EXISTS tmp_threads;\n        CREATE TEMPORARY TABLE tmp_setup_actors AS SELECT * FROM performance_schema.setup_actors;\n        CREATE TEMPORARY TABLE tmp_setup_consumers AS SELECT * FROM  performance_schema.setup_consumers;\n        CREATE TEMPORARY TABLE tmp_setup_instruments AS SELECT * FROM  performance_schema.setup_instruments;\n        CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum(\'YES\',\'NO\') NOT NULL);\n        INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;\n    ELSE\n        SIGNAL SQLSTATE VALUE \'90000\'\n           SET MESSAGE_TEXT = \'Could not lock the sys.ps_setup_save user lock, another thread has a saved configuration\';\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Saves the current configuration of Performance Schema,\n             so that you can alter the setup for debugging purposes,\n             but restore it to a previous state.\n             Use the companion procedure - ps_setup_reload_saved(), to\n             restore the saved config.\n             The named lock \"sys.ps_setup_save\" is taken before the\n             current configuration is saved. If the attempt to get the named\n             lock times out, an error occurs.\n             The lock is released after the settings have been restored by\n             calling ps_setup_reload_saved().\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Parameters\n             in_timeout INT\n               The timeout in seconds used when trying to obtain the lock.\n               A negative timeout means infinite timeout.\n             Example\n             mysql> CALL sys.ps_setup_save(-1);\n             Query OK, 0 rows affected (0.08 sec)\n             mysql> UPDATE performance_schema.setup_instruments\n                 ->    SET enabled = \'YES\', timed = \'YES\';\n             Query OK, 547 rows affected (0.40 sec)\n             Rows matched: 784  Changed: 547  Warnings: 0\n             /* Run some tests that need more detailed instrumentation here */\n             mysql> CALL sys.ps_setup_reload_saved();\n             Query OK, 0 rows affected (0.32 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_lock_result INT;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT GET_LOCK(\'sys.ps_setup_save\', in_timeout) INTO v_lock_result;\n    IF v_lock_result THEN\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_actors;\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_consumers;\n        DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;\n        DROP TEMPORARY TABLE IF EXISTS tmp_threads;\n        CREATE TEMPORARY TABLE tmp_setup_actors AS SELECT * FROM performance_schema.setup_actors;\n        CREATE TEMPORARY TABLE tmp_setup_consumers AS SELECT * FROM  performance_schema.setup_consumers;\n        CREATE TEMPORARY TABLE tmp_setup_instruments AS SELECT * FROM  performance_schema.setup_instruments;\n        CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum(\'YES\',\'NO\') NOT NULL);\n        INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;\n    ELSE\n        SIGNAL SQLSTATE VALUE \'90000\'\n           SET MESSAGE_TEXT = \'Could not lock the sys.ps_setup_save user lock, another thread has a saved configuration\';\n    END IF;\n    SET sql_log_bin = @log_bin;\nEND','NONE'),
('sys','ps_setup_reload_saved','PROCEDURE','ps_setup_reload_saved','SQL','MODIFIES_SQL_DATA','NO','INVOKER','','','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_lock_result INT;\n    DECLARE v_lock_used_by BIGINT;\n    DECLARE v_signal_message TEXT;\n    DECLARE EXIT HANDLER FOR SQLEXCEPTION\n    BEGIN\n        SIGNAL SQLSTATE VALUE \'90001\'\n           SET MESSAGE_TEXT = \'An error occurred, was sys.ps_setup_save() run before this procedure?\';\n    END;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT IS_USED_LOCK(\'sys.ps_setup_save\') INTO v_lock_used_by;\n    IF (v_lock_used_by != CONNECTION_ID()) THEN\n        SET v_signal_message = CONCAT(\'The sys.ps_setup_save lock is currently owned by \', v_lock_used_by);\n        SIGNAL SQLSTATE VALUE \'90002\'\n           SET MESSAGE_TEXT = v_signal_message;\n    END IF;\n    DELETE FROM performance_schema.setup_actors;\n    INSERT INTO performance_schema.setup_actors SELECT * FROM tmp_setup_actors;\n    BEGIN\n        DECLARE v_name varchar(64);\n        DECLARE v_enabled enum(\'YES\', \'NO\');\n        DECLARE c_consumers CURSOR FOR SELECT NAME, ENABLED FROM tmp_setup_consumers;\n        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n        SET v_done = FALSE;\n        OPEN c_consumers;\n        c_consumers_loop: LOOP\n            FETCH c_consumers INTO v_name, v_enabled;\n            IF v_done THEN\n               LEAVE c_consumers_loop;\n            END IF;\n            UPDATE performance_schema.setup_consumers\n               SET ENABLED = v_enabled\n             WHERE NAME = v_name;\n         END LOOP;\n         CLOSE c_consumers;\n    END;\n    UPDATE performance_schema.setup_instruments\n     INNER JOIN tmp_setup_instruments USING (NAME)\n       SET performance_schema.setup_instruments.ENABLED = tmp_setup_instruments.ENABLED,\n           performance_schema.setup_instruments.TIMED   = tmp_setup_instruments.TIMED;\n    BEGIN\n        DECLARE v_thread_id bigint unsigned;\n        DECLARE v_instrumented enum(\'YES\', \'NO\');\n        DECLARE c_threads CURSOR FOR SELECT THREAD_ID, INSTRUMENTED FROM tmp_threads;\n        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n        SET v_done = FALSE;\n        OPEN c_threads;\n        c_threads_loop: LOOP\n            FETCH c_threads INTO v_thread_id, v_instrumented;\n            IF v_done THEN\n               LEAVE c_threads_loop;\n            END IF;\n            UPDATE performance_schema.threads\n               SET INSTRUMENTED = v_instrumented\n             WHERE THREAD_ID = v_thread_id;\n        END LOOP;\n        CLOSE c_threads;\n    END;\n    UPDATE performance_schema.threads\n       SET INSTRUMENTED = IF(PROCESSLIST_USER IS NOT NULL,\n                             sys.ps_is_account_enabled(PROCESSLIST_HOST, PROCESSLIST_USER),\n                             \'YES\')\n     WHERE THREAD_ID NOT IN (SELECT THREAD_ID FROM tmp_threads);\n    DROP TEMPORARY TABLE tmp_setup_actors;\n    DROP TEMPORARY TABLE tmp_setup_consumers;\n    DROP TEMPORARY TABLE tmp_setup_instruments;\n    DROP TEMPORARY TABLE tmp_threads;\n    SELECT RELEASE_LOCK(\'sys.ps_setup_save\') INTO v_lock_result;\n    SET sql_log_bin = @log_bin;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Reloads a saved Performance Schema configuration,\n             so that you can alter the setup for debugging purposes,\n             but restore it to a previous state.\n             Use the companion procedure - ps_setup_save(), to\n             save a configuration.\n             Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n             Parameters\n             None.\n             Example\n             mysql> CALL sys.ps_setup_save();\n             Query OK, 0 rows affected (0.08 sec)\n             mysql> UPDATE performance_schema.setup_instruments SET enabled = \'YES\', timed = \'YES\';\n             Query OK, 547 rows affected (0.40 sec)\n             Rows matched: 784  Changed: 547  Warnings: 0\n             /* Run some tests that need more detailed instrumentation here */\n             mysql> CALL sys.ps_setup_reload_saved();\n             Query OK, 0 rows affected (0.32 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_done bool DEFAULT FALSE;\n    DECLARE v_lock_result INT;\n    DECLARE v_lock_used_by BIGINT;\n    DECLARE v_signal_message TEXT;\n    DECLARE EXIT HANDLER FOR SQLEXCEPTION\n    BEGIN\n        SIGNAL SQLSTATE VALUE \'90001\'\n           SET MESSAGE_TEXT = \'An error occurred, was sys.ps_setup_save() run before this procedure?\';\n    END;\n    SET @log_bin := @@sql_log_bin;\n    SET sql_log_bin = 0;\n    SELECT IS_USED_LOCK(\'sys.ps_setup_save\') INTO v_lock_used_by;\n    IF (v_lock_used_by != CONNECTION_ID()) THEN\n        SET v_signal_message = CONCAT(\'The sys.ps_setup_save lock is currently owned by \', v_lock_used_by);\n        SIGNAL SQLSTATE VALUE \'90002\'\n           SET MESSAGE_TEXT = v_signal_message;\n    END IF;\n    DELETE FROM performance_schema.setup_actors;\n    INSERT INTO performance_schema.setup_actors SELECT * FROM tmp_setup_actors;\n    BEGIN\n        DECLARE v_name varchar(64);\n        DECLARE v_enabled enum(\'YES\', \'NO\');\n        DECLARE c_consumers CURSOR FOR SELECT NAME, ENABLED FROM tmp_setup_consumers;\n        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n        SET v_done = FALSE;\n        OPEN c_consumers;\n        c_consumers_loop: LOOP\n            FETCH c_consumers INTO v_name, v_enabled;\n            IF v_done THEN\n               LEAVE c_consumers_loop;\n            END IF;\n            UPDATE performance_schema.setup_consumers\n               SET ENABLED = v_enabled\n             WHERE NAME = v_name;\n         END LOOP;\n         CLOSE c_consumers;\n    END;\n    UPDATE performance_schema.setup_instruments\n     INNER JOIN tmp_setup_instruments USING (NAME)\n       SET performance_schema.setup_instruments.ENABLED = tmp_setup_instruments.ENABLED,\n           performance_schema.setup_instruments.TIMED   = tmp_setup_instruments.TIMED;\n    BEGIN\n        DECLARE v_thread_id bigint unsigned;\n        DECLARE v_instrumented enum(\'YES\', \'NO\');\n        DECLARE c_threads CURSOR FOR SELECT THREAD_ID, INSTRUMENTED FROM tmp_threads;\n        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n        SET v_done = FALSE;\n        OPEN c_threads;\n        c_threads_loop: LOOP\n            FETCH c_threads INTO v_thread_id, v_instrumented;\n            IF v_done THEN\n               LEAVE c_threads_loop;\n            END IF;\n            UPDATE performance_schema.threads\n               SET INSTRUMENTED = v_instrumented\n             WHERE THREAD_ID = v_thread_id;\n        END LOOP;\n        CLOSE c_threads;\n    END;\n    UPDATE performance_schema.threads\n       SET INSTRUMENTED = IF(PROCESSLIST_USER IS NOT NULL,\n                             sys.ps_is_account_enabled(PROCESSLIST_HOST, PROCESSLIST_USER),\n                             \'YES\')\n     WHERE THREAD_ID NOT IN (SELECT THREAD_ID FROM tmp_threads);\n    DROP TEMPORARY TABLE tmp_setup_actors;\n    DROP TEMPORARY TABLE tmp_setup_consumers;\n    DROP TEMPORARY TABLE tmp_setup_instruments;\n    DROP TEMPORARY TABLE tmp_threads;\n    SELECT RELEASE_LOCK(\'sys.ps_setup_save\') INTO v_lock_result;\n    SET sql_log_bin = @log_bin;\nEND','NONE'),
('sys','ps_setup_show_disabled','PROCEDURE','ps_setup_show_disabled','SQL','READS_SQL_DATA','NO','INVOKER','\n        IN in_show_instruments BOOLEAN,\n        IN in_show_threads BOOLEAN\n    ','','BEGIN\n    SELECT @@performance_schema AS performance_schema_enabled;\n    \n    SELECT object_type,\n           CONCAT(object_schema, \'.\', object_name) AS objects,\n           enabled,\n           timed\n      FROM performance_schema.setup_objects\n     WHERE enabled = \'NO\'\n     ORDER BY object_type, objects;\n    SELECT name AS disabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_consumers;\n    IF (in_show_threads) THEN\n        SELECT IF(name = \'thread/sql/one_connection\',\n                  CONCAT(processlist_user, \'@\', processlist_host),\n                  REPLACE(name, \'thread/\', \'\')) AS disabled_threads,\n        TYPE AS thread_type\n          FROM performance_schema.threads\n         WHERE INSTRUMENTED = \'NO\'\n         ORDER BY disabled_threads;\n    END IF;\n    IF (in_show_instruments) THEN\n        SELECT name AS disabled_instruments,\n               timed\n          FROM performance_schema.setup_instruments\n         WHERE enabled = \'NO\'\n         ORDER BY disabled_instruments;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently disable Performance Schema configuration.\n             Disabled users is only available for MySQL 5.7.6 and later.\n             In earlier versions it was only possible to enable users.\n             Parameters\n             in_show_instruments (BOOLEAN):\n               Whether to print disabled instruments (can print many items)\n             in_show_threads (BOOLEAN):\n               Whether to print disabled threads\n             Example\n             mysql> CALL sys.ps_setup_show_disabled(TRUE, TRUE);\n             +----------------------------+\n             | performance_schema_enabled |\n             +----------------------------+\n             |                          1 |\n             +----------------------------+\n             1 row in set (0.00 sec)\n             +--------------------+\n             | disabled_users     |\n             +--------------------+\n             | \'mark\'@\'localhost\' |\n             +--------------------+\n             1 row in set (0.00 sec)\n             +-------------+----------------------+---------+-------+\n             | object_type | objects              | enabled | timed |\n             +-------------+----------------------+---------+-------+\n             | EVENT       | mysql.%              | NO      | NO    |\n             | EVENT       | performance_schema.% | NO      | NO    |\n             | EVENT       | information_schema.% | NO      | NO    |\n             | FUNCTION    | mysql.%              | NO      | NO    |\n             | FUNCTION    | performance_schema.% | NO      | NO    |\n             | FUNCTION    | information_schema.% | NO      | NO    |\n             | PROCEDURE   | mysql.%              | NO      | NO    |\n             | PROCEDURE   | performance_schema.% | NO      | NO    |\n             | PROCEDURE   | information_schema.% | NO      | NO    |\n             | TABLE       | mysql.%              | NO      | NO    |\n             | TABLE       | performance_schema.% | NO      | NO    |\n             | TABLE       | information_schema.% | NO      | NO    |\n             | TRIGGER     | mysql.%              | NO      | NO    |\n             | TRIGGER     | performance_schema.% | NO      | NO    |\n             | TRIGGER     | information_schema.% | NO      | NO    |\n             +-------------+----------------------+---------+-------+\n             15 rows in set (0.00 sec)\n             +----------------------------------+\n             | disabled_consumers               |\n             +----------------------------------+\n             | events_stages_current            |\n             | events_stages_history            |\n             | events_stages_history_long       |\n             | events_statements_history        |\n             | events_statements_history_long   |\n             | events_transactions_history      |\n             | events_transactions_history_long |\n             | events_waits_current             |\n             | events_waits_history             |\n             | events_waits_history_long        |\n             +----------------------------------+\n             10 rows in set (0.00 sec)\n             Empty set (0.00 sec)\n             +---------------------------------------------------------------------------------------+-------+\n             | disabled_instruments                                                                  | timed |\n             +---------------------------------------------------------------------------------------+-------+\n             | wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_tc                                             | NO    |\n             | wait/synch/mutex/sql/LOCK_des_key_file                                                | NO    |\n             | wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_commit                                       | NO    |\n             ...\n             | memory/sql/servers_cache                                                              | NO    |\n             | memory/sql/udf_mem                                                                    | NO    |\n             | wait/lock/metadata/sql/mdl                                                            | NO    |\n             +---------------------------------------------------------------------------------------+-------+\n             547 rows in set (0.00 sec)\n             Query OK, 0 rows affected (0.01 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT @@performance_schema AS performance_schema_enabled;\n    \n    SELECT object_type,\n           CONCAT(object_schema, \'.\', object_name) AS objects,\n           enabled,\n           timed\n      FROM performance_schema.setup_objects\n     WHERE enabled = \'NO\'\n     ORDER BY object_type, objects;\n    SELECT name AS disabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_consumers;\n    IF (in_show_threads) THEN\n        SELECT IF(name = \'thread/sql/one_connection\',\n                  CONCAT(processlist_user, \'@\', processlist_host),\n                  REPLACE(name, \'thread/\', \'\')) AS disabled_threads,\n        TYPE AS thread_type\n          FROM performance_schema.threads\n         WHERE INSTRUMENTED = \'NO\'\n         ORDER BY disabled_threads;\n    END IF;\n    IF (in_show_instruments) THEN\n        SELECT name AS disabled_instruments,\n               timed\n          FROM performance_schema.setup_instruments\n         WHERE enabled = \'NO\'\n         ORDER BY disabled_instruments;\n    END IF;\nEND','NONE'),
('sys','ps_setup_show_disabled_consumers','PROCEDURE','ps_setup_show_disabled_consumers','SQL','READS_SQL_DATA','YES','INVOKER','','','BEGIN\n    SELECT name AS disabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_consumers;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently disabled consumers.\n             Parameters\n             None\n             Example\n             mysql> CALL sys.ps_setup_show_disabled_consumers();\n             +---------------------------+\n             | disabled_consumers        |\n             +---------------------------+\n             | events_statements_current |\n             | global_instrumentation    |\n             | thread_instrumentation    |\n             | statements_digest         |\n             +---------------------------+\n             4 rows in set (0.05 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT name AS disabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'NO\'\n     ORDER BY disabled_consumers;\nEND','NONE'),
('sys','ps_setup_show_enabled_consumers','PROCEDURE','ps_setup_show_enabled_consumers','SQL','READS_SQL_DATA','YES','INVOKER','','','BEGIN\n    SELECT name AS enabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_consumers;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently enabled consumers.\n             Parameters\n             None\n             Example\n             mysql> CALL sys.ps_setup_show_enabled_consumers();\n             +---------------------------+\n             | enabled_consumers         |\n             +---------------------------+\n             | events_statements_current |\n             | global_instrumentation    |\n             | thread_instrumentation    |\n             | statements_digest         |\n             +---------------------------+\n             4 rows in set (0.05 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT name AS enabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_consumers;\nEND','NONE'),
('sys','ps_truncate_all_tables','PROCEDURE','ps_truncate_all_tables','SQL','MODIFIES_SQL_DATA','YES','INVOKER','\n        IN in_verbose BOOLEAN\n    ','','BEGIN\n    DECLARE v_done INT DEFAULT FALSE;\n    DECLARE v_total_tables INT DEFAULT 0;\n    DECLARE v_ps_table VARCHAR(64);\n    DECLARE ps_tables CURSOR FOR\n        SELECT table_name\n          FROM INFORMATION_SCHEMA.TABLES\n         WHERE table_schema = \'performance_schema\'\n           AND (table_name LIKE \'%summary%\'\n            OR table_name LIKE \'%history%\');\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    OPEN ps_tables;\n    ps_tables_loop: LOOP\n        FETCH ps_tables INTO v_ps_table;\n        IF v_done THEN\n          LEAVE ps_tables_loop;\n        END IF;\n        SET @truncate_stmt := CONCAT(\'TRUNCATE TABLE performance_schema.\', v_ps_table);\n        IF in_verbose THEN\n            SELECT CONCAT(\'Running: \', @truncate_stmt) AS status;\n        END IF;\n        PREPARE truncate_stmt FROM @truncate_stmt;\n        EXECUTE truncate_stmt;\n        DEALLOCATE PREPARE truncate_stmt;\n        SET v_total_tables = v_total_tables + 1;\n    END LOOP;\n    CLOSE ps_tables;\n    SELECT CONCAT(\'Truncated \', v_total_tables, \' tables\') AS summary;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Truncates all summary tables within Performance Schema,\n             resetting all aggregated instrumentation as a snapshot.\n             Parameters\n             in_verbose (BOOLEAN):\n               Whether to print each TRUNCATE statement before running\n             Example\n             mysql> CALL sys.ps_truncate_all_tables(false);\n             +---------------------+\n             | summary             |\n             +---------------------+\n             | Truncated 44 tables |\n             +---------------------+\n             1 row in set (0.10 sec)\n             Query OK, 0 rows affected (0.10 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    DECLARE v_done INT DEFAULT FALSE;\n    DECLARE v_total_tables INT DEFAULT 0;\n    DECLARE v_ps_table VARCHAR(64);\n    DECLARE ps_tables CURSOR FOR\n        SELECT table_name\n          FROM INFORMATION_SCHEMA.TABLES\n         WHERE table_schema = \'performance_schema\'\n           AND (table_name LIKE \'%summary%\'\n            OR table_name LIKE \'%history%\');\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;\n    OPEN ps_tables;\n    ps_tables_loop: LOOP\n        FETCH ps_tables INTO v_ps_table;\n        IF v_done THEN\n          LEAVE ps_tables_loop;\n        END IF;\n        SET @truncate_stmt := CONCAT(\'TRUNCATE TABLE performance_schema.\', v_ps_table);\n        IF in_verbose THEN\n            SELECT CONCAT(\'Running: \', @truncate_stmt) AS status;\n        END IF;\n        PREPARE truncate_stmt FROM @truncate_stmt;\n        EXECUTE truncate_stmt;\n        DEALLOCATE PREPARE truncate_stmt;\n        SET v_total_tables = v_total_tables + 1;\n    END LOOP;\n    CLOSE ps_tables;\n    SELECT CONCAT(\'Truncated \', v_total_tables, \' tables\') AS summary;\nEND','NONE'),
('sys','ps_setup_show_enabled','PROCEDURE','ps_setup_show_enabled','SQL','READS_SQL_DATA','YES','INVOKER','\n        IN in_show_instruments BOOLEAN,\n        IN in_show_threads BOOLEAN\n    ','','BEGIN\n    SELECT @@performance_schema AS performance_schema_enabled;\n    SELECT CONCAT(\'\\\'\', user, \'\\\'@\\\'\', host, \'\\\'\') AS enabled_users\n      FROM performance_schema.setup_actors\n      WHERE enabled = \'YES\'\n     ORDER BY enabled_users;\n    SELECT object_type,\n           CONCAT(object_schema, \'.\', object_name) AS objects,\n           enabled,\n           timed\n      FROM performance_schema.setup_objects\n     WHERE enabled = \'YES\'\n     ORDER BY object_type, objects;\n    SELECT name AS enabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_consumers;\n    IF (in_show_threads) THEN\n        SELECT IF(name = \'thread/sql/one_connection\',\n                  CONCAT(processlist_user, \'@\', processlist_host),\n                  REPLACE(name, \'thread/\', \'\')) AS enabled_threads,\n        TYPE AS thread_type\n          FROM performance_schema.threads\n         WHERE INSTRUMENTED = \'YES\' AND name <> \'thread/innodb/thread_pool_thread\'\n         ORDER BY enabled_threads;\n    END IF;\n    IF (in_show_instruments) THEN\n        SELECT name AS enabled_instruments,\n               timed\n          FROM performance_schema.setup_instruments\n         WHERE enabled = \'YES\'\n         ORDER BY enabled_instruments;\n    END IF;\nEND','mariadb.sys@localhost','2025-05-30 08:20:07','2025-05-30 08:20:07','','\n             Description\n             Shows all currently enabled Performance Schema configuration.\n             Parameters\n             in_show_instruments (BOOLEAN):\n               Whether to print enabled instruments (can print many items)\n             in_show_threads (BOOLEAN):\n               Whether to print enabled threads\n             Example\n             mysql> CALL sys.ps_setup_show_enabled(TRUE, TRUE);\n             +----------------------------+\n             | performance_schema_enabled |\n             +----------------------------+\n             |                          1 |\n             +----------------------------+\n             1 row in set (0.00 sec)\n             +---------------+\n             | enabled_users |\n             +---------------+\n             | \'%\'@\'%\'       |\n             +---------------+\n             1 row in set (0.01 sec)\n             +-------------+---------+---------+-------+\n             | object_type | objects | enabled | timed |\n             +-------------+---------+---------+-------+\n             | EVENT       | %.%     | YES     | YES   |\n             | FUNCTION    | %.%     | YES     | YES   |\n             | PROCEDURE   | %.%     | YES     | YES   |\n             | TABLE       | %.%     | YES     | YES   |\n             | TRIGGER     | %.%     | YES     | YES   |\n             +-------------+---------+---------+-------+\n             5 rows in set (0.01 sec)\n             +---------------------------+\n             | enabled_consumers         |\n             +---------------------------+\n             | events_statements_current |\n             | global_instrumentation    |\n             | thread_instrumentation    |\n             | statements_digest         |\n             +---------------------------+\n             4 rows in set (0.05 sec)\n             +---------------------------------+-------------+\n             | enabled_threads                 | thread_type |\n             +---------------------------------+-------------+\n             | sql/main                        | BACKGROUND  |\n             | sql/thread_timer_notifier       | BACKGROUND  |\n             | innodb/io_ibuf_thread           | BACKGROUND  |\n             | innodb/io_log_thread            | BACKGROUND  |\n             | innodb/io_read_thread           | BACKGROUND  |\n             | innodb/io_read_thread           | BACKGROUND  |\n             | innodb/io_write_thread          | BACKGROUND  |\n             | innodb/io_write_thread          | BACKGROUND  |\n             | innodb/page_cleaner_thread      | BACKGROUND  |\n             | innodb/srv_lock_timeout_thread  | BACKGROUND  |\n             | innodb/srv_error_monitor_thread | BACKGROUND  |\n             | innodb/srv_monitor_thread       | BACKGROUND  |\n             | innodb/srv_master_thread        | BACKGROUND  |\n             | innodb/srv_purge_thread         | BACKGROUND  |\n             | innodb/srv_worker_thread        | BACKGROUND  |\n             | innodb/srv_worker_thread        | BACKGROUND  |\n             | innodb/srv_worker_thread        | BACKGROUND  |\n             | innodb/buf_dump_thread          | BACKGROUND  |\n             | innodb/dict_stats_thread        | BACKGROUND  |\n             | sql/signal_handler              | BACKGROUND  |\n             | sql/compress_gtid_table         | FOREGROUND  |\n             | root@localhost                  | FOREGROUND  |\n             +---------------------------------+-------------+\n             22 rows in set (0.01 sec)\n             +-------------------------------------+-------+\n             | enabled_instruments                 | timed |\n             +-------------------------------------+-------+\n             | wait/io/file/sql/map                | YES   |\n             | wait/io/file/sql/binlog             | YES   |\n             ...\n             | statement/com/Error                 | YES   |\n             | statement/com/                      | YES   |\n             | idle                                | YES   |\n             +-------------------------------------+-------+\n             210 rows in set (0.08 sec)\n             Query OK, 0 rows affected (0.89 sec)\n            ','utf8mb3','utf8mb3_general_ci','utf8mb3_general_ci','BEGIN\n    SELECT @@performance_schema AS performance_schema_enabled;\n    SELECT CONCAT(\'\'\'\', user, \'\'\'@\'\'\', host, \'\'\'\') AS enabled_users\n      FROM performance_schema.setup_actors\n      WHERE enabled = \'YES\'\n     ORDER BY enabled_users;\n    SELECT object_type,\n           CONCAT(object_schema, \'.\', object_name) AS objects,\n           enabled,\n           timed\n      FROM performance_schema.setup_objects\n     WHERE enabled = \'YES\'\n     ORDER BY object_type, objects;\n    SELECT name AS enabled_consumers\n      FROM performance_schema.setup_consumers\n     WHERE enabled = \'YES\'\n     ORDER BY enabled_consumers;\n    IF (in_show_threads) THEN\n        SELECT IF(name = \'thread/sql/one_connection\',\n                  CONCAT(processlist_user, \'@\', processlist_host),\n                  REPLACE(name, \'thread/\', \'\')) AS enabled_threads,\n        TYPE AS thread_type\n          FROM performance_schema.threads\n         WHERE INSTRUMENTED = \'YES\' AND name <> \'thread/innodb/thread_pool_thread\'\n         ORDER BY enabled_threads;\n    END IF;\n    IF (in_show_instruments) THEN\n        SELECT name AS enabled_instruments,\n               timed\n          FROM performance_schema.setup_instruments\n         WHERE enabled = \'YES\'\n         ORDER BY enabled_instruments;\n    END IF;\nEND','NONE');
/*!40000 ALTER TABLE `proc` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `procs_priv`
--

DROP TABLE IF EXISTS `procs_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `procs_priv` (
  `Host` char(255) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
  `Grantor` varchar(384) NOT NULL DEFAULT '',
  `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Procedure privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `procs_priv`
--

LOCK TABLES `procs_priv` WRITE;
/*!40000 ALTER TABLE `procs_priv` DISABLE KEYS */;
/*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `proxies_priv`
--

DROP TABLE IF EXISTS `proxies_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `proxies_priv` (
  `Host` char(255) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Proxied_host` char(255) NOT NULL DEFAULT '',
  `Proxied_user` char(128) NOT NULL DEFAULT '',
  `With_grant` tinyint(1) NOT NULL DEFAULT 0,
  `Grantor` varchar(384) NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User proxy privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `proxies_priv`
--

LOCK TABLES `proxies_priv` WRITE;
/*!40000 ALTER TABLE `proxies_priv` DISABLE KEYS */;
INSERT INTO `proxies_priv` VALUES
('localhost','root','','',1,'','2025-05-30 08:20:06'),
('localhost','mysql','','',1,'','2025-05-30 08:20:06');
/*!40000 ALTER TABLE `proxies_priv` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `roles_mapping`
--

DROP TABLE IF EXISTS `roles_mapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `roles_mapping` (
  `Host` char(255) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Role` char(128) NOT NULL DEFAULT '',
  `Admin_option` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
  UNIQUE KEY `Host` (`Host`,`User`,`Role`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Granted roles';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `roles_mapping`
--

LOCK TABLES `roles_mapping` WRITE;
/*!40000 ALTER TABLE `roles_mapping` DISABLE KEYS */;
/*!40000 ALTER TABLE `roles_mapping` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `servers`
--

DROP TABLE IF EXISTS `servers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `servers` (
  `Server_name` char(64) NOT NULL DEFAULT '',
  `Host` varchar(2048) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `Username` char(128) NOT NULL DEFAULT '',
  `Password` char(64) NOT NULL DEFAULT '',
  `Port` int(4) NOT NULL DEFAULT 0,
  `Socket` char(108) NOT NULL DEFAULT '',
  `Wrapper` char(64) NOT NULL DEFAULT '',
  `Owner` varchar(512) NOT NULL DEFAULT '',
  PRIMARY KEY (`Server_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `servers`
--

LOCK TABLES `servers` WRITE;
/*!40000 ALTER TABLE `servers` DISABLE KEYS */;
/*!40000 ALTER TABLE `servers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `table_stats`
--

DROP TABLE IF EXISTS `table_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `table_stats` (
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `cardinality` bigint(21) unsigned DEFAULT NULL,
  PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Tables';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `table_stats`
--

LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tables_priv`
--

DROP TABLE IF EXISTS `tables_priv`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `tables_priv` (
  `Host` char(255) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `User` char(128) NOT NULL DEFAULT '',
  `Table_name` char(64) NOT NULL DEFAULT '',
  `Grantor` varchar(384) NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Table privileges';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tables_priv`
--

LOCK TABLES `tables_priv` WRITE;
/*!40000 ALTER TABLE `tables_priv` DISABLE KEYS */;
INSERT INTO `tables_priv` VALUES
('localhost','mysql','mariadb.sys','global_priv','root@localhost','0000-00-00 00:00:00','Select,Delete','');
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `time_zone`
--

DROP TABLE IF EXISTS `time_zone`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `time_zone` (
  `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Time_zone_id`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zones';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `time_zone`
--

LOCK TABLES `time_zone` WRITE;
/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */;
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `time_zone_leap_second`
--

DROP TABLE IF EXISTS `time_zone_leap_second`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `time_zone_leap_second` (
  `Transition_time` bigint(20) NOT NULL,
  `Correction` int(11) NOT NULL,
  PRIMARY KEY (`Transition_time`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Leap seconds information for time zones';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `time_zone_leap_second`
--

LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `time_zone_name`
--

DROP TABLE IF EXISTS `time_zone_name`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `time_zone_name` (
  `Name` char(64) NOT NULL,
  `Time_zone_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`Name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone names';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `time_zone_name`
--

LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `time_zone_transition`
--

DROP TABLE IF EXISTS `time_zone_transition`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `time_zone_transition` (
  `Time_zone_id` int(10) unsigned NOT NULL,
  `Transition_time` bigint(20) NOT NULL,
  `Transition_type_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`Time_zone_id`,`Transition_time`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone transitions';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `time_zone_transition`
--

LOCK TABLES `time_zone_transition` WRITE;
/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */;
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `time_zone_transition_type`
--

DROP TABLE IF EXISTS `time_zone_transition_type`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `time_zone_transition_type` (
  `Time_zone_id` int(10) unsigned NOT NULL,
  `Transition_type_id` int(10) unsigned NOT NULL,
  `Offset` int(11) NOT NULL DEFAULT 0,
  `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `Abbreviation` char(8) NOT NULL DEFAULT '',
  PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone transition types';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `time_zone_transition_type`
--

LOCK TABLES `time_zone_transition_type` WRITE;
/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */;
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `user`
--

DROP TABLE IF EXISTS `user`;
/*!50001 DROP VIEW IF EXISTS `user`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `user` AS SELECT
 1 AS `Host`,
  1 AS `User`,
  1 AS `Password`,
  1 AS `Select_priv`,
  1 AS `Insert_priv`,
  1 AS `Update_priv`,
  1 AS `Delete_priv`,
  1 AS `Create_priv`,
  1 AS `Drop_priv`,
  1 AS `Reload_priv`,
  1 AS `Shutdown_priv`,
  1 AS `Process_priv`,
  1 AS `File_priv`,
  1 AS `Grant_priv`,
  1 AS `References_priv`,
  1 AS `Index_priv`,
  1 AS `Alter_priv`,
  1 AS `Show_db_priv`,
  1 AS `Super_priv`,
  1 AS `Create_tmp_table_priv`,
  1 AS `Lock_tables_priv`,
  1 AS `Execute_priv`,
  1 AS `Repl_slave_priv`,
  1 AS `Repl_client_priv`,
  1 AS `Create_view_priv`,
  1 AS `Show_view_priv`,
  1 AS `Create_routine_priv`,
  1 AS `Alter_routine_priv`,
  1 AS `Create_user_priv`,
  1 AS `Event_priv`,
  1 AS `Trigger_priv`,
  1 AS `Create_tablespace_priv`,
  1 AS `Delete_history_priv`,
  1 AS `ssl_type`,
  1 AS `ssl_cipher`,
  1 AS `x509_issuer`,
  1 AS `x509_subject`,
  1 AS `max_questions`,
  1 AS `max_updates`,
  1 AS `max_connections`,
  1 AS `max_user_connections`,
  1 AS `plugin`,
  1 AS `authentication_string`,
  1 AS `password_expired`,
  1 AS `is_role`,
  1 AS `default_role`,
  1 AS `max_statement_time` */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `transaction_registry`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `transaction_registry` (
  `transaction_id` bigint(20) unsigned NOT NULL,
  `commit_id` bigint(20) unsigned NOT NULL,
  `begin_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
  `commit_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
  `isolation_level` enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') NOT NULL,
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `commit_id` (`commit_id`),
  KEY `begin_timestamp` (`begin_timestamp`),
  KEY `commit_timestamp` (`commit_timestamp`,`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Current Database: `nation`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `nation` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `nation`;

--
-- Table structure for table `continents`
--

DROP TABLE IF EXISTS `continents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `continents` (
  `continent_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`continent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `continents`
--

LOCK TABLES `continents` WRITE;
/*!40000 ALTER TABLE `continents` DISABLE KEYS */;
INSERT INTO `continents` VALUES
(1,'North America'),
(2,'Asia'),
(3,'Africa'),
(4,'Europe'),
(5,'South America'),
(6,'Oceania'),
(7,'Antarctica');
/*!40000 ALTER TABLE `continents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `countries`
--

DROP TABLE IF EXISTS `countries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `countries` (
  `country_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `area` decimal(10,2) NOT NULL,
  `national_day` date DEFAULT NULL,
  `country_code2` char(2) NOT NULL,
  `country_code3` char(3) NOT NULL,
  `region_id` int(11) NOT NULL,
  PRIMARY KEY (`country_id`),
  UNIQUE KEY `country_code2` (`country_code2`),
  UNIQUE KEY `country_code3` (`country_code3`),
  KEY `region_id` (`region_id`),
  CONSTRAINT `countries_ibfk_1` FOREIGN KEY (`region_id`) REFERENCES `regions` (`region_id`)
) ENGINE=InnoDB AUTO_INCREMENT=240 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `countries`
--

LOCK TABLES `countries` WRITE;
/*!40000 ALTER TABLE `countries` DISABLE KEYS */;
INSERT INTO `countries` VALUES
(1,'Aruba',193.00,NULL,'AW','ABW',1),
(2,'Afghanistan',652090.00,'1919-08-19','AF','AFG',2),
(3,'Angola',1246700.00,'1975-11-11','AO','AGO',3),
(4,'Anguilla',96.00,'1967-05-30','AI','AIA',1),
(5,'Albania',28748.00,'1912-11-28','AL','ALB',4),
(6,'Andorra',468.00,NULL,'AD','AND',4),
(7,'Netherlands Antilles',800.00,NULL,'AN','ANT',1),
(8,'United Arab Emirates',83600.00,'1971-12-02','AE','ARE',5),
(9,'Argentina',2780400.00,'1816-07-09','AR','ARG',6),
(10,'Armenia',29800.00,'1991-09-21','AM','ARM',5),
(11,'American Samoa',199.00,NULL,'AS','ASM',7),
(12,'Antarctica',13120000.00,NULL,'AQ','ATA',8),
(13,'French Southern territories',7780.00,NULL,'TF','ATF',8),
(14,'Antigua and Barbuda',442.00,'1981-11-01','AG','ATG',1),
(15,'Australia',7741220.00,NULL,'AU','AUS',9),
(16,'Austria',83859.00,'1955-10-26','AT','AUT',10),
(17,'Azerbaijan',86600.00,'1991-10-18','AZ','AZE',5),
(18,'Burundi',27834.00,'1962-07-01','BI','BDI',11),
(19,'Belgium',30518.00,'1831-07-21','BE','BEL',10),
(20,'Benin',112622.00,'1960-08-01','BJ','BEN',12),
(21,'Burkina Faso',274000.00,'1960-08-05','BF','BFA',12),
(22,'Bangladesh',143998.00,'1971-03-26','BD','BGD',2),
(23,'Bulgaria',110994.00,'1878-03-03','BG','BGR',13),
(24,'Bahrain',694.00,'1971-12-16','BH','BHR',5),
(25,'Bahamas',13878.00,NULL,'BS','BHS',1),
(26,'Bosnia and Herzegovina',51197.00,'1992-03-01','BA','BIH',4),
(27,'Belarus',207600.00,'1944-07-03','BY','BLR',13),
(28,'Belize',22696.00,'1981-09-21','BZ','BLZ',14),
(29,'Bermuda',53.00,NULL,'BM','BMU',15),
(30,'Bolivia',1098581.00,'1825-08-06','BO','BOL',6),
(31,'Brazil',8547403.00,'1822-09-07','BR','BRA',6),
(32,'Barbados',430.00,'1966-11-30','BB','BRB',1),
(33,'Brunei',5765.00,'1984-01-01','BN','BRN',16),
(34,'Bhutan',47000.00,NULL,'BT','BTN',2),
(35,'Bouvet Island',59.00,NULL,'BV','BVT',8),
(36,'Botswana',581730.00,'1966-09-30','BW','BWA',17),
(37,'Central African Republic',622984.00,'1960-08-13','CF','CAF',3),
(38,'Canada',9970610.00,'1867-07-01','CA','CAN',15),
(39,'Cocos (Keeling) Islands',14.00,NULL,'CC','CCK',9),
(40,'Switzerland',41284.00,'1291-08-01','CH','CHE',10),
(41,'Chile',756626.00,'1810-09-18','CL','CHL',6),
(42,'China',9572900.00,NULL,'CN','CHN',18),
(43,'Côte d’Ivoire',322463.00,NULL,'CI','CIV',12),
(44,'Cameroon',475442.00,'1960-01-01','CM','CMR',3),
(45,'The Democratic Republic of the Congo',2344858.00,NULL,'CD','COD',3),
(46,'Congo',342000.00,NULL,'CG','COG',3),
(47,'Cook Islands',236.00,NULL,'CK','COK',7),
(48,'Colombia',1138914.00,NULL,'CO','COL',6),
(49,'Comoros',1862.00,'1975-07-06','KM','COM',11),
(50,'Cape Verde',4033.00,'1975-07-05','CV','CPV',12),
(51,'Costa Rica',51100.00,'1821-09-15','CR','CRI',14),
(52,'Cuba',110861.00,'1868-10-10','CU','CUB',1),
(53,'Christmas Island',135.00,NULL,'CX','CXR',9),
(54,'Cayman Islands',264.00,NULL,'KY','CYM',1),
(55,'Cyprus',9251.00,'1960-10-01','CY','CYP',5),
(56,'Czech Republic',78866.00,'1918-10-28','CZ','CZE',13),
(57,'Germany',357022.00,NULL,'DE','DEU',10),
(58,'Djibouti',23200.00,'1977-06-27','DJ','DJI',11),
(59,'Dominica',751.00,'1978-11-03','DM','DMA',1),
(60,'Denmark',43094.00,NULL,'DK','DNK',19),
(61,'Dominican Republic',48511.00,NULL,'DO','DOM',1),
(62,'Algeria',2381741.00,'1962-07-05','DZ','DZA',20),
(63,'Ecuador',283561.00,'1809-08-10','EC','ECU',6),
(64,'Egypt',1001449.00,NULL,'EG','EGY',20),
(65,'Eritrea',117600.00,'1993-05-24','ER','ERI',11),
(66,'Western Sahara',266000.00,NULL,'EH','ESH',20),
(67,'Spain',505992.00,NULL,'ES','ESP',4),
(68,'Estonia',45227.00,'1918-02-24','EE','EST',21),
(69,'Ethiopia',1104300.00,NULL,'ET','ETH',11),
(70,'Finland',338145.00,'1917-12-06','FI','FIN',19),
(71,'Fiji Islands',18274.00,NULL,'FJ','FJI',22),
(72,'Falkland Islands',12173.00,NULL,'FK','FLK',6),
(73,'France',551500.00,'1789-07-14','FR','FRA',10),
(74,'Faroe Islands',1399.00,NULL,'FO','FRO',19),
(75,'Federated States of Micronesia',702.00,NULL,'FM','FSM',23),
(76,'Gabon',267668.00,'1960-08-17','GA','GAB',3),
(77,'United Kingdom',242900.00,NULL,'GB','GBR',24),
(78,'Georgia',69700.00,'1918-05-26','GE','GEO',5),
(79,'Ghana',238533.00,'1957-03-06','GH','GHA',12),
(80,'Gibraltar',6.00,NULL,'GI','GIB',4),
(81,'Guinea',245857.00,'1958-10-02','GN','GIN',12),
(82,'Guadeloupe',1705.00,NULL,'GP','GLP',1),
(83,'Gambia',11295.00,NULL,'GM','GMB',12),
(84,'Guinea-Bissau',36125.00,'1973-09-24','GW','GNB',12),
(85,'Equatorial Guinea',28051.00,'1968-10-12','GQ','GNQ',3),
(86,'Greece',131626.00,'1821-03-25','GR','GRC',4),
(87,'Grenada',344.00,'1974-02-07','GD','GRD',1),
(88,'Greenland',2166090.00,NULL,'GL','GRL',15),
(89,'Guatemala',108889.00,'1821-09-15','GT','GTM',14),
(90,'French Guiana',90000.00,NULL,'GF','GUF',6),
(91,'Guam',549.00,NULL,'GU','GUM',23),
(92,'Guyana',214969.00,'1966-05-26','GY','GUY',6),
(93,'Hong Kong',1075.00,'1997-07-01','HK','HKG',18),
(94,'Heard Island and McDonald Islands',359.00,NULL,'HM','HMD',8),
(95,'Honduras',112088.00,'1821-09-15','HN','HND',14),
(96,'Croatia',56538.00,'1991-10-08','HR','HRV',4),
(97,'Haiti',27750.00,'1804-01-01','HT','HTI',1),
(98,'Hungary',93030.00,'1989-10-23','HU','HUN',13),
(99,'Indonesia',1904569.00,'1945-08-17','ID','IDN',16),
(100,'India',3287263.00,'1947-08-15','IN','IND',2),
(101,'British Indian Ocean Territory',78.00,NULL,'IO','IOT',11),
(102,'Ireland',70273.00,'1916-04-24','IE','IRL',24),
(103,'Iran',1648195.00,'1979-04-01','IR','IRN',2),
(104,'Iraq',438317.00,'1932-10-03','IQ','IRQ',5),
(105,'Iceland',103000.00,'1944-06-17','IS','ISL',19),
(106,'Israel',21056.00,'1948-01-00','IL','ISR',5),
(107,'Italy',301316.00,NULL,'IT','ITA',4),
(108,'Jamaica',10990.00,'1962-08-06','JM','JAM',1),
(109,'Jordan',88946.00,'1946-05-25','JO','JOR',5),
(110,'Japan',377829.00,NULL,'JP','JPN',18),
(111,'Kazakstan',2724900.00,NULL,'KZ','KAZ',2),
(112,'Kenya',580367.00,'1963-12-12','KE','KEN',11),
(113,'Kyrgyzstan',199900.00,'1991-08-31','KG','KGZ',2),
(114,'Cambodia',181035.00,'1953-11-09','KH','KHM',16),
(115,'Kiribati',726.00,'1979-07-12','KI','KIR',23),
(116,'Saint Kitts and Nevis',261.00,'1983-09-19','KN','KNA',1),
(117,'South Korea',99434.00,NULL,'KR','KOR',18),
(118,'Kuwait',17818.00,'1961-02-25','KW','KWT',5),
(119,'Laos',236800.00,'1953-10-22','LA','LAO',16),
(120,'Lebanon',10400.00,'1943-11-22','LB','LBN',5),
(121,'Liberia',111369.00,'1847-07-26','LR','LBR',12),
(122,'Libyan Arab Jamahiriya',1759540.00,NULL,'LY','LBY',20),
(123,'Saint Lucia',622.00,'1979-02-22','LC','LCA',1),
(124,'Liechtenstein',160.00,NULL,'LI','LIE',10),
(125,'Sri Lanka',65610.00,'1948-02-04','LK','LKA',2),
(126,'Lesotho',30355.00,'1966-10-04','LS','LSO',17),
(127,'Lithuania',65301.00,'1918-02-16','LT','LTU',21),
(128,'Luxembourg',2586.00,NULL,'LU','LUX',10),
(129,'Latvia',64589.00,'1918-11-18','LV','LVA',21),
(130,'Macao',18.00,'1999-12-20','MO','MAC',18),
(131,'Morocco',446550.00,'1956-11-18','MA','MAR',20),
(132,'Monaco',1.50,NULL,'MC','MCO',10),
(133,'Moldova',33851.00,'1991-08-27','MD','MDA',13),
(134,'Madagascar',587041.00,'1960-06-26','MG','MDG',11),
(135,'Maldives',298.00,'1965-07-26','MV','MDV',2),
(136,'Mexico',1958201.00,'1810-09-16','MX','MEX',14),
(137,'Marshall Islands',181.00,NULL,'MH','MHL',23),
(138,'Macedonia',25713.00,NULL,'MK','MKD',4),
(139,'Mali',1240192.00,'1960-09-22','ML','MLI',12),
(140,'Malta',316.00,'1964-09-21','MT','MLT',4),
(141,'Myanmar',676578.00,'1948-01-04','MM','MMR',16),
(142,'Mongolia',1566500.00,'1911-12-29','MN','MNG',18),
(143,'Northern Mariana Islands',464.00,NULL,'MP','MNP',23),
(144,'Mozambique',801590.00,'1975-06-25','MZ','MOZ',11),
(145,'Mauritania',1025520.00,'1960-11-28','MR','MRT',12),
(146,'Montserrat',102.00,NULL,'MS','MSR',1),
(147,'Martinique',1102.00,NULL,'MQ','MTQ',1),
(148,'Mauritius',2040.00,'1968-03-12','MU','MUS',11),
(149,'Malawi',118484.00,'1964-07-06','MW','MWI',11),
(150,'Malaysia',329758.00,'1957-08-31','MY','MYS',16),
(151,'Mayotte',373.00,NULL,'YT','MYT',11),
(152,'Namibia',824292.00,'1990-03-21','NA','NAM',17),
(153,'New Caledonia',18575.00,NULL,'NC','NCL',22),
(154,'Niger',1267000.00,'1960-08-03','NE','NER',12),
(155,'Norfolk Island',36.00,NULL,'NF','NFK',9),
(156,'Nigeria',923768.00,'1960-10-01','NG','NGA',12),
(157,'Nicaragua',130000.00,'1821-09-15','NI','NIC',14),
(158,'Niue',260.00,NULL,'NU','NIU',7),
(159,'Netherlands',41526.00,NULL,'NL','NLD',10),
(160,'Norway',323877.00,'1814-05-17','NO','NOR',19),
(161,'Nepal',147181.00,NULL,'NP','NPL',2),
(162,'Nauru',21.00,'1968-01-31','NR','NRU',23),
(163,'New Zealand',270534.00,NULL,'NZ','NZL',9),
(164,'Oman',309500.00,'1650-11-18','OM','OMN',5),
(165,'Pakistan',796095.00,'1947-08-14','PK','PAK',2),
(166,'Panama',75517.00,'1821-11-28','PA','PAN',14),
(167,'Pitcairn',49.00,NULL,'PN','PCN',7),
(168,'Peru',1285216.00,'1821-07-28','PE','PER',6),
(169,'Philippines',300000.00,'1898-06-12','PH','PHL',16),
(170,'Palau',459.00,NULL,'PW','PLW',23),
(171,'Papua New Guinea',462840.00,'1975-09-16','PG','PNG',22),
(172,'Poland',323250.00,'1918-11-11','PL','POL',13),
(173,'Puerto Rico',8875.00,NULL,'PR','PRI',1),
(174,'North Korea',120538.00,NULL,'KP','PRK',18),
(175,'Portugal',91982.00,'1640-12-01','PT','PRT',4),
(176,'Paraguay',406752.00,'1811-05-15','PY','PRY',6),
(177,'Palestine',6257.00,'1988-11-15','PS','PSE',5),
(178,'French Polynesia',4000.00,NULL,'PF','PYF',7),
(179,'Qatar',11000.00,'1971-12-18','QA','QAT',5),
(180,'Réunion',2510.00,NULL,'RE','REU',11),
(181,'Romania',238391.00,'1877-05-09','RO','ROM',13),
(182,'Russian Federation',17075400.00,NULL,'RU','RUS',13),
(183,'Rwanda',26338.00,'1962-07-01','RW','RWA',11),
(184,'Saudi Arabia',2149690.00,NULL,'SA','SAU',5),
(185,'Sudan',2505813.00,'1956-01-01','SD','SDN',20),
(186,'Senegal',196722.00,'1960-04-04','SN','SEN',12),
(187,'Singapore',618.00,'1965-08-09','SG','SGP',16),
(188,'South Georgia and the South Sandwich Islands',3903.00,NULL,'GS','SGS',8),
(189,'Saint Helena',314.00,NULL,'SH','SHN',12),
(190,'Svalbard and Jan Mayen',62422.00,NULL,'SJ','SJM',19),
(191,'Solomon Islands',28896.00,'1978-07-07','SB','SLB',22),
(192,'Sierra Leone',71740.00,'1961-04-27','SL','SLE',12),
(193,'El Salvador',21041.00,'1821-09-15','SV','SLV',14),
(194,'San Marino',61.00,NULL,'SM','SMR',4),
(195,'Somalia',637657.00,'1960-07-01','SO','SOM',11),
(196,'Saint Pierre and Miquelon',242.00,NULL,'PM','SPM',15),
(197,'Sao Tome and Principe',964.00,NULL,'ST','STP',3),
(198,'Suriname',163265.00,'1975-11-25','SR','SUR',6),
(199,'Slovakia',49012.00,'1992-07-17','SK','SVK',13),
(200,'Slovenia',20256.00,'1991-01-00','SI','SVN',4),
(201,'Sweden',449964.00,'1523-06-06','SE','SWE',19),
(202,'Swaziland',17364.00,NULL,'SZ','SWZ',17),
(203,'Seychelles',455.00,'1976-06-29','SC','SYC',11),
(204,'Syria',185180.00,'1946-04-17','SY','SYR',5),
(205,'Turks and Caicos Islands',430.00,NULL,'TC','TCA',1),
(206,'Chad',1284000.00,'1960-08-11','TD','TCD',3),
(207,'Togo',56785.00,'1960-04-27','TG','TGO',12),
(208,'Thailand',513115.00,NULL,'TH','THA',16),
(209,'Tajikistan',143100.00,'1991-09-09','TJ','TJK',2),
(210,'Tokelau',12.00,NULL,'TK','TKL',7),
(211,'Turkmenistan',488100.00,'1991-09-27','TM','TKM',2),
(212,'East Timor',14874.00,'2002-05-20','TP','TMP',16),
(213,'Tonga',650.00,'1970-06-04','TO','TON',7),
(214,'Trinidad and Tobago',5130.00,'1962-08-31','TT','TTO',1),
(215,'Tunisia',163610.00,'1956-03-20','TN','TUN',20),
(216,'Turkey',774815.00,NULL,'TR','TUR',5),
(217,'Tuvalu',26.00,'1978-10-01','TV','TUV',7),
(218,'Taiwan',36188.00,'1911-10-10','TW','TWN',18),
(219,'Tanzania',883749.00,'1961-12-09','TZ','TZA',11),
(220,'Uganda',241038.00,'1962-10-09','UG','UGA',11),
(221,'Ukraine',603700.00,'1991-08-24','UA','UKR',13),
(222,'United States Minor Outlying Islands',16.00,NULL,'UM','UMI',25),
(223,'Uruguay',175016.00,'1825-08-25','UY','URY',6),
(224,'United States',9363520.00,'1776-07-04','US','USA',15),
(225,'Uzbekistan',447400.00,'1991-09-01','UZ','UZB',2),
(226,'Holy See (Vatican City State)',0.40,NULL,'VA','VAT',4),
(227,'Saint Vincent and the Grenadines',388.00,'1979-10-27','VC','VCT',1),
(228,'Venezuela',912050.00,'1811-07-05','VE','VEN',6),
(229,'Virgin Islands, British',151.00,NULL,'VG','VGB',1),
(230,'Virgin Islands, U.S.',347.00,NULL,'VI','VIR',1),
(231,'Vietnam',331689.00,'1945-09-02','VN','VNM',16),
(232,'Vanuatu',12189.00,'1980-07-30','VU','VUT',22),
(233,'Wallis and Futuna',200.00,NULL,'WF','WLF',7),
(234,'Samoa',2831.00,'1962-01-01','WS','WSM',7),
(235,'Yemen',527968.00,'1967-11-30','YE','YEM',5),
(236,'Yugoslavia',102173.00,NULL,'YU','YUG',4),
(237,'South Africa',1221037.00,'1931-12-11','ZA','ZAF',17),
(238,'Zambia',752618.00,'1964-10-24','ZM','ZMB',11),
(239,'Zimbabwe',390757.00,'1980-04-18','ZW','ZWE',11);
/*!40000 ALTER TABLE `countries` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `country_languages`
--

DROP TABLE IF EXISTS `country_languages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `country_languages` (
  `country_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `official` tinyint(1) NOT NULL,
  PRIMARY KEY (`country_id`,`language_id`),
  KEY `language_id` (`language_id`),
  CONSTRAINT `country_languages_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`country_id`),
  CONSTRAINT `country_languages_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`language_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `country_languages`
--

LOCK TABLES `country_languages` WRITE;
/*!40000 ALTER TABLE `country_languages` DISABLE KEYS */;
INSERT INTO `country_languages` VALUES
(1,1,1),
(1,2,0),
(1,3,0),
(1,4,0),
(2,5,0),
(2,6,1),
(2,7,1),
(2,8,0),
(2,9,0),
(3,10,0),
(3,11,0),
(3,12,0),
(3,13,0),
(3,14,0),
(3,15,0),
(3,16,0),
(3,17,0),
(3,18,0),
(4,2,1),
(5,19,1),
(5,20,0),
(5,21,0),
(6,4,0),
(6,22,1),
(6,23,0),
(6,24,0),
(7,1,1),
(7,2,0),
(7,3,1),
(8,25,1),
(8,26,0),
(9,4,1),
(9,27,0),
(9,28,0),
(10,29,1),
(10,30,0),
(11,2,1),
(11,31,1),
(11,32,0),
(14,2,1),
(14,33,0),
(15,2,1),
(15,20,0),
(15,25,0),
(15,28,0),
(15,34,0),
(15,35,0),
(15,36,0),
(15,37,0),
(16,35,1),
(16,36,0),
(16,38,0),
(16,39,0),
(16,40,0),
(16,41,0),
(16,42,0),
(16,43,0),
(17,29,0),
(17,30,1),
(17,44,0),
(17,45,0),
(18,23,1),
(18,46,1),
(18,47,0),
(19,1,1),
(19,23,1),
(19,25,0),
(19,28,0),
(19,35,1),
(19,43,0),
(20,48,0),
(20,49,0),
(20,50,0),
(20,51,0),
(20,52,0),
(20,53,0),
(20,54,0),
(21,52,0),
(21,55,0),
(21,56,0),
(21,57,0),
(21,58,0),
(21,59,0),
(22,60,1),
(22,61,0),
(22,62,0),
(22,63,0),
(22,64,0),
(22,65,0),
(22,66,0),
(23,21,0),
(23,43,0),
(23,67,1),
(23,68,0),
(24,2,0),
(24,25,1),
(25,33,0),
(25,69,0),
(26,36,1),
(27,40,0),
(27,45,1),
(27,70,1),
(27,71,0),
(28,2,1),
(28,4,0),
(28,72,0),
(28,73,0),
(29,2,1),
(30,4,1),
(30,74,1),
(30,75,0),
(30,76,1),
(31,24,1),
(31,27,0),
(31,28,0),
(31,35,0),
(31,77,0),
(32,2,1),
(32,78,0),
(33,2,0),
(33,79,0),
(33,80,1),
(33,81,0),
(34,82,0),
(34,83,1),
(34,84,0),
(36,85,0),
(36,86,0),
(36,87,0),
(36,88,0),
(36,89,0),
(37,90,0),
(37,91,0),
(37,92,0),
(37,93,0),
(37,94,0),
(37,95,0),
(38,1,0),
(38,2,1),
(38,4,0),
(38,23,1),
(38,24,0),
(38,28,0),
(38,35,0),
(38,40,0),
(38,71,0),
(38,79,0),
(38,96,0),
(38,97,0),
(39,2,1),
(39,80,0),
(40,23,1),
(40,28,1),
(40,35,1),
(40,98,1),
(41,4,1),
(41,74,0),
(41,99,0),
(41,100,0),
(42,79,1),
(42,101,0),
(42,102,0),
(42,103,0),
(42,104,0),
(42,105,0),
(42,106,0),
(42,107,0),
(42,108,0),
(42,109,0),
(42,110,0),
(42,111,0),
(43,112,0),
(43,113,0),
(43,114,0),
(43,115,0),
(43,116,0),
(44,52,0),
(44,117,0),
(44,118,0),
(44,119,0),
(44,120,0),
(44,121,0),
(44,122,0),
(44,123,0),
(45,11,0),
(45,12,0),
(45,124,0),
(45,125,0),
(45,126,0),
(45,127,0),
(45,128,0),
(45,129,0),
(45,130,0),
(45,131,0),
(46,12,0),
(46,130,0),
(46,132,0),
(46,133,0),
(46,134,0),
(46,135,0),
(47,2,0),
(47,136,1),
(48,4,1),
(48,33,0),
(48,137,0),
(48,138,0),
(48,139,0),
(49,140,1),
(49,141,0),
(49,142,0),
(49,143,0),
(49,144,0),
(50,24,1),
(50,145,0),
(51,4,1),
(51,33,0),
(51,79,0),
(51,139,0),
(52,4,1),
(53,2,1),
(53,79,0),
(54,2,1),
(55,20,1),
(55,43,1),
(56,35,0),
(56,38,1),
(56,39,0),
(56,40,0),
(56,68,0),
(56,146,0),
(56,147,0),
(56,148,0),
(57,20,0),
(57,28,0),
(57,35,1),
(57,40,0),
(57,43,0),
(57,149,0),
(58,25,1),
(58,150,0),
(58,151,0),
(59,33,0),
(59,69,0),
(60,2,0),
(60,25,0),
(60,35,0),
(60,43,0),
(60,152,1),
(60,153,0),
(60,154,0),
(61,4,1),
(61,69,0),
(62,25,1),
(62,155,0),
(63,4,1),
(63,76,0),
(64,25,1),
(64,156,0),
(65,150,0),
(65,157,0),
(65,158,0),
(65,159,0),
(65,160,0),
(65,161,1),
(66,25,1),
(67,4,1),
(67,22,0),
(67,162,0),
(67,163,0),
(68,45,0),
(68,70,0),
(68,71,0),
(68,164,1),
(68,165,0),
(69,151,0),
(69,161,0),
(69,166,0),
(69,167,0),
(69,168,0),
(69,169,0),
(69,170,0),
(70,45,0),
(70,154,1),
(70,164,0),
(70,165,1),
(70,171,0),
(71,26,0),
(71,172,1),
(72,2,1),
(73,4,0),
(73,23,1),
(73,24,0),
(73,25,0),
(73,28,0),
(73,43,0),
(74,152,1),
(74,173,1),
(75,174,0),
(75,175,0),
(75,176,0),
(75,177,0),
(75,178,0),
(75,179,0),
(76,119,0),
(76,132,0),
(76,180,0),
(76,181,0),
(77,2,1),
(77,182,0),
(77,183,0),
(78,29,0),
(78,30,0),
(78,45,0),
(78,184,0),
(78,185,1),
(78,186,0),
(79,53,0),
(79,58,0),
(79,59,0),
(79,112,0),
(79,187,0),
(79,188,0),
(80,2,1),
(80,25,0),
(81,52,0),
(81,115,0),
(81,189,0),
(81,190,0),
(81,191,0),
(81,192,0),
(81,193,0),
(82,23,1),
(82,69,0),
(83,52,0),
(83,115,0),
(83,194,0),
(83,195,0),
(83,196,0),
(84,24,1),
(84,52,0),
(84,115,0),
(84,145,0),
(84,197,0),
(84,198,0),
(85,119,0),
(85,199,0),
(86,20,1),
(86,43,0),
(87,33,0),
(88,152,1),
(88,200,1),
(89,4,1),
(89,201,0),
(89,202,0),
(89,203,0),
(89,204,0),
(90,27,0),
(90,69,0),
(91,2,1),
(91,77,0),
(91,205,1),
(91,206,0),
(91,207,0),
(92,33,0),
(92,137,0),
(92,138,0),
(93,2,1),
(93,34,0),
(93,208,0),
(93,209,0),
(93,210,0),
(95,4,1),
(95,33,0),
(95,72,0),
(95,211,0),
(96,36,1),
(96,42,0),
(97,23,1),
(97,212,0),
(98,35,0),
(98,36,0),
(98,39,1),
(98,41,0),
(98,68,0),
(98,148,0),
(99,80,1),
(99,213,0),
(99,214,0),
(99,215,0),
(99,216,0),
(99,217,0),
(99,218,0),
(99,219,0),
(99,220,0),
(100,26,1),
(100,60,0),
(100,82,0),
(100,97,0),
(100,221,0),
(100,222,0),
(100,223,0),
(100,224,0),
(100,225,0),
(100,226,0),
(100,227,0),
(100,228,0),
(102,2,1),
(102,229,1),
(103,5,0),
(103,8,0),
(103,25,0),
(103,30,0),
(103,230,0),
(103,231,0),
(103,232,0),
(103,233,0),
(103,234,0),
(103,235,1),
(104,25,1),
(104,30,0),
(104,232,0),
(104,235,0),
(104,236,0),
(105,2,0),
(105,237,1),
(106,25,1),
(106,45,0),
(106,238,1),
(107,19,0),
(107,23,0),
(107,28,1),
(107,35,0),
(107,42,0),
(107,68,0),
(107,239,0),
(107,240,0),
(108,26,0),
(108,33,0),
(109,25,1),
(109,29,0),
(109,241,0),
(110,2,0),
(110,77,1),
(110,79,0),
(110,206,0),
(110,207,0),
(110,242,0),
(111,9,0),
(111,35,0),
(111,45,0),
(111,71,0),
(111,243,1),
(111,244,0),
(112,245,0),
(112,246,0),
(112,247,0),
(112,248,0),
(112,249,0),
(112,250,0),
(112,251,0),
(112,252,0),
(112,253,0),
(112,254,0),
(113,9,0),
(113,45,1),
(113,71,0),
(113,243,0),
(113,244,0),
(113,255,1),
(113,256,0),
(114,37,0),
(114,79,0),
(114,257,1),
(114,258,0),
(115,259,1),
(115,260,0),
(116,2,1),
(116,33,0),
(117,79,0),
(117,206,1),
(118,2,0),
(118,25,1),
(119,261,1),
(119,262,0),
(119,263,0),
(119,264,0),
(120,23,0),
(120,25,1),
(120,29,0),
(121,114,0),
(121,115,0),
(121,190,0),
(121,191,0),
(121,265,0),
(121,266,0),
(121,267,0),
(121,268,0),
(122,25,1),
(122,155,0),
(123,2,1),
(123,69,0),
(124,28,0),
(124,35,1),
(124,43,0),
(125,226,1),
(125,269,0),
(125,270,1),
(126,2,1),
(126,271,1),
(126,272,0),
(127,40,0),
(127,45,0),
(127,70,0),
(127,71,0),
(127,273,1),
(128,23,1),
(128,24,0),
(128,28,0),
(128,35,1),
(128,274,1),
(129,40,0),
(129,45,0),
(129,70,0),
(129,71,0),
(129,273,0),
(129,275,1),
(130,2,0),
(130,24,1),
(130,34,0),
(130,276,0),
(131,25,1),
(131,155,0),
(132,2,0),
(132,23,1),
(132,28,0),
(132,277,0),
(133,41,1),
(133,45,0),
(133,67,0),
(133,71,0),
(133,278,0),
(134,23,1),
(134,279,1),
(135,2,0),
(135,280,1),
(136,4,1),
(136,281,0),
(136,282,0),
(136,283,0),
(136,284,0),
(136,285,0),
(137,2,1),
(137,286,1),
(138,19,0),
(138,21,1),
(138,36,0),
(138,43,0),
(138,68,0),
(139,52,0),
(139,195,0),
(139,287,0),
(139,288,0),
(139,289,0),
(139,290,0),
(140,2,1),
(140,291,1),
(141,292,1),
(141,293,0),
(141,294,0),
(141,295,0),
(141,296,0),
(141,297,0),
(141,298,0),
(141,299,0),
(142,105,1),
(142,243,0),
(142,300,0),
(142,301,0),
(142,302,0),
(142,303,0),
(143,2,1),
(143,79,0),
(143,205,0),
(143,206,0),
(143,207,0),
(143,304,0),
(144,88,0),
(144,305,0),
(144,306,0),
(144,307,0),
(144,308,0),
(144,309,0),
(144,310,0),
(144,311,0),
(144,312,0),
(144,313,0),
(145,52,0),
(145,195,0),
(145,196,0),
(145,314,0),
(145,315,0),
(145,316,0),
(146,2,1),
(147,23,1),
(147,69,0),
(148,23,0),
(148,26,0),
(148,69,0),
(148,224,0),
(148,226,0),
(148,317,0),
(149,306,0),
(149,318,1),
(149,319,0),
(149,320,0),
(150,2,0),
(150,79,0),
(150,80,1),
(150,226,0),
(150,321,0),
(150,322,0),
(151,23,1),
(151,279,0),
(151,323,0),
(152,35,0),
(152,87,0),
(152,324,0),
(152,325,0),
(152,326,0),
(152,327,0),
(152,328,0),
(152,329,0),
(153,23,1),
(153,330,0),
(153,331,0),
(154,52,0),
(154,290,0),
(154,332,0),
(154,333,0),
(154,334,0),
(155,2,1),
(156,52,0),
(156,53,0),
(156,332,0),
(156,333,0),
(156,335,0),
(156,336,0),
(156,337,0),
(156,338,0),
(156,339,0),
(156,340,0),
(157,4,1),
(157,33,0),
(157,211,0),
(157,341,0),
(158,2,1),
(158,342,0),
(159,1,1),
(159,25,0),
(159,43,0),
(159,343,0),
(160,2,0),
(160,152,0),
(160,153,1),
(160,154,0),
(160,171,0),
(161,26,0),
(161,84,1),
(161,317,0),
(161,344,0),
(161,345,0),
(161,346,0),
(161,347,0),
(162,2,1),
(162,79,0),
(162,259,0),
(162,260,0),
(162,348,1),
(163,2,1),
(163,136,0),
(164,5,0),
(164,25,1),
(165,5,0),
(165,7,0),
(165,97,0),
(165,228,1),
(165,349,0),
(165,350,0),
(165,351,0),
(165,352,0),
(166,4,1),
(166,25,0),
(166,33,0),
(166,353,0),
(166,354,0),
(166,355,0),
(167,356,0),
(168,4,1),
(168,74,1),
(168,76,1),
(169,357,0),
(169,358,0),
(169,359,0),
(169,360,0),
(169,361,0),
(169,362,0),
(169,363,0),
(169,364,0),
(169,365,1),
(169,366,0),
(170,2,1),
(170,79,0),
(170,207,0),
(170,367,1),
(171,330,0),
(171,368,0),
(172,35,0),
(172,40,1),
(172,70,0),
(172,71,0),
(173,2,0),
(173,4,1),
(174,79,0),
(174,206,1),
(175,24,1),
(176,4,1),
(176,24,0),
(176,35,0),
(176,75,1),
(177,25,0),
(177,238,0),
(178,23,1),
(178,79,0),
(178,369,0),
(179,25,1),
(179,228,0),
(180,69,0),
(180,79,0),
(180,140,0),
(180,226,0),
(180,279,0),
(181,35,0),
(181,36,0),
(181,39,0),
(181,41,1),
(181,68,1),
(181,71,0),
(182,45,1),
(182,70,0),
(182,71,0),
(182,243,0),
(182,244,0),
(182,370,0),
(182,371,0),
(182,372,0),
(182,373,0),
(182,374,0),
(182,375,0),
(182,376,0),
(183,23,1),
(183,129,1),
(184,25,1),
(185,25,1),
(185,131,0),
(185,377,0),
(185,378,0),
(185,379,0),
(185,380,0),
(185,381,0),
(185,382,0),
(185,383,0),
(185,384,0),
(186,52,0),
(186,115,0),
(186,194,0),
(186,195,0),
(186,196,1),
(186,385,0),
(187,79,1),
(187,80,1),
(187,226,1),
(189,2,1),
(190,45,0),
(190,153,1),
(191,330,0),
(191,331,0),
(191,368,0),
(192,52,0),
(192,193,0),
(192,386,0),
(192,387,0),
(192,388,0),
(192,389,0),
(192,390,0),
(192,391,0),
(193,4,1),
(193,392,0),
(194,28,1),
(195,25,1),
(195,151,1),
(196,23,1),
(197,23,0),
(197,145,0),
(198,26,0),
(198,393,0),
(199,39,0),
(199,68,0),
(199,148,1),
(199,394,0),
(199,395,0),
(200,36,0),
(200,39,0),
(200,42,1),
(201,4,0),
(201,25,0),
(201,149,0),
(201,153,0),
(201,154,1),
(201,165,0),
(202,272,0),
(202,396,1),
(203,2,1),
(203,23,1),
(203,397,0),
(204,25,1),
(204,232,0),
(205,2,1),
(206,25,1),
(206,95,0),
(206,398,0),
(206,399,0),
(206,400,0),
(206,401,0),
(206,402,0),
(206,403,0),
(207,58,0),
(207,187,1),
(207,404,0),
(207,405,1),
(207,406,0),
(207,407,0),
(207,408,0),
(207,409,0),
(208,79,0),
(208,80,0),
(208,257,0),
(208,261,0),
(208,264,1),
(208,410,0),
(209,9,0),
(209,45,0),
(209,256,1),
(210,2,1),
(210,411,0),
(211,8,1),
(211,9,0),
(211,45,0),
(211,243,0),
(212,24,1),
(212,220,0),
(213,2,1),
(213,32,1),
(214,2,0),
(214,26,0),
(214,33,0),
(215,25,1),
(215,412,0),
(215,413,0),
(216,25,0),
(216,43,1),
(216,232,0),
(217,2,1),
(217,259,0),
(217,260,1),
(218,210,0),
(218,276,1),
(218,414,0),
(218,415,0),
(218,416,0),
(218,417,0),
(219,47,1),
(219,418,0),
(219,419,0),
(219,420,0),
(219,421,0),
(219,422,0),
(219,423,0),
(219,424,0),
(219,425,0),
(219,426,0),
(219,427,0),
(220,129,0),
(220,428,0),
(220,429,0),
(220,430,0),
(220,431,0),
(220,432,0),
(220,433,0),
(220,434,0),
(220,435,0),
(220,436,0),
(221,39,0),
(221,40,0),
(221,41,0),
(221,45,0),
(221,67,0),
(221,70,0),
(221,71,1),
(222,2,1),
(223,4,1),
(224,2,1),
(224,4,0),
(224,23,0),
(224,24,0),
(224,28,0),
(224,35,0),
(224,37,0),
(224,40,0),
(224,77,0),
(224,79,0),
(224,206,0),
(224,437,0),
(225,9,1),
(225,45,0),
(225,243,0),
(225,244,0),
(225,256,0),
(225,438,0),
(226,28,1),
(227,2,1),
(227,33,0),
(228,4,1),
(228,439,0),
(228,440,0),
(229,2,1),
(230,2,1),
(230,4,0),
(230,23,0),
(231,37,1),
(231,79,0),
(231,104,0),
(231,257,0),
(231,264,0),
(231,441,0),
(231,442,0),
(231,443,0),
(231,444,0),
(232,2,1),
(232,23,1),
(232,445,1),
(233,446,0),
(233,447,0),
(234,2,1),
(234,31,1),
(234,448,0),
(235,25,1),
(235,449,0),
(236,19,0),
(236,21,0),
(236,36,1),
(236,39,0),
(236,68,0),
(236,148,0),
(237,2,1),
(237,86,0),
(237,89,0),
(237,272,1),
(237,312,0),
(237,324,1),
(237,396,0),
(237,450,0),
(237,451,0),
(237,452,0),
(237,453,1),
(238,32,0),
(238,309,0),
(238,454,0),
(238,455,0),
(238,456,0),
(238,457,0),
(239,2,1),
(239,86,0),
(239,88,0),
(239,309,0);
/*!40000 ALTER TABLE `country_languages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `country_stats`
--

DROP TABLE IF EXISTS `country_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `country_stats` (
  `country_id` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `population` int(11) DEFAULT NULL,
  `gdp` decimal(15,0) DEFAULT NULL,
  PRIMARY KEY (`country_id`,`year`),
  CONSTRAINT `country_stats_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `countries` (`country_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `country_stats`
--

LOCK TABLES `country_stats` WRITE;
/*!40000 ALTER TABLE `country_stats` DISABLE KEYS */;
INSERT INTO `country_stats` VALUES
(1,1986,62644,405463417),
(1,1987,61833,487602457),
(1,1988,61079,596423607),
(1,1989,61032,695304363),
(1,1990,62149,764887117),
(1,1991,64622,872138730),
(1,1992,68235,958463200),
(1,1993,72504,1082979708),
(1,1994,76700,1245688253),
(1,1995,80324,1320474860),
(1,1996,83200,1379960894),
(1,1997,85451,1531944134),
(1,1998,87277,1665100559),
(1,1999,89005,1722798883),
(1,2000,90853,1873452514),
(1,2001,92898,1920111732),
(1,2002,94992,1941340782),
(1,2003,97017,2021229050),
(1,2004,98737,2228491620),
(1,2005,100031,2330726257),
(1,2006,100834,2424581006),
(1,2007,101222,2615083799),
(1,2008,101358,2745251397),
(1,2009,101455,2498882682),
(1,2010,101669,2390502793),
(1,2011,102046,2549720670),
(1,2012,102560,2534636872),
(1,2013,103159,2581564246),
(1,2014,103774,2649720670),
(1,2015,104341,2691620112),
(1,2016,104872,2646927374),
(1,2017,105366,2700558659),
(2,1960,8996973,537777811),
(2,1961,9169410,548888895),
(2,1962,9351441,546666677),
(2,1963,9543205,751111191),
(2,1964,9744781,800000044),
(2,1965,9956320,1006666638),
(2,1966,10174836,1399999967),
(2,1967,10399926,1673333418),
(2,1968,10637063,1373333367),
(2,1969,10893776,1408888922),
(2,1970,11173642,1748886596),
(2,1971,11475445,1831108971),
(2,1972,11791215,1595555476),
(2,1973,12108963,1733333264),
(2,1974,12412950,2155555498),
(2,1975,12689160,2366666616),
(2,1976,12943093,2555555567),
(2,1977,13171306,2953333418),
(2,1978,13341198,3300000109),
(2,1979,13411056,3697940410),
(2,1980,13356511,3641723322),
(2,1981,13171673,3478787909),
(2,2002,22600770,4055176933),
(2,2003,23680871,4515563414),
(2,2004,24726684,5226775163),
(2,2005,25654277,6209140044),
(2,2006,26433049,6971286732),
(2,2007,27100536,9747886105),
(2,2008,27722276,10109218068),
(2,2009,28394813,12439087077),
(2,2010,29185507,15856574731),
(2,2011,30117413,17804280538),
(2,2012,31161376,20001615789),
(2,2013,32269589,20561054090),
(2,2014,33370794,20484873230),
(2,2015,34413603,19907111419),
(2,2016,35383128,19362642267),
(2,2017,36296400,20191764940),
(2,2018,37172386,19362969582),
(3,1980,8341289,5930503401),
(3,1981,8640446,5550483036),
(3,1982,8952950,5550483036),
(3,1983,9278096,5784341596),
(3,1984,9614754,6131475065),
(3,1985,9961997,7553560459),
(3,1986,10320111,7072063345),
(3,1987,10689250,8083872012),
(3,1988,11068050,8769250550),
(3,1989,11454777,10201099040),
(3,1990,11848386,11228764963),
(3,1991,12248901,10603784541),
(3,1992,12657366,8307810974),
(3,1993,13075049,5768720422),
(3,1994,13503747,4438321017),
(3,1995,13945206,5538749260),
(3,1996,14400719,7526446606),
(3,1997,14871570,7648377413),
(3,1998,15359601,6506229607),
(3,1999,15866869,6152922943),
(3,2000,16395473,9129594819),
(3,2001,16945753,8936063723),
(3,2002,17519417,15285594828),
(3,2003,18121479,17812705294),
(3,2004,18758145,23552052408),
(3,2005,19433602,36970918699),
(3,2006,20149901,52381006892),
(3,2007,20905363,65266452081),
(3,2008,21695634,88538611205),
(3,2009,22514281,70307163678),
(3,2010,23356246,83799496611),
(3,2011,24220661,111790000000),
(3,2012,25107931,128053000000),
(3,2013,26015780,136710000000),
(3,2014,26941779,145712000000),
(3,2015,27884381,116194000000),
(3,2016,28842484,101124000000),
(3,2017,29816748,122124000000),
(3,2018,30809762,105751000000),
(5,1984,2904429,1857338012),
(5,1985,2964762,1897050133),
(5,1986,3022635,2097326250),
(5,1987,3083605,2080796250),
(5,1988,3142336,2051236250),
(5,1989,3227943,2253090000),
(5,1990,3286542,2028553750),
(5,1991,3266790,1099559028),
(5,1992,3247039,652174990),
(5,1993,3227287,1185315468),
(5,1994,3207536,1880951520),
(5,1995,3187784,2392764853),
(5,1996,3168033,3199642580),
(5,1997,3148281,2258515610),
(5,1998,3128530,2545967253),
(5,1999,3108778,3212119044),
(5,2000,3089027,3480355189),
(5,2001,3060173,3922099471),
(5,2002,3051010,4348070165),
(5,2003,3039616,5611492283),
(5,2004,3026939,7184681399),
(5,2005,3011487,8052075642),
(5,2006,2992547,8896073938),
(5,2007,2970017,10677321490),
(5,2008,2947314,12881353508),
(5,2009,2927519,12044208086),
(5,2010,2913021,11926953214),
(5,2011,2905195,12890866743),
(5,2012,2900401,12319784886),
(5,2013,2895092,12776280961),
(5,2014,2889104,13228247844),
(5,2015,2880703,11386931490),
(5,2016,2876101,11861352705),
(5,2017,2873457,13025062196),
(5,2018,2866376,15058879129),
(6,1970,24276,78619206),
(6,1971,25559,89409820),
(6,1972,26892,113408231),
(6,1973,28232,150820102),
(6,1974,29520,186558696),
(6,1975,30705,220127246),
(6,1976,31777,227281024),
(6,1977,32771,254020153),
(6,1978,33737,308008897),
(6,1979,34818,411578334),
(6,1980,36067,446416105),
(6,1981,37500,388958731),
(6,1982,39114,375895956),
(6,1983,40867,327861832),
(6,1984,42706,330070689),
(6,1985,44600,346737964),
(6,1986,46517,482000594),
(6,1987,48455,611316399),
(6,1988,50434,721425939),
(6,1989,52448,795449332),
(6,1990,54509,1029048482),
(6,1991,56671,1106928583),
(6,1992,58888,1210013652),
(6,1993,60971,1007025755),
(6,1994,62677,1017549124),
(6,1995,63850,1178738991),
(6,1996,64360,1223945357),
(6,1997,64327,1180597273),
(6,1998,64142,1211932398),
(6,1999,64370,1239876305),
(6,2000,65390,1434429703),
(6,2001,67341,1496912752),
(6,2002,70049,1733116883),
(6,2003,73182,2398645598),
(6,2004,76244,2935659300),
(6,2005,78867,3255789081),
(6,2006,80993,3543256806),
(6,2007,82684,4016972351),
(6,2008,83862,4007353157),
(6,2009,84463,3660530703),
(6,2010,84449,3355695364),
(6,2011,83747,3442062830),
(6,2012,82427,3164615187),
(6,2013,80774,3281585236),
(6,2014,79213,3350736367),
(6,2015,78011,2811489409),
(6,2016,77297,2877311947),
(6,2017,77001,3013387424),
(6,2018,77006,3236543909),
(8,1975,548301,14720672507),
(8,1976,637922,19213022691),
(8,1977,735344,24871775165),
(8,1978,835508,23775831783),
(8,1979,931749,31225463218),
(8,1980,1019509,43598748449),
(8,1981,1096610,49333424135),
(8,1982,1164806,46622718605),
(8,1983,1228459,42803323345),
(8,1984,1293971,41807954236),
(8,1985,1366164,40603650232),
(8,1986,1446380,33943612095),
(8,1987,1533536,36384908744),
(8,1988,1627066,36275674203),
(8,1989,1725681,41464995914),
(8,1990,1828432,50701443748),
(8,1991,1937153,51552165622),
(8,1992,2052891,54239171888),
(8,1993,2173139,55625170253),
(8,1994,2294385,59305093980),
(8,1995,2415090,65743666576),
(8,1996,2539126,73571233996),
(8,1997,2671362,78839008445),
(8,1998,2813214,75674336283),
(8,1999,2966034,84445473111),
(8,2000,3134062,104337000000),
(8,2001,3302719,103312000000),
(8,2002,3478777,109816000000),
(8,2003,3711932,124346000000),
(8,2004,4068570,147824000000),
(8,2005,4588225,180617000000),
(8,2006,5300174,222117000000),
(8,2007,6168838,257916000000),
(8,2008,7089487,315475000000),
(8,2009,7917372,253547000000),
(8,2010,8549988,289787000000),
(8,2011,8946777,350666000000),
(8,2012,9141596,374591000000),
(8,2013,9197910,390108000000),
(8,2014,9214175,403137000000),
(8,2015,9262900,358135000000),
(8,2016,9360980,357045000000),
(8,2017,9487203,382575000000),
(8,2018,9630959,414179000000),
(9,1962,21153052,24450604878),
(9,1963,21488912,18272123664),
(9,1964,21824425,25605249382),
(9,1965,22159650,28344705967),
(9,1966,22494035,28630474728),
(9,1967,22828869,24256667553),
(9,1968,23168267,26436857247),
(9,1969,23517611,31256284544),
(9,1970,23880561,31584210366),
(9,1971,24259561,33293199095),
(9,1972,24653175,34733000536),
(9,1973,25056478,52544000117),
(9,1974,25462302,72436777342),
(9,1975,25865776,52438647922),
(9,1976,26264681,51169499891),
(9,1977,26661398,56781000101),
(9,1978,27061047,58082870156),
(9,1979,27471036,69252328953),
(9,1980,27896528,76961923742),
(9,1981,28338515,78676842366),
(9,1982,28794548,84307486837),
(9,1983,29262047,103979000000),
(9,1984,29737093,79092001998),
(9,1985,30216279,88416668900),
(9,1986,30698964,110934000000),
(9,1987,31184415,111106000000),
(9,1988,31668949,126207000000),
(9,1989,32148134,76636898036),
(9,1990,32618651,141352000000),
(9,1991,33079000,189720000000),
(9,1992,33529326,228789000000),
(9,1993,33970111,236742000000),
(9,1994,34402672,257440000000),
(9,1995,34828170,258032000000),
(9,1996,35246374,272150000000),
(9,1997,35657429,292859000000),
(9,1998,36063459,298948000000),
(9,1999,36467218,283523000000),
(9,2000,36870787,284204000000),
(9,2001,37275652,268697000000),
(9,2002,37681749,97724004252),
(9,2003,38087868,127587000000),
(9,2004,38491972,164658000000),
(9,2005,38892931,198737000000),
(9,2006,39289878,232557000000),
(9,2007,39684295,287531000000),
(9,2008,40080160,361558000000),
(9,2009,40482788,332976000000),
(9,2010,40788453,423627000000),
(9,2011,41261490,530163000000),
(9,2012,41733271,545982000000),
(9,2013,42202935,552025000000),
(9,2014,42669500,526320000000),
(9,2015,43131966,594749000000),
(9,2016,43590368,557531000000),
(9,2017,44044811,642696000000),
(9,2018,44494502,518475000000),
(10,1990,3538171,2256838858),
(10,1991,3505258,2068526522),
(10,1992,3442817,1272577456),
(10,1993,3363108,1201313201),
(10,1994,3283667,1315158670),
(10,1995,3217348,1468317350),
(10,1996,3168221,1596968913),
(10,1997,3133089,1639492424),
(10,1998,3108687,1893726437),
(10,1999,3089022,1845482181),
(10,2000,3069591,1911563665),
(10,2001,3050687,2118467913),
(10,2002,3033978,2376335048),
(10,2003,3017932,2807061009),
(10,2004,3000720,3576615240),
(10,2005,2981269,4900469950),
(10,2006,2958307,6384451606),
(10,2007,2932618,9206301700),
(10,2008,2907618,11662040714),
(10,2009,2888092,8647936748),
(10,2010,2877319,9260284938),
(10,2011,2876538,10142111334),
(10,2012,2884229,10619320049),
(10,2013,2897584,11121465767),
(10,2014,2912403,11609512940),
(10,2015,2925553,10553337673),
(10,2016,2936146,10546135160),
(10,2017,2944809,11527458566),
(10,2018,2951776,12433089919),
(11,2002,59080,514000000),
(11,2003,59504,527000000),
(11,2004,59681,512000000),
(11,2005,59562,503000000),
(11,2006,59107,496000000),
(11,2007,58365,520000000),
(11,2008,57492,563000000),
(11,2009,56683,678000000),
(11,2010,56079,576000000),
(11,2011,55759,574000000),
(11,2012,55667,644000000),
(11,2013,55713,641000000),
(11,2014,55791,643000000),
(11,2015,55812,661000000),
(11,2016,55741,653000000),
(11,2017,55620,634000000),
(14,1977,62159,77496753),
(14,1978,62036,87879341),
(14,1979,61952,109079978),
(14,1980,61865,131431026),
(14,1981,61800,147841734),
(14,1982,61779,164369278),
(14,1983,61787,182144093),
(14,1984,61786,208372846),
(14,1985,61786,240923924),
(14,1986,61754,290440140),
(14,1987,61717,337174861),
(14,1988,61771,398637727),
(14,1989,62008,438794788),
(14,1990,62528,459469058),
(14,1991,63367,481706333),
(14,1992,64471,499281148),
(14,1993,65777,535172777),
(14,1994,67204,589429592),
(14,1995,68670,577280740),
(14,1996,70173,633730629),
(14,1997,71704,680617111),
(14,1998,73224,727860592),
(14,1999,74674,766198925),
(14,2000,76016,830158777),
(14,2001,77212,800740259),
(14,2002,78295,814615333),
(14,2003,79300,855643111),
(14,2004,80336,919577148),
(14,2005,81465,1022191296),
(14,2006,82704,1157005444),
(14,2007,84026,1311401333),
(14,2008,85397,1368431037),
(14,2009,86746,1224253000),
(14,2010,88028,1152469074),
(14,2011,89253,1142042926),
(14,2012,90409,1211411704),
(14,2013,91516,1192919630),
(14,2014,92562,1275576778),
(14,2015,93566,1359194741),
(14,2016,94527,1464630213),
(14,2017,95426,1510084751),
(14,2018,96286,1623804016),
(15,1960,10276477,18577668272),
(15,1961,10483000,19653936611),
(15,1962,10742000,19892485161),
(15,1963,10950000,21507447643),
(15,1964,11167000,23764139321),
(15,1965,11388000,25937954978),
(15,1966,11651000,27268451114),
(15,1967,11799000,30397580916),
(15,1968,12009000,32665472057),
(15,1969,12263000,36628961810),
(15,1970,12507000,41271138985),
(15,1971,12937000,45149512823),
(15,1972,13177000,51967289720),
(15,1973,13380000,63738629084),
(15,1974,13723000,88831245394),
(15,1975,13893000,97171924075),
(15,1976,14033000,104921000000),
(15,1977,14192000,110202000000),
(15,1978,14358000,118340000000),
(15,1979,14514000,134712000000),
(15,1980,14692000,149776000000),
(15,1981,14927000,176643000000),
(15,1982,15178000,193771000000),
(15,1983,15369000,177030000000),
(15,1984,15544000,193242000000),
(15,1985,15758000,180235000000),
(15,1986,16018400,182038000000),
(15,1987,16263900,189059000000),
(15,1988,16532200,235661000000),
(15,1989,16814400,299264000000),
(15,1990,17065100,310775000000),
(15,1991,17284000,325306000000),
(15,1992,17495000,324873000000),
(15,1993,17667000,311539000000),
(15,1994,17855000,322209000000),
(15,1995,18072000,367216000000),
(15,1996,18311000,400303000000),
(15,1997,18517000,434568000000),
(15,1998,18711000,398899000000),
(15,1999,18926000,388608000000),
(15,2000,19153000,415223000000),
(15,2001,19413000,378376000000),
(15,2002,19651400,394649000000),
(15,2003,19895400,466488000000),
(15,2004,20127400,612490000000),
(15,2005,20394800,693408000000),
(15,2006,20697900,746054000000),
(15,2007,20827600,853100000000),
(15,2008,21249200,1054000000000),
(15,2009,21691700,927805000000),
(15,2010,22031750,1146140000000),
(15,2011,22340024,1396650000000),
(15,2012,22733465,1546150000000),
(15,2013,23128129,1576180000000),
(15,2014,23475686,1467480000000),
(15,2015,23815995,1351520000000),
(15,2016,24190907,1210030000000),
(15,2017,24601860,1330800000000),
(15,2018,24992369,1432200000000),
(16,1960,7047539,6592693841),
(16,1961,7086299,7311749633),
(16,1962,7129864,7756110210),
(16,1963,7175811,8374175258),
(16,1964,7223801,9169983886),
(16,1965,7270889,9994070616),
(16,1966,7322066,10887682273),
(16,1967,7376998,11579431669),
(16,1968,7415403,12440625313),
(16,1969,7441055,13582798556),
(16,1970,7467086,15373005769),
(16,1971,7500482,17858485957),
(16,1972,7544201,22059612417),
(16,1973,7586115,29515467988),
(16,1974,7599038,35189299985),
(16,1975,7578903,40059206763),
(16,1976,7565525,42959976068),
(16,1977,7568430,51545759221),
(16,1978,7562305,62052258694),
(16,1979,7549425,73937296655),
(16,1980,7549433,82058912465),
(16,1981,7568710,71034228097),
(16,1982,7574140,71275287328),
(16,1983,7561910,72121016623),
(16,1984,7561434,67985345162),
(16,1985,7564985,69386774475),
(16,1986,7569794,99036165210),
(16,1987,7574586,124168000000),
(16,1988,7585317,133339000000),
(16,1989,7619567,133106000000),
(16,1990,7677850,166463000000),
(16,1991,7754891,173794000000),
(16,1992,7840709,195078000000),
(16,1993,7905633,190380000000),
(16,1994,7936118,203535000000),
(16,1995,7948278,241038000000),
(16,1996,7959017,237251000000),
(16,1997,7968041,212790000000),
(16,1998,7976789,218260000000),
(16,1999,7992324,217186000000),
(16,2000,8011566,196800000000),
(16,2001,8042293,197338000000),
(16,2002,8081957,213378000000),
(16,2003,8121423,261696000000),
(16,2004,8171966,300904000000),
(16,2005,8227829,315974000000),
(16,2006,8268641,335999000000),
(16,2007,8295487,388691000000),
(16,2008,8321496,430294000000),
(16,2009,8343323,400172000000),
(16,2010,8363404,391893000000),
(16,2011,8391643,431120000000),
(16,2012,8429991,409425000000),
(16,2013,8479823,430069000000),
(16,2014,8546356,441996000000),
(16,2015,8642699,381806000000),
(16,2016,8736668,394053000000),
(16,2017,8797566,416836000000),
(16,2018,8847037,455737000000),
(17,1990,7159000,8858006036),
(17,1991,7271000,8792365811),
(17,1992,7382000,4991350458),
(17,1993,7495000,3970953396),
(17,1994,7597000,3313939554),
(17,1995,7685000,3052467522),
(17,1996,7763000,3176703092),
(17,1997,7838250,3962735257),
(17,1998,7913000,4446370371),
(17,1999,7982750,4581246713),
(17,2000,8048600,5272617196),
(17,2001,8111200,5707720391),
(17,2002,8171950,6235856820),
(17,2003,8234100,7276013032),
(17,2004,8306500,8680370408),
(17,2005,8391850,13245716099),
(17,2006,8484550,20982986344),
(17,2007,8581300,33050343783),
(17,2008,8763400,48852482960),
(17,2009,8947243,44291490421),
(17,2010,9054332,52902703376),
(17,2011,9173082,65951627200),
(17,2012,9295784,69683935845),
(17,2013,9416801,74164435946),
(17,2014,9535079,75244294275),
(17,2015,9649341,53074468085),
(17,2016,9757812,37867518957),
(17,2017,9854033,40865558912),
(17,2018,9942334,46939529412),
(18,1960,2797932,195999990),
(18,1961,2852438,202999992),
(18,1962,2907321,213500006),
(18,1963,2964427,232749998),
(18,1964,3026290,260750008),
(18,1965,3094379,158994963),
(18,1966,3170490,165444571),
(18,1967,3253218,178297142),
(18,1968,3336927,183200000),
(18,1969,3413904,190205714),
(18,1970,3479074,242732571),
(18,1971,3529997,252842285),
(18,1972,3569666,246804571),
(18,1973,3605126,304339839),
(18,1974,3646431,345263492),
(18,1975,3700880,420986666),
(18,1976,3770871,448412753),
(18,1977,3854445,547535555),
(18,1978,3949266,610225555),
(18,1979,4051234,782496666),
(18,1980,4157298,919726666),
(18,1981,4266520,969046666),
(18,1982,4379724,1013222222),
(18,1983,4497533,1082926304),
(18,1984,4621103,987143931),
(18,1985,4750837,1149979286),
(18,1986,4886743,1201725497),
(18,1987,5027138,1131466494),
(18,1988,5168698,1082403219),
(18,1989,5307069,1113924130),
(18,1990,5438957,1132101253),
(18,1991,5564926,1167398478),
(18,1992,5685565,1083037671),
(18,1993,5798053,938632612),
(18,1994,5898967,925030590),
(18,1995,5987043,1000428394),
(18,1996,6060111,869033856),
(18,1997,6122130,972896267),
(18,1998,6185562,893770806),
(18,1999,6267124,808077223),
(18,2000,6378871,870486065),
(18,2001,6525545,876794723),
(18,2002,6704113,825394490),
(18,2003,6909154,784654423),
(18,2004,7131693,915257323),
(18,2005,7364862,1117113046),
(18,2006,7607849,1273375020),
(18,2007,7862214,1356199365),
(18,2008,8126102,1611835902),
(18,2009,8397668,1781455092),
(18,2010,8675602,2032135247),
(18,2011,8958406,2235820868),
(18,2012,9245988,2333308099),
(18,2013,9540289,2451625333),
(18,2014,9844297,2705783272),
(18,2015,10160030,3104394858),
(18,2016,10487998,2959185295),
(18,2017,10827024,3172416146),
(18,2018,11175378,3078029929),
(19,1960,9153489,11658722591),
(19,1961,9183948,12400145222),
(19,1962,9220578,13264015675),
(19,1963,9289770,14260017387),
(19,1964,9378113,15960106681),
(19,1965,9463667,17371457608),
(19,1966,9527807,18651883472),
(19,1967,9580991,19992040788),
(19,1968,9618756,21376353113),
(19,1969,9646032,23710735895),
(19,1970,9655549,26849148286),
(19,1971,9673162,29981290025),
(19,1972,9711115,37408591330),
(19,1973,9741720,47999363072),
(19,1974,9772419,56333010460),
(19,1975,9800700,66029748931),
(19,1976,9818227,71494539498),
(19,1977,9830358,83283328419),
(19,1978,9839534,101788000000),
(19,1979,9848382,116938000000),
(19,1980,9859242,127508000000),
(19,1981,9858982,105291000000),
(19,1982,9856303,92588895020),
(19,1983,9855520,87650915976),
(19,1984,9855372,83795680815),
(19,1985,9858308,86730038793),
(19,1986,9861823,120661000000),
(19,1987,9870234,150194000000),
(19,1988,9901664,163168000000),
(19,1989,9937697,165100000000),
(19,1990,9967379,206431000000),
(19,1991,10004486,211638000000),
(19,1992,10045158,236038000000),
(19,1993,10084475,225925000000),
(19,1994,10115603,246195000000),
(19,1995,10136811,289567000000),
(19,1996,10156637,281358000000),
(19,1997,10181245,254814000000),
(19,1998,10203008,260602000000),
(19,1999,10226419,260202000000),
(19,2000,10251250,237905000000),
(19,2001,10286570,237842000000),
(19,2002,10332785,258860000000),
(19,2003,10376133,319003000000),
(19,2004,10421137,370885000000),
(19,2005,10478617,387366000000),
(19,2006,10547958,409813000000),
(19,2007,10625700,471821000000),
(19,2008,10709973,518626000000),
(19,2009,10796493,484553000000),
(19,2010,10895586,483548000000),
(19,2011,11038264,527008000000),
(19,2012,11106932,497884000000),
(19,2013,11159407,520925000000),
(19,2014,11209057,530808000000),
(19,2015,11274196,455940000000),
(19,2016,11331422,469677000000),
(19,2017,11375158,494902000000),
(19,2018,11422068,531767000000),
(20,1960,2431622,226195579),
(20,1961,2465867,235668222),
(20,1962,2502896,236434906),
(20,1963,2542859,253927646),
(20,1964,2585965,269818988),
(20,1965,2632356,289908720),
(20,1966,2682159,302925280),
(20,1967,2735307,306222000),
(20,1968,2791590,326323097),
(20,1969,2850661,330748211),
(20,1970,2912340,333627758),
(20,1971,2976572,335072975),
(20,1972,3043567,410331901),
(20,1973,3113675,504376035),
(20,1974,3187412,554654787),
(20,1975,3265165,676870140),
(20,1976,3347173,698408244),
(20,1977,3433439,750049739),
(20,1978,3523938,928843304),
(20,1979,3618526,1186231265),
(20,1980,3717165,1405251547),
(20,1981,3820128,1291119965),
(20,1982,3927714,1267778489),
(20,1983,4039949,1095348303),
(20,1984,4156819,1051133927),
(20,1985,4278501,1045712703),
(20,1986,4404506,1336102041),
(20,1987,4535263,1562412030),
(20,1988,4672852,1620246187),
(20,1989,4820016,1502294411),
(20,1990,4978496,1959965244),
(20,1991,5149499,1986437860),
(20,1992,5331803,1695315306),
(20,1993,5521763,2274557914),
(20,1994,5714220,1598075932),
(20,1995,5905558,2169627251),
(20,1996,6094259,2361116588),
(20,1997,6281639,2268301538),
(20,1998,6470265,2455092582),
(20,1999,6664098,2689787918),
(20,2000,6865951,2569186643),
(20,2001,7076733,2680213931),
(20,2002,7295394,3054571082),
(20,2003,7520555,3905366188),
(20,2004,7750004,4521424807),
(20,2005,7982225,4803702821),
(20,2006,8216897,5142380779),
(20,2007,8454793,5969535132),
(20,2008,8696921,7132787397),
(20,2009,8944708,7097198712),
(20,2010,9199259,6970240895),
(20,2011,9460830,7814081156),
(20,2012,9729248,8152554487),
(20,2013,10004588,9157355680),
(20,2014,10286842,9707432016),
(20,2015,10575952,8291155881),
(20,2016,10872067,8573159697),
(20,2017,11175204,9246696924),
(20,2018,11485048,10358985583),
(21,1960,4829288,330442817),
(21,1961,4894580,350247237),
(21,1962,4960326,379567178),
(21,1963,5027821,394040749),
(21,1964,5098890,410321785),
(21,1965,5174870,422916848),
(21,1966,5256363,433889831),
(21,1967,5343019,450753993),
(21,1968,5434041,460442864),
(21,1969,5528174,478298781),
(21,1970,5624600,458404330),
(21,1971,5723381,482411279),
(21,1972,5825173,578595584),
(21,1973,5930483,674773821),
(21,1974,6040041,751133642),
(21,1975,6154545,939972703),
(21,1976,6274037,976547572),
(21,1977,6398935,1131225279),
(21,1978,6530819,1475584037),
(21,1979,6671656,1748480982),
(21,1980,6822843,1928720390),
(21,1981,6985160,1775842680),
(21,1982,7158255,1754450379),
(21,1983,7340905,1600278756),
(21,1984,7531242,1459880353),
(21,1985,7727907,1552493414),
(21,1986,7930694,2036303381),
(21,1987,8140073,2369835439),
(21,1988,8356305,2616040646),
(21,1989,8579823,2615588546),
(21,1990,8811034,3101301781),
(21,1991,9050084,3135045684),
(21,1992,9297113,2240264712),
(21,1993,9552476,2332018011),
(21,1994,9816588,1895290965),
(21,1995,10089878,2379518099),
(21,1996,10372745,2586550747),
(21,1997,10665546,2447669404),
(21,1998,10968724,2804902724),
(21,1999,11282701,2993753187),
(21,2000,11607942,2628920056),
(21,2001,11944587,2812845514),
(21,2002,12293100,3205592290),
(21,2003,12654621,4205691222),
(21,2004,13030569,4838551100),
(21,2005,13421930,5462709498),
(21,2006,13829176,5816310158),
(21,2007,14252021,6771277871),
(21,2008,14689725,8369637065),
(21,2009,15141098,8369175126),
(21,2010,15605217,8979966766),
(21,2011,16081911,10724063458),
(21,2012,16571246,11166063467),
(21,2013,17072775,11947176342),
(21,2014,17586017,12377391463),
(21,2015,18110624,10419303761),
(21,2016,18646378,10886363727),
(21,2017,19193284,12322864245),
(21,2018,19751535,14441763759),
(22,1960,48013504,4274893913),
(22,1961,49362843,4817580184),
(22,1962,50752157,5081413340),
(22,1963,52202007,5319458351),
(22,1964,53741716,5386054619),
(22,1965,55385112,5906636557),
(22,1966,57157654,6439687598),
(22,1967,59034249,7253575399),
(22,1968,60918454,7483685474),
(22,1969,62679765,8471006101),
(22,1970,64232482,8992721809),
(22,1971,65531633,8751842840),
(22,1972,66625705,6288245867),
(22,1973,67637530,8086725729),
(22,1974,68742233,12512460520),
(22,1975,70066301,19448348073),
(22,1976,71652381,10117113333),
(22,1977,73463584,9651149302),
(22,1978,75450032,13281767143),
(22,1979,77529045,15565480322),
(22,1980,79639491,18138049096),
(22,1981,81767515,20249694002),
(22,1982,83932127,18525399202),
(22,1983,86142495,17609048822),
(22,1984,88416521,18920840000),
(22,1985,90764183,22278423077),
(22,1986,93187603,21774033333),
(22,1987,95671163,24298032258),
(22,1988,98186350,26579005760),
(22,1989,100695497,28781714764),
(22,1990,103171956,31598341234),
(22,1991,105599127,30957483950),
(22,1992,107983704,31708874594),
(22,1993,110350639,33166519418),
(22,1994,112737683,33768660883),
(22,1995,115169930,37939748769),
(22,1996,117649932,46438484108),
(22,1997,120160564,48244309133),
(22,1998,122682815,49984559471),
(22,1999,125189651,51270569884),
(22,2000,127657854,53369787319),
(22,2001,130088702,53991289844),
(22,2002,132478086,54724081491),
(22,2003,134791603,60158929188),
(22,2004,136986432,65108544250),
(22,2005,139035505,69442943089),
(22,2006,140921167,71819083684),
(22,2007,142660376,79611888213),
(22,2008,144304167,91631278239),
(22,2009,145924797,102478000000),
(22,2010,147575430,115279000000),
(22,2011,149273778,128638000000),
(22,2012,151007807,133356000000),
(22,2013,152764676,149990000000),
(22,2014,154520167,172885000000),
(22,2015,156256276,195079000000),
(22,2016,157970840,221415000000),
(22,2017,159670593,249724000000),
(22,2018,161356039,274025000000),
(23,1980,8861535,19839230769),
(23,1981,8891117,19870000000),
(23,1982,8917457,19342000000),
(23,1983,8939738,16563666667),
(23,1984,8960679,17594944444),
(23,1985,8960547,17155421053),
(23,1986,8958171,20249294118),
(23,1987,8971359,28101000000),
(23,1988,8981446,22555941176),
(23,1989,8876972,21988444444),
(23,1990,8718289,20632090909),
(23,1991,8632367,10943548387),
(23,1992,8540164,10350515464),
(23,1993,8472313,10829710145),
(23,1994,8443591,9697416974),
(23,1995,8406067,18867559524),
(23,1996,8362826,12184935357),
(23,1997,8312068,11211546465),
(23,1998,8256786,14942172234),
(23,1999,8210624,13531969309),
(23,2000,8170172,13153016531),
(23,2001,8009142,14075616789),
(23,2002,7837161,16276456428),
(23,2003,7775327,20982685981),
(23,2004,7716860,25957970922),
(23,2005,7658972,29636617750),
(23,2006,7601022,34130122491),
(23,2007,7545338,44411476557),
(23,2008,7492561,54409138498),
(23,2009,7444443,51884481410),
(23,2010,7395599,50610058210),
(23,2011,7348328,57418414504),
(23,2012,7305888,53903022339),
(23,2013,7265115,55555171010),
(23,2014,7223938,56814543481),
(23,2015,7177991,50201314895),
(23,2016,7127822,53240950226),
(23,2017,7075947,58220973783),
(23,2018,7024216,65132951116),
(24,1980,359888,3072698328),
(24,1981,374120,3467819149),
(24,1982,385950,3645744681),
(24,1983,396454,3735106383),
(24,1984,407225,3905585106),
(24,1985,419428,3651861702),
(24,1986,433480,3052393617),
(24,1987,448971,3392021011),
(24,1988,465198,3702393617),
(24,1989,481087,3863563830),
(24,1990,495931,4229787234),
(24,1991,509760,4616223404),
(24,1992,523086,4751063830),
(24,1993,536210,5200265957),
(24,1994,549583,5567553457),
(24,1995,563697,5849467819),
(24,1996,578666,6101861436),
(24,1997,594931,6349202394),
(24,1998,613700,6183776596),
(24,1999,636541,6621010372),
(24,2000,664611,9062906915),
(24,2001,697545,8976207713),
(24,2002,735146,9632155053),
(24,2003,778708,11074822074),
(24,2004,829844,13150166755),
(24,2005,889164,15968726862),
(24,2006,958418,18505053191),
(24,2007,1035919,21730000000),
(24,2008,1114641,25710877660),
(24,2009,1185076,22938218085),
(24,2010,1240860,25713271277),
(24,2011,1278151,28776595745),
(24,2012,1299943,30749308511),
(24,2013,1315029,32539547872),
(24,2014,1336075,33387712766),
(24,2015,1371851,31125851064),
(24,2016,1425791,32250132979),
(24,2017,1494074,35432686170),
(24,2018,1569439,37746196809),
(25,1960,109534,169803921),
(25,1961,115121,190098039),
(25,1962,121091,212254902),
(25,1963,127339,237745098),
(25,1964,133709,266666666),
(25,1965,140059,300392156),
(25,1966,146382,340000000),
(25,1967,152620,390196078),
(25,1968,158648,444901960),
(25,1969,164268,528137254),
(25,1970,169377,538423153),
(25,1971,173889,573400000),
(25,1972,177866,590900000),
(25,1973,181517,670900000),
(25,1974,185120,632400000),
(25,1975,188896,596200000),
(25,1976,192909,642100000),
(25,1977,197101,713000000),
(25,1978,201478,832400000),
(25,1979,205984,1139800100),
(25,1980,210591,1335300000),
(25,1981,215326,1426500000),
(25,1982,220184,1578300000),
(25,1983,225084,1732800000),
(25,1984,229923,2041100000),
(25,1985,234578,2320699900),
(25,1986,239017,2472500000),
(25,1987,243271,2713999900),
(25,1988,247451,2817900000),
(25,1989,251733,3062000000),
(25,1990,256223,3166000000),
(25,1991,261008,3111160000),
(25,1992,266029,3109000000),
(25,1993,271069,3092000000),
(25,1994,275846,3259000000),
(25,1995,280184,3429000000),
(25,1996,283978,3609000000),
(25,1997,287358,6332360000),
(25,1998,290597,6833220000),
(25,1999,294062,7683870000),
(25,2000,298051,8076470000),
(25,2001,302618,8317830000),
(25,2002,307660,8881160000),
(25,2003,313129,8870090000),
(25,2004,318894,9055290000),
(25,2005,324859,9836200000),
(25,2006,331033,10167250000),
(25,2007,337389,10618340000),
(25,2008,343681,10526000000),
(25,2009,349604,9981960000),
(25,2010,354942,10095760000),
(25,2011,359577,10070450000),
(25,2012,363584,10720500000),
(25,2013,367168,10627600000),
(25,2014,370633,10957300000),
(25,2015,374206,11792300000),
(25,2016,377931,11838800000),
(25,2017,381761,12162100000),
(26,1994,3936524,1255802469),
(26,1995,3829050,1866572954),
(26,1996,3764425,2786045322),
(26,1997,3736070,3671816504),
(26,1998,3734337,4116699437),
(26,1999,3743354,4685733115),
(26,2000,3751176,5505887894),
(26,2001,3755512,5748993411),
(26,2002,3759387,6651106833),
(26,2003,3762173,8369878823),
(26,2004,3764194,10596205714),
(26,2005,3765331,11222953519),
(26,2006,3765424,12864610994),
(26,2007,3762786,15778767670),
(26,2008,3754271,19112739664),
(26,2009,3735938,17613836210),
(26,2010,3705472,17176781337),
(26,2011,3661175,18644723861),
(26,2012,3604972,17226849297),
(26,2013,3542605,18178503835),
(26,2014,3482104,18558343508),
(26,2015,3429361,16211541253),
(26,2016,3386267,16913330694),
(26,2017,3351527,18080118128),
(26,2018,3323929,19781776101),
(27,1990,10189000,21650000000),
(27,1991,10194000,18000000000),
(27,1992,10216000,17037037037),
(27,1993,10239000,16280991736),
(27,1994,10227000,14932024169),
(27,1995,10194000,13972676841),
(27,1996,10160000,14756846154),
(27,1997,10117000,14128408566),
(27,1998,10069000,15222012660),
(27,1999,10026738,12138486532),
(27,2000,9979610,12736856828),
(27,2001,9928549,12354820144),
(27,2002,9865548,14594249023),
(27,2003,9796749,17827791321),
(27,2004,9730146,23144351852),
(27,2005,9663915,30207567317),
(27,2006,9604924,36954312354),
(27,2007,9560953,45277399814),
(27,2008,9527985,60763483146),
(27,2009,9506765,50874078052),
(27,2010,9490583,58665088956),
(27,2011,9473172,61757788945),
(27,2012,9464495,65685102555),
(27,2013,9465997,75527984234),
(27,2014,9474511,78813839984),
(27,2015,9489616,56454734397),
(27,2016,9501534,47722657821),
(27,2017,9498264,54726595249),
(27,2018,9485386,59662495092),
(28,1960,92064,28071888),
(28,1961,94703,29964370),
(28,1962,97384,31856922),
(28,1963,100164,33749405),
(28,1964,103069,36193826),
(28,1965,106119,40069930),
(28,1966,109347,44405594),
(28,1967,112692,47379310),
(28,1968,116061,44910179),
(28,1969,119261,47305389),
(28,1970,122182,53233532),
(28,1971,124793,59207317),
(28,1972,127150,66062500),
(28,1973,129294,78343558),
(28,1974,131307,103216374),
(28,1975,133260,118066298),
(28,1976,135147,96905829),
(28,1977,136989,117650000),
(28,1978,138965,136300000),
(28,1979,141305,151800000),
(28,1980,144155,197938222),
(28,1981,147566,196089854),
(28,1982,151500,182206327),
(28,1983,155822,192103186),
(28,1984,160347,214381949),
(28,1985,164921,212643742),
(28,1986,169568,231638320),
(28,1987,174320,281082558),
(28,1988,179028,320093360),
(28,1989,183469,369133890),
(28,1990,187552,412086445),
(28,1991,191128,444720750),
(28,1992,194324,518239100),
(28,1993,197622,559858250),
(28,1994,201680,580863700),
(28,1995,206963,620140400),
(28,1996,213664,641383800),
(28,1997,221580,654314350),
(28,1998,230244,688992450),
(28,1999,238988,732732350),
(28,2000,247315,832072450),
(28,2001,255063,871860600),
(28,2002,262378,932551850),
(28,2003,269425,990374050),
(28,2004,276504,1057845500),
(28,2005,283800,1114202700),
(28,2006,291329,1217442150),
(28,2007,299025,1290542550),
(28,2008,306823,1368625150),
(28,2009,314655,1335217500),
(28,2010,322464,1396731700),
(28,2011,330237,1486595750),
(28,2012,338000,1563827850),
(28,2013,345715,1608442150),
(28,2014,353366,1692955750),
(28,2015,360933,1762500450),
(28,2016,368400,1806646250),
(28,2017,375769,1862614800),
(28,2018,383071,1925000000),
(29,1960,44400,84466654),
(29,1961,45500,89249986),
(29,1962,46600,94149985),
(29,1963,47700,96366652),
(29,1964,48900,107566650),
(29,1965,50100,114339049),
(29,1966,51000,134173373),
(29,1967,52000,155102984),
(29,1968,53000,150000000),
(29,1969,54000,164900000),
(29,1970,55000,186300000),
(29,1971,54600,211100000),
(29,1972,54200,235400000),
(29,1973,53800,269500000),
(29,1974,53400,312600000),
(29,1975,53000,345000000),
(29,1976,53200,386300000),
(29,1977,53400,447000000),
(29,1978,53600,475800000),
(29,1979,53800,517200000),
(29,1980,54670,613299968),
(29,1981,55050,739100032),
(29,1982,55449,785500032),
(29,1983,55930,889400000),
(29,1984,56423,985699968),
(29,1985,56898,1039500032),
(29,1986,57382,1173500032),
(29,1987,57849,1296499968),
(29,1988,58347,1415100032),
(29,1989,58841,1501500032),
(29,1990,59326,1592400000),
(29,1991,59021,1634899968),
(29,1992,58595,1679900032),
(29,1993,58910,1820359936),
(29,1994,59320,1867160064),
(29,1995,59746,2030749952),
(29,1996,60129,2695390000),
(29,1997,60497,2932827000),
(29,1998,60943,3130748000),
(29,1999,61285,3324433000),
(29,2000,61833,3480219000),
(29,2001,62504,3680483000),
(29,2002,62912,3937228000),
(29,2003,63325,4186525000),
(29,2004,63740,4484703000),
(29,2005,64154,4868136000),
(29,2006,64523,5414299000),
(29,2007,64888,5895048000),
(29,2008,65273,6109928000),
(29,2009,65636,5806378000),
(29,2010,65124,5744414000),
(29,2011,64564,5550771000),
(29,2012,64798,5537537000),
(29,2013,65001,5573710000),
(30,1960,3656955,373879363),
(30,1961,3728964,406684585),
(30,1962,3802990,444665186),
(30,1963,3879192,478805990),
(30,1964,3957757,539491477),
(30,1965,4038872,604377104),
(30,1966,4122517,669191919),
(30,1967,4208676,755808080),
(30,1968,4297517,857912457),
(30,1969,4389246,929629629),
(30,1970,4484004,1017003367),
(30,1971,4581740,1095622896),
(30,1972,4682390,1257615645),
(30,1973,4785923,1262968516),
(30,1974,4892293,2100249875),
(30,1975,5001419,2404697651),
(30,1976,5113456,2731984008),
(30,1977,5228252,3227436282),
(30,1978,5344939,3758220890),
(30,1979,5462419,4421343606),
(30,1980,5579935,4526916803),
(30,1981,5697096,5872756933),
(30,1982,5814345,5587490265),
(30,1983,5932810,5422440962),
(30,1984,6054123,6169501038),
(30,1985,6179460,5377277407),
(30,1986,6309130,3958338883),
(30,1987,6442831,4323623622),
(30,1988,6580312,4597615563),
(30,1989,6721115,4715978868),
(30,1990,6864842,4867582620),
(30,1991,7011453,5343274312),
(30,1992,7160920,5643893347),
(30,1993,7312850,5734676561),
(30,1994,7466793,5981244887),
(30,1995,7622338,6715220507),
(30,1996,7779267,7396966657),
(30,1997,7937458,7925673448),
(30,1998,8096761,8497545598),
(30,1999,8257066,8285075872),
(30,2000,8418264,8397912509),
(30,2001,8580235,8141537938),
(30,2002,8742814,7905485216),
(30,2003,8905823,8082364868),
(30,2004,9069039,8773451739),
(30,2005,9232306,9549077869),
(30,2006,9395446,11451869165),
(30,2007,9558439,13120183157),
(30,2008,9721454,16674324634),
(30,2009,9884781,17339992165),
(30,2010,10048590,19649631451),
(30,2011,10212954,23963033588),
(30,2012,10377676,27084497540),
(30,2013,10542376,30659338784),
(30,2014,10706517,32996188133),
(30,2015,10869730,33000198263),
(30,2016,11031813,33941126194),
(30,2017,11192854,37508642258),
(30,2018,11353142,40287647757),
(31,1960,72179226,15165569913),
(31,1961,74311343,15236854859),
(31,1962,76514328,19926293839),
(31,1963,78772657,23021477292),
(31,1964,81064571,21211892260),
(31,1965,83373530,21790035117),
(31,1966,85696505,27062716578),
(31,1967,88035814,30591834054),
(31,1968,90387079,33875881876),
(31,1969,92746614,37458898244),
(31,1970,95113265,42327600098),
(31,1971,97482920,49204456700),
(31,1972,99859383,58539008786),
(31,1973,102259497,79279057731),
(31,1974,104706198,105136000000),
(31,1975,107216205,123709000000),
(31,1976,109790938,152678000000),
(31,1977,112425392,176171000000),
(31,1978,115121153,200801000000),
(31,1979,117878411,224969000000),
(31,1980,120694009,235025000000),
(31,1981,123570327,263561000000),
(31,1982,126498314,281682000000),
(31,1983,129448819,203305000000),
(31,1984,132383568,209024000000),
(31,1985,135274080,222943000000),
(31,1986,138108912,268137000000),
(31,1987,140891602,294084000000),
(31,1988,143627503,330397000000),
(31,1989,146328304,425595000000),
(31,1990,149003223,461952000000),
(31,1991,151648011,602860000000),
(31,1992,154259380,400599000000),
(31,1993,156849078,437799000000),
(31,1994,159432716,558112000000),
(31,1995,162019896,769305000000),
(31,1996,164614688,850426000000),
(31,1997,167209040,883200000000),
(31,1998,169785250,863723000000),
(31,1999,172318675,599389000000),
(31,2000,174790340,655421000000),
(31,2001,177196054,559372000000),
(31,2002,179537520,507962000000),
(31,2003,181809246,558320000000),
(31,2004,184006481,669317000000),
(31,2005,186127103,891630000000),
(31,2006,188167356,1107640000000),
(31,2007,190130443,1397080000000),
(31,2008,192030362,1695820000000),
(31,2009,193886508,1667020000000),
(31,2010,195713635,2208870000000),
(31,2011,197514534,2616200000000),
(31,2012,199287296,2465190000000),
(31,2013,201035903,2472810000000),
(31,2014,202763735,2455990000000),
(31,2015,204471769,1802210000000),
(31,2016,206163058,1796280000000),
(31,2017,207833831,2053590000000),
(31,2018,209469333,1868630000000),
(32,1974,244644,311809337),
(32,1975,246154,402178605),
(32,1976,247583,435911268),
(32,1977,248937,495097667),
(32,1978,250203,552883707),
(32,1979,251351,670362452),
(32,1980,252394,860388803),
(32,1981,253298,946949734),
(32,1982,254082,989409834),
(32,1983,254788,1050514593),
(32,1984,255497,1144931139),
(32,1985,256263,1198329439),
(32,1986,257107,1315616765),
(32,1987,258019,1448714762),
(32,1988,258977,1540893949),
(32,1989,259957,1703972555),
(32,1990,260936,2023318252),
(32,1991,261905,2007109829),
(32,1992,262886,1950900000),
(32,1993,263874,2046189032),
(32,1994,264893,2151295182),
(32,1995,265955,2261969870),
(32,1996,267049,2411872918),
(32,1997,268187,2549296475),
(32,1998,269336,2874459305),
(32,1999,270451,3012081738),
(32,2000,271515,3121500000),
(32,2001,272500,3116650000),
(32,2002,273425,3169600000),
(32,2003,274329,3274850000),
(32,2004,275284,3514350000),
(32,2005,276323,3897300000),
(32,2006,277477,4176500000),
(32,2007,278700,4672250000),
(32,2008,279946,4782000000),
(32,2009,281104,4479950000),
(32,2010,282131,4529900000),
(32,2011,282987,4660900000),
(32,2012,283700,4656350000),
(32,2013,284296,4612500000),
(32,2014,284825,4608350000),
(32,2015,285324,4584150000),
(32,2016,285796,4529050000),
(32,2017,286233,4673500000),
(33,1965,102386,114040245),
(33,1966,107274,132758395),
(33,1967,112448,139030445),
(33,1968,117898,160819286),
(33,1969,123600,161211289),
(33,1970,129529,179080099),
(33,1971,135671,197523179),
(33,1972,142022,270818555),
(33,1973,148512,433092003),
(33,1974,155072,1073577086),
(33,1975,161626,1168304306),
(33,1976,168181,1423061357),
(33,1977,174714,1732721161),
(33,1978,181205,1941600704),
(33,1979,187604,2803780006),
(33,1980,193879,4928824958),
(33,1981,200021,4366213850),
(33,1982,206065,4264252336),
(33,1983,212076,3844723142),
(33,1984,218175,3782523088),
(33,1985,224449,3523612563),
(33,1986,230915,2358592817),
(33,1987,237563,2754463438),
(33,1988,244404,2690717551),
(33,1989,251458,2985467979),
(33,1990,258721,3520551724),
(33,1991,266210,3701667053),
(33,1992,273892,4183548189),
(33,1993,281681,4105706152),
(33,1994,289454,4087337960),
(33,1995,297114,4734020037),
(33,1996,304622,5115602837),
(33,1997,311958,5197332974),
(33,1998,319144,4051147228),
(33,1999,326210,4600000000),
(33,2000,333165,6001153306),
(33,2001,340034,5601090584),
(33,2002,346782,5843329108),
(33,2003,353293,6557333085),
(33,2004,359433,7872333215),
(33,2005,365114,9531402848),
(33,2006,370263,11470703002),
(33,2007,374965,12247694247),
(33,2008,379421,14393099069),
(33,2009,383906,10732366286),
(33,2010,388646,13707370737),
(33,2011,393688,18525319978),
(33,2012,398989,19048495519),
(33,2013,404421,18093829923),
(33,2014,409769,17098342541),
(33,2015,414907,12930394938),
(33,2016,419800,11400653949),
(33,2017,424473,12128089000),
(33,2018,428962,13567099498),
(34,1980,406875,135653295),
(34,1981,418111,146391639),
(34,1982,428934,148934334),
(34,1983,439822,165585940),
(34,1984,451476,169264991),
(34,1985,464266,172217502),
(34,1986,478692,201375725),
(34,1987,494312,253182453),
(34,1988,509540,283855833),
(34,1989,522179,275949889),
(34,1990,530804,299787275),
(34,1991,534632,250045839),
(34,1992,534516,250794359),
(34,1993,532596,235239570),
(34,1994,531897,270801565),
(34,1995,534620,303053462),
(34,1996,541465,316420860),
(34,1997,551709,365964500),
(34,1998,564377,376955087),
(34,1999,577881,419035810),
(34,2000,591021,439158233),
(34,2001,603640,476360697),
(34,2002,616018,537050133),
(34,2003,627839,622026107),
(34,2004,638815,702682019),
(34,2005,648739,818869145),
(34,2006,657410,897731524),
(34,2007,664876,1196091805),
(34,2008,671613,1258332337),
(34,2009,678323,1264758198),
(34,2010,685503,1585472534),
(34,2011,693298,1820207626),
(34,2012,701583,1823692110),
(34,2013,710238,1798333726),
(34,2014,719056,1976938530),
(34,2015,727876,2059809920),
(34,2016,736709,2219675781),
(34,2017,745568,2528007911),
(34,2018,754394,2534965163),
(36,1960,502745,30412308),
(36,1961,512685,32902336),
(36,1962,523778,35643207),
(36,1963,535685,38091150),
(36,1964,547873,41613969),
(36,1965,559994,45790869),
(36,1966,571964,51464435),
(36,1967,584092,58646443),
(36,1968,596947,66248256),
(36,1969,611300,77356914),
(36,1970,627715,96245114),
(36,1971,646347,126957494),
(36,1972,667092,165258093),
(36,1973,689912,244129088),
(36,1974,714712,306033848),
(36,1975,741355,355172413),
(36,1976,769979,372010119),
(36,1977,800529,451603325),
(36,1978,832467,590376720),
(36,1979,865075,819877300),
(36,1980,897868,1060923829),
(36,1981,930408,1073861599),
(36,1982,962875,1014907255),
(36,1983,996130,1172258182),
(36,1984,1031439,1240796365),
(36,1985,1069582,1114764007),
(36,1986,1110943,1392634772),
(36,1987,1154906,1965274882),
(36,1988,1200067,2644536804),
(36,1989,1244484,3083800685),
(36,1990,1286756,3790567052),
(36,1991,1326322,3942792837),
(36,1992,1363554,4146513722),
(36,1993,1399110,4160086253),
(36,1994,1434059,4259330999),
(36,1995,1469174,4730611067),
(36,1996,1504730,4847752843),
(36,1997,1540425,5020214747),
(36,1998,1575824,4790458837),
(36,1999,1610264,5484257417),
(36,2000,1643334,5788329609),
(36,2001,1674678,5489608300),
(36,2002,1704642,5438857107),
(36,2003,1734398,7511582173),
(36,2004,1765527,8957467707),
(36,2005,1799078,9931134941),
(36,2006,1835908,10126940513),
(36,2007,1875459,10939053365),
(36,2008,1915639,10945070442),
(36,2009,1953498,10267133178),
(36,2010,1987105,12786654366),
(36,2011,2015402,15351972230),
(36,2012,2039551,16067155187),
(36,2013,2062536,14901750765),
(36,2014,2088614,16250750259),
(36,2015,2120716,14420604206),
(36,2016,2159944,15646323341),
(36,2017,2205128,17406565823),
(36,2018,2254126,18616018903),
(37,1960,1501668,112155598),
(37,1961,1526066,123134584),
(37,1962,1551910,124482748),
(37,1963,1579370,129379097),
(37,1964,1608616,142025069),
(37,1965,1639706,150574816),
(37,1966,1673019,157930041),
(37,1967,1708302,163820538),
(37,1968,1744194,191767437),
(37,1969,1778861,188039191),
(37,1970,1811144,189106554),
(37,1971,1840518,201450768),
(37,1972,1867782,230317908),
(37,1973,1894853,271183061),
(37,1974,1924388,281398668),
(37,1975,1958367,378660016),
(37,1976,1997014,451152450),
(37,1977,2039919,507298120),
(37,1978,2087663,610578523),
(37,1979,2140777,700764892),
(37,1980,2199356,797048028),
(37,1981,2264442,694803502),
(37,1982,2335333,748312283),
(37,1983,2408317,658679394),
(37,1984,2478382,637820620),
(37,1985,2542169,864849765),
(37,1986,2597761,1122265026),
(37,1987,2646840,1200991826),
(37,1988,2693973,1264899368),
(37,1989,2745734,1233930277),
(37,1990,2806734,1440711396),
(37,1991,2878509,1377375031),
(37,1992,2959236,1411917558),
(37,1993,3046149,1278781167),
(37,1994,3135015,851174350),
(37,1995,3222656,1115389732),
(37,1996,3308233,1007791186),
(37,1997,3392436,937741468),
(37,1998,3475492,967338348),
(37,1999,3558014,999477510),
(37,2000,3640427,914500299),
(37,2001,3722018,931833302),
(37,2002,3802128,991387870),
(37,2003,3881181,1139754799),
(37,2004,3959875,1270080251),
(37,2005,4038382,1337362392),
(37,2006,4118069,1460561215),
(37,2007,4198010,1697565949),
(37,2008,4273366,1985240986),
(37,2009,4337625,2059094048),
(37,2010,4386768,2140503193),
(37,2011,4418636,2434792413),
(37,2012,4436415,2510270268),
(37,2013,4447942,1700627480),
(37,2014,4464175,1904794555),
(37,2015,4493170,1709221159),
(37,2016,4537687,1844714795),
(37,2017,4596028,2167501640),
(37,2018,4666377,2379716827),
(38,1961,18271000,41555987615),
(38,1962,18614000,42868091993),
(38,1963,18964000,45713151050),
(38,1964,19325000,50126643039),
(38,1965,19678000,55342244543),
(38,1966,20048000,62015172913),
(38,1967,20412000,66664932951),
(38,1968,20744000,72919560567),
(38,1969,21028000,80349194244),
(38,1970,21324000,87896095224),
(38,1971,21962032,99271961478),
(38,1972,22218463,113083000000),
(38,1973,22491777,131322000000),
(38,1974,22807969,160409000000),
(38,1975,23143275,173834000000),
(38,1976,23449808,206576000000),
(38,1977,23725843,211612000000),
(38,1978,23963203,218633000000),
(38,1979,24201544,243072000000),
(38,1980,24515667,273854000000),
(38,1981,24819915,306215000000),
(38,1982,25116942,313507000000),
(38,1983,25366451,340548000000),
(38,1984,25607053,355373000000),
(38,1985,25842116,364756000000),
(38,1986,26100278,377438000000),
(38,1987,26446601,431317000000),
(38,1988,26791747,507354000000),
(38,1989,27276781,565056000000),
(38,1990,27691138,593930000000),
(38,1991,28037420,610328000000),
(38,1992,28371264,592388000000),
(38,1993,28684764,577171000000),
(38,1994,29000663,578139000000),
(38,1995,29302311,604032000000),
(38,1996,29610218,628546000000),
(38,1997,29905948,652824000000),
(38,1998,30155173,631813000000),
(38,1999,30401286,676084000000),
(38,2000,30685730,742295000000),
(38,2001,31020902,736380000000),
(38,2002,31360079,757951000000),
(38,2003,31644028,892382000000),
(38,2004,31940655,1023200000000),
(38,2005,32243753,1169360000000),
(38,2006,32571174,1315420000000),
(38,2007,32889025,1464980000000),
(38,2008,33247118,1549130000000),
(38,2009,33628895,1371150000000),
(38,2010,34004889,1613540000000),
(38,2011,34339328,1789140000000),
(38,2012,34714222,1823970000000),
(38,2013,35082954,1842020000000),
(38,2014,35437435,1801480000000),
(38,2015,35702908,1552900000000),
(38,2016,36109487,1526710000000),
(38,2017,36540268,1646870000000),
(38,2018,37058856,1712510000000),
(40,1960,5327827,9522746719),
(40,1961,5434294,10712712465),
(40,1962,5573815,11879982759),
(40,1963,5694247,13063643796),
(40,1964,5789228,14480556572),
(40,1965,5856472,15346741670),
(40,1966,5918002,16480058705),
(40,1967,5991785,17740013179),
(40,1968,6067714,18942729779),
(40,1969,6136387,20524886616),
(40,1980,6319408,119008000000),
(40,1981,6354074,108994000000),
(40,1982,6391309,111711000000),
(40,1983,6418773,111314000000),
(40,1984,6441865,106285000000),
(40,1985,6470365,107766000000),
(40,1986,6504124,154482000000),
(40,1987,6545106,193466000000),
(40,1988,6593386,209298000000),
(40,1989,6646912,202079000000),
(40,1990,6715519,258067000000),
(40,1991,6799978,261114000000),
(40,1992,6875364,271814000000),
(40,1993,6938265,264353000000),
(40,1994,6993795,292647000000),
(40,1995,7040687,342617000000),
(40,1996,7071850,330092000000),
(40,1997,7088906,286519000000),
(40,1998,7110001,295045000000),
(40,1999,7143991,289912000000),
(40,2000,7184250,272055000000),
(40,2001,7229854,278631000000),
(40,2002,7284753,301417000000),
(40,2003,7339001,352915000000),
(40,2004,7389625,394164000000),
(40,2005,7437115,408689000000),
(40,2006,7483934,430921000000),
(40,2007,7551117,479913000000),
(40,2008,7647675,554363000000),
(40,2009,7743831,541507000000),
(40,2010,7824909,583783000000),
(40,2011,7912398,699580000000),
(40,2012,7996861,668044000000),
(40,2013,8089346,688504000000),
(40,2014,8188649,709183000000),
(40,2015,8282396,679832000000),
(40,2016,8373338,670181000000),
(40,2017,8451840,678965000000),
(40,2018,8516543,705501000000),
(41,1960,8132990,4110000000),
(41,1961,8303811,4609727273),
(41,1962,8476897,5416272727),
(41,1963,8650387,5668187500),
(41,1964,8821858,5982347826),
(41,1965,8989621,6026593750),
(41,1966,9152844,7072641026),
(41,1967,9312095,7013196078),
(41,1968,9468845,7167086957),
(41,1969,9625312,8377093023),
(41,1970,9783134,9126309735),
(41,1971,9942727,10884114754),
(41,1972,10103674,11853817308),
(41,1973,10265829,16836261173),
(41,1974,10428798,16210404184),
(41,1975,10592307,7622217352),
(41,1976,10756878,10341925249),
(41,1977,10922779,13962893422),
(41,1978,11089165,15989933708),
(41,1979,11254877,21803696985),
(41,1980,11419348,29036709872),
(41,1981,11582014,34509878044),
(41,1982,11743911,25325893206),
(41,1983,11907960,20355959237),
(41,1984,12078135,19622527480),
(41,1985,12257236,17702885394),
(41,1986,12445823,18891048819),
(41,1987,12642924,22255407685),
(41,1988,12847708,26040229793),
(41,1989,13058758,29885685143),
(41,1990,13274623,33113887818),
(41,1991,13495258,37834793730),
(41,1992,13719819,45964327559),
(41,1993,13944937,49297773130),
(41,1994,14166340,57008425296),
(41,1995,14380866,73447063319),
(41,1996,14587370,78039572222),
(41,1997,14786220,84952360922),
(41,1998,14977733,81577430181),
(41,1999,15162800,75173794497),
(41,2000,15342353,77860932152),
(41,2001,15516113,70979923960),
(41,2002,15684409,69736811435),
(41,2003,15849652,75643459840),
(41,2004,16014971,99210392858),
(41,2005,16182721,122965000000),
(41,2006,16354504,154788000000),
(41,2007,16530195,173606000000),
(41,2008,16708258,179638000000),
(41,2009,16886186,172389000000),
(41,2010,17062536,218538000000),
(41,2011,17233576,252252000000),
(41,2012,17400347,267122000000),
(41,2013,17571507,278384000000),
(41,2014,17758959,260542000000),
(41,2015,17969353,243919000000),
(41,2016,18209068,250340000000),
(41,2017,18470439,277746000000),
(41,2018,18729160,298231000000),
(42,1960,667070000,59716467625),
(42,1961,660330000,50056868958),
(42,1962,665770000,47209359006),
(42,1963,682335000,50706799903),
(42,1964,698355000,59708343489),
(42,1965,715185000,70436266147),
(42,1966,735400000,76720285970),
(42,1967,754550000,72881631327),
(42,1968,774510000,70846535056),
(42,1969,796025000,79705906247),
(42,1970,818315000,92602973434),
(42,1971,841105000,99800958648),
(42,1972,862030000,113688000000),
(42,1973,881940000,138544000000),
(42,1974,900350000,144182000000),
(42,1975,916395000,163432000000),
(42,1976,930685000,153940000000),
(42,1977,943455000,174938000000),
(42,1978,956165000,149541000000),
(42,1979,969005000,178281000000),
(42,1980,981235000,191149000000),
(42,1981,993885000,195866000000),
(42,1982,1008630000,205090000000),
(42,1983,1023310000,230687000000),
(42,1984,1036825000,259947000000),
(42,1985,1051040000,309488000000),
(42,1986,1066790000,300758000000),
(42,1987,1084035000,272973000000),
(42,1988,1101630000,312354000000),
(42,1989,1118650000,347768000000),
(42,1990,1135185000,360858000000),
(42,1991,1150780000,383373000000),
(42,1992,1164970000,426916000000),
(42,1993,1178440000,444731000000),
(42,1994,1191835000,564325000000),
(42,1995,1204855000,734548000000),
(42,1996,1217550000,863747000000),
(42,1997,1230075000,961604000000),
(42,1998,1241935000,1029040000000),
(42,1999,1252735000,1094000000000),
(42,2000,1262645000,1211350000000),
(42,2001,1271850000,1339400000000),
(42,2002,1280400000,1470550000000),
(42,2003,1288400000,1660290000000),
(42,2004,1296075000,1955350000000),
(42,2005,1303720000,2285970000000),
(42,2006,1311020000,2752130000000),
(42,2007,1317885000,3550340000000),
(42,2008,1324655000,4594310000000),
(42,2009,1331260000,5101700000000),
(42,2010,1337705000,6087160000000),
(42,2011,1344130000,7551500000000),
(42,2012,1350695000,8532230000000),
(42,2013,1357380000,9570410000000),
(42,2014,1364270000,10438500000000),
(42,2015,1371220000,11015500000000),
(42,2016,1378665000,11137900000000),
(42,2017,1386395000,12143500000000),
(42,2018,1392730000,13608200000000),
(43,1960,3503553,546203561),
(43,1961,3631553,618245639),
(43,1962,3770766,645284344),
(43,1963,3918628,761047045),
(43,1964,4071411,921063266),
(43,1965,4226844,919771356),
(43,1966,4383728,1024103034),
(43,1967,4544164,1082922892),
(43,1968,4713135,1281281246),
(43,1969,4897472,1361360157),
(43,1970,5102064,1455482990),
(43,1971,5328744,1584128262),
(43,1972,5576038,1849400600),
(43,1973,5841506,2508421235),
(43,1974,6121285,3070151901),
(43,1975,6412403,3893839190),
(43,1976,6713950,4662053708),
(43,1977,7026496,6265067858),
(43,1978,7350270,7900524898),
(43,1979,7685918,9142935858),
(43,1980,8033650,10175615442),
(43,1981,8393691,8432588484),
(43,1982,8764989,7567109767),
(43,1983,9144931,6838185419),
(43,1984,9530107,6841638715),
(43,1985,9918196,6977650069),
(43,1986,10307281,9158302205),
(43,1987,10698194,10087653189),
(43,1988,11094748,10255170460),
(43,1989,11502449,9757410614),
(43,1990,11924877,10795850107),
(43,1991,12362407,10492628915),
(43,1992,12812421,11152971316),
(43,1993,13271643,11045759469),
(43,1994,13735433,8313557450),
(43,1995,14199762,11000146839),
(43,1996,14665127,12139234939),
(43,1997,15130663,11722142706),
(43,1998,15589414,12612033729),
(43,1999,16032573,12376639823),
(43,2000,16454668,10717022463),
(43,2001,16853026,11192560719),
(43,2002,17231539,12346919152),
(43,2003,17599610,15306602195),
(43,2004,17970494,16554441555),
(43,2005,18354514,17084927540),
(43,2006,18754916,17800887469),
(43,2007,19171237,20343636059),
(43,2008,19605569,24224905504),
(43,2009,20059147,24277494337),
(43,2010,20532950,24884503951),
(43,2011,21028655,25381615976),
(43,2012,21547188,26790577891),
(43,2013,22087505,31264184741),
(43,2014,22647683,35316494574),
(43,2015,23226143,33131113901),
(43,2016,23822714,35296979104),
(43,2017,24437469,38053610009),
(43,2018,25069229,43007045466),
(44,1960,5176918,618740988),
(44,1961,5285017,657597382),
(44,1962,5398729,699373701),
(44,1963,5518104,723624365),
(44,1964,5643036,782384527),
(44,1965,5773543,814139855),
(44,1966,5909882,853268771),
(44,1967,6052420,934079050),
(44,1968,6201413,1053077155),
(44,1969,6357092,1152418515),
(44,1970,6519762,1160002261),
(44,1971,6689662,1233991075),
(44,1972,6867178,1430951332),
(44,1973,7052849,1758727395),
(44,1974,7247287,2255496995),
(44,1975,7451054,2752771044),
(44,1976,7664406,3076592431),
(44,1977,7887560,3366368665),
(44,1978,8121084,4409920644),
(44,1979,8365567,5811444661),
(44,1980,8621406,6740756569),
(44,1981,8888535,7636345827),
(44,1982,9166816,7322914570),
(44,1983,9456494,7381854747),
(44,1984,9757841,7801858825),
(44,1985,10070806,8148223604),
(44,1986,10395480,10621158533),
(44,1987,10731064,12302471429),
(44,1988,11075422,12493286762),
(44,1989,11425800,11140055364),
(44,1990,11780088,11151578051),
(44,1991,12137912,12434370005),
(44,1992,12499499,11396310990),
(44,1993,12864090,15498179313),
(44,1994,13230984,10600157684),
(44,1995,13599988,9643953175),
(44,1996,13970813,10513387442),
(44,1997,14344449,10833497458),
(44,1998,14723768,10612847429),
(44,1999,15112592,11198378749),
(44,2000,15513945,10083937740),
(44,2001,15928910,10371327756),
(44,2002,16357602,11579343088),
(44,2003,16800865,14548845765),
(44,2004,17259322,17430933517),
(44,2005,17733410,17944084201),
(44,2006,18223674,19356046328),
(44,2007,18730282,22365265026),
(44,2008,19252666,26409781215),
(44,2009,19789919,26017925552),
(44,2010,20341241,26143818510),
(44,2011,20906388,29337006833),
(44,2012,21485266,29104437355),
(44,2013,22077298,32348149947),
(44,2014,22681858,34942948737),
(44,2015,23298368,30916218544),
(44,2016,23926539,32621535419),
(44,2017,24566045,34922782311),
(44,2018,25216237,38502059858),
(45,1960,15248251,3359404118),
(45,1961,15637699,3086746857),
(45,1962,16041190,3779841429),
(45,1963,16461830,6213185743),
(45,1964,16903831,2881545273),
(45,1965,17369883,4043901818),
(45,1966,17862049,4532660182),
(45,1967,18378625,3384063372),
(45,1968,18913878,3909780539),
(45,1969,19459816,5032434970),
(45,1970,20011036,4877684910),
(45,1971,20564067,5594770359),
(45,1972,21121363,6173712814),
(45,1973,21690443,7870239461),
(45,1974,22282136,9596960180),
(45,1975,22903581,10237343174),
(45,1976,23560464,9648583225),
(45,1977,24249130,12344424764),
(45,1978,24956385,15372608002),
(45,1979,25663592,15068422236),
(45,1980,26358908,14394927495),
(45,1981,27040322,12537821038),
(45,1982,27717291,13651667371),
(45,1983,28403851,11006712650),
(45,1984,29119673,7857729193),
(45,1985,29881229,7195042616),
(45,1986,30683869,8095367168),
(45,1987,31528708,7661625473),
(45,1988,32443781,8861299977),
(45,1989,33464765,9021862775),
(45,1990,34612023,9349764580),
(45,1991,35908244,9625436873),
(45,1992,37333914,8227343907),
(45,1993,38815834,10706259937),
(45,1994,40252975,5820382248),
(45,1995,41576234,5643439376),
(45,1996,42757243,5771454940),
(45,1997,43827180,6090840548),
(45,1998,44849967,6215591270),
(45,1999,45919613,4711259427),
(45,2000,47105826,19088046306),
(45,2001,48428545,7438189100),
(45,2002,49871666,8728038525),
(45,2003,51425580,8937567060),
(45,2004,53068880,10297483481),
(45,2005,54785903,11964484668),
(45,2006,56578037,14451902468),
(45,2007,58453683,16737071816),
(45,2008,60411195,19788515874),
(45,2009,62448574,18648373312),
(45,2010,64563854,21565720044),
(45,2011,66755153,25839749199),
(45,2012,69020747,29306235826),
(45,2013,71358807,32679745298),
(45,2014,73767447,35909040266),
(45,2015,76244544,37917704900),
(45,2016,78789127,37134799974),
(45,2017,81398764,38019265626),
(45,2018,84068091,47227535291),
(46,1960,1018253,131731862),
(46,1961,1043116,151675739),
(46,1962,1069238,166521239),
(46,1963,1096638,172233430),
(46,1964,1125352,185693724),
(46,1965,1155392,198318063),
(46,1966,1186785,220613582),
(46,1967,1219541,237397428),
(46,1968,1253760,251247458),
(46,1969,1289522,265040036),
(46,1970,1326885,274960699),
(46,1971,1365899,322128019),
(46,1972,1406522,410669262),
(46,1973,1448637,541973362),
(46,1974,1492055,585364635),
(46,1975,1536654,767102679),
(46,1976,1582358,754549600),
(46,1977,1629209,765224030),
(46,1978,1677332,878771771),
(46,1979,1726866,1198749666),
(46,1980,1777934,1705796850),
(46,1981,1830632,1993512326),
(46,1982,1884875,2160640567),
(46,1983,1940443,2097274290),
(46,1984,1996995,2193581366),
(46,1985,2054312,2160872541),
(46,1986,2112361,1849268215),
(46,1987,2171321,2297753649),
(46,1988,2231465,2212536313),
(46,1989,2293166,2389593022),
(46,1990,2356737,2798746051),
(46,1991,2422305,2724853593),
(46,1992,2489952,2933222714),
(46,1993,2559873,1918970032),
(46,1994,2632345,1769365425),
(46,1995,2707537,2116003978),
(46,1996,2785810,2540697688),
(46,1997,2867280,2322718991),
(46,1998,2951647,1949481297),
(46,1999,3038433,2353909564),
(46,2000,3127411,3219910550),
(46,2001,3217933,2794259783),
(46,2002,3310387,3019993739),
(46,2003,3406922,3495868808),
(46,2004,3510468,4648628921),
(46,2005,3622775,6087003176),
(46,2006,3745141,7731261311),
(46,2007,3876119,8394688284),
(46,2008,4011486,11859013281),
(46,2009,4145391,9593537551),
(46,2010,4273731,12007880439),
(46,2011,4394844,14425607180),
(46,2012,4510198,13677930124),
(46,2013,4622761,14085851348),
(46,2014,4736974,14177437982),
(46,2015,4856095,8553154580),
(46,2016,4980999,9035848071),
(46,2017,5110702,8701334800),
(46,2018,5244363,11263682694),
(48,1960,16057724,4031152977),
(48,1961,16567811,4540447761),
(48,1962,17092918,4955543963),
(48,1963,17629979,4836166667),
(48,1964,18175185,5973366667),
(48,1965,18725245,5760761905),
(48,1966,19279740,5428518519),
(48,1967,19837510,5825170438),
(48,1968,20393699,5960212869),
(48,1969,20942456,6450175214),
(48,1970,21480065,7198360460),
(48,1971,22003980,7820380971),
(48,1972,22516425,8671358733),
(48,1973,23024517,10315760000),
(48,1974,23538386,12370029584),
(48,1975,24065507,13098633902),
(48,1976,24608113,15341403660),
(48,1977,25164545,19470960619),
(48,1978,25733673,23263511958),
(48,1979,26312994,27940411250),
(48,1980,26900506,33400735644),
(48,1981,27496617,36388366869),
(48,1982,28101819,38968039722),
(48,1983,28714190,38729822782),
(48,1984,29331238,38253120738),
(48,1985,29951201,34894411352),
(48,1986,30572478,34942489684),
(48,1987,31195413,36373307085),
(48,1988,31822525,39212550050),
(48,1989,32457499,39540080200),
(48,1990,33102575,47844090710),
(48,1991,33758337,49175565911),
(48,1992,34422569,58418985443),
(48,1993,35091275,66446804803),
(48,1994,35758979,81703500846),
(48,1995,36421438,92507279383),
(48,1996,37076387,97160109278),
(48,1997,37723800,106660000000),
(48,1998,38364309,98443739941),
(48,1999,38999471,86186158685),
(48,2000,39629968,99886577331),
(48,2001,40255967,98211749596),
(48,2002,40875360,97963003805),
(48,2003,41483869,94641378693),
(48,2004,42075955,117082000000),
(48,2005,42647723,145181000000),
(48,2006,43200897,161190000000),
(48,2007,43737516,205707000000),
(48,2008,44254975,241711000000),
(48,2009,44750054,232494000000),
(48,2010,45222700,286104000000),
(48,2011,45663099,334454000000),
(48,2012,46076848,370574000000),
(48,2013,46497267,381867000000),
(48,2014,46969209,381112000000),
(48,2015,47520667,293482000000),
(48,2016,48171392,282825000000),
(48,2017,48901066,311790000000),
(48,2018,49648685,330228000000),
(49,1980,307829,212218226),
(49,1981,317606,196349967),
(49,1982,326946,184008995),
(49,1983,336096,191621958),
(49,1984,345466,184697210),
(49,1985,355337,196726077),
(49,1986,365760,279197696),
(49,1987,376654,337525870),
(49,1988,387963,356500026),
(49,1989,399632,341476764),
(49,1990,411594,429622147),
(49,1991,423872,424108796),
(49,1992,436448,457388578),
(49,1993,449274,452881443),
(49,1994,462277,319189200),
(49,1995,475394,398461789),
(49,1996,488627,396053797),
(49,1997,501953,364445589),
(49,1998,515385,370106776),
(49,1999,528848,382454989),
(49,2000,542357,350264287),
(49,2001,555888,378180913),
(49,2002,569479,423962976),
(49,2003,583211,545658929),
(49,2004,597228,632570092),
(49,2005,611627,653584808),
(49,2006,626425,697810988),
(49,2007,641620,794621676),
(49,2008,657229,911967428),
(49,2009,673252,901711442),
(49,2010,689692,907093130),
(49,2011,706569,1021746833),
(49,2012,723871,1015901205),
(49,2013,741505,1115906342),
(49,2014,759390,1148058015),
(49,2015,777424,988150249),
(49,2016,795592,1024261821),
(49,2017,813892,1068124330),
(49,2018,832322,1203080508),
(50,1980,283847,142246875),
(50,1981,288677,139468114),
(50,1982,294254,140630758),
(50,1983,300230,138476239),
(50,1984,306136,132019065),
(50,1985,311678,137728155),
(50,1986,316616,190651208),
(50,1987,321135,235253171),
(50,1988,325746,264308140),
(50,1989,331179,267448513),
(50,1990,337950,306891107),
(50,1991,346230,319827058),
(50,1992,355757,357160985),
(50,1993,366053,490417389),
(50,1994,376407,406580652),
(50,1995,386284,487148993),
(50,1996,395533,501979069),
(50,1997,404259,490608657),
(50,1998,412514,521910560),
(50,1999,420452,592416703),
(50,2000,428188,539227277),
(50,2001,435709,563024383),
(50,2002,442951,620974660),
(50,2003,449930,813963830),
(50,2004,456617,924318490),
(50,2005,463032,971977088),
(50,2006,469170,1107891063),
(50,2007,475060,1513933983),
(50,2008,480842,1789333749),
(50,2009,486671,1711817182),
(50,2010,492654,1664310770),
(50,2011,498856,1864824081),
(50,2012,505235,1751888562),
(50,2013,511748,1850470042),
(50,2014,518269,1859898513),
(50,2015,524743,1596800287),
(50,2016,531146,1662998678),
(50,2017,537497,1771235958),
(50,2018,543767,1986928612),
(51,1960,1330782,507513830),
(51,1961,1381183,490325181),
(51,1962,1433335,479180824),
(51,1963,1486553,511902136),
(51,1964,1539941,542578367),
(51,1965,1592841,592981162),
(51,1966,1645083,647305630),
(51,1967,1696732,699456618),
(51,1968,1747694,773841494),
(51,1969,1797893,853630203),
(51,1970,1847394,984830158),
(51,1971,1896077,1077152902),
(51,1972,1944169,1238251696),
(51,1973,1992514,1528916185),
(51,1974,2042241,1666544754),
(51,1975,2094188,1960863466),
(51,1976,2148677,2412555426),
(51,1977,2205615,3072427013),
(51,1978,2264946,3523208810),
(51,1979,2326464,4035519323),
(51,1980,2389977,4831447001),
(51,1981,2455588,2623807074),
(51,1982,2523354,2606621255),
(51,1983,2593020,3146770104),
(51,1984,2664223,3660476459),
(51,1985,2736712,3919203960),
(51,1986,2810242,4418983871),
(51,1987,2884851,4532952047),
(51,1988,2960929,4614629898),
(51,1989,3039013,5251025767),
(51,1990,3119433,5711687787),
(51,1991,3202085,7168999670),
(51,1992,3286520,8528593421),
(51,1993,3372298,9537297723),
(51,1994,3458834,10432619326),
(51,1995,3545534,11513472786),
(51,1996,3632362,11618286652),
(51,1997,3718949,12552071488),
(51,1998,3803887,13617405297),
(51,1999,3885430,14195623343),
(51,2000,3962372,14949514493),
(51,2001,4034074,15913363441),
(51,2002,4100925,16504795593),
(51,2003,4164053,17196009811),
(51,2004,4225155,18528955525),
(51,2005,4285502,19948261084),
(51,2006,4345412,22602721765),
(51,2007,4404628,26743972912),
(51,2008,4463125,30612927861),
(51,2009,4520740,30562363430),
(51,2010,4577378,37268616184),
(51,2011,4633086,42262694504),
(51,2012,4688000,46473131799),
(51,2013,4742107,49745084870),
(51,2014,4795396,50577769785),
(51,2015,4847804,54775997556),
(51,2016,4899345,57157995873),
(51,2017,4949954,58174550212),
(51,2018,4999441,60126014829),
(52,1970,8712541,5693005200),
(52,1971,8868083,6914658400),
(52,1972,9025345,8135150892),
(52,1973,9178804,9987709650),
(52,1974,9320945,11405957317),
(52,1975,9446442,13027415244),
(52,1976,9554188,13789579903),
(52,1977,9646142,14206158675),
(52,1978,9724044,17844705325),
(52,1979,9790851,19584443288),
(52,1980,9849459,19912889861),
(52,1981,9898889,20150254096),
(52,1982,9940317,20953510235),
(52,1983,9981304,22204940512),
(52,1984,10031649,24039383608),
(52,1985,10097911,22920490774),
(52,1986,10183899,24226574634),
(52,1987,10286643,25213935012),
(52,1988,10397511,27458999472),
(52,1989,10503972,27023468666),
(52,1990,10596987,28645436569),
(52,1991,10673542,24316556026),
(52,1992,10736387,22085858243),
(52,1993,10789306,22367254865),
(52,1994,10838462,28448326757),
(52,1995,10888252,30429803651),
(52,1996,10939293,25017368697),
(52,1997,10989732,25365908059),
(52,1998,11038692,25736331247),
(52,1999,11084670,28364615242),
(52,2000,11126430,30565400000),
(52,2001,11164667,31682400000),
(52,2002,11199651,33590500000),
(52,2003,11229183,35901200000),
(52,2004,11250365,38203000000),
(52,2005,11261582,42643836075),
(52,2006,11261248,52742800000),
(52,2007,11251122,58603900000),
(52,2008,11236971,60806300000),
(52,2009,11226709,62080000000),
(52,2010,11225832,64328000000),
(52,2011,11236670,68990000000),
(52,2012,11257101,73141000000),
(52,2013,11282720,77148000000),
(52,2014,11306902,80656000000),
(52,2015,11324781,87133000000),
(52,2016,11335109,91370000000),
(52,2017,11339259,96851000000),
(54,2005,49261,2315972639),
(54,2006,50740,4227798075),
(54,2017,63382,3570575151),
(55,1975,649751,489914760),
(55,1976,657527,576090073),
(55,1977,665525,734887974),
(55,1978,673247,964026512),
(55,1979,680005,1288715210),
(55,1980,685405,2154311277),
(55,1981,689173,2087496374),
(55,1982,691702,2159242417),
(55,1983,694077,2160364071),
(55,1984,697714,2278248953),
(55,1985,703685,2430411900),
(55,1986,712340,3090734463),
(55,1987,723376,3704813886),
(55,1988,736474,4278792597),
(55,1989,751047,4563482604),
(55,1990,766615,5591130218),
(55,1991,783124,5770197348),
(55,1992,800611,6912150456),
(55,1993,818746,6590291048),
(55,1994,837110,7425703929),
(55,1995,855383,9933143596),
(55,1996,873423,10011919699),
(55,1997,891190,9547822121),
(55,1998,908702,10248619910),
(55,1999,926046,10497907228),
(55,2000,943290,9985843544),
(55,2001,960276,10397896175),
(55,2002,976964,11420230769),
(55,2003,993563,14547327293),
(55,2004,1010408,17320550000),
(55,2005,1027662,18433416242),
(55,2006,1045507,20072788860),
(55,2007,1063713,23968765398),
(55,2008,1081563,27839724623),
(55,2009,1098083,25942664629),
(55,2010,1112612,25562264901),
(55,2011,1124833,27426994718),
(55,2012,1135046,25041397919),
(55,2013,1143866,24084559214),
(55,2014,1152285,23364707443),
(55,2015,1160985,19680625485),
(55,2016,1170187,20453761062),
(55,2017,1179680,22141864999),
(55,2018,1189265,24469841832),
(56,1990,10333355,40477403220),
(56,1991,10308578,29675502270),
(56,1992,10319123,34590052812),
(56,1993,10329855,40614350197),
(56,1994,10333587,47554674591),
(56,1995,10327253,59775697061),
(56,1996,10315241,66985765439),
(56,1997,10304131,61792161168),
(56,1998,10294373,66490372105),
(56,1999,10283860,64867483193),
(56,2000,10255063,61649492817),
(56,2001,10216605,67523642262),
(56,2002,10196916,81910771994),
(56,2003,10193998,99627140274),
(56,2004,10197101,119162000000),
(56,2005,10211216,136281000000),
(56,2006,10238905,155464000000),
(56,2007,10298828,189227000000),
(56,2008,10384603,235719000000),
(56,2009,10443936,206180000000),
(56,2010,10474410,207478000000),
(56,2011,10496088,227948000000),
(56,2012,10510785,207376000000),
(56,2013,10514272,209402000000),
(56,2014,10525347,207818000000),
(56,2015,10546059,186830000000),
(56,2016,10566332,195090000000),
(56,2017,10594438,215914000000),
(56,2018,10625695,245226000000),
(57,1970,78169289,215022000000),
(57,1971,78312842,249039000000),
(57,1972,78688452,298667000000),
(57,1973,78936666,396867000000),
(57,1974,78967433,443619000000),
(57,1975,78673554,488780000000),
(57,1976,78336950,517788000000),
(57,1977,78159814,598226000000),
(57,1978,78091820,737668000000),
(57,1979,78126350,878011000000),
(57,1980,78288576,946695000000),
(57,1981,78407907,797443000000),
(57,1982,78333366,773638000000),
(57,1983,78128282,767768000000),
(57,1984,77858685,722368000000),
(57,1985,77684873,729763000000),
(57,1986,77720436,1042300000000),
(57,1987,77839920,1293260000000),
(57,1988,78144619,1395930000000),
(57,1989,78751283,1393670000000),
(57,1990,79433029,1764970000000),
(57,1991,80013896,1861870000000),
(57,1992,80624598,2123130000000),
(57,1993,81156363,2068560000000),
(57,1994,81438348,2205970000000),
(57,1995,81678051,2591620000000),
(57,1996,81914831,2503670000000),
(57,1997,82034771,2218690000000),
(57,1998,82047195,2243230000000),
(57,1999,82100243,2199960000000),
(57,2000,82211508,1949950000000),
(57,2001,82349925,1950650000000),
(57,2002,82488495,2079140000000),
(57,2003,82534176,2505730000000),
(57,2004,82516260,2819250000000),
(57,2005,82469422,2861410000000),
(57,2006,82376451,3002450000000),
(57,2007,82266372,3439950000000),
(57,2008,82110097,3752370000000),
(57,2009,81902307,3418010000000),
(57,2010,81776930,3417090000000),
(57,2011,80274983,3757700000000),
(57,2012,80425823,3543980000000),
(57,2013,80645605,3752510000000),
(57,2014,80982500,3898730000000),
(57,2015,81686611,3381390000000),
(57,2016,82348669,3495160000000),
(57,2017,82657002,3693200000000),
(57,2018,82927922,3996760000000),
(58,1985,425613,340989528),
(58,1987,490330,373371738),
(58,1988,528999,395794538),
(58,1989,563864,409220087),
(58,1990,590398,452328087),
(58,1991,606844,462421998),
(58,1992,615054,478058304),
(58,1993,618495,466048469),
(58,1994,622366,491689220),
(58,1995,630388,497723960),
(58,1996,643654,494004647),
(58,1997,660863,502675542),
(58,1998,680463,514267869),
(58,1999,699975,536080148),
(58,2000,717584,551230861),
(58,2001,733015,572417440),
(58,2002,746942,591122039),
(58,2003,759641,622044665),
(58,2004,771603,666072101),
(58,2005,783254,708633194),
(58,2006,794563,768873684),
(58,2007,805451,847918929),
(58,2008,816358,999105339),
(58,2009,827823,1049110685),
(58,2010,840198,1128611700),
(58,2011,853674,1239144502),
(58,2012,868136,1353632942),
(58,2013,883293,1324733712),
(58,2014,898696,1455035089),
(58,2015,913993,1633741923),
(58,2016,929112,1764268469),
(58,2017,944097,1844674435),
(58,2018,958920,1965982322),
(59,1977,73440,45872947),
(59,1978,74284,57130215),
(59,1979,74955,55017758),
(59,1980,75314,72804653),
(59,1981,75309,82107391),
(59,1982,75003,89527576),
(59,1983,74483,98665191),
(59,1984,73851,109157070),
(59,1985,73201,119491933),
(59,1986,72533,135161958),
(59,1987,71842,151868754),
(59,1988,71208,171106184),
(59,1989,70723,185137243),
(59,1990,70419,201428730),
(59,1991,70374,219763222),
(59,1992,70544,234058259),
(59,1993,70831,245527592),
(59,1994,71043,264375666),
(59,1995,71098,274522148),
(59,1996,70936,292286000),
(59,1997,70599,302989185),
(59,1998,70185,322409851),
(59,1999,69835,331759000),
(59,2000,69650,333468888),
(59,2001,69661,340205074),
(59,2002,69837,333195185),
(59,2003,70100,343310666),
(59,2004,70382,367199111),
(59,2005,70589,364255074),
(59,2006,70718,390250148),
(59,2007,70795,421375851),
(59,2008,70827,458190185),
(59,2009,70851,489074333),
(59,2010,70878,493824413),
(59,2011,70916,501025303),
(59,2012,70965,485997988),
(59,2013,71016,501979134),
(59,2014,71085,523540777),
(59,2015,71183,540830670),
(59,2016,71307,575468234),
(59,2017,71458,496726248),
(59,2018,71625,503646211),
(60,1960,4579603,6248946880),
(60,1961,4611687,6933842099),
(60,1962,4647727,7812968114),
(60,1963,4684483,8316692386),
(60,1964,4722072,9506678763),
(60,1965,4759012,10678897387),
(60,1966,4797381,11721248101),
(60,1967,4835354,12788479692),
(60,1968,4864883,13196541952),
(60,1969,4891860,15009384585),
(60,1970,4928757,17075457600),
(60,1971,4963126,19085731252),
(60,1972,4991596,23232379952),
(60,1973,5021861,30730626663),
(60,1974,5045297,34160444798),
(60,1975,5059862,40474406216),
(60,1976,5072596,44575892473),
(60,1977,5088419,49784338519),
(60,1978,5104248,60362931854),
(60,1979,5116801,70366241969),
(60,1980,5123027,71127528700),
(60,1981,5121572,61877813965),
(60,1982,5117810,60412844679),
(60,1983,5114297,60644782176),
(60,1984,5111619,59105236854),
(60,1985,5113691,62658568287),
(60,1986,5120534,88078760104),
(60,1987,5127024,109414000000),
(60,1988,5129516,115553000000),
(60,1989,5132594,112409000000),
(60,1990,5140939,138247000000),
(60,1991,5154298,139225000000),
(60,1992,5171370,152916000000),
(60,1993,5188628,143196000000),
(60,1994,5206180,156162000000),
(60,1995,5233373,185007000000),
(60,1996,5263074,187632000000),
(60,1997,5284991,173538000000),
(60,1998,5304219,176992000000),
(60,1999,5321799,177965000000),
(60,2000,5339616,164159000000),
(60,2001,5358783,164791000000),
(60,2002,5375931,178635000000),
(60,2003,5390574,218096000000),
(60,2004,5404523,251373000000),
(60,2005,5419432,264467000000),
(60,2006,5437272,282885000000),
(60,2007,5461438,319423000000),
(60,2008,5493621,353361000000),
(60,2009,5523095,321241000000),
(60,2010,5547683,321995000000),
(60,2011,5570572,344003000000),
(60,2012,5591572,327149000000),
(60,2013,5614932,343584000000),
(60,2014,5643475,352994000000),
(60,2015,5683483,302673000000),
(60,2016,5728010,311988000000),
(60,2017,5764980,329866000000),
(60,2018,5797446,352058000000),
(61,1960,3294224,672399700),
(61,1961,3406280,654100200),
(61,1962,3521018,824100000),
(61,1963,3638109,940799900),
(61,1964,3757132,1025599900),
(61,1965,3877765,888100000),
(61,1966,3999796,983900000),
(61,1967,4123092,1034800000),
(61,1968,4247558,1079100000),
(61,1969,4373124,1230500000),
(61,1970,4499720,1485500000),
(61,1971,4627210,1666500000),
(61,1972,4755459,1987400000),
(61,1973,4884461,2344800000),
(61,1974,5014189,2925700000),
(61,1975,5144637,3599200000),
(61,1976,5275770,3951500000),
(61,1977,5407500,4587100000),
(61,1978,5539590,4734400000),
(61,1979,5671797,5498800000),
(61,1980,5803927,6761300000),
(61,1981,5935909,7561300000),
(61,1982,6067770,8267400000),
(61,1983,6199661,9220600000),
(61,1984,6331764,11594000000),
(61,1985,6464229,5044592945),
(61,1986,6596962,6122198120),
(61,1987,6729933,5826987099),
(61,1988,6863441,5374314928),
(61,1989,6997888,6686593060),
(61,1990,7133494,7073675545),
(61,1991,7270409,9734321854),
(61,1992,7408342,11356271336),
(61,1993,7546463,13081042400),
(61,1994,7683707,14664237667),
(61,1995,7819247,16598679279),
(61,1996,7952763,18241691857),
(61,1997,8084407,20017908829),
(61,1998,8214426,21672526563),
(61,1999,8343283,22137599986),
(61,2000,8471321,24305116729),
(61,2001,8598601,25599311449),
(61,2002,8724975,27362875603),
(61,2003,8850317,21642882856),
(61,2004,8974444,22692574473),
(61,2005,9097257,36119047252),
(61,2006,9218686,38116351526),
(61,2007,9338861,44169678153),
(61,2008,9458075,48288967303),
(61,2009,9576737,48376555306),
(61,2010,9695121,53982886258),
(61,2011,9813210,57811180659),
(61,2012,9930911,60657780261),
(61,2013,10048224,62661773592),
(61,2014,10165178,66065015410),
(61,2015,10281680,68802092021),
(61,2016,10397743,72342967648),
(61,2017,10513131,75931656815),
(61,2018,10627165,81298585403),
(62,1960,11057863,2723648552),
(62,1961,11336339,2434776646),
(62,1962,11619828,2001468868),
(62,1963,11912803,2703014867),
(62,1964,12221675,2909351793),
(62,1965,12550885,3136258897),
(62,1966,12902627,3039834559),
(62,1967,13275026,3370843066),
(62,1968,13663583,3852115817),
(62,1969,14061722,4257218772),
(62,1970,14464985,4863487493),
(62,1971,14872250,5077222367),
(62,1972,15285990,6761786387),
(62,1973,15709825,8715105930),
(62,1974,16149025,13209713643),
(62,1975,16607707,15557934268),
(62,1976,17085801,17728347375),
(62,1977,17582904,20971901273),
(62,1978,18102266,26364491313),
(62,1979,18647815,33243422158),
(62,1980,19221665,42345277342),
(62,1981,19824301,44348672668),
(62,1982,20452902,45207088716),
(62,1983,21101875,48801369800),
(62,1984,21763575,53698278906),
(62,1985,22431502,57937868670),
(62,1986,23102389,63696301893),
(62,1987,23774284,66742267773),
(62,1988,24443467,59089067187),
(62,1989,25106190,55631489802),
(62,1990,25758869,62045099643),
(62,1991,26400479,45715367087),
(62,1992,27028326,48003298223),
(62,1993,27635515,49946455211),
(62,1994,28213774,42542571306),
(62,1995,28757785,41764052458),
(62,1996,29266405,46941496780),
(62,1997,29742979,48177862502),
(62,1998,30192754,48187747529),
(62,1999,30623406,48640574567),
(62,2000,31042235,54790245601),
(62,2001,31451514,54744714396),
(62,2002,31855109,56760288974),
(62,2003,32264157,67863829880),
(62,2004,32692163,85324998814),
(62,2005,33149724,103198000000),
(62,2006,33641002,117027000000),
(62,2007,34166972,134977000000),
(62,2008,34730608,171001000000),
(62,2009,35333881,137211000000),
(62,2010,35977455,161207000000),
(62,2011,36661444,200019000000),
(62,2012,37383887,209059000000),
(62,2013,38140132,209755000000),
(62,2014,38923687,213810000000),
(62,2015,39728025,165979000000),
(62,2016,40551404,160130000000),
(62,2017,41389198,167555000000),
(62,2018,42228429,180689000000),
(63,1960,4543666,2069465326),
(63,1961,4674172,1753850417),
(63,1962,4809201,1518208221),
(63,1963,4948986,1824344492),
(63,1964,5093854,2244146868),
(63,1965,5243977,2387048255),
(63,1966,5399422,2429309514),
(63,1967,5560012,2553596092),
(63,1968,5725459,2582180794),
(63,1969,5895367,3112166848),
(63,1970,6069376,2862504170),
(63,1971,6247418,2754220263),
(63,1972,6429379,3185987235),
(63,1973,6614843,3891755552),
(63,1974,6803280,6599259421),
(63,1975,6994334,7731677257),
(63,1976,7187787,9091924305),
(63,1977,7383724,11026346590),
(63,1978,7582353,11922502171),
(63,1979,7784072,14175166008),
(63,1980,7989186,17881514683),
(63,1981,8197652,21810767209),
(63,1982,8409397,19929853575),
(63,1983,8624594,17152483214),
(63,1984,8843462,16912515183),
(63,1985,9066109,17149094590),
(63,1986,9292474,15314143988),
(63,1987,9522360,13945431882),
(63,1988,9755579,13051886552),
(63,1989,9991870,13890828708),
(63,1990,10230934,15239278100),
(63,1991,10472475,16988535268),
(63,1992,10716129,18094238119),
(63,1993,10961466,18938717359),
(63,1994,11208001,22708673337),
(63,1995,11455204,24432884442),
(63,1996,11703174,25226393197),
(63,1997,11951452,28162053027),
(63,1998,12198449,27981896948),
(63,1999,12442115,19645272636),
(63,2000,12681123,18327764882),
(63,2001,12914667,24468324000),
(63,2002,13143465,28548945000),
(63,2003,13369678,32432858000),
(63,2004,13596388,36591661000),
(63,2005,13825847,41507085000),
(63,2006,14059384,46802044000),
(63,2007,14296557,51007777000),
(63,2008,14535739,61762635000),
(63,2009,14774424,62519686000),
(63,2010,15011117,69555367000),
(63,2011,15243883,79276664000),
(63,2012,15474102,87924544000),
(63,2013,15707474,95129659000),
(63,2014,15951838,101726000000),
(63,2015,16212020,99290381000),
(63,2016,16491115,99937696000),
(63,2017,16785361,104296000000),
(63,2018,17084357,108398000000),
(64,1965,30433022,4948667540),
(64,1966,31237600,5278005612),
(64,1967,32056510,5605484299),
(64,1968,32881848,5932242991),
(64,1969,33703139,6524455206),
(64,1970,34513850,8042200452),
(64,1971,35311910,8609283346),
(64,1972,36102659,9299638056),
(64,1973,36896554,10098534613),
(64,1974,37708146,9228963225),
(64,1975,38549142,11632178869),
(64,1976,39422730,13315988083),
(64,1977,40329589,14400806876),
(64,1978,41275736,14811704063),
(64,1979,42267435,18020571429),
(64,1980,43309063,21669908177),
(64,1981,44400113,22136081081),
(64,1982,45539296,27655172414),
(64,1983,46728286,30966239814),
(64,1984,47968642,33971188992),
(64,1985,49258732,39053502251),
(64,1986,50602354,41253507951),
(64,1987,51991700,40455616654),
(64,1988,53399246,34980124929),
(64,1989,54788685,39756299050),
(64,1990,56134475,42978914311),
(64,1991,57424549,37387836491),
(64,1992,58666814,41855986519),
(64,1993,59880658,46578631453),
(64,1994,61095804,51897983393),
(64,1995,62334034,60159245060),
(64,1996,63601629,67629716981),
(64,1997,64892270,78436578171),
(64,1998,66200269,84828807556),
(64,1999,67515591,90710704807),
(64,2000,68831561,99838543960),
(64,2001,70152661,97632008710),
(64,2002,71485043,87850683979),
(64,2003,72826097,82924503943),
(64,2004,74172073,78845185293),
(64,2005,75523569,89685725230),
(64,2006,76873663,107484000000),
(64,2007,78232126,130479000000),
(64,2008,79636079,162818000000),
(64,2009,81134798,188982000000),
(64,2010,82761235,218888000000),
(64,2011,84529250,236002000000),
(64,2012,86422240,279373000000),
(64,2013,88404640,288586000000),
(64,2014,90424654,305530000000),
(64,2015,92442547,332698000000),
(64,2016,94447072,332928000000),
(64,2017,96442593,235369000000),
(64,2018,98423595,250895000000),
(65,1992,2257596,477101651),
(65,1993,2238626,467872714),
(65,1994,2218430,531688311),
(65,1995,2204222,578015625),
(65,1996,2196464,693535954),
(65,1997,2195179,686490090),
(65,1998,2206432,745526154),
(65,1999,2237405,688921325),
(65,2000,2292416,706370815),
(65,2001,2374722,752368495),
(65,2002,2481058,729321366),
(65,2003,2600973,870247703),
(65,2004,2719803,1109054005),
(65,2005,2826659,1098425901),
(65,2006,2918205,1211161880),
(65,2007,2996536,1317974491),
(65,2008,3062779,1380188800),
(65,2009,3119920,1856695551),
(65,2010,3170435,2117039512),
(65,2011,3213972,2607739837),
(67,1960,30455000,12072126075),
(67,1961,30739250,13834300571),
(67,1962,31023366,16138545209),
(67,1963,31296651,19074913948),
(67,1964,31609195,21343844644),
(67,1965,31954292,24756958695),
(67,1966,32283194,28721062242),
(67,1967,32682947,31647119228),
(67,1968,33113134,31475548481),
(67,1969,33441054,36038711600),
(67,1970,33814531,40881655099),
(67,1971,34224490,46492797365),
(67,1972,34604469,58971806627),
(67,1973,34988947,78425934894),
(67,1974,35373335,97009800115),
(67,1975,35757900,114465000000),
(67,1976,36137812,118185000000),
(67,1977,36511638,132090000000),
(67,1978,36864898,160163000000),
(67,1979,37191330,214019000000),
(67,1980,37491165,232135000000),
(67,1981,37758631,202257000000),
(67,1982,37986012,195464000000),
(67,1983,38171525,170487000000),
(67,1984,38330364,171635000000),
(67,1985,38469512,180302000000),
(67,1986,38584624,250638000000),
(67,1987,38684815,317882000000),
(67,1988,38766939,375139000000),
(67,1989,38827764,413631000000),
(67,1990,38867322,535101000000),
(67,1991,38966376,575599000000),
(67,1992,39157685,629202000000),
(67,1993,39361262,523649000000),
(67,1994,39549108,529122000000),
(67,1995,39724050,612940000000),
(67,1996,39889852,640998000000),
(67,1997,40057389,588692000000),
(67,1998,40223509,617042000000),
(67,1999,40386875,633194000000),
(67,2000,40567864,595403000000),
(67,2001,40850412,625976000000),
(67,2002,41431558,705146000000),
(67,2003,42187645,906853000000),
(67,2004,42921895,1069560000000),
(67,2005,43653155,1157280000000),
(67,2006,44397319,1264550000000),
(67,2007,45226803,1479340000000),
(67,2008,45954106,1635020000000),
(67,2009,46362946,1499100000000),
(67,2010,46576897,1431620000000),
(67,2011,46742697,1488070000000),
(67,2012,46773055,1336020000000),
(67,2013,46620045,1361850000000),
(67,2014,46480882,1376910000000),
(67,2015,46444832,1199080000000),
(67,2016,46483569,1237500000000),
(67,2017,46593236,1314310000000),
(67,2018,46723749,1426190000000),
(68,1995,1436634,4373665146),
(68,1996,1415594,4746109767),
(68,1997,1399535,5066240419),
(68,1998,1386156,5617109245),
(68,1999,1390244,5726897998),
(68,2000,1396985,5685774809),
(68,2001,1388115,6245069734),
(68,2002,1379350,7322069511),
(68,2003,1370720,9833870709),
(68,2004,1362550,12059201242),
(68,2005,1354775,14006088297),
(68,2006,1346810,16963625016),
(68,2007,1340680,22237061730),
(68,2008,1337090,24194039256),
(68,2009,1334515,19652492637),
(68,2010,1331475,19490936349),
(68,2011,1327439,23170239901),
(68,2012,1322696,23043864510),
(68,2013,1317997,25137153149),
(68,2014,1314545,26615854605),
(68,2015,1315407,22904456872),
(68,2016,1315790,23984296771),
(68,2017,1317384,26611651599),
(68,2018,1320884,30284890757),
(69,1981,35984528,7324903188),
(69,1982,36995248,7707678019),
(69,1983,38142674,8567890821),
(69,1984,39374348,8096302367),
(69,1985,40652141,9480840483),
(69,1986,41965693,9848600870),
(69,1987,43329231,10527338647),
(69,1988,44757203,10908935749),
(69,1989,46272299,11476584879),
(69,1990,47887865,12175166763),
(69,1991,49609969,13463868357),
(69,1992,51423585,10492993078),
(69,1993,53295566,8830712714),
(69,1994,55180998,6927950565),
(69,1995,57047908,7663984568),
(69,1996,58883530,8547939731),
(69,1997,60697443,8589211390),
(69,1998,62507724,7818224906),
(69,1999,64343013,7700833482),
(69,2000,66224804,8242392104),
(69,2001,68159423,8231326016),
(69,2002,70142091,7850809498),
(69,2003,72170584,8623691300),
(69,2004,74239505,10131187261),
(69,2005,76346311,12401139454),
(69,2006,78489206,15280861835),
(69,2007,80674348,19707616773),
(69,2008,82916235,27066912635),
(69,2009,85233913,32437389116),
(69,2010,87639964,29933790334),
(69,2011,90139927,31952763089),
(69,2012,92726971,43310721414),
(69,2013,95385785,47648211133),
(69,2014,98094253,55612228234),
(69,2015,100835458,64464547915),
(69,2016,103603501,74271281811),
(69,2017,106400024,81716326731),
(69,2018,109224559,84355462494),
(70,1960,4429634,5224102196),
(70,1961,4461005,5921659485),
(70,1962,4491443,6340580854),
(70,1963,4523309,6885920329),
(70,1964,4548543,7766655086),
(70,1965,4563732,8589340019),
(70,1966,4580869,9208524505),
(70,1967,4605744,9368954010),
(70,1968,4626469,8823033880),
(70,1969,4623785,10070766721),
(70,1970,4606307,11365953567),
(70,1971,4612124,12536710287),
(70,1972,4639657,14754136507),
(70,1973,4666081,19486826980),
(70,1974,4690574,24867278714),
(70,1975,4711440,29494515597),
(70,1976,4725664,31873171719),
(70,1977,4738902,33524682308),
(70,1978,4752528,36283091408),
(70,1979,4764690,44498283621),
(70,1980,4779535,53685049410),
(70,1981,4799964,52485533205),
(70,1982,4826933,52832120390),
(70,1983,4855787,51014090521),
(70,1984,4881803,52926394935),
(70,1985,4902206,55914236378),
(70,1986,4918154,73586676050),
(70,1987,4932123,91642093873),
(70,1988,4946481,109103000000),
(70,1989,4964371,119065000000),
(70,1990,4986431,141518000000),
(70,1991,5013740,127866000000),
(70,1992,5041992,112625000000),
(70,1993,5066447,89255751015),
(70,1994,5088333,103322000000),
(70,1995,5107790,134199000000),
(70,1996,5124573,132099000000),
(70,1997,5139835,126833000000),
(70,1998,5153498,133936000000),
(70,1999,5165474,135226000000),
(70,2000,5176209,125540000000),
(70,2001,5188008,129250000000),
(70,2002,5200598,139553000000),
(70,2003,5213014,171071000000),
(70,2004,5228172,196768000000),
(70,2005,5246096,204436000000),
(70,2006,5266268,216553000000),
(70,2007,5288720,255385000000),
(70,2008,5313399,283742000000),
(70,2009,5338871,251499000000),
(70,2010,5363352,247800000000),
(70,2011,5388272,273674000000),
(70,2012,5413971,256706000000),
(70,2013,5438972,269980000000),
(70,2014,5461512,272609000000),
(70,2015,5479531,232851000000),
(70,2016,5495303,239010000000),
(70,2017,5508214,252331000000),
(70,2018,5518050,273961000000),
(71,1960,393481,112328422),
(71,1961,407249,116987784),
(71,1962,421665,122906435),
(71,1963,436293,129454728),
(71,1964,450542,140032741),
(71,1965,463968,147084750),
(71,1966,476404,150603925),
(71,1967,487981,162625885),
(71,1968,498940,166952937),
(71,1969,509704,182182067),
(71,1970,520562,219878482),
(71,1971,531635,247749327),
(71,1972,542844,316650509),
(71,1973,554138,425963359),
(71,1974,565415,558589870),
(71,1975,576626,684268280),
(71,1976,587557,694552411),
(71,1977,598296,719533137),
(71,1978,609383,829239489),
(71,1979,621585,1019743927),
(71,1980,635307,1202567359),
(71,1981,651021,1235899836),
(71,1982,668280,1194015444),
(71,1983,685497,1123107276),
(71,1984,700483,1177997414),
(71,1985,711775,1141210125),
(71,1986,718639,1290228617),
(71,1987,721783,1177908192),
(71,1988,722930,1109976928),
(71,1989,724594,1182686577),
(71,1990,728573,1337024782),
(71,1991,735401,1383843860),
(71,1992,744469,1531803061),
(71,1993,754963,1635426125),
(71,1994,765609,1825285158),
(71,1995,775425,1970347721),
(71,1996,784386,2129266728),
(71,1997,792736,2093994597),
(71,1998,800157,1656784780),
(71,1999,806303,1942170999),
(71,2000,811006,1684109743),
(71,2001,813925,1660102346),
(71,2002,815257,1842691481),
(71,2003,816076,2315935753),
(71,2004,817860,2727507213),
(71,2005,821604,3006725015),
(71,2006,827870,3102741451),
(71,2007,836190,3405050612),
(71,2008,845361,3523185920),
(71,2009,853637,2870624636),
(71,2010,859818,3140508836),
(71,2011,863449,3774530616),
(71,2012,865069,3972012571),
(71,2013,865608,4190143206),
(71,2014,866453,4856963252),
(71,2015,868627,4682546881),
(71,2016,872399,4926740194),
(71,2017,877459,5270335185),
(71,2018,883483,5479504926),
(73,1960,46621669,62651474947),
(73,1961,47240543,68346741504),
(73,1962,47904877,76313782252),
(73,1963,48582611,85551113767),
(73,1964,49230595,94906593388),
(73,1965,49818028,102161000000),
(73,1966,50330262,110597000000),
(73,1967,50775794,119466000000),
(73,1968,51175508,129847000000),
(73,1969,51561836,140725000000),
(73,1970,51957738,148456000000),
(73,1971,52371342,165967000000),
(73,1972,52793138,203494000000),
(73,1973,53207734,264430000000),
(73,1974,53592233,285552000000),
(73,1975,53931390,360832000000),
(73,1976,54220022,372319000000),
(73,1977,54467702,410279000000),
(73,1978,54691851,506708000000),
(73,1979,54917118,613953000000),
(73,1980,55161527,701288000000),
(73,1981,55430296,615552000000),
(73,1982,55718933,584878000000),
(73,1983,56023770,559869000000),
(73,1984,56337666,530684000000),
(73,1985,56654696,553138000000),
(73,1986,56976123,771471000000),
(73,1987,57302663,934173000000),
(73,1988,57627105,1018850000000),
(73,1989,57940212,1025210000000),
(73,1990,58235697,1269180000000),
(73,1991,58559311,1269280000000),
(73,1992,58851217,1401470000000),
(73,1993,59106768,1322820000000),
(73,1994,59327192,1393980000000),
(73,1995,59541899,1601090000000),
(73,1996,59753100,1605680000000),
(73,1997,59964851,1452880000000),
(73,1998,60186288,1503110000000),
(73,1999,60496718,1492650000000),
(73,2000,60912500,1362250000000),
(73,2001,61357430,1376470000000),
(73,2002,61805267,1494290000000),
(73,2003,62244886,1840480000000),
(73,2004,62704895,2115740000000),
(73,2005,63179351,2196130000000),
(73,2006,63621381,2318590000000),
(73,2007,64016225,2657210000000),
(73,2008,64374984,2918380000000),
(73,2009,64707040,2690220000000),
(73,2010,65027507,2642610000000),
(73,2011,65342780,2861410000000),
(73,2012,65659809,2683830000000),
(73,2013,65998687,2811080000000),
(73,2014,66316100,2852170000000),
(73,2015,66593366,2438210000000),
(73,2016,66859768,2471290000000),
(73,2017,66865144,2586290000000),
(73,2018,66987244,2777540000000),
(74,1998,46096,1107882641),
(74,1999,46436,1120280382),
(74,2000,46735,1058702725),
(74,2001,46997,1147654635),
(74,2002,47233,1262669892),
(74,2003,47432,1494011567),
(74,2004,47600,1688237552),
(74,2005,47722,1727792693),
(74,2006,47792,1984445416),
(74,2007,47825,2290133549),
(74,2008,47820,2432415998),
(74,2009,47808,2268387771),
(74,2010,47814,2320424601),
(74,2011,47823,2490807831),
(74,2012,47843,2366301252),
(74,2013,47892,2627049837),
(74,2014,47960,2850743875),
(74,2015,48051,2518096286),
(74,2016,48173,2689157271),
(75,1983,80629,106500000),
(75,1986,87905,112210000),
(75,1987,89979,116700000),
(75,1988,91985,124700000),
(75,1989,94057,135200000),
(75,1990,96301,147200000),
(75,1991,98770,166200000),
(75,1992,101389,178100000),
(75,1993,103915,198400000),
(75,1994,106030,202500000),
(75,1995,107529,222103600),
(75,1996,108321,218845700),
(75,1997,108480,206900300),
(75,1998,108208,219646200),
(75,1999,107781,220660500),
(75,2000,107402,233226300),
(75,2001,107173,240051900),
(75,2002,107030,241543400),
(75,2003,106901,245277400),
(75,2004,106625,240097000),
(75,2005,106129,250149400),
(75,2006,105371,253372300),
(75,2007,104444,256548100),
(75,2008,103543,262868600),
(75,2009,102975,279966700),
(75,2010,102911,296525300),
(75,2011,103450,310502100),
(75,2012,104506,326128700),
(75,2013,105926,316040600),
(75,2014,107446,317999400),
(75,2015,108895,315179700),
(75,2016,110215,329895600),
(75,2017,111459,336427500),
(75,2018,112640,344501760),
(76,1960,500928,141468977),
(76,1961,505799,167637907),
(76,1962,511287,182796536),
(76,1963,517580,154480244),
(76,1964,524895,215679855),
(76,1965,533361,226474285),
(76,1966,543112,245849781),
(76,1967,554059,271543680),
(76,1968,565766,294468564),
(76,1969,577646,318124701),
(76,1970,589314,323802475),
(76,1971,600613,381687073),
(76,1972,611704,430508357),
(76,1973,622920,722780701),
(76,1974,634742,1544216004),
(76,1975,647536,2157592937),
(76,1976,661402,3009409971),
(76,1977,676255,2809349074),
(76,1978,692077,2389479269),
(76,1979,708788,3030251116),
(76,1980,726328,4279637934),
(76,1981,744696,3862269127),
(76,1982,763930,3618007844),
(76,1983,784061,3391275731),
(76,1984,805115,3561451562),
(76,1985,827108,3339914759),
(76,1986,850048,3403638194),
(76,1987,873867,3281797039),
(76,1988,898469,3834503378),
(76,1989,923711,4186411457),
(76,1990,949488,5952293766),
(76,1991,975783,5402919957),
(76,1992,1002579,5592390849),
(76,1993,1029778,4378645081),
(76,1994,1057255,4190819314),
(76,1995,1084946,4958845906),
(76,1996,1112955,5694040337),
(76,1997,1141338,5326816859),
(76,1998,1170061,4483417120),
(76,1999,1199052,4662992036),
(76,2000,1228360,5067865321),
(76,2001,1258003,5018874179),
(76,2002,1288315,5310381151),
(76,2003,1319953,6497305662),
(76,2004,1353795,7756293575),
(76,2005,1390549,9578973591),
(76,2006,1430152,10318424464),
(76,2007,1472575,12438956756),
(76,2008,1518540,15508574820),
(76,2009,1568928,12065138273),
(76,2010,1624140,14358584300),
(76,2011,1684635,18186478120),
(76,2012,1749682,17171447372),
(76,2013,1817071,17590745162),
(76,2014,1883800,18179752010),
(76,2015,1947686,14377324798),
(76,2016,2007873,14014369642),
(76,2017,2064823,14892609693),
(76,2018,2119275,17017401832),
(77,1960,52400000,72328047042),
(77,1961,52800000,76694360636),
(77,1962,53250000,80601939635),
(77,1963,53650000,85443766670),
(77,1964,54000000,93387598814),
(77,1965,54348050,100596000000),
(77,1966,54648500,107091000000),
(77,1967,54943600,111185000000),
(77,1968,55211700,104703000000),
(77,1969,55441750,112677000000),
(77,1970,55663250,130672000000),
(77,1971,55896223,148114000000),
(77,1972,56086065,169965000000),
(77,1973,56194527,192538000000),
(77,1974,56229974,206131000000),
(77,1975,56225800,241757000000),
(77,1976,56211968,232615000000),
(77,1977,56193492,263066000000),
(77,1978,56196504,335883000000),
(77,1979,56246951,438994000000),
(77,1980,56314216,564948000000),
(77,1981,56333829,540766000000),
(77,1982,56313641,515049000000),
(77,1983,56332848,489618000000),
(77,1984,56422072,461487000000),
(77,1985,56550268,489285000000),
(77,1986,56681396,601453000000),
(77,1987,56802050,745163000000),
(77,1988,56928327,910123000000),
(77,1989,57076711,926885000000),
(77,1990,57247586,1093170000000),
(77,1991,57424897,1142800000000),
(77,1992,57580402,1179660000000),
(77,1993,57718614,1061390000000),
(77,1994,57865745,1140490000000),
(77,1995,58019030,1335860000000),
(77,1996,58166950,1409410000000),
(77,1997,58316954,1553620000000),
(77,1998,58487141,1641670000000),
(77,1999,58682466,1668270000000),
(77,2000,58892514,1648270000000),
(77,2001,59119673,1625800000000),
(77,2002,59370479,1773020000000),
(77,2003,59647577,2043830000000),
(77,2004,59987905,2403610000000),
(77,2005,60401206,2525010000000),
(77,2006,60846820,2697150000000),
(77,2007,61322463,3084120000000),
(77,2008,61806995,2904040000000),
(77,2009,62276270,2394790000000),
(77,2010,62766365,2452900000000),
(77,2011,63258918,2634900000000),
(77,2012,63700300,2676610000000),
(77,2013,64128226,2753570000000),
(77,2014,64613160,3034730000000),
(77,2015,65128861,2896420000000),
(77,2016,65595565,2659240000000),
(77,2017,66058859,2637870000000),
(77,2018,66488991,2825210000000),
(78,1990,4802000,7753501868),
(78,1991,4835900,6357615894),
(78,1992,4873500,3690328964),
(78,1993,4911100,2701181331),
(78,1994,4836076,2513870587),
(78,1995,4657722,2693731866),
(78,1996,4491699,3094855183),
(78,1997,4349913,3510443160),
(78,1998,4243607,3613498175),
(78,1999,4157192,2799976945),
(78,2000,4077131,3057424694),
(78,2001,4014373,3219488664),
(78,2002,3978515,3395773557),
(78,2003,3951736,3991284895),
(78,2004,3927340,5125365192),
(78,2005,3902469,6410878800),
(78,2006,3880347,7745394293),
(78,2007,3860158,10172882371),
(78,2008,3848449,12795076469),
(78,2009,3814419,10766776414),
(78,2010,3786695,11638500814),
(78,2011,3756441,14434568633),
(78,2012,3728874,15846484588),
(78,2013,3717668,16140014428),
(78,2014,3719414,16509316418),
(78,2015,3725276,13993566298),
(78,2016,3727505,14378036929),
(78,2017,3728004,15081330942),
(78,2018,3731000,16209818081),
(79,1960,6635230,1217230038),
(79,1961,6848295,1302674264),
(79,1962,7071971,1382515590),
(79,1963,7300116,1540797517),
(79,1964,7524472,1731296119),
(79,1965,7739473,2053462872),
(79,1966,7941412,2126300573),
(79,1967,8132803,1747187539),
(79,1968,8321770,1666910166),
(79,1969,8520015,1962051319),
(79,1970,8735495,2215029450),
(79,1971,8973244,2417107708),
(79,1972,9229631,2112292945),
(79,1973,9493556,2465492958),
(79,1974,9749104,2894409938),
(79,1975,9985946,2810106383),
(79,1976,10199165,2765254237),
(79,1977,10395452,3189428571),
(79,1978,10590261,3662478185),
(79,1979,10805314,4020227920),
(79,1980,11056116,4445228216),
(79,1981,11348289,4222441615),
(79,1982,11676823,4035994398),
(79,1983,12033575,4057275043),
(79,1984,12405660,4412279843),
(79,1985,12783613,4504342149),
(79,1986,13164837,5727602645),
(79,1987,13552021,5074829932),
(79,1988,13947042,5197840979),
(79,1989,14353410,5251764264),
(79,1990,14773277,5889174825),
(79,1991,15207367,6596546196),
(79,1992,15653336,6413901602),
(79,1993,16106765,5966255778),
(79,1994,16561674,5444560669),
(79,1995,17014057,6465137615),
(79,1996,17462496,6934984709),
(79,1997,17908985,6891308594),
(79,1998,18357156,7480968858),
(79,1999,18812359,7719354839),
(79,2000,19278856,4983024408),
(79,2001,19756928,5314909954),
(79,2002,20246381,6166330136),
(79,2003,20750299,7632406553),
(79,2004,21272323,8881368538),
(79,2005,21814642,10731634117),
(79,2006,22379055,20409668522),
(79,2007,22963946,24758819718),
(79,2008,23563825,28526891010),
(79,2009,24170940,25977847814),
(79,2010,24779619,32174772956),
(79,2011,25387710,39566292433),
(79,2012,25996449,41939728979),
(79,2013,26607642,63277216921),
(79,2014,27224472,53601126665),
(79,2015,27849205,49181854795),
(79,2016,28481946,55009730589),
(79,2017,29121471,58996776244),
(79,2018,29767108,65556464056),
(81,1986,5629418,1922600899),
(81,1987,5801326,2041538057),
(81,1988,5982486,2384295764),
(81,1989,6167475,2432029380),
(81,1990,6352283,2666616177),
(81,1991,6534939,3014890569),
(81,1992,6716038,3284625277),
(81,1993,6897166,3279063318),
(81,1994,7081116,3383218923),
(81,1995,7269625,3693753379),
(81,1996,7463782,3869032271),
(81,1997,7662075,3783788551),
(81,1998,7860781,3588376057),
(81,1999,8054743,3461282294),
(81,2000,8240730,2995360969),
(81,2001,8417081,2833442750),
(81,2002,8586074,2949637039),
(81,2003,8753093,3446442219),
(81,2004,8925743,3666349049),
(81,2005,9109581,2937071767),
(81,2006,9307425,4220019243),
(81,2007,9518162,6281917656),
(81,2008,9738792,6964179194),
(81,2009,9964469,6716904569),
(81,2010,10192176,6853467858),
(81,2011,10420471,6785137173),
(81,2012,10652029,7638045254),
(81,2013,10892810,8376613843),
(81,2014,11150977,8778473615),
(81,2015,11432088,8794202444),
(81,2016,11738441,8604520929),
(81,2017,12067539,9915311049),
(81,2018,12414318,10989790256),
(83,1966,415478,44212353),
(83,1967,426629,46695363),
(83,1968,438603,41160658),
(83,1969,451228,45168722),
(83,1970,464410,52296836),
(83,1971,478116,55728608),
(83,1972,492426,59161545),
(83,1973,507432,75187969),
(83,1974,523251,95797533),
(83,1975,539979,115182522),
(83,1976,557805,112189468),
(83,1977,576757,138094243),
(83,1978,596536,171836793),
(83,1979,616768,207114382),
(83,1980,637246,241080708),
(83,1981,657579,218764445),
(83,1982,678113,216051496),
(83,1983,700199,213446562),
(83,1984,725694,177338801),
(83,1985,755787,225724851),
(83,1986,791147,185646209),
(83,1987,831023,220626484),
(83,1988,873444,266673126),
(83,1989,915635,284119692),
(83,1990,955593,317083373),
(83,1991,992673,690314321),
(83,1992,1027475,714255460),
(83,1993,1060862,755042548),
(83,1994,1094212,746491692),
(83,1995,1128575,785996982),
(83,1996,1164091,848237108),
(83,1997,1200526,803630742),
(83,1998,1238125,840285264),
(83,1999,1277133,814723460),
(83,2000,1317703,782915402),
(83,2001,1360074,687408804),
(83,2002,1404261,578236035),
(83,2003,1449925,487038821),
(83,2004,1496527,578785951),
(83,2005,1543741,624173239),
(83,2006,1591445,655070067),
(83,2007,1639848,798885556),
(83,2008,1689285,965781078),
(83,2009,1740279,900639534),
(83,2010,1793196,951806368),
(83,2011,1848147,898290989),
(83,2012,1905011,910026155),
(83,2013,1963711,1367041585),
(83,2014,2024042,1259063631),
(83,2015,2085860,1394149616),
(83,2016,2149139,1442298542),
(83,2017,2213894,1489464788),
(83,2018,2280102,1624464137),
(84,1970,704939,78733594),
(84,1971,718364,78540057),
(84,1972,732523,87702828),
(84,1973,746173,89374237),
(84,1974,757674,98775328),
(84,1975,765989,108985740),
(84,1976,770421,112386489),
(84,1977,771737,114971207),
(84,1978,772142,122666858),
(84,1979,774726,118537875),
(84,1980,781677,110653830),
(84,1981,793806,154731969),
(84,1982,810405,165523634),
(84,1983,830207,163577538),
(84,1984,851276,138478900),
(84,1985,872163,143856253),
(84,1986,892522,130225018),
(84,1987,912754,173836362),
(84,1988,933045,164458120),
(84,1989,953790,213143016),
(84,1990,975261,243961995),
(84,1991,997522,257150374),
(84,1992,1020350,226313443),
(84,1993,1043423,236880821),
(84,1994,1066346,235620043),
(84,1995,1088854,253966922),
(84,1996,1110833,270419779),
(84,1997,1132510,268550998),
(84,1998,1154371,206457544),
(84,1999,1177131,224446663),
(84,2000,1201301,370173838),
(84,2001,1227106,392278168),
(84,2002,1254453,415843482),
(84,2003,1283305,476388260),
(84,2004,1313492,531109356),
(84,2005,1344930,586795675),
(84,2006,1377581,591839470),
(84,2007,1411543,695990208),
(84,2008,1446936,864654795),
(84,2009,1483921,826798659),
(84,2010,1522599,849050127),
(84,2011,1562989,1098379392),
(84,2012,1604979,989327811),
(84,2013,1648257,1045790133),
(84,2014,1692439,1053512334),
(84,2015,1737202,1047808175),
(84,2016,1782437,1178204501),
(84,2017,1828146,1346841897),
(84,2018,1874309,1458156026),
(85,1962,262219,9122751),
(85,1963,266000,10840095),
(85,1964,270618,12712471),
(85,1965,276300,64748333),
(85,1966,283506,69110000),
(85,1967,291790,72317446),
(85,1968,299413,67514285),
(85,1969,304000,67225714),
(85,1970,303982,66331428),
(85,1971,298846,64946954),
(85,1972,289501,65429198),
(85,1973,277646,81203226),
(85,1974,265771,94159862),
(85,1975,255800,104295643),
(85,1976,247962,103653049),
(85,1977,242156,103987520),
(85,1980,249929,50642880),
(85,1981,264374,36731422),
(85,1982,284630,44294647),
(85,1983,308206,44442456),
(85,1984,331552,50320914),
(85,1985,352118,62118564),
(85,1986,369023,76407396),
(85,1987,382981,93345847),
(85,1988,394961,100534663),
(85,1989,406620,88265974),
(85,1990,419188,112119406),
(85,1991,432853,110906032),
(85,1992,447266,134707184),
(85,1993,462637,136047896),
(85,1994,479098,100807001),
(85,1995,496768,141853368),
(85,1996,515853,232463036),
(85,1997,536460,442337849),
(85,1998,558492,370687618),
(85,1999,581770,621117885),
(85,2000,606181,1045998496),
(85,2001,631666,1461139022),
(85,2002,658384,1806742742),
(85,2003,686664,2484745935),
(85,2004,716949,4410764339),
(85,2005,749535,8217369093),
(85,2006,784496,10086528699),
(85,2007,821687,13071718759),
(85,2008,860840,19749893536),
(85,2009,901599,15027795173),
(85,2010,943639,16298542028),
(85,2011,986853,21329395901),
(85,2012,1031191,22389626329),
(85,2013,1076413,21942597765),
(85,2014,1122276,21736500713),
(85,2015,1168568,13180195435),
(85,2016,1215179,11233177619),
(85,2017,1262001,12289913729),
(85,2018,1308974,13317453070),
(86,1960,8331725,4446528165),
(86,1961,8398050,5016048786),
(86,1962,8448233,5327573509),
(86,1963,8479625,5949478035),
(86,1964,8510429,6680298251),
(86,1965,8550333,7600579093),
(86,1966,8613651,8455611129),
(86,1967,8684088,9136711288),
(86,1968,8740765,9915140546),
(86,1969,8772764,11266091571),
(86,1970,8792806,13139862500),
(86,1971,8831036,14591755682),
(86,1972,8888628,16885506818),
(86,1973,8929086,22347844649),
(86,1974,8962022,25351305682),
(86,1975,9046541,28525872476),
(86,1976,9188150,31152840485),
(86,1977,9308479,36176233117),
(86,1978,9429959,44270203154),
(86,1979,9548258,54481875805),
(86,1980,9642505,56829663469),
(86,1981,9729350,52346507380),
(86,1982,9789513,54617991327),
(86,1983,9846627,49428872678),
(86,1984,9895801,48020024788),
(86,1985,9934300,47820850975),
(86,1986,9967213,56379593720),
(86,1987,10000595,65652751132),
(86,1988,10036983,76261278405),
(86,1989,10089498,79169043642),
(86,1990,10196792,97891090929),
(86,1991,10319927,105143000000),
(86,1992,10399061,116225000000),
(86,1993,10460415,108809000000),
(86,1994,10512922,116602000000),
(86,1995,10562153,136878000000),
(86,1996,10608800,145862000000),
(86,1997,10661259,143158000000),
(86,1998,10720509,144428000000),
(86,1999,10761698,142541000000),
(86,2000,10805808,130134000000),
(86,2001,10862132,136191000000),
(86,2002,10902022,153831000000),
(86,2003,10928070,201924000000),
(86,2004,10955141,240521000000),
(86,2005,10987314,247783000000),
(86,2006,11020362,273318000000),
(86,2007,11048473,318498000000),
(86,2008,11077841,354461000000),
(86,2009,11107017,330000000000),
(86,2010,11121341,299362000000),
(86,2011,11104899,287798000000),
(86,2012,11045011,245671000000),
(86,2013,10965211,239862000000),
(86,2014,10892413,237030000000),
(86,2015,10820883,196591000000),
(86,2016,10775971,195222000000),
(86,2017,10754679,203086000000),
(86,2018,10727668,218032000000),
(87,1977,90227,71494495),
(87,1978,89101,88322386),
(87,1979,88600,102244362),
(87,1980,89032,110900457),
(87,1981,90607,115651918),
(87,1982,93122,125435590),
(87,1983,96019,131803552),
(87,1984,98477,145533310),
(87,1985,99946,167728455),
(87,1986,100191,187589522),
(87,1987,99436,215009569),
(87,1988,98120,236357523),
(87,1989,96924,267327642),
(87,1990,96331,278098763),
(87,1991,96460,300757888),
(87,1992,97165,310160444),
(87,1993,98230,309812185),
(87,1994,99352,325111814),
(87,1995,100288,342172518),
(87,1996,101001,366911444),
(87,1997,101567,392190592),
(87,1998,102021,445903592),
(87,1999,102432,482009370),
(87,2000,102833,520044370),
(87,2001,103249,520444185),
(87,2002,103634,540336925),
(87,2003,104005,591018407),
(87,2004,104347,599118592),
(87,2005,104661,695370296),
(87,2006,104933,698700666),
(87,2007,105190,758683592),
(87,2008,105456,825976037),
(87,2009,105789,771275555),
(87,2010,106233,771013259),
(87,2011,106796,778655925),
(87,2012,107446,799882259),
(87,2013,108170,842620111),
(87,2014,108902,911497407),
(87,2015,109599,997007925),
(87,2016,110261,1061631222),
(87,2017,110874,1126882296),
(87,2018,111454,1207454556),
(88,1970,46400,69520026),
(88,1971,47200,88570952),
(88,1972,48300,106101175),
(88,1973,49000,140153748),
(88,1974,49500,169918948),
(88,1975,49600,211194305),
(88,1976,49700,240780413),
(88,1977,49400,282269373),
(88,1978,49200,355989047),
(88,1979,49600,420642463),
(88,1980,50200,476055288),
(88,1981,51000,435746974),
(88,1982,51500,402405069),
(88,1983,52100,416183706),
(88,1984,52700,379371608),
(88,1985,53200,412876071),
(88,1986,53500,603015696),
(88,1987,54100,787392365),
(88,1988,54800,898611007),
(88,1989,55300,929796722),
(88,1990,55600,1018970365),
(88,1991,55500,1016493395),
(88,1992,55300,1037921837),
(88,1993,55200,927219728),
(88,1994,55500,1005879948),
(88,1995,55800,1208946166),
(88,1996,55900,1197509787),
(88,1997,56000,1072147778),
(88,1998,56100,1149862703),
(88,1999,56100,1131561595),
(88,2000,56200,1068030830),
(88,2001,56350,1086172923),
(88,2002,56609,1169138789),
(88,2003,56765,1558753434),
(88,2004,56911,1822486689),
(88,2005,56935,1849805733),
(88,2006,56774,2013099482),
(88,2007,56555,2249811709),
(88,2008,56328,2499107511),
(88,2009,56323,2529948330),
(88,2010,56905,2503156061),
(88,2011,56890,2684467376),
(88,2012,56810,2609667674),
(88,2013,56483,2684952727),
(88,2014,56295,2842048998),
(88,2015,56114,2499115623),
(88,2016,56186,2713534471),
(89,1960,4210747,1043599900),
(89,1961,4336143,1076699900),
(89,1962,4464249,1143600000),
(89,1963,4595510,1262800000),
(89,1964,4730540,1299099900),
(89,1965,4869716,1331399900),
(89,1966,5013153,1390700000),
(89,1967,5160609,1453500000),
(89,1968,5311615,1610500000),
(89,1969,5465512,1715399900),
(89,1970,5621792,1904000000),
(89,1971,5780480,1984800000),
(89,1972,5941567,2101300000),
(89,1973,6104530,2569200100),
(89,1974,6268707,3161499900),
(89,1975,6433728,3645900000),
(89,1976,6599214,4365300200),
(89,1977,6765516,5480500200),
(89,1978,6933906,6070600200),
(89,1979,7106145,6902600200),
(89,1980,7283459,7878700000),
(89,1981,7466488,8607500300),
(89,1982,7654819,8716999700),
(89,1983,7847472,9050000400),
(89,1984,8042897,9470000100),
(89,1985,8240060,9721652087),
(89,1986,8438604,7231963516),
(89,1987,8639108,7084399840),
(89,1988,8842575,7841602824),
(89,1989,9050465,8410724361),
(89,1990,9263813,7650125217),
(89,1991,9483270,9406097735),
(89,1992,9708544,10440842165),
(89,1993,9938692,11399942453),
(89,1994,10172297,12983235568),
(89,1995,10408489,14655404433),
(89,1996,10646674,15674835615),
(89,1997,10887634,17790026222),
(89,1998,11133501,19395491993),
(89,1999,11387203,18318412251),
(89,2000,11650743,19288827159),
(89,2001,11924946,18702802789),
(89,2002,12208848,20776669467),
(89,2003,12500478,21917706491),
(89,2004,12796925,23965275996),
(89,2005,13096028,27211377225),
(89,2006,13397021,30231249362),
(89,2007,13700327,34113107086),
(89,2008,14006428,39136954232),
(89,2009,14316263,37734072278),
(89,2010,14630417,41338521638),
(89,2011,14948803,47654783852),
(89,2012,15270778,50388460925),
(89,2013,15595821,53851148432),
(89,2014,15923243,58722323918),
(89,2015,16252429,63767597194),
(89,2016,16583060,68663653469),
(89,2017,16914936,75620095538),
(89,2018,17247807,78460447920),
(91,2002,157176,3385000000),
(91,2003,157717,3560000000),
(91,2004,158101,3857000000),
(91,2005,158402,4197000000),
(91,2006,158648,4213000000),
(91,2007,158847,4375000000),
(91,2008,159036,4621000000),
(91,2009,159226,4781000000),
(91,2010,159444,4895000000),
(91,2011,159692,4928000000),
(91,2012,159996,5199000000),
(91,2013,160407,5336000000),
(91,2014,161016,5538000000),
(91,2015,161853,5710000000),
(91,2016,162951,5793000000),
(91,2017,164281,5859000000),
(92,1960,571819,170215248),
(92,1961,589274,185848451),
(92,1962,606285,194948375),
(92,1963,622575,175756868),
(92,1964,637845,194773376),
(92,1965,651868,213235294),
(92,1966,664521,228705882),
(92,1967,675871,250176470),
(92,1968,686146,229750000),
(92,1969,695745,249300000),
(92,1970,704934,267800000),
(92,1971,713684,282050000),
(92,1972,721948,285380952),
(92,1973,729916,307047619),
(92,1974,737847,433954545),
(92,1975,745841,494791666),
(92,1976,754101,454440000),
(92,1977,762424,449880000),
(92,1978,770125,507080000),
(92,1979,776254,530440000),
(92,1980,780153,603200000),
(92,1981,781732,570357107),
(92,1982,781246,482000000),
(92,1983,778948,489333333),
(92,1984,775219,437631605),
(92,1985,770435,453488372),
(92,1986,764446,504651139),
(92,1987,757448,354591846),
(92,1988,750639,413799990),
(92,1989,745585,379779389),
(92,1990,743309,396582263),
(92,1991,744474,348533094),
(92,1992,748602,373573141),
(92,1993,754144,454101382),
(92,1994,758896,540874934),
(92,1995,761291,621626785),
(92,1996,760795,705406001),
(92,1997,757970,749138009),
(92,1998,753778,717530683),
(92,1999,749674,694754988),
(92,2000,746715,712667896),
(92,2001,745206,712167575),
(92,2002,744789,726131434),
(92,2003,745143,743064076),
(92,2004,745737,787814379),
(92,2005,746163,824880550),
(92,2006,746343,1458453715),
(92,2007,746474,1740180444),
(92,2008,746817,1916994912),
(92,2009,747718,2061323854),
(92,2010,749436,2273225042),
(92,2011,752028,2576024116),
(92,2012,755399,2861562266),
(92,2013,759285,2987684170),
(92,2014,763380,3077643314),
(92,2015,767432,3197225182),
(92,2016,771366,3504024213),
(92,2017,775221,3555205811),
(92,2018,779004,3610435299),
(93,1960,3075605,1320796652),
(93,1961,3168100,1383681651),
(93,1962,3305200,1612346412),
(93,1963,3420900,1935298266),
(93,1964,3504600,2206466461),
(93,1965,3597900,2435078534),
(93,1966,3629900,2489845017),
(93,1967,3722800,2692474989),
(93,1968,3802700,2716964388),
(93,1969,3863900,3189740055),
(93,1970,3959000,3800766536),
(93,1971,4045300,4476001946),
(93,1972,4123600,5710107420),
(93,1973,4241600,8030117556),
(93,1974,4377800,9388663646),
(93,1975,4461600,10048022370),
(93,1976,4518000,12876366009),
(93,1977,4583700,15719433719),
(93,1978,4667500,18315007366),
(93,1979,4929700,22526035941),
(93,1980,5063100,28861759209),
(93,1981,5183400,31055409443),
(93,1982,5264500,32291306282),
(93,1983,5345100,29907091340),
(93,1984,5397900,33511383986),
(93,1985,5456200,35699543051),
(93,1986,5524600,41075570592),
(93,1987,5580500,50622571586),
(93,1988,5627600,59707404561),
(93,1989,5686200,68790369107),
(93,1990,5704500,76928290842),
(93,1991,5752000,88959620136),
(93,1992,5800500,104272000000),
(93,1993,5901000,120354000000),
(93,1994,6035400,135812000000),
(93,1995,6156100,144653000000),
(93,1996,6435500,159717000000),
(93,1997,6489300,177353000000),
(93,1998,6543700,168886000000),
(93,1999,6606500,165768000000),
(93,2000,6665000,171668000000),
(93,2001,6714300,169403000000),
(93,2002,6744100,166349000000),
(93,2003,6730800,161385000000),
(93,2004,6783500,169100000000),
(93,2005,6813200,181570000000),
(93,2006,6857100,193536000000),
(93,2007,6916300,211597000000),
(93,2008,6957800,219280000000),
(93,2009,6972800,214046000000),
(93,2010,7024200,228638000000),
(93,2011,7071600,248514000000),
(93,2012,7150100,262629000000),
(93,2013,7178900,275697000000),
(93,2014,7229500,291459000000),
(93,2015,7291300,309384000000),
(93,2016,7336600,320861000000),
(93,2017,7391700,341648000000),
(93,2018,7451000,362993000000),
(95,1960,2038632,335650000),
(95,1961,2096409,356200000),
(95,1962,2155647,387750000),
(95,1963,2216704,410200000),
(95,1964,2280048,457000000),
(95,1965,2346015,508650000),
(95,1966,2414803,549950000),
(95,1967,2486415,598100000),
(95,1968,2560727,646800000),
(95,1969,2637513,668000050),
(95,1970,2716654,723000000),
(95,1971,2798123,731000000),
(95,1972,2882113,802999950),
(95,1973,2968989,912499950),
(95,1974,3059239,1034500000),
(95,1975,3153253,1124000000),
(95,1976,3251145,1347999950),
(95,1977,3352825,1669499950),
(95,1978,3458095,3097242093),
(95,1979,3566654,3544281976),
(95,1980,3678279,3968160046),
(95,1981,3792919,4043894879),
(95,1982,3910640,4266503526),
(95,1983,4031325,4476697185),
(95,1984,4154860,4915311846),
(95,1985,4281161,5278120713),
(95,1986,4410269,5677828959),
(95,1987,4542214,6190521241),
(95,1988,4677024,5902717092),
(95,1989,4814702,5432344902),
(95,1990,4955303,4923009552),
(95,1991,5098591,4648668479),
(95,1992,5244678,4943700431),
(95,1993,5394412,4926728933),
(95,1994,5548960,4642280682),
(95,1995,5709014,5347445005),
(95,1996,5874809,5215028986),
(95,1997,6045699,5737099650),
(95,1998,6220406,6366340266),
(95,1999,6397151,6414520530),
(95,2000,6574509,7103507989),
(95,2001,6751912,7565877534),
(95,2002,6929265,7775075858),
(95,2003,7106319,8140282680),
(95,2004,7282953,8772170427),
(95,2005,7458985,9672027224),
(95,2006,7634298,10841723354),
(95,2007,7808518,12275493959),
(95,2008,7980955,13789727210),
(95,2009,8150775,14486137414),
(95,2010,8317470,15729644901),
(95,2011,8480671,17588097150),
(95,2012,8640691,18400538970),
(95,2013,8798521,18372173611),
(95,2014,8955589,19618567447),
(95,2015,9112916,20833948912),
(95,2016,9270795,21566622850),
(95,2017,9429013,22940179174),
(95,2018,9587522,23803230473),
(96,1995,4620030,22387561845),
(96,1996,4557097,23678012697),
(96,1997,4534920,23822087053),
(96,1998,4532135,25432144406),
(96,1999,4512597,23386945597),
(96,2000,4468302,21774273832),
(96,2001,4299642,23289671102),
(96,2002,4302174,26868450817),
(96,2003,4303399,34667270723),
(96,2004,4304600,41523418160),
(96,2005,4310145,45347181470),
(96,2006,4311159,50404444703),
(96,2007,4310217,60121906684),
(96,2008,4309705,70494603466),
(96,2009,4305181,62779128128),
(96,2010,4295427,59865977192),
(96,2011,4280622,62399478246),
(96,2012,4267558,56548374545),
(96,2013,4255689,58157880646),
(96,2014,4238389,57682343708),
(96,2015,4203604,49519006809),
(96,2016,4174349,51623429121),
(96,2017,4124531,55201417479),
(96,2018,4089400,60805659436),
(97,1960,3866159,273187200),
(97,1961,3941944,271066000),
(97,1962,4019173,281896800),
(97,1963,4097755,294883400),
(97,1964,4177637,325281200),
(97,1965,4258732,353251800),
(97,1966,4341318,368948600),
(97,1967,4425303,369124200),
(97,1968,4509813,367968800),
(97,1969,4593669,391820400),
(97,1970,4676230,331200000),
(97,1971,4757182,362800000),
(97,1972,4837332,372000000),
(97,1973,4918625,466800000),
(97,1974,5003710,565400000),
(97,1975,5094577,681400000),
(97,1976,5191632,879000000),
(97,1977,5294619,947000000),
(97,1978,5404019,974200000),
(97,1979,5520187,1080600000),
(97,1980,5643173,1383800000),
(97,1981,5773366,1479400000),
(97,1982,5910227,1474200000),
(97,1983,6051622,1623600000),
(97,1984,6194687,1816200000),
(97,1985,6337273,2009400000),
(97,1986,6478541,2318000000),
(97,1987,6618744,2047200000),
(97,1988,6758223,2613926800),
(97,1989,6897755,2736243800),
(97,1990,7037917,3096289800),
(97,1991,7178607,3473540602),
(97,1992,7319493,2257121668),
(97,1993,7460689,1878248741),
(97,1994,7602320,2167564195),
(97,1995,7744503,2813313279),
(97,1996,7887304,2907514523),
(97,1997,8030726,3338938830),
(97,1998,8174680,3723909227),
(97,1999,8319057,4153736347),
(97,2000,8463806,3953846311),
(97,2001,8608819,3596443005),
(97,2002,8754150,3472191962),
(97,2003,8900104,2960306121),
(97,2004,9047077,3537720277),
(97,2005,9195288,4310358096),
(97,2006,9344785,4756204070),
(97,2007,9495328,5885325590),
(97,2008,9646580,6548530572),
(97,2009,9798046,6584649419),
(97,2010,9949322,6622541529),
(97,2011,10100320,7516834160),
(97,2012,10250930,7890216508),
(97,2013,10400673,8452509316),
(97,2014,10549008,8776350790),
(97,2015,10695542,8724656126),
(97,2016,10839970,7975563430),
(97,2017,10982366,8408252995),
(97,2018,11123176,9658084644),
(98,1991,10373400,34748508332),
(98,1992,10369341,38724945368),
(98,1993,10357523,40119073326),
(98,1994,10343355,43160392124),
(98,1995,10328965,46418916500),
(98,1996,10311238,46659796773),
(98,1997,10290486,47290180589),
(98,1998,10266570,48770466839),
(98,1999,10237530,49170434391),
(98,2000,10210971,47310623887),
(98,2001,10187576,53821315066),
(98,2002,10158608,67716887203),
(98,2003,10129552,85324771841),
(98,2004,10107146,104067000000),
(98,2005,10087065,113035000000),
(98,2006,10071370,115295000000),
(98,2007,10055780,139851000000),
(98,2008,10038188,157998000000),
(98,2009,10022650,130594000000),
(98,2010,10000023,130923000000),
(98,2011,9971727,140782000000),
(98,2012,9920362,127857000000),
(98,2013,9893082,135221000000),
(98,2014,9866468,140083000000),
(98,2015,9843028,123074000000),
(98,2016,9814023,126008000000),
(98,2017,9787966,139761000000),
(98,2018,9768785,155703000000),
(99,1967,105865571,5667756645),
(99,1968,108779924,7076465295),
(99,1969,111758563,8337423313),
(99,1970,114793178,9150684932),
(99,1971,117880144,9333536360),
(99,1972,121017314,10997590361),
(99,1973,124199687,16273253012),
(99,1974,127422211,25802409639),
(99,1975,130680727,30463855422),
(99,1976,133966941,37269156627),
(99,1977,137278058,45808915663),
(99,1978,140621730,51455719100),
(99,1979,144009845,51400186379),
(99,1980,147447836,72482337370),
(99,1981,150938232,85518233451),
(99,1982,154468229,90158449307),
(99,1983,158009246,81052283405),
(99,1984,161523347,84853699994),
(99,1985,164982451,85289491750),
(99,1986,168374287,79954072570),
(99,1987,171702763,75929617577),
(99,1988,174975954,84300174477),
(99,1989,178209150,94451427898),
(99,1990,181413402,106141000000),
(99,1991,184591903,116622000000),
(99,1992,187739786,128027000000),
(99,1993,190851175,158007000000),
(99,1994,193917462,176892000000),
(99,1995,196934260,202132000000),
(99,1996,199901228,227370000000),
(99,1997,202826446,215749000000),
(99,1998,205724592,95445547873),
(99,1999,208615169,140001000000),
(99,2000,211513823,165021000000),
(99,2001,214427417,160447000000),
(99,2002,217357793,195661000000),
(99,2003,220309469,234772000000),
(99,2004,223285676,256837000000),
(99,2005,226289470,285869000000),
(99,2006,229318262,364571000000),
(99,2007,232374245,432217000000),
(99,2008,235469762,510229000000),
(99,2009,238620563,539580000000),
(99,2010,241834215,755094000000),
(99,2011,245116206,892969000000),
(99,2012,248452413,917870000000),
(99,2013,251806402,912524000000),
(99,2014,255129004,890815000000),
(99,2015,258383256,860854000000),
(99,2016,261554226,931877000000),
(99,2017,264645886,1015420000000),
(99,2018,267663435,1042170000000),
(100,1960,450547679,37029884762),
(100,1961,459642165,39232436723),
(100,1962,469077190,42161482868),
(100,1963,478825608,48421924618),
(100,1964,488848135,56480291292),
(100,1965,499123324,59554856000),
(100,1966,509631500,45865463132),
(100,1967,520400576,50134943403),
(100,1968,531513824,53085457141),
(100,1969,543084336,58447996416),
(100,1970,555189792,62422484548),
(100,1971,567868018,67350989633),
(100,1972,581087256,71463195541),
(100,1973,594770134,85515271632),
(100,1974,608802600,99525901498),
(100,1975,623102897,98472798814),
(100,1976,637630087,102717000000),
(100,1977,652408776,121487000000),
(100,1978,667499806,137300000000),
(100,1979,682995354,152992000000),
(100,1980,698952844,186325000000),
(100,1981,715384993,193491000000),
(100,1982,732239504,200715000000),
(100,1983,749428958,218262000000),
(100,1984,766833410,212158000000),
(100,1985,784360008,232512000000),
(100,1986,801975244,248986000000),
(100,1987,819682102,279034000000),
(100,1988,837468930,296589000000),
(100,1989,855334678,296042000000),
(100,1990,873277798,320979000000),
(100,1991,891273209,270105000000),
(100,1992,909307016,288208000000),
(100,1993,927403860,279296000000),
(100,1994,945601831,327276000000),
(100,1995,963922588,360282000000),
(100,1996,982365243,392897000000),
(100,1997,1000900030,415868000000),
(100,1998,1019483581,421351000000),
(100,1999,1038058156,458820000000),
(100,2000,1056575549,468395000000),
(100,2001,1075000085,485441000000),
(100,2002,1093317189,514938000000),
(100,2003,1111523144,607699000000),
(100,2004,1129623456,709149000000),
(100,2005,1147609927,820382000000),
(100,2006,1165486291,940260000000),
(100,2007,1183209472,1216740000000),
(100,2008,1200669765,1198900000000),
(100,2009,1217726215,1341890000000),
(100,2010,1234281170,1675620000000),
(100,2011,1250288729,1823050000000),
(100,2012,1265782790,1827640000000),
(100,2013,1280846129,1856720000000),
(100,2014,1295604184,2039130000000),
(100,2015,1310152403,2103590000000),
(100,2016,1324509589,2290430000000),
(100,2017,1338658835,2652550000000),
(100,2018,1352617328,2726320000000),
(102,1960,2828600,1939329775),
(102,1961,2824400,2088012282),
(102,1962,2836050,2260349684),
(102,1963,2852650,2430843768),
(102,1964,2866550,2766608946),
(102,1965,2877300,2945704143),
(102,1966,2888800,3104034393),
(102,1967,2902450,3343636773),
(102,1968,2915550,3278584478),
(102,1969,2932650,3787077344),
(102,1970,2957250,4401259497),
(102,1971,2992050,5104355309),
(102,1972,3036850,6325627459),
(102,1973,3085950,7490132356),
(102,1974,3137500,7906317069),
(102,1975,3189550,9495165854),
(102,1976,3238050,9465078121),
(102,1977,3282200,11261810826),
(102,1978,3329100,14665538055),
(102,1979,3373750,18341273372),
(102,1980,3412800,21773901117),
(102,1981,3453000,20694944099),
(102,1982,3485800,21500471384),
(102,1983,3510600,20790917197),
(102,1984,3532423,20130728188),
(102,1985,3538082,21295485800),
(102,1986,3539690,28748959623),
(102,1987,3540057,33961141386),
(102,1988,3524949,37818133293),
(102,1989,3511009,39285383971),
(102,1990,3513974,49364679953),
(102,1991,3534235,49847127139),
(102,1992,3558430,55985505025),
(102,1993,3576261,52480251773),
(102,1994,3590386,57166035571),
(102,1995,3608841,69222624369),
(102,1996,3637510,75880630166),
(102,1997,3674171,82826141595),
(102,1998,3712696,90082051923),
(102,1999,3754786,98692079267),
(102,2000,3805174,99852958356),
(102,2001,3866243,109135000000),
(102,2002,3931947,127950000000),
(102,2003,3996521,164285000000),
(102,2004,4070262,193871000000),
(102,2005,4159914,211649000000),
(102,2006,4273591,232083000000),
(102,2007,4398942,269918000000),
(102,2008,4489544,275039000000),
(102,2009,4535375,236316000000),
(102,2010,4560155,222149000000),
(102,2011,4580084,237472000000),
(102,2012,4599533,224999000000),
(102,2013,4623816,238544000000),
(102,2014,4657740,258472000000),
(102,2015,4701957,291500000000),
(102,2016,4755335,300523000000),
(102,2017,4807388,334834000000),
(102,2018,4853506,382487000000),
(103,1960,21906914,4199134390),
(103,1961,22480372,4426949095),
(103,1962,23071315,4693566416),
(103,1963,23680258,4928628018),
(103,1964,24307860,5379845647),
(103,1965,24954873,6197319930),
(103,1966,25624373,6789938673),
(103,1967,26317783,7555383690),
(103,1968,27032571,8623172960),
(103,1969,27764924,9743089606),
(103,1970,28513866,10976245154),
(103,1971,29281591,13731801565),
(103,1972,30075297,17153463264),
(103,1973,30905707,27081698249),
(103,1974,31786471,46209092073),
(103,1975,32729772,51776222350),
(103,1976,33733961,68055295080),
(103,1977,34803045,80600122701),
(103,1978,35960805,77994316622),
(103,1979,37237137,90391877325),
(103,1980,38650246,94362275580),
(103,1981,40199906,100499000000),
(103,1982,41869236,125949000000),
(103,1983,43636837,156365000000),
(103,1984,45472791,162277000000),
(103,1985,47347186,180184000000),
(103,1986,49260255,209095000000),
(103,1987,51193782,134010000000),
(103,1988,53077313,123058000000),
(103,1989,54822003,120496000000),
(103,1990,56366217,124813000000),
(103,1993,59723764,63743623232),
(103,1994,60590614,71841461173),
(103,1995,61442664,96419225744),
(103,1996,62294920,120404000000),
(103,1997,63136312,113919000000),
(103,1998,63971836,110277000000),
(103,1999,64800880,113848000000),
(103,2000,65623405,109592000000),
(103,2001,66449112,126879000000),
(103,2002,67284796,128627000000),
(103,2003,68122938,153545000000),
(103,2004,68951281,190043000000),
(103,2005,69762347,226452000000),
(103,2006,70554760,266299000000),
(103,2007,71336475,349882000000),
(103,2008,72120604,406071000000),
(103,2009,72924837,414059000000),
(103,2010,73762519,487070000000),
(103,2011,74634956,583500000000),
(103,2012,75539862,598853000000),
(103,2013,76481943,467415000000),
(103,2014,77465753,434475000000),
(103,2015,78492215,385874000000),
(103,2016,79564016,418977000000),
(103,2017,80673951,454013000000),
(104,1960,7289760,1684121535),
(104,1961,7475350,1831700364),
(104,1962,7674220,1954634836),
(104,1963,7888913,1978437693),
(104,1964,8122197,2340521143),
(104,1968,9260682,2896947634),
(104,1969,9585576,3008120975),
(104,1970,9917983,3281713806),
(104,1971,10255850,3865346535),
(104,1972,10599668,4113848002),
(104,1973,10950888,5134367778),
(104,1974,11312062,11516762614),
(104,1975,11684590,13458516763),
(104,1976,12068676,17754825601),
(104,1977,12462070,19838130715),
(104,1978,12860680,23762275652),
(104,1979,13259113,37816457839),
(104,1980,13653354,53405689130),
(104,1981,14044117,38424991534),
(104,1982,14432468,42595309883),
(104,1983,14815656,40595046639),
(104,1984,15190393,46802508845),
(104,1985,15555800,48284979093),
(104,1986,15909762,47127693792),
(104,1987,16257070,56609842393),
(104,1988,16612322,62503055645),
(104,1989,16994948,65641363783),
(104,1990,17419113,179886000000),
(104,2004,26313838,36627901762),
(104,2005,26922284,49954890353),
(104,2006,27448124,65140293688),
(104,2007,27911248,88840050497),
(104,2008,28385746,131614000000),
(104,2009,28973162,111661000000),
(104,2010,29741976,138517000000),
(104,2011,30725300,185750000000),
(104,2012,31890011,218001000000),
(104,2013,33157050,234648000000),
(104,2014,34411951,234648000000),
(104,2015,35572261,177499000000),
(104,2016,36610632,170220000000),
(104,2017,37552781,193159000000),
(104,2018,38433600,225914000000),
(105,1960,175574,248434097),
(105,1961,179029,253885656),
(105,1962,182378,284916516),
(105,1963,185653,340061650),
(105,1964,188983,434267936),
(105,1965,192286,523694949),
(105,1966,195570,628893310),
(105,1967,198751,621225962),
(105,1968,201488,474399471),
(105,1969,203369,414709311),
(105,1970,204438,527496590),
(105,1971,206098,671258750),
(105,1972,209137,840914457),
(105,1973,212317,1156175524),
(105,1974,215209,1517467734),
(105,1975,217979,1408989850),
(105,1976,220154,1671997859),
(105,1977,221799,2211828984),
(105,1978,223537,2515601748),
(105,1979,225735,2857724220),
(105,1980,228138,3386501918),
(105,1981,230755,3498247432),
(105,1982,233860,3211446626),
(105,1983,236977,2770107923),
(105,1984,239511,2868747035),
(105,1985,241405,2988537806),
(105,1986,243180,3995619693),
(105,1987,245859,5528616190),
(105,1988,249740,6115814935),
(105,1989,252852,5681096096),
(105,1990,254826,6478459747),
(105,1991,257797,6920116563),
(105,1992,261057,7091625419),
(105,1993,263725,6227928906),
(105,1994,266021,6399064571),
(105,1995,267468,7134341218),
(105,1996,268916,7438183247),
(105,1997,271128,7580988916),
(105,1998,274047,8494094643),
(105,1999,277381,8971609106),
(105,2000,281205,9003639475),
(105,2001,284968,8205357164),
(105,2002,287523,9294651863),
(105,2003,289521,11414054861),
(105,2004,292074,13834751482),
(105,2005,296734,16812529924),
(105,2006,303782,17216417442),
(105,2007,311566,21514962937),
(105,2008,317414,17905251832),
(105,2009,318499,13164652894),
(105,2010,318041,13683689802),
(105,2011,319014,15158548597),
(105,2012,320716,14724078264),
(105,2013,323764,16033517529),
(105,2014,327386,17758089312),
(105,2015,330815,17344165907),
(105,2016,335439,20716024757),
(105,2017,343400,24489493459),
(105,2018,353574,25882218777),
(106,1960,2114020,2598500000),
(106,1961,2185000,3138500000),
(106,1962,2293000,2510000000),
(106,1963,2379000,2992333333),
(106,1964,2475000,3405333333),
(106,1965,2563000,3663333333),
(106,1966,2629000,3980000000),
(106,1967,2745000,4030000000),
(106,1968,2803000,4619000000),
(106,1969,2877000,5329333333),
(106,1970,2974000,7038333333),
(106,1971,3069000,6702000000),
(106,1972,3148000,8762500000),
(106,1973,3278000,11309750000),
(106,1974,3377000,16317250000),
(106,1975,3455000,15337833333),
(106,1976,3533000,15161000000),
(106,1977,3613000,17347500000),
(106,1978,3690000,16818647059),
(106,1979,3786000,21482760000),
(106,1980,3878000,24129333333),
(106,1981,3956000,25541982456),
(106,1982,4031000,27796979424),
(106,1983,4105000,31046960854),
(106,1984,4159000,29118001364),
(106,1985,4233000,27464859869),
(106,1986,4299000,34047913833),
(106,1987,4369000,40903634140),
(106,1988,4442000,50026434048),
(106,1989,4518000,49829306408),
(106,1990,4660000,58925354727),
(106,1991,4949000,67459649072),
(106,1992,5123000,75496923793),
(106,1993,5261000,75875266422),
(106,1994,5399000,86216942413),
(106,1995,5545000,100239000000),
(106,1996,5692000,109855000000),
(106,1997,5836000,114622000000),
(106,1998,5971000,115862000000),
(106,1999,6125000,117011000000),
(106,2000,6289000,132244000000),
(106,2001,6439000,130671000000),
(106,2002,6570000,121042000000),
(106,2003,6689700,126809000000),
(106,2004,6809000,135342000000),
(106,2005,6930100,142411000000),
(106,2006,7053700,153983000000),
(106,2007,7180100,178743000000),
(106,2008,7308800,215961000000),
(106,2009,7485600,207452000000),
(106,2010,7623600,233733000000),
(106,2011,7765800,261717000000),
(106,2012,7910500,257435000000),
(106,2013,8059500,292917000000),
(106,2014,8215700,310008000000),
(106,2015,8380100,300471000000),
(106,2016,8546000,319378000000),
(106,2017,8713300,353268000000),
(106,2018,8883800,369690000000),
(107,1960,50199700,40385288344),
(107,1961,50536350,44842760293),
(107,1962,50879450,50383891899),
(107,1963,51252000,57710743060),
(107,1964,51675350,63175417019),
(107,1965,52112350,67978153851),
(107,1966,52519000,73654870011),
(107,1967,52900500,81133120065),
(107,1968,53235750,87942231678),
(107,1969,53537950,97085082807),
(107,1970,53821850,113021000000),
(107,1971,54073490,124261000000),
(107,1972,54381345,144781000000),
(107,1973,54751406,174913000000),
(107,1974,55110868,198906000000),
(107,1975,55441001,226945000000),
(107,1976,55718260,223976000000),
(107,1977,55955411,256747000000),
(107,1978,56155143,314019000000),
(107,1979,56317749,392379000000),
(107,1980,56433883,475683000000),
(107,1981,56501675,429282000000),
(107,1982,56543548,425863000000),
(107,1983,56564074,441581000000),
(107,1984,56576718,436443000000),
(107,1985,56593071,450726000000),
(107,1986,56596155,638274000000),
(107,1987,56601931,803055000000),
(107,1988,56629288,888668000000),
(107,1989,56671781,925598000000),
(107,1990,56719240,1177330000000),
(107,1991,56758521,1242110000000),
(107,1992,56797087,1315810000000),
(107,1993,56831821,1061450000000),
(107,1994,56843400,1095590000000),
(107,1995,56844303,1170790000000),
(107,1996,56860281,1308930000000),
(107,1997,56890372,1239050000000),
(107,1998,56906744,1266310000000),
(107,1999,56916317,1248560000000),
(107,2000,56942108,1141760000000),
(107,2001,56974100,1162320000000),
(107,2002,57059007,1266510000000),
(107,2003,57313203,1569650000000),
(107,2004,57685327,1798310000000),
(107,2005,57969484,1852660000000),
(107,2006,58143979,1942630000000),
(107,2007,58438310,2203050000000),
(107,2008,58826731,2390730000000),
(107,2009,59095365,2185160000000),
(107,2010,59277417,2125060000000),
(107,2011,59379449,2276290000000),
(107,2012,59539717,2072820000000),
(107,2013,60233948,2130490000000),
(107,2014,60789140,2151730000000),
(107,2015,60730582,1832270000000),
(107,2016,60627498,1869200000000),
(107,2017,60536709,1946570000000),
(107,2018,60431283,2073900000000),
(108,1960,1628520,699050679),
(108,1961,1651073,748028839),
(108,1962,1676501,777712445),
(108,1963,1703651,826690466),
(108,1964,1730738,897931401),
(108,1965,1756511,972140557),
(108,1966,1780518,1096738065),
(108,1967,1803319,1148025407),
(108,1968,1825879,1083883355),
(108,1969,1849662,1191287652),
(108,1970,1875642,1404776071),
(108,1971,1904276,1539865514),
(108,1972,1935100,1875048860),
(108,1973,1966974,1905917553),
(108,1974,1998309,2375096249),
(108,1975,2028016,2860411286),
(108,1976,2055365,2966010230),
(108,1977,2080831,3249697393),
(108,1978,2105907,2644449232),
(108,1979,2132785,2425033998),
(108,1980,2162846,2679409453),
(108,1981,2196921,2979061412),
(108,1982,2234057,3293533288),
(108,1983,2271736,3619294121),
(108,1984,2306366,2373566957),
(108,1985,2335510,2100223150),
(108,1986,2358161,2754566176),
(108,1987,2375393,3286987552),
(108,1988,2389411,3828310735),
(108,1989,2403464,4404970059),
(108,1990,2419906,4592224067),
(108,1991,2439334,4071219198),
(108,1992,2461049,3530892749),
(108,1993,2484581,5405097571),
(108,1994,2509043,5419134875),
(108,1995,2533711,6538840170),
(108,1996,2558637,7368000000),
(108,1997,2583916,8375077443),
(108,1998,2608873,8763219645),
(108,1999,2632675,8851581633),
(108,2000,2654701,8985352832),
(108,2001,2674702,9178016493),
(108,2002,2692845,9694169757),
(108,2003,2709437,9399447609),
(108,2004,2725015,10150978155),
(108,2005,2740003,11204416000),
(108,2006,2754407,11901911988),
(108,2007,2768227,12827809965),
(108,2008,2781876,13680482787),
(108,2009,2795837,12067478478),
(108,2010,2810460,13200286270),
(108,2011,2825929,14413359665),
(108,2012,2842132,14798716216),
(108,2013,2858709,14193012191),
(108,2014,2875136,13852192273),
(108,2015,2891021,14145469269),
(108,2016,2906238,14072135209),
(108,2017,2920853,14781107822),
(108,2018,2934855,15717858487),
(109,1965,1173606,599831979),
(109,1966,1267062,658078969),
(109,1967,1378998,631755810),
(109,1968,1500163,561187342),
(109,1969,1617428,698963875),
(109,1970,1721323,639596751),
(109,1971,1809182,678241389),
(109,1972,1883935,788574629),
(109,1973,1948442,943700547),
(109,1974,2007735,1197454207),
(109,1975,2065913,1363039400),
(109,1976,2123180,1708734940),
(109,1977,2179363,2096568479),
(109,1978,2237943,2602748691),
(109,1979,2303122,3271728272),
(109,1980,2377995,3910036925),
(109,1981,2464867,4384685230),
(109,1982,2563534,4680567376),
(109,1983,2671413,4920407601),
(109,1984,2784463,4966710013),
(109,1985,2900049,4993829194),
(109,1986,3015299,6401380000),
(109,1987,3131796,6755599114),
(109,1988,3256558,6277197435),
(109,1989,3399330,4220945005),
(109,1990,3565890,4160003917),
(109,1991,3760496,4344250257),
(109,1992,3977672,5311329067),
(109,1993,4201555,5605841536),
(109,1994,4410359,6237739516),
(109,1995,4588843,6727446632),
(109,1996,4732854,6928359238),
(109,1997,4848541,7246188575),
(109,1998,4943975,7912327362),
(109,1999,5031762,8149106065),
(109,2000,5122493,8460424401),
(109,2001,5217336,8975689845),
(109,2002,5317506,9582453032),
(109,2003,5434030,10195660790),
(109,2004,5580244,11411390409),
(109,2005,5765635,12588665303),
(109,2006,5991540,15056929760),
(109,2007,6255280,17110587447),
(109,2008,6556478,22218617772),
(109,2009,6893260,23974612130),
(109,2010,7261539,26551480959),
(109,2011,7663131,28932299013),
(109,2012,8090872,30966149506),
(109,2013,8520420,33675599436),
(109,2014,8920049,36104372355),
(109,2015,9266575,37968970381),
(109,2016,9551467,39252468265),
(109,2017,9779173,40765867419),
(109,2018,9956011,42290832158),
(110,1960,92500572,44307342950),
(110,1961,94943000,53508617739),
(110,1962,95832000,60723018684),
(110,1963,96812000,69498131797),
(110,1964,97826000,81749006382),
(110,1965,98883000,90950278258),
(110,1966,99790000,105628000000),
(110,1967,100725000,123782000000),
(110,1968,101061000,146601000000),
(110,1969,103172000,172204000000),
(110,1970,104345000,212609000000),
(110,1971,105697000,240152000000),
(110,1972,107188000,318031000000),
(110,1973,108079000,432083000000),
(110,1974,110162000,479626000000),
(110,1975,111940000,521542000000),
(110,1976,112771000,586162000000),
(110,1977,113863000,721412000000),
(110,1978,114898000,1013610000000),
(110,1979,115870000,1055010000000),
(110,1980,116782000,1105390000000),
(110,1981,117648000,1218990000000),
(110,1982,118449000,1134520000000),
(110,1983,119259000,1243320000000),
(110,1984,120018000,1318380000000),
(110,1985,120754000,1398890000000),
(110,1986,121492000,2078950000000),
(110,1987,122091000,2532810000000),
(110,1988,122613000,3071680000000),
(110,1989,123116000,3054910000000),
(110,1990,123537000,3132820000000),
(110,1991,123921000,3584420000000),
(110,1992,124229000,3908810000000),
(110,1993,124536000,4454140000000),
(110,1994,124961000,4907040000000),
(110,1995,125439000,5449120000000),
(110,1996,125757000,4833710000000),
(110,1997,126057000,4414730000000),
(110,1998,126400000,4032510000000),
(110,1999,126631000,4562080000000),
(110,2000,126843000,4887520000000),
(110,2001,127149000,4303540000000),
(110,2002,127445000,4115120000000),
(110,2003,127718000,4445660000000),
(110,2004,127761000,4815150000000),
(110,2005,127773000,4755410000000),
(110,2006,127854000,4530380000000),
(110,2007,128001000,4515260000000),
(110,2008,128063000,5037910000000),
(110,2009,128047000,5231380000000),
(110,2010,128070000,5700100000000),
(110,2011,127833000,6157460000000),
(110,2012,127629000,6203210000000),
(110,2013,127445000,5155720000000),
(110,2014,127276000,4850410000000),
(110,2015,127141000,4389480000000),
(110,2016,126994511,4926670000000),
(110,2017,126785797,4859950000000),
(110,2018,126529100,4970920000000),
(111,1990,16348000,26932728899),
(111,1991,16450500,24881135586),
(111,1992,16439095,24906939560),
(111,1993,16330419,23409027476),
(111,1994,16095199,21250839258),
(111,1995,15815626,20374307047),
(111,1996,15577894,21035357833),
(111,1997,15333703,22165932063),
(111,1998,15071300,22135245413),
(111,1999,14928426,16870817135),
(111,2000,14883626,18291990619),
(111,2001,14858335,22152694162),
(111,2002,14858948,24636593223),
(111,2003,14909018,30833699703),
(111,2004,15012985,43151647003),
(111,2005,15147029,57123671734),
(111,2006,15308084,81003884545),
(111,2007,15484192,104850000000),
(111,2008,15674000,133442000000),
(111,2009,16092822,115309000000),
(111,2010,16321872,148047000000),
(111,2011,16557201,192627000000),
(111,2012,16792089,207999000000),
(111,2013,17035550,236635000000),
(111,2014,17288285,221416000000),
(111,2015,17542806,184388000000),
(111,2016,17794055,137278000000),
(111,2017,18037776,162887000000),
(111,2018,18276499,170539000000),
(112,1960,8120080,791265458),
(112,1961,8377696,792959472),
(112,1962,8647011,868111400),
(112,1963,8928511,926589348),
(112,1964,9222692,998759333),
(112,1965,9530173,997919320),
(112,1966,9851444,1164519673),
(112,1967,10187478,1232559506),
(112,1968,10539894,1353295458),
(112,1969,10910675,1458379415),
(112,1970,11301394,1603447357),
(112,1971,11713048,1778391289),
(112,1972,12146068,2107279157),
(112,1973,12600797,2502142444),
(112,1974,13077341,2973309272),
(112,1975,13575907,3259344936),
(112,1976,14096263,3474542392),
(112,1977,14638890,4494378855),
(112,1978,15205374,5303734883),
(112,1979,15797776,6234390975),
(112,1980,16417197,7265315332),
(112,1981,17063876,6854491454),
(112,1982,17736326,6431579357),
(112,1983,18431761,5979198464),
(112,1984,19146400,6191437070),
(112,1985,19877083,6135034338),
(112,1986,20622560,7239126717),
(112,1987,21382112,7970820531),
(112,1988,22153676,8355380879),
(112,1989,22935092,8283114648),
(112,1990,23724579,8572359163),
(112,1991,24521703,8151479004),
(112,1992,25326078,8209129172),
(112,1993,26136216,5751789915),
(112,1994,26950513,7148145376),
(112,1995,27768296,9046326060),
(112,1996,28589451,12045858436),
(112,1997,29415659,13115773738),
(112,1998,30250488,14093998844),
(112,1999,31098757,12896013577),
(112,2000,31964557,12705357103),
(112,2001,32848564,12986007426),
(112,2002,33751739,13147743911),
(112,2003,34678779,14904517650),
(112,2004,35635271,16095337094),
(112,2005,36624895,18737897745),
(112,2006,37649033,25825524821),
(112,2007,38705932,31958195182),
(112,2008,39791981,35895153328),
(112,2009,40901792,37021512049),
(112,2010,42030676,40000088347),
(112,2011,43178257,41953433591),
(112,2012,44343410,50412754861),
(112,2013,45519889,55096728048),
(112,2014,46699981,61448046802),
(112,2015,47878336,64007750179),
(112,2016,49051686,69188755511),
(112,2017,50221473,78757391333),
(112,2018,51393010,87908262520),
(113,1990,4391200,2675000000),
(113,1991,4463600,2569444444),
(113,1992,4515400,2316562500),
(113,1993,4516700,2028295455),
(113,1994,4515100,1681006993),
(113,1995,4560400,1661018519),
(113,1996,4628400,1827570586),
(113,1997,4696400,1767864036),
(113,1998,4769000,1645963750),
(113,1999,4840400,1249061487),
(113,2000,4898400,1369692689),
(113,2001,4945100,1525112242),
(113,2002,4990700,1605640974),
(113,2003,5043300,1919012667),
(113,2004,5104700,2211534585),
(113,2005,5162600,2460248026),
(113,2006,5218400,2834168889),
(113,2007,5268400,3802566171),
(113,2008,5318700,5139957785),
(113,2009,5383300,4690062255),
(113,2010,5447900,4794357795),
(113,2011,5514600,6197766119),
(113,2012,5607200,6605139933),
(113,2013,5719600,7335027592),
(113,2014,5835500,7468096567),
(113,2015,5956900,6678178340),
(113,2016,6079500,6813092066),
(113,2017,6198200,7702934800),
(113,2018,6315800,8092836609),
(114,1960,5722370,637142865),
(114,1961,5872966,642857134),
(114,1962,6028431,660000008),
(114,1963,6183584,728571437),
(114,1964,6331449,782857128),
(114,1965,6467197,868571428),
(114,1966,6585035,914285714),
(114,1967,6685960,962857134),
(114,1968,6779787,1065714249),
(114,1969,6880623,978873232),
(114,1970,6996576,718401157),
(114,1971,7139647,969911421),
(114,1972,7302111,505549441),
(114,1973,7449238,702899156),
(114,1974,7533336,588443893),
(114,1993,9970733,2533727592),
(114,1994,10317899,2791435272),
(114,1995,10656138,3441205693),
(114,1996,10982917,3506695720),
(114,1997,11298600,3443413389),
(114,1998,11600508,3120425503),
(114,1999,11886458,3517242477),
(114,2000,12155239,3677897739),
(114,2001,12405408,3984000517),
(114,2002,12637727,4284028483),
(114,2003,12856163,4658246918),
(114,2004,13066469,5337833248),
(114,2005,13273354,6293046162),
(114,2006,13477709,7274595707),
(114,2007,13679962,8639235842),
(114,2008,13883834,10351914093),
(114,2009,14093604,10401851851),
(114,2010,14312212,11242275199),
(114,2011,14541423,12829541141),
(114,2012,14780454,14054443213),
(114,2013,15026332,15227991395),
(114,2014,15274503,16702610842),
(114,2015,15521436,18049954289),
(114,2016,15766293,20016747754),
(114,2017,16009414,22177200512),
(114,2018,16249798,24571753583),
(115,1970,51151,14295279),
(115,1971,51980,15278632),
(115,1972,52780,18936526),
(115,1973,53553,31710657),
(115,1974,54333,85637174),
(115,1975,55114,55081816),
(115,1976,55924,41109617),
(115,1977,56764,38748059),
(115,1978,57618,45210026),
(115,1979,58461,42620165),
(115,1980,59301,38715554),
(115,1981,60104,41369800),
(115,1982,60887,40572066),
(115,1983,61733,37837837),
(115,1984,62744,41246160),
(115,1985,63986,32125148),
(115,1986,65505,32085561),
(115,1987,67248,33608738),
(115,1988,69089,42972107),
(115,1989,70853,41119721),
(115,1990,72400,39809538),
(115,1991,73692,47515189),
(115,1992,74766,47737955),
(115,1993,75716,46919624),
(115,1994,76670,54832577),
(115,1995,77723,56338028),
(115,1996,78903,66515376),
(115,1997,80187,67537479),
(115,1998,81556,65334841),
(115,1999,82972,69032258),
(115,2000,84396,67254174),
(115,2001,85849,63101272),
(115,2002,87305,72196457),
(115,2003,88835,90231856),
(115,2004,90499,102367039),
(115,2005,92325,112133944),
(115,2006,94343,110234939),
(115,2007,96527,132671743),
(115,2008,98761,141042610),
(115,2009,100930,132420059),
(115,2010,102927,156120895),
(115,2011,104728,181705002),
(115,2012,106370,190243321),
(115,2013,107890,185113921),
(115,2014,109391,179703443),
(115,2015,110930,171117872),
(115,2016,112524,178328873),
(115,2017,114158,185572501),
(115,2018,115847,188284518),
(116,1960,51195,12366563),
(116,1961,51192,12483229),
(116,1962,50963,12541562),
(116,1963,50525,12833226),
(116,1964,49931,13416554),
(116,1965,49214,13593932),
(116,1966,48358,14469078),
(116,1967,47381,16742338),
(116,1968,46397,14600000),
(116,1969,45534,15850000),
(116,1970,44883,16300000),
(116,1971,44490,19624746),
(116,1972,44320,22944849),
(116,1973,44311,24196018),
(116,1974,44328,31514856),
(116,1975,44272,33364055),
(116,1976,44143,30095602),
(116,1977,43942,44496737),
(116,1978,43708,49433941),
(116,1979,43455,58840662),
(116,1980,43205,68459214),
(116,1981,42960,80890204),
(116,1982,42728,86021798),
(116,1983,42482,86875571),
(116,1984,42199,98603924),
(116,1985,41866,111008962),
(116,1986,41479,130684579),
(116,1987,41041,147748773),
(116,1988,40641,172692174),
(116,1989,40354,192517321),
(116,1990,40259,217258907),
(116,1991,40379,220539507),
(116,1992,40697,242135418),
(116,1993,41135,263754660),
(116,1994,41617,295157658),
(116,1995,42074,313483384),
(116,1996,42475,333946095),
(116,1997,42854,374640295),
(116,1998,43221,383257144),
(116,1999,43614,406597034),
(116,2000,44074,433520494),
(116,2001,44599,475443712),
(116,2002,45165,497328946),
(116,2003,45746,486344351),
(116,2004,46324,529250459),
(116,2005,46857,577730934),
(116,2006,47339,657227386),
(116,2007,47778,723938700),
(116,2008,48185,793368441),
(116,2009,48599,767066391),
(116,2010,49016,766785071),
(116,2011,49447,818728133),
(116,2012,49887,800392821),
(116,2013,50331,849496203),
(116,2014,50774,916857359),
(116,2015,51203,936314411),
(116,2016,51625,958973183),
(116,2017,52045,992007403),
(116,2018,52441,1039875050),
(117,1960,25012374,3957240261),
(117,1961,25765673,2417638423),
(117,1962,26513030,2813856976),
(117,1963,27261747,3988476879),
(117,1964,27984155,3458565257),
(117,1965,28704674,3120495495),
(117,1966,29435571,3928281860),
(117,1967,30130983,4854724235),
(117,1968,30838302,6117115489),
(117,1969,31544266,7675943920),
(117,1970,32240827,8999227202),
(117,1971,32882704,9889961112),
(117,1972,33505406,10842220469),
(117,1973,34103149,13841885921),
(117,1974,34692266,19482038223),
(117,1975,35280725,21704752066),
(117,1976,35848523,29779338843),
(117,1977,36411795,38265082645),
(117,1978,36969185,51700619835),
(117,1979,37534236,66567975207),
(117,1980,38123775,64980820835),
(117,1981,38723248,72425590649),
(117,1982,39326352,77773431088),
(117,1983,39910403,87024427973),
(117,1984,40405956,96597434180),
(117,1985,40805744,100273000000),
(117,1986,41213674,115537000000),
(117,1987,41621690,146133000000),
(117,1988,42031247,196964000000),
(117,1989,42449038,243526000000),
(117,1990,42869283,279349000000),
(117,1991,43295704,325734000000),
(117,1992,43747962,350051000000),
(117,1993,44194628,386303000000),
(117,1994,44641540,455603000000),
(117,1995,45092991,556131000000),
(117,1996,45524681,598099000000),
(117,1997,45953580,557503000000),
(117,1998,46286503,374241000000),
(117,1999,46616677,485248000000),
(117,2000,47008111,561633000000),
(117,2001,47370164,533052000000),
(117,2002,47644736,609020000000),
(117,2003,47892330,680521000000),
(117,2004,48082519,764881000000),
(117,2005,48184561,898137000000),
(117,2006,48438292,1011800000000),
(117,2007,48683638,1122680000000),
(117,2008,49054708,1002220000000),
(117,2009,49307835,901935000000),
(117,2010,49554112,1094500000000),
(117,2011,49936638,1202460000000),
(117,2012,50199853,1222810000000),
(117,2013,50428893,1305600000000),
(117,2014,50746659,1411330000000),
(117,2015,51014947,1382760000000),
(117,2016,51245707,1414800000000),
(117,2017,51466201,1530750000000),
(117,2018,51635256,1619420000000),
(118,1965,472037,2097451694),
(118,1966,523166,2391486978),
(118,1967,577164,2441893027),
(118,1968,632899,2663119574),
(118,1969,688979,2769532344),
(118,1970,744450,2873984878),
(118,1971,798642,3880370402),
(118,1972,851916,4451200973),
(118,1973,905635,5408293999),
(118,1974,961770,13004774557),
(118,1975,1021720,12024138276),
(118,1976,1085861,13131668947),
(118,1977,1153583,14135729588),
(118,1978,1224067,15500908760),
(118,1979,1296081,24746019537),
(118,1980,1368677,28638550499),
(118,1981,1439331,25056672166),
(118,1982,1507645,21577977770),
(118,1983,1576968,20869434305),
(118,1984,1652150,21697297872),
(118,1985,1735274,21442619681),
(118,1986,1832310,17903681693),
(118,1987,1938909,22365734482),
(118,1988,2034857,20692472760),
(118,1989,2092777,24312117767),
(118,1990,2095344,18427777778),
(118,1991,2031296,11008793176),
(118,1995,1605901,27191689008),
(118,1996,1626857,31493987642),
(118,1997,1710256,30354434553),
(118,1998,1831119,25941929462),
(118,1999,1951636,30121879435),
(118,2000,2045123,37711864407),
(118,2001,2103282,34890772742),
(118,2002,2136997,38137545245),
(118,2003,2161626,47875838926),
(118,2004,2200492,59440108585),
(118,2005,2270198,80797945205),
(118,2006,2373672,101551000000),
(118,2007,2504019,114641000000),
(118,2008,2656009,147396000000),
(118,2009,2821045,105900000000),
(118,2010,2991884,115419000000),
(118,2011,3168060,154028000000),
(118,2012,3348853,174070000000),
(118,2013,3526378,174161000000),
(118,2014,3690942,162631000000),
(118,2015,3835591,114567000000),
(118,2016,3956873,109420000000),
(118,2017,4056097,119552000000),
(118,2018,4137309,141678000000),
(119,1984,3586316,1757142806),
(119,1985,3687898,2366666616),
(119,1986,3794198,1776842041),
(119,1987,3905530,1087273104),
(119,1988,4020811,598961269),
(119,1989,4138845,714046821),
(119,1990,4258472,865559856),
(119,1991,4379236,1028087972),
(119,1992,4500351,1127806945),
(119,1993,4619944,1327748655),
(119,1994,4735845,1543606345),
(119,1995,4846483,1763536305),
(119,1996,4951195,1873671550),
(119,1997,5050315,1747011857),
(119,1998,5144602,1280177839),
(119,1999,5235346,1454430642),
(119,2000,5323700,1731198022),
(119,2001,5409582,1768619058),
(119,2002,5493246,1758176653),
(119,2003,5576640,2023324407),
(119,2004,5662208,2366398120),
(119,2005,5751676,2735558726),
(119,2006,5846074,3452882514),
(119,2007,5944948,4222962988),
(119,2008,6046620,5443915121),
(119,2009,6148623,5832915387),
(119,2010,6249165,7127792630),
(119,2011,6347567,8749241114),
(119,2012,6444530,10191350120),
(119,2013,6541304,11942230508),
(119,2014,6639756,13268458232),
(119,2015,6741164,14390391264),
(119,2016,6845846,15805707154),
(119,2017,6953035,16853087485),
(119,2018,7061507,18130724396),
(120,1988,2684675,3313540068),
(120,1989,2726440,2717998688),
(120,1990,2803044,2838485354),
(120,1991,2921706,4690415093),
(120,1992,3076132,5843579161),
(120,1993,3246126,7941744492),
(120,1994,3403357,9599127050),
(120,1995,3528380,11718795528),
(120,1996,3610665,13690217333),
(120,1997,3658424,15751867489),
(120,1998,3693520,17247179006),
(120,1999,3747766,17391056369),
(120,2000,3842778,17260364842),
(120,2001,3991001,17649751244),
(120,2002,4182205,19152238806),
(120,2003,4388375,20082918740),
(120,2004,4569378,21145518600),
(120,2005,4698763,21489962080),
(120,2006,4759753,22048664306),
(120,2007,4767344,24873482492),
(120,2008,4764741,29227542760),
(120,2009,4813026,35477299024),
(120,2010,4953061,38419626534),
(120,2011,5202343,40075674295),
(120,2012,5538634,44230727695),
(120,2013,5914621,46866579768),
(120,2014,6262410,48296099502),
(120,2015,6532678,49973893201),
(120,2016,6711121,51239050083),
(120,2017,6811873,53393799668),
(120,2018,6848925,56639155556),
(121,2000,2848456,874000000),
(121,2001,2953927,906000000),
(121,2002,3024729,927000000),
(121,2003,3077058,748000000),
(121,2004,3135651,897000000),
(121,2005,3218116,949000000),
(121,2006,3329211,1119000000),
(121,2007,3461911,1373000000),
(121,2008,3607860,1726000000),
(121,2009,3754133,1768000000),
(121,2010,3891356,1998000000),
(121,2011,4017443,2398000000),
(121,2012,4135659,2721000000),
(121,2013,4248334,3067000000),
(121,2014,4359505,3144000000),
(121,2015,4472230,3177000000),
(121,2016,4586788,3277826000),
(121,2017,4702228,3285455000),
(121,2018,4818977,3249000000),
(122,1990,4436661,28901836158),
(122,1991,4544242,31995012469),
(122,1992,4650885,33881392045),
(122,1993,4755133,30657030223),
(122,1994,4854875,28607921929),
(122,1995,4948798,25544128199),
(122,1996,5036171,27884615385),
(122,1997,5118007,30698633109),
(122,1998,5196780,27249786142),
(122,1999,5275926,35976714101),
(122,2000,5357891,38270206950),
(122,2001,5443248,34110064452),
(122,2002,5531089,20481889764),
(122,2003,5620547,26265625000),
(122,2004,5710154,33122307692),
(122,2005,5798614,47334148578),
(122,2006,5886872,54961936663),
(122,2007,5974787,67516236338),
(122,2008,6058748,87140405361),
(122,2009,6133984,63028320702),
(122,2010,6197663,74773444901),
(122,2011,6247439,34699395524),
(122,2012,6285750,81873662519),
(122,2013,6320359,65502870174),
(122,2014,6362037,41142722414),
(122,2015,6418315,27842131480),
(122,2016,6492164,26221660068),
(122,2017,6580724,38115981879),
(122,2018,6678567,48319620013),
(123,1977,112685,92546835),
(123,1978,114400,107827737),
(123,1979,116136,130475734),
(123,1980,117822,154461345),
(123,1981,119430,177541041),
(123,1982,120988,193148724),
(123,1983,122564,208178548),
(123,1984,124292,229371734),
(123,1985,126244,254459434),
(123,1986,128449,304169848),
(123,1987,130856,335887283),
(123,1988,133367,384376809),
(123,1989,135788,435493044),
(123,1990,138020,518433324),
(123,1991,139995,548819074),
(123,1992,141760,602911074),
(123,1993,143409,612538814),
(123,1994,145083,638422518),
(123,1995,146870,682370000),
(123,1996,148834,705672777),
(123,1997,150913,721068259),
(123,1998,153021,784752481),
(123,1999,154995,824732888),
(123,2000,156729,834327296),
(123,2001,158179,798333814),
(123,2002,159392,805069148),
(123,2003,160530,883314333),
(123,2004,161816,954317407),
(123,2005,163417,1015934667),
(123,2006,165381,1134567222),
(123,2007,167639,1279428222),
(123,2008,170011,1286720333),
(123,2009,172221,1278745519),
(123,2010,174085,1399203481),
(123,2011,175544,1444269667),
(123,2012,176646,1437879370),
(123,2013,177513,1481132148),
(123,2014,178296,1542406296),
(123,2015,179126,1640925667),
(123,2016,180024,1688244704),
(123,2017,180955,1810139889),
(123,2018,181889,1876189778),
(124,1970,21266,90098330),
(124,1971,21728,104888628),
(124,1972,22151,124941925),
(124,1973,22563,165930611),
(124,1974,22983,193983720),
(124,1975,23438,246387479),
(124,1976,23931,272493879),
(124,1977,24448,303496276),
(124,1978,24975,436918176),
(124,1979,25459,503180670),
(124,1980,25879,534701915),
(124,1981,26238,511658690),
(124,1982,26536,522090331),
(124,1983,26789,524034109),
(124,1984,27036,502617355),
(124,1985,27288,529078995),
(124,1986,27559,779365167),
(124,1987,27837,1052843348),
(124,1988,28129,1161757671),
(124,1989,28449,1120000917),
(124,1990,28789,1421466240),
(124,1991,29159,1484152022),
(124,1992,29553,1631197909),
(124,1993,29975,1673104494),
(124,1994,30426,1948118228),
(124,1995,30880,2428461395),
(124,1996,31348,2504033252),
(124,1997,31830,2298410391),
(124,1998,32311,2479721341),
(124,1999,32769,2664026095),
(124,2000,33184,2483953103),
(124,2001,33552,2491822707),
(124,2002,33879,2688630823),
(124,2003,34175,3070691320),
(124,2004,34452,3454362686),
(124,2005,34713,3659251526),
(124,2006,34970,4000239273),
(124,2007,35217,4601299567),
(124,2008,35471,5081432924),
(124,2009,35727,4504549214),
(124,2010,35994,5082366478),
(124,2011,36293,5739977477),
(124,2012,36615,5456009385),
(124,2013,36934,6391735894),
(124,2014,37223,6657170923),
(124,2015,37470,6268391521),
(124,2016,37658,6214633651),
(125,1960,9874476,1409873950),
(125,1961,10111637,1444327731),
(125,1962,10352179,1434156379),
(125,1963,10597511,1240672269),
(125,1964,10849975,1309747899),
(125,1965,11110820,1698319328),
(125,1966,11380670,1751470588),
(125,1967,11657650,1859465021),
(125,1968,11937600,1801344538),
(125,1969,12214956,1965546218),
(125,1970,12485740,2296470588),
(125,1971,12747821,2369308600),
(125,1972,13002231,2553936348),
(125,1973,13252036,2875625000),
(125,1974,13501935,3574586466),
(125,1975,13755146,3791298146),
(125,1976,14012899,3591319857),
(125,1977,14273495,4104509583),
(125,1978,14533690,2733183857),
(125,1979,14788862,3364611432),
(125,1980,15035834,4024621900),
(125,1981,15272831,4415844156),
(125,1982,15501207,4768765017),
(125,1983,15724651,5167913302),
(125,1984,15948487,6043474843),
(125,1985,16176280,5978460972),
(125,1986,16408859,6405210564),
(125,1987,16643952,6682167120),
(125,1988,16878189,6978371581),
(125,1989,17106753,6987267684),
(125,1990,17325773,8032551173),
(125,1991,17535729,9000362582),
(125,1992,17736821,9703011636),
(125,1993,17924823,10338679636),
(125,1994,18094477,11717604209),
(125,1995,18242912,13029697561),
(125,1996,18367288,13897738375),
(125,1997,18470900,15091913884),
(125,1998,18564599,15794972847),
(125,1999,18663284,15656327860),
(125,2000,18777601,16330814180),
(125,2001,18911730,15749753805),
(125,2002,19062482,16536535647),
(125,2003,19224037,18881765437),
(125,2004,19387153,20662525941),
(125,2005,19544988,24405791045),
(125,2006,19695972,28279814925),
(125,2007,19842044,32350248411),
(125,2008,19983984,40713812310),
(125,2009,20123508,42066217872),
(125,2010,20261737,56725749222),
(125,2011,20398670,65292753005),
(125,2012,20425000,68434409315),
(125,2013,20585000,74317806538),
(125,2014,20778000,79356449841),
(125,2015,20970000,80604080689),
(125,2016,21203000,82401038710),
(125,2017,21444000,88019706804),
(125,2018,21670000,88900770858),
(126,1960,837270,34579308),
(126,1961,852890,35699286),
(126,1962,869136,41859162),
(126,1963,886057,47039059),
(126,1964,903763,51938961),
(126,1965,922306,54878902),
(126,1966,941794,56698866),
(126,1967,962273,59260814),
(126,1968,983685,61444771),
(126,1969,1005909,65966680),
(126,1970,1028926,68738625),
(126,1971,1052614,76482102),
(126,1972,1077095,80915831),
(126,1973,1102878,121181556),
(126,1974,1130635,150846210),
(126,1975,1160792,149560513),
(126,1976,1193521,147654093),
(126,1977,1228536,193307267),
(126,1978,1265202,266559337),
(126,1979,1302667,290142517),
(126,1980,1340255,431561376),
(126,1981,1377799,434188034),
(126,1982,1415367,348746822),
(126,1983,1452728,386699308),
(126,1984,1489691,333158476),
(126,1985,1526131,268626912),
(126,1986,1561692,318862888),
(126,1987,1596394,402774852),
(126,1988,1630996,470389179),
(126,1989,1666563,495404888),
(126,1990,1703747,596415104),
(126,1991,1742539,704329192),
(126,1992,1782285,831033941),
(126,1993,1822236,835592802),
(126,1994,1861324,878250450),
(126,1995,1898598,1001889857),
(126,1996,1934291,946123275),
(126,1997,1968044,997996028),
(126,1998,1997516,928458206),
(126,1999,2019731,912771290),
(126,2000,2032804,887295267),
(126,2001,2035740,825706961),
(126,2002,2029829,775780697),
(126,2003,2018348,1157832935),
(126,2004,2005940,1511236656),
(126,2005,1996114,1682350935),
(126,2006,1989939,1800105590),
(126,2007,1986922,1716262753),
(126,2008,1987129,1758534995),
(126,2009,1990131,1773199523),
(126,2010,1995581,2361613520),
(126,2011,2003787,2787951881),
(126,2012,2014990,2678475773),
(126,2013,2028519,2526009063),
(126,2014,2043437,2614566292),
(126,2015,2059021,2510312801),
(126,2016,2075001,2323419617),
(126,2017,2091412,2578265356),
(126,2018,2108132,2791762880),
(127,1995,3629102,7870782261),
(127,1996,3601613,8385109020),
(127,1997,3575137,10120274493),
(127,1998,3549331,11240360898),
(127,1999,3524238,10972878636),
(127,2000,3499536,11539211480),
(127,2001,3470818,12252498921),
(127,2002,3443067,14278357284),
(127,2003,3415213,18802576988),
(127,2004,3377075,22649930576),
(127,2005,3322528,26125575942),
(127,2006,3269909,30216060233),
(127,2007,3231294,39738180077),
(127,2008,3198231,47850551149),
(127,2009,3162916,37440673478),
(127,2010,3097282,37120517694),
(127,2011,3028115,43476873413),
(127,2012,2987773,42848195256),
(127,2013,2957689,46417340375),
(127,2014,2932367,48516371721),
(127,2015,2904910,41516701871),
(127,2016,2868231,42973365745),
(127,2017,2828403,47544459559),
(127,2018,2789533,53251369047),
(128,1960,313970,703925705),
(128,1961,316845,704145671),
(128,1962,320750,741509480),
(128,1963,324100,791140595),
(128,1964,327750,903158753),
(128,1965,331500,921600736),
(128,1966,333895,968440149),
(128,1967,334995,974721762),
(128,1968,335850,1066447131),
(128,1969,337500,1234878981),
(128,1970,339171,1509155063),
(128,1971,342421,1572310772),
(128,1972,346600,1968733022),
(128,1973,350450,2701874664),
(128,1974,355050,3295861019),
(128,1975,358950,3233431611),
(128,1976,360731,3544268025),
(128,1977,361358,3922895892),
(128,1978,362007,4884869092),
(128,1979,362856,5711457760),
(128,1980,364150,6232005656),
(128,1981,365225,5231808670),
(128,1982,365525,4764549532),
(128,1983,365622,4683697830),
(128,1984,365998,4594891581),
(128,1985,366706,4738559685),
(128,1986,368355,6921264132),
(128,1987,370750,8614215559),
(128,1988,373450,9750161053),
(128,1989,377100,10391504709),
(128,1990,381850,13229247948),
(128,1991,387000,14321878795),
(128,1992,392175,16065740778),
(128,1993,397475,16486900187),
(128,1994,402925,18325791415),
(128,1995,408625,21588170498),
(128,1996,414225,21776609772),
(128,1997,419450,19731912494),
(128,1998,424700,20209122027),
(128,1999,430475,22235929043),
(128,2000,436300,21263514833),
(128,2001,441525,21272418792),
(128,2002,446175,23616328816),
(128,2003,451630,29557325056),
(128,2004,458095,34685281848),
(128,2005,465158,37347394603),
(128,2006,472637,42414308117),
(128,2007,479993,50888134410),
(128,2008,488650,55849686539),
(128,2009,497783,51370543206),
(128,2010,506953,53212476812),
(128,2011,518347,60004630234),
(128,2012,530946,56677961787),
(128,2013,543360,61739352212),
(128,2014,556319,66103853237),
(128,2015,569604,57204400105),
(128,2016,582014,58961235412),
(128,2017,596336,62316359824),
(128,2018,607728,69487922619),
(129,1995,2485056,5788368511),
(129,1996,2457222,5970044666),
(129,1997,2432851,6525676264),
(129,1998,2410019,7174985107),
(129,1999,2390482,7533187605),
(129,2000,2367550,7937758980),
(129,2001,2337170,8350252966),
(129,2002,2310173,9546441564),
(129,2003,2287955,11748433157),
(129,2004,2263122,14373269156),
(129,2005,2238799,16922504045),
(129,2006,2218357,21447021570),
(129,2007,2200325,30901399261),
(129,2008,2177322,35596016664),
(129,2009,2141669,26169854045),
(129,2010,2097555,23757368290),
(129,2011,2059709,28223552825),
(129,2012,2034319,28119996053),
(129,2013,2012647,30254677297),
(129,2014,1993782,31335013752),
(129,2015,1977527,26972863394),
(129,2016,1959537,27695474684),
(129,2017,1942248,30463302414),
(129,2018,1926542,34849078086),
(130,1982,251158,1130457130),
(130,1983,260931,1121486563),
(130,1984,271918,1292281654),
(130,1985,283503,1348827324),
(130,1986,295591,1517496131),
(130,1987,308180,1941246972),
(130,1988,320773,2269233639),
(130,1989,332783,2683254708),
(130,1990,343808,3220920085),
(130,1991,353626,3735117374),
(130,1992,362311,4879018602),
(130,1993,370199,5625533410),
(130,1994,377798,6265844252),
(130,1995,385513,6996034037),
(130,1996,393373,7122539667),
(130,1997,401352,7211264780),
(130,1998,409616,6742367273),
(130,1999,418383,6490571704),
(130,2000,427782,6720492406),
(130,2001,437938,6811227983),
(130,2002,448821,7322677820),
(130,2003,460165,8195033162),
(130,2004,471597,10585624891),
(130,2005,482858,12092222042),
(130,2006,493799,14789661809),
(130,2007,504511,18340447243),
(130,2008,515239,20917444920),
(130,2009,526400,21475520709),
(130,2010,538219,28123640999),
(130,2011,550832,36709860068),
(130,2012,564039,43031577366),
(130,2013,577372,51552075902),
(130,2014,590208,55347998648),
(130,2015,602085,45361678147),
(130,2016,612836,45322259884),
(130,2017,622585,50559431846),
(130,2018,631636,54545184268),
(131,1960,12328532,2037150716),
(131,1961,12710581,2025689537),
(131,1962,13094888,2379606422),
(131,1963,13478423,2657247327),
(131,1964,13857649,2798339769),
(131,1965,14230163,2948325264),
(131,1966,14595350,2876395613),
(131,1967,14954031,3046339295),
(131,1968,15307273,3271415868),
(131,1969,15656843,3651615453),
(131,1970,16004731,3956328426),
(131,1971,16350881,4356633663),
(131,1972,16696891,5074117545),
(131,1973,17048518,6242177798),
(131,1974,17413144,7675408486),
(131,1975,17796164,8984824183),
(131,1976,18198844,9584323309),
(131,1977,18620093,11049896742),
(131,1978,19059770,13236854105),
(131,1979,19516942,15912133569),
(131,1980,19990012,21728770055),
(131,1981,20479715,17788171722),
(131,1982,20984009,17692341358),
(131,1983,21495086,16251460689),
(131,1984,22002643,14824728528),
(131,1985,22499110,14991283216),
(131,1986,22980335,19462175322),
(131,1987,23447252,21765261042),
(131,1988,23903592,25705296184),
(131,1989,24355619,26314220188),
(131,1990,24807462,30180108562),
(131,1991,25260404,32285388165),
(131,1992,25711406,33711069431),
(131,1993,26155203,31655473664),
(131,1994,26584478,35604137423),
(131,1995,26994250,39030285468),
(131,1996,27383473,43161452678),
(131,1997,27754571,39147844526),
(131,1998,28110443,41806219379),
(131,1999,28455509,41632027600),
(131,2000,28793679,38857251336),
(131,2001,29126330,39459581217),
(131,2002,29454768,42236836821),
(131,2003,29782884,52064058834),
(131,2004,30115214,59626020162),
(131,2005,30455561,62343022651),
(131,2006,30804683,68640825481),
(131,2007,31163673,79041294874),
(131,2008,31536811,92507257784),
(131,2009,31929087,92897320376),
(131,2010,32343389,93216746662),
(131,2011,32781850,101370000000),
(131,2012,33241898,98266306615),
(131,2013,33715693,106826000000),
(131,2014,34192347,110081000000),
(131,2015,34663603,101180000000),
(131,2016,35126296,103345000000),
(131,2017,35581294,109709000000),
(131,2018,36029138,118495000000),
(132,1970,23484,293073868),
(132,1971,23721,327651488),
(132,1972,24051,402460333),
(132,1973,24439,523552815),
(132,1974,24836,563939670),
(132,1975,25198,711922994),
(132,1976,25524,735339911),
(132,1977,25809,811250927),
(132,1978,26087,1000535735),
(132,1979,26394,1209898293),
(132,1980,26745,1378130996),
(132,1981,27162,1205166026),
(132,1982,27627,1143229072),
(132,1983,28097,1092551781),
(132,1984,28510,1037314956),
(132,1985,28832,1082851077),
(132,1986,29041,1515209588),
(132,1987,29168,1839095595),
(132,1988,29229,2000674667),
(132,1989,29305,2010116851),
(132,1990,29438,2481316054),
(132,1991,29622,2480497539),
(132,1992,29865,2737067002),
(132,1993,30146,2574440023),
(132,1994,30435,2720297793),
(132,1995,30716,3130270895),
(132,1996,30995,3137848801),
(132,1997,31280,2840182221),
(132,1998,31556,2934578821),
(132,1999,31844,2906009308),
(132,2000,32147,2647883816),
(132,2001,32470,2671424966),
(132,2002,32806,2905840862),
(132,2003,33153,3589126975),
(132,2004,33500,4110169853),
(132,2005,33843,4203084194),
(132,2006,34190,4582988333),
(132,2007,34525,5867916781),
(132,2008,34872,6476490406),
(132,2009,35226,5451653237),
(132,2010,35612,5362649007),
(132,2011,36024,6080344732),
(132,2012,36460,5743029680),
(132,2013,36901,6553372278),
(132,2014,37322,7060236168),
(132,2015,37718,6258178995),
(132,2016,38070,6468252212),
(132,2017,38392,6400946586),
(133,1995,3675099,1752979926),
(133,1996,3667748,1695122174),
(133,1997,3654208,1930081169),
(133,1998,3652732,1698717505),
(133,1999,3647001,1170782957),
(133,2000,3639592,1288429392),
(133,2001,3631462,1480673594),
(133,2002,3623062,1661818168),
(133,2003,3612874,1980901554),
(133,2004,3603945,2598231467),
(133,2005,3595187,2988338439),
(133,2006,3585209,3408272498),
(133,2007,3576910,4401154128),
(133,2008,3570108,6054806101),
(133,2009,3565604,5439422031),
(133,2010,3562045,6974960345),
(133,2011,3559986,8414360656),
(133,2012,3559519,8709165249),
(133,2013,3558566,9496684701),
(133,2014,3556397,9510219299),
(133,2015,3554108,7745231660),
(133,2016,3551954,8071480541),
(133,2017,3549196,9669759987),
(133,2018,3545883,11309082555),
(134,1960,5099373,673081724),
(134,1961,5223568,699161943),
(134,1962,5352503,739286906),
(134,1963,5486319,759345863),
(134,1964,5625164,802482182),
(134,1965,5769218,833563472),
(134,1966,5918595,900264583),
(134,1967,6073526,956436931),
(134,1968,6234465,1031669636),
(134,1969,6401921,1056391055),
(134,1970,6576305,1111859570),
(134,1971,6757850,1199507630),
(134,1972,6946620,1341590682),
(134,1973,7142627,1653062347),
(134,1974,7345780,1917508190),
(134,1975,7556026,2283049233),
(134,1976,7773449,2181844194),
(134,1977,7998164,2358930406),
(134,1978,8230218,2669755116),
(134,1979,8469672,3463565881),
(134,1980,8716553,4042139901),
(134,1981,8971345,3594868208),
(134,1982,9234129,3526198070),
(134,1983,9504281,3511573992),
(134,1984,9780872,2939485472),
(134,1985,10063495,2857889712),
(134,1986,10352120,3258288891),
(134,1987,10647754,2565634382),
(134,1988,10952395,2442507588),
(134,1989,11268658,2498059015),
(134,1990,11598633,3081479800),
(134,1991,11942819,2653141959),
(134,1992,12301336,3024459564),
(134,1993,12675460,3370842211),
(134,1994,13066543,2977040722),
(134,1995,13475400,3159901232),
(134,1996,13902688,3995028593),
(134,1997,14347854,3545776697),
(134,1998,14808791,3738704468),
(134,1999,15282521,3717515283),
(134,2000,15766806,3877673539),
(134,2001,16260932,4529575348),
(134,2002,16765117,4397254608),
(134,2003,17279141,5474030080),
(134,2004,17802997,4363934494),
(134,2005,18336724,5039293031),
(134,2006,18880269,5515884349),
(134,2007,19433530,7342923489),
(134,2008,19996473,9413002921),
(134,2009,20569117,8550363975),
(134,2010,21151640,8729936136),
(134,2011,21743967,9892702358),
(134,2012,22346641,9919780071),
(134,2013,22961253,10601690872),
(134,2014,23589887,10673516673),
(134,2015,24234088,9744243531),
(134,2016,24894380,9958655045),
(134,2017,25570540,11465850504),
(134,2018,26262368,12100459087),
(135,1980,158272,42463576),
(135,1981,163824,44781456),
(135,1982,169851,47935843),
(135,1983,176244,57829787),
(135,1984,182850,109503546),
(135,1985,189537,127154929),
(135,1986,196264,141902097),
(135,1987,203028,141268980),
(135,1988,209785,168610478),
(135,1989,216510,189535398),
(135,1990,223158,215089005),
(135,1991,229751,244468292),
(135,1992,236265,284853358),
(135,1993,242605,322326642),
(135,1994,248588,355884383),
(135,1995,254139,398988955),
(135,1996,259183,450382328),
(135,1997,263842,508223602),
(135,1998,268455,540096397),
(135,1999,273527,589239753),
(135,2000,279398,624337145),
(135,2001,286306,870179738),
(135,2002,294186,897031250),
(135,2003,302683,1052121055),
(135,2004,311265,1226829563),
(135,2005,319608,1163362437),
(135,2006,327487,1575200391),
(135,2007,335169,1868383461),
(135,2008,343452,2271646188),
(135,2009,353398,2345294875),
(135,2010,365734,2588176055),
(135,2011,380495,2774351760),
(135,2012,397237,2886170572),
(135,2013,415593,3295011382),
(135,2014,435015,3697351597),
(135,2015,454915,4109424800),
(135,2016,475513,4414055725),
(135,2017,496402,4865546026),
(135,2018,515696,5272288443),
(136,1960,37771859,13040000000),
(136,1961,38966056,14160000000),
(136,1962,40195319,15200000000),
(136,1963,41462369,16960000000),
(136,1964,42771079,20080000000),
(136,1965,44123853,21840000000),
(136,1966,45519737,24320000000),
(136,1967,46956208,26560000000),
(136,1968,48431972,29360000000),
(136,1969,49945279,32480000000),
(136,1970,51493565,35520000000),
(136,1971,53076373,39200000000),
(136,1972,54689943,45200000000),
(136,1973,56324303,55280000000),
(136,1974,57966804,72000000000),
(136,1975,59607953,88000000000),
(136,1976,61242190,89025974026),
(136,1977,62869903,81814159292),
(136,1978,64494869,102500000000),
(136,1979,66123897,134561000000),
(136,1980,67761372,205139000000),
(136,1981,69407624,263959000000),
(136,1982,71058654,184609000000),
(136,1983,72709299,156159000000),
(136,1984,74352631,184261000000),
(136,1985,75983485,195220000000),
(136,1986,77599098,134550000000),
(136,1987,79200081,147541000000),
(136,1988,80788721,181612000000),
(136,1989,82368931,221401000000),
(136,1990,83943132,261254000000),
(136,1991,85512623,313143000000),
(136,1992,87075138,363158000000),
(136,1993,88625440,500736000000),
(136,1994,90156400,527813000000),
(136,1995,91663285,360074000000),
(136,1996,93147044,410976000000),
(136,1997,94611002,500413000000),
(136,1998,96056321,526502000000),
(136,1999,97484832,600233000000),
(136,2000,98899845,707907000000),
(136,2001,100298153,756706000000),
(136,2002,101684758,772106000000),
(136,2003,103081020,729336000000),
(136,2004,104514932,782241000000),
(136,2005,106005203,877476000000),
(136,2006,107560153,975387000000),
(136,2007,109170502,1052700000000),
(136,2008,110815271,1109990000000),
(136,2009,112463887,900045000000),
(136,2010,114092963,1057800000000),
(136,2011,115695473,1180490000000),
(136,2012,117274155,1201090000000),
(136,2013,118827161,1274440000000),
(136,2014,120355128,1314560000000),
(136,2015,121858258,1170560000000),
(136,2016,123333376,1077830000000),
(136,2017,124777324,1158070000000),
(136,2018,126190788,1223810000000),
(137,1981,31893,31020000),
(137,1982,33328,34918000),
(137,1983,34889,41749000),
(137,1984,36557,45144000),
(137,1985,38333,43879000),
(137,1986,40211,55989000),
(137,1987,42173,62983000),
(137,1988,44083,70688000),
(137,1989,45820,72798000),
(137,1990,47271,78476000),
(137,1991,48404,82507000),
(137,1992,49245,91063000),
(137,1993,49831,99461000),
(137,1994,50215,108071000),
(137,1995,50457,120230000),
(137,1996,50533,110858000),
(137,1997,50450,106289100),
(137,1998,50356,108702100),
(137,1999,50423,107978900),
(137,2000,50753,110937700),
(137,2001,51422,115152100),
(137,2002,52370,124735100),
(137,2003,53456,126887600),
(137,2004,54476,131334600),
(137,2005,55258,137928600),
(137,2006,55767,143930000),
(137,2007,56051,150776500),
(137,2008,56174,152788700),
(137,2009,56250,152617500),
(137,2010,56366,164969100),
(137,2011,56531,173260300),
(137,2012,56717,185210500),
(137,2013,56938,190800800),
(137,2014,57179,183121300),
(137,2015,57439,179697900),
(137,2016,57735,194497900),
(137,2017,58058,204173400),
(137,2018,58413,211523642),
(138,1990,1996228,4699646643),
(138,1991,1993302,4938775510),
(138,1992,1988659,2436849342),
(138,1993,1984028,2682456897),
(138,1994,1981703,3556581986),
(138,1995,1983252,4680078740),
(138,1996,1989443,4651453634),
(138,1997,1999598,3928975904),
(138,1998,2012057,3756208791),
(138,1999,2024394,3863743409),
(138,2000,2034819,3772851420),
(138,2001,2042842,3709637830),
(138,2002,2048928,4018365247),
(138,2003,2053426,4946292775),
(138,2004,2057048,5682719260),
(138,2005,2060273,6258600714),
(138,2006,2063131,6861222332),
(138,2007,2065426,8336478142),
(138,2008,2067313,9909548411),
(138,2009,2069039,9401731496),
(138,2010,2070741,9407168702),
(138,2011,2072487,10494632699),
(138,2012,2074278,9745251126),
(138,2013,2076067,10817712139),
(138,2014,2077775,11362272838),
(138,2015,2079328,10064515432),
(138,2016,2080745,10672471861),
(138,2017,2081996,11279509014),
(138,2018,2082958,12672131053),
(139,1967,5706199,275494520),
(139,1968,5780835,343771964),
(139,1969,5861412,339913833),
(139,1970,5949045,359772363),
(139,1971,6044530,430096738),
(139,1972,6147458,486617332),
(139,1973,6256187,563683660),
(139,1974,6368348,538747268),
(139,1975,6482278,830710615),
(139,1976,6596728,939227993),
(139,1977,6712267,1049838493),
(139,1978,6831085,1222702356),
(139,1979,6956402,1595423286),
(139,1980,7090126,1759690812),
(139,1981,7234728,1538972158),
(139,1982,7388668,1333754034),
(139,1983,7545166,1297765449),
(139,1984,7694855,1232932008),
(139,1985,7831889,1392195933),
(139,1986,7952865,1852163475),
(139,1987,8062219,2090629723),
(139,1988,8171522,2169040742),
(139,1989,8296915,2181821902),
(139,1990,8449913,2681912030),
(139,1991,8635527,2724131545),
(139,1992,8850334,2830673389),
(139,1993,9087176,2818280876),
(139,1994,9334880,2081846483),
(139,1995,9585653,2706425298),
(139,1996,9837571,2780422212),
(139,1997,10094368,2697105694),
(139,1998,10360561,2920358587),
(139,1999,10642936,3439463140),
(139,2000,10946445,2954129566),
(139,2001,11271600,3465305993),
(139,2002,11616887,3889758024),
(139,2003,11982695,4703504467),
(139,2004,12369070,5444474268),
(139,2005,12775516,6245031690),
(139,2006,13203378,6899799786),
(139,2007,13651464,8145694632),
(139,2008,14113577,9750822511),
(139,2009,14581429,10181021770),
(139,2010,15049353,10678749467),
(139,2011,15514591,12978107561),
(139,2012,15979499,12442747897),
(139,2013,16449864,13246412031),
(139,2014,16934220,14345828992),
(139,2015,17438778,13099495530),
(139,2016,17965429,14010787738),
(139,2017,18512394,15339614407),
(139,2018,19077690,17196688920),
(140,1970,302650,250721821),
(140,1971,302700,264579879),
(140,1972,302450,295118249),
(140,1973,302200,345602025),
(140,1974,301996,376094108),
(140,1975,304222,474620439),
(140,1976,305774,527936988),
(140,1977,306970,625573345),
(140,1978,310182,793675169),
(140,1979,313342,1001300838),
(140,1980,316645,1250242108),
(140,1981,318982,1243469361),
(140,1982,325898,1234518125),
(140,1983,330524,1165771369),
(140,1984,330593,1101828569),
(140,1985,336452,1117835286),
(140,1986,342121,1435079200),
(140,1987,344485,1751247763),
(140,1988,347325,2019474244),
(140,1989,350722,2118574772),
(140,1990,354170,2547163582),
(140,1991,363845,2750041434),
(140,1992,367618,3021910217),
(140,1993,371308,2709178327),
(140,1994,374797,2998570147),
(140,1995,377419,3439931907),
(140,1996,379905,3570271558),
(140,1997,382791,3705372039),
(140,1998,385287,3923637971),
(140,1999,387578,4127313818),
(140,2000,390087,4306192436),
(140,2001,393028,4331870648),
(140,2002,395969,4689832690),
(140,2003,398582,5456583589),
(140,2004,401268,6062780269),
(140,2005,403834,6394851387),
(140,2006,405308,6757119558),
(140,2007,406724,7880509171),
(140,2008,409379,8977149553),
(140,2009,412477,8528202278),
(140,2010,414508,8741059603),
(140,2011,416268,9500669015),
(140,2012,420028,9211948091),
(140,2013,425967,10151192766),
(140,2014,434558,11281702720),
(140,2015,445053,10701866983),
(140,2016,455356,11442612409),
(140,2017,467999,12748803180),
(140,2018,483530,14542039605),
(141,2000,46719701,8905066164),
(141,2001,47225120,6477790688),
(141,2002,47702171,6777632512),
(141,2003,48148902,10467109978),
(141,2004,48564484,10567354056),
(141,2005,48949924,11986972419),
(141,2006,49301050,14502553710),
(141,2007,49621475,20182477481),
(141,2008,49929642,31862554102),
(141,2009,50250367,36906181381),
(141,2010,50600818,49540813342),
(141,2011,50990615,59977326086),
(141,2012,51413698,59937797559),
(141,2013,51852451,60269734045),
(141,2014,52280807,65446199788),
(141,2015,52680726,59687410897),
(141,2016,53045226,63256184700),
(141,2017,53382581,66719084836),
(141,2018,53708395,71214803378),
(142,1981,1733475,2310099100),
(142,1982,1777727,2552401933),
(142,1983,1823216,2725736633),
(142,1984,1871090,2098734600),
(142,1985,1921881,2186505475),
(142,1986,1976310,2896178867),
(142,1987,2033344,3020611600),
(142,1988,2089715,3204461567),
(142,1989,2141011,3576966800),
(142,1990,2184145,2560785660),
(142,1991,2217917,2379018326),
(142,1992,2243495,1317611864),
(142,1993,2263186,768401634),
(142,1994,2280479,925817092),
(142,1995,2298020,1452165005),
(142,1996,2316568,1345719472),
(142,1997,2335734,1180934203),
(142,1998,2355664,1124440249),
(142,1999,2376225,1057408589),
(142,2000,2397418,1136896124),
(142,2001,2419588,1267997934),
(142,2002,2443271,1396555720),
(142,2003,2468762,1595297356),
(142,2004,2496391,1992066808),
(142,2005,2526424,2523471532),
(142,2006,2558856,3414055566),
(142,2007,2593820,4234999823),
(142,2008,2631898,5623216449),
(142,2009,2673796,4583850368),
(142,2010,2719896,7189481824),
(142,2011,2770362,10409797649),
(142,2012,2824699,12292770631),
(142,2013,2881792,12582122604),
(142,2014,2940108,12226514722),
(142,2015,2998439,11749620620),
(142,2016,3056359,11186734674),
(142,2017,3113779,11433635876),
(142,2018,3170208,13009574621),
(143,2002,58420,1284000000),
(143,2003,57947,1239000000),
(143,2004,57246,1210000000),
(143,2005,56542,1061000000),
(143,2006,55882,990000000),
(143,2007,55219,938000000),
(143,2008,54625,939000000),
(143,2009,54193,795000000),
(143,2010,53971,799000000),
(143,2011,54012,733000000),
(143,2012,54311,751000000),
(143,2013,54784,782000000),
(143,2014,55305,845000000),
(143,2015,55780,931000000),
(143,2016,56188,1250000000),
(143,2017,56562,1593000000),
(144,1980,11630194,3526287037),
(144,1981,11913088,3537099150),
(144,1982,12189824,3612171958),
(144,1983,12439762,3236430348),
(144,1984,12636116,3376172170),
(144,1985,12764387,4456240741),
(144,1986,12808558,5247193069),
(144,1987,12786349,2354117303),
(144,1988,12758008,2093571674),
(144,1989,12805946,2314159887),
(144,1990,12987292,2512079324),
(144,1991,13328032,3263761938),
(144,1992,13806001,2291175765),
(144,1993,14370946,2394823062),
(144,1994,14948048,2460670288),
(144,1995,15483286,2521738760),
(144,1996,15960442,3523842275),
(144,1997,16397183,4227273069),
(144,1998,16813949,4873242526),
(144,1999,17244188,5302532113),
(144,2000,17711927,5016469069),
(144,2001,18221888,4766928747),
(144,2002,18764155,5031510909),
(144,2003,19331100,5597367853),
(144,2004,19910552,6831808930),
(144,2005,20493925,7723846195),
(144,2006,21080110,8312078525),
(144,2007,21673316,9366742309),
(144,2008,22276596,11494837053),
(144,2009,22894710,10911698204),
(144,2010,23531574,10154238250),
(144,2011,24187487,13131168012),
(144,2012,24862648,15265269711),
(144,2013,25560725,16018848994),
(144,2014,26286163,16961117243),
(144,2015,27042002,14798413628),
(144,2016,27829942,10896894351),
(144,2017,28649007,12651912500),
(144,2018,29495962,14457964381),
(145,1960,850384,92609243),
(145,1961,875581,107726205),
(145,1962,901686,111148610),
(145,1963,928734,113797382),
(145,1964,956799,151897202),
(145,1965,985910,172767212),
(145,1966,1016100,180340652),
(145,1967,1047344,191221776),
(145,1968,1079580,210695182),
(145,1969,1112745,199643447),
(145,1970,1146780,209348256),
(145,1971,1181674,227051055),
(145,1972,1217446,265009396),
(145,1973,1254157,333731886),
(145,1974,1291855,414772366),
(145,1975,1330598,475916497),
(145,1976,1370357,524407949),
(145,1977,1411140,540635401),
(145,1978,1453032,544424587),
(145,1979,1496185,644070390),
(145,1980,1540640,709041462),
(145,1981,1586493,747994670),
(145,1982,1633652,750214401),
(145,1983,1681863,788371840),
(145,1984,1730738,726937308),
(145,1985,1780030,683193876),
(145,1986,1829675,802890746),
(145,1987,1879763,909820596),
(145,1988,1930433,957377548),
(145,1989,1981899,981529430),
(145,1990,2034346,1019600785),
(145,1991,2087912,1443688870),
(145,1992,2142645,1464392416),
(145,1993,2198532,1249944999),
(145,1994,2255516,1315932645),
(145,1995,2313630,1415296704),
(145,1996,2372901,1442598431),
(145,1997,2433563,1401946853),
(145,1998,2496216,1375115534),
(145,1999,2561585,1405662879),
(145,2000,2630219,1293654175),
(145,2001,2702400,1295539448),
(145,2002,2778099,1324426607),
(145,2003,2857148,1563074860),
(145,2004,2939247,1833444740),
(145,2005,3024194,2184445123),
(145,2006,3111906,3040716679),
(145,2007,3202517,3356757064),
(145,2008,3296238,4031048268),
(145,2009,3393409,3662282133),
(145,2010,3494195,4337794151),
(145,2011,3598648,5166346516),
(145,2012,3706554,5231255478),
(145,2013,3817494,5639818812),
(145,2014,3930896,5372783880),
(145,2015,4046301,4832547925),
(145,2016,4163534,4727937032),
(145,2017,4282574,4975432191),
(145,2018,4403319,5365868725),
(148,1976,906507,704033525),
(148,1977,921379,823634464),
(148,1978,933499,1015365145),
(148,1979,949888,1211141231),
(148,1980,966039,1131788192),
(148,1981,980462,1142393555),
(148,1982,992521,1078408830),
(148,1983,1001691,1090276947),
(148,1984,1012221,1040557089),
(148,1985,1020528,1076121094),
(148,1986,1028360,1462900255),
(148,1987,1036082,1880852914),
(148,1988,1043239,2134517068),
(148,1989,1051260,2181930255),
(148,1990,1058775,2653480001),
(148,1991,1070266,2856890681),
(148,1992,1084441,3224267548),
(148,1993,1097374,3263368410),
(148,1994,1112846,3558137040),
(148,1995,1122457,4040345933),
(148,1996,1133996,4421943910),
(148,1997,1148284,4187367602),
(148,1998,1160421,4169664285),
(148,1999,1175267,4343710333),
(148,2000,1186873,4663313618),
(148,2001,1196287,4613630624),
(148,2002,1204621,4841310239),
(148,2003,1213370,5816553825),
(148,2004,1221003,6578844487),
(148,2005,1228254,6488750454),
(148,2006,1233996,7028803366),
(148,2007,1239630,8150138757),
(148,2008,1244121,9990370016),
(148,2009,1247429,9128843109),
(148,2010,1250400,10003670690),
(148,2011,1252404,11518393367),
(148,2012,1255882,11668685524),
(148,2013,1258653,12129642296),
(148,2014,1260934,12803445934),
(148,2015,1262605,11692287066),
(148,2016,1263473,12232463656),
(148,2017,1264613,13259351418),
(148,2018,1265303,14220348673),
(149,1960,3659984,162956740),
(149,1961,3747753,174576508),
(149,1962,3839043,183116337),
(149,1963,3933908,190816183),
(149,1964,4032371,194736105),
(149,1965,4134460,229455410),
(149,1966,4240429,260394792),
(149,1967,4350452,269814968),
(149,1968,4464423,245169806),
(149,1969,4582198,265810632),
(149,1970,4703782,290531621),
(149,1971,4829090,365386929),
(149,1972,4958549,406062874),
(149,1973,5093363,444281703),
(149,1974,5235073,548621017),
(149,1975,5384795,613220652),
(149,1976,5545651,670317634),
(149,1977,5717953,806290840),
(149,1978,5896865,949034016),
(149,1979,6075495,1058269066),
(149,1980,6250440,1237655461),
(149,1981,6412384,1237685692),
(149,1982,6565985,1180104216),
(149,1983,6737924,1223186840),
(149,1984,6964607,1208008985),
(149,1985,7268267,1131347798),
(149,1986,7666391,1183654828),
(149,1987,8141146,1183094128),
(149,1988,8636690,1379924257),
(149,1989,9075572,1590215583),
(149,1990,9404500,1880771556),
(149,1991,9600355,2203545857),
(149,1992,9685973,1799517082),
(149,1993,9710331,2070636936),
(149,1994,9745690,1181802596),
(149,1995,9844415,1397457932),
(149,1996,10022789,2281034131),
(149,1997,10264906,2663234934),
(149,1998,10552338,1750584265),
(149,1999,10854322,1775921718),
(149,2000,11148758,1743506531),
(149,2001,11432000,1716502862),
(149,2002,11713664,3495748398),
(149,2003,12000181,3208837077),
(149,2004,12301838,3476094499),
(149,2005,12625952,3655909664),
(149,2006,12973699,3998020177),
(149,2007,13341806,4432937046),
(149,2008,13727890,5321012192),
(149,2009,14128155,6191127665),
(149,2010,14539612,6959655571),
(149,2011,14962112,8004000737),
(149,2012,15396005,6028487929),
(149,2013,15839269,5518880769),
(149,2014,16289540,6047813437),
(149,2015,16745303,6373212641),
(149,2016,17205289,5433040160),
(149,2017,17670260,6303292264),
(149,2018,18143315,7064971176),
(150,1960,8156347,1916241997),
(150,1961,8417824,1901868548),
(150,1962,8692342,2001502679),
(150,1963,8973788,2510126748),
(150,1964,9253842,2674441396),
(150,1965,9526558,2956356984),
(150,1966,9790084,3143538482),
(150,1967,10046325,3188945512),
(150,1968,10297983,3330393310),
(150,1969,10549399,3664575983),
(150,1970,10804131,3864170913),
(150,1971,11062433,4244340334),
(150,1972,11324277,5043268549),
(150,1973,11592638,7662996767),
(150,1974,11871104,9496074114),
(150,1975,12162187,9298800799),
(150,1976,12468689,11050125905),
(150,1977,12790312,13139397879),
(150,1978,13122839,16358376511),
(150,1979,13460031,21213672089),
(150,1980,13798085,24488033442),
(150,1981,14134058,25004557094),
(150,1982,14471211,26804401816),
(150,1983,14819424,30346788438),
(150,1984,15192298,33943505718),
(150,1985,15598927,31200161095),
(150,1986,16043731,27734562640),
(150,1987,16522000,32181695507),
(150,1988,17022465,35271880250),
(150,1989,17528961,38848567631),
(150,1990,18029824,44024178343),
(150,1991,18519937,49142784405),
(150,1992,19002656,59167157498),
(150,1993,19484898,66894448545),
(150,1994,19977500,74477975918),
(150,1995,20487607,88704944179),
(150,1996,21017613,100855000000),
(150,1997,21562793,100005000000),
(150,1998,22114654,72167753771),
(150,1999,22661298,79148947368),
(150,2000,23194257,93789736842),
(150,2001,23709119,92783947368),
(150,2002,24208391,100845000000),
(150,2003,24698819,110202000000),
(150,2004,25190652,124750000000),
(150,2005,25690611,143534000000),
(150,2006,26201961,162691000000),
(150,2007,26720370,193548000000),
(150,2008,27236006,230814000000),
(150,2009,27735040,202258000000),
(150,2010,28208035,255017000000),
(150,2011,28650955,297952000000),
(150,2012,29068159,314443000000),
(150,2013,29468872,323277000000),
(150,2014,29866559,338062000000),
(150,2015,30270962,296636000000),
(150,2016,30684804,296753000000),
(150,2017,31105028,314707000000),
(150,2018,31528585,354348000000),
(152,1980,1057727,2422096075),
(152,1981,1080941,2246757386),
(152,1982,1105104,2116069374),
(152,1983,1131632,2293990996),
(152,1984,1162279,1947967886),
(152,1985,1198148,1605911706),
(152,1986,1239928,1806223061),
(152,1987,1286797,2296378835),
(152,1988,1336536,2491412336),
(152,1989,1386010,2531519951),
(152,1990,1432905,2785764518),
(152,1991,1476388,2992650454),
(152,1992,1516958,3424733520),
(152,1993,1555101,3218475900),
(152,1994,1591822,3636645995),
(152,1995,1627865,3942478206),
(152,1996,1663378,3945340776),
(152,1997,1698032,4102648720),
(152,1998,1731639,3826527631),
(152,1999,1763859,3818954448),
(152,2000,1794571,3833993703),
(152,2001,1823672,3476452446),
(152,2002,1851523,3275669889),
(152,2003,1879117,4811994025),
(152,2004,1907745,6480441754),
(152,2005,1938320,7121391946),
(152,2006,1971317,7835043624),
(152,2007,2006514,8740865600),
(152,2008,2043394,8486721917),
(152,2009,2081044,8876191121),
(152,2010,2118874,11282192605),
(152,2011,2156701,12409629836),
(152,2012,2194784,13016272899),
(152,2013,2233510,12717790505),
(152,2014,2273430,12786078008),
(152,2015,2314904,11650656642),
(152,2016,2358041,11286139080),
(152,2017,2402603,13566192143),
(152,2018,2448255,14521711630),
(153,1965,90500,159594493),
(153,1966,93500,164206537),
(153,1967,96500,180036768),
(153,1968,99500,215507164),
(153,1969,104000,263108834),
(153,1970,112000,358815681),
(153,1971,120000,413634335),
(153,1972,125500,505892512),
(153,1973,128500,542294864),
(153,1974,131000,637400199),
(153,1975,132500,816647865),
(153,1976,134000,798310509),
(153,1977,136000,837616756),
(153,1978,137500,846007597),
(153,1979,138500,1047225130),
(153,1980,140050,1182457143),
(153,1981,142650,972563810),
(153,1982,145700,904619629),
(153,1983,148700,823832940),
(153,1984,151650,796018978),
(153,1985,154450,854823821),
(153,1986,157350,1201262518),
(153,1987,160500,1488113532),
(153,1988,163650,2072735787),
(153,1989,166898,2185072798),
(153,1990,170899,2529310104),
(153,1991,175362,2653781596),
(153,1992,179799,2923764926),
(153,1993,184496,3070161471),
(153,1994,189482,3038727617),
(153,1995,193816,3628440275),
(153,1996,197564,3606968434),
(153,1997,201418,3291489841),
(153,1998,205279,3158806480),
(153,1999,209214,3056999988),
(153,2000,213230,2682347064),
(154,1960,3388764,449526872),
(154,1961,3486326,485785234),
(154,1962,3588228,531736492),
(154,1963,3693980,586294761),
(154,1964,3802803,582816358),
(154,1965,3914117,673383604),
(154,1966,4027963,702296184),
(154,1967,4144592,665586975),
(154,1968,4263927,641214210),
(154,1969,4385927,625867922),
(154,1970,4510644,649916708),
(154,1971,4637988,693573595),
(154,1972,4768227,742779740),
(154,1973,4902151,946385033),
(154,1974,5040798,1026136974),
(154,1975,5184941,1048690933),
(154,1976,5335085,1064517575),
(154,1977,5491153,1291457973),
(154,1978,5652652,1774365275),
(154,1979,5818763,2109278102),
(154,1980,5989004,2508524186),
(154,1981,6163705,2170893039),
(154,1982,6343523,2017611927),
(154,1983,6528641,1803099732),
(154,1984,6719309,1461243212),
(154,1985,6915997,1440581534),
(154,1986,7118883,1904097020),
(154,1987,7328943,2233005823),
(154,1988,7548433,2280356338),
(154,1989,7780245,2179567108),
(154,1990,8026591,2480673195),
(154,1991,8288735,2327986216),
(154,1992,8566770,2344987614),
(154,1993,8860287,1606581744),
(154,1994,9168312,1563207225),
(154,1995,9490288,1880803362),
(154,1996,9826598,1987770899),
(154,1997,10178201,1845599608),
(154,1998,10545716,2076737357),
(154,1999,10929918,2018193703),
(154,2000,11331557,1798374468),
(154,2001,11751365,1945327565),
(154,2002,12189983,2170481509),
(154,2003,12647984,2731416346),
(154,2004,13125916,3052898739),
(154,2005,13624467,3405134832),
(154,2006,14143971,3646728060),
(154,2007,14685399,4291363391),
(154,2008,15250908,5379299888),
(154,2009,15843133,5373097441),
(154,2010,16464025,5718664505),
(154,2011,17114761,6409184724),
(154,2012,17795191,6942258305),
(154,2013,18504255,7667952566),
(154,2014,19240157,8229731384),
(154,2015,20001663,7217667781),
(154,2016,20788838,7528285444),
(154,2017,21602472,8119710126),
(154,2018,22442948,9239513530),
(156,1960,45138458,4196092258),
(156,1961,46063563,4467200336),
(156,1962,47029822,4909302954),
(156,1963,48032934,5165489010),
(156,1964,49066760,5552822484),
(156,1965,50127921,5874422512),
(156,1966,51217973,6366792664),
(156,1967,52342233,5203135937),
(156,1968,53506196,5200895982),
(156,1969,54717039,6634187316),
(156,1970,55982144,12545849083),
(156,1971,57296983,9181769912),
(156,1972,58665808,12274416018),
(156,1973,60114625,15162871287),
(156,1974,61677177,24846641318),
(156,1975,63374298,27778934625),
(156,1976,65221378,36308883249),
(156,1977,67203128,36035407725),
(156,1978,69271917,36527862209),
(156,1979,71361131,47259911894),
(156,1980,73423633,64201788123),
(156,1981,75440502,164475000000),
(156,1982,77427546,142769000000),
(156,1983,79414840,97094911791),
(156,1984,81448755,73484359521),
(156,1985,83562785,73745821156),
(156,1986,85766399,54805852581),
(156,1987,88048032,52676041931),
(156,1988,90395271,49648470440),
(156,1989,92788027,44003061108),
(156,1990,95212450,54035795388),
(156,1991,97667632,49118433048),
(156,1992,100161710,47794925815),
(156,1993,102700753,27752204320),
(156,1994,105293700,33833042988),
(156,1995,107948335,44062465800),
(156,1996,110668794,51075815093),
(156,1997,113457663,54457835193),
(156,1998,116319759,54604050168),
(156,1999,119260063,59372613486),
(156,2000,122283850,69448756933),
(156,2001,125394046,74030364472),
(156,2002,128596076,95385819321),
(156,2003,131900631,104912000000),
(156,2004,135320422,136386000000),
(156,2005,138865016,176134000000),
(156,2006,142538308,236104000000),
(156,2007,146339977,275626000000),
(156,2008,150269623,337036000000),
(156,2009,154324933,291880000000),
(156,2010,158503197,363360000000),
(156,2011,162805071,410335000000),
(156,2012,167228767,459376000000),
(156,2013,171765769,514966000000),
(156,2014,176404902,568499000000),
(156,2015,181137448,494583000000),
(156,2016,185960289,404650000000),
(156,2017,190873311,375745000000),
(156,2018,195874740,397270000000),
(157,1960,1773129,223854666),
(157,1961,1829778,240524723),
(157,1962,1887425,265291588),
(157,1963,1946234,292916241),
(157,1964,2006481,341973758),
(157,1965,2068381,566542872),
(157,1966,2131976,606671444),
(157,1967,2197298,657171436),
(157,1968,2264623,695899980),
(157,1969,2334279,747971449),
(157,1970,2406513,776585681),
(157,1971,2481341,826571413),
(157,1972,2558699,880842890),
(157,1973,2638699,1093571442),
(157,1974,2721415,1520900045),
(157,1975,2806857,1590428523),
(157,1976,2894972,1847871372),
(157,1977,2985489,2239857061),
(157,1978,3077866,2142128604),
(157,1979,3171408,1527852636),
(157,1980,3265519,2189347368),
(157,1981,3360140,2448290110),
(157,1982,3455123,2465165180),
(157,1983,3549711,2743341724),
(157,1984,3642976,3105517091),
(157,1985,3734341,2683816289),
(157,1986,3823130,2885710609),
(157,1987,3909671,3851213728),
(157,1988,3995533,2630904262),
(157,1989,4082958,1013184746),
(157,1990,4173434,1009455484),
(157,1991,4267568,1488804124),
(157,1992,4364512,1792800000),
(157,1993,4462497,1756454248),
(157,1994,4559006,3863185119),
(157,1995,4652185,4140470000),
(157,1996,4741578,4308351903),
(157,1997,4827661,4389965591),
(157,1998,4910647,4635267225),
(157,1999,4991040,4855717875),
(157,2000,5069302,5107329007),
(157,2001,5145366,5323146566),
(157,2002,5219328,5224213018),
(157,2003,5292118,5322454926),
(157,2004,5364935,5795568205),
(157,2005,5438690,6321335612),
(157,2006,5513763,6763671611),
(157,2007,5590055,7423377429),
(157,2008,5667432,8496965842),
(157,2009,5745526,8298695145),
(157,2010,5824065,8758622329),
(157,2011,5903039,9774316692),
(157,2012,5982526,10532001130),
(157,2013,6062454,10982972256),
(157,2014,6142733,11880438824),
(157,2015,6223240,12756717323),
(157,2016,6303974,13286093197),
(157,2017,6384855,13843586680),
(157,2018,6465513,13117859222),
(159,1960,11486631,12276734172),
(159,1961,11638712,13493833740),
(159,1962,11805689,14647057370),
(159,1963,11965966,15891241386),
(159,1964,12127120,18699380731),
(159,1965,12294732,21000586933),
(159,1966,12456251,22867203317),
(159,1967,12598201,25087562181),
(159,1968,12729721,27817605743),
(159,1969,12877984,31503868835),
(159,1970,13038526,38164716869),
(159,1971,13194497,44579122682),
(159,1972,13328593,54706557264),
(159,1973,13439322,71840910058),
(159,1974,13545056,87243413477),
(159,1975,13666335,100250000000),
(159,1976,13774037,109169000000),
(159,1977,13856185,127017000000),
(159,1978,13941700,155860000000),
(159,1979,14038270,179669000000),
(159,1980,14149800,195152000000),
(159,1981,14247208,164134000000),
(159,1982,14312690,158480000000),
(159,1983,14367070,153445000000),
(159,1984,14424211,143913000000),
(159,1985,14491632,143846000000),
(159,1986,14572278,200862000000),
(159,1987,14665037,245046000000),
(159,1988,14760094,261911000000),
(159,1989,14848907,258337000000),
(159,1990,14951510,318331000000),
(159,1991,15069798,327500000000),
(159,1992,15184166,362963000000),
(159,1993,15290368,353550000000),
(159,1994,15382838,379130000000),
(159,1995,15459006,452302000000),
(159,1996,15530498,450490000000),
(159,1997,15610650,416813000000),
(159,1998,15707209,438008000000),
(159,1999,15812088,446899000000),
(159,2000,15925513,416443000000),
(159,2001,16046180,431213000000),
(159,2002,16148929,471614000000),
(159,2003,16225302,578792000000),
(159,2004,16281779,657172000000),
(159,2005,16319868,685093000000),
(159,2006,16346101,733341000000),
(159,2007,16381696,847482000000),
(159,2008,16445593,947998000000),
(159,2009,16530388,868077000000),
(159,2010,16615394,846555000000),
(159,2011,16693074,904086000000),
(159,2012,16754962,838971000000),
(159,2013,16804432,876924000000),
(159,2014,16865008,890981000000),
(159,2015,16939923,765265000000),
(159,2016,17030314,783528000000),
(159,2017,17131296,831810000000),
(159,2018,17231017,913658000000),
(160,1960,3581239,5163271598),
(160,1961,3609800,5632460937),
(160,1962,3638918,6066976683),
(160,1963,3666537,6510239503),
(160,1964,3694339,7159202706),
(160,1965,3723168,8058681060),
(160,1966,3753012,8696460205),
(160,1967,3784539,9514496703),
(160,1968,3816486,10159934137),
(160,1969,3847707,11063065083),
(160,1970,3875763,12814123115),
(160,1971,3903039,14583114840),
(160,1972,3933004,17358610850),
(160,1973,3960612,22534253703),
(160,1974,3985258,27145693810),
(160,1975,4007313,32877805200),
(160,1976,4026152,35942270686),
(160,1977,4043205,41508030431),
(160,1978,4058671,46523091010),
(160,1979,4072517,53132244624),
(160,1980,4085620,64439382896),
(160,1981,4099702,63596654761),
(160,1982,4114787,62647195538),
(160,1983,4128432,61627240831),
(160,1984,4140099,62057955033),
(160,1985,4152516,65416879914),
(160,1986,4167354,78693253276),
(160,1987,4186905,94230055659),
(160,1988,4209488,101900000000),
(160,1989,4226901,102634000000),
(160,1990,4241473,119792000000),
(160,1991,4261732,121872000000),
(160,1992,4286401,130838000000),
(160,1993,4311991,120579000000),
(160,1994,4336613,127131000000),
(160,1995,4359184,152027000000),
(160,1996,4381336,163518000000),
(160,1997,4405157,161354000000),
(160,1998,4431464,154165000000),
(160,1999,4461913,162286000000),
(160,2000,4490967,171316000000),
(160,2001,4513751,174003000000),
(160,2002,4538159,195418000000),
(160,2003,4564855,228752000000),
(160,2004,4591910,264357000000),
(160,2005,4623291,308722000000),
(160,2006,4660677,345425000000),
(160,2007,4709153,401083000000),
(160,2008,4768212,462554000000),
(160,2009,4828726,386622000000),
(160,2010,4889252,429131000000),
(160,2011,4953088,498832000000),
(160,2012,5018573,510229000000),
(160,2013,5079623,523502000000),
(160,2014,5137232,499339000000),
(160,2015,5188607,386663000000),
(160,2016,5234519,371345000000),
(160,2017,5276968,399489000000),
(160,2018,5314336,434751000000),
(161,1960,10105050,508334414),
(161,1961,10267264,531959561),
(161,1962,10433145,574091101),
(161,1963,10604621,496947904),
(161,1964,10783967,496098775),
(161,1965,10972912,735267082),
(161,1966,11172529,906811943),
(161,1967,11382967,841974025),
(161,1968,11603928,772228643),
(161,1969,11834654,788641965),
(161,1970,12074626,865975308),
(161,1971,12323982,882765471),
(161,1972,12583140,1024098805),
(161,1973,12852206,972101725),
(161,1974,13131260,1217953547),
(161,1975,13420369,1575789254),
(161,1976,13719471,1452792989),
(161,1977,14028536,1382400000),
(161,1978,14347641,1604162497),
(161,1979,14676929,1851250008),
(161,1980,15016402,1945916583),
(161,1981,15367230,2275583317),
(161,1982,15729431,2395429852),
(161,1983,16100617,2447174803),
(161,1984,16477473,2581207388),
(161,1985,16858310,2619913956),
(161,1986,17239673,2850784523),
(161,1987,17623693,2957255380),
(161,1988,18020753,3487009748),
(161,1989,18445028,3525228153),
(161,1990,18905478,3627562403),
(161,1991,19405504,3921476085),
(161,1992,19938320,3401211581),
(161,1993,20489975,3660041667),
(161,1994,21040904,4066775510),
(161,1995,21576071,4401104418),
(161,1996,22090352,4521580381),
(161,1997,22584775,4918691917),
(161,1998,23057883,4856255044),
(161,1999,23509964,5033642384),
(161,2000,23941110,5494252208),
(161,2001,24347106,6007055042),
(161,2002,24725627,6050875807),
(161,2003,25080872,6330473097),
(161,2004,25419344,7273938315),
(161,2005,25744500,8130258041),
(161,2006,26066693,9043715356),
(161,2007,26382581,10325618017),
(161,2008,26666576,12545438605),
(161,2009,26883535,12854985464),
(161,2010,27013212,16002656434),
(161,2011,27041437,18913574371),
(161,2012,26989862,18851513891),
(161,2013,26917906,19271168018),
(161,2014,26906926,20002968838),
(161,2015,27015031,21410840909),
(161,2016,27261131,21185922408),
(161,2017,27627124,24880266905),
(161,2018,28087871,28812491892),
(162,2007,9842,20439559),
(162,2008,9891,39292928),
(162,2009,9939,44294351),
(162,2010,10005,49234059),
(162,2011,10057,72682692),
(162,2012,10279,103837431),
(162,2013,10821,108631468),
(162,2014,11853,117013202),
(162,2015,12475,99964019),
(162,2016,13049,102055047),
(162,2017,12876,113880715),
(162,2018,12704,114718022),
(163,1960,2371800,5485854792),
(163,1961,2419700,5670064168),
(163,1962,2482000,6077496268),
(163,1963,2531800,6638937283),
(163,1964,2585400,7274144351),
(163,1965,2628400,5654463586),
(163,1966,2675900,5863733231),
(163,1967,2724100,5961418094),
(163,1968,2748100,5180597621),
(163,1969,2772800,5761588762),
(163,1970,2810700,6623527495),
(163,1971,2853000,7911136757),
(163,1972,2903900,9567331065),
(163,1973,2961300,12802281898),
(163,1974,3023700,13940981798),
(163,1975,3083100,12861983284),
(163,1976,3110500,13604832424),
(163,1977,3120200,15446825318),
(163,1978,3121200,18530518395),
(163,1979,3109000,20731243113),
(163,1980,3112900,23244547385),
(163,1981,3124900,24417617184),
(163,1982,3156100,24164603059),
(163,1983,3199300,24309279706),
(163,1984,3227100,21665975319),
(163,1985,3247100,24679795396),
(163,1986,3246300,30604668357),
(163,1987,3274400,40376354070),
(163,1988,3283400,45176811594),
(163,1989,3299200,43920222525),
(163,1990,3329800,45495129385),
(163,1991,3495100,42745329732),
(163,1992,3531700,41649829860),
(163,1993,3572200,46775620817),
(163,1994,3620000,55314732279),
(163,1995,3673400,63918703507),
(163,1996,3732000,70140835299),
(163,1997,3781300,66075143415),
(163,1998,3815000,56227169851),
(163,1999,3835100,58762260626),
(163,2000,3857700,52623281957),
(163,2001,3880500,53872425917),
(163,2002,3948500,66627729311),
(163,2003,4027200,88250885550),
(163,2004,4087500,103905000000),
(163,2005,4133900,114720000000),
(163,2006,4184600,111609000000),
(163,2007,4223800,137316000000),
(163,2008,4259800,133280000000),
(163,2009,4302600,121339000000),
(163,2010,4350700,146584000000),
(163,2011,4384000,168462000000),
(163,2012,4408100,176194000000),
(163,2013,4442100,190784000000),
(163,2014,4509700,200834000000),
(163,2015,4595700,177208000000),
(163,2016,4693200,187854000000),
(163,2017,4793900,202591000000),
(163,2018,4885500,205025000000),
(164,1965,625009,63287594),
(164,1966,642001,67768132),
(164,1967,660114,107152720),
(164,1968,679595,188864890),
(164,1969,700729,239980801),
(164,1970,723851,256299496),
(164,1971,748968,301010587),
(164,1972,776380,366857738),
(164,1973,806986,483033932),
(164,1974,841950,1645917776),
(164,1975,882047,2096699189),
(164,1976,927436,2560220035),
(164,1977,977804,2741169948),
(164,1978,1032799,2740301390),
(164,1979,1091852,3733352635),
(164,1980,1154377,5981760278),
(164,1981,1220585,7259120151),
(164,1982,1290111,7554719456),
(164,1983,1361087,7932541691),
(164,1984,1431070,8821366532),
(164,1985,1498418,10005500579),
(164,1986,1561185,7323822251),
(164,1987,1619863,7811183095),
(164,1988,1678110,8386215865),
(164,1989,1741156,9372171651),
(164,1990,1812161,11685045514),
(164,1991,1893768,11341482445),
(164,1992,1983275,12452275683),
(164,1993,2072104,12493107932),
(164,1994,2148419,12918855657),
(164,1995,2204277,13802600780),
(164,1996,2236654,15277763329),
(164,1997,2249762,15837451235),
(164,1998,2251864,14085373212),
(164,1999,2254904,15710148244),
(164,2000,2267973,19507412224),
(164,2001,2294962,19452015605),
(164,2002,2334858,20142782835),
(164,2003,2386166,21633810143),
(164,2004,2445517,24763589077),
(164,2005,2511251,31081924577),
(164,2006,2580758,37215864759),
(164,2007,2657158,42085305592),
(164,2008,2750963,60905331599),
(164,2009,2876186,48388296489),
(164,2010,3041434,58642392718),
(164,2011,3251108,67937581274),
(164,2012,3498029,76689206762),
(164,2013,3764805,78784395319),
(164,2014,4027260,81076723017),
(164,2015,4267348,68921456437),
(164,2016,4479219,65941482445),
(164,2017,4665935,70783875163),
(164,2018,4829483,79294928479),
(165,1960,44988690,3707055901),
(165,1961,46065231,4054599181),
(165,1962,47198878,4233095590),
(165,1963,48387301,4540529105),
(165,1964,49627623,5130407728),
(165,1965,50917975,5884712096),
(165,1966,52260189,6466610752),
(165,1967,53655789,7403821903),
(165,1968,55102684,8090088555),
(165,1969,56598144,8632927257),
(165,1970,58142060,10027088849),
(165,1971,59734481,10602058190),
(165,1972,61381987,9309109764),
(165,1973,63099406,6324884129),
(165,1974,64905998,8773030424),
(165,1975,66816877,11340000242),
(165,1976,68834326,13338484980),
(165,1977,70958169,15126059646),
(165,1978,73197258,17820100626),
(165,1979,75561131,19707979303),
(165,1980,78054343,23689696768),
(165,1981,80680459,28100605515),
(165,1982,83431605,30725972787),
(165,1983,86285935,28691890433),
(165,1984,89213706,31151824659),
(165,1985,92191510,31144920554),
(165,1986,95215378,31899071054),
(165,1987,98285755,33351528115),
(165,1988,101389603,38472741737),
(165,1989,104512881,40171019643),
(165,1990,107647921,40010424929),
(165,1991,110778648,45451960732),
(165,1992,113911126,48635176853),
(165,1993,117086685,51478304860),
(165,1994,120362762,51894781282),
(165,1995,123776839,60636022423),
(165,1996,127349290,63320122807),
(165,1997,131057431,62433300338),
(165,1998,134843233,62191955814),
(165,1999,138624621,62973855719),
(165,2000,142343578,73952374970),
(165,2001,145978402,72309738921),
(165,2002,149549700,72306820396),
(165,2003,153093373,83244801093),
(165,2004,156664697,97977766198),
(165,2005,160304008,109502000000),
(165,2006,164022627,137264000000),
(165,2007,167808105,152386000000),
(165,2008,171648986,170078000000),
(165,2009,175525609,168153000000),
(165,2010,179424641,177407000000),
(165,2011,183340592,213587000000),
(165,2012,187281475,224384000000),
(165,2013,191262919,231219000000),
(165,2014,195306825,244361000000),
(165,2015,199426964,270556000000),
(165,2016,203627284,278655000000),
(165,2017,207896686,304952000000),
(165,2018,212215030,312570000000),
(166,1960,1132997,537147100),
(166,1961,1167113,599026300),
(166,1962,1202449,652120900),
(166,1963,1238889,722784500),
(166,1964,1276331,776137500),
(166,1965,1314677,852485300),
(166,1966,1353842,928833000),
(166,1967,1393825,1034376400),
(166,1968,1434669,1112791100),
(166,1969,1476481,1221305700),
(166,1970,1519285,1351006400),
(166,1971,1563093,1523917200),
(166,1972,1607796,1673411700),
(166,1973,1653212,1913793400),
(166,1974,1699054,2188307600),
(166,1975,1745138,2435304100),
(166,1976,1791380,2588106000),
(166,1977,1837800,2738261900),
(166,1978,1884424,3244558600),
(166,1979,1931304,3704551600),
(166,1980,1978487,4614086400),
(166,1981,2025971,5222421500),
(166,1982,2073757,5769767900),
(166,1983,2121860,5923755900),
(166,1984,2170325,6183387100),
(166,1985,2219201,6541517100),
(166,1986,2268500,6797834200),
(166,1987,2318264,6827665300),
(166,1988,2368551,5902783400),
(166,1989,2419426,5918469800),
(166,1990,2470947,6433967000),
(166,1991,2523118,7074675500),
(166,1992,2575954,8042337700),
(166,1993,2629580,8782585400),
(166,1994,2684116,9365289800),
(166,1995,2739668,9573813700),
(166,1996,2796291,9870494000),
(166,1997,2853913,10677286100),
(166,1998,2912316,11575486400),
(166,1999,2971196,12130252200),
(166,2000,3030328,12304115000),
(166,2001,3089648,12502013400),
(166,2002,3149188,12994310400),
(166,2003,3209048,13693981200),
(166,2004,3269356,15013381700),
(166,2005,3330217,16374393900),
(166,2006,3391666,18141666300),
(166,2007,3453675,21295984200),
(166,2008,3516204,25155888600),
(166,2009,3579215,27116635600),
(166,2010,3642687,29440300000),
(166,2011,3706483,34686200000),
(166,2012,3770624,40429700000),
(166,2013,3835437,45600000000),
(166,2014,3901315,49921500000),
(166,2015,3968487,54091700000),
(166,2016,4037078,57957600000),
(166,2017,4106771,62283800000),
(166,2018,4176873,65055100000),
(168,1960,10155015,2571908062),
(168,1961,10446620,2899654840),
(168,1962,10749466,3286773188),
(168,1963,11062300,3600957771),
(168,1964,11383373,4356913870),
(168,1965,11711392,5166861068),
(168,1966,12045787,6113607728),
(168,1967,12386879,6204253759),
(168,1968,12735486,5736083835),
(168,1969,13092852,6420909790),
(168,1970,13459794,7432223177),
(168,1971,13836367,8289582884),
(168,1972,14221961,9189413409),
(168,1973,14615845,10994381895),
(168,1974,15017055,13858441211),
(168,1975,15424744,16877163792),
(168,1976,15838572,15947709380),
(168,1977,16258321,14620386674),
(168,1978,16683456,12495779622),
(168,1979,17113388,15962459447),
(168,1980,17547610,18134029180),
(168,1981,17985393,21649137620),
(168,1982,18426415,21793496819),
(168,1983,18870993,17345624454),
(168,1984,19319746,17599660054),
(168,1985,19772872,16548827018),
(168,1986,20230384,15244232958),
(168,1987,20691283,20702298397),
(168,1988,21153459,15439408447),
(168,1989,21614193,22499559086),
(168,1990,22071433,26410386669),
(168,1991,22522378,34672122381),
(168,1992,22966818,36139225288),
(168,1993,23408131,35158109999),
(168,1994,23851408,44882079767),
(168,1995,24299160,53312793687),
(168,1996,24753824,55252414130),
(168,1997,25210954,58147522523),
(168,1998,25658062,55501467877),
(168,1999,26078293,50187324568),
(168,2000,26459944,51744749133),
(168,2001,26799285,52030158775),
(168,2002,27100968,54777553515),
(168,2003,27372226,58731030122),
(168,2004,27624213,66768703498),
(168,2005,27866145,76060606061),
(168,2006,28102056,88643193062),
(168,2007,28333052,102171000000),
(168,2008,28562317,120551000000),
(168,2009,28792655,120823000000),
(168,2010,29027674,147529000000),
(168,2011,29264318,171762000000),
(168,2012,29506788,192649000000),
(168,2013,29773987,201175000000),
(168,2014,30090359,200984000000),
(168,2015,30470734,189759000000),
(168,2016,30926032,191907000000),
(168,2017,31444297,210702000000),
(168,2018,31989256,222238000000),
(169,1960,26269734,6684568805),
(169,1961,27161047,7256966966),
(169,1962,28077339,4399827768),
(169,1963,29012625,4875309866),
(169,1964,29958688,5271404668),
(169,1965,30909988,5784398977),
(169,1966,31864182,6371459304),
(169,1967,32823968,6809134236),
(169,1968,33795194,7591603053),
(169,1969,34786305,8408229699),
(169,1970,35803594,6687204834),
(169,1971,36849675,7408305736),
(169,1972,37923396,8017468688),
(169,1973,39022767,10082885603),
(169,1974,40144248,13781139970),
(169,1975,41285742,14893969288),
(169,1976,42446653,17097563270),
(169,1977,43629412,19648106122),
(169,1978,44838483,22706155475),
(169,1979,46079850,27502168727),
(169,1980,47357743,32450541843),
(169,1981,48672838,35646416953),
(169,1982,50023563,37140163934),
(169,1983,51408912,33212180658),
(169,1984,52827040,31408492877),
(169,1985,54275822,30734335449),
(169,1986,55755355,29868339081),
(169,1987,57263836,33195933430),
(169,1988,58795001,37885440419),
(169,1989,60340767,42575183906),
(169,1990,61895160,44311593756),
(169,1991,63454786,45417561302),
(169,1992,65020116,52976344929),
(169,1993,66593904,54368083953),
(169,1994,68180859,64084460124),
(169,1995,69784088,74119987245),
(169,1996,71401749,82848140618),
(169,1997,73030884,82344260571),
(169,1998,74672014,72207028768),
(169,1999,76325927,82995145793),
(169,2000,77991755,81026300310),
(169,2001,79672873,76262072467),
(169,2002,81365258,81357605642),
(169,2003,83051971,83908206648),
(169,2004,84710542,91371242495),
(169,2005,86326250,103072000000),
(169,2006,87888675,122211000000),
(169,2007,89405482,149360000000),
(169,2008,90901965,174195000000),
(169,2009,92414158,168335000000),
(169,2010,93966780,199591000000),
(169,2011,95570047,224143000000),
(169,2012,97212638,250092000000),
(169,2013,98871552,271836000000),
(169,2014,100513138,284585000000),
(169,2015,102113212,292774000000),
(169,2016,103663927,304898000000),
(169,2017,105173264,313620000000),
(169,2018,106651922,330910000000),
(170,2000,19105,144759500),
(170,2001,19386,155430000),
(170,2002,19637,161950700),
(170,2003,19809,152765800),
(170,2004,19867,164163200),
(170,2005,19781,184677300),
(170,2006,19540,188037700),
(170,2007,19158,193113700),
(170,2008,18704,196859300),
(170,2009,18285,182704300),
(170,2010,17955,182863000),
(170,2011,17745,193235600),
(170,2012,17640,214648500),
(170,2013,17606,225345700),
(170,2014,17626,245675100),
(170,2015,17665,293124000),
(170,2016,17725,303984500),
(170,2017,17808,289823500),
(170,2018,17907,310111145),
(171,1960,2255859,230496033),
(171,1961,2297059,244832035),
(171,1962,2340352,261184037),
(171,1963,2385946,275968039),
(171,1964,2434223,305312043),
(171,1965,2485437,344159480),
(171,1966,2539674,390973233),
(171,1967,2596820,441706910),
(171,1968,2656633,485160824),
(171,1969,2718811,551237316),
(171,1970,2783121,645537126),
(171,1971,2849532,717716130),
(171,1972,2918139,858802035),
(171,1973,2989202,1299105241),
(171,1974,3063049,1467346060),
(171,1975,3139945,1356591177),
(171,1976,3219829,1511856584),
(171,1977,3302633,1640763204),
(171,1978,3388618,1947947524),
(171,1979,3478100,2293621944),
(171,1980,3571205,2545983008),
(171,1981,3668104,2498068351),
(171,1982,3768483,2368584970),
(171,1983,3871492,2562492525),
(171,1984,3975956,2552526263),
(171,1985,4081030,2423373088),
(171,1986,4186499,2648033766),
(171,1987,4292563,3143848331),
(171,1988,4399324,3655979702),
(171,1989,4506991,3546460177),
(171,1990,4615839,3219730365),
(171,1991,4725547,3787394958),
(171,1992,4836217,4377980510),
(171,1993,4949051,4974550286),
(171,1994,5065661,5502786070),
(171,1995,5187060,4636057476),
(171,1996,5314248,5155311077),
(171,1997,5446641,4936615299),
(171,1998,5581762,3789443015),
(171,1999,5716161,3477038204),
(171,2000,5847586,3521339699),
(171,2001,5974629,3081024212),
(171,2002,6098621,2999511040),
(171,2003,6223377,3536411824),
(171,2004,6354245,3927157867),
(171,2005,6494903,4865892972),
(171,2006,6646895,8306343442),
(171,2007,6808514,9545071325),
(171,2008,6976201,11670678864),
(171,2009,7144776,11619541940),
(171,2010,7310507,14250726290),
(171,2011,7472200,17984816533),
(171,2012,7631002,21295834133),
(171,2013,7788379,21261305413),
(171,2014,7946731,23210611847),
(171,2015,8107775,21723378125),
(171,2016,8271760,20759048835),
(171,2017,8438029,22277692409),
(171,2018,8606316,23431596214),
(172,1990,38110782,65977749037),
(172,1991,38246193,85500935935),
(172,1992,38363667,94337050693),
(172,1993,38461408,96045645026),
(172,1994,38542652,110803000000),
(172,1995,38594998,142137000000),
(172,1996,38624370,159943000000),
(172,1997,38649660,159117000000),
(172,1998,38663481,174389000000),
(172,1999,38660271,169718000000),
(172,2000,38258629,171886000000),
(172,2001,38248076,190521000000),
(172,2002,38230364,198681000000),
(172,2003,38204570,217513000000),
(172,2004,38182222,255102000000),
(172,2005,38165445,306125000000),
(172,2006,38141267,344749000000),
(172,2007,38120560,429064000000),
(172,2008,38125759,533816000000),
(172,2009,38151603,439796000000),
(172,2010,38042794,479321000000),
(172,2011,38063255,528832000000),
(172,2012,38063164,500361000000),
(172,2013,38040196,524234000000),
(172,2014,38011735,545389000000),
(172,2015,37986412,477577000000),
(172,2016,37970087,472028000000),
(172,2017,37974826,526371000000),
(172,2018,37978548,585783000000),
(173,1960,2358000,1691900000),
(173,1961,2399722,1865100000),
(173,1962,2450322,2094400000),
(173,1963,2504530,2333600000),
(173,1964,2554066,2570500000),
(173,1965,2594000,2881500000),
(173,1966,2624995,3170500000),
(173,1967,2645674,3532700000),
(173,1968,2662064,3941700000),
(173,1969,2684150,4460700000),
(173,1970,2718000,5034700000),
(173,1971,2762190,5646800000),
(173,1972,2817256,6328900000),
(173,1973,2878786,7002400000),
(173,1974,2939299,7684800000),
(173,1975,2994000,8198300000),
(173,1976,3043854,8968600000),
(173,1977,3088690,9910900000),
(173,1978,3129421,11165000000),
(173,1979,3168088,12750000000),
(173,1980,3206000,14436100000),
(173,1981,3242552,15955700000),
(173,1982,3277453,16764200000),
(173,1983,3311138,17276600000),
(173,1984,3344190,19162600000),
(173,1985,3377000,20289200000),
(173,1986,3409554,22009300000),
(173,1987,3441850,24025800000),
(173,1988,3473898,26385800000),
(173,1989,3505650,28161200000),
(173,1990,3537000,30603919000),
(173,1991,3562110,32287031000),
(173,1992,3585176,34630430000),
(173,1993,3615497,36922456000),
(173,1994,3649237,39690630000),
(173,1995,3683103,42647331000),
(173,1996,3724655,45340835000),
(173,1997,3759430,48187039000),
(173,1998,3781101,54086400000),
(173,1999,3800081,57841000000),
(173,2000,3810605,61701800000),
(173,2001,3818774,69208400000),
(173,2002,3823701,71623500000),
(173,2003,3826095,74827400000),
(173,2004,3826878,80322313000),
(173,2005,3821362,83914521300),
(173,2006,3805214,87276164400),
(173,2007,3782995,89524131600),
(173,2008,3760866,93639300000),
(173,2009,3740410,96385600000),
(173,2010,3721525,98381300000),
(173,2011,3678732,100352000000),
(173,2012,3634488,101565000000),
(173,2013,3593077,102450000000),
(173,2014,3534874,102446000000),
(173,2015,3473166,103376000000),
(173,2016,3406495,104337000000),
(173,2017,3325001,104250000000),
(173,2018,3195153,101131000000),
(175,1960,8857716,3193200404),
(175,1961,8929316,3417516639),
(175,1962,8993985,3668222358),
(175,1963,9030355,3905734460),
(175,1964,9035365,4235608178),
(175,1965,8998595,4687464055),
(175,1966,8930990,5135387846),
(175,1967,8874520,5740241166),
(175,1968,8836650,6354262628),
(175,1969,8757705,6969025826),
(175,1970,8680431,8109032775),
(175,1971,8643756,9202512367),
(175,1972,8630430,11240223128),
(175,1973,8633100,15092052330),
(175,1974,8754365,17514112076),
(175,1975,9093470,19349512941),
(175,1976,9355810,20334835544),
(175,1977,9455675,21441635411),
(175,1978,9558250,23489924726),
(175,1979,9661265,26625439344),
(175,1980,9766312,32899759311),
(175,1981,9851362,31980423453),
(175,1982,9911771,30530759334),
(175,1983,9957865,27242331886),
(175,1984,9996232,25220451794),
(175,1985,10023613,27118476174),
(175,1986,10032734,38749715722),
(175,1987,10030031,48187667853),
(175,1988,10019610,56352797354),
(175,1989,10005000,60600056659),
(175,1990,9983218,78721607509),
(175,1991,9960235,89242382961),
(175,1992,9952494,107603000000),
(175,1993,9964675,95019103603),
(175,1994,9991525,99698453261),
(175,1995,10026176,118134000000),
(175,1996,10063945,122630000000),
(175,1997,10108977,117046000000),
(175,1998,10160196,123982000000),
(175,1999,10217828,127466000000),
(175,2000,10289898,118358000000),
(175,2001,10362722,121546000000),
(175,2002,10419631,134229000000),
(175,2003,10458821,164964000000),
(175,2004,10483861,189187000000),
(175,2005,10503330,197305000000),
(175,2006,10522288,208567000000),
(175,2007,10542964,240169000000),
(175,2008,10558177,262008000000),
(175,2009,10568247,243746000000),
(175,2010,10573100,238303000000),
(175,2011,10557560,244895000000),
(175,2012,10514844,216368000000),
(175,2013,10457295,226073000000),
(175,2014,10401062,229630000000),
(175,2015,10358076,199420000000),
(175,2016,10325452,206276000000),
(175,2017,10300300,219308000000),
(175,2018,10281762,237979000000),
(176,1965,2172306,443587301),
(176,1966,2230741,465888888),
(176,1967,2290798,492674603),
(176,1968,2351925,517650793),
(176,1969,2413396,556293650),
(176,1970,2474763,594611111),
(176,1971,2535873,664571428),
(176,1972,2597154,769039682),
(176,1973,2659421,995531746),
(176,1974,2723812,1333475397),
(176,1975,2791241,1511420635),
(176,1976,2861867,1698960317),
(176,1977,2935712,2092158730),
(176,1978,3013282,2559857143),
(176,1979,3095145,3416777778),
(176,1980,3181625,4448087302),
(176,1981,3272912,5624515873),
(176,1982,3368773,5419411765),
(176,1983,3468535,5673248726),
(176,1984,3571272,4502462807),
(176,1985,3676210,3282449236),
(176,1986,3783074,3723993943),
(176,1987,3891734,3971044724),
(176,1988,4001681,4255683528),
(176,1989,4112386,4757732200),
(176,1990,4223415,5812114523),
(176,1991,4334345,6984367763),
(176,1992,4445016,7157424031),
(176,1993,4555521,7249533620),
(176,1994,4666094,7870982005),
(176,1995,4776843,9062131475),
(176,1996,4887632,9788391781),
(176,1997,4998100,9965225678),
(176,1998,5107839,9260481572),
(176,1999,5216349,8837070236),
(176,2000,5323201,8855705140),
(176,2001,5428444,8495806432),
(176,2002,5531962,7196260657),
(176,2003,5632983,7691367471),
(176,2004,5730549,9624440836),
(176,2005,5824096,10737500188),
(176,2006,5913209,13429430050),
(176,2007,5998427,17856270473),
(176,2008,6081296,24578067861),
(176,2009,6163972,22341754514),
(176,2010,6248020,27215968616),
(176,2011,6333976,33715524704),
(176,2012,6421512,33283228891),
(176,2013,6510276,38585317743),
(176,2014,6599526,40276532541),
(176,2015,6688746,36164068797),
(176,2016,6777872,36054281572),
(176,2017,6867062,39008900332),
(176,2018,6956071,40842341774),
(177,1994,2366298,2843300000),
(177,1995,2474666,3282800000),
(177,1996,2587997,3409600000),
(177,1997,2706518,3759800000),
(177,1998,2776568,4067800000),
(177,1999,2848431,4271200000),
(177,2000,2922153,4313600000),
(177,2001,2997784,4003700000),
(177,2002,3075373,3555800000),
(177,2003,3154969,3968000000),
(177,2004,3236626,4329200000),
(177,2005,3320396,4831800000),
(177,2006,3406334,4910100000),
(177,2007,3494496,5505800000),
(177,2008,3591977,6673500000),
(177,2009,3689099,7268200000),
(177,2010,3786161,8913100000),
(177,2011,3882986,10465400000),
(177,2012,3979998,11279400000),
(177,2013,4076708,12476000000),
(177,2014,4173398,12715600000),
(177,2015,4270092,12673000000),
(177,2016,4367088,13425700000),
(177,2017,4454805,14498100000),
(177,2018,4569087,14615900000),
(178,1965,93438,176534589),
(178,1966,96716,215659455),
(178,1967,99995,220984369),
(178,1968,103342,259590076),
(178,1969,106820,242943776),
(178,1970,110495,254035999),
(178,1971,114382,296613496),
(178,1972,118440,325843254),
(178,1973,122643,431254103),
(178,1974,126924,555337985),
(178,1975,131233,690319754),
(178,1976,135549,732286143),
(178,1977,139891,793193187),
(178,1978,144277,1005573294),
(178,1979,148741,1215031775),
(178,1980,153301,1362151524),
(178,1981,157953,1279972866),
(178,1982,162685,1286462643),
(178,1983,167451,1335895286),
(178,1984,172249,1378991403),
(178,1985,177027,1507230779),
(178,1986,181817,2301514717),
(178,1987,186584,2543199148),
(178,1988,191266,2687472830),
(178,1989,195726,2636461517),
(178,1990,199905,3181206305),
(178,1991,203726,3267367610),
(178,1992,207245,3558215110),
(178,1993,210642,3694600400),
(178,1994,214197,3522272321),
(178,1995,218071,3982374846),
(178,1996,222322,3954696874),
(178,1997,226866,3567062512),
(178,1998,231570,3775160797),
(178,1999,236221,3797016069),
(178,2000,240686,3447543138),
(179,1970,109514,301791301),
(179,1971,119414,387700084),
(179,1972,130500,510259940),
(179,1973,142186,793884368),
(179,1974,153621,2401403227),
(179,1975,164320,2512784033),
(179,1976,173721,3284301332),
(179,1977,182318,3617580172),
(179,1978,191951,4052000413),
(179,1979,205171,5633000318),
(179,1980,223632,7829094613),
(179,1981,247988,8661263764),
(179,1982,277226,7596703214),
(179,1983,309306,6467582308),
(179,1984,341272,6704395824),
(179,1985,370890,6153296456),
(179,1986,397740,5053021951),
(179,1987,422148,5446428681),
(179,1988,443605,6038187033),
(179,1989,461690,6487912088),
(179,1990,476278,7360439423),
(179,1991,487353,6883516484),
(179,1992,495395,7646153984),
(179,1993,501479,7156593654),
(179,1994,507041,7374450769),
(179,1995,513442,8137911978),
(179,1996,522531,9059340385),
(179,1997,535321,11297802115),
(179,1998,551562,10255495027),
(179,1999,570489,12393131868),
(179,2000,592468,17759890110),
(179,2001,615012,17538461538),
(179,2002,640868,19363736264),
(179,2003,681788,23533791209),
(179,2004,753334,31734065934),
(179,2005,865416,44530494505),
(179,2006,1022711,60882142857),
(179,2007,1218434,79712087912),
(179,2008,1436665,115270000000),
(179,2009,1654950,97798351648),
(179,2010,1856327,125122000000),
(179,2011,2035871,167775000000),
(179,2012,2196074,186834000000),
(179,2013,2336574,198728000000),
(179,2014,2459198,206225000000),
(179,2015,2565710,161740000000),
(179,2016,2654374,151732000000),
(179,2017,2724724,166929000000),
(179,2018,2781677,192009000000),
(182,1988,146857000,554713000000),
(182,1989,147721000,506500000000),
(182,1990,148292000,516814000000),
(182,1991,148624000,517963000000),
(182,1992,148689000,460291000000),
(182,1993,148520000,435084000000),
(182,1994,148336000,395077000000),
(182,1995,148375726,395537000000),
(182,1996,148160042,391725000000),
(182,1997,147915307,404929000000),
(182,1998,147670692,270955000000),
(182,1999,147214392,195907000000),
(182,2000,146596557,259710000000),
(182,2001,145976083,306602000000),
(182,2002,145306046,345470000000),
(182,2003,144648257,430348000000),
(182,2004,144067054,591017000000),
(182,2005,143518523,764017000000),
(182,2006,143049528,989931000000),
(182,2007,142805088,1299710000000),
(182,2008,142742350,1660850000000),
(182,2009,142785342,1222640000000),
(182,2010,142849449,1524920000000),
(182,2011,142960868,2051660000000),
(182,2012,143201676,2210260000000),
(182,2013,143506911,2297130000000),
(182,2014,143819666,2059980000000),
(182,2015,144096870,1363590000000),
(182,2016,144342396,1282720000000),
(182,2017,144496740,1578620000000),
(182,2018,144478050,1657550000000),
(183,1960,2935582,119000024),
(183,1961,2998325,122000016),
(183,1962,3052936,125000008),
(183,1963,3105419,128000000),
(183,1964,3164263,129999994),
(183,1965,3235531,148799980),
(183,1966,3321679,124525702),
(183,1967,3420895,159560018),
(183,1968,3529843,172200018),
(183,1969,3643237,188700037),
(183,1970,3757358,219900006),
(183,1971,3871439,222952578),
(183,1972,3987224,246457838),
(183,1973,4106407,290746157),
(183,1974,4231578,308458423),
(183,1975,4364706,571863295),
(183,1976,4506109,637754162),
(183,1977,4655383,746650558),
(183,1978,4812872,905709147),
(183,1979,4978817,1109346221),
(183,1980,5153312,1254765350),
(183,1981,5329252,1407062608),
(183,1982,5504842,1407242640),
(183,1983,5690980,1479688126),
(183,1984,5902843,1587412957),
(183,1985,6146891,1715625839),
(183,1986,6443751,1944711061),
(183,1987,6779983,2157434025),
(183,1988,7088191,2395493878),
(183,1989,7276985,2405021933),
(183,1990,7288882,2550185618),
(183,1991,7083935,1911600970),
(183,1992,6702244,2029026704),
(183,1993,6263757,1971525999),
(183,1994,5936261,753636370),
(183,1995,5836495,1293535011),
(183,1996,6013107,1382334879),
(183,1997,6419901,1851558302),
(183,1998,6962802,1989343495),
(183,1999,7501234,1898608710),
(183,2000,7933681,1813938653),
(183,2001,8231156,1749262233),
(183,2002,8427060,1749314001),
(183,2003,8557161,1923071486),
(183,2004,8680524,2174623213),
(183,2005,8840215,2685133231),
(183,2006,9043337,3116128156),
(183,2007,9273757,3811474436),
(183,2008,9524534,4867560259),
(183,2009,9782770,5373088997),
(183,2010,10039338,5783152633),
(183,2011,10293331,6563320570),
(183,2012,10549678,7334917697),
(183,2013,10811543,7621923308),
(183,2014,11083635,8016591928),
(183,2015,11369071,8277613194),
(183,2016,11668818,8475681533),
(183,2017,11980937,9135454442),
(183,2018,12301939,9509003197),
(184,1968,5387828,4187777711),
(184,1969,5599904,4485777644),
(184,1970,5836389,5377333333),
(184,1971,6100626,7184853348),
(184,1972,6392970,9664157499),
(184,1973,6711923,14947391140),
(184,1974,7054532,45412957746),
(184,1975,7419493,46773368206),
(184,1976,7802926,64005665722),
(184,1977,8207697,74188249979),
(184,1978,8646845,80265619485),
(184,1979,9137927,111860000000),
(184,1980,9691476,164542000000),
(184,1981,10311775,184292000000),
(184,1982,10988853,153239000000),
(184,1983,11701128,129172000000),
(184,1984,12418834,119625000000),
(184,1985,13118993,103898000000),
(184,1986,13794165,86961922765),
(184,1987,14445671,85695861148),
(184,1988,15070082,88256074766),
(184,1989,15666297,95344459279),
(184,1990,16233785,117630000000),
(184,1991,16772694,132223000000),
(184,1992,17282691,137088000000),
(184,1993,17763298,132968000000),
(184,1994,18214470,135175000000),
(184,1995,18638787,143343000000),
(184,1996,19033845,158662000000),
(184,1997,19407142,165964000000),
(184,1998,19783304,146775000000),
(184,1999,20194527,161717000000),
(184,2000,20663843,189515000000),
(184,2001,21202642,184137000000),
(184,2002,21805313,189606000000),
(184,2003,22456649,215808000000),
(184,2004,23132682,258742000000),
(184,2005,23816183,328460000000),
(184,2006,24498310,376900000000),
(184,2007,25184597,415965000000),
(184,2008,25888541,519797000000),
(184,2009,26630303,429098000000),
(184,2010,27421461,528207000000),
(184,2011,28267685,671239000000),
(184,2012,29155187,735975000000),
(184,2013,30052518,746647000000),
(184,2014,30916994,756350000000),
(184,2015,31717667,654270000000),
(184,2016,32442572,644936000000),
(184,2017,33099147,688586000000),
(184,2018,33699947,782483000000),
(185,1960,7544491,1307333333),
(185,1961,7769482,1419333333),
(185,1962,8004121,1541666667),
(185,1963,8248812,1568333333),
(185,1964,8503994,1611333333),
(185,1965,8770097,1679333333),
(185,1966,9047798,1723000000),
(185,1967,9337657,1865666667),
(185,1968,9639840,1947333333),
(185,1969,9954410,2144333333),
(185,1970,10281700,2437666667),
(185,1971,10621472,2656000000),
(185,1972,10974622,2882000000),
(185,1973,11343926,3571666667),
(185,1974,11732958,4595000000),
(185,1975,12144135,5598000000),
(185,1976,12578407,6979333333),
(185,1977,13034625,8704000000),
(185,1978,13510421,7670500000),
(185,1979,14002303,9032250000),
(185,1980,14507468,7459833333),
(185,1981,15027248,10016500000),
(185,1982,15562125,9240000000),
(185,1983,16107620,8230153846),
(185,1984,16657959,9701357143),
(185,1985,17210187,12403733333),
(185,1986,17757491,15769062500),
(185,1987,18303435,20155555556),
(185,1988,18867560,15399166667),
(185,1989,19476647,15291507937),
(185,1990,20147590,12408647541),
(185,1991,20891441,11379222222),
(185,1992,21696244,7034219713),
(185,1993,22527834,8881785938),
(185,1994,23338464,12794192334),
(185,1995,24094747,13829744879),
(185,1996,24782383,9018243044),
(185,1997,25413917,11681494637),
(185,1998,26015521,11250327988),
(185,1999,26626520,10682045258),
(185,2000,27275015,12257418326),
(185,2001,27971082,13182979784),
(185,2002,28704778,14803189093),
(185,2003,29460519,17646503525),
(185,2004,30214193,21457470203),
(185,2005,30949516,26524538566),
(185,2006,31661823,35822408612),
(185,2007,32360621,45898948564),
(185,2008,33060837,54526580232),
(185,2009,33783788,53150209168),
(185,2010,34545013,65634109237),
(185,2011,35349681,67327289320),
(185,2012,36193783,68125631150),
(185,2013,37072550,72065940086),
(185,2014,37977655,82151588419),
(185,2015,38902950,96741742022),
(185,2016,39847440,95558220777),
(185,2017,40813396,123053000000),
(185,2018,41801533,40851536134),
(186,1960,3206749,1003692375),
(186,1961,3295278,1058975266),
(186,1962,3386806,1085475573),
(186,1963,3481654,1122139637),
(186,1964,3580239,1188930568),
(186,1965,3682876,1210058396),
(186,1966,3789383,1246908374),
(186,1967,3899644,1246480959),
(186,1968,4014103,1309384830),
(186,1969,4133322,1245234807),
(186,1970,4257505,1297407829),
(186,1971,4387540,1339548824),
(186,1972,4522893,1620857277),
(186,1973,4660725,1863398448),
(186,1974,4797187,2099324950),
(186,1975,4929846,2830388405),
(186,1976,5057378,2869777812),
(186,1977,5181514,2938046307),
(186,1978,5306681,3280354339),
(186,1979,5439066,4084878668),
(186,1980,5583165,4435050397),
(186,1981,5740444,4021697233),
(186,1982,5909739,3936758682),
(186,1983,6089572,3512053232),
(186,1984,6277424,3425127373),
(186,1985,6471327,3750056424),
(186,1986,6670663,5304238013),
(186,1987,6875754,6381385760),
(186,1988,7086627,6311054901),
(186,1989,7303517,6219793533),
(186,1990,7526307,7237100724),
(186,1991,7755496,7111252866),
(186,1992,7990096,7602005274),
(186,1993,8226760,7189226453),
(186,1994,8461068,4908415369),
(186,1995,8690164,6176312552),
(186,1996,8912861,6413189839),
(186,1997,9130877,5915250258),
(186,1998,9347774,6368265194),
(186,1999,9568722,6512207622),
(186,2000,9797734,5924239701),
(186,2001,10036104,6174898370),
(186,2002,10283699,6752510283),
(186,2003,10541467,8683229268),
(186,2004,10810083,10167441854),
(186,2005,11090116,11022821632),
(186,2006,11382268,11847848225),
(186,2007,11687080,14285970085),
(186,2008,12004701,16949789465),
(186,2009,12335084,16248212852),
(186,2010,12678148,16215069256),
(186,2011,13033809,17878780185),
(186,2012,13401991,17825417949),
(186,2013,13782420,18960182371),
(186,2014,14174731,19770840286),
(186,2015,14578459,17767704597),
(186,2016,14993528,19027392876),
(186,2017,15419381,21081669870),
(186,2018,15854360,24129599552),
(187,1960,1646400,704756304),
(187,1961,1702400,764634783),
(187,1962,1750200,826244610),
(187,1963,1795000,917614007),
(187,1964,1841600,894159153),
(187,1965,1886900,974650463),
(187,1966,1934400,1096432771),
(187,1967,1977600,1238043904),
(187,1968,2012000,1425715406),
(187,1969,2042500,1659904613),
(187,1970,2074507,1920586698),
(187,1971,2112900,2263785444),
(187,1972,2152400,2721440981),
(187,1973,2193000,3696213333),
(187,1974,2229800,5221534956),
(187,1975,2262600,5633673930),
(187,1976,2293300,6327077974),
(187,1977,2325300,6618585074),
(187,1978,2353600,7517176355),
(187,1979,2383500,9296921724),
(187,1980,2413945,11896256783),
(187,1981,2532835,14175228844),
(187,1982,2646466,16084252378),
(187,1983,2681061,17784112150),
(187,1984,2732221,19749361098),
(187,1985,2735957,19156532746),
(187,1986,2733373,18586746057),
(187,1987,2774789,20919215578),
(187,1988,2846108,25371462488),
(187,1989,2930901,30465364739),
(187,1990,3047132,36144336769),
(187,1991,3135083,45466164978),
(187,1992,3230698,52130263966),
(187,1993,3313471,60603478153),
(187,1994,3419048,73690847191),
(187,1995,3524506,87810991957),
(187,1996,3670704,96295886525),
(187,1997,3796038,100124000000),
(187,1998,3927213,85728310229),
(187,1999,3958723,86284660767),
(187,2000,4027887,96074477958),
(187,2001,4138012,89794943350),
(187,2002,4175950,92537752709),
(187,2003,4114826,97645448284),
(187,2004,4166664,115035000000),
(187,2005,4265762,127808000000),
(187,2006,4401365,148630000000),
(187,2007,4588599,180942000000),
(187,2008,4839396,193612000000),
(187,2009,4987573,194152000000),
(187,2010,5076732,239809000000),
(187,2011,5183688,279351000000),
(187,2012,5312437,295087000000),
(187,2013,5399162,307576000000),
(187,2014,5469724,314851000000),
(187,2015,5535002,308004000000),
(187,2016,5607283,318068000000),
(187,2017,5612253,338406000000),
(187,2018,5638676,364157000000),
(191,1967,145317,25203524),
(191,1968,149881,28084252),
(191,1969,154830,28606411),
(191,1971,166162,50056882),
(191,1972,172552,40606712),
(191,1973,179305,55272108),
(191,1974,186295,84539332),
(191,1975,193402,74617096),
(191,1976,200599,83099107),
(191,1977,207890,93147039),
(191,1978,215295,111022090),
(191,1979,222840,151270207),
(191,1980,230546,168715353),
(191,1981,238429,187313261),
(191,1982,246447,188446092),
(191,1983,254559,180219397),
(191,1984,262687,252806783),
(191,1985,270788,232306861),
(191,1986,278837,210737869),
(191,1987,286870,238606299),
(191,1988,294972,310684273),
(191,1989,303272,332286760),
(191,1990,311866,302515026),
(191,1991,320780,320355090),
(191,1992,329995,378778047),
(191,1993,339504,410923236),
(191,1994,349281,464756638),
(191,1995,359281,519334096),
(191,1996,369523,565163750),
(191,1997,379999,567919502),
(191,1998,390693,471177008),
(191,1999,401586,482214092),
(191,2000,412660,435103853),
(191,2001,423944,400463452),
(191,2002,435432,341661643),
(191,2003,447017,332738245),
(191,2004,458539,375111894),
(191,2005,469918,413909879),
(191,2006,481078,456705434),
(191,2007,492132,516074229),
(191,2008,503360,608229326),
(191,2009,515181,597765363),
(191,2010,527861,681151190),
(191,2011,541521,932725578),
(191,2012,556064,1063879451),
(191,2013,571335,1129787202),
(191,2014,587079,1172268296),
(191,2015,603118,1154650066),
(191,2016,619437,1232699140),
(191,2017,636038,1321131091),
(191,2018,652858,1411904531),
(192,1960,2317636,322009471),
(192,1961,2352363,327834680),
(192,1962,2388769,342721579),
(192,1963,2426857,348546952),
(192,1964,2466667,371848114),
(192,1965,2508219,359379856),
(192,1966,2551578,375479849),
(192,1967,2596805,348795303),
(192,1968,2644020,329860091),
(192,1969,2693348,408690163),
(192,1970,2744891,434410373),
(192,1971,2798724,419549425),
(192,1972,2854872,465381090),
(192,1973,2913344,575230234),
(192,1974,2974104,648590642),
(192,1975,3037154,679335901),
(192,1976,3102592,594895672),
(192,1977,3170508,691777758),
(192,1978,3240839,960728338),
(192,1979,3313504,1109374722),
(192,1980,3388495,1100685845),
(192,1981,3464106,1114830472),
(192,1982,3540170,1295361886),
(192,1983,3619847,995104305),
(192,1984,3707510,1087471862),
(192,1985,3805311,856890498),
(192,1986,3916685,490181456),
(192,1987,4038144,701307602),
(192,1988,4156634,1055083945),
(192,1989,4254444,932974411),
(192,1990,4319762,649644826),
(192,1991,4348660,779981458),
(192,1992,4347724,679997997),
(192,1993,4328957,768812334),
(192,1994,4309775,911915970),
(192,1995,4303957,870758739),
(192,1996,4312666,941742152),
(192,1997,4335301,850218033),
(192,1998,4381483,672375927),
(192,1999,4462378,669384768),
(192,2000,4584571,635874002),
(192,2001,4754072,1090467712),
(192,2002,4965766,1253340520),
(192,2003,5201070,1385810072),
(192,2004,5433991,1448536631),
(192,2005,5645624,1650494367),
(192,2006,5829237,1885112202),
(192,2007,5989633,2158496873),
(192,2008,6133603,2505458705),
(192,2009,6272734,2453899847),
(192,2010,6415634,2578026297),
(192,2011,6563240,2942546781),
(192,2012,6712581,3801862611),
(192,2013,6863980,4920343195),
(192,2014,7017144,5015157816),
(192,2015,7171914,4218723875),
(192,2016,7328838,3674794530),
(192,2017,7488431,3739577973),
(192,2018,7650154,3999945202),
(193,1965,3201313,877720000),
(193,1966,3293952,929520000),
(193,1967,3387383,976200000),
(193,1968,3481624,1009760100),
(193,1969,3576838,1049400000),
(193,1970,3673068,1132920000),
(193,1971,3770059,1186120000),
(193,1972,3867309,1263720000),
(193,1973,3964270,1442320000),
(193,1974,4060260,1665880000),
(193,1975,4154692,1884120100),
(193,1976,4247502,2328280100),
(193,1977,4338458,2941640100),
(193,1978,4426675,3127960000),
(193,1979,4511129,3463639900),
(193,1980,4591134,3573959900),
(193,1981,4666364,3437200200),
(193,1982,4737257,3399189100),
(193,1983,4804935,3506347800),
(193,1984,4871035,3661683400),
(193,1985,4936807,3800368600),
(193,1986,5002336,3771663200),
(193,1987,5067537,3958045800),
(193,1988,5133274,4189880000),
(193,1989,5200602,4372215300),
(193,1990,5270079,4817542204),
(193,1991,5342198,5252342400),
(193,1992,5416323,5813399300),
(193,1993,5490477,6680269200),
(193,1994,5561919,7679384000),
(193,1995,5628600,8921947100),
(193,1996,5689938,9586327800),
(193,1997,5746284,10221705900),
(193,1998,5797765,10936669900),
(193,1999,5844846,11284197000),
(193,2000,5887936,11784927700),
(193,2001,5927006,12282533600),
(193,2002,5962136,12664190300),
(193,2003,5994077,13243892200),
(193,2004,6023797,13724810900),
(193,2005,6052123,14698001400),
(193,2006,6079399,15999886400),
(193,2007,6105810,17011750900),
(193,2008,6131764,17986886200),
(193,2009,6157686,17601616000),
(193,2010,6183875,18447920000),
(193,2011,6210568,20283780000),
(193,2012,6237923,21386160000),
(193,2013,6266070,21990970000),
(193,2014,6295128,22593470000),
(193,2015,6325124,23438240000),
(193,2016,6356143,24154120000),
(193,2017,6388122,24927970000),
(193,2018,6420744,26056950000),
(194,1999,27145,1215640315),
(194,2000,27462,1101897918),
(194,2001,27812,1160626398),
(194,2002,28175,1253529080),
(194,2003,28562,1600451467),
(194,2004,28940,1877328036),
(194,2005,29324,1958711603),
(194,2006,29700,2092585623),
(194,2007,30063,2488365727),
(194,2008,30434,2752307016),
(194,2009,30816,2363156432),
(194,2010,31229,2139072848),
(194,2011,31661,2054489853),
(194,2012,32105,1800077091),
(194,2013,32553,1865374403),
(194,2014,32948,1788510017),
(194,2015,33272,1523012088),
(194,2016,33504,1564380531),
(194,2017,33671,1632860041),
(195,1960,2755972,180459936),
(195,1961,2814118,191659914),
(195,1962,2874218,203531927),
(195,1963,2936477,216145935),
(195,1964,3001158,229529912),
(195,1965,3068459,243724533),
(195,1966,3143648,257374455),
(195,1967,3227841,271780364),
(195,1968,3312742,286718279),
(195,1969,3386738,306357284),
(195,1970,3444568,322600009),
(195,1971,3472367,331102742),
(195,1972,3479790,416942436),
(195,1973,3512623,507028428),
(195,1974,3632990,467577432),
(195,1975,3880292,710850226),
(195,1976,4278973,807275808),
(195,1977,4802141,498550873),
(195,1978,5375017,564986059),
(195,1979,5892755,590419855),
(195,1980,6281134,603592656),
(195,1981,6511113,699112266),
(195,1982,6608044,774419569),
(195,1983,6618588,733901365),
(195,1984,6614715,788307213),
(195,1985,6648627,876404617),
(195,1986,6736748,930318705),
(195,1987,6862273,1009792724),
(195,1988,7005234,1038291284),
(195,1989,7133258,1092392963),
(195,1990,7225092,917044228),
(195,2013,13063706,3368199008),
(195,2014,13423576,3340389106),
(195,2015,13797201,4049001422),
(195,2016,14185613,4198000287),
(195,2017,14589119,4509001513),
(195,2018,15008154,4721000393),
(197,2001,144755,75951127),
(197,2002,147447,85171074),
(197,2003,150415,102085766),
(197,2004,153737,114582285),
(197,2005,157472,136450661),
(197,2006,161681,142775106),
(197,2007,166300,149146923),
(197,2008,171120,188021168),
(197,2009,175876,187821029),
(197,2010,180371,197454052),
(197,2011,184524,233213521),
(197,2012,188404,252560556),
(197,2013,192087,302925488),
(197,2014,195727,348941656),
(197,2015,199432,318265835),
(197,2016,203227,347545391),
(197,2017,207089,375040173),
(197,2018,211028,422296762),
(198,1960,287871,99650000),
(198,1961,295916,107700000),
(198,1962,303895,116150000),
(198,1963,311947,125950000),
(198,1964,320270,134400000),
(198,1965,328936,154150000),
(198,1966,338158,190350000),
(198,1967,347660,220700000),
(198,1968,356550,241350000),
(198,1969,363575,259650000),
(198,1970,367931,274900000),
(198,1971,369236,301000000),
(198,1972,367907,311950000),
(198,1973,364915,339450000),
(198,1974,361667,409850000),
(198,1975,359226,465500000),
(198,1976,357953,505500000),
(198,1977,357659,641500000),
(198,1978,358099,735500000),
(198,1979,358818,782500000),
(198,1980,359519,795000000),
(198,1981,360143,889000000),
(198,1982,360920,915000000),
(198,1983,362276,883500000),
(198,1984,364733,864000000),
(198,1985,368638,873000000),
(198,1986,374140,891000000),
(198,1987,381037,980000000),
(198,1988,388881,1161000000),
(198,1989,397085,542600000),
(198,1990,405168,388400000),
(198,1991,413005,448100000),
(198,1992,420655,404600000),
(198,1993,428030,428764705),
(198,1994,435105,605492537),
(198,1995,441851,691590497),
(198,1996,448213,861411471),
(198,1997,454161,926422500),
(198,1998,459831,1110850000),
(198,1999,465385,886290697),
(198,2000,470949,947671969),
(198,2001,476579,834279357),
(198,2002,482235,1093574468),
(198,2003,487942,1274190311),
(198,2004,493679,1484092538),
(198,2005,499464,1793388732),
(198,2006,505295,2626493057),
(198,2007,511181,2936440801),
(198,2008,517123,3532961749),
(198,2009,523111,3875555556),
(198,2010,529131,4368398048),
(198,2011,535179,4422276622),
(198,2012,541245,4980000000),
(198,2013,547291,5145757576),
(198,2014,553273,5240606061),
(198,2015,559143,4787367928),
(198,2016,564888,3167164371),
(198,2017,570496,3068766110),
(198,2018,575991,3427269682),
(199,1990,5299187,12694544693),
(199,1991,5303294,14213045494),
(199,1992,5305016,15431288006),
(199,1993,5325305,16452201101),
(199,1994,5346331,20079363626),
(199,1995,5361999,25733043137),
(199,1996,5373361,27821913815),
(199,1997,5383291,27660149541),
(199,1998,5390516,29828899206),
(199,1999,5396020,30415095887),
(199,2000,5388720,29114875622),
(199,2001,5378867,30703017450),
(199,2002,5376912,35083608131),
(199,2003,5373374,46731767494),
(199,2004,5372280,57240535138),
(199,2005,5372807,62697540107),
(199,2006,5373054,70596729394),
(199,2007,5374622,86304245825),
(199,2008,5379233,100325000000),
(199,2009,5386406,88945625174),
(199,2010,5391428,89501012916),
(199,2011,5398384,98181259740),
(199,2012,5407579,93413992956),
(199,2013,5413393,98478349315),
(199,2014,5418649,100948000000),
(199,2015,5423801,87769595120),
(199,2016,5430798,89848359305),
(199,2017,5439232,95617670260),
(199,2018,5447011,106472000000),
(200,1990,1998161,18130730932),
(200,1991,1999429,13214510435),
(200,1992,1996498,13052481427),
(200,1993,1991746,13209759788),
(200,1994,1989443,14993821209),
(200,1995,1989872,21273055398),
(200,1996,1988628,21480023017),
(200,1997,1985956,20749140606),
(200,1998,1981629,22125435372),
(200,1999,1983045,22689994990),
(200,2000,1988925,20342201356),
(200,2001,1992060,20875387068),
(200,2002,1994530,23563576758),
(200,2003,1995733,29697448108),
(200,2004,1997012,34470227454),
(200,2005,2000474,36346974008),
(200,2006,2006868,39587732029),
(200,2007,2018122,48114688201),
(200,2008,2021316,55589849128),
(200,2009,2039669,50244793832),
(200,2010,2048583,48013606745),
(200,2011,2052843,51290792018),
(200,2012,2057159,46352802766),
(200,2013,2059953,48116256926),
(200,2014,2061980,49889553216),
(200,2015,2063531,43102044291),
(200,2016,2065042,44641210338),
(200,2017,2066388,48455919386),
(200,2018,2067372,54235484383),
(201,1960,7484656,14842870293),
(201,1961,7519998,16147160123),
(201,1962,7561588,17511477311),
(201,1963,7604328,18954132366),
(201,1964,7661354,21137242561),
(201,1965,7733853,23260320646),
(201,1966,7807797,25302033132),
(201,1967,7867931,27463409202),
(201,1968,7912273,29143383491),
(201,1969,7968072,31649203886),
(201,1970,8042801,37597376846),
(201,1971,8098334,41026187811),
(201,1972,8122300,48317904775),
(201,1973,8136312,58632899709),
(201,1974,8159955,65155385097),
(201,1975,8192437,81808163118),
(201,1976,8222286,88200661976),
(201,1977,8251540,93240961375),
(201,1978,8275599,103085000000),
(201,1979,8293678,121783000000),
(201,1980,8310531,140245000000),
(201,1981,8320503,128001000000),
(201,1982,8325263,112894000000),
(201,1983,8329033,103650000000),
(201,1984,8336605,107782000000),
(201,1985,8350386,112640000000),
(201,1986,8369829,148542000000),
(201,1987,8397804,180631000000),
(201,1988,8436489,204297000000),
(201,1989,8492964,215116000000),
(201,1990,8558835,258443000000),
(201,1991,8617375,270665000000),
(201,1992,8668067,280626000000),
(201,1993,8718561,210186000000),
(201,1994,8780745,226334000000),
(201,1995,8826939,264344000000),
(201,1996,8840998,288455000000),
(201,1997,8846062,264834000000),
(201,1998,8850974,267224000000),
(201,1999,8857874,271177000000),
(201,2000,8872109,260159000000),
(201,2001,8895960,240284000000),
(201,2002,8924958,264346000000),
(201,2003,8958229,331531000000),
(201,2004,8993531,382153000000),
(201,2005,9029572,389488000000),
(201,2006,9080505,420541000000),
(201,2007,9148092,488398000000),
(201,2008,9219637,514585000000),
(201,2009,9298515,430114000000),
(201,2010,9378126,488909000000),
(201,2011,9449213,563797000000),
(201,2012,9519374,544482000000),
(201,2013,9600379,579361000000),
(201,2014,9696110,574413000000),
(201,2015,9799186,498118000000),
(201,2016,9923085,512205000000),
(201,2017,10057698,535607000000),
(201,2018,10183175,551032000000),
(202,1960,336583,35076158),
(202,1961,343345,43025199),
(202,1962,350156,45927061),
(202,1963,357292,54128377),
(202,1964,365122,64979280),
(202,1965,373919,70278594),
(202,1966,383826,76858462),
(202,1967,394757,74758504),
(202,1968,406506,79798404),
(202,1969,418747,105417891),
(202,1970,431253,112137757),
(202,1971,443977,136465324),
(202,1972,457039,146741251),
(202,1973,470559,221902017),
(202,1974,484749,264311994),
(202,1975,499763,288302907),
(202,1976,515599,272539098),
(202,1977,532260,304047838),
(202,1978,549796,340616375),
(202,1979,568315,412093133),
(202,1980,587858,542000513),
(202,1981,608380,571542674),
(202,1982,629811,537575980),
(202,1983,652115,555336145),
(202,1984,675239,494475699),
(202,1985,699080,361014890),
(202,1986,723595,449146608),
(202,1987,748632,584135559),
(202,1988,773768,692016714),
(202,1989,798507,696915430),
(202,1990,822420,1114703088),
(202,1991,845266,1156141998),
(202,1992,866993,1284766234),
(202,1993,887706,1357206996),
(202,1994,907620,1419293455),
(202,1995,926841,1698982438),
(202,1996,945508,1602760100),
(202,1997,963426,1716699913),
(202,1998,979918,1576904292),
(202,1999,994108,1547884442),
(202,2000,1005435,1738100853),
(202,2001,1013609,1542477309),
(202,2002,1019059,1432228125),
(202,2003,1022802,2197612701),
(202,2004,1026286,2770082792),
(202,2005,1030579,3178126492),
(202,2006,1036092,3291353836),
(202,2007,1042652,3469363996),
(202,2008,1049945,3294093485),
(202,2009,1057467,3580417067),
(202,2010,1064837,4438778424),
(202,2011,1072032,4820499924),
(202,2012,1079288,4823831657),
(202,2013,1086839,4560713074),
(202,2014,1095021,4377293816),
(202,2015,1104044,4020275298),
(202,2016,1113984,3817430000),
(202,2017,1124753,4433664364),
(202,2018,1136191,4703787507),
(203,1960,41700,12012025),
(203,1961,42889,11592024),
(203,1962,44042,12642026),
(203,1963,45176,13923029),
(203,1964,46322,15393032),
(203,1965,47500,15603032),
(203,1966,48699,16443034),
(203,1967,49911,16632032),
(203,1968,51134,16074027),
(203,1969,52365,16452027),
(203,1970,53600,18432031),
(203,1971,54695,21965951),
(203,1972,56029,30645121),
(203,1973,56892,36896278),
(203,1974,57937,43134498),
(203,1975,59292,47803145),
(203,1976,60504,49278979),
(203,1977,61786,64526398),
(203,1978,62150,85552369),
(203,1979,62686,127261099),
(203,1980,63261,147357222),
(203,1981,64035,154902869),
(203,1982,64413,147912069),
(203,1983,64335,146712850),
(203,1984,64717,151313242),
(203,1985,65244,168887539),
(203,1986,65652,207850623),
(203,1987,68499,249267039),
(203,1988,68755,283828769),
(203,1989,69167,304832867),
(203,1990,69507,368584758),
(203,1991,70439,374359556),
(203,1992,70763,433667193),
(203,1993,72253,473916819),
(203,1994,74205,486451204),
(203,1995,75304,508221508),
(203,1996,76417,503068472),
(203,1997,77319,562958836),
(203,1998,78846,608369282),
(203,1999,80410,622985493),
(203,2000,81131,614879764),
(203,2001,81202,622262057),
(203,2002,83723,697518248),
(203,2003,82781,705704816),
(203,2004,82475,839319927),
(203,2005,82858,919103254),
(203,2006,84600,1016418229),
(203,2007,85033,1033561654),
(203,2008,86956,967199594),
(203,2009,87298,847397850),
(203,2010,89770,969936525),
(203,2011,87441,1065826670),
(203,2012,88303,1060226126),
(203,2013,89949,1328157609),
(203,2014,91359,1343007845),
(203,2015,93419,1377495054),
(203,2016,94677,1427524565),
(203,2017,95843,1503168690),
(203,2018,96762,1590180446),
(204,1960,4573512,857704431),
(204,1961,4721896,945244992),
(204,1962,4875422,1110565864),
(204,1963,5034646,1200447429),
(204,1964,5200336,1339494290),
(204,1965,5373137,1472036551),
(204,1966,5553246,1342287557),
(204,1967,5740710,1580229795),
(204,1968,5935860,1753746370),
(204,1969,6139048,2245011572),
(204,1970,6350541,2140383696),
(204,1971,6570857,2589851693),
(204,1972,6800141,3059682162),
(204,1973,7037851,3239488105),
(204,1974,7283177,5159557176),
(204,1975,7535714,6826980767),
(204,1976,7794662,7633528921),
(204,1977,8060649,7696011360),
(204,1978,8336418,9275203106),
(204,1979,8625690,9929682184),
(204,1980,8930774,13062421025),
(204,1981,9252851,15518199247),
(204,1982,9590227,16298905397),
(204,1983,9938847,17589184557),
(204,1984,10293049,17503082982),
(204,1985,10648632,16403544511),
(204,1986,11004272,13293209270),
(204,1987,11360852,11356215713),
(204,1988,11719071,10577042355),
(204,1989,12080444,9853396226),
(204,1990,12446171,12308624284),
(204,1991,12815401,12981833333),
(204,1992,13187663,13253565899),
(204,1993,13565072,13695962019),
(204,1994,13950476,10122020000),
(204,1995,14345492,11396706587),
(204,1996,14754142,13789560878),
(204,1997,15175316,14505233969),
(204,1998,15599591,15200846138),
(204,1999,16013985,15873875969),
(204,2000,16410848,19325894913),
(204,2001,16766561,21099833784),
(204,2002,17084632,21582248882),
(204,2003,17415214,21828144686),
(204,2004,17827825,25086930693),
(204,2005,18361176,28858965517),
(204,2006,19059258,33332844575),
(204,2007,19878254,40405006007),
(205,2001,21573,358744800),
(205,2002,23232,366707910),
(205,2003,25011,409753640),
(205,2004,26700,485598810),
(205,2005,28180,578645760),
(205,2006,29391,721891470),
(205,2007,30385,773489740),
(205,2008,31202,862683630),
(205,2009,31934,703175750),
(205,2010,32660,686787810),
(205,2011,33377,728789570),
(205,2012,34066,715722770),
(205,2013,34731,740776770),
(205,2014,35369,823968140),
(205,2015,35981,893501650),
(205,2016,36559,950357510),
(205,2017,37115,962525840),
(205,2018,37665,1022312010),
(206,1960,3001609,313582727),
(206,1961,3060368,333975336),
(206,1962,3121236,357635713),
(206,1963,3183572,371767002),
(206,1964,3246523,392247517),
(206,1965,3309586,416926303),
(206,1966,3372189,432794922),
(206,1967,3434825,449826323),
(206,1968,3499362,453980096),
(206,1969,3568398,471635620),
(206,1970,3643604,469266736),
(206,1971,3726189,501866730),
(206,1972,3815260,585427545),
(206,1973,3907889,647199482),
(206,1974,3999921,652532796),
(206,1975,4088564,864602103),
(206,1976,4173135,866044961),
(206,1977,4255248,935360466),
(206,1978,4337291,1113920123),
(206,1979,4422745,1004316495),
(206,1980,4514430,1033002402),
(206,1981,4612849,876937559),
(206,1982,4718162,834369860),
(206,1983,4832321,832415806),
(206,1984,4957558,919103735),
(206,1985,5095401,1033069710),
(206,1986,5247283,1067828247),
(206,1987,5412847,1163426851),
(206,1988,5589626,1482597299),
(206,1989,5773920,1433686310),
(206,1990,5963252,1738605558),
(206,1991,6157079,1877138042),
(206,1992,6356748,1881847677),
(206,1993,6563922,1463251055),
(206,1994,6781053,1179837955),
(206,1995,7010145,1445919970),
(206,1996,7250975,1607345450),
(206,1997,7503493,1544689503),
(206,1998,7770048,1744794457),
(206,1999,8053536,1534673583),
(206,2000,8355654,1385058162),
(206,2001,8678051,1709347793),
(206,2002,9019233,1987622279),
(206,2003,9373916,2736666516),
(206,2004,9734767,4414929220),
(206,2005,10096633,6646663561),
(206,2006,10457124,7422102656),
(206,2007,10818024,8638711443),
(206,2008,11183588,10351932604),
(206,2009,11560147,9253484108),
(206,2010,11952136,10657705536),
(206,2011,12360989,12156380425),
(206,2012,12784750,12368071039),
(206,2013,13220424,12949854263),
(206,2014,13663559,13922223234),
(206,2015,14110975,10945989472),
(206,2016,14561666,10090922857),
(206,2017,15016773,9975692095),
(206,2018,15477751,11302544205),
(207,1960,1580513,121128073),
(207,1961,1597526,126396469),
(207,1962,1612755,132237441),
(207,1963,1631764,143255784),
(207,1964,1662073,166104067),
(207,1965,1708630,187300336),
(207,1966,1774029,216136263),
(207,1967,1855442,231706475),
(207,1968,1945780,241956910),
(207,1969,2034907,267732446),
(207,1970,2115522,253976626),
(207,1971,2185662,286537525),
(207,1972,2247582,335677636),
(207,1973,2303345,406479906),
(207,1974,2356622,560437742),
(207,1975,2410446,617321669),
(207,1976,2464423,619375134),
(207,1977,2518457,777435020),
(207,1978,2576292,824263841),
(207,1979,2642696,891775906),
(207,1980,2720839,1136408814),
(207,1981,2812307,962347001),
(207,1982,2915620,821651918),
(207,1983,3026973,765746590),
(207,1984,3140846,718148959),
(207,1985,3252994,762359722),
(207,1986,3363042,1060911735),
(207,1987,3471739,1249099130),
(207,1988,3577468,1378847487),
(207,1989,3678567,1352949663),
(207,1990,3774312,1628427515),
(207,1991,3862992,1602299863),
(207,1992,3945905,1692959110),
(207,1993,4029053,1233496846),
(207,1994,4120616,982624324),
(207,1995,4226291,1309382885),
(207,1996,4348805,1465448290),
(207,1997,4485951,1498950899),
(207,1998,4632446,1587345951),
(207,1999,4780448,1576094566),
(207,2000,4924402,1488185772),
(207,2001,5062567,1481141850),
(207,2002,5197031,1698678686),
(207,2003,5330639,2111093198),
(207,2004,5467766,2255942249),
(207,2005,5611640,2280575830),
(207,2006,5762880,2349495621),
(207,2007,5920359,2659095101),
(207,2008,6083420,3310277927),
(207,2009,6250835,3365711796),
(207,2010,6421679,3426022206),
(207,2011,6595943,3867391618),
(207,2012,6773807,3873529926),
(207,2013,6954721,4320427496),
(207,2014,7137997,4568900620),
(207,2015,7323158,4179185205),
(207,2016,7509952,4414908597),
(207,2017,7698475,4765866980),
(207,2018,7889094,5300214337),
(208,1960,27397207,2760747472),
(208,1961,28224187,3034043574),
(208,1962,29080938,3308912797),
(208,1963,29966865,3540403457),
(208,1964,30881138,3889129942),
(208,1965,31822660,4388937649),
(208,1966,32789130,5279230817),
(208,1967,33778799,5638461442),
(208,1968,34791409,6081009428),
(208,1969,35827092,6695336567),
(208,1970,36884536,7086538438),
(208,1971,37963278,7375000024),
(208,1972,39058603,8177884553),
(208,1973,40159582,10838587358),
(208,1974,41252324,13703000530),
(208,1975,42326312,14882747955),
(208,1976,43377271,16985211146),
(208,1977,44405904,19779315170),
(208,1978,45413080,24006570178),
(208,1979,46401754,27371699083),
(208,1980,47374472,32353440727),
(208,1981,48326274,34846107862),
(208,1982,49255900,36589797857),
(208,1983,50173924,40042826244),
(208,1984,51094868,41797592963),
(208,1985,52026901,38900692712),
(208,1986,52980094,43096746122),
(208,1987,53945881,50535438696),
(208,1988,54891520,61667199835),
(208,1989,55772169,72250877410),
(208,1990,56558186,85343063966),
(208,1991,57232465,98234695722),
(208,1992,57811021,111453000000),
(208,1993,58337773,128890000000),
(208,1994,58875269,146683000000),
(208,1995,59467274,169279000000),
(208,1996,60130186,183035000000),
(208,1997,60846582,150180000000),
(208,1998,61585103,113676000000),
(208,1999,62298571,126669000000),
(208,2000,62952642,126392000000),
(208,2001,63539196,120297000000),
(208,2002,64069087,134301000000),
(208,2003,64549866,152281000000),
(208,2004,64995299,172895000000),
(208,2005,65416189,189318000000),
(208,2006,65812536,221758000000),
(208,2007,66182067,262943000000),
(208,2008,66530984,291383000000),
(208,2009,66866839,281710000000),
(208,2010,67195028,341105000000),
(208,2011,67518382,370819000000),
(208,2012,67835957,397558000000),
(208,2013,68144501,420333000000),
(208,2014,68438730,407339000000),
(208,2015,68714511,401296000000),
(208,2016,68971331,412353000000),
(208,2017,69209858,455276000000),
(208,2018,69428524,504993000000),
(209,1990,5283814,2629395066),
(209,1991,5400630,2534720480),
(209,1992,5502494,1909246641),
(209,1993,5593315,1646693642),
(209,1994,5679167,1522018436),
(209,1995,5764810,1231567145),
(209,1996,5851355,1043654822),
(209,1997,5938405,921572114),
(209,1998,6027388,1320242081),
(209,1999,6119661,1086605267),
(209,2000,6216341,860521119),
(209,2001,6318513,1080768907),
(209,2002,6426867,1221120799),
(209,2003,6541547,1555301496),
(209,2004,6662389,2076182461),
(209,2005,6789321,2312327536),
(209,2006,6922587,2830220713),
(209,2007,7062672,3719506173),
(209,2008,7209930,5161337336),
(209,2009,7364753,4979481980),
(209,2010,7527394,5642178580),
(209,2011,7697510,6522732203),
(209,2012,7874835,7633049792),
(209,2013,8059769,8448469838),
(209,2014,8252833,9112544556),
(209,2015,8454028,7854602392),
(209,2016,8663579,6952678127),
(209,2017,8880268,7157865188),
(209,2018,9100837,7522947810),
(211,1987,3407321,2331358820),
(211,1988,3493895,3010982414),
(211,1989,3585868,3006988217),
(211,1990,3683967,3189539641),
(211,1991,3789185,3208098919),
(211,1992,3899843,3200539816),
(211,1993,4010789,3179225949),
(211,1994,4115102,2561118608),
(211,1995,4207841,2482228440),
(211,1996,4287346,2378759975),
(211,1997,4355116,2450349634),
(211,1998,4413479,2605688065),
(211,1999,4466135,2450564468),
(211,2000,4516133,2904662605),
(211,2001,4564083,3534803922),
(211,2002,4610005,4461978499),
(211,2003,4655743,5977560877),
(211,2004,4703401,6838351088),
(211,2005,4754646,8103901996),
(211,2006,4810109,10276674365),
(211,2007,4870141,12664165103),
(211,2008,4935767,19271523179),
(211,2009,5007954,20214385965),
(211,2010,5087213,22583157895),
(211,2011,5174085,29233333333),
(211,2012,5267900,35164210526),
(211,2013,5366375,39197543860),
(211,2014,5466328,43524210526),
(211,2015,5565287,35799714286),
(211,2016,5662372,36180000000),
(211,2017,5757669,37926285714),
(211,2018,5850908,40761142857),
(213,1975,88318,32506741),
(213,1976,89234,30036416),
(213,1977,90273,34139387),
(213,1978,91335,41567471),
(213,1979,92268,44667002),
(213,1980,92971,53260077),
(213,1981,93409,62242013),
(213,1982,93641,62068161),
(213,1983,93729,60863963),
(213,1984,93788,64248354),
(213,1985,93896,60058663),
(213,1986,94088,68195855),
(213,1987,94321,81667133),
(213,1988,94591,106657267),
(213,1989,94851,106344855),
(213,1990,95069,113563821),
(213,1991,95246,132201141),
(213,1992,95399,137066290),
(213,1993,95557,138489884),
(213,1994,95739,193775943),
(213,1995,95976,202547013),
(213,1996,96273,219583570),
(213,1997,96619,212155124),
(213,1998,97032,188686997),
(213,1999,97482,196686674),
(213,2000,97973,202363492),
(213,2001,98487,181244788),
(213,2002,99022,182737040),
(213,2003,99589,202543202),
(213,2004,100218,229358214),
(213,2005,100905,262176133),
(213,2006,101706,294137737),
(213,2007,102581,300143056),
(213,2008,103379,349484427),
(213,2009,103890,318166562),
(213,2010,103986,369485198),
(213,2011,103562,423011844),
(213,2012,102737,472358251),
(213,2013,101768,450686353),
(213,2014,101028,443911052),
(213,2015,100781,435438217),
(213,2016,101133,401109307),
(213,2017,101998,430174168),
(213,2018,103197,450353313),
(214,1960,847979,535670127),
(214,1961,864818,584961208),
(214,1962,879441,619319197),
(214,1963,891944,678235373),
(214,1964,902613,711893367),
(214,1965,911737,736568861),
(214,1966,919217,723735635),
(214,1967,925235,761981474),
(214,1968,930795,758899950),
(214,1969,937186,779200000),
(214,1970,945360,821850000),
(214,1971,955741,896754316),
(214,1972,968136,1083381044),
(214,1973,982010,1308799459),
(214,1974,996493,2042031901),
(214,1975,1010936,2442667573),
(214,1976,1025107,2500410584),
(214,1977,1039212,3138666667),
(214,1978,1053558,3562333458),
(214,1979,1068640,4602416625),
(214,1980,1084744,6235833333),
(214,1981,1101983,6992083333),
(214,1982,1120020,8140416667),
(214,1983,1138071,7763750000),
(214,1984,1155074,7757083333),
(214,1985,1170285,7375918367),
(214,1986,1183381,4794444444),
(214,1987,1194541,4797777778),
(214,1988,1204153,4496852073),
(214,1989,1212857,4323058824),
(214,1990,1221116,5068000000),
(214,1991,1229103,5307905882),
(214,1992,1236683,5439552941),
(214,1993,1243616,4669488516),
(214,1994,1249520,4947205860),
(214,1995,1254200,5329214163),
(214,1996,1257549,5759537726),
(214,1997,1259848,5737751332),
(214,1998,1261695,6043694330),
(214,1999,1263933,6808982521),
(214,2000,1267153,8154338233),
(214,2001,1271632,8824873259),
(214,2002,1277213,9008273721),
(214,2003,1283559,11305459802),
(214,2004,1290123,13280275123),
(214,2005,1296502,15982282462),
(214,2006,1302561,18369361094),
(214,2007,1308451,21641620050),
(214,2008,1314443,27871587350),
(214,2009,1320930,19172165226),
(214,2010,1328147,22157948396),
(214,2011,1336178,25433011405),
(214,2012,1344817,25769329445),
(214,2013,1353700,27110262285),
(214,2014,1362342,27477965424),
(214,2015,1370328,25121524775),
(214,2016,1377564,21746391333),
(214,2017,1384072,22250455019),
(214,2018,1389858,23410353435),
(215,1965,4547941,991047619),
(215,1966,4641000,1040952381),
(215,1967,4740511,1085714286),
(215,1968,4845219,1214666667),
(215,1969,4953390,1289904762),
(215,1970,5063809,1439238095),
(215,1971,5176295,1685217059),
(215,1972,5291338,2237476420),
(215,1973,5409343,2730787476),
(215,1974,5530975,3545933562),
(215,1975,5656914,4328610490),
(215,1976,5786478,4507929104),
(215,1977,5919965,5109324009),
(215,1978,6060151,5968044210),
(215,1979,6210756,7188191882),
(215,1980,6374039,8744134354),
(215,1981,6551231,8428513568),
(215,1982,6740529,8133401050),
(215,1983,6937331,8350176783),
(215,1984,7135270,8254891864),
(215,1985,7329594,8410185740),
(215,1986,7517858,9018136020),
(215,1987,7700736,9696271268),
(215,1988,7880332,10096292842),
(215,1989,8060210,10102075213),
(215,1990,8242496,12290568182),
(215,1991,8427857,13074782609),
(215,1992,8613861,15497286296),
(215,1993,8795932,14608946896),
(215,1994,8967916,15632463424),
(215,1995,9125398,18030876599),
(215,1996,9267340,19587322786),
(215,1997,9395123,20746360430),
(215,1998,9509857,21803372267),
(215,1999,9613588,22943685719),
(215,2000,9708350,21473188882),
(215,2001,9793903,22066101341),
(215,2002,9871251,23142294436),
(215,2003,9945277,27453084983),
(215,2004,10022277,31183139301),
(215,2005,10106771,32273007554),
(215,2006,10201214,34378437265),
(215,2007,10304726,38908069299),
(215,2008,10414433,44856586316),
(215,2009,10525694,43454935940),
(215,2010,10635244,44050929160),
(215,2011,10741880,45810626509),
(215,2012,10847002,45044112939),
(215,2013,10952951,46251061734),
(215,2014,11063201,47632326088),
(215,2015,11179949,43152528548),
(215,2016,11303946,41808379888),
(215,2017,11433443,39952095561),
(215,2018,11565204,39860715814),
(216,1960,27472345,13995067818),
(216,1961,28146910,7988888889),
(216,1962,28832827,8922222222),
(216,1963,29531365,10355555556),
(216,1964,30244261,11177777778),
(216,1965,30972994,11966666667),
(216,1966,31717507,14100000000),
(216,1967,32477992,15644444444),
(216,1968,33256464,17500000000),
(216,1969,34055390,19466666667),
(216,1970,34876303,17086956522),
(216,1971,35720599,16256619964),
(216,1972,36587261,20431095406),
(216,1973,37472336,25724381625),
(216,1974,38370283,35599913836),
(216,1975,39277258,44633707243),
(216,1976,40189567,51280134554),
(216,1977,41108297,58676813687),
(216,1978,42039992,65147022486),
(216,1979,42994041,89394085658),
(216,1980,43975971,68789289566),
(216,1981,44988414,71040020140),
(216,1982,46025411,64546332581),
(216,1983,47073472,61678280115),
(216,1984,48114155,59989909458),
(216,1985,49133937,67234948265),
(216,1986,50128541,75728009963),
(216,1987,51100924,87172789528),
(216,1988,52053765,90852814005),
(216,1989,52992487,107143000000),
(216,1990,53921760,150676000000),
(216,1991,54840590,150028000000),
(216,1992,55748948,158459000000),
(216,1993,56653804,180170000000),
(216,1994,57564204,130690000000),
(216,1995,58486456,169486000000),
(216,1996,59423282,181476000000),
(216,1997,60372568,189835000000),
(216,1998,61329676,275769000000),
(216,1999,62287397,255884000000),
(216,2000,63240194,272979000000),
(216,2001,64192243,200252000000),
(216,2002,65145367,238428000000),
(216,2003,66089402,311823000000),
(216,2004,67010930,404787000000),
(216,2005,67903469,501416000000),
(216,2006,68756810,552487000000),
(216,2007,69581848,675770000000),
(216,2008,70418604,764336000000),
(216,2009,71321399,644640000000),
(216,2010,72326988,771902000000),
(216,2011,73443863,832524000000),
(216,2012,74653016,873982000000),
(216,2013,75928564,950579000000),
(216,2014,77231907,934186000000),
(216,2015,78529409,859797000000),
(216,2016,79821724,863722000000),
(216,2017,81101892,851549000000),
(216,2018,82319724,766509000000),
(217,1990,8913,8824447),
(217,1991,9026,9365165),
(217,1992,9112,9742949),
(217,1993,9194,9630762),
(217,1994,9252,10886825),
(217,1995,9298,11025945),
(217,1996,9323,12334846),
(217,1997,9323,12700905),
(217,1998,9332,12757632),
(217,1999,9346,13687141),
(217,2000,9394,13742057),
(217,2001,9484,13196544),
(217,2002,9596,15450994),
(217,2003,9726,18231078),
(217,2004,9869,21534931),
(217,2005,10000,21839098),
(217,2006,10120,22902861),
(217,2007,10221,27030996),
(217,2008,10314,30290770),
(217,2009,10424,27101312),
(217,2010,10530,31824701),
(217,2011,10633,38713279),
(217,2012,10739,37671734),
(217,2013,10857,37507514),
(217,2014,10972,37291841),
(217,2015,11099,35492333),
(217,2016,11225,36547419),
(217,2017,11370,40620557),
(217,2018,11508,42587778),
(219,1988,23670808,5100405772),
(219,1989,24411738,4420168102),
(219,1990,25203845,4258743263),
(219,1991,26056594,4956588279),
(219,1992,26961197,4601413264),
(219,1993,27887203,4257702197),
(219,1994,28792639,4510846968),
(219,1995,29649135,5255221425),
(219,1996,30444526,6496195451),
(219,1997,31192857,7683852497),
(219,1998,31924196,12270448700),
(219,1999,32682239,12711213451),
(219,2000,33499180,13375976354),
(219,2001,34385856,13581644246),
(219,2002,35334788,14142035080),
(219,2003,36337782,15224257698),
(219,2004,37379767,16675948415),
(219,2005,38450320,18399046025),
(219,2006,39548663,18649590248),
(219,2007,40681414,21843529025),
(219,2008,41853944,27941177435),
(219,2009,43073834,29081425282),
(219,2010,44346525,32014249841),
(219,2011,45673338,34657139495),
(219,2012,47052481,39650530214),
(219,2013,48482266,45680532614),
(219,2014,49959822,49964788814),
(219,2015,51482633,47378599025),
(219,2016,53050790,49774021003),
(219,2017,54663906,53320625959),
(219,2018,56318348,57437073927),
(220,1960,6767095,423008385),
(220,1961,6983818,441524109),
(220,1962,7215796,449012578),
(220,1963,7461634,516147798),
(220,1964,7719104,589056603),
(220,1965,7986066,884873949),
(220,1966,8263439,925770308),
(220,1967,8550443,967647058),
(220,1968,8841153,1037815126),
(220,1969,9127857,1169047619),
(220,1970,9405600,1260084034),
(220,1971,9671860,1417787115),
(220,1972,9929636,1491596639),
(220,1973,10186455,1702521008),
(220,1974,10453037,2100142653),
(220,1975,10737403,2359555556),
(220,1976,11042974,2447300000),
(220,1977,11368615,2936470588),
(220,1978,11712530,2420260870),
(220,1979,12071145,2139025000),
(220,1980,12442334,1244610000),
(220,1981,12825082,1337300000),
(220,1982,13221991,2177500000),
(220,1983,13638729,2240333333),
(220,1984,14082875,3615647477),
(220,1985,14559355,3519666339),
(220,1986,15070302,3923232122),
(220,1987,15612754,6269511615),
(220,1988,16180124,6508931652),
(220,1989,16763042,5276480986),
(220,1990,17354392,4304398866),
(220,1991,17953531,3321729057),
(220,1992,18561674,2857457860),
(220,1993,19175988,3220439044),
(220,1994,19793541,3990430447),
(220,1995,20413152,5755818947),
(220,1996,21032821,6044585327),
(220,1997,21655398,6269333313),
(220,1998,22290780,6584815847),
(220,1999,22952410,5998563258),
(220,2000,23650172,6193246837),
(220,2001,24388968,5840503869),
(220,2002,25167257,6178563591),
(220,2003,25980552,6336696289),
(220,2004,26821297,7940362799),
(220,2005,27684585,9013834373),
(220,2006,28571475,9942597780),
(220,2007,29486338,12292813603),
(220,2008,30431736,14239026630),
(220,2009,31411096,18168902154),
(220,2010,32428167,20186496527),
(220,2011,33476919,20176025257),
(220,2012,34559168,23114293416),
(220,2013,35695246,24599550624),
(220,2014,36912148,27291879819),
(220,2015,38225453,27102650387),
(220,2016,39647506,24133664285),
(220,2017,41162465,25995031850),
(220,2018,42723139,27476945526),
(221,1987,51293000,64087694038),
(221,1988,51521000,74703517903),
(221,1989,51773000,82709161099),
(221,1990,51892000,81456918679),
(221,1991,52000470,77464561150),
(221,1992,52150266,73942235330),
(221,1993,52179210,65648559903),
(221,1994,51921041,52549555149),
(221,1995,51512299,48213868178),
(221,1996,51057189,44558077827),
(221,1997,50594105,50150399792),
(221,1998,50143939,41883241472),
(221,1999,49673350,31580639045),
(221,2000,49175848,31261527363),
(221,2001,48683865,37972301335),
(221,2002,48202500,42351593887),
(221,2003,47812950,50084197498),
(221,2004,47451600,64819702952),
(221,2005,47105150,86057915585),
(221,2006,46787750,107648000000),
(221,2007,46509350,142580000000),
(221,2008,46258200,179817000000),
(221,2009,46053300,117113000000),
(221,2010,45870700,136013000000),
(221,2011,45706100,163160000000),
(221,2012,45593300,175781000000),
(221,2013,45489600,183310000000),
(221,2014,45271947,133503000000),
(221,2015,45154029,91030959455),
(221,2016,45004645,93355993629),
(221,2017,44831135,112190000000),
(221,2018,44622516,130832000000),
(223,1960,2538643,1242289239),
(223,1961,2571681,1547388781),
(223,1962,2603882,1710004407),
(223,1963,2635126,1539681491),
(223,1964,2665388,1975701816),
(223,1965,2694536,1890769326),
(223,1966,2722875,1809183975),
(223,1967,2750086,1597721080),
(223,1968,2774759,1593675330),
(223,1969,2795042,2004435484),
(223,1970,2809793,2137096774),
(223,1971,2818281,2807258065),
(223,1972,2821461,2189418001),
(223,1973,2822117,3964295673),
(223,1974,2824095,4090209682),
(223,1975,2830176,3538283322),
(223,1976,2841372,3667161241),
(223,1977,2856958,4114667063),
(223,1978,2875728,4910257283),
(223,1979,2895688,7181185278),
(223,1980,2915389,10163020116),
(223,1981,2934613,11048335541),
(223,1982,2953852,9178802163),
(223,1983,2973036,5102281256),
(223,1984,2992246,4850241442),
(223,1985,3011519,4732017873),
(223,1986,3030649,5880112788),
(223,1987,3049581,7367494080),
(223,1988,3068705,8213515459),
(223,1989,3088595,8438951476),
(223,1990,3109601,9298839655),
(223,1991,3131660,11205971155),
(223,1992,3154464,12878199881),
(223,1993,3177745,15002106518),
(223,1994,3201151,17474647792),
(223,1995,3224281,19297663097),
(223,1996,3247381,20515543039),
(223,1997,3270164,23969823010),
(223,1998,3291053,25385928198),
(223,1999,3308012,23983945191),
(223,2000,3319736,22823255802),
(223,2001,3325473,20898788417),
(223,2002,3326040,13606494599),
(223,2003,3323668,12045631093),
(223,2004,3321476,13686329890),
(223,2005,3321803,17362857684),
(223,2006,3325401,19579457966),
(223,2007,3331749,23410572634),
(223,2008,3340221,30366213119),
(223,2009,3349676,31660911277),
(223,2010,3359275,40284481652),
(223,2011,3368934,47962439304),
(223,2012,3378974,51264390116),
(223,2013,3389439,57531233351),
(223,2014,3400434,57236013086),
(223,2015,3412009,53274304222),
(223,2016,3424132,52687612262),
(223,2017,3436646,56488991831),
(223,2018,3449299,59596885024),
(224,1960,180671000,543300000000),
(224,1961,183691000,563300000000),
(224,1962,186538000,605100000000),
(224,1963,189242000,638600000000),
(224,1964,191889000,685800000000),
(224,1965,194303000,743700000000),
(224,1966,196560000,815000000000),
(224,1967,198712000,861700000000),
(224,1968,200706000,942500000000),
(224,1969,202677000,1019900000000),
(224,1970,205052000,1073300000000),
(224,1971,207661000,1164850000000),
(224,1972,209896000,1279110000000),
(224,1973,211909000,1425380000000),
(224,1974,213854000,1545240000000),
(224,1975,215973000,1684900000000),
(224,1976,218035000,1873410000000),
(224,1977,220239000,2081830000000),
(224,1978,222585000,2351600000000),
(224,1979,225055000,2627330000000),
(224,1980,227225000,2857310000000),
(224,1981,229466000,3207040000000),
(224,1982,231664000,3343790000000),
(224,1983,233792000,3634040000000),
(224,1984,235825000,4037610000000),
(224,1985,237924000,4338980000000),
(224,1986,240133000,4579630000000),
(224,1987,242289000,4855220000000),
(224,1988,244499000,5236440000000),
(224,1989,246819000,5641580000000),
(224,1990,249623000,5963140000000),
(224,1991,252981000,6158130000000),
(224,1992,256514000,6520330000000),
(224,1993,259919000,6858560000000),
(224,1994,263126000,7287240000000),
(224,1995,266278000,7639750000000),
(224,1996,269394000,8073120000000),
(224,1997,272657000,8577550000000),
(224,1998,275854000,9062820000000),
(224,1999,279040000,9630660000000),
(224,2000,282162411,10252300000000),
(224,2001,284968955,10581800000000),
(224,2002,287625193,10936400000000),
(224,2003,290107933,11458200000000),
(224,2004,292805298,12213700000000),
(224,2005,295516599,13036600000000),
(224,2006,298379912,13814600000000),
(224,2007,301231207,14451900000000),
(224,2008,304093966,14712800000000),
(224,2009,306771529,14448900000000),
(224,2010,309326085,14992100000000),
(224,2011,311580009,15542600000000),
(224,2012,313874218,16197000000000),
(224,2013,316057727,16784800000000),
(224,2014,318386421,17521700000000),
(224,2015,320742673,18219300000000),
(224,2016,323071342,18707200000000),
(224,2017,325147121,19485400000000),
(224,2018,327167434,20494100000000),
(225,1990,20510000,13360607918),
(225,1991,20952000,13677622222),
(225,1992,21449000,12941297376),
(225,1993,21942000,13099013836),
(225,1994,22377000,12899156991),
(225,1995,22785000,13350468917),
(225,1996,23225000,13948892216),
(225,1997,23667000,14744603774),
(225,1998,24051000,14988971211),
(225,1999,24311650,17078465982),
(225,2000,24650400,13760513969),
(225,2001,24964450,11401421329),
(225,2002,25271850,9687788513),
(225,2003,25567650,10134453435),
(225,2004,25864350,12030023548),
(225,2005,26167000,14307509839),
(225,2006,26488250,17330833853),
(225,2007,26868000,22311393928),
(225,2008,27302800,29549438884),
(225,2009,27767400,33689223673),
(225,2010,28562400,39332770929),
(225,2011,29339400,45915191189),
(225,2012,29774500,51821573338),
(225,2013,30243200,57690770140),
(225,2014,30757700,76658542757),
(225,2015,31298900,81847410182),
(225,2016,31847900,81779019096),
(225,2017,32388600,59159949231),
(225,2018,32955400,50499920318),
(227,1960,80977,13066557),
(227,1961,82169,13999883),
(227,1962,83237,14524878),
(227,1963,84198,13708219),
(227,1964,85111,14758210),
(227,1965,86011,15108207),
(227,1966,86903,16099865),
(227,1967,87777,15835177),
(227,1968,88662,15350000),
(227,1969,89568,16650000),
(227,1970,90509,18450000),
(227,1971,91491,20051648),
(227,1972,92513,27585488),
(227,1973,93571,30165373),
(227,1974,94614,32924215),
(227,1975,95662,33237164),
(227,1976,96692,32792480),
(227,1977,97701,49353161),
(227,1978,98697,60844771),
(227,1979,99649,71096359),
(227,1980,100566,82340339),
(227,1981,101437,102086539),
(227,1982,102256,113759203),
(227,1983,103032,122255349),
(227,1984,103779,135024987),
(227,1985,104506,145641705),
(227,1986,105217,160846656),
(227,1987,105906,175580647),
(227,1988,106532,200726712),
(227,1989,107071,214745002),
(227,1990,107484,240365262),
(227,1991,107776,254829629),
(227,1992,107950,277954111),
(227,1993,108033,286307814),
(227,1994,108053,289438481),
(227,1995,108035,316008481),
(227,1996,107976,331489703),
(227,1997,107895,347770000),
(227,1998,107801,373619851),
(227,1999,107758,390719148),
(227,2000,107784,396261370),
(227,2001,107896,430039296),
(227,2002,108097,461883444),
(227,2003,108326,481806296),
(227,2004,108512,521975111),
(227,2005,108614,550728666),
(227,2006,108603,610930037),
(227,2007,108518,684446259),
(227,2008,108393,695428851),
(227,2009,108287,674922481),
(227,2010,108255,681225963),
(227,2011,108316,676129407),
(227,2012,108435,692933740),
(227,2013,108622,721208998),
(227,2014,108861,727714407),
(227,2015,109148,755458031),
(227,2016,109459,770762204),
(227,2017,109827,785222509),
(227,2018,110210,813093984),
(228,1960,8141841,7779090909),
(228,1961,8439261,8189090909),
(228,1962,8742777,8946969697),
(228,1963,9052635,9753333333),
(228,1964,9369096,8099318182),
(228,1965,9692278,8427777778),
(228,1966,10022592,8781333333),
(228,1967,10359745,9250000000),
(228,1968,10702291,10034444444),
(228,1969,11048262,10285111111),
(228,1970,11396393,11561111111),
(228,1971,11745945,12986590909),
(228,1972,12097694,13977727273),
(228,1973,12453718,17035581395),
(228,1974,12816955,26100930233),
(228,1975,13189509,27464651163),
(228,1976,13572208,31419534884),
(228,1977,13964379,36210697674),
(228,1978,14364727,39316279070),
(228,1979,14771271,48310930233),
(228,1980,15182611,59116511628),
(228,1981,15597886,66327441860),
(228,1982,16017573,67736744186),
(228,1983,16443134,67556279070),
(228,1984,16876703,60010285714),
(228,1985,17319520,61965466667),
(228,1986,17772001,60391604938),
(228,1987,18232730,48029034483),
(228,1988,18698847,60226413793),
(228,1989,19166471,43526253602),
(228,1990,19632665,48598315565),
(228,1991,20096317,53476971831),
(228,1992,20557683,60401798246),
(228,1993,21016901,60065011013),
(228,1994,21474549,58418666667),
(228,1995,21931084,77407726244),
(228,1996,22385650,70543211119),
(228,1997,22837743,85843534589),
(228,1998,23288564,91331203433),
(228,1999,23739841,97976886247),
(228,2000,24192446,117141000000),
(228,2001,24646472,122904000000),
(228,2002,25100408,92893587734),
(228,2003,25551624,83620628582),
(228,2004,25996594,112453000000),
(228,2005,26432447,145510000000),
(228,2006,26850194,183478000000),
(228,2007,27247610,230364000000),
(228,2008,27635832,315953000000),
(228,2009,28031009,329788000000),
(228,2010,28439940,393192000000),
(228,2011,28888369,316482000000),
(228,2012,29362449,381286000000),
(228,2013,29783571,371005000000),
(228,2014,30045134,482359000000),
(230,2002,108510,3269000000),
(230,2003,108506,3453000000),
(230,2004,108467,3799000000),
(230,2005,108454,4439000000),
(230,2006,108371,4504000000),
(230,2007,108339,4803000000),
(230,2008,108399,4250000000),
(230,2009,108405,4203000000),
(230,2010,108358,4339000000),
(230,2011,108292,4239000000),
(230,2012,108191,4095000000),
(230,2013,108044,3762000000),
(230,2014,107884,3622000000),
(230,2015,107710,3748000000),
(230,2016,107510,3863000000),
(230,2017,107268,3855000000),
(231,1985,60896721,14094687821),
(231,1986,62293856,26336616250),
(231,1987,63701972,36658108850),
(231,1988,65120439,25423812649),
(231,1989,66550234,6293304975),
(231,1990,67988862,6471740806),
(231,1991,69436954,9613369520),
(231,1992,70883481,9866990236),
(231,1993,72300308,13180953598),
(231,1994,73651218,16286433533),
(231,1995,74910461,20736164459),
(231,1996,76068743,24657470575),
(231,1997,77133214,26843700442),
(231,1998,78115710,27209602050),
(231,1999,79035871,28683659007),
(231,2000,79910412,31172518403),
(231,2001,80742499,32685198735),
(231,2002,81534407,35064105501),
(231,2003,82301656,39552513316),
(231,2004,83062821,45427854693),
(231,2005,83832661,57633255618),
(231,2006,84617540,66371664817),
(231,2007,85419591,77414425532),
(231,2008,86243413,99130304099),
(231,2009,87092252,106015000000),
(231,2010,87967651,115932000000),
(231,2011,88871561,135539000000),
(231,2012,89802487,155820000000),
(231,2013,90753472,171222000000),
(231,2014,91714595,186205000000),
(231,2015,92677076,193241000000),
(231,2016,93638724,205276000000),
(231,2017,94596642,223780000000),
(231,2018,95540395,244948000000),
(232,1979,112549,119258835),
(232,1980,115597,113423181),
(232,1981,118541,98746405),
(232,1982,121395,98144643),
(232,1983,124209,110123779),
(232,1984,127049,135553764),
(232,1985,129984,123698506),
(232,1986,132995,118691396),
(232,1987,136079,130834145),
(232,1988,139315,148545381),
(232,1989,142794,144482170),
(232,1990,146573,158397403),
(232,1991,150716,188869985),
(232,1992,155170,196142585),
(232,1993,159744,188080374),
(232,1994,164129,219260341),
(232,1995,168158,233902114),
(232,1996,171722,245177633),
(232,1997,174921,255890221),
(232,1998,177987,262301252),
(232,1999,181265,267999225),
(232,2000,184972,272014693),
(232,2001,189219,257926881),
(232,2002,193920,262603781),
(232,2003,198959,314463144),
(232,2004,204127,364996869),
(232,2005,209282,394962552),
(232,2006,214370,439376794),
(232,2007,219472,526428309),
(232,2008,224704,607958616),
(232,2009,230247,610066628),
(232,2010,236211,700804286),
(232,2011,242653,792149700),
(232,2012,249499,781702874),
(232,2013,256635,801787555),
(232,2014,263888,814954307),
(232,2015,271130,737917151),
(232,2016,278330,787942567),
(232,2017,285510,849708342),
(232,2018,292680,887817896),
(234,1982,157372,121221651),
(234,1983,158352,111862823),
(234,1984,159248,109200934),
(234,1985,159990,95572172),
(234,1986,160544,100947848),
(234,1987,160965,111713922),
(234,1988,161376,133016065),
(234,1989,161940,122888609),
(234,1990,162803,125766269),
(234,1991,163997,125597205),
(234,1992,165490,132303041),
(234,1993,167119,133122897),
(234,1994,168694,221098106),
(234,1995,170054,224865731),
(234,1996,171165,249908970),
(234,1997,172068,285475591),
(234,1998,172839,269481523),
(234,1999,173609,258833766),
(234,2000,174454,269019710),
(234,2001,175392,273088357),
(234,2002,176407,288078881),
(234,2003,177484,338838639),
(234,2004,178590,420320176),
(234,2005,179727,462649043),
(234,2006,180876,508503671),
(234,2007,182046,550970655),
(234,2008,183263,644132488),
(234,2009,184556,560959527),
(234,2010,185949,643046733),
(234,2011,187469,739785121),
(234,2012,189088,801168622),
(234,2013,190717,804808525),
(234,2014,192221,805162576),
(234,2015,193513,804100573),
(234,2016,194535,786640012),
(234,2017,195352,841538413),
(234,2018,196130,861494700),
(235,1990,11709993,5647119229),
(235,1991,12302124,5930370370),
(235,1992,12954155,6463649985),
(235,1993,13634076,5368270615),
(235,1994,14297613,4167356037),
(235,1995,14913315,4258788725),
(235,1996,15469274,5785685311),
(235,1997,15975668,6838557384),
(235,1998,16450310,6325141676),
(235,1999,16921149,7641102523),
(235,2000,17409072,9652436180),
(235,2001,17918373,9861560095),
(235,2002,18443691,10694628092),
(235,2003,18985000,11777966673),
(235,2004,19540098,13872791659),
(235,2005,20107409,16746344766),
(235,2006,20687646,19061978586),
(235,2007,21282515,21650532264),
(235,2008,21892146,26910851362),
(235,2009,22516460,25130274124),
(235,2010,23154855,30906749533),
(235,2011,23807588,32726417878),
(235,2012,24473178,35401339869),
(235,2013,25147109,40415233436),
(235,2014,25823485,43228585321),
(235,2015,26497889,42628328212),
(235,2016,27168210,30968242968),
(235,2017,27834821,26818703093),
(235,2018,28498687,26914402224),
(237,1960,17099840,7575396973),
(237,1961,17524533,7972996814),
(237,1962,17965725,8497996604),
(237,1963,18423161,9423396234),
(237,1964,18896307,10373995855),
(237,1965,19384841,11334395471),
(237,1966,19888250,12354995063),
(237,1967,20406864,13777394495),
(237,1968,20942145,14894594048),
(237,1969,21496075,16780393295),
(237,1970,22069776,18418392640),
(237,1971,22665271,20333691315),
(237,1972,23281508,21357435928),
(237,1973,23913099,29295674713),
(237,1974,24552540,36807721039),
(237,1975,25195187,38114542813),
(237,1976,25836888,36603349968),
(237,1977,26480913,40651349965),
(237,1978,27138965,46739449959),
(237,1979,27827320,57645721016),
(237,1980,28556769,82980483391),
(237,1981,29333103,85454420504),
(237,1982,30150448,78423059791),
(237,1983,30993758,87415851379),
(237,1984,31841593,77344092904),
(237,1985,32678874,59082638803),
(237,1986,33495953,67521602553),
(237,1987,34297727,88573697222),
(237,1988,35100909,95176640968),
(237,1989,35930050,99030856825),
(237,1990,36800509,115552000000),
(237,1991,37718950,123943000000),
(237,1992,38672607,134545000000),
(237,1993,39633750,134308000000),
(237,1994,40564059,139753000000),
(237,1995,41435758,155461000000),
(237,1996,42241011,147606000000),
(237,1997,42987461,152587000000),
(237,1998,43682260,137775000000),
(237,1999,44338543,136632000000),
(237,2000,44967708,136361000000),
(237,2001,45571274,121515000000),
(237,2002,46150913,115482000000),
(237,2003,46719196,175256000000),
(237,2004,47291610,228590000000),
(237,2005,47880601,257772000000),
(237,2006,48489459,271637000000),
(237,2007,49119759,299417000000),
(237,2008,49779471,286769000000),
(237,2009,50477011,295937000000),
(237,2010,51216964,375348000000),
(237,2011,52004172,416417000000),
(237,2012,52834005,396329000000),
(237,2013,53689236,366645000000),
(237,2014,54545991,350638000000),
(237,2015,55386367,317416000000),
(237,2016,56203654,296341000000),
(237,2017,57000451,349268000000),
(237,2018,57779622,368288000000),
(238,1960,3070776,713000000),
(238,1961,3164329,696285714),
(238,1962,3260650,693142857),
(238,1963,3360104,718714285),
(238,1964,3463213,839428571),
(238,1965,3570464,1082857143),
(238,1966,3681955,1264285714),
(238,1967,3797873,1368000000),
(238,1968,3918872,1605857143),
(238,1969,4045740,1965714286),
(238,1970,4179067,1825285714),
(238,1971,4319224,1687000000),
(238,1972,4466174,1910714286),
(238,1973,4619546,2268714286),
(238,1974,4778724,3121833333),
(238,1975,4943283,2618666667),
(238,1976,5112823,2746714286),
(238,1977,5287548,2483000000),
(238,1978,5468262,2813375000),
(238,1979,5656139,3325500000),
(238,1980,5851825,3829500000),
(238,1981,6055366,3872666667),
(238,1982,6265864,3994777778),
(238,1983,6481916,3216307692),
(238,1984,6701540,2739444444),
(238,1985,6923149,2281258065),
(238,1986,7146969,1661948718),
(238,1987,7372837,2269894737),
(238,1988,7598275,3713614458),
(238,1989,7820205,3998637681),
(238,1990,8036845,3285217391),
(238,1991,8246656,3378882353),
(238,1992,8451347,3181921788),
(238,1993,8656486,3273237853),
(238,1994,8869740,3656647744),
(238,1995,9096607,3807067122),
(238,1996,9339733,3597220962),
(238,1997,9597609,4303281932),
(238,1998,9866476,3537683046),
(238,1999,10140561,3404311977),
(238,2000,10415944,3600683040),
(238,2001,10692193,4094480988),
(238,2002,10971698,4193845678),
(238,2003,11256743,4901839731),
(238,2004,11550642,6221077675),
(238,2005,11856247,8331870169),
(238,2006,12173514,12756858899),
(238,2007,12502958,14056957976),
(238,2008,12848530,17910858638),
(238,2009,13215139,15328342304),
(238,2010,13605984,20265556274),
(238,2011,14023193,23460098340),
(238,2012,14465121,25503370699),
(238,2013,14926504,28045460442),
(238,2014,15399753,27150630607),
(238,2015,15879361,21154394546),
(238,2016,16363507,20954754378),
(238,2017,16853688,25868142077),
(238,2018,17351822,26720073436),
(239,1960,3776681,1052990400),
(239,1961,3905034,1096646600),
(239,1962,4039201,1117601600),
(239,1963,4178726,1159511700),
(239,1964,4322861,1217138000),
(239,1965,4471177,1311435800),
(239,1966,4623351,1281749500),
(239,1967,4779827,1397002000),
(239,1968,4941906,1479599900),
(239,1969,5111337,1747998800),
(239,1970,5289303,1884206300),
(239,1971,5476982,2178716300),
(239,1972,5673911,2677729400),
(239,1973,5877726,3309353600),
(239,1974,6085074,3982161400),
(239,1975,6293875,4371300700),
(239,1976,6502569,4318372000),
(239,1977,6712827,4364382100),
(239,1978,6929664,4351600500),
(239,1979,7160023,5177459400),
(239,1980,7408624,6678868200),
(239,1981,7675591,8011373800),
(239,1982,7958241,8539700700),
(239,1983,8254747,7764067000),
(239,1984,8562249,6352125900),
(239,1985,8877489,5637259300),
(239,1986,9200149,6217523700),
(239,1987,9527203,6741215100),
(239,1988,9849125,7814784100),
(239,1989,10153852,8286322700),
(239,1990,10432421,8783816700),
(239,1991,10680995,8641481700),
(239,1992,10900502,6751472200),
(239,1993,11092766,6563813300),
(239,1994,11261744,6890675000),
(239,1995,11410714,7111270700),
(239,1996,11541217,8553146600),
(239,1997,11653242,8529571600),
(239,1998,11747072,6401968200),
(239,1999,11822719,6858013100),
(239,2000,11881477,6689957600),
(239,2001,11923914,6777384700),
(239,2002,11954290,6342116400),
(239,2003,11982224,5727591800),
(239,2004,12019912,5805598400),
(239,2005,12076699,5755215200),
(239,2006,12155491,5443896500),
(239,2007,12255922,5291950100),
(239,2008,12379549,4415702800),
(239,2009,12526968,9665793300),
(239,2010,12697723,12041655200),
(239,2011,12894316,14101920300),
(239,2012,13115131,17114849900),
(239,2013,13350356,19091020000),
(239,2014,13586681,19495519600),
(239,2015,13814629,19963120600),
(239,2016,14030390,20548678100),
(239,2017,14236745,22813010116),
(239,2018,14439018,31000519447);
/*!40000 ALTER TABLE `country_stats` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `guests`
--

DROP TABLE IF EXISTS `guests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `guests` (
  `guest_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`guest_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `guests`
--

LOCK TABLES `guests` WRITE;
/*!40000 ALTER TABLE `guests` DISABLE KEYS */;
INSERT INTO `guests` VALUES
(1,'John'),
(2,'Jane'),
(3,'Jean'),
(4,'Storm'),
(5,'Beast');
/*!40000 ALTER TABLE `guests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `languages`
--

DROP TABLE IF EXISTS `languages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `languages` (
  `language_id` int(11) NOT NULL AUTO_INCREMENT,
  `language` varchar(50) NOT NULL,
  PRIMARY KEY (`language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=458 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `languages`
--

LOCK TABLES `languages` WRITE;
/*!40000 ALTER TABLE `languages` DISABLE KEYS */;
INSERT INTO `languages` VALUES
(1,'Dutch'),
(2,'English'),
(3,'Papiamento'),
(4,'Spanish'),
(5,'Balochi'),
(6,'Dari'),
(7,'Pashto'),
(8,'Turkmenian'),
(9,'Uzbek'),
(10,'Ambo'),
(11,'Chokwe'),
(12,'Kongo'),
(13,'Luchazi'),
(14,'Luimbe-nganguela'),
(15,'Luvale'),
(16,'Mbundu'),
(17,'Nyaneka-nkhumbi'),
(18,'Ovimbundu'),
(19,'Albaniana'),
(20,'Greek'),
(21,'Macedonian'),
(22,'Catalan'),
(23,'French'),
(24,'Portuguese'),
(25,'Arabic'),
(26,'Hindi'),
(27,'Indian Languages'),
(28,'Italian'),
(29,'Armenian'),
(30,'Azerbaijani'),
(31,'Samoan'),
(32,'Tongan'),
(33,'Creole English'),
(34,'Canton Chinese'),
(35,'German'),
(36,'Serbo-Croatian'),
(37,'Vietnamese'),
(38,'Czech'),
(39,'Hungarian'),
(40,'Polish'),
(41,'Romanian'),
(42,'Slovene'),
(43,'Turkish'),
(44,'Lezgian'),
(45,'Russian'),
(46,'Kirundi'),
(47,'Swahili'),
(48,'Adja'),
(49,'Aizo'),
(50,'Bariba'),
(51,'Fon'),
(52,'Ful'),
(53,'Joruba'),
(54,'Somba'),
(55,'Busansi'),
(56,'Dagara'),
(57,'Dyula'),
(58,'Gurma'),
(59,'Mossi'),
(60,'Bengali'),
(61,'Chakma'),
(62,'Garo'),
(63,'Khasi'),
(64,'Marma'),
(65,'Santhali'),
(66,'Tripuri'),
(67,'Bulgariana'),
(68,'Romani'),
(69,'Creole French'),
(70,'Belorussian'),
(71,'Ukrainian'),
(72,'Garifuna'),
(73,'Maya Languages'),
(74,'Aimará'),
(75,'Guaraní'),
(76,'Ketšua'),
(77,'Japanese'),
(78,'Bajan'),
(79,'Chinese'),
(80,'Malay'),
(81,'Malay-English'),
(82,'Asami'),
(83,'Dzongkha'),
(84,'Nepali'),
(85,'Khoekhoe'),
(86,'Ndebele'),
(87,'San'),
(88,'Shona'),
(89,'Tswana'),
(90,'Banda'),
(91,'Gbaya'),
(92,'Mandjia'),
(93,'Mbum'),
(94,'Ngbaka'),
(95,'Sara'),
(96,'Eskimo Languages'),
(97,'Punjabi'),
(98,'Romansh'),
(99,'Araucan'),
(100,'Rapa nui'),
(101,'Dong'),
(102,'Hui'),
(103,'Mantšu'),
(104,'Miao'),
(105,'Mongolian'),
(106,'Puyi'),
(107,'Tibetan'),
(108,'Tujia'),
(109,'Uighur'),
(110,'Yi'),
(111,'Zhuang'),
(112,'Akan'),
(113,'Gur'),
(114,'Kru'),
(115,'Malinke'),
(116,'[South]Mande'),
(117,'Bamileke-bamum'),
(118,'Duala'),
(119,'Fang'),
(120,'Maka'),
(121,'Mandara'),
(122,'Masana'),
(123,'Tikar'),
(124,'Boa'),
(125,'Luba'),
(126,'Mongo'),
(127,'Ngala and Bangi'),
(128,'Rundi'),
(129,'Rwanda'),
(130,'Teke'),
(131,'Zande'),
(132,'Mbete'),
(133,'Mboshi'),
(134,'Punu'),
(135,'Sango'),
(136,'Maori'),
(137,'Arawakan'),
(138,'Caribbean'),
(139,'Chibcha'),
(140,'Comorian'),
(141,'Comorian-Arabic'),
(142,'Comorian-French'),
(143,'Comorian-madagassi'),
(144,'Comorian-Swahili'),
(145,'Crioulo'),
(146,'Moravian'),
(147,'Silesiana'),
(148,'Slovak'),
(149,'Southern Slavic Languages'),
(150,'Afar'),
(151,'Somali'),
(152,'Danish'),
(153,'Norwegian'),
(154,'Swedish'),
(155,'Berberi'),
(156,'Sinaberberi'),
(157,'Bilin'),
(158,'Hadareb'),
(159,'Saho'),
(160,'Tigre'),
(161,'Tigrinja'),
(162,'Basque'),
(163,'Galecian'),
(164,'Estonian'),
(165,'Finnish'),
(166,'Amhara'),
(167,'Gurage'),
(168,'Oromo'),
(169,'Sidamo'),
(170,'Walaita'),
(171,'Saame'),
(172,'Fijian'),
(173,'Faroese'),
(174,'Kosrean'),
(175,'Mortlock'),
(176,'Pohnpei'),
(177,'Trukese'),
(178,'Wolea'),
(179,'Yap'),
(180,'Mpongwe'),
(181,'Punu-sira-nzebi'),
(182,'Gaeli'),
(183,'Kymri'),
(184,'Abhyasi'),
(185,'Georgiana'),
(186,'Osseetti'),
(187,'Ewe'),
(188,'Ga-adangme'),
(189,'Kissi'),
(190,'Kpelle'),
(191,'Loma'),
(192,'Susu'),
(193,'Yalunka'),
(194,'Diola'),
(195,'Soninke'),
(196,'Wolof'),
(197,'Balante'),
(198,'Mandyako'),
(199,'Bubi'),
(200,'Greenlandic'),
(201,'Cakchiquel'),
(202,'Kekchí'),
(203,'Mam'),
(204,'Quiché'),
(205,'Chamorro'),
(206,'Korean'),
(207,'Philippene Languages'),
(208,'Chiu chau'),
(209,'Fukien'),
(210,'Hakka'),
(211,'Miskito'),
(212,'Haiti Creole'),
(213,'Bali'),
(214,'Banja'),
(215,'Batakki'),
(216,'Bugi'),
(217,'Javanese'),
(218,'Madura'),
(219,'Minangkabau'),
(220,'Sunda'),
(221,'Gujarati'),
(222,'Kannada'),
(223,'Malajalam'),
(224,'Marathi'),
(225,'Orija'),
(226,'Tamil'),
(227,'Telugu'),
(228,'Urdu'),
(229,'Irish'),
(230,'Bakhtyari'),
(231,'Gilaki'),
(232,'Kurdish'),
(233,'Luri'),
(234,'Mazandarani'),
(235,'Persian'),
(236,'Assyrian'),
(237,'Icelandic'),
(238,'Hebrew'),
(239,'Friuli'),
(240,'Sardinian'),
(241,'Circassian'),
(242,'Ainu'),
(243,'Kazakh'),
(244,'Tatar'),
(245,'Gusii'),
(246,'Kalenjin'),
(247,'Kamba'),
(248,'Kikuyu'),
(249,'Luhya'),
(250,'Luo'),
(251,'Masai'),
(252,'Meru'),
(253,'Nyika'),
(254,'Turkana'),
(255,'Kirgiz'),
(256,'Tadzhik'),
(257,'Khmer'),
(258,'Tšam'),
(259,'Kiribati'),
(260,'Tuvalu'),
(261,'Lao'),
(262,'Lao-Soung'),
(263,'Mon-khmer'),
(264,'Thai'),
(265,'Bassa'),
(266,'Gio'),
(267,'Grebo'),
(268,'Mano'),
(269,'Mixed Languages'),
(270,'Singali'),
(271,'Sotho'),
(272,'Zulu'),
(273,'Lithuanian'),
(274,'Luxembourgish'),
(275,'Latvian'),
(276,'Mandarin Chinese'),
(277,'Monegasque'),
(278,'Gagauzi'),
(279,'Malagasy'),
(280,'Dhivehi'),
(281,'Mixtec'),
(282,'Náhuatl'),
(283,'Otomí'),
(284,'Yucatec'),
(285,'Zapotec'),
(286,'Marshallese'),
(287,'Bambara'),
(288,'Senufo and Minianka'),
(289,'Songhai'),
(290,'Tamashek'),
(291,'Maltese'),
(292,'Burmese'),
(293,'Chin'),
(294,'Kachin'),
(295,'Karen'),
(296,'Kayah'),
(297,'Mon'),
(298,'Rakhine'),
(299,'Shan'),
(300,'Bajad'),
(301,'Buryat'),
(302,'Dariganga'),
(303,'Dorbet'),
(304,'Carolinian'),
(305,'Chuabo'),
(306,'Lomwe'),
(307,'Makua'),
(308,'Marendje'),
(309,'Nyanja'),
(310,'Ronga'),
(311,'Sena'),
(312,'Tsonga'),
(313,'Tswa'),
(314,'Hassaniya'),
(315,'Tukulor'),
(316,'Zenaga'),
(317,'Bhojpuri'),
(318,'Chichewa'),
(319,'Ngoni'),
(320,'Yao'),
(321,'Dusun'),
(322,'Iban'),
(323,'Mahoré'),
(324,'Afrikaans'),
(325,'Caprivi'),
(326,'Herero'),
(327,'Kavango'),
(328,'Nama'),
(329,'Ovambo'),
(330,'Malenasian Languages'),
(331,'Polynesian Languages'),
(332,'Hausa'),
(333,'Kanuri'),
(334,'Songhai-zerma'),
(335,'Bura'),
(336,'Edo'),
(337,'Ibibio'),
(338,'Ibo'),
(339,'Ijo'),
(340,'Tiv'),
(341,'Sumo'),
(342,'Niue'),
(343,'Fries'),
(344,'Maithili'),
(345,'Newari'),
(346,'Tamang'),
(347,'Tharu'),
(348,'Nauru'),
(349,'Brahui'),
(350,'Hindko'),
(351,'Saraiki'),
(352,'Sindhi'),
(353,'Cuna'),
(354,'Embera'),
(355,'Guaymí'),
(356,'Pitcairnese'),
(357,'Bicol'),
(358,'Cebuano'),
(359,'Hiligaynon'),
(360,'Ilocano'),
(361,'Maguindanao'),
(362,'Maranao'),
(363,'Pampango'),
(364,'Pangasinan'),
(365,'Pilipino'),
(366,'Waray-waray'),
(367,'Palau'),
(368,'Papuan Languages'),
(369,'Tahitian'),
(370,'Avarian'),
(371,'Bashkir'),
(372,'Chechen'),
(373,'Chuvash'),
(374,'Mari'),
(375,'Mordva'),
(376,'Udmur'),
(377,'Bari'),
(378,'Beja'),
(379,'Chilluk'),
(380,'Dinka'),
(381,'Fur'),
(382,'Lotuko'),
(383,'Nubian Languages'),
(384,'Nuer'),
(385,'Serer'),
(386,'Bullom-sherbro'),
(387,'Kono-vai'),
(388,'Kuranko'),
(389,'Limba'),
(390,'Mende'),
(391,'Temne'),
(392,'Nahua'),
(393,'Sranantonga'),
(394,'Czech and Moravian'),
(395,'Ukrainian and Russian'),
(396,'Swazi'),
(397,'Seselwa'),
(398,'Gorane'),
(399,'Hadjarai'),
(400,'Kanem-bornu'),
(401,'Mayo-kebbi'),
(402,'Ouaddai'),
(403,'Tandjile'),
(404,'Ane'),
(405,'Kabyé'),
(406,'Kotokoli'),
(407,'Moba'),
(408,'Naudemba'),
(409,'Watyi'),
(410,'Kuy'),
(411,'Tokelau'),
(412,'Arabic-French'),
(413,'Arabic-French-English'),
(414,'Ami'),
(415,'Atayal'),
(416,'Min'),
(417,'Paiwan'),
(418,'Chaga and Pare'),
(419,'Gogo'),
(420,'Ha'),
(421,'Haya'),
(422,'Hehet'),
(423,'Luguru'),
(424,'Makonde'),
(425,'Nyakusa'),
(426,'Nyamwesi'),
(427,'Shambala'),
(428,'Acholi'),
(429,'Ganda'),
(430,'Gisu'),
(431,'Kiga'),
(432,'Lango'),
(433,'Lugbara'),
(434,'Nkole'),
(435,'Soga'),
(436,'Teso'),
(437,'Tagalog'),
(438,'Karakalpak'),
(439,'Goajiro'),
(440,'Warrau'),
(441,'Man'),
(442,'Muong'),
(443,'Nung'),
(444,'Tho'),
(445,'Bislama'),
(446,'Futuna'),
(447,'Wallis'),
(448,'Samoan-English'),
(449,'Soqutri'),
(450,'Northsotho'),
(451,'Southsotho'),
(452,'Venda'),
(453,'Xhosa'),
(454,'Bemba'),
(455,'Chewa'),
(456,'Lozi'),
(457,'Nsenga');
/*!40000 ALTER TABLE `languages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `region_areas`
--

DROP TABLE IF EXISTS `region_areas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `region_areas` (
  `region_name` varchar(100) NOT NULL,
  `region_area` decimal(15,2) NOT NULL,
  PRIMARY KEY (`region_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `region_areas`
--

LOCK TABLES `region_areas` WRITE;
/*!40000 ALTER TABLE `region_areas` DISABLE KEYS */;
INSERT INTO `region_areas` VALUES
('Antarctica',13132101.00),
('Australia and New Zealand',8011939.00),
('Baltic Countries',175117.00),
('British Islands',313173.00),
('Caribbean',234423.00),
('Central Africa',6612667.00),
('Central America',2479532.00),
('Eastern Africa',6299891.00),
('Eastern Asia',11774482.00),
('Eastern Europe',18814094.00),
('Melanesia',540774.00),
('Micronesia',3102.00),
('Micronesia/Caribbean',16.00),
('Middle East',4820592.00),
('Nordic Countries',1321901.00),
('North America',21500515.00),
('Northern Africa',8524703.00),
('Polynesia',8463.00),
('South America',17864926.00),
('Southeast Asia',4494801.00),
('Southern Africa',2674778.00),
('Southern and Central Asia',10791130.00),
('Southern Europe',1316392.40),
('Western Africa',6138338.00),
('Western Europe',1108456.50);
/*!40000 ALTER TABLE `region_areas` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `regions`
--

DROP TABLE IF EXISTS `regions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `regions` (
  `region_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `continent_id` int(11) NOT NULL,
  PRIMARY KEY (`region_id`),
  KEY `continent_id` (`continent_id`),
  CONSTRAINT `regions_ibfk_1` FOREIGN KEY (`continent_id`) REFERENCES `continents` (`continent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `regions`
--

LOCK TABLES `regions` WRITE;
/*!40000 ALTER TABLE `regions` DISABLE KEYS */;
INSERT INTO `regions` VALUES
(1,'Caribbean',1),
(2,'Southern and Central Asia',2),
(3,'Central Africa',3),
(4,'Southern Europe',4),
(5,'Middle East',2),
(6,'South America',5),
(7,'Polynesia',6),
(8,'Antarctica',7),
(9,'Australia and New Zealand',6),
(10,'Western Europe',4),
(11,'Eastern Africa',3),
(12,'Western Africa',3),
(13,'Eastern Europe',4),
(14,'Central America',1),
(15,'North America',1),
(16,'Southeast Asia',2),
(17,'Southern Africa',3),
(18,'Eastern Asia',2),
(19,'Nordic Countries',4),
(20,'Northern Africa',3),
(21,'Baltic Countries',4),
(22,'Melanesia',6),
(23,'Micronesia',6),
(24,'British Islands',4),
(25,'Micronesia/Caribbean',6);
/*!40000 ALTER TABLE `regions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vips`
--

DROP TABLE IF EXISTS `vips`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `vips` (
  `vip_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`vip_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vips`
--

LOCK TABLES `vips` WRITE;
/*!40000 ALTER TABLE `vips` DISABLE KEYS */;
INSERT INTO `vips` VALUES
(1,'Jane'),
(2,'Charles'),
(3,'John'),
(4,'Wolverine'),
(5,'Rogue');
/*!40000 ALTER TABLE `vips` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `onlineshopXY`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `onlineshopXY` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `onlineshopXY`;

--
-- Table structure for table `sortiment`
--

DROP TABLE IF EXISTS `sortiment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `sortiment` (
  `sortiment_id` int(11) NOT NULL AUTO_INCREMENT,
  `sortiment_produkttyp` varchar(30) NOT NULL,
  `sortiment_preis` decimal(5,2) NOT NULL,
  `sortiment_anzahl` int(11) DEFAULT NULL,
  `sortiment_versandkosten` decimal(5,2) DEFAULT NULL,
  PRIMARY KEY (`sortiment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sortiment`
--

LOCK TABLES `sortiment` WRITE;
/*!40000 ALTER TABLE `sortiment` DISABLE KEYS */;
/*!40000 ALTER TABLE `sortiment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `phpmyadmin`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phpmyadmin` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `phpmyadmin`;

--
-- Table structure for table `pma__bookmark`
--

DROP TABLE IF EXISTS `pma__bookmark`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__bookmark` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dbase` varchar(255) NOT NULL DEFAULT '',
  `user` varchar(255) NOT NULL DEFAULT '',
  `label` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `query` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Bookmarks';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__bookmark`
--

LOCK TABLES `pma__bookmark` WRITE;
/*!40000 ALTER TABLE `pma__bookmark` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__bookmark` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__central_columns`
--

DROP TABLE IF EXISTS `pma__central_columns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__central_columns` (
  `db_name` varchar(64) NOT NULL,
  `col_name` varchar(64) NOT NULL,
  `col_type` varchar(64) NOT NULL,
  `col_length` text DEFAULT NULL,
  `col_collation` varchar(64) NOT NULL,
  `col_isNull` tinyint(1) NOT NULL,
  `col_extra` varchar(255) DEFAULT '',
  `col_default` text DEFAULT NULL,
  PRIMARY KEY (`db_name`,`col_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Central list of columns';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__central_columns`
--

LOCK TABLES `pma__central_columns` WRITE;
/*!40000 ALTER TABLE `pma__central_columns` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__central_columns` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__column_info`
--

DROP TABLE IF EXISTS `pma__column_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__column_info` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `db_name` varchar(64) NOT NULL DEFAULT '',
  `table_name` varchar(64) NOT NULL DEFAULT '',
  `column_name` varchar(64) NOT NULL DEFAULT '',
  `comment` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `mimetype` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `transformation` varchar(255) NOT NULL DEFAULT '',
  `transformation_options` varchar(255) NOT NULL DEFAULT '',
  `input_transformation` varchar(255) NOT NULL DEFAULT '',
  `input_transformation_options` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Column information for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__column_info`
--

LOCK TABLES `pma__column_info` WRITE;
/*!40000 ALTER TABLE `pma__column_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__column_info` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__designer_settings`
--

DROP TABLE IF EXISTS `pma__designer_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__designer_settings` (
  `username` varchar(64) NOT NULL,
  `settings_data` text NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Settings related to Designer';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__designer_settings`
--

LOCK TABLES `pma__designer_settings` WRITE;
/*!40000 ALTER TABLE `pma__designer_settings` DISABLE KEYS */;
INSERT INTO `pma__designer_settings` VALUES
('root','{\"angular_direct\":\"direct\",\"relation_lines\":\"true\",\"snap_to_grid\":\"off\"}');
/*!40000 ALTER TABLE `pma__designer_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__export_templates`
--

DROP TABLE IF EXISTS `pma__export_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__export_templates` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) NOT NULL,
  `export_type` varchar(10) NOT NULL,
  `template_name` varchar(64) NOT NULL,
  `template_data` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `u_user_type_template` (`username`,`export_type`,`template_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Saved export templates';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__export_templates`
--

LOCK TABLES `pma__export_templates` WRITE;
/*!40000 ALTER TABLE `pma__export_templates` DISABLE KEYS */;
INSERT INTO `pma__export_templates` VALUES
(1,'root','database','meine','{\"quick_or_custom\":\"quick\",\"what\":\"sql\",\"structure_or_data_forced\":\"0\",\"table_select[]\":[\"antworten\",\"fragen\",\"mitglieder\"],\"table_structure[]\":[\"antworten\",\"fragen\",\"mitglieder\"],\"table_data[]\":[\"antworten\",\"fragen\",\"mitglieder\"],\"aliases_new\":\"\",\"output_format\":\"sendit\",\"filename_template\":\"@DATABASE@\",\"remember_template\":\"on\",\"charset\":\"utf-8\",\"compression\":\"none\",\"maxsize\":\"\",\"codegen_structure_or_data\":\"data\",\"codegen_format\":\"0\",\"csv_separator\":\",\",\"csv_enclosed\":\"\\\"\",\"csv_escaped\":\"\\\"\",\"csv_terminated\":\"AUTO\",\"csv_null\":\"NULL\",\"csv_columns\":\"something\",\"csv_structure_or_data\":\"data\",\"excel_null\":\"NULL\",\"excel_columns\":\"something\",\"excel_edition\":\"win\",\"excel_structure_or_data\":\"data\",\"json_structure_or_data\":\"data\",\"json_unicode\":\"something\",\"latex_caption\":\"something\",\"latex_structure_or_data\":\"structure_and_data\",\"latex_structure_caption\":\"Struktur der Tabelle @TABLE@\",\"latex_structure_continued_caption\":\"Struktur der Tabelle @TABLE@ (Fortsetzung)\",\"latex_structure_label\":\"tab:@TABLE@-structure\",\"latex_relation\":\"something\",\"latex_comments\":\"something\",\"latex_mime\":\"something\",\"latex_columns\":\"something\",\"latex_data_caption\":\"Inhalt der Tabelle @TABLE@\",\"latex_data_continued_caption\":\"Inhalt der Tabelle @TABLE@ (Fortsetzung)\",\"latex_data_label\":\"tab:@TABLE@-data\",\"latex_null\":\"\\\\textit{NULL}\",\"mediawiki_structure_or_data\":\"structure_and_data\",\"mediawiki_caption\":\"something\",\"mediawiki_headers\":\"something\",\"htmlword_structure_or_data\":\"structure_and_data\",\"htmlword_null\":\"NULL\",\"ods_null\":\"NULL\",\"ods_structure_or_data\":\"data\",\"odt_structure_or_data\":\"structure_and_data\",\"odt_relation\":\"something\",\"odt_comments\":\"something\",\"odt_mime\":\"something\",\"odt_columns\":\"something\",\"odt_null\":\"NULL\",\"pdf_report_title\":\"\",\"pdf_structure_or_data\":\"structure_and_data\",\"phparray_structure_or_data\":\"data\",\"sql_include_comments\":\"something\",\"sql_header_comment\":\"\",\"sql_use_transaction\":\"something\",\"sql_compatibility\":\"NONE\",\"sql_structure_or_data\":\"structure_and_data\",\"sql_create_table\":\"something\",\"sql_auto_increment\":\"something\",\"sql_create_view\":\"something\",\"sql_procedure_function\":\"something\",\"sql_create_trigger\":\"something\",\"sql_backquotes\":\"something\",\"sql_type\":\"INSERT\",\"sql_insert_syntax\":\"both\",\"sql_max_query_size\":\"50000\",\"sql_hex_for_binary\":\"something\",\"sql_utc_time\":\"something\",\"texytext_structure_or_data\":\"structure_and_data\",\"texytext_null\":\"NULL\",\"xml_structure_or_data\":\"data\",\"xml_export_events\":\"something\",\"xml_export_functions\":\"something\",\"xml_export_procedures\":\"something\",\"xml_export_tables\":\"something\",\"xml_export_triggers\":\"something\",\"xml_export_views\":\"something\",\"xml_export_contents\":\"something\",\"yaml_structure_or_data\":\"data\",\"\":null,\"lock_tables\":null,\"as_separate_files\":null,\"csv_removeCRLF\":null,\"excel_removeCRLF\":null,\"json_pretty_print\":null,\"htmlword_columns\":null,\"ods_columns\":null,\"sql_dates\":null,\"sql_relation\":null,\"sql_mime\":null,\"sql_disable_fk\":null,\"sql_views_as_tables\":null,\"sql_metadata\":null,\"sql_create_database\":null,\"sql_drop_table\":null,\"sql_if_not_exists\":null,\"sql_simple_view_export\":null,\"sql_view_current_user\":null,\"sql_or_replace_view\":null,\"sql_truncate\":null,\"sql_delayed\":null,\"sql_ignore\":null,\"texytext_columns\":null}');
/*!40000 ALTER TABLE `pma__export_templates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__favorite`
--

DROP TABLE IF EXISTS `pma__favorite`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__favorite` (
  `username` varchar(64) NOT NULL,
  `tables` text NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Favorite tables';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__favorite`
--

LOCK TABLES `pma__favorite` WRITE;
/*!40000 ALTER TABLE `pma__favorite` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__favorite` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__history`
--

DROP TABLE IF EXISTS `pma__history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__history` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) NOT NULL DEFAULT '',
  `db` varchar(64) NOT NULL DEFAULT '',
  `table` varchar(64) NOT NULL DEFAULT '',
  `timevalue` timestamp NOT NULL DEFAULT current_timestamp(),
  `sqlquery` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `username` (`username`,`db`,`table`,`timevalue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='SQL history for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__history`
--

LOCK TABLES `pma__history` WRITE;
/*!40000 ALTER TABLE `pma__history` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__history` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__navigationhiding`
--

DROP TABLE IF EXISTS `pma__navigationhiding`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__navigationhiding` (
  `username` varchar(64) NOT NULL,
  `item_name` varchar(64) NOT NULL,
  `item_type` varchar(64) NOT NULL,
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Hidden items of navigation tree';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__navigationhiding`
--

LOCK TABLES `pma__navigationhiding` WRITE;
/*!40000 ALTER TABLE `pma__navigationhiding` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__navigationhiding` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__pdf_pages`
--

DROP TABLE IF EXISTS `pma__pdf_pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__pdf_pages` (
  `db_name` varchar(64) NOT NULL DEFAULT '',
  `page_nr` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `page_descr` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`page_nr`),
  KEY `db_name` (`db_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='PDF relation pages for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__pdf_pages`
--

LOCK TABLES `pma__pdf_pages` WRITE;
/*!40000 ALTER TABLE `pma__pdf_pages` DISABLE KEYS */;
INSERT INTO `pma__pdf_pages` VALUES
('bestelldatenbank',1,'1');
/*!40000 ALTER TABLE `pma__pdf_pages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__recent`
--

DROP TABLE IF EXISTS `pma__recent`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__recent` (
  `username` varchar(64) NOT NULL,
  `tables` text NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Recently accessed tables';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__recent`
--

LOCK TABLES `pma__recent` WRITE;
/*!40000 ALTER TABLE `pma__recent` DISABLE KEYS */;
INSERT INTO `pma__recent` VALUES
('root','[{\"db\":\"sozialesnetzwerk\",\"table\":\"mitglieder\"},{\"db\":\"sozialesnetzwerk\",\"table\":\"fragen\"},{\"db\":\"sozialesnetzwerk\",\"table\":\"antworten\"},{\"db\":\"test\",\"table\":\"test\"},{\"db\":\"kursverwaltung\",\"table\":\"teilnehmer\"},{\"db\":\"kursverwaltung\",\"table\":\"kurs\"},{\"db\":\"kursverwaltung\",\"table\":\"buchung\"},{\"db\":\"bestelldatenbank\",\"table\":\"artikel\"},{\"db\":\"bestelldatenbank\",\"table\":\"positionen\"},{\"db\":\"kverwaltung\",\"table\":\"buchung\"}]');
/*!40000 ALTER TABLE `pma__recent` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__relation`
--

DROP TABLE IF EXISTS `pma__relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__relation` (
  `master_db` varchar(64) NOT NULL DEFAULT '',
  `master_table` varchar(64) NOT NULL DEFAULT '',
  `master_field` varchar(64) NOT NULL DEFAULT '',
  `foreign_db` varchar(64) NOT NULL DEFAULT '',
  `foreign_table` varchar(64) NOT NULL DEFAULT '',
  `foreign_field` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`master_db`,`master_table`,`master_field`),
  KEY `foreign_field` (`foreign_db`,`foreign_table`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Relation table';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__relation`
--

LOCK TABLES `pma__relation` WRITE;
/*!40000 ALTER TABLE `pma__relation` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__relation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__savedsearches`
--

DROP TABLE IF EXISTS `pma__savedsearches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__savedsearches` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) NOT NULL DEFAULT '',
  `db_name` varchar(64) NOT NULL DEFAULT '',
  `search_name` varchar(64) NOT NULL DEFAULT '',
  `search_data` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Saved searches';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__savedsearches`
--

LOCK TABLES `pma__savedsearches` WRITE;
/*!40000 ALTER TABLE `pma__savedsearches` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__savedsearches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__table_coords`
--

DROP TABLE IF EXISTS `pma__table_coords`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__table_coords` (
  `db_name` varchar(64) NOT NULL DEFAULT '',
  `table_name` varchar(64) NOT NULL DEFAULT '',
  `pdf_page_number` int(11) NOT NULL DEFAULT 0,
  `x` float unsigned NOT NULL DEFAULT 0,
  `y` float unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Table coordinates for phpMyAdmin PDF output';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__table_coords`
--

LOCK TABLES `pma__table_coords` WRITE;
/*!40000 ALTER TABLE `pma__table_coords` DISABLE KEYS */;
INSERT INTO `pma__table_coords` VALUES
('bestelldatenbank','artikel',1,772,333),
('bestelldatenbank','bestellungen',1,169,95),
('bestelldatenbank','gruppen',1,553,546),
('bestelldatenbank','kunden',1,165,302),
('bestelldatenbank','positionen',1,763,112);
/*!40000 ALTER TABLE `pma__table_coords` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__table_info`
--

DROP TABLE IF EXISTS `pma__table_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__table_info` (
  `db_name` varchar(64) NOT NULL DEFAULT '',
  `table_name` varchar(64) NOT NULL DEFAULT '',
  `display_field` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Table information for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__table_info`
--

LOCK TABLES `pma__table_info` WRITE;
/*!40000 ALTER TABLE `pma__table_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__table_info` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__table_uiprefs`
--

DROP TABLE IF EXISTS `pma__table_uiprefs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__table_uiprefs` (
  `username` varchar(64) NOT NULL,
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `prefs` text NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`username`,`db_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Tables'' UI preferences';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__table_uiprefs`
--

LOCK TABLES `pma__table_uiprefs` WRITE;
/*!40000 ALTER TABLE `pma__table_uiprefs` DISABLE KEYS */;
INSERT INTO `pma__table_uiprefs` VALUES
('root','kursverwaltung','teilnehmer','{\"sorted_col\":\"`tnummer` ASC\"}','2025-10-18 10:28:31'),
('root','nation','countries','{\"sorted_col\":\"`countries`.`country_id` ASC\"}','2025-12-23 09:40:31'),
('root','nation','regions','{\"sorted_col\":\"`regions`.`continent_id` ASC\"}','2025-12-23 09:09:34');
/*!40000 ALTER TABLE `pma__table_uiprefs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__tracking`
--

DROP TABLE IF EXISTS `pma__tracking`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__tracking` (
  `db_name` varchar(64) NOT NULL,
  `table_name` varchar(64) NOT NULL,
  `version` int(10) unsigned NOT NULL,
  `date_created` datetime NOT NULL,
  `date_updated` datetime NOT NULL,
  `schema_snapshot` text NOT NULL,
  `schema_sql` text DEFAULT NULL,
  `data_sql` longtext DEFAULT NULL,
  `tracking` set('UPDATE','REPLACE','INSERT','DELETE','TRUNCATE','CREATE DATABASE','ALTER DATABASE','DROP DATABASE','CREATE TABLE','ALTER TABLE','RENAME TABLE','DROP TABLE','CREATE INDEX','DROP INDEX','CREATE VIEW','ALTER VIEW','DROP VIEW') DEFAULT NULL,
  `tracking_active` int(1) unsigned NOT NULL DEFAULT 1,
  PRIMARY KEY (`db_name`,`table_name`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Database changes tracking for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__tracking`
--

LOCK TABLES `pma__tracking` WRITE;
/*!40000 ALTER TABLE `pma__tracking` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__tracking` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__userconfig`
--

DROP TABLE IF EXISTS `pma__userconfig`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__userconfig` (
  `username` varchar(64) NOT NULL,
  `timevalue` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `config_data` text NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='User preferences storage for phpMyAdmin';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__userconfig`
--

LOCK TABLES `pma__userconfig` WRITE;
/*!40000 ALTER TABLE `pma__userconfig` DISABLE KEYS */;
INSERT INTO `pma__userconfig` VALUES
('root','2026-04-27 08:17:01','{\"Console\\/Mode\":\"collapse\",\"lang\":\"de\"}');
/*!40000 ALTER TABLE `pma__userconfig` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__usergroups`
--

DROP TABLE IF EXISTS `pma__usergroups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__usergroups` (
  `usergroup` varchar(64) NOT NULL,
  `tab` varchar(64) NOT NULL,
  `allowed` enum('Y','N') NOT NULL DEFAULT 'N',
  PRIMARY KEY (`usergroup`,`tab`,`allowed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='User groups with configured menu items';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__usergroups`
--

LOCK TABLES `pma__usergroups` WRITE;
/*!40000 ALTER TABLE `pma__usergroups` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__usergroups` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pma__users`
--

DROP TABLE IF EXISTS `pma__users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pma__users` (
  `username` varchar(64) NOT NULL,
  `usergroup` varchar(64) NOT NULL,
  PRIMARY KEY (`username`,`usergroup`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='Users and their assignments to user groups';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pma__users`
--

LOCK TABLES `pma__users` WRITE;
/*!40000 ALTER TABLE `pma__users` DISABLE KEYS */;
/*!40000 ALTER TABLE `pma__users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `sozialesnetzwerk`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sozialesnetzwerk` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `sozialesnetzwerk`;

--
-- Table structure for table `antworten`
--

DROP TABLE IF EXISTS `antworten`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `antworten` (
  `id_antwort` int(11) NOT NULL AUTO_INCREMENT,
  `id_fragesteller` int(11) NOT NULL,
  `id_antwortgeber` int(11) NOT NULL,
  `id_frage` int(11) NOT NULL,
  `antwort` longtext NOT NULL,
  PRIMARY KEY (`id_antwort`),
  UNIQUE KEY `id_antwort` (`id_antwort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `antworten`
--

LOCK TABLES `antworten` WRITE;
/*!40000 ALTER TABLE `antworten` DISABLE KEYS */;
/*!40000 ALTER TABLE `antworten` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `fragen`
--

DROP TABLE IF EXISTS `fragen`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `fragen` (
  `id_frage` int(11) NOT NULL AUTO_INCREMENT,
  `bild` varchar(30) NOT NULL,
  `zusatzinfos` longtext NOT NULL,
  `id_mitglied` int(11) NOT NULL,
  PRIMARY KEY (`id_frage`),
  UNIQUE KEY `id_frage` (`id_frage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `fragen`
--

LOCK TABLES `fragen` WRITE;
/*!40000 ALTER TABLE `fragen` DISABLE KEYS */;
/*!40000 ALTER TABLE `fragen` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `mitglieder`
--

DROP TABLE IF EXISTS `mitglieder`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `mitglieder` (
  `id_mitglied` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Die ID, die als eindeutiger Schlüssel jedes Datensatz dient.',
  `name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `vorname` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `email` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `fragen` int(11) DEFAULT NULL COMMENT 'Anzahl der gestellten Fragen',
  `antworten` int(11) DEFAULT NULL COMMENT 'Anzahl der gegebenen Antworten',
  `zusatzinfos` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Optionale Informationen',
  `rolle` enum('Admin','Mitglied') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Informationen, welche Rolle das Mitglied in dem Netzwerk führt. Admin ist 0 und Mitglied 1.',
  `userid` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `pw` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL COMMENT 'Das Password, das MD5-verschlüsselt gespeichert werden soll.',
  `beitritt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Zeitpunkt der Anmeldung',
  `letzterlogin` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Zeitpunkt des letzten logins.',
  PRIMARY KEY (`id_mitglied`),
  UNIQUE KEY `userid` (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `mitglieder`
--

LOCK TABLES `mitglieder` WRITE;
/*!40000 ALTER TABLE `mitglieder` DISABLE KEYS */;
INSERT INTO `mitglieder` VALUES
(18,'Muenzer','Christopher','christopher@cemunz.de',NULL,NULL,'              ','Mitglied','Cemunz20','820466a89565d6288970a0a2d763c223','2026-04-27 08:48:41','2026-04-27 08:48:41');
/*!40000 ALTER TABLE `mitglieder` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `test`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `test`;

--
-- Table structure for table `test`
--

DROP TABLE IF EXISTS `test`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `test` (
  `Anrede` enum('Frau','Herr','Firma') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `test`
--

LOCK TABLES `test` WRITE;
/*!40000 ALTER TABLE `test` DISABLE KEYS */;
INSERT INTO `test` VALUES
('Frau'),
('Firma'),
('Herr');
/*!40000 ALTER TABLE `test` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Current Database: `bestelldatenbank`
--

USE `bestelldatenbank`;

--
-- Current Database: `dummydb`
--

USE `dummydb`;

--
-- Current Database: `kursverwaltung`
--

USE `kursverwaltung`;

--
-- Current Database: `kverwaltung`
--

USE `kverwaltung`;

--
-- Current Database: `mysql`
--

USE `mysql`;

--
-- Final view structure for view `user`
--

/*!50001 DROP VIEW IF EXISTS `user`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8mb4 */;
/*!50001 SET character_set_results     = utf8mb4 */;
/*!50001 SET collation_connection      = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Current Database: `nation`
--

USE `nation`;

--
-- Current Database: `onlineshopXY`
--

USE `onlineshopXY`;

--
-- Current Database: `phpmyadmin`
--

USE `phpmyadmin`;

--
-- Current Database: `sozialesnetzwerk`
--

USE `sozialesnetzwerk`;

--
-- Current Database: `test`
--

USE `test`;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-04-27  9:10:52
