diff --git a/m10_class/__pycache__/account2_str.cpython-36.pyc b/m10_class/__pycache__/account2_str.cpython-36.pyc new file mode 100644 index 0000000..62a5291 Binary files /dev/null and b/m10_class/__pycache__/account2_str.cpython-36.pyc differ diff --git a/m10_class/__pycache__/checkingaccount.cpython-36.pyc b/m10_class/__pycache__/checkingaccount.cpython-36.pyc new file mode 100644 index 0000000..b667516 Binary files /dev/null and b/m10_class/__pycache__/checkingaccount.cpython-36.pyc differ diff --git a/m10_class/account.py b/m10_class/account.py new file mode 100644 index 0000000..94828eb --- /dev/null +++ b/m10_class/account.py @@ -0,0 +1,55 @@ +class Account: + pass +def deposit (acc,amount): + try : + if amount <= 0: + raise ValueError + acc.balance += amount + except ValueError: + print('金額需是正整數') + +def withdraw(acc,amount): + try: + if amount <= acc.balance: + acc.balance -= amount + else : + raise ValueError + except ValueError: + print('餘額不足') + +def main(): + acc = Account() + acc.balance = 0 + acc.number = '123456789' + acc.name = 'Tom' + + print(acc.number) + print(acc.balance) + + amount = eval(input('存入金額 : ')) + deposit(acc,amount) + print(acc.balance) + amount = eval(input('領出金額 : ')) + withdraw(acc,amount) + print(acc.balance) + + acc1 = Account() + acc1.balance = 0 + acc1.number = '123456777' + acc1.name = 'Tina' + + print(acc1.number) + print(acc1.balance) + + amount = eval(input('存入金額 : ')) + deposit(acc1, amount) + print(acc1.balance) + amount = eval(input('領出金額 : ')) + withdraw(acc1, amount) + print(acc1.balance) +# 變數名稱必須不同,才能保留之前的資料 + +main() + + + diff --git a/m10_class/account2.py b/m10_class/account2.py new file mode 100644 index 0000000..3efc65c --- /dev/null +++ b/m10_class/account2.py @@ -0,0 +1,52 @@ +class Account: + def __init__(self,number,name): + self.number = number + self.name = name + self.balance = 0 + + def deposit (self,amount): + try : + if amount <= 0: + raise ValueError + self.balance += amount + except ValueError: + print('金額需是正整數') + + def withdraw(self,amount): + try: + if amount <= self.balance: + self.balance -= amount + else : + raise ValueError + except ValueError: + print('餘額不足') + +def main(): + acc = Account('123456789','Tom') + print(acc.number) + print(acc.balance) + + amount = eval(input('存入金額 : ')) + acc.deposit(amount) + print(acc.balance) + amount = eval(input('領出金額 : ')) + acc.withdraw(amount) + print(acc.balance) + + acc1 = Account('123456777','Tina') + print(acc1.number) + print(acc1.balance) + + amount = eval(input('存入金額 : ')) + acc1.deposit(amount) + print(acc1.balance) + amount = eval(input('領出金額 : ')) + acc1.withdraw(amount) + print(acc1.balance) + # 變數名稱必須不同,才能保留之前的資料 +main() + + + + + diff --git a/m10_class/account2_str.py b/m10_class/account2_str.py new file mode 100644 index 0000000..7f47ac1 --- /dev/null +++ b/m10_class/account2_str.py @@ -0,0 +1,38 @@ +class Account: + def __init__(self,number,name,balance = 0): + self.number = number + self.name = name + self.balance = balance + + + def deposit (self,amount): + try : + if amount <= 0: + raise ValueError + self.balance += amount + except ValueError: + print('金額需是正整數') + + def withdraw(self,amount): + try: + if amount <= self.balance: + self.balance -= amount + else : + raise ValueError + except ValueError: + print('餘額不足') + + def __str__(self): + return ('number:{0} \nname:{1} \nbalance:{2}'.format(self.number,self.name,self.balance)) + +def main(): + acc = Account('123456789','Tom',5000) + print(acc) + print(acc.balance) + + + + + + + diff --git a/m10_class/accountmain.py b/m10_class/accountmain.py new file mode 100644 index 0000000..0460e93 --- /dev/null +++ b/m10_class/accountmain.py @@ -0,0 +1,18 @@ +from m10_class.account2_str import Account +from m10_class.checkingaccount import checkingaccount +def main(): + acc = Account('123456789','Tom',5000) + acc.deposit(500) + acc.withdraw(800) + print(acc) + ca = checkingaccount('7654321','Tina',50000,100000) + ca.deposit(5000) + ca.withdraw(70000) + print(ca) + +main() + + + + + diff --git a/m10_class/checkingaccount.py b/m10_class/checkingaccount.py new file mode 100644 index 0000000..5d9fb3f --- /dev/null +++ b/m10_class/checkingaccount.py @@ -0,0 +1,30 @@ +from m10_class.account2_str import Account +class checkingaccount(Account): + def __init__(self,number,name,balance = 0,credit_limit = 10000): + super(checkingaccount,self).__init__(number,name,balance) + self.credit_limit = credit_limit + + def withdraw(self,amount): + try: + if amount <= self.balance + self.credit_limit: + self.balance -= amount + else : + raise ValueError + except ValueError: + print('餘額不足') + + def __str__(self): + return (super(checkingaccount,self).__str__() + ' \ncredit_limit{}'.format(self.credit_limit)) + +def main(): + acc = Account('123456789','Tom',5000) + print(acc) + ca = checkingaccount('7654321','Tina',50000,100000) + print(ca) + + + + + + + diff --git a/m10_class/checkingaccountnogood.py b/m10_class/checkingaccountnogood.py new file mode 100644 index 0000000..9d8377f --- /dev/null +++ b/m10_class/checkingaccountnogood.py @@ -0,0 +1,32 @@ +from m10_class.account2_str import Account +class checkingaccount(Account): + def __init__(self,number,name,balance = 0,credit_limit = 10000): + self.number = number + self.name = name + self.balance = balance + self.credit_limit = credit_limit + + def withdraw(self,amount): + try: + if amount <= self.balance + self.credit_limit: + self.balance -= amount + else : + raise ValueError + except ValueError: + print('餘額不足') + + def __str__(self): + return ('number:{0} \nname:{1} \nbalance:{2} \ncredit_limit{3}'.format(self.number,self.name,self.balance,self.credit_limit)) + +def main(): + acc = Account('123456789','Tom',5000) + print(acc) + ca = checkingaccount('7654321','Tina',50000,100000) + print(ca) + + + + + + + diff --git a/m10_class/multiinheritence.py b/m10_class/multiinheritence.py new file mode 100644 index 0000000..7fb1fdb --- /dev/null +++ b/m10_class/multiinheritence.py @@ -0,0 +1,24 @@ +class A (object): + def method1(self): + print('A.m1') + def method2(self): + print('A.m2') +class B (A): + def method3(self): + print('B.m3') +class C (A): + def method2(self): + print('C.m2') + def method3(self): + print('C.m3') +class D (B,C): + def method4(self): + print('D.m4') + +def main(): + d = D() + d.method1() + d.method2() + d.method3() + d.method4() +main() \ No newline at end of file diff --git a/m10_class/overriding1.py b/m10_class/overriding1.py new file mode 100644 index 0000000..946af6d --- /dev/null +++ b/m10_class/overriding1.py @@ -0,0 +1,23 @@ +class Parent: + def m1(self): + print('Parent: m1()') + def m2(self): + print('Parent: m2()') +class Child1(Parent): + def m3(self): + print('Child1: m3()') + +class Child2(Parent): + def m4(self): + print('Child2: m4()') +def main(): + child1 = Child1() + child1.m1() + child1.m2() + child1.m3() + child2 = Child2() + child2.m1() + child2.m2() + child2.m4() + +main() \ No newline at end of file diff --git a/m10_class/overriding2.py b/m10_class/overriding2.py new file mode 100644 index 0000000..62823c2 --- /dev/null +++ b/m10_class/overriding2.py @@ -0,0 +1,25 @@ +class Parent: + def m1(self): + print('Parent: m1()') + def m2(self): + print('Parent: m2()') +class Child1(Parent): + def m3(self): + print('Child1: m3()') + def m2(self): + print('Child1: m2()') + +class Child2(Parent): + def m4(self): + print('Child2: m4()') +def main(): + child1 = Child1() + child1.m1() + child1.m2() + child1.m3() + child2 = Child2() + child2.m1() + child2.m2() + child2.m4() + +main() \ No newline at end of file diff --git a/m10_class/pointer.py b/m10_class/pointer.py new file mode 100644 index 0000000..e169a62 --- /dev/null +++ b/m10_class/pointer.py @@ -0,0 +1,30 @@ +class Pointer: + def __init__(self,x,y): + self.x = x + self.y = y + def __str__(self): + return "x = {} , y = {}".format(self.x,self.y) + + def __add__(self, other): + x = self.x + other.x + y = self.y + other.y + return Pointer(x,y) + def __sub__(self, other): + x = self.x - other.x + y = self.y - other.y + return Pointer(x,y) + def __eq__(self, other): + return self.x == other.x and self.y == other.y + + + +def main(): + p1 = Pointer(4,8) + print(p1) + p2 = Pointer(4,8) + print(p2) + print(p1 +p2) + print(p1 - p2) + print(p1 == p2) + +main() \ No newline at end of file diff --git a/m10_class/polymorphism.py b/m10_class/polymorphism.py new file mode 100644 index 0000000..cf11882 --- /dev/null +++ b/m10_class/polymorphism.py @@ -0,0 +1,28 @@ +class Dog: + def run(self): + print("Dog : run()") + def walk(self): + print("Dog : walk()") + +class Cat: + def run(self): + print("Cat : run()") + def walk(self): + print("Cat : walk()") +class Tiger: + def run(self): + print("Tiger : run()") + def walk(self): + print("Tiger : walk()") +def test(animal): + animal.run() + animal.walk() #可以利用相同方法名稱情況下,統一使用多型一次測試 +def main(): + dog = Dog() + cat = Cat() + tiger = Tiger() + test(dog) + test(cat) + test(tiger) + +main() diff --git a/m11_file/append.py b/m11_file/append.py new file mode 100644 index 0000000..e0ee575 --- /dev/null +++ b/m11_file/append.py @@ -0,0 +1,8 @@ +with open('lang.txt','a') as f: + + f.write('C++\n') + f.write('Javascript\n') + f.write('C#\n') + + list1 = ['a\n','b\n','c\n'] + f.writelines(list1) #此方法在大量write的情況下效能會比較好 \ No newline at end of file diff --git a/m11_file/lang.txt b/m11_file/lang.txt new file mode 100644 index 0000000..43898b2 --- /dev/null +++ b/m11_file/lang.txt @@ -0,0 +1,9 @@ +C +Python +Java +C++ +Javascript +C# +a +b +c diff --git a/m11_file/read.py b/m11_file/read.py new file mode 100644 index 0000000..9a866d3 --- /dev/null +++ b/m11_file/read.py @@ -0,0 +1,37 @@ +with open('lang.txt','r') as f : + line = f.readline() + while line != '': + print(line,end='') + line = f.readline() +print("=================================") + +with open('lang.txt','r') as f : + line = f.readline() + while line != '': + print(repr(line)) + line = f.readline() + +print("=================================") + +with open('lang.txt','r') as f: + data = f.read() + print(data) + print(repr(data)) +print("=================================") +with open('lang.txt','r') as f: + data = f.read(14) + print(data) + data = f.read(10) + print(data) +print("=================================") + +with open('lang.txt','r') as f: + lines = f.readlines() + print(lines) + for line in lines: + print(line,end='') +print("=================================") +import os +with open("lang.txt",'r') as f: + f.seek(10,os.SEEK_SET)#跟f.seek(10,0)一樣 + print(f.read(10)) diff --git a/m11_file/write.py b/m11_file/write.py new file mode 100644 index 0000000..54e656d --- /dev/null +++ b/m11_file/write.py @@ -0,0 +1,4 @@ +with open('lang.txt','w') as f: + f.write('C\n') + f.write('Python\n') + f.write('Java\n') \ No newline at end of file diff --git a/m12_mysql/Insert.py b/m12_mysql/Insert.py new file mode 100644 index 0000000..ba51708 --- /dev/null +++ b/m12_mysql/Insert.py @@ -0,0 +1,32 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + + ins = "insert into employee values(%s,%s,%s,%s,%s,%s)" + ins_data = (1011, "張億",'2019/02/26',58000,100,'engineer') + cursor.execute(ins,ins_data) + conn.commit() + print("insert",cursor.rowcount,'employee') + + query = "select ename, hiredate, salary from employee" + cursor.execute(query) + for ename, hiredate, salary in cursor: + print('ename={}, hiredate={},salary={}'.format(ename,hiredate,salary)) + print('total',cursor.rowcount,'employee') + + +except mysql.connector.Error as err: + print(err) +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/connector.py b/m12_mysql/connector.py new file mode 100644 index 0000000..26c8c72 --- /dev/null +++ b/m12_mysql/connector.py @@ -0,0 +1,12 @@ +import mysql.connector +conn = mysql.connector.connect(database='db01',user='root',password='choumysql') +from mysql.connector import connection +conn = connection.MySQLConnection(database='db01',user='root',password='choumysql') + +import mysql.connector +config = { + 'database' : 'db01', + 'user' : 'root', + 'password' : 'choumysql' +} +conn = mysql.connector.connect(**config) diff --git a/m12_mysql/connector_except.py b/m12_mysql/connector_except.py new file mode 100644 index 0000000..1185cee --- /dev/null +++ b/m12_mysql/connector_except.py @@ -0,0 +1,20 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') +except mysql.connector.Error as err: + if err.errno == errorcode.ER_ACCESS_DENIED_ERROR: + print('user or passwd error') + elif err.errno == errorcode.ER_BAD_DB_ERROR: + print('database not existed') + else: + print('err') +finally: + if conn: + print('close') + conn.close() + + + + diff --git a/m12_mysql/connector_queryall.py b/m12_mysql/connector_queryall.py new file mode 100644 index 0000000..1e73d88 --- /dev/null +++ b/m12_mysql/connector_queryall.py @@ -0,0 +1,26 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee" + cursor.execute(sql) + + for ename, hiredate, salary in cursor: + print('name={},hiredate={},salary={}'.format(ename,hiredate,salary)) + print("total",cursor.rowcount,"employees") + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/delete.py b/m12_mysql/delete.py new file mode 100644 index 0000000..7fe7780 --- /dev/null +++ b/m12_mysql/delete.py @@ -0,0 +1,32 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + + ins = "delete from employee where empno = %s" + ins_data = 1011 + cursor.execute(ins,(ins_data,)) + conn.commit() + print("insert",cursor.rowcount,'employee') + + query = "select ename, hiredate, salary from employee" + cursor.execute(query) + for ename, hiredate, salary in cursor: + print('ename={}, hiredate={},salary={}'.format(ename,hiredate,salary)) + print('total',cursor.rowcount,'employee') + + +except mysql.connector.Error as err: + print(err) +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/fetch_all.py b/m12_mysql/fetch_all.py new file mode 100644 index 0000000..cf096cc --- /dev/null +++ b/m12_mysql/fetch_all.py @@ -0,0 +1,31 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee" + cursor.execute(sql) + emps = cursor.fetchall() + + for ename, hiredate, salary in emps: + print('name={},hiredate={},salary={}'.format(ename,hiredate,salary)) + print("=============================================") + for emp in emps: + print(emp) + print('name={} ,hiredate={} ,salary={}'.format(emp[0],emp[1],emp[2])) + print("total",cursor.rowcount,"employees") + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/fetch_many.py b/m12_mysql/fetch_many.py new file mode 100644 index 0000000..53da543 --- /dev/null +++ b/m12_mysql/fetch_many.py @@ -0,0 +1,28 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee where title = %s and deptno = %s" + title = 'manager' + deptno = 200 + cursor.execute(sql,(title,deptno)) + + for ename, hiredate, salary in cursor: + print('name={},hiredate={},salary={}'.format(ename,hiredate,salary)) + print("total",cursor.rowcount,"employees") + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/fetch_many2.py b/m12_mysql/fetch_many2.py new file mode 100644 index 0000000..904f334 --- /dev/null +++ b/m12_mysql/fetch_many2.py @@ -0,0 +1,28 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee where title = %(title)s and deptno = %(deptno)s" + title = 'manager' + deptno = 200 + cursor.execute(sql,{"title":title,"deptno":deptno}) + + for ename, hiredate, salary in cursor: + print('name={},hiredate={},salary={}'.format(ename,hiredate,salary)) + print("total",cursor.rowcount,"employees") + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/fetch_many_practice.py b/m12_mysql/fetch_many_practice.py new file mode 100644 index 0000000..9fea98b --- /dev/null +++ b/m12_mysql/fetch_many_practice.py @@ -0,0 +1,28 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee where ename like %s" + ename = input('輸入名稱 : ') + ename1 =str('%'+ename+'%') + cursor.execute(sql,(ename1,)) + + for ename, hiredate, salary in cursor: + print('name={},hiredate={},salary={}'.format(ename,hiredate,salary)) + print("total",cursor.rowcount,"employees") + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/fetch_one.py b/m12_mysql/fetch_one.py new file mode 100644 index 0000000..958dd77 --- /dev/null +++ b/m12_mysql/fetch_one.py @@ -0,0 +1,29 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + sql = "select ename, hiredate, salary from employee where empno = %s" + empno = eval(input("employee no : ")) + cursor.execute(sql,(empno,)) + emps = cursor.fetchone() + if emps is not None: + print(emps) + print("name={}, hiredate= {},salary= {}".format(emps[0],emps[1],emps[2])) + else: + print('No data') + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m12_mysql/update.py b/m12_mysql/update.py new file mode 100644 index 0000000..8c90d3c --- /dev/null +++ b/m12_mysql/update.py @@ -0,0 +1,34 @@ +import mysql.connector +from mysql.connector import errorcode +conn = None +cursor = None +try: + conn = mysql.connector.connect(database='db01',user='root',password='choumysql') + cursor = conn.cursor(); + upd = "update employee set salary = %s where empno = %s" + upd_data=(50000,1001) + cursor.execute(upd,upd_data) + conn.commit() + + sql = "select ename, hiredate, salary from employee where empno = %s" + empno = eval(input("employee no : ")) + cursor.execute(sql,(empno,)) + emps = cursor.fetchone() + if emps is not None: + print(emps) + print("name={}, hiredate= {},salary= {}".format(emps[0],emps[1],emps[2])) + else: + print('No data') + + +except mysql.connector.Error as err: + print('err') +finally: + if cursor: + cursor.close() + if conn: + conn.close() + + + + diff --git a/m2_type/literal.py b/m2_type/literal.py index b112a98..2654d16 100644 --- a/m2_type/literal.py +++ b/m2_type/literal.py @@ -5,4 +5,13 @@ x=0x1db #16進位 print(x) x=0o733 #進位 -print(x) \ No newline at end of file +print(x) + +x = 'A' +print(x) +x = u'\u0041' +print(x) +x = '胖' +print(x) +x = u'\u80D6' +print(x) diff --git a/m3_operator/arithmetic.py b/m3_operator/arithmetic.py new file mode 100644 index 0000000..96d05ff --- /dev/null +++ b/m3_operator/arithmetic.py @@ -0,0 +1,18 @@ +x=17//4 +print(x) +x=17%4 +print(x) +x=17/4 +print(x) + +x=-17//4 +print(x) +x=-17%4 +print(x) +x=-17/4 +print(x) + +x= 'Ball' +'Lozon' +print(x) +x= 'Ball' + str(2) +print(x) \ No newline at end of file diff --git a/m3_operator/bitewise.py b/m3_operator/bitewise.py new file mode 100644 index 0000000..62d4a9b --- /dev/null +++ b/m3_operator/bitewise.py @@ -0,0 +1,11 @@ +x=0b1100100 +print(x) +y=0b10000111 +print(y) + +print(x >> 2) +print(x << 2) + +print(x & y) +print(x | y) +print(x ^ y) \ No newline at end of file diff --git a/m3_operator/buildin_math.py b/m3_operator/buildin_math.py new file mode 100644 index 0000000..3becbfa --- /dev/null +++ b/m3_operator/buildin_math.py @@ -0,0 +1,10 @@ +print(abs(-888)) +print(max(55,88,7879,456,4,421,599,456)) +print(min(1111,45645,8,796,4654,46546,44,1.33)) +print(pow(5,8)) +print(round(4.8)) +print(round(3.5)) +print(round(4.5)) +'''取最接近整數(若一樣進取偶數)''' +print(round(55.232,1)) +print(round(195582.4567,-1)) \ No newline at end of file diff --git a/m3_operator/decimal_fraction.py b/m3_operator/decimal_fraction.py new file mode 100644 index 0000000..f53d618 --- /dev/null +++ b/m3_operator/decimal_fraction.py @@ -0,0 +1,10 @@ +import decimal +print(decimal.Decimal(0.1)) +print(decimal.Decimal(0.1)+decimal.Decimal(0.2)) +print(decimal.Decimal('0.1')+decimal.Decimal('0.2')) + +import fractions +print(fractions.Fraction(1.5)) +print(fractions.Fraction(1,3)) +print(fractions.Fraction(1.1)) +print(fractions.Fraction('1.1')) \ No newline at end of file diff --git a/m3_operator/format_c.py b/m3_operator/format_c.py new file mode 100644 index 0000000..e02671a --- /dev/null +++ b/m3_operator/format_c.py @@ -0,0 +1,30 @@ +a= 123 +b= 12345.678 +c= 'python' +print('/'+'%5d' % a +'/') +print('/'+'%10.2f' % b +'/') +print('/'+'%10.2e' % b +'/') +print('/'+'%10.2E' % b +'/') +print('/'+'%10s' % c +'/') + +print('/'+'%-5d' % a +'/') +print('/'+'%-10.2f' % b +'/') +print('/'+'%-10.0f' % b +'/') +print('/'+'%-10.2e' % b +'/') +print('/'+'%-10.2E' % b +'/') +print('/'+'%-10s' % c +'/') + +print('/'+'%5x' % a +'/') +print('/'+'%5X' % a +'/') +print('/'+'%#5X' % a +'/') +print('/'+'%05d' % a +'/') +print('/'+'%5o' % a +'/') +print('/'+'%#5o' % a +'/') +print('/'+'%5d%%' % a +'/') +print('/'+'%+5d' % a +'/') +print('/'+'%5d %10.2f %10s' % (a,b,c) +'/') + + +print('/' + '%10r' % 'aaaa\thhh' + '/') +print('/' + '%10s' % 'aaaa\thhh' + '/') +print('/' + '%15s' % 'aaaa\thhh' + '/') diff --git a/m3_operator/format_py.py b/m3_operator/format_py.py new file mode 100644 index 0000000..a2f0a85 --- /dev/null +++ b/m3_operator/format_py.py @@ -0,0 +1,9 @@ +a= 123 +b= 12345.678 +c= 'python' + +print('/' + format(a,'5d') + '/') +print('/' + format(b,'10,.2f') + '/') +print('/' + format(b,'f') + '/') +print('/' + format(c,'-^10s') + '/') +print('/' + format(a,'#5b') + '/') \ No newline at end of file diff --git a/m3_operator/format_str.py b/m3_operator/format_str.py new file mode 100644 index 0000000..52e046e --- /dev/null +++ b/m3_operator/format_str.py @@ -0,0 +1,15 @@ +print('{0} is {1} years old !' .format('TOM',30)) +print('{1} is {0} years old !' .format(30,'TOM')) +print('{} is {} years old !' .format('TOM',30)) +print('{name} is {age} years old !' .format(name='TOM',age=30)) +print('{name} is {age} years old !' .format(age=30,name='TOM')) +print('{} is {age} years old !' .format('TOM',age=30)) + +print('{0} is {1} years old ! He is {2}m!!' .format('TOM',30,1.8872)) +print('{0} is {1} years old ! He is {2: .2f}m!!' .format('TOM',30,1.8872)) + +print('String : {:>10s}'.format('GM')) +print('String : {:^10s}'.format('GM')) +print('String : {:<10s}'.format('GM')) +print('String : {:-^10s}'.format('GM')) + diff --git a/m3_operator/import_math.py b/m3_operator/import_math.py new file mode 100644 index 0000000..5229076 --- /dev/null +++ b/m3_operator/import_math.py @@ -0,0 +1,11 @@ +import math +print(math.sqrt(25)) +print(math.fabs(-955)) +print(math.floor(46.2)) +print(math.ceil(46.2)) +print(math.factorial(6)) +print(math.gcd(55,22)) +print(math.fabs(-4.5)) + +import random +print(random.randint(1,100)) \ No newline at end of file diff --git a/m3_operator/input.py b/m3_operator/input.py new file mode 100644 index 0000000..2d74a72 --- /dev/null +++ b/m3_operator/input.py @@ -0,0 +1,12 @@ +''' +n = input('please input string:') +print(n) + +n = eval(input('please input number:')) +print(n) + +n = eval(input('please input number:')) +print(n+558) +''' +n1,n2 = eval(input('please input 2 number:')) +print(format(n1/n2,'10.2f')) diff --git a/m3_operator/print.py b/m3_operator/print.py new file mode 100644 index 0000000..0d478f1 --- /dev/null +++ b/m3_operator/print.py @@ -0,0 +1,6 @@ +a= 123 +b= 456 +c= 'aaa' +print(a, end=',') +print(b, end=',') +print(c, end='.') \ No newline at end of file diff --git a/m4_flow/condition_operator.py b/m4_flow/condition_operator.py new file mode 100644 index 0000000..8afcc85 --- /dev/null +++ b/m4_flow/condition_operator.py @@ -0,0 +1,5 @@ +coverage , area = eval(input('please input two numbers: ')) +count = area //coverage +count += 0 if area %coverage == 0 else 1 +unit = 'can' if count == 1 else 'cans' +print('need {0} {1} to print '.format(count,unit)) \ No newline at end of file diff --git a/m4_flow/iterator.py b/m4_flow/iterator.py new file mode 100644 index 0000000..4bdf157 --- /dev/null +++ b/m4_flow/iterator.py @@ -0,0 +1,43 @@ +'''1加到10''' +n = 1 +total = 0 +while n<=10 : + total +=n + n += 1 +print(n,total) +'''10加到1''' +n = 10 +total = 0 +while n>=1 : + total +=n + n -= 1 +print(n,total) +'''偶數相加''' +n = 0 +total = 0 +while n<=10 : + total +=n + n += 2 +print(n,total) +'''奇數相加''' +n = 1 +total = 0 +while n<=10 : + total +=n + n += 2 +print(n,total) +'''for ... in range''' +total = 0 +for n in range(1, 11): + total += n +print(n, total) +'''偶''' +total = 0 +for n in range(0, 11,2): + total += n +print(n, total) +'''奇''' +total = 0 +for n in range(1, 11,2): + total += n +print(n, total) \ No newline at end of file diff --git a/m4_flow/nested_for.py b/m4_flow/nested_for.py new file mode 100644 index 0000000..f8e31f9 --- /dev/null +++ b/m4_flow/nested_for.py @@ -0,0 +1,10 @@ +for i in range (1,10): + for j in range (1,10): + print('{0}*{1}={2}'.format(i,j,i*j),end='\t') + print() + '''row 跑9次後換行''' +print() +for i in range (1,10): + for j in range (1,10): + print('{1}*{0}={2}'.format(i,j,i*j),end='\t') + print() \ No newline at end of file diff --git a/m5_str/str1.py b/m5_str/str1.py new file mode 100644 index 0000000..48f9573 --- /dev/null +++ b/m5_str/str1.py @@ -0,0 +1,18 @@ +str1 = 'python' +print('p' in str1) +print('P' in str1) +for i in str1: + print(i,end=' ') +print() +print(str1[2]) +print(str1[1:5]) +print(str1[-4:]) +print(str1[1:-1]) + +print(len(str1)) +print(max(str1)) +print(min(str1)) + +str2 = 'Simple' +print(str1+str2) +print(str2*3) \ No newline at end of file diff --git a/m5_str/str_fu.py b/m5_str/str_fu.py new file mode 100644 index 0000000..61587d1 --- /dev/null +++ b/m5_str/str_fu.py @@ -0,0 +1,38 @@ +str1='acc213' +str2='123' +str3='asdasd' +str4='_asd' +print(str1.isalnum()) +print(str1.isalpha()) +print(str1.isdigit()) +print('---------------------1') +print(str2.isalnum()) +print(str2.isalpha()) +print(str2.isdigit()) +print('---------------------2') +print(str3.isalnum()) +print(str3.isalpha()) +print(str3.isdigit()) +print('---------------------3') +print(str1.isidentifier()) +print(str2.isidentifier()) +print(str3.isidentifier()) +print(str4.isidentifier()) +print('---------------------4') +str5='Yrwew' +print(str5.isupper()) +print(str5.islower()) +print('---------------------5') +str6=" " +print(str6.isspace()) +str7='\t' +print(str7.isspace()) +str8="\n" +print(str8.isspace()) +str9="\b" +print(str9.isspace()) +print('---------------------6') +print(str5.startswith('Y')) +print(str5.startswith('y')) +str10='ddd.py' +print(str10.endswith('.py')) \ No newline at end of file diff --git a/m5_str/str_fu1.py b/m5_str/str_fu1.py new file mode 100644 index 0000000..733f44b --- /dev/null +++ b/m5_str/str_fu1.py @@ -0,0 +1,21 @@ +str1='hello world , my complex world !' +print(str1.find('world')) +print(str1.rfind('world')) +print(str1.count('world')) +print(str1.lower()) +print(str1.upper()) +print(str1.capitalize()) +print(str1.title()) +print(str1.swapcase()) +str2="Hey hey , u can't catch me" +print(str2.swapcase()) +print(str1.replace('world','kid')) +str3 = " yaaaaaaaa " +print(str3.lstrip()) +print(str3.rstrip()) +print(str3.strip()) +str4 = "Gaaaaaa" +width = 20 +print(str4.ljust(width)) +print(str4.center(20)) +print(str4.rjust(20)) \ No newline at end of file diff --git a/m6_funcation/__pycache__/my_math.cpython-36.pyc b/m6_funcation/__pycache__/my_math.cpython-36.pyc new file mode 100644 index 0000000..f6b28f1 Binary files /dev/null and b/m6_funcation/__pycache__/my_math.cpython-36.pyc differ diff --git a/m6_funcation/arbitrary_args.py b/m6_funcation/arbitrary_args.py new file mode 100644 index 0000000..0d4ef99 --- /dev/null +++ b/m6_funcation/arbitrary_args.py @@ -0,0 +1,10 @@ +def greet(*names): + for name in names: + print("Hello",name) +greet('TOM','HOME','JERRY','ILLY') + +def stu (**data): + for key,value in data.items(): + print("{} is {}".format(key,value)) +stu(name = "TOM",age = "25",mobile = "034582202") +stu(name = "JIMMY",age = "33",email="J123@gmail.com",mobile="0955874441") \ No newline at end of file diff --git a/m6_funcation/argument.py b/m6_funcation/argument.py new file mode 100644 index 0000000..6e7a96c --- /dev/null +++ b/m6_funcation/argument.py @@ -0,0 +1,6 @@ +def total(x,y): + return x**2+y**2 +def main(): + a,b= eval(input('2 Numbers: ')) + print(total(a,b)) +main() \ No newline at end of file diff --git a/m6_funcation/default_args.py b/m6_funcation/default_args.py new file mode 100644 index 0000000..f07283a --- /dev/null +++ b/m6_funcation/default_args.py @@ -0,0 +1,17 @@ +def sum_avg(n1=1,n2=100): + total = 0 + for i in range (n1,n2+1): + total += i + avg = total / (n2-n1+1) + return total,avg +def main(): + total, avg = sum_avg() + print('sum = {0},average = {1}'.format(total, avg)) + total, avg = sum_avg(n2=2) + print('sum = {0},average = {1}'.format(total, avg)) + total, avg = sum_avg(10, 150) + print('sum = {0},average = {1}'.format(total, avg)) + total, avg = sum_avg(100,1000) + print('sum = {0},average = {1}'.format(total,avg)) + +main() \ No newline at end of file diff --git a/m6_funcation/factor.py b/m6_funcation/factor.py new file mode 100644 index 0000000..22130b3 --- /dev/null +++ b/m6_funcation/factor.py @@ -0,0 +1,10 @@ +def fac(a): + total=1 + for n in range(1,(a+1)): + total *= n + return total +def main(): + a = eval(input('Number: ')) + print(fac(a)) + +main() \ No newline at end of file diff --git a/m6_funcation/mult_return.py b/m6_funcation/mult_return.py new file mode 100644 index 0000000..a2c6ee0 --- /dev/null +++ b/m6_funcation/mult_return.py @@ -0,0 +1,11 @@ +def sum_avg(n1,n2): + total = 0 + for i in range (n1,n2+1): + total += i + avg = total / (n2-n1+1) + return total,avg +def main(): + total, avg = sum_avg(1,100) + print('sum = {0},average = {1}'.format(total,avg)) + +main() \ No newline at end of file diff --git a/m6_funcation/my_math.py b/m6_funcation/my_math.py new file mode 100644 index 0000000..e014a5c --- /dev/null +++ b/m6_funcation/my_math.py @@ -0,0 +1,6 @@ +def mypow(x,y): + return x**y +def myabs(x): + return x*-1 if x<0 else x +def mysum(x,y): + return x+y \ No newline at end of file diff --git a/m6_funcation/mymath_call.py b/m6_funcation/mymath_call.py new file mode 100644 index 0000000..228039d --- /dev/null +++ b/m6_funcation/mymath_call.py @@ -0,0 +1,18 @@ +import m6_funcation.my_math + +print(m6_funcation.my_math.mypow(2,3)) +print(m6_funcation.my_math.mysum(2,3)) +print(m6_funcation.my_math.myabs(-8)) + +import m6_funcation.my_math as my_math + +print(my_math.mypow(2,3)) +print(my_math.mysum(2,3)) +print(my_math.myabs(-8)) + +from m6_funcation.my_math import * +print(mypow(2,8)) +print(mysum(8,7)) +print(myabs(-87)) + +print(dir(m6_funcation.my_math)) \ No newline at end of file diff --git a/m6_funcation/nonlocal _var.py b/m6_funcation/nonlocal _var.py new file mode 100644 index 0000000..4e0b6fe --- /dev/null +++ b/m6_funcation/nonlocal _var.py @@ -0,0 +1,15 @@ +def func(): + x = 10 + def get_x(): + return x + def set_x(n): + nonlocal x + x = n + return get_x,set_x +getx,setx = func() +x1 = getx() +print(x1) + +setx(30) +x1 = getx() +print(x1) \ No newline at end of file diff --git a/m6_funcation/position_args.py b/m6_funcation/position_args.py new file mode 100644 index 0000000..34a4128 --- /dev/null +++ b/m6_funcation/position_args.py @@ -0,0 +1,7 @@ +def msg (name,age): + print("{0} is {1} years old!!".format(name,age)) + +msg('Tom', 25) +msg('Tom', age=25) +msg(name='Tom', age=25) +msg(age=25,name='Tom') diff --git a/m6_funcation/recursive.py b/m6_funcation/recursive.py new file mode 100644 index 0000000..da226c1 --- /dev/null +++ b/m6_funcation/recursive.py @@ -0,0 +1,8 @@ +def func(n): + print('level',n) + if n<4: + func(n+1) + print('LEVEL',n) +def main(): + func(1) +main() \ No newline at end of file diff --git a/m6_funcation/simple.py b/m6_funcation/simple.py new file mode 100644 index 0000000..78e033d --- /dev/null +++ b/m6_funcation/simple.py @@ -0,0 +1,9 @@ +def func(): + print('this is a simplest function') +def main(): + print('this is boss') + print('and func is under me') + func() + print('bye bye') + +main() \ No newline at end of file diff --git a/m6_funcation/variable_scope.py b/m6_funcation/variable_scope.py new file mode 100644 index 0000000..fdcb329 --- /dev/null +++ b/m6_funcation/variable_scope.py @@ -0,0 +1,82 @@ +''' +x=10 +y=11 +def main(): + x=20 + print(x) + print(y) +main() +print(x) +print(y) + +def outer(): + def inner(): + print('first') + def inner2(): + print('second') + inner() #呼叫inner + inner2() #呼叫inner2 +outer() #呼叫outer + +def outer(): + def inner(): + print('first') + def inner2(): + print('second') + inner2() + inner() +outer()#一層層呼叫 + +x=30 +def outer(): + x=20 + print(x) + def inner(): + x=10 + print(x) + inner() + print(x) +outer() +print(x) + +x = 10 +y = 11 +def main(): + x=20 + print(x) + global y + y=22 + print(y) +main() +print(x) +print(y) +''' +''' +x = 10 +def outer(): + x = 20 + def inner(): + nonlocal x + print(x) + x = 30 + inner() + print(x) +outer() +print(x) +''' +x = 10 +def outer(): + x = 20 + def inner(): + nonlocal x + x = 30 + def inner2(): + nonlocal x + print(x) + x=40 + inner2() + print(x) + inner() + print(x) +outer() +print(x) \ No newline at end of file diff --git a/m7_list/for_loop.py b/m7_list/for_loop.py new file mode 100644 index 0000000..2f5dcbe --- /dev/null +++ b/m7_list/for_loop.py @@ -0,0 +1,12 @@ +import random +list1 = [45,12,13,15,45,8] +list2 = [] +for i in range(6): + list2.append(random.randint(1,100)) +print(list2) +for i in range(len(list1)): + print(i,list1[i]) +for s in list1: + print(s) +else: + print('nothing') \ No newline at end of file diff --git a/m7_list/list_func.py b/m7_list/list_func.py new file mode 100644 index 0000000..5c94e05 --- /dev/null +++ b/m7_list/list_func.py @@ -0,0 +1,22 @@ +list1 = [45,67,88,39,11,34,90,88] +list1.append(777) +print(list1) + +list2 = [] +list2.append(54) +print(list2) + +list1.insert(1,888) +print(list1) +print(list1.pop(1)) +print(list1) +print(list1.pop(3)) +print(list1) +print(list1.count(88)) +print(list1.index(67)) +list1.remove(88) +print(list1) +list1.sort() +print(list1) +list1.reverse() +print(list1) \ No newline at end of file diff --git a/m7_list/one_dim.py b/m7_list/one_dim.py new file mode 100644 index 0000000..416ec99 --- /dev/null +++ b/m7_list/one_dim.py @@ -0,0 +1,18 @@ +list1 = [] +list2 = [65,4.21,'string',True] +list3 = [1,2,3,4,5,6] +list4 = ['Python','C','Java'] + +print(list3) +print(type(list3)) +print(list3[0]) +print(list4[2]) + +print(len(list4)) +print(max(list3)) +print(min(list3)) +print(sum(list3)) +print('C' in list4) +print(list3+list4) +print(list4*2) +print(list3*2) diff --git a/m7_list/slice.py b/m7_list/slice.py new file mode 100644 index 0000000..4a78253 --- /dev/null +++ b/m7_list/slice.py @@ -0,0 +1,6 @@ +list1 = [45,67,88,39,11,34,90,88,86,36,12] +print(list1[2:6]) +print(list1[-2:]) +print(list1[:-3]) +print(list1[:6]) +print(list1[2:]) \ No newline at end of file diff --git a/m7_list/spilt.py b/m7_list/spilt.py new file mode 100644 index 0000000..977ff16 --- /dev/null +++ b/m7_list/spilt.py @@ -0,0 +1,8 @@ +str1 = 'python C Java' +list1 = str1.split() +print(list1) + +str2 = 'python,C,java' +list2 = str2.split(',') +print(list2) + diff --git a/m7_list/three_dim.py b/m7_list/three_dim.py new file mode 100644 index 0000000..46ec551 --- /dev/null +++ b/m7_list/three_dim.py @@ -0,0 +1,50 @@ +list1 = [[[1,2],[3,4]], + [[5,6],[7,8]], + [[9,10],[11,12]] + ] +''' +print(list1) +print(list1[2][1][1],end=' ')#layer,row,col +print(list1[2][1][0],end=' ') +print(list1[2][0][1],end=' ') +print(list1[2][0][0],end=' ') +print(list1[1][1][1],end=' ') +print(list1[1][1][0],end=' ') +print(list1[1][0][1],end=' ') +print(list1[1][0][0],end=' ') +print(list1[0][1][1],end=' ') +print(list1[0][1][0],end=' ') +print(list1[0][0][1],end=' ') +print(list1[0][0][0]) + +print(list1[0][0]) +print(list1[1]) +print(len(list1)) +''' +''' +for i in range(len(list1)): + for j in range(len(list1[i])): + for k in range(len(list1[i][j])): + print(list1[i][j][k],end=' ') +print() + +for i in range(len(list1)): + for j in range(len(list1[i])): + print(list1[i][j],end=' ') +print() + +for i in range(len(list1)): + print(list1[i], end=' ') +''' +import random +lay = eval(input('layer: ')) +row = eval(input('row: ')) +col = eval(input('col : ')) +list2 = [] +for i in range(lay): + list2.append([]) + for j in range(row): + list2[i].append([]) + for k in range(col): + list2[i][j].append(random.randint(1,100)) +print(list2) \ No newline at end of file diff --git a/m7_list/two_dim.py b/m7_list/two_dim.py new file mode 100644 index 0000000..bb40a6d --- /dev/null +++ b/m7_list/two_dim.py @@ -0,0 +1,43 @@ +list1 = [[1,2,3],[4,5,6]] +print(list1[0][0]) +print(list1[0][1]) +print(list1[0][2]) +print(list1[1][0]) +print(list1[1][2]) + +list2 = [[1,2],[3,4],[5,6]] +print(list2[0][0], end=' ') +print(list2[0][1]) +print(list2[2][1]) +print(list2[1][0]) +print(list2[1][1]) + +list3 = [[1,2],[3,4],[5,6,7]] +print(list3[0][0], end=' ') +print(list3[0][1]) +print(list3[1][0]) +print(list3[1][1]) +print(list3[2][0]) +print(list3[2][1]) +print(list3[2][2]) + +print(len(list3)) +print(len(list3[0])) +print(len(list3[2])) + +print(list3[2]) +print(list1[1]) +print(list2[0]) + +for i in range (len(list1)): + for j in range (len(list1[i])): + print(list1[i][j],end=' ') +print() +for i in range (len(list3)): + for j in range (len(list3[i])): + print(list3[i][j],end=' ') +print() +for i in range(len(list1)): + print(list1[i]) +for i in range(len(list3)): + print(list3[i]) \ No newline at end of file diff --git a/m7_list/two_dim_random.py b/m7_list/two_dim_random.py new file mode 100644 index 0000000..5d58baf --- /dev/null +++ b/m7_list/two_dim_random.py @@ -0,0 +1,22 @@ +import random +''' +list1 = [45,12,13,15,45,8] +list2 = [] +for i in range(6): + list2.append(random.randint(1,100)) +print(list2) +for i in range(len(list1)): + print(i,list1[i]) +for s in list1: + print(s) +else: + print('nothing') +''' +row = eval(input('Row number: ')) +col = eval(input('Col number: ')) +list1 = [] +for i in range(row): + list1.append([]) + for j in range(col): + list1[i].append(random.randint(1,100)) +print(list1) \ No newline at end of file diff --git a/m8_tuple_set_dict/arbitrary_args.py b/m8_tuple_set_dict/arbitrary_args.py new file mode 100644 index 0000000..fdd4f5c --- /dev/null +++ b/m8_tuple_set_dict/arbitrary_args.py @@ -0,0 +1,21 @@ +def greet(*names): + for name in names: + print("Hello",name) +greet('TOM','HOME','JERRY','ILLY') + +tuple1 = ('tom','home','kiki','nina') +greet(*tuple1) +list1 = ['tom','home','kiki','nina'] +greet(*list1) +str1 = 'python' +greet(*str1) + +def stu (**data): + for key,value in data.items(): + print("{} is {}".format(key,value)) +stu(name = "TOM",age = "25",mobile = "034582202") +stu(name = "JIMMY",age = "33",email="J123@gmail.com",mobile="0955874441") + +student = {'name' :"JIMMY",'age' : "33",'email':"J123@gmail.com",'mobile':"0955874441"} +stu(**student) + diff --git a/m8_tuple_set_dict/comprehension.py b/m8_tuple_set_dict/comprehension.py new file mode 100644 index 0000000..6ece113 --- /dev/null +++ b/m8_tuple_set_dict/comprehension.py @@ -0,0 +1,23 @@ +list1 = [i for i in range(1,11)] +print(list1) +list2 = [i*i for i in range(1,10)] +print(list2) +dict1 = {i:i*i for i in range(1,10)} +print(dict1) +gen1 = (i**i for i in range(1,5)) +print(gen1) +for n in gen1: + print(n,end=' ') +print() + +evens = [i for i in range(1,51) if i%2 == 0] +print(evens) +odds = [i for i in range(1,51) if i%2 != 0] +print(odds) +odds = [i for i in range(1,51) if i % 2] #因為python 的true&false 就是 1&0 +print(odds) +evens = [i for i in range(1,51) if not(i%2)] +print(evens) +prime = [x for x in range(2,101) if ((x % 6) == 5 and (x % 5) != 0 and (x % 7) != 0) or ((x%6)==1 and (x%5)!=0 and (x%7)!=0) or (x==2 or x== 3 or x==5 or x==7)] +print(prime) + diff --git a/m8_tuple_set_dict/dict_1.py b/m8_tuple_set_dict/dict_1.py new file mode 100644 index 0000000..c2eb106 --- /dev/null +++ b/m8_tuple_set_dict/dict_1.py @@ -0,0 +1,44 @@ +dict1 = {'name':'Tom','age':25,'mobile':'0922454878'} +dict2 = {10:'a',11:'b',12:'c',13:'d',14:'e',15:'f'} +print(dict1['name']) +print(dict2.get(13)) + +for key in dict1: + print('%s : %s' % (key,dict1[key])) + +print(dict1.keys()) +print(dict1.values()) + +print(list(dict1.keys())) +print(list(dict1.values())) + +print(tuple(dict1.keys())) +print(tuple(dict1.values())) + +print(dict1.items()) +print(tuple(dict1.items())) +print(list(dict1.items())) + +for key,value in dict1.items(): + print('%s : %s' % (key,value)) + +print(len(dict1)) +print('name' in dict1) + +dict3 = {'name':'Tom','mobile':'0922454878','age':25,} +print(dict1 == dict3) + +dict1['email'] = 'Tomisboy@gmail.com' +print(dict1) +del dict3['age'] +print(dict3) +print(dict3.pop('name')) +print(dict3) +dict3.clear() +print(dict3) #會保留dict3 + +dict3 = dict1.copy() +print(dict3) +dict3 = {'name':'Tom','mobile':'0922454878','age':32,'id':'H1222334441'} +dict1.update(dict3) +print(dict1) \ No newline at end of file diff --git a/m8_tuple_set_dict/set_1.py b/m8_tuple_set_dict/set_1.py new file mode 100644 index 0000000..b83b28f --- /dev/null +++ b/m8_tuple_set_dict/set_1.py @@ -0,0 +1,32 @@ +set1 = {1,2,3,4,5,6} +set2 = {'python','c','java'} +print(set1) +print(set2) +print(type(set1)) + +list1 = [35,43,32,54,66,77,77] #重複項轉換成set會被刪除 +set3 = set(list1) +print(set3) +tuple1 = (1,2,3,4,5,6,7,7) +set4 = set(tuple1) +print(set4) + +set2.add('C++'); +print(set2) +set2.remove('c') +print(set2) + +set1 = {1,2,3,5,8} +set2 = {1,3,5,7,9} +print(set1 | set2) +print(set1&set2) +print(set1 - set2) +print(set2 - set1) +print(set1 ^ set2) + +set1 = {1,2,3,5,8} +set2 = {1,3,5} +print(set2.issubset(set1)) +print(set1.issuperset(set2)) +print(set2 == set1) +print(set2 != set1) \ No newline at end of file diff --git a/m8_tuple_set_dict/tupple_1.py b/m8_tuple_set_dict/tupple_1.py new file mode 100644 index 0000000..1cca21b --- /dev/null +++ b/m8_tuple_set_dict/tupple_1.py @@ -0,0 +1,24 @@ +tuple1 = (1,2,3,4,5,6) +tuple2 = ('Python','C','Java') + +print(tuple2[0]) + +for i in tuple2: + print (i,end=' ') +print() +for i in range(len(tuple2)): + print(i,tuple2[i]) +print(sum(tuple1)) +print(tuple1.count(5)) +print(tuple1.index(1)) +print('C' in tuple2) + +list1 = ['pp','ss','ls'] +tuple3 = tuple(list1) +print(tuple3) + +tuple1 += (7,) +print(tuple1) +tuple1 +=(7,8) +print(tuple1) + diff --git a/m9_exception/exception_1.py b/m9_exception/exception_1.py new file mode 100644 index 0000000..0169e77 --- /dev/null +++ b/m9_exception/exception_1.py @@ -0,0 +1,5 @@ +try: + num = int(input('input number:')) + print('{} is a {}'.format(num,'odd' if num%2 else 'even')) +except ValueError as e : + print(e) \ No newline at end of file diff --git a/m9_exception/exception_2.py b/m9_exception/exception_2.py new file mode 100644 index 0000000..a777b93 --- /dev/null +++ b/m9_exception/exception_2.py @@ -0,0 +1,5 @@ +try: + num = int(input('input number:')) + print('{} is a {}'.format(num,'odd' if num%2 else 'even')) +except ValueError as e : + print("please in put a number no a string !") \ No newline at end of file diff --git a/m9_exception/finally.py b/m9_exception/finally.py new file mode 100644 index 0000000..99b504e --- /dev/null +++ b/m9_exception/finally.py @@ -0,0 +1,18 @@ +try: + n1,n2 = eval(input("Enter 2 numbers to divide : ")) + div = n1 / n2 + print('{} / {} = {} '.format(n1,n2,div)) +except ZeroDivisionError: + print('Division error') +except SyntaxError: + print('Comma is missing') +except NameError: + print('Input number!!!!') +except: + print('Something wrong') +else: + print('No exception') +finally: + print('Must be done') + + diff --git a/m9_exception/raise.py b/m9_exception/raise.py new file mode 100644 index 0000000..6b6c684 --- /dev/null +++ b/m9_exception/raise.py @@ -0,0 +1,7 @@ +try: + num = int(input('input 0 ~100:')) + if num < 0 or num > 100: + raise ValueError + print('score is {}'.format(num)) +except ValueError as e : + print("input number out of range '{}'".format(num)) \ No newline at end of file diff --git a/venv/Lib/site-packages/mysql/__init__.py b/venv/Lib/site-packages/mysql/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/venv/Lib/site-packages/mysql/__pycache__/__init__.cpython-36.pyc b/venv/Lib/site-packages/mysql/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..4730699 Binary files /dev/null and b/venv/Lib/site-packages/mysql/__pycache__/__init__.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__init__.py b/venv/Lib/site-packages/mysql/connector/__init__.py new file mode 100644 index 0000000..93dbad1 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/__init__.py @@ -0,0 +1,201 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +""" +MySQL Connector/Python - MySQL driver written in Python +""" + +try: + import _mysql_connector # pylint: disable=F0401 + from .connection_cext import CMySQLConnection +except ImportError: + HAVE_CEXT = False +else: + HAVE_CEXT = True + +from . import version +from .connection import MySQLConnection +from .errors import ( # pylint: disable=W0622 + Error, Warning, InterfaceError, DatabaseError, + NotSupportedError, DataError, IntegrityError, ProgrammingError, + OperationalError, InternalError, custom_error_exception, PoolError) +from .constants import FieldFlag, FieldType, CharacterSet, \ + RefreshOption, ClientFlag +from .dbapi import ( + Date, Time, Timestamp, Binary, DateFromTicks, + TimestampFromTicks, TimeFromTicks, + STRING, BINARY, NUMBER, DATETIME, ROWID, + apilevel, threadsafety, paramstyle) +from .optionfiles import read_option_files + +_CONNECTION_POOLS = {} + +def _get_pooled_connection(**kwargs): + """Return a pooled MySQL connection""" + # If no pool name specified, generate one + from .pooling import ( + MySQLConnectionPool, generate_pool_name, + CONNECTION_POOL_LOCK) + + try: + pool_name = kwargs['pool_name'] + except KeyError: + pool_name = generate_pool_name(**kwargs) + + # Setup the pool, ensuring only 1 thread can update at a time + with CONNECTION_POOL_LOCK: + if pool_name not in _CONNECTION_POOLS: + _CONNECTION_POOLS[pool_name] = MySQLConnectionPool(**kwargs) + elif isinstance(_CONNECTION_POOLS[pool_name], MySQLConnectionPool): + # pool_size must be the same + check_size = _CONNECTION_POOLS[pool_name].pool_size + if ('pool_size' in kwargs + and kwargs['pool_size'] != check_size): + raise PoolError("Size can not be changed " + "for active pools.") + + # Return pooled connection + try: + return _CONNECTION_POOLS[pool_name].get_connection() + except AttributeError: + raise InterfaceError( + "Failed getting connection from pool '{0}'".format(pool_name)) + + +def _get_failover_connection(**kwargs): + """Return a MySQL connection and try to failover if needed + + An InterfaceError is raise when no MySQL is available. ValueError is + raised when the failover server configuration contains an illegal + connection argument. Supported arguments are user, password, host, port, + unix_socket and database. ValueError is also raised when the failover + argument was not provided. + + Returns MySQLConnection instance. + """ + config = kwargs.copy() + try: + failover = config['failover'] + except KeyError: + raise ValueError('failover argument not provided') + del config['failover'] + + support_cnx_args = set( + ['user', 'password', 'host', 'port', 'unix_socket', + 'database', 'pool_name', 'pool_size']) + + # First check if we can add all use the configuration + for server in failover: + diff = set(server.keys()) - support_cnx_args + if diff: + raise ValueError( + "Unsupported connection argument {0} in failover: {1}".format( + 's' if len(diff) > 1 else '', + ', '.join(diff))) + + for server in failover: + new_config = config.copy() + new_config.update(server) + try: + return connect(**new_config) + except Error: + # If we failed to connect, we try the next server + pass + + raise InterfaceError("Could not failover: no MySQL server available") + + +def connect(*args, **kwargs): + """Create or get a MySQL connection object + + In its simpliest form, Connect() will open a connection to a + MySQL server and return a MySQLConnection object. + + When any connection pooling arguments are given, for example pool_name + or pool_size, a pool is created or a previously one is used to return + a PooledMySQLConnection. + + Returns MySQLConnection or PooledMySQLConnection. + """ + # Option files + if 'option_files' in kwargs: + new_config = read_option_files(**kwargs) + return connect(**new_config) + + # Failover + if 'failover' in kwargs: + return _get_failover_connection(**kwargs) + + # Pooled connections + try: + from .constants import CNX_POOL_ARGS + if any([key in kwargs for key in CNX_POOL_ARGS]): + return _get_pooled_connection(**kwargs) + except NameError: + # No pooling + pass + + # Use C Extension by default + use_pure = kwargs.get('use_pure', False) + if 'use_pure' in kwargs: + del kwargs['use_pure'] # Remove 'use_pure' from kwargs + if not use_pure and not HAVE_CEXT: + raise ImportError("MySQL Connector/Python C Extension not " + "available") + + if HAVE_CEXT and not use_pure: + return CMySQLConnection(*args, **kwargs) + return MySQLConnection(*args, **kwargs) +Connect = connect # pylint: disable=C0103 + +__version_info__ = version.VERSION +__version__ = version.VERSION_TEXT + +__all__ = [ + 'MySQLConnection', 'Connect', 'custom_error_exception', + + # Some useful constants + 'FieldType', 'FieldFlag', 'ClientFlag', 'CharacterSet', 'RefreshOption', + 'HAVE_CEXT', + + # Error handling + 'Error', 'Warning', + 'InterfaceError', 'DatabaseError', + 'NotSupportedError', 'DataError', 'IntegrityError', 'ProgrammingError', + 'OperationalError', 'InternalError', + + # DBAPI PEP 249 required exports + 'connect', 'apilevel', 'threadsafety', 'paramstyle', + 'Date', 'Time', 'Timestamp', 'Binary', + 'DateFromTicks', 'DateFromTicks', 'TimestampFromTicks', 'TimeFromTicks', + 'STRING', 'BINARY', 'NUMBER', + 'DATETIME', 'ROWID', + + # C Extension + 'CMySQLConnection', + ] diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/__init__.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..61bd7fc Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/__init__.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/abstracts.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/abstracts.cpython-36.pyc new file mode 100644 index 0000000..1b20031 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/abstracts.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/authentication.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/authentication.cpython-36.pyc new file mode 100644 index 0000000..f09050f Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/authentication.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/catch23.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/catch23.cpython-36.pyc new file mode 100644 index 0000000..d522071 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/catch23.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/charsets.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/charsets.cpython-36.pyc new file mode 100644 index 0000000..0882e78 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/charsets.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/connection.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/connection.cpython-36.pyc new file mode 100644 index 0000000..43994a0 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/connection.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/constants.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/constants.cpython-36.pyc new file mode 100644 index 0000000..82e67e1 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/constants.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/conversion.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/conversion.cpython-36.pyc new file mode 100644 index 0000000..5ef32a4 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/conversion.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/cursor.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/cursor.cpython-36.pyc new file mode 100644 index 0000000..d1b428a Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/cursor.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/custom_types.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/custom_types.cpython-36.pyc new file mode 100644 index 0000000..59f106e Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/custom_types.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/dbapi.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/dbapi.cpython-36.pyc new file mode 100644 index 0000000..2000e5c Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/dbapi.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/errorcode.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/errorcode.cpython-36.pyc new file mode 100644 index 0000000..a922f6c Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/errorcode.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/errors.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/errors.cpython-36.pyc new file mode 100644 index 0000000..a04861b Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/errors.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/network.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/network.cpython-36.pyc new file mode 100644 index 0000000..732a4fc Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/network.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/optionfiles.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/optionfiles.cpython-36.pyc new file mode 100644 index 0000000..5e445cc Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/optionfiles.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/protocol.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/protocol.cpython-36.pyc new file mode 100644 index 0000000..f615075 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/protocol.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/utils.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/utils.cpython-36.pyc new file mode 100644 index 0000000..5c72fe4 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/utils.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/__pycache__/version.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/__pycache__/version.cpython-36.pyc new file mode 100644 index 0000000..4a4c38b Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/__pycache__/version.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/abstracts.py b/venv/Lib/site-packages/mysql/connector/abstracts.py new file mode 100644 index 0000000..a42b63f --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/abstracts.py @@ -0,0 +1,1177 @@ +# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Module gathering all abstract base classes""" + +from abc import ABCMeta, abstractmethod, abstractproperty +import re +import time +import weakref + +from .catch23 import make_abc, BYTE_TYPES +from .conversion import MySQLConverterBase +from .constants import ClientFlag, CharacterSet, DEFAULT_CONFIGURATION +from .optionfiles import MySQLOptionsParser +from . import errors + +NAMED_TUPLE_CACHE = weakref.WeakValueDictionary() + +@make_abc(ABCMeta) +class MySQLConnectionAbstract(object): + + """Abstract class for classes connecting to a MySQL server""" + + def __init__(self, **kwargs): + """Initialize""" + self._client_flags = ClientFlag.get_default() + self._charset_id = 45 + self._sql_mode = None + self._time_zone = None + self._autocommit = False + self._server_version = None + self._handshake = None + + self._user = '' + self._password = '' + self._database = '' + self._host = '127.0.0.1' + self._port = 3306 + self._unix_socket = None + self._client_host = '' + self._client_port = 0 + self._ssl = {} + self._ssl_disabled = DEFAULT_CONFIGURATION["ssl_disabled"] + self._force_ipv6 = False + + self._use_unicode = True + self._get_warnings = False + self._raise_on_warnings = False + self._connection_timeout = DEFAULT_CONFIGURATION["connect_timeout"] + self._buffered = False + self._unread_result = False + self._have_next_result = False + self._raw = False + self._in_transaction = False + + self._prepared_statements = None + + self._ssl_active = False + self._auth_plugin = None + self._pool_config_version = None + self.converter = None + self._converter_class = None + self._compress = False + + self._consume_results = False + + def _get_self(self): + """Return self for weakref.proxy + + This method is used when the original object is needed when using + weakref.proxy. + """ + return self + + def _read_option_files(self, config): + """ + Read option files for connection parameters. + + Checks if connection arguments contain option file arguments, and then + reads option files accordingly. + """ + if 'option_files' in config: + try: + if isinstance(config['option_groups'], str): + config['option_groups'] = [config['option_groups']] + groups = config['option_groups'] + del config['option_groups'] + except KeyError: + groups = ['client', 'connector_python'] + + if isinstance(config['option_files'], str): + config['option_files'] = [config['option_files']] + option_parser = MySQLOptionsParser(list(config['option_files']), + keep_dashes=False) + del config['option_files'] + + config_from_file = option_parser.get_groups_as_dict_with_priority( + *groups) + config_options = {} + for group in groups: + try: + for option, value in config_from_file[group].items(): + try: + if option == 'socket': + option = 'unix_socket' + # pylint: disable=W0104 + DEFAULT_CONFIGURATION[option] + # pylint: enable=W0104 + + if (option not in config_options or + config_options[option][1] <= value[1]): + config_options[option] = value + except KeyError: + if group == 'connector_python': + raise AttributeError("Unsupported argument " + "'{0}'".format(option)) + except KeyError: + continue + + for option, value in config_options.items(): + if option not in config: + try: + config[option] = eval(value[0]) # pylint: disable=W0123 + except (NameError, SyntaxError): + config[option] = value[0] + return config + + @property + def user(self): + """User used while connecting to MySQL""" + return self._user + + @property + def server_host(self): + """MySQL server IP address or name""" + return self._host + + @property + def server_port(self): + "MySQL server TCP/IP port" + return self._port + + @property + def unix_socket(self): + "MySQL Unix socket file location" + return self._unix_socket + + @abstractproperty + def database(self): + """Get the current database""" + pass + + @database.setter + def database(self, value): + """Set the current database""" + self.cmd_query("USE %s" % value) + + @property + def can_consume_results(self): + """Returns whether to consume results""" + return self._consume_results + + def config(self, **kwargs): + """Configure the MySQL Connection + + This method allows you to configure the MySQLConnection instance. + + Raises on errors. + """ + config = kwargs.copy() + if 'dsn' in config: + raise errors.NotSupportedError("Data source name is not supported") + + # Read option files + self._read_option_files(config) + + # Configure how we handle MySQL warnings + try: + self.get_warnings = config['get_warnings'] + del config['get_warnings'] + except KeyError: + pass # Leave what was set or default + try: + self.raise_on_warnings = config['raise_on_warnings'] + del config['raise_on_warnings'] + except KeyError: + pass # Leave what was set or default + + # Configure client flags + try: + default = ClientFlag.get_default() + self.set_client_flags(config['client_flags'] or default) + del config['client_flags'] + except KeyError: + pass # Missing client_flags-argument is OK + + try: + if config['compress']: + self._compress = True + self.set_client_flags([ClientFlag.COMPRESS]) + except KeyError: + pass # Missing compress argument is OK + + allow_local_infile = config.get( + 'allow_local_infile', DEFAULT_CONFIGURATION['allow_local_infile']) + if allow_local_infile: + self.set_client_flags([ClientFlag.LOCAL_FILES]) + else: + self.set_client_flags([-ClientFlag.LOCAL_FILES]) + + try: + if not config['consume_results']: + self._consume_results = False + else: + self._consume_results = True + except KeyError: + self._consume_results = False + + # Configure auth_plugin + try: + self._auth_plugin = config['auth_plugin'] + del config['auth_plugin'] + except KeyError: + self._auth_plugin = '' + + # Configure character set and collation + if 'charset' in config or 'collation' in config: + try: + charset = config['charset'] + del config['charset'] + except KeyError: + charset = None + try: + collation = config['collation'] + del config['collation'] + except KeyError: + collation = None + self._charset_id = CharacterSet.get_charset_info(charset, + collation)[0] + + # Set converter class + try: + self.set_converter_class(config['converter_class']) + except KeyError: + pass # Using default converter class + except TypeError: + raise AttributeError("Converter class should be a subclass " + "of conversion.MySQLConverterBase.") + + # Compatible configuration with other drivers + compat_map = [ + # (,) + ('db', 'database'), + ('passwd', 'password'), + ('connect_timeout', 'connection_timeout'), + ] + for compat, translate in compat_map: + try: + if translate not in config: + config[translate] = config[compat] + del config[compat] + except KeyError: + pass # Missing compat argument is OK + + # Configure login information + if 'user' in config or 'password' in config: + try: + user = config['user'] + del config['user'] + except KeyError: + user = self._user + try: + password = config['password'] + del config['password'] + except KeyError: + password = self._password + self.set_login(user, password) + + # Configure host information + if 'host' in config and config['host']: + self._host = config['host'] + + # Check network locations + try: + self._port = int(config['port']) + del config['port'] + except KeyError: + pass # Missing port argument is OK + except ValueError: + raise errors.InterfaceError( + "TCP/IP port number should be an integer") + + if "ssl_disabled" in config: + self._ssl_disabled = config.pop("ssl_disabled") + + # Other configuration + set_ssl_flag = False + for key, value in config.items(): + try: + DEFAULT_CONFIGURATION[key] + except KeyError: + raise AttributeError("Unsupported argument '{0}'".format(key)) + # SSL Configuration + if key.startswith('ssl_'): + set_ssl_flag = True + self._ssl.update({key.replace('ssl_', ''): value}) + else: + attribute = '_' + key + try: + setattr(self, attribute, value.strip()) + except AttributeError: + setattr(self, attribute, value) + + if set_ssl_flag: + if 'verify_cert' not in self._ssl: + self._ssl['verify_cert'] = \ + DEFAULT_CONFIGURATION['ssl_verify_cert'] + if 'verify_identity' not in self._ssl: + self._ssl['verify_identity'] = \ + DEFAULT_CONFIGURATION['ssl_verify_identity'] + # Make sure both ssl_key/ssl_cert are set, or neither (XOR) + if 'ca' not in self._ssl or self._ssl['ca'] is None: + raise AttributeError( + "Missing ssl_ca argument.") + if bool('key' in self._ssl) != bool('cert' in self._ssl): + raise AttributeError( + "ssl_key and ssl_cert need to be both " + "specified, or neither." + ) + # Make sure key/cert are set to None + elif not set(('key', 'cert')) <= set(self._ssl): + self._ssl['key'] = None + self._ssl['cert'] = None + elif (self._ssl['key'] is None) != (self._ssl['cert'] is None): + raise AttributeError( + "ssl_key and ssl_cert need to be both " + "set, or neither." + ) + + def _check_server_version(self, server_version): + """Check the MySQL version + + This method will check the MySQL version and raise an InterfaceError + when it is not supported or invalid. It will return the version + as a tuple with major, minor and patch. + + Raises InterfaceError if invalid server version. + + Returns tuple + """ + if isinstance(server_version, BYTE_TYPES): + server_version = server_version.decode() + + # pylint: disable=W1401 + regex_ver = re.compile(r"^(\d{1,2})\.(\d{1,2})\.(\d{1,3})(.*)") + # pylint: enable=W1401 + match = regex_ver.match(server_version) + if not match: + raise errors.InterfaceError("Failed parsing MySQL version") + + version = tuple([int(v) for v in match.groups()[0:3]]) + if version < (4, 1): + raise errors.InterfaceError( + "MySQL Version '{0}' is not supported.".format(server_version)) + + return version + + def get_server_version(self): + """Get the MySQL version + + This method returns the MySQL server version as a tuple. If not + previously connected, it will return None. + + Returns a tuple or None. + """ + return self._server_version + + def get_server_info(self): + """Get the original MySQL version information + + This method returns the original MySQL server as text. If not + previously connected, it will return None. + + Returns a string or None. + """ + try: + return self._handshake['server_version_original'] + except (TypeError, KeyError): + return None + + @abstractproperty + def in_transaction(self): + """MySQL session has started a transaction""" + pass + + def set_client_flags(self, flags): + """Set the client flags + + The flags-argument can be either an int or a list (or tuple) of + ClientFlag-values. If it is an integer, it will set client_flags + to flags as is. + If flags is a list (or tuple), each flag will be set or unset + when it's negative. + + set_client_flags([ClientFlag.FOUND_ROWS,-ClientFlag.LONG_FLAG]) + + Raises ProgrammingError when the flags argument is not a set or + an integer bigger than 0. + + Returns self.client_flags + """ + if isinstance(flags, int) and flags > 0: + self._client_flags = flags + elif isinstance(flags, (tuple, list)): + for flag in flags: + if flag < 0: + self._client_flags &= ~abs(flag) + else: + self._client_flags |= flag + else: + raise errors.ProgrammingError( + "set_client_flags expect integer (>0) or set") + return self._client_flags + + def isset_client_flag(self, flag): + """Check if a client flag is set""" + if (self._client_flags & flag) > 0: + return True + return False + + @property + def time_zone(self): + """Get the current time zone""" + return self.info_query("SELECT @@session.time_zone")[0] + + @time_zone.setter + def time_zone(self, value): + """Set the time zone""" + self.cmd_query("SET @@session.time_zone = '{0}'".format(value)) + self._time_zone = value + + @property + def sql_mode(self): + """Get the SQL mode""" + return self.info_query("SELECT @@session.sql_mode")[0] + + @sql_mode.setter + def sql_mode(self, value): + """Set the SQL mode + + This method sets the SQL Mode for the current connection. The value + argument can be either a string with comma separate mode names, or + a sequence of mode names. + + It is good practice to use the constants class SQLMode: + from mysql.connector.constants import SQLMode + cnx.sql_mode = [SQLMode.NO_ZERO_DATE, SQLMode.REAL_AS_FLOAT] + """ + if isinstance(value, (list, tuple)): + value = ','.join(value) + self.cmd_query("SET @@session.sql_mode = '{0}'".format(value)) + self._sql_mode = value + + @abstractmethod + def info_query(self, query): + """Send a query which only returns 1 row""" + pass + + def set_login(self, username=None, password=None): + """Set login information for MySQL + + Set the username and/or password for the user connecting to + the MySQL Server. + """ + if username is not None: + self._user = username.strip() + else: + self._user = '' + if password is not None: + self._password = password + else: + self._password = '' + + def set_unicode(self, value=True): + """Toggle unicode mode + + Set whether we return string fields as unicode or not. + Default is True. + """ + self._use_unicode = value + if self.converter: + self.converter.set_unicode(value) + + @property + def autocommit(self): + """Get whether autocommit is on or off""" + value = self.info_query("SELECT @@session.autocommit")[0] + return True if value == 1 else False + + @autocommit.setter + def autocommit(self, value): + """Toggle autocommit""" + switch = 'ON' if value else 'OFF' + self.cmd_query("SET @@session.autocommit = {0}".format(switch)) + self._autocommit = value + + @property + def get_warnings(self): + """Get whether this connection retrieves warnings automatically + + This method returns whether this connection retrieves warnings + automatically. + + Returns True, or False when warnings are not retrieved. + """ + return self._get_warnings + + @get_warnings.setter + def get_warnings(self, value): + """Set whether warnings should be automatically retrieved + + The toggle-argument must be a boolean. When True, cursors for this + connection will retrieve information about warnings (if any). + + Raises ValueError on error. + """ + if not isinstance(value, bool): + raise ValueError("Expected a boolean type") + self._get_warnings = value + + @property + def raise_on_warnings(self): + """Get whether this connection raises an error on warnings + + This method returns whether this connection will raise errors when + MySQL reports warnings. + + Returns True or False. + """ + return self._raise_on_warnings + + @raise_on_warnings.setter + def raise_on_warnings(self, value): + """Set whether warnings raise an error + + The toggle-argument must be a boolean. When True, cursors for this + connection will raise an error when MySQL reports warnings. + + Raising on warnings implies retrieving warnings automatically. In + other words: warnings will be set to True. If set to False, warnings + will be also set to False. + + Raises ValueError on error. + """ + if not isinstance(value, bool): + raise ValueError("Expected a boolean type") + self._raise_on_warnings = value + self._get_warnings = value + + + @property + def unread_result(self): + """Get whether there is an unread result + + This method is used by cursors to check whether another cursor still + needs to retrieve its result set. + + Returns True, or False when there is no unread result. + """ + return self._unread_result + + @unread_result.setter + def unread_result(self, value): + """Set whether there is an unread result + + This method is used by cursors to let other cursors know there is + still a result set that needs to be retrieved. + + Raises ValueError on errors. + """ + if not isinstance(value, bool): + raise ValueError("Expected a boolean type") + self._unread_result = value + + @property + def charset(self): + """Returns the character set for current connection + + This property returns the character set name of the current connection. + The server is queried when the connection is active. If not connected, + the configured character set name is returned. + + Returns a string. + """ + return CharacterSet.get_info(self._charset_id)[0] + + @property + def python_charset(self): + """Returns the Python character set for current connection + + This property returns the character set name of the current connection. + Note that, unlike property charset, this checks if the previously set + character set is supported by Python and if not, it returns the + equivalent character set that Python supports. + + Returns a string. + """ + encoding = CharacterSet.get_info(self._charset_id)[0] + if encoding in ('utf8mb4', 'binary'): + return 'utf8' + return encoding + + def set_charset_collation(self, charset=None, collation=None): + """Sets the character set and collation for the current connection + + This method sets the character set and collation to be used for + the current connection. The charset argument can be either the + name of a character set as a string, or the numerical equivalent + as defined in constants.CharacterSet. + + When the collation is not given, the default will be looked up and + used. + + For example, the following will set the collation for the latin1 + character set to latin1_general_ci: + + set_charset('latin1','latin1_general_ci') + + """ + if charset: + if isinstance(charset, int): + (self._charset_id, charset_name, collation_name) = \ + CharacterSet.get_charset_info(charset) + elif isinstance(charset, str): + (self._charset_id, charset_name, collation_name) = \ + CharacterSet.get_charset_info(charset, collation) + else: + raise ValueError( + "charset should be either integer, string or None") + elif collation: + (self._charset_id, charset_name, collation_name) = \ + CharacterSet.get_charset_info(collation=collation) + + self._execute_query("SET NAMES '{0}' COLLATE '{1}'".format( + charset_name, collation_name)) + + try: + # Required for C Extension + self.set_character_set_name(charset_name) # pylint: disable=E1101 + except AttributeError: + # Not required for pure Python connection + pass + + if self.converter: + self.converter.set_charset(charset_name) + + @property + def collation(self): + """Returns the collation for current connection + + This property returns the collation name of the current connection. + The server is queried when the connection is active. If not connected, + the configured collation name is returned. + + Returns a string. + """ + return CharacterSet.get_charset_info(self._charset_id)[2] + + @abstractmethod + def _do_handshake(self): + """Gather information of the MySQL server before authentication""" + pass + + @abstractmethod + def _open_connection(self): + """Open the connection to the MySQL server""" + pass + + def _post_connection(self): + """Executes commands after connection has been established + + This method executes commands after the connection has been + established. Some setting like autocommit, character set, and SQL mode + are set using this method. + """ + self.set_charset_collation(self._charset_id) + self.autocommit = self._autocommit + if self._time_zone: + self.time_zone = self._time_zone + if self._sql_mode: + self.sql_mode = self._sql_mode + + @abstractmethod + def disconnect(self): + """Disconnect from the MySQL server""" + pass + close = disconnect + + def connect(self, **kwargs): + """Connect to the MySQL server + + This method sets up the connection to the MySQL server. If no + arguments are given, it will use the already configured or default + values. + """ + if kwargs: + self.config(**kwargs) + + self.disconnect() + self._open_connection() + self._post_connection() + + def reconnect(self, attempts=1, delay=0): + """Attempt to reconnect to the MySQL server + + The argument attempts should be the number of times a reconnect + is tried. The delay argument is the number of seconds to wait between + each retry. + + You may want to set the number of attempts higher and use delay when + you expect the MySQL server to be down for maintenance or when you + expect the network to be temporary unavailable. + + Raises InterfaceError on errors. + """ + counter = 0 + while counter != attempts: + counter = counter + 1 + try: + self.disconnect() + self.connect() + if self.is_connected(): + break + except Exception as err: # pylint: disable=W0703 + if counter == attempts: + msg = "Can not reconnect to MySQL after {0} "\ + "attempt(s): {1}".format(attempts, str(err)) + raise errors.InterfaceError(msg) + if delay > 0: + time.sleep(delay) + + @abstractmethod + def is_connected(self): + """Reports whether the connection to MySQL Server is available""" + pass + + @abstractmethod + def ping(self, reconnect=False, attempts=1, delay=0): + """Check availability of the MySQL server""" + pass + + @abstractmethod + def commit(self): + """Commit current transaction""" + pass + + @abstractmethod + def cursor(self, buffered=None, raw=None, prepared=None, cursor_class=None, + dictionary=None, named_tuple=None): + """Instantiates and returns a cursor""" + pass + + @abstractmethod + def _execute_query(self, query): + """Execute a query""" + pass + + @abstractmethod + def rollback(self): + """Rollback current transaction""" + pass + + def start_transaction(self, consistent_snapshot=False, + isolation_level=None, readonly=None): + """Start a transaction + + This method explicitly starts a transaction sending the + START TRANSACTION statement to the MySQL server. You can optionally + set whether there should be a consistent snapshot, which + isolation level you need or which access mode i.e. READ ONLY or + READ WRITE. + + For example, to start a transaction with isolation level SERIALIZABLE, + you would do the following: + >>> cnx = mysql.connector.connect(..) + >>> cnx.start_transaction(isolation_level='SERIALIZABLE') + + Raises ProgrammingError when a transaction is already in progress + and when ValueError when isolation_level specifies an Unknown + level. + """ + if self.in_transaction: + raise errors.ProgrammingError("Transaction already in progress") + + if isolation_level: + level = isolation_level.strip().replace('-', ' ').upper() + levels = ['READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', + 'SERIALIZABLE'] + + if level not in levels: + raise ValueError( + 'Unknown isolation level "{0}"'.format(isolation_level)) + + self._execute_query( + "SET TRANSACTION ISOLATION LEVEL {0}".format(level)) + + if readonly is not None: + if self._server_version < (5, 6, 5): + raise ValueError( + "MySQL server version {0} does not support " + "this feature".format(self._server_version)) + + if readonly: + access_mode = 'READ ONLY' + else: + access_mode = 'READ WRITE' + self._execute_query( + "SET TRANSACTION {0}".format(access_mode)) + + query = "START TRANSACTION" + if consistent_snapshot: + query += " WITH CONSISTENT SNAPSHOT" + self.cmd_query(query) + + def reset_session(self, user_variables=None, session_variables=None): + """Clears the current active session + + This method resets the session state, if the MySQL server is 5.7.3 + or later active session will be reset without re-authenticating. + For other server versions session will be reset by re-authenticating. + + It is possible to provide a sequence of variables and their values to + be set after clearing the session. This is possible for both user + defined variables and session variables. + This method takes two arguments user_variables and session_variables + which are dictionaries. + + Raises OperationalError if not connected, InternalError if there are + unread results and InterfaceError on errors. + """ + if not self.is_connected(): + raise errors.OperationalError("MySQL Connection not available.") + + try: + self.cmd_reset_connection() + except (errors.NotSupportedError, NotImplementedError): + if self._compress: + raise errors.NotSupportedError( + "Reset session is not supported with compression for " + "MySQL server version 5.7.2 or earlier.") + else: + self.cmd_change_user(self._user, self._password, + self._database, self._charset_id) + + if user_variables or session_variables: + cur = self.cursor() + if user_variables: + for key, value in user_variables.items(): + cur.execute("SET @`{0}` = %s".format(key), (value,)) + if session_variables: + for key, value in session_variables.items(): + cur.execute("SET SESSION `{0}` = %s".format(key), (value,)) + cur.close() + + def set_converter_class(self, convclass): + """ + Set the converter class to be used. This should be a class overloading + methods and members of conversion.MySQLConverter. + """ + if convclass and issubclass(convclass, MySQLConverterBase): + charset_name = CharacterSet.get_info(self._charset_id)[0] + self._converter_class = convclass + self.converter = convclass(charset_name, self._use_unicode) + else: + raise TypeError("Converter class should be a subclass " + "of conversion.MySQLConverterBase.") + + @abstractmethod + def get_rows(self, count=None, binary=False, columns=None, raw=None): + """Get all rows returned by the MySQL server""" + pass + + def cmd_init_db(self, database): + """Change the current database""" + raise NotImplementedError + + def cmd_query(self, query, raw=False, buffered=False, raw_as_string=False): + """Send a query to the MySQL server""" + raise NotImplementedError + + def cmd_query_iter(self, statements): + """Send one or more statements to the MySQL server""" + raise NotImplementedError + + def cmd_refresh(self, options): + """Send the Refresh command to the MySQL server""" + raise NotImplementedError + + def cmd_quit(self): + """Close the current connection with the server""" + raise NotImplementedError + + def cmd_shutdown(self, shutdown_type=None): + """Shut down the MySQL Server""" + raise NotImplementedError + + def cmd_statistics(self): + """Send the statistics command to the MySQL Server""" + raise NotImplementedError + + def cmd_process_info(self): + """Get the process list of the MySQL Server + + This method is a placeholder to notify that the PROCESS_INFO command + is not supported by raising the NotSupportedError. The command + "SHOW PROCESSLIST" should be send using the cmd_query()-method or + using the INFORMATION_SCHEMA database. + + Raises NotSupportedError exception + """ + raise errors.NotSupportedError( + "Not implemented. Use SHOW PROCESSLIST or INFORMATION_SCHEMA") + + def cmd_process_kill(self, mysql_pid): + """Kill a MySQL process""" + raise NotImplementedError + + def cmd_debug(self): + """Send the DEBUG command""" + raise NotImplementedError + + def cmd_ping(self): + """Send the PING command""" + raise NotImplementedError + + def cmd_change_user(self, username='', password='', database='', + charset=45): + """Change the current logged in user""" + raise NotImplementedError + + def cmd_stmt_prepare(self, statement): + """Prepare a MySQL statement""" + raise NotImplementedError + + def cmd_stmt_execute(self, statement_id, data=(), parameters=(), flags=0): + """Execute a prepared MySQL statement""" + raise NotImplementedError + + def cmd_stmt_close(self, statement_id): + """Deallocate a prepared MySQL statement""" + raise NotImplementedError + + def cmd_stmt_send_long_data(self, statement_id, param_id, data): + """Send data for a column""" + raise NotImplementedError + + def cmd_stmt_reset(self, statement_id): + """Reset data for prepared statement sent as long data""" + raise NotImplementedError + + def cmd_reset_connection(self): + """Resets the session state without re-authenticating""" + raise NotImplementedError + + +@make_abc(ABCMeta) +class MySQLCursorAbstract(object): + """Abstract cursor class + + Abstract class defining cursor class with method and members + required by the Python Database API Specification v2.0. + """ + def __init__(self): + """Initialization""" + self._description = None + self._rowcount = -1 + self._last_insert_id = None + self._warnings = None + self.arraysize = 1 + + @abstractmethod + def callproc(self, procname, args=()): + """Calls a stored procedure with the given arguments + + The arguments will be set during this session, meaning + they will be called like ___arg where + is an enumeration (+1) of the arguments. + + Coding Example: + 1) Defining the Stored Routine in MySQL: + CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT) + BEGIN + SET pProd := pFac1 * pFac2; + END + + 2) Executing in Python: + args = (5,5,0) # 0 is to hold pprod + cursor.callproc('multiply', args) + print(cursor.fetchone()) + + Does not return a value, but a result set will be + available when the CALL-statement execute successfully. + Raises exceptions when something is wrong. + """ + pass + + @abstractmethod + def close(self): + """Close the cursor.""" + pass + + @abstractmethod + def execute(self, operation, params=(), multi=False): + """Executes the given operation + + Executes the given operation substituting any markers with + the given parameters. + + For example, getting all rows where id is 5: + cursor.execute("SELECT * FROM t1 WHERE id = %s", (5,)) + + The multi argument should be set to True when executing multiple + statements in one operation. If not set and multiple results are + found, an InterfaceError will be raised. + + If warnings where generated, and connection.get_warnings is True, then + self._warnings will be a list containing these warnings. + + Returns an iterator when multi is True, otherwise None. + """ + pass + + @abstractmethod + def executemany(self, operation, seq_params): + """Execute the given operation multiple times + + The executemany() method will execute the operation iterating + over the list of parameters in seq_params. + + Example: Inserting 3 new employees and their phone number + + data = [ + ('Jane','555-001'), + ('Joe', '555-001'), + ('John', '555-003') + ] + stmt = "INSERT INTO employees (name, phone) VALUES ('%s','%s')" + cursor.executemany(stmt, data) + + INSERT statements are optimized by batching the data, that is + using the MySQL multiple rows syntax. + + Results are discarded. If they are needed, consider looping over + data using the execute() method. + """ + pass + + @abstractmethod + def fetchone(self): + """Returns next row of a query result set + + Returns a tuple or None. + """ + pass + + @abstractmethod + def fetchmany(self, size=1): + """Returns the next set of rows of a query result, returning a + list of tuples. When no more rows are available, it returns an + empty list. + + The number of rows returned can be specified using the size argument, + which defaults to one + """ + pass + + @abstractmethod + def fetchall(self): + """Returns all rows of a query result set + + Returns a list of tuples. + """ + pass + + def nextset(self): + """Not Implemented.""" + pass + + def setinputsizes(self, sizes): + """Not Implemented.""" + pass + + def setoutputsize(self, size, column=None): + """Not Implemented.""" + pass + + def reset(self, free=True): + """Reset the cursor to default""" + pass + + @abstractproperty + def description(self): + """Returns description of columns in a result + + This property returns a list of tuples describing the columns in + in a result set. A tuple is described as follows:: + + (column_name, + type, + None, + None, + None, + None, + null_ok, + column_flags) # Addition to PEP-249 specs + + Returns a list of tuples. + """ + return self._description + + @abstractproperty + def rowcount(self): + """Returns the number of rows produced or affected + + This property returns the number of rows produced by queries + such as a SELECT, or affected rows when executing DML statements + like INSERT or UPDATE. + + Note that for non-buffered cursors it is impossible to know the + number of rows produced before having fetched them all. For those, + the number of rows will be -1 right after execution, and + incremented when fetching rows. + + Returns an integer. + """ + return self._rowcount + + @abstractproperty + def lastrowid(self): + """Returns the value generated for an AUTO_INCREMENT column + + Returns the value generated for an AUTO_INCREMENT column by + the previous INSERT or UPDATE statement or None when there is + no such value available. + + Returns a long value or None. + """ + return self._last_insert_id + + def fetchwarnings(self): + """Returns Warnings.""" + return self._warnings diff --git a/venv/Lib/site-packages/mysql/connector/authentication.py b/venv/Lib/site-packages/mysql/connector/authentication.py new file mode 100644 index 0000000..28e6e16 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/authentication.py @@ -0,0 +1,272 @@ +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementing support for MySQL Authentication Plugins""" + +from hashlib import sha1, sha256 +import struct + +from . import errors +from .catch23 import PY2, isstr, UNICODE_TYPES + + +class BaseAuthPlugin(object): + """Base class for authentication plugins + + + Classes inheriting from BaseAuthPlugin should implement the method + prepare_password(). When instantiating, auth_data argument is + required. The username, password and database are optional. The + ssl_enabled argument can be used to tell the plugin whether SSL is + active or not. + + The method auth_response() method is used to retrieve the password + which was prepared by prepare_password(). + """ + + requires_ssl = False + plugin_name = '' + + def __init__(self, auth_data, username=None, password=None, database=None, + ssl_enabled=False): + """Initialization""" + self._auth_data = auth_data + self._username = username + self._password = password + self._database = database + self._ssl_enabled = ssl_enabled + + def prepare_password(self): + """Prepares and returns password to be send to MySQL + + This method needs to be implemented by classes inheriting from + this class. It is used by the auth_response() method. + + Raises NotImplementedError. + """ + raise NotImplementedError + + def auth_response(self): + """Returns the prepared password to send to MySQL + + Raises InterfaceError on errors. For example, when SSL is required + by not enabled. + + Returns str + """ + if self.requires_ssl and not self._ssl_enabled: + raise errors.InterfaceError("{name} requires SSL".format( + name=self.plugin_name)) + return self.prepare_password() + + +class MySQLNativePasswordAuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL Native Password authentication plugin""" + + requires_ssl = False + plugin_name = 'mysql_native_password' + + def prepare_password(self): + """Prepares and returns password as native MySQL 4.1+ password""" + if not self._auth_data: + raise errors.InterfaceError("Missing authentication data (seed)") + + if not self._password: + return b'' + password = self._password + + if isstr(self._password): + password = self._password.encode('utf-8') + else: + password = self._password + + if PY2: + password = buffer(password) # pylint: disable=E0602 + try: + auth_data = buffer(self._auth_data) # pylint: disable=E0602 + except TypeError: + raise errors.InterfaceError("Authentication data incorrect") + else: + password = password + auth_data = self._auth_data + + hash4 = None + try: + hash1 = sha1(password).digest() + hash2 = sha1(hash1).digest() + hash3 = sha1(auth_data + hash2).digest() + if PY2: + xored = [ord(h1) ^ ord(h3) for (h1, h3) in zip(hash1, hash3)] + else: + xored = [h1 ^ h3 for (h1, h3) in zip(hash1, hash3)] + hash4 = struct.pack('20B', *xored) + except Exception as exc: + raise errors.InterfaceError( + "Failed scrambling password; {0}".format(exc)) + + return hash4 + + +class MySQLClearPasswordAuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL Clear Password authentication plugin""" + + requires_ssl = True + plugin_name = 'mysql_clear_password' + + def prepare_password(self): + """Returns password as as clear text""" + if not self._password: + return b'\x00' + password = self._password + + if PY2: + if isinstance(password, unicode): # pylint: disable=E0602 + password = password.encode('utf8') + elif isinstance(password, str): + password = password.encode('utf8') + + return password + b'\x00' + + +class MySQLSHA256PasswordAuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL SHA256 authentication plugin + + Note that encrypting using RSA is not supported since the Python + Standard Library does not provide this OpenSSL functionality. + """ + + requires_ssl = True + plugin_name = 'sha256_password' + + def prepare_password(self): + """Returns password as as clear text""" + if not self._password: + return b'\x00' + password = self._password + + if PY2: + if isinstance(password, unicode): # pylint: disable=E0602 + password = password.encode('utf8') + elif isinstance(password, str): + password = password.encode('utf8') + + return password + b'\x00' + + +class MySQLCachingSHA2PasswordAuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL caching_sha2_password authentication plugin + + Note that encrypting using RSA is not supported since the Python + Standard Library does not provide this OpenSSL functionality. + """ + requires_ssl = False + plugin_name = 'caching_sha2_password' + perform_full_authentication = 4 + fast_auth_success = 3 + + def _scramble(self): + """ Returns a scramble of the password using a Nonce sent by the + server. + + The scramble is of the form: + XOR(SHA2(password), SHA2(SHA2(SHA2(password)), Nonce)) + """ + if not self._auth_data: + raise errors.InterfaceError("Missing authentication data (seed)") + + if not self._password: + return b'' + + password = self._password.encode('utf-8') \ + if isinstance(self._password, UNICODE_TYPES) else self._password + + if PY2: + password = buffer(password) # pylint: disable=E0602 + try: + auth_data = buffer(self._auth_data) # pylint: disable=E0602 + except TypeError: + raise errors.InterfaceError("Authentication data incorrect") + else: + password = password + auth_data = self._auth_data + + hash1 = sha256(password).digest() + hash2 = sha256() + hash2.update(sha256(hash1).digest()) + hash2.update(auth_data) + hash2 = hash2.digest() + if PY2: + xored = [ord(h1) ^ ord(h2) for (h1, h2) in zip(hash1, hash2)] + else: + xored = [h1 ^ h2 for (h1, h2) in zip(hash1, hash2)] + hash3 = struct.pack('32B', *xored) + + return hash3 + + def prepare_password(self): + if len(self._auth_data) > 1: + return self._scramble() + elif self._auth_data[0] == self.perform_full_authentication: + return self._full_authentication() + return None + + def _full_authentication(self): + """Returns password as as clear text""" + if not self._ssl_enabled: + raise errors.InterfaceError("{name} requires SSL".format( + name=self.plugin_name)) + + if not self._password: + return b'\x00' + password = self._password + + if PY2: + if isinstance(password, unicode): # pylint: disable=E0602 + password = password.encode('utf8') + elif isinstance(password, str): + password = password.encode('utf8') + + return password + b'\x00' + + +def get_auth_plugin(plugin_name): + """Return authentication class based on plugin name + + This function returns the class for the authentication plugin plugin_name. + The returned class is a subclass of BaseAuthPlugin. + + Raises errors.NotSupportedError when plugin_name is not supported. + + Returns subclass of BaseAuthPlugin. + """ + for authclass in BaseAuthPlugin.__subclasses__(): # pylint: disable=E1101 + if authclass.plugin_name == plugin_name: + return authclass + + raise errors.NotSupportedError( + "Authentication plugin '{0}' is not supported".format(plugin_name)) diff --git a/venv/Lib/site-packages/mysql/connector/catch23.py b/venv/Lib/site-packages/mysql/connector/catch23.py new file mode 100644 index 0000000..3152414 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/catch23.py @@ -0,0 +1,116 @@ +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Python v2 to v3 migration module""" + +from decimal import Decimal +import struct +import sys + +from .custom_types import HexLiteral + +# pylint: disable=E0602,E1103 + +PY2 = sys.version_info[0] == 2 + +if PY2: + NUMERIC_TYPES = (int, float, Decimal, HexLiteral, long) + INT_TYPES = (int, long) + UNICODE_TYPES = (unicode,) + STRING_TYPES = (str, unicode) + BYTE_TYPES = (bytearray,) +else: + NUMERIC_TYPES = (int, float, Decimal, HexLiteral) + INT_TYPES = (int,) + UNICODE_TYPES = (str,) + STRING_TYPES = (str,) + BYTE_TYPES = (bytearray, bytes) + + +def init_bytearray(payload=b'', encoding='utf-8'): + """Initializes a bytearray from the payload""" + if isinstance(payload, bytearray): + return payload + + if PY2: + return bytearray(payload) + + if isinstance(payload, int): + return bytearray(payload) + elif not isinstance(payload, bytes): + try: + return bytearray(payload.encode(encoding=encoding)) + except AttributeError: + raise ValueError("payload must be a str or bytes") + + return bytearray(payload) + + +def isstr(obj): + """Returns whether a variable is a string""" + if PY2: + return isinstance(obj, basestring) + return isinstance(obj, str) + +def isunicode(obj): + """Returns whether a variable is a of unicode type""" + if PY2: + return isinstance(obj, unicode) + return isinstance(obj, str) + + +if PY2: + def struct_unpack(fmt, buf): + """Wrapper around struct.unpack handling buffer as bytes and strings""" + if isinstance(buf, (bytearray, bytes)): + return struct.unpack_from(fmt, buffer(buf)) + return struct.unpack_from(fmt, buf) +else: + struct_unpack = struct.unpack # pylint: disable=C0103 + + +def make_abc(base_class): + """Decorator used to create a abstract base class + + We use this decorator to create abstract base classes instead of + using the abc-module. The decorator makes it possible to do the + same in both Python v2 and v3 code. + """ + def wrapper(class_): + """Wrapper""" + attrs = class_.__dict__.copy() + for attr in '__dict__', '__weakref__': + attrs.pop(attr, None) # ignore missing attributes + + bases = class_.__bases__ + if PY2: + attrs['__metaclass__'] = class_ + else: + bases = (class_,) + bases + return base_class(class_.__name__, bases, attrs) + return wrapper diff --git a/venv/Lib/site-packages/mysql/connector/charsets.py b/venv/Lib/site-packages/mysql/connector/charsets.py new file mode 100644 index 0000000..05f0d9b --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/charsets.py @@ -0,0 +1,348 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2017-12-18' +_MYSQL_VERSION = (8, 0, 4) + +"""This module contains the MySQL Server Character Sets""" + +MYSQL_CHARACTER_SETS = [ + # (character set name, collation, default) + None, + ("big5", "big5_chinese_ci", True), # 1 + ("latin2", "latin2_czech_cs", False), # 2 + ("dec8", "dec8_swedish_ci", True), # 3 + ("cp850", "cp850_general_ci", True), # 4 + ("latin1", "latin1_german1_ci", False), # 5 + ("hp8", "hp8_english_ci", True), # 6 + ("koi8r", "koi8r_general_ci", True), # 7 + ("latin1", "latin1_swedish_ci", True), # 8 + ("latin2", "latin2_general_ci", True), # 9 + ("swe7", "swe7_swedish_ci", True), # 10 + ("ascii", "ascii_general_ci", True), # 11 + ("ujis", "ujis_japanese_ci", True), # 12 + ("sjis", "sjis_japanese_ci", True), # 13 + ("cp1251", "cp1251_bulgarian_ci", False), # 14 + ("latin1", "latin1_danish_ci", False), # 15 + ("hebrew", "hebrew_general_ci", True), # 16 + None, + ("tis620", "tis620_thai_ci", True), # 18 + ("euckr", "euckr_korean_ci", True), # 19 + ("latin7", "latin7_estonian_cs", False), # 20 + ("latin2", "latin2_hungarian_ci", False), # 21 + ("koi8u", "koi8u_general_ci", True), # 22 + ("cp1251", "cp1251_ukrainian_ci", False), # 23 + ("gb2312", "gb2312_chinese_ci", True), # 24 + ("greek", "greek_general_ci", True), # 25 + ("cp1250", "cp1250_general_ci", True), # 26 + ("latin2", "latin2_croatian_ci", False), # 27 + ("gbk", "gbk_chinese_ci", True), # 28 + ("cp1257", "cp1257_lithuanian_ci", False), # 29 + ("latin5", "latin5_turkish_ci", True), # 30 + ("latin1", "latin1_german2_ci", False), # 31 + ("armscii8", "armscii8_general_ci", True), # 32 + ("utf8", "utf8_general_ci", True), # 33 + ("cp1250", "cp1250_czech_cs", False), # 34 + ("ucs2", "ucs2_general_ci", True), # 35 + ("cp866", "cp866_general_ci", True), # 36 + ("keybcs2", "keybcs2_general_ci", True), # 37 + ("macce", "macce_general_ci", True), # 38 + ("macroman", "macroman_general_ci", True), # 39 + ("cp852", "cp852_general_ci", True), # 40 + ("latin7", "latin7_general_ci", True), # 41 + ("latin7", "latin7_general_cs", False), # 42 + ("macce", "macce_bin", False), # 43 + ("cp1250", "cp1250_croatian_ci", False), # 44 + ("utf8mb4", "utf8mb4_general_ci", True), # 45 + ("utf8mb4", "utf8mb4_bin", False), # 46 + ("latin1", "latin1_bin", False), # 47 + ("latin1", "latin1_general_ci", False), # 48 + ("latin1", "latin1_general_cs", False), # 49 + ("cp1251", "cp1251_bin", False), # 50 + ("cp1251", "cp1251_general_ci", True), # 51 + ("cp1251", "cp1251_general_cs", False), # 52 + ("macroman", "macroman_bin", False), # 53 + ("utf16", "utf16_general_ci", True), # 54 + ("utf16", "utf16_bin", False), # 55 + ("utf16le", "utf16le_general_ci", True), # 56 + ("cp1256", "cp1256_general_ci", True), # 57 + ("cp1257", "cp1257_bin", False), # 58 + ("cp1257", "cp1257_general_ci", True), # 59 + ("utf32", "utf32_general_ci", True), # 60 + ("utf32", "utf32_bin", False), # 61 + ("utf16le", "utf16le_bin", False), # 62 + ("binary", "binary", True), # 63 + ("armscii8", "armscii8_bin", False), # 64 + ("ascii", "ascii_bin", False), # 65 + ("cp1250", "cp1250_bin", False), # 66 + ("cp1256", "cp1256_bin", False), # 67 + ("cp866", "cp866_bin", False), # 68 + ("dec8", "dec8_bin", False), # 69 + ("greek", "greek_bin", False), # 70 + ("hebrew", "hebrew_bin", False), # 71 + ("hp8", "hp8_bin", False), # 72 + ("keybcs2", "keybcs2_bin", False), # 73 + ("koi8r", "koi8r_bin", False), # 74 + ("koi8u", "koi8u_bin", False), # 75 + ("utf8", "utf8_tolower_ci", False), # 76 + ("latin2", "latin2_bin", False), # 77 + ("latin5", "latin5_bin", False), # 78 + ("latin7", "latin7_bin", False), # 79 + ("cp850", "cp850_bin", False), # 80 + ("cp852", "cp852_bin", False), # 81 + ("swe7", "swe7_bin", False), # 82 + ("utf8", "utf8_bin", False), # 83 + ("big5", "big5_bin", False), # 84 + ("euckr", "euckr_bin", False), # 85 + ("gb2312", "gb2312_bin", False), # 86 + ("gbk", "gbk_bin", False), # 87 + ("sjis", "sjis_bin", False), # 88 + ("tis620", "tis620_bin", False), # 89 + ("ucs2", "ucs2_bin", False), # 90 + ("ujis", "ujis_bin", False), # 91 + ("geostd8", "geostd8_general_ci", True), # 92 + ("geostd8", "geostd8_bin", False), # 93 + ("latin1", "latin1_spanish_ci", False), # 94 + ("cp932", "cp932_japanese_ci", True), # 95 + ("cp932", "cp932_bin", False), # 96 + ("eucjpms", "eucjpms_japanese_ci", True), # 97 + ("eucjpms", "eucjpms_bin", False), # 98 + ("cp1250", "cp1250_polish_ci", False), # 99 + None, + ("utf16", "utf16_unicode_ci", False), # 101 + ("utf16", "utf16_icelandic_ci", False), # 102 + ("utf16", "utf16_latvian_ci", False), # 103 + ("utf16", "utf16_romanian_ci", False), # 104 + ("utf16", "utf16_slovenian_ci", False), # 105 + ("utf16", "utf16_polish_ci", False), # 106 + ("utf16", "utf16_estonian_ci", False), # 107 + ("utf16", "utf16_spanish_ci", False), # 108 + ("utf16", "utf16_swedish_ci", False), # 109 + ("utf16", "utf16_turkish_ci", False), # 110 + ("utf16", "utf16_czech_ci", False), # 111 + ("utf16", "utf16_danish_ci", False), # 112 + ("utf16", "utf16_lithuanian_ci", False), # 113 + ("utf16", "utf16_slovak_ci", False), # 114 + ("utf16", "utf16_spanish2_ci", False), # 115 + ("utf16", "utf16_roman_ci", False), # 116 + ("utf16", "utf16_persian_ci", False), # 117 + ("utf16", "utf16_esperanto_ci", False), # 118 + ("utf16", "utf16_hungarian_ci", False), # 119 + ("utf16", "utf16_sinhala_ci", False), # 120 + ("utf16", "utf16_german2_ci", False), # 121 + ("utf16", "utf16_croatian_ci", False), # 122 + ("utf16", "utf16_unicode_520_ci", False), # 123 + ("utf16", "utf16_vietnamese_ci", False), # 124 + None, + None, + None, + ("ucs2", "ucs2_unicode_ci", False), # 128 + ("ucs2", "ucs2_icelandic_ci", False), # 129 + ("ucs2", "ucs2_latvian_ci", False), # 130 + ("ucs2", "ucs2_romanian_ci", False), # 131 + ("ucs2", "ucs2_slovenian_ci", False), # 132 + ("ucs2", "ucs2_polish_ci", False), # 133 + ("ucs2", "ucs2_estonian_ci", False), # 134 + ("ucs2", "ucs2_spanish_ci", False), # 135 + ("ucs2", "ucs2_swedish_ci", False), # 136 + ("ucs2", "ucs2_turkish_ci", False), # 137 + ("ucs2", "ucs2_czech_ci", False), # 138 + ("ucs2", "ucs2_danish_ci", False), # 139 + ("ucs2", "ucs2_lithuanian_ci", False), # 140 + ("ucs2", "ucs2_slovak_ci", False), # 141 + ("ucs2", "ucs2_spanish2_ci", False), # 142 + ("ucs2", "ucs2_roman_ci", False), # 143 + ("ucs2", "ucs2_persian_ci", False), # 144 + ("ucs2", "ucs2_esperanto_ci", False), # 145 + ("ucs2", "ucs2_hungarian_ci", False), # 146 + ("ucs2", "ucs2_sinhala_ci", False), # 147 + ("ucs2", "ucs2_german2_ci", False), # 148 + ("ucs2", "ucs2_croatian_ci", False), # 149 + ("ucs2", "ucs2_unicode_520_ci", False), # 150 + ("ucs2", "ucs2_vietnamese_ci", False), # 151 + None, + None, + None, + None, + None, + None, + None, + ("ucs2", "ucs2_general_mysql500_ci", False), # 159 + ("utf32", "utf32_unicode_ci", False), # 160 + ("utf32", "utf32_icelandic_ci", False), # 161 + ("utf32", "utf32_latvian_ci", False), # 162 + ("utf32", "utf32_romanian_ci", False), # 163 + ("utf32", "utf32_slovenian_ci", False), # 164 + ("utf32", "utf32_polish_ci", False), # 165 + ("utf32", "utf32_estonian_ci", False), # 166 + ("utf32", "utf32_spanish_ci", False), # 167 + ("utf32", "utf32_swedish_ci", False), # 168 + ("utf32", "utf32_turkish_ci", False), # 169 + ("utf32", "utf32_czech_ci", False), # 170 + ("utf32", "utf32_danish_ci", False), # 171 + ("utf32", "utf32_lithuanian_ci", False), # 172 + ("utf32", "utf32_slovak_ci", False), # 173 + ("utf32", "utf32_spanish2_ci", False), # 174 + ("utf32", "utf32_roman_ci", False), # 175 + ("utf32", "utf32_persian_ci", False), # 176 + ("utf32", "utf32_esperanto_ci", False), # 177 + ("utf32", "utf32_hungarian_ci", False), # 178 + ("utf32", "utf32_sinhala_ci", False), # 179 + ("utf32", "utf32_german2_ci", False), # 180 + ("utf32", "utf32_croatian_ci", False), # 181 + ("utf32", "utf32_unicode_520_ci", False), # 182 + ("utf32", "utf32_vietnamese_ci", False), # 183 + None, + None, + None, + None, + None, + None, + None, + None, + ("utf8", "utf8_unicode_ci", False), # 192 + ("utf8", "utf8_icelandic_ci", False), # 193 + ("utf8", "utf8_latvian_ci", False), # 194 + ("utf8", "utf8_romanian_ci", False), # 195 + ("utf8", "utf8_slovenian_ci", False), # 196 + ("utf8", "utf8_polish_ci", False), # 197 + ("utf8", "utf8_estonian_ci", False), # 198 + ("utf8", "utf8_spanish_ci", False), # 199 + ("utf8", "utf8_swedish_ci", False), # 200 + ("utf8", "utf8_turkish_ci", False), # 201 + ("utf8", "utf8_czech_ci", False), # 202 + ("utf8", "utf8_danish_ci", False), # 203 + ("utf8", "utf8_lithuanian_ci", False), # 204 + ("utf8", "utf8_slovak_ci", False), # 205 + ("utf8", "utf8_spanish2_ci", False), # 206 + ("utf8", "utf8_roman_ci", False), # 207 + ("utf8", "utf8_persian_ci", False), # 208 + ("utf8", "utf8_esperanto_ci", False), # 209 + ("utf8", "utf8_hungarian_ci", False), # 210 + ("utf8", "utf8_sinhala_ci", False), # 211 + ("utf8", "utf8_german2_ci", False), # 212 + ("utf8", "utf8_croatian_ci", False), # 213 + ("utf8", "utf8_unicode_520_ci", False), # 214 + ("utf8", "utf8_vietnamese_ci", False), # 215 + None, + None, + None, + None, + None, + None, + None, + ("utf8", "utf8_general_mysql500_ci", False), # 223 + ("utf8mb4", "utf8mb4_unicode_ci", False), # 224 + ("utf8mb4", "utf8mb4_icelandic_ci", False), # 225 + ("utf8mb4", "utf8mb4_latvian_ci", False), # 226 + ("utf8mb4", "utf8mb4_romanian_ci", False), # 227 + ("utf8mb4", "utf8mb4_slovenian_ci", False), # 228 + ("utf8mb4", "utf8mb4_polish_ci", False), # 229 + ("utf8mb4", "utf8mb4_estonian_ci", False), # 230 + ("utf8mb4", "utf8mb4_spanish_ci", False), # 231 + ("utf8mb4", "utf8mb4_swedish_ci", False), # 232 + ("utf8mb4", "utf8mb4_turkish_ci", False), # 233 + ("utf8mb4", "utf8mb4_czech_ci", False), # 234 + ("utf8mb4", "utf8mb4_danish_ci", False), # 235 + ("utf8mb4", "utf8mb4_lithuanian_ci", False), # 236 + ("utf8mb4", "utf8mb4_slovak_ci", False), # 237 + ("utf8mb4", "utf8mb4_spanish2_ci", False), # 238 + ("utf8mb4", "utf8mb4_roman_ci", False), # 239 + ("utf8mb4", "utf8mb4_persian_ci", False), # 240 + ("utf8mb4", "utf8mb4_esperanto_ci", False), # 241 + ("utf8mb4", "utf8mb4_hungarian_ci", False), # 242 + ("utf8mb4", "utf8mb4_sinhala_ci", False), # 243 + ("utf8mb4", "utf8mb4_german2_ci", False), # 244 + ("utf8mb4", "utf8mb4_croatian_ci", False), # 245 + ("utf8mb4", "utf8mb4_unicode_520_ci", False), # 246 + ("utf8mb4", "utf8mb4_vietnamese_ci", False), # 247 + ("gb18030", "gb18030_chinese_ci", True), # 248 + ("gb18030", "gb18030_bin", False), # 249 + ("gb18030", "gb18030_unicode_520_ci", False), # 250 + None, + None, + None, + None, + ("utf8mb4", "utf8mb4_0900_ai_ci", False), # 255 + ("utf8mb4", "utf8mb4_de_pb_0900_ai_ci", False), # 256 + ("utf8mb4", "utf8mb4_is_0900_ai_ci", False), # 257 + ("utf8mb4", "utf8mb4_lv_0900_ai_ci", False), # 258 + ("utf8mb4", "utf8mb4_ro_0900_ai_ci", False), # 259 + ("utf8mb4", "utf8mb4_sl_0900_ai_ci", False), # 260 + ("utf8mb4", "utf8mb4_pl_0900_ai_ci", False), # 261 + ("utf8mb4", "utf8mb4_et_0900_ai_ci", False), # 262 + ("utf8mb4", "utf8mb4_es_0900_ai_ci", False), # 263 + ("utf8mb4", "utf8mb4_sv_0900_ai_ci", False), # 264 + ("utf8mb4", "utf8mb4_tr_0900_ai_ci", False), # 265 + ("utf8mb4", "utf8mb4_cs_0900_ai_ci", False), # 266 + ("utf8mb4", "utf8mb4_da_0900_ai_ci", False), # 267 + ("utf8mb4", "utf8mb4_lt_0900_ai_ci", False), # 268 + ("utf8mb4", "utf8mb4_sk_0900_ai_ci", False), # 269 + ("utf8mb4", "utf8mb4_es_trad_0900_ai_ci", False), # 270 + ("utf8mb4", "utf8mb4_la_0900_ai_ci", False), # 271 + None, + ("utf8mb4", "utf8mb4_eo_0900_ai_ci", False), # 273 + ("utf8mb4", "utf8mb4_hu_0900_ai_ci", False), # 274 + ("utf8mb4", "utf8mb4_hr_0900_ai_ci", False), # 275 + None, + ("utf8mb4", "utf8mb4_vi_0900_ai_ci", False), # 277 + ("utf8mb4", "utf8mb4_0900_as_cs", False), # 278 + ("utf8mb4", "utf8mb4_de_pb_0900_as_cs", False), # 279 + ("utf8mb4", "utf8mb4_is_0900_as_cs", False), # 280 + ("utf8mb4", "utf8mb4_lv_0900_as_cs", False), # 281 + ("utf8mb4", "utf8mb4_ro_0900_as_cs", False), # 282 + ("utf8mb4", "utf8mb4_sl_0900_as_cs", False), # 283 + ("utf8mb4", "utf8mb4_pl_0900_as_cs", False), # 284 + ("utf8mb4", "utf8mb4_et_0900_as_cs", False), # 285 + ("utf8mb4", "utf8mb4_es_0900_as_cs", False), # 286 + ("utf8mb4", "utf8mb4_sv_0900_as_cs", False), # 287 + ("utf8mb4", "utf8mb4_tr_0900_as_cs", False), # 288 + ("utf8mb4", "utf8mb4_cs_0900_as_cs", False), # 289 + ("utf8mb4", "utf8mb4_da_0900_as_cs", False), # 290 + ("utf8mb4", "utf8mb4_lt_0900_as_cs", False), # 291 + ("utf8mb4", "utf8mb4_sk_0900_as_cs", False), # 292 + ("utf8mb4", "utf8mb4_es_trad_0900_as_cs", False), # 293 + ("utf8mb4", "utf8mb4_la_0900_as_cs", False), # 294 + None, + ("utf8mb4", "utf8mb4_eo_0900_as_cs", False), # 296 + ("utf8mb4", "utf8mb4_hu_0900_as_cs", False), # 297 + ("utf8mb4", "utf8mb4_hr_0900_as_cs", False), # 298 + None, + ("utf8mb4", "utf8mb4_vi_0900_as_cs", False), # 300 + None, + None, + ("utf8mb4", "utf8mb4_ja_0900_as_cs", False), # 303 + ("utf8mb4", "utf8mb4_ja_0900_as_cs_ks", False), # 304 + ("utf8mb4", "utf8mb4_0900_as_ci", False), # 305 + ("utf8mb4", "utf8mb4_ru_0900_ai_ci", False), # 306 + ("utf8mb4", "utf8mb4_ru_0900_as_cs", False), # 307 +] + diff --git a/venv/Lib/site-packages/mysql/connector/connection.py b/venv/Lib/site-packages/mysql/connector/connection.py new file mode 100644 index 0000000..2fb7240 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/connection.py @@ -0,0 +1,1132 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementing communication with MySQL servers. +""" + +from io import IOBase +import os +import time + +from .authentication import get_auth_plugin +from .catch23 import PY2, isstr, UNICODE_TYPES +from .constants import ( + ClientFlag, ServerCmd, ServerFlag, + flag_is_set, ShutdownType, NET_BUFFER_LENGTH +) + +from . import errors +from .conversion import MySQLConverter +from .cursor import ( + CursorBase, MySQLCursor, MySQLCursorRaw, + MySQLCursorBuffered, MySQLCursorBufferedRaw, MySQLCursorPrepared, + MySQLCursorDict, MySQLCursorBufferedDict, MySQLCursorNamedTuple, + MySQLCursorBufferedNamedTuple) +from .network import MySQLUnixSocket, MySQLTCPSocket +from .protocol import MySQLProtocol +from .utils import int4store +from .abstracts import MySQLConnectionAbstract + + +class MySQLConnection(MySQLConnectionAbstract): + """Connection to a MySQL Server""" + def __init__(self, *args, **kwargs): + self._protocol = None + self._socket = None + self._handshake = None + super(MySQLConnection, self).__init__(*args, **kwargs) + + self._converter_class = MySQLConverter + + self._client_flags = ClientFlag.get_default() + self._charset_id = 45 + self._sql_mode = None + self._time_zone = None + self._autocommit = False + + self._user = '' + self._password = '' + self._database = '' + self._host = '127.0.0.1' + self._port = 3306 + self._unix_socket = None + self._client_host = '' + self._client_port = 0 + self._ssl = {} + self._force_ipv6 = False + + self._use_unicode = True + self._get_warnings = False + self._raise_on_warnings = False + self._buffered = False + self._unread_result = False + self._have_next_result = False + self._raw = False + self._in_transaction = False + + self._prepared_statements = None + + self._ssl_active = False + self._auth_plugin = None + self._pool_config_version = None + + self._columns_desc = [] + + if kwargs: + try: + self.connect(**kwargs) + except: + # Tidy-up underlying socket on failure + self.close() + self._socket = None + raise + + def _do_handshake(self): + """Get the handshake from the MySQL server""" + packet = self._socket.recv() + if packet[4] == 255: + raise errors.get_exception(packet) + + self._handshake = None + try: + handshake = self._protocol.parse_handshake(packet) + except Exception as err: + # pylint: disable=E1101 + raise errors.get_mysql_exception(msg=err.msg, errno=err.errno, + sqlstate=err.sqlstate) + + self._server_version = self._check_server_version( + handshake['server_version_original']) + + if not handshake['capabilities'] & ClientFlag.SSL: + self._client_flags &= ~ClientFlag.SSL + if self._ssl.get('verify_cert'): + raise errors.InterfaceError("SSL is required but the server " + "doesn't support it", errno=2026) + elif not self._ssl_disabled: + self._client_flags |= ClientFlag.SSL + + if handshake['capabilities'] & ClientFlag.PLUGIN_AUTH: + self.set_client_flags([ClientFlag.PLUGIN_AUTH]) + + self._handshake = handshake + + def _do_auth(self, username=None, password=None, database=None, + client_flags=0, charset=45, ssl_options=None): + """Authenticate with the MySQL server + + Authentication happens in two parts. We first send a response to the + handshake. The MySQL server will then send either an AuthSwitchRequest + or an error packet. + + Raises NotSupportedError when we get the old, insecure password + reply back. Raises any error coming from MySQL. + """ + self._ssl_active = False + if client_flags & ClientFlag.SSL: + packet = self._protocol.make_auth_ssl(charset=charset, + client_flags=client_flags) + self._socket.send(packet) + self._socket.switch_to_ssl(ssl_options.get('ca'), + ssl_options.get('cert'), + ssl_options.get('key'), + ssl_options.get('verify_cert') or False, + ssl_options.get('verify_identity') or + False, + ssl_options.get('cipher'), + ssl_options.get('version', None)) + self._ssl_active = True + + packet = self._protocol.make_auth( + handshake=self._handshake, + username=username, password=password, database=database, + charset=charset, client_flags=client_flags, + ssl_enabled=self._ssl_active, + auth_plugin=self._auth_plugin) + self._socket.send(packet) + self._auth_switch_request(username, password) + + if not (client_flags & ClientFlag.CONNECT_WITH_DB) and database: + self.cmd_init_db(database) + + return True + + def _auth_switch_request(self, username=None, password=None): + """Handle second part of authentication + + Raises NotSupportedError when we get the old, insecure password + reply back. Raises any error coming from MySQL. + """ + auth = None + new_auth_plugin = self._auth_plugin or self._handshake["auth_plugin"] + packet = self._socket.recv() + if packet[4] == 254 and len(packet) == 5: + raise errors.NotSupportedError( + "Authentication with old (insecure) passwords " + "is not supported. For more information, lookup " + "Password Hashing in the latest MySQL manual") + elif packet[4] == 254: + # AuthSwitchRequest + (new_auth_plugin, + auth_data) = self._protocol.parse_auth_switch_request(packet) + auth = get_auth_plugin(new_auth_plugin)( + auth_data, password=password, ssl_enabled=self._ssl_active) + response = auth.auth_response() + self._socket.send(response) + packet = self._socket.recv() + + if packet[4] == 1: + auth_data = self._protocol.parse_auth_more_data(packet) + auth = get_auth_plugin(new_auth_plugin)( + auth_data, password=password, ssl_enabled=self._ssl_active) + if new_auth_plugin == "caching_sha2_password": + response = auth.auth_response() + if response: + self._socket.send(response) + packet = self._socket.recv() + + if packet[4] == 0: + return self._handle_ok(packet) + elif packet[4] == 255: + raise errors.get_exception(packet) + return None + + def _get_connection(self, prtcls=None): + """Get connection based on configuration + + This method will return the appropriated connection object using + the connection parameters. + + Returns subclass of MySQLBaseSocket. + """ + conn = None + if self.unix_socket and os.name != 'nt': + conn = MySQLUnixSocket(unix_socket=self.unix_socket) + else: + conn = MySQLTCPSocket(host=self.server_host, + port=self.server_port, + force_ipv6=self._force_ipv6) + + conn.set_connection_timeout(self._connection_timeout) + return conn + + def _open_connection(self): + """Open the connection to the MySQL server + + This method sets up and opens the connection to the MySQL server. + + Raises on errors. + """ + self._protocol = MySQLProtocol() + self._socket = self._get_connection() + try: + self._socket.open_connection() + self._do_handshake() + self._do_auth(self._user, self._password, + self._database, self._client_flags, self._charset_id, + self._ssl) + self.set_converter_class(self._converter_class) + if self._client_flags & ClientFlag.COMPRESS: + self._socket.recv = self._socket.recv_compressed + self._socket.send = self._socket.send_compressed + except: + # close socket + self.close() + raise + + def shutdown(self): + """Shut down connection to MySQL Server. + """ + if not self._socket: + return + + try: + self._socket.shutdown() + except (AttributeError, errors.Error): + pass # Getting an exception would mean we are disconnected. + + def close(self): + """Disconnect from the MySQL server""" + if not self._socket: + return + + try: + self.cmd_quit() + except (AttributeError, errors.Error): + pass # Getting an exception would mean we are disconnected. + self._socket.close_connection() + + disconnect = close + + def _send_cmd(self, command, argument=None, packet_number=0, packet=None, + expect_response=True, compressed_packet_number=0): + """Send a command to the MySQL server + + This method sends a command with an optional argument. + If packet is not None, it will be sent and the argument will be + ignored. + + The packet_number is optional and should usually not be used. + + Some commands might not result in the MySQL server returning + a response. If a command does not return anything, you should + set expect_response to False. The _send_cmd method will then + return None instead of a MySQL packet. + + Returns a MySQL packet or None. + """ + self.handle_unread_result() + + try: + self._socket.send( + self._protocol.make_command(command, packet or argument), + packet_number, compressed_packet_number) + except AttributeError: + raise errors.OperationalError("MySQL Connection not available.") + + if not expect_response: + return None + return self._socket.recv() + + def _send_data(self, data_file, send_empty_packet=False): + """Send data to the MySQL server + + This method accepts a file-like object and sends its data + as is to the MySQL server. If the send_empty_packet is + True, it will send an extra empty package (for example + when using LOAD LOCAL DATA INFILE). + + Returns a MySQL packet. + """ + self.handle_unread_result() + + if not hasattr(data_file, 'read'): + raise ValueError("expecting a file-like object") + + try: + buf = data_file.read(NET_BUFFER_LENGTH - 16) + while buf: + self._socket.send(buf) + buf = data_file.read(NET_BUFFER_LENGTH - 16) + except AttributeError: + raise errors.OperationalError("MySQL Connection not available.") + + if send_empty_packet: + try: + self._socket.send(b'') + except AttributeError: + raise errors.OperationalError( + "MySQL Connection not available.") + + return self._socket.recv() + + def _handle_server_status(self, flags): + """Handle the server flags found in MySQL packets + + This method handles the server flags send by MySQL OK and EOF + packets. It, for example, checks whether there exists more result + sets or whether there is an ongoing transaction. + """ + self._have_next_result = flag_is_set(ServerFlag.MORE_RESULTS_EXISTS, + flags) + self._in_transaction = flag_is_set(ServerFlag.STATUS_IN_TRANS, flags) + + @property + def in_transaction(self): + """MySQL session has started a transaction""" + return self._in_transaction + + def _handle_ok(self, packet): + """Handle a MySQL OK packet + + This method handles a MySQL OK packet. When the packet is found to + be an Error packet, an error will be raised. If the packet is neither + an OK or an Error packet, errors.InterfaceError will be raised. + + Returns a dict() + """ + if packet[4] == 0: + ok_pkt = self._protocol.parse_ok(packet) + self._handle_server_status(ok_pkt['status_flag']) + return ok_pkt + elif packet[4] == 255: + raise errors.get_exception(packet) + raise errors.InterfaceError('Expected OK packet') + + def _handle_eof(self, packet): + """Handle a MySQL EOF packet + + This method handles a MySQL EOF packet. When the packet is found to + be an Error packet, an error will be raised. If the packet is neither + and OK or an Error packet, errors.InterfaceError will be raised. + + Returns a dict() + """ + if packet[4] == 254: + eof = self._protocol.parse_eof(packet) + self._handle_server_status(eof['status_flag']) + return eof + elif packet[4] == 255: + raise errors.get_exception(packet) + raise errors.InterfaceError('Expected EOF packet') + + def _handle_load_data_infile(self, filename): + """Handle a LOAD DATA INFILE LOCAL request""" + try: + data_file = open(filename, 'rb') + except IOError: + # Send a empty packet to cancel the operation + try: + self._socket.send(b'') + except AttributeError: + raise errors.OperationalError( + "MySQL Connection not available.") + raise errors.InterfaceError( + "File '{0}' could not be read".format(filename)) + + return self._handle_ok(self._send_data(data_file, + send_empty_packet=True)) + + def _handle_result(self, packet): + """Handle a MySQL Result + + This method handles a MySQL result, for example, after sending the + query command. OK and EOF packets will be handled and returned. If + the packet is an Error packet, an errors.Error-exception will be + raised. + + The dictionary returned of: + - columns: column information + - eof: the EOF-packet information + + Returns a dict() + """ + if not packet or len(packet) < 4: + raise errors.InterfaceError('Empty response') + elif packet[4] == 0: + return self._handle_ok(packet) + elif packet[4] == 251: + if PY2: + filename = str(packet[5:]) + else: + filename = packet[5:].decode() + return self._handle_load_data_infile(filename) + elif packet[4] == 254: + return self._handle_eof(packet) + elif packet[4] == 255: + raise errors.get_exception(packet) + + # We have a text result set + column_count = self._protocol.parse_column_count(packet) + if not column_count or not isinstance(column_count, int): + raise errors.InterfaceError('Illegal result set.') + + self._columns_desc = [None,] * column_count + for i in range(0, column_count): + self._columns_desc[i] = self._protocol.parse_column( + self._socket.recv(), self.python_charset) + + eof = self._handle_eof(self._socket.recv()) + self.unread_result = True + return {'columns': self._columns_desc, 'eof': eof} + + def get_row(self, binary=False, columns=None, raw=None): + """Get the next rows returned by the MySQL server + + This method gets one row from the result set after sending, for + example, the query command. The result is a tuple consisting of the + row and the EOF packet. + If no row was available in the result set, the row data will be None. + + Returns a tuple. + """ + (rows, eof) = self.get_rows(count=1, binary=binary, columns=columns, + raw=raw) + if rows: + return (rows[0], eof) + return (None, eof) + + def get_rows(self, count=None, binary=False, columns=None, raw=None): + """Get all rows returned by the MySQL server + + This method gets all rows returned by the MySQL server after sending, + for example, the query command. The result is a tuple consisting of + a list of rows and the EOF packet. + + Returns a tuple() + """ + if raw is None: + raw = self._raw + + if not self.unread_result: + raise errors.InternalError("No result set available.") + + try: + if binary: + charset = self.charset + if charset == 'utf8mb4': + charset = 'utf8' + rows = self._protocol.read_binary_result( + self._socket, columns, count, charset) + else: + rows = self._protocol.read_text_result(self._socket, + self._server_version, + count=count) + except errors.Error as err: + self.unread_result = False + raise err + + rows, eof_p = rows + + if not (binary or raw) and self._columns_desc is not None and rows \ + and hasattr(self, 'converter'): + row_to_python = self.converter.row_to_python + rows = [row_to_python(row, self._columns_desc) for row in rows] + + if eof_p is not None: + self._handle_server_status(eof_p['status_flag'] if 'status_flag' in + eof_p else eof_p['server_status']) + self.unread_result = False + + return rows, eof_p + + def consume_results(self): + """Consume results + """ + if self.unread_result: + self.get_rows() + + def cmd_init_db(self, database): + """Change the current database + + This method changes the current (default) database by sending the + INIT_DB command. The result is a dictionary containing the OK packet + information. + + Returns a dict() + """ + return self._handle_ok( + self._send_cmd(ServerCmd.INIT_DB, database.encode('utf-8'))) + + def cmd_query(self, query, raw=False, buffered=False, raw_as_string=False): + """Send a query to the MySQL server + + This method send the query to the MySQL server and returns the result. + + If there was a text result, a tuple will be returned consisting of + the number of columns and a list containing information about these + columns. + + When the query doesn't return a text result, the OK or EOF packet + information as dictionary will be returned. In case the result was + an error, exception errors.Error will be raised. + + Returns a tuple() + """ + if not isinstance(query, bytes): + query = query.encode('utf-8') + result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) + + if self._have_next_result: + raise errors.InterfaceError( + 'Use cmd_query_iter for statements with multiple queries.') + + return result + + def cmd_query_iter(self, statements): + """Send one or more statements to the MySQL server + + Similar to the cmd_query method, but instead returns a generator + object to iterate through results. It sends the statements to the + MySQL server and through the iterator you can get the results. + + statement = 'SELECT 1; INSERT INTO t1 VALUES (); SELECT 2' + for result in cnx.cmd_query(statement, iterate=True): + if 'columns' in result: + columns = result['columns'] + rows = cnx.get_rows() + else: + # do something useful with INSERT result + + Returns a generator. + """ + if not isinstance(statements, bytearray): + if isstr(statements) and isinstance(statements, UNICODE_TYPES): + statements = statements.encode('utf8') + statements = bytearray(statements) + + # Handle the first query result + yield self._handle_result(self._send_cmd(ServerCmd.QUERY, statements)) + + # Handle next results, if any + while self._have_next_result: + self.handle_unread_result() + yield self._handle_result(self._socket.recv()) + + def cmd_refresh(self, options): + """Send the Refresh command to the MySQL server + + This method sends the Refresh command to the MySQL server. The options + argument should be a bitwise value using constants.RefreshOption. + Usage example: + RefreshOption = mysql.connector.RefreshOption + refresh = RefreshOption.LOG | RefreshOption.THREADS + cnx.cmd_refresh(refresh) + + The result is a dictionary with the OK packet information. + + Returns a dict() + """ + return self._handle_ok( + self._send_cmd(ServerCmd.REFRESH, int4store(options))) + + def cmd_quit(self): + """Close the current connection with the server + + This method sends the QUIT command to the MySQL server, closing the + current connection. Since the no response can be returned to the + client, cmd_quit() will return the packet it send. + + Returns a str() + """ + self.handle_unread_result() + + packet = self._protocol.make_command(ServerCmd.QUIT) + self._socket.send(packet, 0, 0) + return packet + + def cmd_shutdown(self, shutdown_type=None): + """Shut down the MySQL Server + + This method sends the SHUTDOWN command to the MySQL server and is only + possible if the current user has SUPER privileges. The result is a + dictionary containing the OK packet information. + + Note: Most applications and scripts do not the SUPER privilege. + + Returns a dict() + """ + if shutdown_type: + if not ShutdownType.get_info(shutdown_type): + raise errors.InterfaceError("Invalid shutdown type") + atype = shutdown_type + else: + atype = ShutdownType.SHUTDOWN_DEFAULT + return self._handle_eof(self._send_cmd(ServerCmd.SHUTDOWN, + int4store(atype))) + + def cmd_statistics(self): + """Send the statistics command to the MySQL Server + + This method sends the STATISTICS command to the MySQL server. The + result is a dictionary with various statistical information. + + Returns a dict() + """ + self.handle_unread_result() + + packet = self._protocol.make_command(ServerCmd.STATISTICS) + self._socket.send(packet, 0, 0) + return self._protocol.parse_statistics(self._socket.recv()) + + def cmd_process_kill(self, mysql_pid): + """Kill a MySQL process + + This method send the PROCESS_KILL command to the server along with + the process ID. The result is a dictionary with the OK packet + information. + + Returns a dict() + """ + return self._handle_ok( + self._send_cmd(ServerCmd.PROCESS_KILL, int4store(mysql_pid))) + + def cmd_debug(self): + """Send the DEBUG command + + This method sends the DEBUG command to the MySQL server, which + requires the MySQL user to have SUPER privilege. The output will go + to the MySQL server error log and the result of this method is a + dictionary with EOF packet information. + + Returns a dict() + """ + return self._handle_eof(self._send_cmd(ServerCmd.DEBUG)) + + def cmd_ping(self): + """Send the PING command + + This method sends the PING command to the MySQL server. It is used to + check if the the connection is still valid. The result of this + method is dictionary with OK packet information. + + Returns a dict() + """ + return self._handle_ok(self._send_cmd(ServerCmd.PING)) + + def cmd_change_user(self, username='', password='', database='', + charset=45): + """Change the current logged in user + + This method allows to change the current logged in user information. + The result is a dictionary with OK packet information. + + Returns a dict() + """ + self.handle_unread_result() + + if self._compress: + raise errors.NotSupportedError("Change user is not supported with " + "compression.") + + packet = self._protocol.make_change_user( + handshake=self._handshake, + username=username, password=password, database=database, + charset=charset, client_flags=self._client_flags, + ssl_enabled=self._ssl_active, + auth_plugin=self._auth_plugin) + self._socket.send(packet, 0, 0) + + ok_packet = self._auth_switch_request(username, password) + + try: + if not (self._client_flags & ClientFlag.CONNECT_WITH_DB) \ + and database: + self.cmd_init_db(database) + except: + raise + + self._charset_id = charset + self._post_connection() + + return ok_packet + + @property + def database(self): + """Get the current database""" + return self.info_query("SELECT DATABASE()")[0] + + @database.setter + def database(self, value): # pylint: disable=W0221 + """Set the current database""" + self.cmd_query("USE %s" % value) + + def is_connected(self): + """Reports whether the connection to MySQL Server is available + + This method checks whether the connection to MySQL is available. + It is similar to ping(), but unlike the ping()-method, either True + or False is returned and no exception is raised. + + Returns True or False. + """ + try: + self.cmd_ping() + except: + return False # This method does not raise + return True + + def reset_session(self, user_variables=None, session_variables=None): + """Clears the current active session + + This method resets the session state, if the MySQL server is 5.7.3 + or later active session will be reset without re-authenticating. + For other server versions session will be reset by re-authenticating. + + It is possible to provide a sequence of variables and their values to + be set after clearing the session. This is possible for both user + defined variables and session variables. + This method takes two arguments user_variables and session_variables + which are dictionaries. + + Raises OperationalError if not connected, InternalError if there are + unread results and InterfaceError on errors. + """ + if not self.is_connected(): + raise errors.OperationalError("MySQL Connection not available.") + + try: + self.cmd_reset_connection() + except errors.NotSupportedError: + self.cmd_change_user(self._user, self._password, + self._database, self._charset_id) + + cur = self.cursor() + if user_variables: + for key, value in user_variables.items(): + cur.execute("SET @`{0}` = %s".format(key), (value,)) + if session_variables: + for key, value in session_variables.items(): + cur.execute("SET SESSION `{0}` = %s".format(key), (value,)) + + def reconnect(self, attempts=1, delay=0): + """Attempt to reconnect to the MySQL server + + The argument attempts should be the number of times a reconnect + is tried. The delay argument is the number of seconds to wait between + each retry. + + You may want to set the number of attempts higher and use delay when + you expect the MySQL server to be down for maintenance or when you + expect the network to be temporary unavailable. + + Raises InterfaceError on errors. + """ + counter = 0 + while counter != attempts: + counter = counter + 1 + try: + self.disconnect() + self.connect() + if self.is_connected(): + break + except Exception as err: # pylint: disable=W0703 + if counter == attempts: + msg = "Can not reconnect to MySQL after {0} "\ + "attempt(s): {1}".format(attempts, str(err)) + raise errors.InterfaceError(msg) + if delay > 0: + time.sleep(delay) + + def ping(self, reconnect=False, attempts=1, delay=0): + """Check availability of the MySQL server + + When reconnect is set to True, one or more attempts are made to try + to reconnect to the MySQL server using the reconnect()-method. + + delay is the number of seconds to wait between each retry. + + When the connection is not available, an InterfaceError is raised. Use + the is_connected()-method if you just want to check the connection + without raising an error. + + Raises InterfaceError on errors. + """ + try: + self.cmd_ping() + except: + if reconnect: + self.reconnect(attempts=attempts, delay=delay) + else: + raise errors.InterfaceError("Connection to MySQL is" + " not available.") + + @property + def connection_id(self): + """MySQL connection ID""" + try: + return self._handshake['server_threadid'] + except KeyError: + return None + + def cursor(self, buffered=None, raw=None, prepared=None, cursor_class=None, + dictionary=None, named_tuple=None): + """Instantiates and returns a cursor + + By default, MySQLCursor is returned. Depending on the options + while connecting, a buffered and/or raw cursor is instantiated + instead. Also depending upon the cursor options, rows can be + returned as dictionary or named tuple. + + Dictionary and namedtuple based cursors are available with buffered + output but not raw. + + It is possible to also give a custom cursor through the + cursor_class parameter, but it needs to be a subclass of + mysql.connector.cursor.CursorBase. + + Raises ProgrammingError when cursor_class is not a subclass of + CursorBase. Raises ValueError when cursor is not available. + + Returns a cursor-object + """ + self.handle_unread_result() + + if not self.is_connected(): + raise errors.OperationalError("MySQL Connection not available.") + if cursor_class is not None: + if not issubclass(cursor_class, CursorBase): + raise errors.ProgrammingError( + "Cursor class needs be to subclass of cursor.CursorBase") + return (cursor_class)(self) + + buffered = buffered if buffered is not None else self._buffered + raw = raw if raw is not None else self._raw + + cursor_type = 0 + if buffered is True: + cursor_type |= 1 + if raw is True: + cursor_type |= 2 + if dictionary is True: + cursor_type |= 4 + if named_tuple is True: + cursor_type |= 8 + if prepared is True: + cursor_type |= 16 + + types = { + 0: MySQLCursor, # 0 + 1: MySQLCursorBuffered, + 2: MySQLCursorRaw, + 3: MySQLCursorBufferedRaw, + 4: MySQLCursorDict, + 5: MySQLCursorBufferedDict, + 8: MySQLCursorNamedTuple, + 9: MySQLCursorBufferedNamedTuple, + 16: MySQLCursorPrepared + } + try: + return (types[cursor_type])(self) + except KeyError: + args = ('buffered', 'raw', 'dictionary', 'named_tuple', 'prepared') + raise ValueError('Cursor not available with given criteria: ' + + ', '.join([args[i] for i in range(5) + if cursor_type & (1 << i) != 0])) + + def commit(self): + """Commit current transaction""" + self._execute_query("COMMIT") + + def rollback(self): + """Rollback current transaction""" + if self.unread_result: + self.get_rows() + + self._execute_query("ROLLBACK") + + def _execute_query(self, query): + """Execute a query + + This method simply calls cmd_query() after checking for unread + result. If there are still unread result, an errors.InterfaceError + is raised. Otherwise whatever cmd_query() returns is returned. + + Returns a dict() + """ + self.handle_unread_result() + self.cmd_query(query) + + def info_query(self, query): + """Send a query which only returns 1 row""" + cursor = self.cursor(buffered=True) + cursor.execute(query) + return cursor.fetchone() + + def _handle_binary_ok(self, packet): + """Handle a MySQL Binary Protocol OK packet + + This method handles a MySQL Binary Protocol OK packet. When the + packet is found to be an Error packet, an error will be raised. If + the packet is neither an OK or an Error packet, errors.InterfaceError + will be raised. + + Returns a dict() + """ + if packet[4] == 0: + return self._protocol.parse_binary_prepare_ok(packet) + elif packet[4] == 255: + raise errors.get_exception(packet) + raise errors.InterfaceError('Expected Binary OK packet') + + def _handle_binary_result(self, packet): + """Handle a MySQL Result + + This method handles a MySQL result, for example, after sending the + query command. OK and EOF packets will be handled and returned. If + the packet is an Error packet, an errors.Error-exception will be + raised. + + The tuple returned by this method consist of: + - the number of columns in the result, + - a list of tuples with information about the columns, + - the EOF packet information as a dictionary. + + Returns tuple() or dict() + """ + if not packet or len(packet) < 4: + raise errors.InterfaceError('Empty response') + elif packet[4] == 0: + return self._handle_ok(packet) + elif packet[4] == 254: + return self._handle_eof(packet) + elif packet[4] == 255: + raise errors.get_exception(packet) + + # We have a binary result set + column_count = self._protocol.parse_column_count(packet) + if not column_count or not isinstance(column_count, int): + raise errors.InterfaceError('Illegal result set.') + + columns = [None] * column_count + for i in range(0, column_count): + columns[i] = self._protocol.parse_column( + self._socket.recv(), self.python_charset) + + eof = self._handle_eof(self._socket.recv()) + return (column_count, columns, eof) + + def cmd_stmt_fetch(self, statement_id, rows=1): + """Fetch a MySQL statement Result Set + + This method will send the FETCH command to MySQL together with the + given statement id and the number of rows to fetch. + """ + packet = self._protocol.make_stmt_fetch(statement_id, rows) + self.unread_result = False + self._send_cmd(ServerCmd.STMT_FETCH, packet, expect_response=False) + self.unread_result = True + + def cmd_stmt_prepare(self, statement): + """Prepare a MySQL statement + + This method will send the PREPARE command to MySQL together with the + given statement. + + Returns a dict() + """ + packet = self._send_cmd(ServerCmd.STMT_PREPARE, statement) + result = self._handle_binary_ok(packet) + + result['columns'] = [] + result['parameters'] = [] + if result['num_params'] > 0: + for _ in range(0, result['num_params']): + result['parameters'].append( + self._protocol.parse_column(self._socket.recv(), + self.python_charset)) + self._handle_eof(self._socket.recv()) + if result['num_columns'] > 0: + for _ in range(0, result['num_columns']): + result['columns'].append( + self._protocol.parse_column(self._socket.recv(), + self.python_charset)) + self._handle_eof(self._socket.recv()) + + return result + + def cmd_stmt_execute(self, statement_id, data=(), parameters=(), flags=0): + """Execute a prepared MySQL statement""" + parameters = list(parameters) + long_data_used = {} + + if data: + for param_id, _ in enumerate(parameters): + if isinstance(data[param_id], IOBase): + binary = True + try: + binary = 'b' not in data[param_id].mode + except AttributeError: + pass + self.cmd_stmt_send_long_data(statement_id, param_id, + data[param_id]) + long_data_used[param_id] = (binary,) + + execute_packet = self._protocol.make_stmt_execute( + statement_id, data, tuple(parameters), flags, + long_data_used, self.charset) + packet = self._send_cmd(ServerCmd.STMT_EXECUTE, packet=execute_packet) + result = self._handle_binary_result(packet) + return result + + def cmd_stmt_close(self, statement_id): + """Deallocate a prepared MySQL statement + + This method deallocates the prepared statement using the + statement_id. Note that the MySQL server does not return + anything. + """ + self._send_cmd(ServerCmd.STMT_CLOSE, int4store(statement_id), + expect_response=False) + + def cmd_stmt_send_long_data(self, statement_id, param_id, data): + """Send data for a column + + This methods send data for a column (for example BLOB) for statement + identified by statement_id. The param_id indicate which parameter + the data belongs too. + The data argument should be a file-like object. + + Since MySQL does not send anything back, no error is raised. When + the MySQL server is not reachable, an OperationalError is raised. + + cmd_stmt_send_long_data should be called before cmd_stmt_execute. + + The total bytes send is returned. + + Returns int. + """ + chunk_size = 8192 + total_sent = 0 + # pylint: disable=W0212 + prepare_packet = self._protocol._prepare_stmt_send_long_data + # pylint: enable=W0212 + try: + buf = data.read(chunk_size) + while buf: + packet = prepare_packet(statement_id, param_id, buf) + self._send_cmd(ServerCmd.STMT_SEND_LONG_DATA, packet=packet, + expect_response=False) + total_sent += len(buf) + buf = data.read(chunk_size) + except AttributeError: + raise errors.OperationalError("MySQL Connection not available.") + + return total_sent + + def cmd_stmt_reset(self, statement_id): + """Reset data for prepared statement sent as long data + + The result is a dictionary with OK packet information. + + Returns a dict() + """ + self._handle_ok(self._send_cmd(ServerCmd.STMT_RESET, + int4store(statement_id))) + + def cmd_reset_connection(self): + """Resets the session state without re-authenticating + + Works only for MySQL server 5.7.3 or later. + The result is a dictionary with OK packet information. + + Returns a dict() + """ + if self._server_version < (5, 7, 3): + raise errors.NotSupportedError("MySQL version 5.7.2 and " + "earlier does not support " + "COM_RESET_CONNECTION.") + self._handle_ok(self._send_cmd(ServerCmd.RESET_CONNECTION)) + self._post_connection() + + def handle_unread_result(self): + """Check whether there is an unread result""" + if self.can_consume_results: + self.consume_results() + elif self.unread_result: + raise errors.InternalError("Unread result found") diff --git a/venv/Lib/site-packages/mysql/connector/connection_cext.py b/venv/Lib/site-packages/mysql/connector/connection_cext.py new file mode 100644 index 0000000..d38bf6a --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/connection_cext.py @@ -0,0 +1,617 @@ +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Connection class using the C Extension +""" + +# Detection of abstract methods in pylint is not working correctly +#pylint: disable=W0223 + +from . import errors +from .catch23 import INT_TYPES +from .constants import ( + CharacterSet, FieldFlag, ServerFlag, ShutdownType, ClientFlag +) +from .abstracts import MySQLConnectionAbstract, MySQLCursorAbstract +from .protocol import MySQLProtocol + +HAVE_CMYSQL = False +# pylint: disable=F0401,C0413 +try: + import _mysql_connector + from .cursor_cext import ( + CMySQLCursor, CMySQLCursorRaw, + CMySQLCursorBuffered, CMySQLCursorBufferedRaw, CMySQLCursorPrepared, + CMySQLCursorDict, CMySQLCursorBufferedDict, CMySQLCursorNamedTuple, + CMySQLCursorBufferedNamedTuple) + from _mysql_connector import MySQLInterfaceError # pylint: disable=F0401 +except ImportError as exc: + raise ImportError( + "MySQL Connector/Python C Extension not available ({0})".format( + str(exc) + )) +else: + HAVE_CMYSQL = True +# pylint: enable=F0401,C0413 + + +class CMySQLConnection(MySQLConnectionAbstract): + + """Class initiating a MySQL Connection using Connector/C""" + + def __init__(self, **kwargs): + """Initialization""" + if not HAVE_CMYSQL: + raise RuntimeError( + "MySQL Connector/Python C Extension not available") + self._cmysql = None + self._columns = [] + self.converter = None + super(CMySQLConnection, self).__init__(**kwargs) + + if kwargs: + self.connect(**kwargs) + + def _do_handshake(self): + """Gather information of the MySQL server before authentication""" + self._handshake = { + 'protocol': self._cmysql.get_proto_info(), + 'server_version_original': self._cmysql.get_server_info(), + 'server_threadid': self._cmysql.thread_id(), + 'charset': None, + 'server_status': None, + 'auth_plugin': None, + 'auth_data': None, + 'capabilities': self._cmysql.st_server_capabilities(), + } + + self._server_version = self._check_server_version( + self._handshake['server_version_original'] + ) + + @property + def _server_status(self): + """Returns the server status attribute of MYSQL structure""" + return self._cmysql.st_server_status() + + def set_unicode(self, value=True): + """Toggle unicode mode + + Set whether we return string fields as unicode or not. + Default is True. + """ + self._use_unicode = value + if self._cmysql: + self._cmysql.use_unicode(value) + if self.converter: + self.converter.set_unicode(value) + + @property + def autocommit(self): + """Get whether autocommit is on or off""" + value = self.info_query("SELECT @@session.autocommit")[0] + return True if value == 1 else False + + @autocommit.setter + def autocommit(self, value): # pylint: disable=W0221 + """Toggle autocommit""" + try: + self._cmysql.autocommit(value) + self._autocommit = value + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + @property + def database(self): + """Get the current database""" + return self.info_query("SELECT DATABASE()")[0] + + @database.setter + def database(self, value): # pylint: disable=W0221 + """Set the current database""" + self._cmysql.select_db(value) + + @property + def in_transaction(self): + """MySQL session has started a transaction""" + return self._server_status & ServerFlag.STATUS_IN_TRANS + + def _open_connection(self): + charset_name = CharacterSet.get_info(self._charset_id)[0] + self._cmysql = _mysql_connector.MySQL( # pylint: disable=E1101,I1101 + buffered=self._buffered, + raw=self._raw, + charset_name=charset_name, + connection_timeout=(self._connection_timeout or 0), + use_unicode=self._use_unicode, + auth_plugin=self._auth_plugin) + + cnx_kwargs = { + 'host': self._host, + 'user': self._user, + 'password': self._password, + 'database': self._database, + 'port': self._port, + 'client_flags': self._client_flags, + 'unix_socket': self._unix_socket, + 'compress': self.isset_client_flag(ClientFlag.COMPRESS), + 'ssl_disabled': True + } + + if not self._ssl_disabled: + cnx_kwargs.update({ + 'ssl_ca': self._ssl.get('ca'), + 'ssl_cert': self._ssl.get('cert'), + 'ssl_key': self._ssl.get('key'), + 'ssl_verify_cert': self._ssl.get('verify_cert') or False, + 'ssl_verify_identity': + self._ssl.get('verify_identity') or False, + 'ssl_disabled': self._ssl_disabled + }) + + try: + self._cmysql.connect(**cnx_kwargs) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + self._do_handshake() + + def close(self): + """Disconnect from the MySQL server""" + if self._cmysql: + try: + self.free_result() + self._cmysql.close() + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + self._cmysql = None + disconnect = close + + def is_connected(self): + """Reports whether the connection to MySQL Server is available""" + if self._cmysql: + return self._cmysql.ping() + + return False + + def ping(self, reconnect=False, attempts=1, delay=0): + """Check availability of the MySQL server + + When reconnect is set to True, one or more attempts are made to try + to reconnect to the MySQL server using the reconnect()-method. + + delay is the number of seconds to wait between each retry. + + When the connection is not available, an InterfaceError is raised. Use + the is_connected()-method if you just want to check the connection + without raising an error. + + Raises InterfaceError on errors. + """ + errmsg = "Connection to MySQL is not available" + + try: + connected = self._cmysql.ping() + except AttributeError: + pass # Raise or reconnect later + else: + if connected: + return + + if reconnect: + self.reconnect(attempts=attempts, delay=delay) + else: + raise errors.InterfaceError(errmsg) + + def set_character_set_name(self, charset): + """Sets the default character set name for current connection. + """ + self._cmysql.set_character_set(charset) + + def info_query(self, query): + """Send a query which only returns 1 row""" + self._cmysql.query(query) + first_row = () + if self._cmysql.have_result_set: + first_row = self._cmysql.fetch_row() + if self._cmysql.fetch_row(): + self._cmysql.free_result() + raise errors.InterfaceError( + "Query should not return more than 1 row") + self._cmysql.free_result() + + return first_row + + @property + def connection_id(self): + """MySQL connection ID""" + try: + return self._cmysql.thread_id() + except MySQLInterfaceError: + pass # Just return None + + return None + + def get_rows(self, count=None, binary=False, columns=None, raw=None): + """Get all or a subset of rows returned by the MySQL server""" + if not (self._cmysql and self.unread_result): + raise errors.InternalError("No result set available") + + if raw is None: + raw = self._raw + + rows = [] + if count is not None and count <= 0: + raise AttributeError("count should be 1 or higher, or None") + + counter = 0 + try: + row = self._cmysql.fetch_row() + while row: + if not self._raw and self.converter: + row = list(row) + for i, _ in enumerate(row): + if not raw: + row[i] = self.converter.to_python(self._columns[i], + row[i]) + row = tuple(row) + rows.append(row) + counter += 1 + if count and counter == count: + break + row = self._cmysql.fetch_row() + if not row: + _eof = self.fetch_eof_columns()['eof'] + self.free_result() + else: + _eof = None + except MySQLInterfaceError as exc: + self.free_result() + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + return rows, _eof + + def get_row(self, binary=False, columns=None, raw=None): + """Get the next rows returned by the MySQL server""" + try: + rows, eof = self.get_rows(count=1, binary=binary, columns=columns, + raw=raw) + if rows: + return (rows[0], eof) + return (None, eof) + except IndexError: + # No row available + return (None, None) + + def next_result(self): + """Reads the next result""" + if self._cmysql: + self._cmysql.consume_result() + return self._cmysql.next_result() + return None + + def free_result(self): + """Frees the result""" + if self._cmysql: + self._cmysql.free_result() + + def commit(self): + """Commit current transaction""" + if self._cmysql: + self._cmysql.commit() + + def rollback(self): + """Rollback current transaction""" + if self._cmysql: + self._cmysql.consume_result() + self._cmysql.rollback() + + def cmd_init_db(self, database): + """Change the current database""" + try: + self._cmysql.select_db(database) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + def fetch_eof_columns(self): + """Fetch EOF and column information""" + if not self._cmysql.have_result_set: + raise errors.InterfaceError("No result set") + + fields = self._cmysql.fetch_fields() + self._columns = [] + for col in fields: + self._columns.append(( + col[4], + int(col[8]), + None, + None, + None, + None, + ~int(col[9]) & FieldFlag.NOT_NULL, + int(col[9]) + )) + + return { + 'eof': { + 'status_flag': self._server_status, + 'warning_count': self._cmysql.st_warning_count(), + }, + 'columns': self._columns, + } + + def fetch_eof_status(self): + """Fetch EOF and status information""" + if self._cmysql: + return { + 'warning_count': self._cmysql.st_warning_count(), + 'field_count': self._cmysql.st_field_count(), + 'insert_id': self._cmysql.insert_id(), + 'affected_rows': self._cmysql.affected_rows(), + 'server_status': self._server_status, + } + + return None + + def cmd_query(self, query, raw=None, buffered=False, raw_as_string=False): + """Send a query to the MySQL server""" + self.handle_unread_result() + if raw is None: + raw = self._raw + try: + if not isinstance(query, bytes): + query = query.encode('utf-8') + self._cmysql.query(query, + raw=raw, buffered=buffered, + raw_as_string=raw_as_string) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(exc.errno, msg=exc.msg, + sqlstate=exc.sqlstate) + except AttributeError: + if self._unix_socket: + addr = self._unix_socket + else: + addr = self._host + ':' + str(self._port) + raise errors.OperationalError( + errno=2055, values=(addr, 'Connection not available.')) + + self._columns = [] + if not self._cmysql.have_result_set: + # No result + return self.fetch_eof_status() + + return self.fetch_eof_columns() + _execute_query = cmd_query + + def cursor(self, buffered=None, raw=None, prepared=None, cursor_class=None, + dictionary=None, named_tuple=None): + """Instantiates and returns a cursor using C Extension + + By default, CMySQLCursor is returned. Depending on the options + while connecting, a buffered and/or raw cursor is instantiated + instead. Also depending upon the cursor options, rows can be + returned as dictionary or named tuple. + + Dictionary and namedtuple based cursors are available with buffered + output but not raw. + + It is possible to also give a custom cursor through the + cursor_class parameter, but it needs to be a subclass of + mysql.connector.cursor_cext.CMySQLCursor. + + Raises ProgrammingError when cursor_class is not a subclass of + CursorBase. Raises ValueError when cursor is not available. + + Returns instance of CMySQLCursor or subclass. + + :param buffered: Return a buffering cursor + :param raw: Return a raw cursor + :param prepared: Return a cursor which uses prepared statements + :param cursor_class: Use a custom cursor class + :param dictionary: Rows are returned as dictionary + :param named_tuple: Rows are returned as named tuple + :return: Subclass of CMySQLCursor + :rtype: CMySQLCursor or subclass + """ + self.handle_unread_result() + if not self.is_connected(): + raise errors.OperationalError("MySQL Connection not available.") + if cursor_class is not None: + if not issubclass(cursor_class, MySQLCursorAbstract): + raise errors.ProgrammingError( + "Cursor class needs be to subclass" + " of cursor_cext.CMySQLCursor") + return (cursor_class)(self) + + buffered = buffered or self._buffered + raw = raw or self._raw + + cursor_type = 0 + if buffered is True: + cursor_type |= 1 + if raw is True: + cursor_type |= 2 + if dictionary is True: + cursor_type |= 4 + if named_tuple is True: + cursor_type |= 8 + if prepared is True: + cursor_type |= 16 + + types = { + 0: CMySQLCursor, # 0 + 1: CMySQLCursorBuffered, + 2: CMySQLCursorRaw, + 3: CMySQLCursorBufferedRaw, + 4: CMySQLCursorDict, + 5: CMySQLCursorBufferedDict, + 8: CMySQLCursorNamedTuple, + 9: CMySQLCursorBufferedNamedTuple, + 16: CMySQLCursorPrepared + } + try: + return (types[cursor_type])(self) + except KeyError: + args = ('buffered', 'raw', 'dictionary', 'named_tuple', 'prepared') + raise ValueError('Cursor not available with given criteria: ' + + ', '.join([args[i] for i in range(5) + if cursor_type & (1 << i) != 0])) + + @property + def num_rows(self): + """Returns number of rows of current result set""" + if not self._cmysql.have_result_set: + raise errors.InterfaceError("No result set") + + return self._cmysql.num_rows() + + @property + def warning_count(self): + """Returns number of warnings""" + if not self._cmysql: + return 0 + + return self._cmysql.warning_count() + + @property + def result_set_available(self): + """Check if a result set is available""" + if not self._cmysql: + return False + + return self._cmysql.have_result_set + + @property + def unread_result(self): + """Check if there are unread results or rows""" + return self.result_set_available + + @property + def more_results(self): + """Check if there are more results""" + return self._cmysql.more_results() + + def prepare_for_mysql(self, params): + """Prepare parameters for statements + + This method is use by cursors to prepared parameters found in the + list (or tuple) params. + + Returns dict. + """ + if isinstance(params, (list, tuple)): + result = self._cmysql.convert_to_mysql(*params) + elif isinstance(params, dict): + result = {} + for key, value in params.items(): + result[key] = self._cmysql.convert_to_mysql(value)[0] + else: + raise ValueError("Could not process parameters") + + return result + + def consume_results(self): + """Consume the current result + + This method consume the result by reading (consuming) all rows. + """ + self._cmysql.consume_result() + + def cmd_change_user(self, username='', password='', database='', + charset=45): + """Change the current logged in user""" + try: + self._cmysql.change_user(username, password, database) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + self._charset_id = charset + self._post_connection() + + def cmd_refresh(self, options): + """Send the Refresh command to the MySQL server""" + try: + self._cmysql.refresh(options) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + return self.fetch_eof_status() + + def cmd_quit(self): + """Close the current connection with the server""" + self.close() + + def cmd_shutdown(self, shutdown_type=None): + """Shut down the MySQL Server""" + if not self._cmysql: + raise errors.OperationalError("MySQL Connection not available") + + if shutdown_type: + if not ShutdownType.get_info(shutdown_type): + raise errors.InterfaceError("Invalid shutdown type") + level = shutdown_type + else: + level = ShutdownType.SHUTDOWN_DEFAULT + + try: + self._cmysql.shutdown(level) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + self.close() + + def cmd_statistics(self): + """Return statistics from the MySQL server""" + self.handle_unread_result() + + try: + stat = self._cmysql.stat() + return MySQLProtocol().parse_statistics(stat, with_header=False) + except (MySQLInterfaceError, errors.InterfaceError) as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + def cmd_process_kill(self, mysql_pid): + """Kill a MySQL process""" + if not isinstance(mysql_pid, INT_TYPES): + raise ValueError("MySQL PID must be int") + self.info_query("KILL {0}".format(mysql_pid)) + + def handle_unread_result(self): + """Check whether there is an unread result""" + if self.can_consume_results: + self.consume_results() + elif self.unread_result: + raise errors.InternalError("Unread result found") diff --git a/venv/Lib/site-packages/mysql/connector/constants.py b/venv/Lib/site-packages/mysql/connector/constants.py new file mode 100644 index 0000000..524d3e3 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/constants.py @@ -0,0 +1,784 @@ +# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Various MySQL constants and character sets +""" + +from .errors import ProgrammingError +from .charsets import MYSQL_CHARACTER_SETS + +MAX_PACKET_LENGTH = 16777215 +NET_BUFFER_LENGTH = 8192 +MAX_MYSQL_TABLE_COLUMNS = 4096 + +DEFAULT_CONFIGURATION = { + 'database': None, + 'user': '', + 'password': '', + 'host': '127.0.0.1', + 'port': 3306, + 'unix_socket': None, + 'use_unicode': True, + 'charset': 'utf8mb4', + 'collation': None, + 'converter_class': None, + 'autocommit': False, + 'time_zone': None, + 'sql_mode': None, + 'get_warnings': False, + 'raise_on_warnings': False, + 'connection_timeout': None, + 'client_flags': 0, + 'compress': False, + 'buffered': False, + 'raw': False, + 'ssl_ca': None, + 'ssl_cert': None, + 'ssl_key': None, + 'ssl_verify_cert': False, + 'ssl_verify_identity': False, + 'ssl_cipher': None, + 'ssl_disabled': False, + 'ssl_version': None, + 'passwd': None, + 'db': None, + 'connect_timeout': None, + 'dsn': None, + 'force_ipv6': False, + 'auth_plugin': None, + 'allow_local_infile': False, + 'consume_results': False, +} + +CNX_POOL_ARGS = ('pool_name', 'pool_size', 'pool_reset_session') + +def flag_is_set(flag, flags): + """Checks if the flag is set + + Returns boolean""" + if (flags & flag) > 0: + return True + return False + + +class _Constants(object): + """ + Base class for constants + """ + prefix = '' + desc = {} + + def __new__(cls): + raise TypeError("Can not instanciate from %s" % cls.__name__) + + @classmethod + def get_desc(cls, name): + """Get description of given constant""" + try: + return cls.desc[name][1] + except: + return None + + @classmethod + def get_info(cls, setid): + """Get information about given constant""" + for name, info in cls.desc.items(): + if info[0] == setid: + return name + return None + + @classmethod + def get_full_info(cls): + """get full information about given constant""" + res = () + try: + res = ["%s : %s" % (k, v[1]) for k, v in cls.desc.items()] + except Exception as err: # pylint: disable=W0703 + res = ('No information found in constant class.%s' % err) + + return res + + +class _Flags(_Constants): + """Base class for classes describing flags + """ + + @classmethod + def get_bit_info(cls, value): + """Get the name of all bits set + + Returns a list of strings.""" + res = [] + for name, info in cls.desc.items(): + if value & info[0]: + res.append(name) + return res + + +class FieldType(_Constants): + """MySQL Field Types + """ + prefix = 'FIELD_TYPE_' + DECIMAL = 0x00 + TINY = 0x01 + SHORT = 0x02 + LONG = 0x03 + FLOAT = 0x04 + DOUBLE = 0x05 + NULL = 0x06 + TIMESTAMP = 0x07 + LONGLONG = 0x08 + INT24 = 0x09 + DATE = 0x0a + TIME = 0x0b + DATETIME = 0x0c + YEAR = 0x0d + NEWDATE = 0x0e + VARCHAR = 0x0f + BIT = 0x10 + JSON = 0xf5 + NEWDECIMAL = 0xf6 + ENUM = 0xf7 + SET = 0xf8 + TINY_BLOB = 0xf9 + MEDIUM_BLOB = 0xfa + LONG_BLOB = 0xfb + BLOB = 0xfc + VAR_STRING = 0xfd + STRING = 0xfe + GEOMETRY = 0xff + + desc = { + 'DECIMAL': (0x00, 'DECIMAL'), + 'TINY': (0x01, 'TINY'), + 'SHORT': (0x02, 'SHORT'), + 'LONG': (0x03, 'LONG'), + 'FLOAT': (0x04, 'FLOAT'), + 'DOUBLE': (0x05, 'DOUBLE'), + 'NULL': (0x06, 'NULL'), + 'TIMESTAMP': (0x07, 'TIMESTAMP'), + 'LONGLONG': (0x08, 'LONGLONG'), + 'INT24': (0x09, 'INT24'), + 'DATE': (0x0a, 'DATE'), + 'TIME': (0x0b, 'TIME'), + 'DATETIME': (0x0c, 'DATETIME'), + 'YEAR': (0x0d, 'YEAR'), + 'NEWDATE': (0x0e, 'NEWDATE'), + 'VARCHAR': (0x0f, 'VARCHAR'), + 'BIT': (0x10, 'BIT'), + 'JSON': (0xf5, 'JSON'), + 'NEWDECIMAL': (0xf6, 'NEWDECIMAL'), + 'ENUM': (0xf7, 'ENUM'), + 'SET': (0xf8, 'SET'), + 'TINY_BLOB': (0xf9, 'TINY_BLOB'), + 'MEDIUM_BLOB': (0xfa, 'MEDIUM_BLOB'), + 'LONG_BLOB': (0xfb, 'LONG_BLOB'), + 'BLOB': (0xfc, 'BLOB'), + 'VAR_STRING': (0xfd, 'VAR_STRING'), + 'STRING': (0xfe, 'STRING'), + 'GEOMETRY': (0xff, 'GEOMETRY'), + } + + @classmethod + def get_string_types(cls): + """Get the list of all string types""" + return [ + cls.VARCHAR, + cls.ENUM, + cls.VAR_STRING, cls.STRING, + ] + + @classmethod + def get_binary_types(cls): + """Get the list of all binary types""" + return [ + cls.TINY_BLOB, cls.MEDIUM_BLOB, + cls.LONG_BLOB, cls.BLOB, + ] + + @classmethod + def get_number_types(cls): + """Get the list of all number types""" + return [ + cls.DECIMAL, cls.NEWDECIMAL, + cls.TINY, cls.SHORT, cls.LONG, + cls.FLOAT, cls.DOUBLE, + cls.LONGLONG, cls.INT24, + cls.BIT, + cls.YEAR, + ] + + @classmethod + def get_timestamp_types(cls): + """Get the list of all timestamp types""" + return [ + cls.DATETIME, cls.TIMESTAMP, + ] + + +class FieldFlag(_Flags): + """MySQL Field Flags + + Field flags as found in MySQL sources mysql-src/include/mysql_com.h + """ + _prefix = '' + NOT_NULL = 1 << 0 + PRI_KEY = 1 << 1 + UNIQUE_KEY = 1 << 2 + MULTIPLE_KEY = 1 << 3 + BLOB = 1 << 4 + UNSIGNED = 1 << 5 + ZEROFILL = 1 << 6 + BINARY = 1 << 7 + + ENUM = 1 << 8 + AUTO_INCREMENT = 1 << 9 + TIMESTAMP = 1 << 10 + SET = 1 << 11 + + NO_DEFAULT_VALUE = 1 << 12 + ON_UPDATE_NOW = 1 << 13 + NUM = 1 << 14 + PART_KEY = 1 << 15 + GROUP = 1 << 14 # SAME AS NUM !!!!!!!???? + UNIQUE = 1 << 16 + BINCMP = 1 << 17 + + GET_FIXED_FIELDS = 1 << 18 + FIELD_IN_PART_FUNC = 1 << 19 + FIELD_IN_ADD_INDEX = 1 << 20 + FIELD_IS_RENAMED = 1 << 21 + + desc = { + 'NOT_NULL': (1 << 0, "Field can't be NULL"), + 'PRI_KEY': (1 << 1, "Field is part of a primary key"), + 'UNIQUE_KEY': (1 << 2, "Field is part of a unique key"), + 'MULTIPLE_KEY': (1 << 3, "Field is part of a key"), + 'BLOB': (1 << 4, "Field is a blob"), + 'UNSIGNED': (1 << 5, "Field is unsigned"), + 'ZEROFILL': (1 << 6, "Field is zerofill"), + 'BINARY': (1 << 7, "Field is binary "), + 'ENUM': (1 << 8, "field is an enum"), + 'AUTO_INCREMENT': (1 << 9, "field is a autoincrement field"), + 'TIMESTAMP': (1 << 10, "Field is a timestamp"), + 'SET': (1 << 11, "field is a set"), + 'NO_DEFAULT_VALUE': (1 << 12, "Field doesn't have default value"), + 'ON_UPDATE_NOW': (1 << 13, "Field is set to NOW on UPDATE"), + 'NUM': (1 << 14, "Field is num (for clients)"), + + 'PART_KEY': (1 << 15, "Intern; Part of some key"), + 'GROUP': (1 << 14, "Intern: Group field"), # Same as NUM + 'UNIQUE': (1 << 16, "Intern: Used by sql_yacc"), + 'BINCMP': (1 << 17, "Intern: Used by sql_yacc"), + 'GET_FIXED_FIELDS': (1 << 18, "Used to get fields in item tree"), + 'FIELD_IN_PART_FUNC': (1 << 19, "Field part of partition func"), + 'FIELD_IN_ADD_INDEX': (1 << 20, "Intern: Field used in ADD INDEX"), + 'FIELD_IS_RENAMED': (1 << 21, "Intern: Field is being renamed"), + } + + +class ServerCmd(_Constants): + """MySQL Server Commands + """ + _prefix = 'COM_' + SLEEP = 0 + QUIT = 1 + INIT_DB = 2 + QUERY = 3 + FIELD_LIST = 4 + CREATE_DB = 5 + DROP_DB = 6 + REFRESH = 7 + SHUTDOWN = 8 + STATISTICS = 9 + PROCESS_INFO = 10 + CONNECT = 11 + PROCESS_KILL = 12 + DEBUG = 13 + PING = 14 + TIME = 15 + DELAYED_INSERT = 16 + CHANGE_USER = 17 + BINLOG_DUMP = 18 + TABLE_DUMP = 19 + CONNECT_OUT = 20 + REGISTER_SLAVE = 21 + STMT_PREPARE = 22 + STMT_EXECUTE = 23 + STMT_SEND_LONG_DATA = 24 + STMT_CLOSE = 25 + STMT_RESET = 26 + SET_OPTION = 27 + STMT_FETCH = 28 + DAEMON = 29 + BINLOG_DUMP_GTID = 30 + RESET_CONNECTION = 31 + + desc = { + 'SLEEP': (0, 'SLEEP'), + 'QUIT': (1, 'QUIT'), + 'INIT_DB': (2, 'INIT_DB'), + 'QUERY': (3, 'QUERY'), + 'FIELD_LIST': (4, 'FIELD_LIST'), + 'CREATE_DB': (5, 'CREATE_DB'), + 'DROP_DB': (6, 'DROP_DB'), + 'REFRESH': (7, 'REFRESH'), + 'SHUTDOWN': (8, 'SHUTDOWN'), + 'STATISTICS': (9, 'STATISTICS'), + 'PROCESS_INFO': (10, 'PROCESS_INFO'), + 'CONNECT': (11, 'CONNECT'), + 'PROCESS_KILL': (12, 'PROCESS_KILL'), + 'DEBUG': (13, 'DEBUG'), + 'PING': (14, 'PING'), + 'TIME': (15, 'TIME'), + 'DELAYED_INSERT': (16, 'DELAYED_INSERT'), + 'CHANGE_USER': (17, 'CHANGE_USER'), + 'BINLOG_DUMP': (18, 'BINLOG_DUMP'), + 'TABLE_DUMP': (19, 'TABLE_DUMP'), + 'CONNECT_OUT': (20, 'CONNECT_OUT'), + 'REGISTER_SLAVE': (21, 'REGISTER_SLAVE'), + 'STMT_PREPARE': (22, 'STMT_PREPARE'), + 'STMT_EXECUTE': (23, 'STMT_EXECUTE'), + 'STMT_SEND_LONG_DATA': (24, 'STMT_SEND_LONG_DATA'), + 'STMT_CLOSE': (25, 'STMT_CLOSE'), + 'STMT_RESET': (26, 'STMT_RESET'), + 'SET_OPTION': (27, 'SET_OPTION'), + 'STMT_FETCH': (28, 'STMT_FETCH'), + 'DAEMON': (29, 'DAEMON'), + 'BINLOG_DUMP_GTID': (30, 'BINLOG_DUMP_GTID'), + 'RESET_CONNECTION': (31, 'RESET_CONNECTION'), + } + + +class ClientFlag(_Flags): + """MySQL Client Flags + + Client options as found in the MySQL sources mysql-src/include/mysql_com.h + """ + LONG_PASSWD = 1 << 0 + FOUND_ROWS = 1 << 1 + LONG_FLAG = 1 << 2 + CONNECT_WITH_DB = 1 << 3 + NO_SCHEMA = 1 << 4 + COMPRESS = 1 << 5 + ODBC = 1 << 6 + LOCAL_FILES = 1 << 7 + IGNORE_SPACE = 1 << 8 + PROTOCOL_41 = 1 << 9 + INTERACTIVE = 1 << 10 + SSL = 1 << 11 + IGNORE_SIGPIPE = 1 << 12 + TRANSACTIONS = 1 << 13 + RESERVED = 1 << 14 + SECURE_CONNECTION = 1 << 15 + MULTI_STATEMENTS = 1 << 16 + MULTI_RESULTS = 1 << 17 + PS_MULTI_RESULTS = 1 << 18 + PLUGIN_AUTH = 1 << 19 + CONNECT_ARGS = 1 << 20 + PLUGIN_AUTH_LENENC_CLIENT_DATA = 1 << 21 + CAN_HANDLE_EXPIRED_PASSWORDS = 1 << 22 + SESION_TRACK = 1 << 23 + DEPRECATE_EOF = 1 << 24 + SSL_VERIFY_SERVER_CERT = 1 << 30 + REMEMBER_OPTIONS = 1 << 31 + + desc = { + 'LONG_PASSWD': (1 << 0, 'New more secure passwords'), + 'FOUND_ROWS': (1 << 1, 'Found instead of affected rows'), + 'LONG_FLAG': (1 << 2, 'Get all column flags'), + 'CONNECT_WITH_DB': (1 << 3, 'One can specify db on connect'), + 'NO_SCHEMA': (1 << 4, "Don't allow database.table.column"), + 'COMPRESS': (1 << 5, 'Can use compression protocol'), + 'ODBC': (1 << 6, 'ODBC client'), + 'LOCAL_FILES': (1 << 7, 'Can use LOAD DATA LOCAL'), + 'IGNORE_SPACE': (1 << 8, "Ignore spaces before ''"), + 'PROTOCOL_41': (1 << 9, 'New 4.1 protocol'), + 'INTERACTIVE': (1 << 10, 'This is an interactive client'), + 'SSL': (1 << 11, 'Switch to SSL after handshake'), + 'IGNORE_SIGPIPE': (1 << 12, 'IGNORE sigpipes'), + 'TRANSACTIONS': (1 << 13, 'Client knows about transactions'), + 'RESERVED': (1 << 14, 'Old flag for 4.1 protocol'), + 'SECURE_CONNECTION': (1 << 15, 'New 4.1 authentication'), + 'MULTI_STATEMENTS': (1 << 16, 'Enable/disable multi-stmt support'), + 'MULTI_RESULTS': (1 << 17, 'Enable/disable multi-results'), + 'PS_MULTI_RESULTS': (1 << 18, 'Multi-results in PS-protocol'), + 'PLUGIN_AUTH': (1 << 19, 'Client supports plugin authentication'), + 'CONNECT_ARGS': (1 << 20, 'Client supports connection attributes'), + 'PLUGIN_AUTH_LENENC_CLIENT_DATA': (1 << 21, + 'Enable authentication response packet to be larger than 255 bytes'), + 'CAN_HANDLE_EXPIRED_PASSWORDS': (1 << 22, "Don't close the connection for a connection with expired password"), + 'SESION_TRACK': (1 << 23, 'Capable of handling server state change information'), + 'DEPRECATE_EOF': (1 << 24, 'Client no longer needs EOF packet'), + 'SSL_VERIFY_SERVER_CERT': (1 << 30, ''), + 'REMEMBER_OPTIONS': (1 << 31, ''), + } + + default = [ + LONG_PASSWD, + LONG_FLAG, + CONNECT_WITH_DB, + PROTOCOL_41, + TRANSACTIONS, + SECURE_CONNECTION, + MULTI_STATEMENTS, + MULTI_RESULTS, + ] + + @classmethod + def get_default(cls): + """Get the default client options set + + Returns a flag with all the default client options set""" + flags = 0 + for option in cls.default: + flags |= option + return flags + + +class ServerFlag(_Flags): + """MySQL Server Flags + + Server flags as found in the MySQL sources mysql-src/include/mysql_com.h + """ + _prefix = 'SERVER_' + STATUS_IN_TRANS = 1 << 0 + STATUS_AUTOCOMMIT = 1 << 1 + MORE_RESULTS_EXISTS = 1 << 3 + QUERY_NO_GOOD_INDEX_USED = 1 << 4 + QUERY_NO_INDEX_USED = 1 << 5 + STATUS_CURSOR_EXISTS = 1 << 6 + STATUS_LAST_ROW_SENT = 1 << 7 + STATUS_DB_DROPPED = 1 << 8 + STATUS_NO_BACKSLASH_ESCAPES = 1 << 9 + SERVER_STATUS_METADATA_CHANGED = 1 << 10 + SERVER_QUERY_WAS_SLOW = 1 << 11 + SERVER_PS_OUT_PARAMS = 1 << 12 + SERVER_STATUS_IN_TRANS_READONLY = 1 << 13 + SERVER_SESSION_STATE_CHANGED = 1 << 14 + + desc = { + 'SERVER_STATUS_IN_TRANS': (1 << 0, + 'Transaction has started'), + 'SERVER_STATUS_AUTOCOMMIT': (1 << 1, + 'Server in auto_commit mode'), + 'SERVER_MORE_RESULTS_EXISTS': (1 << 3, + 'Multi query - ' + 'next query exists'), + 'SERVER_QUERY_NO_GOOD_INDEX_USED': (1 << 4, ''), + 'SERVER_QUERY_NO_INDEX_USED': (1 << 5, ''), + 'SERVER_STATUS_CURSOR_EXISTS': (1 << 6, + 'Set when server opened a read-only ' + 'non-scrollable cursor for a query.'), + 'SERVER_STATUS_LAST_ROW_SENT': (1 << 7, + 'Set when a read-only cursor is ' + 'exhausted'), + 'SERVER_STATUS_DB_DROPPED': (1 << 8, 'A database was dropped'), + 'SERVER_STATUS_NO_BACKSLASH_ESCAPES': (1 << 9, ''), + 'SERVER_STATUS_METADATA_CHANGED': (1024, + 'Set if after a prepared statement ' + 'reprepare we discovered that the ' + 'new statement returns a different ' + 'number of result set columns.'), + 'SERVER_QUERY_WAS_SLOW': (2048, ''), + 'SERVER_PS_OUT_PARAMS': (4096, + 'To mark ResultSet containing output ' + 'parameter values.'), + 'SERVER_STATUS_IN_TRANS_READONLY': (8192, + 'Set if multi-statement ' + 'transaction is a read-only ' + 'transaction.'), + 'SERVER_SESSION_STATE_CHANGED': (1 << 14, + 'Session state has changed on the ' + 'server because of the execution of ' + 'the last statement'), + } + + +class RefreshOption(_Constants): + """MySQL Refresh command options + + Options used when sending the COM_REFRESH server command. + """ + _prefix = 'REFRESH_' + GRANT = 1 << 0 + LOG = 1 << 1 + TABLES = 1 << 2 + HOST = 1 << 3 + STATUS = 1 << 4 + THREADS = 1 << 5 + SLAVE = 1 << 6 + + desc = { + 'GRANT': (1 << 0, 'Refresh grant tables'), + 'LOG': (1 << 1, 'Start on new log file'), + 'TABLES': (1 << 2, 'close all tables'), + 'HOSTS': (1 << 3, 'Flush host cache'), + 'STATUS': (1 << 4, 'Flush status variables'), + 'THREADS': (1 << 5, 'Flush thread cache'), + 'SLAVE': (1 << 6, 'Reset master info and restart slave thread'), + } + + +class ShutdownType(_Constants): + """MySQL Shutdown types + + Shutdown types used by the COM_SHUTDOWN server command. + """ + _prefix = '' + SHUTDOWN_DEFAULT = 0 + SHUTDOWN_WAIT_CONNECTIONS = 1 + SHUTDOWN_WAIT_TRANSACTIONS = 2 + SHUTDOWN_WAIT_UPDATES = 8 + SHUTDOWN_WAIT_ALL_BUFFERS = 16 + SHUTDOWN_WAIT_CRITICAL_BUFFERS = 17 + KILL_QUERY = 254 + KILL_CONNECTION = 255 + + desc = { + 'SHUTDOWN_DEFAULT': ( + SHUTDOWN_DEFAULT, + "defaults to SHUTDOWN_WAIT_ALL_BUFFERS"), + 'SHUTDOWN_WAIT_CONNECTIONS': ( + SHUTDOWN_WAIT_CONNECTIONS, + "wait for existing connections to finish"), + 'SHUTDOWN_WAIT_TRANSACTIONS': ( + SHUTDOWN_WAIT_TRANSACTIONS, + "wait for existing trans to finish"), + 'SHUTDOWN_WAIT_UPDATES': ( + SHUTDOWN_WAIT_UPDATES, + "wait for existing updates to finish"), + 'SHUTDOWN_WAIT_ALL_BUFFERS': ( + SHUTDOWN_WAIT_ALL_BUFFERS, + "flush InnoDB and other storage engine buffers"), + 'SHUTDOWN_WAIT_CRITICAL_BUFFERS': ( + SHUTDOWN_WAIT_CRITICAL_BUFFERS, + "don't flush InnoDB buffers, " + "flush other storage engines' buffers"), + 'KILL_QUERY': ( + KILL_QUERY, + "(no description)"), + 'KILL_CONNECTION': ( + KILL_CONNECTION, + "(no description)"), + } + + +class CharacterSet(_Constants): + """MySQL supported character sets and collations + + List of character sets with their collations supported by MySQL. This + maps to the character set we get from the server within the handshake + packet. + + The list is hardcode so we avoid a database query when getting the + name of the used character set or collation. + """ + desc = MYSQL_CHARACTER_SETS + + # Multi-byte character sets which use 5c (backslash) in characters + slash_charsets = (1, 13, 28, 84, 87, 88) + + @classmethod + def get_info(cls, setid): + """Retrieves character set information as tuple using an ID + + Retrieves character set and collation information based on the + given MySQL ID. + + Raises ProgrammingError when character set is not supported. + + Returns a tuple. + """ + try: + return cls.desc[setid][0:2] + except IndexError: + raise ProgrammingError( + "Character set '{0}' unsupported".format(setid)) + + @classmethod + def get_desc(cls, name): + """Retrieves character set information as string using an ID + + Retrieves character set and collation information based on the + given MySQL ID. + + Returns a tuple. + """ + try: + return "%s/%s" % cls.get_info(name) + except: + raise + + @classmethod + def get_default_collation(cls, charset): + """Retrieves the default collation for given character set + + Raises ProgrammingError when character set is not supported. + + Returns list (collation, charset, index) + """ + if isinstance(charset, int): + try: + info = cls.desc[charset] + return info[1], info[0], charset + except: + ProgrammingError("Character set ID '%s' unsupported." % ( + charset)) + + for cid, info in enumerate(cls.desc): + if info is None: + continue + if info[0] == charset and info[2] is True: + return info[1], info[0], cid + + raise ProgrammingError("Character set '%s' unsupported." % (charset)) + + @classmethod + def get_charset_info(cls, charset=None, collation=None): + """Get character set information using charset name and/or collation + + Retrieves character set and collation information given character + set name and/or a collation name. + If charset is an integer, it will look up the character set based + on the MySQL's ID. + For example: + get_charset_info('utf8',None) + get_charset_info(collation='utf8_general_ci') + get_charset_info(47) + + Raises ProgrammingError when character set is not supported. + + Returns a tuple with (id, characterset name, collation) + """ + if isinstance(charset, int): + try: + info = cls.desc[charset] + return (charset, info[0], info[1]) + except IndexError: + ProgrammingError("Character set ID {0} unknown.".format( + charset)) + + if charset is not None and collation is None: + info = cls.get_default_collation(charset) + return (info[2], info[1], info[0]) + elif charset is None and collation is not None: + for cid, info in enumerate(cls.desc): + if info is None: + continue + if collation == info[1]: + return (cid, info[0], info[1]) + raise ProgrammingError("Collation '{0}' unknown.".format(collation)) + else: + for cid, info in enumerate(cls.desc): + if info is None: + continue + if info[0] == charset and info[1] == collation: + return (cid, info[0], info[1]) + _ = cls.get_default_collation(charset) + raise ProgrammingError("Collation '{0}' unknown.".format(collation)) + + @classmethod + def get_supported(cls): + """Retrieves a list with names of all supproted character sets + + Returns a tuple. + """ + res = [] + for info in cls.desc: + if info and info[0] not in res: + res.append(info[0]) + return tuple(res) + + +class SQLMode(_Constants): + """MySQL SQL Modes + + The numeric values of SQL Modes are not interesting, only the names + are used when setting the SQL_MODE system variable using the MySQL + SET command. + + See http://dev.mysql.com/doc/refman/5.6/en/server-sql-mode.html + """ + _prefix = 'MODE_' + REAL_AS_FLOAT = 'REAL_AS_FLOAT' + PIPES_AS_CONCAT = 'PIPES_AS_CONCAT' + ANSI_QUOTES = 'ANSI_QUOTES' + IGNORE_SPACE = 'IGNORE_SPACE' + NOT_USED = 'NOT_USED' + ONLY_FULL_GROUP_BY = 'ONLY_FULL_GROUP_BY' + NO_UNSIGNED_SUBTRACTION = 'NO_UNSIGNED_SUBTRACTION' + NO_DIR_IN_CREATE = 'NO_DIR_IN_CREATE' + POSTGRESQL = 'POSTGRESQL' + ORACLE = 'ORACLE' + MSSQL = 'MSSQL' + DB2 = 'DB2' + MAXDB = 'MAXDB' + NO_KEY_OPTIONS = 'NO_KEY_OPTIONS' + NO_TABLE_OPTIONS = 'NO_TABLE_OPTIONS' + NO_FIELD_OPTIONS = 'NO_FIELD_OPTIONS' + MYSQL323 = 'MYSQL323' + MYSQL40 = 'MYSQL40' + ANSI = 'ANSI' + NO_AUTO_VALUE_ON_ZERO = 'NO_AUTO_VALUE_ON_ZERO' + NO_BACKSLASH_ESCAPES = 'NO_BACKSLASH_ESCAPES' + STRICT_TRANS_TABLES = 'STRICT_TRANS_TABLES' + STRICT_ALL_TABLES = 'STRICT_ALL_TABLES' + NO_ZERO_IN_DATE = 'NO_ZERO_IN_DATE' + NO_ZERO_DATE = 'NO_ZERO_DATE' + INVALID_DATES = 'INVALID_DATES' + ERROR_FOR_DIVISION_BY_ZERO = 'ERROR_FOR_DIVISION_BY_ZERO' + TRADITIONAL = 'TRADITIONAL' + NO_AUTO_CREATE_USER = 'NO_AUTO_CREATE_USER' + HIGH_NOT_PRECEDENCE = 'HIGH_NOT_PRECEDENCE' + NO_ENGINE_SUBSTITUTION = 'NO_ENGINE_SUBSTITUTION' + PAD_CHAR_TO_FULL_LENGTH = 'PAD_CHAR_TO_FULL_LENGTH' + + @classmethod + def get_desc(cls, name): + raise NotImplementedError + + @classmethod + def get_info(cls, setid): + raise NotImplementedError + + @classmethod + def get_full_info(cls): + """Returns a sequence of all available SQL Modes + + This class method returns a tuple containing all SQL Mode names. The + names will be alphabetically sorted. + + Returns a tuple. + """ + res = [] + for key in vars(cls).keys(): + if not key.startswith('_') \ + and not hasattr(getattr(cls, key), '__call__'): + res.append(key) + return tuple(sorted(res)) diff --git a/venv/Lib/site-packages/mysql/connector/conversion.py b/venv/Lib/site-packages/mysql/connector/conversion.py new file mode 100644 index 0000000..83be979 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/conversion.py @@ -0,0 +1,652 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Converting MySQL and Python types +""" + +import datetime +import time +from decimal import Decimal + +from .constants import FieldType, FieldFlag, CharacterSet +from .catch23 import PY2, NUMERIC_TYPES, struct_unpack +from .custom_types import HexLiteral + + +class MySQLConverterBase(object): + """Base class for conversion classes + + All class dealing with converting to and from MySQL data types must + be a subclass of this class. + """ + + def __init__(self, charset='utf8', use_unicode=True): + self.python_types = None + self.mysql_types = None + self.charset = None + self.charset_id = 0 + self.use_unicode = None + self.set_charset(charset) + self.set_unicode(use_unicode) + self._cache_field_types = {} + + def set_charset(self, charset): + """Set character set""" + if charset == 'utf8mb4': + charset = 'utf8' + if charset is not None: + self.charset = charset + else: + # default to utf8 + self.charset = 'utf8' + self.charset_id = CharacterSet.get_charset_info(self.charset)[0] + + def set_unicode(self, value=True): + """Set whether to use Unicode""" + self.use_unicode = value + + def to_mysql(self, value): + """Convert Python data type to MySQL""" + type_name = value.__class__.__name__.lower() + try: + return getattr(self, "_{0}_to_mysql".format(type_name))(value) + except AttributeError: + return value + + def to_python(self, vtype, value): + """Convert MySQL data type to Python""" + + if (value == b'\x00' or value is None) and vtype[1] != FieldType.BIT: + # Don't go further when we hit a NULL value + return None + + if not self._cache_field_types: + self._cache_field_types = {} + for name, info in FieldType.desc.items(): + try: + self._cache_field_types[info[0]] = getattr( + self, '_{0}_to_python'.format(name)) + except AttributeError: + # We ignore field types which has no method + pass + + try: + return self._cache_field_types[vtype[1]](value, vtype) + except KeyError: + return value + + def escape(self, value): + """Escape buffer for sending to MySQL""" + return value + + def quote(self, buf): + """Quote buffer for sending to MySQL""" + return str(buf) + + +class MySQLConverter(MySQLConverterBase): + """Default conversion class for MySQL Connector/Python. + + o escape method: for escaping values send to MySQL + o quoting method: for quoting values send to MySQL in statements + o conversion mapping: maps Python and MySQL data types to + function for converting them. + + Whenever one needs to convert values differently, a converter_class + argument can be given while instantiating a new connection like + cnx.connect(converter_class=CustomMySQLConverterClass). + + """ + + def __init__(self, charset=None, use_unicode=True): + MySQLConverterBase.__init__(self, charset, use_unicode) + self._cache_field_types = {} + + def escape(self, value): + """ + Escapes special characters as they are expected to by when MySQL + receives them. + As found in MySQL source mysys/charset.c + + Returns the value if not a string, or the escaped string. + """ + if value is None: + return value + elif isinstance(value, NUMERIC_TYPES): + return value + if isinstance(value, (bytes, bytearray)): + value = value.replace(b'\\', b'\\\\') + value = value.replace(b'\n', b'\\n') + value = value.replace(b'\r', b'\\r') + value = value.replace(b'\047', b'\134\047') # single quotes + value = value.replace(b'\042', b'\134\042') # double quotes + value = value.replace(b'\032', b'\134\032') # for Win32 + else: + value = value.replace('\\', '\\\\') + value = value.replace('\n', '\\n') + value = value.replace('\r', '\\r') + value = value.replace('\047', '\134\047') # single quotes + value = value.replace('\042', '\134\042') # double quotes + value = value.replace('\032', '\134\032') # for Win32 + return value + + def quote(self, buf): + """ + Quote the parameters for commands. General rules: + o numbers are returns as bytes using ascii codec + o None is returned as bytearray(b'NULL') + o Everything else is single quoted '' + + Returns a bytearray object. + """ + if isinstance(buf, NUMERIC_TYPES): + if PY2: + if isinstance(buf, float): + return repr(buf) + return str(buf) + return str(buf).encode('ascii') + elif isinstance(buf, type(None)): + return bytearray(b"NULL") + return bytearray(b"'" + buf + b"'") + + def to_mysql(self, value): + """Convert Python data type to MySQL""" + type_name = value.__class__.__name__.lower() + try: + return getattr(self, "_{0}_to_mysql".format(type_name))(value) + except AttributeError: + raise TypeError("Python '{0}' cannot be converted to a " + "MySQL type".format(type_name)) + + def to_python(self, vtype, value): + """Convert MySQL data type to Python""" + if value == 0 and vtype[1] != FieldType.BIT: # \x00 + # Don't go further when we hit a NULL value + return None + if value is None: + return None + + if not self._cache_field_types: + self._cache_field_types = {} + for name, info in FieldType.desc.items(): + try: + self._cache_field_types[info[0]] = getattr( + self, '_{0}_to_python'.format(name)) + except AttributeError: + # We ignore field types which has no method + pass + + try: + return self._cache_field_types[vtype[1]](value, vtype) + except KeyError: + # If one type is not defined, we just return the value as str + try: + return value.decode('utf-8') + except UnicodeDecodeError: + return value + except ValueError as err: + raise ValueError("%s (field %s)" % (err, vtype[0])) + except TypeError as err: + raise TypeError("%s (field %s)" % (err, vtype[0])) + except: + raise + + def _int_to_mysql(self, value): + """Convert value to int""" + return int(value) + + def _long_to_mysql(self, value): + """Convert value to int""" + return int(value) + + def _float_to_mysql(self, value): + """Convert value to float""" + return float(value) + + def _str_to_mysql(self, value): + """Convert value to string""" + if PY2: + return str(value) + return self._unicode_to_mysql(value) + + def _unicode_to_mysql(self, value): + """Convert unicode""" + charset = self.charset + charset_id = self.charset_id + if charset == 'binary': + charset = 'utf8' + charset_id = CharacterSet.get_charset_info(charset)[0] + encoded = value.encode(charset) + if charset_id in CharacterSet.slash_charsets: + if b'\x5c' in encoded: + return HexLiteral(value, charset) + return encoded + + def _bytes_to_mysql(self, value): + """Convert value to bytes""" + return value + + def _bytearray_to_mysql(self, value): + """Convert value to bytes""" + return bytes(value) + + def _bool_to_mysql(self, value): + """Convert value to boolean""" + if value: + return 1 + return 0 + + def _nonetype_to_mysql(self, value): + """ + This would return what None would be in MySQL, but instead we + leave it None and return it right away. The actual conversion + from None to NULL happens in the quoting functionality. + + Return None. + """ + return None + + def _datetime_to_mysql(self, value): + """ + Converts a datetime instance to a string suitable for MySQL. + The returned string has format: %Y-%m-%d %H:%M:%S[.%f] + + If the instance isn't a datetime.datetime type, it return None. + + Returns a bytes. + """ + if value.microsecond: + fmt = '{0:d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:06d}' + return fmt.format( + value.year, value.month, value.day, + value.hour, value.minute, value.second, + value.microsecond).encode('ascii') + + fmt = '{0:d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}' + return fmt.format( + value.year, value.month, value.day, + value.hour, value.minute, value.second).encode('ascii') + + def _date_to_mysql(self, value): + """ + Converts a date instance to a string suitable for MySQL. + The returned string has format: %Y-%m-%d + + If the instance isn't a datetime.date type, it return None. + + Returns a bytes. + """ + return '{0:d}-{1:02d}-{2:02d}'.format(value.year, value.month, + value.day).encode('ascii') + + def _time_to_mysql(self, value): + """ + Converts a time instance to a string suitable for MySQL. + The returned string has format: %H:%M:%S[.%f] + + If the instance isn't a datetime.time type, it return None. + + Returns a bytes. + """ + if value.microsecond: + return value.strftime('%H:%M:%S.%f').encode('ascii') + return value.strftime('%H:%M:%S').encode('ascii') + + def _struct_time_to_mysql(self, value): + """ + Converts a time.struct_time sequence to a string suitable + for MySQL. + The returned string has format: %Y-%m-%d %H:%M:%S + + Returns a bytes or None when not valid. + """ + return time.strftime('%Y-%m-%d %H:%M:%S', value).encode('ascii') + + def _timedelta_to_mysql(self, value): + """ + Converts a timedelta instance to a string suitable for MySQL. + The returned string has format: %H:%M:%S + + Returns a bytes. + """ + seconds = abs(value.days * 86400 + value.seconds) + + if value.microseconds: + fmt = '{0:02d}:{1:02d}:{2:02d}.{3:06d}' + if value.days < 0: + mcs = 1000000 - value.microseconds + seconds -= 1 + else: + mcs = value.microseconds + else: + fmt = '{0:02d}:{1:02d}:{2:02d}' + + if value.days < 0: + fmt = '-' + fmt + + (hours, remainder) = divmod(seconds, 3600) + (mins, secs) = divmod(remainder, 60) + + if value.microseconds: + result = fmt.format(hours, mins, secs, mcs) + else: + result = fmt.format(hours, mins, secs) + + if PY2: + return result + return result.encode('ascii') + + def _decimal_to_mysql(self, value): + """ + Converts a decimal.Decimal instance to a string suitable for + MySQL. + + Returns a bytes or None when not valid. + """ + if isinstance(value, Decimal): + return str(value).encode('ascii') + + return None + + def row_to_python(self, row, fields): + """Convert a MySQL text result row to Python types + + The row argument is a sequence containing text result returned + by a MySQL server. Each value of the row is converted to the + using the field type information in the fields argument. + + Returns a tuple. + """ + i = 0 + result = [None]*len(fields) + + if not self._cache_field_types: + self._cache_field_types = {} + for name, info in FieldType.desc.items(): + try: + self._cache_field_types[info[0]] = getattr( + self, '_{0}_to_python'.format(name)) + except AttributeError: + # We ignore field types which has no method + pass + + for field in fields: + field_type = field[1] + + if (row[i] == 0 and field_type != FieldType.BIT) or row[i] is None: + # Don't convert NULL value + i += 1 + continue + + try: + result[i] = self._cache_field_types[field_type](row[i], field) + except KeyError: + # If one type is not defined, we just return the value as str + try: + result[i] = row[i].decode('utf-8') + except UnicodeDecodeError: + result[i] = row[i] + except (ValueError, TypeError) as err: + err.message = "{0} (field {1})".format(str(err), field[0]) + raise + + i += 1 + + return tuple(result) + + def _FLOAT_to_python(self, value, desc=None): # pylint: disable=C0103 + """ + Returns value as float type. + """ + return float(value) + + _DOUBLE_to_python = _FLOAT_to_python + + def _INT_to_python(self, value, desc=None): # pylint: disable=C0103 + """ + Returns value as int type. + """ + return int(value) + + _TINY_to_python = _INT_to_python + _SHORT_to_python = _INT_to_python + _INT24_to_python = _INT_to_python + _LONG_to_python = _INT_to_python + _LONGLONG_to_python = _INT_to_python + + def _DECIMAL_to_python(self, value, desc=None): # pylint: disable=C0103 + """ + Returns value as a decimal.Decimal. + """ + val = value.decode(self.charset) + return Decimal(val) + + _NEWDECIMAL_to_python = _DECIMAL_to_python + + def _str(self, value, desc=None): + """ + Returns value as str type. + """ + return str(value) + + def _BIT_to_python(self, value, dsc=None): # pylint: disable=C0103 + """Returns BIT columntype as integer""" + int_val = value + if len(int_val) < 8: + int_val = b'\x00' * (8 - len(int_val)) + int_val + return struct_unpack('>Q', int_val)[0] + + def _DATE_to_python(self, value, dsc=None): # pylint: disable=C0103 + """ + Returns DATE column type as datetime.date type. + """ + if isinstance(value, datetime.date): + return value + try: + parts = value.split(b'-') + return datetime.date(int(parts[0]), int(parts[1]), int(parts[2])) + except ValueError: + return None + + _NEWDATE_to_python = _DATE_to_python + + def _TIME_to_python(self, value, dsc=None): # pylint: disable=C0103 + """ + Returns TIME column type as datetime.time type. + """ + time_val = None + try: + (hms, mcs) = value.split(b'.') + mcs = int(mcs.ljust(6, b'0')) + except ValueError: + hms = value + mcs = 0 + try: + (hours, mins, secs) = [int(d) for d in hms.split(b':')] + if value[0] == 45 or value[0] == '-': # if PY3 or PY2 + mins, secs, mcs = -mins, -secs, -mcs + time_val = datetime.timedelta(hours=hours, minutes=mins, + seconds=secs, microseconds=mcs) + except ValueError: + raise ValueError( + "Could not convert {0} to python datetime.timedelta".format( + value)) + else: + return time_val + + def _DATETIME_to_python(self, value, dsc=None): # pylint: disable=C0103 + """ + Returns DATETIME column type as datetime.datetime type. + """ + if isinstance(value, datetime.datetime): + return value + datetime_val = None + try: + (date_, time_) = value.split(b' ') + if len(time_) > 8: + (hms, mcs) = time_.split(b'.') + mcs = int(mcs.ljust(6, b'0')) + else: + hms = time_ + mcs = 0 + dtval = [int(i) for i in date_.split(b'-')] + \ + [int(i) for i in hms.split(b':')] + [mcs, ] + datetime_val = datetime.datetime(*dtval) + except ValueError: + datetime_val = None + + return datetime_val + + _TIMESTAMP_to_python = _DATETIME_to_python + + def _YEAR_to_python(self, value, desc=None): # pylint: disable=C0103 + """Returns YEAR column type as integer""" + try: + year = int(value) + except ValueError: + raise ValueError("Failed converting YEAR to int (%s)" % value) + + return year + + def _SET_to_python(self, value, dsc=None): # pylint: disable=C0103 + """Returns SET column type as set + + Actually, MySQL protocol sees a SET as a string type field. So this + code isn't called directly, but used by STRING_to_python() method. + + Returns SET column type as a set. + """ + set_type = None + val = value.decode(self.charset) + if not val: + return set() + try: + set_type = set(val.split(',')) + except ValueError: + raise ValueError("Could not convert set %s to a sequence." % value) + return set_type + + def _JSON_to_python(self, value, dsc=None): # pylint: disable=C0103 + """Returns JSON column type as python type + + Returns JSON column type as python type. + """ + try: + num = float(value) + if num.is_integer(): + return int(value) + return num + except ValueError: + pass + + if value == b'true': + return True + elif value == b'false': + return False + + # The following types are returned between double quotes or + # bytearray(b'"')[0] or int 34 for shortness. + if value[0] == 34 and value[-1] == 34: + value_nq = value[1:-1] + + value_datetime = self._DATETIME_to_python(value_nq) + if value_datetime is not None: + return value_datetime + + value_date = self._DATE_to_python(value_nq) + if value_date is not None: + return value_date + try: + value_time = self._TIME_to_python(value_nq) + if value_time is not None: + return value_time + except ValueError: + pass + + if isinstance(value, (bytes, bytearray)): + return value.decode(self.charset) + + if dsc is not None: + # Check if we deal with a SET + if dsc[7] & FieldFlag.SET: + return self._SET_to_python(value, dsc) + if dsc[7] & FieldFlag.BINARY: + if self.charset != 'binary' and not isinstance(value, str): + try: + return value.decode(self.charset) + except (LookupError, UnicodeDecodeError): + return value + else: + return value + + return self._STRING_to_python(value, dsc) + + def _STRING_to_python(self, value, dsc=None): # pylint: disable=C0103 + """ + Note that a SET is a string too, but using the FieldFlag we can see + whether we have to split it. + + Returns string typed columns as string type. + """ + if dsc is not None: + # Check if we deal with a SET + if dsc[7] & FieldFlag.SET: + return self._SET_to_python(value, dsc) + if dsc[7] & FieldFlag.BINARY: + if self.charset != 'binary' and not isinstance(value, str): + try: + return value.decode(self.charset) + except (LookupError, UnicodeDecodeError): + return value + else: + return value + + if self.charset == 'binary': + return value + if isinstance(value, (bytes, bytearray)) and self.use_unicode: + return value.decode(self.charset) + + return value + + _VAR_STRING_to_python = _STRING_to_python + + def _BLOB_to_python(self, value, dsc=None): # pylint: disable=C0103 + """Convert BLOB data type to Python""" + if dsc is not None: + if dsc[7] & FieldFlag.BINARY: + if PY2: + return value + elif isinstance(value, str): + return bytes(value, self.charset) + return bytes(value) + + return self._STRING_to_python(value, dsc) + + _LONG_BLOB_to_python = _JSON_to_python + _MEDIUM_BLOB_to_python = _BLOB_to_python + _TINY_BLOB_to_python = _BLOB_to_python diff --git a/venv/Lib/site-packages/mysql/connector/cursor.py b/venv/Lib/site-packages/mysql/connector/cursor.py new file mode 100644 index 0000000..1a2ab5c --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/cursor.py @@ -0,0 +1,1435 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Cursor classes +""" + +from collections import namedtuple +import re +import weakref + +from . import errors +from .abstracts import MySQLCursorAbstract, NAMED_TUPLE_CACHE +from .catch23 import PY2 +from .constants import ServerFlag + +SQL_COMMENT = r"\/\*.*?\*\/" +RE_SQL_COMMENT = re.compile( + r'''({0})|(["'`][^"'`]*?({0})[^"'`]*?["'`])'''.format(SQL_COMMENT), + re.I | re.M | re.S) +RE_SQL_ON_DUPLICATE = re.compile( + r'''\s*ON\s+DUPLICATE\s+KEY(?:[^"'`]*["'`][^"'`]*["'`])*[^"'`]*$''', + re.I | re.M | re.S) +RE_SQL_INSERT_STMT = re.compile( + r"({0}|\s)*INSERT({0}|\s)*INTO\s+[`'\"]?.+[`'\"]?(?:\.[`'\"]?.+[`'\"]?)" + r"{{0,2}}\s+VALUES\s*\(.+(?:\s*,.+)*\)".format(SQL_COMMENT), + re.I | re.M | re.S) +RE_SQL_INSERT_VALUES = re.compile(r'.*VALUES\s*(\(.*\)).*', re.I | re.M | re.S) +RE_PY_PARAM = re.compile(b'(%s)') +RE_PY_MAPPING_PARAM = re.compile( + br''' + % + \((?P[^)]+)\) + (?P[diouxXeEfFgGcrs%]) + ''', + re.X +) +RE_SQL_SPLIT_STMTS = re.compile( + b''';(?=(?:[^"'`]*["'`][^"'`]*["'`])*[^"'`]*$)''') +RE_SQL_FIND_PARAM = re.compile( + b'''%s(?=(?:[^"'`]*["'`][^"'`]*["'`])*[^"'`]*$)''') + +ERR_NO_RESULT_TO_FETCH = "No result set to fetch from" + +MAX_RESULTS = 4294967295 + +class _ParamSubstitutor(object): + """ + Substitutes parameters into SQL statement. + """ + def __init__(self, params): + self.params = params + self.index = 0 + + def __call__(self, matchobj): + index = self.index + self.index += 1 + try: + return bytes(self.params[index]) + except IndexError: + raise errors.ProgrammingError( + "Not enough parameters for the SQL statement") + + @property + def remaining(self): + """Returns number of parameters remaining to be substituted""" + return len(self.params) - self.index + + +def _bytestr_format_dict(bytestr, value_dict): + """ + >>> _bytestr_format_dict(b'%(a)s', {b'a': b'foobar'}) + b'foobar + >>> _bytestr_format_dict(b'%%(a)s', {b'a': b'foobar'}) + b'%%(a)s' + >>> _bytestr_format_dict(b'%%%(a)s', {b'a': b'foobar'}) + b'%%foobar' + >>> _bytestr_format_dict(b'%(x)s %(y)s', + ... {b'x': b'x=%(y)s', b'y': b'y=%(x)s'}) + b'x=%(y)s y=%(x)s' + """ + def replace(matchobj): + """Replace pattern.""" + value = None + groups = matchobj.groupdict() + if groups["conversion_type"] == b"%": + value = b"%" + if groups["conversion_type"] == b"s": + key = groups["mapping_key"] + value = value_dict[key] + if value is None: + raise ValueError("Unsupported conversion_type: {0}" + "".format(groups["conversion_type"])) + return bytes(value) if PY2 else value + + stmt = RE_PY_MAPPING_PARAM.sub(replace, bytestr) + if PY2: + try: + return stmt.decode("utf-8") + except UnicodeDecodeError: + pass + return stmt + + +class CursorBase(MySQLCursorAbstract): + """ + Base for defining MySQLCursor. This class is a skeleton and defines + methods and members as required for the Python Database API + Specification v2.0. + + It's better to inherite from MySQLCursor. + """ + + _raw = False + + def __init__(self): + self._description = None + self._rowcount = -1 + self._last_insert_id = None + self.arraysize = 1 + super(CursorBase, self).__init__() + + def callproc(self, procname, args=()): + """Calls a stored procedue with the given arguments + + The arguments will be set during this session, meaning + they will be called like ___arg where + is an enumeration (+1) of the arguments. + + Coding Example: + 1) Definining the Stored Routine in MySQL: + CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT) + BEGIN + SET pProd := pFac1 * pFac2; + END + + 2) Executing in Python: + args = (5,5,0) # 0 is to hold pprod + cursor.callproc('multiply', args) + print(cursor.fetchone()) + + Does not return a value, but a result set will be + available when the CALL-statement execute successfully. + Raises exceptions when something is wrong. + """ + pass + + def close(self): + """Close the cursor.""" + pass + + def execute(self, operation, params=(), multi=False): + """Executes the given operation + + Executes the given operation substituting any markers with + the given parameters. + + For example, getting all rows where id is 5: + cursor.execute("SELECT * FROM t1 WHERE id = %s", (5,)) + + The multi argument should be set to True when executing multiple + statements in one operation. If not set and multiple results are + found, an InterfaceError will be raised. + + If warnings where generated, and connection.get_warnings is True, then + self._warnings will be a list containing these warnings. + + Returns an iterator when multi is True, otherwise None. + """ + pass + + def executemany(self, operation, seq_params): + """Execute the given operation multiple times + + The executemany() method will execute the operation iterating + over the list of parameters in seq_params. + + Example: Inserting 3 new employees and their phone number + + data = [ + ('Jane','555-001'), + ('Joe', '555-001'), + ('John', '555-003') + ] + stmt = "INSERT INTO employees (name, phone) VALUES ('%s','%s')" + cursor.executemany(stmt, data) + + INSERT statements are optimized by batching the data, that is + using the MySQL multiple rows syntax. + + Results are discarded. If they are needed, consider looping over + data using the execute() method. + """ + pass + + def fetchone(self): + """Returns next row of a query result set + + Returns a tuple or None. + """ + pass + + def fetchmany(self, size=1): + """Returns the next set of rows of a query result, returning a + list of tuples. When no more rows are available, it returns an + empty list. + + The number of rows returned can be specified using the size argument, + which defaults to one + """ + pass + + def fetchall(self): + """Returns all rows of a query result set + + Returns a list of tuples. + """ + pass + + def nextset(self): + """Not Implemented.""" + pass + + def setinputsizes(self, sizes): + """Not Implemented.""" + pass + + def setoutputsize(self, size, column=None): + """Not Implemented.""" + pass + + def reset(self, free=True): + """Reset the cursor to default""" + pass + + @property + def description(self): + """Returns description of columns in a result + + This property returns a list of tuples describing the columns in + in a result set. A tuple is described as follows:: + + (column_name, + type, + None, + None, + None, + None, + null_ok, + column_flags) # Addition to PEP-249 specs + + Returns a list of tuples. + """ + return self._description + + @property + def rowcount(self): + """Returns the number of rows produced or affected + + This property returns the number of rows produced by queries + such as a SELECT, or affected rows when executing DML statements + like INSERT or UPDATE. + + Note that for non-buffered cursors it is impossible to know the + number of rows produced before having fetched them all. For those, + the number of rows will be -1 right after execution, and + incremented when fetching rows. + + Returns an integer. + """ + return self._rowcount + + @property + def lastrowid(self): + """Returns the value generated for an AUTO_INCREMENT column + + Returns the value generated for an AUTO_INCREMENT column by + the previous INSERT or UPDATE statement or None when there is + no such value available. + + Returns a long value or None. + """ + return self._last_insert_id + + +class MySQLCursor(CursorBase): + """Default cursor for interacting with MySQL + + This cursor will execute statements and handle the result. It will + not automatically fetch all rows. + + MySQLCursor should be inherited whenever other functionallity is + required. An example would to change the fetch* member functions + to return dictionaries instead of lists of values. + + Implements the Python Database API Specification v2.0 (PEP-249) + """ + def __init__(self, connection=None): + CursorBase.__init__(self) + self._connection = None + self._stored_results = [] + self._nextrow = (None, None) + self._warnings = None + self._warning_count = 0 + self._executed = None + self._executed_list = [] + self._binary = False + + if connection is not None: + self._set_connection(connection) + + def __iter__(self): + """ + Iteration over the result set which calls self.fetchone() + and returns the next row. + """ + return iter(self.fetchone, None) + + def _set_connection(self, connection): + """Set the connection""" + try: + self._connection = weakref.proxy(connection) + self._connection.is_connected() + except (AttributeError, TypeError): + raise errors.InterfaceError(errno=2048) + + def _reset_result(self): + """Reset the cursor to default""" + self._rowcount = -1 + self._nextrow = (None, None) + self._stored_results = [] + self._warnings = None + self._warning_count = 0 + self._description = None + self._executed = None + self._executed_list = [] + self.reset() + + def _have_unread_result(self): + """Check whether there is an unread result""" + try: + return self._connection.unread_result + except AttributeError: + return False + + def next(self): + """Used for iterating over the result set.""" + return self.__next__() + + def __next__(self): + """ + Used for iterating over the result set. Calles self.fetchone() + to get the next row. + """ + try: + row = self.fetchone() + except errors.InterfaceError: + raise StopIteration + if not row: + raise StopIteration + return row + + def close(self): + """Close the cursor + + Returns True when successful, otherwise False. + """ + if self._connection is None: + return False + + self._connection.handle_unread_result() + self._reset_result() + self._connection = None + + return True + + def _process_params_dict(self, params): + """Process query parameters given as dictionary""" + try: + to_mysql = self._connection.converter.to_mysql + escape = self._connection.converter.escape + quote = self._connection.converter.quote + res = {} + for key, value in list(params.items()): + conv = value + conv = to_mysql(conv) + conv = escape(conv) + conv = quote(conv) + if PY2: + res[key] = conv + else: + res[key.encode()] = conv + except Exception as err: + raise errors.ProgrammingError( + "Failed processing pyformat-parameters; %s" % err) + else: + return res + + def _process_params(self, params): + """Process query parameters.""" + try: + res = params + + to_mysql = self._connection.converter.to_mysql + escape = self._connection.converter.escape + quote = self._connection.converter.quote + + res = [to_mysql(i) for i in res] + res = [escape(i) for i in res] + res = [quote(i) for i in res] + except Exception as err: + raise errors.ProgrammingError( + "Failed processing format-parameters; %s" % err) + else: + return tuple(res) + + def _handle_noresultset(self, res): + """Handles result of execute() when there is no result set + """ + try: + self._rowcount = res['affected_rows'] + self._last_insert_id = res['insert_id'] + self._warning_count = res['warning_count'] + except (KeyError, TypeError) as err: + raise errors.ProgrammingError( + "Failed handling non-resultset; {0}".format(err)) + + self._handle_warnings() + if self._connection.raise_on_warnings is True and self._warnings: + raise errors.get_mysql_exception( + self._warnings[0][1], self._warnings[0][2]) + + def _handle_resultset(self): + """Handles result set + + This method handles the result set and is called after reading + and storing column information in _handle_result(). For non-buffering + cursors, this method is usually doing nothing. + """ + pass + + def _handle_result(self, result): + """ + Handle the result after a command was send. The result can be either + an OK-packet or a dictionary containing column/eof information. + + Raises InterfaceError when result is not a dict() or result is + invalid. + """ + if not isinstance(result, dict): + raise errors.InterfaceError('Result was not a dict()') + + if 'columns' in result: + # Weak test, must be column/eof information + self._description = result['columns'] + self._connection.unread_result = True + self._handle_resultset() + elif 'affected_rows' in result: + # Weak test, must be an OK-packet + self._connection.unread_result = False + self._handle_noresultset(result) + else: + raise errors.InterfaceError('Invalid result') + + def _execute_iter(self, query_iter): + """Generator returns MySQLCursor objects for multiple statements + + This method is only used when multiple statements are executed + by the execute() method. It uses zip() to make an iterator from the + given query_iter (result of MySQLConnection.cmd_query_iter()) and + the list of statements that were executed. + """ + executed_list = RE_SQL_SPLIT_STMTS.split(self._executed) + + i = 0 + while True: + try: + result = next(query_iter) + self._reset_result() + self._handle_result(result) + try: + self._executed = executed_list[i].strip() + i += 1 + except IndexError: + self._executed = executed_list[0] + + yield self + except StopIteration: + return + + def execute(self, operation, params=None, multi=False): + """Executes the given operation + + Executes the given operation substituting any markers with + the given parameters. + + For example, getting all rows where id is 5: + cursor.execute("SELECT * FROM t1 WHERE id = %s", (5,)) + + The multi argument should be set to True when executing multiple + statements in one operation. If not set and multiple results are + found, an InterfaceError will be raised. + + If warnings where generated, and connection.get_warnings is True, then + self._warnings will be a list containing these warnings. + + Returns an iterator when multi is True, otherwise None. + """ + if not operation: + return None + + if not self._connection: + raise errors.ProgrammingError("Cursor is not connected") + + self._connection.handle_unread_result() + + self._reset_result() + stmt = '' + + try: + if not isinstance(operation, (bytes, bytearray)): + stmt = operation.encode(self._connection.python_charset) + else: + stmt = operation + except (UnicodeDecodeError, UnicodeEncodeError) as err: + raise errors.ProgrammingError(str(err)) + + if params is not None: + if isinstance(params, dict): + stmt = _bytestr_format_dict( + stmt, self._process_params_dict(params)) + elif isinstance(params, (list, tuple)): + psub = _ParamSubstitutor(self._process_params(params)) + stmt = RE_PY_PARAM.sub(psub, stmt) + if psub.remaining != 0: + raise errors.ProgrammingError( + "Not all parameters were used in the SQL statement") + + self._executed = stmt + if multi: + self._executed_list = [] + return self._execute_iter(self._connection.cmd_query_iter(stmt)) + + try: + self._handle_result(self._connection.cmd_query(stmt)) + except errors.InterfaceError: + if self._connection._have_next_result: # pylint: disable=W0212 + raise errors.InterfaceError( + "Use multi=True when executing multiple statements") + raise + return None + + def _batch_insert(self, operation, seq_params): + """Implements multi row insert""" + def remove_comments(match): + """Remove comments from INSERT statements. + + This function is used while removing comments from INSERT + statements. If the matched string is a comment not enclosed + by quotes, it returns an empty string, else the string itself. + """ + if match.group(1): + return "" + return match.group(2) + + tmp = re.sub(RE_SQL_ON_DUPLICATE, '', + re.sub(RE_SQL_COMMENT, remove_comments, operation)) + + matches = re.search(RE_SQL_INSERT_VALUES, tmp) + if not matches: + raise errors.InterfaceError( + "Failed rewriting statement for multi-row INSERT. " + "Check SQL syntax." + ) + fmt = matches.group(1).encode(self._connection.python_charset) + values = [] + + try: + stmt = operation.encode(self._connection.python_charset) + for params in seq_params: + tmp = fmt + if isinstance(params, dict): + tmp = _bytestr_format_dict( + tmp, self._process_params_dict(params)) + else: + psub = _ParamSubstitutor(self._process_params(params)) + tmp = RE_PY_PARAM.sub(psub, tmp) + if psub.remaining != 0: + raise errors.ProgrammingError( + "Not all parameters were used in the SQL statement") + #for p in self._process_params(params): + # tmp = tmp.replace(b'%s',p,1) + values.append(tmp) + if fmt in stmt: + stmt = stmt.replace(fmt, b','.join(values), 1) + self._executed = stmt + return stmt + return None + except (UnicodeDecodeError, UnicodeEncodeError) as err: + raise errors.ProgrammingError(str(err)) + except errors.Error: + raise + except Exception as err: + raise errors.InterfaceError( + "Failed executing the operation; %s" % err) + + def executemany(self, operation, seq_params): + """Execute the given operation multiple times + + The executemany() method will execute the operation iterating + over the list of parameters in seq_params. + + Example: Inserting 3 new employees and their phone number + + data = [ + ('Jane','555-001'), + ('Joe', '555-001'), + ('John', '555-003') + ] + stmt = "INSERT INTO employees (name, phone) VALUES ('%s','%s)" + cursor.executemany(stmt, data) + + INSERT statements are optimized by batching the data, that is + using the MySQL multiple rows syntax. + + Results are discarded. If they are needed, consider looping over + data using the execute() method. + """ + if not operation or not seq_params: + return None + self._connection.handle_unread_result() + + try: + _ = iter(seq_params) + except TypeError: + raise errors.ProgrammingError( + "Parameters for query must be an Iterable.") + + # Optimize INSERTs by batching them + if re.match(RE_SQL_INSERT_STMT, operation): + if not seq_params: + self._rowcount = 0 + return None + stmt = self._batch_insert(operation, seq_params) + if stmt is not None: + return self.execute(stmt) + + rowcnt = 0 + try: + for params in seq_params: + self.execute(operation, params) + if self.with_rows and self._have_unread_result(): + self.fetchall() + rowcnt += self._rowcount + except (ValueError, TypeError) as err: + raise errors.InterfaceError( + "Failed executing the operation; {0}".format(err)) + except: + # Raise whatever execute() raises + raise + self._rowcount = rowcnt + return None + + def stored_results(self): + """Returns an iterator for stored results + + This method returns an iterator over results which are stored when + callproc() is called. The iterator will provide MySQLCursorBuffered + instances. + + Returns a iterator. + """ + return iter(self._stored_results) + + def callproc(self, procname, args=()): + """Calls a stored procedure with the given arguments + + The arguments will be set during this session, meaning + they will be called like ___arg where + is an enumeration (+1) of the arguments. + + Coding Example: + 1) Defining the Stored Routine in MySQL: + CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT) + BEGIN + SET pProd := pFac1 * pFac2; + END + + 2) Executing in Python: + args = (5, 5, 0) # 0 is to hold pprod + cursor.callproc('multiply', args) + print(cursor.fetchone()) + + For OUT and INOUT parameters the user should provide the + type of the parameter as well. The argument should be a + tuple with first item as the value of the parameter to pass + and second argument the type of the argument. + + In the above example, one can call callproc method like: + args = (5, 5, (0, 'INT')) + cursor.callproc('multiply', args) + + The type of the argument given in the tuple will be used by + the MySQL CAST function to convert the values in the corresponding + MySQL type (See CAST in MySQL Reference for more information) + + Does not return a value, but a result set will be + available when the CALL-statement execute successfully. + Raises exceptions when something is wrong. + """ + if not procname or not isinstance(procname, str): + raise ValueError("procname must be a string") + + if not isinstance(args, (tuple, list)): + raise ValueError("args must be a sequence") + + argfmt = "@_{name}_arg{index}" + self._stored_results = [] + + results = [] + try: + argnames = [] + argtypes = [] + if args: + for idx, arg in enumerate(args): + argname = argfmt.format(name=procname, index=idx + 1) + argnames.append(argname) + if isinstance(arg, tuple): + argtypes.append(" CAST({0} AS {1})".format(argname, + arg[1])) + self.execute("SET {0}=%s".format(argname), (arg[0],)) + else: + argtypes.append(argname) + self.execute("SET {0}=%s".format(argname), (arg,)) + + call = "CALL {0}({1})".format(procname, ','.join(argnames)) + + # pylint: disable=W0212 + # We disable consuming results temporary to make sure we + # getting all results + can_consume_results = self._connection._consume_results + for result in self._connection.cmd_query_iter(call): + self._connection._consume_results = False + if self._raw: + tmp = MySQLCursorBufferedRaw(self._connection._get_self()) + else: + tmp = MySQLCursorBuffered(self._connection._get_self()) + tmp._executed = "(a result of {0})".format(call) + tmp._handle_result(result) + if tmp._warnings is not None: + self._warnings = tmp._warnings + if 'columns' in result: + results.append(tmp) + self._connection._consume_results = can_consume_results + # pylint: enable=W0212 + + if argnames: + select = "SELECT {0}".format(','.join(argtypes)) + self.execute(select) + self._stored_results = results + return self.fetchone() + + self._stored_results = results + return () + + except errors.Error: + raise + except Exception as err: + raise errors.InterfaceError( + "Failed calling stored routine; {0}".format(err)) + + def getlastrowid(self): + """Returns the value generated for an AUTO_INCREMENT column + + Returns the value generated for an AUTO_INCREMENT column by + the previous INSERT or UPDATE statement. + + Returns a long value or None. + """ + return self._last_insert_id + + def _fetch_warnings(self): + """ + Fetch warnings doing a SHOW WARNINGS. Can be called after getting + the result. + + Returns a result set or None when there were no warnings. + """ + res = [] + try: + cur = self._connection.cursor(raw=False) + cur.execute("SHOW WARNINGS") + res = cur.fetchall() + cur.close() + except Exception as err: + raise errors.InterfaceError( + "Failed getting warnings; %s" % err) + + if res: + return res + + return None + + def _handle_warnings(self): + """Handle possible warnings after all results are consumed""" + if self._connection.get_warnings is True and self._warning_count: + self._warnings = self._fetch_warnings() + + def _handle_eof(self, eof): + """Handle EOF packet""" + self._connection.unread_result = False + self._nextrow = (None, None) + self._warning_count = eof['warning_count'] + self._handle_warnings() + if self._connection.raise_on_warnings is True and self._warnings: + raise errors.get_mysql_exception( + self._warnings[0][1], self._warnings[0][2]) + + def _fetch_row(self, raw=False): + """Returns the next row in the result set + + Returns a tuple or None. + """ + if not self._have_unread_result(): + return None + row = None + + if self._nextrow == (None, None): + (row, eof) = self._connection.get_row( + binary=self._binary, columns=self.description, raw=raw) + else: + (row, eof) = self._nextrow + + if row: + self._nextrow = self._connection.get_row( + binary=self._binary, columns=self.description, raw=raw) + eof = self._nextrow[1] + if eof is not None: + self._handle_eof(eof) + if self._rowcount == -1: + self._rowcount = 1 + else: + self._rowcount += 1 + if eof: + self._handle_eof(eof) + + return row + + def fetchone(self): + """Returns next row of a query result set + + Returns a tuple or None. + """ + row = self._fetch_row() + if row: + return row + return None + + def fetchmany(self, size=None): + res = [] + cnt = (size or self.arraysize) + while cnt > 0 and self._have_unread_result(): + cnt -= 1 + row = self.fetchone() + if row: + res.append(row) + return res + + def fetchall(self): + if not self._have_unread_result(): + raise errors.InterfaceError("No result set to fetch from.") + (rows, eof) = self._connection.get_rows() + if self._nextrow[0]: + rows.insert(0, self._nextrow[0]) + + self._handle_eof(eof) + rowcount = len(rows) + if rowcount >= 0 and self._rowcount == -1: + self._rowcount = 0 + self._rowcount += rowcount + return rows + + @property + def column_names(self): + """Returns column names + + This property returns the columns names as a tuple. + + Returns a tuple. + """ + if not self.description: + return () + return tuple([d[0] for d in self.description]) + + @property + def statement(self): + """Returns the executed statement + + This property returns the executed statement. When multiple + statements were executed, the current statement in the iterator + will be returned. + """ + if self._executed is None: + return None + try: + return self._executed.strip().decode('utf-8') + except (AttributeError, UnicodeDecodeError): + return self._executed.strip() + + @property + def with_rows(self): + """Returns whether the cursor could have rows returned + + This property returns True when column descriptions are available + and possibly also rows, which will need to be fetched. + + Returns True or False. + """ + if not self.description: + return False + return True + + def __str__(self): + fmt = "{class_name}: {stmt}" + if self._executed: + try: + executed = self._executed.decode('utf-8') + except AttributeError: + executed = self._executed + if len(executed) > 40: + executed = executed[:40] + '..' + else: + executed = '(Nothing executed yet)' + return fmt.format(class_name=self.__class__.__name__, stmt=executed) + + +class MySQLCursorBuffered(MySQLCursor): + """Cursor which fetches rows within execute()""" + + def __init__(self, connection=None): + MySQLCursor.__init__(self, connection) + self._rows = None + self._next_row = 0 + + def _handle_resultset(self): + (self._rows, eof) = self._connection.get_rows() + self._rowcount = len(self._rows) + self._handle_eof(eof) + self._next_row = 0 + try: + self._connection.unread_result = False + except: + pass + + def reset(self, free=True): + self._rows = None + + def _fetch_row(self, raw=False): + row = None + try: + row = self._rows[self._next_row] + except: + return None + else: + self._next_row += 1 + return row + return None + + def fetchone(self): + """Returns next row of a query result set + + Returns a tuple or None. + """ + row = self._fetch_row() + if row: + return row + return None + + def fetchall(self): + if self._rows is None: + raise errors.InterfaceError("No result set to fetch from.") + res = [] + res = self._rows[self._next_row:] + self._next_row = len(self._rows) + return res + + def fetchmany(self, size=None): + res = [] + cnt = (size or self.arraysize) + while cnt > 0: + cnt -= 1 + row = self.fetchone() + if row: + res.append(row) + + return res + + @property + def with_rows(self): + return self._rows is not None + + +class MySQLCursorRaw(MySQLCursor): + """ + Skips conversion from MySQL datatypes to Python types when fetching rows. + """ + + _raw = True + + def fetchone(self): + row = self._fetch_row(raw=True) + + if row: + return row + return None + + def fetchall(self): + if not self._have_unread_result(): + raise errors.InterfaceError("No result set to fetch from.") + (rows, eof) = self._connection.get_rows(raw=True) + if self._nextrow[0]: + rows.insert(0, self._nextrow[0]) + self._handle_eof(eof) + rowcount = len(rows) + if rowcount >= 0 and self._rowcount == -1: + self._rowcount = 0 + self._rowcount += rowcount + return rows + + +class MySQLCursorBufferedRaw(MySQLCursorBuffered): + """ + Cursor which skips conversion from MySQL datatypes to Python types when + fetching rows and fetches rows within execute(). + """ + + _raw = True + + def _handle_resultset(self): + (self._rows, eof) = self._connection.get_rows(raw=self._raw) + self._rowcount = len(self._rows) + self._handle_eof(eof) + self._next_row = 0 + try: + self._connection.unread_result = False + except: + pass + + def fetchone(self): + row = self._fetch_row() + if row: + return row + return None + + def fetchall(self): + if self._rows is None: + raise errors.InterfaceError("No result set to fetch from.") + return [r for r in self._rows[self._next_row:]] + + @property + def with_rows(self): + return self._rows is not None + + +class MySQLCursorPrepared(MySQLCursor): + """Cursor using MySQL Prepared Statements + """ + def __init__(self, connection=None): + super(MySQLCursorPrepared, self).__init__(connection) + self._rows = None + self._next_row = 0 + self._prepared = None + self._binary = True + self._have_result = None + self._last_row_sent = False + self._cursor_exists = False + + def reset(self, free=True): + if self._prepared: + try: + self._connection.cmd_stmt_close(self._prepared['statement_id']) + except errors.Error: + # We tried to deallocate, but it's OK when we fail. + pass + self._prepared = None + self._last_row_sent = False + self._cursor_exists = False + + def _handle_noresultset(self, res): + self._handle_server_status(res.get('status_flag', + res.get('server_status', 0))) + super(MySQLCursorPrepared, self)._handle_noresultset(res) + + def _handle_server_status(self, flags): + """Check for SERVER_STATUS_CURSOR_EXISTS and + SERVER_STATUS_LAST_ROW_SENT flags set by the server. + """ + self._cursor_exists = flags & ServerFlag.STATUS_CURSOR_EXISTS != 0 + self._last_row_sent = flags & ServerFlag.STATUS_LAST_ROW_SENT != 0 + + def _handle_eof(self, eof): + self._handle_server_status(eof.get('status_flag', + eof.get('server_status', 0))) + super(MySQLCursorPrepared, self)._handle_eof(eof) + + def callproc(self, procname, args=()): + """Calls a stored procedue + + Not supported with MySQLCursorPrepared. + """ + raise errors.NotSupportedError() + + def close(self): + """Close the cursor + + This method will try to deallocate the prepared statement and close + the cursor. + """ + self.reset() + super(MySQLCursorPrepared, self).close() + + def _row_to_python(self, rowdata, desc=None): + """Convert row data from MySQL to Python types + + The conversion is done while reading binary data in the + protocol module. + """ + pass + + def _handle_result(self, result): + """Handle result after execution""" + if isinstance(result, dict): + self._connection.unread_result = False + self._have_result = False + self._handle_noresultset(result) + else: + self._description = result[1] + self._connection.unread_result = True + self._have_result = True + + if 'status_flag' in result[2]: + self._handle_server_status(result[2]['status_flag']) + elif 'server_status' in result[2]: + self._handle_server_status(result[2]['server_status']) + + def execute(self, operation, params=(), multi=False): # multi is unused + """Prepare and execute a MySQL Prepared Statement + + This method will preare the given operation and execute it using + the optionally given parameters. + + If the cursor instance already had a prepared statement, it is + first closed. + """ + if operation is not self._executed: + if self._prepared: + self._connection.cmd_stmt_close(self._prepared['statement_id']) + + self._executed = operation + try: + if not isinstance(operation, bytes): + charset = self._connection.charset + if charset == 'utf8mb4': + charset = 'utf8' + operation = operation.encode(charset) + except (UnicodeDecodeError, UnicodeEncodeError) as err: + raise errors.ProgrammingError(str(err)) + + # need to convert %s to ? before sending it to MySQL + if b'%s' in operation: + operation = re.sub(RE_SQL_FIND_PARAM, b'?', operation) + + try: + self._prepared = self._connection.cmd_stmt_prepare(operation) + except errors.Error: + self._executed = None + raise + + self._connection.cmd_stmt_reset(self._prepared['statement_id']) + + if self._prepared['parameters'] and not params: + return + elif len(self._prepared['parameters']) != len(params): + raise errors.ProgrammingError( + errno=1210, + msg="Incorrect number of arguments " \ + "executing prepared statement") + + res = self._connection.cmd_stmt_execute( + self._prepared['statement_id'], + data=params, + parameters=self._prepared['parameters']) + self._handle_result(res) + + def executemany(self, operation, seq_params): + """Prepare and execute a MySQL Prepared Statement many times + + This method will prepare the given operation and execute with each + tuple found the list seq_params. + + If the cursor instance already had a prepared statement, it is + first closed. + + executemany() simply calls execute(). + """ + rowcnt = 0 + try: + for params in seq_params: + self.execute(operation, params) + if self.with_rows and self._have_unread_result(): + self.fetchall() + rowcnt += self._rowcount + except (ValueError, TypeError) as err: + raise errors.InterfaceError( + "Failed executing the operation; {error}".format(error=err)) + except: + # Raise whatever execute() raises + raise + self._rowcount = rowcnt + + def fetchone(self): + """Returns next row of a query result set + + Returns a tuple or None. + """ + if self._cursor_exists: + self._connection.cmd_stmt_fetch(self._prepared['statement_id']) + return self._fetch_row() or None + + def fetchmany(self, size=None): + res = [] + cnt = (size or self.arraysize) + while cnt > 0 and self._have_unread_result(): + cnt -= 1 + row = self._fetch_row() + if row: + res.append(row) + return res + + def fetchall(self): + if not self._have_unread_result(): + raise errors.InterfaceError("No result set to fetch from.") + rows = [] + if self._nextrow[0]: + rows.append(self._nextrow[0]) + while self._have_unread_result(): + if self._cursor_exists: + self._connection.cmd_stmt_fetch( + self._prepared['statement_id'], MAX_RESULTS) + (tmp, eof) = self._connection.get_rows( + binary=self._binary, columns=self.description) + rows.extend(tmp) + self._handle_eof(eof) + self._rowcount = len(rows) + return rows + + +class MySQLCursorDict(MySQLCursor): + """ + Cursor fetching rows as dictionaries. + + The fetch methods of this class will return dictionaries instead of tuples. + Each row is a dictionary that looks like: + row = { + "col1": value1, + "col2": value2 + } + """ + def _row_to_python(self, rowdata, desc=None): + """Convert a MySQL text result row to Python types + + Returns a dictionary. + """ + row = rowdata + + if row: + return dict(zip(self.column_names, row)) + + return None + + def fetchone(self): + """Returns next row of a query result set + """ + row = self._fetch_row() + if row: + return self._row_to_python(row, self.description) + return None + + def fetchall(self): + """Returns all rows of a query result set + """ + if not self._have_unread_result(): + raise errors.InterfaceError(ERR_NO_RESULT_TO_FETCH) + (rows, eof) = self._connection.get_rows() + if self._nextrow[0]: + rows.insert(0, self._nextrow[0]) + res = [] + for row in rows: + res.append(self._row_to_python(row, self.description)) + self._handle_eof(eof) + rowcount = len(rows) + if rowcount >= 0 and self._rowcount == -1: + self._rowcount = 0 + self._rowcount += rowcount + return res + + +class MySQLCursorNamedTuple(MySQLCursor): + """ + Cursor fetching rows as named tuple. + + The fetch methods of this class will return namedtuples instead of tuples. + Each row is returned as a namedtuple and the values can be accessed as: + row.col1, row.col2 + """ + def _row_to_python(self, rowdata, desc=None): + """Convert a MySQL text result row to Python types + + Returns a named tuple. + """ + row = rowdata + + if row: + # pylint: disable=W0201 + columns = tuple(self.column_names) + try: + named_tuple = NAMED_TUPLE_CACHE[columns] + except KeyError: + named_tuple = namedtuple('Row', columns) + NAMED_TUPLE_CACHE[columns] = named_tuple + # pylint: enable=W0201 + return named_tuple(*row) + return None + + def fetchone(self): + """Returns next row of a query result set + """ + row = self._fetch_row() + if row: + if hasattr(self._connection, 'converter'): + return self._row_to_python(row, self.description) + return row + return None + + def fetchall(self): + """Returns all rows of a query result set + """ + if not self._have_unread_result(): + raise errors.InterfaceError(ERR_NO_RESULT_TO_FETCH) + (rows, eof) = self._connection.get_rows() + if self._nextrow[0]: + rows.insert(0, self._nextrow[0]) + res = [self._row_to_python(row, self.description) + for row in rows] + + self._handle_eof(eof) + rowcount = len(rows) + if rowcount >= 0 and self._rowcount == -1: + self._rowcount = 0 + self._rowcount += rowcount + return res + + +class MySQLCursorBufferedDict(MySQLCursorDict, MySQLCursorBuffered): + """ + Buffered Cursor fetching rows as dictionaries. + """ + def fetchone(self): + """Returns next row of a query result set + """ + row = self._fetch_row() + if row: + return self._row_to_python(row, self.description) + return None + + def fetchall(self): + """Returns all rows of a query result set + """ + if self._rows is None: + raise errors.InterfaceError(ERR_NO_RESULT_TO_FETCH) + res = [] + for row in self._rows[self._next_row:]: + res.append(self._row_to_python( + row, self.description)) + self._next_row = len(self._rows) + return res + + +class MySQLCursorBufferedNamedTuple(MySQLCursorNamedTuple, MySQLCursorBuffered): + """ + Buffered Cursor fetching rows as named tuple. + """ + def fetchone(self): + """Returns next row of a query result set + """ + row = self._fetch_row() + if row: + return self._row_to_python(row, self.description) + return None + + def fetchall(self): + """Returns all rows of a query result set + """ + if self._rows is None: + raise errors.InterfaceError(ERR_NO_RESULT_TO_FETCH) + res = [] + for row in self._rows[self._next_row:]: + res.append(self._row_to_python( + row, self.description)) + self._next_row = len(self._rows) + return res diff --git a/venv/Lib/site-packages/mysql/connector/cursor_cext.py b/venv/Lib/site-packages/mysql/connector/cursor_cext.py new file mode 100644 index 0000000..0e82d3d --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/cursor_cext.py @@ -0,0 +1,820 @@ +# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Cursor classes using the C Extension +""" + +from collections import namedtuple +import re +import weakref + +from _mysql_connector import MySQLInterfaceError # pylint: disable=F0401,E0611 + +from .abstracts import (MySQLConnectionAbstract, MySQLCursorAbstract, + NAMED_TUPLE_CACHE) +from .catch23 import PY2, isunicode +from . import errors +from .errorcode import CR_NO_RESULT_SET + +from .cursor import ( + RE_PY_PARAM, RE_SQL_INSERT_STMT, + RE_SQL_ON_DUPLICATE, RE_SQL_COMMENT, RE_SQL_INSERT_VALUES, + RE_SQL_SPLIT_STMTS +) + + +class _ParamSubstitutor(object): + + """ + Substitutes parameters into SQL statement. + """ + + def __init__(self, params): + self.params = params + self.index = 0 + + def __call__(self, matchobj): + index = self.index + self.index += 1 + try: + return self.params[index] + except IndexError: + raise errors.ProgrammingError( + "Not enough parameters for the SQL statement") + + @property + def remaining(self): + """Returns number of parameters remaining to be substituted""" + return len(self.params) - self.index + + +class CMySQLCursor(MySQLCursorAbstract): + + """Default cursor for interacting with MySQL using C Extension""" + + _raw = False + _buffered = False + _raw_as_string = False + + def __init__(self, connection): + """Initialize""" + MySQLCursorAbstract.__init__(self) + + self._insert_id = 0 + self._warning_count = 0 + self._warnings = None + self._affected_rows = -1 + self._rowcount = -1 + self._nextrow = (None, None) + self._executed = None + self._executed_list = [] + self._stored_results = [] + + if not isinstance(connection, MySQLConnectionAbstract): + raise errors.InterfaceError(errno=2048) + self._cnx = weakref.proxy(connection) + + def reset(self, free=True): + """Reset the cursor + + When free is True (default) the result will be freed. + """ + self._rowcount = -1 + self._nextrow = None + self._affected_rows = -1 + self._insert_id = 0 + self._warning_count = 0 + self._warnings = None + self._warnings = None + self._warning_count = 0 + self._description = None + self._executed = None + self._executed_list = [] + if free and self._cnx: + self._cnx.free_result() + super(CMySQLCursor, self).reset() + + def _fetch_warnings(self): + """Fetch warnings + + Fetch warnings doing a SHOW WARNINGS. Can be called after getting + the result. + + Returns a result set or None when there were no warnings. + + Raises errors.Error (or subclass) on errors. + + Returns list of tuples or None. + """ + warnings = [] + try: + # force freeing result + self._cnx.consume_results() + _ = self._cnx.cmd_query("SHOW WARNINGS") + warnings = self._cnx.get_rows()[0] + self._cnx.consume_results() + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + except Exception as err: + raise errors.InterfaceError( + "Failed getting warnings; {0}".format(str(err))) + + if warnings: + return warnings + + return None + + def _handle_warnings(self): + """Handle possible warnings after all results are consumed""" + if self._cnx.get_warnings is True and self._warning_count: + self._warnings = self._fetch_warnings() + + def _handle_result(self, result): + """Handles the result after statement execution""" + if 'columns' in result: + self._description = result['columns'] + self._rowcount = 0 + self._handle_resultset() + else: + self._insert_id = result['insert_id'] + self._warning_count = result['warning_count'] + self._affected_rows = result['affected_rows'] + self._rowcount = -1 + self._handle_warnings() + if self._cnx.raise_on_warnings is True and self._warnings: + raise errors.get_mysql_exception(*self._warnings[0][1:3]) + + def _handle_resultset(self): + """Handle a result set""" + pass + + def _handle_eof(self): + """Handle end of reading the result + + Raises an errors.Error on errors. + """ + self._warning_count = self._cnx.warning_count + self._handle_warnings() + if self._cnx.raise_on_warnings is True and self._warnings: + raise errors.get_mysql_exception(*self._warnings[0][1:3]) + + if not self._cnx.more_results: + self._cnx.free_result() + + def _execute_iter(self): + """Generator returns MySQLCursor objects for multiple statements + + Deprecated: use nextset() method directly. + + This method is only used when multiple statements are executed + by the execute() method. It uses zip() to make an iterator from the + given query_iter (result of MySQLConnection.cmd_query_iter()) and + the list of statements that were executed. + """ + executed_list = RE_SQL_SPLIT_STMTS.split(self._executed) + i = 0 + self._executed = executed_list[i] + yield self + + while True: + try: + if not self.nextset(): + raise StopIteration + except errors.InterfaceError as exc: + # Result without result set + if exc.errno != CR_NO_RESULT_SET: + raise + except StopIteration: + return + i += 1 + try: + self._executed = executed_list[i].strip() + except IndexError: + self._executed = executed_list[0] + yield self + return + + def execute(self, operation, params=(), multi=False): + """Execute given statement using given parameters + + Deprecated: The multi argument is not needed and nextset() should + be used to handle multiple result sets. + """ + if not operation: + return None + + if not self._cnx: + raise errors.ProgrammingError("Cursor is not connected") + self._cnx.handle_unread_result() + + stmt = '' + self.reset() + + try: + if isunicode(operation): + stmt = operation.encode(self._cnx.python_charset) + else: + stmt = operation + except (UnicodeDecodeError, UnicodeEncodeError) as err: + raise errors.ProgrammingError(str(err)) + + if params: + prepared = self._cnx.prepare_for_mysql(params) + if isinstance(prepared, dict): + for key, value in prepared.items(): + if PY2: + stmt = stmt.replace("%({0})s".format(key), value) + else: + stmt = stmt.replace("%({0})s".format(key).encode(), + value) + elif isinstance(prepared, (list, tuple)): + psub = _ParamSubstitutor(prepared) + stmt = RE_PY_PARAM.sub(psub, stmt) + if psub.remaining != 0: + raise errors.ProgrammingError( + "Not all parameters were used in the SQL statement") + + try: + result = self._cnx.cmd_query(stmt, raw=self._raw, + buffered=self._buffered, + raw_as_string=self._raw_as_string) + except MySQLInterfaceError as exc: + raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno, + sqlstate=exc.sqlstate) + + self._executed = stmt + self._handle_result(result) + + if multi: + return self._execute_iter() + + return None + + def _batch_insert(self, operation, seq_params): + """Implements multi row insert""" + def remove_comments(match): + """Remove comments from INSERT statements. + + This function is used while removing comments from INSERT + statements. If the matched string is a comment not enclosed + by quotes, it returns an empty string, else the string itself. + """ + if match.group(1): + return "" + return match.group(2) + + tmp = re.sub(RE_SQL_ON_DUPLICATE, '', + re.sub(RE_SQL_COMMENT, remove_comments, operation)) + + matches = re.search(RE_SQL_INSERT_VALUES, tmp) + if not matches: + raise errors.InterfaceError( + "Failed rewriting statement for multi-row INSERT. " + "Check SQL syntax." + ) + fmt = matches.group(1).encode(self._cnx.python_charset) + values = [] + + try: + stmt = operation.encode(self._cnx.python_charset) + for params in seq_params: + tmp = fmt + prepared = self._cnx.prepare_for_mysql(params) + if isinstance(prepared, dict): + for key, value in prepared.items(): + tmp = tmp.replace("%({0})s".format(key).encode(), value) + elif isinstance(prepared, (list, tuple)): + psub = _ParamSubstitutor(prepared) + tmp = RE_PY_PARAM.sub(psub, tmp) + if psub.remaining != 0: + raise errors.ProgrammingError( + "Not all parameters were used in the SQL statement") + values.append(tmp) + + if fmt in stmt: + stmt = stmt.replace(fmt, b','.join(values), 1) + self._executed = stmt + return stmt + return None + except (UnicodeDecodeError, UnicodeEncodeError) as err: + raise errors.ProgrammingError(str(err)) + except Exception as err: + raise errors.InterfaceError( + "Failed executing the operation; %s" % err) + + + def executemany(self, operation, seq_params): + """Execute the given operation multiple times""" + if not operation or not seq_params: + return None + + if not self._cnx: + raise errors.ProgrammingError("Cursor is not connected") + self._cnx.handle_unread_result() + + if not isinstance(seq_params, (list, tuple)): + raise errors.ProgrammingError( + "Parameters for query must be list or tuple.") + + # Optimize INSERTs by batching them + if re.match(RE_SQL_INSERT_STMT, operation): + if not seq_params: + self._rowcount = 0 + return None + stmt = self._batch_insert(operation, seq_params) + if stmt is not None: + return self.execute(stmt) + + rowcnt = 0 + try: + for params in seq_params: + self.execute(operation, params) + try: + while True: + if self._description: + rowcnt += len(self._cnx.get_rows()[0]) + else: + rowcnt += self._affected_rows + if not self.nextset(): + break + except StopIteration: + # No more results + pass + + except (ValueError, TypeError) as err: + raise errors.ProgrammingError( + "Failed executing the operation; {0}".format(err)) + + self._rowcount = rowcnt + return None + + @property + def description(self): + """Returns description of columns in a result""" + return self._description + + @property + def rowcount(self): + """Returns the number of rows produced or affected""" + if self._rowcount == -1: + return self._affected_rows + return self._rowcount + + @property + def lastrowid(self): + """Returns the value generated for an AUTO_INCREMENT column""" + return self._insert_id + + def close(self): + """Close the cursor + + The result will be freed. + """ + if not self._cnx: + return False + + self._cnx.handle_unread_result() + self._warnings = None + self._cnx = None + return True + + def callproc(self, procname, args=()): + """Calls a stored procedure with the given arguments""" + if not procname or not isinstance(procname, str): + raise ValueError("procname must be a string") + + if not isinstance(args, (tuple, list)): + raise ValueError("args must be a sequence") + + argfmt = "@_{name}_arg{index}" + self._stored_results = [] + + try: + argnames = [] + argtypes = [] + if args: + for idx, arg in enumerate(args): + argname = argfmt.format(name=procname, index=idx + 1) + argnames.append(argname) + if isinstance(arg, tuple): + argtypes.append(" CAST({0} AS {1})".format(argname, + arg[1])) + self.execute("SET {0}=%s".format(argname), (arg[0],)) + else: + argtypes.append(argname) + self.execute("SET {0}=%s".format(argname), (arg,)) + + call = "CALL {0}({1})".format(procname, ','.join(argnames)) + + result = self._cnx.cmd_query(call, raw=self._raw, + raw_as_string=self._raw_as_string) + + results = [] + while self._cnx.result_set_available: + result = self._cnx.fetch_eof_columns() + # pylint: disable=W0212 + if self._raw: + cur = CMySQLCursorBufferedRaw(self._cnx._get_self()) + else: + cur = CMySQLCursorBuffered(self._cnx._get_self()) + cur._executed = "(a result of {0})".format(call) + cur._handle_result(result) + # pylint: enable=W0212 + results.append(cur) + self._cnx.next_result() + self._stored_results = results + self._handle_eof() + + if argnames: + self.reset() + select = "SELECT {0}".format(','.join(argtypes)) + self.execute(select) + + return self.fetchone() + return tuple() + + except errors.Error: + raise + except Exception as err: + raise errors.InterfaceError( + "Failed calling stored routine; {0}".format(err)) + + def nextset(self): + """Skip to the next available result set""" + if not self._cnx.next_result(): + self.reset(free=True) + return None + self.reset(free=False) + + if not self._cnx.result_set_available: + eof = self._cnx.fetch_eof_status() + self._handle_result(eof) + raise errors.InterfaceError(errno=CR_NO_RESULT_SET) + + self._handle_result(self._cnx.fetch_eof_columns()) + return True + + def fetchall(self): + """Returns all rows of a query result set + + Returns a list of tuples. + """ + if not self._cnx.unread_result: + raise errors.InterfaceError("No result set to fetch from.") + rows = self._cnx.get_rows() + if self._nextrow and self._nextrow[0]: + rows[0].insert(0, self._nextrow[0]) + + if not rows[0]: + self._handle_eof() + return [] + + self._rowcount += len(rows[0]) + self._handle_eof() + #self._cnx.handle_unread_result() + return rows[0] + + def fetchmany(self, size=1): + """Returns the next set of rows of a result set""" + if self._nextrow and self._nextrow[0]: + rows = [self._nextrow[0]] + size -= 1 + else: + rows = [] + + if size and self._cnx.unread_result: + rows.extend(self._cnx.get_rows(size)[0]) + + if size and self._cnx.unread_result: + self._nextrow = self._cnx.get_row() + if self._nextrow and not self._nextrow[0] and \ + not self._cnx.more_results: + self._cnx.free_result() + + if not rows: + self._handle_eof() + return [] + + self._rowcount += len(rows) + return rows + + def fetchone(self): + """Returns next row of a query result set""" + row = self._nextrow + if not row and self._cnx.unread_result: + row = self._cnx.get_row() + + if row and row[0]: + self._nextrow = self._cnx.get_row() + if not self._nextrow[0] and not self._cnx.more_results: + self._cnx.free_result() + else: + self._handle_eof() + return None + self._rowcount += 1 + return row[0] + + def __iter__(self): + """Iteration over the result set + + Iteration over the result set which calls self.fetchone() + and returns the next row. + """ + return iter(self.fetchone, None) + + def stored_results(self): + """Returns an iterator for stored results + + This method returns an iterator over results which are stored when + callproc() is called. The iterator will provide MySQLCursorBuffered + instances. + + Returns a iterator. + """ + for i in range(len(self._stored_results)): + yield self._stored_results[i] + + self._stored_results = [] + + if PY2: + def next(self): + """Used for iterating over the result set.""" + return self.__next__() + + def __next__(self): + """Iteration over the result set + Used for iterating over the result set. Calls self.fetchone() + to get the next row. + + Raises StopIteration when no more rows are available. + """ + try: + row = self.fetchone() + except errors.InterfaceError: + raise StopIteration + if not row: + raise StopIteration + return row + + @property + def column_names(self): + """Returns column names + + This property returns the columns names as a tuple. + + Returns a tuple. + """ + if not self.description: + return () + return tuple([d[0] for d in self.description]) + + @property + def statement(self): + """Returns the executed statement + + This property returns the executed statement. When multiple + statements were executed, the current statement in the iterator + will be returned. + """ + try: + return self._executed.strip().decode('utf8') + except AttributeError: + return self._executed.strip() + + @property + def with_rows(self): + """Returns whether the cursor could have rows returned + + This property returns True when column descriptions are available + and possibly also rows, which will need to be fetched. + + Returns True or False. + """ + if self.description: + return True + return False + + def __str__(self): + fmt = "{class_name}: {stmt}" + if self._executed: + try: + executed = self._executed.decode('utf-8') + except AttributeError: + executed = self._executed + if len(executed) > 40: + executed = executed[:40] + '..' + else: + executed = '(Nothing executed yet)' + + return fmt.format(class_name=self.__class__.__name__, stmt=executed) + + +class CMySQLCursorBuffered(CMySQLCursor): + + """Cursor using C Extension buffering results""" + + def __init__(self, connection): + """Initialize""" + super(CMySQLCursorBuffered, self).__init__(connection) + + self._rows = None + self._next_row = 0 + + def _handle_resultset(self): + """Handle a result set""" + self._rows = self._cnx.get_rows()[0] + self._next_row = 0 + self._rowcount = len(self._rows) + self._handle_eof() + + def reset(self, free=True): + """Reset the cursor to default""" + self._rows = None + self._next_row = 0 + super(CMySQLCursorBuffered, self).reset(free=free) + + def _fetch_row(self): + """Returns the next row in the result set + + Returns a tuple or None. + """ + row = None + try: + row = self._rows[self._next_row] + except IndexError: + return None + else: + self._next_row += 1 + + return row + + def fetchall(self): + if self._rows is None: + raise errors.InterfaceError("No result set to fetch from.") + res = self._rows[self._next_row:] + self._next_row = len(self._rows) + return res + + def fetchmany(self, size=1): + res = [] + cnt = size or self.arraysize + while cnt > 0: + cnt -= 1 + row = self._fetch_row() + if row: + res.append(row) + else: + break + return res + + def fetchone(self): + return self._fetch_row() + + +class CMySQLCursorRaw(CMySQLCursor): + + """Cursor using C Extension return raw results""" + + _raw = True + + +class CMySQLCursorBufferedRaw(CMySQLCursorBuffered): + + """Cursor using C Extension buffering raw results""" + + _raw = True + + +class CMySQLCursorDict(CMySQLCursor): + + """Cursor using C Extension returning rows as dictionaries""" + + _raw = False + + def fetchone(self): + """Returns all rows of a query result set + """ + row = super(CMySQLCursorDict, self).fetchone() + if row: + return dict(zip(self.column_names, row)) + return None + + def fetchmany(self, size=1): + """Returns next set of rows as list of dictionaries""" + res = super(CMySQLCursorDict, self).fetchmany(size=size) + return [dict(zip(self.column_names, row)) for row in res] + + def fetchall(self): + """Returns all rows of a query result set as list of dictionaries""" + res = super(CMySQLCursorDict, self).fetchall() + return [dict(zip(self.column_names, row)) for row in res] + + +class CMySQLCursorBufferedDict(CMySQLCursorBuffered): + + """Cursor using C Extension buffering and returning rows as dictionaries""" + + _raw = False + + def _fetch_row(self): + row = super(CMySQLCursorBufferedDict, self)._fetch_row() + if row: + return dict(zip(self.column_names, row)) + return None + + def fetchall(self): + res = super(CMySQLCursorBufferedDict, self).fetchall() + return [dict(zip(self.column_names, row)) for row in res] + + +class CMySQLCursorNamedTuple(CMySQLCursor): + + """Cursor using C Extension returning rows as named tuples""" + + def _handle_resultset(self): + """Handle a result set""" + super(CMySQLCursorNamedTuple, self)._handle_resultset() + # pylint: disable=W0201 + columns = tuple(self.column_names) + try: + self.named_tuple = NAMED_TUPLE_CACHE[columns] + except KeyError: + self.named_tuple = namedtuple('Row', columns) + NAMED_TUPLE_CACHE[columns] = self.named_tuple + # pylint: enable=W0201 + + def fetchone(self): + """Returns all rows of a query result set + """ + row = super(CMySQLCursorNamedTuple, self).fetchone() + if row: + return self.named_tuple(*row) + return None + + def fetchmany(self, size=1): + """Returns next set of rows as list of named tuples""" + res = super(CMySQLCursorNamedTuple, self).fetchmany(size=size) + return [self.named_tuple(*res[0])] + + def fetchall(self): + """Returns all rows of a query result set as list of named tuples""" + res = super(CMySQLCursorNamedTuple, self).fetchall() + return [self.named_tuple(*row) for row in res] + + +class CMySQLCursorBufferedNamedTuple(CMySQLCursorBuffered): + + """Cursor using C Extension buffering and returning rows as named tuples""" + + def _handle_resultset(self): + super(CMySQLCursorBufferedNamedTuple, self)._handle_resultset() + # pylint: disable=W0201 + self.named_tuple = namedtuple('Row', self.column_names) + # pylint: enable=W0201 + + def _fetch_row(self): + row = super(CMySQLCursorBufferedNamedTuple, self)._fetch_row() + if row: + return self.named_tuple(*row) + return None + + def fetchall(self): + res = super(CMySQLCursorBufferedNamedTuple, self).fetchall() + return [self.named_tuple(*row) for row in res] + + +class CMySQLCursorPrepared(CMySQLCursor): + + """Cursor using Prepare Statement + """ + + def __init__(self, connection): + super(CMySQLCursorPrepared, self).__init__(connection) + raise NotImplementedError( + "Alternative: Use connection.MySQLCursorPrepared") diff --git a/venv/Lib/site-packages/mysql/connector/custom_types.py b/venv/Lib/site-packages/mysql/connector/custom_types.py new file mode 100644 index 0000000..3613af6 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/custom_types.py @@ -0,0 +1,50 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Custom Python types used by MySQL Connector/Python""" + + +import sys + + +class HexLiteral(str): + + """Class holding MySQL hex literals""" + + def __new__(cls, str_, charset='utf8'): + if sys.version_info[0] == 2: + hexed = ["%02x" % ord(i) for i in str_.encode(charset)] + else: + hexed = ["%02x" % i for i in str_.encode(charset)] + obj = str.__new__(cls, ''.join(hexed)) + obj.charset = charset + obj.original = str_ + return obj + + def __str__(self): + return '0x' + self diff --git a/venv/Lib/site-packages/mysql/connector/dbapi.py b/venv/Lib/site-packages/mysql/connector/dbapi.py new file mode 100644 index 0000000..873cfbb --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/dbapi.py @@ -0,0 +1,80 @@ +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +""" +This module implements some constructors and singletons as required by the +DB API v2.0 (PEP-249). +""" + +# Python Db API v2 +apilevel = '2.0' +threadsafety = 1 +paramstyle = 'pyformat' + +import time +import datetime + +from . import constants + +class _DBAPITypeObject(object): + + def __init__(self, *values): + self.values = values + + def __eq__(self, other): + if other in self.values: + return True + else: + return False + + def __ne__(self, other): + if other in self.values: + return False + else: + return True + +Date = datetime.date +Time = datetime.time +Timestamp = datetime.datetime + +def DateFromTicks(ticks): + return Date(*time.localtime(ticks)[:3]) + +def TimeFromTicks(ticks): + return Time(*time.localtime(ticks)[3:6]) + +def TimestampFromTicks(ticks): + return Timestamp(*time.localtime(ticks)[:6]) + +Binary = bytes + +STRING = _DBAPITypeObject(*constants.FieldType.get_string_types()) +BINARY = _DBAPITypeObject(*constants.FieldType.get_binary_types()) +NUMBER = _DBAPITypeObject(*constants.FieldType.get_number_types()) +DATETIME = _DBAPITypeObject(*constants.FieldType.get_timestamp_types()) +ROWID = _DBAPITypeObject() diff --git a/venv/Lib/site-packages/mysql/connector/django/__init__.py b/venv/Lib/site-packages/mysql/connector/django/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/venv/Lib/site-packages/mysql/connector/django/base.py b/venv/Lib/site-packages/mysql/connector/django/base.py new file mode 100644 index 0000000..fcdbbe0 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/base.py @@ -0,0 +1,575 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +"""Django database Backend using MySQL Connector/Python + +This Django database backend is heavily based on the MySQL backend coming +with Django. + +Changes include: +* Support for microseconds (MySQL 5.6.3 and later) +* Using INFORMATION_SCHEMA where possible +* Using new defaults for, for example SQL_AUTO_IS_NULL + +Requires and comes with MySQL Connector/Python v1.1 and later: + http://dev.mysql.com/downloads/connector/python/ +""" + + +from __future__ import unicode_literals + +from datetime import datetime +import sys +import warnings + +import django +from django.core.exceptions import ImproperlyConfigured +from django.utils.functional import cached_property + +try: + import mysql.connector + from mysql.connector.conversion import MySQLConverter, MySQLConverterBase + from mysql.connector.catch23 import PY2 +except ImportError as err: + raise ImproperlyConfigured( + "Error loading mysql.connector module: {0}".format(err)) + +try: + version = mysql.connector.__version_info__[0:3] +except AttributeError: + from mysql.connector.version import VERSION + version = VERSION[0:3] + +try: + from _mysql_connector import datetime_to_mysql, time_to_mysql +except ImportError: + HAVE_CEXT = False +else: + HAVE_CEXT = True + +if version < (1, 1): + raise ImproperlyConfigured( + "MySQL Connector/Python v1.1.0 or newer " + "is required; you have %s" % mysql.connector.__version__) + +from django.db import utils +if django.VERSION < (1, 7): + from django.db.backends import util +else: + from django.db.backends import utils as backend_utils +if django.VERSION >= (1, 8): + from django.db.backends.base.base import BaseDatabaseWrapper +else: + from django.db.backends import BaseDatabaseWrapper + +from django.db.backends.signals import connection_created +from django.utils import (six, timezone, dateparse) +from django.conf import settings + +from mysql.connector.django.client import DatabaseClient +from mysql.connector.django.creation import DatabaseCreation +from mysql.connector.django.introspection import DatabaseIntrospection +from mysql.connector.django.validation import DatabaseValidation +from mysql.connector.django.features import DatabaseFeatures +from mysql.connector.django.operations import DatabaseOperations +if django.VERSION >= (1, 7): + from mysql.connector.django.schema import DatabaseSchemaEditor + + +DatabaseError = mysql.connector.DatabaseError +IntegrityError = mysql.connector.IntegrityError +NotSupportedError = mysql.connector.NotSupportedError + + +def adapt_datetime_with_timezone_support(value): + # Equivalent to DateTimeField.get_db_prep_value. Used only by raw SQL. + if settings.USE_TZ: + if timezone.is_naive(value): + warnings.warn("MySQL received a naive datetime (%s)" + " while time zone support is active." % value, + RuntimeWarning) + default_timezone = timezone.get_default_timezone() + value = timezone.make_aware(value, default_timezone) + value = value.astimezone(timezone.utc).replace(tzinfo=None) + if HAVE_CEXT: + return datetime_to_mysql(value) + else: + return value.strftime("%Y-%m-%d %H:%M:%S.%f") + + +class DjangoMySQLConverter(MySQLConverter): + """Custom converter for Django for MySQLConnection""" + def _TIME_to_python(self, value, dsc=None): + """Return MySQL TIME data type as datetime.time() + + Returns datetime.time() + """ + return dateparse.parse_time(value.decode('utf-8')) + + def _DATETIME_to_python(self, value, dsc=None): + """Connector/Python always returns naive datetime.datetime + + Connector/Python always returns naive timestamps since MySQL has + no time zone support. Since Django needs non-naive, we need to add + the UTC time zone. + + Returns datetime.datetime() + """ + if not value: + return None + dt = MySQLConverter._DATETIME_to_python(self, value) + if dt is None: + return None + if settings.USE_TZ and timezone.is_naive(dt): + dt = dt.replace(tzinfo=timezone.utc) + return dt + + def _safetext_to_mysql(self, value): + if PY2: + return self._unicode_to_mysql(value) + else: + return self._str_to_mysql(value) + + def _safebytes_to_mysql(self, value): + return self._bytes_to_mysql(value) + + +class DjangoCMySQLConverter(MySQLConverterBase): + """Custom converter for Django for CMySQLConnection""" + def _TIME_to_python(self, value, dsc=None): + """Return MySQL TIME data type as datetime.time() + + Returns datetime.time() + """ + return dateparse.parse_time(str(value)) + + def _DATETIME_to_python(self, value, dsc=None): + """Connector/Python always returns naive datetime.datetime + + Connector/Python always returns naive timestamps since MySQL has + no time zone support. Since Django needs non-naive, we need to add + the UTC time zone. + + Returns datetime.datetime() + """ + if not value: + return None + if settings.USE_TZ and timezone.is_naive(value): + value = value.replace(tzinfo=timezone.utc) + return value + + +class CursorWrapper(object): + """Wrapper around MySQL Connector/Python's cursor class. + + The cursor class is defined by the options passed to MySQL + Connector/Python. If buffered option is True in those options, + MySQLCursorBuffered will be used. + """ + codes_for_integrityerror = (1048,) + + def __init__(self, cursor): + self.cursor = cursor + + def _execute_wrapper(self, method, query, args): + """Wrapper around execute() and executemany()""" + try: + return method(query, args) + except (mysql.connector.ProgrammingError) as err: + six.reraise(utils.ProgrammingError, + utils.ProgrammingError(err.msg), sys.exc_info()[2]) + except (mysql.connector.IntegrityError) as err: + six.reraise(utils.IntegrityError, + utils.IntegrityError(err.msg), sys.exc_info()[2]) + except mysql.connector.OperationalError as err: + # Map some error codes to IntegrityError, since they seem to be + # misclassified and Django would prefer the more logical place. + if err.args[0] in self.codes_for_integrityerror: + six.reraise(utils.IntegrityError, + utils.IntegrityError(err.msg), sys.exc_info()[2]) + else: + six.reraise(utils.DatabaseError, + utils.DatabaseError(err.msg), sys.exc_info()[2]) + except mysql.connector.DatabaseError as err: + six.reraise(utils.DatabaseError, + utils.DatabaseError(err.msg), sys.exc_info()[2]) + + def _adapt_execute_args_dict(self, args): + if not args: + return args + new_args = dict(args) + for key, value in args.items(): + if isinstance(value, datetime): + new_args[key] = adapt_datetime_with_timezone_support(value) + + return new_args + + def _adapt_execute_args(self, args): + if not args: + return args + new_args = list(args) + for i, arg in enumerate(args): + if isinstance(arg, datetime): + new_args[i] = adapt_datetime_with_timezone_support(arg) + + return tuple(new_args) + + def execute(self, query, args=None): + """Executes the given operation + + This wrapper method around the execute()-method of the cursor is + mainly needed to re-raise using different exceptions. + """ + if isinstance(args, dict): + new_args = self._adapt_execute_args_dict(args) + else: + new_args = self._adapt_execute_args(args) + return self._execute_wrapper(self.cursor.execute, query, new_args) + + def executemany(self, query, args): + """Executes the given operation + + This wrapper method around the executemany()-method of the cursor is + mainly needed to re-raise using different exceptions. + """ + return self._execute_wrapper(self.cursor.executemany, query, args) + + def __getattr__(self, attr): + """Return attribute of wrapped cursor""" + return getattr(self.cursor, attr) + + def __iter__(self): + """Returns iterator over wrapped cursor""" + return iter(self.cursor) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, exc_traceback): + self.close() + + +class DatabaseWrapper(BaseDatabaseWrapper): + vendor = 'mysql' + # This dictionary maps Field objects to their associated MySQL column + # types, as strings. Column-type strings can contain format strings; they'll + # be interpolated against the values of Field.__dict__ before being output. + # If a column type is set to None, it won't be included in the output. + + # Moved from DatabaseCreation class in Django v1.8 + _data_types = { + 'AutoField': 'integer AUTO_INCREMENT', + 'BinaryField': 'longblob', + 'BooleanField': 'bool', + 'CharField': 'varchar(%(max_length)s)', + 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)', + 'DateField': 'date', + 'DateTimeField': 'datetime', + 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', + 'DurationField': 'bigint', + 'FileField': 'varchar(%(max_length)s)', + 'FilePathField': 'varchar(%(max_length)s)', + 'FloatField': 'double precision', + 'IntegerField': 'integer', + 'BigIntegerField': 'bigint', + 'IPAddressField': 'char(15)', + 'GenericIPAddressField': 'char(39)', + 'NullBooleanField': 'bool', + 'OneToOneField': 'integer', + 'PositiveIntegerField': 'integer UNSIGNED', + 'PositiveSmallIntegerField': 'smallint UNSIGNED', + 'SlugField': 'varchar(%(max_length)s)', + 'SmallIntegerField': 'smallint', + 'TextField': 'longtext', + 'TimeField': 'time', + 'UUIDField': 'char(32)', + } + + @cached_property + def data_types(self): + if self.features.supports_microsecond_precision: + return dict(self._data_types, DateTimeField='datetime(6)', + TimeField='time(6)') + else: + return self._data_types + + operators = { + 'exact': '= %s', + 'iexact': 'LIKE %s', + 'contains': 'LIKE BINARY %s', + 'icontains': 'LIKE %s', + 'regex': 'REGEXP BINARY %s', + 'iregex': 'REGEXP %s', + 'gt': '> %s', + 'gte': '>= %s', + 'lt': '< %s', + 'lte': '<= %s', + 'startswith': 'LIKE BINARY %s', + 'endswith': 'LIKE BINARY %s', + 'istartswith': 'LIKE %s', + 'iendswith': 'LIKE %s', + } + + # The patterns below are used to generate SQL pattern lookup clauses when + # the right-hand side of the lookup isn't a raw string (it might be an + # expression or the result of a bilateral transformation). + # In those cases, special characters for LIKE operators (e.g. \, *, _) + # should be escaped on database side. + # + # Note: we use str.format() here for readability as '%' is used as a + # wildcard for the LIKE operator. + pattern_esc = (r"REPLACE(REPLACE(REPLACE({}, '\\', '\\\\')," + r" '%%', '\%%'), '_', '\_')") + pattern_ops = { + 'contains': "LIKE BINARY CONCAT('%%', {}, '%%')", + 'icontains': "LIKE CONCAT('%%', {}, '%%')", + 'startswith': "LIKE BINARY CONCAT({}, '%%')", + 'istartswith': "LIKE CONCAT({}, '%%')", + 'endswith': "LIKE BINARY CONCAT('%%', {})", + 'iendswith': "LIKE CONCAT('%%', {})", + } + + SchemaEditorClass = DatabaseSchemaEditor + Database = mysql.connector + + if django.VERSION >= (1, 11): + client_class = DatabaseClient + creation_class = DatabaseCreation + features_class = DatabaseFeatures + introspection_class = DatabaseIntrospection + ops_class = DatabaseOperations + validation_class = DatabaseValidation + + def __init__(self, *args, **kwargs): + super(DatabaseWrapper, self).__init__(*args, **kwargs) + + try: + self._use_pure = self.settings_dict['OPTIONS']['use_pure'] + except KeyError: + self._use_pure = True + + if not self.use_pure: + self.converter = DjangoCMySQLConverter() + else: + self.converter = DjangoMySQLConverter() + if django.VERSION < (1, 11): + self.ops = DatabaseOperations(self) + self.features = DatabaseFeatures(self) + self.client = DatabaseClient(self) + self.creation = DatabaseCreation(self) + self.introspection = DatabaseIntrospection(self) + self.validation = DatabaseValidation(self) + + def _valid_connection(self): + if self.connection: + return self.connection.is_connected() + return False + + def get_connection_params(self): + # Django 1.6 + kwargs = { + 'charset': 'utf8', + 'use_unicode': True, + 'buffered': False, + 'consume_results': True, + } + + settings_dict = self.settings_dict + + if settings_dict['USER']: + kwargs['user'] = settings_dict['USER'] + if settings_dict['NAME']: + kwargs['database'] = settings_dict['NAME'] + if settings_dict['PASSWORD']: + kwargs['passwd'] = settings_dict['PASSWORD'] + if settings_dict['HOST'].startswith('/'): + kwargs['unix_socket'] = settings_dict['HOST'] + elif settings_dict['HOST']: + kwargs['host'] = settings_dict['HOST'] + if settings_dict['PORT']: + kwargs['port'] = int(settings_dict['PORT']) + + # Raise exceptions for database warnings if DEBUG is on + kwargs['raise_on_warnings'] = settings.DEBUG + + kwargs['client_flags'] = [ + # Need potentially affected rows on UPDATE + mysql.connector.constants.ClientFlag.FOUND_ROWS, + ] + try: + kwargs.update(settings_dict['OPTIONS']) + except KeyError: + # OPTIONS missing is OK + pass + + return kwargs + + def get_new_connection(self, conn_params): + # Django 1.6 + if not self.use_pure: + conn_params['converter_class'] = DjangoCMySQLConverter + else: + conn_params['converter_class'] = DjangoMySQLConverter + cnx = mysql.connector.connect(**conn_params) + + return cnx + + def init_connection_state(self): + # Django 1.6 + if self.mysql_version < (5, 5, 3): + # See sysvar_sql_auto_is_null in MySQL Reference manual + self.connection.cmd_query("SET SQL_AUTO_IS_NULL = 0") + + if 'AUTOCOMMIT' in self.settings_dict: + try: + # Django 1.6 + self.set_autocommit(self.settings_dict['AUTOCOMMIT']) + except AttributeError: + self._set_autocommit(self.settings_dict['AUTOCOMMIT']) + + def create_cursor(self, name=None): + # Django 1.6 + cursor = self.connection.cursor() + return CursorWrapper(cursor) + + def _connect(self): + """Setup the connection with MySQL""" + self.connection = self.get_new_connection(self.get_connection_params()) + connection_created.send(sender=self.__class__, connection=self) + self.init_connection_state() + + def _cursor(self): + """Return a CursorWrapper object + + Returns a CursorWrapper + """ + try: + # Django 1.6 + return super(DatabaseWrapper, self)._cursor() + except AttributeError: + if not self.connection: + self._connect() + return self.create_cursor() + + def get_server_version(self): + """Returns the MySQL server version of current connection + + Returns a tuple + """ + try: + # Django 1.6 + self.ensure_connection() + except AttributeError: + if not self.connection: + self._connect() + + return self.connection.get_server_version() + + def disable_constraint_checking(self): + """Disables foreign key checks + + Disables foreign key checks, primarily for use in adding rows with + forward references. Always returns True, + to indicate constraint checks need to be re-enabled. + + Returns True + """ + self.cursor().execute('SET @@session.foreign_key_checks = 0') + return True + + def enable_constraint_checking(self): + """Re-enable foreign key checks + + Re-enable foreign key checks after they have been disabled. + """ + # Override needs_rollback in case constraint_checks_disabled is + # nested inside transaction.atomic. + if django.VERSION >= (1, 6): + self.needs_rollback, needs_rollback = False, self.needs_rollback + try: + self.cursor().execute('SET @@session.foreign_key_checks = 1') + finally: + if django.VERSION >= (1, 6): + self.needs_rollback = needs_rollback + + def check_constraints(self, table_names=None): + """Check rows in tables for invalid foreign key references + + Checks each table name in `table_names` for rows with invalid foreign + key references. This method is intended to be used in conjunction with + `disable_constraint_checking()` and `enable_constraint_checking()`, to + determine if rows with invalid references were entered while + constraint checks were off. + + Raises an IntegrityError on the first invalid foreign key reference + encountered (if any) and provides detailed information about the + invalid reference in the error message. + + Backends can override this method if they can more directly apply + constraint checking (e.g. via "SET CONSTRAINTS ALL IMMEDIATE") + """ + ref_query = """ + SELECT REFERRING.`{0}`, REFERRING.`{1}` FROM `{2}` as REFERRING + LEFT JOIN `{3}` as REFERRED + ON (REFERRING.`{4}` = REFERRED.`{5}`) + WHERE REFERRING.`{6}` IS NOT NULL AND REFERRED.`{7}` IS NULL""" + cursor = self.cursor() + if table_names is None: + table_names = self.introspection.table_names(cursor) + for table_name in table_names: + primary_key_column_name = \ + self.introspection.get_primary_key_column(cursor, table_name) + if not primary_key_column_name: + continue + key_columns = self.introspection.get_key_columns(cursor, + table_name) + for column_name, referenced_table_name, referenced_column_name \ + in key_columns: + cursor.execute(ref_query.format(primary_key_column_name, + column_name, table_name, + referenced_table_name, + column_name, + referenced_column_name, + column_name, + referenced_column_name)) + for bad_row in cursor.fetchall(): + msg = ("The row in table '{0}' with primary key '{1}' has " + "an invalid foreign key: {2}.{3} contains a value " + "'{4}' that does not have a corresponding value in " + "{5}.{6}.".format(table_name, bad_row[0], + table_name, column_name, + bad_row[1], referenced_table_name, + referenced_column_name)) + raise utils.IntegrityError(msg) + + def _rollback(self): + try: + BaseDatabaseWrapper._rollback(self) + except NotSupportedError: + pass + + def _set_autocommit(self, autocommit): + # Django 1.6 + with self.wrap_database_errors: + self.connection.autocommit = autocommit + + def schema_editor(self, *args, **kwargs): + """Returns a new instance of this backend's SchemaEditor""" + # Django 1.7 + return DatabaseSchemaEditor(self, *args, **kwargs) + + def is_usable(self): + # Django 1.6 + return self.connection.is_connected() + + @cached_property + def mysql_version(self): + config = self.get_connection_params() + temp_conn = mysql.connector.connect(**config) + server_version = temp_conn.get_server_version() + temp_conn.close() + + return server_version + + @property + def use_pure(self): + return not HAVE_CEXT or self._use_pure diff --git a/venv/Lib/site-packages/mysql/connector/django/client.py b/venv/Lib/site-packages/mysql/connector/django/client.py new file mode 100644 index 0000000..8a3dc3e --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/client.py @@ -0,0 +1,57 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +import django +import subprocess + +if django.VERSION >= (1, 8): + from django.db.backends.base.client import BaseDatabaseClient +else: + from django.db.backends import BaseDatabaseClient + + +class DatabaseClient(BaseDatabaseClient): + executable_name = 'mysql' + + @classmethod + def settings_to_cmd_args(cls, settings_dict): + args = [cls.executable_name] + + db = settings_dict['OPTIONS'].get('database', settings_dict['NAME']) + user = settings_dict['OPTIONS'].get('user', + settings_dict['USER']) + passwd = settings_dict['OPTIONS'].get('password', + settings_dict['PASSWORD']) + host = settings_dict['OPTIONS'].get('host', settings_dict['HOST']) + port = settings_dict['OPTIONS'].get('port', settings_dict['PORT']) + defaults_file = settings_dict['OPTIONS'].get('read_default_file') + + # --defaults-file should always be the first option + if defaults_file: + args.append("--defaults-file={0}".format(defaults_file)) + + # We force SQL_MODE to TRADITIONAL + args.append("--init-command=SET @@session.SQL_MODE=TRADITIONAL") + + if user: + args.append("--user={0}".format(user)) + if passwd: + args.append("--password={0}".format(passwd)) + + if host: + if '/' in host: + args.append("--socket={0}".format(host)) + else: + args.append("--host={0}".format(host)) + + if port: + args.append("--port={0}".format(port)) + + if db: + args.append("--database={0}".format(db)) + + return args + + def runshell(self): + args = DatabaseClient.settings_to_cmd_args( + self.connection.settings_dict) + subprocess.call(args) diff --git a/venv/Lib/site-packages/mysql/connector/django/compiler.py b/venv/Lib/site-packages/mysql/connector/django/compiler.py new file mode 100644 index 0000000..232ed99 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/compiler.py @@ -0,0 +1,59 @@ +# MySQL Connector/Python - MySQL driver written in Python. + + +import django +from django.db.models.sql import compiler +from django.utils.six.moves import zip_longest + + +class SQLCompiler(compiler.SQLCompiler): + def resolve_columns(self, row, fields=()): + values = [] + index_extra_select = len(self.query.extra_select) + bool_fields = ("BooleanField", "NullBooleanField") + for value, field in zip_longest(row[index_extra_select:], fields): + if (field and field.get_internal_type() in bool_fields and + value in (0, 1)): + value = bool(value) + values.append(value) + return row[:index_extra_select] + tuple(values) + + if django.VERSION >= (1, 8): + def as_subquery_condition(self, alias, columns, compiler): + qn = compiler.quote_name_unless_alias + qn2 = self.connection.ops.quote_name + sql, params = self.as_sql() + return '(%s) IN (%s)' % (', '.join('%s.%s' % (qn(alias), qn2(column)) for column in columns), sql), params + else: + def as_subquery_condition(self, alias, columns, qn): + # Django 1.6 + qn2 = self.connection.ops.quote_name + sql, params = self.as_sql() + column_list = ', '.join( + ['%s.%s' % (qn(alias), qn2(column)) for column in columns]) + return '({0}) IN ({1})'.format(column_list, sql), params + + +class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler): + pass + + +class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): + pass + + +class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler): + pass + + +class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler): + pass + +if django.VERSION < (1, 8): + class SQLDateCompiler(compiler.SQLDateCompiler, SQLCompiler): + pass + + if django.VERSION >= (1, 6): + class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, SQLCompiler): + # Django 1.6 + pass diff --git a/venv/Lib/site-packages/mysql/connector/django/creation.py b/venv/Lib/site-packages/mysql/connector/django/creation.py new file mode 100644 index 0000000..0937148 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/creation.py @@ -0,0 +1,141 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +import django +from django.db import models + +if django.VERSION >= (1, 8): + from django.db.backends.base.creation import BaseDatabaseCreation +else: + from django.db.backends.creation import BaseDatabaseCreation +if django.VERSION < (1, 7): + from django.db.backends.util import truncate_name +else: + from django.db.backends.utils import truncate_name + +class DatabaseCreation(BaseDatabaseCreation): + """Maps Django Field object with MySQL data types + """ + def __init__(self, connection): + super(DatabaseCreation, self).__init__(connection) + + if django.VERSION < (1, 8): + self.data_types = { + 'AutoField': 'integer AUTO_INCREMENT', + 'BinaryField': 'longblob', + 'BooleanField': 'bool', + 'CharField': 'varchar(%(max_length)s)', + 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)', + 'DateField': 'date', + 'DateTimeField': 'datetime', # ms support set later + 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', + 'FileField': 'varchar(%(max_length)s)', + 'FilePathField': 'varchar(%(max_length)s)', + 'FloatField': 'double precision', + 'IntegerField': 'integer', + 'BigIntegerField': 'bigint', + 'IPAddressField': 'char(15)', + + 'GenericIPAddressField': 'char(39)', + 'NullBooleanField': 'bool', + 'OneToOneField': 'integer', + 'PositiveIntegerField': 'integer UNSIGNED', + 'PositiveSmallIntegerField': 'smallint UNSIGNED', + 'SlugField': 'varchar(%(max_length)s)', + 'SmallIntegerField': 'smallint', + 'TextField': 'longtext', + 'TimeField': 'time', # ms support set later + } + + # Support for microseconds + if self.connection.mysql_version >= (5, 6, 4): + self.data_types.update({ + 'DateTimeField': 'datetime(6)', + 'TimeField': 'time(6)', + }) + + def sql_table_creation_suffix(self): + suffix = [] + if django.VERSION < (1, 7): + if self.connection.settings_dict['TEST_CHARSET']: + suffix.append('CHARACTER SET {0}'.format( + self.connection.settings_dict['TEST_CHARSET'])) + if self.connection.settings_dict['TEST_COLLATION']: + suffix.append('COLLATE {0}'.format( + self.connection.settings_dict['TEST_COLLATION'])) + + else: + test_settings = self.connection.settings_dict['TEST'] + if test_settings['CHARSET']: + suffix.append('CHARACTER SET %s' % test_settings['CHARSET']) + if test_settings['COLLATION']: + suffix.append('COLLATE %s' % test_settings['COLLATION']) + + return ' '.join(suffix) + + if django.VERSION < (1, 6): + def sql_for_inline_foreign_key_references(self, field, known_models, + style): + "All inline references are pending under MySQL" + return [], True + else: + def sql_for_inline_foreign_key_references(self, model, field, + known_models, style): + "All inline references are pending under MySQL" + return [], True + + def sql_for_inline_many_to_many_references(self, model, field, style): + opts = model._meta + qn = self.connection.ops.quote_name + + columndef = ' {column} {type} {options},' + table_output = [ + columndef.format( + column=style.SQL_FIELD(qn(field.m2m_column_name())), + type=style.SQL_COLTYPE(models.ForeignKey(model).db_type( + connection=self.connection)), + options=style.SQL_KEYWORD('NOT NULL') + ), + columndef.format( + column=style.SQL_FIELD(qn(field.m2m_reverse_name())), + type=style.SQL_COLTYPE(models.ForeignKey(field.rel.to).db_type( + connection=self.connection)), + options=style.SQL_KEYWORD('NOT NULL') + ), + ] + + deferred = [ + (field.m2m_db_table(), field.m2m_column_name(), opts.db_table, + opts.pk.column), + (field.m2m_db_table(), field.m2m_reverse_name(), + field.rel.to._meta.db_table, field.rel.to._meta.pk.column) + ] + return table_output, deferred + + def sql_destroy_indexes_for_fields(self, model, fields, style): + # Django 1.6 + if len(fields) == 1 and fields[0].db_tablespace: + tablespace_sql = self.connection.ops.tablespace_sql( + fields[0].db_tablespace) + elif model._meta.db_tablespace: + tablespace_sql = self.connection.ops.tablespace_sql( + model._meta.db_tablespace) + else: + tablespace_sql = "" + if tablespace_sql: + tablespace_sql = " " + tablespace_sql + + field_names = [] + qn = self.connection.ops.quote_name + for f in fields: + field_names.append(style.SQL_FIELD(qn(f.column))) + + index_name = "{0}_{1}".format(model._meta.db_table, + self._digest([f.name for f in fields])) + + return [ + style.SQL_KEYWORD("DROP INDEX") + " " + + style.SQL_TABLE(qn(truncate_name(index_name, + self.connection.ops.max_name_length()))) + " " + + style.SQL_KEYWORD("ON") + " " + + style.SQL_TABLE(qn(model._meta.db_table)) + ";", + ] diff --git a/venv/Lib/site-packages/mysql/connector/django/features.py b/venv/Lib/site-packages/mysql/connector/django/features.py new file mode 100644 index 0000000..cc4c9b7 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/features.py @@ -0,0 +1,127 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +# New file added for Django 1.8 + +import django +if django.VERSION >= (1, 8): + from django.db.backends.base.features import BaseDatabaseFeatures +else: + from django.db.backends import BaseDatabaseFeatures +from django.utils.functional import cached_property +from django.utils import six + +try: + import pytz + HAVE_PYTZ = True +except ImportError: + HAVE_PYTZ = False + + +class DatabaseFeatures(BaseDatabaseFeatures): + """Features specific to MySQL + + Microsecond precision is supported since MySQL 5.6.3 and turned on + by default if this MySQL version is used. + """ + empty_fetchmany_value = [] + update_can_self_select = False + allows_group_by_pk = True + related_fields_match_type = True + allow_sliced_subqueries = False + has_bulk_insert = True + has_select_for_update = True + has_select_for_update_nowait = False + supports_forward_references = False + supports_regex_backreferencing = False + supports_date_lookup_using_string = False + can_introspect_autofield = True + can_introspect_binary_field = False + can_introspect_small_integer_field = True + supports_timezones = False + requires_explicit_null_ordering_when_grouping = True + allows_auto_pk_0 = False + allows_primary_key_0 = False + uses_savepoints = True + atomic_transactions = False + supports_column_check_constraints = False + + if django.VERSION < (1, 8): + supports_long_model_names = False + supports_binary_field = six.PY2 + can_introspect_boolean_field = False + + def __init__(self, connection): + super(DatabaseFeatures, self).__init__(connection) + + @cached_property + def supports_microsecond_precision(self): + if self.connection.mysql_version >= (5, 6, 3): + return True + return False + + @cached_property + def mysql_storage_engine(self): + """Get default storage engine of MySQL + + This method creates a table without ENGINE table option and inspects + which engine was used. + + Used by Django tests. + """ + tblname = 'INTROSPECT_TEST' + + droptable = 'DROP TABLE IF EXISTS {table}'.format(table=tblname) + with self.connection.cursor() as cursor: + cursor.execute(droptable) + cursor.execute('CREATE TABLE {table} (X INT)'.format(table=tblname)) + + if self.connection.mysql_version >= (5, 0, 0): + cursor.execute( + "SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES " + "WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s", + (self.connection.settings_dict['NAME'], tblname)) + engine = cursor.fetchone()[0] + else: + # Very old MySQL servers.. + cursor.execute("SHOW TABLE STATUS WHERE Name='{table}'".format( + table=tblname)) + engine = cursor.fetchone()[1] + cursor.execute(droptable) + + self._cached_storage_engine = engine + return engine + + @cached_property + def _disabled_supports_transactions(self): + return self.mysql_storage_engine == 'InnoDB' + + @cached_property + def can_introspect_foreign_keys(self): + """Confirm support for introspected foreign keys + + Only the InnoDB storage engine supports Foreigen Key (not taking + into account MySQL Cluster here). + """ + return self.mysql_storage_engine == 'InnoDB' + + @cached_property + def has_zoneinfo_database(self): + """Tests if the time zone definitions are installed + + MySQL accepts full time zones names (eg. Africa/Nairobi) but rejects + abbreviations (eg. EAT). When pytz isn't installed and the current + time zone is LocalTimezone (the only sensible value in this context), + the current time zone name will be an abbreviation. As a consequence, + MySQL cannot perform time zone conversions reliably. + """ + # Django 1.6 + if not HAVE_PYTZ: + return False + + with self.connection.cursor() as cursor: + cursor.execute("SELECT 1 FROM mysql.time_zone LIMIT 1") + return cursor.fetchall() != [] + + def introspected_boolean_field_type(self, *args, **kwargs): + # New in Django 1.8 + return 'IntegerField' diff --git a/venv/Lib/site-packages/mysql/connector/django/introspection.py b/venv/Lib/site-packages/mysql/connector/django/introspection.py new file mode 100644 index 0000000..e82623f --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/introspection.py @@ -0,0 +1,367 @@ +# MySQL Connector/Python - MySQL driver written in Python. + + +import re +from collections import namedtuple + +import django +if django.VERSION >= (1, 8): + from django.db.backends.base.introspection import ( + BaseDatabaseIntrospection, FieldInfo, TableInfo + ) +else: + from django.db.backends import BaseDatabaseIntrospection + +if django.VERSION >= (1, 6): + if django.VERSION < (1, 8): + from django.db.backends import FieldInfo + from django.utils.encoding import force_text + if django.VERSION >= (1, 7): + from django.utils.datastructures import OrderedSet + +from mysql.connector.constants import FieldType + +foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) " + r"REFERENCES `([^`]*)` \(`([^`]*)`\)") + +if django.VERSION >= (1, 8): + FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('extra',)) + + +class DatabaseIntrospection(BaseDatabaseIntrospection): + data_types_reverse = { + FieldType.BLOB: 'TextField', + FieldType.DECIMAL: 'DecimalField', + FieldType.NEWDECIMAL: 'DecimalField', + FieldType.DATE: 'DateField', + FieldType.DATETIME: 'DateTimeField', + FieldType.DOUBLE: 'FloatField', + FieldType.FLOAT: 'FloatField', + FieldType.INT24: 'IntegerField', + FieldType.LONG: 'IntegerField', + FieldType.LONGLONG: 'BigIntegerField', + FieldType.SHORT: ( + 'IntegerField' if django.VERSION < (1, 8) else 'SmallIntegerField' + ), + FieldType.STRING: 'CharField', + FieldType.TIME: 'TimeField', + FieldType.TIMESTAMP: 'DateTimeField', + FieldType.TINY: 'IntegerField', + FieldType.TINY_BLOB: 'TextField', + FieldType.MEDIUM_BLOB: 'TextField', + FieldType.LONG_BLOB: 'TextField', + FieldType.VAR_STRING: 'CharField', + } + + def get_field_type(self, data_type, description): + field_type = super(DatabaseIntrospection, self).get_field_type( + data_type, description) + if (field_type == 'IntegerField' + and 'auto_increment' in description.extra): + return 'AutoField' + return field_type + + def get_table_list(self, cursor): + """Returns a list of table names in the current database.""" + cursor.execute("SHOW FULL TABLES") + if django.VERSION >= (1, 8): + return [ + TableInfo(row[0], {'BASE TABLE': 't', 'VIEW': 'v'}.get(row[1])) + for row in cursor.fetchall() + ] + else: + return [row[0] for row in cursor.fetchall()] + + if django.VERSION >= (1, 11): + def get_table_description(self, cursor, table_name): + """ + Returns a description of the table, with the DB-API + cursor.description interface." + """ + # - information_schema database gives more accurate results for + # some figures: + # - varchar length returned by cursor.description is an internal + # length, not visible length (#5725) + # - precision and scale (for decimal fields) (#5014) + # - auto_increment is not available in cursor.description + + InfoLine = namedtuple('InfoLine', 'col_name data_type max_len ' + 'num_prec num_scale extra column_default') + cursor.execute(""" + SELECT column_name, data_type, character_maximum_length, + numeric_precision, numeric_scale, extra, column_default + FROM information_schema.columns + WHERE table_name = %s AND table_schema = DATABASE()""", + [table_name]) + field_info = dict( + (line[0], InfoLine(*line)) for line in cursor.fetchall() + ) + + cursor.execute("SELECT * FROM %s LIMIT 1" + % self.connection.ops.quote_name(table_name)) + to_int = lambda i: int(i) if i is not None else i + fields = [] + for line in cursor.description: + col_name = force_text(line[0]) + fields.append( + FieldInfo(*( + (col_name,) + + line[1:3] + + ( + to_int(field_info[col_name].max_len) or line[3], + to_int(field_info[col_name].num_prec) or line[4], + to_int(field_info[col_name].num_scale) or line[5], + line[6], + field_info[col_name].column_default, + field_info[col_name].extra, + ) + )) + ) + return fields + elif django.VERSION >= (1, 8): + def get_table_description(self, cursor, table_name): + """ + Returns a description of the table, with the DB-API + cursor.description interface." + """ + # - information_schema database gives more accurate results for + # some figures: + # - varchar length returned by cursor.description is an internal + # length, not visible length (#5725) + # - precision and scale (for decimal fields) (#5014) + # - auto_increment is not available in cursor.description + InfoLine = namedtuple( + 'InfoLine', + 'col_name data_type max_len num_prec num_scale extra' + ) + cursor.execute(""" + SELECT column_name, data_type, character_maximum_length, + numeric_precision, numeric_scale, extra + FROM information_schema.columns + WHERE table_name = %s AND table_schema = DATABASE()""", + [table_name]) + field_info = dict( + (line[0], InfoLine(*line)) for line in cursor.fetchall() + ) + + cursor.execute("SELECT * FROM %s LIMIT 1" + % self.connection.ops.quote_name(table_name)) + to_int = lambda i: int(i) if i is not None else i + fields = [] + for line in cursor.description: + col_name = force_text(line[0]) + fields.append( + FieldInfo(*((col_name,) + + line[1:3] + + (to_int(field_info[col_name].max_len) + or line[3], + to_int(field_info[col_name].num_prec) + or line[4], + to_int(field_info[col_name].num_scale) + or line[5]) + + (line[6],) + + (field_info[col_name].extra,))) + ) + return fields + else: + def get_table_description(self, cursor, table_name): + """ + Returns a description of the table, with the DB-API + cursor.description interface. + """ + # varchar length returned by cursor.description is an internal + # length not visible length (#5725), use information_schema database + # to fix this + cursor.execute( + "SELECT column_name, character_maximum_length " + "FROM INFORMATION_SCHEMA.COLUMNS " + "WHERE table_name = %s AND table_schema = DATABASE() " + "AND character_maximum_length IS NOT NULL", [table_name]) + length_map = dict(cursor.fetchall()) + + # Also getting precision and scale from + # information_schema (see #5014) + cursor.execute( + "SELECT column_name, numeric_precision, numeric_scale FROM " + "INFORMATION_SCHEMA.COLUMNS WHERE table_name = %s AND " + "table_schema = DATABASE() AND data_type='decimal'", + [table_name]) + numeric_map = dict((line[0], tuple([int(n) for n in line[1:]])) + for line in cursor.fetchall()) + + cursor.execute("SELECT * FROM {0} LIMIT 1".format( + self.connection.ops.quote_name(table_name))) + + if django.VERSION >= (1, 6): + return [FieldInfo(*((force_text(line[0]),) + + line[1:3] + + (length_map.get(line[0], line[3]),) + + numeric_map.get(line[0], line[4:6]) + + (line[6],))) + for line in cursor.description] + else: + return [ + line[:3] + (length_map.get(line[0], line[3]),) + line[4:] + for line in cursor.description + ] + + def _name_to_index(self, cursor, table_name): + """ + Returns a dictionary of {field_name: field_index} for the given table. + Indexes are 0-based. + """ + return dict((d[0], i) for i, d in enumerate( + self.get_table_description(cursor, table_name))) + + def get_relations(self, cursor, table_name): + """ + Returns a dictionary of {field_index: (field_index_other_table, + other_table)} + representing all relationships to the given table. Indexes are 0-based. + """ + constraints = self.get_key_columns(cursor, table_name) + relations = {} + if django.VERSION >= (1, 8): + for my_fieldname, other_table, other_field in constraints: + relations[my_fieldname] = (other_field, other_table) + return relations + else: + my_field_dict = self._name_to_index(cursor, table_name) + for my_fieldname, other_table, other_field in constraints: + other_field_index = self._name_to_index( + cursor, other_table)[other_field] + my_field_index = my_field_dict[my_fieldname] + relations[my_field_index] = (other_field_index, other_table) + return relations + + def get_key_columns(self, cursor, table_name): + """ + Returns a list of (column_name, referenced_table_name, + referenced_column_name) for all key columns in given table. + """ + key_columns = [] + cursor.execute( + "SELECT column_name, referenced_table_name, referenced_column_name " + "FROM information_schema.key_column_usage " + "WHERE table_name = %s " + "AND table_schema = DATABASE() " + "AND referenced_table_name IS NOT NULL " + "AND referenced_column_name IS NOT NULL", [table_name]) + key_columns.extend(cursor.fetchall()) + return key_columns + + def get_indexes(self, cursor, table_name): + cursor.execute("SHOW INDEX FROM {0}" + "".format(self.connection.ops.quote_name(table_name))) + # Do a two-pass search for indexes: on first pass check which indexes + # are multicolumn, on second pass check which single-column indexes + # are present. + rows = list(cursor.fetchall()) + multicol_indexes = set() + for row in rows: + if row[3] > 1: + multicol_indexes.add(row[2]) + indexes = {} + for row in rows: + if row[2] in multicol_indexes: + continue + if row[4] not in indexes: + indexes[row[4]] = {'primary_key': False, 'unique': False} + # It's possible to have the unique and PK constraints in + # separate indexes. + if row[2] == 'PRIMARY': + indexes[row[4]]['primary_key'] = True + if not row[1]: + indexes[row[4]]['unique'] = True + return indexes + + def get_primary_key_column(self, cursor, table_name): + """ + Returns the name of the primary key column for the given table + """ + # Django 1.6 + for column in self.get_indexes(cursor, table_name).items(): + if column[1]['primary_key']: + return column[0] + return None + + def get_storage_engine(self, cursor, table_name): + """ + Retrieves the storage engine for a given table. Returns the default + storage engine if the table doesn't exist. + """ + cursor.execute( + "SELECT engine " + "FROM information_schema.tables " + "WHERE table_name = %s", [table_name]) + result = cursor.fetchone() + if not result: + return self.connection.features.mysql_storage_engine + return result[0] + + def get_constraints(self, cursor, table_name): + """ + Retrieves any constraints or keys (unique, pk, fk, check, index) across + one or more columns. + """ + # Django 1.7 + constraints = {} + # Get the actual constraint names and columns + name_query = ( + "SELECT kc.`constraint_name`, kc.`column_name`, " + "kc.`referenced_table_name`, kc.`referenced_column_name` " + "FROM information_schema.key_column_usage AS kc " + "WHERE " + "kc.table_schema = %s AND " + "kc.table_name = %s" + ) + cursor.execute(name_query, [self.connection.settings_dict['NAME'], + table_name]) + for constraint, column, ref_table, ref_column in cursor.fetchall(): + if constraint not in constraints: + constraints[constraint] = { + 'columns': OrderedSet(), + 'primary_key': False, + 'unique': False, + 'index': False, + 'check': False, + 'foreign_key': \ + (ref_table, ref_column) if ref_column else None + } + constraints[constraint]['columns'].add(column) + # Now get the constraint types + type_query = """ + SELECT c.constraint_name, c.constraint_type + FROM information_schema.table_constraints AS c + WHERE + c.table_schema = %s AND + c.table_name = %s + """ + cursor.execute(type_query, [self.connection.settings_dict['NAME'], + table_name]) + for constraint, kind in cursor.fetchall(): + if kind.lower() == "primary key": + constraints[constraint]['primary_key'] = True + constraints[constraint]['unique'] = True + elif kind.lower() == "unique": + constraints[constraint]['unique'] = True + # Now add in the indexes + cursor.execute("SHOW INDEX FROM %s" % self.connection.ops.quote_name( + table_name)) + for table, non_unique, index, colseq, column in [x[:5] for x in + cursor.fetchall()]: + if index not in constraints: + constraints[index] = { + 'columns': OrderedSet(), + 'primary_key': False, + 'unique': False, + 'index': True, + 'check': False, + 'foreign_key': None, + } + constraints[index]['index'] = True + constraints[index]['columns'].add(column) + # Convert the sorted sets to lists + for constraint in constraints.values(): + constraint['columns'] = list(constraint['columns']) + return constraints diff --git a/venv/Lib/site-packages/mysql/connector/django/operations.py b/venv/Lib/site-packages/mysql/connector/django/operations.py new file mode 100644 index 0000000..8b23290 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/operations.py @@ -0,0 +1,322 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +# New file added for Django 1.8 + +from __future__ import unicode_literals + +import uuid + +import django +from django.conf import settings +if django.VERSION >= (1, 8): + from django.db.backends.base.operations import BaseDatabaseOperations +else: + from django.db.backends import BaseDatabaseOperations +from django.utils import six, timezone +from django.utils.encoding import force_text + +try: + from _mysql_connector import datetime_to_mysql, time_to_mysql +except ImportError: + HAVE_CEXT = False +else: + HAVE_CEXT = True + + +class DatabaseOperations(BaseDatabaseOperations): + compiler_module = "mysql.connector.django.compiler" + + # MySQL stores positive fields as UNSIGNED ints. + if django.VERSION >= (1, 7): + integer_field_ranges = dict(BaseDatabaseOperations.integer_field_ranges, + PositiveSmallIntegerField=(0, 4294967295), + PositiveIntegerField=( + 0, 18446744073709551615),) + + def date_extract_sql(self, lookup_type, field_name): + # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html + if lookup_type == 'week_day': + # DAYOFWEEK() returns an integer, 1-7, Sunday=1. + # Note: WEEKDAY() returns 0-6, Monday=0. + return "DAYOFWEEK({0})".format(field_name) + else: + return "EXTRACT({0} FROM {1})".format( + lookup_type.upper(), field_name) + + def date_trunc_sql(self, lookup_type, field_name): + """Returns SQL simulating DATE_TRUNC + + This function uses MySQL functions DATE_FORMAT and CAST to + simulate DATE_TRUNC. + + The field_name is returned when lookup_type is not supported. + """ + fields = ['year', 'month', 'day', 'hour', 'minute', 'second'] + format = ('%Y-', '%m', '-%d', ' %H:', '%i', ':%S') + format_def = ('0000-', '01', '-01', ' 00:', '00', ':00') + try: + i = fields.index(lookup_type) + 1 + except ValueError: + # Wrong lookup type, just return the value from MySQL as-is + sql = field_name + else: + format_str = ''.join([f for f in format[:i]] + + [f for f in format_def[i:]]) + sql = "CAST(DATE_FORMAT({0}, '{1}') AS DATETIME)".format( + field_name, format_str) + return sql + + def datetime_extract_sql(self, lookup_type, field_name, tzname): + # Django 1.6 + if settings.USE_TZ: + field_name = "CONVERT_TZ({0}, 'UTC', %s)".format(field_name) + params = [tzname] + else: + params = [] + + # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html + if lookup_type == 'week_day': + # DAYOFWEEK() returns an integer, 1-7, Sunday=1. + # Note: WEEKDAY() returns 0-6, Monday=0. + sql = "DAYOFWEEK({0})".format(field_name) + else: + sql = "EXTRACT({0} FROM {1})".format(lookup_type.upper(), + field_name) + return sql, params + + def datetime_trunc_sql(self, lookup_type, field_name, tzname): + # Django 1.6 + if settings.USE_TZ: + field_name = "CONVERT_TZ({0}, 'UTC', %s)".format(field_name) + params = [tzname] + else: + params = [] + fields = ['year', 'month', 'day', 'hour', 'minute', 'second'] + format_ = ('%Y-', '%m', '-%d', ' %H:', '%i', ':%S') + format_def = ('0000-', '01', '-01', ' 00:', '00', ':00') + try: + i = fields.index(lookup_type) + 1 + except ValueError: + sql = field_name + else: + format_str = ''.join([f for f in format_[:i]] + + [f for f in format_def[i:]]) + sql = "CAST(DATE_FORMAT({0}, '{1}') AS DATETIME)".format( + field_name, format_str) + return sql, params + + if django.VERSION >= (1, 8): + def date_interval_sql(self, timedelta): + """Returns SQL for calculating date/time intervals + """ + return "INTERVAL '%d 0:0:%d:%d' DAY_MICROSECOND" % ( + timedelta.days, timedelta.seconds, timedelta.microseconds), [] + else: + def date_interval_sql(self, sql, connector, timedelta): + """Returns SQL for calculating date/time intervals + """ + fmt = ( + "({sql} {connector} INTERVAL '{days} " + "0:0:{secs}:{msecs}' DAY_MICROSECOND)" + ) + return fmt.format( + sql=sql, + connector=connector, + days=timedelta.days, + secs=timedelta.seconds, + msecs=timedelta.microseconds + ) + + def format_for_duration_arithmetic(self, sql): + if self.connection.features.supports_microsecond_precision: + return 'INTERVAL %s MICROSECOND' % sql + else: + return 'INTERVAL FLOOR(%s / 1000000) SECOND' % sql + + def drop_foreignkey_sql(self): + return "DROP FOREIGN KEY" + + def force_no_ordering(self): + """ + "ORDER BY NULL" prevents MySQL from implicitly ordering by grouped + columns. If no ordering would otherwise be applied, we don't want any + implicit sorting going on. + """ + if django.VERSION >= (1, 8): + return [(None, ("NULL", [], False))] + else: + return ["NULL"] + + def fulltext_search_sql(self, field_name): + return 'MATCH ({0}) AGAINST (%s IN BOOLEAN MODE)'.format(field_name) + + def last_executed_query(self, cursor, sql, params): + return force_text(cursor.statement, errors='replace') + + def no_limit_value(self): + # 2**64 - 1, as recommended by the MySQL documentation + return 18446744073709551615 + + def quote_name(self, name): + if name.startswith("`") and name.endswith("`"): + return name # Quoting once is enough. + return "`{0}`".format(name) + + def random_function_sql(self): + return 'RAND()' + + def sql_flush(self, style, tables, sequences, allow_cascade=False): + if tables: + sql = ['SET FOREIGN_KEY_CHECKS = 0;'] + for table in tables: + sql.append('{keyword} {table};'.format( + keyword=style.SQL_KEYWORD('TRUNCATE'), + table=style.SQL_FIELD(self.quote_name(table)))) + sql.append('SET FOREIGN_KEY_CHECKS = 1;') + sql.extend(self.sequence_reset_by_name_sql(style, sequences)) + return sql + else: + return [] + + def validate_autopk_value(self, value): + # MySQLism: zero in AUTO_INCREMENT field does not work. Refs #17653. + if value == 0: + raise ValueError('The database backend does not accept 0 as a ' + 'value for AutoField.') + return value + + if django.VERSION > (1, 8): + def adapt_datetimefield_value(self, value): + return self.value_to_db_datetime(value) + + def value_to_db_datetime(self, value): + if value is None: + return None + # MySQL doesn't support tz-aware times + if timezone.is_aware(value): + if settings.USE_TZ: + value = value.astimezone(timezone.utc).replace(tzinfo=None) + else: + raise ValueError( + "MySQL backend does not support timezone-aware times." + ) + if not self.connection.features.supports_microsecond_precision: + value = value.replace(microsecond=0) + if not self.connection.use_pure: + return datetime_to_mysql(value) + return self.connection.converter.to_mysql(value) + + if django.VERSION > (1, 8): + def adapt_timefield_value(self, value): + return self.value_to_db_time(value) + + def value_to_db_time(self, value): + if value is None: + return None + + # MySQL doesn't support tz-aware times + if timezone.is_aware(value): + raise ValueError("MySQL backend does not support timezone-aware " + "times.") + + if not self.connection.use_pure: + return time_to_mysql(value) + return self.connection.converter.to_mysql(value) + + def max_name_length(self): + return 64 + + if django.VERSION < (1, 9): + def bulk_insert_sql(self, fields, num_values): + items_sql = "({0})".format(", ".join(["%s"] * len(fields))) + return "VALUES " + ", ".join([items_sql] * num_values) + else: + def bulk_insert_sql(self, fields, placeholder_rows): + placeholder_rows_sql = (", ".join(row) for row in placeholder_rows) + values_sql = ", ".join("({0})".format(sql) for sql in placeholder_rows_sql) + return "VALUES " + values_sql + + if django.VERSION < (1, 8): + def year_lookup_bounds(self, value): + # Again, no microseconds + first = '{0}-01-01 00:00:00' + second = '{0}-12-31 23:59:59.999999' + return [first.format(value), second.format(value)] + + def year_lookup_bounds_for_datetime_field(self, value): + # Django 1.6 + # Again, no microseconds + first, second = super(DatabaseOperations, + self).year_lookup_bounds_for_datetime_field(value) + if self.connection.mysql_version >= (5, 6, 4): + return [first.replace(microsecond=0), second] + else: + return [first.replace(microsecond=0), + second.replace(microsecond=0)] + + def sequence_reset_by_name_sql(self, style, sequences): + # Truncate already resets the AUTO_INCREMENT field from + # MySQL version 5.0.13 onwards. Refs #16961. + res = [] + if self.connection.mysql_version < (5, 0, 13): + fmt = "{alter} {table} {{tablename}} {auto_inc} {field};".format( + alter=style.SQL_KEYWORD('ALTER'), + table=style.SQL_KEYWORD('TABLE'), + auto_inc=style.SQL_KEYWORD('AUTO_INCREMENT'), + field=style.SQL_FIELD('= 1') + ) + for sequence in sequences: + tablename = style.SQL_TABLE(self.quote_name(sequence['table'])) + res.append(fmt.format(tablename=tablename)) + return res + return res + + def savepoint_create_sql(self, sid): + return "SAVEPOINT {0}".format(sid) + + def savepoint_commit_sql(self, sid): + return "RELEASE SAVEPOINT {0}".format(sid) + + def savepoint_rollback_sql(self, sid): + return "ROLLBACK TO SAVEPOINT {0}".format(sid) + + def combine_expression(self, connector, sub_expressions): + """ + MySQL requires special cases for ^ operators in query expressions + """ + if connector == '^': + return 'POW(%s)' % ','.join(sub_expressions) + return super(DatabaseOperations, self).combine_expression( + connector, sub_expressions) + + def get_db_converters(self, expression): + # New in Django 1.8 + converters = super(DatabaseOperations, self).get_db_converters( + expression) + internal_type = expression.output_field.get_internal_type() + if internal_type in ['BooleanField', 'NullBooleanField']: + converters.append(self.convert_booleanfield_value) + if internal_type == 'UUIDField': + converters.append(self.convert_uuidfield_value) + if internal_type == 'TextField': + converters.append(self.convert_textfield_value) + return converters + + def convert_booleanfield_value(self, value, + expression, connection, context): + # New in Django 1.8 + if value in (0, 1): + value = bool(value) + return value + + def convert_uuidfield_value(self, value, expression, connection, context): + # New in Django 1.8 + if value is not None: + value = uuid.UUID(value) + return value + + def convert_textfield_value(self, value, expression, connection, context): + # New in Django 1.8 + if value is not None: + value = force_text(value) + return value diff --git a/venv/Lib/site-packages/mysql/connector/django/schema.py b/venv/Lib/site-packages/mysql/connector/django/schema.py new file mode 100644 index 0000000..3dfde53 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/schema.py @@ -0,0 +1,86 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +# New file added for Django 1.7 + +import django +if django.VERSION >= (1, 8): + from django.db.backends.base.schema import BaseDatabaseSchemaEditor +else: + from django.db.backends.schema import BaseDatabaseSchemaEditor +from django.db.models import NOT_PROVIDED + + +class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): + + sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" + + sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" + sql_alter_column_not_null = "MODIFY %(column)s %(type)s NOT NULL" + sql_alter_column_type = "MODIFY %(column)s %(type)s" + sql_rename_column = "ALTER TABLE %(table)s CHANGE %(old_column)s " \ + "%(new_column)s %(type)s" + + sql_delete_unique = "ALTER TABLE %(table)s DROP INDEX %(name)s" + + sql_create_fk = "ALTER TABLE %(table)s ADD CONSTRAINT %(name)s FOREIGN " \ + "KEY (%(column)s) REFERENCES %(to_table)s (%(to_column)s)" + sql_delete_fk = "ALTER TABLE %(table)s DROP FOREIGN KEY %(name)s" + + sql_delete_index = "DROP INDEX %(name)s ON %(table)s" + + alter_string_set_null = 'MODIFY %(column)s %(type)s NULL;' + alter_string_drop_null = 'MODIFY %(column)s %(type)s NOT NULL;' + + sql_create_pk = "ALTER TABLE %(table)s ADD CONSTRAINT %(name)s " \ + "PRIMARY KEY (%(columns)s)" + sql_delete_pk = "ALTER TABLE %(table)s DROP PRIMARY KEY" + + def quote_value(self, value): + # Inner import to allow module to fail to load gracefully + from mysql.connector.conversion import MySQLConverter + return MySQLConverter.quote(MySQLConverter.escape(value)) + + def skip_default(self, field): + """ + MySQL doesn't accept default values for longtext and longblob + and implicitly treats these columns as nullable. + """ + return field.db_type(self.connection) in ('longtext', 'longblob') + + def add_field(self, model, field): + super(DatabaseSchemaEditor, self).add_field(model, field) + + # Simulate the effect of a one-off default. + if (self.skip_default(field) + and field.default not in (None, NOT_PROVIDED)): + effective_default = self.effective_default(field) + self.execute('UPDATE %(table)s SET %(column)s = %%s' % { + 'table': self.quote_name(model._meta.db_table), + 'column': self.quote_name(field.column), + }, [effective_default]) + + def _model_indexes_sql(self, model): + # New in Django 1.8 + storage = self.connection.introspection.get_storage_engine( + self.connection.cursor(), model._meta.db_table + ) + if storage == "InnoDB": + for field in model._meta.local_fields: + if (field.db_index and not field.unique + and field.get_internal_type() == "ForeignKey"): + # Temporary setting db_index to False (in memory) to + # disable index creation for FKs (index automatically + # created by MySQL) + field.db_index = False + return super(DatabaseSchemaEditor, self)._model_indexes_sql(model) + + def _alter_column_type_sql(self, table, old_field, new_field, new_type): + # New in Django 1.8 + # Keep null property of old field, if it has changed, it will be + # handled separately + if old_field.null: + new_type += " NULL" + else: + new_type += " NOT NULL" + return super(DatabaseSchemaEditor, self)._alter_column_type_sql( + table, old_field, new_field, new_type) diff --git a/venv/Lib/site-packages/mysql/connector/django/validation.py b/venv/Lib/site-packages/mysql/connector/django/validation.py new file mode 100644 index 0000000..75c29ef --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/django/validation.py @@ -0,0 +1,65 @@ +# MySQL Connector/Python - MySQL driver written in Python. + +import django + +if django.VERSION >= (1, 8): + from django.db.backends.base.validation import BaseDatabaseValidation +else: + from django.db.backends import BaseDatabaseValidation + +if django.VERSION < (1, 7): + from django.db import models +else: + from django.core import checks + from django.db import connection + + +class DatabaseValidation(BaseDatabaseValidation): + if django.VERSION < (1, 7): + def validate_field(self, errors, opts, f): + """ + MySQL has the following field length restriction: + No character (varchar) fields can have a length exceeding 255 + characters if they have a unique index on them. + """ + varchar_fields = (models.CharField, + models.CommaSeparatedIntegerField, + models.SlugField) + if isinstance(f, varchar_fields) and f.max_length > 255 and f.unique: + msg = ('"%(name)s": %(cls)s cannot have a "max_length" greater ' + 'than 255 when using "unique=True".') + errors.add(opts, msg % {'name': f.name, + 'cls': f.__class__.__name__}) + + else: + def check_field(self, field, **kwargs): + """ + MySQL has the following field length restriction: + No character (varchar) fields can have a length exceeding 255 + characters if they have a unique index on them. + """ + # Django 1.7 + errors = super(DatabaseValidation, self).check_field(field, + **kwargs) + + # Ignore any related fields. + if getattr(field, 'rel', None) is None: + field_type = field.db_type(connection) + + if field_type is None: + return errors + + if (field_type.startswith('varchar') # Look for CharFields... + and field.unique # ... that are unique + and (field.max_length is None or + int(field.max_length) > 255)): + errors.append( + checks.Error( + ('MySQL does not allow unique CharFields to have a ' + 'max_length > 255.'), + hint=None, + obj=field, + id='mysql.E001', + ) + ) + return errors diff --git a/venv/Lib/site-packages/mysql/connector/errorcode.py b/venv/Lib/site-packages/mysql/connector/errorcode.py new file mode 100644 index 0000000..ecc1470 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/errorcode.py @@ -0,0 +1,4611 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2018-03-16' +_MYSQL_VERSION = (8, 0, 11) + +"""This module contains the MySQL Server and Client error codes""" + +# Start MySQL Errors +OBSOLETE_ER_HASHCHK = 1000 +OBSOLETE_ER_NISAMCHK = 1001 +ER_NO = 1002 +ER_YES = 1003 +ER_CANT_CREATE_FILE = 1004 +ER_CANT_CREATE_TABLE = 1005 +ER_CANT_CREATE_DB = 1006 +ER_DB_CREATE_EXISTS = 1007 +ER_DB_DROP_EXISTS = 1008 +OBSOLETE_ER_DB_DROP_DELETE = 1009 +ER_DB_DROP_RMDIR = 1010 +OBSOLETE_ER_CANT_DELETE_FILE = 1011 +ER_CANT_FIND_SYSTEM_REC = 1012 +ER_CANT_GET_STAT = 1013 +OBSOLETE_ER_CANT_GET_WD = 1014 +ER_CANT_LOCK = 1015 +ER_CANT_OPEN_FILE = 1016 +ER_FILE_NOT_FOUND = 1017 +ER_CANT_READ_DIR = 1018 +OBSOLETE_ER_CANT_SET_WD = 1019 +ER_CHECKREAD = 1020 +OBSOLETE_ER_DISK_FULL = 1021 +ER_DUP_KEY = 1022 +OBSOLETE_ER_ERROR_ON_CLOSE = 1023 +ER_ERROR_ON_READ = 1024 +ER_ERROR_ON_RENAME = 1025 +ER_ERROR_ON_WRITE = 1026 +ER_FILE_USED = 1027 +ER_FILSORT_ABORT = 1028 +OBSOLETE_ER_FORM_NOT_FOUND = 1029 +ER_GET_ERRNO = 1030 +ER_ILLEGAL_HA = 1031 +ER_KEY_NOT_FOUND = 1032 +ER_NOT_FORM_FILE = 1033 +ER_NOT_KEYFILE = 1034 +ER_OLD_KEYFILE = 1035 +ER_OPEN_AS_READONLY = 1036 +ER_OUTOFMEMORY = 1037 +ER_OUT_OF_SORTMEMORY = 1038 +OBSOLETE_ER_UNEXPECTED_EOF = 1039 +ER_CON_COUNT_ERROR = 1040 +ER_OUT_OF_RESOURCES = 1041 +ER_BAD_HOST_ERROR = 1042 +ER_HANDSHAKE_ERROR = 1043 +ER_DBACCESS_DENIED_ERROR = 1044 +ER_ACCESS_DENIED_ERROR = 1045 +ER_NO_DB_ERROR = 1046 +ER_UNKNOWN_COM_ERROR = 1047 +ER_BAD_NULL_ERROR = 1048 +ER_BAD_DB_ERROR = 1049 +ER_TABLE_EXISTS_ERROR = 1050 +ER_BAD_TABLE_ERROR = 1051 +ER_NON_UNIQ_ERROR = 1052 +ER_SERVER_SHUTDOWN = 1053 +ER_BAD_FIELD_ERROR = 1054 +ER_WRONG_FIELD_WITH_GROUP = 1055 +ER_WRONG_GROUP_FIELD = 1056 +ER_WRONG_SUM_SELECT = 1057 +ER_WRONG_VALUE_COUNT = 1058 +ER_TOO_LONG_IDENT = 1059 +ER_DUP_FIELDNAME = 1060 +ER_DUP_KEYNAME = 1061 +ER_DUP_ENTRY = 1062 +ER_WRONG_FIELD_SPEC = 1063 +ER_PARSE_ERROR = 1064 +ER_EMPTY_QUERY = 1065 +ER_NONUNIQ_TABLE = 1066 +ER_INVALID_DEFAULT = 1067 +ER_MULTIPLE_PRI_KEY = 1068 +ER_TOO_MANY_KEYS = 1069 +ER_TOO_MANY_KEY_PARTS = 1070 +ER_TOO_LONG_KEY = 1071 +ER_KEY_COLUMN_DOES_NOT_EXITS = 1072 +ER_BLOB_USED_AS_KEY = 1073 +ER_TOO_BIG_FIELDLENGTH = 1074 +ER_WRONG_AUTO_KEY = 1075 +ER_READY = 1076 +OBSOLETE_ER_NORMAL_SHUTDOWN = 1077 +OBSOLETE_ER_GOT_SIGNAL = 1078 +ER_SHUTDOWN_COMPLETE = 1079 +ER_FORCING_CLOSE = 1080 +ER_IPSOCK_ERROR = 1081 +ER_NO_SUCH_INDEX = 1082 +ER_WRONG_FIELD_TERMINATORS = 1083 +ER_BLOBS_AND_NO_TERMINATED = 1084 +ER_TEXTFILE_NOT_READABLE = 1085 +ER_FILE_EXISTS_ERROR = 1086 +ER_LOAD_INFO = 1087 +ER_ALTER_INFO = 1088 +ER_WRONG_SUB_KEY = 1089 +ER_CANT_REMOVE_ALL_FIELDS = 1090 +ER_CANT_DROP_FIELD_OR_KEY = 1091 +ER_INSERT_INFO = 1092 +ER_UPDATE_TABLE_USED = 1093 +ER_NO_SUCH_THREAD = 1094 +ER_KILL_DENIED_ERROR = 1095 +ER_NO_TABLES_USED = 1096 +ER_TOO_BIG_SET = 1097 +ER_NO_UNIQUE_LOGFILE = 1098 +ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099 +ER_TABLE_NOT_LOCKED = 1100 +ER_BLOB_CANT_HAVE_DEFAULT = 1101 +ER_WRONG_DB_NAME = 1102 +ER_WRONG_TABLE_NAME = 1103 +ER_TOO_BIG_SELECT = 1104 +ER_UNKNOWN_ERROR = 1105 +ER_UNKNOWN_PROCEDURE = 1106 +ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107 +ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108 +ER_UNKNOWN_TABLE = 1109 +ER_FIELD_SPECIFIED_TWICE = 1110 +ER_INVALID_GROUP_FUNC_USE = 1111 +ER_UNSUPPORTED_EXTENSION = 1112 +ER_TABLE_MUST_HAVE_COLUMNS = 1113 +ER_RECORD_FILE_FULL = 1114 +ER_UNKNOWN_CHARACTER_SET = 1115 +ER_TOO_MANY_TABLES = 1116 +ER_TOO_MANY_FIELDS = 1117 +ER_TOO_BIG_ROWSIZE = 1118 +ER_STACK_OVERRUN = 1119 +ER_WRONG_OUTER_JOIN_UNUSED = 1120 +ER_NULL_COLUMN_IN_INDEX = 1121 +ER_CANT_FIND_UDF = 1122 +ER_CANT_INITIALIZE_UDF = 1123 +ER_UDF_NO_PATHS = 1124 +ER_UDF_EXISTS = 1125 +ER_CANT_OPEN_LIBRARY = 1126 +ER_CANT_FIND_DL_ENTRY = 1127 +ER_FUNCTION_NOT_DEFINED = 1128 +ER_HOST_IS_BLOCKED = 1129 +ER_HOST_NOT_PRIVILEGED = 1130 +ER_PASSWORD_ANONYMOUS_USER = 1131 +ER_PASSWORD_NOT_ALLOWED = 1132 +ER_PASSWORD_NO_MATCH = 1133 +ER_UPDATE_INFO = 1134 +ER_CANT_CREATE_THREAD = 1135 +ER_WRONG_VALUE_COUNT_ON_ROW = 1136 +ER_CANT_REOPEN_TABLE = 1137 +ER_INVALID_USE_OF_NULL = 1138 +ER_REGEXP_ERROR = 1139 +ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140 +ER_NONEXISTING_GRANT = 1141 +ER_TABLEACCESS_DENIED_ERROR = 1142 +ER_COLUMNACCESS_DENIED_ERROR = 1143 +ER_ILLEGAL_GRANT_FOR_TABLE = 1144 +ER_GRANT_WRONG_HOST_OR_USER = 1145 +ER_NO_SUCH_TABLE = 1146 +ER_NONEXISTING_TABLE_GRANT = 1147 +ER_NOT_ALLOWED_COMMAND = 1148 +ER_SYNTAX_ERROR = 1149 +OBSOLETE_ER_UNUSED1 = 1150 +OBSOLETE_ER_UNUSED2 = 1151 +ER_ABORTING_CONNECTION = 1152 +ER_NET_PACKET_TOO_LARGE = 1153 +ER_NET_READ_ERROR_FROM_PIPE = 1154 +ER_NET_FCNTL_ERROR = 1155 +ER_NET_PACKETS_OUT_OF_ORDER = 1156 +ER_NET_UNCOMPRESS_ERROR = 1157 +ER_NET_READ_ERROR = 1158 +ER_NET_READ_INTERRUPTED = 1159 +ER_NET_ERROR_ON_WRITE = 1160 +ER_NET_WRITE_INTERRUPTED = 1161 +ER_TOO_LONG_STRING = 1162 +ER_TABLE_CANT_HANDLE_BLOB = 1163 +ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164 +OBSOLETE_ER_UNUSED3 = 1165 +ER_WRONG_COLUMN_NAME = 1166 +ER_WRONG_KEY_COLUMN = 1167 +ER_WRONG_MRG_TABLE = 1168 +ER_DUP_UNIQUE = 1169 +ER_BLOB_KEY_WITHOUT_LENGTH = 1170 +ER_PRIMARY_CANT_HAVE_NULL = 1171 +ER_TOO_MANY_ROWS = 1172 +ER_REQUIRES_PRIMARY_KEY = 1173 +OBSOLETE_ER_NO_RAID_COMPILED = 1174 +ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175 +ER_KEY_DOES_NOT_EXITS = 1176 +ER_CHECK_NO_SUCH_TABLE = 1177 +ER_CHECK_NOT_IMPLEMENTED = 1178 +ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179 +ER_ERROR_DURING_COMMIT = 1180 +ER_ERROR_DURING_ROLLBACK = 1181 +ER_ERROR_DURING_FLUSH_LOGS = 1182 +OBSOLETE_ER_ERROR_DURING_CHECKPOINT = 1183 +ER_NEW_ABORTING_CONNECTION = 1184 +OBSOLETE_ER_DUMP_NOT_IMPLEMENTED = 1185 +OBSOLETE_ER_FLUSH_MASTER_BINLOG_CLOSED = 1186 +OBSOLETE_ER_INDEX_REBUILD = 1187 +ER_MASTER = 1188 +ER_MASTER_NET_READ = 1189 +ER_MASTER_NET_WRITE = 1190 +ER_FT_MATCHING_KEY_NOT_FOUND = 1191 +ER_LOCK_OR_ACTIVE_TRANSACTION = 1192 +ER_UNKNOWN_SYSTEM_VARIABLE = 1193 +ER_CRASHED_ON_USAGE = 1194 +ER_CRASHED_ON_REPAIR = 1195 +ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196 +ER_TRANS_CACHE_FULL = 1197 +OBSOLETE_ER_SLAVE_MUST_STOP = 1198 +ER_SLAVE_NOT_RUNNING = 1199 +ER_BAD_SLAVE = 1200 +ER_MASTER_INFO = 1201 +ER_SLAVE_THREAD = 1202 +ER_TOO_MANY_USER_CONNECTIONS = 1203 +ER_SET_CONSTANTS_ONLY = 1204 +ER_LOCK_WAIT_TIMEOUT = 1205 +ER_LOCK_TABLE_FULL = 1206 +ER_READ_ONLY_TRANSACTION = 1207 +OBSOLETE_ER_DROP_DB_WITH_READ_LOCK = 1208 +OBSOLETE_ER_CREATE_DB_WITH_READ_LOCK = 1209 +ER_WRONG_ARGUMENTS = 1210 +ER_NO_PERMISSION_TO_CREATE_USER = 1211 +OBSOLETE_ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212 +ER_LOCK_DEADLOCK = 1213 +ER_TABLE_CANT_HANDLE_FT = 1214 +ER_CANNOT_ADD_FOREIGN = 1215 +ER_NO_REFERENCED_ROW = 1216 +ER_ROW_IS_REFERENCED = 1217 +ER_CONNECT_TO_MASTER = 1218 +OBSOLETE_ER_QUERY_ON_MASTER = 1219 +ER_ERROR_WHEN_EXECUTING_COMMAND = 1220 +ER_WRONG_USAGE = 1221 +ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222 +ER_CANT_UPDATE_WITH_READLOCK = 1223 +ER_MIXING_NOT_ALLOWED = 1224 +ER_DUP_ARGUMENT = 1225 +ER_USER_LIMIT_REACHED = 1226 +ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227 +ER_LOCAL_VARIABLE = 1228 +ER_GLOBAL_VARIABLE = 1229 +ER_NO_DEFAULT = 1230 +ER_WRONG_VALUE_FOR_VAR = 1231 +ER_WRONG_TYPE_FOR_VAR = 1232 +ER_VAR_CANT_BE_READ = 1233 +ER_CANT_USE_OPTION_HERE = 1234 +ER_NOT_SUPPORTED_YET = 1235 +ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236 +ER_SLAVE_IGNORED_TABLE = 1237 +ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238 +ER_WRONG_FK_DEF = 1239 +ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240 +ER_OPERAND_COLUMNS = 1241 +ER_SUBQUERY_NO_1_ROW = 1242 +ER_UNKNOWN_STMT_HANDLER = 1243 +ER_CORRUPT_HELP_DB = 1244 +OBSOLETE_ER_CYCLIC_REFERENCE = 1245 +ER_AUTO_CONVERT = 1246 +ER_ILLEGAL_REFERENCE = 1247 +ER_DERIVED_MUST_HAVE_ALIAS = 1248 +ER_SELECT_REDUCED = 1249 +ER_TABLENAME_NOT_ALLOWED_HERE = 1250 +ER_NOT_SUPPORTED_AUTH_MODE = 1251 +ER_SPATIAL_CANT_HAVE_NULL = 1252 +ER_COLLATION_CHARSET_MISMATCH = 1253 +OBSOLETE_ER_SLAVE_WAS_RUNNING = 1254 +OBSOLETE_ER_SLAVE_WAS_NOT_RUNNING = 1255 +ER_TOO_BIG_FOR_UNCOMPRESS = 1256 +ER_ZLIB_Z_MEM_ERROR = 1257 +ER_ZLIB_Z_BUF_ERROR = 1258 +ER_ZLIB_Z_DATA_ERROR = 1259 +ER_CUT_VALUE_GROUP_CONCAT = 1260 +ER_WARN_TOO_FEW_RECORDS = 1261 +ER_WARN_TOO_MANY_RECORDS = 1262 +ER_WARN_NULL_TO_NOTNULL = 1263 +ER_WARN_DATA_OUT_OF_RANGE = 1264 +WARN_DATA_TRUNCATED = 1265 +ER_WARN_USING_OTHER_HANDLER = 1266 +ER_CANT_AGGREGATE_2COLLATIONS = 1267 +OBSOLETE_ER_DROP_USER = 1268 +ER_REVOKE_GRANTS = 1269 +ER_CANT_AGGREGATE_3COLLATIONS = 1270 +ER_CANT_AGGREGATE_NCOLLATIONS = 1271 +ER_VARIABLE_IS_NOT_STRUCT = 1272 +ER_UNKNOWN_COLLATION = 1273 +ER_SLAVE_IGNORED_SSL_PARAMS = 1274 +ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275 +ER_WARN_FIELD_RESOLVED = 1276 +ER_BAD_SLAVE_UNTIL_COND = 1277 +ER_MISSING_SKIP_SLAVE = 1278 +ER_UNTIL_COND_IGNORED = 1279 +ER_WRONG_NAME_FOR_INDEX = 1280 +ER_WRONG_NAME_FOR_CATALOG = 1281 +OBSOLETE_ER_WARN_QC_RESIZE = 1282 +ER_BAD_FT_COLUMN = 1283 +ER_UNKNOWN_KEY_CACHE = 1284 +ER_WARN_HOSTNAME_WONT_WORK = 1285 +ER_UNKNOWN_STORAGE_ENGINE = 1286 +ER_WARN_DEPRECATED_SYNTAX = 1287 +ER_NON_UPDATABLE_TABLE = 1288 +ER_FEATURE_DISABLED = 1289 +ER_OPTION_PREVENTS_STATEMENT = 1290 +ER_DUPLICATED_VALUE_IN_TYPE = 1291 +ER_TRUNCATED_WRONG_VALUE = 1292 +OBSOLETE_ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293 +ER_INVALID_ON_UPDATE = 1294 +ER_UNSUPPORTED_PS = 1295 +ER_GET_ERRMSG = 1296 +ER_GET_TEMPORARY_ERRMSG = 1297 +ER_UNKNOWN_TIME_ZONE = 1298 +ER_WARN_INVALID_TIMESTAMP = 1299 +ER_INVALID_CHARACTER_STRING = 1300 +ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301 +ER_CONFLICTING_DECLARATIONS = 1302 +ER_SP_NO_RECURSIVE_CREATE = 1303 +ER_SP_ALREADY_EXISTS = 1304 +ER_SP_DOES_NOT_EXIST = 1305 +ER_SP_DROP_FAILED = 1306 +ER_SP_STORE_FAILED = 1307 +ER_SP_LILABEL_MISMATCH = 1308 +ER_SP_LABEL_REDEFINE = 1309 +ER_SP_LABEL_MISMATCH = 1310 +ER_SP_UNINIT_VAR = 1311 +ER_SP_BADSELECT = 1312 +ER_SP_BADRETURN = 1313 +ER_SP_BADSTATEMENT = 1314 +ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315 +ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316 +ER_QUERY_INTERRUPTED = 1317 +ER_SP_WRONG_NO_OF_ARGS = 1318 +ER_SP_COND_MISMATCH = 1319 +ER_SP_NORETURN = 1320 +ER_SP_NORETURNEND = 1321 +ER_SP_BAD_CURSOR_QUERY = 1322 +ER_SP_BAD_CURSOR_SELECT = 1323 +ER_SP_CURSOR_MISMATCH = 1324 +ER_SP_CURSOR_ALREADY_OPEN = 1325 +ER_SP_CURSOR_NOT_OPEN = 1326 +ER_SP_UNDECLARED_VAR = 1327 +ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328 +ER_SP_FETCH_NO_DATA = 1329 +ER_SP_DUP_PARAM = 1330 +ER_SP_DUP_VAR = 1331 +ER_SP_DUP_COND = 1332 +ER_SP_DUP_CURS = 1333 +ER_SP_CANT_ALTER = 1334 +ER_SP_SUBSELECT_NYI = 1335 +ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336 +ER_SP_VARCOND_AFTER_CURSHNDLR = 1337 +ER_SP_CURSOR_AFTER_HANDLER = 1338 +ER_SP_CASE_NOT_FOUND = 1339 +ER_FPARSER_TOO_BIG_FILE = 1340 +ER_FPARSER_BAD_HEADER = 1341 +ER_FPARSER_EOF_IN_COMMENT = 1342 +ER_FPARSER_ERROR_IN_PARAMETER = 1343 +ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344 +ER_VIEW_NO_EXPLAIN = 1345 +OBSOLETE_ER_FRM_UNKNOWN_TYPE = 1346 +ER_WRONG_OBJECT = 1347 +ER_NONUPDATEABLE_COLUMN = 1348 +OBSOLETE_ER_VIEW_SELECT_DERIVED_UNUSED = 1349 +ER_VIEW_SELECT_CLAUSE = 1350 +ER_VIEW_SELECT_VARIABLE = 1351 +ER_VIEW_SELECT_TMPTABLE = 1352 +ER_VIEW_WRONG_LIST = 1353 +ER_WARN_VIEW_MERGE = 1354 +ER_WARN_VIEW_WITHOUT_KEY = 1355 +ER_VIEW_INVALID = 1356 +ER_SP_NO_DROP_SP = 1357 +OBSOLETE_ER_SP_GOTO_IN_HNDLR = 1358 +ER_TRG_ALREADY_EXISTS = 1359 +ER_TRG_DOES_NOT_EXIST = 1360 +ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361 +ER_TRG_CANT_CHANGE_ROW = 1362 +ER_TRG_NO_SUCH_ROW_IN_TRG = 1363 +ER_NO_DEFAULT_FOR_FIELD = 1364 +ER_DIVISION_BY_ZERO = 1365 +ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366 +ER_ILLEGAL_VALUE_FOR_TYPE = 1367 +ER_VIEW_NONUPD_CHECK = 1368 +ER_VIEW_CHECK_FAILED = 1369 +ER_PROCACCESS_DENIED_ERROR = 1370 +ER_RELAY_LOG_FAIL = 1371 +OBSOLETE_ER_PASSWD_LENGTH = 1372 +ER_UNKNOWN_TARGET_BINLOG = 1373 +ER_IO_ERR_LOG_INDEX_READ = 1374 +ER_BINLOG_PURGE_PROHIBITED = 1375 +ER_FSEEK_FAIL = 1376 +ER_BINLOG_PURGE_FATAL_ERR = 1377 +ER_LOG_IN_USE = 1378 +ER_LOG_PURGE_UNKNOWN_ERR = 1379 +ER_RELAY_LOG_INIT = 1380 +ER_NO_BINARY_LOGGING = 1381 +ER_RESERVED_SYNTAX = 1382 +OBSOLETE_ER_WSAS_FAILED = 1383 +OBSOLETE_ER_DIFF_GROUPS_PROC = 1384 +OBSOLETE_ER_NO_GROUP_FOR_PROC = 1385 +OBSOLETE_ER_ORDER_WITH_PROC = 1386 +OBSOLETE_ER_LOGGING_PROHIBIT_CHANGING_OF = 1387 +OBSOLETE_ER_NO_FILE_MAPPING = 1388 +OBSOLETE_ER_WRONG_MAGIC = 1389 +ER_PS_MANY_PARAM = 1390 +ER_KEY_PART_0 = 1391 +ER_VIEW_CHECKSUM = 1392 +ER_VIEW_MULTIUPDATE = 1393 +ER_VIEW_NO_INSERT_FIELD_LIST = 1394 +ER_VIEW_DELETE_MERGE_VIEW = 1395 +ER_CANNOT_USER = 1396 +ER_XAER_NOTA = 1397 +ER_XAER_INVAL = 1398 +ER_XAER_RMFAIL = 1399 +ER_XAER_OUTSIDE = 1400 +ER_XAER_RMERR = 1401 +ER_XA_RBROLLBACK = 1402 +ER_NONEXISTING_PROC_GRANT = 1403 +ER_PROC_AUTO_GRANT_FAIL = 1404 +ER_PROC_AUTO_REVOKE_FAIL = 1405 +ER_DATA_TOO_LONG = 1406 +ER_SP_BAD_SQLSTATE = 1407 +ER_STARTUP = 1408 +ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409 +ER_CANT_CREATE_USER_WITH_GRANT = 1410 +ER_WRONG_VALUE_FOR_TYPE = 1411 +ER_TABLE_DEF_CHANGED = 1412 +ER_SP_DUP_HANDLER = 1413 +ER_SP_NOT_VAR_ARG = 1414 +ER_SP_NO_RETSET = 1415 +ER_CANT_CREATE_GEOMETRY_OBJECT = 1416 +OBSOLETE_ER_FAILED_ROUTINE_BREAK_BINLOG = 1417 +ER_BINLOG_UNSAFE_ROUTINE = 1418 +ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419 +OBSOLETE_ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420 +ER_STMT_HAS_NO_OPEN_CURSOR = 1421 +ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422 +ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423 +ER_SP_NO_RECURSION = 1424 +ER_TOO_BIG_SCALE = 1425 +ER_TOO_BIG_PRECISION = 1426 +ER_M_BIGGER_THAN_D = 1427 +ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428 +ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429 +ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430 +ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431 +ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432 +ER_FOREIGN_DATA_STRING_INVALID = 1433 +OBSOLETE_ER_CANT_CREATE_FEDERATED_TABLE = 1434 +ER_TRG_IN_WRONG_SCHEMA = 1435 +ER_STACK_OVERRUN_NEED_MORE = 1436 +ER_TOO_LONG_BODY = 1437 +ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438 +ER_TOO_BIG_DISPLAYWIDTH = 1439 +ER_XAER_DUPID = 1440 +ER_DATETIME_FUNCTION_OVERFLOW = 1441 +ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442 +ER_VIEW_PREVENT_UPDATE = 1443 +ER_PS_NO_RECURSION = 1444 +ER_SP_CANT_SET_AUTOCOMMIT = 1445 +OBSOLETE_ER_MALFORMED_DEFINER = 1446 +ER_VIEW_FRM_NO_USER = 1447 +ER_VIEW_OTHER_USER = 1448 +ER_NO_SUCH_USER = 1449 +ER_FORBID_SCHEMA_CHANGE = 1450 +ER_ROW_IS_REFERENCED_2 = 1451 +ER_NO_REFERENCED_ROW_2 = 1452 +ER_SP_BAD_VAR_SHADOW = 1453 +ER_TRG_NO_DEFINER = 1454 +ER_OLD_FILE_FORMAT = 1455 +ER_SP_RECURSION_LIMIT = 1456 +OBSOLETE_ER_SP_PROC_TABLE_CORRUPT = 1457 +ER_SP_WRONG_NAME = 1458 +ER_TABLE_NEEDS_UPGRADE = 1459 +ER_SP_NO_AGGREGATE = 1460 +ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461 +ER_VIEW_RECURSIVE = 1462 +ER_NON_GROUPING_FIELD_USED = 1463 +ER_TABLE_CANT_HANDLE_SPKEYS = 1464 +ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465 +ER_REMOVED_SPACES = 1466 +ER_AUTOINC_READ_FAILED = 1467 +ER_USERNAME = 1468 +ER_HOSTNAME = 1469 +ER_WRONG_STRING_LENGTH = 1470 +ER_NON_INSERTABLE_TABLE = 1471 +ER_ADMIN_WRONG_MRG_TABLE = 1472 +ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473 +ER_NAME_BECOMES_EMPTY = 1474 +ER_AMBIGUOUS_FIELD_TERM = 1475 +ER_FOREIGN_SERVER_EXISTS = 1476 +ER_FOREIGN_SERVER_DOESNT_EXIST = 1477 +ER_ILLEGAL_HA_CREATE_OPTION = 1478 +ER_PARTITION_REQUIRES_VALUES_ERROR = 1479 +ER_PARTITION_WRONG_VALUES_ERROR = 1480 +ER_PARTITION_MAXVALUE_ERROR = 1481 +OBSOLETE_ER_PARTITION_SUBPARTITION_ERROR = 1482 +OBSOLETE_ER_PARTITION_SUBPART_MIX_ERROR = 1483 +ER_PARTITION_WRONG_NO_PART_ERROR = 1484 +ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485 +ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486 +OBSOLETE_ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487 +ER_FIELD_NOT_FOUND_PART_ERROR = 1488 +OBSOLETE_ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489 +ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490 +ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491 +ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492 +ER_RANGE_NOT_INCREASING_ERROR = 1493 +ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494 +ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495 +ER_PARTITION_ENTRY_ERROR = 1496 +ER_MIX_HANDLER_ERROR = 1497 +ER_PARTITION_NOT_DEFINED_ERROR = 1498 +ER_TOO_MANY_PARTITIONS_ERROR = 1499 +ER_SUBPARTITION_ERROR = 1500 +ER_CANT_CREATE_HANDLER_FILE = 1501 +ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502 +ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503 +ER_NO_PARTS_ERROR = 1504 +ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505 +ER_FOREIGN_KEY_ON_PARTITIONED = 1506 +ER_DROP_PARTITION_NON_EXISTENT = 1507 +ER_DROP_LAST_PARTITION = 1508 +ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509 +ER_REORG_HASH_ONLY_ON_SAME_NO = 1510 +ER_REORG_NO_PARAM_ERROR = 1511 +ER_ONLY_ON_RANGE_LIST_PARTITION = 1512 +ER_ADD_PARTITION_SUBPART_ERROR = 1513 +ER_ADD_PARTITION_NO_NEW_PARTITION = 1514 +ER_COALESCE_PARTITION_NO_PARTITION = 1515 +ER_REORG_PARTITION_NOT_EXIST = 1516 +ER_SAME_NAME_PARTITION = 1517 +ER_NO_BINLOG_ERROR = 1518 +ER_CONSECUTIVE_REORG_PARTITIONS = 1519 +ER_REORG_OUTSIDE_RANGE = 1520 +ER_PARTITION_FUNCTION_FAILURE = 1521 +OBSOLETE_ER_PART_STATE_ERROR = 1522 +ER_LIMITED_PART_RANGE = 1523 +ER_PLUGIN_IS_NOT_LOADED = 1524 +ER_WRONG_VALUE = 1525 +ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526 +ER_FILEGROUP_OPTION_ONLY_ONCE = 1527 +ER_CREATE_FILEGROUP_FAILED = 1528 +ER_DROP_FILEGROUP_FAILED = 1529 +ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530 +ER_WRONG_SIZE_NUMBER = 1531 +ER_SIZE_OVERFLOW_ERROR = 1532 +ER_ALTER_FILEGROUP_FAILED = 1533 +ER_BINLOG_ROW_LOGGING_FAILED = 1534 +OBSOLETE_ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535 +OBSOLETE_ER_BINLOG_ROW_RBR_TO_SBR = 1536 +ER_EVENT_ALREADY_EXISTS = 1537 +OBSOLETE_ER_EVENT_STORE_FAILED = 1538 +ER_EVENT_DOES_NOT_EXIST = 1539 +OBSOLETE_ER_EVENT_CANT_ALTER = 1540 +OBSOLETE_ER_EVENT_DROP_FAILED = 1541 +ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542 +ER_EVENT_ENDS_BEFORE_STARTS = 1543 +ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544 +OBSOLETE_ER_EVENT_OPEN_TABLE_FAILED = 1545 +OBSOLETE_ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546 +OBSOLETE_ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547 +OBSOLETE_ER_CANNOT_LOAD_FROM_TABLE = 1548 +OBSOLETE_ER_EVENT_CANNOT_DELETE = 1549 +OBSOLETE_ER_EVENT_COMPILE_ERROR = 1550 +ER_EVENT_SAME_NAME = 1551 +OBSOLETE_ER_EVENT_DATA_TOO_LONG = 1552 +ER_DROP_INDEX_FK = 1553 +ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554 +OBSOLETE_ER_CANT_WRITE_LOCK_LOG_TABLE = 1555 +ER_CANT_LOCK_LOG_TABLE = 1556 +ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED = 1557 +ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558 +ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559 +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560 +OBSOLETE_ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561 +ER_PARTITION_NO_TEMPORARY = 1562 +ER_PARTITION_CONST_DOMAIN_ERROR = 1563 +ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564 +OBSOLETE_ER_DDL_LOG_ERROR_UNUSED = 1565 +ER_NULL_IN_VALUES_LESS_THAN = 1566 +ER_WRONG_PARTITION_NAME = 1567 +ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568 +ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569 +OBSOLETE_ER_EVENT_MODIFY_QUEUE_ERROR = 1570 +ER_EVENT_SET_VAR_ERROR = 1571 +ER_PARTITION_MERGE_ERROR = 1572 +OBSOLETE_ER_CANT_ACTIVATE_LOG = 1573 +OBSOLETE_ER_RBR_NOT_AVAILABLE = 1574 +ER_BASE64_DECODE_ERROR = 1575 +ER_EVENT_RECURSION_FORBIDDEN = 1576 +OBSOLETE_ER_EVENTS_DB_ERROR = 1577 +ER_ONLY_INTEGERS_ALLOWED = 1578 +ER_UNSUPORTED_LOG_ENGINE = 1579 +ER_BAD_LOG_STATEMENT = 1580 +ER_CANT_RENAME_LOG_TABLE = 1581 +ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582 +ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583 +ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584 +ER_NATIVE_FCT_NAME_COLLISION = 1585 +ER_DUP_ENTRY_WITH_KEY_NAME = 1586 +ER_BINLOG_PURGE_EMFILE = 1587 +ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588 +ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589 +OBSOLETE_ER_SLAVE_INCIDENT = 1590 +ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591 +ER_BINLOG_UNSAFE_STATEMENT = 1592 +ER_BINLOG_FATAL_ERROR = 1593 +OBSOLETE_ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594 +OBSOLETE_ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595 +OBSOLETE_ER_SLAVE_CREATE_EVENT_FAILURE = 1596 +OBSOLETE_ER_SLAVE_MASTER_COM_FAILURE = 1597 +ER_BINLOG_LOGGING_IMPOSSIBLE = 1598 +ER_VIEW_NO_CREATION_CTX = 1599 +ER_VIEW_INVALID_CREATION_CTX = 1600 +OBSOLETE_ER_SR_INVALID_CREATION_CTX = 1601 +ER_TRG_CORRUPTED_FILE = 1602 +ER_TRG_NO_CREATION_CTX = 1603 +ER_TRG_INVALID_CREATION_CTX = 1604 +ER_EVENT_INVALID_CREATION_CTX = 1605 +ER_TRG_CANT_OPEN_TABLE = 1606 +OBSOLETE_ER_CANT_CREATE_SROUTINE = 1607 +OBSOLETE_ER_NEVER_USED = 1608 +ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609 +ER_SLAVE_CORRUPT_EVENT = 1610 +OBSOLETE_ER_LOAD_DATA_INVALID_COLUMN_UNUSED = 1611 +ER_LOG_PURGE_NO_FILE = 1612 +ER_XA_RBTIMEOUT = 1613 +ER_XA_RBDEADLOCK = 1614 +ER_NEED_REPREPARE = 1615 +OBSOLETE_ER_DELAYED_NOT_SUPPORTED = 1616 +WARN_NO_MASTER_INFO = 1617 +WARN_OPTION_IGNORED = 1618 +ER_PLUGIN_DELETE_BUILTIN = 1619 +WARN_PLUGIN_BUSY = 1620 +ER_VARIABLE_IS_READONLY = 1621 +ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622 +OBSOLETE_ER_SLAVE_HEARTBEAT_FAILURE = 1623 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624 +ER_NDB_REPLICATION_SCHEMA_ERROR = 1625 +ER_CONFLICT_FN_PARSE_ERROR = 1626 +ER_EXCEPTIONS_WRITE_ERROR = 1627 +ER_TOO_LONG_TABLE_COMMENT = 1628 +ER_TOO_LONG_FIELD_COMMENT = 1629 +ER_FUNC_INEXISTENT_NAME_COLLISION = 1630 +ER_DATABASE_NAME = 1631 +ER_TABLE_NAME = 1632 +ER_PARTITION_NAME = 1633 +ER_SUBPARTITION_NAME = 1634 +ER_TEMPORARY_NAME = 1635 +ER_RENAMED_NAME = 1636 +ER_TOO_MANY_CONCURRENT_TRXS = 1637 +WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638 +ER_DEBUG_SYNC_TIMEOUT = 1639 +ER_DEBUG_SYNC_HIT_LIMIT = 1640 +ER_DUP_SIGNAL_SET = 1641 +ER_SIGNAL_WARN = 1642 +ER_SIGNAL_NOT_FOUND = 1643 +ER_SIGNAL_EXCEPTION = 1644 +ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645 +ER_SIGNAL_BAD_CONDITION_TYPE = 1646 +WARN_COND_ITEM_TRUNCATED = 1647 +ER_COND_ITEM_TOO_LONG = 1648 +ER_UNKNOWN_LOCALE = 1649 +ER_SLAVE_IGNORE_SERVER_IDS = 1650 +OBSOLETE_ER_QUERY_CACHE_DISABLED = 1651 +ER_SAME_NAME_PARTITION_FIELD = 1652 +ER_PARTITION_COLUMN_LIST_ERROR = 1653 +ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654 +ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655 +ER_MAXVALUE_IN_VALUES_IN = 1656 +ER_TOO_MANY_VALUES_ERROR = 1657 +ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658 +ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659 +ER_PARTITION_FIELDS_TOO_LONG = 1660 +ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661 +ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662 +ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663 +ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664 +ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665 +ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666 +ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667 +ER_BINLOG_UNSAFE_LIMIT = 1668 +OBSOLETE_ER_UNUSED4 = 1669 +ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670 +ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671 +ER_BINLOG_UNSAFE_UDF = 1672 +ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673 +ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674 +ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675 +ER_MESSAGE_AND_STATEMENT = 1676 +OBSOLETE_ER_SLAVE_CONVERSION_FAILED = 1677 +ER_SLAVE_CANT_CREATE_CONVERSION = 1678 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679 +ER_PATH_LENGTH = 1680 +ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681 +ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682 +ER_WRONG_PERFSCHEMA_USAGE = 1683 +ER_WARN_I_S_SKIPPED_TABLE = 1684 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685 +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686 +ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687 +ER_TOO_LONG_INDEX_COMMENT = 1688 +ER_LOCK_ABORTED = 1689 +ER_DATA_OUT_OF_RANGE = 1690 +ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691 +ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692 +ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694 +ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695 +ER_FAILED_READ_FROM_PAR_FILE = 1696 +ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697 +ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698 +ER_SET_PASSWORD_AUTH_PLUGIN = 1699 +OBSOLETE_ER_GRANT_PLUGIN_USER_EXISTS = 1700 +ER_TRUNCATE_ILLEGAL_FK = 1701 +ER_PLUGIN_IS_PERMANENT = 1702 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704 +ER_STMT_CACHE_FULL = 1705 +ER_MULTI_UPDATE_KEY_CONFLICT = 1706 +ER_TABLE_NEEDS_REBUILD = 1707 +WARN_OPTION_BELOW_LIMIT = 1708 +ER_INDEX_COLUMN_TOO_LONG = 1709 +ER_ERROR_IN_TRIGGER_BODY = 1710 +ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711 +ER_INDEX_CORRUPT = 1712 +ER_UNDO_RECORD_TOO_BIG = 1713 +ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714 +ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715 +ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716 +ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717 +ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718 +ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719 +ER_PLUGIN_NO_UNINSTALL = 1720 +ER_PLUGIN_NO_INSTALL = 1721 +ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722 +ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723 +ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724 +ER_TABLE_IN_FK_CHECK = 1725 +ER_UNSUPPORTED_ENGINE = 1726 +ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727 +ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728 +ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729 +ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730 +ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731 +ER_PARTITION_EXCHANGE_PART_TABLE = 1732 +ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733 +ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734 +ER_UNKNOWN_PARTITION = 1735 +ER_TABLES_DIFFERENT_METADATA = 1736 +ER_ROW_DOES_NOT_MATCH_PARTITION = 1737 +ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738 +ER_WARN_INDEX_NOT_APPLICABLE = 1739 +ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740 +OBSOLETE_ER_NO_SUCH_KEY_VALUE = 1741 +ER_RPL_INFO_DATA_TOO_LONG = 1742 +OBSOLETE_ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743 +OBSOLETE_ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744 +ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745 +ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746 +ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747 +ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748 +OBSOLETE_ER_NO_SUCH_PARTITION__UNUSED = 1749 +ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750 +ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751 +ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752 +ER_MTS_FEATURE_IS_NOT_SUPPORTED = 1753 +ER_MTS_UPDATED_DBS_GREATER_MAX = 1754 +ER_MTS_CANT_PARALLEL = 1755 +ER_MTS_INCONSISTENT_DATA = 1756 +ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757 +ER_DA_INVALID_CONDITION_NUMBER = 1758 +ER_INSECURE_PLAIN_TEXT = 1759 +ER_INSECURE_CHANGE_MASTER = 1760 +ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761 +ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762 +ER_SQLTHREAD_WITH_SECURE_SLAVE = 1763 +ER_TABLE_HAS_NO_FT = 1764 +ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765 +ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766 +OBSOLETE_ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767 +OBSOLETE_ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768 +ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769 +ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770 +OBSOLETE_ER_SKIPPING_LOGGED_TRANSACTION = 1771 +ER_MALFORMED_GTID_SET_SPECIFICATION = 1772 +ER_MALFORMED_GTID_SET_ENCODING = 1773 +ER_MALFORMED_GTID_SPECIFICATION = 1774 +ER_GNO_EXHAUSTED = 1775 +ER_BAD_SLAVE_AUTO_POSITION = 1776 +ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777 +ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778 +ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779 +OBSOLETE_ER_GTID_MODE_REQUIRES_BINLOG = 1780 +ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781 +ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782 +ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783 +OBSOLETE_ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF__UNUSED = 1784 +ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785 +ER_GTID_UNSAFE_CREATE_SELECT = 1786 +ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION = 1787 +ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788 +ER_MASTER_HAS_PURGED_REQUIRED_GTIDS = 1789 +ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790 +ER_UNKNOWN_EXPLAIN_FORMAT = 1791 +ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792 +ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793 +ER_SLAVE_CONFIGURATION = 1794 +ER_INNODB_FT_LIMIT = 1795 +ER_INNODB_NO_FT_TEMP_TABLE = 1796 +ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797 +ER_INNODB_FT_WRONG_DOCID_INDEX = 1798 +ER_INNODB_ONLINE_LOG_TOO_BIG = 1799 +ER_UNKNOWN_ALTER_ALGORITHM = 1800 +ER_UNKNOWN_ALTER_LOCK = 1801 +ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802 +ER_MTS_RECOVERY_FAILURE = 1803 +ER_MTS_RESET_WORKERS = 1804 +ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805 +ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806 +ER_DISCARD_FK_CHECKS_RUNNING = 1807 +ER_TABLE_SCHEMA_MISMATCH = 1808 +ER_TABLE_IN_SYSTEM_TABLESPACE = 1809 +ER_IO_READ_ERROR = 1810 +ER_IO_WRITE_ERROR = 1811 +ER_TABLESPACE_MISSING = 1812 +ER_TABLESPACE_EXISTS = 1813 +ER_TABLESPACE_DISCARDED = 1814 +ER_INTERNAL_ERROR = 1815 +ER_INNODB_IMPORT_ERROR = 1816 +ER_INNODB_INDEX_CORRUPT = 1817 +ER_INVALID_YEAR_COLUMN_LENGTH = 1818 +ER_NOT_VALID_PASSWORD = 1819 +ER_MUST_CHANGE_PASSWORD = 1820 +ER_FK_NO_INDEX_CHILD = 1821 +ER_FK_NO_INDEX_PARENT = 1822 +ER_FK_FAIL_ADD_SYSTEM = 1823 +ER_FK_CANNOT_OPEN_PARENT = 1824 +ER_FK_INCORRECT_OPTION = 1825 +ER_FK_DUP_NAME = 1826 +ER_PASSWORD_FORMAT = 1827 +ER_FK_COLUMN_CANNOT_DROP = 1828 +ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829 +ER_FK_COLUMN_NOT_NULL = 1830 +ER_DUP_INDEX = 1831 +ER_FK_COLUMN_CANNOT_CHANGE = 1832 +ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833 +OBSOLETE_ER_UNUSED5 = 1834 +ER_MALFORMED_PACKET = 1835 +ER_READ_ONLY_MODE = 1836 +ER_GTID_NEXT_TYPE_UNDEFINED_GTID = 1837 +ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838 +OBSOLETE_ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839 +ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840 +ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841 +ER_GTID_PURGED_WAS_CHANGED = 1842 +ER_GTID_EXECUTED_WAS_CHANGED = 1843 +ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844 +ER_ALTER_OPERATION_NOT_SUPPORTED = 1845 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851 +OBSOLETE_ER_UNUSED6 = 1852 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857 +ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858 +ER_DUP_UNKNOWN_IN_INDEX = 1859 +ER_IDENT_CAUSES_TOO_LONG_PATH = 1860 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861 +ER_MUST_CHANGE_PASSWORD_LOGIN = 1862 +ER_ROW_IN_WRONG_PARTITION = 1863 +ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864 +OBSOLETE_ER_INNODB_NO_FT_USES_PARSER = 1865 +ER_BINLOG_LOGICAL_CORRUPTION = 1866 +ER_WARN_PURGE_LOG_IN_USE = 1867 +ER_WARN_PURGE_LOG_IS_ACTIVE = 1868 +ER_AUTO_INCREMENT_CONFLICT = 1869 +WARN_ON_BLOCKHOLE_IN_RBR = 1870 +ER_SLAVE_MI_INIT_REPOSITORY = 1871 +ER_SLAVE_RLI_INIT_REPOSITORY = 1872 +ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873 +ER_INNODB_READ_ONLY = 1874 +ER_STOP_SLAVE_SQL_THREAD_TIMEOUT = 1875 +ER_STOP_SLAVE_IO_THREAD_TIMEOUT = 1876 +ER_TABLE_CORRUPT = 1877 +ER_TEMP_FILE_WRITE_FAILURE = 1878 +ER_INNODB_FT_AUX_NOT_HEX_ID = 1879 +ER_OLD_TEMPORALS_UPGRADED = 1880 +ER_INNODB_FORCED_RECOVERY = 1881 +ER_AES_INVALID_IV = 1882 +ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883 +ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID = 1884 +ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER = 1885 +ER_MISSING_KEY = 1886 +ER_FILE_CORRUPT = 3000 +ER_ERROR_ON_MASTER = 3001 +OBSOLETE_ER_INCONSISTENT_ERROR = 3002 +ER_STORAGE_ENGINE_NOT_LOADED = 3003 +ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004 +ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005 +ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006 +ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007 +ER_FK_DEPTH_EXCEEDED = 3008 +ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009 +ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010 +ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011 +ER_EXPLAIN_NOT_SUPPORTED = 3012 +ER_INVALID_FIELD_SIZE = 3013 +ER_MISSING_HA_CREATE_OPTION = 3014 +ER_ENGINE_OUT_OF_MEMORY = 3015 +ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016 +ER_SLAVE_SQL_THREAD_MUST_STOP = 3017 +ER_NO_FT_MATERIALIZED_SUBQUERY = 3018 +ER_INNODB_UNDO_LOG_FULL = 3019 +ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020 +ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP = 3021 +ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022 +ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS = 3023 +ER_QUERY_TIMEOUT = 3024 +ER_NON_RO_SELECT_DISABLE_TIMER = 3025 +ER_DUP_LIST_ENTRY = 3026 +OBSOLETE_ER_SQL_MODE_NO_EFFECT = 3027 +ER_AGGREGATE_ORDER_FOR_UNION = 3028 +ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029 +ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030 +ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER = 3031 +ER_SERVER_OFFLINE_MODE = 3032 +ER_GIS_DIFFERENT_SRIDS = 3033 +ER_GIS_UNSUPPORTED_ARGUMENT = 3034 +ER_GIS_UNKNOWN_ERROR = 3035 +ER_GIS_UNKNOWN_EXCEPTION = 3036 +ER_GIS_INVALID_DATA = 3037 +ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038 +ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039 +ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040 +ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041 +ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042 +ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043 +ER_STD_BAD_ALLOC_ERROR = 3044 +ER_STD_DOMAIN_ERROR = 3045 +ER_STD_LENGTH_ERROR = 3046 +ER_STD_INVALID_ARGUMENT = 3047 +ER_STD_OUT_OF_RANGE_ERROR = 3048 +ER_STD_OVERFLOW_ERROR = 3049 +ER_STD_RANGE_ERROR = 3050 +ER_STD_UNDERFLOW_ERROR = 3051 +ER_STD_LOGIC_ERROR = 3052 +ER_STD_RUNTIME_ERROR = 3053 +ER_STD_UNKNOWN_EXCEPTION = 3054 +ER_GIS_DATA_WRONG_ENDIANESS = 3055 +ER_CHANGE_MASTER_PASSWORD_LENGTH = 3056 +ER_USER_LOCK_WRONG_NAME = 3057 +ER_USER_LOCK_DEADLOCK = 3058 +ER_REPLACE_INACCESSIBLE_ROWS = 3059 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060 +ER_ILLEGAL_USER_VAR = 3061 +ER_GTID_MODE_OFF = 3062 +OBSOLETE_ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063 +ER_INCORRECT_TYPE = 3064 +ER_FIELD_IN_ORDER_NOT_SELECT = 3065 +ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066 +ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067 +ER_NET_OK_PACKET_TOO_LARGE = 3068 +ER_INVALID_JSON_DATA = 3069 +ER_INVALID_GEOJSON_MISSING_MEMBER = 3070 +ER_INVALID_GEOJSON_WRONG_TYPE = 3071 +ER_INVALID_GEOJSON_UNSPECIFIED = 3072 +ER_DIMENSION_UNSUPPORTED = 3073 +ER_SLAVE_CHANNEL_DOES_NOT_EXIST = 3074 +OBSOLETE_ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075 +ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076 +ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY = 3077 +OBSOLETE_ER_SLAVE_CHANNEL_DELETE = 3078 +ER_SLAVE_MULTIPLE_CHANNELS_CMD = 3079 +ER_SLAVE_MAX_CHANNELS_EXCEEDED = 3080 +ER_SLAVE_CHANNEL_MUST_STOP = 3081 +ER_SLAVE_CHANNEL_NOT_RUNNING = 3082 +ER_SLAVE_CHANNEL_WAS_RUNNING = 3083 +ER_SLAVE_CHANNEL_WAS_NOT_RUNNING = 3084 +ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP = 3085 +ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER = 3086 +ER_WRONG_FIELD_WITH_GROUP_V2 = 3087 +ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088 +ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089 +ER_WARN_DEPRECATED_SQLMODE = 3090 +ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091 +ER_GROUP_REPLICATION_CONFIGURATION = 3092 +ER_GROUP_REPLICATION_RUNNING = 3093 +ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094 +ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095 +ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096 +ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097 +ER_BEFORE_DML_VALIDATION_ERROR = 3098 +ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099 +ER_RUN_HOOK_ERROR = 3100 +ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101 +ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102 +ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103 +ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104 +ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105 +ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106 +ER_GENERATED_COLUMN_NON_PRIOR = 3107 +ER_DEPENDENT_BY_GENERATED_COLUMN = 3108 +ER_GENERATED_COLUMN_REF_AUTO_INC = 3109 +ER_FEATURE_NOT_AVAILABLE = 3110 +ER_CANT_SET_GTID_MODE = 3111 +ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112 +OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113 +OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114 +OBSOLETE_ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115 +ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX = 3116 +ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX = 3117 +ER_ACCOUNT_HAS_BEEN_LOCKED = 3118 +ER_WRONG_TABLESPACE_NAME = 3119 +ER_TABLESPACE_IS_NOT_EMPTY = 3120 +ER_WRONG_FILE_NAME = 3121 +ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122 +ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123 +ER_WARN_BAD_MAX_EXECUTION_TIME = 3124 +ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125 +ER_WARN_CONFLICTING_HINT = 3126 +ER_WARN_UNKNOWN_QB_NAME = 3127 +ER_UNRESOLVED_HINT_NAME = 3128 +ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129 +ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130 +ER_LOCKING_SERVICE_WRONG_NAME = 3131 +ER_LOCKING_SERVICE_DEADLOCK = 3132 +ER_LOCKING_SERVICE_TIMEOUT = 3133 +ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134 +ER_SQL_MODE_MERGED = 3135 +ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136 +ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137 +ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138 +ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED = 3139 +ER_INVALID_JSON_TEXT = 3140 +ER_INVALID_JSON_TEXT_IN_PARAM = 3141 +ER_INVALID_JSON_BINARY_DATA = 3142 +ER_INVALID_JSON_PATH = 3143 +ER_INVALID_JSON_CHARSET = 3144 +ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145 +ER_INVALID_TYPE_FOR_JSON = 3146 +ER_INVALID_CAST_TO_JSON = 3147 +ER_INVALID_JSON_PATH_CHARSET = 3148 +ER_INVALID_JSON_PATH_WILDCARD = 3149 +ER_JSON_VALUE_TOO_BIG = 3150 +ER_JSON_KEY_TOO_BIG = 3151 +ER_JSON_USED_AS_KEY = 3152 +ER_JSON_VACUOUS_PATH = 3153 +ER_JSON_BAD_ONE_OR_ALL_ARG = 3154 +ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155 +ER_INVALID_JSON_VALUE_FOR_CAST = 3156 +ER_JSON_DOCUMENT_TOO_DEEP = 3157 +ER_JSON_DOCUMENT_NULL_KEY = 3158 +ER_SECURE_TRANSPORT_REQUIRED = 3159 +ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160 +ER_DISABLED_STORAGE_ENGINE = 3161 +ER_USER_DOES_NOT_EXIST = 3162 +ER_USER_ALREADY_EXISTS = 3163 +ER_AUDIT_API_ABORT = 3164 +ER_INVALID_JSON_PATH_ARRAY_CELL = 3165 +ER_BUFPOOL_RESIZE_INPROGRESS = 3166 +ER_FEATURE_DISABLED_SEE_DOC = 3167 +ER_SERVER_ISNT_AVAILABLE = 3168 +ER_SESSION_WAS_KILLED = 3169 +ER_CAPACITY_EXCEEDED = 3170 +ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171 +OBSOLETE_ER_TABLE_NEEDS_UPG_PART = 3172 +ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173 +ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174 +ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175 +ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176 +ER_LOCK_REFUSED_BY_ENGINE = 3177 +ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178 +ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179 +OBSOLETE_ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180 +ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181 +ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182 +ER_TABLESPACE_CANNOT_ENCRYPT = 3183 +ER_INVALID_ENCRYPTION_OPTION = 3184 +ER_CANNOT_FIND_KEY_IN_KEYRING = 3185 +ER_CAPACITY_EXCEEDED_IN_PARSER = 3186 +ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187 +ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188 +ER_USER_COLUMN_OLD_LENGTH = 3189 +ER_CANT_RESET_MASTER = 3190 +ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191 +ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192 +ER_TABLE_REFERENCED = 3193 +OBSOLETE_ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194 +OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195 +OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196 +ER_XA_RETRY = 3197 +ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198 +ER_BINLOG_UNSAFE_XA = 3199 +ER_UDF_ERROR = 3200 +ER_KEYRING_MIGRATION_FAILURE = 3201 +ER_KEYRING_ACCESS_DENIED_ERROR = 3202 +ER_KEYRING_MIGRATION_STATUS = 3203 +OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204 +OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205 +OBSOLETE_ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206 +OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207 +OBSOLETE_ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208 +OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210 +OBSOLETE_ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211 +ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212 +OBSOLETE_ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213 +ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214 +ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215 +ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216 +ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217 +ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220 +OBSOLETE_ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222 +OBSOLETE_ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223 +OBSOLETE_ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224 +OBSOLETE_ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225 +ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE = 3500 +ER_ACL_OPERATION_FAILED = 3501 +ER_UNSUPPORTED_INDEX_ALGORITHM = 3502 +ER_NO_SUCH_DB = 3503 +ER_TOO_BIG_ENUM = 3504 +ER_TOO_LONG_SET_ENUM_VALUE = 3505 +ER_INVALID_DD_OBJECT = 3506 +ER_UPDATING_DD_TABLE = 3507 +ER_INVALID_DD_OBJECT_ID = 3508 +ER_INVALID_DD_OBJECT_NAME = 3509 +ER_TABLESPACE_MISSING_WITH_NAME = 3510 +ER_TOO_LONG_ROUTINE_COMMENT = 3511 +ER_SP_LOAD_FAILED = 3512 +ER_INVALID_BITWISE_OPERANDS_SIZE = 3513 +ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE = 3514 +ER_WARN_UNSUPPORTED_HINT = 3515 +ER_UNEXPECTED_GEOMETRY_TYPE = 3516 +ER_SRS_PARSE_ERROR = 3517 +ER_SRS_PROJ_PARAMETER_MISSING = 3518 +ER_WARN_SRS_NOT_FOUND = 3519 +ER_SRS_NOT_CARTESIAN = 3520 +ER_SRS_NOT_CARTESIAN_UNDEFINED = 3521 +ER_PK_INDEX_CANT_BE_INVISIBLE = 3522 +ER_UNKNOWN_AUTHID = 3523 +ER_FAILED_ROLE_GRANT = 3524 +ER_OPEN_ROLE_TABLES = 3525 +ER_FAILED_DEFAULT_ROLES = 3526 +ER_COMPONENTS_NO_SCHEME = 3527 +ER_COMPONENTS_NO_SCHEME_SERVICE = 3528 +ER_COMPONENTS_CANT_LOAD = 3529 +ER_ROLE_NOT_GRANTED = 3530 +ER_FAILED_REVOKE_ROLE = 3531 +ER_RENAME_ROLE = 3532 +ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION = 3533 +ER_COMPONENTS_CANT_SATISFY_DEPENDENCY = 3534 +ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION = 3535 +ER_COMPONENTS_LOAD_CANT_INITIALIZE = 3536 +ER_COMPONENTS_UNLOAD_NOT_LOADED = 3537 +ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE = 3538 +ER_COMPONENTS_CANT_RELEASE_SERVICE = 3539 +ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE = 3540 +ER_COMPONENTS_CANT_UNLOAD = 3541 +ER_WARN_UNLOAD_THE_NOT_PERSISTED = 3542 +ER_COMPONENT_TABLE_INCORRECT = 3543 +ER_COMPONENT_MANIPULATE_ROW_FAILED = 3544 +ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP = 3545 +ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS = 3546 +ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES = 3547 +ER_SRS_NOT_FOUND = 3548 +ER_VARIABLE_NOT_PERSISTED = 3549 +ER_IS_QUERY_INVALID_CLAUSE = 3550 +ER_UNABLE_TO_STORE_STATISTICS = 3551 +ER_NO_SYSTEM_SCHEMA_ACCESS = 3552 +ER_NO_SYSTEM_TABLESPACE_ACCESS = 3553 +ER_NO_SYSTEM_TABLE_ACCESS = 3554 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE = 3555 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE = 3556 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE = 3557 +ER_INVALID_OPTION_KEY = 3558 +ER_INVALID_OPTION_VALUE = 3559 +ER_INVALID_OPTION_KEY_VALUE_PAIR = 3560 +ER_INVALID_OPTION_START_CHARACTER = 3561 +ER_INVALID_OPTION_END_CHARACTER = 3562 +ER_INVALID_OPTION_CHARACTERS = 3563 +ER_DUPLICATE_OPTION_KEY = 3564 +ER_WARN_SRS_NOT_FOUND_AXIS_ORDER = 3565 +ER_NO_ACCESS_TO_NATIVE_FCT = 3566 +ER_RESET_MASTER_TO_VALUE_OUT_OF_RANGE = 3567 +ER_UNRESOLVED_TABLE_LOCK = 3568 +ER_DUPLICATE_TABLE_LOCK = 3569 +ER_BINLOG_UNSAFE_SKIP_LOCKED = 3570 +ER_BINLOG_UNSAFE_NOWAIT = 3571 +ER_LOCK_NOWAIT = 3572 +ER_CTE_RECURSIVE_REQUIRES_UNION = 3573 +ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST = 3574 +ER_CTE_RECURSIVE_FORBIDS_AGGREGATION = 3575 +ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER = 3576 +ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE = 3577 +ER_SWITCH_TMP_ENGINE = 3578 +ER_WINDOW_NO_SUCH_WINDOW = 3579 +ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH = 3580 +ER_WINDOW_NO_CHILD_PARTITIONING = 3581 +ER_WINDOW_NO_INHERIT_FRAME = 3582 +ER_WINDOW_NO_REDEFINE_ORDER_BY = 3583 +ER_WINDOW_FRAME_START_ILLEGAL = 3584 +ER_WINDOW_FRAME_END_ILLEGAL = 3585 +ER_WINDOW_FRAME_ILLEGAL = 3586 +ER_WINDOW_RANGE_FRAME_ORDER_TYPE = 3587 +ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE = 3588 +ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE = 3589 +ER_WINDOW_RANGE_BOUND_NOT_CONSTANT = 3590 +ER_WINDOW_DUPLICATE_NAME = 3591 +ER_WINDOW_ILLEGAL_ORDER_BY = 3592 +ER_WINDOW_INVALID_WINDOW_FUNC_USE = 3593 +ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE = 3594 +ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC = 3595 +ER_WINDOW_ROWS_INTERVAL_USE = 3596 +ER_WINDOW_NO_GROUP_ORDER = 3597 +ER_WINDOW_EXPLAIN_JSON = 3598 +ER_WINDOW_FUNCTION_IGNORES_FRAME = 3599 +ER_WL9236_NOW_UNUSED = 3600 +ER_INVALID_NO_OF_ARGS = 3601 +ER_FIELD_IN_GROUPING_NOT_GROUP_BY = 3602 +ER_TOO_LONG_TABLESPACE_COMMENT = 3603 +ER_ENGINE_CANT_DROP_TABLE = 3604 +ER_ENGINE_CANT_DROP_MISSING_TABLE = 3605 +ER_TABLESPACE_DUP_FILENAME = 3606 +ER_DB_DROP_RMDIR2 = 3607 +ER_IMP_NO_FILES_MATCHED = 3608 +ER_IMP_SCHEMA_DOES_NOT_EXIST = 3609 +ER_IMP_TABLE_ALREADY_EXISTS = 3610 +ER_IMP_INCOMPATIBLE_MYSQLD_VERSION = 3611 +ER_IMP_INCOMPATIBLE_DD_VERSION = 3612 +ER_IMP_INCOMPATIBLE_SDI_VERSION = 3613 +ER_WARN_INVALID_HINT = 3614 +ER_VAR_DOES_NOT_EXIST = 3615 +ER_LONGITUDE_OUT_OF_RANGE = 3616 +ER_LATITUDE_OUT_OF_RANGE = 3617 +ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS = 3618 +ER_ILLEGAL_PRIVILEGE_LEVEL = 3619 +ER_NO_SYSTEM_VIEW_ACCESS = 3620 +ER_COMPONENT_FILTER_FLABBERGASTED = 3621 +ER_PART_EXPR_TOO_LONG = 3622 +ER_UDF_DROP_DYNAMICALLY_REGISTERED = 3623 +ER_UNABLE_TO_STORE_COLUMN_STATISTICS = 3624 +ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS = 3625 +ER_UNABLE_TO_DROP_COLUMN_STATISTICS = 3626 +ER_UNABLE_TO_BUILD_HISTOGRAM = 3627 +ER_MANDATORY_ROLE = 3628 +ER_MISSING_TABLESPACE_FILE = 3629 +ER_PERSIST_ONLY_ACCESS_DENIED_ERROR = 3630 +ER_CMD_NEED_SUPER = 3631 +ER_PATH_IN_DATADIR = 3632 +ER_DDL_IN_PROGRESS = 3633 +ER_TOO_MANY_CONCURRENT_CLONES = 3634 +ER_APPLIER_LOG_EVENT_VALIDATION_ERROR = 3635 +ER_CTE_MAX_RECURSION_DEPTH = 3636 +ER_NOT_HINT_UPDATABLE_VARIABLE = 3637 +ER_CREDENTIALS_CONTRADICT_TO_HISTORY = 3638 +ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID = 3639 +ER_CLIENT_DOES_NOT_SUPPORT = 3640 +ER_I_S_SKIPPED_TABLESPACE = 3641 +ER_TABLESPACE_ENGINE_MISMATCH = 3642 +ER_WRONG_SRID_FOR_COLUMN = 3643 +ER_CANNOT_ALTER_SRID_DUE_TO_INDEX = 3644 +ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED = 3645 +ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED = 3646 +ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES = 3647 +ER_COULD_NOT_APPLY_JSON_DIFF = 3648 +ER_CORRUPTED_JSON_DIFF = 3649 +ER_RESOURCE_GROUP_EXISTS = 3650 +ER_RESOURCE_GROUP_NOT_EXISTS = 3651 +ER_INVALID_VCPU_ID = 3652 +ER_INVALID_VCPU_RANGE = 3653 +ER_INVALID_THREAD_PRIORITY = 3654 +ER_DISALLOWED_OPERATION = 3655 +ER_RESOURCE_GROUP_BUSY = 3656 +ER_RESOURCE_GROUP_DISABLED = 3657 +ER_FEATURE_UNSUPPORTED = 3658 +ER_ATTRIBUTE_IGNORED = 3659 +ER_INVALID_THREAD_ID = 3660 +ER_RESOURCE_GROUP_BIND_FAILED = 3661 +ER_INVALID_USE_OF_FORCE_OPTION = 3662 +ER_GROUP_REPLICATION_COMMAND_FAILURE = 3663 +ER_SDI_OPERATION_FAILED = 3664 +ER_MISSING_JSON_TABLE_VALUE = 3665 +ER_WRONG_JSON_TABLE_VALUE = 3666 +ER_TF_MUST_HAVE_ALIAS = 3667 +ER_TF_FORBIDDEN_JOIN_TYPE = 3668 +ER_JT_VALUE_OUT_OF_RANGE = 3669 +ER_JT_MAX_NESTED_PATH = 3670 +ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD = 3671 +ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL = 3672 +ER_BAD_NULL_ERROR_NOT_IGNORED = 3673 +WARN_USELESS_SPATIAL_INDEX = 3674 +ER_DISK_FULL_NOWAIT = 3675 +ER_PARSE_ERROR_IN_DIGEST_FN = 3676 +ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN = 3677 +ER_SCHEMA_DIR_EXISTS = 3678 +ER_SCHEMA_DIR_MISSING = 3679 +ER_SCHEMA_DIR_CREATE_FAILED = 3680 +ER_SCHEMA_DIR_UNKNOWN = 3681 +ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 = 3682 +ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER = 3683 +ER_REGEXP_BUFFER_OVERFLOW = 3684 +ER_REGEXP_ILLEGAL_ARGUMENT = 3685 +ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR = 3686 +ER_REGEXP_INTERNAL_ERROR = 3687 +ER_REGEXP_RULE_SYNTAX = 3688 +ER_REGEXP_BAD_ESCAPE_SEQUENCE = 3689 +ER_REGEXP_UNIMPLEMENTED = 3690 +ER_REGEXP_MISMATCHED_PAREN = 3691 +ER_REGEXP_BAD_INTERVAL = 3692 +ER_REGEXP_MAX_LT_MIN = 3693 +ER_REGEXP_INVALID_BACK_REF = 3694 +ER_REGEXP_LOOK_BEHIND_LIMIT = 3695 +ER_REGEXP_MISSING_CLOSE_BRACKET = 3696 +ER_REGEXP_INVALID_RANGE = 3697 +ER_REGEXP_STACK_OVERFLOW = 3698 +ER_REGEXP_TIME_OUT = 3699 +ER_REGEXP_PATTERN_TOO_BIG = 3700 +ER_CANT_SET_ERROR_LOG_SERVICE = 3701 +ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE = 3702 +ER_COMPONENT_FILTER_DIAGNOSTICS = 3703 +ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS = 3704 +ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS = 3705 +ER_NONPOSITIVE_RADIUS = 3706 +ER_RESTART_SERVER_FAILED = 3707 +ER_SRS_MISSING_MANDATORY_ATTRIBUTE = 3708 +ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS = 3709 +ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE = 3710 +ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE = 3711 +ER_SRS_ID_ALREADY_EXISTS = 3712 +ER_WARN_SRS_ID_ALREADY_EXISTS = 3713 +ER_CANT_MODIFY_SRID_0 = 3714 +ER_WARN_RESERVED_SRID_RANGE = 3715 +ER_CANT_MODIFY_SRS_USED_BY_COLUMN = 3716 +ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE = 3717 +ER_SRS_ATTRIBUTE_STRING_TOO_LONG = 3718 +ER_DEPRECATED_UTF8_ALIAS = 3719 +ER_DEPRECATED_NATIONAL = 3720 +ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 3721 +ER_UNABLE_TO_COLLECT_INSTANCE_LOG_STATUS = 3722 +ER_RESERVED_TABLESPACE_NAME = 3723 +ER_UNABLE_TO_SET_OPTION = 3724 +ER_SLAVE_POSSIBLY_DIVERGED_AFTER_DDL = 3725 +ER_PARSER_TRACE = 10000 +ER_BOOTSTRAP_CANT_THREAD = 10001 +ER_TRIGGER_INVALID_VALUE = 10002 +ER_OPT_WRONG_TREE = 10003 +ER_DD_FAILSAFE = 10004 +ER_DD_NO_WRITES_NO_REPOPULATION = 10005 +ER_DD_VERSION_FOUND = 10006 +ER_DD_VERSION_INSTALLED = 10007 +ER_DD_VERSION_UNSUPPORTED = 10008 +ER_LOG_SYSLOG_FACILITY_FAIL = 10009 +ER_LOG_SYSLOG_CANNOT_OPEN = 10010 +ER_LOG_SLOW_CANNOT_OPEN = 10011 +ER_LOG_GENERAL_CANNOT_OPEN = 10012 +ER_LOG_CANNOT_WRITE = 10013 +ER_RPL_ZOMBIE_ENCOUNTERED = 10014 +ER_RPL_GTID_TABLE_CANNOT_OPEN = 10015 +ER_SYSTEM_SCHEMA_NOT_FOUND = 10016 +ER_DD_INIT_UPGRADE_FAILED = 10017 +ER_VIEW_UNKNOWN_CHARSET_OR_COLLATION = 10018 +ER_DD_VIEW_CANT_ALLOC_CHARSET = 10019 +ER_DD_INIT_FAILED = 10020 +ER_DD_UPDATING_PLUGIN_MD_FAILED = 10021 +ER_DD_POPULATING_TABLES_FAILED = 10022 +ER_DD_VIEW_CANT_CREATE = 10023 +ER_DD_METADATA_NOT_FOUND = 10024 +ER_DD_CACHE_NOT_EMPTY_AT_SHUTDOWN = 10025 +ER_DD_OBJECT_REMAINS = 10026 +ER_DD_OBJECT_REMAINS_IN_RELEASER = 10027 +ER_DD_OBJECT_RELEASER_REMAINS = 10028 +ER_DD_CANT_GET_OBJECT_KEY = 10029 +ER_DD_CANT_CREATE_OBJECT_KEY = 10030 +ER_CANT_CREATE_HANDLE_MGR_THREAD = 10031 +ER_RPL_REPO_HAS_GAPS = 10032 +ER_INVALID_VALUE_FOR_ENFORCE_GTID_CONSISTENCY = 10033 +ER_CHANGED_ENFORCE_GTID_CONSISTENCY = 10034 +ER_CHANGED_GTID_MODE = 10035 +ER_DISABLED_STORAGE_ENGINE_AS_DEFAULT = 10036 +ER_DEBUG_SYNC_HIT = 10037 +ER_DEBUG_SYNC_EXECUTED = 10038 +ER_DEBUG_SYNC_THREAD_MAX = 10039 +ER_DEBUG_SYNC_OOM = 10040 +ER_CANT_INIT_TC_LOG = 10041 +ER_EVENT_CANT_INIT_QUEUE = 10042 +ER_EVENT_PURGING_QUEUE = 10043 +ER_EVENT_LAST_EXECUTION = 10044 +ER_EVENT_MESSAGE_STACK = 10045 +ER_EVENT_EXECUTION_FAILED = 10046 +ER_CANT_INIT_SCHEDULER_THREAD = 10047 +ER_SCHEDULER_STOPPED = 10048 +ER_CANT_CREATE_SCHEDULER_THREAD = 10049 +ER_SCHEDULER_WAITING = 10050 +ER_SCHEDULER_STARTED = 10051 +ER_SCHEDULER_STOPPING_FAILED_TO_GET_EVENT = 10052 +ER_SCHEDULER_STOPPING_FAILED_TO_CREATE_WORKER = 10053 +ER_SCHEDULER_KILLING = 10054 +ER_UNABLE_TO_RESOLVE_IP = 10055 +ER_UNABLE_TO_RESOLVE_HOSTNAME = 10056 +ER_HOSTNAME_RESEMBLES_IPV4 = 10057 +ER_HOSTNAME_DOESNT_RESOLVE_TO = 10058 +ER_ADDRESSES_FOR_HOSTNAME_HEADER = 10059 +ER_ADDRESSES_FOR_HOSTNAME_LIST_ITEM = 10060 +ER_TRG_WITHOUT_DEFINER = 10061 +ER_TRG_NO_CLIENT_CHARSET = 10062 +ER_PARSING_VIEW = 10063 +ER_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP = 10064 +ER_COMPONENTS_INFRASTRUCTURE_SHUTDOWN = 10065 +ER_COMPONENTS_PERSIST_LOADER_BOOTSTRAP = 10066 +ER_DEPART_WITH_GRACE = 10067 +ER_CA_SELF_SIGNED = 10068 +ER_SSL_LIBRARY_ERROR = 10069 +ER_NO_THD_NO_UUID = 10070 +ER_UUID_SALT = 10071 +ER_UUID_IS = 10072 +ER_UUID_INVALID = 10073 +ER_UUID_SCRUB = 10074 +ER_CREATING_NEW_UUID = 10075 +ER_CANT_CREATE_UUID = 10076 +ER_UNKNOWN_UNSUPPORTED_STORAGE_ENGINE = 10077 +ER_SECURE_AUTH_VALUE_UNSUPPORTED = 10078 +ER_INVALID_INSTRUMENT = 10079 +ER_INNODB_MANDATORY = 10080 +OBSOLETE_ER_INNODB_CANNOT_BE_IGNORED = 10081 +ER_OLD_PASSWORDS_NO_MIDDLE_GROUND = 10082 +ER_VERBOSE_REQUIRES_HELP = 10083 +ER_POINTLESS_WITHOUT_SLOWLOG = 10084 +ER_WASTEFUL_NET_BUFFER_SIZE = 10085 +ER_DEPRECATED_TIMESTAMP_IMPLICIT_DEFAULTS = 10086 +ER_FT_BOOL_SYNTAX_INVALID = 10087 +ER_CREDENTIALLESS_AUTO_USER_BAD = 10088 +ER_CONNECTION_HANDLING_OOM = 10089 +ER_THREAD_HANDLING_OOM = 10090 +ER_CANT_CREATE_TEST_FILE = 10091 +ER_CANT_CREATE_PID_FILE = 10092 +ER_CANT_REMOVE_PID_FILE = 10093 +ER_CANT_CREATE_SHUTDOWN_THREAD = 10094 +ER_SEC_FILE_PRIV_CANT_ACCESS_DIR = 10095 +ER_SEC_FILE_PRIV_IGNORED = 10096 +ER_SEC_FILE_PRIV_EMPTY = 10097 +ER_SEC_FILE_PRIV_NULL = 10098 +ER_SEC_FILE_PRIV_DIRECTORY_INSECURE = 10099 +ER_SEC_FILE_PRIV_CANT_STAT = 10100 +ER_SEC_FILE_PRIV_DIRECTORY_PERMISSIONS = 10101 +ER_SEC_FILE_PRIV_ARGUMENT_TOO_LONG = 10102 +ER_CANT_CREATE_NAMED_PIPES_THREAD = 10103 +ER_CANT_CREATE_TCPIP_THREAD = 10104 +ER_CANT_CREATE_SHM_THREAD = 10105 +ER_CANT_CREATE_INTERRUPT_THREAD = 10106 +ER_WRITABLE_CONFIG_REMOVED = 10107 +ER_CORE_VALUES = 10108 +ER_WRONG_DATETIME_SPEC = 10109 +ER_RPL_BINLOG_FILTERS_OOM = 10110 +ER_KEYCACHE_OOM = 10111 +ER_CONFIRMING_THE_FUTURE = 10112 +ER_BACK_IN_TIME = 10113 +ER_FUTURE_DATE = 10114 +ER_UNSUPPORTED_DATE = 10115 +ER_STARTING_AS = 10116 +ER_SHUTTING_DOWN_SLAVE_THREADS = 10117 +ER_DISCONNECTING_REMAINING_CLIENTS = 10118 +ER_ABORTING = 10119 +ER_BINLOG_END = 10120 +ER_CALL_ME_LOCALHOST = 10121 +ER_USER_REQUIRES_ROOT = 10122 +ER_REALLY_RUN_AS_ROOT = 10123 +ER_USER_WHAT_USER = 10124 +ER_TRANSPORTS_WHAT_TRANSPORTS = 10125 +ER_FAIL_SETGID = 10126 +ER_FAIL_SETUID = 10127 +ER_FAIL_SETREGID = 10128 +ER_FAIL_SETREUID = 10129 +ER_FAIL_CHROOT = 10130 +ER_WIN_LISTEN_BUT_HOW = 10131 +ER_NOT_RIGHT_NOW = 10132 +ER_FIXING_CLIENT_CHARSET = 10133 +ER_OOM = 10134 +ER_FAILED_TO_LOCK_MEM = 10135 +ER_MYINIT_FAILED = 10136 +ER_BEG_INITFILE = 10137 +ER_END_INITFILE = 10138 +ER_CHANGED_MAX_OPEN_FILES = 10139 +ER_CANT_INCREASE_MAX_OPEN_FILES = 10140 +ER_CHANGED_MAX_CONNECTIONS = 10141 +ER_CHANGED_TABLE_OPEN_CACHE = 10142 +ER_THE_USER_ABIDES = 10143 +ER_RPL_CANT_ADD_DO_TABLE = 10144 +ER_RPL_CANT_ADD_IGNORE_TABLE = 10145 +ER_TRACK_VARIABLES_BOGUS = 10146 +ER_EXCESS_ARGUMENTS = 10147 +ER_VERBOSE_HINT = 10148 +ER_CANT_READ_ERRMSGS = 10149 +ER_CANT_INIT_DBS = 10150 +ER_LOG_OUTPUT_CONTRADICTORY = 10151 +ER_NO_CSV_NO_LOG_TABLES = 10152 +ER_RPL_REWRITEDB_MISSING_ARROW = 10153 +ER_RPL_REWRITEDB_EMPTY_FROM = 10154 +ER_RPL_REWRITEDB_EMPTY_TO = 10155 +ER_LOG_FILES_GIVEN_LOG_OUTPUT_IS_TABLE = 10156 +ER_LOG_FILE_INVALID = 10157 +ER_LOWER_CASE_TABLE_NAMES_CS_DD_ON_CI_FS_UNSUPPORTED = 10158 +ER_LOWER_CASE_TABLE_NAMES_USING_2 = 10159 +ER_LOWER_CASE_TABLE_NAMES_USING_0 = 10160 +ER_NEED_LOG_BIN = 10161 +ER_NEED_FILE_INSTEAD_OF_DIR = 10162 +ER_LOG_BIN_BETTER_WITH_NAME = 10163 +ER_BINLOG_NEEDS_SERVERID = 10164 +ER_RPL_CANT_MAKE_PATHS = 10165 +ER_CANT_INITIALIZE_GTID = 10166 +ER_CANT_INITIALIZE_EARLY_PLUGINS = 10167 +ER_CANT_INITIALIZE_BUILTIN_PLUGINS = 10168 +ER_CANT_INITIALIZE_DYNAMIC_PLUGINS = 10169 +ER_PERFSCHEMA_INIT_FAILED = 10170 +ER_STACKSIZE_UNEXPECTED = 10171 +ER_CANT_SET_DATADIR = 10172 +ER_CANT_STAT_DATADIR = 10173 +ER_CANT_CHOWN_DATADIR = 10174 +ER_CANT_SET_UP_PERSISTED_VALUES = 10175 +ER_CANT_SAVE_GTIDS = 10176 +ER_AUTH_CANT_SET_DEFAULT_PLUGIN = 10177 +ER_CANT_JOIN_SHUTDOWN_THREAD = 10178 +ER_CANT_HASH_DO_AND_IGNORE_RULES = 10179 +ER_CANT_OPEN_CA = 10180 +ER_CANT_ACCESS_CAPATH = 10181 +ER_SSL_TRYING_DATADIR_DEFAULTS = 10182 +ER_AUTO_OPTIONS_FAILED = 10183 +ER_CANT_INIT_TIMER = 10184 +ER_SERVERID_TOO_LARGE = 10185 +ER_DEFAULT_SE_UNAVAILABLE = 10186 +ER_CANT_OPEN_ERROR_LOG = 10187 +ER_INVALID_ERROR_LOG_NAME = 10188 +ER_RPL_INFINITY_DENIED = 10189 +ER_RPL_INFINITY_IGNORED = 10190 +ER_NDB_TABLES_NOT_READY = 10191 +ER_TABLE_CHECK_INTACT = 10192 +ER_DD_TABLESPACE_NOT_FOUND = 10193 +ER_DD_TRG_CONNECTION_COLLATION_MISSING = 10194 +ER_DD_TRG_DB_COLLATION_MISSING = 10195 +ER_DD_TRG_DEFINER_OOM = 10196 +ER_DD_TRG_FILE_UNREADABLE = 10197 +ER_TRG_CANT_PARSE = 10198 +ER_DD_TRG_CANT_ADD = 10199 +ER_DD_CANT_RESOLVE_VIEW = 10200 +ER_DD_VIEW_WITHOUT_DEFINER = 10201 +ER_PLUGIN_INIT_FAILED = 10202 +ER_RPL_TRX_DELEGATES_INIT_FAILED = 10203 +ER_RPL_BINLOG_STORAGE_DELEGATES_INIT_FAILED = 10204 +ER_RPL_BINLOG_TRANSMIT_DELEGATES_INIT_FAILED = 10205 +ER_RPL_BINLOG_RELAY_DELEGATES_INIT_FAILED = 10206 +ER_RPL_PLUGIN_FUNCTION_FAILED = 10207 +ER_SQL_HA_READ_FAILED = 10208 +ER_SR_BOGUS_VALUE = 10209 +ER_SR_INVALID_CONTEXT = 10210 +ER_READING_TABLE_FAILED = 10211 +ER_DES_FILE_WRONG_KEY = 10212 +ER_CANT_SET_PERSISTED = 10213 +ER_JSON_PARSE_ERROR = 10214 +ER_CONFIG_OPTION_WITHOUT_GROUP = 10215 +ER_VALGRIND_DO_QUICK_LEAK_CHECK = 10216 +ER_VALGRIND_COUNT_LEAKS = 10217 +ER_LOAD_DATA_INFILE_FAILED_IN_UNEXPECTED_WAY = 10218 +ER_UNKNOWN_ERROR_NUMBER = 10219 +ER_UDF_CANT_ALLOC_FOR_STRUCTURES = 10220 +ER_UDF_CANT_ALLOC_FOR_FUNCTION = 10221 +ER_UDF_INVALID_ROW_IN_FUNCTION_TABLE = 10222 +ER_UDF_CANT_OPEN_FUNCTION_TABLE = 10223 +ER_XA_RECOVER_FOUND_TRX_IN_SE = 10224 +ER_XA_RECOVER_FOUND_XA_TRX = 10225 +ER_XA_IGNORING_XID = 10226 +ER_XA_COMMITTING_XID = 10227 +ER_XA_ROLLING_BACK_XID = 10228 +ER_XA_STARTING_RECOVERY = 10229 +ER_XA_NO_MULTI_2PC_HEURISTIC_RECOVER = 10230 +ER_XA_RECOVER_EXPLANATION = 10231 +ER_XA_RECOVERY_DONE = 10232 +ER_TRX_GTID_COLLECT_REJECT = 10233 +ER_SQL_AUTHOR_DEFAULT_ROLES_FAIL = 10234 +ER_SQL_USER_TABLE_CREATE_WARNING = 10235 +ER_SQL_USER_TABLE_ALTER_WARNING = 10236 +ER_ROW_IN_WRONG_PARTITION_PLEASE_REPAIR = 10237 +ER_MYISAM_CRASHED_ERROR_IN_THREAD = 10238 +ER_MYISAM_CRASHED_ERROR_IN = 10239 +ER_TOO_MANY_STORAGE_ENGINES = 10240 +ER_SE_TYPECODE_CONFLICT = 10241 +ER_TRX_WRITE_SET_OOM = 10242 +ER_HANDLERTON_OOM = 10243 +ER_CONN_SHM_LISTENER = 10244 +ER_CONN_SHM_CANT_CREATE_SERVICE = 10245 +ER_CONN_SHM_CANT_CREATE_CONNECTION = 10246 +ER_CONN_PIP_CANT_CREATE_EVENT = 10247 +ER_CONN_PIP_CANT_CREATE_PIPE = 10248 +ER_CONN_PER_THREAD_NO_THREAD = 10249 +ER_CONN_TCP_NO_SOCKET = 10250 +ER_CONN_TCP_CREATED = 10251 +ER_CONN_TCP_ADDRESS = 10252 +ER_CONN_TCP_IPV6_AVAILABLE = 10253 +ER_CONN_TCP_IPV6_UNAVAILABLE = 10254 +ER_CONN_TCP_ERROR_WITH_STRERROR = 10255 +ER_CONN_TCP_CANT_RESOLVE_HOSTNAME = 10256 +ER_CONN_TCP_IS_THERE_ANOTHER_USING_PORT = 10257 +ER_CONN_UNIX_IS_THERE_ANOTHER_USING_SOCKET = 10258 +ER_CONN_UNIX_PID_CLAIMED_SOCKET_FILE = 10259 +ER_CONN_TCP_CANT_RESET_V6ONLY = 10260 +ER_CONN_TCP_BIND_RETRY = 10261 +ER_CONN_TPC_BIND_FAIL = 10262 +ER_CONN_TCP_IP_NOT_LOGGED = 10263 +ER_CONN_TCP_RESOLVE_INFO = 10264 +ER_CONN_TCP_START_FAIL = 10265 +ER_CONN_TCP_LISTEN_FAIL = 10266 +ER_CONN_UNIX_PATH_TOO_LONG = 10267 +ER_CONN_UNIX_LOCK_FILE_FAIL = 10268 +ER_CONN_UNIX_NO_FD = 10269 +ER_CONN_UNIX_NO_BIND_NO_START = 10270 +ER_CONN_UNIX_LISTEN_FAILED = 10271 +ER_CONN_UNIX_LOCK_FILE_GIVING_UP = 10272 +ER_CONN_UNIX_LOCK_FILE_CANT_CREATE = 10273 +ER_CONN_UNIX_LOCK_FILE_CANT_OPEN = 10274 +ER_CONN_UNIX_LOCK_FILE_CANT_READ = 10275 +ER_CONN_UNIX_LOCK_FILE_EMPTY = 10276 +ER_CONN_UNIX_LOCK_FILE_PIDLESS = 10277 +ER_CONN_UNIX_LOCK_FILE_CANT_WRITE = 10278 +ER_CONN_UNIX_LOCK_FILE_CANT_DELETE = 10279 +ER_CONN_UNIX_LOCK_FILE_CANT_SYNC = 10280 +ER_CONN_UNIX_LOCK_FILE_CANT_CLOSE = 10281 +ER_CONN_SOCKET_SELECT_FAILED = 10282 +ER_CONN_SOCKET_ACCEPT_FAILED = 10283 +ER_AUTH_RSA_CANT_FIND = 10284 +ER_AUTH_RSA_CANT_PARSE = 10285 +ER_AUTH_RSA_CANT_READ = 10286 +ER_AUTH_RSA_FILES_NOT_FOUND = 10287 +ER_CONN_ATTR_TRUNCATED = 10288 +ER_X509_CIPHERS_MISMATCH = 10289 +ER_X509_ISSUER_MISMATCH = 10290 +ER_X509_SUBJECT_MISMATCH = 10291 +ER_AUTH_CANT_ACTIVATE_ROLE = 10292 +ER_X509_NEEDS_RSA_PRIVKEY = 10293 +ER_X509_CANT_WRITE_KEY = 10294 +ER_X509_CANT_CHMOD_KEY = 10295 +ER_X509_CANT_READ_CA_KEY = 10296 +ER_X509_CANT_READ_CA_CERT = 10297 +ER_X509_CANT_CREATE_CERT = 10298 +ER_X509_CANT_WRITE_CERT = 10299 +ER_AUTH_CANT_CREATE_RSA_PAIR = 10300 +ER_AUTH_CANT_WRITE_PRIVKEY = 10301 +ER_AUTH_CANT_WRITE_PUBKEY = 10302 +ER_AUTH_SSL_CONF_PREVENTS_CERT_GENERATION = 10303 +ER_AUTH_USING_EXISTING_CERTS = 10304 +ER_AUTH_CERTS_SAVED_TO_DATADIR = 10305 +ER_AUTH_CERT_GENERATION_DISABLED = 10306 +ER_AUTH_RSA_CONF_PREVENTS_KEY_GENERATION = 10307 +ER_AUTH_KEY_GENERATION_SKIPPED_PAIR_PRESENT = 10308 +ER_AUTH_KEYS_SAVED_TO_DATADIR = 10309 +ER_AUTH_KEY_GENERATION_DISABLED = 10310 +ER_AUTHCACHE_PROXIES_PRIV_SKIPPED_NEEDS_RESOLVE = 10311 +ER_AUTHCACHE_PLUGIN_MISSING = 10312 +ER_AUTHCACHE_PLUGIN_CONFIG = 10313 +OBSOLETE_ER_AUTHCACHE_ROLE_TABLES_DODGY = 10314 +ER_AUTHCACHE_USER_SKIPPED_NEEDS_RESOLVE = 10315 +ER_AUTHCACHE_USER_TABLE_DODGY = 10316 +ER_AUTHCACHE_USER_IGNORED_DEPRECATED_PASSWORD = 10317 +ER_AUTHCACHE_USER_IGNORED_NEEDS_PLUGIN = 10318 +ER_AUTHCACHE_USER_IGNORED_INVALID_PASSWORD = 10319 +ER_AUTHCACHE_EXPIRED_PASSWORD_UNSUPPORTED = 10320 +ER_NO_SUPER_WITHOUT_USER_PLUGIN = 10321 +ER_AUTHCACHE_DB_IGNORED_EMPTY_NAME = 10322 +ER_AUTHCACHE_DB_SKIPPED_NEEDS_RESOLVE = 10323 +ER_AUTHCACHE_DB_ENTRY_LOWERCASED_REVOKE_WILL_FAIL = 10324 +ER_AUTHCACHE_TABLE_PROXIES_PRIV_MISSING = 10325 +ER_AUTHCACHE_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES = 10326 +ER_AUTHCACHE_CANT_INIT_GRANT_SUBSYSTEM = 10327 +ER_AUTHCACHE_PROCS_PRIV_SKIPPED_NEEDS_RESOLVE = 10328 +ER_AUTHCACHE_PROCS_PRIV_ENTRY_IGNORED_BAD_ROUTINE_TYPE = 10329 +ER_AUTHCACHE_TABLES_PRIV_SKIPPED_NEEDS_RESOLVE = 10330 +ER_USER_NOT_IN_EXTRA_USERS_BINLOG_POSSIBLY_INCOMPLETE = 10331 +ER_DD_SCHEMA_NOT_FOUND = 10332 +ER_DD_TABLE_NOT_FOUND = 10333 +ER_DD_SE_INIT_FAILED = 10334 +ER_DD_ABORTING_PARTIAL_UPGRADE = 10335 +ER_DD_FRM_EXISTS_FOR_TABLE = 10336 +ER_DD_CREATED_FOR_UPGRADE = 10337 +ER_ERRMSG_CANT_FIND_FILE = 10338 +ER_ERRMSG_LOADING_55_STYLE = 10339 +ER_ERRMSG_MISSING_IN_FILE = 10340 +ER_ERRMSG_OOM = 10341 +ER_ERRMSG_CANT_READ = 10342 +ER_TABLE_INCOMPATIBLE_DECIMAL_FIELD = 10343 +ER_TABLE_INCOMPATIBLE_YEAR_FIELD = 10344 +ER_INVALID_CHARSET_AND_DEFAULT_IS_MB = 10345 +ER_TABLE_WRONG_KEY_DEFINITION = 10346 +ER_CANT_OPEN_FRM_FILE = 10347 +ER_CANT_READ_FRM_FILE = 10348 +ER_TABLE_CREATED_WITH_DIFFERENT_VERSION = 10349 +ER_VIEW_UNPARSABLE = 10350 +ER_FILE_TYPE_UNKNOWN = 10351 +ER_INVALID_INFO_IN_FRM = 10352 +ER_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES = 10353 +ER_AUDIT_PLUGIN_DOES_NOT_SUPPORT_AUDIT_AUTH_EVENTS = 10354 +ER_AUDIT_PLUGIN_HAS_INVALID_DATA = 10355 +ER_TZ_OOM_INITIALIZING_TIME_ZONES = 10356 +ER_TZ_CANT_OPEN_AND_LOCK_TIME_ZONE_TABLE = 10357 +ER_TZ_OOM_LOADING_LEAP_SECOND_TABLE = 10358 +ER_TZ_TOO_MANY_LEAPS_IN_LEAP_SECOND_TABLE = 10359 +ER_TZ_ERROR_LOADING_LEAP_SECOND_TABLE = 10360 +ER_TZ_UNKNOWN_OR_ILLEGAL_DEFAULT_TIME_ZONE = 10361 +ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE = 10362 +ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE_ID = 10363 +ER_TZ_TRANSITION_TYPE_TABLE_TYPE_TOO_LARGE = 10364 +ER_TZ_TRANSITION_TYPE_TABLE_ABBREVIATIONS_EXCEED_SPACE = 10365 +ER_TZ_TRANSITION_TYPE_TABLE_LOAD_ERROR = 10366 +ER_TZ_TRANSITION_TABLE_TOO_MANY_TRANSITIONS = 10367 +ER_TZ_TRANSITION_TABLE_BAD_TRANSITION_TYPE = 10368 +ER_TZ_TRANSITION_TABLE_LOAD_ERROR = 10369 +ER_TZ_NO_TRANSITION_TYPES_IN_TIME_ZONE = 10370 +ER_TZ_OOM_LOADING_TIME_ZONE_DESCRIPTION = 10371 +ER_TZ_CANT_BUILD_MKTIME_MAP = 10372 +ER_TZ_OOM_WHILE_LOADING_TIME_ZONE = 10373 +ER_TZ_OOM_WHILE_SETTING_TIME_ZONE = 10374 +ER_SLAVE_SQL_THREAD_STOPPED_UNTIL_CONDITION_BAD = 10375 +ER_SLAVE_SQL_THREAD_STOPPED_UNTIL_POSITION_REACHED = 10376 +ER_SLAVE_SQL_THREAD_STOPPED_BEFORE_GTIDS_ALREADY_APPLIED = 10377 +ER_SLAVE_SQL_THREAD_STOPPED_BEFORE_GTIDS_REACHED = 10378 +ER_SLAVE_SQL_THREAD_STOPPED_AFTER_GTIDS_REACHED = 10379 +ER_SLAVE_SQL_THREAD_STOPPED_GAP_TRX_PROCESSED = 10380 +ER_GROUP_REPLICATION_PLUGIN_NOT_INSTALLED = 10381 +ER_GTID_ALREADY_ADDED_BY_USER = 10382 +ER_FAILED_TO_DELETE_FROM_GTID_EXECUTED_TABLE = 10383 +ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE = 10384 +ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE_OOM = 10385 +ER_FAILED_TO_INIT_THREAD_ATTR_FOR_GTID_TABLE_COMPRESSION = 10386 +ER_FAILED_TO_CREATE_GTID_TABLE_COMPRESSION_THREAD = 10387 +ER_FAILED_TO_JOIN_GTID_TABLE_COMPRESSION_THREAD = 10388 +ER_NPIPE_FAILED_TO_INIT_SECURITY_DESCRIPTOR = 10389 +ER_NPIPE_FAILED_TO_SET_SECURITY_DESCRIPTOR = 10390 +ER_NPIPE_PIPE_ALREADY_IN_USE = 10391 +ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS_ON_START = 10392 +ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS = 10393 +ER_NDB_SLAVE_SAW_ALREADY_COMMITTED_EPOCH = 10394 +ER_NDB_SLAVE_PREVIOUS_EPOCH_NOT_COMMITTED = 10395 +ER_NDB_SLAVE_MISSING_DATA_FOR_TIMESTAMP_COLUMN = 10396 +ER_NDB_SLAVE_LOGGING_EXCEPTIONS_TO = 10397 +ER_NDB_SLAVE_LOW_EPOCH_RESOLUTION = 10398 +ER_NDB_INFO_FOUND_UNEXPECTED_FIELD_TYPE = 10399 +ER_NDB_INFO_FAILED_TO_CREATE_NDBINFO = 10400 +ER_NDB_INFO_FAILED_TO_INIT_NDBINFO = 10401 +ER_NDB_CLUSTER_WRONG_NUMBER_OF_FUNCTION_ARGUMENTS = 10402 +ER_NDB_CLUSTER_SCHEMA_INFO = 10403 +ER_NDB_CLUSTER_GENERIC_MESSAGE = 10404 +ER_RPL_CANT_OPEN_INFO_TABLE = 10405 +ER_RPL_CANT_SCAN_INFO_TABLE = 10406 +ER_RPL_CORRUPTED_INFO_TABLE = 10407 +ER_RPL_CORRUPTED_KEYS_IN_INFO_TABLE = 10408 +ER_RPL_WORKER_ID_IS = 10409 +ER_RPL_INCONSISTENT_TIMESTAMPS_IN_TRX = 10410 +ER_RPL_INCONSISTENT_SEQUENCE_NO_IN_TRX = 10411 +ER_RPL_CHANNELS_REQUIRE_TABLES_AS_INFO_REPOSITORIES = 10412 +ER_RPL_CHANNELS_REQUIRE_NON_ZERO_SERVER_ID = 10413 +ER_RPL_REPO_SHOULD_BE_TABLE = 10414 +ER_RPL_ERROR_CREATING_MASTER_INFO = 10415 +ER_RPL_ERROR_CHANGING_MASTER_INFO_REPO_TYPE = 10416 +ER_RPL_CHANGING_RELAY_LOG_INFO_REPO_TYPE_FAILED_DUE_TO_GAPS = 10417 +ER_RPL_ERROR_CREATING_RELAY_LOG_INFO = 10418 +ER_RPL_ERROR_CHANGING_RELAY_LOG_INFO_REPO_TYPE = 10419 +ER_RPL_FAILED_TO_DELETE_FROM_SLAVE_WORKERS_INFO_REPOSITORY = 10420 +ER_RPL_FAILED_TO_RESET_STATE_IN_SLAVE_INFO_REPOSITORY = 10421 +ER_RPL_ERROR_CHECKING_REPOSITORY = 10422 +ER_RPL_SLAVE_GENERIC_MESSAGE = 10423 +ER_RPL_SLAVE_COULD_NOT_CREATE_CHANNEL_LIST = 10424 +ER_RPL_MULTISOURCE_REQUIRES_TABLE_TYPE_REPOSITORIES = 10425 +ER_RPL_SLAVE_FAILED_TO_INIT_A_MASTER_INFO_STRUCTURE = 10426 +ER_RPL_SLAVE_FAILED_TO_INIT_MASTER_INFO_STRUCTURE = 10427 +ER_RPL_SLAVE_FAILED_TO_CREATE_CHANNEL_FROM_MASTER_INFO = 10428 +ER_RPL_FAILED_TO_CREATE_NEW_INFO_FILE = 10429 +ER_RPL_FAILED_TO_CREATE_CACHE_FOR_INFO_FILE = 10430 +ER_RPL_FAILED_TO_OPEN_INFO_FILE = 10431 +ER_RPL_GTID_MEMORY_FINALLY_AVAILABLE = 10432 +ER_SERVER_COST_UNKNOWN_COST_CONSTANT = 10433 +ER_SERVER_COST_INVALID_COST_CONSTANT = 10434 +ER_ENGINE_COST_UNKNOWN_COST_CONSTANT = 10435 +ER_ENGINE_COST_UNKNOWN_STORAGE_ENGINE = 10436 +ER_ENGINE_COST_INVALID_DEVICE_TYPE_FOR_SE = 10437 +ER_ENGINE_COST_INVALID_CONST_CONSTANT_FOR_SE_AND_DEVICE = 10438 +ER_SERVER_COST_FAILED_TO_READ = 10439 +ER_ENGINE_COST_FAILED_TO_READ = 10440 +ER_FAILED_TO_OPEN_COST_CONSTANT_TABLES = 10441 +ER_RPL_UNSUPPORTED_UNIGNORABLE_EVENT_IN_STREAM = 10442 +ER_RPL_GTID_LOG_EVENT_IN_STREAM = 10443 +ER_RPL_UNEXPECTED_BEGIN_IN_STREAM = 10444 +ER_RPL_UNEXPECTED_COMMIT_ROLLBACK_OR_XID_LOG_EVENT_IN_STREAM = 10445 +ER_RPL_UNEXPECTED_XA_ROLLBACK_IN_STREAM = 10446 +ER_EVENT_EXECUTION_FAILED_CANT_AUTHENTICATE_USER = 10447 +ER_EVENT_EXECUTION_FAILED_USER_LOST_EVEN_PRIVILEGE = 10448 +ER_EVENT_ERROR_DURING_COMPILATION = 10449 +ER_EVENT_DROPPING = 10450 +ER_NDB_SCHEMA_GENERIC_MESSAGE = 10451 +ER_RPL_INCOMPATIBLE_DECIMAL_IN_RBR = 10452 +ER_INIT_ROOT_WITHOUT_PASSWORD = 10453 +ER_INIT_GENERATING_TEMP_PASSWORD_FOR_ROOT = 10454 +ER_INIT_CANT_OPEN_BOOTSTRAP_FILE = 10455 +ER_INIT_BOOTSTRAP_COMPLETE = 10456 +ER_INIT_DATADIR_NOT_EMPTY_WONT_INITIALIZE = 10457 +ER_INIT_DATADIR_EXISTS_WONT_INITIALIZE = 10458 +ER_INIT_DATADIR_EXISTS_AND_PATH_TOO_LONG_WONT_INITIALIZE = 10459 +ER_INIT_DATADIR_EXISTS_AND_NOT_WRITABLE_WONT_INITIALIZE = 10460 +ER_INIT_CREATING_DD = 10461 +ER_RPL_BINLOG_STARTING_DUMP = 10462 +ER_RPL_BINLOG_MASTER_SENDS_HEARTBEAT = 10463 +ER_RPL_BINLOG_SKIPPING_REMAINING_HEARTBEAT_INFO = 10464 +ER_RPL_BINLOG_MASTER_USES_CHECKSUM_AND_SLAVE_CANT = 10465 +ER_NDB_QUERY_FAILED = 10466 +ER_KILLING_THREAD = 10467 +ER_DETACHING_SESSION_LEFT_BY_PLUGIN = 10468 +ER_CANT_DETACH_SESSION_LEFT_BY_PLUGIN = 10469 +ER_DETACHED_SESSIONS_LEFT_BY_PLUGIN = 10470 +ER_FAILED_TO_DECREMENT_NUMBER_OF_THREADS = 10471 +ER_PLUGIN_DID_NOT_DEINITIALIZE_THREADS = 10472 +ER_KILLED_THREADS_OF_PLUGIN = 10473 +ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_UNKNOWN = 10474 +ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_SET_TO = 10475 +ER_NDB_NODE_ID_AND_MANAGEMENT_SERVER_INFO = 10476 +ER_NDB_DISCONNECT_INFO = 10477 +ER_NDB_COLUMN_DEFAULTS_DIFFER = 10478 +ER_NDB_COLUMN_SHOULD_NOT_HAVE_NATIVE_DEFAULT = 10479 +ER_NDB_FIELD_INFO = 10480 +ER_NDB_COLUMN_INFO = 10481 +ER_NDB_OOM_IN_FIX_UNIQUE_INDEX_ATTR_ORDER = 10482 +ER_NDB_SLAVE_MALFORMED_EVENT_RECEIVED_ON_TABLE = 10483 +ER_NDB_SLAVE_CONFLICT_FUNCTION_REQUIRES_ROLE = 10484 +ER_NDB_SLAVE_CONFLICT_DETECTION_REQUIRES_TRANSACTION_IDS = 10485 +ER_NDB_SLAVE_BINLOG_MISSING_INFO_FOR_CONFLICT_DETECTION = 10486 +ER_NDB_ERROR_IN_READAUTOINCREMENTVALUE = 10487 +ER_NDB_FOUND_UNCOMMITTED_AUTOCOMMIT = 10488 +ER_NDB_SLAVE_TOO_MANY_RETRIES = 10489 +ER_NDB_SLAVE_ERROR_IN_UPDATE_CREATE_INFO = 10490 +ER_NDB_SLAVE_CANT_ALLOCATE_TABLE_SHARE = 10491 +ER_NDB_BINLOG_ERROR_INFO_FROM_DA = 10492 +ER_NDB_BINLOG_CREATE_TABLE_EVENT = 10493 +ER_NDB_BINLOG_FAILED_CREATE_TABLE_EVENT_OPERATIONS = 10494 +ER_NDB_BINLOG_RENAME_EVENT = 10495 +ER_NDB_BINLOG_FAILED_CREATE_EVENT_OPERATIONS_DURING_RENAME = 10496 +ER_NDB_UNEXPECTED_RENAME_TYPE = 10497 +ER_NDB_ERROR_IN_GET_AUTO_INCREMENT = 10498 +ER_NDB_CREATING_SHARE_IN_OPEN = 10499 +ER_NDB_TABLE_OPENED_READ_ONLY = 10500 +ER_NDB_INITIALIZE_GIVEN_CLUSTER_PLUGIN_DISABLED = 10501 +ER_NDB_BINLOG_FORMAT_CHANGED_FROM_STMT_TO_MIXED = 10502 +ER_NDB_TRAILING_SHARE_RELEASED_BY_CLOSE_CACHED_TABLES = 10503 +ER_NDB_SHARE_ALREADY_EXISTS = 10504 +ER_NDB_HANDLE_TRAILING_SHARE_INFO = 10505 +ER_NDB_CLUSTER_GET_SHARE_INFO = 10506 +ER_NDB_CLUSTER_REAL_FREE_SHARE_INFO = 10507 +ER_NDB_CLUSTER_REAL_FREE_SHARE_DROP_FAILED = 10508 +ER_NDB_CLUSTER_FREE_SHARE_INFO = 10509 +ER_NDB_CLUSTER_MARK_SHARE_DROPPED_INFO = 10510 +ER_NDB_CLUSTER_MARK_SHARE_DROPPED_DESTROYING_SHARE = 10511 +ER_NDB_CLUSTER_OOM_THD_NDB = 10512 +ER_NDB_BINLOG_NDB_TABLES_INITIALLY_READ_ONLY = 10513 +ER_NDB_UTIL_THREAD_OOM = 10514 +ER_NDB_ILLEGAL_VALUE_FOR_NDB_RECV_THREAD_CPU_MASK = 10515 +ER_NDB_TOO_MANY_CPUS_IN_NDB_RECV_THREAD_CPU_MASK = 10516 +ER_DBUG_CHECK_SHARES_OPEN = 10517 +ER_DBUG_CHECK_SHARES_INFO = 10518 +ER_DBUG_CHECK_SHARES_DROPPED = 10519 +ER_INVALID_OR_OLD_TABLE_OR_DB_NAME = 10520 +ER_TC_RECOVERING_AFTER_CRASH_USING = 10521 +ER_TC_CANT_AUTO_RECOVER_WITH_TC_HEURISTIC_RECOVER = 10522 +ER_TC_BAD_MAGIC_IN_TC_LOG = 10523 +ER_TC_NEED_N_SE_SUPPORTING_2PC_FOR_RECOVERY = 10524 +ER_TC_RECOVERY_FAILED_THESE_ARE_YOUR_OPTIONS = 10525 +ER_TC_HEURISTIC_RECOVERY_MODE = 10526 +ER_TC_HEURISTIC_RECOVERY_FAILED = 10527 +ER_TC_RESTART_WITHOUT_TC_HEURISTIC_RECOVER = 10528 +ER_RPL_SLAVE_FAILED_TO_CREATE_OR_RECOVER_INFO_REPOSITORIES = 10529 +ER_RPL_SLAVE_AUTO_POSITION_IS_1_AND_GTID_MODE_IS_OFF = 10530 +ER_RPL_SLAVE_CANT_START_SLAVE_FOR_CHANNEL = 10531 +ER_RPL_SLAVE_CANT_STOP_SLAVE_FOR_CHANNEL = 10532 +ER_RPL_RECOVERY_NO_ROTATE_EVENT_FROM_MASTER = 10533 +ER_RPL_RECOVERY_ERROR_READ_RELAY_LOG = 10534 +ER_RPL_RECOVERY_ERROR_FREEING_IO_CACHE = 10535 +ER_RPL_RECOVERY_SKIPPED_GROUP_REPLICATION_CHANNEL = 10536 +ER_RPL_RECOVERY_ERROR = 10537 +ER_RPL_RECOVERY_IO_ERROR_READING_RELAY_LOG_INDEX = 10538 +ER_RPL_RECOVERY_FILE_MASTER_POS_INFO = 10539 +ER_RPL_RECOVERY_REPLICATE_SAME_SERVER_ID_REQUIRES_POSITION = 10540 +ER_RPL_MTS_RECOVERY_STARTING_COORDINATOR = 10541 +ER_RPL_MTS_RECOVERY_FAILED_TO_START_COORDINATOR = 10542 +ER_RPL_MTS_AUTOMATIC_RECOVERY_FAILED = 10543 +ER_RPL_MTS_RECOVERY_CANT_OPEN_RELAY_LOG = 10544 +ER_RPL_MTS_RECOVERY_SUCCESSFUL = 10545 +ER_RPL_SERVER_ID_MISSING = 10546 +ER_RPL_CANT_CREATE_SLAVE_THREAD = 10547 +ER_RPL_SLAVE_IO_THREAD_WAS_KILLED = 10548 +ER_RPL_SLAVE_MASTER_UUID_HAS_CHANGED = 10549 +ER_RPL_SLAVE_USES_CHECKSUM_AND_MASTER_PRE_50 = 10550 +ER_RPL_SLAVE_SECONDS_BEHIND_MASTER_DUBIOUS = 10551 +ER_RPL_SLAVE_CANT_FLUSH_MASTER_INFO_FILE = 10552 +ER_RPL_SLAVE_REPORT_HOST_TOO_LONG = 10553 +ER_RPL_SLAVE_REPORT_USER_TOO_LONG = 10554 +ER_RPL_SLAVE_REPORT_PASSWORD_TOO_LONG = 10555 +ER_RPL_SLAVE_ERROR_RETRYING = 10556 +ER_RPL_SLAVE_ERROR_READING_FROM_SERVER = 10557 +ER_RPL_SLAVE_DUMP_THREAD_KILLED_BY_MASTER = 10558 +ER_RPL_MTS_STATISTICS = 10559 +ER_RPL_MTS_RECOVERY_COMPLETE = 10560 +ER_RPL_SLAVE_CANT_INIT_RELAY_LOG_POSITION = 10561 +ER_RPL_SLAVE_CONNECTED_TO_MASTER_REPLICATION_STARTED = 10562 +ER_RPL_SLAVE_IO_THREAD_KILLED = 10563 +ER_RPL_SLAVE_IO_THREAD_CANT_REGISTER_ON_MASTER = 10564 +ER_RPL_SLAVE_FORCING_TO_RECONNECT_IO_THREAD = 10565 +ER_RPL_SLAVE_ERROR_REQUESTING_BINLOG_DUMP = 10566 +ER_RPL_LOG_ENTRY_EXCEEDS_SLAVE_MAX_ALLOWED_PACKET = 10567 +ER_RPL_SLAVE_STOPPING_AS_MASTER_OOM = 10568 +ER_RPL_SLAVE_IO_THREAD_ABORTED_WAITING_FOR_RELAY_LOG_SPACE = 10569 +ER_RPL_SLAVE_IO_THREAD_EXITING = 10570 +ER_RPL_SLAVE_CANT_INITIALIZE_SLAVE_WORKER = 10571 +ER_RPL_MTS_GROUP_RECOVERY_RELAY_LOG_INFO_FOR_WORKER = 10572 +ER_RPL_ERROR_LOOKING_FOR_LOG = 10573 +ER_RPL_MTS_GROUP_RECOVERY_RELAY_LOG_INFO = 10574 +ER_RPL_CANT_FIND_FOLLOWUP_FILE = 10575 +ER_RPL_MTS_CHECKPOINT_PERIOD_DIFFERS_FROM_CNT = 10576 +ER_RPL_SLAVE_WORKER_THREAD_CREATION_FAILED = 10577 +ER_RPL_SLAVE_WORKER_THREAD_CREATION_FAILED_WITH_ERRNO = 10578 +ER_RPL_SLAVE_FAILED_TO_INIT_PARTITIONS_HASH = 10579 +ER_RPL_SLAVE_NDB_TABLES_NOT_AVAILABLE = 10580 +ER_RPL_SLAVE_SQL_THREAD_STARTING = 10581 +ER_RPL_SLAVE_SKIP_COUNTER_EXECUTED = 10582 +ER_RPL_SLAVE_ADDITIONAL_ERROR_INFO_FROM_DA = 10583 +ER_RPL_SLAVE_ERROR_INFO_FROM_DA = 10584 +ER_RPL_SLAVE_ERROR_LOADING_USER_DEFINED_LIBRARY = 10585 +ER_RPL_SLAVE_ERROR_RUNNING_QUERY = 10586 +ER_RPL_SLAVE_SQL_THREAD_EXITING = 10587 +ER_RPL_SLAVE_READ_INVALID_EVENT_FROM_MASTER = 10588 +ER_RPL_SLAVE_QUEUE_EVENT_FAILED_INVALID_CONFIGURATION = 10589 +ER_RPL_SLAVE_IO_THREAD_DETECTED_UNEXPECTED_EVENT_SEQUENCE = 10590 +ER_RPL_SLAVE_CANT_USE_CHARSET = 10591 +ER_RPL_SLAVE_CONNECTED_TO_MASTER_REPLICATION_RESUMED = 10592 +ER_RPL_SLAVE_NEXT_LOG_IS_ACTIVE = 10593 +ER_RPL_SLAVE_NEXT_LOG_IS_INACTIVE = 10594 +ER_RPL_SLAVE_SQL_THREAD_IO_ERROR_READING_EVENT = 10595 +ER_RPL_SLAVE_ERROR_READING_RELAY_LOG_EVENTS = 10596 +ER_SLAVE_CHANGE_MASTER_TO_EXECUTED = 10597 +ER_RPL_SLAVE_NEW_MASTER_INFO_NEEDS_REPOS_TYPE_OTHER_THAN_FILE = 10598 +ER_RPL_FAILED_TO_STAT_LOG_IN_INDEX = 10599 +ER_RPL_LOG_NOT_FOUND_WHILE_COUNTING_RELAY_LOG_SPACE = 10600 +ER_SLAVE_CANT_USE_TEMPDIR = 10601 +ER_RPL_RELAY_LOG_NEEDS_FILE_NOT_DIRECTORY = 10602 +ER_RPL_RELAY_LOG_INDEX_NEEDS_FILE_NOT_DIRECTORY = 10603 +ER_RPL_PLEASE_USE_OPTION_RELAY_LOG = 10604 +ER_RPL_OPEN_INDEX_FILE_FAILED = 10605 +ER_RPL_CANT_INITIALIZE_GTID_SETS_IN_RLI_INIT_INFO = 10606 +ER_RPL_CANT_OPEN_LOG_IN_RLI_INIT_INFO = 10607 +ER_RPL_ERROR_WRITING_RELAY_LOG_CONFIGURATION = 10608 +ER_NDB_OOM_GET_NDB_BLOBS_VALUE = 10609 +ER_NDB_THREAD_TIMED_OUT = 10610 +ER_NDB_TABLE_IS_NOT_DISTRIBUTED = 10611 +ER_NDB_CREATING_TABLE = 10612 +ER_NDB_FLUSHING_TABLE_INFO = 10613 +ER_NDB_CLEANING_STRAY_TABLES = 10614 +ER_NDB_DISCOVERED_MISSING_DB = 10615 +ER_NDB_DISCOVERED_REMAINING_DB = 10616 +ER_NDB_CLUSTER_FIND_ALL_DBS_RETRY = 10617 +ER_NDB_CLUSTER_FIND_ALL_DBS_FAIL = 10618 +ER_NDB_SKIPPING_SETUP_TABLE = 10619 +ER_NDB_FAILED_TO_SET_UP_TABLE = 10620 +ER_NDB_MISSING_FRM_DISCOVERING = 10621 +ER_NDB_MISMATCH_IN_FRM_DISCOVERING = 10622 +ER_NDB_BINLOG_CLEANING_UP_SETUP_LEFTOVERS = 10623 +ER_NDB_WAITING_INFO = 10624 +ER_NDB_WAITING_INFO_WITH_MAP = 10625 +ER_NDB_TIMEOUT_WHILE_DISTRIBUTING = 10626 +ER_NDB_NOT_WAITING_FOR_DISTRIBUTING = 10627 +ER_NDB_DISTRIBUTED_INFO = 10628 +ER_NDB_DISTRIBUTION_COMPLETE = 10629 +ER_NDB_SCHEMA_DISTRIBUTION_FAILED = 10630 +ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_SUBSCRIBE = 10631 +ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_UNSUBSCRIBE = 10632 +ER_NDB_BINLOG_CANT_DISCOVER_TABLE_FROM_SCHEMA_EVENT = 10633 +ER_NDB_BINLOG_SIGNALLING_UNKNOWN_VALUE = 10634 +ER_NDB_BINLOG_REPLY_TO = 10635 +ER_NDB_BINLOG_CANT_RELEASE_SLOCK = 10636 +ER_NDB_CANT_FIND_TABLE = 10637 +ER_NDB_DISCARDING_EVENT_NO_OBJ = 10638 +ER_NDB_DISCARDING_EVENT_ID_VERSION_MISMATCH = 10639 +ER_NDB_CLEAR_SLOCK_INFO = 10640 +ER_NDB_BINLOG_SKIPPING_LOCAL_TABLE = 10641 +ER_NDB_BINLOG_ONLINE_ALTER_RENAME = 10642 +ER_NDB_BINLOG_CANT_REOPEN_SHADOW_TABLE = 10643 +ER_NDB_BINLOG_ONLINE_ALTER_RENAME_COMPLETE = 10644 +ER_NDB_BINLOG_SKIPPING_DROP_OF_LOCAL_TABLE = 10645 +ER_NDB_BINLOG_SKIPPING_RENAME_OF_LOCAL_TABLE = 10646 +ER_NDB_BINLOG_SKIPPING_DROP_OF_DB_CONTAINING_LOCAL_TABLES = 10647 +ER_NDB_BINLOG_GOT_DIST_PRIV_EVENT_FLUSHING_PRIVILEGES = 10648 +ER_NDB_BINLOG_GOT_SCHEMA_EVENT = 10649 +ER_NDB_BINLOG_SKIPPING_OLD_SCHEMA_OPERATION = 10650 +ER_NDB_CLUSTER_FAILURE = 10651 +ER_NDB_TABLES_INITIALLY_READ_ONLY_ON_RECONNECT = 10652 +ER_NDB_IGNORING_UNKNOWN_EVENT = 10653 +ER_NDB_BINLOG_OPENING_INDEX = 10654 +ER_NDB_BINLOG_CANT_LOCK_NDB_BINLOG_INDEX = 10655 +ER_NDB_BINLOG_INJECTING_RANDOM_WRITE_FAILURE = 10656 +ER_NDB_BINLOG_CANT_WRITE_TO_NDB_BINLOG_INDEX = 10657 +ER_NDB_BINLOG_WRITING_TO_NDB_BINLOG_INDEX = 10658 +ER_NDB_BINLOG_CANT_COMMIT_TO_NDB_BINLOG_INDEX = 10659 +ER_NDB_BINLOG_WRITE_TO_NDB_BINLOG_INDEX_FAILED_AFTER_KILL = 10660 +ER_NDB_BINLOG_USING_SERVER_ID_0_SLAVES_WILL_NOT = 10661 +ER_NDB_SERVER_ID_RESERVED_OR_TOO_LARGE = 10662 +ER_NDB_BINLOG_NDB_LOG_TRANSACTION_ID_REQUIRES_V2_ROW_EVENTS = 10663 +ER_NDB_BINLOG_NDB_LOG_APPLY_STATUS_FORCING_FULL_USE_WRITE = 10664 +ER_NDB_BINLOG_GENERIC_MESSAGE = 10665 +ER_NDB_CONFLICT_GENERIC_MESSAGE = 10666 +ER_NDB_TRANS_DEPENDENCY_TRACKER_ERROR = 10667 +ER_NDB_CONFLICT_FN_PARSE_ERROR = 10668 +ER_NDB_CONFLICT_FN_SETUP_ERROR = 10669 +ER_NDB_BINLOG_FAILED_TO_GET_TABLE = 10670 +ER_NDB_BINLOG_NOT_LOGGING = 10671 +ER_NDB_BINLOG_CREATE_TABLE_EVENT_FAILED = 10672 +ER_NDB_BINLOG_CREATE_TABLE_EVENT_INFO = 10673 +ER_NDB_BINLOG_DISCOVER_TABLE_EVENT_INFO = 10674 +ER_NDB_BINLOG_BLOB_REQUIRES_PK = 10675 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB = 10676 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_AND_CANT_DROP = 10677 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_DROPPED = 10678 +ER_NDB_BINLOG_DISCOVER_REUSING_OLD_EVENT_OPS = 10679 +ER_NDB_BINLOG_CREATING_NDBEVENTOPERATION_FAILED = 10680 +ER_NDB_BINLOG_CANT_CREATE_BLOB = 10681 +ER_NDB_BINLOG_NDBEVENT_EXECUTE_FAILED = 10682 +ER_NDB_CREATE_EVENT_OPS_LOGGING_INFO = 10683 +ER_NDB_BINLOG_CANT_DROP_EVENT_FROM_DB = 10684 +ER_NDB_TIMED_OUT_IN_DROP_TABLE = 10685 +ER_NDB_BINLOG_UNHANDLED_ERROR_FOR_TABLE = 10686 +ER_NDB_BINLOG_CLUSTER_FAILURE = 10687 +ER_NDB_BINLOG_UNKNOWN_NON_DATA_EVENT = 10688 +ER_NDB_BINLOG_INJECTOR_DISCARDING_ROW_EVENT_METADATA = 10689 +ER_NDB_REMAINING_OPEN_TABLES = 10690 +ER_NDB_REMAINING_OPEN_TABLE_INFO = 10691 +ER_NDB_COULD_NOT_GET_APPLY_STATUS_SHARE = 10692 +ER_NDB_BINLOG_SERVER_SHUTDOWN_DURING_NDB_CLUSTER_START = 10693 +ER_NDB_BINLOG_CLUSTER_RESTARTED_RESET_MASTER_SUGGESTED = 10694 +ER_NDB_BINLOG_CLUSTER_HAS_RECONNECTED = 10695 +ER_NDB_BINLOG_STARTING_LOG_AT_EPOCH = 10696 +ER_NDB_BINLOG_NDB_TABLES_WRITABLE = 10697 +ER_NDB_BINLOG_SHUTDOWN_DETECTED = 10698 +ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_WAITING = 10699 +ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_CONTINUING = 10700 +ER_NDB_BINLOG_ERROR_HANDLING_SCHEMA_EVENT = 10701 +ER_NDB_BINLOG_CANT_INJECT_APPLY_STATUS_WRITE_ROW = 10702 +ER_NDB_BINLOG_ERROR_DURING_GCI_ROLLBACK = 10703 +ER_NDB_BINLOG_ERROR_DURING_GCI_COMMIT = 10704 +ER_NDB_BINLOG_LATEST_TRX_IN_EPOCH_NOT_IN_BINLOG = 10705 +ER_NDB_BINLOG_RELEASING_EXTRA_SHARE_REFERENCES = 10706 +ER_NDB_BINLOG_REMAINING_OPEN_TABLES = 10707 +ER_NDB_BINLOG_REMAINING_OPEN_TABLE_INFO = 10708 +ER_TREE_CORRUPT_PARENT_SHOULD_POINT_AT_PARENT = 10709 +ER_TREE_CORRUPT_ROOT_SHOULD_BE_BLACK = 10710 +ER_TREE_CORRUPT_2_CONSECUTIVE_REDS = 10711 +ER_TREE_CORRUPT_RIGHT_IS_LEFT = 10712 +ER_TREE_CORRUPT_INCORRECT_BLACK_COUNT = 10713 +ER_WRONG_COUNT_FOR_ORIGIN = 10714 +ER_WRONG_COUNT_FOR_KEY = 10715 +ER_WRONG_COUNT_OF_ELEMENTS = 10716 +ER_RPL_ERROR_READING_SLAVE_WORKER_CONFIGURATION = 10717 +ER_RPL_ERROR_WRITING_SLAVE_WORKER_CONFIGURATION = 10718 +ER_RPL_FAILED_TO_OPEN_RELAY_LOG = 10719 +ER_RPL_WORKER_CANT_READ_RELAY_LOG = 10720 +ER_RPL_WORKER_CANT_FIND_NEXT_RELAY_LOG = 10721 +ER_RPL_MTS_SLAVE_COORDINATOR_HAS_WAITED = 10722 +ER_BINLOG_FAILED_TO_WRITE_DROP_FOR_TEMP_TABLES = 10723 +ER_BINLOG_OOM_WRITING_DELETE_WHILE_OPENING_HEAP_TABLE = 10724 +ER_FAILED_TO_REPAIR_TABLE = 10725 +ER_FAILED_TO_REMOVE_TEMP_TABLE = 10726 +ER_SYSTEM_TABLE_NOT_TRANSACTIONAL = 10727 +ER_RPL_ERROR_WRITING_MASTER_CONFIGURATION = 10728 +ER_RPL_ERROR_READING_MASTER_CONFIGURATION = 10729 +ER_RPL_SSL_INFO_IN_MASTER_INFO_IGNORED = 10730 +ER_PLUGIN_FAILED_DEINITIALIZATION = 10731 +ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_DEINITIALIZATION = 10732 +ER_PLUGIN_SHUTTING_DOWN_PLUGIN = 10733 +ER_PLUGIN_REGISTRATION_FAILED = 10734 +ER_PLUGIN_CANT_OPEN_PLUGIN_TABLE = 10735 +ER_PLUGIN_CANT_LOAD = 10736 +ER_PLUGIN_LOAD_PARAMETER_TOO_LONG = 10737 +ER_PLUGIN_FORCING_SHUTDOWN = 10738 +ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_SHUTDOWN = 10739 +ER_PLUGIN_UNKNOWN_VARIABLE_TYPE = 10740 +ER_PLUGIN_VARIABLE_SET_READ_ONLY = 10741 +ER_PLUGIN_VARIABLE_MISSING_NAME = 10742 +ER_PLUGIN_VARIABLE_NOT_ALLOCATED_THREAD_LOCAL = 10743 +ER_PLUGIN_OOM = 10744 +ER_PLUGIN_BAD_OPTIONS = 10745 +ER_PLUGIN_PARSING_OPTIONS_FAILED = 10746 +ER_PLUGIN_DISABLED = 10747 +ER_PLUGIN_HAS_CONFLICTING_SYSTEM_VARIABLES = 10748 +ER_PLUGIN_CANT_SET_PERSISTENT_OPTIONS = 10749 +ER_MY_NET_WRITE_FAILED_FALLING_BACK_ON_STDERR = 10750 +ER_RETRYING_REPAIR_WITHOUT_QUICK = 10751 +ER_RETRYING_REPAIR_WITH_KEYCACHE = 10752 +ER_FOUND_ROWS_WHILE_REPAIRING = 10753 +ER_ERROR_DURING_OPTIMIZE_TABLE = 10754 +ER_ERROR_ENABLING_KEYS = 10755 +ER_CHECKING_TABLE = 10756 +ER_RECOVERING_TABLE = 10757 +ER_CANT_CREATE_TABLE_SHARE_FROM_FRM = 10758 +ER_CANT_LOCK_TABLE = 10759 +ER_CANT_ALLOC_TABLE_OBJECT = 10760 +ER_CANT_CREATE_HANDLER_OBJECT_FOR_TABLE = 10761 +ER_CANT_SET_HANDLER_REFERENCE_FOR_TABLE = 10762 +ER_CANT_LOCK_TABLESPACE = 10763 +ER_CANT_UPGRADE_GENERATED_COLUMNS_TO_DD = 10764 +ER_DD_ERROR_CREATING_ENTRY = 10765 +ER_DD_CANT_FETCH_TABLE_DATA = 10766 +ER_DD_CANT_FIX_SE_DATA = 10767 +ER_DD_CANT_CREATE_SP = 10768 +ER_CANT_OPEN_DB_OPT_USING_DEFAULT_CHARSET = 10769 +ER_CANT_CREATE_CACHE_FOR_DB_OPT = 10770 +ER_CANT_IDENTIFY_CHARSET_USING_DEFAULT = 10771 +ER_DB_OPT_NOT_FOUND_USING_DEFAULT_CHARSET = 10772 +ER_EVENT_CANT_GET_TIMEZONE_FROM_FIELD = 10773 +ER_EVENT_CANT_FIND_TIMEZONE = 10774 +ER_EVENT_CANT_GET_CHARSET = 10775 +ER_EVENT_CANT_GET_COLLATION = 10776 +ER_EVENT_CANT_OPEN_TABLE_MYSQL_EVENT = 10777 +ER_CANT_PARSE_STORED_ROUTINE_BODY = 10778 +ER_CANT_OPEN_TABLE_MYSQL_PROC = 10779 +ER_CANT_READ_TABLE_MYSQL_PROC = 10780 +ER_FILE_EXISTS_DURING_UPGRADE = 10781 +ER_CANT_OPEN_DATADIR_AFTER_UPGRADE_FAILURE = 10782 +ER_CANT_SET_PATH_FOR = 10783 +ER_CANT_OPEN_DIR = 10784 +ER_NDB_EMPTY_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10785 +ER_NDB_CANT_PARSE_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10786 +ER_NDB_INVALID_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10787 +ER_NDB_DUPLICATE_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10788 +ER_NDB_POOL_SIZE_MUST_MATCH_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10789 +ER_NDB_NODEID_NOT_FIRST_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10790 +ER_NDB_USING_NODEID = 10791 +ER_NDB_CANT_ALLOC_GLOBAL_NDB_CLUSTER_CONNECTION = 10792 +ER_NDB_CANT_ALLOC_GLOBAL_NDB_OBJECT = 10793 +ER_NDB_USING_NODEID_LIST = 10794 +ER_NDB_CANT_ALLOC_NDB_CLUSTER_CONNECTION = 10795 +ER_NDB_STARTING_CONNECT_THREAD = 10796 +ER_NDB_NODE_INFO = 10797 +ER_NDB_CANT_START_CONNECT_THREAD = 10798 +ER_NDB_GENERIC_ERROR = 10799 +ER_NDB_CPU_MASK_TOO_SHORT = 10800 +ER_EVENT_ERROR_CREATING_QUERY_TO_WRITE_TO_BINLOG = 10801 +ER_EVENT_SCHEDULER_ERROR_LOADING_FROM_DB = 10802 +ER_EVENT_SCHEDULER_ERROR_GETTING_EVENT_OBJECT = 10803 +ER_EVENT_SCHEDULER_GOT_BAD_DATA_FROM_TABLE = 10804 +ER_EVENT_CANT_GET_LOCK_FOR_DROPPING_EVENT = 10805 +ER_EVENT_UNABLE_TO_DROP_EVENT = 10806 +ER_BINLOG_ATTACHING_THREAD_MEMORY_FINALLY_AVAILABLE = 10807 +ER_BINLOG_CANT_RESIZE_CACHE = 10808 +ER_BINLOG_FILE_BEING_READ_NOT_PURGED = 10809 +ER_BINLOG_IO_ERROR_READING_HEADER = 10810 +ER_BINLOG_CANT_OPEN_LOG = 10811 +ER_BINLOG_CANT_CREATE_CACHE_FOR_LOG = 10812 +ER_BINLOG_FILE_EXTENSION_NUMBER_EXHAUSTED = 10813 +ER_BINLOG_FILE_NAME_TOO_LONG = 10814 +ER_BINLOG_FILE_EXTENSION_NUMBER_RUNNING_LOW = 10815 +ER_BINLOG_CANT_OPEN_FOR_LOGGING = 10816 +ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE = 10817 +ER_BINLOG_ERROR_READING_GTIDS_FROM_RELAY_LOG = 10818 +ER_BINLOG_EVENTS_READ_FROM_RELAY_LOG_INFO = 10819 +ER_BINLOG_ERROR_READING_GTIDS_FROM_BINARY_LOG = 10820 +ER_BINLOG_EVENTS_READ_FROM_BINLOG_INFO = 10821 +ER_BINLOG_CANT_GENERATE_NEW_FILE_NAME = 10822 +ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE_IN_OPEN = 10823 +ER_BINLOG_CANT_USE_FOR_LOGGING = 10824 +ER_BINLOG_FAILED_TO_CLOSE_INDEX_FILE_WHILE_REBUILDING = 10825 +ER_BINLOG_FAILED_TO_DELETE_INDEX_FILE_WHILE_REBUILDING = 10826 +ER_BINLOG_FAILED_TO_RENAME_INDEX_FILE_WHILE_REBUILDING = 10827 +ER_BINLOG_FAILED_TO_OPEN_INDEX_FILE_AFTER_REBUILDING = 10828 +ER_BINLOG_CANT_APPEND_LOG_TO_TMP_INDEX = 10829 +ER_BINLOG_CANT_LOCATE_OLD_BINLOG_OR_RELAY_LOG_FILES = 10830 +ER_BINLOG_CANT_DELETE_FILE = 10831 +ER_BINLOG_CANT_SET_TMP_INDEX_NAME = 10832 +ER_BINLOG_FAILED_TO_OPEN_TEMPORARY_INDEX_FILE = 10833 +ER_BINLOG_ERROR_GETTING_NEXT_LOG_FROM_INDEX = 10834 +ER_BINLOG_CANT_OPEN_TMP_INDEX = 10835 +ER_BINLOG_CANT_COPY_INDEX_TO_TMP = 10836 +ER_BINLOG_CANT_CLOSE_TMP_INDEX = 10837 +ER_BINLOG_CANT_MOVE_TMP_TO_INDEX = 10838 +ER_BINLOG_PURGE_LOGS_CALLED_WITH_FILE_NOT_IN_INDEX = 10839 +ER_BINLOG_PURGE_LOGS_CANT_SYNC_INDEX_FILE = 10840 +ER_BINLOG_PURGE_LOGS_CANT_COPY_TO_REGISTER_FILE = 10841 +ER_BINLOG_PURGE_LOGS_CANT_FLUSH_REGISTER_FILE = 10842 +ER_BINLOG_PURGE_LOGS_CANT_UPDATE_INDEX_FILE = 10843 +ER_BINLOG_PURGE_LOGS_FAILED_TO_PURGE_LOG = 10844 +ER_BINLOG_FAILED_TO_SET_PURGE_INDEX_FILE_NAME = 10845 +ER_BINLOG_FAILED_TO_OPEN_REGISTER_FILE = 10846 +ER_BINLOG_FAILED_TO_REINIT_REGISTER_FILE = 10847 +ER_BINLOG_FAILED_TO_READ_REGISTER_FILE = 10848 +ER_CANT_STAT_FILE = 10849 +ER_BINLOG_CANT_DELETE_LOG_FILE_DOES_INDEX_MATCH_FILES = 10850 +ER_BINLOG_CANT_DELETE_FILE_AND_READ_BINLOG_INDEX = 10851 +ER_BINLOG_FAILED_TO_DELETE_LOG_FILE = 10852 +ER_BINLOG_LOGGING_INCIDENT_TO_STOP_SLAVES = 10853 +ER_BINLOG_CANT_FIND_LOG_IN_INDEX = 10854 +ER_BINLOG_RECOVERING_AFTER_CRASH_USING = 10855 +ER_BINLOG_CANT_OPEN_CRASHED_BINLOG = 10856 +ER_BINLOG_CANT_TRIM_CRASHED_BINLOG = 10857 +ER_BINLOG_CRASHED_BINLOG_TRIMMED = 10858 +ER_BINLOG_CANT_CLEAR_IN_USE_FLAG_FOR_CRASHED_BINLOG = 10859 +ER_BINLOG_FAILED_TO_RUN_AFTER_SYNC_HOOK = 10860 +ER_TURNING_LOGGING_OFF_FOR_THE_DURATION = 10861 +ER_BINLOG_FAILED_TO_RUN_AFTER_FLUSH_HOOK = 10862 +ER_BINLOG_CRASH_RECOVERY_FAILED = 10863 +ER_BINLOG_WARNING_SUPPRESSED = 10864 +ER_NDB_LOG_ENTRY = 10865 +ER_NDB_LOG_ENTRY_WITH_PREFIX = 10866 +ER_NDB_BINLOG_CANT_CREATE_PURGE_THD = 10867 +ER_INNODB_UNKNOWN_COLLATION = 10868 +ER_INNODB_INVALID_LOG_GROUP_HOME_DIR = 10869 +ER_INNODB_INVALID_INNODB_UNDO_DIRECTORY = 10870 +ER_INNODB_ILLEGAL_COLON_IN_POOL = 10871 +ER_INNODB_INVALID_PAGE_SIZE = 10872 +ER_INNODB_DIRTY_WATER_MARK_NOT_LOW = 10873 +ER_INNODB_IO_CAPACITY_EXCEEDS_MAX = 10874 +ER_INNODB_FILES_SAME = 10875 +ER_INNODB_UNREGISTERED_TRX_ACTIVE = 10876 +ER_INNODB_CLOSING_CONNECTION_ROLLS_BACK = 10877 +ER_INNODB_TRX_XLATION_TABLE_OOM = 10878 +ER_INNODB_CANT_FIND_INDEX_IN_INNODB_DD = 10879 +ER_INNODB_INDEX_COLUMN_INFO_UNLIKE_MYSQLS = 10880 +ER_INNODB_CANT_OPEN_TABLE = 10881 +ER_INNODB_CANT_BUILD_INDEX_XLATION_TABLE_FOR = 10882 +ER_INNODB_PK_NOT_IN_MYSQL = 10883 +ER_INNODB_PK_ONLY_IN_MYSQL = 10884 +ER_INNODB_CLUSTERED_INDEX_PRIVATE = 10885 +ER_INNODB_PARTITION_TABLE_LOWERCASED = 10886 +ER_ERRMSG_REPLACEMENT_DODGY = 10887 +ER_ERRMSG_REPLACEMENTS_FAILED = 10888 +ER_NPIPE_CANT_CREATE = 10889 +ER_PARTITION_MOVE_CREATED_DUPLICATE_ROW_PLEASE_FIX = 10890 +ER_AUDIT_CANT_ABORT_COMMAND = 10891 +ER_AUDIT_CANT_ABORT_EVENT = 10892 +ER_AUDIT_WARNING = 10893 +ER_NDB_NUMBER_OF_CHANNELS = 10894 +ER_NDB_SLAVE_PARALLEL_WORKERS = 10895 +ER_NDB_DISTRIBUTING_ERR = 10896 +ER_RPL_SLAVE_INSECURE_CHANGE_MASTER = 10897 +ER_RPL_SLAVE_FLUSH_RELAY_LOGS_NOT_ALLOWED = 10898 +ER_RPL_SLAVE_INCORRECT_CHANNEL = 10899 +ER_FAILED_TO_FIND_DL_ENTRY = 10900 +ER_FAILED_TO_OPEN_SHARED_LIBRARY = 10901 +ER_THREAD_PRIORITY_IGNORED = 10902 +ER_BINLOG_CACHE_SIZE_TOO_LARGE = 10903 +ER_BINLOG_STMT_CACHE_SIZE_TOO_LARGE = 10904 +ER_FAILED_TO_GENERATE_UNIQUE_LOGFILE = 10905 +ER_FAILED_TO_READ_FILE = 10906 +ER_FAILED_TO_WRITE_TO_FILE = 10907 +ER_BINLOG_UNSAFE_MESSAGE_AND_STATEMENT = 10908 +ER_FORCE_CLOSE_THREAD = 10909 +ER_SERVER_SHUTDOWN_COMPLETE = 10910 +ER_RPL_CANT_HAVE_SAME_BASENAME = 10911 +ER_RPL_GTID_MODE_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 10912 +ER_WARN_NO_SERVERID_SPECIFIED = 10913 +ER_ABORTING_USER_CONNECTION = 10914 +ER_SQL_MODE_MERGED_WITH_STRICT_MODE = 10915 +ER_GTID_PURGED_WAS_UPDATED = 10916 +ER_GTID_EXECUTED_WAS_UPDATED = 10917 +ER_DEPRECATE_MSG_WITH_REPLACEMENT = 10918 +ER_TRG_CREATION_CTX_NOT_SET = 10919 +ER_FILE_HAS_OLD_FORMAT = 10920 +ER_VIEW_CREATION_CTX_NOT_SET = 10921 +ER_TABLE_NAME_CAUSES_TOO_LONG_PATH = 10922 +ER_TABLE_UPGRADE_REQUIRED = 10923 +ER_GET_ERRNO_FROM_STORAGE_ENGINE = 10924 +ER_ACCESS_DENIED_ERROR_WITHOUT_PASSWORD = 10925 +ER_ACCESS_DENIED_ERROR_WITH_PASSWORD = 10926 +ER_ACCESS_DENIED_FOR_USER_ACCOUNT_LOCKED = 10927 +ER_MUST_CHANGE_EXPIRED_PASSWORD = 10928 +ER_SYSTEM_TABLES_NOT_SUPPORTED_BY_STORAGE_ENGINE = 10929 +ER_FILESORT_TERMINATED = 10930 +ER_SERVER_STARTUP_MSG = 10931 +ER_FAILED_TO_FIND_LOCALE_NAME = 10932 +ER_FAILED_TO_FIND_COLLATION_NAME = 10933 +ER_SERVER_OUT_OF_RESOURCES = 10934 +ER_SERVER_OUTOFMEMORY = 10935 +ER_INVALID_COLLATION_FOR_CHARSET = 10936 +ER_CANT_START_ERROR_LOG_SERVICE = 10937 +ER_CREATING_NEW_UUID_FIRST_START = 10938 +ER_FAILED_TO_GET_ABSOLUTE_PATH = 10939 +ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP = 10940 +ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_SHUTDOWN = 10941 +ER_DUP_FD_OPEN_FAILED = 10942 +ER_SYSTEM_VIEW_INIT_FAILED = 10943 +ER_RESOURCE_GROUP_POST_INIT_FAILED = 10944 +ER_RESOURCE_GROUP_SUBSYSTEM_INIT_FAILED = 10945 +ER_FAILED_START_MYSQLD_DAEMON = 10946 +ER_CANNOT_CHANGE_TO_ROOT_DIR = 10947 +ER_PERSISTENT_PRIVILEGES_BOOTSTRAP = 10948 +ER_BASEDIR_SET_TO = 10949 +ER_RPL_FILTER_ADD_WILD_DO_TABLE_FAILED = 10950 +ER_RPL_FILTER_ADD_WILD_IGNORE_TABLE_FAILED = 10951 +ER_PRIVILEGE_SYSTEM_INIT_FAILED = 10952 +ER_CANNOT_SET_LOG_ERROR_SERVICES = 10953 +ER_PERFSCHEMA_TABLES_INIT_FAILED = 10954 +ER_TX_EXTRACTION_ALGORITHM_FOR_BINLOG_TX_DEPEDENCY_TRACKING = 10955 +ER_INVALID_REPLICATION_TIMESTAMPS = 10956 +ER_RPL_TIMESTAMPS_RETURNED_TO_NORMAL = 10957 +ER_BINLOG_FILE_OPEN_FAILED = 10958 +ER_BINLOG_EVENT_WRITE_TO_STMT_CACHE_FAILED = 10959 +ER_SLAVE_RELAY_LOG_TRUNCATE_INFO = 10960 +ER_SLAVE_RELAY_LOG_PURGE_FAILED = 10961 +ER_RPL_SLAVE_FILTER_CREATE_FAILED = 10962 +ER_RPL_SLAVE_GLOBAL_FILTERS_COPY_FAILED = 10963 +ER_RPL_SLAVE_RESET_FILTER_OPTIONS = 10964 +ER_MISSING_GRANT_SYSTEM_TABLE = 10965 +ER_MISSING_ACL_SYSTEM_TABLE = 10966 +ER_ANONYMOUS_AUTH_ID_NOT_ALLOWED_IN_MANDATORY_ROLES = 10967 +ER_UNKNOWN_AUTH_ID_IN_MANDATORY_ROLE = 10968 +ER_WRITE_ROW_TO_PARTITION_FAILED = 10969 +ER_RESOURCE_GROUP_METADATA_UPDATE_SKIPPED = 10970 +ER_FAILED_TO_PERSIST_RESOURCE_GROUP_METADATA = 10971 +ER_FAILED_TO_DESERIALIZE_RESOURCE_GROUP = 10972 +ER_FAILED_TO_UPDATE_RESOURCE_GROUP = 10973 +ER_RESOURCE_GROUP_VALIDATION_FAILED = 10974 +ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP = 10975 +ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP_HASH = 10976 +ER_FAILED_TO_ADD_RESOURCE_GROUP_TO_MAP = 10977 +ER_RESOURCE_GROUP_IS_DISABLED = 10978 +ER_FAILED_TO_APPLY_RESOURCE_GROUP_CONTROLLER = 10979 +ER_FAILED_TO_ACQUIRE_LOCK_ON_RESOURCE_GROUP = 10980 +ER_PFS_NOTIFICATION_FUNCTION_REGISTER_FAILED = 10981 +ER_RES_GRP_SET_THR_AFFINITY_FAILED = 10982 +ER_RES_GRP_SET_THR_AFFINITY_TO_CPUS_FAILED = 10983 +ER_RES_GRP_THD_UNBIND_FROM_CPU_FAILED = 10984 +ER_RES_GRP_SET_THREAD_PRIORITY_FAILED = 10985 +ER_RES_GRP_FAILED_TO_DETERMINE_NICE_CAPABILITY = 10986 +ER_RES_GRP_FAILED_TO_GET_THREAD_HANDLE = 10987 +ER_RES_GRP_GET_THREAD_PRIO_NOT_SUPPORTED = 10988 +ER_RES_GRP_FAILED_DETERMINE_CPU_COUNT = 10989 +ER_RES_GRP_FEATURE_NOT_AVAILABLE = 10990 +ER_RES_GRP_INVALID_THREAD_PRIORITY = 10991 +ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_CPUID_FAILED = 10992 +ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_THREAD_FAILED = 10993 +ER_RES_GRP_SOLARIS_PROCESSOR_AFFINITY_FAILED = 10994 +ER_DD_UPGRADE_RENAME_IDX_STATS_FILE_FAILED = 10995 +ER_DD_UPGRADE_DD_OPEN_FAILED = 10996 +ER_DD_UPGRADE_FAILED_TO_FETCH_TABLESPACES = 10997 +ER_DD_UPGRADE_FAILED_TO_ACQUIRE_TABLESPACE = 10998 +ER_DD_UPGRADE_FAILED_TO_RESOLVE_TABLESPACE_ENGINE = 10999 +ER_FAILED_TO_CREATE_SDI_FOR_TABLESPACE = 11000 +ER_FAILED_TO_STORE_SDI_FOR_TABLESPACE = 11001 +ER_DD_UPGRADE_FAILED_TO_FETCH_TABLES = 11002 +ER_DD_UPGRADE_DD_POPULATED = 11003 +ER_DD_UPGRADE_INFO_FILE_OPEN_FAILED = 11004 +ER_DD_UPGRADE_INFO_FILE_CLOSE_FAILED = 11005 +ER_DD_UPGRADE_TABLESPACE_MIGRATION_FAILED = 11006 +ER_DD_UPGRADE_FAILED_TO_CREATE_TABLE_STATS = 11007 +ER_DD_UPGRADE_TABLE_STATS_MIGRATE_COMPLETED = 11008 +ER_DD_UPGRADE_FAILED_TO_CREATE_INDEX_STATS = 11009 +ER_DD_UPGRADE_INDEX_STATS_MIGRATE_COMPLETED = 11010 +ER_DD_UPGRADE_FAILED_FIND_VALID_DATA_DIR = 11011 +ER_DD_UPGRADE_START = 11012 +ER_DD_UPGRADE_FAILED_INIT_DD_SE = 11013 +ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_ABORT = 11014 +ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_CONTINUE = 11015 +ER_DD_UPGRADE_SE_LOGS_FAILED = 11016 +ER_DD_UPGRADE_SDI_INFO_UPDATE_FAILED = 11017 +ER_SKIP_UPDATING_METADATA_IN_SE_RO_MODE = 11018 +ER_CREATED_SYSTEM_WITH_VERSION = 11019 +ER_UNKNOWN_ERROR_DETECTED_IN_SE = 11020 +ER_READ_LOG_EVENT_FAILED = 11021 +ER_ROW_DATA_TOO_BIG_TO_WRITE_IN_BINLOG = 11022 +ER_FAILED_TO_CONSTRUCT_DROP_EVENT_QUERY = 11023 +ER_FAILED_TO_BINLOG_DROP_EVENT = 11024 +ER_FAILED_TO_START_SLAVE_THREAD = 11025 +ER_RPL_IO_THREAD_KILLED = 11026 +ER_SLAVE_RECONNECT_FAILED = 11027 +ER_SLAVE_KILLED_AFTER_RECONNECT = 11028 +ER_SLAVE_NOT_STARTED_ON_SOME_CHANNELS = 11029 +ER_FAILED_TO_ADD_RPL_FILTER = 11030 +ER_PER_CHANNEL_RPL_FILTER_CONF_FOR_GRP_RPL = 11031 +ER_RPL_FILTERS_NOT_ATTACHED_TO_CHANNEL = 11032 +ER_FAILED_TO_BUILD_DO_AND_IGNORE_TABLE_HASHES = 11033 +ER_CLONE_PLUGIN_NOT_LOADED = 11034 +ER_CLONE_HANDLER_EXISTS = 11035 +ER_FAILED_TO_CREATE_CLONE_HANDLER = 11036 +ER_CYCLE_TIMER_IS_NOT_AVAILABLE = 11037 +ER_NANOSECOND_TIMER_IS_NOT_AVAILABLE = 11038 +ER_MICROSECOND_TIMER_IS_NOT_AVAILABLE = 11039 +ER_PFS_MALLOC_ARRAY_OVERFLOW = 11040 +ER_PFS_MALLOC_ARRAY_OOM = 11041 +ER_INNODB_FAILED_TO_FIND_IDX_WITH_KEY_NO = 11042 +ER_INNODB_FAILED_TO_FIND_IDX = 11043 +ER_INNODB_FAILED_TO_FIND_IDX_FROM_DICT_CACHE = 11044 +ER_INNODB_ACTIVE_INDEX_CHANGE_FAILED = 11045 +ER_INNODB_DIFF_IN_REF_LEN = 11046 +ER_WRONG_TYPE_FOR_COLUMN_PREFIX_IDX_FLD = 11047 +ER_INNODB_CANNOT_CREATE_TABLE = 11048 +ER_INNODB_INTERNAL_INDEX = 11049 +ER_INNODB_IDX_CNT_MORE_THAN_DEFINED_IN_MYSQL = 11050 +ER_INNODB_IDX_CNT_FEWER_THAN_DEFINED_IN_MYSQL = 11051 +ER_INNODB_IDX_COLUMN_CNT_DIFF = 11052 +ER_INNODB_USE_MONITOR_GROUP_NAME = 11053 +ER_INNODB_MONITOR_DEFAULT_VALUE_NOT_DEFINED = 11054 +ER_INNODB_MONITOR_IS_ENABLED = 11055 +ER_INNODB_INVALID_MONITOR_COUNTER_NAME = 11056 +ER_WIN_LOAD_LIBRARY_FAILED = 11057 +ER_PARTITION_HANDLER_ADMIN_MSG = 11058 +ER_RPL_RLI_INIT_INFO_MSG = 11059 +ER_DD_UPGRADE_TABLE_INTACT_ERROR = 11060 +ER_SERVER_INIT_COMPILED_IN_COMMANDS = 11061 +ER_MYISAM_CHECK_METHOD_ERROR = 11062 +ER_MYISAM_CRASHED_ERROR = 11063 +ER_WAITPID_FAILED = 11064 +ER_FAILED_TO_FIND_MYSQLD_STATUS = 11065 +ER_INNODB_ERROR_LOGGER_MSG = 11066 +ER_INNODB_ERROR_LOGGER_FATAL_MSG = 11067 +ER_DEPRECATED_SYNTAX_WITH_REPLACEMENT = 11068 +ER_DEPRECATED_SYNTAX_NO_REPLACEMENT = 11069 +ER_DEPRECATE_MSG_NO_REPLACEMENT = 11070 +ER_LOG_PRINTF_MSG = 11071 +ER_BINLOG_LOGGING_NOT_POSSIBLE = 11072 +ER_FAILED_TO_SET_PERSISTED_OPTIONS = 11073 +ER_COMPONENTS_FAILED_TO_ACQUIRE_SERVICE_IMPLEMENTATION = 11074 +ER_RES_GRP_INVALID_VCPU_RANGE = 11075 +ER_RES_GRP_INVALID_VCPU_ID = 11076 +ER_ERROR_DURING_FLUSH_LOG_COMMIT_PHASE = 11077 +ER_DROP_DATABASE_FAILED_RMDIR_MANUALLY = 11078 +ER_EXPIRE_LOGS_DAYS_IGNORED = 11079 +ER_BINLOG_MALFORMED_OR_OLD_RELAY_LOG = 11080 +ER_DD_UPGRADE_VIEW_COLUMN_NAME_TOO_LONG = 11081 +ER_TABLE_NEEDS_DUMP_UPGRADE = 11082 +ER_DD_UPGRADE_FAILED_TO_UPDATE_VER_NO_IN_TABLESPACE = 11083 +ER_KEYRING_MIGRATION_FAILED = 11084 +ER_KEYRING_MIGRATION_SUCCESSFUL = 11085 +ER_RESTART_RECEIVED_INFO = 11086 +ER_LCTN_CHANGED = 11087 +ER_DD_INITIALIZE = 11088 +ER_DD_RESTART = 11089 +ER_DD_UPGRADE = 11090 +ER_DD_UPGRADE_OFF = 11091 +ER_DD_UPGRADE_VERSION_NOT_SUPPORTED = 11092 +ER_DD_UPGRADE_SCHEMA_UNAVAILABLE = 11093 +ER_DD_MINOR_DOWNGRADE = 11094 +ER_DD_MINOR_DOWNGRADE_VERSION_NOT_SUPPORTED = 11095 +ER_DD_NO_VERSION_FOUND = 11096 +ER_THREAD_POOL_NOT_SUPPORTED_ON_PLATFORM = 11097 +ER_THREAD_POOL_SIZE_TOO_LOW = 11098 +ER_THREAD_POOL_SIZE_TOO_HIGH = 11099 +ER_THREAD_POOL_ALGORITHM_INVALID = 11100 +ER_THREAD_POOL_INVALID_STALL_LIMIT = 11101 +ER_THREAD_POOL_INVALID_PRIO_KICKUP_TIMER = 11102 +ER_THREAD_POOL_MAX_UNUSED_THREADS_INVALID = 11103 +ER_THREAD_POOL_CON_HANDLER_INIT_FAILED = 11104 +ER_THREAD_POOL_INIT_FAILED = 11105 +ER_THREAD_POOL_PLUGIN_STARTED = 11106 +ER_THREAD_POOL_CANNOT_SET_THREAD_SPECIFIC_DATA = 11107 +ER_THREAD_POOL_FAILED_TO_CREATE_CONNECT_HANDLER_THD = 11108 +ER_THREAD_POOL_FAILED_TO_CREATE_THD_AND_AUTH_CONN = 11109 +ER_THREAD_POOL_FAILED_PROCESS_CONNECT_EVENT = 11110 +ER_THREAD_POOL_FAILED_TO_CREATE_POOL = 11111 +ER_THREAD_POOL_RATE_LIMITED_ERROR_MSGS = 11112 +ER_TRHEAD_POOL_LOW_LEVEL_INIT_FAILED = 11113 +ER_THREAD_POOL_LOW_LEVEL_REARM_FAILED = 11114 +ER_THREAD_POOL_BUFFER_TOO_SMALL = 11115 +ER_MECAB_NOT_SUPPORTED = 11116 +ER_MECAB_NOT_VERIFIED = 11117 +ER_MECAB_CREATING_MODEL = 11118 +ER_MECAB_FAILED_TO_CREATE_MODEL = 11119 +ER_MECAB_FAILED_TO_CREATE_TRIGGER = 11120 +ER_MECAB_UNSUPPORTED_CHARSET = 11121 +ER_MECAB_CHARSET_LOADED = 11122 +ER_MECAB_PARSE_FAILED = 11123 +ER_MECAB_OOM_WHILE_PARSING_TEXT = 11124 +ER_MECAB_CREATE_LATTICE_FAILED = 11125 +ER_SEMISYNC_TRACE_ENTER_FUNC = 11126 +ER_SEMISYNC_TRACE_EXIT_WITH_INT_EXIT_CODE = 11127 +ER_SEMISYNC_TRACE_EXIT_WITH_BOOL_EXIT_CODE = 11128 +ER_SEMISYNC_TRACE_EXIT = 11129 +ER_SEMISYNC_RPL_INIT_FOR_TRX = 11130 +ER_SEMISYNC_FAILED_TO_ALLOCATE_TRX_NODE = 11131 +ER_SEMISYNC_BINLOG_WRITE_OUT_OF_ORDER = 11132 +ER_SEMISYNC_INSERT_LOG_INFO_IN_ENTRY = 11133 +ER_SEMISYNC_PROBE_LOG_INFO_IN_ENTRY = 11134 +ER_SEMISYNC_CLEARED_ALL_ACTIVE_TRANSACTION_NODES = 11135 +ER_SEMISYNC_CLEARED_ACTIVE_TRANSACTION_TILL_POS = 11136 +ER_SEMISYNC_REPLY_MAGIC_NO_ERROR = 11137 +ER_SEMISYNC_REPLY_PKT_LENGTH_TOO_SMALL = 11138 +ER_SEMISYNC_REPLY_BINLOG_FILE_TOO_LARGE = 11139 +ER_SEMISYNC_SERVER_REPLY = 11140 +ER_SEMISYNC_FUNCTION_CALLED_TWICE = 11141 +ER_SEMISYNC_RPL_ENABLED_ON_MASTER = 11142 +ER_SEMISYNC_MASTER_OOM = 11143 +ER_SEMISYNC_DISABLED_ON_MASTER = 11144 +ER_SEMISYNC_FORCED_SHUTDOWN = 11145 +ER_SEMISYNC_MASTER_GOT_REPLY_AT_POS = 11146 +ER_SEMISYNC_MASTER_SIGNAL_ALL_WAITING_THREADS = 11147 +ER_SEMISYNC_MASTER_TRX_WAIT_POS = 11148 +ER_SEMISYNC_BINLOG_REPLY_IS_AHEAD = 11149 +ER_SEMISYNC_MOVE_BACK_WAIT_POS = 11150 +ER_SEMISYNC_INIT_WAIT_POS = 11151 +ER_SEMISYNC_WAIT_TIME_FOR_BINLOG_SENT = 11152 +ER_SEMISYNC_WAIT_FOR_BINLOG_TIMEDOUT = 11153 +ER_SEMISYNC_WAIT_TIME_ASSESSMENT_FOR_COMMIT_TRX_FAILED = 11154 +ER_SEMISYNC_RPL_SWITCHED_OFF = 11155 +ER_SEMISYNC_RPL_SWITCHED_ON = 11156 +ER_SEMISYNC_NO_SPACE_IN_THE_PKT = 11157 +ER_SEMISYNC_SYNC_HEADER_UPDATE_INFO = 11158 +ER_SEMISYNC_FAILED_TO_INSERT_TRX_NODE = 11159 +ER_SEMISYNC_TRX_SKIPPED_AT_POS = 11160 +ER_SEMISYNC_MASTER_FAILED_ON_NET_FLUSH = 11161 +ER_SEMISYNC_RECEIVED_ACK_IS_SMALLER = 11162 +ER_SEMISYNC_ADD_ACK_TO_SLOT = 11163 +ER_SEMISYNC_UPDATE_EXISTING_SLAVE_ACK = 11164 +ER_SEMISYNC_FAILED_TO_START_ACK_RECEIVER_THD = 11165 +ER_SEMISYNC_STARTING_ACK_RECEIVER_THD = 11166 +ER_SEMISYNC_FAILED_TO_WAIT_ON_DUMP_SOCKET = 11167 +ER_SEMISYNC_STOPPING_ACK_RECEIVER_THREAD = 11168 +ER_SEMISYNC_FAILED_REGISTER_SLAVE_TO_RECEIVER = 11169 +ER_SEMISYNC_START_BINLOG_DUMP_TO_SLAVE = 11170 +ER_SEMISYNC_STOP_BINLOG_DUMP_TO_SLAVE = 11171 +ER_SEMISYNC_UNREGISTER_TRX_OBSERVER_FAILED = 11172 +ER_SEMISYNC_UNREGISTER_BINLOG_STORAGE_OBSERVER_FAILED = 11173 +ER_SEMISYNC_UNREGISTER_BINLOG_TRANSMIT_OBSERVER_FAILED = 11174 +ER_SEMISYNC_UNREGISTERED_REPLICATOR = 11175 +ER_SEMISYNC_SOCKET_FD_TOO_LARGE = 11176 +ER_SEMISYNC_SLAVE_REPLY = 11177 +ER_SEMISYNC_MISSING_MAGIC_NO_FOR_SEMISYNC_PKT = 11178 +ER_SEMISYNC_SLAVE_START = 11179 +ER_SEMISYNC_SLAVE_REPLY_WITH_BINLOG_INFO = 11180 +ER_SEMISYNC_SLAVE_NET_FLUSH_REPLY_FAILED = 11181 +ER_SEMISYNC_SLAVE_SEND_REPLY_FAILED = 11182 +ER_SEMISYNC_EXECUTION_FAILED_ON_MASTER = 11183 +ER_SEMISYNC_NOT_SUPPORTED_BY_MASTER = 11184 +ER_SEMISYNC_SLAVE_SET_FAILED = 11185 +ER_SEMISYNC_FAILED_TO_STOP_ACK_RECEIVER_THD = 11186 +ER_FIREWALL_FAILED_TO_READ_FIREWALL_TABLES = 11187 +ER_FIREWALL_FAILED_TO_REG_DYNAMIC_PRIVILEGES = 11188 +ER_FIREWALL_RECORDING_STMT_WAS_TRUNCATED = 11189 +ER_FIREWALL_RECORDING_STMT_WITHOUT_TEXT = 11190 +ER_FIREWALL_SUSPICIOUS_STMT = 11191 +ER_FIREWALL_ACCESS_DENIED = 11192 +ER_FIREWALL_SKIPPED_UNKNOWN_USER_MODE = 11193 +ER_FIREWALL_RELOADING_CACHE = 11194 +ER_FIREWALL_RESET_FOR_USER = 11195 +ER_FIREWALL_STATUS_FLUSHED = 11196 +ER_KEYRING_LOGGER_ERROR_MSG = 11197 +ER_AUDIT_LOG_FILTER_IS_NOT_INSTALLED = 11198 +ER_AUDIT_LOG_SWITCHING_TO_INCLUDE_LIST = 11199 +ER_AUDIT_LOG_CANNOT_SET_LOG_POLICY_WITH_OTHER_POLICIES = 11200 +ER_AUDIT_LOG_ONLY_INCLUDE_LIST_USED = 11201 +ER_AUDIT_LOG_INDEX_MAP_CANNOT_ACCESS_DIR = 11202 +ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED = 11203 +ER_AUDIT_LOG_WRITER_DEST_FILE_ALREADY_EXISTS = 11204 +ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED_REMOVE_FILE_MANUALLY = 11205 +ER_AUDIT_LOG_WRITER_INCOMPLETE_FILE_RENAMED = 11206 +ER_AUDIT_LOG_WRITER_FAILED_TO_WRITE_TO_FILE = 11207 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_ENCRYPTION = 11208 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_COMPRESSION = 11209 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_CREATE_FILE = 11210 +ER_AUDIT_LOG_RENAME_LOG_FILE_BEFORE_FLUSH = 11211 +ER_AUDIT_LOG_FILTER_RESULT_MSG = 11212 +ER_AUDIT_LOG_JSON_READER_FAILED_TO_PARSE = 11213 +ER_AUDIT_LOG_JSON_READER_BUF_TOO_SMALL = 11214 +ER_AUDIT_LOG_JSON_READER_FAILED_TO_OPEN_FILE = 11215 +ER_AUDIT_LOG_JSON_READER_FILE_PARSING_ERROR = 11216 +ER_AUDIT_LOG_FILTER_INVALID_COLUMN_COUNT = 11217 +ER_AUDIT_LOG_FILTER_INVALID_COLUMN_DEFINITION = 11218 +ER_AUDIT_LOG_FILTER_FAILED_TO_STORE_TABLE_FLDS = 11219 +ER_AUDIT_LOG_FILTER_FAILED_TO_UPDATE_TABLE = 11220 +ER_AUDIT_LOG_FILTER_FAILED_TO_INSERT_INTO_TABLE = 11221 +ER_AUDIT_LOG_FILTER_FAILED_TO_DELETE_FROM_TABLE = 11222 +ER_AUDIT_LOG_FILTER_FAILED_TO_INIT_TABLE_FOR_READ = 11223 +ER_AUDIT_LOG_FILTER_FAILED_TO_READ_TABLE = 11224 +ER_AUDIT_LOG_FILTER_FAILED_TO_CLOSE_TABLE_AFTER_READING = 11225 +ER_AUDIT_LOG_FILTER_USER_AND_HOST_CANNOT_BE_EMPTY = 11226 +ER_AUDIT_LOG_FILTER_FLD_FILTERNAME_CANNOT_BE_EMPTY = 11227 +ER_VALIDATE_PWD_DICT_FILE_NOT_SPECIFIED = 11228 +ER_VALIDATE_PWD_DICT_FILE_NOT_LOADED = 11229 +ER_VALIDATE_PWD_DICT_FILE_TOO_BIG = 11230 +ER_VALIDATE_PWD_FAILED_TO_READ_DICT_FILE = 11231 +ER_VALIDATE_PWD_FAILED_TO_GET_FLD_FROM_SECURITY_CTX = 11232 +ER_VALIDATE_PWD_FAILED_TO_GET_SECURITY_CTX = 11233 +ER_VALIDATE_PWD_LENGTH_CHANGED = 11234 +ER_REWRITER_QUERY_ERROR_MSG = 11235 +ER_REWRITER_QUERY_FAILED = 11236 +ER_XPLUGIN_STARTUP_FAILED = 11237 +ER_XPLUGIN_SERVER_EXITING = 11238 +ER_XPLUGIN_SERVER_EXITED = 11239 +ER_XPLUGIN_USING_SSL_CONF_FROM_SERVER = 11240 +ER_XPLUGIN_USING_SSL_CONF_FROM_MYSQLX = 11241 +ER_XPLUGIN_FAILED_TO_USE_SSL_CONF = 11242 +ER_XPLUGIN_USING_SSL_FOR_TLS_CONNECTION = 11243 +ER_XPLUGIN_REFERENCE_TO_SECURE_CONN_WITH_XPLUGIN = 11244 +ER_XPLUGIN_ERROR_MSG = 11245 +ER_SHA_PWD_FAILED_TO_PARSE_AUTH_STRING = 11246 +ER_SHA_PWD_FAILED_TO_GENERATE_MULTI_ROUND_HASH = 11247 +ER_SHA_PWD_AUTH_REQUIRES_RSA_OR_SSL = 11248 +ER_SHA_PWD_RSA_KEY_TOO_LONG = 11249 +ER_PLUGIN_COMMON_FAILED_TO_OPEN_FILTER_TABLES = 11250 +ER_PLUGIN_COMMON_FAILED_TO_OPEN_TABLE = 11251 +ER_AUTH_LDAP_ERROR_LOGGER_ERROR_MSG = 11252 +ER_CONN_CONTROL_ERROR_MSG = 11253 +ER_GRP_RPL_ERROR_MSG = 11254 +ER_SHA_PWD_SALT_FOR_USER_CORRUPT = 11255 +ER_SYS_VAR_COMPONENT_OOM = 11256 +ER_SYS_VAR_COMPONENT_VARIABLE_SET_READ_ONLY = 11257 +ER_SYS_VAR_COMPONENT_UNKNOWN_VARIABLE_TYPE = 11258 +ER_SYS_VAR_COMPONENT_FAILED_TO_PARSE_VARIABLE_OPTIONS = 11259 +ER_SYS_VAR_COMPONENT_FAILED_TO_MAKE_VARIABLE_PERSISTENT = 11260 +ER_COMPONENT_FILTER_CONFUSED = 11261 +ER_STOP_SLAVE_IO_THREAD_DISK_SPACE = 11262 +ER_LOG_FILE_CANNOT_OPEN = 11263 +OBSOLETE_ER_UNABLE_TO_COLLECT_INSTANCE_LOG_STATUS = 11264 +OBSOLETE_ER_DEPRECATED_UTF8_ALIAS = 11265 +OBSOLETE_ER_DEPRECATED_NATIONAL = 11266 +OBSOLETE_ER_SLAVE_POSSIBLY_DIVERGED_AFTER_DDL = 11267 +ER_PERSIST_OPTION_STATUS = 11268 +ER_NOT_IMPLEMENTED_GET_TABLESPACE_STATISTICS = 11269 +OBSOLETE_ER_UNABLE_TO_SET_OPTION = 11270 +OBSOLETE_ER_RESERVED_TABLESPACE_NAME = 11271 +ER_SSL_FIPS_MODE_ERROR = 11272 +ER_CONN_INIT_CONNECT_IGNORED = 11273 +ER_UNSUPPORTED_SQL_MODE = 11274 +ER_REWRITER_OOM = 11275 +ER_REWRITER_TABLE_MALFORMED_ERROR = 11276 +ER_REWRITER_LOAD_FAILED = 11277 +ER_REWRITER_READ_FAILED = 11278 +ER_CONN_CONTROL_EVENT_COORDINATOR_INIT_FAILED = 11279 +ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_UPDATE_FAILED = 11280 +ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_RESET_FAILED = 11281 +ER_CONN_CONTROL_INVALID_CONN_DELAY_TYPE = 11282 +ER_CONN_CONTROL_DELAY_ACTION_INIT_FAILED = 11283 +ER_CONN_CONTROL_FAILED_TO_SET_CONN_DELAY = 11284 +ER_CONN_CONTROL_FAILED_TO_UPDATE_CONN_DELAY_HASH = 11285 +ER_XPLUGIN_FORCE_STOP_CLIENT = 11286 +ER_XPLUGIN_MAX_AUTH_ATTEMPTS_REACHED = 11287 +ER_XPLUGIN_BUFFER_PAGE_ALLOC_FAILED = 11288 +ER_XPLUGIN_DETECTED_HANGING_CLIENTS = 11289 +ER_XPLUGIN_FAILED_TO_ACCEPT_CLIENT = 11290 +ER_XPLUGIN_FAILED_TO_SCHEDULE_CLIENT = 11291 +ER_XPLUGIN_FAILED_TO_PREPARE_IO_INTERFACES = 11292 +ER_XPLUGIN_SRV_SESSION_INIT_THREAD_FAILED = 11293 +ER_XPLUGIN_UNABLE_TO_USE_USER_SESSION_ACCOUNT = 11294 +ER_XPLUGIN_REFERENCE_TO_USER_ACCOUNT_DOC_SECTION = 11295 +ER_XPLUGIN_UNEXPECTED_EXCEPTION_DISPATCHING_CMD = 11296 +ER_XPLUGIN_EXCEPTION_IN_TASK_SCHEDULER = 11297 +ER_XPLUGIN_TASK_SCHEDULING_FAILED = 11298 +ER_XPLUGIN_EXCEPTION_IN_EVENT_LOOP = 11299 +ER_XPLUGIN_LISTENER_SETUP_FAILED = 11300 +ER_XPLUING_NET_STARTUP_FAILED = 11301 +ER_XPLUGIN_FAILED_AT_SSL_CONF = 11302 +ER_XPLUGIN_CLIENT_SSL_HANDSHAKE_FAILED = 11303 +ER_XPLUGIN_SSL_HANDSHAKE_WITH_SERVER_FAILED = 11304 +ER_XPLUGIN_FAILED_TO_CREATE_SESSION_FOR_CONN = 11305 +ER_XPLUGIN_FAILED_TO_INITIALIZE_SESSION = 11306 +ER_XPLUGIN_MESSAGE_TOO_LONG = 11307 +ER_XPLUGIN_UNINITIALIZED_MESSAGE = 11308 +ER_XPLUGIN_FAILED_TO_SET_MIN_NUMBER_OF_WORKERS = 11309 +ER_XPLUGIN_UNABLE_TO_ACCEPT_CONNECTION = 11310 +ER_XPLUGIN_ALL_IO_INTERFACES_DISABLED = 11311 +ER_XPLUGIN_INVALID_MSG_DURING_CLIENT_INIT = 11312 +ER_XPLUGIN_CLOSING_CLIENTS_ON_SHUTDOWN = 11313 +ER_XPLUGIN_ERROR_READING_SOCKET = 11314 +ER_XPLUGIN_PEER_DISCONNECTED_WHILE_READING_MSG_BODY = 11315 +ER_XPLUGIN_READ_FAILED_CLOSING_CONNECTION = 11316 +ER_XPLUGIN_INVALID_AUTH_METHOD = 11317 +ER_XPLUGIN_UNEXPECTED_MSG_DURING_AUTHENTICATION = 11318 +ER_XPLUGIN_ERROR_WRITING_TO_CLIENT = 11319 +ER_XPLUGIN_SCHEDULER_STARTED = 11320 +ER_XPLUGIN_SCHEDULER_STOPPED = 11321 +ER_XPLUGIN_LISTENER_SYS_VARIABLE_ERROR = 11322 +ER_XPLUGIN_LISTENER_STATUS_MSG = 11323 +ER_XPLUGIN_RETRYING_BIND_ON_PORT = 11324 +ER_XPLUGIN_SHUTDOWN_TRIGGERED = 11325 +ER_XPLUGIN_USER_ACCOUNT_WITH_ALL_PERMISSIONS = 11326 +ER_XPLUGIN_EXISTING_USER_ACCOUNT_WITH_INCOMPLETE_GRANTS = 11327 +ER_XPLUGIN_SERVER_STARTS_HANDLING_CONNECTIONS = 11328 +ER_XPLUGIN_SERVER_STOPPED_HANDLING_CONNECTIONS = 11329 +ER_XPLUGIN_FAILED_TO_INTERRUPT_SESSION = 11330 +ER_XPLUGIN_CLIENT_RELEASE_TRIGGERED = 11331 +ER_XPLUGIN_IPv6_AVAILABLE = 11332 +ER_XPLUGIN_UNIX_SOCKET_NOT_CONFIGURED = 11333 +ER_XPLUGIN_CLIENT_KILL_MSG = 11334 +ER_XPLUGIN_FAILED_TO_GET_SECURITY_CTX = 11335 +ER_XPLUGIN_FAILED_TO_SWITCH_SECURITY_CTX_TO_ROOT = 11336 +ER_XPLUGIN_FAILED_TO_CLOSE_SQL_SESSION = 11337 +ER_XPLUGIN_FAILED_TO_EXECUTE_ADMIN_CMD = 11338 +ER_XPLUGIN_EMPTY_ADMIN_CMD = 11339 +ER_XPLUGIN_FAILED_TO_GET_SYS_VAR = 11340 +ER_XPLUGIN_FAILED_TO_GET_CREATION_STMT = 11341 +ER_XPLUGIN_FAILED_TO_GET_ENGINE_INFO = 11342 +ER_XPLUGIN_FAIL_TO_GET_RESULT_DATA = 11343 +ER_XPLUGIN_CAPABILITY_EXPIRED_PASSWORD = 11344 +ER_XPLUGIN_FAILED_TO_SET_SO_REUSEADDR_FLAG = 11345 +ER_XPLUGIN_FAILED_TO_OPEN_INTERNAL_SESSION = 11346 +ER_XPLUGIN_FAILED_TO_SWITCH_CONTEXT = 11347 +ER_XPLUGIN_FAILED_TO_UNREGISTER_UDF = 11348 +ER_XPLUGIN_GET_PEER_ADDRESS_FAILED = 11349 +ER_XPLUGIN_CAPABILITY_CLIENT_INTERACTIVE_FAILED = 11350 +ER_XPLUGIN_FAILED_TO_RESET_IPV6_V6ONLY_FLAG = 11351 +ER_KEYRING_INVALID_KEY_TYPE = 11352 +ER_KEYRING_INVALID_KEY_LENGTH = 11353 +ER_KEYRING_FAILED_TO_CREATE_KEYRING_DIR = 11354 +ER_KEYRING_FILE_INIT_FAILED = 11355 +ER_KEYRING_INTERNAL_EXCEPTION_FAILED_FILE_INIT = 11356 +ER_KEYRING_FAILED_TO_GENERATE_KEY = 11357 +ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_INVALID_KEY = 11358 +ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_EMPTY_KEY_ID = 11359 +ER_KEYRING_OPERATION_FAILED_DUE_TO_INTERNAL_ERROR = 11360 +ER_KEYRING_INCORRECT_FILE = 11361 +ER_KEYRING_FOUND_MALFORMED_BACKUP_FILE = 11362 +ER_KEYRING_FAILED_TO_RESTORE_FROM_BACKUP_FILE = 11363 +ER_KEYRING_FAILED_TO_FLUSH_KEYRING_TO_FILE = 11364 +ER_KEYRING_FAILED_TO_GET_FILE_STAT = 11365 +ER_KEYRING_FAILED_TO_REMOVE_FILE = 11366 +ER_KEYRING_FAILED_TO_TRUNCATE_FILE = 11367 +ER_KEYRING_UNKNOWN_ERROR = 11368 +ER_KEYRING_FAILED_TO_SET_KEYRING_FILE_DATA = 11369 +ER_KEYRING_FILE_IO_ERROR = 11370 +ER_KEYRING_FAILED_TO_LOAD_KEYRING_CONTENT = 11371 +ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING = 11372 +ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING_BACKUP = 11373 +ER_KEYRING_KEY_FETCH_FAILED_DUE_TO_EMPTY_KEY_ID = 11374 +ER_KEYRING_FAILED_TO_REMOVE_KEY_DUE_TO_EMPTY_ID = 11375 +ER_KEYRING_OKV_INCORRECT_KEY_VAULT_CONFIGURED = 11376 +ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INCORRECT_CONF = 11377 +ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INTERNAL_ERROR = 11378 +ER_KEYRING_OKV_INVALID_KEY_TYPE = 11379 +ER_KEYRING_OKV_INVALID_KEY_LENGTH_FOR_CIPHER = 11380 +ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR = 11381 +ER_KEYRING_OKV_FAILED_TO_FIND_SERVER_ENTRY = 11382 +ER_KEYRING_OKV_FAILED_TO_FIND_STANDBY_SERVER_ENTRY = 11383 +ER_KEYRING_OKV_FAILED_TO_PARSE_CONF_FILE = 11384 +ER_KEYRING_OKV_FAILED_TO_LOAD_KEY_UID = 11385 +ER_KEYRING_OKV_FAILED_TO_INIT_SSL_LAYER = 11386 +ER_KEYRING_OKV_FAILED_TO_INIT_CLIENT = 11387 +ER_KEYRING_OKV_CONNECTION_TO_SERVER_FAILED = 11388 +ER_KEYRING_OKV_FAILED_TO_REMOVE_KEY = 11389 +ER_KEYRING_OKV_FAILED_TO_ADD_ATTRIBUTE = 11390 +ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY = 11391 +ER_KEYRING_OKV_FAILED_TO_STORE_KEY = 11392 +ER_KEYRING_OKV_FAILED_TO_ACTIVATE_KEYS = 11393 +ER_KEYRING_OKV_FAILED_TO_FETCH_KEY = 11394 +ER_KEYRING_OKV_FAILED_TO_STORE_OR_GENERATE_KEY = 11395 +ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY_SIGNATURE = 11396 +ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY = 11397 +ER_KEYRING_OKV_FAILED_TO_LOAD_SSL_TRUST_STORE = 11398 +ER_KEYRING_OKV_FAILED_TO_SET_CERTIFICATE_FILE = 11399 +ER_KEYRING_OKV_FAILED_TO_SET_KEY_FILE = 11400 +ER_KEYRING_OKV_KEY_MISMATCH = 11401 +ER_KEYRING_ENCRYPTED_FILE_INCORRECT_KEYRING_FILE = 11402 +ER_KEYRING_ENCRYPTED_FILE_DECRYPTION_FAILED = 11403 +ER_KEYRING_ENCRYPTED_FILE_FOUND_MALFORMED_BACKUP_FILE = 11404 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_RESTORE_KEYRING = 11405 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_FLUSH_KEYRING = 11406 +ER_KEYRING_ENCRYPTED_FILE_ENCRYPTION_FAILED = 11407 +ER_KEYRING_ENCRYPTED_FILE_INVALID_KEYRING_DIR = 11408 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_CREATE_KEYRING_DIR = 11409 +ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_INVALID = 11410 +ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_TOO_LONG = 11411 +ER_KEYRING_ENCRYPTED_FILE_INIT_FAILURE = 11412 +ER_KEYRING_ENCRYPTED_FILE_INIT_FAILED_DUE_TO_INTERNAL_ERROR = 11413 +ER_KEYRING_ENCRYPTED_FILE_GEN_KEY_FAILED_DUE_TO_INTERNAL_ERROR = 11414 +ER_KEYRING_AWS_FAILED_TO_SET_CMK_ID = 11415 +ER_KEYRING_AWS_FAILED_TO_SET_REGION = 11416 +ER_KEYRING_AWS_FAILED_TO_OPEN_CONF_FILE = 11417 +ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_ID_FROM_CONF_FILE = 11418 +ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_FROM_CONF_FILE = 11419 +ER_KEYRING_AWS_INVALID_CONF_FILE_PATH = 11420 +ER_KEYRING_AWS_INVALID_DATA_FILE_PATH = 11421 +ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DIR = 11422 +ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DATA_FILE = 11423 +ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_INTERNAL_ERROR = 11424 +ER_KEYRING_AWS_FAILED_TO_ACCESS_DATA_FILE = 11425 +ER_KEYRING_AWS_CMK_ID_NOT_SET = 11426 +ER_KEYRING_AWS_FAILED_TO_GET_KMS_CREDENTIAL_FROM_CONF_FILE = 11427 +ER_KEYRING_AWS_INIT_FAILURE = 11428 +ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_PLUGIN_INTERNAL_ERROR = 11429 +ER_KEYRING_AWS_INVALID_KEY_LENGTH_FOR_CIPHER = 11430 +ER_KEYRING_AWS_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR = 11431 +ER_KEYRING_AWS_INCORRECT_FILE = 11432 +ER_KEYRING_AWS_FOUND_MALFORMED_BACKUP_FILE = 11433 +ER_KEYRING_AWS_FAILED_TO_RESTORE_FROM_BACKUP_FILE = 11434 +ER_KEYRING_AWS_FAILED_TO_FLUSH_KEYRING_TO_FILE = 11435 +ER_KEYRING_AWS_INCORRECT_REGION = 11436 +ER_KEYRING_AWS_FAILED_TO_CONNECT_KMS = 11437 +ER_KEYRING_AWS_FAILED_TO_GENERATE_NEW_KEY = 11438 +ER_KEYRING_AWS_FAILED_TO_ENCRYPT_KEY = 11439 +ER_KEYRING_AWS_FAILED_TO_RE_ENCRYPT_KEY = 11440 +ER_KEYRING_AWS_FAILED_TO_DECRYPT_KEY = 11441 +ER_KEYRING_AWS_FAILED_TO_ROTATE_CMK = 11442 +ER_GRP_RPL_GTID_ALREADY_USED = 11443 +ER_GRP_RPL_APPLIER_THD_KILLED = 11444 +ER_GRP_RPL_EVENT_HANDLING_ERROR = 11445 +ER_GRP_RPL_ERROR_GTID_EXECUTION_INFO = 11446 +ER_GRP_RPL_CERTIFICATE_SIZE_ERROR = 11447 +ER_GRP_RPL_CREATE_APPLIER_CACHE_ERROR = 11448 +ER_GRP_RPL_UNBLOCK_WAITING_THD = 11449 +ER_GRP_RPL_APPLIER_PIPELINE_NOT_DISPOSED = 11450 +ER_GRP_RPL_APPLIER_THD_EXECUTION_ABORTED = 11451 +ER_GRP_RPL_APPLIER_EXECUTION_FATAL_ERROR = 11452 +ER_GRP_RPL_ERROR_STOPPING_CHANNELS = 11453 +ER_GRP_RPL_ERROR_SENDING_SINGLE_PRIMARY_MSSG = 11454 +ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_VER_ERROR = 11455 +ER_GRP_RPL_SIDNO_FETCH_ERROR = 11456 +ER_GRP_RPL_BROADCAST_COMMIT_TRANS_MSSG_FAILED = 11457 +ER_GRP_RPL_GROUP_NAME_PARSE_ERROR = 11458 +ER_GRP_RPL_ADD_GRPSID_TO_GRPGTIDSID_MAP_ERROR = 11459 +ER_GRP_RPL_UPDATE_GRPGTID_EXECUTED_ERROR = 11460 +ER_GRP_RPL_DONOR_TRANS_INFO_ERROR = 11461 +ER_GRP_RPL_SERVER_CONN_ERROR = 11462 +ER_GRP_RPL_ERROR_FETCHING_GTID_EXECUTED_SET = 11463 +ER_GRP_RPL_ADD_GTID_TO_GRPGTID_EXECUTED_ERROR = 11464 +ER_GRP_RPL_ERROR_FETCHING_GTID_SET = 11465 +ER_GRP_RPL_ADD_RETRIEVED_SET_TO_GRP_GTID_EXECUTED_ERROR = 11466 +ER_GRP_RPL_CERTIFICATION_INITIALIZATION_FAILURE = 11467 +ER_GRP_RPL_UPDATE_LAST_CONFLICT_FREE_TRANS_ERROR = 11468 +ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_REF_VER_ERROR = 11469 +ER_GRP_RPL_FETCH_TRANS_SIDNO_ERROR = 11470 +ER_GRP_RPL_ERROR_VERIFYING_SIDNO = 11471 +ER_GRP_RPL_CANT_GENERATE_GTID = 11472 +ER_GRP_RPL_INVALID_GTID_SET = 11473 +ER_GRP_RPL_UPDATE_GTID_SET_ERROR = 11474 +ER_GRP_RPL_RECEIVED_SET_MISSING_GTIDS = 11475 +ER_GRP_RPL_SKIP_COMPUTATION_TRANS_COMMITTED = 11476 +ER_GRP_RPL_NULL_PACKET = 11477 +ER_GRP_RPL_CANT_READ_GTID = 11478 +ER_GRP_RPL_PROCESS_GTID_SET_ERROR = 11479 +ER_GRP_RPL_PROCESS_INTERSECTION_GTID_SET_ERROR = 11480 +ER_GRP_RPL_SET_STABLE_TRANS_ERROR = 11481 +ER_GRP_RPL_CANT_READ_GRP_GTID_EXTRACTED = 11482 +ER_GRP_RPL_CANT_READ_WRITE_SET_ITEM = 11483 +ER_GRP_RPL_INIT_CERTIFICATION_INFO_FAILURE = 11484 +ER_GRP_RPL_CONFLICT_DETECTION_DISABLED = 11485 +ER_GRP_RPL_MSG_DISCARDED = 11486 +ER_GRP_RPL_MISSING_GRP_RPL_APPLIER = 11487 +ER_GRP_RPL_CERTIFIER_MSSG_PROCESS_ERROR = 11488 +ER_GRP_RPL_SRV_NOT_ONLINE = 11489 +ER_GRP_RPL_SRV_ONLINE = 11490 +ER_GRP_RPL_DISABLE_SRV_READ_MODE_RESTRICTED = 11491 +ER_GRP_RPL_MEM_ONLINE = 11492 +ER_GRP_RPL_MEM_UNREACHABLE = 11493 +ER_GRP_RPL_MEM_REACHABLE = 11494 +ER_GRP_RPL_SRV_BLOCKED = 11495 +ER_GRP_RPL_SRV_BLOCKED_FOR_SECS = 11496 +ER_GRP_RPL_CHANGE_GRP_MEM_NOT_PROCESSED = 11497 +ER_GRP_RPL_MEMBER_CONTACT_RESTORED = 11498 +ER_GRP_RPL_MEMBER_REMOVED = 11499 +ER_GRP_RPL_PRIMARY_MEMBER_LEFT_GRP = 11500 +ER_GRP_RPL_MEMBER_ADDED = 11501 +ER_GRP_RPL_MEMBER_EXIT_PLUGIN_ERROR = 11502 +ER_GRP_RPL_MEMBER_CHANGE = 11503 +ER_GRP_RPL_MEMBER_LEFT_GRP = 11504 +ER_GRP_RPL_MEMBER_EXPELLED = 11505 +ER_GRP_RPL_SESSION_OPEN_FAILED = 11506 +ER_GRP_RPL_NEW_PRIMARY_ELECTED = 11507 +ER_GRP_RPL_DISABLE_READ_ONLY_FAILED = 11508 +ER_GRP_RPL_ENABLE_READ_ONLY_FAILED = 11509 +ER_GRP_RPL_SRV_PRIMARY_MEM = 11510 +ER_GRP_RPL_SRV_SECONDARY_MEM = 11511 +ER_GRP_RPL_NO_SUITABLE_PRIMARY_MEM = 11512 +ER_GRP_RPL_SUPER_READ_ONLY_ACTIVATE_ERROR = 11513 +ER_GRP_RPL_EXCEEDS_AUTO_INC_VALUE = 11514 +ER_GRP_RPL_DATA_NOT_PROVIDED_BY_MEM = 11515 +ER_GRP_RPL_MEMBER_ALREADY_EXISTS = 11516 +ER_GRP_RPL_GRP_CHANGE_INFO_EXTRACT_ERROR = 11517 +ER_GRP_RPL_GTID_EXECUTED_EXTRACT_ERROR = 11518 +ER_GRP_RPL_GTID_SET_EXTRACT_ERROR = 11519 +ER_GRP_RPL_START_FAILED = 11520 +ER_GRP_RPL_MEMBER_VER_INCOMPATIBLE = 11521 +ER_GRP_RPL_TRANS_NOT_PRESENT_IN_GRP = 11522 +ER_GRP_RPL_TRANS_GREATER_THAN_GRP = 11523 +ER_GRP_RPL_MEMBER_VERSION_LOWER_THAN_GRP = 11524 +ER_GRP_RPL_LOCAL_GTID_SETS_PROCESS_ERROR = 11525 +ER_GRP_RPL_MEMBER_TRANS_GREATER_THAN_GRP = 11526 +ER_GRP_RPL_BLOCK_SIZE_DIFF_FROM_GRP = 11527 +ER_GRP_RPL_TRANS_WRITE_SET_EXTRACT_DIFF_FROM_GRP = 11528 +ER_GRP_RPL_MEMBER_CFG_INCOMPATIBLE_WITH_GRP_CFG = 11529 +ER_GRP_RPL_MEMBER_STOP_RPL_CHANNELS_ERROR = 11530 +ER_GRP_RPL_PURGE_APPLIER_LOGS = 11531 +ER_GRP_RPL_RESET_APPLIER_MODULE_LOGS_ERROR = 11532 +ER_GRP_RPL_APPLIER_THD_SETUP_ERROR = 11533 +ER_GRP_RPL_APPLIER_THD_START_ERROR = 11534 +ER_GRP_RPL_APPLIER_THD_STOP_ERROR = 11535 +ER_GRP_RPL_FETCH_TRANS_DATA_FAILED = 11536 +ER_GRP_RPL_SLAVE_IO_THD_PRIMARY_UNKNOWN = 11537 +ER_GRP_RPL_SALVE_IO_THD_ON_SECONDARY_MEMBER = 11538 +ER_GRP_RPL_SLAVE_SQL_THD_PRIMARY_UNKNOWN = 11539 +ER_GRP_RPL_SLAVE_SQL_THD_ON_SECONDARY_MEMBER = 11540 +ER_GRP_RPL_NEEDS_INNODB_TABLE = 11541 +ER_GRP_RPL_PRIMARY_KEY_NOT_DEFINED = 11542 +ER_GRP_RPL_FK_WITH_CASCADE_UNSUPPORTED = 11543 +ER_GRP_RPL_AUTO_INC_RESET = 11544 +ER_GRP_RPL_AUTO_INC_OFFSET_RESET = 11545 +ER_GRP_RPL_AUTO_INC_SET = 11546 +ER_GRP_RPL_AUTO_INC_OFFSET_SET = 11547 +ER_GRP_RPL_FETCH_TRANS_CONTEXT_FAILED = 11548 +ER_GRP_RPL_FETCH_FORMAT_DESC_LOG_EVENT_FAILED = 11549 +ER_GRP_RPL_FETCH_TRANS_CONTEXT_LOG_EVENT_FAILED = 11550 +ER_GRP_RPL_FETCH_SNAPSHOT_VERSION_FAILED = 11551 +ER_GRP_RPL_FETCH_GTID_LOG_EVENT_FAILED = 11552 +ER_GRP_RPL_UPDATE_SERV_CERTIFICATE_FAILED = 11553 +ER_GRP_RPL_ADD_GTID_INFO_WITH_LOCAL_GTID_FAILED = 11554 +ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_LOCAL_GTID_FAILED = 11555 +ER_GRP_RPL_NOTIFY_CERTIFICATION_OUTCOME_FAILED = 11556 +ER_GRP_RPL_ADD_GTID_INFO_WITH_REMOTE_GTID_FAILED = 11557 +ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_REMOTE_GTID_FAILED = 11558 +ER_GRP_RPL_FETCH_VIEW_CHANGE_LOG_EVENT_FAILED = 11559 +ER_GRP_RPL_CONTACT_WITH_SRV_FAILED = 11560 +ER_GRP_RPL_SRV_WAIT_TIME_OUT = 11561 +ER_GRP_RPL_FETCH_LOG_EVENT_FAILED = 11562 +ER_GRP_RPL_START_GRP_RPL_FAILED = 11563 +ER_GRP_RPL_CONN_INTERNAL_PLUGIN_FAIL = 11564 +ER_GRP_RPL_SUPER_READ_ON = 11565 +ER_GRP_RPL_SUPER_READ_OFF = 11566 +ER_GRP_RPL_KILLED_SESSION_ID = 11567 +ER_GRP_RPL_KILLED_FAILED_ID = 11568 +ER_GRP_RPL_INTERNAL_QUERY = 11569 +ER_GRP_RPL_COPY_FROM_EMPTY_STRING = 11570 +ER_GRP_RPL_QUERY_FAIL = 11571 +ER_GRP_RPL_CREATE_SESSION_UNABLE = 11572 +ER_GRP_RPL_MEMBER_NOT_FOUND = 11573 +ER_GRP_RPL_MAXIMUM_CONNECTION_RETRIES_REACHED = 11574 +ER_GRP_RPL_ALL_DONORS_LEFT_ABORT_RECOVERY = 11575 +ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_DONOR = 11576 +ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_ANOTHER_DONOR = 11577 +ER_GRP_RPL_NO_VALID_DONOR = 11578 +ER_GRP_RPL_CONFIG_RECOVERY = 11579 +ER_GRP_RPL_ESTABLISHING_CONN_GRP_REC_DONOR = 11580 +ER_GRP_RPL_CREATE_GRP_RPL_REC_CHANNEL = 11581 +ER_GRP_RPL_DONOR_SERVER_CONN = 11582 +ER_GRP_RPL_CHECK_STATUS_TABLE = 11583 +ER_GRP_RPL_STARTING_GRP_REC = 11584 +ER_GRP_RPL_DONOR_CONN_TERMINATION = 11585 +ER_GRP_RPL_STOPPING_GRP_REC = 11586 +ER_GRP_RPL_PURGE_REC = 11587 +ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_APPLIER = 11588 +ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_FAILOVER = 11589 +ER_GRP_RPL_FAILED_TO_NOTIFY_GRP_MEMBERSHIP_EVENT = 11590 +ER_GRP_RPL_FAILED_TO_BROADCAST_GRP_MEMBERSHIP_NOTIFICATION = 11591 +ER_GRP_RPL_FAILED_TO_BROADCAST_MEMBER_STATUS_NOTIFICATION = 11592 +ER_GRP_RPL_OOM_FAILED_TO_GENERATE_IDENTIFICATION_HASH = 11593 +ER_GRP_RPL_WRITE_IDENT_HASH_BASE64_ENCODING_FAILED = 11594 +ER_GRP_RPL_INVALID_BINLOG_FORMAT = 11595 +ER_GRP_RPL_BINLOG_CHECKSUM_SET = 11596 +ER_GRP_RPL_TRANS_WRITE_SET_EXTRACTION_NOT_SET = 11597 +ER_GRP_RPL_UNSUPPORTED_TRANS_ISOLATION = 11598 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_STOPPING = 11599 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_RECOVERING = 11600 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_ERROR_STATE = 11601 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_OFFLINE_MODE = 11602 +ER_GRP_RPL_MULTIPLE_CACHE_TYPE_NOT_SUPPORTED_FOR_SESSION = 11603 +ER_GRP_RPL_FAILED_TO_REINIT_BINLOG_CACHE_FOR_READ = 11604 +ER_GRP_RPL_FAILED_TO_CREATE_TRANS_CONTEXT = 11605 +ER_GRP_RPL_FAILED_TO_EXTRACT_TRANS_WRITE_SET = 11606 +ER_GRP_RPL_FAILED_TO_GATHER_TRANS_WRITE_SET = 11607 +ER_GRP_RPL_TRANS_SIZE_EXCEEDS_LIMIT = 11608 +ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_READ_FAILED = 11609 +ER_GRP_RPL_APPENDING_DATA_TO_INTERNAL_CACHE_FAILED = 11610 +ER_GRP_RPL_WRITE_TO_BINLOG_CACHE_FAILED = 11611 +ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_OUTCOME_NOTIFICTION = 11612 +ER_GRP_RPL_MSG_TOO_LONG_BROADCASTING_TRANS_FAILED = 11613 +ER_GRP_RPL_BROADCASTING_TRANS_TO_GRP_FAILED = 11614 +ER_GRP_RPL_ERROR_WHILE_WAITING_FOR_CONFLICT_DETECTION = 11615 +ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_WRITE_FAILED = 11616 +ER_GRP_RPL_FAILED_TO_CREATE_COMMIT_CACHE = 11617 +ER_GRP_RPL_REINIT_OF_COMMIT_CACHE_FOR_WRITE_FAILED = 11618 +ER_GRP_RPL_PREV_REC_SESSION_RUNNING = 11619 +ER_GRP_RPL_FATAL_REC_PROCESS = 11620 +ER_GRP_RPL_WHILE_STOPPING_REP_CHANNEL = 11621 +ER_GRP_RPL_UNABLE_TO_EVALUATE_APPLIER_STATUS = 11622 +ER_GRP_RPL_ONLY_ONE_SERVER_ALIVE = 11623 +ER_GRP_RPL_CERTIFICATION_REC_PROCESS = 11624 +ER_GRP_RPL_UNABLE_TO_ENSURE_EXECUTION_REC = 11625 +ER_GRP_RPL_WHILE_SENDING_MSG_REC = 11626 +ER_GRP_RPL_READ_UNABLE_FOR_SUPER_READ_ONLY = 11627 +ER_GRP_RPL_READ_UNABLE_FOR_READ_ONLY_SUPER_READ_ONLY = 11628 +ER_GRP_RPL_UNABLE_TO_RESET_SERVER_READ_MODE = 11629 +ER_GRP_RPL_UNABLE_TO_CERTIFY_PLUGIN_TRANS = 11630 +ER_GRP_RPL_UNBLOCK_CERTIFIED_TRANS = 11631 +ER_GRP_RPL_SERVER_WORKING_AS_SECONDARY = 11632 +ER_GRP_RPL_FAILED_TO_START_WITH_INVALID_SERVER_ID = 11633 +ER_GRP_RPL_FORCE_MEMBERS_MUST_BE_EMPTY = 11634 +ER_GRP_RPL_PLUGIN_STRUCT_INIT_NOT_POSSIBLE_ON_SERVER_START = 11635 +ER_GRP_RPL_FAILED_TO_ENABLE_SUPER_READ_ONLY_MODE = 11636 +ER_GRP_RPL_FAILED_TO_INIT_COMMUNICATION_ENGINE = 11637 +ER_GRP_RPL_FAILED_TO_START_ON_SECONDARY_WITH_ASYNC_CHANNELS = 11638 +ER_GRP_RPL_FAILED_TO_START_COMMUNICATION_ENGINE = 11639 +ER_GRP_RPL_TIMEOUT_ON_VIEW_AFTER_JOINING_GRP = 11640 +ER_GRP_RPL_FAILED_TO_CALL_GRP_COMMUNICATION_INTERFACE = 11641 +ER_GRP_RPL_MEMBER_SERVER_UUID_IS_INCOMPATIBLE_WITH_GRP = 11642 +ER_GRP_RPL_MEMBER_CONF_INFO = 11643 +ER_GRP_RPL_FAILED_TO_CONFIRM_IF_SERVER_LEFT_GRP = 11644 +ER_GRP_RPL_SERVER_IS_ALREADY_LEAVING = 11645 +ER_GRP_RPL_SERVER_ALREADY_LEFT = 11646 +ER_GRP_RPL_WAITING_FOR_VIEW_UPDATE = 11647 +ER_GRP_RPL_TIMEOUT_RECEIVING_VIEW_CHANGE_ON_SHUTDOWN = 11648 +ER_GRP_RPL_REQUESTING_NON_MEMBER_SERVER_TO_LEAVE = 11649 +ER_GRP_RPL_IS_STOPPING = 11650 +ER_GRP_RPL_IS_STOPPED = 11651 +ER_GRP_RPL_FAILED_TO_ENABLE_READ_ONLY_MODE_ON_SHUTDOWN = 11652 +ER_GRP_RPL_RECOVERY_MODULE_TERMINATION_TIMED_OUT_ON_SHUTDOWN = 11653 +ER_GRP_RPL_APPLIER_TERMINATION_TIMED_OUT_ON_SHUTDOWN = 11654 +ER_GRP_RPL_FAILED_TO_SHUTDOWN_REGISTRY_MODULE = 11655 +ER_GRP_RPL_FAILED_TO_INIT_HANDLER = 11656 +ER_GRP_RPL_FAILED_TO_REGISTER_SERVER_STATE_OBSERVER = 11657 +ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_STATE_OBSERVER = 11658 +ER_GRP_RPL_FAILED_TO_REGISTER_BINLOG_STATE_OBSERVER = 11659 +ER_GRP_RPL_FAILED_TO_START_ON_BOOT = 11660 +ER_GRP_RPL_FAILED_TO_STOP_ON_PLUGIN_UNINSTALL = 11661 +ER_GRP_RPL_FAILED_TO_UNREGISTER_SERVER_STATE_OBSERVER = 11662 +ER_GRP_RPL_FAILED_TO_UNREGISTER_TRANS_STATE_OBSERVER = 11663 +ER_GRP_RPL_FAILED_TO_UNREGISTER_BINLOG_STATE_OBSERVER = 11664 +ER_GRP_RPL_ALL_OBSERVERS_UNREGISTERED = 11665 +ER_GRP_RPL_FAILED_TO_PARSE_THE_GRP_NAME = 11666 +ER_GRP_RPL_FAILED_TO_GENERATE_SIDNO_FOR_GRP = 11667 +ER_GRP_RPL_APPLIER_NOT_STARTED_DUE_TO_RUNNING_PREV_SHUTDOWN = 11668 +ER_GRP_RPL_FAILED_TO_INIT_APPLIER_MODULE = 11669 +ER_GRP_RPL_APPLIER_INITIALIZED = 11670 +ER_GRP_RPL_COMMUNICATION_SSL_CONF_INFO = 11671 +ER_GRP_RPL_ABORTS_AS_SSL_NOT_SUPPORTED_BY_MYSQLD = 11672 +ER_GRP_RPL_SSL_DISABLED = 11673 +ER_GRP_RPL_UNABLE_TO_INIT_COMMUNICATION_ENGINE = 11674 +ER_GRP_RPL_BINLOG_DISABLED = 11675 +ER_GRP_RPL_GTID_MODE_OFF = 11676 +ER_GRP_RPL_LOG_SLAVE_UPDATES_NOT_SET = 11677 +ER_GRP_RPL_INVALID_TRANS_WRITE_SET_EXTRACTION_VALUE = 11678 +ER_GRP_RPL_RELAY_LOG_INFO_REPO_MUST_BE_TABLE = 11679 +ER_GRP_RPL_MASTER_INFO_REPO_MUST_BE_TABLE = 11680 +ER_GRP_RPL_INCORRECT_TYPE_SET_FOR_PARALLEL_APPLIER = 11681 +ER_GRP_RPL_SLAVE_PRESERVE_COMMIT_ORDER_NOT_SET = 11682 +ER_GRP_RPL_SINGLE_PRIM_MODE_NOT_ALLOWED_WITH_UPDATE_EVERYWHERE = 11683 +ER_GRP_RPL_MODULE_TERMINATE_ERROR = 11684 +ER_GRP_RPL_GRP_NAME_OPTION_MANDATORY = 11685 +ER_GRP_RPL_GRP_NAME_IS_TOO_LONG = 11686 +ER_GRP_RPL_GRP_NAME_IS_NOT_VALID_UUID = 11687 +ER_GRP_RPL_FLOW_CTRL_MIN_QUOTA_GREATER_THAN_MAX_QUOTA = 11688 +ER_GRP_RPL_FLOW_CTRL_MIN_RECOVERY_QUOTA_GREATER_THAN_MAX_QUOTA = 11689 +ER_GRP_RPL_FLOW_CTRL_MAX_QUOTA_SMALLER_THAN_MIN_QUOTAS = 11690 +ER_GRP_RPL_INVALID_SSL_RECOVERY_STRING = 11691 +ER_GRP_RPL_SUPPORTS_ONLY_ONE_FORCE_MEMBERS_SET = 11692 +ER_GRP_RPL_FORCE_MEMBERS_SET_UPDATE_NOT_ALLOWED = 11693 +ER_GRP_RPL_GRP_COMMUNICATION_INIT_WITH_CONF = 11694 +ER_GRP_RPL_UNKNOWN_GRP_RPL_APPLIER_PIPELINE_REQUESTED = 11695 +ER_GRP_RPL_FAILED_TO_BOOTSTRAP_EVENT_HANDLING_INFRASTRUCTURE = 11696 +ER_GRP_RPL_APPLIER_HANDLER_NOT_INITIALIZED = 11697 +ER_GRP_RPL_APPLIER_HANDLER_IS_IN_USE = 11698 +ER_GRP_RPL_APPLIER_HANDLER_ROLE_IS_IN_USE = 11699 +ER_GRP_RPL_FAILED_TO_INIT_APPLIER_HANDLER = 11700 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_INIT_SESSION_THREAD = 11701 +ER_GRP_RPL_SQL_SERVICE_COMM_SESSION_NOT_INITIALIZED = 11702 +ER_GRP_RPL_SQL_SERVICE_SERVER_SESSION_KILLED = 11703 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_RUN_SQL_QUERY = 11704 +ER_GRP_RPL_SQL_SERVICE_SERVER_INTERNAL_FAILURE = 11705 +ER_GRP_RPL_SQL_SERVICE_RETRIES_EXCEEDED_ON_SESSION_STATE = 11706 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_FETCH_SECURITY_CTX = 11707 +ER_GRP_RPL_SQL_SERVICE_SERVER_ACCESS_DENIED_FOR_USER = 11708 +ER_GRP_RPL_SQL_SERVICE_MAX_CONN_ERROR_FROM_SERVER = 11709 +ER_GRP_RPL_SQL_SERVICE_SERVER_ERROR_ON_CONN = 11710 +ER_GRP_RPL_UNREACHABLE_MAJORITY_TIMEOUT_FOR_MEMBER = 11711 +ER_GRP_RPL_SERVER_SET_TO_READ_ONLY_DUE_TO_ERRORS = 11712 +ER_GRP_RPL_GMS_LISTENER_FAILED_TO_LOG_NOTIFICATION = 11713 +ER_GRP_RPL_GRP_COMMUNICATION_ENG_INIT_FAILED = 11714 +ER_GRP_RPL_SET_GRP_COMMUNICATION_ENG_LOGGER_FAILED = 11715 +ER_GRP_RPL_DEBUG_OPTIONS = 11716 +ER_GRP_RPL_INVALID_DEBUG_OPTIONS = 11717 +ER_GRP_RPL_EXIT_GRP_GCS_ERROR = 11718 +ER_GRP_RPL_GRP_MEMBER_OFFLINE = 11719 +ER_GRP_RPL_GCS_INTERFACE_ERROR = 11720 +ER_GRP_RPL_FORCE_MEMBER_VALUE_SET_ERROR = 11721 +ER_GRP_RPL_FORCE_MEMBER_VALUE_SET = 11722 +ER_GRP_RPL_FORCE_MEMBER_VALUE_TIME_OUT = 11723 +ER_GRP_RPL_BROADCAST_COMMIT_MSSG_TOO_BIG = 11724 +ER_GRP_RPL_SEND_STATS_ERROR = 11725 +ER_GRP_RPL_MEMBER_STATS_INFO = 11726 +ER_GRP_RPL_FLOW_CONTROL_STATS = 11727 +ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT = 11728 +ER_GRP_RPL_PIPELINE_CREATE_FAILED = 11729 +ER_GRP_RPL_PIPELINE_REINIT_FAILED_WRITE = 11730 +ER_GRP_RPL_UNABLE_TO_CONVERT_EVENT_TO_PACKET = 11731 +ER_GRP_RPL_PIPELINE_FLUSH_FAIL = 11732 +ER_GRP_RPL_PIPELINE_REINIT_FAILED_READ = 11733 +ER_GRP_RPL_STOP_REP_CHANNEL = 11734 +ER_GRP_RPL_GCS_GR_ERROR_MSG = 11735 +ER_GRP_RPL_SLAVE_IO_THREAD_UNBLOCKED = 11736 +ER_GRP_RPL_SLAVE_IO_THREAD_ERROR_OUT = 11737 +ER_GRP_RPL_SLAVE_APPLIER_THREAD_UNBLOCKED = 11738 +ER_GRP_RPL_SLAVE_APPLIER_THREAD_ERROR_OUT = 11739 +ER_LDAP_AUTH_FAILED_TO_CREATE_OR_GET_CONNECTION = 11740 +ER_LDAP_AUTH_DEINIT_FAILED = 11741 +ER_LDAP_AUTH_SKIPPING_USER_GROUP_SEARCH = 11742 +ER_LDAP_AUTH_POOL_DISABLE_MAX_SIZE_ZERO = 11743 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT_CREATOR = 11744 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT = 11745 +ER_LDAP_AUTH_TLS_CONF = 11746 +ER_LDAP_AUTH_TLS_CONNECTION = 11747 +ER_LDAP_AUTH_CONN_POOL_NOT_CREATED = 11748 +ER_LDAP_AUTH_CONN_POOL_INITIALIZING = 11749 +ER_LDAP_AUTH_CONN_POOL_DEINITIALIZING = 11750 +ER_LDAP_AUTH_ZERO_MAX_POOL_SIZE_UNCHANGED = 11751 +ER_LDAP_AUTH_POOL_REINITIALIZING = 11752 +ER_LDAP_AUTH_FAILED_TO_WRITE_PACKET = 11753 +ER_LDAP_AUTH_SETTING_USERNAME = 11754 +ER_LDAP_AUTH_USER_AUTH_DATA = 11755 +ER_LDAP_AUTH_INFO_FOR_USER = 11756 +ER_LDAP_AUTH_USER_GROUP_SEARCH_INFO = 11757 +ER_LDAP_AUTH_GRP_SEARCH_SPECIAL_HDL = 11758 +ER_LDAP_AUTH_GRP_IS_FULL_DN = 11759 +ER_LDAP_AUTH_USER_NOT_FOUND_IN_ANY_GRP = 11760 +ER_LDAP_AUTH_USER_FOUND_IN_MANY_GRPS = 11761 +ER_LDAP_AUTH_USER_HAS_MULTIPLE_GRP_NAMES = 11762 +ER_LDAP_AUTH_SEARCHED_USER_GRP_NAME = 11763 +ER_LDAP_AUTH_OBJECT_CREATE_TIMESTAMP = 11764 +ER_LDAP_AUTH_CERTIFICATE_NAME = 11765 +ER_LDAP_AUTH_FAILED_TO_POOL_DEINIT = 11766 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_RECONSTRUCTING = 11767 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_INIT_STATE = 11768 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_DEINIT_STATE = 11769 +ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_POOL_IN_RECONSTRUCT_STATE = 11770 +ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_NOT_READY_POOL = 11771 +ER_LDAP_AUTH_FAILED_TO_GET_CONNECTION_AS_PLUGIN_NOT_READY = 11772 +ER_LDAP_AUTH_CONNECTION_POOL_INIT_FAILED = 11773 +ER_LDAP_AUTH_MAX_ALLOWED_CONNECTION_LIMIT_HIT = 11774 +ER_LDAP_AUTH_MAX_POOL_SIZE_SET_FAILED = 11775 +ER_LDAP_AUTH_PLUGIN_FAILED_TO_READ_PACKET = 11776 +ER_LDAP_AUTH_CREATING_LDAP_CONNECTION = 11777 +ER_LDAP_AUTH_GETTING_CONNECTION_FROM_POOL = 11778 +ER_LDAP_AUTH_RETURNING_CONNECTION_TO_POOL = 11779 +ER_LDAP_AUTH_SEARCH_USER_GROUP_ATTR_NOT_FOUND = 11780 +ER_LDAP_AUTH_LDAP_INFO_NULL = 11781 +ER_LDAP_AUTH_FREEING_CONNECTION = 11782 +ER_LDAP_AUTH_CONNECTION_PUSHED_TO_POOL = 11783 +ER_LDAP_AUTH_CONNECTION_CREATOR_ENTER = 11784 +ER_LDAP_AUTH_STARTING_TLS = 11785 +ER_LDAP_AUTH_CONNECTION_GET_LDAP_INFO_NULL = 11786 +ER_LDAP_AUTH_DELETING_CONNECTION_KEY = 11787 +ER_LDAP_AUTH_POOLED_CONNECTION_KEY = 11788 +ER_LDAP_AUTH_CREATE_CONNECTION_KEY = 11789 +ER_LDAP_AUTH_COMMUNICATION_HOST_INFO = 11790 +ER_LDAP_AUTH_METHOD_TO_CLIENT = 11791 +ER_LDAP_AUTH_SASL_REQUEST_FROM_CLIENT = 11792 +ER_LDAP_AUTH_SASL_PROCESS_SASL = 11793 +ER_LDAP_AUTH_SASL_BIND_SUCCESS_INFO = 11794 +ER_LDAP_AUTH_STARTED_FOR_USER = 11795 +ER_LDAP_AUTH_DISTINGUISHED_NAME = 11796 +ER_LDAP_AUTH_INIT_FAILED = 11797 +ER_LDAP_AUTH_OR_GROUP_RETRIEVAL_FAILED = 11798 +ER_LDAP_AUTH_USER_GROUP_SEARCH_FAILED = 11799 +ER_LDAP_AUTH_USER_BIND_FAILED = 11800 +ER_LDAP_AUTH_POOL_GET_FAILED_TO_CREATE_CONNECTION = 11801 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_CONNECTION = 11802 +ER_LDAP_AUTH_FAILED_TO_ESTABLISH_TLS_CONNECTION = 11803 +ER_LDAP_AUTH_FAILED_TO_SEARCH_DN = 11804 +ER_LDAP_AUTH_CONNECTION_POOL_REINIT_ENTER = 11805 +ER_SYSTEMD_NOTIFY_PATH_TOO_LONG = 11806 +ER_SYSTEMD_NOTIFY_CONNECT_FAILED = 11807 +ER_SYSTEMD_NOTIFY_WRITE_FAILED = 11808 +ER_FOUND_MISSING_GTIDS = 11809 +ER_PID_FILE_PRIV_DIRECTORY_INSECURE = 11810 +ER_CANT_CHECK_PID_PATH = 11811 +ER_VALIDATE_PWD_STATUS_VAR_REGISTRATION_FAILED = 11812 +ER_VALIDATE_PWD_STATUS_VAR_UNREGISTRATION_FAILED = 11813 +ER_VALIDATE_PWD_DICT_FILE_OPEN_FAILED = 11814 +ER_VALIDATE_PWD_COULD_BE_NULL = 11815 +ER_VALIDATE_PWD_STRING_CONV_TO_LOWERCASE_FAILED = 11816 +ER_VALIDATE_PWD_STRING_CONV_TO_BUFFER_FAILED = 11817 +ER_VALIDATE_PWD_STRING_HANDLER_MEM_ALLOCATION_FAILED = 11818 +ER_VALIDATE_PWD_STRONG_POLICY_DICT_FILE_UNSPECIFIED = 11819 +ER_VALIDATE_PWD_CONVERT_TO_BUFFER_FAILED = 11820 +ER_VALIDATE_PWD_VARIABLE_REGISTRATION_FAILED = 11821 +ER_VALIDATE_PWD_VARIABLE_UNREGISTRATION_FAILED = 11822 +ER_KEYRING_MIGRATION_EXTRA_OPTIONS = 11823 +OBSOLETE_ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 11824 +ER_IB_MSG_0 = 11825 +ER_IB_MSG_1 = 11826 +ER_IB_MSG_2 = 11827 +ER_IB_MSG_3 = 11828 +ER_IB_MSG_4 = 11829 +ER_IB_MSG_5 = 11830 +ER_IB_MSG_6 = 11831 +ER_IB_MSG_7 = 11832 +ER_IB_MSG_8 = 11833 +ER_IB_MSG_9 = 11834 +ER_IB_MSG_10 = 11835 +ER_IB_MSG_11 = 11836 +ER_IB_MSG_12 = 11837 +ER_IB_MSG_13 = 11838 +ER_IB_MSG_14 = 11839 +ER_IB_MSG_15 = 11840 +ER_IB_MSG_16 = 11841 +ER_IB_MSG_17 = 11842 +ER_IB_MSG_18 = 11843 +ER_IB_MSG_19 = 11844 +ER_IB_MSG_20 = 11845 +ER_IB_MSG_21 = 11846 +ER_IB_MSG_22 = 11847 +ER_IB_MSG_23 = 11848 +ER_IB_MSG_24 = 11849 +ER_IB_MSG_25 = 11850 +ER_IB_MSG_26 = 11851 +ER_IB_MSG_27 = 11852 +ER_IB_MSG_28 = 11853 +ER_IB_MSG_29 = 11854 +ER_IB_MSG_30 = 11855 +ER_IB_MSG_31 = 11856 +ER_IB_MSG_32 = 11857 +ER_IB_MSG_33 = 11858 +ER_IB_MSG_34 = 11859 +ER_IB_MSG_35 = 11860 +ER_IB_MSG_36 = 11861 +ER_IB_MSG_37 = 11862 +ER_IB_MSG_38 = 11863 +ER_IB_MSG_39 = 11864 +ER_IB_MSG_40 = 11865 +ER_IB_MSG_41 = 11866 +ER_IB_MSG_42 = 11867 +ER_IB_MSG_43 = 11868 +ER_IB_MSG_44 = 11869 +ER_IB_MSG_45 = 11870 +ER_IB_MSG_46 = 11871 +ER_IB_MSG_47 = 11872 +ER_IB_MSG_48 = 11873 +ER_IB_MSG_49 = 11874 +ER_IB_MSG_50 = 11875 +ER_IB_MSG_51 = 11876 +ER_IB_MSG_52 = 11877 +ER_IB_MSG_53 = 11878 +ER_IB_MSG_54 = 11879 +ER_IB_MSG_55 = 11880 +ER_IB_MSG_56 = 11881 +ER_IB_MSG_57 = 11882 +ER_IB_MSG_58 = 11883 +ER_IB_MSG_59 = 11884 +ER_IB_MSG_60 = 11885 +ER_IB_MSG_61 = 11886 +ER_IB_MSG_62 = 11887 +ER_IB_MSG_63 = 11888 +ER_IB_MSG_64 = 11889 +ER_IB_MSG_65 = 11890 +ER_IB_MSG_66 = 11891 +ER_IB_MSG_67 = 11892 +ER_IB_MSG_68 = 11893 +ER_IB_MSG_69 = 11894 +ER_IB_MSG_70 = 11895 +ER_IB_MSG_71 = 11896 +ER_IB_MSG_72 = 11897 +ER_IB_MSG_73 = 11898 +ER_IB_MSG_74 = 11899 +ER_IB_MSG_75 = 11900 +ER_IB_MSG_76 = 11901 +ER_IB_MSG_77 = 11902 +ER_IB_MSG_78 = 11903 +ER_IB_MSG_79 = 11904 +ER_IB_MSG_80 = 11905 +ER_IB_MSG_81 = 11906 +ER_IB_MSG_82 = 11907 +ER_IB_MSG_83 = 11908 +ER_IB_MSG_84 = 11909 +ER_IB_MSG_85 = 11910 +ER_IB_MSG_86 = 11911 +ER_IB_MSG_87 = 11912 +ER_IB_MSG_88 = 11913 +ER_IB_MSG_89 = 11914 +ER_IB_MSG_90 = 11915 +ER_IB_MSG_91 = 11916 +ER_IB_MSG_92 = 11917 +ER_IB_MSG_93 = 11918 +ER_IB_MSG_94 = 11919 +ER_IB_MSG_95 = 11920 +ER_IB_MSG_96 = 11921 +ER_IB_MSG_97 = 11922 +ER_IB_MSG_98 = 11923 +ER_IB_MSG_99 = 11924 +ER_IB_MSG_100 = 11925 +ER_IB_MSG_101 = 11926 +ER_IB_MSG_102 = 11927 +ER_IB_MSG_103 = 11928 +ER_IB_MSG_104 = 11929 +ER_IB_MSG_105 = 11930 +ER_IB_MSG_106 = 11931 +ER_IB_MSG_107 = 11932 +ER_IB_MSG_108 = 11933 +ER_IB_MSG_109 = 11934 +ER_IB_MSG_110 = 11935 +ER_IB_MSG_111 = 11936 +ER_IB_MSG_112 = 11937 +ER_IB_MSG_113 = 11938 +ER_IB_MSG_114 = 11939 +ER_IB_MSG_115 = 11940 +ER_IB_MSG_116 = 11941 +ER_IB_MSG_117 = 11942 +ER_IB_MSG_118 = 11943 +ER_IB_MSG_119 = 11944 +ER_IB_MSG_120 = 11945 +ER_IB_MSG_121 = 11946 +ER_IB_MSG_122 = 11947 +ER_IB_MSG_123 = 11948 +ER_IB_MSG_124 = 11949 +ER_IB_MSG_125 = 11950 +ER_IB_MSG_126 = 11951 +ER_IB_MSG_127 = 11952 +ER_IB_MSG_128 = 11953 +ER_IB_MSG_129 = 11954 +ER_IB_MSG_130 = 11955 +ER_IB_MSG_131 = 11956 +ER_IB_MSG_132 = 11957 +ER_IB_MSG_133 = 11958 +ER_IB_MSG_134 = 11959 +ER_IB_MSG_135 = 11960 +ER_IB_MSG_136 = 11961 +ER_IB_MSG_137 = 11962 +ER_IB_MSG_138 = 11963 +ER_IB_MSG_139 = 11964 +ER_IB_MSG_140 = 11965 +ER_IB_MSG_141 = 11966 +ER_IB_MSG_142 = 11967 +ER_IB_MSG_143 = 11968 +ER_IB_MSG_144 = 11969 +ER_IB_MSG_145 = 11970 +ER_IB_MSG_146 = 11971 +ER_IB_MSG_147 = 11972 +ER_IB_MSG_148 = 11973 +ER_IB_MSG_149 = 11974 +ER_IB_MSG_150 = 11975 +ER_IB_MSG_151 = 11976 +ER_IB_MSG_152 = 11977 +ER_IB_MSG_153 = 11978 +ER_IB_MSG_154 = 11979 +ER_IB_MSG_155 = 11980 +ER_IB_MSG_156 = 11981 +ER_IB_MSG_157 = 11982 +ER_IB_MSG_158 = 11983 +ER_IB_MSG_159 = 11984 +ER_IB_MSG_160 = 11985 +ER_IB_MSG_161 = 11986 +ER_IB_MSG_162 = 11987 +ER_IB_MSG_163 = 11988 +ER_IB_MSG_164 = 11989 +ER_IB_MSG_165 = 11990 +ER_IB_MSG_166 = 11991 +ER_IB_MSG_167 = 11992 +ER_IB_MSG_168 = 11993 +ER_IB_MSG_169 = 11994 +ER_IB_MSG_170 = 11995 +ER_IB_MSG_171 = 11996 +ER_IB_MSG_172 = 11997 +ER_IB_MSG_173 = 11998 +ER_IB_MSG_174 = 11999 +ER_IB_MSG_175 = 12000 +ER_IB_MSG_176 = 12001 +ER_IB_MSG_177 = 12002 +ER_IB_MSG_178 = 12003 +ER_IB_MSG_179 = 12004 +ER_IB_MSG_180 = 12005 +ER_IB_MSG_181 = 12006 +ER_IB_MSG_182 = 12007 +ER_IB_MSG_183 = 12008 +ER_IB_MSG_184 = 12009 +ER_IB_MSG_185 = 12010 +ER_IB_MSG_186 = 12011 +ER_IB_MSG_187 = 12012 +ER_IB_MSG_188 = 12013 +ER_IB_MSG_189 = 12014 +ER_IB_MSG_190 = 12015 +ER_IB_MSG_191 = 12016 +ER_IB_MSG_192 = 12017 +ER_IB_MSG_193 = 12018 +ER_IB_MSG_194 = 12019 +ER_IB_MSG_195 = 12020 +ER_IB_MSG_196 = 12021 +ER_IB_MSG_197 = 12022 +ER_IB_MSG_198 = 12023 +ER_IB_MSG_199 = 12024 +ER_IB_MSG_200 = 12025 +ER_IB_MSG_201 = 12026 +ER_IB_MSG_202 = 12027 +ER_IB_MSG_203 = 12028 +ER_IB_MSG_204 = 12029 +ER_IB_MSG_205 = 12030 +ER_IB_MSG_206 = 12031 +ER_IB_MSG_207 = 12032 +ER_IB_MSG_208 = 12033 +ER_IB_MSG_209 = 12034 +ER_IB_MSG_210 = 12035 +ER_IB_MSG_211 = 12036 +ER_IB_MSG_212 = 12037 +ER_IB_MSG_213 = 12038 +ER_IB_MSG_214 = 12039 +ER_IB_MSG_215 = 12040 +ER_IB_MSG_216 = 12041 +ER_IB_MSG_217 = 12042 +ER_IB_MSG_218 = 12043 +ER_IB_MSG_219 = 12044 +ER_IB_MSG_220 = 12045 +ER_IB_MSG_221 = 12046 +ER_IB_MSG_222 = 12047 +ER_IB_MSG_223 = 12048 +ER_IB_MSG_224 = 12049 +ER_IB_MSG_225 = 12050 +ER_IB_MSG_226 = 12051 +ER_IB_MSG_227 = 12052 +ER_IB_MSG_228 = 12053 +ER_IB_MSG_229 = 12054 +ER_IB_MSG_230 = 12055 +ER_IB_MSG_231 = 12056 +ER_IB_MSG_232 = 12057 +ER_IB_MSG_233 = 12058 +ER_IB_MSG_234 = 12059 +ER_IB_MSG_235 = 12060 +ER_IB_MSG_236 = 12061 +ER_IB_MSG_237 = 12062 +ER_IB_MSG_238 = 12063 +ER_IB_MSG_239 = 12064 +ER_IB_MSG_240 = 12065 +ER_IB_MSG_241 = 12066 +ER_IB_MSG_242 = 12067 +ER_IB_MSG_243 = 12068 +ER_IB_MSG_244 = 12069 +ER_IB_MSG_245 = 12070 +ER_IB_MSG_246 = 12071 +ER_IB_MSG_247 = 12072 +ER_IB_MSG_248 = 12073 +ER_IB_MSG_249 = 12074 +ER_IB_MSG_250 = 12075 +ER_IB_MSG_251 = 12076 +ER_IB_MSG_252 = 12077 +ER_IB_MSG_253 = 12078 +ER_IB_MSG_254 = 12079 +ER_IB_MSG_255 = 12080 +ER_IB_MSG_256 = 12081 +ER_IB_MSG_257 = 12082 +ER_IB_MSG_258 = 12083 +ER_IB_MSG_259 = 12084 +ER_IB_MSG_260 = 12085 +ER_IB_MSG_261 = 12086 +ER_IB_MSG_262 = 12087 +ER_IB_MSG_263 = 12088 +ER_IB_MSG_264 = 12089 +ER_IB_MSG_265 = 12090 +ER_IB_MSG_266 = 12091 +ER_IB_MSG_267 = 12092 +ER_IB_MSG_268 = 12093 +ER_IB_MSG_269 = 12094 +ER_IB_MSG_270 = 12095 +ER_IB_MSG_271 = 12096 +ER_IB_MSG_272 = 12097 +ER_IB_MSG_273 = 12098 +ER_IB_MSG_274 = 12099 +ER_IB_MSG_275 = 12100 +ER_IB_MSG_276 = 12101 +ER_IB_MSG_277 = 12102 +ER_IB_MSG_278 = 12103 +ER_IB_MSG_279 = 12104 +ER_IB_MSG_280 = 12105 +ER_IB_MSG_281 = 12106 +ER_IB_MSG_282 = 12107 +ER_IB_MSG_283 = 12108 +ER_IB_MSG_284 = 12109 +ER_IB_MSG_285 = 12110 +ER_IB_MSG_286 = 12111 +ER_IB_MSG_287 = 12112 +ER_IB_MSG_288 = 12113 +ER_IB_MSG_289 = 12114 +ER_IB_MSG_290 = 12115 +ER_IB_MSG_291 = 12116 +ER_IB_MSG_292 = 12117 +ER_IB_MSG_293 = 12118 +ER_IB_MSG_294 = 12119 +ER_IB_MSG_295 = 12120 +ER_IB_MSG_296 = 12121 +ER_IB_MSG_297 = 12122 +ER_IB_MSG_298 = 12123 +ER_IB_MSG_299 = 12124 +ER_IB_MSG_300 = 12125 +ER_IB_MSG_301 = 12126 +ER_IB_MSG_302 = 12127 +ER_IB_MSG_303 = 12128 +ER_IB_MSG_304 = 12129 +ER_IB_MSG_305 = 12130 +ER_IB_MSG_306 = 12131 +ER_IB_MSG_307 = 12132 +ER_IB_MSG_308 = 12133 +ER_IB_MSG_309 = 12134 +ER_IB_MSG_310 = 12135 +ER_IB_MSG_311 = 12136 +ER_IB_MSG_312 = 12137 +ER_IB_MSG_313 = 12138 +ER_IB_MSG_314 = 12139 +ER_IB_MSG_315 = 12140 +ER_IB_MSG_316 = 12141 +ER_IB_MSG_317 = 12142 +ER_IB_MSG_318 = 12143 +ER_IB_MSG_319 = 12144 +ER_IB_MSG_320 = 12145 +ER_IB_MSG_321 = 12146 +ER_IB_MSG_322 = 12147 +ER_IB_MSG_323 = 12148 +ER_IB_MSG_324 = 12149 +ER_IB_MSG_325 = 12150 +ER_IB_MSG_326 = 12151 +ER_IB_MSG_327 = 12152 +ER_IB_MSG_328 = 12153 +ER_IB_MSG_329 = 12154 +ER_IB_MSG_330 = 12155 +ER_IB_MSG_331 = 12156 +ER_IB_MSG_332 = 12157 +ER_IB_MSG_333 = 12158 +ER_IB_MSG_334 = 12159 +ER_IB_MSG_335 = 12160 +ER_IB_MSG_336 = 12161 +ER_IB_MSG_337 = 12162 +ER_IB_MSG_338 = 12163 +ER_IB_MSG_339 = 12164 +ER_IB_MSG_340 = 12165 +ER_IB_MSG_341 = 12166 +ER_IB_MSG_342 = 12167 +ER_IB_MSG_343 = 12168 +ER_IB_MSG_344 = 12169 +ER_IB_MSG_345 = 12170 +ER_IB_MSG_346 = 12171 +ER_IB_MSG_347 = 12172 +ER_IB_MSG_348 = 12173 +ER_IB_MSG_349 = 12174 +ER_IB_MSG_350 = 12175 +ER_IB_MSG_351 = 12176 +ER_IB_MSG_352 = 12177 +ER_IB_MSG_353 = 12178 +ER_IB_MSG_354 = 12179 +ER_IB_MSG_355 = 12180 +ER_IB_MSG_356 = 12181 +ER_IB_MSG_357 = 12182 +ER_IB_MSG_358 = 12183 +ER_IB_MSG_359 = 12184 +ER_IB_MSG_360 = 12185 +ER_IB_MSG_361 = 12186 +ER_IB_MSG_362 = 12187 +ER_IB_MSG_363 = 12188 +ER_IB_MSG_364 = 12189 +ER_IB_MSG_365 = 12190 +ER_IB_MSG_366 = 12191 +ER_IB_MSG_367 = 12192 +ER_IB_MSG_368 = 12193 +ER_IB_MSG_369 = 12194 +ER_IB_MSG_370 = 12195 +ER_IB_MSG_371 = 12196 +ER_IB_MSG_372 = 12197 +ER_IB_MSG_373 = 12198 +ER_IB_MSG_374 = 12199 +ER_IB_MSG_375 = 12200 +ER_IB_MSG_376 = 12201 +ER_IB_MSG_377 = 12202 +ER_IB_MSG_378 = 12203 +ER_IB_MSG_379 = 12204 +ER_IB_MSG_380 = 12205 +ER_IB_MSG_381 = 12206 +ER_IB_MSG_382 = 12207 +ER_IB_MSG_383 = 12208 +ER_IB_MSG_384 = 12209 +ER_IB_MSG_385 = 12210 +ER_IB_MSG_386 = 12211 +ER_IB_MSG_387 = 12212 +ER_IB_MSG_388 = 12213 +ER_IB_MSG_389 = 12214 +ER_IB_MSG_390 = 12215 +ER_IB_MSG_391 = 12216 +ER_IB_MSG_392 = 12217 +ER_IB_MSG_393 = 12218 +ER_IB_MSG_394 = 12219 +ER_IB_MSG_395 = 12220 +ER_IB_MSG_396 = 12221 +ER_IB_MSG_397 = 12222 +ER_IB_MSG_398 = 12223 +ER_IB_MSG_399 = 12224 +ER_IB_MSG_400 = 12225 +ER_IB_MSG_401 = 12226 +ER_IB_MSG_402 = 12227 +ER_IB_MSG_403 = 12228 +ER_IB_MSG_404 = 12229 +ER_IB_MSG_405 = 12230 +ER_IB_MSG_406 = 12231 +ER_IB_MSG_407 = 12232 +ER_IB_MSG_408 = 12233 +ER_IB_MSG_409 = 12234 +ER_IB_MSG_410 = 12235 +ER_IB_MSG_411 = 12236 +ER_IB_MSG_412 = 12237 +ER_IB_MSG_413 = 12238 +ER_IB_MSG_414 = 12239 +ER_IB_MSG_415 = 12240 +ER_IB_MSG_416 = 12241 +ER_IB_MSG_417 = 12242 +ER_IB_MSG_418 = 12243 +ER_IB_MSG_419 = 12244 +ER_IB_MSG_420 = 12245 +ER_IB_MSG_421 = 12246 +ER_IB_MSG_422 = 12247 +ER_IB_MSG_423 = 12248 +ER_IB_MSG_424 = 12249 +ER_IB_MSG_425 = 12250 +ER_IB_MSG_426 = 12251 +ER_IB_MSG_427 = 12252 +ER_IB_MSG_428 = 12253 +ER_IB_MSG_429 = 12254 +ER_IB_MSG_430 = 12255 +ER_IB_MSG_431 = 12256 +ER_IB_MSG_432 = 12257 +ER_IB_MSG_433 = 12258 +ER_IB_MSG_434 = 12259 +ER_IB_MSG_435 = 12260 +ER_IB_MSG_436 = 12261 +ER_IB_MSG_437 = 12262 +ER_IB_MSG_438 = 12263 +ER_IB_MSG_439 = 12264 +ER_IB_MSG_440 = 12265 +ER_IB_MSG_441 = 12266 +ER_IB_MSG_442 = 12267 +ER_IB_MSG_443 = 12268 +ER_IB_MSG_444 = 12269 +ER_IB_MSG_445 = 12270 +ER_IB_MSG_446 = 12271 +ER_IB_MSG_447 = 12272 +ER_IB_MSG_448 = 12273 +ER_IB_MSG_449 = 12274 +ER_IB_MSG_450 = 12275 +ER_IB_MSG_451 = 12276 +ER_IB_MSG_452 = 12277 +ER_IB_MSG_453 = 12278 +ER_IB_MSG_454 = 12279 +ER_IB_MSG_455 = 12280 +ER_IB_MSG_456 = 12281 +ER_IB_MSG_457 = 12282 +ER_IB_MSG_458 = 12283 +ER_IB_MSG_459 = 12284 +ER_IB_MSG_460 = 12285 +ER_IB_MSG_461 = 12286 +ER_IB_MSG_462 = 12287 +ER_IB_MSG_463 = 12288 +ER_IB_MSG_464 = 12289 +ER_IB_MSG_465 = 12290 +ER_IB_MSG_466 = 12291 +ER_IB_MSG_467 = 12292 +ER_IB_MSG_468 = 12293 +ER_IB_MSG_469 = 12294 +ER_IB_MSG_470 = 12295 +ER_IB_MSG_471 = 12296 +ER_IB_MSG_472 = 12297 +ER_IB_MSG_473 = 12298 +ER_IB_MSG_474 = 12299 +ER_IB_MSG_475 = 12300 +ER_IB_MSG_476 = 12301 +ER_IB_MSG_477 = 12302 +ER_IB_MSG_478 = 12303 +ER_IB_MSG_479 = 12304 +ER_IB_MSG_480 = 12305 +ER_IB_MSG_481 = 12306 +ER_IB_MSG_482 = 12307 +ER_IB_MSG_483 = 12308 +ER_IB_MSG_484 = 12309 +ER_IB_MSG_485 = 12310 +ER_IB_MSG_486 = 12311 +ER_IB_MSG_487 = 12312 +ER_IB_MSG_488 = 12313 +ER_IB_MSG_489 = 12314 +ER_IB_MSG_490 = 12315 +ER_IB_MSG_491 = 12316 +ER_IB_MSG_492 = 12317 +ER_IB_MSG_493 = 12318 +ER_IB_MSG_494 = 12319 +ER_IB_MSG_495 = 12320 +ER_IB_MSG_496 = 12321 +ER_IB_MSG_497 = 12322 +ER_IB_MSG_498 = 12323 +ER_IB_MSG_499 = 12324 +ER_IB_MSG_500 = 12325 +ER_IB_MSG_501 = 12326 +ER_IB_MSG_502 = 12327 +ER_IB_MSG_503 = 12328 +ER_IB_MSG_504 = 12329 +ER_IB_MSG_505 = 12330 +ER_IB_MSG_506 = 12331 +ER_IB_MSG_507 = 12332 +ER_IB_MSG_508 = 12333 +ER_IB_MSG_509 = 12334 +ER_IB_MSG_510 = 12335 +ER_IB_MSG_511 = 12336 +ER_IB_MSG_512 = 12337 +ER_IB_MSG_513 = 12338 +ER_IB_MSG_514 = 12339 +ER_IB_MSG_515 = 12340 +ER_IB_MSG_516 = 12341 +ER_IB_MSG_517 = 12342 +ER_IB_MSG_518 = 12343 +ER_IB_MSG_519 = 12344 +ER_IB_MSG_520 = 12345 +ER_IB_MSG_521 = 12346 +ER_IB_MSG_522 = 12347 +ER_IB_MSG_523 = 12348 +ER_IB_MSG_524 = 12349 +ER_IB_MSG_525 = 12350 +ER_IB_MSG_526 = 12351 +ER_IB_MSG_527 = 12352 +ER_IB_MSG_528 = 12353 +ER_IB_MSG_529 = 12354 +ER_IB_MSG_530 = 12355 +ER_IB_MSG_531 = 12356 +ER_IB_MSG_532 = 12357 +ER_IB_MSG_533 = 12358 +ER_IB_MSG_534 = 12359 +ER_IB_MSG_535 = 12360 +ER_IB_MSG_536 = 12361 +ER_IB_MSG_537 = 12362 +ER_IB_MSG_538 = 12363 +ER_IB_MSG_539 = 12364 +ER_IB_MSG_540 = 12365 +ER_IB_MSG_541 = 12366 +ER_IB_MSG_542 = 12367 +ER_IB_MSG_543 = 12368 +ER_IB_MSG_544 = 12369 +ER_IB_MSG_545 = 12370 +ER_IB_MSG_546 = 12371 +ER_IB_MSG_547 = 12372 +ER_IB_MSG_548 = 12373 +ER_IB_MSG_549 = 12374 +ER_IB_MSG_550 = 12375 +ER_IB_MSG_551 = 12376 +ER_IB_MSG_552 = 12377 +ER_IB_MSG_553 = 12378 +ER_IB_MSG_554 = 12379 +ER_IB_MSG_555 = 12380 +ER_IB_MSG_556 = 12381 +ER_IB_MSG_557 = 12382 +ER_IB_MSG_558 = 12383 +ER_IB_MSG_559 = 12384 +ER_IB_MSG_560 = 12385 +ER_IB_MSG_561 = 12386 +ER_IB_MSG_562 = 12387 +ER_IB_MSG_563 = 12388 +ER_IB_MSG_564 = 12389 +ER_IB_MSG_565 = 12390 +ER_IB_MSG_566 = 12391 +ER_IB_MSG_567 = 12392 +ER_IB_MSG_568 = 12393 +ER_IB_MSG_569 = 12394 +ER_IB_MSG_570 = 12395 +ER_IB_MSG_571 = 12396 +ER_IB_MSG_572 = 12397 +ER_IB_MSG_573 = 12398 +ER_IB_MSG_574 = 12399 +ER_IB_MSG_575 = 12400 +ER_IB_MSG_576 = 12401 +ER_IB_MSG_577 = 12402 +ER_IB_MSG_578 = 12403 +ER_IB_MSG_579 = 12404 +ER_IB_MSG_580 = 12405 +ER_IB_MSG_581 = 12406 +ER_IB_MSG_582 = 12407 +ER_IB_MSG_583 = 12408 +ER_IB_MSG_584 = 12409 +ER_IB_MSG_585 = 12410 +ER_IB_MSG_586 = 12411 +ER_IB_MSG_587 = 12412 +ER_IB_MSG_588 = 12413 +ER_IB_MSG_589 = 12414 +ER_IB_MSG_590 = 12415 +ER_IB_MSG_591 = 12416 +ER_IB_MSG_592 = 12417 +ER_IB_MSG_593 = 12418 +ER_IB_MSG_594 = 12419 +ER_IB_MSG_595 = 12420 +ER_IB_MSG_596 = 12421 +ER_IB_MSG_597 = 12422 +ER_IB_MSG_598 = 12423 +ER_IB_MSG_599 = 12424 +ER_IB_MSG_600 = 12425 +ER_IB_MSG_601 = 12426 +ER_IB_MSG_602 = 12427 +ER_IB_MSG_603 = 12428 +ER_IB_MSG_604 = 12429 +ER_IB_MSG_605 = 12430 +ER_IB_MSG_606 = 12431 +ER_IB_MSG_607 = 12432 +ER_IB_MSG_608 = 12433 +ER_IB_MSG_609 = 12434 +ER_IB_MSG_610 = 12435 +ER_IB_MSG_611 = 12436 +ER_IB_MSG_612 = 12437 +ER_IB_MSG_613 = 12438 +ER_IB_MSG_614 = 12439 +ER_IB_MSG_615 = 12440 +ER_IB_MSG_616 = 12441 +ER_IB_MSG_617 = 12442 +ER_IB_MSG_618 = 12443 +ER_IB_MSG_619 = 12444 +ER_IB_MSG_620 = 12445 +ER_IB_MSG_621 = 12446 +ER_IB_MSG_622 = 12447 +ER_IB_MSG_623 = 12448 +ER_IB_MSG_624 = 12449 +ER_IB_MSG_625 = 12450 +ER_IB_MSG_626 = 12451 +ER_IB_MSG_627 = 12452 +ER_IB_MSG_628 = 12453 +ER_IB_MSG_629 = 12454 +ER_IB_MSG_630 = 12455 +ER_IB_MSG_631 = 12456 +ER_IB_MSG_632 = 12457 +ER_IB_MSG_633 = 12458 +ER_IB_MSG_634 = 12459 +ER_IB_MSG_635 = 12460 +ER_IB_MSG_636 = 12461 +ER_IB_MSG_637 = 12462 +ER_IB_MSG_638 = 12463 +ER_IB_MSG_639 = 12464 +ER_IB_MSG_640 = 12465 +ER_IB_MSG_641 = 12466 +ER_IB_MSG_642 = 12467 +ER_IB_MSG_643 = 12468 +ER_IB_MSG_644 = 12469 +ER_IB_MSG_645 = 12470 +ER_IB_MSG_646 = 12471 +ER_IB_MSG_647 = 12472 +ER_IB_MSG_648 = 12473 +ER_IB_MSG_649 = 12474 +ER_IB_MSG_650 = 12475 +ER_IB_MSG_651 = 12476 +ER_IB_MSG_652 = 12477 +ER_IB_MSG_653 = 12478 +ER_IB_MSG_654 = 12479 +ER_IB_MSG_655 = 12480 +ER_IB_MSG_656 = 12481 +ER_IB_MSG_657 = 12482 +ER_IB_MSG_658 = 12483 +ER_IB_MSG_659 = 12484 +ER_IB_MSG_660 = 12485 +ER_IB_MSG_661 = 12486 +ER_IB_MSG_662 = 12487 +ER_IB_MSG_663 = 12488 +ER_IB_MSG_664 = 12489 +ER_IB_MSG_665 = 12490 +ER_IB_MSG_666 = 12491 +ER_IB_MSG_667 = 12492 +ER_IB_MSG_668 = 12493 +ER_IB_MSG_669 = 12494 +ER_IB_MSG_670 = 12495 +ER_IB_MSG_671 = 12496 +ER_IB_MSG_672 = 12497 +ER_IB_MSG_673 = 12498 +ER_IB_MSG_674 = 12499 +ER_IB_MSG_675 = 12500 +ER_IB_MSG_676 = 12501 +ER_IB_MSG_677 = 12502 +ER_IB_MSG_678 = 12503 +ER_IB_MSG_679 = 12504 +ER_IB_MSG_680 = 12505 +ER_IB_MSG_681 = 12506 +ER_IB_MSG_682 = 12507 +ER_IB_MSG_683 = 12508 +ER_IB_MSG_684 = 12509 +ER_IB_MSG_685 = 12510 +ER_IB_MSG_686 = 12511 +ER_IB_MSG_687 = 12512 +ER_IB_MSG_688 = 12513 +ER_IB_MSG_689 = 12514 +ER_IB_MSG_690 = 12515 +ER_IB_MSG_691 = 12516 +ER_IB_MSG_692 = 12517 +ER_IB_MSG_693 = 12518 +ER_IB_MSG_694 = 12519 +ER_IB_MSG_695 = 12520 +ER_IB_MSG_696 = 12521 +ER_IB_MSG_697 = 12522 +ER_IB_MSG_698 = 12523 +ER_IB_MSG_699 = 12524 +ER_IB_MSG_700 = 12525 +ER_IB_MSG_701 = 12526 +ER_IB_MSG_702 = 12527 +ER_IB_MSG_703 = 12528 +ER_IB_MSG_704 = 12529 +ER_IB_MSG_705 = 12530 +ER_IB_MSG_706 = 12531 +ER_IB_MSG_707 = 12532 +ER_IB_MSG_708 = 12533 +ER_IB_MSG_709 = 12534 +ER_IB_MSG_710 = 12535 +ER_IB_MSG_711 = 12536 +ER_IB_MSG_712 = 12537 +ER_IB_MSG_713 = 12538 +ER_IB_MSG_714 = 12539 +ER_IB_MSG_715 = 12540 +ER_IB_MSG_716 = 12541 +ER_IB_MSG_717 = 12542 +ER_IB_MSG_718 = 12543 +ER_IB_MSG_719 = 12544 +ER_IB_MSG_720 = 12545 +ER_IB_MSG_721 = 12546 +ER_IB_MSG_722 = 12547 +ER_IB_MSG_723 = 12548 +ER_IB_MSG_724 = 12549 +ER_IB_MSG_725 = 12550 +ER_IB_MSG_726 = 12551 +ER_IB_MSG_727 = 12552 +ER_IB_MSG_728 = 12553 +ER_IB_MSG_729 = 12554 +ER_IB_MSG_730 = 12555 +ER_IB_MSG_731 = 12556 +ER_IB_MSG_732 = 12557 +ER_IB_MSG_733 = 12558 +ER_IB_MSG_734 = 12559 +ER_IB_MSG_735 = 12560 +ER_IB_MSG_736 = 12561 +ER_IB_MSG_737 = 12562 +ER_IB_MSG_738 = 12563 +ER_IB_MSG_739 = 12564 +ER_IB_MSG_740 = 12565 +ER_IB_MSG_741 = 12566 +ER_IB_MSG_742 = 12567 +ER_IB_MSG_743 = 12568 +ER_IB_MSG_744 = 12569 +ER_IB_MSG_745 = 12570 +ER_IB_MSG_746 = 12571 +ER_IB_MSG_747 = 12572 +ER_IB_MSG_748 = 12573 +ER_IB_MSG_749 = 12574 +ER_IB_MSG_750 = 12575 +ER_IB_MSG_751 = 12576 +ER_IB_MSG_752 = 12577 +ER_IB_MSG_753 = 12578 +ER_IB_MSG_754 = 12579 +ER_IB_MSG_755 = 12580 +ER_IB_MSG_756 = 12581 +ER_IB_MSG_757 = 12582 +ER_IB_MSG_758 = 12583 +ER_IB_MSG_759 = 12584 +ER_IB_MSG_760 = 12585 +ER_IB_MSG_761 = 12586 +ER_IB_MSG_762 = 12587 +ER_IB_MSG_763 = 12588 +ER_IB_MSG_764 = 12589 +ER_IB_MSG_765 = 12590 +ER_IB_MSG_766 = 12591 +ER_IB_MSG_767 = 12592 +ER_IB_MSG_768 = 12593 +ER_IB_MSG_769 = 12594 +ER_IB_MSG_770 = 12595 +ER_IB_MSG_771 = 12596 +ER_IB_MSG_772 = 12597 +ER_IB_MSG_773 = 12598 +ER_IB_MSG_774 = 12599 +ER_IB_MSG_775 = 12600 +ER_IB_MSG_776 = 12601 +ER_IB_MSG_777 = 12602 +ER_IB_MSG_778 = 12603 +ER_IB_MSG_779 = 12604 +ER_IB_MSG_780 = 12605 +ER_IB_MSG_781 = 12606 +ER_IB_MSG_782 = 12607 +ER_IB_MSG_783 = 12608 +ER_IB_MSG_784 = 12609 +ER_IB_MSG_785 = 12610 +ER_IB_MSG_786 = 12611 +ER_IB_MSG_787 = 12612 +ER_IB_MSG_788 = 12613 +ER_IB_MSG_789 = 12614 +ER_IB_MSG_790 = 12615 +ER_IB_MSG_791 = 12616 +ER_IB_MSG_792 = 12617 +ER_IB_MSG_793 = 12618 +ER_IB_MSG_794 = 12619 +ER_IB_MSG_795 = 12620 +ER_IB_MSG_796 = 12621 +ER_IB_MSG_797 = 12622 +ER_IB_MSG_798 = 12623 +ER_IB_MSG_799 = 12624 +ER_IB_MSG_800 = 12625 +ER_IB_MSG_801 = 12626 +ER_IB_MSG_802 = 12627 +ER_IB_MSG_803 = 12628 +ER_IB_MSG_804 = 12629 +ER_IB_MSG_805 = 12630 +ER_IB_MSG_806 = 12631 +ER_IB_MSG_807 = 12632 +ER_IB_MSG_808 = 12633 +ER_IB_MSG_809 = 12634 +ER_IB_MSG_810 = 12635 +ER_IB_MSG_811 = 12636 +ER_IB_MSG_812 = 12637 +ER_IB_MSG_813 = 12638 +ER_IB_MSG_814 = 12639 +ER_IB_MSG_815 = 12640 +ER_IB_MSG_816 = 12641 +ER_IB_MSG_817 = 12642 +ER_IB_MSG_818 = 12643 +ER_IB_MSG_819 = 12644 +ER_IB_MSG_820 = 12645 +ER_IB_MSG_821 = 12646 +ER_IB_MSG_822 = 12647 +ER_IB_MSG_823 = 12648 +ER_IB_MSG_824 = 12649 +ER_IB_MSG_825 = 12650 +ER_IB_MSG_826 = 12651 +ER_IB_MSG_827 = 12652 +ER_IB_MSG_828 = 12653 +ER_IB_MSG_829 = 12654 +ER_IB_MSG_830 = 12655 +ER_IB_MSG_831 = 12656 +ER_IB_MSG_832 = 12657 +ER_IB_MSG_833 = 12658 +ER_IB_MSG_834 = 12659 +ER_IB_MSG_835 = 12660 +ER_IB_MSG_836 = 12661 +ER_IB_MSG_837 = 12662 +ER_IB_MSG_838 = 12663 +ER_IB_MSG_839 = 12664 +ER_IB_MSG_840 = 12665 +ER_IB_MSG_841 = 12666 +ER_IB_MSG_842 = 12667 +ER_IB_MSG_843 = 12668 +ER_IB_MSG_844 = 12669 +ER_IB_MSG_845 = 12670 +ER_IB_MSG_846 = 12671 +ER_IB_MSG_847 = 12672 +ER_IB_MSG_848 = 12673 +ER_IB_MSG_849 = 12674 +ER_IB_MSG_850 = 12675 +ER_IB_MSG_851 = 12676 +ER_IB_MSG_852 = 12677 +ER_IB_MSG_853 = 12678 +ER_IB_MSG_854 = 12679 +ER_IB_MSG_855 = 12680 +ER_IB_MSG_856 = 12681 +ER_IB_MSG_857 = 12682 +ER_IB_MSG_858 = 12683 +ER_IB_MSG_859 = 12684 +ER_IB_MSG_860 = 12685 +ER_IB_MSG_861 = 12686 +ER_IB_MSG_862 = 12687 +ER_IB_MSG_863 = 12688 +ER_IB_MSG_864 = 12689 +ER_IB_MSG_865 = 12690 +ER_IB_MSG_866 = 12691 +ER_IB_MSG_867 = 12692 +ER_IB_MSG_868 = 12693 +ER_IB_MSG_869 = 12694 +ER_IB_MSG_870 = 12695 +ER_IB_MSG_871 = 12696 +ER_IB_MSG_872 = 12697 +ER_IB_MSG_873 = 12698 +ER_IB_MSG_874 = 12699 +ER_IB_MSG_875 = 12700 +ER_IB_MSG_876 = 12701 +ER_IB_MSG_877 = 12702 +ER_IB_MSG_878 = 12703 +ER_IB_MSG_879 = 12704 +ER_IB_MSG_880 = 12705 +ER_IB_MSG_881 = 12706 +ER_IB_MSG_882 = 12707 +ER_IB_MSG_883 = 12708 +ER_IB_MSG_884 = 12709 +ER_IB_MSG_885 = 12710 +ER_IB_MSG_886 = 12711 +ER_IB_MSG_887 = 12712 +ER_IB_MSG_888 = 12713 +ER_IB_MSG_889 = 12714 +ER_IB_MSG_890 = 12715 +ER_IB_MSG_891 = 12716 +ER_IB_MSG_892 = 12717 +ER_IB_MSG_893 = 12718 +ER_IB_MSG_894 = 12719 +ER_IB_MSG_895 = 12720 +ER_IB_MSG_896 = 12721 +ER_IB_MSG_897 = 12722 +ER_IB_MSG_898 = 12723 +ER_IB_MSG_899 = 12724 +ER_IB_MSG_900 = 12725 +ER_IB_MSG_901 = 12726 +ER_IB_MSG_902 = 12727 +ER_IB_MSG_903 = 12728 +ER_IB_MSG_904 = 12729 +ER_IB_MSG_905 = 12730 +ER_IB_MSG_906 = 12731 +ER_IB_MSG_907 = 12732 +ER_IB_MSG_908 = 12733 +ER_IB_MSG_909 = 12734 +ER_IB_MSG_910 = 12735 +ER_IB_MSG_911 = 12736 +ER_IB_MSG_912 = 12737 +ER_IB_MSG_913 = 12738 +ER_IB_MSG_914 = 12739 +ER_IB_MSG_915 = 12740 +ER_IB_MSG_916 = 12741 +ER_IB_MSG_917 = 12742 +ER_IB_MSG_918 = 12743 +ER_IB_MSG_919 = 12744 +ER_IB_MSG_920 = 12745 +ER_IB_MSG_921 = 12746 +ER_IB_MSG_922 = 12747 +ER_IB_MSG_923 = 12748 +ER_IB_MSG_924 = 12749 +ER_IB_MSG_925 = 12750 +ER_IB_MSG_926 = 12751 +ER_IB_MSG_927 = 12752 +ER_IB_MSG_928 = 12753 +ER_IB_MSG_929 = 12754 +ER_IB_MSG_930 = 12755 +ER_IB_MSG_931 = 12756 +ER_IB_MSG_932 = 12757 +ER_IB_MSG_933 = 12758 +ER_IB_MSG_934 = 12759 +ER_IB_MSG_935 = 12760 +ER_IB_MSG_936 = 12761 +ER_IB_MSG_937 = 12762 +ER_IB_MSG_938 = 12763 +ER_IB_MSG_939 = 12764 +ER_IB_MSG_940 = 12765 +ER_IB_MSG_941 = 12766 +ER_IB_MSG_942 = 12767 +ER_IB_MSG_943 = 12768 +ER_IB_MSG_944 = 12769 +ER_IB_MSG_945 = 12770 +ER_IB_MSG_946 = 12771 +ER_IB_MSG_947 = 12772 +ER_IB_MSG_948 = 12773 +ER_IB_MSG_949 = 12774 +ER_IB_MSG_950 = 12775 +ER_IB_MSG_951 = 12776 +ER_IB_MSG_952 = 12777 +ER_IB_MSG_953 = 12778 +ER_IB_MSG_954 = 12779 +ER_IB_MSG_955 = 12780 +ER_IB_MSG_956 = 12781 +ER_IB_MSG_957 = 12782 +ER_IB_MSG_958 = 12783 +ER_IB_MSG_959 = 12784 +ER_IB_MSG_960 = 12785 +ER_IB_MSG_961 = 12786 +ER_IB_MSG_962 = 12787 +ER_IB_MSG_963 = 12788 +ER_IB_MSG_964 = 12789 +ER_IB_MSG_965 = 12790 +ER_IB_MSG_966 = 12791 +ER_IB_MSG_967 = 12792 +ER_IB_MSG_968 = 12793 +ER_IB_MSG_969 = 12794 +ER_IB_MSG_970 = 12795 +ER_IB_MSG_971 = 12796 +ER_IB_MSG_972 = 12797 +ER_IB_MSG_973 = 12798 +ER_IB_MSG_974 = 12799 +ER_IB_MSG_975 = 12800 +ER_IB_MSG_976 = 12801 +ER_IB_MSG_977 = 12802 +ER_IB_MSG_978 = 12803 +ER_IB_MSG_979 = 12804 +ER_IB_MSG_980 = 12805 +ER_IB_MSG_981 = 12806 +ER_IB_MSG_982 = 12807 +ER_IB_MSG_983 = 12808 +ER_IB_MSG_984 = 12809 +ER_IB_MSG_985 = 12810 +ER_IB_MSG_986 = 12811 +ER_IB_MSG_987 = 12812 +ER_IB_MSG_988 = 12813 +ER_IB_MSG_989 = 12814 +ER_IB_MSG_990 = 12815 +ER_IB_MSG_991 = 12816 +ER_IB_MSG_992 = 12817 +ER_IB_MSG_993 = 12818 +ER_IB_MSG_994 = 12819 +ER_IB_MSG_995 = 12820 +ER_IB_MSG_996 = 12821 +ER_IB_MSG_997 = 12822 +ER_IB_MSG_998 = 12823 +ER_IB_MSG_999 = 12824 +ER_IB_MSG_1000 = 12825 +ER_IB_MSG_1001 = 12826 +ER_IB_MSG_1002 = 12827 +ER_IB_MSG_1003 = 12828 +ER_IB_MSG_1004 = 12829 +ER_IB_MSG_1005 = 12830 +ER_IB_MSG_1006 = 12831 +ER_IB_MSG_1007 = 12832 +ER_IB_MSG_1008 = 12833 +ER_IB_MSG_1009 = 12834 +ER_IB_MSG_1010 = 12835 +ER_IB_MSG_1011 = 12836 +ER_IB_MSG_1012 = 12837 +ER_IB_MSG_1013 = 12838 +ER_IB_MSG_1014 = 12839 +ER_IB_MSG_1015 = 12840 +ER_IB_MSG_1016 = 12841 +ER_IB_MSG_1017 = 12842 +ER_IB_MSG_1018 = 12843 +ER_IB_MSG_1019 = 12844 +ER_IB_MSG_1020 = 12845 +ER_IB_MSG_1021 = 12846 +ER_IB_MSG_1022 = 12847 +ER_IB_MSG_1023 = 12848 +ER_IB_MSG_1024 = 12849 +ER_IB_MSG_1025 = 12850 +ER_IB_MSG_1026 = 12851 +ER_IB_MSG_1027 = 12852 +ER_IB_MSG_1028 = 12853 +ER_IB_MSG_1029 = 12854 +ER_IB_MSG_1030 = 12855 +ER_IB_MSG_1031 = 12856 +ER_IB_MSG_1032 = 12857 +ER_IB_MSG_1033 = 12858 +ER_IB_MSG_1034 = 12859 +ER_IB_MSG_1035 = 12860 +ER_IB_MSG_1036 = 12861 +ER_IB_MSG_1037 = 12862 +ER_IB_MSG_1038 = 12863 +ER_IB_MSG_1039 = 12864 +ER_IB_MSG_1040 = 12865 +ER_IB_MSG_1041 = 12866 +ER_IB_MSG_1042 = 12867 +ER_IB_MSG_1043 = 12868 +ER_IB_MSG_1044 = 12869 +ER_IB_MSG_1045 = 12870 +ER_IB_MSG_1046 = 12871 +ER_IB_MSG_1047 = 12872 +ER_IB_MSG_1048 = 12873 +ER_IB_MSG_1049 = 12874 +ER_IB_MSG_1050 = 12875 +ER_IB_MSG_1051 = 12876 +ER_IB_MSG_1052 = 12877 +ER_IB_MSG_1053 = 12878 +ER_IB_MSG_1054 = 12879 +ER_IB_MSG_1055 = 12880 +ER_IB_MSG_1056 = 12881 +ER_IB_MSG_1057 = 12882 +ER_IB_MSG_1058 = 12883 +ER_IB_MSG_1059 = 12884 +ER_IB_MSG_1060 = 12885 +ER_IB_MSG_1061 = 12886 +ER_IB_MSG_1062 = 12887 +ER_IB_MSG_1063 = 12888 +ER_IB_MSG_1064 = 12889 +ER_IB_MSG_1065 = 12890 +ER_IB_MSG_1066 = 12891 +ER_IB_MSG_1067 = 12892 +ER_IB_MSG_1068 = 12893 +ER_IB_MSG_1069 = 12894 +ER_IB_MSG_1070 = 12895 +ER_IB_MSG_1071 = 12896 +ER_IB_MSG_1072 = 12897 +ER_IB_MSG_1073 = 12898 +ER_IB_MSG_1074 = 12899 +ER_IB_MSG_1075 = 12900 +ER_IB_MSG_1076 = 12901 +ER_IB_MSG_1077 = 12902 +ER_IB_MSG_1078 = 12903 +ER_IB_MSG_1079 = 12904 +ER_IB_MSG_1080 = 12905 +ER_IB_MSG_1081 = 12906 +ER_IB_MSG_1082 = 12907 +ER_IB_MSG_1083 = 12908 +ER_IB_MSG_1084 = 12909 +ER_IB_MSG_1085 = 12910 +ER_IB_MSG_1086 = 12911 +ER_IB_MSG_1087 = 12912 +ER_IB_MSG_1088 = 12913 +ER_IB_MSG_1089 = 12914 +ER_IB_MSG_1090 = 12915 +ER_IB_MSG_1091 = 12916 +ER_IB_MSG_1092 = 12917 +ER_IB_MSG_1093 = 12918 +ER_IB_MSG_1094 = 12919 +ER_IB_MSG_1095 = 12920 +ER_IB_MSG_1096 = 12921 +ER_IB_MSG_1097 = 12922 +ER_IB_MSG_1098 = 12923 +ER_IB_MSG_1099 = 12924 +ER_IB_MSG_1100 = 12925 +ER_IB_MSG_1101 = 12926 +ER_IB_MSG_1102 = 12927 +ER_IB_MSG_1103 = 12928 +ER_IB_MSG_1104 = 12929 +ER_IB_MSG_1105 = 12930 +ER_IB_MSG_1106 = 12931 +ER_IB_MSG_1107 = 12932 +ER_IB_MSG_1108 = 12933 +ER_IB_MSG_1109 = 12934 +ER_IB_MSG_1110 = 12935 +ER_IB_MSG_1111 = 12936 +ER_IB_MSG_1112 = 12937 +ER_IB_MSG_1113 = 12938 +ER_IB_MSG_1114 = 12939 +ER_IB_MSG_1115 = 12940 +ER_IB_MSG_1116 = 12941 +ER_IB_MSG_1117 = 12942 +ER_IB_MSG_1118 = 12943 +ER_IB_MSG_1119 = 12944 +ER_IB_MSG_1120 = 12945 +ER_IB_MSG_1121 = 12946 +ER_IB_MSG_1122 = 12947 +ER_IB_MSG_1123 = 12948 +ER_IB_MSG_1124 = 12949 +ER_IB_MSG_1125 = 12950 +ER_IB_MSG_1126 = 12951 +ER_IB_MSG_1127 = 12952 +ER_IB_MSG_1128 = 12953 +ER_IB_MSG_1129 = 12954 +ER_IB_MSG_1130 = 12955 +ER_IB_MSG_1131 = 12956 +ER_IB_MSG_1132 = 12957 +ER_IB_MSG_1133 = 12958 +ER_IB_MSG_1134 = 12959 +ER_IB_MSG_1135 = 12960 +ER_IB_MSG_1136 = 12961 +ER_IB_MSG_1137 = 12962 +ER_IB_MSG_1138 = 12963 +ER_IB_MSG_1139 = 12964 +ER_IB_MSG_1140 = 12965 +ER_IB_MSG_1141 = 12966 +ER_IB_MSG_1142 = 12967 +ER_IB_MSG_1143 = 12968 +ER_IB_MSG_1144 = 12969 +ER_IB_MSG_1145 = 12970 +ER_IB_MSG_1146 = 12971 +ER_IB_MSG_1147 = 12972 +ER_IB_MSG_1148 = 12973 +ER_IB_MSG_1149 = 12974 +ER_IB_MSG_1150 = 12975 +ER_IB_MSG_1151 = 12976 +ER_IB_MSG_1152 = 12977 +ER_IB_MSG_1153 = 12978 +ER_IB_MSG_1154 = 12979 +ER_IB_MSG_1155 = 12980 +ER_IB_MSG_1156 = 12981 +ER_IB_MSG_1157 = 12982 +ER_IB_MSG_1158 = 12983 +ER_IB_MSG_1159 = 12984 +ER_IB_MSG_1160 = 12985 +ER_IB_MSG_1161 = 12986 +ER_IB_MSG_1162 = 12987 +ER_IB_MSG_1163 = 12988 +ER_IB_MSG_1164 = 12989 +ER_IB_MSG_1165 = 12990 +ER_IB_MSG_1166 = 12991 +ER_IB_MSG_1167 = 12992 +ER_IB_MSG_1168 = 12993 +ER_IB_MSG_1169 = 12994 +ER_IB_MSG_1170 = 12995 +ER_IB_MSG_1171 = 12996 +ER_IB_MSG_1172 = 12997 +ER_IB_MSG_1173 = 12998 +ER_IB_MSG_1174 = 12999 +ER_IB_MSG_1175 = 13000 +ER_IB_MSG_1176 = 13001 +ER_IB_MSG_1177 = 13002 +ER_IB_MSG_1178 = 13003 +ER_IB_MSG_1179 = 13004 +ER_IB_MSG_1180 = 13005 +ER_IB_MSG_1181 = 13006 +ER_IB_MSG_1182 = 13007 +ER_IB_MSG_1183 = 13008 +ER_IB_MSG_1184 = 13009 +ER_IB_MSG_1185 = 13010 +ER_IB_MSG_1186 = 13011 +ER_IB_MSG_1187 = 13012 +ER_IB_MSG_1188 = 13013 +ER_IB_MSG_1189 = 13014 +ER_IB_MSG_1190 = 13015 +ER_IB_MSG_1191 = 13016 +ER_IB_MSG_1192 = 13017 +ER_IB_MSG_1193 = 13018 +ER_IB_MSG_1194 = 13019 +ER_IB_MSG_1195 = 13020 +ER_IB_MSG_1196 = 13021 +ER_IB_MSG_1197 = 13022 +ER_IB_MSG_1198 = 13023 +ER_IB_MSG_1199 = 13024 +ER_IB_MSG_1200 = 13025 +ER_IB_MSG_1201 = 13026 +ER_IB_MSG_1202 = 13027 +ER_IB_MSG_1203 = 13028 +ER_IB_MSG_1204 = 13029 +ER_IB_MSG_1205 = 13030 +ER_IB_MSG_1206 = 13031 +ER_IB_MSG_1207 = 13032 +ER_IB_MSG_1208 = 13033 +ER_IB_MSG_1209 = 13034 +ER_IB_MSG_1210 = 13035 +ER_IB_MSG_1211 = 13036 +ER_IB_MSG_1212 = 13037 +ER_IB_MSG_1213 = 13038 +ER_IB_MSG_1214 = 13039 +ER_IB_MSG_1215 = 13040 +ER_IB_MSG_1216 = 13041 +ER_IB_MSG_1217 = 13042 +ER_IB_MSG_1218 = 13043 +ER_IB_MSG_1219 = 13044 +ER_IB_MSG_1220 = 13045 +ER_IB_MSG_1221 = 13046 +ER_IB_MSG_1222 = 13047 +ER_IB_MSG_1223 = 13048 +ER_IB_MSG_1224 = 13049 +ER_IB_MSG_1225 = 13050 +ER_IB_MSG_1226 = 13051 +ER_IB_MSG_1227 = 13052 +ER_IB_MSG_1228 = 13053 +ER_IB_MSG_1229 = 13054 +ER_IB_MSG_1230 = 13055 +ER_IB_MSG_1231 = 13056 +ER_IB_MSG_1232 = 13057 +ER_IB_MSG_1233 = 13058 +ER_IB_MSG_1234 = 13059 +ER_IB_MSG_1235 = 13060 +ER_IB_MSG_1236 = 13061 +ER_IB_MSG_1237 = 13062 +ER_IB_MSG_1238 = 13063 +ER_IB_MSG_1239 = 13064 +ER_IB_MSG_1240 = 13065 +ER_IB_MSG_1241 = 13066 +ER_IB_MSG_1242 = 13067 +ER_IB_MSG_1243 = 13068 +ER_IB_MSG_1244 = 13069 +ER_IB_MSG_1245 = 13070 +ER_IB_MSG_1246 = 13071 +ER_IB_MSG_1247 = 13072 +ER_IB_MSG_1248 = 13073 +ER_IB_MSG_1249 = 13074 +ER_IB_MSG_1250 = 13075 +ER_IB_MSG_1251 = 13076 +ER_IB_MSG_1252 = 13077 +ER_IB_MSG_1253 = 13078 +ER_IB_MSG_1254 = 13079 +ER_IB_MSG_1255 = 13080 +ER_IB_MSG_1256 = 13081 +ER_IB_MSG_1257 = 13082 +ER_IB_MSG_1258 = 13083 +ER_IB_MSG_1259 = 13084 +ER_IB_MSG_1260 = 13085 +ER_IB_MSG_1261 = 13086 +ER_IB_MSG_1262 = 13087 +ER_IB_MSG_1263 = 13088 +ER_IB_MSG_1264 = 13089 +ER_IB_MSG_1265 = 13090 +ER_IB_MSG_1266 = 13091 +ER_IB_MSG_1267 = 13092 +ER_IB_MSG_1268 = 13093 +ER_IB_MSG_1269 = 13094 +ER_IB_MSG_1270 = 13095 +ER_RPL_SLAVE_SQL_THREAD_STOP_CMD_EXEC_TIMEOUT = 13096 +ER_RPL_SLAVE_IO_THREAD_STOP_CMD_EXEC_TIMEOUT = 13097 +ER_RPL_GTID_UNSAFE_STMT_ON_NON_TRANS_TABLE = 13098 +ER_RPL_GTID_UNSAFE_STMT_CREATE_SELECT = 13099 +ER_RPL_GTID_UNSAFE_STMT_ON_TEMPORARY_TABLE = 13100 +ER_BINLOG_ROW_VALUE_OPTION_IGNORED = 13101 +ER_BINLOG_USE_V1_ROW_EVENTS_IGNORED = 13102 +ER_BINLOG_ROW_VALUE_OPTION_USED_ONLY_FOR_AFTER_IMAGES = 13103 +ER_CONNECTION_ABORTED = 13104 +ER_NORMAL_SERVER_SHUTDOWN = 13105 +ER_KEYRING_MIGRATE_FAILED = 13106 +ER_GRP_RPL_LOWER_CASE_TABLE_NAMES_DIFF_FROM_GRP = 13107 +ER_OOM_SAVE_GTIDS = 13108 +ER_LCTN_NOT_FOUND = 13109 +ER_REGEXP_INVALID_CAPTURE_GROUP_NAME = 13110 +ER_COMPONENT_FILTER_WRONG_VALUE = 13111 +ER_XPLUGIN_FAILED_TO_STOP_SERVICES = 13112 +ER_INCONSISTENT_ERROR = 13113 +ER_SERVER_MASTER_FATAL_ERROR_READING_BINLOG = 13114 +ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 13115 +ER_SLAVE_CREATE_EVENT_FAILURE = 13116 +ER_SLAVE_FATAL_ERROR = 13117 +ER_SLAVE_HEARTBEAT_FAILURE = 13118 +ER_SLAVE_INCIDENT = 13119 +ER_SLAVE_MASTER_COM_FAILURE = 13120 +ER_SLAVE_RELAY_LOG_READ_FAILURE = 13121 +ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 13122 +ER_SERVER_SLAVE_MI_INIT_REPOSITORY = 13123 +ER_SERVER_SLAVE_RLI_INIT_REPOSITORY = 13124 +ER_SERVER_NET_PACKET_TOO_LARGE = 13125 +ER_SERVER_NO_SYSTEM_TABLE_ACCESS = 13126 +ER_SERVER_UNKNOWN_ERROR = 13127 +ER_SERVER_UNKNOWN_SYSTEM_VARIABLE = 13128 +ER_SERVER_NO_SESSION_TO_SEND_TO = 13129 +ER_SERVER_NEW_ABORTING_CONNECTION = 13130 +ER_SERVER_OUT_OF_SORTMEMORY = 13131 +ER_SERVER_RECORD_FILE_FULL = 13132 +ER_SERVER_DISK_FULL_NOWAIT = 13133 +ER_SERVER_HANDLER_ERROR = 13134 +ER_SERVER_NOT_FORM_FILE = 13135 +ER_SERVER_CANT_OPEN_FILE = 13136 +ER_SERVER_FILE_NOT_FOUND = 13137 +ER_SERVER_FILE_USED = 13138 +ER_SERVER_CANNOT_LOAD_FROM_TABLE_V2 = 13139 +ER_ERROR_INFO_FROM_DA = 13140 +ER_SERVER_TABLE_CHECK_FAILED = 13141 +ER_SERVER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 13142 +ER_SERVER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 13143 +ER_SERVER_ACL_TABLE_ERROR = 13144 +ER_SERVER_SLAVE_INIT_QUERY_FAILED = 13145 +ER_SERVER_SLAVE_CONVERSION_FAILED = 13146 +ER_SERVER_SLAVE_IGNORED_TABLE = 13147 +ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 13148 +ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 13149 +ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 13150 +ER_SERVER_TEST_MESSAGE = 13151 +ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 13152 +ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 13153 +ER_PLUGIN_FAILED_TO_OPEN_TABLES = 13154 +ER_PLUGIN_FAILED_TO_OPEN_TABLE = 13155 +ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 13156 +ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 13157 +ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 13158 +ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 13159 +ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 13160 +ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 13161 +ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 13162 +ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 13163 +ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 13164 +ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 13165 +ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 13166 +ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXIST = 13167 +CR_UNKNOWN_ERROR = 2000 +CR_SOCKET_CREATE_ERROR = 2001 +CR_CONNECTION_ERROR = 2002 +CR_CONN_HOST_ERROR = 2003 +CR_IPSOCK_ERROR = 2004 +CR_UNKNOWN_HOST = 2005 +CR_SERVER_GONE_ERROR = 2006 +CR_VERSION_ERROR = 2007 +CR_OUT_OF_MEMORY = 2008 +CR_WRONG_HOST_INFO = 2009 +CR_LOCALHOST_CONNECTION = 2010 +CR_TCP_CONNECTION = 2011 +CR_SERVER_HANDSHAKE_ERR = 2012 +CR_SERVER_LOST = 2013 +CR_COMMANDS_OUT_OF_SYNC = 2014 +CR_NAMEDPIPE_CONNECTION = 2015 +CR_NAMEDPIPEWAIT_ERROR = 2016 +CR_NAMEDPIPEOPEN_ERROR = 2017 +CR_NAMEDPIPESETSTATE_ERROR = 2018 +CR_CANT_READ_CHARSET = 2019 +CR_NET_PACKET_TOO_LARGE = 2020 +CR_EMBEDDED_CONNECTION = 2021 +CR_PROBE_SLAVE_STATUS = 2022 +CR_PROBE_SLAVE_HOSTS = 2023 +CR_PROBE_SLAVE_CONNECT = 2024 +CR_PROBE_MASTER_CONNECT = 2025 +CR_SSL_CONNECTION_ERROR = 2026 +CR_MALFORMED_PACKET = 2027 +CR_WRONG_LICENSE = 2028 +CR_NULL_POINTER = 2029 +CR_NO_PREPARE_STMT = 2030 +CR_PARAMS_NOT_BOUND = 2031 +CR_DATA_TRUNCATED = 2032 +CR_NO_PARAMETERS_EXISTS = 2033 +CR_INVALID_PARAMETER_NO = 2034 +CR_INVALID_BUFFER_USE = 2035 +CR_UNSUPPORTED_PARAM_TYPE = 2036 +CR_SHARED_MEMORY_CONNECTION = 2037 +CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR = 2038 +CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR = 2039 +CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR = 2040 +CR_SHARED_MEMORY_CONNECT_MAP_ERROR = 2041 +CR_SHARED_MEMORY_FILE_MAP_ERROR = 2042 +CR_SHARED_MEMORY_MAP_ERROR = 2043 +CR_SHARED_MEMORY_EVENT_ERROR = 2044 +CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR = 2045 +CR_SHARED_MEMORY_CONNECT_SET_ERROR = 2046 +CR_CONN_UNKNOW_PROTOCOL = 2047 +CR_INVALID_CONN_HANDLE = 2048 +CR_UNUSED_1 = 2049 +CR_FETCH_CANCELED = 2050 +CR_NO_DATA = 2051 +CR_NO_STMT_METADATA = 2052 +CR_NO_RESULT_SET = 2053 +CR_NOT_IMPLEMENTED = 2054 +CR_SERVER_LOST_EXTENDED = 2055 +CR_STMT_CLOSED = 2056 +CR_NEW_STMT_METADATA = 2057 +CR_ALREADY_CONNECTED = 2058 +CR_AUTH_PLUGIN_CANNOT_LOAD = 2059 +CR_DUPLICATE_CONNECTION_ATTR = 2060 +CR_AUTH_PLUGIN_ERR = 2061 +CR_INSECURE_API_ERR = 2062 +CR_FILE_NAME_TOO_LONG = 2063 +CR_SSL_FIPS_MODE_ERR = 2064 +# End MySQL Errors + diff --git a/venv/Lib/site-packages/mysql/connector/errors.py b/venv/Lib/site-packages/mysql/connector/errors.py new file mode 100644 index 0000000..4accce2 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/errors.py @@ -0,0 +1,307 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Python exceptions +""" + +from . import utils +from .locales import get_client_error +from .catch23 import PY2 + +# _CUSTOM_ERROR_EXCEPTIONS holds custom exceptions and is ued by the +# function custom_error_exception. _ERROR_EXCEPTIONS (at bottom of module) +# is similar, but hardcoded exceptions. +_CUSTOM_ERROR_EXCEPTIONS = {} + + +def custom_error_exception(error=None, exception=None): + """Define custom exceptions for MySQL server errors + + This function defines custom exceptions for MySQL server errors and + returns the current set customizations. + + If error is a MySQL Server error number, then you have to pass also the + exception class. + + The error argument can also be a dictionary in which case the key is + the server error number, and value the exception to be raised. + + If none of the arguments are given, then custom_error_exception() will + simply return the current set customizations. + + To reset the customizations, simply supply an empty dictionary. + + Examples: + import mysql.connector + from mysql.connector import errorcode + + # Server error 1028 should raise a DatabaseError + mysql.connector.custom_error_exception( + 1028, mysql.connector.DatabaseError) + + # Or using a dictionary: + mysql.connector.custom_error_exception({ + 1028: mysql.connector.DatabaseError, + 1029: mysql.connector.OperationalError, + }) + + # Reset + mysql.connector.custom_error_exception({}) + + Returns a dictionary. + """ + global _CUSTOM_ERROR_EXCEPTIONS # pylint: disable=W0603 + + if isinstance(error, dict) and not error: + _CUSTOM_ERROR_EXCEPTIONS = {} + return _CUSTOM_ERROR_EXCEPTIONS + + if not error and not exception: + return _CUSTOM_ERROR_EXCEPTIONS + + if not isinstance(error, (int, dict)): + raise ValueError( + "The error argument should be either an integer or dictionary") + + if isinstance(error, int): + error = {error: exception} + + for errno, _exception in error.items(): + if not isinstance(errno, int): + raise ValueError("error number should be an integer") + try: + if not issubclass(_exception, Exception): + raise TypeError + except TypeError: + raise ValueError("exception should be subclass of Exception") + _CUSTOM_ERROR_EXCEPTIONS[errno] = _exception + + return _CUSTOM_ERROR_EXCEPTIONS + +def get_mysql_exception(errno, msg=None, sqlstate=None): + """Get the exception matching the MySQL error + + This function will return an exception based on the SQLState. The given + message will be passed on in the returned exception. + + The exception returned can be customized using the + mysql.connector.custom_error_exception() function. + + Returns an Exception + """ + try: + return _CUSTOM_ERROR_EXCEPTIONS[errno]( + msg=msg, errno=errno, sqlstate=sqlstate) + except KeyError: + # Error was not mapped to particular exception + pass + + try: + return _ERROR_EXCEPTIONS[errno]( + msg=msg, errno=errno, sqlstate=sqlstate) + except KeyError: + # Error was not mapped to particular exception + pass + + if not sqlstate: + return DatabaseError(msg=msg, errno=errno) + + try: + return _SQLSTATE_CLASS_EXCEPTION[sqlstate[0:2]]( + msg=msg, errno=errno, sqlstate=sqlstate) + except KeyError: + # Return default InterfaceError + return DatabaseError(msg=msg, errno=errno, sqlstate=sqlstate) + +def get_exception(packet): + """Returns an exception object based on the MySQL error + + Returns an exception object based on the MySQL error in the given + packet. + + Returns an Error-Object. + """ + errno = errmsg = None + + try: + if packet[4] != 255: + raise ValueError("Packet is not an error packet") + except IndexError as err: + return InterfaceError("Failed getting Error information (%r)" % err) + + sqlstate = None + try: + packet = packet[5:] + (packet, errno) = utils.read_int(packet, 2) + if packet[0] != 35: + # Error without SQLState + if isinstance(packet, (bytes, bytearray)): + errmsg = packet.decode('utf8') + else: + errmsg = packet + else: + (packet, sqlstate) = utils.read_bytes(packet[1:], 5) + sqlstate = sqlstate.decode('utf8') + errmsg = packet.decode('utf8') + except Exception as err: # pylint: disable=W0703 + return InterfaceError("Failed getting Error information (%r)" % err) + else: + return get_mysql_exception(errno, errmsg, sqlstate) + + +class Error(Exception): + """Exception that is base class for all other error exceptions""" + def __init__(self, msg=None, errno=None, values=None, sqlstate=None): + super(Error, self).__init__() + self.msg = msg + self._full_msg = self.msg + self.errno = errno or -1 + self.sqlstate = sqlstate + + if not self.msg and (2000 <= self.errno < 3000): + self.msg = get_client_error(self.errno) + if values is not None: + try: + self.msg = self.msg % values + except TypeError as err: + self.msg = "{0} (Warning: {1})".format(self.msg, str(err)) + elif not self.msg: + self._full_msg = self.msg = 'Unknown error' + + if self.msg and self.errno != -1: + fields = { + 'errno': self.errno, + 'msg': self.msg.encode('utf8') if PY2 else self.msg + } + if self.sqlstate: + fmt = '{errno} ({state}): {msg}' + fields['state'] = self.sqlstate + else: + fmt = '{errno}: {msg}' + self._full_msg = fmt.format(**fields) + + self.args = (self.errno, self._full_msg, self.sqlstate) + + def __str__(self): + return self._full_msg + + +class Warning(Exception): # pylint: disable=W0622 + """Exception for important warnings""" + pass + + +class InterfaceError(Error): + """Exception for errors related to the interface""" + pass + + +class DatabaseError(Error): + """Exception for errors related to the database""" + pass + + +class InternalError(DatabaseError): + """Exception for errors internal database errors""" + pass + + +class OperationalError(DatabaseError): + """Exception for errors related to the database's operation""" + pass + + +class ProgrammingError(DatabaseError): + """Exception for errors programming errors""" + pass + + +class IntegrityError(DatabaseError): + """Exception for errors regarding relational integrity""" + pass + + +class DataError(DatabaseError): + """Exception for errors reporting problems with processed data""" + pass + + +class NotSupportedError(DatabaseError): + """Exception for errors when an unsupported database feature was used""" + pass + + +class PoolError(Error): + """Exception for errors relating to connection pooling""" + pass + + +_SQLSTATE_CLASS_EXCEPTION = { + '02': DataError, # no data + '07': DatabaseError, # dynamic SQL error + '08': OperationalError, # connection exception + '0A': NotSupportedError, # feature not supported + '21': DataError, # cardinality violation + '22': DataError, # data exception + '23': IntegrityError, # integrity constraint violation + '24': ProgrammingError, # invalid cursor state + '25': ProgrammingError, # invalid transaction state + '26': ProgrammingError, # invalid SQL statement name + '27': ProgrammingError, # triggered data change violation + '28': ProgrammingError, # invalid authorization specification + '2A': ProgrammingError, # direct SQL syntax error or access rule violation + '2B': DatabaseError, # dependent privilege descriptors still exist + '2C': ProgrammingError, # invalid character set name + '2D': DatabaseError, # invalid transaction termination + '2E': DatabaseError, # invalid connection name + '33': DatabaseError, # invalid SQL descriptor name + '34': ProgrammingError, # invalid cursor name + '35': ProgrammingError, # invalid condition number + '37': ProgrammingError, # dynamic SQL syntax error or access rule violation + '3C': ProgrammingError, # ambiguous cursor name + '3D': ProgrammingError, # invalid catalog name + '3F': ProgrammingError, # invalid schema name + '40': InternalError, # transaction rollback + '42': ProgrammingError, # syntax error or access rule violation + '44': InternalError, # with check option violation + 'HZ': OperationalError, # remote database access + 'XA': IntegrityError, + '0K': OperationalError, + 'HY': DatabaseError, # default when no SQLState provided by MySQL server +} + +_ERROR_EXCEPTIONS = { + 1243: ProgrammingError, + 1210: ProgrammingError, + 2002: InterfaceError, + 2013: OperationalError, + 2049: NotSupportedError, + 2055: OperationalError, + 2061: InterfaceError, + 2026: InterfaceError, +} diff --git a/venv/Lib/site-packages/mysql/connector/locales/__init__.py b/venv/Lib/site-packages/mysql/connector/locales/__init__.py new file mode 100644 index 0000000..c1a737b --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/locales/__init__.py @@ -0,0 +1,75 @@ +# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Translations +""" + +__all__ = [ + 'get_client_error' +] + +from .. import errorcode + +def get_client_error(error, language='eng'): + """Lookup client error + + This function will lookup the client error message based on the given + error and return the error message. If the error was not found, + None will be returned. + + Error can be either an integer or a string. For example: + error: 2000 + error: CR_UNKNOWN_ERROR + + The language attribute can be used to retrieve a localized message, when + available. + + Returns a string or None. + """ + try: + tmp = __import__('mysql.connector.locales.{0}'.format(language), + globals(), locals(), ['client_error']) + except ImportError: + raise ImportError("No localization support for language '{0}'".format( + language)) + client_error = tmp.client_error + + if isinstance(error, int): + errno = error + for key, value in errorcode.__dict__.items(): + if value == errno: + error = key + break + + if isinstance(error, (str)): + try: + return getattr(client_error, error) + except AttributeError: + return None + + raise ValueError("error argument needs to be either an integer or string") diff --git a/venv/Lib/site-packages/mysql/connector/locales/__pycache__/__init__.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/locales/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..7f4d3e2 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/locales/__pycache__/__init__.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/locales/eng/__init__.py b/venv/Lib/site-packages/mysql/connector/locales/eng/__init__.py new file mode 100644 index 0000000..2e1c02b --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/locales/eng/__init__.py @@ -0,0 +1,30 @@ +# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""English Content +""" diff --git a/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/__init__.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..b5436b9 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/__init__.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/client_error.cpython-36.pyc b/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/client_error.cpython-36.pyc new file mode 100644 index 0000000..9731042 Binary files /dev/null and b/venv/Lib/site-packages/mysql/connector/locales/eng/__pycache__/client_error.cpython-36.pyc differ diff --git a/venv/Lib/site-packages/mysql/connector/locales/eng/client_error.py b/venv/Lib/site-packages/mysql/connector/locales/eng/client_error.py new file mode 100644 index 0000000..a9ed8b9 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/locales/eng/client_error.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2018-03-16' +_MYSQL_VERSION = (8, 0, 11) + +# Start MySQL Error messages +CR_UNKNOWN_ERROR = u"Unknown MySQL error" +CR_SOCKET_CREATE_ERROR = u"Can't create UNIX socket (%s)" +CR_CONNECTION_ERROR = u"Can't connect to local MySQL server through socket '%-.100s' (%s)" +CR_CONN_HOST_ERROR = u"Can't connect to MySQL server on '%-.100s' (%s)" +CR_IPSOCK_ERROR = u"Can't create TCP/IP socket (%s)" +CR_UNKNOWN_HOST = u"Unknown MySQL server host '%-.100s' (%s)" +CR_SERVER_GONE_ERROR = u"MySQL server has gone away" +CR_VERSION_ERROR = u"Protocol mismatch; server version = %s, client version = %s" +CR_OUT_OF_MEMORY = u"MySQL client ran out of memory" +CR_WRONG_HOST_INFO = u"Wrong host info" +CR_LOCALHOST_CONNECTION = u"Localhost via UNIX socket" +CR_TCP_CONNECTION = u"%-.100s via TCP/IP" +CR_SERVER_HANDSHAKE_ERR = u"Error in server handshake" +CR_SERVER_LOST = u"Lost connection to MySQL server during query" +CR_COMMANDS_OUT_OF_SYNC = u"Commands out of sync; you can't run this command now" +CR_NAMEDPIPE_CONNECTION = u"Named pipe: %-.32s" +CR_NAMEDPIPEWAIT_ERROR = u"Can't wait for named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_NAMEDPIPEOPEN_ERROR = u"Can't open named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_NAMEDPIPESETSTATE_ERROR = u"Can't set state of named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_CANT_READ_CHARSET = u"Can't initialize character set %-.32s (path: %-.100s)" +CR_NET_PACKET_TOO_LARGE = u"Got packet bigger than 'max_allowed_packet' bytes" +CR_EMBEDDED_CONNECTION = u"Embedded server" +CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:" +CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:" +CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:" +CR_PROBE_MASTER_CONNECT = u"Error connecting to master:" +CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s" +CR_MALFORMED_PACKET = u"Malformed packet" +CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license" +CR_NULL_POINTER = u"Invalid use of null pointer" +CR_NO_PREPARE_STMT = u"Statement not prepared" +CR_PARAMS_NOT_BOUND = u"No data supplied for parameters in prepared statement" +CR_DATA_TRUNCATED = u"Data truncated" +CR_NO_PARAMETERS_EXISTS = u"No parameters exist in the statement" +CR_INVALID_PARAMETER_NO = u"Invalid parameter number" +CR_INVALID_BUFFER_USE = u"Can't send long data for non-string/non-binary data types (parameter: %s)" +CR_UNSUPPORTED_PARAM_TYPE = u"Using unsupported buffer type: %s (parameter: %s)" +CR_SHARED_MEMORY_CONNECTION = u"Shared memory: %-.100s" +CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR = u"Can't open shared memory; client could not create request event (%s)" +CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR = u"Can't open shared memory; no answer event received from server (%s)" +CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR = u"Can't open shared memory; server could not allocate file mapping (%s)" +CR_SHARED_MEMORY_CONNECT_MAP_ERROR = u"Can't open shared memory; server could not get pointer to file mapping (%s)" +CR_SHARED_MEMORY_FILE_MAP_ERROR = u"Can't open shared memory; client could not allocate file mapping (%s)" +CR_SHARED_MEMORY_MAP_ERROR = u"Can't open shared memory; client could not get pointer to file mapping (%s)" +CR_SHARED_MEMORY_EVENT_ERROR = u"Can't open shared memory; client could not create %s event (%s)" +CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR = u"Can't open shared memory; no answer from server (%s)" +CR_SHARED_MEMORY_CONNECT_SET_ERROR = u"Can't open shared memory; cannot send request event to server (%s)" +CR_CONN_UNKNOW_PROTOCOL = u"Wrong or unknown protocol" +CR_INVALID_CONN_HANDLE = u"Invalid connection handle" +CR_UNUSED_1 = u"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)" +CR_FETCH_CANCELED = u"Row retrieval was canceled by mysql_stmt_close() call" +CR_NO_DATA = u"Attempt to read column without prior row fetch" +CR_NO_STMT_METADATA = u"Prepared statement contains no metadata" +CR_NO_RESULT_SET = u"Attempt to read a row while there is no result set associated with the statement" +CR_NOT_IMPLEMENTED = u"This feature is not implemented yet" +CR_SERVER_LOST_EXTENDED = u"Lost connection to MySQL server at '%s', system error: %s" +CR_STMT_CLOSED = u"Statement closed indirectly because of a preceding %s() call" +CR_NEW_STMT_METADATA = u"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again" +CR_ALREADY_CONNECTED = u"This handle is already connected. Use a separate handle for each connection." +CR_AUTH_PLUGIN_CANNOT_LOAD = u"Authentication plugin '%s' cannot be loaded: %s" +CR_DUPLICATE_CONNECTION_ATTR = u"There is an attribute with the same name already" +CR_AUTH_PLUGIN_ERR = u"Authentication plugin '%s' reported error: %s" +CR_INSECURE_API_ERR = u"Insecure API function call: '%s' Use instead: '%s'" +CR_FILE_NAME_TOO_LONG = u"File name is too long" +CR_SSL_FIPS_MODE_ERR = u"Set FIPS mode ON/STRICT failed" +# End MySQL Error messages + diff --git a/venv/Lib/site-packages/mysql/connector/network.py b/venv/Lib/site-packages/mysql/connector/network.py new file mode 100644 index 0000000..3e7b99a --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/network.py @@ -0,0 +1,534 @@ +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Module implementing low-level socket communication with MySQL servers. +""" + +from collections import deque +import socket +import struct +import sys +import zlib + +try: + import ssl +except: + # If import fails, we don't have SSL support. + pass + +from . import constants, errors +from .catch23 import PY2, init_bytearray, struct_unpack + + +def _strioerror(err): + """Reformat the IOError error message + + This function reformats the IOError error message. + """ + if not err.errno: + return str(err) + return '{errno} {strerr}'.format(errno=err.errno, strerr=err.strerror) + + +def _prepare_packets(buf, pktnr): + """Prepare a packet for sending to the MySQL server""" + pkts = [] + pllen = len(buf) + maxpktlen = constants.MAX_PACKET_LENGTH + while pllen > maxpktlen: + pkts.append(b'\xff\xff\xff' + struct.pack(' 255: + self._packet_number = 0 + return self._packet_number + + @property + def next_compressed_packet_number(self): + """Increments the compressed packet number""" + self._compressed_packet_number = self._compressed_packet_number + 1 + if self._compressed_packet_number > 255: + self._compressed_packet_number = 0 + return self._compressed_packet_number + + def open_connection(self): + """Open the socket""" + raise NotImplementedError + + def get_address(self): + """Get the location of the socket""" + raise NotImplementedError + + def shutdown(self): + """Shut down the socket before closing it""" + try: + self.sock.shutdown(socket.SHUT_RDWR) + self.sock.close() + del self._packet_queue + except (socket.error, AttributeError): + pass + + def close_connection(self): + """Close the socket""" + try: + self.sock.close() + del self._packet_queue + except (socket.error, AttributeError): + pass + + def __del__(self): + self.shutdown() + + def send_plain(self, buf, packet_number=None, + compressed_packet_number=None): + """Send packets to the MySQL server""" + if packet_number is None: + self.next_packet_number # pylint: disable=W0104 + else: + self._packet_number = packet_number + packets = _prepare_packets(buf, self._packet_number) + for packet in packets: + try: + if PY2: + self.sock.sendall(buffer(packet)) # pylint: disable=E0602 + else: + self.sock.sendall(packet) + except IOError as err: + raise errors.OperationalError( + errno=2055, values=(self.get_address(), _strioerror(err))) + except AttributeError: + raise errors.OperationalError(errno=2006) + + send = send_plain + + def send_compressed(self, buf, packet_number=None, + compressed_packet_number=None): + """Send compressed packets to the MySQL server""" + if packet_number is None: + self.next_packet_number # pylint: disable=W0104 + else: + self._packet_number = packet_number + if compressed_packet_number is None: + self.next_compressed_packet_number # pylint: disable=W0104 + else: + self._compressed_packet_number = compressed_packet_number + + pktnr = self._packet_number + pllen = len(buf) + zpkts = [] + maxpktlen = constants.MAX_PACKET_LENGTH + if pllen > maxpktlen: + pkts = _prepare_packets(buf, pktnr) + if PY2: + tmpbuf = bytearray() + for pkt in pkts: + tmpbuf += pkt + tmpbuf = buffer(tmpbuf) # pylint: disable=E0602 + else: + tmpbuf = b''.join(pkts) + del pkts + zbuf = zlib.compress(tmpbuf[:16384]) + header = (struct.pack(' maxpktlen: + zbuf = zlib.compress(tmpbuf[:maxpktlen]) + header = (struct.pack(' 50: + zbuf = zlib.compress(pkt) + zpkts.append(struct.pack(' 0: + raise errors.InterfaceError(errno=2013) + packet_view = packet_view[read:] + rest -= read + return packet + except IOError as err: + raise errors.OperationalError( + errno=2055, values=(self.get_address(), _strioerror(err))) + + def recv_py26_plain(self): + """Receive packets from the MySQL server""" + try: + # Read the header of the MySQL packet, 4 bytes + header = bytearray(b'') + header_len = 0 + while header_len < 4: + chunk = self.sock.recv(4 - header_len) + if not chunk: + raise errors.InterfaceError(errno=2013) + header += chunk + header_len = len(header) + + # Save the packet number and payload length + self._packet_number = header[3] + payload_len = struct_unpack(" 0: + chunk = self.sock.recv(rest) + if not chunk: + raise errors.InterfaceError(errno=2013) + payload += chunk + rest = payload_len - len(payload) + return header + payload + except IOError as err: + raise errors.OperationalError( + errno=2055, values=(self.get_address(), _strioerror(err))) + + if sys.version_info[0:2] == (2, 6): + recv = recv_py26_plain + recv_plain = recv_py26_plain + else: + recv = recv_plain + + def _split_zipped_payload(self, packet_bunch): + """Split compressed payload""" + while packet_bunch: + if PY2: + payload_length = struct.unpack_from( + "[^:=\s][^:=]*)' + r'\s*(?:' + r'(?P[:=])\s*' + r'(?P.*))?$' + ) + + self._options_dict = {} + + if PY2: + SafeConfigParser.__init__(self) + else: + SafeConfigParser.__init__(self, strict=False) + + self.default_extension = DEFAULT_EXTENSIONS[os.name] + self.keep_dashes = keep_dashes + + if not files: + raise ValueError('files argument should be given') + if isinstance(files, str): + self.files = [files] + else: + self.files = files + + self._parse_options(list(self.files)) + self._sections = self.get_groups_as_dict() + + def optionxform(self, optionstr): + """Converts option strings + + Converts option strings to lower case and replaces dashes(-) with + underscores(_) if keep_dashes variable is set. + """ + if not self.keep_dashes: + optionstr = optionstr.replace('-', '_') + return optionstr.lower() + + def _parse_options(self, files): + """Parse options from files given as arguments. + This method checks for !include or !inculdedir directives and if there + is any, those files included by these directives are also parsed + for options. + + Raises ValueError if any of the included or file given in arguments + is not readable. + """ + index = 0 + err_msg = "Option file '{0}' being included again in file '{1}'" + + for file_ in files: + try: + if file_ in files[index+1:]: + raise ValueError("Same option file '{0}' occurring more " + "than once in the list".format(file_)) + with open(file_, 'r') as op_file: + for line in op_file.readlines(): + if line.startswith('!includedir'): + _, dir_path = line.split(None, 1) + dir_path = dir_path.strip() + for entry in os.listdir(dir_path): + entry = os.path.join(dir_path, entry) + if entry in files: + raise ValueError(err_msg.format( + entry, file_)) + if (os.path.isfile(entry) and + entry.endswith(self.default_extension)): + files.insert(index+1, entry) + + elif line.startswith('!include'): + _, filename = line.split(None, 1) + filename = filename.strip() + if filename in files: + raise ValueError(err_msg.format( + filename, file_)) + files.insert(index+1, filename) + + index += 1 + + except (IOError, OSError) as exc: + raise ValueError("Failed reading file '{0}': {1}".format( + file_, str(exc))) + + read_files = self.read(files) + not_read_files = set(files) - set(read_files) + if not_read_files: + raise ValueError("File(s) {0} could not be read.".format( + ', '.join(not_read_files))) + + def read(self, filenames): # pylint: disable=W0221 + """Read and parse a filename or a list of filenames. + + Overridden from ConfigParser and modified so as to allow options + which are not inside any section header + + Return list of successfully read files. + """ + if isinstance(filenames, str): + filenames = [filenames] + read_ok = [] + for priority, filename in enumerate(filenames): + try: + out_file = io.StringIO() + for line in codecs.open(filename, encoding='utf-8'): + line = line.strip() + match_obj = self.OPTCRE.match(line) + if not self.SECTCRE.match(line) and match_obj: + optname, delimiter, optval = match_obj.group('option', + 'vi', + 'value') + if optname and not optval and not delimiter: + out_file.write(line + "=\n") + else: + out_file.write(line + '\n') + else: + out_file.write(line + '\n') + out_file.seek(0) + except IOError: + continue + try: + self._read(out_file, filename) + for group in self._sections.keys(): + try: + self._options_dict[group] + except KeyError: + self._options_dict[group] = {} + for option, value in self._sections[group].items(): + self._options_dict[group][option] = (value, priority) + + self._sections = self._dict() + + except MissingSectionHeaderError: + self._read(out_file, filename) + out_file.close() + read_ok.append(filename) + return read_ok + + def get_groups(self, *args): + """Returns options as a dictionary. + + Returns options from all the groups specified as arguments, returns + the options from all groups if no argument provided. Options are + overridden when they are found in the next group. + + Returns a dictionary + """ + if not args: + args = self._options_dict.keys() + + options = {} + priority = {} + for group in args: + try: + for option, value in [(key, value,) for key, value in + self._options_dict[group].items() if + key != "__name__" and + not key.startswith("!")]: + if option not in options or priority[option] <= value[1]: + priority[option] = value[1] + options[option] = value[0] + except KeyError: + pass + + return options + + def get_groups_as_dict_with_priority(self, *args): # pylint: disable=C0103 + """Returns options as dictionary of dictionaries. + + Returns options from all the groups specified as arguments. For each + group the option are contained in a dictionary. The order in which + the groups are specified is unimportant. Also options are not + overridden in between the groups. + + The value is a tuple with two elements, first being the actual value + and second is the priority of the value which is higher for a value + read from a higher priority file. + + Returns an dictionary of dictionaries + """ + if not args: + args = self._options_dict.keys() + + options = dict() + for group in args: + try: + options[group] = dict((key, value,) for key, value in + self._options_dict[group].items() if + key != "__name__" and + not key.startswith("!")) + except KeyError: + pass + + return options + + def get_groups_as_dict(self, *args): + """Returns options as dictionary of dictionaries. + + Returns options from all the groups specified as arguments. For each + group the option are contained in a dictionary. The order in which + the groups are specified is unimportant. Also options are not + overridden in between the groups. + + Returns an dictionary of dictionaries + """ + if not args: + args = self._options_dict.keys() + + options = dict() + for group in args: + try: + options[group] = dict((key, value[0],) for key, value in + self._options_dict[group].items() if + key != "__name__" and + not key.startswith("!")) + except KeyError: + pass + + return options diff --git a/venv/Lib/site-packages/mysql/connector/pooling.py b/venv/Lib/site-packages/mysql/connector/pooling.py new file mode 100644 index 0000000..3be8b3d --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/pooling.py @@ -0,0 +1,361 @@ +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementing pooling of connections to MySQL servers. +""" + +import re +from uuid import uuid4 +# pylint: disable=F0401 +try: + import queue +except ImportError: + # Python v2 + import Queue as queue +# pylint: enable=F0401 +import threading + +from . import errors +from .connection import MySQLConnection + +CONNECTION_POOL_LOCK = threading.RLock() +CNX_POOL_MAXSIZE = 32 +CNX_POOL_MAXNAMESIZE = 64 +CNX_POOL_NAMEREGEX = re.compile(r'[^a-zA-Z0-9._:\-*$#]') + + +def generate_pool_name(**kwargs): + """Generate a pool name + + This function takes keyword arguments, usually the connection + arguments for MySQLConnection, and tries to generate a name for + a pool. + + Raises PoolError when no name can be generated. + + Returns a string. + """ + parts = [] + for key in ('host', 'port', 'user', 'database'): + try: + parts.append(str(kwargs[key])) + except KeyError: + pass + + if not parts: + raise errors.PoolError( + "Failed generating pool name; specify pool_name") + + return '_'.join(parts) + + +class PooledMySQLConnection(object): + """Class holding a MySQL Connection in a pool + + PooledMySQLConnection is used by MySQLConnectionPool to return an + instance holding a MySQL connection. It works like a MySQLConnection + except for methods like close() and config(). + + The close()-method will add the connection back to the pool rather + than disconnecting from the MySQL server. + + Configuring the connection have to be done through the MySQLConnectionPool + method set_config(). Using config() on pooled connection will raise a + PoolError. + """ + def __init__(self, pool, cnx): + """Initialize + + The pool argument must be an instance of MySQLConnectionPoll. cnx + if an instance of MySQLConnection. + """ + if not isinstance(pool, MySQLConnectionPool): + raise AttributeError( + "pool should be a MySQLConnectionPool") + if not isinstance(cnx, MySQLConnection): + raise AttributeError( + "cnx should be a MySQLConnection") + self._cnx_pool = pool + self._cnx = cnx + + def __getattr__(self, attr): + """Calls attributes of the MySQLConnection instance""" + return getattr(self._cnx, attr) + + def close(self): + """Do not close, but add connection back to pool + + The close() method does not close the connection with the + MySQL server. The connection is added back to the pool so it + can be reused. + + When the pool is configured to reset the session, the session + state will be cleared by re-authenticating the user. + """ + try: + cnx = self._cnx + if self._cnx_pool.reset_session: + cnx.reset_session() + finally: + self._cnx_pool.add_connection(cnx) + self._cnx = None + + def config(self, **kwargs): + """Configuration is done through the pool""" + raise errors.PoolError( + "Configuration for pooled connections should " + "be done through the pool itself." + ) + + @property + def pool_name(self): + """Return the name of the connection pool""" + return self._cnx_pool.pool_name + + +class MySQLConnectionPool(object): + """Class defining a pool of MySQL connections""" + def __init__(self, pool_size=5, pool_name=None, pool_reset_session=True, + **kwargs): + """Initialize + + Initialize a MySQL connection pool with a maximum number of + connections set to pool_size. The rest of the keywords + arguments, kwargs, are configuration arguments for MySQLConnection + instances. + """ + self._pool_size = None + self._pool_name = None + self._reset_session = pool_reset_session + self._set_pool_size(pool_size) + self._set_pool_name(pool_name or generate_pool_name(**kwargs)) + self._cnx_config = {} + self._cnx_queue = queue.Queue(self._pool_size) + self._config_version = uuid4() + + if kwargs: + self.set_config(**kwargs) + cnt = 0 + while cnt < self._pool_size: + self.add_connection() + cnt += 1 + + @property + def pool_name(self): + """Return the name of the connection pool""" + return self._pool_name + + @property + def pool_size(self): + """Return number of connections managed by the pool""" + return self._pool_size + + @property + def reset_session(self): + """Return whether to reset session""" + return self._reset_session + + def set_config(self, **kwargs): + """Set the connection configuration for MySQLConnection instances + + This method sets the configuration used for creating MySQLConnection + instances. See MySQLConnection for valid connection arguments. + + Raises PoolError when a connection argument is not valid, missing + or not supported by MySQLConnection. + """ + if not kwargs: + return + + with CONNECTION_POOL_LOCK: + try: + test_cnx = MySQLConnection() + if "use_pure" in kwargs: + del kwargs["use_pure"] + test_cnx.config(**kwargs) + self._cnx_config = kwargs + self._config_version = uuid4() + except AttributeError as err: + raise errors.PoolError( + "Connection configuration not valid: {0}".format(err)) + + def _set_pool_size(self, pool_size): + """Set the size of the pool + + This method sets the size of the pool but it will not resize the pool. + + Raises an AttributeError when the pool_size is not valid. Invalid size + is 0, negative or higher than pooling.CNX_POOL_MAXSIZE. + """ + if pool_size <= 0 or pool_size > CNX_POOL_MAXSIZE: + raise AttributeError( + "Pool size should be higher than 0 and " + "lower or equal to {0}".format(CNX_POOL_MAXSIZE)) + self._pool_size = pool_size + + def _set_pool_name(self, pool_name): + r"""Set the name of the pool + + This method checks the validity and sets the name of the pool. + + Raises an AttributeError when pool_name contains illegal characters + ([^a-zA-Z0-9._\-*$#]) or is longer than pooling.CNX_POOL_MAXNAMESIZE. + """ + if CNX_POOL_NAMEREGEX.search(pool_name): + raise AttributeError( + "Pool name '{0}' contains illegal characters".format(pool_name)) + if len(pool_name) > CNX_POOL_MAXNAMESIZE: + raise AttributeError( + "Pool name '{0}' is too long".format(pool_name)) + self._pool_name = pool_name + + def _queue_connection(self, cnx): + """Put connection back in the queue + + This method is putting a connection back in the queue. It will not + acquire a lock as the methods using _queue_connection() will have it + set. + + Raises PoolError on errors. + """ + if not isinstance(cnx, MySQLConnection): + raise errors.PoolError( + "Connection instance not subclass of MySQLConnection.") + + try: + self._cnx_queue.put(cnx, block=False) + except queue.Full: + errors.PoolError("Failed adding connection; queue is full") + + def add_connection(self, cnx=None): + """Add a connection to the pool + + This method instantiates a MySQLConnection using the configuration + passed when initializing the MySQLConnectionPool instance or using + the set_config() method. + If cnx is a MySQLConnection instance, it will be added to the + queue. + + Raises PoolError when no configuration is set, when no more + connection can be added (maximum reached) or when the connection + can not be instantiated. + """ + with CONNECTION_POOL_LOCK: + if not self._cnx_config: + raise errors.PoolError( + "Connection configuration not available") + + if self._cnx_queue.full(): + raise errors.PoolError( + "Failed adding connection; queue is full") + + if not cnx: + cnx = MySQLConnection(**self._cnx_config) + try: + if (self._reset_session and self._cnx_config['compress'] + and cnx.get_server_version() < (5, 7, 3)): + raise errors.NotSupportedError("Pool reset session is " + "not supported with " + "compression for MySQL " + "server version 5.7.2 " + "or earlier.") + except KeyError: + pass + + # pylint: disable=W0201,W0212 + cnx._pool_config_version = self._config_version + # pylint: enable=W0201,W0212 + else: + if not isinstance(cnx, MySQLConnection): + raise errors.PoolError( + "Connection instance not subclass of MySQLConnection.") + + self._queue_connection(cnx) + + def get_connection(self): + """Get a connection from the pool + + This method returns an PooledMySQLConnection instance which + has a reference to the pool that created it, and the next available + MySQL connection. + + When the MySQL connection is not connect, a reconnect is attempted. + + Raises PoolError on errors. + + Returns a PooledMySQLConnection instance. + """ + with CONNECTION_POOL_LOCK: + try: + cnx = self._cnx_queue.get(block=False) + except queue.Empty: + raise errors.PoolError( + "Failed getting connection; pool exhausted") + + # pylint: disable=W0201,W0212 + if not cnx.is_connected() \ + or self._config_version != cnx._pool_config_version: + cnx.config(**self._cnx_config) + try: + cnx.reconnect() + except errors.InterfaceError: + # Failed to reconnect, give connection back to pool + self._queue_connection(cnx) + raise + cnx._pool_config_version = self._config_version + # pylint: enable=W0201,W0212 + + return PooledMySQLConnection(self, cnx) + + def _remove_connections(self): + """Close all connections + + This method closes all connections. It returns the number + of connections it closed. + + Used mostly for tests. + + Returns int. + """ + with CONNECTION_POOL_LOCK: + cnt = 0 + cnxq = self._cnx_queue + while cnxq.qsize(): + try: + cnx = cnxq.get(block=False) + cnx.disconnect() + cnt += 1 + except queue.Empty: + return cnt + except errors.PoolError: + raise + except errors.Error: + # Any other error when closing means connection is closed + pass + + return cnt diff --git a/venv/Lib/site-packages/mysql/connector/protocol.py b/venv/Lib/site-packages/mysql/connector/protocol.py new file mode 100644 index 0000000..d292c77 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/protocol.py @@ -0,0 +1,742 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implements the MySQL Client/Server protocol +""" + +import struct +import datetime +from decimal import Decimal + +from .constants import ( + FieldFlag, ServerCmd, FieldType, ClientFlag) +from . import errors, utils +from .authentication import get_auth_plugin +from .catch23 import PY2, struct_unpack +from .errors import DatabaseError, get_exception + +PROTOCOL_VERSION = 10 + + +class MySQLProtocol(object): + """Implements MySQL client/server protocol + + Create and parses MySQL packets. + """ + + def _connect_with_db(self, client_flags, database): + """Prepare database string for handshake response""" + if client_flags & ClientFlag.CONNECT_WITH_DB and database: + return database.encode('utf8') + b'\x00' + return b'\x00' + + def _auth_response(self, client_flags, username, password, database, + auth_plugin, auth_data, ssl_enabled): + """Prepare the authentication response""" + if not password: + return b'\x00' + + try: + auth = get_auth_plugin(auth_plugin)( + auth_data, + username=username, password=password, database=database, + ssl_enabled=ssl_enabled) + plugin_auth_response = auth.auth_response() + except (TypeError, errors.InterfaceError) as exc: + raise errors.InterfaceError( + "Failed authentication: {0}".format(str(exc))) + + if client_flags & ClientFlag.SECURE_CONNECTION: + resplen = len(plugin_auth_response) + auth_response = struct.pack('= 7: + mcs = 0 + if length == 11: + mcs = struct_unpack('I', packet[8:length + 1])[0] + value = datetime.datetime( + year=struct_unpack('H', packet[1:3])[0], + month=packet[3], + day=packet[4], + hour=packet[5], + minute=packet[6], + second=packet[7], + microsecond=mcs) + + return (packet[length + 1:], value) + + def _parse_binary_time(self, packet, field): + """Parse a time value from a binary packet""" + length = packet[0] + data = packet[1:length + 1] + mcs = 0 + if length > 8: + mcs = struct_unpack('I', data[8:])[0] + days = struct_unpack('I', data[1:5])[0] + if data[0] == 1: + days *= -1 + tmp = datetime.timedelta(days=days, + seconds=data[7], + microseconds=mcs, + minutes=data[6], + hours=data[5]) + + return (packet[length + 1:], tmp) + + def _parse_binary_values(self, fields, packet, charset='utf-8'): + """Parse values from a binary result packet""" + null_bitmap_length = (len(fields) + 7 + 2) // 8 + null_bitmap = [int(i) for i in packet[0:null_bitmap_length]] + packet = packet[null_bitmap_length:] + + values = [] + for pos, field in enumerate(fields): + if null_bitmap[int((pos+2)/8)] & (1 << (pos + 2) % 8): + values.append(None) + continue + elif field[1] in (FieldType.TINY, FieldType.SHORT, + FieldType.INT24, + FieldType.LONG, FieldType.LONGLONG): + (packet, value) = self._parse_binary_integer(packet, field) + values.append(value) + elif field[1] in (FieldType.DOUBLE, FieldType.FLOAT): + (packet, value) = self._parse_binary_float(packet, field) + values.append(value) + elif field[1] in (FieldType.DATETIME, FieldType.DATE, + FieldType.TIMESTAMP): + (packet, value) = self._parse_binary_timestamp(packet, field) + values.append(value) + elif field[1] == FieldType.TIME: + (packet, value) = self._parse_binary_time(packet, field) + values.append(value) + else: + (packet, value) = utils.read_lc_string(packet) + values.append(value.decode(charset)) + + return tuple(values) + + def read_binary_result(self, sock, columns, count=1, charset='utf-8'): + """Read MySQL binary protocol result + + Reads all or given number of binary resultset rows from the socket. + """ + rows = [] + eof = None + values = None + i = 0 + while True: + if eof is not None: + break + if i == count: + break + packet = sock.recv() + if packet[4] == 254: + eof = self.parse_eof(packet) + values = None + elif packet[4] == 0: + eof = None + values = self._parse_binary_values(columns, packet[5:], charset) + if eof is None and values is not None: + rows.append(values) + elif eof is None and values is None: + raise get_exception(packet) + i += 1 + return (rows, eof) + + def parse_binary_prepare_ok(self, packet): + """Parse a MySQL Binary Protocol OK packet""" + if not packet[4] == 0: + raise errors.InterfaceError("Failed parsing Binary OK packet") + + ok_pkt = {} + try: + (packet, ok_pkt['statement_id']) = utils.read_int(packet[5:], 4) + (packet, ok_pkt['num_columns']) = utils.read_int(packet, 2) + (packet, ok_pkt['num_params']) = utils.read_int(packet, 2) + packet = packet[1:] # Filler 1 * \x00 + (packet, ok_pkt['warning_count']) = utils.read_int(packet, 2) + except ValueError: + raise errors.InterfaceError("Failed parsing Binary OK packet") + + return ok_pkt + + def _prepare_binary_integer(self, value): + """Prepare an integer for the MySQL binary protocol""" + field_type = None + flags = 0 + if value < 0: + if value >= -128: + format_ = 'b' + field_type = FieldType.TINY + elif value >= -32768: + format_ = 'h' + field_type = FieldType.SHORT + elif value >= -2147483648: + format_ = 'i' + field_type = FieldType.LONG + else: + format_ = 'q' + field_type = FieldType.LONGLONG + else: + flags = 128 + if value <= 255: + format_ = 'B' + field_type = FieldType.TINY + elif value <= 65535: + format_ = 'H' + field_type = FieldType.SHORT + elif value <= 4294967295: + format_ = 'I' + field_type = FieldType.LONG + else: + field_type = FieldType.LONGLONG + format_ = 'Q' + return (struct.pack(format_, value), field_type, flags) + + def _prepare_binary_timestamp(self, value): + """Prepare a timestamp object for the MySQL binary protocol + + This method prepares a timestamp of type datetime.datetime or + datetime.date for sending over the MySQL binary protocol. + A tuple is returned with the prepared value and field type + as elements. + + Raises ValueError when the argument value is of invalid type. + + Returns a tuple. + """ + if isinstance(value, datetime.datetime): + field_type = FieldType.DATETIME + elif isinstance(value, datetime.date): + field_type = FieldType.DATE + else: + raise ValueError( + "Argument must a datetime.datetime or datetime.date") + + packed = (utils.int2store(value.year) + + utils.int1store(value.month) + + utils.int1store(value.day)) + + if isinstance(value, datetime.datetime): + packed = (packed + utils.int1store(value.hour) + + utils.int1store(value.minute) + + utils.int1store(value.second)) + if value.microsecond > 0: + packed += utils.int4store(value.microsecond) + + packed = utils.int1store(len(packed)) + packed + return (packed, field_type) + + def _prepare_binary_time(self, value): + """Prepare a time object for the MySQL binary protocol + + This method prepares a time object of type datetime.timedelta or + datetime.time for sending over the MySQL binary protocol. + A tuple is returned with the prepared value and field type + as elements. + + Raises ValueError when the argument value is of invalid type. + + Returns a tuple. + """ + if not isinstance(value, (datetime.timedelta, datetime.time)): + raise ValueError( + "Argument must a datetime.timedelta or datetime.time") + + field_type = FieldType.TIME + negative = 0 + mcs = None + packed = b'' + + if isinstance(value, datetime.timedelta): + if value.days < 0: + negative = 1 + (hours, remainder) = divmod(value.seconds, 3600) + (mins, secs) = divmod(remainder, 60) + packed += (utils.int4store(abs(value.days)) + + utils.int1store(hours) + + utils.int1store(mins) + + utils.int1store(secs)) + mcs = value.microseconds + else: + packed += (utils.int4store(0) + + utils.int1store(value.hour) + + utils.int1store(value.minute) + + utils.int1store(value.second)) + mcs = value.microsecond + if mcs: + packed += utils.int4store(mcs) + + packed = utils.int1store(negative) + packed + packed = utils.int1store(len(packed)) + packed + + return (packed, field_type) + + def _prepare_stmt_send_long_data(self, statement, param, data): + """Prepare long data for prepared statements + + Returns a string. + """ + packet = ( + utils.int4store(statement) + + utils.int2store(param) + + data) + return packet + + def make_stmt_execute(self, statement_id, data=(), parameters=(), + flags=0, long_data_used=None, charset='utf8'): + """Make a MySQL packet with the Statement Execute command""" + iteration_count = 1 + null_bitmap = [0] * ((len(data) + 7) // 8) + values = [] + types = [] + packed = b'' + if charset == 'utf8mb4': + charset = 'utf8' + if long_data_used is None: + long_data_used = {} + if parameters and data: + if len(data) != len(parameters): + raise errors.InterfaceError( + "Failed executing prepared statement: data values does not" + " match number of parameters") + for pos, _ in enumerate(parameters): + value = data[pos] + flags = 0 + if value is None: + null_bitmap[(pos // 8)] |= 1 << (pos % 8) + types.append(utils.int1store(FieldType.NULL) + + utils.int1store(flags)) + continue + elif pos in long_data_used: + if long_data_used[pos][0]: + # We suppose binary data + field_type = FieldType.BLOB + else: + # We suppose text data + field_type = FieldType.STRING + elif isinstance(value, int): + (packed, field_type, + flags) = self._prepare_binary_integer(value) + values.append(packed) + elif isinstance(value, str): + if PY2: + values.append(utils.lc_int(len(value)) + + value) + else: + value = value.encode(charset) + values.append( + utils.lc_int(len(value)) + value) + field_type = FieldType.VARCHAR + elif isinstance(value, bytes): + values.append(utils.lc_int(len(value)) + value) + field_type = FieldType.BLOB + elif PY2 and \ + isinstance(value, unicode): # pylint: disable=E0602 + value = value.encode(charset) + values.append(utils.lc_int(len(value)) + value) + field_type = FieldType.VARCHAR + elif isinstance(value, Decimal): + values.append( + utils.lc_int(len(str(value).encode( + charset))) + str(value).encode(charset)) + field_type = FieldType.DECIMAL + elif isinstance(value, float): + values.append(struct.pack('d', value)) + field_type = FieldType.DOUBLE + elif isinstance(value, (datetime.datetime, datetime.date)): + (packed, field_type) = self._prepare_binary_timestamp( + value) + values.append(packed) + elif isinstance(value, (datetime.timedelta, datetime.time)): + (packed, field_type) = self._prepare_binary_time(value) + values.append(packed) + else: + raise errors.ProgrammingError( + "MySQL binary protocol can not handle " + "'{classname}' objects".format( + classname=value.__class__.__name__)) + types.append(utils.int1store(field_type) + + utils.int1store(flags)) + + packet = ( + utils.int4store(statement_id) + + utils.int1store(flags) + + utils.int4store(iteration_count) + + b''.join([struct.pack('B', bit) for bit in null_bitmap]) + + utils.int1store(1) + ) + + for a_type in types: + packet += a_type + + for a_value in values: + packet += a_value + + return packet + + def parse_auth_switch_request(self, packet): + """Parse a MySQL AuthSwitchRequest-packet""" + if not packet[4] == 254: + raise errors.InterfaceError( + "Failed parsing AuthSwitchRequest packet") + + (packet, plugin_name) = utils.read_string(packet[5:], end=b'\x00') + if packet and packet[-1] == 0: + packet = packet[:-1] + + return plugin_name.decode('utf8'), packet + + def parse_auth_more_data(self, packet): + """Parse a MySQL AuthMoreData-packet""" + if not packet[4] == 1: + raise errors.InterfaceError( + "Failed parsing AuthMoreData packet") + + return packet[5:] diff --git a/venv/Lib/site-packages/mysql/connector/utils.py b/venv/Lib/site-packages/mysql/connector/utils.py new file mode 100644 index 0000000..2fa31b9 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/utils.py @@ -0,0 +1,342 @@ +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Utilities +""" + +from __future__ import print_function + +__MYSQL_DEBUG__ = False + +import struct + +from .catch23 import struct_unpack + +def intread(buf): + """Unpacks the given buffer to an integer""" + try: + if isinstance(buf, int): + return buf + length = len(buf) + if length == 1: + return buf[0] + elif length <= 4: + tmp = buf + b'\x00'*(4-length) + return struct_unpack(' 255: + raise ValueError('int1store requires 0 <= i <= 255') + else: + return bytearray(struct.pack(' 65535: + raise ValueError('int2store requires 0 <= i <= 65535') + else: + return bytearray(struct.pack(' 16777215: + raise ValueError('int3store requires 0 <= i <= 16777215') + else: + return bytearray(struct.pack(' 4294967295: + raise ValueError('int4store requires 0 <= i <= 4294967295') + else: + return bytearray(struct.pack(' 18446744073709551616: + raise ValueError('int8store requires 0 <= i <= 2^64') + else: + return bytearray(struct.pack(' 18446744073709551616: + raise ValueError('intstore requires 0 <= i <= 2^64') + + if i <= 255: + formed_string = int1store + elif i <= 65535: + formed_string = int2store + elif i <= 16777215: + formed_string = int3store + elif i <= 4294967295: + formed_string = int4store + else: + formed_string = int8store + + return formed_string(i) + + +def lc_int(i): + """ + Takes an unsigned integer and packs it as bytes, + with the information of how much bytes the encoded int takes. + """ + if i < 0 or i > 18446744073709551616: + raise ValueError('Requires 0 <= i <= 2^64') + + if i < 251: + return bytearray(struct.pack(' + +----------+------------------------- + | length | a string goes here + +----------+------------------------- + + If the string is bigger than 250, then it looks like this: + + <- 1b -><- 2/3/8 -> + +------+-----------+------------------------- + | type | length | a string goes here + +------+-----------+------------------------- + + if type == \xfc: + length is code in next 2 bytes + elif type == \xfd: + length is code in next 3 bytes + elif type == \xfe: + length is code in next 8 bytes + + NULL has a special value. If the buffer starts with \xfb then + it's a NULL and we return None as value. + + Returns a tuple (trucated buffer, bytes). + """ + if buf[0] == 251: # \xfb + # NULL value + return (buf[1:], None) + + length = lsize = 0 + fst = buf[0] + + if fst <= 250: # \xFA + length = fst + return (buf[1 + length:], buf[1:length + 1]) + elif fst == 252: + lsize = 2 + elif fst == 253: + lsize = 3 + if fst == 254: + lsize = 8 + + length = intread(buf[1:lsize + 1]) + return (buf[lsize + length + 1:], buf[lsize + 1:length + lsize + 1]) + + +def read_lc_string_list(buf): + """Reads all length encoded strings from the given buffer + + Returns a list of bytes + """ + byteslst = [] + + sizes = {252: 2, 253: 3, 254: 8} + + buf_len = len(buf) + pos = 0 + + while pos < buf_len: + first = buf[pos] + if first == 255: + # Special case when MySQL error 1317 is returned by MySQL. + # We simply return None. + return None + if first == 251: + # NULL value + byteslst.append(None) + pos += 1 + else: + if first <= 250: + length = first + byteslst.append(buf[(pos + 1):length + (pos + 1)]) + pos += 1 + length + else: + lsize = 0 + try: + lsize = sizes[first] + except KeyError: + return None + length = intread(buf[(pos + 1):lsize + (pos + 1)]) + byteslst.append( + buf[pos + 1 + lsize:length + lsize + (pos + 1)]) + pos += 1 + lsize + length + + return tuple(byteslst) + + +def read_string(buf, end=None, size=None): + """ + Reads a string up until a character or for a given size. + + Returns a tuple (trucated buffer, string). + """ + if end is None and size is None: + raise ValueError('read_string() needs either end or size') + + if end is not None: + try: + idx = buf.index(end) + except ValueError: + raise ValueError("end byte not present in buffer") + return (buf[idx + 1:], buf[0:idx]) + elif size is not None: + return read_bytes(buf, size) + + raise ValueError('read_string() needs either end or size (weird)') + + +def read_int(buf, size): + """Read an integer from buffer + + Returns a tuple (truncated buffer, int) + """ + + try: + res = intread(buf[0:size]) + except: + raise + + return (buf[size:], res) + + +def read_lc_int(buf): + """ + Takes a buffer and reads an length code string from the start. + + Returns a tuple with buffer less the integer and the integer read. + """ + if not buf: + raise ValueError("Empty buffer.") + + lcbyte = buf[0] + if lcbyte == 251: + return (buf[1:], None) + elif lcbyte < 251: + return (buf[1:], int(lcbyte)) + elif lcbyte == 252: + return (buf[3:], struct_unpack(' 0: + digest = _digest_buffer(abuffer[0:limit]) + else: + digest = _digest_buffer(abuffer) + print(prefix + ': ' + digest) + else: + print(_digest_buffer(abuffer)) diff --git a/venv/Lib/site-packages/mysql/connector/version.py b/venv/Lib/site-packages/mysql/connector/version.py new file mode 100644 index 0000000..3613915 --- /dev/null +++ b/venv/Lib/site-packages/mysql/connector/version.py @@ -0,0 +1,44 @@ +# Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""MySQL Connector/Python version information + +The file version.py gets installed and is available after installation +as mysql.connector.version. +""" + +VERSION = (8, 0, 15, '', 1) + +if VERSION[3] and VERSION[4]: + VERSION_TEXT = '{0}.{1}.{2}{3}{4}'.format(*VERSION) +else: + VERSION_TEXT = '{0}.{1}.{2}'.format(*VERSION[0:3]) + +VERSION_EXTRA = '' +LICENSE = 'GPLv2 with FOSS License Exception' +EDITION = '' # Added in package names, after the version diff --git a/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/PKG-INFO b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/PKG-INFO new file mode 100644 index 0000000..2c0331b --- /dev/null +++ b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/PKG-INFO @@ -0,0 +1,33 @@ +Metadata-Version: 1.1 +Name: mysql-connector-python +Version: 8.0.15 +Summary: MySQL driver written in Python +Home-page: http://dev.mysql.com/doc/connector-python/en/index.html +Author: Oracle and/or its affiliates +Author-email: UNKNOWN +License: GNU GPLv2 (with FOSS License Exception) +Download-URL: http://dev.mysql.com/downloads/connector/python/ +Description: + MySQL driver written in Python which does not depend on MySQL C client + libraries and implements the DB API v2.0 specification (PEP-249). + +Keywords: mysql db +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Other Environment +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: GNU General Public License (GPL) +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Topic :: Database +Classifier: Topic :: Software Development +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks +Classifier: Topic :: Software Development :: Libraries :: Python Modules diff --git a/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/SOURCES.txt b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/SOURCES.txt new file mode 100644 index 0000000..bc8ed61 --- /dev/null +++ b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/SOURCES.txt @@ -0,0 +1,201 @@ +CHANGES.txt +LICENSE.txt +MANIFEST.in +README.txt +setup.py +setupinfo.py +unittests.py +docs/README_DOCS.txt +examples/__init__.py +examples/dates.py +examples/engines.py +examples/inserts.py +examples/microseconds.py +examples/multi_resultsets.py +examples/mysql_warnings.py +examples/prepared_statements.py +examples/transaction.py +examples/unicode.py +examples/warnings.py +lib/__init__.py +lib/cpy_distutils.py +lib/mysql/__init__.py +lib/mysql/connector/__init__.py +lib/mysql/connector/abstracts.py +lib/mysql/connector/authentication.py +lib/mysql/connector/catch23.py +lib/mysql/connector/charsets.py +lib/mysql/connector/connection.py +lib/mysql/connector/connection_cext.py +lib/mysql/connector/constants.py +lib/mysql/connector/conversion.py +lib/mysql/connector/cursor.py +lib/mysql/connector/cursor_cext.py +lib/mysql/connector/custom_types.py +lib/mysql/connector/dbapi.py +lib/mysql/connector/errorcode.py +lib/mysql/connector/errors.py +lib/mysql/connector/network.py +lib/mysql/connector/optionfiles.py +lib/mysql/connector/pooling.py +lib/mysql/connector/protocol.py +lib/mysql/connector/utils.py +lib/mysql/connector/version.py +lib/mysql/connector/django/__init__.py +lib/mysql/connector/django/base.py +lib/mysql/connector/django/client.py +lib/mysql/connector/django/compiler.py +lib/mysql/connector/django/creation.py +lib/mysql/connector/django/features.py +lib/mysql/connector/django/introspection.py +lib/mysql/connector/django/operations.py +lib/mysql/connector/django/schema.py +lib/mysql/connector/django/validation.py +lib/mysql/connector/locales/__init__.py +lib/mysql/connector/locales/eng/__init__.py +lib/mysql/connector/locales/eng/client_error.py +lib/mysql_connector_python.egg-info/PKG-INFO +lib/mysql_connector_python.egg-info/SOURCES.txt +lib/mysql_connector_python.egg-info/dependency_links.txt +lib/mysql_connector_python.egg-info/requires.txt +lib/mysql_connector_python.egg-info/top_level.txt +lib/mysqlx/__init__.py +lib/mysqlx/authentication.py +lib/mysqlx/charsets.py +lib/mysqlx/compat.py +lib/mysqlx/connection.py +lib/mysqlx/constants.py +lib/mysqlx/crud.py +lib/mysqlx/dbdoc.py +lib/mysqlx/errorcode.py +lib/mysqlx/errors.py +lib/mysqlx/expr.py +lib/mysqlx/helpers.py +lib/mysqlx/protocol.py +lib/mysqlx/result.py +lib/mysqlx/statement.py +lib/mysqlx/locales/__init__.py +lib/mysqlx/locales/eng/__init__.py +lib/mysqlx/locales/eng/client_error.py +lib/mysqlx/protobuf/__init__.py +lib/mysqlx/protobuf/mysqlx_connection_pb2.py +lib/mysqlx/protobuf/mysqlx_crud_pb2.py +lib/mysqlx/protobuf/mysqlx_datatypes_pb2.py +lib/mysqlx/protobuf/mysqlx_expect_pb2.py +lib/mysqlx/protobuf/mysqlx_expr_pb2.py +lib/mysqlx/protobuf/mysqlx_notice_pb2.py +lib/mysqlx/protobuf/mysqlx_pb2.py +lib/mysqlx/protobuf/mysqlx_resultset_pb2.py +lib/mysqlx/protobuf/mysqlx_session_pb2.py +lib/mysqlx/protobuf/mysqlx_sql_pb2.py +src/exceptions.c +src/force_cpp_linkage.cc +src/mysql_capi.c +src/mysql_capi_conversion.c +src/mysql_connector.c +src/mysqlxpb/mysqlxpb.cc +src/mysqlxpb/mysqlx/mysqlx.pb.cc +src/mysqlxpb/mysqlx/mysqlx_connection.pb.cc +src/mysqlxpb/mysqlx/mysqlx_crud.pb.cc +src/mysqlxpb/mysqlx/mysqlx_datatypes.pb.cc +src/mysqlxpb/mysqlx/mysqlx_expect.pb.cc +src/mysqlxpb/mysqlx/mysqlx_expr.pb.cc +src/mysqlxpb/mysqlx/mysqlx_notice.pb.cc +src/mysqlxpb/mysqlx/mysqlx_resultset.pb.cc +src/mysqlxpb/mysqlx/mysqlx_session.pb.cc +src/mysqlxpb/mysqlx/mysqlx_sql.pb.cc +src/include/catch23.h +src/include/exceptions.h +src/include/mysql_capi.h +src/include/mysql_capi_conversion.h +src/include/mysql_connector.h +src/mysqlxpb/mysqlxpb.cc +src/mysqlxpb/python.h +src/mysqlxpb/python_cast.h +src/mysqlxpb/mysqlx/mysqlx.pb.cc +src/mysqlxpb/mysqlx/mysqlx.pb.h +src/mysqlxpb/mysqlx/mysqlx_connection.pb.cc +src/mysqlxpb/mysqlx/mysqlx_connection.pb.h +src/mysqlxpb/mysqlx/mysqlx_crud.pb.cc +src/mysqlxpb/mysqlx/mysqlx_crud.pb.h +src/mysqlxpb/mysqlx/mysqlx_datatypes.pb.cc +src/mysqlxpb/mysqlx/mysqlx_datatypes.pb.h +src/mysqlxpb/mysqlx/mysqlx_expect.pb.cc +src/mysqlxpb/mysqlx/mysqlx_expect.pb.h +src/mysqlxpb/mysqlx/mysqlx_expr.pb.cc +src/mysqlxpb/mysqlx/mysqlx_expr.pb.h +src/mysqlxpb/mysqlx/mysqlx_notice.pb.cc +src/mysqlxpb/mysqlx/mysqlx_notice.pb.h +src/mysqlxpb/mysqlx/mysqlx_resultset.pb.cc +src/mysqlxpb/mysqlx/mysqlx_resultset.pb.h +src/mysqlxpb/mysqlx/mysqlx_session.pb.cc +src/mysqlxpb/mysqlx/mysqlx_session.pb.h +src/mysqlxpb/mysqlx/mysqlx_sql.pb.cc +src/mysqlxpb/mysqlx/mysqlx_sql.pb.h +src/mysqlxpb/mysqlx/protocol/mysqlx.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_connection.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_crud.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_datatypes.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_expect.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_expr.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_notice.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_resultset.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_session.proto +src/mysqlxpb/mysqlx/protocol/mysqlx_sql.proto +tests/__init__.py +tests/mysqld.py +tests/py26.py +tests/test_abstracts.py +tests/test_authentication.py +tests/test_bugs.py +tests/test_connection.py +tests/test_constants.py +tests/test_conversion.py +tests/test_cursor.py +tests/test_django.py +tests/test_errorcode.py +tests/test_errors.py +tests/test_examples.py +tests/test_locales.py +tests/test_mysql_datatypes.py +tests/test_mysqlx_connection.py +tests/test_mysqlx_crud.py +tests/test_mysqlx_errorcode.py +tests/test_mysqlx_errors.py +tests/test_mysqlx_pooling.py +tests/test_mysqlx_style.py +tests/test_network.py +tests/test_optionfiles.py +tests/test_pep249.py +tests/test_pooling.py +tests/test_protocol.py +tests/test_setup.py +tests/test_style.py +tests/test_utils.py +tests/cext/__init__.py +tests/cext/test_cext_api.py +tests/cext/test_cext_connection.py +tests/cext/test_cext_cursor.py +tests/data/local_data.csv +tests/data/random_big_bin.csv +tests/data/option_files/dup_groups.cnf +tests/data/option_files/my.cnf +tests/data/option_files/pool.cnf +tests/data/option_files/include_files/1.cnf +tests/data/option_files/include_files/2.cnf +tests/data/ssl/tests_CA_cert.pem +tests/data/ssl/tests_CA_cert_1.pem +tests/data/ssl/tests_CA_key.pem +tests/data/ssl/tests_CA_key_1.pem +tests/data/ssl/tests_client_cert.pem +tests/data/ssl/tests_client_key.pem +tests/data/ssl/tests_expired_server_cert.pem +tests/data/ssl/tests_expired_server_key.pem +tests/data/ssl/tests_server_cert.pem +tests/data/ssl/tests_server_key.pem +tests/issues/__init__.py +tests/issues/test_bug21449207.py +tests/issues/test_bug21449996.py +tests/issues/test_bug21879859.py +tests/issues/test_bug21879914.py +tests/issues/test_bug22545879.py \ No newline at end of file diff --git a/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/dependency_links.txt b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/requires.txt b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/requires.txt new file mode 100644 index 0000000..d5adad1 --- /dev/null +++ b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/requires.txt @@ -0,0 +1 @@ +protobuf>=3.0.0 diff --git a/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/top_level.txt b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/top_level.txt new file mode 100644 index 0000000..d05e344 --- /dev/null +++ b/venv/Lib/site-packages/mysql_connector_python-8.0.15-py3.6.egg-info/top_level.txt @@ -0,0 +1,4 @@ +_mysql_connector +_mysqlxpb +mysql +mysqlx diff --git a/venv/Lib/site-packages/mysqlx/__init__.py b/venv/Lib/site-packages/mysqlx/__init__.py new file mode 100644 index 0000000..774a9b3 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/__init__.py @@ -0,0 +1,412 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""MySQL X DevAPI Python implementation""" + +import re +import json + +from . import constants +from .compat import (INT_TYPES, STRING_TYPES, JSONDecodeError, urlparse, + unquote, parse_qsl) +from .connection import Client, Session +from .constants import Auth, LockContention, SSLMode +from .crud import Schema, Collection, Table, View +from .dbdoc import DbDoc +# pylint: disable=W0622 +from .errors import (Error, InterfaceError, DatabaseError, NotSupportedError, + DataError, IntegrityError, ProgrammingError, + OperationalError, InternalError, PoolError, TimeoutError) +from .result import (Column, Row, Result, BufferingResult, RowResult, + SqlResult, DocResult, ColumnType) +from .statement import (Statement, FilterableStatement, SqlStatement, + FindStatement, AddStatement, RemoveStatement, + ModifyStatement, SelectStatement, InsertStatement, + DeleteStatement, UpdateStatement, + CreateCollectionIndexStatement, Expr, ReadStatement, + WriteStatement) + +from .expr import ExprParser as expr + +_SPLIT = re.compile(r',(?![^\(\)]*\))') +_PRIORITY = re.compile(r'^\(address=(.+),priority=(\d+)\)$', re.VERBOSE) +_SSL_OPTS = ["ssl-cert", "ssl-ca", "ssl-key", "ssl-crl"] +_SESS_OPTS = _SSL_OPTS + ["user", "password", "schema", "host", "port", + "routers", "socket", "ssl-mode", "auth", "use-pure", + "connect-timeout"] + +def _parse_address_list(path): + """Parses a list of host, port pairs + + Args: + path: String containing a list of routers or just router + + Returns: + Returns a dict with parsed values of host, port and priority if + specified. + """ + path = path.replace(" ", "") + array = not("," not in path and path.count(":") > 1 + and path.count("[") == 1) and path.startswith("[") \ + and path.endswith("]") + + routers = [] + address_list = _SPLIT.split(path[1:-1] if array else path) + for address in address_list: + router = {} + + match = _PRIORITY.match(address) + if match: + address = match.group(1) + router["priority"] = int(match.group(2)) + + match = urlparse("//{0}".format(address)) + if not match.hostname: + raise InterfaceError("Invalid address: {0}".format(address)) + + router.update(host=match.hostname, port=match.port) + routers.append(router) + + return {"routers": routers} if array else routers[0] + + +def _parse_connection_uri(uri): + """Parses the connection string and returns a dictionary with the + connection settings. + + Args: + uri: mysqlx URI scheme to connect to a MySQL server/farm. + + Returns: + Returns a dict with parsed values of credentials and address of the + MySQL server/farm. + """ + settings = {"schema": ""} + uri = "{0}{1}".format("" if uri.startswith("mysqlx://") + else "mysqlx://", uri) + _, temp = uri.split("://", 1) + userinfo, temp = temp.partition("@")[::2] + host, query_str = temp.partition("?")[::2] + + pos = host.rfind("/") + if host[pos:].find(")") == -1 and pos > 0: + host, settings["schema"] = host.rsplit("/", 1) + host = host.strip("()") + + if not host or not userinfo or ":" not in userinfo: + raise InterfaceError("Malformed URI '{0}'".format(uri)) + user, password = userinfo.split(":", 1) + settings["user"], settings["password"] = unquote(user), unquote(password) + + if host.startswith(("/", "..", ".")): + settings["socket"] = unquote(host) + elif host.startswith("\\."): + raise InterfaceError("Windows Pipe is not supported.") + else: + settings.update(_parse_address_list(host)) + + for key, val in parse_qsl(query_str, True): + opt = key.replace("_", "-").lower() + if opt in settings: + raise InterfaceError("Duplicate option '{0}'.".format(key)) + if opt in _SSL_OPTS: + settings[opt] = unquote(val.strip("()")) + else: + val_str = val.lower() + if val_str in ("1", "true"): + settings[opt] = True + elif val_str in ("0", "false"): + settings[opt] = False + else: + settings[opt] = val_str + return settings + + +def _validate_settings(settings): + """Validates the settings to be passed to a Session object + the port values are converted to int if specified or set to 33060 + otherwise. The priority values for each router is converted to int + if specified. + + Args: + settings: dict containing connection settings. + """ + invalid_opts = set(settings.keys()).difference(_SESS_OPTS) + if invalid_opts: + raise ProgrammingError("Invalid options: {0}." + "".format(", ".join(invalid_opts))) + + if "routers" in settings: + for router in settings["routers"]: + _validate_hosts(router) + elif "host" in settings: + _validate_hosts(settings) + + if "ssl-mode" in settings: + try: + settings["ssl-mode"] = settings["ssl-mode"].lower() + SSLMode.index(settings["ssl-mode"]) + except (AttributeError, ValueError): + raise InterfaceError("Invalid SSL Mode '{0}'." + "".format(settings["ssl-mode"])) + if settings["ssl-mode"] == SSLMode.DISABLED and \ + any(key in settings for key in _SSL_OPTS): + raise InterfaceError("SSL options used with ssl-mode 'disabled'.") + + if "ssl-crl" in settings and not "ssl-ca" in settings: + raise InterfaceError("CA Certificate not provided.") + if "ssl-key" in settings and not "ssl-cert" in settings: + raise InterfaceError("Client Certificate not provided.") + + if not "ssl-ca" in settings and settings.get("ssl-mode") \ + in [SSLMode.VERIFY_IDENTITY, SSLMode.VERIFY_CA]: + raise InterfaceError("Cannot verify Server without CA.") + if "ssl-ca" in settings and settings.get("ssl-mode") \ + not in [SSLMode.VERIFY_IDENTITY, SSLMode.VERIFY_CA]: + raise InterfaceError("Must verify Server if CA is provided.") + + if "auth" in settings: + try: + settings["auth"] = settings["auth"].lower() + Auth.index(settings["auth"]) + except (AttributeError, ValueError): + raise InterfaceError("Invalid Auth '{0}'".format(settings["auth"])) + + +def _validate_hosts(settings): + """Validate hosts. + + Args: + settings (dict): Settings dictionary. + + Raises: + :class:`mysqlx.InterfaceError`: If priority or port are invalid. + """ + if "priority" in settings and settings["priority"]: + try: + settings["priority"] = int(settings["priority"]) + except NameError: + raise InterfaceError("Invalid priority") + + if "port" in settings and settings["port"]: + try: + settings["port"] = int(settings["port"]) + except NameError: + raise InterfaceError("Invalid port") + elif "host" in settings: + settings["port"] = 33060 + + +def _get_connection_settings(*args, **kwargs): + """Parses the connection string and returns a dictionary with the + connection settings. + + Args: + *args: Variable length argument list with the connection data used + to connect to the database. It can be a dictionary or a + connection string. + **kwargs: Arbitrary keyword arguments with connection data used to + connect to the database. + + Returns: + mysqlx.Session: Session object. + + Raises: + TypeError: If connection timeout is not a positive integer. + """ + settings = {} + if args: + if isinstance(args[0], STRING_TYPES): + settings = _parse_connection_uri(args[0]) + elif isinstance(args[0], dict): + for key, val in args[0].items(): + settings[key.replace("_", "-")] = val + elif kwargs: + settings.update(kwargs) + for key in settings: + if "_" in key: + settings[key.replace("_", "-")] = settings.pop(key) + + if not settings: + raise InterfaceError("Settings not provided") + + if "connect-timeout" in settings: + try: + if isinstance(settings["connect-timeout"], STRING_TYPES): + settings["connect-timeout"] = int(settings["connect-timeout"]) + if not isinstance(settings["connect-timeout"], INT_TYPES) \ + or settings["connect-timeout"] < 0: + raise ValueError + except ValueError: + raise TypeError("The connection timeout value must be a positive " + "integer (including 0)") + + _validate_settings(settings) + return settings + + +def get_session(*args, **kwargs): + """Creates a Session instance using the provided connection data. + + Args: + *args: Variable length argument list with the connection data used + to connect to a MySQL server. It can be a dictionary or a + connection string. + **kwargs: Arbitrary keyword arguments with connection data used to + connect to the database. + + Returns: + mysqlx.Session: Session object. + """ + settings = _get_connection_settings(*args, **kwargs) + return Session(settings) + + +def get_client(connection_string, options_string): + """Creates a Client instance with the provided connection data and settings. + + Args: + connection_string: A string or a dict type object to indicate the \ + connection data used to connect to a MySQL server. + + The string must have the following uri format:: + + cnx_str = 'mysqlx://{user}:{pwd}@{host}:{port}' + cnx_str = ('mysqlx://{user}:{pwd}@[' + ' (address={host}:{port}, priority=n),' + ' (address={host}:{port}, priority=n), ...]' + ' ?[option=value]') + + And the dictionary:: + + cnx_dict = { + 'host': 'The host where the MySQL product is running', + 'port': '(int) the port number configured for X protocol', + 'user': 'The user name account', + 'password': 'The password for the given user account', + 'ssl-mode': 'The flags for ssl mode in mysqlx.SSLMode.FLAG', + 'ssl-ca': 'The path to the ca.cert' + "connect-timeout": '(int) milliseconds to wait on timeout' + } + + options_string: A string in the form of a document or a dictionary \ + type with configuration for the client. + + Current options include:: + + options = { + 'pooling': { + 'enabled': (bool), # [True | False], True by default + 'max_size': (int), # Maximum connections per pool + "max_idle_time": (int), # milliseconds that a + # connection will remain active while not in use. + # By default 0, means infinite. + "queue_timeout": (int), # milliseconds a request will + # wait for a connection to become available. + # By default 0, means infinite. + } + } + + Returns: + mysqlx.Client: Client object. + + .. versionadded:: 8.0.13 + """ + if not isinstance(connection_string, (STRING_TYPES, dict)): + raise InterfaceError("connection_data must be a string or dict") + + settings_dict = _get_connection_settings(connection_string) + + if not isinstance(options_string, (STRING_TYPES, dict)): + raise InterfaceError("connection_options must be a string or dict") + + if isinstance(options_string, STRING_TYPES): + try: + options_dict = json.loads(options_string) + except JSONDecodeError: + raise InterfaceError("'pooling' options must be given in the form " + "of a document or dict") + else: + options_dict = {} + for key, value in options_string.items(): + options_dict[key.replace("-", "_")] = value + + if not isinstance(options_dict, dict): + raise InterfaceError("'pooling' options must be given in the form of a " + "document or dict") + pooling_options_dict = {} + if "pooling" in options_dict: + pooling_options = options_dict.pop("pooling") + if not isinstance(pooling_options, (dict)): + raise InterfaceError("'pooling' options must be given in the form " + "document or dict") + # Fill default pooling settings + pooling_options_dict["enabled"] = pooling_options.pop("enabled", True) + pooling_options_dict["max_size"] = pooling_options.pop("max_size", 25) + pooling_options_dict["max_idle_time"] = \ + pooling_options.pop("max_idle_time", 0) + pooling_options_dict["queue_timeout"] = \ + pooling_options.pop("queue_timeout", 0) + + # No other options besides pooling are supported + if len(pooling_options) > 0: + raise InterfaceError("Unrecognized pooling options: {}" + "".format(pooling_options)) + # No other options besides pooling are supported + if len(options_dict) > 0: + raise InterfaceError("Unrecognized connection options: {}" + "".format(options_dict.keys())) + + return Client(settings_dict, pooling_options_dict) + + +__all__ = [ + # mysqlx.connection + "Client", "Session", "get_client", "get_session", "expr", + + # mysqlx.constants + "Auth", "LockContention", "SSLMode", + + # mysqlx.crud + "Schema", "Collection", "Table", "View", + + # mysqlx.errors + "Error", "InterfaceError", "DatabaseError", "NotSupportedError", + "DataError", "IntegrityError", "ProgrammingError", "OperationalError", + "InternalError", "PoolError", "TimeoutError", + + # mysqlx.result + "Column", "Row", "Result", "BufferingResult", "RowResult", + "SqlResult", "DocResult", "ColumnType", + + # mysqlx.statement + "DbDoc", "Statement", "FilterableStatement", "SqlStatement", + "FindStatement", "AddStatement", "RemoveStatement", "ModifyStatement", + "SelectStatement", "InsertStatement", "DeleteStatement", "UpdateStatement", + "CreateCollectionIndexStatement", "Expr", +] diff --git a/venv/Lib/site-packages/mysqlx/authentication.py b/venv/Lib/site-packages/mysqlx/authentication.py new file mode 100644 index 0000000..a512560 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/authentication.py @@ -0,0 +1,180 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of MySQL Authentication Plugin.""" + +import hashlib +import struct + +from .compat import PY3, UNICODE_TYPES, hexlify + + +def xor_string(hash1, hash2, hash_size): + """Encrypt/Decrypt function used for password encryption in + authentication, using a simple XOR. + + Args: + hash1 (str): The first hash. + hash2 (str): The second hash. + + Returns: + str: A string with the xor applied. + """ + if PY3: + xored = [h1 ^ h2 for (h1, h2) in zip(hash1, hash2)] + else: + xored = [ord(h1) ^ ord(h2) for (h1, h2) in zip(hash1, hash2)] + return struct.pack("{0}B".format(hash_size), *xored) + + +class BaseAuthPlugin(object): + """Base class for implementing the authentication plugins.""" + def __init__(self, username=None, password=None): + self._username = username + self._password = password + + def name(self): + """Returns the plugin name. + + Returns: + str: The plugin name. + """ + raise NotImplementedError + + def auth_name(self): + """Returns the authentication name. + + Returns: + str: The authentication name. + """ + raise NotImplementedError + + +class MySQL41AuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL Native Password authentication plugin.""" + def name(self): + """Returns the plugin name. + + Returns: + str: The plugin name. + """ + return "MySQL 4.1 Authentication Plugin" + + def auth_name(self): + """Returns the authentication name. + + Returns: + str: The authentication name. + """ + return "MYSQL41" + + def auth_data(self, data): + """Hashing for MySQL 4.1 authentication. + + Args: + data (str): The authentication data. + + Returns: + str: The authentication response. + """ + if self._password: + password = self._password.encode("utf-8") \ + if isinstance(self._password, UNICODE_TYPES) else self._password + hash1 = hashlib.sha1(password).digest() + hash2 = hashlib.sha1(hash1).digest() + xored = xor_string(hash1, hashlib.sha1(data + hash2).digest(), 20) + return "{0}\0{1}\0*{2}\0".format("", self._username, hexlify(xored)) + return "{0}\0{1}\0".format("", self._username) + + +class PlainAuthPlugin(BaseAuthPlugin): + """Class implementing the MySQL Plain authentication plugin.""" + def name(self): + """Returns the plugin name. + + Returns: + str: The plugin name. + """ + return "Plain Authentication Plugin" + + def auth_name(self): + """Returns the authentication name. + + Returns: + str: The authentication name. + """ + return "PLAIN" + + def auth_data(self): + """Returns the authentication data. + + Returns: + str: The authentication data. + """ + password = self._password.encode("utf-8") \ + if isinstance(self._password, UNICODE_TYPES) and not PY3 \ + else self._password + return "\0{0}\0{1}".format(self._username, password) + + +class Sha256MemoryAuthPlugin(BaseAuthPlugin): + """Class implementing the SHA256_MEMORY authentication plugin.""" + def name(self): + """Returns the plugin name. + + Returns: + str: The plugin name. + """ + return "SHA256_MEMORY Authentication Plugin" + + def auth_name(self): + """Returns the authentication name. + + Returns: + str: The authentication name. + """ + return "SHA256_MEMORY" + + def auth_data(self, data): + """Hashing for SHA256_MEMORY authentication. + + The scramble is of the form: + SHA256(SHA256(SHA256(PASSWORD)),NONCE) XOR SHA256(PASSWORD) + + Args: + data (str): The authentication data. + + Returns: + str: The authentication response. + """ + password = self._password.encode("utf-8") \ + if isinstance(self._password, UNICODE_TYPES) else self._password + hash1 = hashlib.sha256(password).digest() + hash2 = hashlib.sha256(hashlib.sha256(hash1).digest() + data).digest() + xored = xor_string(hash2, hash1, 32) + return "\0{0}\0{1}".format(self._username, hexlify(xored)) diff --git a/venv/Lib/site-packages/mysqlx/charsets.py b/venv/Lib/site-packages/mysqlx/charsets.py new file mode 100644 index 0000000..34ddaf6 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/charsets.py @@ -0,0 +1,348 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2017-12-18' +_MYSQL_VERSION = (8, 0, 4) + +"""This module contains the MySQL Server Character Sets""" + +MYSQL_CHARACTER_SETS = [ + # (character set name, collation, default) + None, + ("big5", "big5_chinese_ci", True), # 1 + ("latin2", "latin2_czech_cs", False), # 2 + ("dec8", "dec8_swedish_ci", True), # 3 + ("cp850", "cp850_general_ci", True), # 4 + ("latin1", "latin1_german1_ci", False), # 5 + ("hp8", "hp8_english_ci", True), # 6 + ("koi8r", "koi8r_general_ci", True), # 7 + ("latin1", "latin1_swedish_ci", True), # 8 + ("latin2", "latin2_general_ci", True), # 9 + ("swe7", "swe7_swedish_ci", True), # 10 + ("ascii", "ascii_general_ci", True), # 11 + ("ujis", "ujis_japanese_ci", True), # 12 + ("sjis", "sjis_japanese_ci", True), # 13 + ("cp1251", "cp1251_bulgarian_ci", False), # 14 + ("latin1", "latin1_danish_ci", False), # 15 + ("hebrew", "hebrew_general_ci", True), # 16 + None, + ("tis620", "tis620_thai_ci", True), # 18 + ("euckr", "euckr_korean_ci", True), # 19 + ("latin7", "latin7_estonian_cs", False), # 20 + ("latin2", "latin2_hungarian_ci", False), # 21 + ("koi8u", "koi8u_general_ci", True), # 22 + ("cp1251", "cp1251_ukrainian_ci", False), # 23 + ("gb2312", "gb2312_chinese_ci", True), # 24 + ("greek", "greek_general_ci", True), # 25 + ("cp1250", "cp1250_general_ci", True), # 26 + ("latin2", "latin2_croatian_ci", False), # 27 + ("gbk", "gbk_chinese_ci", True), # 28 + ("cp1257", "cp1257_lithuanian_ci", False), # 29 + ("latin5", "latin5_turkish_ci", True), # 30 + ("latin1", "latin1_german2_ci", False), # 31 + ("armscii8", "armscii8_general_ci", True), # 32 + ("utf8", "utf8_general_ci", True), # 33 + ("cp1250", "cp1250_czech_cs", False), # 34 + ("ucs2", "ucs2_general_ci", True), # 35 + ("cp866", "cp866_general_ci", True), # 36 + ("keybcs2", "keybcs2_general_ci", True), # 37 + ("macce", "macce_general_ci", True), # 38 + ("macroman", "macroman_general_ci", True), # 39 + ("cp852", "cp852_general_ci", True), # 40 + ("latin7", "latin7_general_ci", True), # 41 + ("latin7", "latin7_general_cs", False), # 42 + ("macce", "macce_bin", False), # 43 + ("cp1250", "cp1250_croatian_ci", False), # 44 + ("utf8mb4", "utf8mb4_general_ci", False), # 45 + ("utf8mb4", "utf8mb4_bin", False), # 46 + ("latin1", "latin1_bin", False), # 47 + ("latin1", "latin1_general_ci", False), # 48 + ("latin1", "latin1_general_cs", False), # 49 + ("cp1251", "cp1251_bin", False), # 50 + ("cp1251", "cp1251_general_ci", True), # 51 + ("cp1251", "cp1251_general_cs", False), # 52 + ("macroman", "macroman_bin", False), # 53 + ("utf16", "utf16_general_ci", True), # 54 + ("utf16", "utf16_bin", False), # 55 + ("utf16le", "utf16le_general_ci", True), # 56 + ("cp1256", "cp1256_general_ci", True), # 57 + ("cp1257", "cp1257_bin", False), # 58 + ("cp1257", "cp1257_general_ci", True), # 59 + ("utf32", "utf32_general_ci", True), # 60 + ("utf32", "utf32_bin", False), # 61 + ("utf16le", "utf16le_bin", False), # 62 + ("binary", "binary", True), # 63 + ("armscii8", "armscii8_bin", False), # 64 + ("ascii", "ascii_bin", False), # 65 + ("cp1250", "cp1250_bin", False), # 66 + ("cp1256", "cp1256_bin", False), # 67 + ("cp866", "cp866_bin", False), # 68 + ("dec8", "dec8_bin", False), # 69 + ("greek", "greek_bin", False), # 70 + ("hebrew", "hebrew_bin", False), # 71 + ("hp8", "hp8_bin", False), # 72 + ("keybcs2", "keybcs2_bin", False), # 73 + ("koi8r", "koi8r_bin", False), # 74 + ("koi8u", "koi8u_bin", False), # 75 + ("utf8", "utf8_tolower_ci", False), # 76 + ("latin2", "latin2_bin", False), # 77 + ("latin5", "latin5_bin", False), # 78 + ("latin7", "latin7_bin", False), # 79 + ("cp850", "cp850_bin", False), # 80 + ("cp852", "cp852_bin", False), # 81 + ("swe7", "swe7_bin", False), # 82 + ("utf8", "utf8_bin", False), # 83 + ("big5", "big5_bin", False), # 84 + ("euckr", "euckr_bin", False), # 85 + ("gb2312", "gb2312_bin", False), # 86 + ("gbk", "gbk_bin", False), # 87 + ("sjis", "sjis_bin", False), # 88 + ("tis620", "tis620_bin", False), # 89 + ("ucs2", "ucs2_bin", False), # 90 + ("ujis", "ujis_bin", False), # 91 + ("geostd8", "geostd8_general_ci", True), # 92 + ("geostd8", "geostd8_bin", False), # 93 + ("latin1", "latin1_spanish_ci", False), # 94 + ("cp932", "cp932_japanese_ci", True), # 95 + ("cp932", "cp932_bin", False), # 96 + ("eucjpms", "eucjpms_japanese_ci", True), # 97 + ("eucjpms", "eucjpms_bin", False), # 98 + ("cp1250", "cp1250_polish_ci", False), # 99 + None, + ("utf16", "utf16_unicode_ci", False), # 101 + ("utf16", "utf16_icelandic_ci", False), # 102 + ("utf16", "utf16_latvian_ci", False), # 103 + ("utf16", "utf16_romanian_ci", False), # 104 + ("utf16", "utf16_slovenian_ci", False), # 105 + ("utf16", "utf16_polish_ci", False), # 106 + ("utf16", "utf16_estonian_ci", False), # 107 + ("utf16", "utf16_spanish_ci", False), # 108 + ("utf16", "utf16_swedish_ci", False), # 109 + ("utf16", "utf16_turkish_ci", False), # 110 + ("utf16", "utf16_czech_ci", False), # 111 + ("utf16", "utf16_danish_ci", False), # 112 + ("utf16", "utf16_lithuanian_ci", False), # 113 + ("utf16", "utf16_slovak_ci", False), # 114 + ("utf16", "utf16_spanish2_ci", False), # 115 + ("utf16", "utf16_roman_ci", False), # 116 + ("utf16", "utf16_persian_ci", False), # 117 + ("utf16", "utf16_esperanto_ci", False), # 118 + ("utf16", "utf16_hungarian_ci", False), # 119 + ("utf16", "utf16_sinhala_ci", False), # 120 + ("utf16", "utf16_german2_ci", False), # 121 + ("utf16", "utf16_croatian_ci", False), # 122 + ("utf16", "utf16_unicode_520_ci", False), # 123 + ("utf16", "utf16_vietnamese_ci", False), # 124 + None, + None, + None, + ("ucs2", "ucs2_unicode_ci", False), # 128 + ("ucs2", "ucs2_icelandic_ci", False), # 129 + ("ucs2", "ucs2_latvian_ci", False), # 130 + ("ucs2", "ucs2_romanian_ci", False), # 131 + ("ucs2", "ucs2_slovenian_ci", False), # 132 + ("ucs2", "ucs2_polish_ci", False), # 133 + ("ucs2", "ucs2_estonian_ci", False), # 134 + ("ucs2", "ucs2_spanish_ci", False), # 135 + ("ucs2", "ucs2_swedish_ci", False), # 136 + ("ucs2", "ucs2_turkish_ci", False), # 137 + ("ucs2", "ucs2_czech_ci", False), # 138 + ("ucs2", "ucs2_danish_ci", False), # 139 + ("ucs2", "ucs2_lithuanian_ci", False), # 140 + ("ucs2", "ucs2_slovak_ci", False), # 141 + ("ucs2", "ucs2_spanish2_ci", False), # 142 + ("ucs2", "ucs2_roman_ci", False), # 143 + ("ucs2", "ucs2_persian_ci", False), # 144 + ("ucs2", "ucs2_esperanto_ci", False), # 145 + ("ucs2", "ucs2_hungarian_ci", False), # 146 + ("ucs2", "ucs2_sinhala_ci", False), # 147 + ("ucs2", "ucs2_german2_ci", False), # 148 + ("ucs2", "ucs2_croatian_ci", False), # 149 + ("ucs2", "ucs2_unicode_520_ci", False), # 150 + ("ucs2", "ucs2_vietnamese_ci", False), # 151 + None, + None, + None, + None, + None, + None, + None, + ("ucs2", "ucs2_general_mysql500_ci", False), # 159 + ("utf32", "utf32_unicode_ci", False), # 160 + ("utf32", "utf32_icelandic_ci", False), # 161 + ("utf32", "utf32_latvian_ci", False), # 162 + ("utf32", "utf32_romanian_ci", False), # 163 + ("utf32", "utf32_slovenian_ci", False), # 164 + ("utf32", "utf32_polish_ci", False), # 165 + ("utf32", "utf32_estonian_ci", False), # 166 + ("utf32", "utf32_spanish_ci", False), # 167 + ("utf32", "utf32_swedish_ci", False), # 168 + ("utf32", "utf32_turkish_ci", False), # 169 + ("utf32", "utf32_czech_ci", False), # 170 + ("utf32", "utf32_danish_ci", False), # 171 + ("utf32", "utf32_lithuanian_ci", False), # 172 + ("utf32", "utf32_slovak_ci", False), # 173 + ("utf32", "utf32_spanish2_ci", False), # 174 + ("utf32", "utf32_roman_ci", False), # 175 + ("utf32", "utf32_persian_ci", False), # 176 + ("utf32", "utf32_esperanto_ci", False), # 177 + ("utf32", "utf32_hungarian_ci", False), # 178 + ("utf32", "utf32_sinhala_ci", False), # 179 + ("utf32", "utf32_german2_ci", False), # 180 + ("utf32", "utf32_croatian_ci", False), # 181 + ("utf32", "utf32_unicode_520_ci", False), # 182 + ("utf32", "utf32_vietnamese_ci", False), # 183 + None, + None, + None, + None, + None, + None, + None, + None, + ("utf8", "utf8_unicode_ci", False), # 192 + ("utf8", "utf8_icelandic_ci", False), # 193 + ("utf8", "utf8_latvian_ci", False), # 194 + ("utf8", "utf8_romanian_ci", False), # 195 + ("utf8", "utf8_slovenian_ci", False), # 196 + ("utf8", "utf8_polish_ci", False), # 197 + ("utf8", "utf8_estonian_ci", False), # 198 + ("utf8", "utf8_spanish_ci", False), # 199 + ("utf8", "utf8_swedish_ci", False), # 200 + ("utf8", "utf8_turkish_ci", False), # 201 + ("utf8", "utf8_czech_ci", False), # 202 + ("utf8", "utf8_danish_ci", False), # 203 + ("utf8", "utf8_lithuanian_ci", False), # 204 + ("utf8", "utf8_slovak_ci", False), # 205 + ("utf8", "utf8_spanish2_ci", False), # 206 + ("utf8", "utf8_roman_ci", False), # 207 + ("utf8", "utf8_persian_ci", False), # 208 + ("utf8", "utf8_esperanto_ci", False), # 209 + ("utf8", "utf8_hungarian_ci", False), # 210 + ("utf8", "utf8_sinhala_ci", False), # 211 + ("utf8", "utf8_german2_ci", False), # 212 + ("utf8", "utf8_croatian_ci", False), # 213 + ("utf8", "utf8_unicode_520_ci", False), # 214 + ("utf8", "utf8_vietnamese_ci", False), # 215 + None, + None, + None, + None, + None, + None, + None, + ("utf8", "utf8_general_mysql500_ci", False), # 223 + ("utf8mb4", "utf8mb4_unicode_ci", False), # 224 + ("utf8mb4", "utf8mb4_icelandic_ci", False), # 225 + ("utf8mb4", "utf8mb4_latvian_ci", False), # 226 + ("utf8mb4", "utf8mb4_romanian_ci", False), # 227 + ("utf8mb4", "utf8mb4_slovenian_ci", False), # 228 + ("utf8mb4", "utf8mb4_polish_ci", False), # 229 + ("utf8mb4", "utf8mb4_estonian_ci", False), # 230 + ("utf8mb4", "utf8mb4_spanish_ci", False), # 231 + ("utf8mb4", "utf8mb4_swedish_ci", False), # 232 + ("utf8mb4", "utf8mb4_turkish_ci", False), # 233 + ("utf8mb4", "utf8mb4_czech_ci", False), # 234 + ("utf8mb4", "utf8mb4_danish_ci", False), # 235 + ("utf8mb4", "utf8mb4_lithuanian_ci", False), # 236 + ("utf8mb4", "utf8mb4_slovak_ci", False), # 237 + ("utf8mb4", "utf8mb4_spanish2_ci", False), # 238 + ("utf8mb4", "utf8mb4_roman_ci", False), # 239 + ("utf8mb4", "utf8mb4_persian_ci", False), # 240 + ("utf8mb4", "utf8mb4_esperanto_ci", False), # 241 + ("utf8mb4", "utf8mb4_hungarian_ci", False), # 242 + ("utf8mb4", "utf8mb4_sinhala_ci", False), # 243 + ("utf8mb4", "utf8mb4_german2_ci", False), # 244 + ("utf8mb4", "utf8mb4_croatian_ci", False), # 245 + ("utf8mb4", "utf8mb4_unicode_520_ci", False), # 246 + ("utf8mb4", "utf8mb4_vietnamese_ci", False), # 247 + ("gb18030", "gb18030_chinese_ci", True), # 248 + ("gb18030", "gb18030_bin", False), # 249 + ("gb18030", "gb18030_unicode_520_ci", False), # 250 + None, + None, + None, + None, + ("utf8mb4", "utf8mb4_0900_ai_ci", True), # 255 + ("utf8mb4", "utf8mb4_de_pb_0900_ai_ci", False), # 256 + ("utf8mb4", "utf8mb4_is_0900_ai_ci", False), # 257 + ("utf8mb4", "utf8mb4_lv_0900_ai_ci", False), # 258 + ("utf8mb4", "utf8mb4_ro_0900_ai_ci", False), # 259 + ("utf8mb4", "utf8mb4_sl_0900_ai_ci", False), # 260 + ("utf8mb4", "utf8mb4_pl_0900_ai_ci", False), # 261 + ("utf8mb4", "utf8mb4_et_0900_ai_ci", False), # 262 + ("utf8mb4", "utf8mb4_es_0900_ai_ci", False), # 263 + ("utf8mb4", "utf8mb4_sv_0900_ai_ci", False), # 264 + ("utf8mb4", "utf8mb4_tr_0900_ai_ci", False), # 265 + ("utf8mb4", "utf8mb4_cs_0900_ai_ci", False), # 266 + ("utf8mb4", "utf8mb4_da_0900_ai_ci", False), # 267 + ("utf8mb4", "utf8mb4_lt_0900_ai_ci", False), # 268 + ("utf8mb4", "utf8mb4_sk_0900_ai_ci", False), # 269 + ("utf8mb4", "utf8mb4_es_trad_0900_ai_ci", False), # 270 + ("utf8mb4", "utf8mb4_la_0900_ai_ci", False), # 271 + None, + ("utf8mb4", "utf8mb4_eo_0900_ai_ci", False), # 273 + ("utf8mb4", "utf8mb4_hu_0900_ai_ci", False), # 274 + ("utf8mb4", "utf8mb4_hr_0900_ai_ci", False), # 275 + None, + ("utf8mb4", "utf8mb4_vi_0900_ai_ci", False), # 277 + ("utf8mb4", "utf8mb4_0900_as_cs", False), # 278 + ("utf8mb4", "utf8mb4_de_pb_0900_as_cs", False), # 279 + ("utf8mb4", "utf8mb4_is_0900_as_cs", False), # 280 + ("utf8mb4", "utf8mb4_lv_0900_as_cs", False), # 281 + ("utf8mb4", "utf8mb4_ro_0900_as_cs", False), # 282 + ("utf8mb4", "utf8mb4_sl_0900_as_cs", False), # 283 + ("utf8mb4", "utf8mb4_pl_0900_as_cs", False), # 284 + ("utf8mb4", "utf8mb4_et_0900_as_cs", False), # 285 + ("utf8mb4", "utf8mb4_es_0900_as_cs", False), # 286 + ("utf8mb4", "utf8mb4_sv_0900_as_cs", False), # 287 + ("utf8mb4", "utf8mb4_tr_0900_as_cs", False), # 288 + ("utf8mb4", "utf8mb4_cs_0900_as_cs", False), # 289 + ("utf8mb4", "utf8mb4_da_0900_as_cs", False), # 290 + ("utf8mb4", "utf8mb4_lt_0900_as_cs", False), # 291 + ("utf8mb4", "utf8mb4_sk_0900_as_cs", False), # 292 + ("utf8mb4", "utf8mb4_es_trad_0900_as_cs", False), # 293 + ("utf8mb4", "utf8mb4_la_0900_as_cs", False), # 294 + None, + ("utf8mb4", "utf8mb4_eo_0900_as_cs", False), # 296 + ("utf8mb4", "utf8mb4_hu_0900_as_cs", False), # 297 + ("utf8mb4", "utf8mb4_hr_0900_as_cs", False), # 298 + None, + ("utf8mb4", "utf8mb4_vi_0900_as_cs", False), # 300 + None, + None, + ("utf8mb4", "utf8mb4_ja_0900_as_cs", False), # 303 + ("utf8mb4", "utf8mb4_ja_0900_as_cs_ks", False), # 304 + ("utf8mb4", "utf8mb4_0900_as_ci", False), # 305 + ("utf8mb4", "utf8mb4_ru_0900_ai_ci", False), # 306 + ("utf8mb4", "utf8mb4_ru_0900_as_cs", False), # 307 +] + diff --git a/venv/Lib/site-packages/mysqlx/compat.py b/venv/Lib/site-packages/mysqlx/compat.py new file mode 100644 index 0000000..17a74dc --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/compat.py @@ -0,0 +1,83 @@ +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""This module handles compatibility issues between Python 2 and Python 3.""" + +import sys +import decimal +import binascii + + +PY3 = sys.version_info[0] == 3 + + +# pylint: disable=E0401,E0602,E0611,W0611, +if PY3: + import queue + from json.decoder import JSONDecodeError + from urllib.parse import urlparse, unquote, parse_qsl + + def hexlify(data): + """Return the hexadecimal representation of the binary data. + + Args: + data (str): The binary data. + + Returns: + bytes: The hexadecimal representation of data. + """ + return binascii.hexlify(data).decode("utf-8") + + NUMERIC_TYPES = (int, float, decimal.Decimal,) + INT_TYPES = (int,) + UNICODE_TYPES = (str,) + STRING_TYPES = (str,) + BYTE_TYPES = (bytearray, bytes,) + + +else: + import Queue as queue + from urlparse import urlparse, unquote, parse_qsl + + def hexlify(data): + """Return the hexadecimal representation of the binary data. + + Args: + data (str): The binary data. + + Returns: + bytes: The hexadecimal representation of data. + """ + return data.encode("hex") + + NUMERIC_TYPES = (int, float, decimal.Decimal, long,) + INT_TYPES = (int, long,) + UNICODE_TYPES = (unicode,) + STRING_TYPES = (str, unicode,) + BYTE_TYPES = (bytearray,) + JSONDecodeError = ValueError diff --git a/venv/Lib/site-packages/mysqlx/connection.py b/venv/Lib/site-packages/mysqlx/connection.py new file mode 100644 index 0000000..bee9083 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/connection.py @@ -0,0 +1,1536 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of communication for MySQL X servers.""" + +try: + import ssl + SSL_AVAILABLE = True +except: + SSL_AVAILABLE = False + +import sys +import socket +import logging +import uuid +import platform +import os +import re +import threading + +from functools import wraps + +from .authentication import (MySQL41AuthPlugin, PlainAuthPlugin, + Sha256MemoryAuthPlugin) +# pylint: disable=W0622 +from .errors import (InterfaceError, OperationalError, PoolError, + ProgrammingError, TimeoutError) +from .compat import PY3, STRING_TYPES, UNICODE_TYPES, queue +from .crud import Schema +from .constants import SSLMode, Auth +from .helpers import escape, get_item_or_attr +from .protocol import Protocol, MessageReaderWriter +from .result import Result, RowResult, DocResult +from .statement import SqlStatement, AddStatement, quote_identifier +from .protobuf import Protobuf + + +_CONNECT_TIMEOUT = 10000 # Default connect timeout in milliseconds +_DROP_DATABASE_QUERY = "DROP DATABASE IF EXISTS {0}" +_CREATE_DATABASE_QUERY = "CREATE DATABASE IF NOT EXISTS {0}" +_SELECT_SCHEMA_NAME_QUERY = ("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA." + "SCHEMATA WHERE SCHEMA_NAME = '{}'") + +_CNX_POOL_MAXSIZE = 99 +_CNX_POOL_MAX_NAME_SIZE = 120 +_CNX_POOL_NAME_REGEX = re.compile(r'[^a-zA-Z0-9._:\-*$#]') +_CNX_POOL_MAX_IDLE_TIME = 2147483 +_CNX_POOL_QUEUE_TIMEOUT = 2147483 + +_LOGGER = logging.getLogger("mysqlx") + + +def generate_pool_name(**kwargs): + """Generate a pool name. + + This function takes keyword arguments, usually the connection arguments and + tries to generate a name for the pool. + + Args: + **kwargs: Arbitrary keyword arguments with the connection arguments. + + Raises: + PoolError: If the name can't be generated. + + Returns: + str: The generated pool name. + """ + parts = [] + for key in ("host", "port", "user", "database", "client_id"): + try: + parts.append(str(kwargs[key])) + except KeyError: + pass + + if not parts: + raise PoolError("Failed generating pool name; specify pool_name") + + return "_".join(parts) + + +class SocketStream(object): + """Implements a socket stream.""" + def __init__(self): + self._socket = None + self._is_ssl = False + self._is_socket = False + self._host = None + + def connect(self, params, connect_timeout=_CONNECT_TIMEOUT): + """Connects to a TCP service. + + Args: + params (tuple): The connection parameters. + + Raises: + :class:`mysqlx.InterfaceError`: If Unix socket is not supported. + """ + if connect_timeout is not None: + connect_timeout = connect_timeout / 1000 # Convert to seconds + try: + self._socket = socket.create_connection(params, connect_timeout) + self._host = params[0] + except ValueError: + try: + self._socket = socket.socket(socket.AF_UNIX) + self._socket.settimeout(connect_timeout) + self._socket.connect(params) + self._is_socket = True + except AttributeError: + raise InterfaceError("Unix socket unsupported") + + def read(self, count): + """Receive data from the socket. + + Args: + count (int): Buffer size. + + Returns: + bytes: The data received. + """ + if self._socket is None: + raise OperationalError("MySQLx Connection not available") + buf = [] + while count > 0: + data = self._socket.recv(count) + if data == b"": + raise RuntimeError("Unexpected connection close") + buf.append(data) + count -= len(data) + return b"".join(buf) + + def sendall(self, data): + """Send data to the socket. + + Args: + data (bytes): The data to be sent. + """ + if self._socket is None: + raise OperationalError("MySQLx Connection not available") + self._socket.sendall(data) + + def close(self): + """Close the socket.""" + if not self._socket: + return + try: + self._socket.shutdown(socket.SHUT_RDWR) + self._socket.close() + except socket.error: + # On [Errno 107] Transport endpoint is not connected + pass + self._socket = None + + def __del__(self): + self.close() + + def set_ssl(self, ssl_mode, ssl_ca, ssl_crl, ssl_cert, ssl_key): + """Set SSL parameters. + + Args: + ssl_mode (str): SSL mode. + ssl_ca (str): The certification authority certificate. + ssl_crl (str): The certification revocation lists. + ssl_cert (str): The certificate. + ssl_key (str): The certificate key. + + Raises: + :class:`mysqlx.RuntimeError`: If Python installation has no SSL + support. + :class:`mysqlx.InterfaceError`: If the parameters are invalid. + """ + if not SSL_AVAILABLE: + self.close() + raise RuntimeError("Python installation has no SSL support") + + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + context.load_default_certs() + + if ssl_ca: + try: + context.load_verify_locations(ssl_ca) + context.verify_mode = ssl.CERT_REQUIRED + except (IOError, ssl.SSLError) as err: + self.close() + raise InterfaceError("Invalid CA Certificate: {}".format(err)) + + if ssl_crl: + try: + context.load_verify_locations(ssl_crl) + context.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF + except (IOError, ssl.SSLError) as err: + self.close() + raise InterfaceError("Invalid CRL: {}".format(err)) + + if ssl_cert: + try: + context.load_cert_chain(ssl_cert, ssl_key) + except (IOError, ssl.SSLError) as err: + self.close() + raise InterfaceError("Invalid Certificate/Key: {}".format(err)) + + self._socket = context.wrap_socket(self._socket) + if ssl_mode == SSLMode.VERIFY_IDENTITY: + hostnames = [] + # Windows does not return loopback aliases on gethostbyaddr + if os.name == 'nt' and (self._host == 'localhost' or \ + self._host == '127.0.0.1'): + hostnames = ['localhost', '127.0.0.1'] + aliases = socket.gethostbyaddr(self._host) + hostnames.extend([aliases[0]] + aliases[1]) + match_found = False + errs = [] + for hostname in hostnames: + try: + ssl.match_hostname(self._socket.getpeercert(), hostname) + except ssl.CertificateError as err: + errs.append(err) + else: + match_found = True + break + if not match_found: + self.close() + raise InterfaceError("Unable to verify server identity: {}" + "".format(", ".join(errs))) + self._is_ssl = True + + def is_ssl(self): + """Verifies if SSL is being used. + + Returns: + bool: Returns `True` if SSL is being used. + """ + return self._is_ssl + + def is_socket(self): + """Verifies if socket connection is being used. + + Returns: + bool: Returns `True` if socket connection is being used. + """ + return self._is_socket + + def is_secure(self): + """Verifies if connection is secure. + + Returns: + bool: Returns `True` if connection is secure. + """ + return self._is_ssl or self._is_socket + + def is_open(self): + """Verifies if connection is open. + + Returns: + bool: Returns `True` if connection is open. + """ + return self._socket is not None + + +def catch_network_exception(func): + """Decorator used to catch socket.error or RuntimeError. + + Raises: + :class:`mysqlx.InterfaceError`: If `socket.Error` or `RuntimeError` + is raised. + """ + @wraps(func) + def wrapper(self, *args, **kwargs): + """Wrapper function.""" + try: + return func(self, *args, **kwargs) + except (socket.error, RuntimeError): + self.disconnect() + raise InterfaceError("Cannot connect to host") + return wrapper + + +class Connection(object): + """Connection to a MySQL Server. + + Args: + settings (dict): Dictionary with connection settings. + """ + def __init__(self, settings): + self.settings = settings + self.stream = SocketStream() + self.reader_writer = None + self.protocol = None + self._user = settings.get("user") + self._password = settings.get("password") + self._schema = settings.get("schema") + self._active_result = None + self._routers = settings.get("routers", []) + + if 'host' in settings and settings['host']: + self._routers.append({ + 'host': settings.get('host'), + 'port': settings.get('port', None) + }) + + self._cur_router = -1 + self._can_failover = True + self._ensure_priorities() + self._routers.sort(key=lambda x: x['priority'], reverse=True) + self._connect_timeout = settings.get("connect-timeout", + _CONNECT_TIMEOUT) + if self._connect_timeout == 0: + # None is assigned if connect timeout is 0, which disables timeouts + # on socket operations + self._connect_timeout = None + + def fetch_active_result(self): + """Fetch active result.""" + if self._active_result is not None: + self._active_result.fetch_all() + self._active_result = None + + def set_active_result(self, result): + """Set active result. + + Args: + `Result`: It can be :class:`mysqlx.Result`, + :class:`mysqlx.BufferingResult`, + :class:`mysqlx.RowResult`, :class:`mysqlx.SqlResult` or + :class:`mysqlx.DocResult`. + """ + self._active_result = result + + def _ensure_priorities(self): + """Ensure priorities. + + Raises: + :class:`mysqlx.ProgrammingError`: If priorities are invalid. + """ + priority_count = 0 + priority = 100 + + for router in self._routers: + pri = router.get('priority', None) + if pri is None: + priority_count += 1 + router["priority"] = priority + elif pri > 100: + raise ProgrammingError("The priorities must be between 0 and " + "100", 4007) + priority -= 1 + + if 0 < priority_count < len(self._routers): + raise ProgrammingError("You must either assign no priority to any " + "of the routers or give a priority for " + "every router", 4000) + + def _get_connection_params(self): + """Returns the connection parameters. + + Returns: + tuple: The connection parameters. + """ + if not self._routers: + self._can_failover = False + if "host" in self.settings: + return self.settings["host"], self.settings.get("port", 33060) + if "socket" in self.settings: + return self.settings["socket"] + return ("localhost", 33060,) + + # Reset routers status once all are tried + if not self._can_failover or self._cur_router == -1: + self._cur_router = -1 + self._can_failover = True + for router in self._routers: + router['available'] = True + + self._cur_router += 1 + host = self._routers[self._cur_router]["host"] + port = self._routers[self._cur_router]["port"] + + if self._cur_router > 0: + self._routers[self._cur_router-1]["available"] = False + if self._cur_router >= len(self._routers) - 1: + self._can_failover = False + + return (host, port,) + + def connect(self): + """Attempt to connect to the MySQL server. + + Raises: + :class:`mysqlx.InterfaceError`: If fails to connect to the MySQL + server. + :class:`mysqlx.TimeoutError`: If connect timeout was exceeded. + """ + # Loop and check + error = None + while self._can_failover: + try: + self.stream.connect(self._get_connection_params(), + self._connect_timeout) + self.reader_writer = MessageReaderWriter(self.stream) + self.protocol = Protocol(self.reader_writer) + self._handle_capabilities() + self._authenticate() + return + except socket.error as err: + error = err + + # Python 2.7 does not raise a socket.timeout exception when using + # settimeout(), but it raises a socket.error with errno.EAGAIN (11) + # or errno.EINPROGRESS (115) if connect-timeout value is too low + if error is not None and (isinstance(error, socket.timeout) or + (error.errno in (11, 115) and not PY3)): + if len(self._routers) <= 1: + raise TimeoutError("Connection attempt to the server was " + "aborted. Timeout of {0} ms was exceeded" + "".format(self._connect_timeout)) + raise TimeoutError("All server connection attempts were aborted. " + "Timeout of {0} ms was exceeded for each " + "selected server".format(self._connect_timeout)) + if len(self._routers) <= 1: + raise InterfaceError("Cannot connect to host: {0}".format(error)) + raise InterfaceError("Failed to connect to any of the routers", 4001) + + def _handle_capabilities(self): + """Handle capabilities. + + Raises: + :class:`mysqlx.OperationalError`: If SSL is not enabled at the + server. + :class:`mysqlx.RuntimeError`: If support for SSL is not available + in Python. + """ + if self.settings.get("ssl-mode") == SSLMode.DISABLED: + return + if self.stream.is_socket(): + if self.settings.get("ssl-mode"): + _LOGGER.warning("SSL not required when using Unix socket.") + return + + data = self.protocol.get_capabilites().capabilities + if not (get_item_or_attr(data[0], "name").lower() == "tls" + if data else False): + self.close_connection() + raise OperationalError("SSL not enabled at server") + + is_ol7 = False + if platform.system() == "Linux": + # pylint: disable=W1505 + distname, version, _ = platform.linux_distribution() + try: + is_ol7 = "Oracle Linux" in distname and \ + version.split(".")[0] == "7" + except IndexError: + is_ol7 = False + + if sys.version_info < (2, 7, 9) and not is_ol7: + self.close_connection() + raise RuntimeError("The support for SSL is not available for " + "this Python version") + + self.protocol.set_capabilities(tls=True) + self.stream.set_ssl(self.settings.get("ssl-mode", SSLMode.REQUIRED), + self.settings.get("ssl-ca"), + self.settings.get("ssl-crl"), + self.settings.get("ssl-cert"), + self.settings.get("ssl-key")) + + def _authenticate(self): + """Authenticate with the MySQL server.""" + auth = self.settings.get("auth") + if auth: + if auth == Auth.PLAIN: + self._authenticate_plain() + elif auth == Auth.SHA256_MEMORY: + self._authenticate_sha256_memory() + elif auth == Auth.MYSQL41: + self._authenticate_mysql41() + elif self.stream.is_secure(): + # Use PLAIN if no auth provided and connection is secure + self._authenticate_plain() + else: + # Use MYSQL41 if connection is not secure + try: + self._authenticate_mysql41() + except InterfaceError: + pass + else: + return + # Try SHA256_MEMORY if MYSQL41 fails + try: + self._authenticate_sha256_memory() + except InterfaceError: + raise InterfaceError("Authentication failed using MYSQL41 and " + "SHA256_MEMORY, check username and " + "password or try a secure connection") + + def _authenticate_mysql41(self): + """Authenticate with the MySQL server using `MySQL41AuthPlugin`.""" + plugin = MySQL41AuthPlugin(self._user, self._password) + self.protocol.send_auth_start(plugin.auth_name()) + extra_data = self.protocol.read_auth_continue() + self.protocol.send_auth_continue(plugin.auth_data(extra_data)) + self.protocol.read_auth_ok() + + def _authenticate_plain(self): + """Authenticate with the MySQL server using `PlainAuthPlugin`.""" + if not self.stream.is_secure(): + raise InterfaceError("PLAIN authentication is not allowed via " + "unencrypted connection") + plugin = PlainAuthPlugin(self._user, self._password) + self.protocol.send_auth_start(plugin.auth_name(), + auth_data=plugin.auth_data()) + self.protocol.read_auth_ok() + + def _authenticate_sha256_memory(self): + """Authenticate with the MySQL server using `Sha256MemoryAuthPlugin`.""" + plugin = Sha256MemoryAuthPlugin(self._user, self._password) + self.protocol.send_auth_start(plugin.auth_name()) + extra_data = self.protocol.read_auth_continue() + self.protocol.send_auth_continue(plugin.auth_data(extra_data)) + self.protocol.read_auth_ok() + + @catch_network_exception + def send_sql(self, sql, *args): + """Execute a SQL statement. + + Args: + sql (str): The SQL statement. + *args: Arbitrary arguments. + + Raises: + :class:`mysqlx.ProgrammingError`: If the SQL statement is not a + valid string. + """ + if self.protocol is None: + raise OperationalError("MySQLx Connection not available") + if not isinstance(sql, STRING_TYPES): + raise ProgrammingError("The SQL statement is not a valid string") + elif not PY3 and isinstance(sql, UNICODE_TYPES): + self.protocol.send_execute_statement( + "sql", bytes(bytearray(sql, "utf-8")), args) + else: + self.protocol.send_execute_statement("sql", sql, args) + + @catch_network_exception + def send_insert(self, statement): + """Send an insert statement. + + Args: + statement (`Statement`): It can be :class:`mysqlx.InsertStatement` + or :class:`mysqlx.AddStatement`. + + Returns: + :class:`mysqlx.Result`: A result object. + """ + if self.protocol is None: + raise OperationalError("MySQLx Connection not available") + self.protocol.send_insert(statement) + ids = None + if isinstance(statement, AddStatement): + ids = statement.ids + return Result(self, ids) + + @catch_network_exception + def find(self, statement): + """Send an find statement. + + Args: + statement (`Statement`): It can be :class:`mysqlx.ReadStatement` + or :class:`mysqlx.FindStatement`. + + Returns: + `Result`: It can be class:`mysqlx.DocResult` or + :class:`mysqlx.RowResult`. + """ + self.protocol.send_find(statement) + return DocResult(self) if statement.is_doc_based() else RowResult(self) + + @catch_network_exception + def delete(self, statement): + """Send an delete statement. + + Args: + statement (`Statement`): It can be :class:`mysqlx.RemoveStatement` + or :class:`mysqlx.DeleteStatement`. + + Returns: + :class:`mysqlx.Result`: The result object. + """ + self.protocol.send_delete(statement) + return Result(self) + + @catch_network_exception + def update(self, statement): + """Send an delete statement. + + Args: + statement (`Statement`): It can be :class:`mysqlx.ModifyStatement` + or :class:`mysqlx.UpdateStatement`. + + Returns: + :class:`mysqlx.Result`: The result object. + """ + self.protocol.send_update(statement) + return Result(self) + + @catch_network_exception + def execute_nonquery(self, namespace, cmd, raise_on_fail, *args): + """Execute a non query command. + + Args: + namespace (str): The namespace. + cmd (str): The command. + raise_on_fail (bool): `True` to raise on fail. + *args: Arbitrary arguments. + + Raises: + :class:`mysqlx.OperationalError`: On errors. + + Returns: + :class:`mysqlx.Result`: The result object. + """ + try: + self.protocol.send_execute_statement(namespace, cmd, args) + return Result(self) + except OperationalError: + if raise_on_fail: + raise + + @catch_network_exception + def execute_sql_scalar(self, sql, *args): + """Execute a SQL scalar. + + Args: + sql (str): The SQL statement. + *args: Arbitrary arguments. + + Raises: + :class:`mysqlx.InterfaceError`: If no data found. + + Returns: + :class:`mysqlx.Result`: The result. + """ + self.protocol.send_execute_statement("sql", sql, args) + result = RowResult(self) + result.fetch_all() + if result.count == 0: + raise InterfaceError("No data found") + return result[0][0] + + @catch_network_exception + def get_row_result(self, cmd, *args): + """Returns the row result. + + Args: + cmd (str): The command. + *args: Arbitrary arguments. + + Returns: + :class:`mysqlx.RowResult`: The result object. + """ + self.protocol.send_execute_statement("xplugin", cmd, args) + return RowResult(self) + + @catch_network_exception + def read_row(self, result): + """Read row. + + Args: + result (:class:`mysqlx.RowResult`): The result object. + """ + return self.protocol.read_row(result) + + @catch_network_exception + def close_result(self, result): + """Close result. + + Args: + result (:class:`mysqlx.Result`): The result object. + """ + self.protocol.close_result(result) + + @catch_network_exception + def get_column_metadata(self, result): + """Get column metadata. + + Args: + result (:class:`mysqlx.Result`): The result object. + """ + return self.protocol.get_column_metadata(result) + + def is_open(self): + """Check if connection is open. + + Returns: + bool: `True` if connection is open. + """ + return self.stream.is_open() + + def disconnect(self): + """Disconnect from server.""" + if not self.is_open(): + return + self.stream.close() + + def close_session(self): + """Close a sucessfully authenticated session.""" + if not self.is_open(): + return + try: + if self._active_result is not None: + self._active_result.fetch_all() + self.protocol.send_close() + self.protocol.read_ok() + except (InterfaceError, OperationalError) as err: + _LOGGER.warning("Warning: An error occurred while attempting to " + "close the connection: {}".format(err)) + finally: + # The remote connection with the server has been lost, + # close the connection locally. + self.stream.close() + + def reset_session(self): + """Reset a sucessfully authenticated session.""" + if not self.is_open(): + return + if self._active_result is not None: + self._active_result.fetch_all() + try: + self.protocol.send_reset() + except (InterfaceError, OperationalError) as err: + _LOGGER.warning("Warning: An error occurred while attempting to " + "reset the session: {}".format(err)) + + def close_connection(self): + """Announce to the server that the client wants to close the + connection. Discards any session state of the server. + """ + if not self.is_open(): + return + if self._active_result is not None: + self._active_result.fetch_all() + self.protocol.send_connection_close() + self.protocol.read_ok() + self.stream.close() + + +class PooledConnection(Connection): + """Class to hold :class:`Connection` instances in a pool. + + PooledConnection is used by :class:`ConnectionPool` to facilitate the + connection to return to the pool once is not required, more specifically + once the close_session() method is invoked. It works like a normal + Connection except for methods like close() and sql(). + + The close_session() method will add the connection back to the pool rather + than disconnecting from the MySQL server. + + The sql() method is used to execute sql statements. + + Args: + pool (ConnectionPool): The pool where this connection must return. + + .. versionadded:: 8.0.13 + """ + def __init__(self, pool): + if not isinstance(pool, ConnectionPool): + raise AttributeError("pool should be a ConnectionPool object") + super(PooledConnection, self).__init__(pool.cnx_config) + self.pool = pool + self.host = pool.cnx_config["host"] + self.port = pool.cnx_config["port"] + + def close_connection(self): + """Closes the connection. + + This method closes the socket. + """ + super(PooledConnection, self).close_session() + + def close_session(self): + """Do not close, but add connection back to pool. + + The close_session() method does not close the connection with the + MySQL server. The connection is added back to the pool so it + can be reused. + + When the pool is configured to reset the session, the session + state will be cleared by re-authenticating the user once the connection + is get from the pool. + """ + self.pool.add_connection(self) + + def reconnect(self): + """Reconnect this connection. + """ + if self._active_result is not None: + self._active_result.fetch_all() + self._authenticate() + + def reset(self): + """Reset the connection. + + Resets the connection by re-authenticate. + """ + self.reconnect() + + def sql(self, sql_statement): + """Creates a :class:`mysqlx.SqlStatement` object to allow running the + SQL statement on the target MySQL Server. + + Returns: + :class:`mysqlx.SqlStatement`: The sql statement object. + """ + return SqlStatement(self, sql_statement) + + +class ConnectionPool(queue.Queue): + """This class represents a pool of connections. + + Initializes the Pool with the given name and settings. + + Args: + name (str): The name of the pool, used to track a single pool per + combination of host and user. + **kwargs: + max_size (int): The maximun number of connections to hold in + the pool. + reset_session (bool): If the connection should be reseted when + is taken from the pool. + max_idle_time (int): The maximum number of milliseconds to allow + a connection to be idle in the queue before + being closed. Zero value means infinite. + queue_timeout (int): The maximum number of milliseconds a + request will wait for a connection to + become available. A zero value means + infinite. + priority (int): The router priority, to choose this pool over + other with lower priority. + + Raises: + :class:`mysqlx.PoolError` on errors. + + .. versionadded:: 8.0.13 + """ + def __init__(self, name, **kwargs): + self._set_pool_name(name) + self._open_sessions = 0 + self._connections_openned = [] + self.pool_max_size = kwargs.get("max_size", 25) + # Can't invoke super due to Queue not is a new-style class + queue.Queue.__init__(self, self.pool_max_size) + self.reset_session = kwargs.get("reset_session", True) + self.max_idle_time = kwargs.get("max_idle_time", 25) + self.settings = kwargs + self.queue_timeout = kwargs.get("queue_timeout", 25) + self._priority = kwargs.get('priority', 0) + self.cnx_config = kwargs + self.host = kwargs['host'] + self.port = kwargs['port'] + + def _set_pool_name(self, pool_name): + r"""Set the name of the pool. + + This method checks the validity and sets the name of the pool. + + Args: + pool_name (str): The pool name. + + Raises: + AttributeError: If the pool_name contains illegal characters + ([^a-zA-Z0-9._\-*$#]) or is longer than + connection._CNX_POOL_MAX_NAME_SIZE. + """ + if _CNX_POOL_NAME_REGEX.search(pool_name): + raise AttributeError( + "Pool name '{0}' contains illegal characters".format(pool_name)) + if len(pool_name) > _CNX_POOL_MAX_NAME_SIZE: + raise AttributeError( + "Pool name '{0}' is too long".format(pool_name)) + self.name = pool_name + + @property + def open_connections(self): + """Returns the number of open connections that can return to this pool. + """ + return len(self._connections_openned) + + def add_connection(self, cnx=None): + """Adds a connection to this pool. + + This method instantiates a Connection using the configuration passed + when initializing the ConnectionPool instance or using the set_config() + method. + If cnx is a Connection instance, it will be added to the queue. + + Args: + cnx (PooledConnection): The connection object. + + Raises: + PoolError: If no configuration is set, if no more connection can + be added (maximum reached) or if the connection can not + be instantiated. + """ + if not self.cnx_config: + raise PoolError("Connection configuration not available") + + if self.full(): + raise PoolError("Failed adding connection; queue is full") + + if not cnx: + cnx = PooledConnection(self) + # mysqlx_wait_timeout is only available on MySQL 8 + ver = cnx.sql('show variables like "version"' + ).execute().fetch_all()[0][1] + if tuple([int(n) for n in ver.split("-")[0].split(".")]) > (8, 10): + cnx.sql("set mysqlx_wait_timeout = {}".format(1) + ).execute() + self._connections_openned.append(cnx) + else: + if not isinstance(cnx, PooledConnection): + raise PoolError( + "Connection instance not subclass of PooledSession.") + + self.queue_connection(cnx) + + def queue_connection(self, cnx): + """Put connection back in the queue: + + This method is putting a connection back in the queue. + It will not acquire a lock as the methods using _queue_connection() will + have it set. + + Args: + PooledConnection: The connection object. + + Raises: + PoolError: On errors. + """ + if not isinstance(cnx, PooledConnection): + raise PoolError( + "Connection instance not subclass of PooledSession.") + + # Reset the connection + if self.reset_session: + cnx.reset_session() + try: + self.put(cnx, block=False) + except queue.Full: + PoolError("Failed adding connection; queue is full") + + def track_connection(self, connection): + """Tracks connection in order of close it when client.close() is invoke. + """ + self._connections_openned.append(connection) + + def __str__(self): + return self.name + + def close(self): + """Empty this ConnectionPool. + """ + for cnx in self._connections_openned: + cnx.close_connection() + + +class PoolsManager(object): + """Manages a pool of connections for a host or hosts in routers. + + This class handles all the pools of Connections. + + .. versionadded:: 8.0.13 + """ + __instance = None + __pools = {} + + def __new__(cls): + if PoolsManager.__instance is None: + PoolsManager.__instance = object.__new__(cls) + PoolsManager.__pools = {} + return PoolsManager.__instance + + def _pool_exists(self, client_id, pool_name): + """Verifies if a pool exists with the given name. + + Args: + client_id (str): The client id. + pool_name (str): The name of the pool. + + Returns: + bool: Returns `True` if the pool exists otherwise `False`. + """ + pools = self.__pools.get(client_id, []) + for pool in pools: + if pool.name == pool_name: + return True + return False + + def _get_pools(self, settings): + """Retrieves a list of pools that shares the given settings. + + Args: + settings (dict): the configuration of the pool. + + Returns: + list: A list of pools that shares the given settings. + """ + available_pools = [] + pool_names = [] + connections_settings = self._get_connections_settings(settings) + + # Generate the names of the pools this settings can connect to + for router_name, _ in connections_settings: + pool_names.append(router_name) + + # Generate the names of the pools this settings can connect to + for pool in self.__pools.get(settings.get("client_id", "No id"), []): + if pool.name in pool_names: + available_pools.append(pool) + return available_pools + + def _get_connections_settings(self, settings): + """Generates a list of separated connection settings for each host. + + Gets a list of connection settings for each host or router found in the + given settings. + + Args: + settings (dict): The configuration for the connections. + + Returns: + list: A list of connections settings + """ + pool_settings = settings.copy() + routers = pool_settings.get("routers", []) + connections_settings = [] + if "routers" in pool_settings: + pool_settings.pop("routers") + if "host" in pool_settings and "port" in pool_settings: + routers.append({"priority": 0, + "host": pool_settings["host"], + "port": pool_settings["port"]}) + # Order routers + routers.sort(key=lambda x: x["priority"], reverse=True) + for router in routers: + connection_settings = pool_settings.copy() + connection_settings["host"] = router["host"] + connection_settings["port"] = router["port"] + connection_settings["priority"] = router["priority"] + connections_settings.append( + (generate_pool_name(**connection_settings), + connection_settings)) + return connections_settings + + def create_pool(self, cnx_settings): + """Creates a `ConnectionPool` instance to hold the connections. + + Creates a `ConnectionPool` instance to hold the connections only if + no other pool exists with the same configuration. + + Args: + cnx_settings (dict): The configuration for the connections. + """ + connections_settings = self._get_connections_settings(cnx_settings) + + # Subscribe client if it does not exists + if cnx_settings.get("client_id", "No id") not in self.__pools: + self.__pools[cnx_settings.get("client_id", "No id")] = [] + + # Create a pool for each router + for router_name, settings in connections_settings: + if self._pool_exists(cnx_settings.get("client_id", "No id"), + router_name): + continue + else: + pool = self.__pools.get(cnx_settings.get("client_id", "No id"), + []) + pool.append(ConnectionPool(router_name, **settings)) + + def get_connection(self, settings): + """Get a connection from the pool. + + This method returns an `PooledConnection` instance which has a reference + to the pool that created it, and can be used as a normal Connection. + + When the MySQL connection is not connected, a reconnect is attempted. + + Raises: + :class:`PoolError`: On errors. + + Returns: + PooledConnection: A pooled connection object. + """ + pools = self._get_pools(settings) + # Pools are stored by router priority + num_pools = len(pools) + for pool_number in range(num_pools): + pool = pools[pool_number] + try: + # Check connections aviability in this pool + if pool.qsize() > 0: + # We have connections in pool, try to return a working one + with threading.RLock(): + try: + cnx = pool.get(block=True, + timeout=pool.queue_timeout) + except queue.Empty: + raise PoolError( + "Failed getting connection; pool exhausted") + cnx.reset() + # mysqlx_wait_timeout is only available on MySQL 8 + ver = cnx.sql('show variables like "version"' + ).execute().fetch_all()[0][1] + if tuple([int(n) for n in + ver.split("-")[0].split(".")]) > (8, 10): + cnx.sql("set mysqlx_wait_timeout = {}".format(1) + ).execute() + return cnx + elif pool.open_connections < pool.pool_max_size: + # No connections in pool, but we can open a new one + cnx = PooledConnection(pool) + pool.track_connection(cnx) + cnx.connect() + # mysqlx_wait_timeout is only available on MySQL 8 + ver = cnx.sql('show variables like "version"' + ).execute().fetch_all()[0][1] + if tuple([int(n) for n in + ver.split("-")[0].split(".")]) > (8, 10): + cnx.sql("set mysqlx_wait_timeout = {}".format(1) + ).execute() + return cnx + else: + # Pool is exaust so the client needs to wait + with threading.RLock(): + try: + cnx = pool.get(block=True, + timeout=pool.queue_timeout) + cnx.reset() + # mysqlx_wait_timeout is only available on MySQL 8 + ver = cnx.sql('show variables like "version"' + ).execute().fetch_all()[0][1] + if tuple([int(n) for n in + ver.split("-")[0].split(".")]) > (8, 10): + cnx.sql("set mysqlx_wait_timeout = {}".format(1) + ).execute() + return cnx + except queue.Empty: + raise PoolError("pool max size has been reached") + except (InterfaceError, TimeoutError): + if pool_number == num_pools - 1: + raise + else: + continue + + def close_pool(self, cnx_settings): + """Closes the connections in the pools + + Returns: + int: The number of closed pools + """ + pools = self._get_pools(cnx_settings) + for pool in pools: + pool.close() + # Remove the pool + if cnx_settings.get("client_id", None) is not None: + client_pools = self.__pools.get(cnx_settings.get("client_id")) + if pool in client_pools: + client_pools.remove(pool) + return len(pools) + + +class Session(object): + """Enables interaction with a X Protocol enabled MySQL Product. + + The functionality includes: + + - Accessing available schemas. + - Schema management operations. + - Enabling/disabling warning generation. + - Retrieval of connection information. + + Args: + settings (dict): Connection data used to connect to the database. + """ + def __init__(self, settings): + self.use_pure = settings.get("use-pure", Protobuf.use_pure) + self._settings = settings + if "pooling" in settings and settings["pooling"]: + # Create pool and retrieve a Connection instance + PoolsManager().create_pool(settings) + self._connection = PoolsManager().get_connection(settings) + if self._connection is None: + raise PoolError("connection could not be retrieve from pool. %s", + values=settings) + else: + self._connection = Connection(self._settings) + self._connection.connect() + # Set default schema + schema = self._settings.get("schema") + if schema: + try: + self.sql("USE {}".format(quote_identifier(schema))).execute() + except OperationalError as err: + # Access denied for user will raise err.errno = 1044 + errmsg = err.msg if err.errno == 1044 \ + else "Default schema '{}' does not exists".format(schema) + raise InterfaceError(errmsg, err.errno) + + @property + def use_pure(self): + """bool: `True` to use pure Python Protobuf implementation. + """ + return Protobuf.use_pure + + @use_pure.setter + def use_pure(self, value): + if not isinstance(value, bool): + raise ProgrammingError("'use_pure' option should be True or False") + Protobuf.set_use_pure(value) + + def is_open(self): + """Returns `True` if the session is open. + + Returns: + bool: Returns `True` if the session is open. + """ + return self._connection.stream.is_open() + + def sql(self, sql): + """Creates a :class:`mysqlx.SqlStatement` object to allow running the + SQL statement on the target MySQL Server. + """ + return SqlStatement(self._connection, sql) + + def get_connection(self): + """Returns the underlying connection. + + Returns: + mysqlx.connection.Connection: The connection object. + """ + return self._connection + + def get_schemas(self): + """Returns the list of schemas in the current session. + + Returns: + `list`: The list of schemas in the current session. + + .. versionadded:: 8.0.12 + """ + result = self.sql("SHOW DATABASES").execute() + return [row[0] for row in result.fetch_all()] + + def get_schema(self, name): + """Retrieves a Schema object from the current session by it's name. + + Args: + name (string): The name of the Schema object to be retrieved. + + Returns: + mysqlx.Schema: The Schema object with the given name. + """ + return Schema(self, name) + + def get_default_schema(self): + """Retrieves a Schema object from the current session by the schema + name configured in the connection settings. + + Returns: + mysqlx.Schema: The Schema object with the given name at connect + time. + None: In case the default schema was not provided with the + initialization data. + + Raises: + :class:`mysqlx.ProgrammingError`: If the provided default schema + does not exists. + """ + schema = self._connection.settings.get("schema") + if schema: + res = self.sql( + _SELECT_SCHEMA_NAME_QUERY.format(escape(schema)) + ).execute().fetch_all() + try: + if res[0][0] == schema: + return Schema(self, schema) + except IndexError: + raise ProgrammingError( + "Default schema '{}' does not exists".format(schema)) + return None + + def drop_schema(self, name): + """Drops the schema with the specified name. + + Args: + name (string): The name of the Schema object to be retrieved. + """ + self._connection.execute_nonquery( + "sql", _DROP_DATABASE_QUERY.format(quote_identifier(name)), True) + + def create_schema(self, name): + """Creates a schema on the database and returns the corresponding + object. + + Args: + name (string): A string value indicating the schema name. + """ + self._connection.execute_nonquery( + "sql", _CREATE_DATABASE_QUERY.format(quote_identifier(name)), True) + return Schema(self, name) + + def start_transaction(self): + """Starts a transaction context on the server.""" + self._connection.execute_nonquery("sql", "START TRANSACTION", True) + + def commit(self): + """Commits all the operations executed after a call to + startTransaction(). + """ + self._connection.execute_nonquery("sql", "COMMIT", True) + + def rollback(self): + """Discards all the operations executed after a call to + startTransaction(). + """ + self._connection.execute_nonquery("sql", "ROLLBACK", True) + + def set_savepoint(self, name=None): + """Creates a transaction savepoint. + + If a name is not provided, one will be generated using the uuid.uuid1() + function. + + Args: + name (Optional[string]): The savepoint name. + + Returns: + string: The savepoint name. + """ + if name is None: + name = "{0}".format(uuid.uuid1()) + elif not isinstance(name, STRING_TYPES) or len(name.strip()) == 0: + raise ProgrammingError("Invalid SAVEPOINT name") + self._connection.execute_nonquery("sql", "SAVEPOINT {0}" + "".format(quote_identifier(name)), + True) + return name + + def rollback_to(self, name): + """Rollback to a transaction savepoint with the given name. + + Args: + name (string): The savepoint name. + """ + if not isinstance(name, STRING_TYPES) or len(name.strip()) == 0: + raise ProgrammingError("Invalid SAVEPOINT name") + self._connection.execute_nonquery("sql", "ROLLBACK TO SAVEPOINT {0}" + "".format(quote_identifier(name)), + True) + + def release_savepoint(self, name): + """Release a transaction savepoint with the given name. + + Args: + name (string): The savepoint name. + """ + if not isinstance(name, STRING_TYPES) or len(name.strip()) == 0: + raise ProgrammingError("Invalid SAVEPOINT name") + self._connection.execute_nonquery("sql", "RELEASE SAVEPOINT {0}" + "".format(quote_identifier(name)), + True) + + def close(self): + """Closes the session.""" + self._connection.close_session() + # Set an unconnected connection + self._connection = Connection(self._settings) + + def close_connections(self): + """Closes all underliying connections as pooled connections""" + self._connection.close_connection() + + +class Client(object): + """Class defining a client, it stores a connection configuration. + + Args: + connection_dict (dict): The connection information to connect to a + MySQL server. + options_dict (dict): The options to configure this client. + + .. versionadded:: 8.0.13 + """ + def __init__(self, connection_dict, options_dict=None): + self.settings = connection_dict + if options_dict is None: + options_dict = {} + + self.sessions = [] + self.client_id = uuid.uuid4() + + self._set_pool_size(options_dict.get("max_size", 25)) + self._set_max_idle_time(options_dict.get("max_idle_time", 0)) + self._set_queue_timeout(options_dict.get("queue_timeout", 0)) + self._set_pool_enabled(options_dict.get("enabled", True)) + + self.settings["pooling"] = self.pooling_enabled + self.settings["max_size"] = self.max_size + self.settings["client_id"] = self.client_id + + def _set_pool_size(self, pool_size): + """Set the size of the pool. + + This method sets the size of the pool but it will not resize the pool. + + Args: + pool_size (int): An integer equal or greater than 0 indicating + the pool size. + + Raises: + :class:`AttributeError`: If the pool_size value is not an integer + greater or equal to 0. + """ + if isinstance(pool_size, bool) or not isinstance(pool_size, int) or \ + not pool_size > 0: + raise AttributeError("Pool max_size value must be an integer " + "greater than 0, the given value {} " + "is not valid.".format(pool_size)) + + self.max_size = _CNX_POOL_MAXSIZE if pool_size == 0 else pool_size + + def _set_max_idle_time(self, max_idle_time): + """Set the max idle time. + + This method sets the max idle time. + + Args: + max_idle_time (int): An integer equal or greater than 0 indicating + the max idle time. + + Raises: + :class:`AttributeError`: If the max_idle_time value is not an + integer greater or equal to 0. + """ + if isinstance(max_idle_time, bool) or \ + not isinstance(max_idle_time, int) or not max_idle_time > -1: + raise AttributeError("Connection max_idle_time value must be an " + "integer greater or equal to 0, the given " + "value {} is not valid.".format(max_idle_time)) + + self.max_idle_time = max_idle_time + self.settings["max_idle_time"] = _CNX_POOL_MAX_IDLE_TIME \ + if max_idle_time == 0 else int(max_idle_time / 1000) + + def _set_pool_enabled(self, enabled): + """Set if the pool is enabled. + + This method sets if the pool is enabled. + + Args: + enabled (bool): True if to enabling the pool. + + Raises: + :class:`AttributeError`: If the value of enabled is not a bool type. + """ + if not isinstance(enabled, bool): + raise AttributeError("The enabled value should be True or False.") + self.pooling_enabled = enabled + + def _set_queue_timeout(self, queue_timeout): + """Set the queue timeout. + + This method sets the queue timeout. + + Args: + queue_timeout (int): An integer equal or greater than 0 indicating + the queue timeout. + + Raises: + :class:`AttributeError`: If the queue_timeout value is not an + integer greater or equal to 0. + """ + if isinstance(queue_timeout, bool) or \ + not isinstance(queue_timeout, int) or not queue_timeout > -1: + raise AttributeError("Connection queue_timeout value must be an " + "integer greater or equal to 0, the given " + "value {} is not valid.".format(queue_timeout)) + + self.queue_timeout = queue_timeout + self.settings["queue_timeout"] = _CNX_POOL_QUEUE_TIMEOUT \ + if queue_timeout == 0 else int(queue_timeout / 1000) + # To avoid a connection stall waiting for the server, if the + # connect-timeout is not given, use the queue_timeout + if not "connect-timeout" in self.settings: + self.settings["connect-timeout"] = self.queue_timeout + + def get_session(self): + """Creates a Session instance using the provided connection data. + + Returns: + Session: Session object. + """ + session = Session(self.settings) + self.sessions.append(session) + return session + + def close(self): + """Closes the sessions opened by this client. + """ + PoolsManager().close_pool(self.settings) + for session in self.sessions: + session.close_connections() diff --git a/venv/Lib/site-packages/mysqlx/constants.py b/venv/Lib/site-packages/mysqlx/constants.py new file mode 100644 index 0000000..7e9488b --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/constants.py @@ -0,0 +1,61 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Constants.""" + +from collections import namedtuple + + +# pylint: disable=C0103 +def create_enum(name, fields, values=None): + """Emulates an enum by creating a namedtuple. + + Args: + name (string): The type name. + fields (tuple): The fields names. + values (tuple): The values of the fields. + + Returns: + namedtuple: A namedtuple object. + """ + Enum = namedtuple(name, fields) + if values is None: + return Enum(*fields) + return Enum(*values) + + +SSLMode = create_enum("SSLMode", + ("REQUIRED", "DISABLED", "VERIFY_CA", "VERIFY_IDENTITY"), + ("required", "disabled", "verify_ca", "verify_identity")) +Auth = create_enum("Auth", + ("PLAIN", "MYSQL41", "SHA256_MEMORY"), + ("plain", "mysql41", "sha256_memory")) +LockContention = create_enum("LockContention", + ("DEFAULT", "NOWAIT", "SKIP_LOCKED"), (0, 1, 2)) + +__all__ = ["SSLMode", "Auth", "LockContention"] diff --git a/venv/Lib/site-packages/mysqlx/crud.py b/venv/Lib/site-packages/mysqlx/crud.py new file mode 100644 index 0000000..ad0c6c4 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/crud.py @@ -0,0 +1,565 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of the CRUD database objects.""" + +from .dbdoc import DbDoc +from .errorcode import ER_NO_SUCH_TABLE +from .errors import OperationalError, ProgrammingError +from .helpers import deprecated, escape, quote_identifier +from .statement import (FindStatement, AddStatement, RemoveStatement, + ModifyStatement, SelectStatement, InsertStatement, + DeleteStatement, UpdateStatement, + CreateCollectionIndexStatement) + + +_COUNT_VIEWS_QUERY = ("SELECT COUNT(*) FROM information_schema.views " + "WHERE table_schema = '{0}' AND table_name = '{1}'") +_COUNT_TABLES_QUERY = ("SELECT COUNT(*) FROM information_schema.tables " + "WHERE table_schema = '{0}' AND table_name = '{1}'") +_COUNT_SCHEMAS_QUERY = ("SELECT COUNT(*) FROM information_schema.schemata " + "WHERE schema_name = '{0}'") +_COUNT_QUERY = "SELECT COUNT(*) FROM {0}.{1}" +_DROP_TABLE_QUERY = "DROP TABLE IF EXISTS {0}.{1}" + + +class DatabaseObject(object): + """Provides base functionality for database objects. + + Args: + schema (mysqlx.Schema): The Schema object. + name (str): The database object name. + """ + def __init__(self, schema, name): + self._schema = schema + self._name = name + self._session = self._schema.get_session() + self._connection = self._session.get_connection() + + @property + def session(self): + """:class:`mysqlx.Session`: The Session object. + """ + return self._session + + @property + def schema(self): + """:class:`mysqlx.Schema`: The Schema object. + """ + return self._schema + + @property + def name(self): + """str: The name of this database object. + """ + return self._name + + def get_connection(self): + """Returns the underlying connection. + + Returns: + mysqlx.connection.Connection: The connection object. + """ + return self._connection + + def get_session(self): + """Returns the session of this database object. + + Returns: + mysqlx.Session: The Session object. + """ + return self._session + + def get_schema(self): + """Returns the Schema object of this database object. + + Returns: + mysqlx.Schema: The Schema object. + """ + return self._schema + + def get_name(self): + """Returns the name of this database object. + + Returns: + str: The name of this database object. + """ + return self._name + + def exists_in_database(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + + Raises: + NotImplementedError: This method must be implemented. + """ + raise NotImplementedError + + @deprecated("8.0.12", "Use 'exists_in_database()' method instead") + def am_i_real(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + + Raises: + NotImplementedError: This method must be implemented. + + .. deprecated:: 8.0.12 + Use ``exists_in_database()`` method instead. + """ + return self.exists_in_database() + + @deprecated("8.0.12", "Use 'get_name()' method instead") + def who_am_i(self): + """Returns the name of this database object. + + Returns: + str: The name of this database object. + + .. deprecated:: 8.0.12 + Use ``get_name()`` method instead. + """ + return self.get_name() + + +class Schema(DatabaseObject): + """A client-side representation of a database schema. Provides access to + the schema contents. + + Args: + session (mysqlx.XSession): Session object. + name (str): The Schema name. + """ + def __init__(self, session, name): + self._session = session + super(Schema, self).__init__(self, name) + + def exists_in_database(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + """ + sql = _COUNT_SCHEMAS_QUERY.format(escape(self._name)) + return self._connection.execute_sql_scalar(sql) == 1 + + def get_collections(self): + """Returns a list of collections for this schema. + + Returns: + `list`: List of Collection objects. + """ + rows = self._connection.get_row_result("list_objects", self._name) + rows.fetch_all() + collections = [] + for row in rows: + if row["type"] != "COLLECTION": + continue + try: + collection = Collection(self, row["TABLE_NAME"]) + except ValueError: + collection = Collection(self, row["name"]) + collections.append(collection) + return collections + + def get_collection_as_table(self, name, check_existence=False): + """Returns a a table object for the given collection + + Returns: + mysqlx.Table: Table object. + + """ + return self.get_table(name, check_existence) + + def get_tables(self): + """Returns a list of tables for this schema. + + Returns: + `list`: List of Table objects. + """ + rows = self._connection.get_row_result("list_objects", self._name) + rows.fetch_all() + tables = [] + object_types = ("TABLE", "VIEW",) + for row in rows: + if row["type"] in object_types: + try: + table = Table(self, row["TABLE_NAME"]) + except ValueError: + table = Table(self, row["name"]) + tables.append(table) + return tables + + def get_table(self, name, check_existence=False): + """Returns the table of the given name for this schema. + + Returns: + mysqlx.Table: Table object. + """ + table = Table(self, name) + if check_existence: + if not table.exists_in_database(): + raise ProgrammingError("Table does not exist") + return table + + def get_view(self, name, check_existence=False): + """Returns the view of the given name for this schema. + + Returns: + mysqlx.View: View object. + """ + view = View(self, name) + if check_existence: + if not view.exists_in_database(): + raise ProgrammingError("View does not exist") + return view + + def get_collection(self, name, check_existence=False): + """Returns the collection of the given name for this schema. + + Returns: + mysqlx.Collection: Collection object. + """ + collection = Collection(self, name) + if check_existence: + if not collection.exists_in_database(): + raise ProgrammingError("Collection does not exist") + return collection + + def drop_collection(self, name): + """Drops a collection. + + Args: + name (str): The name of the collection to be dropped. + """ + self._connection.execute_nonquery( + "sql", _DROP_TABLE_QUERY.format(quote_identifier(self._name), + quote_identifier(name)), False) + + def create_collection(self, name, reuse=False): + """Creates in the current schema a new collection with the specified + name and retrieves an object representing the new collection created. + + Args: + name (str): The name of the collection. + reuse (bool): `True` to reuse an existing collection. + + Returns: + mysqlx.Collection: Collection object. + + Raises: + :class:`mysqlx.ProgrammingError`: If ``reuse`` is False and + collection exists. + """ + if not name: + raise ProgrammingError("Collection name is invalid") + collection = Collection(self, name) + if not collection.exists_in_database(): + self._connection.execute_nonquery("xplugin", "create_collection", + True, self._name, name) + elif not reuse: + raise ProgrammingError("Collection already exists") + return collection + + +class Collection(DatabaseObject): + """Represents a collection of documents on a schema. + + Args: + schema (mysqlx.Schema): The Schema object. + name (str): The collection name. + """ + + def exists_in_database(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + """ + sql = _COUNT_TABLES_QUERY.format(escape(self._schema.name), + escape(self._name)) + return self._connection.execute_sql_scalar(sql) == 1 + + def find(self, condition=None): + """Retrieves documents from a collection. + + Args: + condition (Optional[str]): The string with the filter expression of + the documents to be retrieved. + """ + return FindStatement(self, condition) + + def add(self, *values): + """Adds a list of documents to a collection. + + Args: + *values: The document list to be added into the collection. + + Returns: + mysqlx.AddStatement: AddStatement object. + """ + return AddStatement(self).add(*values) + + + def remove(self, condition): + """Removes documents based on the ``condition``. + + Args: + condition (str): The string with the filter expression of the + documents to be removed. + + Returns: + mysqlx.RemoveStatement: RemoveStatement object. + + .. versionchanged:: 8.0.12 + The ``condition`` parameter is now mandatory. + """ + return RemoveStatement(self, condition) + + def modify(self, condition): + """Modifies documents based on the ``condition``. + + Args: + condition (str): The string with the filter expression of the + documents to be modified. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + + .. versionchanged:: 8.0.12 + The ``condition`` parameter is now mandatory. + """ + return ModifyStatement(self, condition) + + def count(self): + """Counts the documents in the collection. + + Returns: + int: The total of documents in the collection. + """ + sql = _COUNT_QUERY.format(quote_identifier(self._schema.name), + quote_identifier(self._name)) + try: + res = self._connection.execute_sql_scalar(sql) + except OperationalError as err: + if err.errno == ER_NO_SUCH_TABLE: + raise OperationalError( + "Collection '{}' does not exist in schema '{}'" + "".format(self._name, self._schema.name)) + raise + return res + + def create_index(self, index_name, fields_desc): + """Creates a collection index. + + Args: + index_name (str): Index name. + fields_desc (dict): A dictionary containing the fields members that + constraints the index to be created. It must + have the form as shown in the following:: + + {"fields": [{"field": member_path, + "type": member_type, + "required": member_required, + "collation": collation, + "options": options, + "srid": srid}, + # {... more members, + # repeated as many times + # as needed} + ], + "type": type} + """ + return CreateCollectionIndexStatement(self, index_name, fields_desc) + + def drop_index(self, index_name): + """Drops a collection index. + + Args: + index_name (str): Index name. + """ + self._connection.execute_nonquery("xplugin", "drop_collection_index", + False, self._schema.name, self._name, + index_name) + + def replace_one(self, doc_id, doc): + """Replaces the Document matching the document ID with a new document + provided. + + Args: + doc_id (str): Document ID + doc (DbDoc/dict): New Document + """ + return self.modify("_id = :id").set("$", doc) \ + .bind("id", doc_id).execute() + + def add_or_replace_one(self, doc_id, doc): + """Upserts the Document matching the document ID with a new document + provided. + + Args: + doc_id (str): Document ID + doc (DbDoc/dict): New Document + """ + if not isinstance(doc, DbDoc): + doc = DbDoc(doc) + return self.add(doc.copy(doc_id)).upsert(True).execute() + + def get_one(self, doc_id): + """Returns a Document matching the Document ID. + + Args: + doc_id (str): Document ID + """ + return self.find("_id = :id").bind("id", doc_id).execute().fetch_one() + + def remove_one(self, doc_id): + """Removes a Document matching the Document ID. + + Args: + doc_id (str): Document ID + + Returns: + mysqlx.Result: Result object. + """ + return self.remove("_id = :id").bind("id", doc_id).execute() + + +class Table(DatabaseObject): + """Represents a database table on a schema. + + Provides access to the table through standard INSERT/SELECT/UPDATE/DELETE + statements. + + Args: + schema (mysqlx.Schema): The Schema object. + name (str): The table name. + """ + + def exists_in_database(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + """ + sql = _COUNT_TABLES_QUERY.format(escape(self._schema.name), + escape(self._name)) + return self._connection.execute_sql_scalar(sql) == 1 + + def select(self, *fields): + """Creates a new :class:`mysqlx.SelectStatement` object. + + Args: + *fields: The fields to be retrieved. + + Returns: + mysqlx.SelectStatement: SelectStatement object + """ + return SelectStatement(self, *fields) + + def insert(self, *fields): + """Creates a new :class:`mysqlx.InsertStatement` object. + + Args: + *fields: The fields to be inserted. + + Returns: + mysqlx.InsertStatement: InsertStatement object + """ + return InsertStatement(self, *fields) + + def update(self): + """Creates a new :class:`mysqlx.UpdateStatement` object. + + Returns: + mysqlx.UpdateStatement: UpdateStatement object + """ + return UpdateStatement(self) + + def delete(self): + """Creates a new :class:`mysqlx.DeleteStatement` object. + + Returns: + mysqlx.DeleteStatement: DeleteStatement object + + .. versionchanged:: 8.0.12 + The ``condition`` parameter was removed. + """ + return DeleteStatement(self) + + def count(self): + """Counts the rows in the table. + + Returns: + int: The total of rows in the table. + """ + sql = _COUNT_QUERY.format(quote_identifier(self._schema.name), + quote_identifier(self._name)) + try: + res = self._connection.execute_sql_scalar(sql) + except OperationalError as err: + if err.errno == ER_NO_SUCH_TABLE: + raise OperationalError( + "Table '{}' does not exist in schema '{}'" + "".format(self._name, self._schema.name)) + raise + return res + + def is_view(self): + """Determine if the underlying object is a view or not. + + Returns: + bool: `True` if the underlying object is a view. + """ + sql = _COUNT_VIEWS_QUERY.format(escape(self._schema.name), + escape(self._name)) + return self._connection.execute_sql_scalar(sql) == 1 + + +class View(Table): + """Represents a database view on a schema. + + Provides a mechanism for creating, alter and drop views. + + Args: + schema (mysqlx.Schema): The Schema object. + name (str): The table name. + """ + + def exists_in_database(self): + """Verifies if this object exists in the database. + + Returns: + bool: `True` if object exists in database. + """ + sql = _COUNT_VIEWS_QUERY.format(escape(self._schema.name), + escape(self._name)) + return self._connection.execute_sql_scalar(sql) == 1 diff --git a/venv/Lib/site-packages/mysqlx/dbdoc.py b/venv/Lib/site-packages/mysqlx/dbdoc.py new file mode 100644 index 0000000..88cb97a --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/dbdoc.py @@ -0,0 +1,102 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of the DbDoc.""" + +import json + +from .compat import STRING_TYPES +from .errors import ProgrammingError + + +class ExprJSONEncoder(json.JSONEncoder): + """A :class:`json.JSONEncoder` subclass, which enables encoding of + :class:`mysqlx.ExprParser` objects.""" + def default(self, o): # pylint: disable=E0202 + if hasattr(o, "expr"): + return "{0}".format(o) + # Let the base class default method raise the TypeError + return json.JSONEncoder.default(self, o) + + +class DbDoc(object): + """Represents a generic document in JSON format. + + Args: + value (object): The value can be a JSON string or a dict. + + Raises: + ValueError: If ``value`` type is not a basestring or dict. + """ + def __init__(self, value): + if isinstance(value, dict): + self.__dict__ = value + elif isinstance(value, STRING_TYPES): + self.__dict__ = json.loads(value) + else: + raise ValueError("Unable to handle type: {0}".format(type(value))) + + def __str__(self): + return json.dumps(self.__dict__, cls=ExprJSONEncoder) + + def __repr__(self): + return repr(self.__dict__) + + def __setitem__(self, index, value): + if index == "_id": + raise ProgrammingError("Cannot modify _id") + self.__dict__[index] = value + + def __getitem__(self, index): + return self.__dict__[index] + + def copy(self, doc_id=None): + """Returns a new copy of a :class:`mysqlx.DbDoc` object containing the + `doc_id` provided. If `doc_id` is not provided, it will be removed from + new :class:`mysqlx.DbDoc` object. + + Args: + doc_id (Optional[str]): Document ID + + Returns: + mysqlx.DbDoc: A new instance of DbDoc containing the _id provided + """ + new_dict = self.__dict__.copy() + if doc_id: + new_dict["_id"] = doc_id + elif "_id" in new_dict: + del new_dict["_id"] + return DbDoc(new_dict) + + def keys(self): + """Returns the keys. + + Returns: + `list`: The keys. + """ + return self.__dict__.keys() diff --git a/venv/Lib/site-packages/mysqlx/errorcode.py b/venv/Lib/site-packages/mysqlx/errorcode.py new file mode 100644 index 0000000..ecc1470 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/errorcode.py @@ -0,0 +1,4611 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2018-03-16' +_MYSQL_VERSION = (8, 0, 11) + +"""This module contains the MySQL Server and Client error codes""" + +# Start MySQL Errors +OBSOLETE_ER_HASHCHK = 1000 +OBSOLETE_ER_NISAMCHK = 1001 +ER_NO = 1002 +ER_YES = 1003 +ER_CANT_CREATE_FILE = 1004 +ER_CANT_CREATE_TABLE = 1005 +ER_CANT_CREATE_DB = 1006 +ER_DB_CREATE_EXISTS = 1007 +ER_DB_DROP_EXISTS = 1008 +OBSOLETE_ER_DB_DROP_DELETE = 1009 +ER_DB_DROP_RMDIR = 1010 +OBSOLETE_ER_CANT_DELETE_FILE = 1011 +ER_CANT_FIND_SYSTEM_REC = 1012 +ER_CANT_GET_STAT = 1013 +OBSOLETE_ER_CANT_GET_WD = 1014 +ER_CANT_LOCK = 1015 +ER_CANT_OPEN_FILE = 1016 +ER_FILE_NOT_FOUND = 1017 +ER_CANT_READ_DIR = 1018 +OBSOLETE_ER_CANT_SET_WD = 1019 +ER_CHECKREAD = 1020 +OBSOLETE_ER_DISK_FULL = 1021 +ER_DUP_KEY = 1022 +OBSOLETE_ER_ERROR_ON_CLOSE = 1023 +ER_ERROR_ON_READ = 1024 +ER_ERROR_ON_RENAME = 1025 +ER_ERROR_ON_WRITE = 1026 +ER_FILE_USED = 1027 +ER_FILSORT_ABORT = 1028 +OBSOLETE_ER_FORM_NOT_FOUND = 1029 +ER_GET_ERRNO = 1030 +ER_ILLEGAL_HA = 1031 +ER_KEY_NOT_FOUND = 1032 +ER_NOT_FORM_FILE = 1033 +ER_NOT_KEYFILE = 1034 +ER_OLD_KEYFILE = 1035 +ER_OPEN_AS_READONLY = 1036 +ER_OUTOFMEMORY = 1037 +ER_OUT_OF_SORTMEMORY = 1038 +OBSOLETE_ER_UNEXPECTED_EOF = 1039 +ER_CON_COUNT_ERROR = 1040 +ER_OUT_OF_RESOURCES = 1041 +ER_BAD_HOST_ERROR = 1042 +ER_HANDSHAKE_ERROR = 1043 +ER_DBACCESS_DENIED_ERROR = 1044 +ER_ACCESS_DENIED_ERROR = 1045 +ER_NO_DB_ERROR = 1046 +ER_UNKNOWN_COM_ERROR = 1047 +ER_BAD_NULL_ERROR = 1048 +ER_BAD_DB_ERROR = 1049 +ER_TABLE_EXISTS_ERROR = 1050 +ER_BAD_TABLE_ERROR = 1051 +ER_NON_UNIQ_ERROR = 1052 +ER_SERVER_SHUTDOWN = 1053 +ER_BAD_FIELD_ERROR = 1054 +ER_WRONG_FIELD_WITH_GROUP = 1055 +ER_WRONG_GROUP_FIELD = 1056 +ER_WRONG_SUM_SELECT = 1057 +ER_WRONG_VALUE_COUNT = 1058 +ER_TOO_LONG_IDENT = 1059 +ER_DUP_FIELDNAME = 1060 +ER_DUP_KEYNAME = 1061 +ER_DUP_ENTRY = 1062 +ER_WRONG_FIELD_SPEC = 1063 +ER_PARSE_ERROR = 1064 +ER_EMPTY_QUERY = 1065 +ER_NONUNIQ_TABLE = 1066 +ER_INVALID_DEFAULT = 1067 +ER_MULTIPLE_PRI_KEY = 1068 +ER_TOO_MANY_KEYS = 1069 +ER_TOO_MANY_KEY_PARTS = 1070 +ER_TOO_LONG_KEY = 1071 +ER_KEY_COLUMN_DOES_NOT_EXITS = 1072 +ER_BLOB_USED_AS_KEY = 1073 +ER_TOO_BIG_FIELDLENGTH = 1074 +ER_WRONG_AUTO_KEY = 1075 +ER_READY = 1076 +OBSOLETE_ER_NORMAL_SHUTDOWN = 1077 +OBSOLETE_ER_GOT_SIGNAL = 1078 +ER_SHUTDOWN_COMPLETE = 1079 +ER_FORCING_CLOSE = 1080 +ER_IPSOCK_ERROR = 1081 +ER_NO_SUCH_INDEX = 1082 +ER_WRONG_FIELD_TERMINATORS = 1083 +ER_BLOBS_AND_NO_TERMINATED = 1084 +ER_TEXTFILE_NOT_READABLE = 1085 +ER_FILE_EXISTS_ERROR = 1086 +ER_LOAD_INFO = 1087 +ER_ALTER_INFO = 1088 +ER_WRONG_SUB_KEY = 1089 +ER_CANT_REMOVE_ALL_FIELDS = 1090 +ER_CANT_DROP_FIELD_OR_KEY = 1091 +ER_INSERT_INFO = 1092 +ER_UPDATE_TABLE_USED = 1093 +ER_NO_SUCH_THREAD = 1094 +ER_KILL_DENIED_ERROR = 1095 +ER_NO_TABLES_USED = 1096 +ER_TOO_BIG_SET = 1097 +ER_NO_UNIQUE_LOGFILE = 1098 +ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099 +ER_TABLE_NOT_LOCKED = 1100 +ER_BLOB_CANT_HAVE_DEFAULT = 1101 +ER_WRONG_DB_NAME = 1102 +ER_WRONG_TABLE_NAME = 1103 +ER_TOO_BIG_SELECT = 1104 +ER_UNKNOWN_ERROR = 1105 +ER_UNKNOWN_PROCEDURE = 1106 +ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107 +ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108 +ER_UNKNOWN_TABLE = 1109 +ER_FIELD_SPECIFIED_TWICE = 1110 +ER_INVALID_GROUP_FUNC_USE = 1111 +ER_UNSUPPORTED_EXTENSION = 1112 +ER_TABLE_MUST_HAVE_COLUMNS = 1113 +ER_RECORD_FILE_FULL = 1114 +ER_UNKNOWN_CHARACTER_SET = 1115 +ER_TOO_MANY_TABLES = 1116 +ER_TOO_MANY_FIELDS = 1117 +ER_TOO_BIG_ROWSIZE = 1118 +ER_STACK_OVERRUN = 1119 +ER_WRONG_OUTER_JOIN_UNUSED = 1120 +ER_NULL_COLUMN_IN_INDEX = 1121 +ER_CANT_FIND_UDF = 1122 +ER_CANT_INITIALIZE_UDF = 1123 +ER_UDF_NO_PATHS = 1124 +ER_UDF_EXISTS = 1125 +ER_CANT_OPEN_LIBRARY = 1126 +ER_CANT_FIND_DL_ENTRY = 1127 +ER_FUNCTION_NOT_DEFINED = 1128 +ER_HOST_IS_BLOCKED = 1129 +ER_HOST_NOT_PRIVILEGED = 1130 +ER_PASSWORD_ANONYMOUS_USER = 1131 +ER_PASSWORD_NOT_ALLOWED = 1132 +ER_PASSWORD_NO_MATCH = 1133 +ER_UPDATE_INFO = 1134 +ER_CANT_CREATE_THREAD = 1135 +ER_WRONG_VALUE_COUNT_ON_ROW = 1136 +ER_CANT_REOPEN_TABLE = 1137 +ER_INVALID_USE_OF_NULL = 1138 +ER_REGEXP_ERROR = 1139 +ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140 +ER_NONEXISTING_GRANT = 1141 +ER_TABLEACCESS_DENIED_ERROR = 1142 +ER_COLUMNACCESS_DENIED_ERROR = 1143 +ER_ILLEGAL_GRANT_FOR_TABLE = 1144 +ER_GRANT_WRONG_HOST_OR_USER = 1145 +ER_NO_SUCH_TABLE = 1146 +ER_NONEXISTING_TABLE_GRANT = 1147 +ER_NOT_ALLOWED_COMMAND = 1148 +ER_SYNTAX_ERROR = 1149 +OBSOLETE_ER_UNUSED1 = 1150 +OBSOLETE_ER_UNUSED2 = 1151 +ER_ABORTING_CONNECTION = 1152 +ER_NET_PACKET_TOO_LARGE = 1153 +ER_NET_READ_ERROR_FROM_PIPE = 1154 +ER_NET_FCNTL_ERROR = 1155 +ER_NET_PACKETS_OUT_OF_ORDER = 1156 +ER_NET_UNCOMPRESS_ERROR = 1157 +ER_NET_READ_ERROR = 1158 +ER_NET_READ_INTERRUPTED = 1159 +ER_NET_ERROR_ON_WRITE = 1160 +ER_NET_WRITE_INTERRUPTED = 1161 +ER_TOO_LONG_STRING = 1162 +ER_TABLE_CANT_HANDLE_BLOB = 1163 +ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164 +OBSOLETE_ER_UNUSED3 = 1165 +ER_WRONG_COLUMN_NAME = 1166 +ER_WRONG_KEY_COLUMN = 1167 +ER_WRONG_MRG_TABLE = 1168 +ER_DUP_UNIQUE = 1169 +ER_BLOB_KEY_WITHOUT_LENGTH = 1170 +ER_PRIMARY_CANT_HAVE_NULL = 1171 +ER_TOO_MANY_ROWS = 1172 +ER_REQUIRES_PRIMARY_KEY = 1173 +OBSOLETE_ER_NO_RAID_COMPILED = 1174 +ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175 +ER_KEY_DOES_NOT_EXITS = 1176 +ER_CHECK_NO_SUCH_TABLE = 1177 +ER_CHECK_NOT_IMPLEMENTED = 1178 +ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179 +ER_ERROR_DURING_COMMIT = 1180 +ER_ERROR_DURING_ROLLBACK = 1181 +ER_ERROR_DURING_FLUSH_LOGS = 1182 +OBSOLETE_ER_ERROR_DURING_CHECKPOINT = 1183 +ER_NEW_ABORTING_CONNECTION = 1184 +OBSOLETE_ER_DUMP_NOT_IMPLEMENTED = 1185 +OBSOLETE_ER_FLUSH_MASTER_BINLOG_CLOSED = 1186 +OBSOLETE_ER_INDEX_REBUILD = 1187 +ER_MASTER = 1188 +ER_MASTER_NET_READ = 1189 +ER_MASTER_NET_WRITE = 1190 +ER_FT_MATCHING_KEY_NOT_FOUND = 1191 +ER_LOCK_OR_ACTIVE_TRANSACTION = 1192 +ER_UNKNOWN_SYSTEM_VARIABLE = 1193 +ER_CRASHED_ON_USAGE = 1194 +ER_CRASHED_ON_REPAIR = 1195 +ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196 +ER_TRANS_CACHE_FULL = 1197 +OBSOLETE_ER_SLAVE_MUST_STOP = 1198 +ER_SLAVE_NOT_RUNNING = 1199 +ER_BAD_SLAVE = 1200 +ER_MASTER_INFO = 1201 +ER_SLAVE_THREAD = 1202 +ER_TOO_MANY_USER_CONNECTIONS = 1203 +ER_SET_CONSTANTS_ONLY = 1204 +ER_LOCK_WAIT_TIMEOUT = 1205 +ER_LOCK_TABLE_FULL = 1206 +ER_READ_ONLY_TRANSACTION = 1207 +OBSOLETE_ER_DROP_DB_WITH_READ_LOCK = 1208 +OBSOLETE_ER_CREATE_DB_WITH_READ_LOCK = 1209 +ER_WRONG_ARGUMENTS = 1210 +ER_NO_PERMISSION_TO_CREATE_USER = 1211 +OBSOLETE_ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212 +ER_LOCK_DEADLOCK = 1213 +ER_TABLE_CANT_HANDLE_FT = 1214 +ER_CANNOT_ADD_FOREIGN = 1215 +ER_NO_REFERENCED_ROW = 1216 +ER_ROW_IS_REFERENCED = 1217 +ER_CONNECT_TO_MASTER = 1218 +OBSOLETE_ER_QUERY_ON_MASTER = 1219 +ER_ERROR_WHEN_EXECUTING_COMMAND = 1220 +ER_WRONG_USAGE = 1221 +ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222 +ER_CANT_UPDATE_WITH_READLOCK = 1223 +ER_MIXING_NOT_ALLOWED = 1224 +ER_DUP_ARGUMENT = 1225 +ER_USER_LIMIT_REACHED = 1226 +ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227 +ER_LOCAL_VARIABLE = 1228 +ER_GLOBAL_VARIABLE = 1229 +ER_NO_DEFAULT = 1230 +ER_WRONG_VALUE_FOR_VAR = 1231 +ER_WRONG_TYPE_FOR_VAR = 1232 +ER_VAR_CANT_BE_READ = 1233 +ER_CANT_USE_OPTION_HERE = 1234 +ER_NOT_SUPPORTED_YET = 1235 +ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236 +ER_SLAVE_IGNORED_TABLE = 1237 +ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238 +ER_WRONG_FK_DEF = 1239 +ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240 +ER_OPERAND_COLUMNS = 1241 +ER_SUBQUERY_NO_1_ROW = 1242 +ER_UNKNOWN_STMT_HANDLER = 1243 +ER_CORRUPT_HELP_DB = 1244 +OBSOLETE_ER_CYCLIC_REFERENCE = 1245 +ER_AUTO_CONVERT = 1246 +ER_ILLEGAL_REFERENCE = 1247 +ER_DERIVED_MUST_HAVE_ALIAS = 1248 +ER_SELECT_REDUCED = 1249 +ER_TABLENAME_NOT_ALLOWED_HERE = 1250 +ER_NOT_SUPPORTED_AUTH_MODE = 1251 +ER_SPATIAL_CANT_HAVE_NULL = 1252 +ER_COLLATION_CHARSET_MISMATCH = 1253 +OBSOLETE_ER_SLAVE_WAS_RUNNING = 1254 +OBSOLETE_ER_SLAVE_WAS_NOT_RUNNING = 1255 +ER_TOO_BIG_FOR_UNCOMPRESS = 1256 +ER_ZLIB_Z_MEM_ERROR = 1257 +ER_ZLIB_Z_BUF_ERROR = 1258 +ER_ZLIB_Z_DATA_ERROR = 1259 +ER_CUT_VALUE_GROUP_CONCAT = 1260 +ER_WARN_TOO_FEW_RECORDS = 1261 +ER_WARN_TOO_MANY_RECORDS = 1262 +ER_WARN_NULL_TO_NOTNULL = 1263 +ER_WARN_DATA_OUT_OF_RANGE = 1264 +WARN_DATA_TRUNCATED = 1265 +ER_WARN_USING_OTHER_HANDLER = 1266 +ER_CANT_AGGREGATE_2COLLATIONS = 1267 +OBSOLETE_ER_DROP_USER = 1268 +ER_REVOKE_GRANTS = 1269 +ER_CANT_AGGREGATE_3COLLATIONS = 1270 +ER_CANT_AGGREGATE_NCOLLATIONS = 1271 +ER_VARIABLE_IS_NOT_STRUCT = 1272 +ER_UNKNOWN_COLLATION = 1273 +ER_SLAVE_IGNORED_SSL_PARAMS = 1274 +ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275 +ER_WARN_FIELD_RESOLVED = 1276 +ER_BAD_SLAVE_UNTIL_COND = 1277 +ER_MISSING_SKIP_SLAVE = 1278 +ER_UNTIL_COND_IGNORED = 1279 +ER_WRONG_NAME_FOR_INDEX = 1280 +ER_WRONG_NAME_FOR_CATALOG = 1281 +OBSOLETE_ER_WARN_QC_RESIZE = 1282 +ER_BAD_FT_COLUMN = 1283 +ER_UNKNOWN_KEY_CACHE = 1284 +ER_WARN_HOSTNAME_WONT_WORK = 1285 +ER_UNKNOWN_STORAGE_ENGINE = 1286 +ER_WARN_DEPRECATED_SYNTAX = 1287 +ER_NON_UPDATABLE_TABLE = 1288 +ER_FEATURE_DISABLED = 1289 +ER_OPTION_PREVENTS_STATEMENT = 1290 +ER_DUPLICATED_VALUE_IN_TYPE = 1291 +ER_TRUNCATED_WRONG_VALUE = 1292 +OBSOLETE_ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293 +ER_INVALID_ON_UPDATE = 1294 +ER_UNSUPPORTED_PS = 1295 +ER_GET_ERRMSG = 1296 +ER_GET_TEMPORARY_ERRMSG = 1297 +ER_UNKNOWN_TIME_ZONE = 1298 +ER_WARN_INVALID_TIMESTAMP = 1299 +ER_INVALID_CHARACTER_STRING = 1300 +ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301 +ER_CONFLICTING_DECLARATIONS = 1302 +ER_SP_NO_RECURSIVE_CREATE = 1303 +ER_SP_ALREADY_EXISTS = 1304 +ER_SP_DOES_NOT_EXIST = 1305 +ER_SP_DROP_FAILED = 1306 +ER_SP_STORE_FAILED = 1307 +ER_SP_LILABEL_MISMATCH = 1308 +ER_SP_LABEL_REDEFINE = 1309 +ER_SP_LABEL_MISMATCH = 1310 +ER_SP_UNINIT_VAR = 1311 +ER_SP_BADSELECT = 1312 +ER_SP_BADRETURN = 1313 +ER_SP_BADSTATEMENT = 1314 +ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315 +ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316 +ER_QUERY_INTERRUPTED = 1317 +ER_SP_WRONG_NO_OF_ARGS = 1318 +ER_SP_COND_MISMATCH = 1319 +ER_SP_NORETURN = 1320 +ER_SP_NORETURNEND = 1321 +ER_SP_BAD_CURSOR_QUERY = 1322 +ER_SP_BAD_CURSOR_SELECT = 1323 +ER_SP_CURSOR_MISMATCH = 1324 +ER_SP_CURSOR_ALREADY_OPEN = 1325 +ER_SP_CURSOR_NOT_OPEN = 1326 +ER_SP_UNDECLARED_VAR = 1327 +ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328 +ER_SP_FETCH_NO_DATA = 1329 +ER_SP_DUP_PARAM = 1330 +ER_SP_DUP_VAR = 1331 +ER_SP_DUP_COND = 1332 +ER_SP_DUP_CURS = 1333 +ER_SP_CANT_ALTER = 1334 +ER_SP_SUBSELECT_NYI = 1335 +ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336 +ER_SP_VARCOND_AFTER_CURSHNDLR = 1337 +ER_SP_CURSOR_AFTER_HANDLER = 1338 +ER_SP_CASE_NOT_FOUND = 1339 +ER_FPARSER_TOO_BIG_FILE = 1340 +ER_FPARSER_BAD_HEADER = 1341 +ER_FPARSER_EOF_IN_COMMENT = 1342 +ER_FPARSER_ERROR_IN_PARAMETER = 1343 +ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344 +ER_VIEW_NO_EXPLAIN = 1345 +OBSOLETE_ER_FRM_UNKNOWN_TYPE = 1346 +ER_WRONG_OBJECT = 1347 +ER_NONUPDATEABLE_COLUMN = 1348 +OBSOLETE_ER_VIEW_SELECT_DERIVED_UNUSED = 1349 +ER_VIEW_SELECT_CLAUSE = 1350 +ER_VIEW_SELECT_VARIABLE = 1351 +ER_VIEW_SELECT_TMPTABLE = 1352 +ER_VIEW_WRONG_LIST = 1353 +ER_WARN_VIEW_MERGE = 1354 +ER_WARN_VIEW_WITHOUT_KEY = 1355 +ER_VIEW_INVALID = 1356 +ER_SP_NO_DROP_SP = 1357 +OBSOLETE_ER_SP_GOTO_IN_HNDLR = 1358 +ER_TRG_ALREADY_EXISTS = 1359 +ER_TRG_DOES_NOT_EXIST = 1360 +ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361 +ER_TRG_CANT_CHANGE_ROW = 1362 +ER_TRG_NO_SUCH_ROW_IN_TRG = 1363 +ER_NO_DEFAULT_FOR_FIELD = 1364 +ER_DIVISION_BY_ZERO = 1365 +ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366 +ER_ILLEGAL_VALUE_FOR_TYPE = 1367 +ER_VIEW_NONUPD_CHECK = 1368 +ER_VIEW_CHECK_FAILED = 1369 +ER_PROCACCESS_DENIED_ERROR = 1370 +ER_RELAY_LOG_FAIL = 1371 +OBSOLETE_ER_PASSWD_LENGTH = 1372 +ER_UNKNOWN_TARGET_BINLOG = 1373 +ER_IO_ERR_LOG_INDEX_READ = 1374 +ER_BINLOG_PURGE_PROHIBITED = 1375 +ER_FSEEK_FAIL = 1376 +ER_BINLOG_PURGE_FATAL_ERR = 1377 +ER_LOG_IN_USE = 1378 +ER_LOG_PURGE_UNKNOWN_ERR = 1379 +ER_RELAY_LOG_INIT = 1380 +ER_NO_BINARY_LOGGING = 1381 +ER_RESERVED_SYNTAX = 1382 +OBSOLETE_ER_WSAS_FAILED = 1383 +OBSOLETE_ER_DIFF_GROUPS_PROC = 1384 +OBSOLETE_ER_NO_GROUP_FOR_PROC = 1385 +OBSOLETE_ER_ORDER_WITH_PROC = 1386 +OBSOLETE_ER_LOGGING_PROHIBIT_CHANGING_OF = 1387 +OBSOLETE_ER_NO_FILE_MAPPING = 1388 +OBSOLETE_ER_WRONG_MAGIC = 1389 +ER_PS_MANY_PARAM = 1390 +ER_KEY_PART_0 = 1391 +ER_VIEW_CHECKSUM = 1392 +ER_VIEW_MULTIUPDATE = 1393 +ER_VIEW_NO_INSERT_FIELD_LIST = 1394 +ER_VIEW_DELETE_MERGE_VIEW = 1395 +ER_CANNOT_USER = 1396 +ER_XAER_NOTA = 1397 +ER_XAER_INVAL = 1398 +ER_XAER_RMFAIL = 1399 +ER_XAER_OUTSIDE = 1400 +ER_XAER_RMERR = 1401 +ER_XA_RBROLLBACK = 1402 +ER_NONEXISTING_PROC_GRANT = 1403 +ER_PROC_AUTO_GRANT_FAIL = 1404 +ER_PROC_AUTO_REVOKE_FAIL = 1405 +ER_DATA_TOO_LONG = 1406 +ER_SP_BAD_SQLSTATE = 1407 +ER_STARTUP = 1408 +ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409 +ER_CANT_CREATE_USER_WITH_GRANT = 1410 +ER_WRONG_VALUE_FOR_TYPE = 1411 +ER_TABLE_DEF_CHANGED = 1412 +ER_SP_DUP_HANDLER = 1413 +ER_SP_NOT_VAR_ARG = 1414 +ER_SP_NO_RETSET = 1415 +ER_CANT_CREATE_GEOMETRY_OBJECT = 1416 +OBSOLETE_ER_FAILED_ROUTINE_BREAK_BINLOG = 1417 +ER_BINLOG_UNSAFE_ROUTINE = 1418 +ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419 +OBSOLETE_ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420 +ER_STMT_HAS_NO_OPEN_CURSOR = 1421 +ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422 +ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423 +ER_SP_NO_RECURSION = 1424 +ER_TOO_BIG_SCALE = 1425 +ER_TOO_BIG_PRECISION = 1426 +ER_M_BIGGER_THAN_D = 1427 +ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428 +ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429 +ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430 +ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431 +ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432 +ER_FOREIGN_DATA_STRING_INVALID = 1433 +OBSOLETE_ER_CANT_CREATE_FEDERATED_TABLE = 1434 +ER_TRG_IN_WRONG_SCHEMA = 1435 +ER_STACK_OVERRUN_NEED_MORE = 1436 +ER_TOO_LONG_BODY = 1437 +ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438 +ER_TOO_BIG_DISPLAYWIDTH = 1439 +ER_XAER_DUPID = 1440 +ER_DATETIME_FUNCTION_OVERFLOW = 1441 +ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442 +ER_VIEW_PREVENT_UPDATE = 1443 +ER_PS_NO_RECURSION = 1444 +ER_SP_CANT_SET_AUTOCOMMIT = 1445 +OBSOLETE_ER_MALFORMED_DEFINER = 1446 +ER_VIEW_FRM_NO_USER = 1447 +ER_VIEW_OTHER_USER = 1448 +ER_NO_SUCH_USER = 1449 +ER_FORBID_SCHEMA_CHANGE = 1450 +ER_ROW_IS_REFERENCED_2 = 1451 +ER_NO_REFERENCED_ROW_2 = 1452 +ER_SP_BAD_VAR_SHADOW = 1453 +ER_TRG_NO_DEFINER = 1454 +ER_OLD_FILE_FORMAT = 1455 +ER_SP_RECURSION_LIMIT = 1456 +OBSOLETE_ER_SP_PROC_TABLE_CORRUPT = 1457 +ER_SP_WRONG_NAME = 1458 +ER_TABLE_NEEDS_UPGRADE = 1459 +ER_SP_NO_AGGREGATE = 1460 +ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461 +ER_VIEW_RECURSIVE = 1462 +ER_NON_GROUPING_FIELD_USED = 1463 +ER_TABLE_CANT_HANDLE_SPKEYS = 1464 +ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465 +ER_REMOVED_SPACES = 1466 +ER_AUTOINC_READ_FAILED = 1467 +ER_USERNAME = 1468 +ER_HOSTNAME = 1469 +ER_WRONG_STRING_LENGTH = 1470 +ER_NON_INSERTABLE_TABLE = 1471 +ER_ADMIN_WRONG_MRG_TABLE = 1472 +ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473 +ER_NAME_BECOMES_EMPTY = 1474 +ER_AMBIGUOUS_FIELD_TERM = 1475 +ER_FOREIGN_SERVER_EXISTS = 1476 +ER_FOREIGN_SERVER_DOESNT_EXIST = 1477 +ER_ILLEGAL_HA_CREATE_OPTION = 1478 +ER_PARTITION_REQUIRES_VALUES_ERROR = 1479 +ER_PARTITION_WRONG_VALUES_ERROR = 1480 +ER_PARTITION_MAXVALUE_ERROR = 1481 +OBSOLETE_ER_PARTITION_SUBPARTITION_ERROR = 1482 +OBSOLETE_ER_PARTITION_SUBPART_MIX_ERROR = 1483 +ER_PARTITION_WRONG_NO_PART_ERROR = 1484 +ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485 +ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486 +OBSOLETE_ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487 +ER_FIELD_NOT_FOUND_PART_ERROR = 1488 +OBSOLETE_ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489 +ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490 +ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491 +ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492 +ER_RANGE_NOT_INCREASING_ERROR = 1493 +ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494 +ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495 +ER_PARTITION_ENTRY_ERROR = 1496 +ER_MIX_HANDLER_ERROR = 1497 +ER_PARTITION_NOT_DEFINED_ERROR = 1498 +ER_TOO_MANY_PARTITIONS_ERROR = 1499 +ER_SUBPARTITION_ERROR = 1500 +ER_CANT_CREATE_HANDLER_FILE = 1501 +ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502 +ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503 +ER_NO_PARTS_ERROR = 1504 +ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505 +ER_FOREIGN_KEY_ON_PARTITIONED = 1506 +ER_DROP_PARTITION_NON_EXISTENT = 1507 +ER_DROP_LAST_PARTITION = 1508 +ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509 +ER_REORG_HASH_ONLY_ON_SAME_NO = 1510 +ER_REORG_NO_PARAM_ERROR = 1511 +ER_ONLY_ON_RANGE_LIST_PARTITION = 1512 +ER_ADD_PARTITION_SUBPART_ERROR = 1513 +ER_ADD_PARTITION_NO_NEW_PARTITION = 1514 +ER_COALESCE_PARTITION_NO_PARTITION = 1515 +ER_REORG_PARTITION_NOT_EXIST = 1516 +ER_SAME_NAME_PARTITION = 1517 +ER_NO_BINLOG_ERROR = 1518 +ER_CONSECUTIVE_REORG_PARTITIONS = 1519 +ER_REORG_OUTSIDE_RANGE = 1520 +ER_PARTITION_FUNCTION_FAILURE = 1521 +OBSOLETE_ER_PART_STATE_ERROR = 1522 +ER_LIMITED_PART_RANGE = 1523 +ER_PLUGIN_IS_NOT_LOADED = 1524 +ER_WRONG_VALUE = 1525 +ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526 +ER_FILEGROUP_OPTION_ONLY_ONCE = 1527 +ER_CREATE_FILEGROUP_FAILED = 1528 +ER_DROP_FILEGROUP_FAILED = 1529 +ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530 +ER_WRONG_SIZE_NUMBER = 1531 +ER_SIZE_OVERFLOW_ERROR = 1532 +ER_ALTER_FILEGROUP_FAILED = 1533 +ER_BINLOG_ROW_LOGGING_FAILED = 1534 +OBSOLETE_ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535 +OBSOLETE_ER_BINLOG_ROW_RBR_TO_SBR = 1536 +ER_EVENT_ALREADY_EXISTS = 1537 +OBSOLETE_ER_EVENT_STORE_FAILED = 1538 +ER_EVENT_DOES_NOT_EXIST = 1539 +OBSOLETE_ER_EVENT_CANT_ALTER = 1540 +OBSOLETE_ER_EVENT_DROP_FAILED = 1541 +ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542 +ER_EVENT_ENDS_BEFORE_STARTS = 1543 +ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544 +OBSOLETE_ER_EVENT_OPEN_TABLE_FAILED = 1545 +OBSOLETE_ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546 +OBSOLETE_ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547 +OBSOLETE_ER_CANNOT_LOAD_FROM_TABLE = 1548 +OBSOLETE_ER_EVENT_CANNOT_DELETE = 1549 +OBSOLETE_ER_EVENT_COMPILE_ERROR = 1550 +ER_EVENT_SAME_NAME = 1551 +OBSOLETE_ER_EVENT_DATA_TOO_LONG = 1552 +ER_DROP_INDEX_FK = 1553 +ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554 +OBSOLETE_ER_CANT_WRITE_LOCK_LOG_TABLE = 1555 +ER_CANT_LOCK_LOG_TABLE = 1556 +ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED = 1557 +ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558 +ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559 +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560 +OBSOLETE_ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561 +ER_PARTITION_NO_TEMPORARY = 1562 +ER_PARTITION_CONST_DOMAIN_ERROR = 1563 +ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564 +OBSOLETE_ER_DDL_LOG_ERROR_UNUSED = 1565 +ER_NULL_IN_VALUES_LESS_THAN = 1566 +ER_WRONG_PARTITION_NAME = 1567 +ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568 +ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569 +OBSOLETE_ER_EVENT_MODIFY_QUEUE_ERROR = 1570 +ER_EVENT_SET_VAR_ERROR = 1571 +ER_PARTITION_MERGE_ERROR = 1572 +OBSOLETE_ER_CANT_ACTIVATE_LOG = 1573 +OBSOLETE_ER_RBR_NOT_AVAILABLE = 1574 +ER_BASE64_DECODE_ERROR = 1575 +ER_EVENT_RECURSION_FORBIDDEN = 1576 +OBSOLETE_ER_EVENTS_DB_ERROR = 1577 +ER_ONLY_INTEGERS_ALLOWED = 1578 +ER_UNSUPORTED_LOG_ENGINE = 1579 +ER_BAD_LOG_STATEMENT = 1580 +ER_CANT_RENAME_LOG_TABLE = 1581 +ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582 +ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583 +ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584 +ER_NATIVE_FCT_NAME_COLLISION = 1585 +ER_DUP_ENTRY_WITH_KEY_NAME = 1586 +ER_BINLOG_PURGE_EMFILE = 1587 +ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588 +ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589 +OBSOLETE_ER_SLAVE_INCIDENT = 1590 +ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591 +ER_BINLOG_UNSAFE_STATEMENT = 1592 +ER_BINLOG_FATAL_ERROR = 1593 +OBSOLETE_ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594 +OBSOLETE_ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595 +OBSOLETE_ER_SLAVE_CREATE_EVENT_FAILURE = 1596 +OBSOLETE_ER_SLAVE_MASTER_COM_FAILURE = 1597 +ER_BINLOG_LOGGING_IMPOSSIBLE = 1598 +ER_VIEW_NO_CREATION_CTX = 1599 +ER_VIEW_INVALID_CREATION_CTX = 1600 +OBSOLETE_ER_SR_INVALID_CREATION_CTX = 1601 +ER_TRG_CORRUPTED_FILE = 1602 +ER_TRG_NO_CREATION_CTX = 1603 +ER_TRG_INVALID_CREATION_CTX = 1604 +ER_EVENT_INVALID_CREATION_CTX = 1605 +ER_TRG_CANT_OPEN_TABLE = 1606 +OBSOLETE_ER_CANT_CREATE_SROUTINE = 1607 +OBSOLETE_ER_NEVER_USED = 1608 +ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609 +ER_SLAVE_CORRUPT_EVENT = 1610 +OBSOLETE_ER_LOAD_DATA_INVALID_COLUMN_UNUSED = 1611 +ER_LOG_PURGE_NO_FILE = 1612 +ER_XA_RBTIMEOUT = 1613 +ER_XA_RBDEADLOCK = 1614 +ER_NEED_REPREPARE = 1615 +OBSOLETE_ER_DELAYED_NOT_SUPPORTED = 1616 +WARN_NO_MASTER_INFO = 1617 +WARN_OPTION_IGNORED = 1618 +ER_PLUGIN_DELETE_BUILTIN = 1619 +WARN_PLUGIN_BUSY = 1620 +ER_VARIABLE_IS_READONLY = 1621 +ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622 +OBSOLETE_ER_SLAVE_HEARTBEAT_FAILURE = 1623 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624 +ER_NDB_REPLICATION_SCHEMA_ERROR = 1625 +ER_CONFLICT_FN_PARSE_ERROR = 1626 +ER_EXCEPTIONS_WRITE_ERROR = 1627 +ER_TOO_LONG_TABLE_COMMENT = 1628 +ER_TOO_LONG_FIELD_COMMENT = 1629 +ER_FUNC_INEXISTENT_NAME_COLLISION = 1630 +ER_DATABASE_NAME = 1631 +ER_TABLE_NAME = 1632 +ER_PARTITION_NAME = 1633 +ER_SUBPARTITION_NAME = 1634 +ER_TEMPORARY_NAME = 1635 +ER_RENAMED_NAME = 1636 +ER_TOO_MANY_CONCURRENT_TRXS = 1637 +WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638 +ER_DEBUG_SYNC_TIMEOUT = 1639 +ER_DEBUG_SYNC_HIT_LIMIT = 1640 +ER_DUP_SIGNAL_SET = 1641 +ER_SIGNAL_WARN = 1642 +ER_SIGNAL_NOT_FOUND = 1643 +ER_SIGNAL_EXCEPTION = 1644 +ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645 +ER_SIGNAL_BAD_CONDITION_TYPE = 1646 +WARN_COND_ITEM_TRUNCATED = 1647 +ER_COND_ITEM_TOO_LONG = 1648 +ER_UNKNOWN_LOCALE = 1649 +ER_SLAVE_IGNORE_SERVER_IDS = 1650 +OBSOLETE_ER_QUERY_CACHE_DISABLED = 1651 +ER_SAME_NAME_PARTITION_FIELD = 1652 +ER_PARTITION_COLUMN_LIST_ERROR = 1653 +ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654 +ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655 +ER_MAXVALUE_IN_VALUES_IN = 1656 +ER_TOO_MANY_VALUES_ERROR = 1657 +ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658 +ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659 +ER_PARTITION_FIELDS_TOO_LONG = 1660 +ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661 +ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662 +ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663 +ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664 +ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665 +ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666 +ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667 +ER_BINLOG_UNSAFE_LIMIT = 1668 +OBSOLETE_ER_UNUSED4 = 1669 +ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670 +ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671 +ER_BINLOG_UNSAFE_UDF = 1672 +ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673 +ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674 +ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675 +ER_MESSAGE_AND_STATEMENT = 1676 +OBSOLETE_ER_SLAVE_CONVERSION_FAILED = 1677 +ER_SLAVE_CANT_CREATE_CONVERSION = 1678 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679 +ER_PATH_LENGTH = 1680 +ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681 +ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682 +ER_WRONG_PERFSCHEMA_USAGE = 1683 +ER_WARN_I_S_SKIPPED_TABLE = 1684 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685 +ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686 +ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687 +ER_TOO_LONG_INDEX_COMMENT = 1688 +ER_LOCK_ABORTED = 1689 +ER_DATA_OUT_OF_RANGE = 1690 +ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691 +ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692 +ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693 +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694 +ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695 +ER_FAILED_READ_FROM_PAR_FILE = 1696 +ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697 +ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698 +ER_SET_PASSWORD_AUTH_PLUGIN = 1699 +OBSOLETE_ER_GRANT_PLUGIN_USER_EXISTS = 1700 +ER_TRUNCATE_ILLEGAL_FK = 1701 +ER_PLUGIN_IS_PERMANENT = 1702 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703 +ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704 +ER_STMT_CACHE_FULL = 1705 +ER_MULTI_UPDATE_KEY_CONFLICT = 1706 +ER_TABLE_NEEDS_REBUILD = 1707 +WARN_OPTION_BELOW_LIMIT = 1708 +ER_INDEX_COLUMN_TOO_LONG = 1709 +ER_ERROR_IN_TRIGGER_BODY = 1710 +ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711 +ER_INDEX_CORRUPT = 1712 +ER_UNDO_RECORD_TOO_BIG = 1713 +ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714 +ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715 +ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716 +ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717 +ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718 +ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719 +ER_PLUGIN_NO_UNINSTALL = 1720 +ER_PLUGIN_NO_INSTALL = 1721 +ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722 +ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723 +ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724 +ER_TABLE_IN_FK_CHECK = 1725 +ER_UNSUPPORTED_ENGINE = 1726 +ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727 +ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728 +ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729 +ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730 +ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731 +ER_PARTITION_EXCHANGE_PART_TABLE = 1732 +ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733 +ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734 +ER_UNKNOWN_PARTITION = 1735 +ER_TABLES_DIFFERENT_METADATA = 1736 +ER_ROW_DOES_NOT_MATCH_PARTITION = 1737 +ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738 +ER_WARN_INDEX_NOT_APPLICABLE = 1739 +ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740 +OBSOLETE_ER_NO_SUCH_KEY_VALUE = 1741 +ER_RPL_INFO_DATA_TOO_LONG = 1742 +OBSOLETE_ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743 +OBSOLETE_ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744 +ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745 +ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746 +ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747 +ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748 +OBSOLETE_ER_NO_SUCH_PARTITION__UNUSED = 1749 +ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750 +ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751 +ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752 +ER_MTS_FEATURE_IS_NOT_SUPPORTED = 1753 +ER_MTS_UPDATED_DBS_GREATER_MAX = 1754 +ER_MTS_CANT_PARALLEL = 1755 +ER_MTS_INCONSISTENT_DATA = 1756 +ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757 +ER_DA_INVALID_CONDITION_NUMBER = 1758 +ER_INSECURE_PLAIN_TEXT = 1759 +ER_INSECURE_CHANGE_MASTER = 1760 +ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761 +ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762 +ER_SQLTHREAD_WITH_SECURE_SLAVE = 1763 +ER_TABLE_HAS_NO_FT = 1764 +ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765 +ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766 +OBSOLETE_ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767 +OBSOLETE_ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768 +ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769 +ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770 +OBSOLETE_ER_SKIPPING_LOGGED_TRANSACTION = 1771 +ER_MALFORMED_GTID_SET_SPECIFICATION = 1772 +ER_MALFORMED_GTID_SET_ENCODING = 1773 +ER_MALFORMED_GTID_SPECIFICATION = 1774 +ER_GNO_EXHAUSTED = 1775 +ER_BAD_SLAVE_AUTO_POSITION = 1776 +ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777 +ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778 +ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779 +OBSOLETE_ER_GTID_MODE_REQUIRES_BINLOG = 1780 +ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781 +ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782 +ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783 +OBSOLETE_ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF__UNUSED = 1784 +ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785 +ER_GTID_UNSAFE_CREATE_SELECT = 1786 +ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION = 1787 +ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788 +ER_MASTER_HAS_PURGED_REQUIRED_GTIDS = 1789 +ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790 +ER_UNKNOWN_EXPLAIN_FORMAT = 1791 +ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792 +ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793 +ER_SLAVE_CONFIGURATION = 1794 +ER_INNODB_FT_LIMIT = 1795 +ER_INNODB_NO_FT_TEMP_TABLE = 1796 +ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797 +ER_INNODB_FT_WRONG_DOCID_INDEX = 1798 +ER_INNODB_ONLINE_LOG_TOO_BIG = 1799 +ER_UNKNOWN_ALTER_ALGORITHM = 1800 +ER_UNKNOWN_ALTER_LOCK = 1801 +ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802 +ER_MTS_RECOVERY_FAILURE = 1803 +ER_MTS_RESET_WORKERS = 1804 +ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805 +ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806 +ER_DISCARD_FK_CHECKS_RUNNING = 1807 +ER_TABLE_SCHEMA_MISMATCH = 1808 +ER_TABLE_IN_SYSTEM_TABLESPACE = 1809 +ER_IO_READ_ERROR = 1810 +ER_IO_WRITE_ERROR = 1811 +ER_TABLESPACE_MISSING = 1812 +ER_TABLESPACE_EXISTS = 1813 +ER_TABLESPACE_DISCARDED = 1814 +ER_INTERNAL_ERROR = 1815 +ER_INNODB_IMPORT_ERROR = 1816 +ER_INNODB_INDEX_CORRUPT = 1817 +ER_INVALID_YEAR_COLUMN_LENGTH = 1818 +ER_NOT_VALID_PASSWORD = 1819 +ER_MUST_CHANGE_PASSWORD = 1820 +ER_FK_NO_INDEX_CHILD = 1821 +ER_FK_NO_INDEX_PARENT = 1822 +ER_FK_FAIL_ADD_SYSTEM = 1823 +ER_FK_CANNOT_OPEN_PARENT = 1824 +ER_FK_INCORRECT_OPTION = 1825 +ER_FK_DUP_NAME = 1826 +ER_PASSWORD_FORMAT = 1827 +ER_FK_COLUMN_CANNOT_DROP = 1828 +ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829 +ER_FK_COLUMN_NOT_NULL = 1830 +ER_DUP_INDEX = 1831 +ER_FK_COLUMN_CANNOT_CHANGE = 1832 +ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833 +OBSOLETE_ER_UNUSED5 = 1834 +ER_MALFORMED_PACKET = 1835 +ER_READ_ONLY_MODE = 1836 +ER_GTID_NEXT_TYPE_UNDEFINED_GTID = 1837 +ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838 +OBSOLETE_ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839 +ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840 +ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841 +ER_GTID_PURGED_WAS_CHANGED = 1842 +ER_GTID_EXECUTED_WAS_CHANGED = 1843 +ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844 +ER_ALTER_OPERATION_NOT_SUPPORTED = 1845 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851 +OBSOLETE_ER_UNUSED6 = 1852 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857 +ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858 +ER_DUP_UNKNOWN_IN_INDEX = 1859 +ER_IDENT_CAUSES_TOO_LONG_PATH = 1860 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861 +ER_MUST_CHANGE_PASSWORD_LOGIN = 1862 +ER_ROW_IN_WRONG_PARTITION = 1863 +ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864 +OBSOLETE_ER_INNODB_NO_FT_USES_PARSER = 1865 +ER_BINLOG_LOGICAL_CORRUPTION = 1866 +ER_WARN_PURGE_LOG_IN_USE = 1867 +ER_WARN_PURGE_LOG_IS_ACTIVE = 1868 +ER_AUTO_INCREMENT_CONFLICT = 1869 +WARN_ON_BLOCKHOLE_IN_RBR = 1870 +ER_SLAVE_MI_INIT_REPOSITORY = 1871 +ER_SLAVE_RLI_INIT_REPOSITORY = 1872 +ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873 +ER_INNODB_READ_ONLY = 1874 +ER_STOP_SLAVE_SQL_THREAD_TIMEOUT = 1875 +ER_STOP_SLAVE_IO_THREAD_TIMEOUT = 1876 +ER_TABLE_CORRUPT = 1877 +ER_TEMP_FILE_WRITE_FAILURE = 1878 +ER_INNODB_FT_AUX_NOT_HEX_ID = 1879 +ER_OLD_TEMPORALS_UPGRADED = 1880 +ER_INNODB_FORCED_RECOVERY = 1881 +ER_AES_INVALID_IV = 1882 +ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883 +ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID = 1884 +ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER = 1885 +ER_MISSING_KEY = 1886 +ER_FILE_CORRUPT = 3000 +ER_ERROR_ON_MASTER = 3001 +OBSOLETE_ER_INCONSISTENT_ERROR = 3002 +ER_STORAGE_ENGINE_NOT_LOADED = 3003 +ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004 +ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005 +ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006 +ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007 +ER_FK_DEPTH_EXCEEDED = 3008 +ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009 +ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010 +ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011 +ER_EXPLAIN_NOT_SUPPORTED = 3012 +ER_INVALID_FIELD_SIZE = 3013 +ER_MISSING_HA_CREATE_OPTION = 3014 +ER_ENGINE_OUT_OF_MEMORY = 3015 +ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016 +ER_SLAVE_SQL_THREAD_MUST_STOP = 3017 +ER_NO_FT_MATERIALIZED_SUBQUERY = 3018 +ER_INNODB_UNDO_LOG_FULL = 3019 +ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020 +ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP = 3021 +ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022 +ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS = 3023 +ER_QUERY_TIMEOUT = 3024 +ER_NON_RO_SELECT_DISABLE_TIMER = 3025 +ER_DUP_LIST_ENTRY = 3026 +OBSOLETE_ER_SQL_MODE_NO_EFFECT = 3027 +ER_AGGREGATE_ORDER_FOR_UNION = 3028 +ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029 +ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030 +ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER = 3031 +ER_SERVER_OFFLINE_MODE = 3032 +ER_GIS_DIFFERENT_SRIDS = 3033 +ER_GIS_UNSUPPORTED_ARGUMENT = 3034 +ER_GIS_UNKNOWN_ERROR = 3035 +ER_GIS_UNKNOWN_EXCEPTION = 3036 +ER_GIS_INVALID_DATA = 3037 +ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038 +ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039 +ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040 +ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041 +ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042 +ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043 +ER_STD_BAD_ALLOC_ERROR = 3044 +ER_STD_DOMAIN_ERROR = 3045 +ER_STD_LENGTH_ERROR = 3046 +ER_STD_INVALID_ARGUMENT = 3047 +ER_STD_OUT_OF_RANGE_ERROR = 3048 +ER_STD_OVERFLOW_ERROR = 3049 +ER_STD_RANGE_ERROR = 3050 +ER_STD_UNDERFLOW_ERROR = 3051 +ER_STD_LOGIC_ERROR = 3052 +ER_STD_RUNTIME_ERROR = 3053 +ER_STD_UNKNOWN_EXCEPTION = 3054 +ER_GIS_DATA_WRONG_ENDIANESS = 3055 +ER_CHANGE_MASTER_PASSWORD_LENGTH = 3056 +ER_USER_LOCK_WRONG_NAME = 3057 +ER_USER_LOCK_DEADLOCK = 3058 +ER_REPLACE_INACCESSIBLE_ROWS = 3059 +ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060 +ER_ILLEGAL_USER_VAR = 3061 +ER_GTID_MODE_OFF = 3062 +OBSOLETE_ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063 +ER_INCORRECT_TYPE = 3064 +ER_FIELD_IN_ORDER_NOT_SELECT = 3065 +ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066 +ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067 +ER_NET_OK_PACKET_TOO_LARGE = 3068 +ER_INVALID_JSON_DATA = 3069 +ER_INVALID_GEOJSON_MISSING_MEMBER = 3070 +ER_INVALID_GEOJSON_WRONG_TYPE = 3071 +ER_INVALID_GEOJSON_UNSPECIFIED = 3072 +ER_DIMENSION_UNSUPPORTED = 3073 +ER_SLAVE_CHANNEL_DOES_NOT_EXIST = 3074 +OBSOLETE_ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075 +ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076 +ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY = 3077 +OBSOLETE_ER_SLAVE_CHANNEL_DELETE = 3078 +ER_SLAVE_MULTIPLE_CHANNELS_CMD = 3079 +ER_SLAVE_MAX_CHANNELS_EXCEEDED = 3080 +ER_SLAVE_CHANNEL_MUST_STOP = 3081 +ER_SLAVE_CHANNEL_NOT_RUNNING = 3082 +ER_SLAVE_CHANNEL_WAS_RUNNING = 3083 +ER_SLAVE_CHANNEL_WAS_NOT_RUNNING = 3084 +ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP = 3085 +ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER = 3086 +ER_WRONG_FIELD_WITH_GROUP_V2 = 3087 +ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088 +ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089 +ER_WARN_DEPRECATED_SQLMODE = 3090 +ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091 +ER_GROUP_REPLICATION_CONFIGURATION = 3092 +ER_GROUP_REPLICATION_RUNNING = 3093 +ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094 +ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095 +ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096 +ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097 +ER_BEFORE_DML_VALIDATION_ERROR = 3098 +ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099 +ER_RUN_HOOK_ERROR = 3100 +ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101 +ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102 +ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103 +ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104 +ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105 +ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106 +ER_GENERATED_COLUMN_NON_PRIOR = 3107 +ER_DEPENDENT_BY_GENERATED_COLUMN = 3108 +ER_GENERATED_COLUMN_REF_AUTO_INC = 3109 +ER_FEATURE_NOT_AVAILABLE = 3110 +ER_CANT_SET_GTID_MODE = 3111 +ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112 +OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113 +OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114 +OBSOLETE_ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115 +ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX = 3116 +ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX = 3117 +ER_ACCOUNT_HAS_BEEN_LOCKED = 3118 +ER_WRONG_TABLESPACE_NAME = 3119 +ER_TABLESPACE_IS_NOT_EMPTY = 3120 +ER_WRONG_FILE_NAME = 3121 +ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122 +ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123 +ER_WARN_BAD_MAX_EXECUTION_TIME = 3124 +ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125 +ER_WARN_CONFLICTING_HINT = 3126 +ER_WARN_UNKNOWN_QB_NAME = 3127 +ER_UNRESOLVED_HINT_NAME = 3128 +ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129 +ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130 +ER_LOCKING_SERVICE_WRONG_NAME = 3131 +ER_LOCKING_SERVICE_DEADLOCK = 3132 +ER_LOCKING_SERVICE_TIMEOUT = 3133 +ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134 +ER_SQL_MODE_MERGED = 3135 +ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136 +ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137 +ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138 +ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED = 3139 +ER_INVALID_JSON_TEXT = 3140 +ER_INVALID_JSON_TEXT_IN_PARAM = 3141 +ER_INVALID_JSON_BINARY_DATA = 3142 +ER_INVALID_JSON_PATH = 3143 +ER_INVALID_JSON_CHARSET = 3144 +ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145 +ER_INVALID_TYPE_FOR_JSON = 3146 +ER_INVALID_CAST_TO_JSON = 3147 +ER_INVALID_JSON_PATH_CHARSET = 3148 +ER_INVALID_JSON_PATH_WILDCARD = 3149 +ER_JSON_VALUE_TOO_BIG = 3150 +ER_JSON_KEY_TOO_BIG = 3151 +ER_JSON_USED_AS_KEY = 3152 +ER_JSON_VACUOUS_PATH = 3153 +ER_JSON_BAD_ONE_OR_ALL_ARG = 3154 +ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155 +ER_INVALID_JSON_VALUE_FOR_CAST = 3156 +ER_JSON_DOCUMENT_TOO_DEEP = 3157 +ER_JSON_DOCUMENT_NULL_KEY = 3158 +ER_SECURE_TRANSPORT_REQUIRED = 3159 +ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160 +ER_DISABLED_STORAGE_ENGINE = 3161 +ER_USER_DOES_NOT_EXIST = 3162 +ER_USER_ALREADY_EXISTS = 3163 +ER_AUDIT_API_ABORT = 3164 +ER_INVALID_JSON_PATH_ARRAY_CELL = 3165 +ER_BUFPOOL_RESIZE_INPROGRESS = 3166 +ER_FEATURE_DISABLED_SEE_DOC = 3167 +ER_SERVER_ISNT_AVAILABLE = 3168 +ER_SESSION_WAS_KILLED = 3169 +ER_CAPACITY_EXCEEDED = 3170 +ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171 +OBSOLETE_ER_TABLE_NEEDS_UPG_PART = 3172 +ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173 +ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174 +ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175 +ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176 +ER_LOCK_REFUSED_BY_ENGINE = 3177 +ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178 +ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179 +OBSOLETE_ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180 +ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181 +ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182 +ER_TABLESPACE_CANNOT_ENCRYPT = 3183 +ER_INVALID_ENCRYPTION_OPTION = 3184 +ER_CANNOT_FIND_KEY_IN_KEYRING = 3185 +ER_CAPACITY_EXCEEDED_IN_PARSER = 3186 +ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187 +ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188 +ER_USER_COLUMN_OLD_LENGTH = 3189 +ER_CANT_RESET_MASTER = 3190 +ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191 +ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192 +ER_TABLE_REFERENCED = 3193 +OBSOLETE_ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194 +OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195 +OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196 +ER_XA_RETRY = 3197 +ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198 +ER_BINLOG_UNSAFE_XA = 3199 +ER_UDF_ERROR = 3200 +ER_KEYRING_MIGRATION_FAILURE = 3201 +ER_KEYRING_ACCESS_DENIED_ERROR = 3202 +ER_KEYRING_MIGRATION_STATUS = 3203 +OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204 +OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205 +OBSOLETE_ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206 +OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207 +OBSOLETE_ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208 +OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210 +OBSOLETE_ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211 +ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212 +OBSOLETE_ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213 +ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214 +ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215 +ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216 +ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217 +ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220 +OBSOLETE_ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221 +OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222 +OBSOLETE_ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223 +OBSOLETE_ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224 +OBSOLETE_ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225 +ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE = 3500 +ER_ACL_OPERATION_FAILED = 3501 +ER_UNSUPPORTED_INDEX_ALGORITHM = 3502 +ER_NO_SUCH_DB = 3503 +ER_TOO_BIG_ENUM = 3504 +ER_TOO_LONG_SET_ENUM_VALUE = 3505 +ER_INVALID_DD_OBJECT = 3506 +ER_UPDATING_DD_TABLE = 3507 +ER_INVALID_DD_OBJECT_ID = 3508 +ER_INVALID_DD_OBJECT_NAME = 3509 +ER_TABLESPACE_MISSING_WITH_NAME = 3510 +ER_TOO_LONG_ROUTINE_COMMENT = 3511 +ER_SP_LOAD_FAILED = 3512 +ER_INVALID_BITWISE_OPERANDS_SIZE = 3513 +ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE = 3514 +ER_WARN_UNSUPPORTED_HINT = 3515 +ER_UNEXPECTED_GEOMETRY_TYPE = 3516 +ER_SRS_PARSE_ERROR = 3517 +ER_SRS_PROJ_PARAMETER_MISSING = 3518 +ER_WARN_SRS_NOT_FOUND = 3519 +ER_SRS_NOT_CARTESIAN = 3520 +ER_SRS_NOT_CARTESIAN_UNDEFINED = 3521 +ER_PK_INDEX_CANT_BE_INVISIBLE = 3522 +ER_UNKNOWN_AUTHID = 3523 +ER_FAILED_ROLE_GRANT = 3524 +ER_OPEN_ROLE_TABLES = 3525 +ER_FAILED_DEFAULT_ROLES = 3526 +ER_COMPONENTS_NO_SCHEME = 3527 +ER_COMPONENTS_NO_SCHEME_SERVICE = 3528 +ER_COMPONENTS_CANT_LOAD = 3529 +ER_ROLE_NOT_GRANTED = 3530 +ER_FAILED_REVOKE_ROLE = 3531 +ER_RENAME_ROLE = 3532 +ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION = 3533 +ER_COMPONENTS_CANT_SATISFY_DEPENDENCY = 3534 +ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION = 3535 +ER_COMPONENTS_LOAD_CANT_INITIALIZE = 3536 +ER_COMPONENTS_UNLOAD_NOT_LOADED = 3537 +ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE = 3538 +ER_COMPONENTS_CANT_RELEASE_SERVICE = 3539 +ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE = 3540 +ER_COMPONENTS_CANT_UNLOAD = 3541 +ER_WARN_UNLOAD_THE_NOT_PERSISTED = 3542 +ER_COMPONENT_TABLE_INCORRECT = 3543 +ER_COMPONENT_MANIPULATE_ROW_FAILED = 3544 +ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP = 3545 +ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS = 3546 +ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES = 3547 +ER_SRS_NOT_FOUND = 3548 +ER_VARIABLE_NOT_PERSISTED = 3549 +ER_IS_QUERY_INVALID_CLAUSE = 3550 +ER_UNABLE_TO_STORE_STATISTICS = 3551 +ER_NO_SYSTEM_SCHEMA_ACCESS = 3552 +ER_NO_SYSTEM_TABLESPACE_ACCESS = 3553 +ER_NO_SYSTEM_TABLE_ACCESS = 3554 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE = 3555 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE = 3556 +ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE = 3557 +ER_INVALID_OPTION_KEY = 3558 +ER_INVALID_OPTION_VALUE = 3559 +ER_INVALID_OPTION_KEY_VALUE_PAIR = 3560 +ER_INVALID_OPTION_START_CHARACTER = 3561 +ER_INVALID_OPTION_END_CHARACTER = 3562 +ER_INVALID_OPTION_CHARACTERS = 3563 +ER_DUPLICATE_OPTION_KEY = 3564 +ER_WARN_SRS_NOT_FOUND_AXIS_ORDER = 3565 +ER_NO_ACCESS_TO_NATIVE_FCT = 3566 +ER_RESET_MASTER_TO_VALUE_OUT_OF_RANGE = 3567 +ER_UNRESOLVED_TABLE_LOCK = 3568 +ER_DUPLICATE_TABLE_LOCK = 3569 +ER_BINLOG_UNSAFE_SKIP_LOCKED = 3570 +ER_BINLOG_UNSAFE_NOWAIT = 3571 +ER_LOCK_NOWAIT = 3572 +ER_CTE_RECURSIVE_REQUIRES_UNION = 3573 +ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST = 3574 +ER_CTE_RECURSIVE_FORBIDS_AGGREGATION = 3575 +ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER = 3576 +ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE = 3577 +ER_SWITCH_TMP_ENGINE = 3578 +ER_WINDOW_NO_SUCH_WINDOW = 3579 +ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH = 3580 +ER_WINDOW_NO_CHILD_PARTITIONING = 3581 +ER_WINDOW_NO_INHERIT_FRAME = 3582 +ER_WINDOW_NO_REDEFINE_ORDER_BY = 3583 +ER_WINDOW_FRAME_START_ILLEGAL = 3584 +ER_WINDOW_FRAME_END_ILLEGAL = 3585 +ER_WINDOW_FRAME_ILLEGAL = 3586 +ER_WINDOW_RANGE_FRAME_ORDER_TYPE = 3587 +ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE = 3588 +ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE = 3589 +ER_WINDOW_RANGE_BOUND_NOT_CONSTANT = 3590 +ER_WINDOW_DUPLICATE_NAME = 3591 +ER_WINDOW_ILLEGAL_ORDER_BY = 3592 +ER_WINDOW_INVALID_WINDOW_FUNC_USE = 3593 +ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE = 3594 +ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC = 3595 +ER_WINDOW_ROWS_INTERVAL_USE = 3596 +ER_WINDOW_NO_GROUP_ORDER = 3597 +ER_WINDOW_EXPLAIN_JSON = 3598 +ER_WINDOW_FUNCTION_IGNORES_FRAME = 3599 +ER_WL9236_NOW_UNUSED = 3600 +ER_INVALID_NO_OF_ARGS = 3601 +ER_FIELD_IN_GROUPING_NOT_GROUP_BY = 3602 +ER_TOO_LONG_TABLESPACE_COMMENT = 3603 +ER_ENGINE_CANT_DROP_TABLE = 3604 +ER_ENGINE_CANT_DROP_MISSING_TABLE = 3605 +ER_TABLESPACE_DUP_FILENAME = 3606 +ER_DB_DROP_RMDIR2 = 3607 +ER_IMP_NO_FILES_MATCHED = 3608 +ER_IMP_SCHEMA_DOES_NOT_EXIST = 3609 +ER_IMP_TABLE_ALREADY_EXISTS = 3610 +ER_IMP_INCOMPATIBLE_MYSQLD_VERSION = 3611 +ER_IMP_INCOMPATIBLE_DD_VERSION = 3612 +ER_IMP_INCOMPATIBLE_SDI_VERSION = 3613 +ER_WARN_INVALID_HINT = 3614 +ER_VAR_DOES_NOT_EXIST = 3615 +ER_LONGITUDE_OUT_OF_RANGE = 3616 +ER_LATITUDE_OUT_OF_RANGE = 3617 +ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS = 3618 +ER_ILLEGAL_PRIVILEGE_LEVEL = 3619 +ER_NO_SYSTEM_VIEW_ACCESS = 3620 +ER_COMPONENT_FILTER_FLABBERGASTED = 3621 +ER_PART_EXPR_TOO_LONG = 3622 +ER_UDF_DROP_DYNAMICALLY_REGISTERED = 3623 +ER_UNABLE_TO_STORE_COLUMN_STATISTICS = 3624 +ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS = 3625 +ER_UNABLE_TO_DROP_COLUMN_STATISTICS = 3626 +ER_UNABLE_TO_BUILD_HISTOGRAM = 3627 +ER_MANDATORY_ROLE = 3628 +ER_MISSING_TABLESPACE_FILE = 3629 +ER_PERSIST_ONLY_ACCESS_DENIED_ERROR = 3630 +ER_CMD_NEED_SUPER = 3631 +ER_PATH_IN_DATADIR = 3632 +ER_DDL_IN_PROGRESS = 3633 +ER_TOO_MANY_CONCURRENT_CLONES = 3634 +ER_APPLIER_LOG_EVENT_VALIDATION_ERROR = 3635 +ER_CTE_MAX_RECURSION_DEPTH = 3636 +ER_NOT_HINT_UPDATABLE_VARIABLE = 3637 +ER_CREDENTIALS_CONTRADICT_TO_HISTORY = 3638 +ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID = 3639 +ER_CLIENT_DOES_NOT_SUPPORT = 3640 +ER_I_S_SKIPPED_TABLESPACE = 3641 +ER_TABLESPACE_ENGINE_MISMATCH = 3642 +ER_WRONG_SRID_FOR_COLUMN = 3643 +ER_CANNOT_ALTER_SRID_DUE_TO_INDEX = 3644 +ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED = 3645 +ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED = 3646 +ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES = 3647 +ER_COULD_NOT_APPLY_JSON_DIFF = 3648 +ER_CORRUPTED_JSON_DIFF = 3649 +ER_RESOURCE_GROUP_EXISTS = 3650 +ER_RESOURCE_GROUP_NOT_EXISTS = 3651 +ER_INVALID_VCPU_ID = 3652 +ER_INVALID_VCPU_RANGE = 3653 +ER_INVALID_THREAD_PRIORITY = 3654 +ER_DISALLOWED_OPERATION = 3655 +ER_RESOURCE_GROUP_BUSY = 3656 +ER_RESOURCE_GROUP_DISABLED = 3657 +ER_FEATURE_UNSUPPORTED = 3658 +ER_ATTRIBUTE_IGNORED = 3659 +ER_INVALID_THREAD_ID = 3660 +ER_RESOURCE_GROUP_BIND_FAILED = 3661 +ER_INVALID_USE_OF_FORCE_OPTION = 3662 +ER_GROUP_REPLICATION_COMMAND_FAILURE = 3663 +ER_SDI_OPERATION_FAILED = 3664 +ER_MISSING_JSON_TABLE_VALUE = 3665 +ER_WRONG_JSON_TABLE_VALUE = 3666 +ER_TF_MUST_HAVE_ALIAS = 3667 +ER_TF_FORBIDDEN_JOIN_TYPE = 3668 +ER_JT_VALUE_OUT_OF_RANGE = 3669 +ER_JT_MAX_NESTED_PATH = 3670 +ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD = 3671 +ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL = 3672 +ER_BAD_NULL_ERROR_NOT_IGNORED = 3673 +WARN_USELESS_SPATIAL_INDEX = 3674 +ER_DISK_FULL_NOWAIT = 3675 +ER_PARSE_ERROR_IN_DIGEST_FN = 3676 +ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN = 3677 +ER_SCHEMA_DIR_EXISTS = 3678 +ER_SCHEMA_DIR_MISSING = 3679 +ER_SCHEMA_DIR_CREATE_FAILED = 3680 +ER_SCHEMA_DIR_UNKNOWN = 3681 +ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 = 3682 +ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER = 3683 +ER_REGEXP_BUFFER_OVERFLOW = 3684 +ER_REGEXP_ILLEGAL_ARGUMENT = 3685 +ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR = 3686 +ER_REGEXP_INTERNAL_ERROR = 3687 +ER_REGEXP_RULE_SYNTAX = 3688 +ER_REGEXP_BAD_ESCAPE_SEQUENCE = 3689 +ER_REGEXP_UNIMPLEMENTED = 3690 +ER_REGEXP_MISMATCHED_PAREN = 3691 +ER_REGEXP_BAD_INTERVAL = 3692 +ER_REGEXP_MAX_LT_MIN = 3693 +ER_REGEXP_INVALID_BACK_REF = 3694 +ER_REGEXP_LOOK_BEHIND_LIMIT = 3695 +ER_REGEXP_MISSING_CLOSE_BRACKET = 3696 +ER_REGEXP_INVALID_RANGE = 3697 +ER_REGEXP_STACK_OVERFLOW = 3698 +ER_REGEXP_TIME_OUT = 3699 +ER_REGEXP_PATTERN_TOO_BIG = 3700 +ER_CANT_SET_ERROR_LOG_SERVICE = 3701 +ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE = 3702 +ER_COMPONENT_FILTER_DIAGNOSTICS = 3703 +ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS = 3704 +ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS = 3705 +ER_NONPOSITIVE_RADIUS = 3706 +ER_RESTART_SERVER_FAILED = 3707 +ER_SRS_MISSING_MANDATORY_ATTRIBUTE = 3708 +ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS = 3709 +ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE = 3710 +ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE = 3711 +ER_SRS_ID_ALREADY_EXISTS = 3712 +ER_WARN_SRS_ID_ALREADY_EXISTS = 3713 +ER_CANT_MODIFY_SRID_0 = 3714 +ER_WARN_RESERVED_SRID_RANGE = 3715 +ER_CANT_MODIFY_SRS_USED_BY_COLUMN = 3716 +ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE = 3717 +ER_SRS_ATTRIBUTE_STRING_TOO_LONG = 3718 +ER_DEPRECATED_UTF8_ALIAS = 3719 +ER_DEPRECATED_NATIONAL = 3720 +ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 3721 +ER_UNABLE_TO_COLLECT_INSTANCE_LOG_STATUS = 3722 +ER_RESERVED_TABLESPACE_NAME = 3723 +ER_UNABLE_TO_SET_OPTION = 3724 +ER_SLAVE_POSSIBLY_DIVERGED_AFTER_DDL = 3725 +ER_PARSER_TRACE = 10000 +ER_BOOTSTRAP_CANT_THREAD = 10001 +ER_TRIGGER_INVALID_VALUE = 10002 +ER_OPT_WRONG_TREE = 10003 +ER_DD_FAILSAFE = 10004 +ER_DD_NO_WRITES_NO_REPOPULATION = 10005 +ER_DD_VERSION_FOUND = 10006 +ER_DD_VERSION_INSTALLED = 10007 +ER_DD_VERSION_UNSUPPORTED = 10008 +ER_LOG_SYSLOG_FACILITY_FAIL = 10009 +ER_LOG_SYSLOG_CANNOT_OPEN = 10010 +ER_LOG_SLOW_CANNOT_OPEN = 10011 +ER_LOG_GENERAL_CANNOT_OPEN = 10012 +ER_LOG_CANNOT_WRITE = 10013 +ER_RPL_ZOMBIE_ENCOUNTERED = 10014 +ER_RPL_GTID_TABLE_CANNOT_OPEN = 10015 +ER_SYSTEM_SCHEMA_NOT_FOUND = 10016 +ER_DD_INIT_UPGRADE_FAILED = 10017 +ER_VIEW_UNKNOWN_CHARSET_OR_COLLATION = 10018 +ER_DD_VIEW_CANT_ALLOC_CHARSET = 10019 +ER_DD_INIT_FAILED = 10020 +ER_DD_UPDATING_PLUGIN_MD_FAILED = 10021 +ER_DD_POPULATING_TABLES_FAILED = 10022 +ER_DD_VIEW_CANT_CREATE = 10023 +ER_DD_METADATA_NOT_FOUND = 10024 +ER_DD_CACHE_NOT_EMPTY_AT_SHUTDOWN = 10025 +ER_DD_OBJECT_REMAINS = 10026 +ER_DD_OBJECT_REMAINS_IN_RELEASER = 10027 +ER_DD_OBJECT_RELEASER_REMAINS = 10028 +ER_DD_CANT_GET_OBJECT_KEY = 10029 +ER_DD_CANT_CREATE_OBJECT_KEY = 10030 +ER_CANT_CREATE_HANDLE_MGR_THREAD = 10031 +ER_RPL_REPO_HAS_GAPS = 10032 +ER_INVALID_VALUE_FOR_ENFORCE_GTID_CONSISTENCY = 10033 +ER_CHANGED_ENFORCE_GTID_CONSISTENCY = 10034 +ER_CHANGED_GTID_MODE = 10035 +ER_DISABLED_STORAGE_ENGINE_AS_DEFAULT = 10036 +ER_DEBUG_SYNC_HIT = 10037 +ER_DEBUG_SYNC_EXECUTED = 10038 +ER_DEBUG_SYNC_THREAD_MAX = 10039 +ER_DEBUG_SYNC_OOM = 10040 +ER_CANT_INIT_TC_LOG = 10041 +ER_EVENT_CANT_INIT_QUEUE = 10042 +ER_EVENT_PURGING_QUEUE = 10043 +ER_EVENT_LAST_EXECUTION = 10044 +ER_EVENT_MESSAGE_STACK = 10045 +ER_EVENT_EXECUTION_FAILED = 10046 +ER_CANT_INIT_SCHEDULER_THREAD = 10047 +ER_SCHEDULER_STOPPED = 10048 +ER_CANT_CREATE_SCHEDULER_THREAD = 10049 +ER_SCHEDULER_WAITING = 10050 +ER_SCHEDULER_STARTED = 10051 +ER_SCHEDULER_STOPPING_FAILED_TO_GET_EVENT = 10052 +ER_SCHEDULER_STOPPING_FAILED_TO_CREATE_WORKER = 10053 +ER_SCHEDULER_KILLING = 10054 +ER_UNABLE_TO_RESOLVE_IP = 10055 +ER_UNABLE_TO_RESOLVE_HOSTNAME = 10056 +ER_HOSTNAME_RESEMBLES_IPV4 = 10057 +ER_HOSTNAME_DOESNT_RESOLVE_TO = 10058 +ER_ADDRESSES_FOR_HOSTNAME_HEADER = 10059 +ER_ADDRESSES_FOR_HOSTNAME_LIST_ITEM = 10060 +ER_TRG_WITHOUT_DEFINER = 10061 +ER_TRG_NO_CLIENT_CHARSET = 10062 +ER_PARSING_VIEW = 10063 +ER_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP = 10064 +ER_COMPONENTS_INFRASTRUCTURE_SHUTDOWN = 10065 +ER_COMPONENTS_PERSIST_LOADER_BOOTSTRAP = 10066 +ER_DEPART_WITH_GRACE = 10067 +ER_CA_SELF_SIGNED = 10068 +ER_SSL_LIBRARY_ERROR = 10069 +ER_NO_THD_NO_UUID = 10070 +ER_UUID_SALT = 10071 +ER_UUID_IS = 10072 +ER_UUID_INVALID = 10073 +ER_UUID_SCRUB = 10074 +ER_CREATING_NEW_UUID = 10075 +ER_CANT_CREATE_UUID = 10076 +ER_UNKNOWN_UNSUPPORTED_STORAGE_ENGINE = 10077 +ER_SECURE_AUTH_VALUE_UNSUPPORTED = 10078 +ER_INVALID_INSTRUMENT = 10079 +ER_INNODB_MANDATORY = 10080 +OBSOLETE_ER_INNODB_CANNOT_BE_IGNORED = 10081 +ER_OLD_PASSWORDS_NO_MIDDLE_GROUND = 10082 +ER_VERBOSE_REQUIRES_HELP = 10083 +ER_POINTLESS_WITHOUT_SLOWLOG = 10084 +ER_WASTEFUL_NET_BUFFER_SIZE = 10085 +ER_DEPRECATED_TIMESTAMP_IMPLICIT_DEFAULTS = 10086 +ER_FT_BOOL_SYNTAX_INVALID = 10087 +ER_CREDENTIALLESS_AUTO_USER_BAD = 10088 +ER_CONNECTION_HANDLING_OOM = 10089 +ER_THREAD_HANDLING_OOM = 10090 +ER_CANT_CREATE_TEST_FILE = 10091 +ER_CANT_CREATE_PID_FILE = 10092 +ER_CANT_REMOVE_PID_FILE = 10093 +ER_CANT_CREATE_SHUTDOWN_THREAD = 10094 +ER_SEC_FILE_PRIV_CANT_ACCESS_DIR = 10095 +ER_SEC_FILE_PRIV_IGNORED = 10096 +ER_SEC_FILE_PRIV_EMPTY = 10097 +ER_SEC_FILE_PRIV_NULL = 10098 +ER_SEC_FILE_PRIV_DIRECTORY_INSECURE = 10099 +ER_SEC_FILE_PRIV_CANT_STAT = 10100 +ER_SEC_FILE_PRIV_DIRECTORY_PERMISSIONS = 10101 +ER_SEC_FILE_PRIV_ARGUMENT_TOO_LONG = 10102 +ER_CANT_CREATE_NAMED_PIPES_THREAD = 10103 +ER_CANT_CREATE_TCPIP_THREAD = 10104 +ER_CANT_CREATE_SHM_THREAD = 10105 +ER_CANT_CREATE_INTERRUPT_THREAD = 10106 +ER_WRITABLE_CONFIG_REMOVED = 10107 +ER_CORE_VALUES = 10108 +ER_WRONG_DATETIME_SPEC = 10109 +ER_RPL_BINLOG_FILTERS_OOM = 10110 +ER_KEYCACHE_OOM = 10111 +ER_CONFIRMING_THE_FUTURE = 10112 +ER_BACK_IN_TIME = 10113 +ER_FUTURE_DATE = 10114 +ER_UNSUPPORTED_DATE = 10115 +ER_STARTING_AS = 10116 +ER_SHUTTING_DOWN_SLAVE_THREADS = 10117 +ER_DISCONNECTING_REMAINING_CLIENTS = 10118 +ER_ABORTING = 10119 +ER_BINLOG_END = 10120 +ER_CALL_ME_LOCALHOST = 10121 +ER_USER_REQUIRES_ROOT = 10122 +ER_REALLY_RUN_AS_ROOT = 10123 +ER_USER_WHAT_USER = 10124 +ER_TRANSPORTS_WHAT_TRANSPORTS = 10125 +ER_FAIL_SETGID = 10126 +ER_FAIL_SETUID = 10127 +ER_FAIL_SETREGID = 10128 +ER_FAIL_SETREUID = 10129 +ER_FAIL_CHROOT = 10130 +ER_WIN_LISTEN_BUT_HOW = 10131 +ER_NOT_RIGHT_NOW = 10132 +ER_FIXING_CLIENT_CHARSET = 10133 +ER_OOM = 10134 +ER_FAILED_TO_LOCK_MEM = 10135 +ER_MYINIT_FAILED = 10136 +ER_BEG_INITFILE = 10137 +ER_END_INITFILE = 10138 +ER_CHANGED_MAX_OPEN_FILES = 10139 +ER_CANT_INCREASE_MAX_OPEN_FILES = 10140 +ER_CHANGED_MAX_CONNECTIONS = 10141 +ER_CHANGED_TABLE_OPEN_CACHE = 10142 +ER_THE_USER_ABIDES = 10143 +ER_RPL_CANT_ADD_DO_TABLE = 10144 +ER_RPL_CANT_ADD_IGNORE_TABLE = 10145 +ER_TRACK_VARIABLES_BOGUS = 10146 +ER_EXCESS_ARGUMENTS = 10147 +ER_VERBOSE_HINT = 10148 +ER_CANT_READ_ERRMSGS = 10149 +ER_CANT_INIT_DBS = 10150 +ER_LOG_OUTPUT_CONTRADICTORY = 10151 +ER_NO_CSV_NO_LOG_TABLES = 10152 +ER_RPL_REWRITEDB_MISSING_ARROW = 10153 +ER_RPL_REWRITEDB_EMPTY_FROM = 10154 +ER_RPL_REWRITEDB_EMPTY_TO = 10155 +ER_LOG_FILES_GIVEN_LOG_OUTPUT_IS_TABLE = 10156 +ER_LOG_FILE_INVALID = 10157 +ER_LOWER_CASE_TABLE_NAMES_CS_DD_ON_CI_FS_UNSUPPORTED = 10158 +ER_LOWER_CASE_TABLE_NAMES_USING_2 = 10159 +ER_LOWER_CASE_TABLE_NAMES_USING_0 = 10160 +ER_NEED_LOG_BIN = 10161 +ER_NEED_FILE_INSTEAD_OF_DIR = 10162 +ER_LOG_BIN_BETTER_WITH_NAME = 10163 +ER_BINLOG_NEEDS_SERVERID = 10164 +ER_RPL_CANT_MAKE_PATHS = 10165 +ER_CANT_INITIALIZE_GTID = 10166 +ER_CANT_INITIALIZE_EARLY_PLUGINS = 10167 +ER_CANT_INITIALIZE_BUILTIN_PLUGINS = 10168 +ER_CANT_INITIALIZE_DYNAMIC_PLUGINS = 10169 +ER_PERFSCHEMA_INIT_FAILED = 10170 +ER_STACKSIZE_UNEXPECTED = 10171 +ER_CANT_SET_DATADIR = 10172 +ER_CANT_STAT_DATADIR = 10173 +ER_CANT_CHOWN_DATADIR = 10174 +ER_CANT_SET_UP_PERSISTED_VALUES = 10175 +ER_CANT_SAVE_GTIDS = 10176 +ER_AUTH_CANT_SET_DEFAULT_PLUGIN = 10177 +ER_CANT_JOIN_SHUTDOWN_THREAD = 10178 +ER_CANT_HASH_DO_AND_IGNORE_RULES = 10179 +ER_CANT_OPEN_CA = 10180 +ER_CANT_ACCESS_CAPATH = 10181 +ER_SSL_TRYING_DATADIR_DEFAULTS = 10182 +ER_AUTO_OPTIONS_FAILED = 10183 +ER_CANT_INIT_TIMER = 10184 +ER_SERVERID_TOO_LARGE = 10185 +ER_DEFAULT_SE_UNAVAILABLE = 10186 +ER_CANT_OPEN_ERROR_LOG = 10187 +ER_INVALID_ERROR_LOG_NAME = 10188 +ER_RPL_INFINITY_DENIED = 10189 +ER_RPL_INFINITY_IGNORED = 10190 +ER_NDB_TABLES_NOT_READY = 10191 +ER_TABLE_CHECK_INTACT = 10192 +ER_DD_TABLESPACE_NOT_FOUND = 10193 +ER_DD_TRG_CONNECTION_COLLATION_MISSING = 10194 +ER_DD_TRG_DB_COLLATION_MISSING = 10195 +ER_DD_TRG_DEFINER_OOM = 10196 +ER_DD_TRG_FILE_UNREADABLE = 10197 +ER_TRG_CANT_PARSE = 10198 +ER_DD_TRG_CANT_ADD = 10199 +ER_DD_CANT_RESOLVE_VIEW = 10200 +ER_DD_VIEW_WITHOUT_DEFINER = 10201 +ER_PLUGIN_INIT_FAILED = 10202 +ER_RPL_TRX_DELEGATES_INIT_FAILED = 10203 +ER_RPL_BINLOG_STORAGE_DELEGATES_INIT_FAILED = 10204 +ER_RPL_BINLOG_TRANSMIT_DELEGATES_INIT_FAILED = 10205 +ER_RPL_BINLOG_RELAY_DELEGATES_INIT_FAILED = 10206 +ER_RPL_PLUGIN_FUNCTION_FAILED = 10207 +ER_SQL_HA_READ_FAILED = 10208 +ER_SR_BOGUS_VALUE = 10209 +ER_SR_INVALID_CONTEXT = 10210 +ER_READING_TABLE_FAILED = 10211 +ER_DES_FILE_WRONG_KEY = 10212 +ER_CANT_SET_PERSISTED = 10213 +ER_JSON_PARSE_ERROR = 10214 +ER_CONFIG_OPTION_WITHOUT_GROUP = 10215 +ER_VALGRIND_DO_QUICK_LEAK_CHECK = 10216 +ER_VALGRIND_COUNT_LEAKS = 10217 +ER_LOAD_DATA_INFILE_FAILED_IN_UNEXPECTED_WAY = 10218 +ER_UNKNOWN_ERROR_NUMBER = 10219 +ER_UDF_CANT_ALLOC_FOR_STRUCTURES = 10220 +ER_UDF_CANT_ALLOC_FOR_FUNCTION = 10221 +ER_UDF_INVALID_ROW_IN_FUNCTION_TABLE = 10222 +ER_UDF_CANT_OPEN_FUNCTION_TABLE = 10223 +ER_XA_RECOVER_FOUND_TRX_IN_SE = 10224 +ER_XA_RECOVER_FOUND_XA_TRX = 10225 +ER_XA_IGNORING_XID = 10226 +ER_XA_COMMITTING_XID = 10227 +ER_XA_ROLLING_BACK_XID = 10228 +ER_XA_STARTING_RECOVERY = 10229 +ER_XA_NO_MULTI_2PC_HEURISTIC_RECOVER = 10230 +ER_XA_RECOVER_EXPLANATION = 10231 +ER_XA_RECOVERY_DONE = 10232 +ER_TRX_GTID_COLLECT_REJECT = 10233 +ER_SQL_AUTHOR_DEFAULT_ROLES_FAIL = 10234 +ER_SQL_USER_TABLE_CREATE_WARNING = 10235 +ER_SQL_USER_TABLE_ALTER_WARNING = 10236 +ER_ROW_IN_WRONG_PARTITION_PLEASE_REPAIR = 10237 +ER_MYISAM_CRASHED_ERROR_IN_THREAD = 10238 +ER_MYISAM_CRASHED_ERROR_IN = 10239 +ER_TOO_MANY_STORAGE_ENGINES = 10240 +ER_SE_TYPECODE_CONFLICT = 10241 +ER_TRX_WRITE_SET_OOM = 10242 +ER_HANDLERTON_OOM = 10243 +ER_CONN_SHM_LISTENER = 10244 +ER_CONN_SHM_CANT_CREATE_SERVICE = 10245 +ER_CONN_SHM_CANT_CREATE_CONNECTION = 10246 +ER_CONN_PIP_CANT_CREATE_EVENT = 10247 +ER_CONN_PIP_CANT_CREATE_PIPE = 10248 +ER_CONN_PER_THREAD_NO_THREAD = 10249 +ER_CONN_TCP_NO_SOCKET = 10250 +ER_CONN_TCP_CREATED = 10251 +ER_CONN_TCP_ADDRESS = 10252 +ER_CONN_TCP_IPV6_AVAILABLE = 10253 +ER_CONN_TCP_IPV6_UNAVAILABLE = 10254 +ER_CONN_TCP_ERROR_WITH_STRERROR = 10255 +ER_CONN_TCP_CANT_RESOLVE_HOSTNAME = 10256 +ER_CONN_TCP_IS_THERE_ANOTHER_USING_PORT = 10257 +ER_CONN_UNIX_IS_THERE_ANOTHER_USING_SOCKET = 10258 +ER_CONN_UNIX_PID_CLAIMED_SOCKET_FILE = 10259 +ER_CONN_TCP_CANT_RESET_V6ONLY = 10260 +ER_CONN_TCP_BIND_RETRY = 10261 +ER_CONN_TPC_BIND_FAIL = 10262 +ER_CONN_TCP_IP_NOT_LOGGED = 10263 +ER_CONN_TCP_RESOLVE_INFO = 10264 +ER_CONN_TCP_START_FAIL = 10265 +ER_CONN_TCP_LISTEN_FAIL = 10266 +ER_CONN_UNIX_PATH_TOO_LONG = 10267 +ER_CONN_UNIX_LOCK_FILE_FAIL = 10268 +ER_CONN_UNIX_NO_FD = 10269 +ER_CONN_UNIX_NO_BIND_NO_START = 10270 +ER_CONN_UNIX_LISTEN_FAILED = 10271 +ER_CONN_UNIX_LOCK_FILE_GIVING_UP = 10272 +ER_CONN_UNIX_LOCK_FILE_CANT_CREATE = 10273 +ER_CONN_UNIX_LOCK_FILE_CANT_OPEN = 10274 +ER_CONN_UNIX_LOCK_FILE_CANT_READ = 10275 +ER_CONN_UNIX_LOCK_FILE_EMPTY = 10276 +ER_CONN_UNIX_LOCK_FILE_PIDLESS = 10277 +ER_CONN_UNIX_LOCK_FILE_CANT_WRITE = 10278 +ER_CONN_UNIX_LOCK_FILE_CANT_DELETE = 10279 +ER_CONN_UNIX_LOCK_FILE_CANT_SYNC = 10280 +ER_CONN_UNIX_LOCK_FILE_CANT_CLOSE = 10281 +ER_CONN_SOCKET_SELECT_FAILED = 10282 +ER_CONN_SOCKET_ACCEPT_FAILED = 10283 +ER_AUTH_RSA_CANT_FIND = 10284 +ER_AUTH_RSA_CANT_PARSE = 10285 +ER_AUTH_RSA_CANT_READ = 10286 +ER_AUTH_RSA_FILES_NOT_FOUND = 10287 +ER_CONN_ATTR_TRUNCATED = 10288 +ER_X509_CIPHERS_MISMATCH = 10289 +ER_X509_ISSUER_MISMATCH = 10290 +ER_X509_SUBJECT_MISMATCH = 10291 +ER_AUTH_CANT_ACTIVATE_ROLE = 10292 +ER_X509_NEEDS_RSA_PRIVKEY = 10293 +ER_X509_CANT_WRITE_KEY = 10294 +ER_X509_CANT_CHMOD_KEY = 10295 +ER_X509_CANT_READ_CA_KEY = 10296 +ER_X509_CANT_READ_CA_CERT = 10297 +ER_X509_CANT_CREATE_CERT = 10298 +ER_X509_CANT_WRITE_CERT = 10299 +ER_AUTH_CANT_CREATE_RSA_PAIR = 10300 +ER_AUTH_CANT_WRITE_PRIVKEY = 10301 +ER_AUTH_CANT_WRITE_PUBKEY = 10302 +ER_AUTH_SSL_CONF_PREVENTS_CERT_GENERATION = 10303 +ER_AUTH_USING_EXISTING_CERTS = 10304 +ER_AUTH_CERTS_SAVED_TO_DATADIR = 10305 +ER_AUTH_CERT_GENERATION_DISABLED = 10306 +ER_AUTH_RSA_CONF_PREVENTS_KEY_GENERATION = 10307 +ER_AUTH_KEY_GENERATION_SKIPPED_PAIR_PRESENT = 10308 +ER_AUTH_KEYS_SAVED_TO_DATADIR = 10309 +ER_AUTH_KEY_GENERATION_DISABLED = 10310 +ER_AUTHCACHE_PROXIES_PRIV_SKIPPED_NEEDS_RESOLVE = 10311 +ER_AUTHCACHE_PLUGIN_MISSING = 10312 +ER_AUTHCACHE_PLUGIN_CONFIG = 10313 +OBSOLETE_ER_AUTHCACHE_ROLE_TABLES_DODGY = 10314 +ER_AUTHCACHE_USER_SKIPPED_NEEDS_RESOLVE = 10315 +ER_AUTHCACHE_USER_TABLE_DODGY = 10316 +ER_AUTHCACHE_USER_IGNORED_DEPRECATED_PASSWORD = 10317 +ER_AUTHCACHE_USER_IGNORED_NEEDS_PLUGIN = 10318 +ER_AUTHCACHE_USER_IGNORED_INVALID_PASSWORD = 10319 +ER_AUTHCACHE_EXPIRED_PASSWORD_UNSUPPORTED = 10320 +ER_NO_SUPER_WITHOUT_USER_PLUGIN = 10321 +ER_AUTHCACHE_DB_IGNORED_EMPTY_NAME = 10322 +ER_AUTHCACHE_DB_SKIPPED_NEEDS_RESOLVE = 10323 +ER_AUTHCACHE_DB_ENTRY_LOWERCASED_REVOKE_WILL_FAIL = 10324 +ER_AUTHCACHE_TABLE_PROXIES_PRIV_MISSING = 10325 +ER_AUTHCACHE_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES = 10326 +ER_AUTHCACHE_CANT_INIT_GRANT_SUBSYSTEM = 10327 +ER_AUTHCACHE_PROCS_PRIV_SKIPPED_NEEDS_RESOLVE = 10328 +ER_AUTHCACHE_PROCS_PRIV_ENTRY_IGNORED_BAD_ROUTINE_TYPE = 10329 +ER_AUTHCACHE_TABLES_PRIV_SKIPPED_NEEDS_RESOLVE = 10330 +ER_USER_NOT_IN_EXTRA_USERS_BINLOG_POSSIBLY_INCOMPLETE = 10331 +ER_DD_SCHEMA_NOT_FOUND = 10332 +ER_DD_TABLE_NOT_FOUND = 10333 +ER_DD_SE_INIT_FAILED = 10334 +ER_DD_ABORTING_PARTIAL_UPGRADE = 10335 +ER_DD_FRM_EXISTS_FOR_TABLE = 10336 +ER_DD_CREATED_FOR_UPGRADE = 10337 +ER_ERRMSG_CANT_FIND_FILE = 10338 +ER_ERRMSG_LOADING_55_STYLE = 10339 +ER_ERRMSG_MISSING_IN_FILE = 10340 +ER_ERRMSG_OOM = 10341 +ER_ERRMSG_CANT_READ = 10342 +ER_TABLE_INCOMPATIBLE_DECIMAL_FIELD = 10343 +ER_TABLE_INCOMPATIBLE_YEAR_FIELD = 10344 +ER_INVALID_CHARSET_AND_DEFAULT_IS_MB = 10345 +ER_TABLE_WRONG_KEY_DEFINITION = 10346 +ER_CANT_OPEN_FRM_FILE = 10347 +ER_CANT_READ_FRM_FILE = 10348 +ER_TABLE_CREATED_WITH_DIFFERENT_VERSION = 10349 +ER_VIEW_UNPARSABLE = 10350 +ER_FILE_TYPE_UNKNOWN = 10351 +ER_INVALID_INFO_IN_FRM = 10352 +ER_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES = 10353 +ER_AUDIT_PLUGIN_DOES_NOT_SUPPORT_AUDIT_AUTH_EVENTS = 10354 +ER_AUDIT_PLUGIN_HAS_INVALID_DATA = 10355 +ER_TZ_OOM_INITIALIZING_TIME_ZONES = 10356 +ER_TZ_CANT_OPEN_AND_LOCK_TIME_ZONE_TABLE = 10357 +ER_TZ_OOM_LOADING_LEAP_SECOND_TABLE = 10358 +ER_TZ_TOO_MANY_LEAPS_IN_LEAP_SECOND_TABLE = 10359 +ER_TZ_ERROR_LOADING_LEAP_SECOND_TABLE = 10360 +ER_TZ_UNKNOWN_OR_ILLEGAL_DEFAULT_TIME_ZONE = 10361 +ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE = 10362 +ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE_ID = 10363 +ER_TZ_TRANSITION_TYPE_TABLE_TYPE_TOO_LARGE = 10364 +ER_TZ_TRANSITION_TYPE_TABLE_ABBREVIATIONS_EXCEED_SPACE = 10365 +ER_TZ_TRANSITION_TYPE_TABLE_LOAD_ERROR = 10366 +ER_TZ_TRANSITION_TABLE_TOO_MANY_TRANSITIONS = 10367 +ER_TZ_TRANSITION_TABLE_BAD_TRANSITION_TYPE = 10368 +ER_TZ_TRANSITION_TABLE_LOAD_ERROR = 10369 +ER_TZ_NO_TRANSITION_TYPES_IN_TIME_ZONE = 10370 +ER_TZ_OOM_LOADING_TIME_ZONE_DESCRIPTION = 10371 +ER_TZ_CANT_BUILD_MKTIME_MAP = 10372 +ER_TZ_OOM_WHILE_LOADING_TIME_ZONE = 10373 +ER_TZ_OOM_WHILE_SETTING_TIME_ZONE = 10374 +ER_SLAVE_SQL_THREAD_STOPPED_UNTIL_CONDITION_BAD = 10375 +ER_SLAVE_SQL_THREAD_STOPPED_UNTIL_POSITION_REACHED = 10376 +ER_SLAVE_SQL_THREAD_STOPPED_BEFORE_GTIDS_ALREADY_APPLIED = 10377 +ER_SLAVE_SQL_THREAD_STOPPED_BEFORE_GTIDS_REACHED = 10378 +ER_SLAVE_SQL_THREAD_STOPPED_AFTER_GTIDS_REACHED = 10379 +ER_SLAVE_SQL_THREAD_STOPPED_GAP_TRX_PROCESSED = 10380 +ER_GROUP_REPLICATION_PLUGIN_NOT_INSTALLED = 10381 +ER_GTID_ALREADY_ADDED_BY_USER = 10382 +ER_FAILED_TO_DELETE_FROM_GTID_EXECUTED_TABLE = 10383 +ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE = 10384 +ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE_OOM = 10385 +ER_FAILED_TO_INIT_THREAD_ATTR_FOR_GTID_TABLE_COMPRESSION = 10386 +ER_FAILED_TO_CREATE_GTID_TABLE_COMPRESSION_THREAD = 10387 +ER_FAILED_TO_JOIN_GTID_TABLE_COMPRESSION_THREAD = 10388 +ER_NPIPE_FAILED_TO_INIT_SECURITY_DESCRIPTOR = 10389 +ER_NPIPE_FAILED_TO_SET_SECURITY_DESCRIPTOR = 10390 +ER_NPIPE_PIPE_ALREADY_IN_USE = 10391 +ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS_ON_START = 10392 +ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS = 10393 +ER_NDB_SLAVE_SAW_ALREADY_COMMITTED_EPOCH = 10394 +ER_NDB_SLAVE_PREVIOUS_EPOCH_NOT_COMMITTED = 10395 +ER_NDB_SLAVE_MISSING_DATA_FOR_TIMESTAMP_COLUMN = 10396 +ER_NDB_SLAVE_LOGGING_EXCEPTIONS_TO = 10397 +ER_NDB_SLAVE_LOW_EPOCH_RESOLUTION = 10398 +ER_NDB_INFO_FOUND_UNEXPECTED_FIELD_TYPE = 10399 +ER_NDB_INFO_FAILED_TO_CREATE_NDBINFO = 10400 +ER_NDB_INFO_FAILED_TO_INIT_NDBINFO = 10401 +ER_NDB_CLUSTER_WRONG_NUMBER_OF_FUNCTION_ARGUMENTS = 10402 +ER_NDB_CLUSTER_SCHEMA_INFO = 10403 +ER_NDB_CLUSTER_GENERIC_MESSAGE = 10404 +ER_RPL_CANT_OPEN_INFO_TABLE = 10405 +ER_RPL_CANT_SCAN_INFO_TABLE = 10406 +ER_RPL_CORRUPTED_INFO_TABLE = 10407 +ER_RPL_CORRUPTED_KEYS_IN_INFO_TABLE = 10408 +ER_RPL_WORKER_ID_IS = 10409 +ER_RPL_INCONSISTENT_TIMESTAMPS_IN_TRX = 10410 +ER_RPL_INCONSISTENT_SEQUENCE_NO_IN_TRX = 10411 +ER_RPL_CHANNELS_REQUIRE_TABLES_AS_INFO_REPOSITORIES = 10412 +ER_RPL_CHANNELS_REQUIRE_NON_ZERO_SERVER_ID = 10413 +ER_RPL_REPO_SHOULD_BE_TABLE = 10414 +ER_RPL_ERROR_CREATING_MASTER_INFO = 10415 +ER_RPL_ERROR_CHANGING_MASTER_INFO_REPO_TYPE = 10416 +ER_RPL_CHANGING_RELAY_LOG_INFO_REPO_TYPE_FAILED_DUE_TO_GAPS = 10417 +ER_RPL_ERROR_CREATING_RELAY_LOG_INFO = 10418 +ER_RPL_ERROR_CHANGING_RELAY_LOG_INFO_REPO_TYPE = 10419 +ER_RPL_FAILED_TO_DELETE_FROM_SLAVE_WORKERS_INFO_REPOSITORY = 10420 +ER_RPL_FAILED_TO_RESET_STATE_IN_SLAVE_INFO_REPOSITORY = 10421 +ER_RPL_ERROR_CHECKING_REPOSITORY = 10422 +ER_RPL_SLAVE_GENERIC_MESSAGE = 10423 +ER_RPL_SLAVE_COULD_NOT_CREATE_CHANNEL_LIST = 10424 +ER_RPL_MULTISOURCE_REQUIRES_TABLE_TYPE_REPOSITORIES = 10425 +ER_RPL_SLAVE_FAILED_TO_INIT_A_MASTER_INFO_STRUCTURE = 10426 +ER_RPL_SLAVE_FAILED_TO_INIT_MASTER_INFO_STRUCTURE = 10427 +ER_RPL_SLAVE_FAILED_TO_CREATE_CHANNEL_FROM_MASTER_INFO = 10428 +ER_RPL_FAILED_TO_CREATE_NEW_INFO_FILE = 10429 +ER_RPL_FAILED_TO_CREATE_CACHE_FOR_INFO_FILE = 10430 +ER_RPL_FAILED_TO_OPEN_INFO_FILE = 10431 +ER_RPL_GTID_MEMORY_FINALLY_AVAILABLE = 10432 +ER_SERVER_COST_UNKNOWN_COST_CONSTANT = 10433 +ER_SERVER_COST_INVALID_COST_CONSTANT = 10434 +ER_ENGINE_COST_UNKNOWN_COST_CONSTANT = 10435 +ER_ENGINE_COST_UNKNOWN_STORAGE_ENGINE = 10436 +ER_ENGINE_COST_INVALID_DEVICE_TYPE_FOR_SE = 10437 +ER_ENGINE_COST_INVALID_CONST_CONSTANT_FOR_SE_AND_DEVICE = 10438 +ER_SERVER_COST_FAILED_TO_READ = 10439 +ER_ENGINE_COST_FAILED_TO_READ = 10440 +ER_FAILED_TO_OPEN_COST_CONSTANT_TABLES = 10441 +ER_RPL_UNSUPPORTED_UNIGNORABLE_EVENT_IN_STREAM = 10442 +ER_RPL_GTID_LOG_EVENT_IN_STREAM = 10443 +ER_RPL_UNEXPECTED_BEGIN_IN_STREAM = 10444 +ER_RPL_UNEXPECTED_COMMIT_ROLLBACK_OR_XID_LOG_EVENT_IN_STREAM = 10445 +ER_RPL_UNEXPECTED_XA_ROLLBACK_IN_STREAM = 10446 +ER_EVENT_EXECUTION_FAILED_CANT_AUTHENTICATE_USER = 10447 +ER_EVENT_EXECUTION_FAILED_USER_LOST_EVEN_PRIVILEGE = 10448 +ER_EVENT_ERROR_DURING_COMPILATION = 10449 +ER_EVENT_DROPPING = 10450 +ER_NDB_SCHEMA_GENERIC_MESSAGE = 10451 +ER_RPL_INCOMPATIBLE_DECIMAL_IN_RBR = 10452 +ER_INIT_ROOT_WITHOUT_PASSWORD = 10453 +ER_INIT_GENERATING_TEMP_PASSWORD_FOR_ROOT = 10454 +ER_INIT_CANT_OPEN_BOOTSTRAP_FILE = 10455 +ER_INIT_BOOTSTRAP_COMPLETE = 10456 +ER_INIT_DATADIR_NOT_EMPTY_WONT_INITIALIZE = 10457 +ER_INIT_DATADIR_EXISTS_WONT_INITIALIZE = 10458 +ER_INIT_DATADIR_EXISTS_AND_PATH_TOO_LONG_WONT_INITIALIZE = 10459 +ER_INIT_DATADIR_EXISTS_AND_NOT_WRITABLE_WONT_INITIALIZE = 10460 +ER_INIT_CREATING_DD = 10461 +ER_RPL_BINLOG_STARTING_DUMP = 10462 +ER_RPL_BINLOG_MASTER_SENDS_HEARTBEAT = 10463 +ER_RPL_BINLOG_SKIPPING_REMAINING_HEARTBEAT_INFO = 10464 +ER_RPL_BINLOG_MASTER_USES_CHECKSUM_AND_SLAVE_CANT = 10465 +ER_NDB_QUERY_FAILED = 10466 +ER_KILLING_THREAD = 10467 +ER_DETACHING_SESSION_LEFT_BY_PLUGIN = 10468 +ER_CANT_DETACH_SESSION_LEFT_BY_PLUGIN = 10469 +ER_DETACHED_SESSIONS_LEFT_BY_PLUGIN = 10470 +ER_FAILED_TO_DECREMENT_NUMBER_OF_THREADS = 10471 +ER_PLUGIN_DID_NOT_DEINITIALIZE_THREADS = 10472 +ER_KILLED_THREADS_OF_PLUGIN = 10473 +ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_UNKNOWN = 10474 +ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_SET_TO = 10475 +ER_NDB_NODE_ID_AND_MANAGEMENT_SERVER_INFO = 10476 +ER_NDB_DISCONNECT_INFO = 10477 +ER_NDB_COLUMN_DEFAULTS_DIFFER = 10478 +ER_NDB_COLUMN_SHOULD_NOT_HAVE_NATIVE_DEFAULT = 10479 +ER_NDB_FIELD_INFO = 10480 +ER_NDB_COLUMN_INFO = 10481 +ER_NDB_OOM_IN_FIX_UNIQUE_INDEX_ATTR_ORDER = 10482 +ER_NDB_SLAVE_MALFORMED_EVENT_RECEIVED_ON_TABLE = 10483 +ER_NDB_SLAVE_CONFLICT_FUNCTION_REQUIRES_ROLE = 10484 +ER_NDB_SLAVE_CONFLICT_DETECTION_REQUIRES_TRANSACTION_IDS = 10485 +ER_NDB_SLAVE_BINLOG_MISSING_INFO_FOR_CONFLICT_DETECTION = 10486 +ER_NDB_ERROR_IN_READAUTOINCREMENTVALUE = 10487 +ER_NDB_FOUND_UNCOMMITTED_AUTOCOMMIT = 10488 +ER_NDB_SLAVE_TOO_MANY_RETRIES = 10489 +ER_NDB_SLAVE_ERROR_IN_UPDATE_CREATE_INFO = 10490 +ER_NDB_SLAVE_CANT_ALLOCATE_TABLE_SHARE = 10491 +ER_NDB_BINLOG_ERROR_INFO_FROM_DA = 10492 +ER_NDB_BINLOG_CREATE_TABLE_EVENT = 10493 +ER_NDB_BINLOG_FAILED_CREATE_TABLE_EVENT_OPERATIONS = 10494 +ER_NDB_BINLOG_RENAME_EVENT = 10495 +ER_NDB_BINLOG_FAILED_CREATE_EVENT_OPERATIONS_DURING_RENAME = 10496 +ER_NDB_UNEXPECTED_RENAME_TYPE = 10497 +ER_NDB_ERROR_IN_GET_AUTO_INCREMENT = 10498 +ER_NDB_CREATING_SHARE_IN_OPEN = 10499 +ER_NDB_TABLE_OPENED_READ_ONLY = 10500 +ER_NDB_INITIALIZE_GIVEN_CLUSTER_PLUGIN_DISABLED = 10501 +ER_NDB_BINLOG_FORMAT_CHANGED_FROM_STMT_TO_MIXED = 10502 +ER_NDB_TRAILING_SHARE_RELEASED_BY_CLOSE_CACHED_TABLES = 10503 +ER_NDB_SHARE_ALREADY_EXISTS = 10504 +ER_NDB_HANDLE_TRAILING_SHARE_INFO = 10505 +ER_NDB_CLUSTER_GET_SHARE_INFO = 10506 +ER_NDB_CLUSTER_REAL_FREE_SHARE_INFO = 10507 +ER_NDB_CLUSTER_REAL_FREE_SHARE_DROP_FAILED = 10508 +ER_NDB_CLUSTER_FREE_SHARE_INFO = 10509 +ER_NDB_CLUSTER_MARK_SHARE_DROPPED_INFO = 10510 +ER_NDB_CLUSTER_MARK_SHARE_DROPPED_DESTROYING_SHARE = 10511 +ER_NDB_CLUSTER_OOM_THD_NDB = 10512 +ER_NDB_BINLOG_NDB_TABLES_INITIALLY_READ_ONLY = 10513 +ER_NDB_UTIL_THREAD_OOM = 10514 +ER_NDB_ILLEGAL_VALUE_FOR_NDB_RECV_THREAD_CPU_MASK = 10515 +ER_NDB_TOO_MANY_CPUS_IN_NDB_RECV_THREAD_CPU_MASK = 10516 +ER_DBUG_CHECK_SHARES_OPEN = 10517 +ER_DBUG_CHECK_SHARES_INFO = 10518 +ER_DBUG_CHECK_SHARES_DROPPED = 10519 +ER_INVALID_OR_OLD_TABLE_OR_DB_NAME = 10520 +ER_TC_RECOVERING_AFTER_CRASH_USING = 10521 +ER_TC_CANT_AUTO_RECOVER_WITH_TC_HEURISTIC_RECOVER = 10522 +ER_TC_BAD_MAGIC_IN_TC_LOG = 10523 +ER_TC_NEED_N_SE_SUPPORTING_2PC_FOR_RECOVERY = 10524 +ER_TC_RECOVERY_FAILED_THESE_ARE_YOUR_OPTIONS = 10525 +ER_TC_HEURISTIC_RECOVERY_MODE = 10526 +ER_TC_HEURISTIC_RECOVERY_FAILED = 10527 +ER_TC_RESTART_WITHOUT_TC_HEURISTIC_RECOVER = 10528 +ER_RPL_SLAVE_FAILED_TO_CREATE_OR_RECOVER_INFO_REPOSITORIES = 10529 +ER_RPL_SLAVE_AUTO_POSITION_IS_1_AND_GTID_MODE_IS_OFF = 10530 +ER_RPL_SLAVE_CANT_START_SLAVE_FOR_CHANNEL = 10531 +ER_RPL_SLAVE_CANT_STOP_SLAVE_FOR_CHANNEL = 10532 +ER_RPL_RECOVERY_NO_ROTATE_EVENT_FROM_MASTER = 10533 +ER_RPL_RECOVERY_ERROR_READ_RELAY_LOG = 10534 +ER_RPL_RECOVERY_ERROR_FREEING_IO_CACHE = 10535 +ER_RPL_RECOVERY_SKIPPED_GROUP_REPLICATION_CHANNEL = 10536 +ER_RPL_RECOVERY_ERROR = 10537 +ER_RPL_RECOVERY_IO_ERROR_READING_RELAY_LOG_INDEX = 10538 +ER_RPL_RECOVERY_FILE_MASTER_POS_INFO = 10539 +ER_RPL_RECOVERY_REPLICATE_SAME_SERVER_ID_REQUIRES_POSITION = 10540 +ER_RPL_MTS_RECOVERY_STARTING_COORDINATOR = 10541 +ER_RPL_MTS_RECOVERY_FAILED_TO_START_COORDINATOR = 10542 +ER_RPL_MTS_AUTOMATIC_RECOVERY_FAILED = 10543 +ER_RPL_MTS_RECOVERY_CANT_OPEN_RELAY_LOG = 10544 +ER_RPL_MTS_RECOVERY_SUCCESSFUL = 10545 +ER_RPL_SERVER_ID_MISSING = 10546 +ER_RPL_CANT_CREATE_SLAVE_THREAD = 10547 +ER_RPL_SLAVE_IO_THREAD_WAS_KILLED = 10548 +ER_RPL_SLAVE_MASTER_UUID_HAS_CHANGED = 10549 +ER_RPL_SLAVE_USES_CHECKSUM_AND_MASTER_PRE_50 = 10550 +ER_RPL_SLAVE_SECONDS_BEHIND_MASTER_DUBIOUS = 10551 +ER_RPL_SLAVE_CANT_FLUSH_MASTER_INFO_FILE = 10552 +ER_RPL_SLAVE_REPORT_HOST_TOO_LONG = 10553 +ER_RPL_SLAVE_REPORT_USER_TOO_LONG = 10554 +ER_RPL_SLAVE_REPORT_PASSWORD_TOO_LONG = 10555 +ER_RPL_SLAVE_ERROR_RETRYING = 10556 +ER_RPL_SLAVE_ERROR_READING_FROM_SERVER = 10557 +ER_RPL_SLAVE_DUMP_THREAD_KILLED_BY_MASTER = 10558 +ER_RPL_MTS_STATISTICS = 10559 +ER_RPL_MTS_RECOVERY_COMPLETE = 10560 +ER_RPL_SLAVE_CANT_INIT_RELAY_LOG_POSITION = 10561 +ER_RPL_SLAVE_CONNECTED_TO_MASTER_REPLICATION_STARTED = 10562 +ER_RPL_SLAVE_IO_THREAD_KILLED = 10563 +ER_RPL_SLAVE_IO_THREAD_CANT_REGISTER_ON_MASTER = 10564 +ER_RPL_SLAVE_FORCING_TO_RECONNECT_IO_THREAD = 10565 +ER_RPL_SLAVE_ERROR_REQUESTING_BINLOG_DUMP = 10566 +ER_RPL_LOG_ENTRY_EXCEEDS_SLAVE_MAX_ALLOWED_PACKET = 10567 +ER_RPL_SLAVE_STOPPING_AS_MASTER_OOM = 10568 +ER_RPL_SLAVE_IO_THREAD_ABORTED_WAITING_FOR_RELAY_LOG_SPACE = 10569 +ER_RPL_SLAVE_IO_THREAD_EXITING = 10570 +ER_RPL_SLAVE_CANT_INITIALIZE_SLAVE_WORKER = 10571 +ER_RPL_MTS_GROUP_RECOVERY_RELAY_LOG_INFO_FOR_WORKER = 10572 +ER_RPL_ERROR_LOOKING_FOR_LOG = 10573 +ER_RPL_MTS_GROUP_RECOVERY_RELAY_LOG_INFO = 10574 +ER_RPL_CANT_FIND_FOLLOWUP_FILE = 10575 +ER_RPL_MTS_CHECKPOINT_PERIOD_DIFFERS_FROM_CNT = 10576 +ER_RPL_SLAVE_WORKER_THREAD_CREATION_FAILED = 10577 +ER_RPL_SLAVE_WORKER_THREAD_CREATION_FAILED_WITH_ERRNO = 10578 +ER_RPL_SLAVE_FAILED_TO_INIT_PARTITIONS_HASH = 10579 +ER_RPL_SLAVE_NDB_TABLES_NOT_AVAILABLE = 10580 +ER_RPL_SLAVE_SQL_THREAD_STARTING = 10581 +ER_RPL_SLAVE_SKIP_COUNTER_EXECUTED = 10582 +ER_RPL_SLAVE_ADDITIONAL_ERROR_INFO_FROM_DA = 10583 +ER_RPL_SLAVE_ERROR_INFO_FROM_DA = 10584 +ER_RPL_SLAVE_ERROR_LOADING_USER_DEFINED_LIBRARY = 10585 +ER_RPL_SLAVE_ERROR_RUNNING_QUERY = 10586 +ER_RPL_SLAVE_SQL_THREAD_EXITING = 10587 +ER_RPL_SLAVE_READ_INVALID_EVENT_FROM_MASTER = 10588 +ER_RPL_SLAVE_QUEUE_EVENT_FAILED_INVALID_CONFIGURATION = 10589 +ER_RPL_SLAVE_IO_THREAD_DETECTED_UNEXPECTED_EVENT_SEQUENCE = 10590 +ER_RPL_SLAVE_CANT_USE_CHARSET = 10591 +ER_RPL_SLAVE_CONNECTED_TO_MASTER_REPLICATION_RESUMED = 10592 +ER_RPL_SLAVE_NEXT_LOG_IS_ACTIVE = 10593 +ER_RPL_SLAVE_NEXT_LOG_IS_INACTIVE = 10594 +ER_RPL_SLAVE_SQL_THREAD_IO_ERROR_READING_EVENT = 10595 +ER_RPL_SLAVE_ERROR_READING_RELAY_LOG_EVENTS = 10596 +ER_SLAVE_CHANGE_MASTER_TO_EXECUTED = 10597 +ER_RPL_SLAVE_NEW_MASTER_INFO_NEEDS_REPOS_TYPE_OTHER_THAN_FILE = 10598 +ER_RPL_FAILED_TO_STAT_LOG_IN_INDEX = 10599 +ER_RPL_LOG_NOT_FOUND_WHILE_COUNTING_RELAY_LOG_SPACE = 10600 +ER_SLAVE_CANT_USE_TEMPDIR = 10601 +ER_RPL_RELAY_LOG_NEEDS_FILE_NOT_DIRECTORY = 10602 +ER_RPL_RELAY_LOG_INDEX_NEEDS_FILE_NOT_DIRECTORY = 10603 +ER_RPL_PLEASE_USE_OPTION_RELAY_LOG = 10604 +ER_RPL_OPEN_INDEX_FILE_FAILED = 10605 +ER_RPL_CANT_INITIALIZE_GTID_SETS_IN_RLI_INIT_INFO = 10606 +ER_RPL_CANT_OPEN_LOG_IN_RLI_INIT_INFO = 10607 +ER_RPL_ERROR_WRITING_RELAY_LOG_CONFIGURATION = 10608 +ER_NDB_OOM_GET_NDB_BLOBS_VALUE = 10609 +ER_NDB_THREAD_TIMED_OUT = 10610 +ER_NDB_TABLE_IS_NOT_DISTRIBUTED = 10611 +ER_NDB_CREATING_TABLE = 10612 +ER_NDB_FLUSHING_TABLE_INFO = 10613 +ER_NDB_CLEANING_STRAY_TABLES = 10614 +ER_NDB_DISCOVERED_MISSING_DB = 10615 +ER_NDB_DISCOVERED_REMAINING_DB = 10616 +ER_NDB_CLUSTER_FIND_ALL_DBS_RETRY = 10617 +ER_NDB_CLUSTER_FIND_ALL_DBS_FAIL = 10618 +ER_NDB_SKIPPING_SETUP_TABLE = 10619 +ER_NDB_FAILED_TO_SET_UP_TABLE = 10620 +ER_NDB_MISSING_FRM_DISCOVERING = 10621 +ER_NDB_MISMATCH_IN_FRM_DISCOVERING = 10622 +ER_NDB_BINLOG_CLEANING_UP_SETUP_LEFTOVERS = 10623 +ER_NDB_WAITING_INFO = 10624 +ER_NDB_WAITING_INFO_WITH_MAP = 10625 +ER_NDB_TIMEOUT_WHILE_DISTRIBUTING = 10626 +ER_NDB_NOT_WAITING_FOR_DISTRIBUTING = 10627 +ER_NDB_DISTRIBUTED_INFO = 10628 +ER_NDB_DISTRIBUTION_COMPLETE = 10629 +ER_NDB_SCHEMA_DISTRIBUTION_FAILED = 10630 +ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_SUBSCRIBE = 10631 +ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_UNSUBSCRIBE = 10632 +ER_NDB_BINLOG_CANT_DISCOVER_TABLE_FROM_SCHEMA_EVENT = 10633 +ER_NDB_BINLOG_SIGNALLING_UNKNOWN_VALUE = 10634 +ER_NDB_BINLOG_REPLY_TO = 10635 +ER_NDB_BINLOG_CANT_RELEASE_SLOCK = 10636 +ER_NDB_CANT_FIND_TABLE = 10637 +ER_NDB_DISCARDING_EVENT_NO_OBJ = 10638 +ER_NDB_DISCARDING_EVENT_ID_VERSION_MISMATCH = 10639 +ER_NDB_CLEAR_SLOCK_INFO = 10640 +ER_NDB_BINLOG_SKIPPING_LOCAL_TABLE = 10641 +ER_NDB_BINLOG_ONLINE_ALTER_RENAME = 10642 +ER_NDB_BINLOG_CANT_REOPEN_SHADOW_TABLE = 10643 +ER_NDB_BINLOG_ONLINE_ALTER_RENAME_COMPLETE = 10644 +ER_NDB_BINLOG_SKIPPING_DROP_OF_LOCAL_TABLE = 10645 +ER_NDB_BINLOG_SKIPPING_RENAME_OF_LOCAL_TABLE = 10646 +ER_NDB_BINLOG_SKIPPING_DROP_OF_DB_CONTAINING_LOCAL_TABLES = 10647 +ER_NDB_BINLOG_GOT_DIST_PRIV_EVENT_FLUSHING_PRIVILEGES = 10648 +ER_NDB_BINLOG_GOT_SCHEMA_EVENT = 10649 +ER_NDB_BINLOG_SKIPPING_OLD_SCHEMA_OPERATION = 10650 +ER_NDB_CLUSTER_FAILURE = 10651 +ER_NDB_TABLES_INITIALLY_READ_ONLY_ON_RECONNECT = 10652 +ER_NDB_IGNORING_UNKNOWN_EVENT = 10653 +ER_NDB_BINLOG_OPENING_INDEX = 10654 +ER_NDB_BINLOG_CANT_LOCK_NDB_BINLOG_INDEX = 10655 +ER_NDB_BINLOG_INJECTING_RANDOM_WRITE_FAILURE = 10656 +ER_NDB_BINLOG_CANT_WRITE_TO_NDB_BINLOG_INDEX = 10657 +ER_NDB_BINLOG_WRITING_TO_NDB_BINLOG_INDEX = 10658 +ER_NDB_BINLOG_CANT_COMMIT_TO_NDB_BINLOG_INDEX = 10659 +ER_NDB_BINLOG_WRITE_TO_NDB_BINLOG_INDEX_FAILED_AFTER_KILL = 10660 +ER_NDB_BINLOG_USING_SERVER_ID_0_SLAVES_WILL_NOT = 10661 +ER_NDB_SERVER_ID_RESERVED_OR_TOO_LARGE = 10662 +ER_NDB_BINLOG_NDB_LOG_TRANSACTION_ID_REQUIRES_V2_ROW_EVENTS = 10663 +ER_NDB_BINLOG_NDB_LOG_APPLY_STATUS_FORCING_FULL_USE_WRITE = 10664 +ER_NDB_BINLOG_GENERIC_MESSAGE = 10665 +ER_NDB_CONFLICT_GENERIC_MESSAGE = 10666 +ER_NDB_TRANS_DEPENDENCY_TRACKER_ERROR = 10667 +ER_NDB_CONFLICT_FN_PARSE_ERROR = 10668 +ER_NDB_CONFLICT_FN_SETUP_ERROR = 10669 +ER_NDB_BINLOG_FAILED_TO_GET_TABLE = 10670 +ER_NDB_BINLOG_NOT_LOGGING = 10671 +ER_NDB_BINLOG_CREATE_TABLE_EVENT_FAILED = 10672 +ER_NDB_BINLOG_CREATE_TABLE_EVENT_INFO = 10673 +ER_NDB_BINLOG_DISCOVER_TABLE_EVENT_INFO = 10674 +ER_NDB_BINLOG_BLOB_REQUIRES_PK = 10675 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB = 10676 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_AND_CANT_DROP = 10677 +ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_DROPPED = 10678 +ER_NDB_BINLOG_DISCOVER_REUSING_OLD_EVENT_OPS = 10679 +ER_NDB_BINLOG_CREATING_NDBEVENTOPERATION_FAILED = 10680 +ER_NDB_BINLOG_CANT_CREATE_BLOB = 10681 +ER_NDB_BINLOG_NDBEVENT_EXECUTE_FAILED = 10682 +ER_NDB_CREATE_EVENT_OPS_LOGGING_INFO = 10683 +ER_NDB_BINLOG_CANT_DROP_EVENT_FROM_DB = 10684 +ER_NDB_TIMED_OUT_IN_DROP_TABLE = 10685 +ER_NDB_BINLOG_UNHANDLED_ERROR_FOR_TABLE = 10686 +ER_NDB_BINLOG_CLUSTER_FAILURE = 10687 +ER_NDB_BINLOG_UNKNOWN_NON_DATA_EVENT = 10688 +ER_NDB_BINLOG_INJECTOR_DISCARDING_ROW_EVENT_METADATA = 10689 +ER_NDB_REMAINING_OPEN_TABLES = 10690 +ER_NDB_REMAINING_OPEN_TABLE_INFO = 10691 +ER_NDB_COULD_NOT_GET_APPLY_STATUS_SHARE = 10692 +ER_NDB_BINLOG_SERVER_SHUTDOWN_DURING_NDB_CLUSTER_START = 10693 +ER_NDB_BINLOG_CLUSTER_RESTARTED_RESET_MASTER_SUGGESTED = 10694 +ER_NDB_BINLOG_CLUSTER_HAS_RECONNECTED = 10695 +ER_NDB_BINLOG_STARTING_LOG_AT_EPOCH = 10696 +ER_NDB_BINLOG_NDB_TABLES_WRITABLE = 10697 +ER_NDB_BINLOG_SHUTDOWN_DETECTED = 10698 +ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_WAITING = 10699 +ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_CONTINUING = 10700 +ER_NDB_BINLOG_ERROR_HANDLING_SCHEMA_EVENT = 10701 +ER_NDB_BINLOG_CANT_INJECT_APPLY_STATUS_WRITE_ROW = 10702 +ER_NDB_BINLOG_ERROR_DURING_GCI_ROLLBACK = 10703 +ER_NDB_BINLOG_ERROR_DURING_GCI_COMMIT = 10704 +ER_NDB_BINLOG_LATEST_TRX_IN_EPOCH_NOT_IN_BINLOG = 10705 +ER_NDB_BINLOG_RELEASING_EXTRA_SHARE_REFERENCES = 10706 +ER_NDB_BINLOG_REMAINING_OPEN_TABLES = 10707 +ER_NDB_BINLOG_REMAINING_OPEN_TABLE_INFO = 10708 +ER_TREE_CORRUPT_PARENT_SHOULD_POINT_AT_PARENT = 10709 +ER_TREE_CORRUPT_ROOT_SHOULD_BE_BLACK = 10710 +ER_TREE_CORRUPT_2_CONSECUTIVE_REDS = 10711 +ER_TREE_CORRUPT_RIGHT_IS_LEFT = 10712 +ER_TREE_CORRUPT_INCORRECT_BLACK_COUNT = 10713 +ER_WRONG_COUNT_FOR_ORIGIN = 10714 +ER_WRONG_COUNT_FOR_KEY = 10715 +ER_WRONG_COUNT_OF_ELEMENTS = 10716 +ER_RPL_ERROR_READING_SLAVE_WORKER_CONFIGURATION = 10717 +ER_RPL_ERROR_WRITING_SLAVE_WORKER_CONFIGURATION = 10718 +ER_RPL_FAILED_TO_OPEN_RELAY_LOG = 10719 +ER_RPL_WORKER_CANT_READ_RELAY_LOG = 10720 +ER_RPL_WORKER_CANT_FIND_NEXT_RELAY_LOG = 10721 +ER_RPL_MTS_SLAVE_COORDINATOR_HAS_WAITED = 10722 +ER_BINLOG_FAILED_TO_WRITE_DROP_FOR_TEMP_TABLES = 10723 +ER_BINLOG_OOM_WRITING_DELETE_WHILE_OPENING_HEAP_TABLE = 10724 +ER_FAILED_TO_REPAIR_TABLE = 10725 +ER_FAILED_TO_REMOVE_TEMP_TABLE = 10726 +ER_SYSTEM_TABLE_NOT_TRANSACTIONAL = 10727 +ER_RPL_ERROR_WRITING_MASTER_CONFIGURATION = 10728 +ER_RPL_ERROR_READING_MASTER_CONFIGURATION = 10729 +ER_RPL_SSL_INFO_IN_MASTER_INFO_IGNORED = 10730 +ER_PLUGIN_FAILED_DEINITIALIZATION = 10731 +ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_DEINITIALIZATION = 10732 +ER_PLUGIN_SHUTTING_DOWN_PLUGIN = 10733 +ER_PLUGIN_REGISTRATION_FAILED = 10734 +ER_PLUGIN_CANT_OPEN_PLUGIN_TABLE = 10735 +ER_PLUGIN_CANT_LOAD = 10736 +ER_PLUGIN_LOAD_PARAMETER_TOO_LONG = 10737 +ER_PLUGIN_FORCING_SHUTDOWN = 10738 +ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_SHUTDOWN = 10739 +ER_PLUGIN_UNKNOWN_VARIABLE_TYPE = 10740 +ER_PLUGIN_VARIABLE_SET_READ_ONLY = 10741 +ER_PLUGIN_VARIABLE_MISSING_NAME = 10742 +ER_PLUGIN_VARIABLE_NOT_ALLOCATED_THREAD_LOCAL = 10743 +ER_PLUGIN_OOM = 10744 +ER_PLUGIN_BAD_OPTIONS = 10745 +ER_PLUGIN_PARSING_OPTIONS_FAILED = 10746 +ER_PLUGIN_DISABLED = 10747 +ER_PLUGIN_HAS_CONFLICTING_SYSTEM_VARIABLES = 10748 +ER_PLUGIN_CANT_SET_PERSISTENT_OPTIONS = 10749 +ER_MY_NET_WRITE_FAILED_FALLING_BACK_ON_STDERR = 10750 +ER_RETRYING_REPAIR_WITHOUT_QUICK = 10751 +ER_RETRYING_REPAIR_WITH_KEYCACHE = 10752 +ER_FOUND_ROWS_WHILE_REPAIRING = 10753 +ER_ERROR_DURING_OPTIMIZE_TABLE = 10754 +ER_ERROR_ENABLING_KEYS = 10755 +ER_CHECKING_TABLE = 10756 +ER_RECOVERING_TABLE = 10757 +ER_CANT_CREATE_TABLE_SHARE_FROM_FRM = 10758 +ER_CANT_LOCK_TABLE = 10759 +ER_CANT_ALLOC_TABLE_OBJECT = 10760 +ER_CANT_CREATE_HANDLER_OBJECT_FOR_TABLE = 10761 +ER_CANT_SET_HANDLER_REFERENCE_FOR_TABLE = 10762 +ER_CANT_LOCK_TABLESPACE = 10763 +ER_CANT_UPGRADE_GENERATED_COLUMNS_TO_DD = 10764 +ER_DD_ERROR_CREATING_ENTRY = 10765 +ER_DD_CANT_FETCH_TABLE_DATA = 10766 +ER_DD_CANT_FIX_SE_DATA = 10767 +ER_DD_CANT_CREATE_SP = 10768 +ER_CANT_OPEN_DB_OPT_USING_DEFAULT_CHARSET = 10769 +ER_CANT_CREATE_CACHE_FOR_DB_OPT = 10770 +ER_CANT_IDENTIFY_CHARSET_USING_DEFAULT = 10771 +ER_DB_OPT_NOT_FOUND_USING_DEFAULT_CHARSET = 10772 +ER_EVENT_CANT_GET_TIMEZONE_FROM_FIELD = 10773 +ER_EVENT_CANT_FIND_TIMEZONE = 10774 +ER_EVENT_CANT_GET_CHARSET = 10775 +ER_EVENT_CANT_GET_COLLATION = 10776 +ER_EVENT_CANT_OPEN_TABLE_MYSQL_EVENT = 10777 +ER_CANT_PARSE_STORED_ROUTINE_BODY = 10778 +ER_CANT_OPEN_TABLE_MYSQL_PROC = 10779 +ER_CANT_READ_TABLE_MYSQL_PROC = 10780 +ER_FILE_EXISTS_DURING_UPGRADE = 10781 +ER_CANT_OPEN_DATADIR_AFTER_UPGRADE_FAILURE = 10782 +ER_CANT_SET_PATH_FOR = 10783 +ER_CANT_OPEN_DIR = 10784 +ER_NDB_EMPTY_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10785 +ER_NDB_CANT_PARSE_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10786 +ER_NDB_INVALID_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10787 +ER_NDB_DUPLICATE_NODEID_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10788 +ER_NDB_POOL_SIZE_MUST_MATCH_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10789 +ER_NDB_NODEID_NOT_FIRST_IN_NDB_CLUSTER_CONNECTION_POOL_NODEIDS = 10790 +ER_NDB_USING_NODEID = 10791 +ER_NDB_CANT_ALLOC_GLOBAL_NDB_CLUSTER_CONNECTION = 10792 +ER_NDB_CANT_ALLOC_GLOBAL_NDB_OBJECT = 10793 +ER_NDB_USING_NODEID_LIST = 10794 +ER_NDB_CANT_ALLOC_NDB_CLUSTER_CONNECTION = 10795 +ER_NDB_STARTING_CONNECT_THREAD = 10796 +ER_NDB_NODE_INFO = 10797 +ER_NDB_CANT_START_CONNECT_THREAD = 10798 +ER_NDB_GENERIC_ERROR = 10799 +ER_NDB_CPU_MASK_TOO_SHORT = 10800 +ER_EVENT_ERROR_CREATING_QUERY_TO_WRITE_TO_BINLOG = 10801 +ER_EVENT_SCHEDULER_ERROR_LOADING_FROM_DB = 10802 +ER_EVENT_SCHEDULER_ERROR_GETTING_EVENT_OBJECT = 10803 +ER_EVENT_SCHEDULER_GOT_BAD_DATA_FROM_TABLE = 10804 +ER_EVENT_CANT_GET_LOCK_FOR_DROPPING_EVENT = 10805 +ER_EVENT_UNABLE_TO_DROP_EVENT = 10806 +ER_BINLOG_ATTACHING_THREAD_MEMORY_FINALLY_AVAILABLE = 10807 +ER_BINLOG_CANT_RESIZE_CACHE = 10808 +ER_BINLOG_FILE_BEING_READ_NOT_PURGED = 10809 +ER_BINLOG_IO_ERROR_READING_HEADER = 10810 +ER_BINLOG_CANT_OPEN_LOG = 10811 +ER_BINLOG_CANT_CREATE_CACHE_FOR_LOG = 10812 +ER_BINLOG_FILE_EXTENSION_NUMBER_EXHAUSTED = 10813 +ER_BINLOG_FILE_NAME_TOO_LONG = 10814 +ER_BINLOG_FILE_EXTENSION_NUMBER_RUNNING_LOW = 10815 +ER_BINLOG_CANT_OPEN_FOR_LOGGING = 10816 +ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE = 10817 +ER_BINLOG_ERROR_READING_GTIDS_FROM_RELAY_LOG = 10818 +ER_BINLOG_EVENTS_READ_FROM_RELAY_LOG_INFO = 10819 +ER_BINLOG_ERROR_READING_GTIDS_FROM_BINARY_LOG = 10820 +ER_BINLOG_EVENTS_READ_FROM_BINLOG_INFO = 10821 +ER_BINLOG_CANT_GENERATE_NEW_FILE_NAME = 10822 +ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE_IN_OPEN = 10823 +ER_BINLOG_CANT_USE_FOR_LOGGING = 10824 +ER_BINLOG_FAILED_TO_CLOSE_INDEX_FILE_WHILE_REBUILDING = 10825 +ER_BINLOG_FAILED_TO_DELETE_INDEX_FILE_WHILE_REBUILDING = 10826 +ER_BINLOG_FAILED_TO_RENAME_INDEX_FILE_WHILE_REBUILDING = 10827 +ER_BINLOG_FAILED_TO_OPEN_INDEX_FILE_AFTER_REBUILDING = 10828 +ER_BINLOG_CANT_APPEND_LOG_TO_TMP_INDEX = 10829 +ER_BINLOG_CANT_LOCATE_OLD_BINLOG_OR_RELAY_LOG_FILES = 10830 +ER_BINLOG_CANT_DELETE_FILE = 10831 +ER_BINLOG_CANT_SET_TMP_INDEX_NAME = 10832 +ER_BINLOG_FAILED_TO_OPEN_TEMPORARY_INDEX_FILE = 10833 +ER_BINLOG_ERROR_GETTING_NEXT_LOG_FROM_INDEX = 10834 +ER_BINLOG_CANT_OPEN_TMP_INDEX = 10835 +ER_BINLOG_CANT_COPY_INDEX_TO_TMP = 10836 +ER_BINLOG_CANT_CLOSE_TMP_INDEX = 10837 +ER_BINLOG_CANT_MOVE_TMP_TO_INDEX = 10838 +ER_BINLOG_PURGE_LOGS_CALLED_WITH_FILE_NOT_IN_INDEX = 10839 +ER_BINLOG_PURGE_LOGS_CANT_SYNC_INDEX_FILE = 10840 +ER_BINLOG_PURGE_LOGS_CANT_COPY_TO_REGISTER_FILE = 10841 +ER_BINLOG_PURGE_LOGS_CANT_FLUSH_REGISTER_FILE = 10842 +ER_BINLOG_PURGE_LOGS_CANT_UPDATE_INDEX_FILE = 10843 +ER_BINLOG_PURGE_LOGS_FAILED_TO_PURGE_LOG = 10844 +ER_BINLOG_FAILED_TO_SET_PURGE_INDEX_FILE_NAME = 10845 +ER_BINLOG_FAILED_TO_OPEN_REGISTER_FILE = 10846 +ER_BINLOG_FAILED_TO_REINIT_REGISTER_FILE = 10847 +ER_BINLOG_FAILED_TO_READ_REGISTER_FILE = 10848 +ER_CANT_STAT_FILE = 10849 +ER_BINLOG_CANT_DELETE_LOG_FILE_DOES_INDEX_MATCH_FILES = 10850 +ER_BINLOG_CANT_DELETE_FILE_AND_READ_BINLOG_INDEX = 10851 +ER_BINLOG_FAILED_TO_DELETE_LOG_FILE = 10852 +ER_BINLOG_LOGGING_INCIDENT_TO_STOP_SLAVES = 10853 +ER_BINLOG_CANT_FIND_LOG_IN_INDEX = 10854 +ER_BINLOG_RECOVERING_AFTER_CRASH_USING = 10855 +ER_BINLOG_CANT_OPEN_CRASHED_BINLOG = 10856 +ER_BINLOG_CANT_TRIM_CRASHED_BINLOG = 10857 +ER_BINLOG_CRASHED_BINLOG_TRIMMED = 10858 +ER_BINLOG_CANT_CLEAR_IN_USE_FLAG_FOR_CRASHED_BINLOG = 10859 +ER_BINLOG_FAILED_TO_RUN_AFTER_SYNC_HOOK = 10860 +ER_TURNING_LOGGING_OFF_FOR_THE_DURATION = 10861 +ER_BINLOG_FAILED_TO_RUN_AFTER_FLUSH_HOOK = 10862 +ER_BINLOG_CRASH_RECOVERY_FAILED = 10863 +ER_BINLOG_WARNING_SUPPRESSED = 10864 +ER_NDB_LOG_ENTRY = 10865 +ER_NDB_LOG_ENTRY_WITH_PREFIX = 10866 +ER_NDB_BINLOG_CANT_CREATE_PURGE_THD = 10867 +ER_INNODB_UNKNOWN_COLLATION = 10868 +ER_INNODB_INVALID_LOG_GROUP_HOME_DIR = 10869 +ER_INNODB_INVALID_INNODB_UNDO_DIRECTORY = 10870 +ER_INNODB_ILLEGAL_COLON_IN_POOL = 10871 +ER_INNODB_INVALID_PAGE_SIZE = 10872 +ER_INNODB_DIRTY_WATER_MARK_NOT_LOW = 10873 +ER_INNODB_IO_CAPACITY_EXCEEDS_MAX = 10874 +ER_INNODB_FILES_SAME = 10875 +ER_INNODB_UNREGISTERED_TRX_ACTIVE = 10876 +ER_INNODB_CLOSING_CONNECTION_ROLLS_BACK = 10877 +ER_INNODB_TRX_XLATION_TABLE_OOM = 10878 +ER_INNODB_CANT_FIND_INDEX_IN_INNODB_DD = 10879 +ER_INNODB_INDEX_COLUMN_INFO_UNLIKE_MYSQLS = 10880 +ER_INNODB_CANT_OPEN_TABLE = 10881 +ER_INNODB_CANT_BUILD_INDEX_XLATION_TABLE_FOR = 10882 +ER_INNODB_PK_NOT_IN_MYSQL = 10883 +ER_INNODB_PK_ONLY_IN_MYSQL = 10884 +ER_INNODB_CLUSTERED_INDEX_PRIVATE = 10885 +ER_INNODB_PARTITION_TABLE_LOWERCASED = 10886 +ER_ERRMSG_REPLACEMENT_DODGY = 10887 +ER_ERRMSG_REPLACEMENTS_FAILED = 10888 +ER_NPIPE_CANT_CREATE = 10889 +ER_PARTITION_MOVE_CREATED_DUPLICATE_ROW_PLEASE_FIX = 10890 +ER_AUDIT_CANT_ABORT_COMMAND = 10891 +ER_AUDIT_CANT_ABORT_EVENT = 10892 +ER_AUDIT_WARNING = 10893 +ER_NDB_NUMBER_OF_CHANNELS = 10894 +ER_NDB_SLAVE_PARALLEL_WORKERS = 10895 +ER_NDB_DISTRIBUTING_ERR = 10896 +ER_RPL_SLAVE_INSECURE_CHANGE_MASTER = 10897 +ER_RPL_SLAVE_FLUSH_RELAY_LOGS_NOT_ALLOWED = 10898 +ER_RPL_SLAVE_INCORRECT_CHANNEL = 10899 +ER_FAILED_TO_FIND_DL_ENTRY = 10900 +ER_FAILED_TO_OPEN_SHARED_LIBRARY = 10901 +ER_THREAD_PRIORITY_IGNORED = 10902 +ER_BINLOG_CACHE_SIZE_TOO_LARGE = 10903 +ER_BINLOG_STMT_CACHE_SIZE_TOO_LARGE = 10904 +ER_FAILED_TO_GENERATE_UNIQUE_LOGFILE = 10905 +ER_FAILED_TO_READ_FILE = 10906 +ER_FAILED_TO_WRITE_TO_FILE = 10907 +ER_BINLOG_UNSAFE_MESSAGE_AND_STATEMENT = 10908 +ER_FORCE_CLOSE_THREAD = 10909 +ER_SERVER_SHUTDOWN_COMPLETE = 10910 +ER_RPL_CANT_HAVE_SAME_BASENAME = 10911 +ER_RPL_GTID_MODE_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 10912 +ER_WARN_NO_SERVERID_SPECIFIED = 10913 +ER_ABORTING_USER_CONNECTION = 10914 +ER_SQL_MODE_MERGED_WITH_STRICT_MODE = 10915 +ER_GTID_PURGED_WAS_UPDATED = 10916 +ER_GTID_EXECUTED_WAS_UPDATED = 10917 +ER_DEPRECATE_MSG_WITH_REPLACEMENT = 10918 +ER_TRG_CREATION_CTX_NOT_SET = 10919 +ER_FILE_HAS_OLD_FORMAT = 10920 +ER_VIEW_CREATION_CTX_NOT_SET = 10921 +ER_TABLE_NAME_CAUSES_TOO_LONG_PATH = 10922 +ER_TABLE_UPGRADE_REQUIRED = 10923 +ER_GET_ERRNO_FROM_STORAGE_ENGINE = 10924 +ER_ACCESS_DENIED_ERROR_WITHOUT_PASSWORD = 10925 +ER_ACCESS_DENIED_ERROR_WITH_PASSWORD = 10926 +ER_ACCESS_DENIED_FOR_USER_ACCOUNT_LOCKED = 10927 +ER_MUST_CHANGE_EXPIRED_PASSWORD = 10928 +ER_SYSTEM_TABLES_NOT_SUPPORTED_BY_STORAGE_ENGINE = 10929 +ER_FILESORT_TERMINATED = 10930 +ER_SERVER_STARTUP_MSG = 10931 +ER_FAILED_TO_FIND_LOCALE_NAME = 10932 +ER_FAILED_TO_FIND_COLLATION_NAME = 10933 +ER_SERVER_OUT_OF_RESOURCES = 10934 +ER_SERVER_OUTOFMEMORY = 10935 +ER_INVALID_COLLATION_FOR_CHARSET = 10936 +ER_CANT_START_ERROR_LOG_SERVICE = 10937 +ER_CREATING_NEW_UUID_FIRST_START = 10938 +ER_FAILED_TO_GET_ABSOLUTE_PATH = 10939 +ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP = 10940 +ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_SHUTDOWN = 10941 +ER_DUP_FD_OPEN_FAILED = 10942 +ER_SYSTEM_VIEW_INIT_FAILED = 10943 +ER_RESOURCE_GROUP_POST_INIT_FAILED = 10944 +ER_RESOURCE_GROUP_SUBSYSTEM_INIT_FAILED = 10945 +ER_FAILED_START_MYSQLD_DAEMON = 10946 +ER_CANNOT_CHANGE_TO_ROOT_DIR = 10947 +ER_PERSISTENT_PRIVILEGES_BOOTSTRAP = 10948 +ER_BASEDIR_SET_TO = 10949 +ER_RPL_FILTER_ADD_WILD_DO_TABLE_FAILED = 10950 +ER_RPL_FILTER_ADD_WILD_IGNORE_TABLE_FAILED = 10951 +ER_PRIVILEGE_SYSTEM_INIT_FAILED = 10952 +ER_CANNOT_SET_LOG_ERROR_SERVICES = 10953 +ER_PERFSCHEMA_TABLES_INIT_FAILED = 10954 +ER_TX_EXTRACTION_ALGORITHM_FOR_BINLOG_TX_DEPEDENCY_TRACKING = 10955 +ER_INVALID_REPLICATION_TIMESTAMPS = 10956 +ER_RPL_TIMESTAMPS_RETURNED_TO_NORMAL = 10957 +ER_BINLOG_FILE_OPEN_FAILED = 10958 +ER_BINLOG_EVENT_WRITE_TO_STMT_CACHE_FAILED = 10959 +ER_SLAVE_RELAY_LOG_TRUNCATE_INFO = 10960 +ER_SLAVE_RELAY_LOG_PURGE_FAILED = 10961 +ER_RPL_SLAVE_FILTER_CREATE_FAILED = 10962 +ER_RPL_SLAVE_GLOBAL_FILTERS_COPY_FAILED = 10963 +ER_RPL_SLAVE_RESET_FILTER_OPTIONS = 10964 +ER_MISSING_GRANT_SYSTEM_TABLE = 10965 +ER_MISSING_ACL_SYSTEM_TABLE = 10966 +ER_ANONYMOUS_AUTH_ID_NOT_ALLOWED_IN_MANDATORY_ROLES = 10967 +ER_UNKNOWN_AUTH_ID_IN_MANDATORY_ROLE = 10968 +ER_WRITE_ROW_TO_PARTITION_FAILED = 10969 +ER_RESOURCE_GROUP_METADATA_UPDATE_SKIPPED = 10970 +ER_FAILED_TO_PERSIST_RESOURCE_GROUP_METADATA = 10971 +ER_FAILED_TO_DESERIALIZE_RESOURCE_GROUP = 10972 +ER_FAILED_TO_UPDATE_RESOURCE_GROUP = 10973 +ER_RESOURCE_GROUP_VALIDATION_FAILED = 10974 +ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP = 10975 +ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP_HASH = 10976 +ER_FAILED_TO_ADD_RESOURCE_GROUP_TO_MAP = 10977 +ER_RESOURCE_GROUP_IS_DISABLED = 10978 +ER_FAILED_TO_APPLY_RESOURCE_GROUP_CONTROLLER = 10979 +ER_FAILED_TO_ACQUIRE_LOCK_ON_RESOURCE_GROUP = 10980 +ER_PFS_NOTIFICATION_FUNCTION_REGISTER_FAILED = 10981 +ER_RES_GRP_SET_THR_AFFINITY_FAILED = 10982 +ER_RES_GRP_SET_THR_AFFINITY_TO_CPUS_FAILED = 10983 +ER_RES_GRP_THD_UNBIND_FROM_CPU_FAILED = 10984 +ER_RES_GRP_SET_THREAD_PRIORITY_FAILED = 10985 +ER_RES_GRP_FAILED_TO_DETERMINE_NICE_CAPABILITY = 10986 +ER_RES_GRP_FAILED_TO_GET_THREAD_HANDLE = 10987 +ER_RES_GRP_GET_THREAD_PRIO_NOT_SUPPORTED = 10988 +ER_RES_GRP_FAILED_DETERMINE_CPU_COUNT = 10989 +ER_RES_GRP_FEATURE_NOT_AVAILABLE = 10990 +ER_RES_GRP_INVALID_THREAD_PRIORITY = 10991 +ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_CPUID_FAILED = 10992 +ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_THREAD_FAILED = 10993 +ER_RES_GRP_SOLARIS_PROCESSOR_AFFINITY_FAILED = 10994 +ER_DD_UPGRADE_RENAME_IDX_STATS_FILE_FAILED = 10995 +ER_DD_UPGRADE_DD_OPEN_FAILED = 10996 +ER_DD_UPGRADE_FAILED_TO_FETCH_TABLESPACES = 10997 +ER_DD_UPGRADE_FAILED_TO_ACQUIRE_TABLESPACE = 10998 +ER_DD_UPGRADE_FAILED_TO_RESOLVE_TABLESPACE_ENGINE = 10999 +ER_FAILED_TO_CREATE_SDI_FOR_TABLESPACE = 11000 +ER_FAILED_TO_STORE_SDI_FOR_TABLESPACE = 11001 +ER_DD_UPGRADE_FAILED_TO_FETCH_TABLES = 11002 +ER_DD_UPGRADE_DD_POPULATED = 11003 +ER_DD_UPGRADE_INFO_FILE_OPEN_FAILED = 11004 +ER_DD_UPGRADE_INFO_FILE_CLOSE_FAILED = 11005 +ER_DD_UPGRADE_TABLESPACE_MIGRATION_FAILED = 11006 +ER_DD_UPGRADE_FAILED_TO_CREATE_TABLE_STATS = 11007 +ER_DD_UPGRADE_TABLE_STATS_MIGRATE_COMPLETED = 11008 +ER_DD_UPGRADE_FAILED_TO_CREATE_INDEX_STATS = 11009 +ER_DD_UPGRADE_INDEX_STATS_MIGRATE_COMPLETED = 11010 +ER_DD_UPGRADE_FAILED_FIND_VALID_DATA_DIR = 11011 +ER_DD_UPGRADE_START = 11012 +ER_DD_UPGRADE_FAILED_INIT_DD_SE = 11013 +ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_ABORT = 11014 +ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_CONTINUE = 11015 +ER_DD_UPGRADE_SE_LOGS_FAILED = 11016 +ER_DD_UPGRADE_SDI_INFO_UPDATE_FAILED = 11017 +ER_SKIP_UPDATING_METADATA_IN_SE_RO_MODE = 11018 +ER_CREATED_SYSTEM_WITH_VERSION = 11019 +ER_UNKNOWN_ERROR_DETECTED_IN_SE = 11020 +ER_READ_LOG_EVENT_FAILED = 11021 +ER_ROW_DATA_TOO_BIG_TO_WRITE_IN_BINLOG = 11022 +ER_FAILED_TO_CONSTRUCT_DROP_EVENT_QUERY = 11023 +ER_FAILED_TO_BINLOG_DROP_EVENT = 11024 +ER_FAILED_TO_START_SLAVE_THREAD = 11025 +ER_RPL_IO_THREAD_KILLED = 11026 +ER_SLAVE_RECONNECT_FAILED = 11027 +ER_SLAVE_KILLED_AFTER_RECONNECT = 11028 +ER_SLAVE_NOT_STARTED_ON_SOME_CHANNELS = 11029 +ER_FAILED_TO_ADD_RPL_FILTER = 11030 +ER_PER_CHANNEL_RPL_FILTER_CONF_FOR_GRP_RPL = 11031 +ER_RPL_FILTERS_NOT_ATTACHED_TO_CHANNEL = 11032 +ER_FAILED_TO_BUILD_DO_AND_IGNORE_TABLE_HASHES = 11033 +ER_CLONE_PLUGIN_NOT_LOADED = 11034 +ER_CLONE_HANDLER_EXISTS = 11035 +ER_FAILED_TO_CREATE_CLONE_HANDLER = 11036 +ER_CYCLE_TIMER_IS_NOT_AVAILABLE = 11037 +ER_NANOSECOND_TIMER_IS_NOT_AVAILABLE = 11038 +ER_MICROSECOND_TIMER_IS_NOT_AVAILABLE = 11039 +ER_PFS_MALLOC_ARRAY_OVERFLOW = 11040 +ER_PFS_MALLOC_ARRAY_OOM = 11041 +ER_INNODB_FAILED_TO_FIND_IDX_WITH_KEY_NO = 11042 +ER_INNODB_FAILED_TO_FIND_IDX = 11043 +ER_INNODB_FAILED_TO_FIND_IDX_FROM_DICT_CACHE = 11044 +ER_INNODB_ACTIVE_INDEX_CHANGE_FAILED = 11045 +ER_INNODB_DIFF_IN_REF_LEN = 11046 +ER_WRONG_TYPE_FOR_COLUMN_PREFIX_IDX_FLD = 11047 +ER_INNODB_CANNOT_CREATE_TABLE = 11048 +ER_INNODB_INTERNAL_INDEX = 11049 +ER_INNODB_IDX_CNT_MORE_THAN_DEFINED_IN_MYSQL = 11050 +ER_INNODB_IDX_CNT_FEWER_THAN_DEFINED_IN_MYSQL = 11051 +ER_INNODB_IDX_COLUMN_CNT_DIFF = 11052 +ER_INNODB_USE_MONITOR_GROUP_NAME = 11053 +ER_INNODB_MONITOR_DEFAULT_VALUE_NOT_DEFINED = 11054 +ER_INNODB_MONITOR_IS_ENABLED = 11055 +ER_INNODB_INVALID_MONITOR_COUNTER_NAME = 11056 +ER_WIN_LOAD_LIBRARY_FAILED = 11057 +ER_PARTITION_HANDLER_ADMIN_MSG = 11058 +ER_RPL_RLI_INIT_INFO_MSG = 11059 +ER_DD_UPGRADE_TABLE_INTACT_ERROR = 11060 +ER_SERVER_INIT_COMPILED_IN_COMMANDS = 11061 +ER_MYISAM_CHECK_METHOD_ERROR = 11062 +ER_MYISAM_CRASHED_ERROR = 11063 +ER_WAITPID_FAILED = 11064 +ER_FAILED_TO_FIND_MYSQLD_STATUS = 11065 +ER_INNODB_ERROR_LOGGER_MSG = 11066 +ER_INNODB_ERROR_LOGGER_FATAL_MSG = 11067 +ER_DEPRECATED_SYNTAX_WITH_REPLACEMENT = 11068 +ER_DEPRECATED_SYNTAX_NO_REPLACEMENT = 11069 +ER_DEPRECATE_MSG_NO_REPLACEMENT = 11070 +ER_LOG_PRINTF_MSG = 11071 +ER_BINLOG_LOGGING_NOT_POSSIBLE = 11072 +ER_FAILED_TO_SET_PERSISTED_OPTIONS = 11073 +ER_COMPONENTS_FAILED_TO_ACQUIRE_SERVICE_IMPLEMENTATION = 11074 +ER_RES_GRP_INVALID_VCPU_RANGE = 11075 +ER_RES_GRP_INVALID_VCPU_ID = 11076 +ER_ERROR_DURING_FLUSH_LOG_COMMIT_PHASE = 11077 +ER_DROP_DATABASE_FAILED_RMDIR_MANUALLY = 11078 +ER_EXPIRE_LOGS_DAYS_IGNORED = 11079 +ER_BINLOG_MALFORMED_OR_OLD_RELAY_LOG = 11080 +ER_DD_UPGRADE_VIEW_COLUMN_NAME_TOO_LONG = 11081 +ER_TABLE_NEEDS_DUMP_UPGRADE = 11082 +ER_DD_UPGRADE_FAILED_TO_UPDATE_VER_NO_IN_TABLESPACE = 11083 +ER_KEYRING_MIGRATION_FAILED = 11084 +ER_KEYRING_MIGRATION_SUCCESSFUL = 11085 +ER_RESTART_RECEIVED_INFO = 11086 +ER_LCTN_CHANGED = 11087 +ER_DD_INITIALIZE = 11088 +ER_DD_RESTART = 11089 +ER_DD_UPGRADE = 11090 +ER_DD_UPGRADE_OFF = 11091 +ER_DD_UPGRADE_VERSION_NOT_SUPPORTED = 11092 +ER_DD_UPGRADE_SCHEMA_UNAVAILABLE = 11093 +ER_DD_MINOR_DOWNGRADE = 11094 +ER_DD_MINOR_DOWNGRADE_VERSION_NOT_SUPPORTED = 11095 +ER_DD_NO_VERSION_FOUND = 11096 +ER_THREAD_POOL_NOT_SUPPORTED_ON_PLATFORM = 11097 +ER_THREAD_POOL_SIZE_TOO_LOW = 11098 +ER_THREAD_POOL_SIZE_TOO_HIGH = 11099 +ER_THREAD_POOL_ALGORITHM_INVALID = 11100 +ER_THREAD_POOL_INVALID_STALL_LIMIT = 11101 +ER_THREAD_POOL_INVALID_PRIO_KICKUP_TIMER = 11102 +ER_THREAD_POOL_MAX_UNUSED_THREADS_INVALID = 11103 +ER_THREAD_POOL_CON_HANDLER_INIT_FAILED = 11104 +ER_THREAD_POOL_INIT_FAILED = 11105 +ER_THREAD_POOL_PLUGIN_STARTED = 11106 +ER_THREAD_POOL_CANNOT_SET_THREAD_SPECIFIC_DATA = 11107 +ER_THREAD_POOL_FAILED_TO_CREATE_CONNECT_HANDLER_THD = 11108 +ER_THREAD_POOL_FAILED_TO_CREATE_THD_AND_AUTH_CONN = 11109 +ER_THREAD_POOL_FAILED_PROCESS_CONNECT_EVENT = 11110 +ER_THREAD_POOL_FAILED_TO_CREATE_POOL = 11111 +ER_THREAD_POOL_RATE_LIMITED_ERROR_MSGS = 11112 +ER_TRHEAD_POOL_LOW_LEVEL_INIT_FAILED = 11113 +ER_THREAD_POOL_LOW_LEVEL_REARM_FAILED = 11114 +ER_THREAD_POOL_BUFFER_TOO_SMALL = 11115 +ER_MECAB_NOT_SUPPORTED = 11116 +ER_MECAB_NOT_VERIFIED = 11117 +ER_MECAB_CREATING_MODEL = 11118 +ER_MECAB_FAILED_TO_CREATE_MODEL = 11119 +ER_MECAB_FAILED_TO_CREATE_TRIGGER = 11120 +ER_MECAB_UNSUPPORTED_CHARSET = 11121 +ER_MECAB_CHARSET_LOADED = 11122 +ER_MECAB_PARSE_FAILED = 11123 +ER_MECAB_OOM_WHILE_PARSING_TEXT = 11124 +ER_MECAB_CREATE_LATTICE_FAILED = 11125 +ER_SEMISYNC_TRACE_ENTER_FUNC = 11126 +ER_SEMISYNC_TRACE_EXIT_WITH_INT_EXIT_CODE = 11127 +ER_SEMISYNC_TRACE_EXIT_WITH_BOOL_EXIT_CODE = 11128 +ER_SEMISYNC_TRACE_EXIT = 11129 +ER_SEMISYNC_RPL_INIT_FOR_TRX = 11130 +ER_SEMISYNC_FAILED_TO_ALLOCATE_TRX_NODE = 11131 +ER_SEMISYNC_BINLOG_WRITE_OUT_OF_ORDER = 11132 +ER_SEMISYNC_INSERT_LOG_INFO_IN_ENTRY = 11133 +ER_SEMISYNC_PROBE_LOG_INFO_IN_ENTRY = 11134 +ER_SEMISYNC_CLEARED_ALL_ACTIVE_TRANSACTION_NODES = 11135 +ER_SEMISYNC_CLEARED_ACTIVE_TRANSACTION_TILL_POS = 11136 +ER_SEMISYNC_REPLY_MAGIC_NO_ERROR = 11137 +ER_SEMISYNC_REPLY_PKT_LENGTH_TOO_SMALL = 11138 +ER_SEMISYNC_REPLY_BINLOG_FILE_TOO_LARGE = 11139 +ER_SEMISYNC_SERVER_REPLY = 11140 +ER_SEMISYNC_FUNCTION_CALLED_TWICE = 11141 +ER_SEMISYNC_RPL_ENABLED_ON_MASTER = 11142 +ER_SEMISYNC_MASTER_OOM = 11143 +ER_SEMISYNC_DISABLED_ON_MASTER = 11144 +ER_SEMISYNC_FORCED_SHUTDOWN = 11145 +ER_SEMISYNC_MASTER_GOT_REPLY_AT_POS = 11146 +ER_SEMISYNC_MASTER_SIGNAL_ALL_WAITING_THREADS = 11147 +ER_SEMISYNC_MASTER_TRX_WAIT_POS = 11148 +ER_SEMISYNC_BINLOG_REPLY_IS_AHEAD = 11149 +ER_SEMISYNC_MOVE_BACK_WAIT_POS = 11150 +ER_SEMISYNC_INIT_WAIT_POS = 11151 +ER_SEMISYNC_WAIT_TIME_FOR_BINLOG_SENT = 11152 +ER_SEMISYNC_WAIT_FOR_BINLOG_TIMEDOUT = 11153 +ER_SEMISYNC_WAIT_TIME_ASSESSMENT_FOR_COMMIT_TRX_FAILED = 11154 +ER_SEMISYNC_RPL_SWITCHED_OFF = 11155 +ER_SEMISYNC_RPL_SWITCHED_ON = 11156 +ER_SEMISYNC_NO_SPACE_IN_THE_PKT = 11157 +ER_SEMISYNC_SYNC_HEADER_UPDATE_INFO = 11158 +ER_SEMISYNC_FAILED_TO_INSERT_TRX_NODE = 11159 +ER_SEMISYNC_TRX_SKIPPED_AT_POS = 11160 +ER_SEMISYNC_MASTER_FAILED_ON_NET_FLUSH = 11161 +ER_SEMISYNC_RECEIVED_ACK_IS_SMALLER = 11162 +ER_SEMISYNC_ADD_ACK_TO_SLOT = 11163 +ER_SEMISYNC_UPDATE_EXISTING_SLAVE_ACK = 11164 +ER_SEMISYNC_FAILED_TO_START_ACK_RECEIVER_THD = 11165 +ER_SEMISYNC_STARTING_ACK_RECEIVER_THD = 11166 +ER_SEMISYNC_FAILED_TO_WAIT_ON_DUMP_SOCKET = 11167 +ER_SEMISYNC_STOPPING_ACK_RECEIVER_THREAD = 11168 +ER_SEMISYNC_FAILED_REGISTER_SLAVE_TO_RECEIVER = 11169 +ER_SEMISYNC_START_BINLOG_DUMP_TO_SLAVE = 11170 +ER_SEMISYNC_STOP_BINLOG_DUMP_TO_SLAVE = 11171 +ER_SEMISYNC_UNREGISTER_TRX_OBSERVER_FAILED = 11172 +ER_SEMISYNC_UNREGISTER_BINLOG_STORAGE_OBSERVER_FAILED = 11173 +ER_SEMISYNC_UNREGISTER_BINLOG_TRANSMIT_OBSERVER_FAILED = 11174 +ER_SEMISYNC_UNREGISTERED_REPLICATOR = 11175 +ER_SEMISYNC_SOCKET_FD_TOO_LARGE = 11176 +ER_SEMISYNC_SLAVE_REPLY = 11177 +ER_SEMISYNC_MISSING_MAGIC_NO_FOR_SEMISYNC_PKT = 11178 +ER_SEMISYNC_SLAVE_START = 11179 +ER_SEMISYNC_SLAVE_REPLY_WITH_BINLOG_INFO = 11180 +ER_SEMISYNC_SLAVE_NET_FLUSH_REPLY_FAILED = 11181 +ER_SEMISYNC_SLAVE_SEND_REPLY_FAILED = 11182 +ER_SEMISYNC_EXECUTION_FAILED_ON_MASTER = 11183 +ER_SEMISYNC_NOT_SUPPORTED_BY_MASTER = 11184 +ER_SEMISYNC_SLAVE_SET_FAILED = 11185 +ER_SEMISYNC_FAILED_TO_STOP_ACK_RECEIVER_THD = 11186 +ER_FIREWALL_FAILED_TO_READ_FIREWALL_TABLES = 11187 +ER_FIREWALL_FAILED_TO_REG_DYNAMIC_PRIVILEGES = 11188 +ER_FIREWALL_RECORDING_STMT_WAS_TRUNCATED = 11189 +ER_FIREWALL_RECORDING_STMT_WITHOUT_TEXT = 11190 +ER_FIREWALL_SUSPICIOUS_STMT = 11191 +ER_FIREWALL_ACCESS_DENIED = 11192 +ER_FIREWALL_SKIPPED_UNKNOWN_USER_MODE = 11193 +ER_FIREWALL_RELOADING_CACHE = 11194 +ER_FIREWALL_RESET_FOR_USER = 11195 +ER_FIREWALL_STATUS_FLUSHED = 11196 +ER_KEYRING_LOGGER_ERROR_MSG = 11197 +ER_AUDIT_LOG_FILTER_IS_NOT_INSTALLED = 11198 +ER_AUDIT_LOG_SWITCHING_TO_INCLUDE_LIST = 11199 +ER_AUDIT_LOG_CANNOT_SET_LOG_POLICY_WITH_OTHER_POLICIES = 11200 +ER_AUDIT_LOG_ONLY_INCLUDE_LIST_USED = 11201 +ER_AUDIT_LOG_INDEX_MAP_CANNOT_ACCESS_DIR = 11202 +ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED = 11203 +ER_AUDIT_LOG_WRITER_DEST_FILE_ALREADY_EXISTS = 11204 +ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED_REMOVE_FILE_MANUALLY = 11205 +ER_AUDIT_LOG_WRITER_INCOMPLETE_FILE_RENAMED = 11206 +ER_AUDIT_LOG_WRITER_FAILED_TO_WRITE_TO_FILE = 11207 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_ENCRYPTION = 11208 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_COMPRESSION = 11209 +ER_AUDIT_LOG_EC_WRITER_FAILED_TO_CREATE_FILE = 11210 +ER_AUDIT_LOG_RENAME_LOG_FILE_BEFORE_FLUSH = 11211 +ER_AUDIT_LOG_FILTER_RESULT_MSG = 11212 +ER_AUDIT_LOG_JSON_READER_FAILED_TO_PARSE = 11213 +ER_AUDIT_LOG_JSON_READER_BUF_TOO_SMALL = 11214 +ER_AUDIT_LOG_JSON_READER_FAILED_TO_OPEN_FILE = 11215 +ER_AUDIT_LOG_JSON_READER_FILE_PARSING_ERROR = 11216 +ER_AUDIT_LOG_FILTER_INVALID_COLUMN_COUNT = 11217 +ER_AUDIT_LOG_FILTER_INVALID_COLUMN_DEFINITION = 11218 +ER_AUDIT_LOG_FILTER_FAILED_TO_STORE_TABLE_FLDS = 11219 +ER_AUDIT_LOG_FILTER_FAILED_TO_UPDATE_TABLE = 11220 +ER_AUDIT_LOG_FILTER_FAILED_TO_INSERT_INTO_TABLE = 11221 +ER_AUDIT_LOG_FILTER_FAILED_TO_DELETE_FROM_TABLE = 11222 +ER_AUDIT_LOG_FILTER_FAILED_TO_INIT_TABLE_FOR_READ = 11223 +ER_AUDIT_LOG_FILTER_FAILED_TO_READ_TABLE = 11224 +ER_AUDIT_LOG_FILTER_FAILED_TO_CLOSE_TABLE_AFTER_READING = 11225 +ER_AUDIT_LOG_FILTER_USER_AND_HOST_CANNOT_BE_EMPTY = 11226 +ER_AUDIT_LOG_FILTER_FLD_FILTERNAME_CANNOT_BE_EMPTY = 11227 +ER_VALIDATE_PWD_DICT_FILE_NOT_SPECIFIED = 11228 +ER_VALIDATE_PWD_DICT_FILE_NOT_LOADED = 11229 +ER_VALIDATE_PWD_DICT_FILE_TOO_BIG = 11230 +ER_VALIDATE_PWD_FAILED_TO_READ_DICT_FILE = 11231 +ER_VALIDATE_PWD_FAILED_TO_GET_FLD_FROM_SECURITY_CTX = 11232 +ER_VALIDATE_PWD_FAILED_TO_GET_SECURITY_CTX = 11233 +ER_VALIDATE_PWD_LENGTH_CHANGED = 11234 +ER_REWRITER_QUERY_ERROR_MSG = 11235 +ER_REWRITER_QUERY_FAILED = 11236 +ER_XPLUGIN_STARTUP_FAILED = 11237 +ER_XPLUGIN_SERVER_EXITING = 11238 +ER_XPLUGIN_SERVER_EXITED = 11239 +ER_XPLUGIN_USING_SSL_CONF_FROM_SERVER = 11240 +ER_XPLUGIN_USING_SSL_CONF_FROM_MYSQLX = 11241 +ER_XPLUGIN_FAILED_TO_USE_SSL_CONF = 11242 +ER_XPLUGIN_USING_SSL_FOR_TLS_CONNECTION = 11243 +ER_XPLUGIN_REFERENCE_TO_SECURE_CONN_WITH_XPLUGIN = 11244 +ER_XPLUGIN_ERROR_MSG = 11245 +ER_SHA_PWD_FAILED_TO_PARSE_AUTH_STRING = 11246 +ER_SHA_PWD_FAILED_TO_GENERATE_MULTI_ROUND_HASH = 11247 +ER_SHA_PWD_AUTH_REQUIRES_RSA_OR_SSL = 11248 +ER_SHA_PWD_RSA_KEY_TOO_LONG = 11249 +ER_PLUGIN_COMMON_FAILED_TO_OPEN_FILTER_TABLES = 11250 +ER_PLUGIN_COMMON_FAILED_TO_OPEN_TABLE = 11251 +ER_AUTH_LDAP_ERROR_LOGGER_ERROR_MSG = 11252 +ER_CONN_CONTROL_ERROR_MSG = 11253 +ER_GRP_RPL_ERROR_MSG = 11254 +ER_SHA_PWD_SALT_FOR_USER_CORRUPT = 11255 +ER_SYS_VAR_COMPONENT_OOM = 11256 +ER_SYS_VAR_COMPONENT_VARIABLE_SET_READ_ONLY = 11257 +ER_SYS_VAR_COMPONENT_UNKNOWN_VARIABLE_TYPE = 11258 +ER_SYS_VAR_COMPONENT_FAILED_TO_PARSE_VARIABLE_OPTIONS = 11259 +ER_SYS_VAR_COMPONENT_FAILED_TO_MAKE_VARIABLE_PERSISTENT = 11260 +ER_COMPONENT_FILTER_CONFUSED = 11261 +ER_STOP_SLAVE_IO_THREAD_DISK_SPACE = 11262 +ER_LOG_FILE_CANNOT_OPEN = 11263 +OBSOLETE_ER_UNABLE_TO_COLLECT_INSTANCE_LOG_STATUS = 11264 +OBSOLETE_ER_DEPRECATED_UTF8_ALIAS = 11265 +OBSOLETE_ER_DEPRECATED_NATIONAL = 11266 +OBSOLETE_ER_SLAVE_POSSIBLY_DIVERGED_AFTER_DDL = 11267 +ER_PERSIST_OPTION_STATUS = 11268 +ER_NOT_IMPLEMENTED_GET_TABLESPACE_STATISTICS = 11269 +OBSOLETE_ER_UNABLE_TO_SET_OPTION = 11270 +OBSOLETE_ER_RESERVED_TABLESPACE_NAME = 11271 +ER_SSL_FIPS_MODE_ERROR = 11272 +ER_CONN_INIT_CONNECT_IGNORED = 11273 +ER_UNSUPPORTED_SQL_MODE = 11274 +ER_REWRITER_OOM = 11275 +ER_REWRITER_TABLE_MALFORMED_ERROR = 11276 +ER_REWRITER_LOAD_FAILED = 11277 +ER_REWRITER_READ_FAILED = 11278 +ER_CONN_CONTROL_EVENT_COORDINATOR_INIT_FAILED = 11279 +ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_UPDATE_FAILED = 11280 +ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_RESET_FAILED = 11281 +ER_CONN_CONTROL_INVALID_CONN_DELAY_TYPE = 11282 +ER_CONN_CONTROL_DELAY_ACTION_INIT_FAILED = 11283 +ER_CONN_CONTROL_FAILED_TO_SET_CONN_DELAY = 11284 +ER_CONN_CONTROL_FAILED_TO_UPDATE_CONN_DELAY_HASH = 11285 +ER_XPLUGIN_FORCE_STOP_CLIENT = 11286 +ER_XPLUGIN_MAX_AUTH_ATTEMPTS_REACHED = 11287 +ER_XPLUGIN_BUFFER_PAGE_ALLOC_FAILED = 11288 +ER_XPLUGIN_DETECTED_HANGING_CLIENTS = 11289 +ER_XPLUGIN_FAILED_TO_ACCEPT_CLIENT = 11290 +ER_XPLUGIN_FAILED_TO_SCHEDULE_CLIENT = 11291 +ER_XPLUGIN_FAILED_TO_PREPARE_IO_INTERFACES = 11292 +ER_XPLUGIN_SRV_SESSION_INIT_THREAD_FAILED = 11293 +ER_XPLUGIN_UNABLE_TO_USE_USER_SESSION_ACCOUNT = 11294 +ER_XPLUGIN_REFERENCE_TO_USER_ACCOUNT_DOC_SECTION = 11295 +ER_XPLUGIN_UNEXPECTED_EXCEPTION_DISPATCHING_CMD = 11296 +ER_XPLUGIN_EXCEPTION_IN_TASK_SCHEDULER = 11297 +ER_XPLUGIN_TASK_SCHEDULING_FAILED = 11298 +ER_XPLUGIN_EXCEPTION_IN_EVENT_LOOP = 11299 +ER_XPLUGIN_LISTENER_SETUP_FAILED = 11300 +ER_XPLUING_NET_STARTUP_FAILED = 11301 +ER_XPLUGIN_FAILED_AT_SSL_CONF = 11302 +ER_XPLUGIN_CLIENT_SSL_HANDSHAKE_FAILED = 11303 +ER_XPLUGIN_SSL_HANDSHAKE_WITH_SERVER_FAILED = 11304 +ER_XPLUGIN_FAILED_TO_CREATE_SESSION_FOR_CONN = 11305 +ER_XPLUGIN_FAILED_TO_INITIALIZE_SESSION = 11306 +ER_XPLUGIN_MESSAGE_TOO_LONG = 11307 +ER_XPLUGIN_UNINITIALIZED_MESSAGE = 11308 +ER_XPLUGIN_FAILED_TO_SET_MIN_NUMBER_OF_WORKERS = 11309 +ER_XPLUGIN_UNABLE_TO_ACCEPT_CONNECTION = 11310 +ER_XPLUGIN_ALL_IO_INTERFACES_DISABLED = 11311 +ER_XPLUGIN_INVALID_MSG_DURING_CLIENT_INIT = 11312 +ER_XPLUGIN_CLOSING_CLIENTS_ON_SHUTDOWN = 11313 +ER_XPLUGIN_ERROR_READING_SOCKET = 11314 +ER_XPLUGIN_PEER_DISCONNECTED_WHILE_READING_MSG_BODY = 11315 +ER_XPLUGIN_READ_FAILED_CLOSING_CONNECTION = 11316 +ER_XPLUGIN_INVALID_AUTH_METHOD = 11317 +ER_XPLUGIN_UNEXPECTED_MSG_DURING_AUTHENTICATION = 11318 +ER_XPLUGIN_ERROR_WRITING_TO_CLIENT = 11319 +ER_XPLUGIN_SCHEDULER_STARTED = 11320 +ER_XPLUGIN_SCHEDULER_STOPPED = 11321 +ER_XPLUGIN_LISTENER_SYS_VARIABLE_ERROR = 11322 +ER_XPLUGIN_LISTENER_STATUS_MSG = 11323 +ER_XPLUGIN_RETRYING_BIND_ON_PORT = 11324 +ER_XPLUGIN_SHUTDOWN_TRIGGERED = 11325 +ER_XPLUGIN_USER_ACCOUNT_WITH_ALL_PERMISSIONS = 11326 +ER_XPLUGIN_EXISTING_USER_ACCOUNT_WITH_INCOMPLETE_GRANTS = 11327 +ER_XPLUGIN_SERVER_STARTS_HANDLING_CONNECTIONS = 11328 +ER_XPLUGIN_SERVER_STOPPED_HANDLING_CONNECTIONS = 11329 +ER_XPLUGIN_FAILED_TO_INTERRUPT_SESSION = 11330 +ER_XPLUGIN_CLIENT_RELEASE_TRIGGERED = 11331 +ER_XPLUGIN_IPv6_AVAILABLE = 11332 +ER_XPLUGIN_UNIX_SOCKET_NOT_CONFIGURED = 11333 +ER_XPLUGIN_CLIENT_KILL_MSG = 11334 +ER_XPLUGIN_FAILED_TO_GET_SECURITY_CTX = 11335 +ER_XPLUGIN_FAILED_TO_SWITCH_SECURITY_CTX_TO_ROOT = 11336 +ER_XPLUGIN_FAILED_TO_CLOSE_SQL_SESSION = 11337 +ER_XPLUGIN_FAILED_TO_EXECUTE_ADMIN_CMD = 11338 +ER_XPLUGIN_EMPTY_ADMIN_CMD = 11339 +ER_XPLUGIN_FAILED_TO_GET_SYS_VAR = 11340 +ER_XPLUGIN_FAILED_TO_GET_CREATION_STMT = 11341 +ER_XPLUGIN_FAILED_TO_GET_ENGINE_INFO = 11342 +ER_XPLUGIN_FAIL_TO_GET_RESULT_DATA = 11343 +ER_XPLUGIN_CAPABILITY_EXPIRED_PASSWORD = 11344 +ER_XPLUGIN_FAILED_TO_SET_SO_REUSEADDR_FLAG = 11345 +ER_XPLUGIN_FAILED_TO_OPEN_INTERNAL_SESSION = 11346 +ER_XPLUGIN_FAILED_TO_SWITCH_CONTEXT = 11347 +ER_XPLUGIN_FAILED_TO_UNREGISTER_UDF = 11348 +ER_XPLUGIN_GET_PEER_ADDRESS_FAILED = 11349 +ER_XPLUGIN_CAPABILITY_CLIENT_INTERACTIVE_FAILED = 11350 +ER_XPLUGIN_FAILED_TO_RESET_IPV6_V6ONLY_FLAG = 11351 +ER_KEYRING_INVALID_KEY_TYPE = 11352 +ER_KEYRING_INVALID_KEY_LENGTH = 11353 +ER_KEYRING_FAILED_TO_CREATE_KEYRING_DIR = 11354 +ER_KEYRING_FILE_INIT_FAILED = 11355 +ER_KEYRING_INTERNAL_EXCEPTION_FAILED_FILE_INIT = 11356 +ER_KEYRING_FAILED_TO_GENERATE_KEY = 11357 +ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_INVALID_KEY = 11358 +ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_EMPTY_KEY_ID = 11359 +ER_KEYRING_OPERATION_FAILED_DUE_TO_INTERNAL_ERROR = 11360 +ER_KEYRING_INCORRECT_FILE = 11361 +ER_KEYRING_FOUND_MALFORMED_BACKUP_FILE = 11362 +ER_KEYRING_FAILED_TO_RESTORE_FROM_BACKUP_FILE = 11363 +ER_KEYRING_FAILED_TO_FLUSH_KEYRING_TO_FILE = 11364 +ER_KEYRING_FAILED_TO_GET_FILE_STAT = 11365 +ER_KEYRING_FAILED_TO_REMOVE_FILE = 11366 +ER_KEYRING_FAILED_TO_TRUNCATE_FILE = 11367 +ER_KEYRING_UNKNOWN_ERROR = 11368 +ER_KEYRING_FAILED_TO_SET_KEYRING_FILE_DATA = 11369 +ER_KEYRING_FILE_IO_ERROR = 11370 +ER_KEYRING_FAILED_TO_LOAD_KEYRING_CONTENT = 11371 +ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING = 11372 +ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING_BACKUP = 11373 +ER_KEYRING_KEY_FETCH_FAILED_DUE_TO_EMPTY_KEY_ID = 11374 +ER_KEYRING_FAILED_TO_REMOVE_KEY_DUE_TO_EMPTY_ID = 11375 +ER_KEYRING_OKV_INCORRECT_KEY_VAULT_CONFIGURED = 11376 +ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INCORRECT_CONF = 11377 +ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INTERNAL_ERROR = 11378 +ER_KEYRING_OKV_INVALID_KEY_TYPE = 11379 +ER_KEYRING_OKV_INVALID_KEY_LENGTH_FOR_CIPHER = 11380 +ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR = 11381 +ER_KEYRING_OKV_FAILED_TO_FIND_SERVER_ENTRY = 11382 +ER_KEYRING_OKV_FAILED_TO_FIND_STANDBY_SERVER_ENTRY = 11383 +ER_KEYRING_OKV_FAILED_TO_PARSE_CONF_FILE = 11384 +ER_KEYRING_OKV_FAILED_TO_LOAD_KEY_UID = 11385 +ER_KEYRING_OKV_FAILED_TO_INIT_SSL_LAYER = 11386 +ER_KEYRING_OKV_FAILED_TO_INIT_CLIENT = 11387 +ER_KEYRING_OKV_CONNECTION_TO_SERVER_FAILED = 11388 +ER_KEYRING_OKV_FAILED_TO_REMOVE_KEY = 11389 +ER_KEYRING_OKV_FAILED_TO_ADD_ATTRIBUTE = 11390 +ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY = 11391 +ER_KEYRING_OKV_FAILED_TO_STORE_KEY = 11392 +ER_KEYRING_OKV_FAILED_TO_ACTIVATE_KEYS = 11393 +ER_KEYRING_OKV_FAILED_TO_FETCH_KEY = 11394 +ER_KEYRING_OKV_FAILED_TO_STORE_OR_GENERATE_KEY = 11395 +ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY_SIGNATURE = 11396 +ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY = 11397 +ER_KEYRING_OKV_FAILED_TO_LOAD_SSL_TRUST_STORE = 11398 +ER_KEYRING_OKV_FAILED_TO_SET_CERTIFICATE_FILE = 11399 +ER_KEYRING_OKV_FAILED_TO_SET_KEY_FILE = 11400 +ER_KEYRING_OKV_KEY_MISMATCH = 11401 +ER_KEYRING_ENCRYPTED_FILE_INCORRECT_KEYRING_FILE = 11402 +ER_KEYRING_ENCRYPTED_FILE_DECRYPTION_FAILED = 11403 +ER_KEYRING_ENCRYPTED_FILE_FOUND_MALFORMED_BACKUP_FILE = 11404 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_RESTORE_KEYRING = 11405 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_FLUSH_KEYRING = 11406 +ER_KEYRING_ENCRYPTED_FILE_ENCRYPTION_FAILED = 11407 +ER_KEYRING_ENCRYPTED_FILE_INVALID_KEYRING_DIR = 11408 +ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_CREATE_KEYRING_DIR = 11409 +ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_INVALID = 11410 +ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_TOO_LONG = 11411 +ER_KEYRING_ENCRYPTED_FILE_INIT_FAILURE = 11412 +ER_KEYRING_ENCRYPTED_FILE_INIT_FAILED_DUE_TO_INTERNAL_ERROR = 11413 +ER_KEYRING_ENCRYPTED_FILE_GEN_KEY_FAILED_DUE_TO_INTERNAL_ERROR = 11414 +ER_KEYRING_AWS_FAILED_TO_SET_CMK_ID = 11415 +ER_KEYRING_AWS_FAILED_TO_SET_REGION = 11416 +ER_KEYRING_AWS_FAILED_TO_OPEN_CONF_FILE = 11417 +ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_ID_FROM_CONF_FILE = 11418 +ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_FROM_CONF_FILE = 11419 +ER_KEYRING_AWS_INVALID_CONF_FILE_PATH = 11420 +ER_KEYRING_AWS_INVALID_DATA_FILE_PATH = 11421 +ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DIR = 11422 +ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DATA_FILE = 11423 +ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_INTERNAL_ERROR = 11424 +ER_KEYRING_AWS_FAILED_TO_ACCESS_DATA_FILE = 11425 +ER_KEYRING_AWS_CMK_ID_NOT_SET = 11426 +ER_KEYRING_AWS_FAILED_TO_GET_KMS_CREDENTIAL_FROM_CONF_FILE = 11427 +ER_KEYRING_AWS_INIT_FAILURE = 11428 +ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_PLUGIN_INTERNAL_ERROR = 11429 +ER_KEYRING_AWS_INVALID_KEY_LENGTH_FOR_CIPHER = 11430 +ER_KEYRING_AWS_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR = 11431 +ER_KEYRING_AWS_INCORRECT_FILE = 11432 +ER_KEYRING_AWS_FOUND_MALFORMED_BACKUP_FILE = 11433 +ER_KEYRING_AWS_FAILED_TO_RESTORE_FROM_BACKUP_FILE = 11434 +ER_KEYRING_AWS_FAILED_TO_FLUSH_KEYRING_TO_FILE = 11435 +ER_KEYRING_AWS_INCORRECT_REGION = 11436 +ER_KEYRING_AWS_FAILED_TO_CONNECT_KMS = 11437 +ER_KEYRING_AWS_FAILED_TO_GENERATE_NEW_KEY = 11438 +ER_KEYRING_AWS_FAILED_TO_ENCRYPT_KEY = 11439 +ER_KEYRING_AWS_FAILED_TO_RE_ENCRYPT_KEY = 11440 +ER_KEYRING_AWS_FAILED_TO_DECRYPT_KEY = 11441 +ER_KEYRING_AWS_FAILED_TO_ROTATE_CMK = 11442 +ER_GRP_RPL_GTID_ALREADY_USED = 11443 +ER_GRP_RPL_APPLIER_THD_KILLED = 11444 +ER_GRP_RPL_EVENT_HANDLING_ERROR = 11445 +ER_GRP_RPL_ERROR_GTID_EXECUTION_INFO = 11446 +ER_GRP_RPL_CERTIFICATE_SIZE_ERROR = 11447 +ER_GRP_RPL_CREATE_APPLIER_CACHE_ERROR = 11448 +ER_GRP_RPL_UNBLOCK_WAITING_THD = 11449 +ER_GRP_RPL_APPLIER_PIPELINE_NOT_DISPOSED = 11450 +ER_GRP_RPL_APPLIER_THD_EXECUTION_ABORTED = 11451 +ER_GRP_RPL_APPLIER_EXECUTION_FATAL_ERROR = 11452 +ER_GRP_RPL_ERROR_STOPPING_CHANNELS = 11453 +ER_GRP_RPL_ERROR_SENDING_SINGLE_PRIMARY_MSSG = 11454 +ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_VER_ERROR = 11455 +ER_GRP_RPL_SIDNO_FETCH_ERROR = 11456 +ER_GRP_RPL_BROADCAST_COMMIT_TRANS_MSSG_FAILED = 11457 +ER_GRP_RPL_GROUP_NAME_PARSE_ERROR = 11458 +ER_GRP_RPL_ADD_GRPSID_TO_GRPGTIDSID_MAP_ERROR = 11459 +ER_GRP_RPL_UPDATE_GRPGTID_EXECUTED_ERROR = 11460 +ER_GRP_RPL_DONOR_TRANS_INFO_ERROR = 11461 +ER_GRP_RPL_SERVER_CONN_ERROR = 11462 +ER_GRP_RPL_ERROR_FETCHING_GTID_EXECUTED_SET = 11463 +ER_GRP_RPL_ADD_GTID_TO_GRPGTID_EXECUTED_ERROR = 11464 +ER_GRP_RPL_ERROR_FETCHING_GTID_SET = 11465 +ER_GRP_RPL_ADD_RETRIEVED_SET_TO_GRP_GTID_EXECUTED_ERROR = 11466 +ER_GRP_RPL_CERTIFICATION_INITIALIZATION_FAILURE = 11467 +ER_GRP_RPL_UPDATE_LAST_CONFLICT_FREE_TRANS_ERROR = 11468 +ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_REF_VER_ERROR = 11469 +ER_GRP_RPL_FETCH_TRANS_SIDNO_ERROR = 11470 +ER_GRP_RPL_ERROR_VERIFYING_SIDNO = 11471 +ER_GRP_RPL_CANT_GENERATE_GTID = 11472 +ER_GRP_RPL_INVALID_GTID_SET = 11473 +ER_GRP_RPL_UPDATE_GTID_SET_ERROR = 11474 +ER_GRP_RPL_RECEIVED_SET_MISSING_GTIDS = 11475 +ER_GRP_RPL_SKIP_COMPUTATION_TRANS_COMMITTED = 11476 +ER_GRP_RPL_NULL_PACKET = 11477 +ER_GRP_RPL_CANT_READ_GTID = 11478 +ER_GRP_RPL_PROCESS_GTID_SET_ERROR = 11479 +ER_GRP_RPL_PROCESS_INTERSECTION_GTID_SET_ERROR = 11480 +ER_GRP_RPL_SET_STABLE_TRANS_ERROR = 11481 +ER_GRP_RPL_CANT_READ_GRP_GTID_EXTRACTED = 11482 +ER_GRP_RPL_CANT_READ_WRITE_SET_ITEM = 11483 +ER_GRP_RPL_INIT_CERTIFICATION_INFO_FAILURE = 11484 +ER_GRP_RPL_CONFLICT_DETECTION_DISABLED = 11485 +ER_GRP_RPL_MSG_DISCARDED = 11486 +ER_GRP_RPL_MISSING_GRP_RPL_APPLIER = 11487 +ER_GRP_RPL_CERTIFIER_MSSG_PROCESS_ERROR = 11488 +ER_GRP_RPL_SRV_NOT_ONLINE = 11489 +ER_GRP_RPL_SRV_ONLINE = 11490 +ER_GRP_RPL_DISABLE_SRV_READ_MODE_RESTRICTED = 11491 +ER_GRP_RPL_MEM_ONLINE = 11492 +ER_GRP_RPL_MEM_UNREACHABLE = 11493 +ER_GRP_RPL_MEM_REACHABLE = 11494 +ER_GRP_RPL_SRV_BLOCKED = 11495 +ER_GRP_RPL_SRV_BLOCKED_FOR_SECS = 11496 +ER_GRP_RPL_CHANGE_GRP_MEM_NOT_PROCESSED = 11497 +ER_GRP_RPL_MEMBER_CONTACT_RESTORED = 11498 +ER_GRP_RPL_MEMBER_REMOVED = 11499 +ER_GRP_RPL_PRIMARY_MEMBER_LEFT_GRP = 11500 +ER_GRP_RPL_MEMBER_ADDED = 11501 +ER_GRP_RPL_MEMBER_EXIT_PLUGIN_ERROR = 11502 +ER_GRP_RPL_MEMBER_CHANGE = 11503 +ER_GRP_RPL_MEMBER_LEFT_GRP = 11504 +ER_GRP_RPL_MEMBER_EXPELLED = 11505 +ER_GRP_RPL_SESSION_OPEN_FAILED = 11506 +ER_GRP_RPL_NEW_PRIMARY_ELECTED = 11507 +ER_GRP_RPL_DISABLE_READ_ONLY_FAILED = 11508 +ER_GRP_RPL_ENABLE_READ_ONLY_FAILED = 11509 +ER_GRP_RPL_SRV_PRIMARY_MEM = 11510 +ER_GRP_RPL_SRV_SECONDARY_MEM = 11511 +ER_GRP_RPL_NO_SUITABLE_PRIMARY_MEM = 11512 +ER_GRP_RPL_SUPER_READ_ONLY_ACTIVATE_ERROR = 11513 +ER_GRP_RPL_EXCEEDS_AUTO_INC_VALUE = 11514 +ER_GRP_RPL_DATA_NOT_PROVIDED_BY_MEM = 11515 +ER_GRP_RPL_MEMBER_ALREADY_EXISTS = 11516 +ER_GRP_RPL_GRP_CHANGE_INFO_EXTRACT_ERROR = 11517 +ER_GRP_RPL_GTID_EXECUTED_EXTRACT_ERROR = 11518 +ER_GRP_RPL_GTID_SET_EXTRACT_ERROR = 11519 +ER_GRP_RPL_START_FAILED = 11520 +ER_GRP_RPL_MEMBER_VER_INCOMPATIBLE = 11521 +ER_GRP_RPL_TRANS_NOT_PRESENT_IN_GRP = 11522 +ER_GRP_RPL_TRANS_GREATER_THAN_GRP = 11523 +ER_GRP_RPL_MEMBER_VERSION_LOWER_THAN_GRP = 11524 +ER_GRP_RPL_LOCAL_GTID_SETS_PROCESS_ERROR = 11525 +ER_GRP_RPL_MEMBER_TRANS_GREATER_THAN_GRP = 11526 +ER_GRP_RPL_BLOCK_SIZE_DIFF_FROM_GRP = 11527 +ER_GRP_RPL_TRANS_WRITE_SET_EXTRACT_DIFF_FROM_GRP = 11528 +ER_GRP_RPL_MEMBER_CFG_INCOMPATIBLE_WITH_GRP_CFG = 11529 +ER_GRP_RPL_MEMBER_STOP_RPL_CHANNELS_ERROR = 11530 +ER_GRP_RPL_PURGE_APPLIER_LOGS = 11531 +ER_GRP_RPL_RESET_APPLIER_MODULE_LOGS_ERROR = 11532 +ER_GRP_RPL_APPLIER_THD_SETUP_ERROR = 11533 +ER_GRP_RPL_APPLIER_THD_START_ERROR = 11534 +ER_GRP_RPL_APPLIER_THD_STOP_ERROR = 11535 +ER_GRP_RPL_FETCH_TRANS_DATA_FAILED = 11536 +ER_GRP_RPL_SLAVE_IO_THD_PRIMARY_UNKNOWN = 11537 +ER_GRP_RPL_SALVE_IO_THD_ON_SECONDARY_MEMBER = 11538 +ER_GRP_RPL_SLAVE_SQL_THD_PRIMARY_UNKNOWN = 11539 +ER_GRP_RPL_SLAVE_SQL_THD_ON_SECONDARY_MEMBER = 11540 +ER_GRP_RPL_NEEDS_INNODB_TABLE = 11541 +ER_GRP_RPL_PRIMARY_KEY_NOT_DEFINED = 11542 +ER_GRP_RPL_FK_WITH_CASCADE_UNSUPPORTED = 11543 +ER_GRP_RPL_AUTO_INC_RESET = 11544 +ER_GRP_RPL_AUTO_INC_OFFSET_RESET = 11545 +ER_GRP_RPL_AUTO_INC_SET = 11546 +ER_GRP_RPL_AUTO_INC_OFFSET_SET = 11547 +ER_GRP_RPL_FETCH_TRANS_CONTEXT_FAILED = 11548 +ER_GRP_RPL_FETCH_FORMAT_DESC_LOG_EVENT_FAILED = 11549 +ER_GRP_RPL_FETCH_TRANS_CONTEXT_LOG_EVENT_FAILED = 11550 +ER_GRP_RPL_FETCH_SNAPSHOT_VERSION_FAILED = 11551 +ER_GRP_RPL_FETCH_GTID_LOG_EVENT_FAILED = 11552 +ER_GRP_RPL_UPDATE_SERV_CERTIFICATE_FAILED = 11553 +ER_GRP_RPL_ADD_GTID_INFO_WITH_LOCAL_GTID_FAILED = 11554 +ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_LOCAL_GTID_FAILED = 11555 +ER_GRP_RPL_NOTIFY_CERTIFICATION_OUTCOME_FAILED = 11556 +ER_GRP_RPL_ADD_GTID_INFO_WITH_REMOTE_GTID_FAILED = 11557 +ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_REMOTE_GTID_FAILED = 11558 +ER_GRP_RPL_FETCH_VIEW_CHANGE_LOG_EVENT_FAILED = 11559 +ER_GRP_RPL_CONTACT_WITH_SRV_FAILED = 11560 +ER_GRP_RPL_SRV_WAIT_TIME_OUT = 11561 +ER_GRP_RPL_FETCH_LOG_EVENT_FAILED = 11562 +ER_GRP_RPL_START_GRP_RPL_FAILED = 11563 +ER_GRP_RPL_CONN_INTERNAL_PLUGIN_FAIL = 11564 +ER_GRP_RPL_SUPER_READ_ON = 11565 +ER_GRP_RPL_SUPER_READ_OFF = 11566 +ER_GRP_RPL_KILLED_SESSION_ID = 11567 +ER_GRP_RPL_KILLED_FAILED_ID = 11568 +ER_GRP_RPL_INTERNAL_QUERY = 11569 +ER_GRP_RPL_COPY_FROM_EMPTY_STRING = 11570 +ER_GRP_RPL_QUERY_FAIL = 11571 +ER_GRP_RPL_CREATE_SESSION_UNABLE = 11572 +ER_GRP_RPL_MEMBER_NOT_FOUND = 11573 +ER_GRP_RPL_MAXIMUM_CONNECTION_RETRIES_REACHED = 11574 +ER_GRP_RPL_ALL_DONORS_LEFT_ABORT_RECOVERY = 11575 +ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_DONOR = 11576 +ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_ANOTHER_DONOR = 11577 +ER_GRP_RPL_NO_VALID_DONOR = 11578 +ER_GRP_RPL_CONFIG_RECOVERY = 11579 +ER_GRP_RPL_ESTABLISHING_CONN_GRP_REC_DONOR = 11580 +ER_GRP_RPL_CREATE_GRP_RPL_REC_CHANNEL = 11581 +ER_GRP_RPL_DONOR_SERVER_CONN = 11582 +ER_GRP_RPL_CHECK_STATUS_TABLE = 11583 +ER_GRP_RPL_STARTING_GRP_REC = 11584 +ER_GRP_RPL_DONOR_CONN_TERMINATION = 11585 +ER_GRP_RPL_STOPPING_GRP_REC = 11586 +ER_GRP_RPL_PURGE_REC = 11587 +ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_APPLIER = 11588 +ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_FAILOVER = 11589 +ER_GRP_RPL_FAILED_TO_NOTIFY_GRP_MEMBERSHIP_EVENT = 11590 +ER_GRP_RPL_FAILED_TO_BROADCAST_GRP_MEMBERSHIP_NOTIFICATION = 11591 +ER_GRP_RPL_FAILED_TO_BROADCAST_MEMBER_STATUS_NOTIFICATION = 11592 +ER_GRP_RPL_OOM_FAILED_TO_GENERATE_IDENTIFICATION_HASH = 11593 +ER_GRP_RPL_WRITE_IDENT_HASH_BASE64_ENCODING_FAILED = 11594 +ER_GRP_RPL_INVALID_BINLOG_FORMAT = 11595 +ER_GRP_RPL_BINLOG_CHECKSUM_SET = 11596 +ER_GRP_RPL_TRANS_WRITE_SET_EXTRACTION_NOT_SET = 11597 +ER_GRP_RPL_UNSUPPORTED_TRANS_ISOLATION = 11598 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_STOPPING = 11599 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_RECOVERING = 11600 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_ERROR_STATE = 11601 +ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_OFFLINE_MODE = 11602 +ER_GRP_RPL_MULTIPLE_CACHE_TYPE_NOT_SUPPORTED_FOR_SESSION = 11603 +ER_GRP_RPL_FAILED_TO_REINIT_BINLOG_CACHE_FOR_READ = 11604 +ER_GRP_RPL_FAILED_TO_CREATE_TRANS_CONTEXT = 11605 +ER_GRP_RPL_FAILED_TO_EXTRACT_TRANS_WRITE_SET = 11606 +ER_GRP_RPL_FAILED_TO_GATHER_TRANS_WRITE_SET = 11607 +ER_GRP_RPL_TRANS_SIZE_EXCEEDS_LIMIT = 11608 +ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_READ_FAILED = 11609 +ER_GRP_RPL_APPENDING_DATA_TO_INTERNAL_CACHE_FAILED = 11610 +ER_GRP_RPL_WRITE_TO_BINLOG_CACHE_FAILED = 11611 +ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_OUTCOME_NOTIFICTION = 11612 +ER_GRP_RPL_MSG_TOO_LONG_BROADCASTING_TRANS_FAILED = 11613 +ER_GRP_RPL_BROADCASTING_TRANS_TO_GRP_FAILED = 11614 +ER_GRP_RPL_ERROR_WHILE_WAITING_FOR_CONFLICT_DETECTION = 11615 +ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_WRITE_FAILED = 11616 +ER_GRP_RPL_FAILED_TO_CREATE_COMMIT_CACHE = 11617 +ER_GRP_RPL_REINIT_OF_COMMIT_CACHE_FOR_WRITE_FAILED = 11618 +ER_GRP_RPL_PREV_REC_SESSION_RUNNING = 11619 +ER_GRP_RPL_FATAL_REC_PROCESS = 11620 +ER_GRP_RPL_WHILE_STOPPING_REP_CHANNEL = 11621 +ER_GRP_RPL_UNABLE_TO_EVALUATE_APPLIER_STATUS = 11622 +ER_GRP_RPL_ONLY_ONE_SERVER_ALIVE = 11623 +ER_GRP_RPL_CERTIFICATION_REC_PROCESS = 11624 +ER_GRP_RPL_UNABLE_TO_ENSURE_EXECUTION_REC = 11625 +ER_GRP_RPL_WHILE_SENDING_MSG_REC = 11626 +ER_GRP_RPL_READ_UNABLE_FOR_SUPER_READ_ONLY = 11627 +ER_GRP_RPL_READ_UNABLE_FOR_READ_ONLY_SUPER_READ_ONLY = 11628 +ER_GRP_RPL_UNABLE_TO_RESET_SERVER_READ_MODE = 11629 +ER_GRP_RPL_UNABLE_TO_CERTIFY_PLUGIN_TRANS = 11630 +ER_GRP_RPL_UNBLOCK_CERTIFIED_TRANS = 11631 +ER_GRP_RPL_SERVER_WORKING_AS_SECONDARY = 11632 +ER_GRP_RPL_FAILED_TO_START_WITH_INVALID_SERVER_ID = 11633 +ER_GRP_RPL_FORCE_MEMBERS_MUST_BE_EMPTY = 11634 +ER_GRP_RPL_PLUGIN_STRUCT_INIT_NOT_POSSIBLE_ON_SERVER_START = 11635 +ER_GRP_RPL_FAILED_TO_ENABLE_SUPER_READ_ONLY_MODE = 11636 +ER_GRP_RPL_FAILED_TO_INIT_COMMUNICATION_ENGINE = 11637 +ER_GRP_RPL_FAILED_TO_START_ON_SECONDARY_WITH_ASYNC_CHANNELS = 11638 +ER_GRP_RPL_FAILED_TO_START_COMMUNICATION_ENGINE = 11639 +ER_GRP_RPL_TIMEOUT_ON_VIEW_AFTER_JOINING_GRP = 11640 +ER_GRP_RPL_FAILED_TO_CALL_GRP_COMMUNICATION_INTERFACE = 11641 +ER_GRP_RPL_MEMBER_SERVER_UUID_IS_INCOMPATIBLE_WITH_GRP = 11642 +ER_GRP_RPL_MEMBER_CONF_INFO = 11643 +ER_GRP_RPL_FAILED_TO_CONFIRM_IF_SERVER_LEFT_GRP = 11644 +ER_GRP_RPL_SERVER_IS_ALREADY_LEAVING = 11645 +ER_GRP_RPL_SERVER_ALREADY_LEFT = 11646 +ER_GRP_RPL_WAITING_FOR_VIEW_UPDATE = 11647 +ER_GRP_RPL_TIMEOUT_RECEIVING_VIEW_CHANGE_ON_SHUTDOWN = 11648 +ER_GRP_RPL_REQUESTING_NON_MEMBER_SERVER_TO_LEAVE = 11649 +ER_GRP_RPL_IS_STOPPING = 11650 +ER_GRP_RPL_IS_STOPPED = 11651 +ER_GRP_RPL_FAILED_TO_ENABLE_READ_ONLY_MODE_ON_SHUTDOWN = 11652 +ER_GRP_RPL_RECOVERY_MODULE_TERMINATION_TIMED_OUT_ON_SHUTDOWN = 11653 +ER_GRP_RPL_APPLIER_TERMINATION_TIMED_OUT_ON_SHUTDOWN = 11654 +ER_GRP_RPL_FAILED_TO_SHUTDOWN_REGISTRY_MODULE = 11655 +ER_GRP_RPL_FAILED_TO_INIT_HANDLER = 11656 +ER_GRP_RPL_FAILED_TO_REGISTER_SERVER_STATE_OBSERVER = 11657 +ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_STATE_OBSERVER = 11658 +ER_GRP_RPL_FAILED_TO_REGISTER_BINLOG_STATE_OBSERVER = 11659 +ER_GRP_RPL_FAILED_TO_START_ON_BOOT = 11660 +ER_GRP_RPL_FAILED_TO_STOP_ON_PLUGIN_UNINSTALL = 11661 +ER_GRP_RPL_FAILED_TO_UNREGISTER_SERVER_STATE_OBSERVER = 11662 +ER_GRP_RPL_FAILED_TO_UNREGISTER_TRANS_STATE_OBSERVER = 11663 +ER_GRP_RPL_FAILED_TO_UNREGISTER_BINLOG_STATE_OBSERVER = 11664 +ER_GRP_RPL_ALL_OBSERVERS_UNREGISTERED = 11665 +ER_GRP_RPL_FAILED_TO_PARSE_THE_GRP_NAME = 11666 +ER_GRP_RPL_FAILED_TO_GENERATE_SIDNO_FOR_GRP = 11667 +ER_GRP_RPL_APPLIER_NOT_STARTED_DUE_TO_RUNNING_PREV_SHUTDOWN = 11668 +ER_GRP_RPL_FAILED_TO_INIT_APPLIER_MODULE = 11669 +ER_GRP_RPL_APPLIER_INITIALIZED = 11670 +ER_GRP_RPL_COMMUNICATION_SSL_CONF_INFO = 11671 +ER_GRP_RPL_ABORTS_AS_SSL_NOT_SUPPORTED_BY_MYSQLD = 11672 +ER_GRP_RPL_SSL_DISABLED = 11673 +ER_GRP_RPL_UNABLE_TO_INIT_COMMUNICATION_ENGINE = 11674 +ER_GRP_RPL_BINLOG_DISABLED = 11675 +ER_GRP_RPL_GTID_MODE_OFF = 11676 +ER_GRP_RPL_LOG_SLAVE_UPDATES_NOT_SET = 11677 +ER_GRP_RPL_INVALID_TRANS_WRITE_SET_EXTRACTION_VALUE = 11678 +ER_GRP_RPL_RELAY_LOG_INFO_REPO_MUST_BE_TABLE = 11679 +ER_GRP_RPL_MASTER_INFO_REPO_MUST_BE_TABLE = 11680 +ER_GRP_RPL_INCORRECT_TYPE_SET_FOR_PARALLEL_APPLIER = 11681 +ER_GRP_RPL_SLAVE_PRESERVE_COMMIT_ORDER_NOT_SET = 11682 +ER_GRP_RPL_SINGLE_PRIM_MODE_NOT_ALLOWED_WITH_UPDATE_EVERYWHERE = 11683 +ER_GRP_RPL_MODULE_TERMINATE_ERROR = 11684 +ER_GRP_RPL_GRP_NAME_OPTION_MANDATORY = 11685 +ER_GRP_RPL_GRP_NAME_IS_TOO_LONG = 11686 +ER_GRP_RPL_GRP_NAME_IS_NOT_VALID_UUID = 11687 +ER_GRP_RPL_FLOW_CTRL_MIN_QUOTA_GREATER_THAN_MAX_QUOTA = 11688 +ER_GRP_RPL_FLOW_CTRL_MIN_RECOVERY_QUOTA_GREATER_THAN_MAX_QUOTA = 11689 +ER_GRP_RPL_FLOW_CTRL_MAX_QUOTA_SMALLER_THAN_MIN_QUOTAS = 11690 +ER_GRP_RPL_INVALID_SSL_RECOVERY_STRING = 11691 +ER_GRP_RPL_SUPPORTS_ONLY_ONE_FORCE_MEMBERS_SET = 11692 +ER_GRP_RPL_FORCE_MEMBERS_SET_UPDATE_NOT_ALLOWED = 11693 +ER_GRP_RPL_GRP_COMMUNICATION_INIT_WITH_CONF = 11694 +ER_GRP_RPL_UNKNOWN_GRP_RPL_APPLIER_PIPELINE_REQUESTED = 11695 +ER_GRP_RPL_FAILED_TO_BOOTSTRAP_EVENT_HANDLING_INFRASTRUCTURE = 11696 +ER_GRP_RPL_APPLIER_HANDLER_NOT_INITIALIZED = 11697 +ER_GRP_RPL_APPLIER_HANDLER_IS_IN_USE = 11698 +ER_GRP_RPL_APPLIER_HANDLER_ROLE_IS_IN_USE = 11699 +ER_GRP_RPL_FAILED_TO_INIT_APPLIER_HANDLER = 11700 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_INIT_SESSION_THREAD = 11701 +ER_GRP_RPL_SQL_SERVICE_COMM_SESSION_NOT_INITIALIZED = 11702 +ER_GRP_RPL_SQL_SERVICE_SERVER_SESSION_KILLED = 11703 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_RUN_SQL_QUERY = 11704 +ER_GRP_RPL_SQL_SERVICE_SERVER_INTERNAL_FAILURE = 11705 +ER_GRP_RPL_SQL_SERVICE_RETRIES_EXCEEDED_ON_SESSION_STATE = 11706 +ER_GRP_RPL_SQL_SERVICE_FAILED_TO_FETCH_SECURITY_CTX = 11707 +ER_GRP_RPL_SQL_SERVICE_SERVER_ACCESS_DENIED_FOR_USER = 11708 +ER_GRP_RPL_SQL_SERVICE_MAX_CONN_ERROR_FROM_SERVER = 11709 +ER_GRP_RPL_SQL_SERVICE_SERVER_ERROR_ON_CONN = 11710 +ER_GRP_RPL_UNREACHABLE_MAJORITY_TIMEOUT_FOR_MEMBER = 11711 +ER_GRP_RPL_SERVER_SET_TO_READ_ONLY_DUE_TO_ERRORS = 11712 +ER_GRP_RPL_GMS_LISTENER_FAILED_TO_LOG_NOTIFICATION = 11713 +ER_GRP_RPL_GRP_COMMUNICATION_ENG_INIT_FAILED = 11714 +ER_GRP_RPL_SET_GRP_COMMUNICATION_ENG_LOGGER_FAILED = 11715 +ER_GRP_RPL_DEBUG_OPTIONS = 11716 +ER_GRP_RPL_INVALID_DEBUG_OPTIONS = 11717 +ER_GRP_RPL_EXIT_GRP_GCS_ERROR = 11718 +ER_GRP_RPL_GRP_MEMBER_OFFLINE = 11719 +ER_GRP_RPL_GCS_INTERFACE_ERROR = 11720 +ER_GRP_RPL_FORCE_MEMBER_VALUE_SET_ERROR = 11721 +ER_GRP_RPL_FORCE_MEMBER_VALUE_SET = 11722 +ER_GRP_RPL_FORCE_MEMBER_VALUE_TIME_OUT = 11723 +ER_GRP_RPL_BROADCAST_COMMIT_MSSG_TOO_BIG = 11724 +ER_GRP_RPL_SEND_STATS_ERROR = 11725 +ER_GRP_RPL_MEMBER_STATS_INFO = 11726 +ER_GRP_RPL_FLOW_CONTROL_STATS = 11727 +ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT = 11728 +ER_GRP_RPL_PIPELINE_CREATE_FAILED = 11729 +ER_GRP_RPL_PIPELINE_REINIT_FAILED_WRITE = 11730 +ER_GRP_RPL_UNABLE_TO_CONVERT_EVENT_TO_PACKET = 11731 +ER_GRP_RPL_PIPELINE_FLUSH_FAIL = 11732 +ER_GRP_RPL_PIPELINE_REINIT_FAILED_READ = 11733 +ER_GRP_RPL_STOP_REP_CHANNEL = 11734 +ER_GRP_RPL_GCS_GR_ERROR_MSG = 11735 +ER_GRP_RPL_SLAVE_IO_THREAD_UNBLOCKED = 11736 +ER_GRP_RPL_SLAVE_IO_THREAD_ERROR_OUT = 11737 +ER_GRP_RPL_SLAVE_APPLIER_THREAD_UNBLOCKED = 11738 +ER_GRP_RPL_SLAVE_APPLIER_THREAD_ERROR_OUT = 11739 +ER_LDAP_AUTH_FAILED_TO_CREATE_OR_GET_CONNECTION = 11740 +ER_LDAP_AUTH_DEINIT_FAILED = 11741 +ER_LDAP_AUTH_SKIPPING_USER_GROUP_SEARCH = 11742 +ER_LDAP_AUTH_POOL_DISABLE_MAX_SIZE_ZERO = 11743 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT_CREATOR = 11744 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT = 11745 +ER_LDAP_AUTH_TLS_CONF = 11746 +ER_LDAP_AUTH_TLS_CONNECTION = 11747 +ER_LDAP_AUTH_CONN_POOL_NOT_CREATED = 11748 +ER_LDAP_AUTH_CONN_POOL_INITIALIZING = 11749 +ER_LDAP_AUTH_CONN_POOL_DEINITIALIZING = 11750 +ER_LDAP_AUTH_ZERO_MAX_POOL_SIZE_UNCHANGED = 11751 +ER_LDAP_AUTH_POOL_REINITIALIZING = 11752 +ER_LDAP_AUTH_FAILED_TO_WRITE_PACKET = 11753 +ER_LDAP_AUTH_SETTING_USERNAME = 11754 +ER_LDAP_AUTH_USER_AUTH_DATA = 11755 +ER_LDAP_AUTH_INFO_FOR_USER = 11756 +ER_LDAP_AUTH_USER_GROUP_SEARCH_INFO = 11757 +ER_LDAP_AUTH_GRP_SEARCH_SPECIAL_HDL = 11758 +ER_LDAP_AUTH_GRP_IS_FULL_DN = 11759 +ER_LDAP_AUTH_USER_NOT_FOUND_IN_ANY_GRP = 11760 +ER_LDAP_AUTH_USER_FOUND_IN_MANY_GRPS = 11761 +ER_LDAP_AUTH_USER_HAS_MULTIPLE_GRP_NAMES = 11762 +ER_LDAP_AUTH_SEARCHED_USER_GRP_NAME = 11763 +ER_LDAP_AUTH_OBJECT_CREATE_TIMESTAMP = 11764 +ER_LDAP_AUTH_CERTIFICATE_NAME = 11765 +ER_LDAP_AUTH_FAILED_TO_POOL_DEINIT = 11766 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_RECONSTRUCTING = 11767 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_INIT_STATE = 11768 +ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_DEINIT_STATE = 11769 +ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_POOL_IN_RECONSTRUCT_STATE = 11770 +ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_NOT_READY_POOL = 11771 +ER_LDAP_AUTH_FAILED_TO_GET_CONNECTION_AS_PLUGIN_NOT_READY = 11772 +ER_LDAP_AUTH_CONNECTION_POOL_INIT_FAILED = 11773 +ER_LDAP_AUTH_MAX_ALLOWED_CONNECTION_LIMIT_HIT = 11774 +ER_LDAP_AUTH_MAX_POOL_SIZE_SET_FAILED = 11775 +ER_LDAP_AUTH_PLUGIN_FAILED_TO_READ_PACKET = 11776 +ER_LDAP_AUTH_CREATING_LDAP_CONNECTION = 11777 +ER_LDAP_AUTH_GETTING_CONNECTION_FROM_POOL = 11778 +ER_LDAP_AUTH_RETURNING_CONNECTION_TO_POOL = 11779 +ER_LDAP_AUTH_SEARCH_USER_GROUP_ATTR_NOT_FOUND = 11780 +ER_LDAP_AUTH_LDAP_INFO_NULL = 11781 +ER_LDAP_AUTH_FREEING_CONNECTION = 11782 +ER_LDAP_AUTH_CONNECTION_PUSHED_TO_POOL = 11783 +ER_LDAP_AUTH_CONNECTION_CREATOR_ENTER = 11784 +ER_LDAP_AUTH_STARTING_TLS = 11785 +ER_LDAP_AUTH_CONNECTION_GET_LDAP_INFO_NULL = 11786 +ER_LDAP_AUTH_DELETING_CONNECTION_KEY = 11787 +ER_LDAP_AUTH_POOLED_CONNECTION_KEY = 11788 +ER_LDAP_AUTH_CREATE_CONNECTION_KEY = 11789 +ER_LDAP_AUTH_COMMUNICATION_HOST_INFO = 11790 +ER_LDAP_AUTH_METHOD_TO_CLIENT = 11791 +ER_LDAP_AUTH_SASL_REQUEST_FROM_CLIENT = 11792 +ER_LDAP_AUTH_SASL_PROCESS_SASL = 11793 +ER_LDAP_AUTH_SASL_BIND_SUCCESS_INFO = 11794 +ER_LDAP_AUTH_STARTED_FOR_USER = 11795 +ER_LDAP_AUTH_DISTINGUISHED_NAME = 11796 +ER_LDAP_AUTH_INIT_FAILED = 11797 +ER_LDAP_AUTH_OR_GROUP_RETRIEVAL_FAILED = 11798 +ER_LDAP_AUTH_USER_GROUP_SEARCH_FAILED = 11799 +ER_LDAP_AUTH_USER_BIND_FAILED = 11800 +ER_LDAP_AUTH_POOL_GET_FAILED_TO_CREATE_CONNECTION = 11801 +ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_CONNECTION = 11802 +ER_LDAP_AUTH_FAILED_TO_ESTABLISH_TLS_CONNECTION = 11803 +ER_LDAP_AUTH_FAILED_TO_SEARCH_DN = 11804 +ER_LDAP_AUTH_CONNECTION_POOL_REINIT_ENTER = 11805 +ER_SYSTEMD_NOTIFY_PATH_TOO_LONG = 11806 +ER_SYSTEMD_NOTIFY_CONNECT_FAILED = 11807 +ER_SYSTEMD_NOTIFY_WRITE_FAILED = 11808 +ER_FOUND_MISSING_GTIDS = 11809 +ER_PID_FILE_PRIV_DIRECTORY_INSECURE = 11810 +ER_CANT_CHECK_PID_PATH = 11811 +ER_VALIDATE_PWD_STATUS_VAR_REGISTRATION_FAILED = 11812 +ER_VALIDATE_PWD_STATUS_VAR_UNREGISTRATION_FAILED = 11813 +ER_VALIDATE_PWD_DICT_FILE_OPEN_FAILED = 11814 +ER_VALIDATE_PWD_COULD_BE_NULL = 11815 +ER_VALIDATE_PWD_STRING_CONV_TO_LOWERCASE_FAILED = 11816 +ER_VALIDATE_PWD_STRING_CONV_TO_BUFFER_FAILED = 11817 +ER_VALIDATE_PWD_STRING_HANDLER_MEM_ALLOCATION_FAILED = 11818 +ER_VALIDATE_PWD_STRONG_POLICY_DICT_FILE_UNSPECIFIED = 11819 +ER_VALIDATE_PWD_CONVERT_TO_BUFFER_FAILED = 11820 +ER_VALIDATE_PWD_VARIABLE_REGISTRATION_FAILED = 11821 +ER_VALIDATE_PWD_VARIABLE_UNREGISTRATION_FAILED = 11822 +ER_KEYRING_MIGRATION_EXTRA_OPTIONS = 11823 +OBSOLETE_ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 11824 +ER_IB_MSG_0 = 11825 +ER_IB_MSG_1 = 11826 +ER_IB_MSG_2 = 11827 +ER_IB_MSG_3 = 11828 +ER_IB_MSG_4 = 11829 +ER_IB_MSG_5 = 11830 +ER_IB_MSG_6 = 11831 +ER_IB_MSG_7 = 11832 +ER_IB_MSG_8 = 11833 +ER_IB_MSG_9 = 11834 +ER_IB_MSG_10 = 11835 +ER_IB_MSG_11 = 11836 +ER_IB_MSG_12 = 11837 +ER_IB_MSG_13 = 11838 +ER_IB_MSG_14 = 11839 +ER_IB_MSG_15 = 11840 +ER_IB_MSG_16 = 11841 +ER_IB_MSG_17 = 11842 +ER_IB_MSG_18 = 11843 +ER_IB_MSG_19 = 11844 +ER_IB_MSG_20 = 11845 +ER_IB_MSG_21 = 11846 +ER_IB_MSG_22 = 11847 +ER_IB_MSG_23 = 11848 +ER_IB_MSG_24 = 11849 +ER_IB_MSG_25 = 11850 +ER_IB_MSG_26 = 11851 +ER_IB_MSG_27 = 11852 +ER_IB_MSG_28 = 11853 +ER_IB_MSG_29 = 11854 +ER_IB_MSG_30 = 11855 +ER_IB_MSG_31 = 11856 +ER_IB_MSG_32 = 11857 +ER_IB_MSG_33 = 11858 +ER_IB_MSG_34 = 11859 +ER_IB_MSG_35 = 11860 +ER_IB_MSG_36 = 11861 +ER_IB_MSG_37 = 11862 +ER_IB_MSG_38 = 11863 +ER_IB_MSG_39 = 11864 +ER_IB_MSG_40 = 11865 +ER_IB_MSG_41 = 11866 +ER_IB_MSG_42 = 11867 +ER_IB_MSG_43 = 11868 +ER_IB_MSG_44 = 11869 +ER_IB_MSG_45 = 11870 +ER_IB_MSG_46 = 11871 +ER_IB_MSG_47 = 11872 +ER_IB_MSG_48 = 11873 +ER_IB_MSG_49 = 11874 +ER_IB_MSG_50 = 11875 +ER_IB_MSG_51 = 11876 +ER_IB_MSG_52 = 11877 +ER_IB_MSG_53 = 11878 +ER_IB_MSG_54 = 11879 +ER_IB_MSG_55 = 11880 +ER_IB_MSG_56 = 11881 +ER_IB_MSG_57 = 11882 +ER_IB_MSG_58 = 11883 +ER_IB_MSG_59 = 11884 +ER_IB_MSG_60 = 11885 +ER_IB_MSG_61 = 11886 +ER_IB_MSG_62 = 11887 +ER_IB_MSG_63 = 11888 +ER_IB_MSG_64 = 11889 +ER_IB_MSG_65 = 11890 +ER_IB_MSG_66 = 11891 +ER_IB_MSG_67 = 11892 +ER_IB_MSG_68 = 11893 +ER_IB_MSG_69 = 11894 +ER_IB_MSG_70 = 11895 +ER_IB_MSG_71 = 11896 +ER_IB_MSG_72 = 11897 +ER_IB_MSG_73 = 11898 +ER_IB_MSG_74 = 11899 +ER_IB_MSG_75 = 11900 +ER_IB_MSG_76 = 11901 +ER_IB_MSG_77 = 11902 +ER_IB_MSG_78 = 11903 +ER_IB_MSG_79 = 11904 +ER_IB_MSG_80 = 11905 +ER_IB_MSG_81 = 11906 +ER_IB_MSG_82 = 11907 +ER_IB_MSG_83 = 11908 +ER_IB_MSG_84 = 11909 +ER_IB_MSG_85 = 11910 +ER_IB_MSG_86 = 11911 +ER_IB_MSG_87 = 11912 +ER_IB_MSG_88 = 11913 +ER_IB_MSG_89 = 11914 +ER_IB_MSG_90 = 11915 +ER_IB_MSG_91 = 11916 +ER_IB_MSG_92 = 11917 +ER_IB_MSG_93 = 11918 +ER_IB_MSG_94 = 11919 +ER_IB_MSG_95 = 11920 +ER_IB_MSG_96 = 11921 +ER_IB_MSG_97 = 11922 +ER_IB_MSG_98 = 11923 +ER_IB_MSG_99 = 11924 +ER_IB_MSG_100 = 11925 +ER_IB_MSG_101 = 11926 +ER_IB_MSG_102 = 11927 +ER_IB_MSG_103 = 11928 +ER_IB_MSG_104 = 11929 +ER_IB_MSG_105 = 11930 +ER_IB_MSG_106 = 11931 +ER_IB_MSG_107 = 11932 +ER_IB_MSG_108 = 11933 +ER_IB_MSG_109 = 11934 +ER_IB_MSG_110 = 11935 +ER_IB_MSG_111 = 11936 +ER_IB_MSG_112 = 11937 +ER_IB_MSG_113 = 11938 +ER_IB_MSG_114 = 11939 +ER_IB_MSG_115 = 11940 +ER_IB_MSG_116 = 11941 +ER_IB_MSG_117 = 11942 +ER_IB_MSG_118 = 11943 +ER_IB_MSG_119 = 11944 +ER_IB_MSG_120 = 11945 +ER_IB_MSG_121 = 11946 +ER_IB_MSG_122 = 11947 +ER_IB_MSG_123 = 11948 +ER_IB_MSG_124 = 11949 +ER_IB_MSG_125 = 11950 +ER_IB_MSG_126 = 11951 +ER_IB_MSG_127 = 11952 +ER_IB_MSG_128 = 11953 +ER_IB_MSG_129 = 11954 +ER_IB_MSG_130 = 11955 +ER_IB_MSG_131 = 11956 +ER_IB_MSG_132 = 11957 +ER_IB_MSG_133 = 11958 +ER_IB_MSG_134 = 11959 +ER_IB_MSG_135 = 11960 +ER_IB_MSG_136 = 11961 +ER_IB_MSG_137 = 11962 +ER_IB_MSG_138 = 11963 +ER_IB_MSG_139 = 11964 +ER_IB_MSG_140 = 11965 +ER_IB_MSG_141 = 11966 +ER_IB_MSG_142 = 11967 +ER_IB_MSG_143 = 11968 +ER_IB_MSG_144 = 11969 +ER_IB_MSG_145 = 11970 +ER_IB_MSG_146 = 11971 +ER_IB_MSG_147 = 11972 +ER_IB_MSG_148 = 11973 +ER_IB_MSG_149 = 11974 +ER_IB_MSG_150 = 11975 +ER_IB_MSG_151 = 11976 +ER_IB_MSG_152 = 11977 +ER_IB_MSG_153 = 11978 +ER_IB_MSG_154 = 11979 +ER_IB_MSG_155 = 11980 +ER_IB_MSG_156 = 11981 +ER_IB_MSG_157 = 11982 +ER_IB_MSG_158 = 11983 +ER_IB_MSG_159 = 11984 +ER_IB_MSG_160 = 11985 +ER_IB_MSG_161 = 11986 +ER_IB_MSG_162 = 11987 +ER_IB_MSG_163 = 11988 +ER_IB_MSG_164 = 11989 +ER_IB_MSG_165 = 11990 +ER_IB_MSG_166 = 11991 +ER_IB_MSG_167 = 11992 +ER_IB_MSG_168 = 11993 +ER_IB_MSG_169 = 11994 +ER_IB_MSG_170 = 11995 +ER_IB_MSG_171 = 11996 +ER_IB_MSG_172 = 11997 +ER_IB_MSG_173 = 11998 +ER_IB_MSG_174 = 11999 +ER_IB_MSG_175 = 12000 +ER_IB_MSG_176 = 12001 +ER_IB_MSG_177 = 12002 +ER_IB_MSG_178 = 12003 +ER_IB_MSG_179 = 12004 +ER_IB_MSG_180 = 12005 +ER_IB_MSG_181 = 12006 +ER_IB_MSG_182 = 12007 +ER_IB_MSG_183 = 12008 +ER_IB_MSG_184 = 12009 +ER_IB_MSG_185 = 12010 +ER_IB_MSG_186 = 12011 +ER_IB_MSG_187 = 12012 +ER_IB_MSG_188 = 12013 +ER_IB_MSG_189 = 12014 +ER_IB_MSG_190 = 12015 +ER_IB_MSG_191 = 12016 +ER_IB_MSG_192 = 12017 +ER_IB_MSG_193 = 12018 +ER_IB_MSG_194 = 12019 +ER_IB_MSG_195 = 12020 +ER_IB_MSG_196 = 12021 +ER_IB_MSG_197 = 12022 +ER_IB_MSG_198 = 12023 +ER_IB_MSG_199 = 12024 +ER_IB_MSG_200 = 12025 +ER_IB_MSG_201 = 12026 +ER_IB_MSG_202 = 12027 +ER_IB_MSG_203 = 12028 +ER_IB_MSG_204 = 12029 +ER_IB_MSG_205 = 12030 +ER_IB_MSG_206 = 12031 +ER_IB_MSG_207 = 12032 +ER_IB_MSG_208 = 12033 +ER_IB_MSG_209 = 12034 +ER_IB_MSG_210 = 12035 +ER_IB_MSG_211 = 12036 +ER_IB_MSG_212 = 12037 +ER_IB_MSG_213 = 12038 +ER_IB_MSG_214 = 12039 +ER_IB_MSG_215 = 12040 +ER_IB_MSG_216 = 12041 +ER_IB_MSG_217 = 12042 +ER_IB_MSG_218 = 12043 +ER_IB_MSG_219 = 12044 +ER_IB_MSG_220 = 12045 +ER_IB_MSG_221 = 12046 +ER_IB_MSG_222 = 12047 +ER_IB_MSG_223 = 12048 +ER_IB_MSG_224 = 12049 +ER_IB_MSG_225 = 12050 +ER_IB_MSG_226 = 12051 +ER_IB_MSG_227 = 12052 +ER_IB_MSG_228 = 12053 +ER_IB_MSG_229 = 12054 +ER_IB_MSG_230 = 12055 +ER_IB_MSG_231 = 12056 +ER_IB_MSG_232 = 12057 +ER_IB_MSG_233 = 12058 +ER_IB_MSG_234 = 12059 +ER_IB_MSG_235 = 12060 +ER_IB_MSG_236 = 12061 +ER_IB_MSG_237 = 12062 +ER_IB_MSG_238 = 12063 +ER_IB_MSG_239 = 12064 +ER_IB_MSG_240 = 12065 +ER_IB_MSG_241 = 12066 +ER_IB_MSG_242 = 12067 +ER_IB_MSG_243 = 12068 +ER_IB_MSG_244 = 12069 +ER_IB_MSG_245 = 12070 +ER_IB_MSG_246 = 12071 +ER_IB_MSG_247 = 12072 +ER_IB_MSG_248 = 12073 +ER_IB_MSG_249 = 12074 +ER_IB_MSG_250 = 12075 +ER_IB_MSG_251 = 12076 +ER_IB_MSG_252 = 12077 +ER_IB_MSG_253 = 12078 +ER_IB_MSG_254 = 12079 +ER_IB_MSG_255 = 12080 +ER_IB_MSG_256 = 12081 +ER_IB_MSG_257 = 12082 +ER_IB_MSG_258 = 12083 +ER_IB_MSG_259 = 12084 +ER_IB_MSG_260 = 12085 +ER_IB_MSG_261 = 12086 +ER_IB_MSG_262 = 12087 +ER_IB_MSG_263 = 12088 +ER_IB_MSG_264 = 12089 +ER_IB_MSG_265 = 12090 +ER_IB_MSG_266 = 12091 +ER_IB_MSG_267 = 12092 +ER_IB_MSG_268 = 12093 +ER_IB_MSG_269 = 12094 +ER_IB_MSG_270 = 12095 +ER_IB_MSG_271 = 12096 +ER_IB_MSG_272 = 12097 +ER_IB_MSG_273 = 12098 +ER_IB_MSG_274 = 12099 +ER_IB_MSG_275 = 12100 +ER_IB_MSG_276 = 12101 +ER_IB_MSG_277 = 12102 +ER_IB_MSG_278 = 12103 +ER_IB_MSG_279 = 12104 +ER_IB_MSG_280 = 12105 +ER_IB_MSG_281 = 12106 +ER_IB_MSG_282 = 12107 +ER_IB_MSG_283 = 12108 +ER_IB_MSG_284 = 12109 +ER_IB_MSG_285 = 12110 +ER_IB_MSG_286 = 12111 +ER_IB_MSG_287 = 12112 +ER_IB_MSG_288 = 12113 +ER_IB_MSG_289 = 12114 +ER_IB_MSG_290 = 12115 +ER_IB_MSG_291 = 12116 +ER_IB_MSG_292 = 12117 +ER_IB_MSG_293 = 12118 +ER_IB_MSG_294 = 12119 +ER_IB_MSG_295 = 12120 +ER_IB_MSG_296 = 12121 +ER_IB_MSG_297 = 12122 +ER_IB_MSG_298 = 12123 +ER_IB_MSG_299 = 12124 +ER_IB_MSG_300 = 12125 +ER_IB_MSG_301 = 12126 +ER_IB_MSG_302 = 12127 +ER_IB_MSG_303 = 12128 +ER_IB_MSG_304 = 12129 +ER_IB_MSG_305 = 12130 +ER_IB_MSG_306 = 12131 +ER_IB_MSG_307 = 12132 +ER_IB_MSG_308 = 12133 +ER_IB_MSG_309 = 12134 +ER_IB_MSG_310 = 12135 +ER_IB_MSG_311 = 12136 +ER_IB_MSG_312 = 12137 +ER_IB_MSG_313 = 12138 +ER_IB_MSG_314 = 12139 +ER_IB_MSG_315 = 12140 +ER_IB_MSG_316 = 12141 +ER_IB_MSG_317 = 12142 +ER_IB_MSG_318 = 12143 +ER_IB_MSG_319 = 12144 +ER_IB_MSG_320 = 12145 +ER_IB_MSG_321 = 12146 +ER_IB_MSG_322 = 12147 +ER_IB_MSG_323 = 12148 +ER_IB_MSG_324 = 12149 +ER_IB_MSG_325 = 12150 +ER_IB_MSG_326 = 12151 +ER_IB_MSG_327 = 12152 +ER_IB_MSG_328 = 12153 +ER_IB_MSG_329 = 12154 +ER_IB_MSG_330 = 12155 +ER_IB_MSG_331 = 12156 +ER_IB_MSG_332 = 12157 +ER_IB_MSG_333 = 12158 +ER_IB_MSG_334 = 12159 +ER_IB_MSG_335 = 12160 +ER_IB_MSG_336 = 12161 +ER_IB_MSG_337 = 12162 +ER_IB_MSG_338 = 12163 +ER_IB_MSG_339 = 12164 +ER_IB_MSG_340 = 12165 +ER_IB_MSG_341 = 12166 +ER_IB_MSG_342 = 12167 +ER_IB_MSG_343 = 12168 +ER_IB_MSG_344 = 12169 +ER_IB_MSG_345 = 12170 +ER_IB_MSG_346 = 12171 +ER_IB_MSG_347 = 12172 +ER_IB_MSG_348 = 12173 +ER_IB_MSG_349 = 12174 +ER_IB_MSG_350 = 12175 +ER_IB_MSG_351 = 12176 +ER_IB_MSG_352 = 12177 +ER_IB_MSG_353 = 12178 +ER_IB_MSG_354 = 12179 +ER_IB_MSG_355 = 12180 +ER_IB_MSG_356 = 12181 +ER_IB_MSG_357 = 12182 +ER_IB_MSG_358 = 12183 +ER_IB_MSG_359 = 12184 +ER_IB_MSG_360 = 12185 +ER_IB_MSG_361 = 12186 +ER_IB_MSG_362 = 12187 +ER_IB_MSG_363 = 12188 +ER_IB_MSG_364 = 12189 +ER_IB_MSG_365 = 12190 +ER_IB_MSG_366 = 12191 +ER_IB_MSG_367 = 12192 +ER_IB_MSG_368 = 12193 +ER_IB_MSG_369 = 12194 +ER_IB_MSG_370 = 12195 +ER_IB_MSG_371 = 12196 +ER_IB_MSG_372 = 12197 +ER_IB_MSG_373 = 12198 +ER_IB_MSG_374 = 12199 +ER_IB_MSG_375 = 12200 +ER_IB_MSG_376 = 12201 +ER_IB_MSG_377 = 12202 +ER_IB_MSG_378 = 12203 +ER_IB_MSG_379 = 12204 +ER_IB_MSG_380 = 12205 +ER_IB_MSG_381 = 12206 +ER_IB_MSG_382 = 12207 +ER_IB_MSG_383 = 12208 +ER_IB_MSG_384 = 12209 +ER_IB_MSG_385 = 12210 +ER_IB_MSG_386 = 12211 +ER_IB_MSG_387 = 12212 +ER_IB_MSG_388 = 12213 +ER_IB_MSG_389 = 12214 +ER_IB_MSG_390 = 12215 +ER_IB_MSG_391 = 12216 +ER_IB_MSG_392 = 12217 +ER_IB_MSG_393 = 12218 +ER_IB_MSG_394 = 12219 +ER_IB_MSG_395 = 12220 +ER_IB_MSG_396 = 12221 +ER_IB_MSG_397 = 12222 +ER_IB_MSG_398 = 12223 +ER_IB_MSG_399 = 12224 +ER_IB_MSG_400 = 12225 +ER_IB_MSG_401 = 12226 +ER_IB_MSG_402 = 12227 +ER_IB_MSG_403 = 12228 +ER_IB_MSG_404 = 12229 +ER_IB_MSG_405 = 12230 +ER_IB_MSG_406 = 12231 +ER_IB_MSG_407 = 12232 +ER_IB_MSG_408 = 12233 +ER_IB_MSG_409 = 12234 +ER_IB_MSG_410 = 12235 +ER_IB_MSG_411 = 12236 +ER_IB_MSG_412 = 12237 +ER_IB_MSG_413 = 12238 +ER_IB_MSG_414 = 12239 +ER_IB_MSG_415 = 12240 +ER_IB_MSG_416 = 12241 +ER_IB_MSG_417 = 12242 +ER_IB_MSG_418 = 12243 +ER_IB_MSG_419 = 12244 +ER_IB_MSG_420 = 12245 +ER_IB_MSG_421 = 12246 +ER_IB_MSG_422 = 12247 +ER_IB_MSG_423 = 12248 +ER_IB_MSG_424 = 12249 +ER_IB_MSG_425 = 12250 +ER_IB_MSG_426 = 12251 +ER_IB_MSG_427 = 12252 +ER_IB_MSG_428 = 12253 +ER_IB_MSG_429 = 12254 +ER_IB_MSG_430 = 12255 +ER_IB_MSG_431 = 12256 +ER_IB_MSG_432 = 12257 +ER_IB_MSG_433 = 12258 +ER_IB_MSG_434 = 12259 +ER_IB_MSG_435 = 12260 +ER_IB_MSG_436 = 12261 +ER_IB_MSG_437 = 12262 +ER_IB_MSG_438 = 12263 +ER_IB_MSG_439 = 12264 +ER_IB_MSG_440 = 12265 +ER_IB_MSG_441 = 12266 +ER_IB_MSG_442 = 12267 +ER_IB_MSG_443 = 12268 +ER_IB_MSG_444 = 12269 +ER_IB_MSG_445 = 12270 +ER_IB_MSG_446 = 12271 +ER_IB_MSG_447 = 12272 +ER_IB_MSG_448 = 12273 +ER_IB_MSG_449 = 12274 +ER_IB_MSG_450 = 12275 +ER_IB_MSG_451 = 12276 +ER_IB_MSG_452 = 12277 +ER_IB_MSG_453 = 12278 +ER_IB_MSG_454 = 12279 +ER_IB_MSG_455 = 12280 +ER_IB_MSG_456 = 12281 +ER_IB_MSG_457 = 12282 +ER_IB_MSG_458 = 12283 +ER_IB_MSG_459 = 12284 +ER_IB_MSG_460 = 12285 +ER_IB_MSG_461 = 12286 +ER_IB_MSG_462 = 12287 +ER_IB_MSG_463 = 12288 +ER_IB_MSG_464 = 12289 +ER_IB_MSG_465 = 12290 +ER_IB_MSG_466 = 12291 +ER_IB_MSG_467 = 12292 +ER_IB_MSG_468 = 12293 +ER_IB_MSG_469 = 12294 +ER_IB_MSG_470 = 12295 +ER_IB_MSG_471 = 12296 +ER_IB_MSG_472 = 12297 +ER_IB_MSG_473 = 12298 +ER_IB_MSG_474 = 12299 +ER_IB_MSG_475 = 12300 +ER_IB_MSG_476 = 12301 +ER_IB_MSG_477 = 12302 +ER_IB_MSG_478 = 12303 +ER_IB_MSG_479 = 12304 +ER_IB_MSG_480 = 12305 +ER_IB_MSG_481 = 12306 +ER_IB_MSG_482 = 12307 +ER_IB_MSG_483 = 12308 +ER_IB_MSG_484 = 12309 +ER_IB_MSG_485 = 12310 +ER_IB_MSG_486 = 12311 +ER_IB_MSG_487 = 12312 +ER_IB_MSG_488 = 12313 +ER_IB_MSG_489 = 12314 +ER_IB_MSG_490 = 12315 +ER_IB_MSG_491 = 12316 +ER_IB_MSG_492 = 12317 +ER_IB_MSG_493 = 12318 +ER_IB_MSG_494 = 12319 +ER_IB_MSG_495 = 12320 +ER_IB_MSG_496 = 12321 +ER_IB_MSG_497 = 12322 +ER_IB_MSG_498 = 12323 +ER_IB_MSG_499 = 12324 +ER_IB_MSG_500 = 12325 +ER_IB_MSG_501 = 12326 +ER_IB_MSG_502 = 12327 +ER_IB_MSG_503 = 12328 +ER_IB_MSG_504 = 12329 +ER_IB_MSG_505 = 12330 +ER_IB_MSG_506 = 12331 +ER_IB_MSG_507 = 12332 +ER_IB_MSG_508 = 12333 +ER_IB_MSG_509 = 12334 +ER_IB_MSG_510 = 12335 +ER_IB_MSG_511 = 12336 +ER_IB_MSG_512 = 12337 +ER_IB_MSG_513 = 12338 +ER_IB_MSG_514 = 12339 +ER_IB_MSG_515 = 12340 +ER_IB_MSG_516 = 12341 +ER_IB_MSG_517 = 12342 +ER_IB_MSG_518 = 12343 +ER_IB_MSG_519 = 12344 +ER_IB_MSG_520 = 12345 +ER_IB_MSG_521 = 12346 +ER_IB_MSG_522 = 12347 +ER_IB_MSG_523 = 12348 +ER_IB_MSG_524 = 12349 +ER_IB_MSG_525 = 12350 +ER_IB_MSG_526 = 12351 +ER_IB_MSG_527 = 12352 +ER_IB_MSG_528 = 12353 +ER_IB_MSG_529 = 12354 +ER_IB_MSG_530 = 12355 +ER_IB_MSG_531 = 12356 +ER_IB_MSG_532 = 12357 +ER_IB_MSG_533 = 12358 +ER_IB_MSG_534 = 12359 +ER_IB_MSG_535 = 12360 +ER_IB_MSG_536 = 12361 +ER_IB_MSG_537 = 12362 +ER_IB_MSG_538 = 12363 +ER_IB_MSG_539 = 12364 +ER_IB_MSG_540 = 12365 +ER_IB_MSG_541 = 12366 +ER_IB_MSG_542 = 12367 +ER_IB_MSG_543 = 12368 +ER_IB_MSG_544 = 12369 +ER_IB_MSG_545 = 12370 +ER_IB_MSG_546 = 12371 +ER_IB_MSG_547 = 12372 +ER_IB_MSG_548 = 12373 +ER_IB_MSG_549 = 12374 +ER_IB_MSG_550 = 12375 +ER_IB_MSG_551 = 12376 +ER_IB_MSG_552 = 12377 +ER_IB_MSG_553 = 12378 +ER_IB_MSG_554 = 12379 +ER_IB_MSG_555 = 12380 +ER_IB_MSG_556 = 12381 +ER_IB_MSG_557 = 12382 +ER_IB_MSG_558 = 12383 +ER_IB_MSG_559 = 12384 +ER_IB_MSG_560 = 12385 +ER_IB_MSG_561 = 12386 +ER_IB_MSG_562 = 12387 +ER_IB_MSG_563 = 12388 +ER_IB_MSG_564 = 12389 +ER_IB_MSG_565 = 12390 +ER_IB_MSG_566 = 12391 +ER_IB_MSG_567 = 12392 +ER_IB_MSG_568 = 12393 +ER_IB_MSG_569 = 12394 +ER_IB_MSG_570 = 12395 +ER_IB_MSG_571 = 12396 +ER_IB_MSG_572 = 12397 +ER_IB_MSG_573 = 12398 +ER_IB_MSG_574 = 12399 +ER_IB_MSG_575 = 12400 +ER_IB_MSG_576 = 12401 +ER_IB_MSG_577 = 12402 +ER_IB_MSG_578 = 12403 +ER_IB_MSG_579 = 12404 +ER_IB_MSG_580 = 12405 +ER_IB_MSG_581 = 12406 +ER_IB_MSG_582 = 12407 +ER_IB_MSG_583 = 12408 +ER_IB_MSG_584 = 12409 +ER_IB_MSG_585 = 12410 +ER_IB_MSG_586 = 12411 +ER_IB_MSG_587 = 12412 +ER_IB_MSG_588 = 12413 +ER_IB_MSG_589 = 12414 +ER_IB_MSG_590 = 12415 +ER_IB_MSG_591 = 12416 +ER_IB_MSG_592 = 12417 +ER_IB_MSG_593 = 12418 +ER_IB_MSG_594 = 12419 +ER_IB_MSG_595 = 12420 +ER_IB_MSG_596 = 12421 +ER_IB_MSG_597 = 12422 +ER_IB_MSG_598 = 12423 +ER_IB_MSG_599 = 12424 +ER_IB_MSG_600 = 12425 +ER_IB_MSG_601 = 12426 +ER_IB_MSG_602 = 12427 +ER_IB_MSG_603 = 12428 +ER_IB_MSG_604 = 12429 +ER_IB_MSG_605 = 12430 +ER_IB_MSG_606 = 12431 +ER_IB_MSG_607 = 12432 +ER_IB_MSG_608 = 12433 +ER_IB_MSG_609 = 12434 +ER_IB_MSG_610 = 12435 +ER_IB_MSG_611 = 12436 +ER_IB_MSG_612 = 12437 +ER_IB_MSG_613 = 12438 +ER_IB_MSG_614 = 12439 +ER_IB_MSG_615 = 12440 +ER_IB_MSG_616 = 12441 +ER_IB_MSG_617 = 12442 +ER_IB_MSG_618 = 12443 +ER_IB_MSG_619 = 12444 +ER_IB_MSG_620 = 12445 +ER_IB_MSG_621 = 12446 +ER_IB_MSG_622 = 12447 +ER_IB_MSG_623 = 12448 +ER_IB_MSG_624 = 12449 +ER_IB_MSG_625 = 12450 +ER_IB_MSG_626 = 12451 +ER_IB_MSG_627 = 12452 +ER_IB_MSG_628 = 12453 +ER_IB_MSG_629 = 12454 +ER_IB_MSG_630 = 12455 +ER_IB_MSG_631 = 12456 +ER_IB_MSG_632 = 12457 +ER_IB_MSG_633 = 12458 +ER_IB_MSG_634 = 12459 +ER_IB_MSG_635 = 12460 +ER_IB_MSG_636 = 12461 +ER_IB_MSG_637 = 12462 +ER_IB_MSG_638 = 12463 +ER_IB_MSG_639 = 12464 +ER_IB_MSG_640 = 12465 +ER_IB_MSG_641 = 12466 +ER_IB_MSG_642 = 12467 +ER_IB_MSG_643 = 12468 +ER_IB_MSG_644 = 12469 +ER_IB_MSG_645 = 12470 +ER_IB_MSG_646 = 12471 +ER_IB_MSG_647 = 12472 +ER_IB_MSG_648 = 12473 +ER_IB_MSG_649 = 12474 +ER_IB_MSG_650 = 12475 +ER_IB_MSG_651 = 12476 +ER_IB_MSG_652 = 12477 +ER_IB_MSG_653 = 12478 +ER_IB_MSG_654 = 12479 +ER_IB_MSG_655 = 12480 +ER_IB_MSG_656 = 12481 +ER_IB_MSG_657 = 12482 +ER_IB_MSG_658 = 12483 +ER_IB_MSG_659 = 12484 +ER_IB_MSG_660 = 12485 +ER_IB_MSG_661 = 12486 +ER_IB_MSG_662 = 12487 +ER_IB_MSG_663 = 12488 +ER_IB_MSG_664 = 12489 +ER_IB_MSG_665 = 12490 +ER_IB_MSG_666 = 12491 +ER_IB_MSG_667 = 12492 +ER_IB_MSG_668 = 12493 +ER_IB_MSG_669 = 12494 +ER_IB_MSG_670 = 12495 +ER_IB_MSG_671 = 12496 +ER_IB_MSG_672 = 12497 +ER_IB_MSG_673 = 12498 +ER_IB_MSG_674 = 12499 +ER_IB_MSG_675 = 12500 +ER_IB_MSG_676 = 12501 +ER_IB_MSG_677 = 12502 +ER_IB_MSG_678 = 12503 +ER_IB_MSG_679 = 12504 +ER_IB_MSG_680 = 12505 +ER_IB_MSG_681 = 12506 +ER_IB_MSG_682 = 12507 +ER_IB_MSG_683 = 12508 +ER_IB_MSG_684 = 12509 +ER_IB_MSG_685 = 12510 +ER_IB_MSG_686 = 12511 +ER_IB_MSG_687 = 12512 +ER_IB_MSG_688 = 12513 +ER_IB_MSG_689 = 12514 +ER_IB_MSG_690 = 12515 +ER_IB_MSG_691 = 12516 +ER_IB_MSG_692 = 12517 +ER_IB_MSG_693 = 12518 +ER_IB_MSG_694 = 12519 +ER_IB_MSG_695 = 12520 +ER_IB_MSG_696 = 12521 +ER_IB_MSG_697 = 12522 +ER_IB_MSG_698 = 12523 +ER_IB_MSG_699 = 12524 +ER_IB_MSG_700 = 12525 +ER_IB_MSG_701 = 12526 +ER_IB_MSG_702 = 12527 +ER_IB_MSG_703 = 12528 +ER_IB_MSG_704 = 12529 +ER_IB_MSG_705 = 12530 +ER_IB_MSG_706 = 12531 +ER_IB_MSG_707 = 12532 +ER_IB_MSG_708 = 12533 +ER_IB_MSG_709 = 12534 +ER_IB_MSG_710 = 12535 +ER_IB_MSG_711 = 12536 +ER_IB_MSG_712 = 12537 +ER_IB_MSG_713 = 12538 +ER_IB_MSG_714 = 12539 +ER_IB_MSG_715 = 12540 +ER_IB_MSG_716 = 12541 +ER_IB_MSG_717 = 12542 +ER_IB_MSG_718 = 12543 +ER_IB_MSG_719 = 12544 +ER_IB_MSG_720 = 12545 +ER_IB_MSG_721 = 12546 +ER_IB_MSG_722 = 12547 +ER_IB_MSG_723 = 12548 +ER_IB_MSG_724 = 12549 +ER_IB_MSG_725 = 12550 +ER_IB_MSG_726 = 12551 +ER_IB_MSG_727 = 12552 +ER_IB_MSG_728 = 12553 +ER_IB_MSG_729 = 12554 +ER_IB_MSG_730 = 12555 +ER_IB_MSG_731 = 12556 +ER_IB_MSG_732 = 12557 +ER_IB_MSG_733 = 12558 +ER_IB_MSG_734 = 12559 +ER_IB_MSG_735 = 12560 +ER_IB_MSG_736 = 12561 +ER_IB_MSG_737 = 12562 +ER_IB_MSG_738 = 12563 +ER_IB_MSG_739 = 12564 +ER_IB_MSG_740 = 12565 +ER_IB_MSG_741 = 12566 +ER_IB_MSG_742 = 12567 +ER_IB_MSG_743 = 12568 +ER_IB_MSG_744 = 12569 +ER_IB_MSG_745 = 12570 +ER_IB_MSG_746 = 12571 +ER_IB_MSG_747 = 12572 +ER_IB_MSG_748 = 12573 +ER_IB_MSG_749 = 12574 +ER_IB_MSG_750 = 12575 +ER_IB_MSG_751 = 12576 +ER_IB_MSG_752 = 12577 +ER_IB_MSG_753 = 12578 +ER_IB_MSG_754 = 12579 +ER_IB_MSG_755 = 12580 +ER_IB_MSG_756 = 12581 +ER_IB_MSG_757 = 12582 +ER_IB_MSG_758 = 12583 +ER_IB_MSG_759 = 12584 +ER_IB_MSG_760 = 12585 +ER_IB_MSG_761 = 12586 +ER_IB_MSG_762 = 12587 +ER_IB_MSG_763 = 12588 +ER_IB_MSG_764 = 12589 +ER_IB_MSG_765 = 12590 +ER_IB_MSG_766 = 12591 +ER_IB_MSG_767 = 12592 +ER_IB_MSG_768 = 12593 +ER_IB_MSG_769 = 12594 +ER_IB_MSG_770 = 12595 +ER_IB_MSG_771 = 12596 +ER_IB_MSG_772 = 12597 +ER_IB_MSG_773 = 12598 +ER_IB_MSG_774 = 12599 +ER_IB_MSG_775 = 12600 +ER_IB_MSG_776 = 12601 +ER_IB_MSG_777 = 12602 +ER_IB_MSG_778 = 12603 +ER_IB_MSG_779 = 12604 +ER_IB_MSG_780 = 12605 +ER_IB_MSG_781 = 12606 +ER_IB_MSG_782 = 12607 +ER_IB_MSG_783 = 12608 +ER_IB_MSG_784 = 12609 +ER_IB_MSG_785 = 12610 +ER_IB_MSG_786 = 12611 +ER_IB_MSG_787 = 12612 +ER_IB_MSG_788 = 12613 +ER_IB_MSG_789 = 12614 +ER_IB_MSG_790 = 12615 +ER_IB_MSG_791 = 12616 +ER_IB_MSG_792 = 12617 +ER_IB_MSG_793 = 12618 +ER_IB_MSG_794 = 12619 +ER_IB_MSG_795 = 12620 +ER_IB_MSG_796 = 12621 +ER_IB_MSG_797 = 12622 +ER_IB_MSG_798 = 12623 +ER_IB_MSG_799 = 12624 +ER_IB_MSG_800 = 12625 +ER_IB_MSG_801 = 12626 +ER_IB_MSG_802 = 12627 +ER_IB_MSG_803 = 12628 +ER_IB_MSG_804 = 12629 +ER_IB_MSG_805 = 12630 +ER_IB_MSG_806 = 12631 +ER_IB_MSG_807 = 12632 +ER_IB_MSG_808 = 12633 +ER_IB_MSG_809 = 12634 +ER_IB_MSG_810 = 12635 +ER_IB_MSG_811 = 12636 +ER_IB_MSG_812 = 12637 +ER_IB_MSG_813 = 12638 +ER_IB_MSG_814 = 12639 +ER_IB_MSG_815 = 12640 +ER_IB_MSG_816 = 12641 +ER_IB_MSG_817 = 12642 +ER_IB_MSG_818 = 12643 +ER_IB_MSG_819 = 12644 +ER_IB_MSG_820 = 12645 +ER_IB_MSG_821 = 12646 +ER_IB_MSG_822 = 12647 +ER_IB_MSG_823 = 12648 +ER_IB_MSG_824 = 12649 +ER_IB_MSG_825 = 12650 +ER_IB_MSG_826 = 12651 +ER_IB_MSG_827 = 12652 +ER_IB_MSG_828 = 12653 +ER_IB_MSG_829 = 12654 +ER_IB_MSG_830 = 12655 +ER_IB_MSG_831 = 12656 +ER_IB_MSG_832 = 12657 +ER_IB_MSG_833 = 12658 +ER_IB_MSG_834 = 12659 +ER_IB_MSG_835 = 12660 +ER_IB_MSG_836 = 12661 +ER_IB_MSG_837 = 12662 +ER_IB_MSG_838 = 12663 +ER_IB_MSG_839 = 12664 +ER_IB_MSG_840 = 12665 +ER_IB_MSG_841 = 12666 +ER_IB_MSG_842 = 12667 +ER_IB_MSG_843 = 12668 +ER_IB_MSG_844 = 12669 +ER_IB_MSG_845 = 12670 +ER_IB_MSG_846 = 12671 +ER_IB_MSG_847 = 12672 +ER_IB_MSG_848 = 12673 +ER_IB_MSG_849 = 12674 +ER_IB_MSG_850 = 12675 +ER_IB_MSG_851 = 12676 +ER_IB_MSG_852 = 12677 +ER_IB_MSG_853 = 12678 +ER_IB_MSG_854 = 12679 +ER_IB_MSG_855 = 12680 +ER_IB_MSG_856 = 12681 +ER_IB_MSG_857 = 12682 +ER_IB_MSG_858 = 12683 +ER_IB_MSG_859 = 12684 +ER_IB_MSG_860 = 12685 +ER_IB_MSG_861 = 12686 +ER_IB_MSG_862 = 12687 +ER_IB_MSG_863 = 12688 +ER_IB_MSG_864 = 12689 +ER_IB_MSG_865 = 12690 +ER_IB_MSG_866 = 12691 +ER_IB_MSG_867 = 12692 +ER_IB_MSG_868 = 12693 +ER_IB_MSG_869 = 12694 +ER_IB_MSG_870 = 12695 +ER_IB_MSG_871 = 12696 +ER_IB_MSG_872 = 12697 +ER_IB_MSG_873 = 12698 +ER_IB_MSG_874 = 12699 +ER_IB_MSG_875 = 12700 +ER_IB_MSG_876 = 12701 +ER_IB_MSG_877 = 12702 +ER_IB_MSG_878 = 12703 +ER_IB_MSG_879 = 12704 +ER_IB_MSG_880 = 12705 +ER_IB_MSG_881 = 12706 +ER_IB_MSG_882 = 12707 +ER_IB_MSG_883 = 12708 +ER_IB_MSG_884 = 12709 +ER_IB_MSG_885 = 12710 +ER_IB_MSG_886 = 12711 +ER_IB_MSG_887 = 12712 +ER_IB_MSG_888 = 12713 +ER_IB_MSG_889 = 12714 +ER_IB_MSG_890 = 12715 +ER_IB_MSG_891 = 12716 +ER_IB_MSG_892 = 12717 +ER_IB_MSG_893 = 12718 +ER_IB_MSG_894 = 12719 +ER_IB_MSG_895 = 12720 +ER_IB_MSG_896 = 12721 +ER_IB_MSG_897 = 12722 +ER_IB_MSG_898 = 12723 +ER_IB_MSG_899 = 12724 +ER_IB_MSG_900 = 12725 +ER_IB_MSG_901 = 12726 +ER_IB_MSG_902 = 12727 +ER_IB_MSG_903 = 12728 +ER_IB_MSG_904 = 12729 +ER_IB_MSG_905 = 12730 +ER_IB_MSG_906 = 12731 +ER_IB_MSG_907 = 12732 +ER_IB_MSG_908 = 12733 +ER_IB_MSG_909 = 12734 +ER_IB_MSG_910 = 12735 +ER_IB_MSG_911 = 12736 +ER_IB_MSG_912 = 12737 +ER_IB_MSG_913 = 12738 +ER_IB_MSG_914 = 12739 +ER_IB_MSG_915 = 12740 +ER_IB_MSG_916 = 12741 +ER_IB_MSG_917 = 12742 +ER_IB_MSG_918 = 12743 +ER_IB_MSG_919 = 12744 +ER_IB_MSG_920 = 12745 +ER_IB_MSG_921 = 12746 +ER_IB_MSG_922 = 12747 +ER_IB_MSG_923 = 12748 +ER_IB_MSG_924 = 12749 +ER_IB_MSG_925 = 12750 +ER_IB_MSG_926 = 12751 +ER_IB_MSG_927 = 12752 +ER_IB_MSG_928 = 12753 +ER_IB_MSG_929 = 12754 +ER_IB_MSG_930 = 12755 +ER_IB_MSG_931 = 12756 +ER_IB_MSG_932 = 12757 +ER_IB_MSG_933 = 12758 +ER_IB_MSG_934 = 12759 +ER_IB_MSG_935 = 12760 +ER_IB_MSG_936 = 12761 +ER_IB_MSG_937 = 12762 +ER_IB_MSG_938 = 12763 +ER_IB_MSG_939 = 12764 +ER_IB_MSG_940 = 12765 +ER_IB_MSG_941 = 12766 +ER_IB_MSG_942 = 12767 +ER_IB_MSG_943 = 12768 +ER_IB_MSG_944 = 12769 +ER_IB_MSG_945 = 12770 +ER_IB_MSG_946 = 12771 +ER_IB_MSG_947 = 12772 +ER_IB_MSG_948 = 12773 +ER_IB_MSG_949 = 12774 +ER_IB_MSG_950 = 12775 +ER_IB_MSG_951 = 12776 +ER_IB_MSG_952 = 12777 +ER_IB_MSG_953 = 12778 +ER_IB_MSG_954 = 12779 +ER_IB_MSG_955 = 12780 +ER_IB_MSG_956 = 12781 +ER_IB_MSG_957 = 12782 +ER_IB_MSG_958 = 12783 +ER_IB_MSG_959 = 12784 +ER_IB_MSG_960 = 12785 +ER_IB_MSG_961 = 12786 +ER_IB_MSG_962 = 12787 +ER_IB_MSG_963 = 12788 +ER_IB_MSG_964 = 12789 +ER_IB_MSG_965 = 12790 +ER_IB_MSG_966 = 12791 +ER_IB_MSG_967 = 12792 +ER_IB_MSG_968 = 12793 +ER_IB_MSG_969 = 12794 +ER_IB_MSG_970 = 12795 +ER_IB_MSG_971 = 12796 +ER_IB_MSG_972 = 12797 +ER_IB_MSG_973 = 12798 +ER_IB_MSG_974 = 12799 +ER_IB_MSG_975 = 12800 +ER_IB_MSG_976 = 12801 +ER_IB_MSG_977 = 12802 +ER_IB_MSG_978 = 12803 +ER_IB_MSG_979 = 12804 +ER_IB_MSG_980 = 12805 +ER_IB_MSG_981 = 12806 +ER_IB_MSG_982 = 12807 +ER_IB_MSG_983 = 12808 +ER_IB_MSG_984 = 12809 +ER_IB_MSG_985 = 12810 +ER_IB_MSG_986 = 12811 +ER_IB_MSG_987 = 12812 +ER_IB_MSG_988 = 12813 +ER_IB_MSG_989 = 12814 +ER_IB_MSG_990 = 12815 +ER_IB_MSG_991 = 12816 +ER_IB_MSG_992 = 12817 +ER_IB_MSG_993 = 12818 +ER_IB_MSG_994 = 12819 +ER_IB_MSG_995 = 12820 +ER_IB_MSG_996 = 12821 +ER_IB_MSG_997 = 12822 +ER_IB_MSG_998 = 12823 +ER_IB_MSG_999 = 12824 +ER_IB_MSG_1000 = 12825 +ER_IB_MSG_1001 = 12826 +ER_IB_MSG_1002 = 12827 +ER_IB_MSG_1003 = 12828 +ER_IB_MSG_1004 = 12829 +ER_IB_MSG_1005 = 12830 +ER_IB_MSG_1006 = 12831 +ER_IB_MSG_1007 = 12832 +ER_IB_MSG_1008 = 12833 +ER_IB_MSG_1009 = 12834 +ER_IB_MSG_1010 = 12835 +ER_IB_MSG_1011 = 12836 +ER_IB_MSG_1012 = 12837 +ER_IB_MSG_1013 = 12838 +ER_IB_MSG_1014 = 12839 +ER_IB_MSG_1015 = 12840 +ER_IB_MSG_1016 = 12841 +ER_IB_MSG_1017 = 12842 +ER_IB_MSG_1018 = 12843 +ER_IB_MSG_1019 = 12844 +ER_IB_MSG_1020 = 12845 +ER_IB_MSG_1021 = 12846 +ER_IB_MSG_1022 = 12847 +ER_IB_MSG_1023 = 12848 +ER_IB_MSG_1024 = 12849 +ER_IB_MSG_1025 = 12850 +ER_IB_MSG_1026 = 12851 +ER_IB_MSG_1027 = 12852 +ER_IB_MSG_1028 = 12853 +ER_IB_MSG_1029 = 12854 +ER_IB_MSG_1030 = 12855 +ER_IB_MSG_1031 = 12856 +ER_IB_MSG_1032 = 12857 +ER_IB_MSG_1033 = 12858 +ER_IB_MSG_1034 = 12859 +ER_IB_MSG_1035 = 12860 +ER_IB_MSG_1036 = 12861 +ER_IB_MSG_1037 = 12862 +ER_IB_MSG_1038 = 12863 +ER_IB_MSG_1039 = 12864 +ER_IB_MSG_1040 = 12865 +ER_IB_MSG_1041 = 12866 +ER_IB_MSG_1042 = 12867 +ER_IB_MSG_1043 = 12868 +ER_IB_MSG_1044 = 12869 +ER_IB_MSG_1045 = 12870 +ER_IB_MSG_1046 = 12871 +ER_IB_MSG_1047 = 12872 +ER_IB_MSG_1048 = 12873 +ER_IB_MSG_1049 = 12874 +ER_IB_MSG_1050 = 12875 +ER_IB_MSG_1051 = 12876 +ER_IB_MSG_1052 = 12877 +ER_IB_MSG_1053 = 12878 +ER_IB_MSG_1054 = 12879 +ER_IB_MSG_1055 = 12880 +ER_IB_MSG_1056 = 12881 +ER_IB_MSG_1057 = 12882 +ER_IB_MSG_1058 = 12883 +ER_IB_MSG_1059 = 12884 +ER_IB_MSG_1060 = 12885 +ER_IB_MSG_1061 = 12886 +ER_IB_MSG_1062 = 12887 +ER_IB_MSG_1063 = 12888 +ER_IB_MSG_1064 = 12889 +ER_IB_MSG_1065 = 12890 +ER_IB_MSG_1066 = 12891 +ER_IB_MSG_1067 = 12892 +ER_IB_MSG_1068 = 12893 +ER_IB_MSG_1069 = 12894 +ER_IB_MSG_1070 = 12895 +ER_IB_MSG_1071 = 12896 +ER_IB_MSG_1072 = 12897 +ER_IB_MSG_1073 = 12898 +ER_IB_MSG_1074 = 12899 +ER_IB_MSG_1075 = 12900 +ER_IB_MSG_1076 = 12901 +ER_IB_MSG_1077 = 12902 +ER_IB_MSG_1078 = 12903 +ER_IB_MSG_1079 = 12904 +ER_IB_MSG_1080 = 12905 +ER_IB_MSG_1081 = 12906 +ER_IB_MSG_1082 = 12907 +ER_IB_MSG_1083 = 12908 +ER_IB_MSG_1084 = 12909 +ER_IB_MSG_1085 = 12910 +ER_IB_MSG_1086 = 12911 +ER_IB_MSG_1087 = 12912 +ER_IB_MSG_1088 = 12913 +ER_IB_MSG_1089 = 12914 +ER_IB_MSG_1090 = 12915 +ER_IB_MSG_1091 = 12916 +ER_IB_MSG_1092 = 12917 +ER_IB_MSG_1093 = 12918 +ER_IB_MSG_1094 = 12919 +ER_IB_MSG_1095 = 12920 +ER_IB_MSG_1096 = 12921 +ER_IB_MSG_1097 = 12922 +ER_IB_MSG_1098 = 12923 +ER_IB_MSG_1099 = 12924 +ER_IB_MSG_1100 = 12925 +ER_IB_MSG_1101 = 12926 +ER_IB_MSG_1102 = 12927 +ER_IB_MSG_1103 = 12928 +ER_IB_MSG_1104 = 12929 +ER_IB_MSG_1105 = 12930 +ER_IB_MSG_1106 = 12931 +ER_IB_MSG_1107 = 12932 +ER_IB_MSG_1108 = 12933 +ER_IB_MSG_1109 = 12934 +ER_IB_MSG_1110 = 12935 +ER_IB_MSG_1111 = 12936 +ER_IB_MSG_1112 = 12937 +ER_IB_MSG_1113 = 12938 +ER_IB_MSG_1114 = 12939 +ER_IB_MSG_1115 = 12940 +ER_IB_MSG_1116 = 12941 +ER_IB_MSG_1117 = 12942 +ER_IB_MSG_1118 = 12943 +ER_IB_MSG_1119 = 12944 +ER_IB_MSG_1120 = 12945 +ER_IB_MSG_1121 = 12946 +ER_IB_MSG_1122 = 12947 +ER_IB_MSG_1123 = 12948 +ER_IB_MSG_1124 = 12949 +ER_IB_MSG_1125 = 12950 +ER_IB_MSG_1126 = 12951 +ER_IB_MSG_1127 = 12952 +ER_IB_MSG_1128 = 12953 +ER_IB_MSG_1129 = 12954 +ER_IB_MSG_1130 = 12955 +ER_IB_MSG_1131 = 12956 +ER_IB_MSG_1132 = 12957 +ER_IB_MSG_1133 = 12958 +ER_IB_MSG_1134 = 12959 +ER_IB_MSG_1135 = 12960 +ER_IB_MSG_1136 = 12961 +ER_IB_MSG_1137 = 12962 +ER_IB_MSG_1138 = 12963 +ER_IB_MSG_1139 = 12964 +ER_IB_MSG_1140 = 12965 +ER_IB_MSG_1141 = 12966 +ER_IB_MSG_1142 = 12967 +ER_IB_MSG_1143 = 12968 +ER_IB_MSG_1144 = 12969 +ER_IB_MSG_1145 = 12970 +ER_IB_MSG_1146 = 12971 +ER_IB_MSG_1147 = 12972 +ER_IB_MSG_1148 = 12973 +ER_IB_MSG_1149 = 12974 +ER_IB_MSG_1150 = 12975 +ER_IB_MSG_1151 = 12976 +ER_IB_MSG_1152 = 12977 +ER_IB_MSG_1153 = 12978 +ER_IB_MSG_1154 = 12979 +ER_IB_MSG_1155 = 12980 +ER_IB_MSG_1156 = 12981 +ER_IB_MSG_1157 = 12982 +ER_IB_MSG_1158 = 12983 +ER_IB_MSG_1159 = 12984 +ER_IB_MSG_1160 = 12985 +ER_IB_MSG_1161 = 12986 +ER_IB_MSG_1162 = 12987 +ER_IB_MSG_1163 = 12988 +ER_IB_MSG_1164 = 12989 +ER_IB_MSG_1165 = 12990 +ER_IB_MSG_1166 = 12991 +ER_IB_MSG_1167 = 12992 +ER_IB_MSG_1168 = 12993 +ER_IB_MSG_1169 = 12994 +ER_IB_MSG_1170 = 12995 +ER_IB_MSG_1171 = 12996 +ER_IB_MSG_1172 = 12997 +ER_IB_MSG_1173 = 12998 +ER_IB_MSG_1174 = 12999 +ER_IB_MSG_1175 = 13000 +ER_IB_MSG_1176 = 13001 +ER_IB_MSG_1177 = 13002 +ER_IB_MSG_1178 = 13003 +ER_IB_MSG_1179 = 13004 +ER_IB_MSG_1180 = 13005 +ER_IB_MSG_1181 = 13006 +ER_IB_MSG_1182 = 13007 +ER_IB_MSG_1183 = 13008 +ER_IB_MSG_1184 = 13009 +ER_IB_MSG_1185 = 13010 +ER_IB_MSG_1186 = 13011 +ER_IB_MSG_1187 = 13012 +ER_IB_MSG_1188 = 13013 +ER_IB_MSG_1189 = 13014 +ER_IB_MSG_1190 = 13015 +ER_IB_MSG_1191 = 13016 +ER_IB_MSG_1192 = 13017 +ER_IB_MSG_1193 = 13018 +ER_IB_MSG_1194 = 13019 +ER_IB_MSG_1195 = 13020 +ER_IB_MSG_1196 = 13021 +ER_IB_MSG_1197 = 13022 +ER_IB_MSG_1198 = 13023 +ER_IB_MSG_1199 = 13024 +ER_IB_MSG_1200 = 13025 +ER_IB_MSG_1201 = 13026 +ER_IB_MSG_1202 = 13027 +ER_IB_MSG_1203 = 13028 +ER_IB_MSG_1204 = 13029 +ER_IB_MSG_1205 = 13030 +ER_IB_MSG_1206 = 13031 +ER_IB_MSG_1207 = 13032 +ER_IB_MSG_1208 = 13033 +ER_IB_MSG_1209 = 13034 +ER_IB_MSG_1210 = 13035 +ER_IB_MSG_1211 = 13036 +ER_IB_MSG_1212 = 13037 +ER_IB_MSG_1213 = 13038 +ER_IB_MSG_1214 = 13039 +ER_IB_MSG_1215 = 13040 +ER_IB_MSG_1216 = 13041 +ER_IB_MSG_1217 = 13042 +ER_IB_MSG_1218 = 13043 +ER_IB_MSG_1219 = 13044 +ER_IB_MSG_1220 = 13045 +ER_IB_MSG_1221 = 13046 +ER_IB_MSG_1222 = 13047 +ER_IB_MSG_1223 = 13048 +ER_IB_MSG_1224 = 13049 +ER_IB_MSG_1225 = 13050 +ER_IB_MSG_1226 = 13051 +ER_IB_MSG_1227 = 13052 +ER_IB_MSG_1228 = 13053 +ER_IB_MSG_1229 = 13054 +ER_IB_MSG_1230 = 13055 +ER_IB_MSG_1231 = 13056 +ER_IB_MSG_1232 = 13057 +ER_IB_MSG_1233 = 13058 +ER_IB_MSG_1234 = 13059 +ER_IB_MSG_1235 = 13060 +ER_IB_MSG_1236 = 13061 +ER_IB_MSG_1237 = 13062 +ER_IB_MSG_1238 = 13063 +ER_IB_MSG_1239 = 13064 +ER_IB_MSG_1240 = 13065 +ER_IB_MSG_1241 = 13066 +ER_IB_MSG_1242 = 13067 +ER_IB_MSG_1243 = 13068 +ER_IB_MSG_1244 = 13069 +ER_IB_MSG_1245 = 13070 +ER_IB_MSG_1246 = 13071 +ER_IB_MSG_1247 = 13072 +ER_IB_MSG_1248 = 13073 +ER_IB_MSG_1249 = 13074 +ER_IB_MSG_1250 = 13075 +ER_IB_MSG_1251 = 13076 +ER_IB_MSG_1252 = 13077 +ER_IB_MSG_1253 = 13078 +ER_IB_MSG_1254 = 13079 +ER_IB_MSG_1255 = 13080 +ER_IB_MSG_1256 = 13081 +ER_IB_MSG_1257 = 13082 +ER_IB_MSG_1258 = 13083 +ER_IB_MSG_1259 = 13084 +ER_IB_MSG_1260 = 13085 +ER_IB_MSG_1261 = 13086 +ER_IB_MSG_1262 = 13087 +ER_IB_MSG_1263 = 13088 +ER_IB_MSG_1264 = 13089 +ER_IB_MSG_1265 = 13090 +ER_IB_MSG_1266 = 13091 +ER_IB_MSG_1267 = 13092 +ER_IB_MSG_1268 = 13093 +ER_IB_MSG_1269 = 13094 +ER_IB_MSG_1270 = 13095 +ER_RPL_SLAVE_SQL_THREAD_STOP_CMD_EXEC_TIMEOUT = 13096 +ER_RPL_SLAVE_IO_THREAD_STOP_CMD_EXEC_TIMEOUT = 13097 +ER_RPL_GTID_UNSAFE_STMT_ON_NON_TRANS_TABLE = 13098 +ER_RPL_GTID_UNSAFE_STMT_CREATE_SELECT = 13099 +ER_RPL_GTID_UNSAFE_STMT_ON_TEMPORARY_TABLE = 13100 +ER_BINLOG_ROW_VALUE_OPTION_IGNORED = 13101 +ER_BINLOG_USE_V1_ROW_EVENTS_IGNORED = 13102 +ER_BINLOG_ROW_VALUE_OPTION_USED_ONLY_FOR_AFTER_IMAGES = 13103 +ER_CONNECTION_ABORTED = 13104 +ER_NORMAL_SERVER_SHUTDOWN = 13105 +ER_KEYRING_MIGRATE_FAILED = 13106 +ER_GRP_RPL_LOWER_CASE_TABLE_NAMES_DIFF_FROM_GRP = 13107 +ER_OOM_SAVE_GTIDS = 13108 +ER_LCTN_NOT_FOUND = 13109 +ER_REGEXP_INVALID_CAPTURE_GROUP_NAME = 13110 +ER_COMPONENT_FILTER_WRONG_VALUE = 13111 +ER_XPLUGIN_FAILED_TO_STOP_SERVICES = 13112 +ER_INCONSISTENT_ERROR = 13113 +ER_SERVER_MASTER_FATAL_ERROR_READING_BINLOG = 13114 +ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 13115 +ER_SLAVE_CREATE_EVENT_FAILURE = 13116 +ER_SLAVE_FATAL_ERROR = 13117 +ER_SLAVE_HEARTBEAT_FAILURE = 13118 +ER_SLAVE_INCIDENT = 13119 +ER_SLAVE_MASTER_COM_FAILURE = 13120 +ER_SLAVE_RELAY_LOG_READ_FAILURE = 13121 +ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 13122 +ER_SERVER_SLAVE_MI_INIT_REPOSITORY = 13123 +ER_SERVER_SLAVE_RLI_INIT_REPOSITORY = 13124 +ER_SERVER_NET_PACKET_TOO_LARGE = 13125 +ER_SERVER_NO_SYSTEM_TABLE_ACCESS = 13126 +ER_SERVER_UNKNOWN_ERROR = 13127 +ER_SERVER_UNKNOWN_SYSTEM_VARIABLE = 13128 +ER_SERVER_NO_SESSION_TO_SEND_TO = 13129 +ER_SERVER_NEW_ABORTING_CONNECTION = 13130 +ER_SERVER_OUT_OF_SORTMEMORY = 13131 +ER_SERVER_RECORD_FILE_FULL = 13132 +ER_SERVER_DISK_FULL_NOWAIT = 13133 +ER_SERVER_HANDLER_ERROR = 13134 +ER_SERVER_NOT_FORM_FILE = 13135 +ER_SERVER_CANT_OPEN_FILE = 13136 +ER_SERVER_FILE_NOT_FOUND = 13137 +ER_SERVER_FILE_USED = 13138 +ER_SERVER_CANNOT_LOAD_FROM_TABLE_V2 = 13139 +ER_ERROR_INFO_FROM_DA = 13140 +ER_SERVER_TABLE_CHECK_FAILED = 13141 +ER_SERVER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 13142 +ER_SERVER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 13143 +ER_SERVER_ACL_TABLE_ERROR = 13144 +ER_SERVER_SLAVE_INIT_QUERY_FAILED = 13145 +ER_SERVER_SLAVE_CONVERSION_FAILED = 13146 +ER_SERVER_SLAVE_IGNORED_TABLE = 13147 +ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 13148 +ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 13149 +ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 13150 +ER_SERVER_TEST_MESSAGE = 13151 +ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 13152 +ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 13153 +ER_PLUGIN_FAILED_TO_OPEN_TABLES = 13154 +ER_PLUGIN_FAILED_TO_OPEN_TABLE = 13155 +ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 13156 +ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 13157 +ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 13158 +ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 13159 +ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 13160 +ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 13161 +ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 13162 +ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 13163 +ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 13164 +ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 13165 +ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 13166 +ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXIST = 13167 +CR_UNKNOWN_ERROR = 2000 +CR_SOCKET_CREATE_ERROR = 2001 +CR_CONNECTION_ERROR = 2002 +CR_CONN_HOST_ERROR = 2003 +CR_IPSOCK_ERROR = 2004 +CR_UNKNOWN_HOST = 2005 +CR_SERVER_GONE_ERROR = 2006 +CR_VERSION_ERROR = 2007 +CR_OUT_OF_MEMORY = 2008 +CR_WRONG_HOST_INFO = 2009 +CR_LOCALHOST_CONNECTION = 2010 +CR_TCP_CONNECTION = 2011 +CR_SERVER_HANDSHAKE_ERR = 2012 +CR_SERVER_LOST = 2013 +CR_COMMANDS_OUT_OF_SYNC = 2014 +CR_NAMEDPIPE_CONNECTION = 2015 +CR_NAMEDPIPEWAIT_ERROR = 2016 +CR_NAMEDPIPEOPEN_ERROR = 2017 +CR_NAMEDPIPESETSTATE_ERROR = 2018 +CR_CANT_READ_CHARSET = 2019 +CR_NET_PACKET_TOO_LARGE = 2020 +CR_EMBEDDED_CONNECTION = 2021 +CR_PROBE_SLAVE_STATUS = 2022 +CR_PROBE_SLAVE_HOSTS = 2023 +CR_PROBE_SLAVE_CONNECT = 2024 +CR_PROBE_MASTER_CONNECT = 2025 +CR_SSL_CONNECTION_ERROR = 2026 +CR_MALFORMED_PACKET = 2027 +CR_WRONG_LICENSE = 2028 +CR_NULL_POINTER = 2029 +CR_NO_PREPARE_STMT = 2030 +CR_PARAMS_NOT_BOUND = 2031 +CR_DATA_TRUNCATED = 2032 +CR_NO_PARAMETERS_EXISTS = 2033 +CR_INVALID_PARAMETER_NO = 2034 +CR_INVALID_BUFFER_USE = 2035 +CR_UNSUPPORTED_PARAM_TYPE = 2036 +CR_SHARED_MEMORY_CONNECTION = 2037 +CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR = 2038 +CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR = 2039 +CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR = 2040 +CR_SHARED_MEMORY_CONNECT_MAP_ERROR = 2041 +CR_SHARED_MEMORY_FILE_MAP_ERROR = 2042 +CR_SHARED_MEMORY_MAP_ERROR = 2043 +CR_SHARED_MEMORY_EVENT_ERROR = 2044 +CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR = 2045 +CR_SHARED_MEMORY_CONNECT_SET_ERROR = 2046 +CR_CONN_UNKNOW_PROTOCOL = 2047 +CR_INVALID_CONN_HANDLE = 2048 +CR_UNUSED_1 = 2049 +CR_FETCH_CANCELED = 2050 +CR_NO_DATA = 2051 +CR_NO_STMT_METADATA = 2052 +CR_NO_RESULT_SET = 2053 +CR_NOT_IMPLEMENTED = 2054 +CR_SERVER_LOST_EXTENDED = 2055 +CR_STMT_CLOSED = 2056 +CR_NEW_STMT_METADATA = 2057 +CR_ALREADY_CONNECTED = 2058 +CR_AUTH_PLUGIN_CANNOT_LOAD = 2059 +CR_DUPLICATE_CONNECTION_ATTR = 2060 +CR_AUTH_PLUGIN_ERR = 2061 +CR_INSECURE_API_ERR = 2062 +CR_FILE_NAME_TOO_LONG = 2063 +CR_SSL_FIPS_MODE_ERR = 2064 +# End MySQL Errors + diff --git a/venv/Lib/site-packages/mysqlx/errors.py b/venv/Lib/site-packages/mysqlx/errors.py new file mode 100644 index 0000000..e2534d5 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/errors.py @@ -0,0 +1,284 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of the Python Database API Specification v2.0 exceptions.""" + +import sys +import struct + +from .locales import get_client_error + +PY2 = sys.version_info[0] == 2 + +if PY2: + # pylint: disable=E0602 + def struct_unpack(fmt, buf): + """Wrapper around struct.unpack handling buffer as bytes and strings. + """ + if isinstance(buf, (bytearray, bytes)): + return struct.unpack_from(fmt, buffer(buf)) + return struct.unpack_from(fmt, buf) + # pylint: enable=E0602 +else: + from struct import unpack as struct_unpack + + +class Error(Exception): + """Exception that is base class for all other error exceptions.""" + def __init__(self, msg=None, errno=None, values=None, sqlstate=None): + super(Error, self).__init__() + self.msg = msg + self._full_msg = self.msg + self.errno = errno or -1 + self.sqlstate = sqlstate + + if not self.msg and (2000 <= self.errno < 3000): + self.msg = get_client_error(self.errno) + if values is not None: + try: + self.msg = self.msg % values + except TypeError as err: + self.msg = "{0} (Warning: {1})".format(self.msg, str(err)) + elif not self.msg: + self._full_msg = self.msg = "Unknown error" + + if self.msg and self.errno != -1: + fields = { + "errno": self.errno, + "msg": self.msg.encode("utf8") if PY2 else self.msg + } + if self.sqlstate: + fmt = "{errno} ({state}): {msg}" + fields["state"] = self.sqlstate + else: + fmt = "{errno}: {msg}" + self._full_msg = fmt.format(**fields) + + self.args = (self.errno, self._full_msg, self.sqlstate) + + def __str__(self): + return self._full_msg + + +class InterfaceError(Error): + """Exception for errors related to the interface.""" + pass + + +class DatabaseError(Error): + """Exception for errors related to the database.""" + pass + + +class InternalError(DatabaseError): + """Exception for errors internal database errors.""" + pass + + +class OperationalError(DatabaseError): + """Exception for errors related to the database's operation.""" + pass + + +class ProgrammingError(DatabaseError): + """Exception for errors programming errors.""" + pass + + +class IntegrityError(DatabaseError): + """Exception for errors regarding relational integrity.""" + pass + + +class DataError(DatabaseError): + """Exception for errors reporting problems with processed data.""" + pass + + +class NotSupportedError(DatabaseError): + """Exception for errors when an unsupported database feature was used.""" + pass + + +class PoolError(Error): + """Exception for errors relating to connection pooling.""" + pass + +# pylint: disable=W0622 +class TimeoutError(Error): + """Exception for errors relating to connection timeout.""" + pass + + +def intread(buf): + """Unpacks the given buffer to an integer.""" + try: + if isinstance(buf, int): + return buf + length = len(buf) + if length == 1: + return buf[0] + elif length <= 4: + tmp = buf + b"\x00" * (4 - length) + return struct_unpack("": "!=", + ">": ">", + ">=": ">=", + "<": "<", + "<=": "<=", + "&": "&", + "|": "|", + "<<": "<<", + ">>": ">>", + "+": "+", + "-": "-", + "*": "*", + "/": "/", + "~": "~", + "%": "%", + "cast": "cast", + "cont_in": "cont_in" +} + +_UNARY_OPERATORS = { + "+": "sign_plus", + "-": "sign_minus", + "~": "~", + "not": "not", + "!": "!" +} + +_NEGATION = { + "is": "is_not", + "between": "not_between", + "regexp": "not_regexp", + "like": "not_like", + "in": "not_in", + "cont_in": "not_cont_in" +} + + +class Token(object): + def __init__(self, token_type, value, length=1): + self.token_type = token_type + self.value = value + self.length = length + + def __repr__(self): + return self.__str__() + + def __str__(self): + if self.token_type == TokenType.IDENT or \ + self.token_type == TokenType.LNUM or \ + self.token_type == TokenType.LSTRING: + return "{0}({1})".format(self.token_type, self.value) + return "{0}".format(self.token_type) + + +# static protobuf helper functions + +def build_expr(value): + msg = Message("Mysqlx.Expr.Expr") + if isinstance(value, (Message)): + return value + elif isinstance(value, (ExprParser)): + return value.expr() + elif isinstance(value, (dict, DbDoc)): + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OBJECT") + msg["object"] = build_object(value).get_message() + elif isinstance(value, (list, tuple)): + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.ARRAY") + msg["array"] = build_array(value).get_message() + else: + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.LITERAL") + msg["literal"] = build_scalar(value).get_message() + return msg + + +def build_scalar(value): + if isinstance(value, STRING_TYPES): + return build_string_scalar(value) + elif isinstance(value, BYTE_TYPES): + return build_bytes_scalar(value) + elif isinstance(value, bool): + return build_bool_scalar(value) + elif isinstance(value, int): + return build_int_scalar(value) + elif isinstance(value, float): + return build_double_scalar(value) + elif value is None: + return build_null_scalar() + raise ValueError("Unsupported data type: {0}.".format(type(value))) + + +def build_object(obj): + if isinstance(obj, DbDoc): + return build_object(obj.__dict__) + + msg = Message("Mysqlx.Expr.Object") + for key, value in obj.items(): + pair = Message("Mysqlx.Expr.Object.ObjectField") + pair["key"] = key.encode() if isinstance(key, UNICODE_TYPES) else key + pair["value"] = build_expr(value).get_message() + msg["fld"].extend([pair.get_message()]) + return msg + + +def build_array(array): + msg = Message("Mysqlx.Expr.Array") + msg["value"].extend([build_expr(value).get_message() for value in array]) + return msg + + +def build_null_scalar(): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_NULL") + return msg + + +def build_double_scalar(value): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_DOUBLE") + msg["v_double"] = value + return msg + + +def build_int_scalar(value): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_SINT") + msg["v_signed_int"] = value + return msg + +def build_unsigned_int_scalar(value): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_UINT") + msg["v_unsigned_int"] = value + return msg + +def build_string_scalar(value): + if isinstance(value, STRING_TYPES): + value = bytes(bytearray(value, "utf-8")) + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_STRING") + msg["v_string"] = Message("Mysqlx.Datatypes.Scalar.String", value=value) + return msg + + +def build_bool_scalar(value): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_BOOL") + msg["v_bool"] = value + return msg + + +def build_bytes_scalar(value): + msg = Message("Mysqlx.Datatypes.Scalar") + msg["type"] = mysqlxpb_enum("Mysqlx.Datatypes.Scalar.Type.V_OCTETS") + msg["v_octets"] = Message("Mysqlx.Datatypes.Scalar.Octets", value=value) + return msg + + +def build_literal_expr(value): + msg = Message("Mysqlx.Expr.Expr") + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.LITERAL") + msg["literal"] = value + return msg + + +def build_unary_op(name, param): + operator = Message("Mysqlx.Expr.Operator") + operator["name"] = _UNARY_OPERATORS[name] + operator["param"] = [param.get_message()] + msg = Message("Mysqlx.Expr.Expr") + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OPERATOR") + msg["operator"] = operator.get_message() + return msg + + +def escape_literal(string): + return string.replace('"', '""') + + +class ExprParser(object): + def __init__(self, string, allow_relational=False): + self.string = string + self.tokens = [] + self.pos = 0 + self._allow_relational_columns = allow_relational + self.placeholder_name_to_position = {} + self.positional_placeholder_count = 0 + self.clean_expression() + self.lex() + + def __str__(self): + return "".format(self.string) + + def clean_expression(self): + """Removes the keywords that does not form part of the expression. + + Removes the keywords "SELECT" and "WHERE" that does not form part of + the expression itself. + """ + if not isinstance(self.string, STRING_TYPES): + self.string = repr(self.string) + self.string = self.string.strip(" ") + if len(self.string) > 1 and self.string[-1] == ';': + self.string = self.string[:-1] + if "SELECT" in self.string[:6].upper(): + self.string = self.string[6:] + if "WHERE" in self.string[:5].upper(): + self.string = self.string[5:] + + # convencience checker for lexer + def next_char_is(self, key, char): + return key + 1 < len(self.string) and self.string[key + 1] == char + + def lex_number(self, pos): + # numeric literal + start = pos + found_dot = False + while pos < len(self.string) and (self.string[pos].isdigit() or + self.string[pos] == "."): + if self.string[pos] == ".": + if found_dot is True: + raise ValueError("Invalid number. Found multiple '.'") + found_dot = True + # technically we allow more than one "." and let float()'s parsing + # complain later + pos += 1 + val = self.string[start:pos] + return Token(TokenType.LNUM, val, len(val)) + + def lex_alpha(self, i, allow_space=False): + start = i + while i < len(self.string) and \ + (self.string[i].isalnum() or self.string[i] == "_" or + (self.string[i].isspace() and allow_space)): + i += 1 + + val = self.string[start:i] + try: + if i < len(self.string) and self.string[i] == '(' and \ + val.lower() not in _SQL_FUNTION_RESERVED_WORDS_COLLISION: + token = Token(TokenType.IDENT, val, len(val)) + else: + token = Token(_RESERVED_WORDS[val.lower()], val.lower(), len(val)) + except KeyError: + token = Token(TokenType.IDENT, val, len(val)) + return token + + def lex_quoted_token(self, key): + quote_char = self.string[key] + val = "" + key += 1 + start = key + while key < len(self.string): + char = self.string[key] + if char == quote_char and key + 1 < len(self.string) and \ + self.string[key + 1] != quote_char: + # break if we have a quote char that's not double + break + elif char == quote_char or char == "\\": + # this quote char has to be doubled + if key + 1 >= len(self.string): + break + key += 1 + val += self.string[key] + else: + val += char + key += 1 + if key >= len(self.string) or self.string[key] != quote_char: + raise ValueError("Unterminated quoted string starting at {0}" + "".format(start)) + if quote_char == "`": + return Token(TokenType.IDENT, val, len(val) + 2) + return Token(TokenType.LSTRING, val, len(val) + 2) + + def lex(self): + i = 0 + arrow_last = False + inside_arrow = False + while i < len(self.string): + char = self.string[i] + if char.isspace(): + i += 1 + continue + elif char.isdigit(): + token = self.lex_number(i) + elif char.isalpha() or char == "_": + token = self.lex_alpha(i, inside_arrow) + elif char == "?": + token = Token(TokenType.EROTEME, char) + elif char == ":": + token = Token(TokenType.COLON, char) + elif char == "{": + token = Token(TokenType.LCURLY, char) + elif char == "}": + token = Token(TokenType.RCURLY, char) + elif char == "+": + token = Token(TokenType.PLUS, char) + elif char == "-": + if self.next_char_is(i, ">") and not arrow_last: + token = Token(TokenType.ARROW, "->", 2) + arrow_last = True + else: + token = Token(TokenType.MINUS, char) + elif char == "*": + if self.next_char_is(i, "*"): + token = Token(TokenType.DOUBLESTAR, "**", 2) + else: + token = Token(TokenType.MUL, char) + elif char == "/": + token = Token(TokenType.DIV, char) + elif char == "$": + token = Token(TokenType.DOLLAR, char) + elif char == "%": + token = Token(TokenType.MOD, char) + elif char == "=": + if self.next_char_is(i, "="): + token = Token(TokenType.EQ, "==", 2) + else: + token = Token(TokenType.EQ, "==", 1) + elif char == "&": + if self.next_char_is(i, "&"): + token = Token(TokenType.ANDAND, char, 2) + else: + token = Token(TokenType.BITAND, char) + elif char == "^": + token = Token(TokenType.BITXOR, char) + elif char == "|": + if self.next_char_is(i, "|"): + token = Token(TokenType.OROR, "||", 2) + else: + token = Token(TokenType.BITOR, char) + elif char == "(": + token = Token(TokenType.LPAREN, char) + elif char == ")": + token = Token(TokenType.RPAREN, char) + elif char == "[": + token = Token(TokenType.LSQBRACKET, char) + elif char == "]": + token = Token(TokenType.RSQBRACKET, char) + elif char == "~": + token = Token(TokenType.NEG, char) + elif char == ",": + token = Token(TokenType.COMMA, char) + elif char == "!": + if self.next_char_is(i, "="): + token = Token(TokenType.NE, "!=", 2) + else: + token = Token(TokenType.BANG, char) + elif char == "<": + if self.next_char_is(i, ">"): + token = Token(TokenType.NE, "<>", 2) + elif self.next_char_is(i, "<"): + token = Token(TokenType.LSHIFT, "<<", 2) + elif self.next_char_is(i, "="): + token = Token(TokenType.LE, "<=", 2) + else: + token = Token(TokenType.LT, char) + elif char == ">": + if self.next_char_is(i, ">"): + token = Token(TokenType.RSHIFT, ">>", 2) + elif self.next_char_is(i, "="): + token = Token(TokenType.GE, ">=", 2) + else: + token = Token(TokenType.GT, char) + elif char == ".": + if self.next_char_is(i, "*"): + token = Token(TokenType.DOTSTAR, ".*", 2) + elif i + 1 < len(self.string) and self.string[i + 1].isdigit(): + token = self.lex_number(i) + else: + token = Token(TokenType.DOT, char) + elif (char == "'" or char == '"') and arrow_last: + token = Token(TokenType.QUOTE, char) + if not inside_arrow: + inside_arrow = True + else: + arrow_last = False + inside_arrow = False + elif char == '"' or char == "'" or char == "`": + token = self.lex_quoted_token(i) + else: + raise ValueError("Unknown character at {0}".format(i)) + self.tokens.append(token) + i += token.length + + def assert_cur_token(self, token_type): + if self.pos >= len(self.tokens): + raise ValueError("Expected token type {0} at pos {1} but no " + "tokens left".format(token_type, self.pos)) + if self.tokens[self.pos].token_type != token_type: + raise ValueError("Expected token type {0} at pos {1} but found " + "type {2}".format(token_type, self.pos, + self.tokens[self.pos])) + + def cur_token_type_is(self, token_type): + return self.pos_token_type_is(self.pos, token_type) + + def cur_token_type_in(self, *types): + return self.pos < len(self.tokens) and \ + self.tokens[self.pos].token_type in types + + def next_token_type_is(self, token_type): + return self.pos_token_type_is(self.pos + 1, token_type) + + def next_token_type_in(self, *types): + return self.pos < len(self.tokens) and \ + self.tokens[self.pos + 1].token_type in types + + def pos_token_type_is(self, pos, token_type): + return pos < len(self.tokens) and \ + self.tokens[pos].token_type == token_type + + def consume_token(self, token_type): + self.assert_cur_token(token_type) + value = self.tokens[self.pos].value + self.pos += 1 + return value + + def paren_expr_list(self): + """Parse a paren-bounded expression list for function arguments or IN + list and return a list of Expr objects. + """ + exprs = [] + self.consume_token(TokenType.LPAREN) + if not self.cur_token_type_is(TokenType.RPAREN): + exprs.append(self.expr().get_message()) + while self.cur_token_type_is(TokenType.COMMA): + self.pos += 1 + exprs.append(self.expr().get_message()) + self.consume_token(TokenType.RPAREN) + return exprs + + def identifier(self): + self.assert_cur_token(TokenType.IDENT) + ident = Message("Mysqlx.Expr.Identifier") + if self.next_token_type_is(TokenType.DOT): + ident["schema_name"] = self.consume_token(TokenType.IDENT) + self.consume_token(TokenType.DOT) + ident["name"] = self.tokens[self.pos].value + self.pos += 1 + return ident + + def function_call(self): + function_call = Message("Mysqlx.Expr.FunctionCall") + function_call["name"] = self.identifier() + function_call["param"] = self.paren_expr_list() + msg_expr = Message("Mysqlx.Expr.Expr") + msg_expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.FUNC_CALL") + msg_expr["function_call"] = function_call.get_message() + return msg_expr + + def docpath_member(self): + self.consume_token(TokenType.DOT) + token = self.tokens[self.pos] + + if token.token_type == TokenType.IDENT: + if token.value.startswith('`') and token.value.endswith('`'): + raise ValueError("{0} is not a valid JSON/ECMAScript " + "identifier".format(token.value)) + self.consume_token(TokenType.IDENT) + member_name = token.value + elif token.token_type == TokenType.LSTRING: + self.consume_token(TokenType.LSTRING) + member_name = token.value + else: + raise ValueError("Expected token type IDENT or LSTRING in JSON " + "path at token pos {0}".format(self.pos)) + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.MEMBER") + doc_path_item["value"] = member_name + return doc_path_item + + def docpath_array_loc(self): + self.consume_token(TokenType.LSQBRACKET) + if self.cur_token_type_is(TokenType.MUL): + self.consume_token(TokenType.MUL) + self.consume_token(TokenType.RSQBRACKET) + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.ARRAY_INDEX_ASTERISK") + return doc_path_item + elif self.cur_token_type_is(TokenType.LNUM): + value = int(self.consume_token(TokenType.LNUM)) + if value < 0: + raise IndexError("Array index cannot be negative at {0}" + "".format(self.pos)) + self.consume_token(TokenType.RSQBRACKET) + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.ARRAY_INDEX") + doc_path_item["index"] = value + return doc_path_item + else: + raise ValueError("Exception token type MUL or LNUM in JSON " + "path array index at token pos {0}" + "".format(self.pos)) + + def document_field(self): + col_id = Message("Mysqlx.Expr.ColumnIdentifier") + if self.cur_token_type_is(TokenType.IDENT): + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.MEMBER") + doc_path_item["value"] = self.consume_token(TokenType.IDENT) + col_id["document_path"].extend([doc_path_item.get_message()]) + col_id["document_path"].extend(self.document_path()) + expr = Message("Mysqlx.Expr.Expr") + expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.IDENT") + expr["identifier"] = col_id + return expr + + def document_path(self): + """Parse a JSON-style document path, like WL#7909, but prefix by @. + instead of $. We parse this as a string because the protocol doesn't + support it. (yet) + """ + doc_path = [] + while True: + if self.cur_token_type_is(TokenType.DOT): + doc_path.append(self.docpath_member().get_message()) + elif self.cur_token_type_is(TokenType.DOTSTAR): + self.consume_token(TokenType.DOTSTAR) + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.MEMBER_ASTERISK") + doc_path.append(doc_path_item.get_message()) + elif self.cur_token_type_is(TokenType.LSQBRACKET): + doc_path.append(self.docpath_array_loc().get_message()) + elif self.cur_token_type_is(TokenType.DOUBLESTAR): + self.consume_token(TokenType.DOUBLESTAR) + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.DOUBLE_ASTERISK") + doc_path.append(doc_path_item.get_message()) + else: + break + items = len(doc_path) + if items > 0 and get_item_or_attr(doc_path[items - 1], "type") == \ + mysqlxpb_enum("Mysqlx.Expr.DocumentPathItem.Type.DOUBLE_ASTERISK"): + raise ValueError("JSON path may not end in '**' at {0}" + "".format(self.pos)) + return doc_path + + def column_identifier(self): + parts = [] + parts.append(self.consume_token(TokenType.IDENT)) + while self.cur_token_type_is(TokenType.DOT): + self.consume_token(TokenType.DOT) + parts.append(self.consume_token(TokenType.IDENT)) + if len(parts) > 3: + raise ValueError("Too many parts to identifier at {0}" + "".format(self.pos)) + parts.reverse() + col_id = Message("Mysqlx.Expr.ColumnIdentifier") + # clever way to apply them to the struct + for i in range(0, len(parts)): + if i == 0: + col_id["name"] = parts[0] + elif i == 1: + col_id["table_name"] = parts[1] + elif i == 2: + col_id["schema_name"] = parts[2] + + is_doc = False + if self.cur_token_type_is(TokenType.DOLLAR): + is_doc = True + self.consume_token(TokenType.DOLLAR) + col_id["document_path"] = self.document_path() + elif self.cur_token_type_is(TokenType.ARROW): + is_doc = True + self.consume_token(TokenType.ARROW) + is_quoted = False + if self.cur_token_type_is(TokenType.QUOTE): + is_quoted = True + self.consume_token(TokenType.QUOTE) + self.consume_token(TokenType.DOLLAR) + col_id["document_path"] = self.document_path() + if is_quoted: + self.consume_token(TokenType.QUOTE) + + if is_doc and len(col_id["document_path"]) == 0: + doc_path_item = Message("Mysqlx.Expr.DocumentPathItem") + doc_path_item["type"] = mysqlxpb_enum( + "Mysqlx.Expr.DocumentPathItem.Type.MEMBER") + doc_path_item["value"] = "" + col_id["document_path"].extend([doc_path_item.get_message()]) + + msg_expr = Message("Mysqlx.Expr.Expr") + msg_expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.IDENT") + msg_expr["identifier"] = col_id + return msg_expr + + def next_token(self): + if self.pos >= len(self.tokens): + raise ValueError("Unexpected end of token stream") + token = self.tokens[self.pos] + self.pos += 1 + return token + + def expect_token(self, token_type): + token = self.next_token() + if token.token_type != token_type: + raise ValueError("Expected token type {0}".format(token_type)) + + def peek_token(self): + return self.tokens[self.pos] + + def consume_any_token(self): + value = self.tokens[self.pos].value + self.pos += 1 + return value + + def parse_json_array(self): + """ + jsonArray ::= "[" [ expr ("," expr)* ] "]" + """ + msg = Message("Mysqlx.Expr.Array") + while self.pos < len(self.tokens) and \ + not self.cur_token_type_is(TokenType.RSQBRACKET): + msg["value"].extend([self.expr().get_message()]) + if not self.cur_token_type_is(TokenType.COMMA): + break + self.consume_token(TokenType.COMMA) + self.consume_token(TokenType.RSQBRACKET) + + expr = Message("Mysqlx.Expr.Expr") + expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.ARRAY") + expr["array"] = msg.get_message() + return expr + + def parse_json_doc(self): + """ + jsonDoc ::= "{" [jsonKeyValue ("," jsonKeyValue)*] "}" + jsonKeyValue ::= STRING_DQ ":" expr + """ + msg = Message("Mysqlx.Expr.Object") + while self.pos < len(self.tokens) and \ + not self.cur_token_type_is(TokenType.RCURLY): + item = Message("Mysqlx.Expr.Object.ObjectField") + item["key"] = self.consume_token(TokenType.LSTRING) + self.consume_token(TokenType.COLON) + item["value"] = self.expr().get_message() + msg["fld"].extend([item.get_message()]) + if not self.cur_token_type_is(TokenType.COMMA): + break + self.consume_token(TokenType.COMMA) + self.consume_token(TokenType.RCURLY) + + expr = Message("Mysqlx.Expr.Expr") + expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OBJECT") + expr["object"] = msg.get_message() + return expr + + def parse_place_holder(self, token): + place_holder_name = "" + if self.cur_token_type_is(TokenType.LNUM): + place_holder_name = self.consume_token(TokenType.LNUM) + elif self.cur_token_type_is(TokenType.IDENT): + place_holder_name = self.consume_token(TokenType.IDENT) + elif token.token_type == TokenType.EROTEME: + place_holder_name = str(self.positional_placeholder_count) + else: + raise ValueError("Invalid placeholder name at token pos {0}" + "".format(self.pos)) + + place_holder_name = place_holder_name.lower() + msg_expr = Message("Mysqlx.Expr.Expr") + msg_expr["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.PLACEHOLDER") + if place_holder_name in self.placeholder_name_to_position: + msg_expr["position"] = \ + self.placeholder_name_to_position[place_holder_name] + else: + msg_expr["position"] = self.positional_placeholder_count + self.placeholder_name_to_position[place_holder_name] = \ + self.positional_placeholder_count + self.positional_placeholder_count += 1 + return msg_expr + + def cast(self): + """ cast ::= CAST LPAREN expr AS cast_data_type RPAREN + """ + operator = Message("Mysqlx.Expr.Operator", name="cast") + self.consume_token(TokenType.LPAREN) + operator["param"].extend([self.expr().get_message()]) + self.consume_token(TokenType.AS) + + type_scalar = build_bytes_scalar(str.encode(self.cast_data_type())) + operator["param"].extend( + [build_literal_expr(type_scalar).get_message()]) + self.consume_token(TokenType.RPAREN) + msg = Message("Mysqlx.Expr.Expr", operator=operator.get_message()) + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OPERATOR") + return msg + + def cast_data_type(self): + """ cast_data_type ::= ( BINARY dimension? ) | + ( CHAR dimension? ) | + ( DATE ) | + ( DATETIME dimension? ) | + ( TIME dimension? ) | + ( DECIMAL dimension? ) | + ( SIGNED INTEGER? ) | + ( UNSIGNED INTEGER? ) | + JSON + """ + token = self.next_token() + if token.token_type in (TokenType.BINARY, TokenType.CHAR, + TokenType.DATETIME, TokenType.TIME,): + dimension = self.cast_data_type_dimension() + return "{0}{1}".format(token.value, dimension) \ + if dimension else token.value + elif token.token_type is TokenType.DECIMAL: + dimension = self.cast_data_type_dimension(True) + return "{0}{1}".format(token.value, dimension) \ + if dimension else token.value + elif token.token_type in (TokenType.SIGNED, TokenType.UNSIGNED,): + if self.cur_token_type_is(TokenType.INTEGER): + self.consume_token(TokenType.INTEGER) + return token.value + elif token.token_type in (TokenType.INTEGER, TokenType.JSON, + TokenType.DATE,): + return token.value + + raise ValueError("Unknown token type {0} at position {1} ({2})" + "".format(token.token_type, self.pos, token.value)) + + def cast_data_type_dimension(self, decimal=False): + """ dimension ::= LPAREN LNUM (, LNUM)? RPAREN + """ + if not self.cur_token_type_is(TokenType.LPAREN): + return None + + dimension = [] + self.consume_token(TokenType.LPAREN) + dimension.append(self.consume_token(TokenType.LNUM)) + if decimal and self.cur_token_type_is(TokenType.COMMA): + self.consume_token(TokenType.COMMA) + dimension.append(self.consume_token(TokenType.LNUM)) + self.consume_token(TokenType.RPAREN) + + return "({0})".format(dimension[0]) if len(dimension) is 1 else \ + "({0},{1})".format(*dimension) + + def star_operator(self): + msg = Message("Mysqlx.Expr.Expr") + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OPERATOR") + msg["operator"] = Message("Mysqlx.Expr.Operator", name="*") + return msg + + def atomic_expr(self): + """Parse an atomic expression and return a protobuf Expr object""" + token = self.next_token() + + if token.token_type in [TokenType.EROTEME, TokenType.COLON]: + return self.parse_place_holder(token) + elif token.token_type == TokenType.LCURLY: + return self.parse_json_doc() + elif token.token_type == TokenType.LSQBRACKET: + return self.parse_json_array() + elif token.token_type == TokenType.CAST: + return self.cast() + elif token.token_type == TokenType.LPAREN: + expr = self.expr() + self.expect_token(TokenType.RPAREN) + return expr + elif token.token_type in [TokenType.PLUS, TokenType.MINUS]: + peek = self.peek_token() + if peek.token_type == TokenType.LNUM: + self.tokens[self.pos].value = token.value + peek.value + return self.atomic_expr() + return build_unary_op(token.value, self.atomic_expr()) + elif token.token_type in [TokenType.NOT, TokenType.NEG, TokenType.BANG]: + return build_unary_op(token.value, self.atomic_expr()) + elif token.token_type == TokenType.LSTRING: + return build_literal_expr(build_string_scalar(token.value)) + elif token.token_type == TokenType.NULL: + return build_literal_expr(build_null_scalar()) + elif token.token_type == TokenType.LNUM: + if "." in token.value: + return build_literal_expr( + build_double_scalar(float(token.value))) + return build_literal_expr(build_int_scalar(int(token.value))) + elif token.token_type in [TokenType.TRUE, TokenType.FALSE]: + return build_literal_expr( + build_bool_scalar(token.token_type == TokenType.TRUE)) + elif token.token_type == TokenType.DOLLAR: + return self.document_field() + elif token.token_type == TokenType.MUL: + return self.star_operator() + elif token.token_type == TokenType.IDENT: + self.pos = self.pos - 1 # stay on the identifier + if self.next_token_type_is(TokenType.LPAREN) or \ + (self.next_token_type_is(TokenType.DOT) and + self.pos_token_type_is(self.pos + 2, TokenType.IDENT) and + self.pos_token_type_is(self.pos + 3, TokenType.LPAREN)): + # Function call + return self.function_call() + return (self.document_field() + if not self._allow_relational_columns + else self.column_identifier()) + + raise ValueError("Unknown token type = {0} when expecting atomic " + "expression at {1}" + "".format(token.token_type, self.pos)) + + def parse_left_assoc_binary_op_expr(self, types, inner_parser): + """Given a `set' of types and an Expr-returning inner parser function, + parse a left associate binary operator expression""" + lhs = inner_parser() + while (self.pos < len(self.tokens) and + self.tokens[self.pos].token_type in types): + msg = Message("Mysqlx.Expr.Expr") + msg["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OPERATOR") + operator = Message("Mysqlx.Expr.Operator") + operator["name"] = _OPERATORS[self.tokens[self.pos].value] + operator["param"] = [lhs.get_message()] + self.pos += 1 + operator["param"].extend([inner_parser().get_message()]) + msg["operator"] = operator + lhs = msg + return lhs + + # operator precedence is implemented here + def add_sub_interval(self): + lhs = self.atomic_expr() + if self.cur_token_type_in(TokenType.PLUS, TokenType.MINUS) and \ + self.next_token_type_is(TokenType.INTERVAL): + token = self.next_token() + + operator = Message("Mysqlx.Expr.Operator") + operator["param"].extend([lhs.get_message()]) + operator["name"] = "date_add" if token.token_type is TokenType.PLUS \ + else "date_sub" + + self.consume_token(TokenType.INTERVAL) + operator["param"].extend([self.bit_expr().get_message()]) + + if not self.cur_token_type_in(*_INTERVAL_UNITS): + raise ValueError("Expected interval type at position {0}" + "".format(self.pos)) + + token = str.encode(self.consume_any_token().upper()) + operator["param"].extend([build_literal_expr( + build_bytes_scalar(token)).get_message()]) + + lhs = Message("Mysqlx.Expr.Expr", operator=operator) + lhs["type"] = mysqlxpb_enum("Mysqlx.Expr.Expr.Type.OPERATOR") + + return lhs + + def mul_div_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.MUL, TokenType.DIV, TokenType.MOD]), + self.add_sub_interval) + + def add_sub_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.PLUS, TokenType.MINUS]), self.mul_div_expr) + + def shift_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.LSHIFT, TokenType.RSHIFT]), self.add_sub_expr) + + def bit_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.BITAND, TokenType.BITOR, TokenType.BITXOR]), + self.shift_expr) + + def comp_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.GE, TokenType.GT, TokenType.LE, TokenType.LT, + TokenType.EQ, TokenType.NE]), self.bit_expr) + + def ilri_expr(self): + params = [] + lhs = self.comp_expr() + is_not = False + if self.cur_token_type_is(TokenType.NOT): + is_not = True + self.consume_token(TokenType.NOT) + if self.pos < len(self.tokens): + params.append(lhs.get_message()) + op_name = self.tokens[self.pos].value + if self.cur_token_type_is(TokenType.IS): + self.consume_token(TokenType.IS) + # for IS, NOT comes AFTER + if self.cur_token_type_is(TokenType.NOT): + is_not = True + self.consume_token(TokenType.NOT) + params.append(self.comp_expr().get_message()) + elif self.cur_token_type_is(TokenType.IN): + self.consume_token(TokenType.IN) + if self.cur_token_type_is(TokenType.LPAREN): + params.extend(self.paren_expr_list()) + else: + op_name = "cont_in" + params.append(self.comp_expr().get_message()) + elif self.cur_token_type_is(TokenType.LIKE): + self.consume_token(TokenType.LIKE) + params.append(self.comp_expr().get_message()) + if self.cur_token_type_is(TokenType.ESCAPE): + self.consume_token(TokenType.ESCAPE) + params.append(self.comp_expr().get_message()) + elif self.cur_token_type_is(TokenType.BETWEEN): + self.consume_token(TokenType.BETWEEN) + params.append(self.comp_expr().get_message()) + self.consume_token(TokenType.AND) + params.append(self.comp_expr().get_message()) + elif self.cur_token_type_is(TokenType.REGEXP): + self.consume_token(TokenType.REGEXP) + params.append(self.comp_expr().get_message()) + else: + if is_not: + raise ValueError("Unknown token after NOT as pos {0}" + "".format(self.pos)) + op_name = None # not an operator we're interested in + if op_name: + operator = Message("Mysqlx.Expr.Operator") + operator["name"] = _NEGATION[op_name] if is_not else op_name + operator["param"] = params + msg_expr = Message("Mysqlx.Expr.Expr") + msg_expr["type"] = mysqlxpb_enum( + "Mysqlx.Expr.Expr.Type.OPERATOR") + msg_expr["operator"] = operator.get_message() + lhs = msg_expr + return lhs + + def and_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.AND, TokenType.ANDAND]), self.ilri_expr) + + def xor_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.XOR]), self.and_expr) + + def or_expr(self): + return self.parse_left_assoc_binary_op_expr( + set([TokenType.OR, TokenType.OROR]), self.xor_expr) + + def expr(self): + return self.or_expr() + + def parse_table_insert_field(self): + return Message("Mysqlx.Crud.Column", + name=self.consume_token(TokenType.IDENT)) + + def parse_table_update_field(self): + return self.column_identifier().identifier + + def _table_fields(self): + fields = [] + temp = self.string.split(",") + temp.reverse() + while temp: + field = temp.pop() + while field.count("(") != field.count(")") or \ + field.count("[") != field.count("]") or \ + field.count("{") != field.count("}"): + field = "{1},{0}".format(temp.pop(), field) + fields.append(field.strip()) + return fields + + def parse_table_select_projection(self): + project_expr = [] + first = True + fields = self._table_fields() + while self.pos < len(self.tokens): + if not first: + self.consume_token(TokenType.COMMA) + first = False + projection = Message("Mysqlx.Crud.Projection", source=self.expr()) + if self.cur_token_type_is(TokenType.AS): + self.consume_token(TokenType.AS) + projection["alias"] = self.consume_token(TokenType.IDENT) + else: + projection["alias"] = fields[len(project_expr)] + project_expr.append(projection.get_message()) + + return project_expr + + def parse_order_spec(self): + order_specs = [] + first = True + while self.pos < len(self.tokens): + if not first: + self.consume_token(TokenType.COMMA) + first = False + order = Message("Mysqlx.Crud.Order", expr=self.expr()) + if self.cur_token_type_is(TokenType.ORDERBY_ASC): + order["direction"] = mysqlxpb_enum( + "Mysqlx.Crud.Order.Direction.ASC") + self.consume_token(TokenType.ORDERBY_ASC) + elif self.cur_token_type_is(TokenType.ORDERBY_DESC): + order["direction"] = mysqlxpb_enum( + "Mysqlx.Crud.Order.Direction.DESC") + self.consume_token(TokenType.ORDERBY_DESC) + order_specs.append(order.get_message()) + return order_specs + + def parse_expr_list(self): + expr_list = [] + first = True + while self.pos < len(self.tokens): + if not first: + self.consume_token(TokenType.COMMA) + first = False + expr_list.append(self.expr().get_message()) + return expr_list diff --git a/venv/Lib/site-packages/mysqlx/helpers.py b/venv/Lib/site-packages/mysqlx/helpers.py new file mode 100644 index 0000000..05541e3 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/helpers.py @@ -0,0 +1,168 @@ +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""This module contains helper functions.""" + +import functools +import inspect +import warnings + +from .compat import NUMERIC_TYPES + + +def encode_to_bytes(value, encoding="utf-8"): + """Returns an encoded version of the string as a bytes object. + + Args: + encoding (str): The encoding. + + Resturns: + bytes: The encoded version of the string as a bytes object. + """ + return value if isinstance(value, bytes) else value.encode(encoding) + + +def decode_from_bytes(value, encoding="utf-8"): + """Returns a string decoded from the given bytes. + + Args: + value (bytes): The value to be decoded. + encoding (str): The encoding. + + Returns: + str: The value decoded from bytes. + """ + return value.decode(encoding) if isinstance(value, bytes) else value + + +def get_item_or_attr(obj, key): + """Get item from dictionary or attribute from object. + + Args: + obj (object): Dictionary or object. + key (str): Key. + + Returns: + object: The object for the provided key. + """ + return obj[key] if isinstance(obj, dict) else getattr(obj, key) + + +def escape(*args): + """Escapes special characters as they are expected to be when MySQL + receives them. + As found in MySQL source mysys/charset.c + + Args: + value (object): Value to be escaped. + + Returns: + str: The value if not a string, or the escaped string. + """ + def _escape(value): + """Escapes special characters.""" + if value is None: + return value + elif isinstance(value, NUMERIC_TYPES): + return value + if isinstance(value, (bytes, bytearray)): + value = value.replace(b'\\', b'\\\\') + value = value.replace(b'\n', b'\\n') + value = value.replace(b'\r', b'\\r') + value = value.replace(b'\047', b'\134\047') # single quotes + value = value.replace(b'\042', b'\134\042') # double quotes + value = value.replace(b'\032', b'\134\032') # for Win32 + else: + value = value.replace('\\', '\\\\') + value = value.replace('\n', '\\n') + value = value.replace('\r', '\\r') + value = value.replace('\047', '\134\047') # single quotes + value = value.replace('\042', '\134\042') # double quotes + value = value.replace('\032', '\134\032') # for Win32 + return value + if len(args) > 1: + return [_escape(arg) for arg in args] + return _escape(args[0]) + + +def quote_identifier(identifier, sql_mode=""): + """Quote the given identifier with backticks, converting backticks (`) + in the identifier name with the correct escape sequence (``) unless the + identifier is quoted (") as in sql_mode set to ANSI_QUOTES. + + Args: + identifier (str): Identifier to quote. + + Returns: + str: Returns string with the identifier quoted with backticks. + """ + if sql_mode == "ANSI_QUOTES": + return '"{0}"'.format(identifier.replace('"', '""')) + return "`{0}`".format(identifier.replace("`", "``")) + + +def deprecated(version=None, reason=None): + """This is a decorator used to mark functions as deprecated. + + Args: + version (Optional[string]): Version when was deprecated. + reason (Optional[string]): Reason or extra information to be shown. + + Usage: + + .. code-block:: python + + from mysqlx.helpers import deprecated + + @deprecated('8.0.12', 'Please use other_function() instead') + def deprecated_function(x, y): + return x + y + """ + def decorate(func): + """Decorate function.""" + @functools.wraps(func) + def wrapper(*args, **kwargs): + """Wrapper function. + + Args: + *args: Variable length argument list. + **kwargs: Arbitrary keyword arguments. + """ + message = ["'{}' is deprecated".format(func.__name__)] + if version: + message.append(" since version {}".format(version)) + if reason: + message.append(". {}".format(reason)) + frame = inspect.currentframe().f_back + warnings.warn_explicit("".join(message), + category=DeprecationWarning, + filename=inspect.getfile(frame.f_code), + lineno=frame.f_lineno) + return func(*args, **kwargs) + return wrapper + return decorate diff --git a/venv/Lib/site-packages/mysqlx/locales/__init__.py b/venv/Lib/site-packages/mysqlx/locales/__init__.py new file mode 100644 index 0000000..be63763 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/locales/__init__.py @@ -0,0 +1,73 @@ +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Translations""" + +__all__ = ["get_client_error"] + +from .. import errorcode + + +def get_client_error(error, language="eng"): + """Lookup client error + + This function will lookup the client error message based on the given + error and return the error message. If the error was not found, + None will be returned. + + Error can be either an integer or a string. For example: + error: 2000 + error: CR_UNKNOWN_ERROR + + The language attribute can be used to retrieve a localized message, when + available. + + Returns a string or None. + """ + try: + tmp = __import__("mysqlx.locales.{0}".format(language), + globals(), locals(), ["client_error"]) + except ImportError: + raise ImportError("No localization support for language '{0}'" + "".format(language)) + client_error = tmp.client_error + + if isinstance(error, int): + errno = error + for key, value in errorcode.__dict__.items(): + if value == errno: + error = key + break + + if isinstance(error, (str)): + try: + return getattr(client_error, error) + except AttributeError: + return None + + raise ValueError("Error argument needs to be either an integer or string") diff --git a/venv/Lib/site-packages/mysqlx/locales/eng/__init__.py b/venv/Lib/site-packages/mysqlx/locales/eng/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/venv/Lib/site-packages/mysqlx/locales/eng/client_error.py b/venv/Lib/site-packages/mysqlx/locales/eng/client_error.py new file mode 100644 index 0000000..a9ed8b9 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/locales/eng/client_error.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file was auto-generated. +_GENERATED_ON = '2018-03-16' +_MYSQL_VERSION = (8, 0, 11) + +# Start MySQL Error messages +CR_UNKNOWN_ERROR = u"Unknown MySQL error" +CR_SOCKET_CREATE_ERROR = u"Can't create UNIX socket (%s)" +CR_CONNECTION_ERROR = u"Can't connect to local MySQL server through socket '%-.100s' (%s)" +CR_CONN_HOST_ERROR = u"Can't connect to MySQL server on '%-.100s' (%s)" +CR_IPSOCK_ERROR = u"Can't create TCP/IP socket (%s)" +CR_UNKNOWN_HOST = u"Unknown MySQL server host '%-.100s' (%s)" +CR_SERVER_GONE_ERROR = u"MySQL server has gone away" +CR_VERSION_ERROR = u"Protocol mismatch; server version = %s, client version = %s" +CR_OUT_OF_MEMORY = u"MySQL client ran out of memory" +CR_WRONG_HOST_INFO = u"Wrong host info" +CR_LOCALHOST_CONNECTION = u"Localhost via UNIX socket" +CR_TCP_CONNECTION = u"%-.100s via TCP/IP" +CR_SERVER_HANDSHAKE_ERR = u"Error in server handshake" +CR_SERVER_LOST = u"Lost connection to MySQL server during query" +CR_COMMANDS_OUT_OF_SYNC = u"Commands out of sync; you can't run this command now" +CR_NAMEDPIPE_CONNECTION = u"Named pipe: %-.32s" +CR_NAMEDPIPEWAIT_ERROR = u"Can't wait for named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_NAMEDPIPEOPEN_ERROR = u"Can't open named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_NAMEDPIPESETSTATE_ERROR = u"Can't set state of named pipe to host: %-.64s pipe: %-.32s (%s)" +CR_CANT_READ_CHARSET = u"Can't initialize character set %-.32s (path: %-.100s)" +CR_NET_PACKET_TOO_LARGE = u"Got packet bigger than 'max_allowed_packet' bytes" +CR_EMBEDDED_CONNECTION = u"Embedded server" +CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:" +CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:" +CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:" +CR_PROBE_MASTER_CONNECT = u"Error connecting to master:" +CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s" +CR_MALFORMED_PACKET = u"Malformed packet" +CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license" +CR_NULL_POINTER = u"Invalid use of null pointer" +CR_NO_PREPARE_STMT = u"Statement not prepared" +CR_PARAMS_NOT_BOUND = u"No data supplied for parameters in prepared statement" +CR_DATA_TRUNCATED = u"Data truncated" +CR_NO_PARAMETERS_EXISTS = u"No parameters exist in the statement" +CR_INVALID_PARAMETER_NO = u"Invalid parameter number" +CR_INVALID_BUFFER_USE = u"Can't send long data for non-string/non-binary data types (parameter: %s)" +CR_UNSUPPORTED_PARAM_TYPE = u"Using unsupported buffer type: %s (parameter: %s)" +CR_SHARED_MEMORY_CONNECTION = u"Shared memory: %-.100s" +CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR = u"Can't open shared memory; client could not create request event (%s)" +CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR = u"Can't open shared memory; no answer event received from server (%s)" +CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR = u"Can't open shared memory; server could not allocate file mapping (%s)" +CR_SHARED_MEMORY_CONNECT_MAP_ERROR = u"Can't open shared memory; server could not get pointer to file mapping (%s)" +CR_SHARED_MEMORY_FILE_MAP_ERROR = u"Can't open shared memory; client could not allocate file mapping (%s)" +CR_SHARED_MEMORY_MAP_ERROR = u"Can't open shared memory; client could not get pointer to file mapping (%s)" +CR_SHARED_MEMORY_EVENT_ERROR = u"Can't open shared memory; client could not create %s event (%s)" +CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR = u"Can't open shared memory; no answer from server (%s)" +CR_SHARED_MEMORY_CONNECT_SET_ERROR = u"Can't open shared memory; cannot send request event to server (%s)" +CR_CONN_UNKNOW_PROTOCOL = u"Wrong or unknown protocol" +CR_INVALID_CONN_HANDLE = u"Invalid connection handle" +CR_UNUSED_1 = u"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)" +CR_FETCH_CANCELED = u"Row retrieval was canceled by mysql_stmt_close() call" +CR_NO_DATA = u"Attempt to read column without prior row fetch" +CR_NO_STMT_METADATA = u"Prepared statement contains no metadata" +CR_NO_RESULT_SET = u"Attempt to read a row while there is no result set associated with the statement" +CR_NOT_IMPLEMENTED = u"This feature is not implemented yet" +CR_SERVER_LOST_EXTENDED = u"Lost connection to MySQL server at '%s', system error: %s" +CR_STMT_CLOSED = u"Statement closed indirectly because of a preceding %s() call" +CR_NEW_STMT_METADATA = u"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again" +CR_ALREADY_CONNECTED = u"This handle is already connected. Use a separate handle for each connection." +CR_AUTH_PLUGIN_CANNOT_LOAD = u"Authentication plugin '%s' cannot be loaded: %s" +CR_DUPLICATE_CONNECTION_ATTR = u"There is an attribute with the same name already" +CR_AUTH_PLUGIN_ERR = u"Authentication plugin '%s' reported error: %s" +CR_INSECURE_API_ERR = u"Insecure API function call: '%s' Use instead: '%s'" +CR_FILE_NAME_TOO_LONG = u"File name is too long" +CR_SSL_FIPS_MODE_ERR = u"Set FIPS mode ON/STRICT failed" +# End MySQL Error messages + diff --git a/venv/Lib/site-packages/mysqlx/protobuf/__init__.py b/venv/Lib/site-packages/mysqlx/protobuf/__init__.py new file mode 100644 index 0000000..16e4082 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/__init__.py @@ -0,0 +1,406 @@ +# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""This module contains the implementation of a helper class for MySQL X +Protobuf messages.""" + +_SERVER_MESSAGES_TUPLES = ( + ("Mysqlx.ServerMessages.Type.OK", + "Mysqlx.Ok"), + ("Mysqlx.ServerMessages.Type.ERROR", + "Mysqlx.Error"), + ("Mysqlx.ServerMessages.Type.CONN_CAPABILITIES", + "Mysqlx.Connection.Capabilities"), + ("Mysqlx.ServerMessages.Type.SESS_AUTHENTICATE_CONTINUE", + "Mysqlx.Session.AuthenticateContinue"), + ("Mysqlx.ServerMessages.Type.SESS_AUTHENTICATE_OK", + "Mysqlx.Session.AuthenticateOk"), + ("Mysqlx.ServerMessages.Type.NOTICE", + "Mysqlx.Notice.Frame"), + ("Mysqlx.ServerMessages.Type.RESULTSET_COLUMN_META_DATA", + "Mysqlx.Resultset.ColumnMetaData"), + ("Mysqlx.ServerMessages.Type.RESULTSET_ROW", + "Mysqlx.Resultset.Row"), + ("Mysqlx.ServerMessages.Type.RESULTSET_FETCH_DONE", + "Mysqlx.Resultset.FetchDone"), + ("Mysqlx.ServerMessages.Type.RESULTSET_FETCH_SUSPENDED", + "Mysqlx.Resultset.FetchSuspended"), + ("Mysqlx.ServerMessages.Type.RESULTSET_FETCH_DONE_MORE_RESULTSETS", + "Mysqlx.Resultset.FetchDoneMoreResultsets"), + ("Mysqlx.ServerMessages.Type.SQL_STMT_EXECUTE_OK", + "Mysqlx.Sql.StmtExecuteOk"), + ("Mysqlx.ServerMessages.Type.RESULTSET_FETCH_DONE_MORE_OUT_PARAMS", + "Mysqlx.Resultset.FetchDoneMoreOutParams"), +) + +PROTOBUF_REPEATED_TYPES = [list] + +try: + import _mysqlxpb + SERVER_MESSAGES = dict([(int(_mysqlxpb.enum_value(key)), val) + for key, val in _SERVER_MESSAGES_TUPLES]) + HAVE_MYSQLXPB_CEXT = True +except ImportError: + HAVE_MYSQLXPB_CEXT = False + +from ..compat import PY3, NUMERIC_TYPES, STRING_TYPES, BYTE_TYPES +from ..helpers import encode_to_bytes + +try: + from . import mysqlx_connection_pb2 + from . import mysqlx_crud_pb2 + from . import mysqlx_datatypes_pb2 + from . import mysqlx_expect_pb2 + from . import mysqlx_expr_pb2 + from . import mysqlx_notice_pb2 + from . import mysqlx_pb2 + from . import mysqlx_resultset_pb2 + from . import mysqlx_session_pb2 + from . import mysqlx_sql_pb2 + + from google.protobuf import descriptor_database + from google.protobuf import descriptor_pb2 + from google.protobuf import descriptor_pool + from google.protobuf import message_factory + from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer) + try: + from google.protobuf.pyext._message import ( + RepeatedCompositeContainer) + PROTOBUF_REPEATED_TYPES.append(RepeatedCompositeContainer) + except ImportError: + pass + + PROTOBUF_REPEATED_TYPES.append(RepeatedCompositeFieldContainer) + + # Dictionary with all messages descriptors + _MESSAGES = {} + + # Mysqlx + for key, val in mysqlx_pb2.ClientMessages.Type.items(): + _MESSAGES["Mysqlx.ClientMessages.Type.{0}".format(key)] = val + for key, val in mysqlx_pb2.ServerMessages.Type.items(): + _MESSAGES["Mysqlx.ServerMessages.Type.{0}".format(key)] = val + for key, val in mysqlx_pb2.Error.Severity.items(): + _MESSAGES["Mysqlx.Error.Severity.{0}".format(key)] = val + + # Mysqlx.Crud + for key, val in mysqlx_crud_pb2.DataModel.items(): + _MESSAGES["Mysqlx.Crud.DataModel.{0}".format(key)] = val + for key, val in mysqlx_crud_pb2.Find.RowLock.items(): + _MESSAGES["Mysqlx.Crud.Find.RowLock.{0}".format(key)] = val + for key, val in mysqlx_crud_pb2.Order.Direction.items(): + _MESSAGES["Mysqlx.Crud.Order.Direction.{0}".format(key)] = val + for key, val in mysqlx_crud_pb2.UpdateOperation.UpdateType.items(): + _MESSAGES["Mysqlx.Crud.UpdateOperation.UpdateType.{0}".format(key)] = val + + # Mysqlx.Datatypes + for key, val in mysqlx_datatypes_pb2.Scalar.Type.items(): + _MESSAGES["Mysqlx.Datatypes.Scalar.Type.{0}".format(key)] = val + for key, val in mysqlx_datatypes_pb2.Any.Type.items(): + _MESSAGES["Mysqlx.Datatypes.Any.Type.{0}".format(key)] = val + + # Mysqlx.Expect + for key, val in mysqlx_expect_pb2.Open.Condition.ConditionOperation.items(): + _MESSAGES["Mysqlx.Expect.Open.Condition.ConditionOperation.{0}" + "".format(key)] = val + for key, val in mysqlx_expect_pb2.Open.CtxOperation.items(): + _MESSAGES["Mysqlx.Expect.Open.CtxOperation.{0}".format(key)] = val + + # Mysqlx.Expr + for key, val in mysqlx_expr_pb2.Expr.Type.items(): + _MESSAGES["Mysqlx.Expr.Expr.Type.{0}".format(key)] = val + for key, val in mysqlx_expr_pb2.DocumentPathItem.Type.items(): + _MESSAGES["Mysqlx.Expr.DocumentPathItem.Type.{0}".format(key)] = val + + # Mysqlx.Notice + for key, val in mysqlx_notice_pb2.Frame.Scope.items(): + _MESSAGES["Mysqlx.Notice.Frame.Scope.{0}".format(key)] = val + for key, val in mysqlx_notice_pb2.Warning.Level.items(): + _MESSAGES["Mysqlx.Notice.Warning.Level.{0}".format(key)] = val + for key, val in mysqlx_notice_pb2.SessionStateChanged.Parameter.items(): + _MESSAGES["Mysqlx.Notice.SessionStateChanged.Parameter.{0}" + "".format(key)] = val + + # Mysql.Resultset + for key, val in mysqlx_resultset_pb2.ColumnMetaData.FieldType.items(): + _MESSAGES["Mysqlx.Resultset.ColumnMetaData.FieldType.{0}".format(key)] = val + + # Add messages to the descriptor pool + _DESCRIPTOR_DB = descriptor_database.DescriptorDatabase() + _DESCRIPTOR_POOL = descriptor_pool.DescriptorPool(_DESCRIPTOR_DB) + + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_connection_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_crud_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_datatypes_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_expect_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_expr_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_notice_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_resultset_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_session_pb2.DESCRIPTOR.serialized_pb)) + _DESCRIPTOR_DB.Add(descriptor_pb2.FileDescriptorProto.FromString( + mysqlx_sql_pb2.DESCRIPTOR.serialized_pb)) + + SERVER_MESSAGES = dict( + [(_MESSAGES[key], val) for key, val in _SERVER_MESSAGES_TUPLES] + ) + HAVE_PROTOBUF = True + + + class _mysqlxpb_pure(object): + """This class implements the methods in pure Python used by the + _mysqlxpb C++ extension.""" + + factory = message_factory.MessageFactory() + + @staticmethod + def new_message(name): + cls = _mysqlxpb_pure.factory.GetPrototype( + _DESCRIPTOR_POOL.FindMessageTypeByName(name)) + return cls() + + @staticmethod + def enum_value(key): + return _MESSAGES[key] + + @staticmethod + def serialize_message(msg): + return msg.SerializeToString() + + @staticmethod + def parse_message(msg_type_name, payload): + msg = _mysqlxpb_pure.new_message(msg_type_name) + msg.ParseFromString(payload) + return msg + + @staticmethod + def parse_server_message(msg_type, payload): + msg_type_name = SERVER_MESSAGES.get(msg_type) + if not msg_type_name: + raise ValueError("Unknown msg_type: {0}".format(msg_type)) + msg = _mysqlxpb_pure.new_message(msg_type_name) + msg.ParseFromString(payload) + return msg +except ImportError: + HAVE_PROTOBUF = False + if not HAVE_MYSQLXPB_CEXT: + raise ImportError("Protobuf is not available") + + +class Protobuf(object): + """Protobuf class acts as a container of the Protobuf message class. + It allows the switch between the C extension and pure Python implementation + message handlers, by patching the `mysqlxpb` class attribute. + """ + mysqlxpb = _mysqlxpb if HAVE_MYSQLXPB_CEXT else _mysqlxpb_pure + use_pure = False if HAVE_MYSQLXPB_CEXT else True + + @staticmethod + def set_use_pure(use_pure): + """Sets whether to use the C extension or pure Python implementation. + + Args: + use_pure (bool): `True` to use pure Python implementation. + """ + if use_pure and not HAVE_PROTOBUF: + raise ImportError("Protobuf is not available") + elif not use_pure and not HAVE_MYSQLXPB_CEXT: + raise ImportError("MySQL X Protobuf C extension is not available") + Protobuf.mysqlxpb = _mysqlxpb_pure if use_pure else _mysqlxpb + Protobuf.use_pure = use_pure + + +class Message(object): + """Helper class for interfacing with the MySQL X Protobuf extension. + + Args: + msg_type_name (string): Protobuf type name. + **kwargs: Arbitrary keyword arguments with values for the message. + """ + def __init__(self, msg_type_name=None, **kwargs): + self.__dict__["_msg"] = Protobuf.mysqlxpb.new_message(msg_type_name) \ + if msg_type_name else None + for key, value in kwargs.items(): + self.__setattr__(key, value) + + def __setattr__(self, name, value): + if Protobuf.use_pure: + if PY3 and isinstance(value, STRING_TYPES): + setattr(self._msg, name, encode_to_bytes(value)) + elif isinstance(value, (NUMERIC_TYPES, STRING_TYPES, BYTE_TYPES)): + setattr(self._msg, name, value) + elif isinstance(value, list): + getattr(self._msg, name).extend(value) + elif isinstance(value, Message): + getattr(self._msg, name).MergeFrom(value.get_message()) + else: + getattr(self._msg, name).MergeFrom(value) + else: + self._msg[name] = value.get_message() \ + if isinstance(value, Message) else value + + def __getattr__(self, name): + try: + return self._msg[name] if not Protobuf.use_pure \ + else getattr(self._msg, name) + except KeyError: + raise AttributeError + + def __setitem__(self, name, value): + self.__setattr__(name, value) + + def __getitem__(self, name): + return self.__getattr__(name) + + def get(self, name, default=None): + """Returns the value of an element of the message dictionary. + + Args: + name (string): Key name. + default (object): The default value if the key does not exists. + + Returns: + object: The value of the provided key name. + """ + return self.__dict__["_msg"].get(name, default) \ + if not Protobuf.use_pure \ + else getattr(self.__dict__["_msg"], name, default) + + def set_message(self, msg): + """Sets the message. + + Args: + msg (dict): Dictionary representing a message. + """ + self.__dict__["_msg"] = msg + + def get_message(self): + """Returns the dictionary representing a message containing parsed + data. + + Returns: + dict: The dictionary representing a message containing parsed data. + """ + return self.__dict__["_msg"] + + def serialize_to_string(self): + """Serializes a message to a string. + + Returns: + string: A string representing a message containing parsed data. + """ + return Protobuf.mysqlxpb.serialize_message(self._msg) + + @property + def type(self): + """string: Message type name.""" + return self._msg["_mysqlxpb_type_name"] if not Protobuf.use_pure \ + else self._msg.DESCRIPTOR.full_name + + @staticmethod + def parse(msg_type_name, payload): + """Creates a new message, initialized with parsed data. + + Args: + msg_type_name (string): Message type name. + payload (string): Serialized message data. + + Returns: + dict: The dictionary representing a message containing parsed data. + """ + return Protobuf.mysqlxpb.parse_message(msg_type_name, payload) + + @staticmethod + def parse_from_server(msg_type, payload): + """Creates a new server-side message, initialized with parsed data. + + Args: + msg_type (int): Message type. + payload (string): Serialized message data. + + Returns: + dict: The dictionary representing a message containing parsed data. + """ + return Protobuf.mysqlxpb.parse_server_message(msg_type, payload) + + @classmethod + def from_message(cls, msg_type_name, payload): + """Creates a new message, initialized with parsed data and returns a + :class:`mysqlx.protobuf.Message` object. + + Args: + msg_type_name (string): Message type name. + payload (string): Serialized message data. + + Returns: + mysqlx.protobuf.Message: The Message representing a message + containing parsed data. + """ + msg = cls() + msg.set_message(Protobuf.mysqlxpb.parse_message(msg_type_name, payload)) + return msg + + @classmethod + def from_server_message(cls, msg_type, payload): + """Creates a new server-side message, initialized with parsed data and + returns a :class:`mysqlx.protobuf.Message` object. + + Args: + msg_type (int): Message type. + payload (string): Serialized message data. + + Returns: + mysqlx.protobuf.Message: The Message representing a message + containing parsed data. + """ + msg = cls() + msg.set_message( + Protobuf.mysqlxpb.parse_server_message(msg_type, payload)) + return msg + + +def mysqlxpb_enum(name): + """Returns the value of a MySQL X Protobuf enumerator. + + Args: + name (string): MySQL X Protobuf numerator name. + + Returns: + int: Value of the enumerator. + """ + return Protobuf.mysqlxpb.enum_value(name) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_connection_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_connection_pb2.py new file mode 100644 index 0000000..bc6f32c --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_connection_pb2.py @@ -0,0 +1,225 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_connection.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from mysqlx.protobuf import mysqlx_datatypes_pb2 as mysqlx__datatypes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_connection.proto', + package='Mysqlx.Connection', + syntax='proto2', + serialized_pb=_b('\n\x17mysqlx_connection.proto\x12\x11Mysqlx.Connection\x1a\x16mysqlx_datatypes.proto\"@\n\nCapability\x12\x0c\n\x04name\x18\x01 \x02(\t\x12$\n\x05value\x18\x02 \x02(\x0b\x32\x15.Mysqlx.Datatypes.Any\"C\n\x0c\x43\x61pabilities\x12\x33\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32\x1d.Mysqlx.Connection.Capability\"\x11\n\x0f\x43\x61pabilitiesGet\"H\n\x0f\x43\x61pabilitiesSet\x12\x35\n\x0c\x63\x61pabilities\x18\x01 \x02(\x0b\x32\x1f.Mysqlx.Connection.Capabilities\"\x07\n\x05\x43loseB\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') + , + dependencies=[mysqlx__datatypes__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_CAPABILITY = _descriptor.Descriptor( + name='Capability', + full_name='Mysqlx.Connection.Capability', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Connection.Capability.name', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Connection.Capability.value', index=1, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=70, + serialized_end=134, +) + + +_CAPABILITIES = _descriptor.Descriptor( + name='Capabilities', + full_name='Mysqlx.Connection.Capabilities', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='capabilities', full_name='Mysqlx.Connection.Capabilities.capabilities', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=136, + serialized_end=203, +) + + +_CAPABILITIESGET = _descriptor.Descriptor( + name='CapabilitiesGet', + full_name='Mysqlx.Connection.CapabilitiesGet', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=205, + serialized_end=222, +) + + +_CAPABILITIESSET = _descriptor.Descriptor( + name='CapabilitiesSet', + full_name='Mysqlx.Connection.CapabilitiesSet', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='capabilities', full_name='Mysqlx.Connection.CapabilitiesSet.capabilities', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=224, + serialized_end=296, +) + + +_CLOSE = _descriptor.Descriptor( + name='Close', + full_name='Mysqlx.Connection.Close', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=298, + serialized_end=305, +) + +_CAPABILITY.fields_by_name['value'].message_type = mysqlx__datatypes__pb2._ANY +_CAPABILITIES.fields_by_name['capabilities'].message_type = _CAPABILITY +_CAPABILITIESSET.fields_by_name['capabilities'].message_type = _CAPABILITIES +DESCRIPTOR.message_types_by_name['Capability'] = _CAPABILITY +DESCRIPTOR.message_types_by_name['Capabilities'] = _CAPABILITIES +DESCRIPTOR.message_types_by_name['CapabilitiesGet'] = _CAPABILITIESGET +DESCRIPTOR.message_types_by_name['CapabilitiesSet'] = _CAPABILITIESSET +DESCRIPTOR.message_types_by_name['Close'] = _CLOSE + +Capability = _reflection.GeneratedProtocolMessageType('Capability', (_message.Message,), dict( + DESCRIPTOR = _CAPABILITY, + __module__ = 'mysqlx_connection_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Connection.Capability) + )) +_sym_db.RegisterMessage(Capability) + +Capabilities = _reflection.GeneratedProtocolMessageType('Capabilities', (_message.Message,), dict( + DESCRIPTOR = _CAPABILITIES, + __module__ = 'mysqlx_connection_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Connection.Capabilities) + )) +_sym_db.RegisterMessage(Capabilities) + +CapabilitiesGet = _reflection.GeneratedProtocolMessageType('CapabilitiesGet', (_message.Message,), dict( + DESCRIPTOR = _CAPABILITIESGET, + __module__ = 'mysqlx_connection_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Connection.CapabilitiesGet) + )) +_sym_db.RegisterMessage(CapabilitiesGet) + +CapabilitiesSet = _reflection.GeneratedProtocolMessageType('CapabilitiesSet', (_message.Message,), dict( + DESCRIPTOR = _CAPABILITIESSET, + __module__ = 'mysqlx_connection_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Connection.CapabilitiesSet) + )) +_sym_db.RegisterMessage(CapabilitiesSet) + +Close = _reflection.GeneratedProtocolMessageType('Close', (_message.Message,), dict( + DESCRIPTOR = _CLOSE, + __module__ = 'mysqlx_connection_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Connection.Close) + )) +_sym_db.RegisterMessage(Close) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_crud_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_crud_pb2.py new file mode 100644 index 0000000..da506db --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_crud_pb2.py @@ -0,0 +1,1195 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_crud.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from mysqlx.protobuf import mysqlx_expr_pb2 as mysqlx__expr__pb2 +from mysqlx.protobuf import mysqlx_datatypes_pb2 as mysqlx__datatypes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_crud.proto', + package='Mysqlx.Crud', + syntax='proto2', + serialized_pb=_b('\n\x11mysqlx_crud.proto\x12\x0bMysqlx.Crud\x1a\x11mysqlx_expr.proto\x1a\x16mysqlx_datatypes.proto\"[\n\x06\x43olumn\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\x34\n\rdocument_path\x18\x03 \x03(\x0b\x32\x1d.Mysqlx.Expr.DocumentPathItem\">\n\nProjection\x12!\n\x06source\x18\x01 \x02(\x0b\x32\x11.Mysqlx.Expr.Expr\x12\r\n\x05\x61lias\x18\x02 \x01(\t\"*\n\nCollection\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\x0e\n\x06schema\x18\x02 \x01(\t\"*\n\x05Limit\x12\x11\n\trow_count\x18\x01 \x02(\x04\x12\x0e\n\x06offset\x18\x02 \x01(\x04\"~\n\x05Order\x12\x1f\n\x04\x65xpr\x18\x01 \x02(\x0b\x32\x11.Mysqlx.Expr.Expr\x12\x34\n\tdirection\x18\x02 \x01(\x0e\x32\x1c.Mysqlx.Crud.Order.Direction:\x03\x41SC\"\x1e\n\tDirection\x12\x07\n\x03\x41SC\x10\x01\x12\x08\n\x04\x44\x45SC\x10\x02\"\xac\x02\n\x0fUpdateOperation\x12-\n\x06source\x18\x01 \x02(\x0b\x32\x1d.Mysqlx.Expr.ColumnIdentifier\x12:\n\toperation\x18\x02 \x02(\x0e\x32\'.Mysqlx.Crud.UpdateOperation.UpdateType\x12 \n\x05value\x18\x03 \x01(\x0b\x32\x11.Mysqlx.Expr.Expr\"\x8b\x01\n\nUpdateType\x12\x07\n\x03SET\x10\x01\x12\x0f\n\x0bITEM_REMOVE\x10\x02\x12\x0c\n\x08ITEM_SET\x10\x03\x12\x10\n\x0cITEM_REPLACE\x10\x04\x12\x0e\n\nITEM_MERGE\x10\x05\x12\x10\n\x0c\x41RRAY_INSERT\x10\x06\x12\x10\n\x0c\x41RRAY_APPEND\x10\x07\x12\x0f\n\x0bMERGE_PATCH\x10\x08\"\xb8\x04\n\x04\x46ind\x12+\n\ncollection\x18\x02 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12*\n\ndata_model\x18\x03 \x01(\x0e\x32\x16.Mysqlx.Crud.DataModel\x12+\n\nprojection\x18\x04 \x03(\x0b\x32\x17.Mysqlx.Crud.Projection\x12#\n\x08\x63riteria\x18\x05 \x01(\x0b\x32\x11.Mysqlx.Expr.Expr\x12&\n\x04\x61rgs\x18\x0b \x03(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12!\n\x05limit\x18\x06 \x01(\x0b\x32\x12.Mysqlx.Crud.Limit\x12!\n\x05order\x18\x07 \x03(\x0b\x32\x12.Mysqlx.Crud.Order\x12#\n\x08grouping\x18\x08 \x03(\x0b\x32\x11.Mysqlx.Expr.Expr\x12,\n\x11grouping_criteria\x18\t \x01(\x0b\x32\x11.Mysqlx.Expr.Expr\x12*\n\x07locking\x18\x0c \x01(\x0e\x32\x19.Mysqlx.Crud.Find.RowLock\x12\x39\n\x0flocking_options\x18\r \x01(\x0e\x32 .Mysqlx.Crud.Find.RowLockOptions\".\n\x07RowLock\x12\x0f\n\x0bSHARED_LOCK\x10\x01\x12\x12\n\x0e\x45XCLUSIVE_LOCK\x10\x02\"-\n\x0eRowLockOptions\x12\n\n\x06NOWAIT\x10\x01\x12\x0f\n\x0bSKIP_LOCKED\x10\x02\"\xa2\x02\n\x06Insert\x12+\n\ncollection\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12*\n\ndata_model\x18\x02 \x01(\x0e\x32\x16.Mysqlx.Crud.DataModel\x12\'\n\nprojection\x18\x03 \x03(\x0b\x32\x13.Mysqlx.Crud.Column\x12)\n\x03row\x18\x04 \x03(\x0b\x32\x1c.Mysqlx.Crud.Insert.TypedRow\x12&\n\x04\x61rgs\x18\x05 \x03(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12\x15\n\x06upsert\x18\x06 \x01(\x08:\x05\x66\x61lse\x1a,\n\x08TypedRow\x12 \n\x05\x66ield\x18\x01 \x03(\x0b\x32\x11.Mysqlx.Expr.Expr\"\xa5\x02\n\x06Update\x12+\n\ncollection\x18\x02 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12*\n\ndata_model\x18\x03 \x01(\x0e\x32\x16.Mysqlx.Crud.DataModel\x12#\n\x08\x63riteria\x18\x04 \x01(\x0b\x32\x11.Mysqlx.Expr.Expr\x12&\n\x04\x61rgs\x18\x08 \x03(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12!\n\x05limit\x18\x05 \x01(\x0b\x32\x12.Mysqlx.Crud.Limit\x12!\n\x05order\x18\x06 \x03(\x0b\x32\x12.Mysqlx.Crud.Order\x12/\n\toperation\x18\x07 \x03(\x0b\x32\x1c.Mysqlx.Crud.UpdateOperation\"\xf4\x01\n\x06\x44\x65lete\x12+\n\ncollection\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12*\n\ndata_model\x18\x02 \x01(\x0e\x32\x16.Mysqlx.Crud.DataModel\x12#\n\x08\x63riteria\x18\x03 \x01(\x0b\x32\x11.Mysqlx.Expr.Expr\x12&\n\x04\x61rgs\x18\x06 \x03(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12!\n\x05limit\x18\x04 \x01(\x0b\x32\x12.Mysqlx.Crud.Limit\x12!\n\x05order\x18\x05 \x03(\x0b\x32\x12.Mysqlx.Crud.Order\"\xbc\x02\n\nCreateView\x12+\n\ncollection\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12\x0f\n\x07\x64\x65\x66iner\x18\x02 \x01(\t\x12\x38\n\talgorithm\x18\x03 \x01(\x0e\x32\x1a.Mysqlx.Crud.ViewAlgorithm:\tUNDEFINED\x12\x37\n\x08security\x18\x04 \x01(\x0e\x32\x1c.Mysqlx.Crud.ViewSqlSecurity:\x07\x44\x45\x46INER\x12+\n\x05\x63heck\x18\x05 \x01(\x0e\x32\x1c.Mysqlx.Crud.ViewCheckOption\x12\x0e\n\x06\x63olumn\x18\x06 \x03(\t\x12\x1f\n\x04stmt\x18\x07 \x02(\x0b\x32\x11.Mysqlx.Crud.Find\x12\x1f\n\x10replace_existing\x18\x08 \x01(\x08:\x05\x66\x61lse\"\x87\x02\n\nModifyView\x12+\n\ncollection\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12\x0f\n\x07\x64\x65\x66iner\x18\x02 \x01(\t\x12-\n\talgorithm\x18\x03 \x01(\x0e\x32\x1a.Mysqlx.Crud.ViewAlgorithm\x12.\n\x08security\x18\x04 \x01(\x0e\x32\x1c.Mysqlx.Crud.ViewSqlSecurity\x12+\n\x05\x63heck\x18\x05 \x01(\x0e\x32\x1c.Mysqlx.Crud.ViewCheckOption\x12\x0e\n\x06\x63olumn\x18\x06 \x03(\t\x12\x1f\n\x04stmt\x18\x07 \x01(\x0b\x32\x11.Mysqlx.Crud.Find\"Q\n\x08\x44ropView\x12+\n\ncollection\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Crud.Collection\x12\x18\n\tif_exists\x18\x02 \x01(\x08:\x05\x66\x61lse*$\n\tDataModel\x12\x0c\n\x08\x44OCUMENT\x10\x01\x12\t\n\x05TABLE\x10\x02*8\n\rViewAlgorithm\x12\r\n\tUNDEFINED\x10\x01\x12\t\n\x05MERGE\x10\x02\x12\r\n\tTEMPTABLE\x10\x03*+\n\x0fViewSqlSecurity\x12\x0b\n\x07INVOKER\x10\x01\x12\x0b\n\x07\x44\x45\x46INER\x10\x02**\n\x0fViewCheckOption\x12\t\n\x05LOCAL\x10\x01\x12\x0c\n\x08\x43\x41SCADED\x10\x02\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') + , + dependencies=[mysqlx__expr__pb2.DESCRIPTOR,mysqlx__datatypes__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_DATAMODEL = _descriptor.EnumDescriptor( + name='DataModel', + full_name='Mysqlx.Crud.DataModel', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DOCUMENT', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TABLE', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2828, + serialized_end=2864, +) +_sym_db.RegisterEnumDescriptor(_DATAMODEL) + +DataModel = enum_type_wrapper.EnumTypeWrapper(_DATAMODEL) +_VIEWALGORITHM = _descriptor.EnumDescriptor( + name='ViewAlgorithm', + full_name='Mysqlx.Crud.ViewAlgorithm', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNDEFINED', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MERGE', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TEMPTABLE', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2866, + serialized_end=2922, +) +_sym_db.RegisterEnumDescriptor(_VIEWALGORITHM) + +ViewAlgorithm = enum_type_wrapper.EnumTypeWrapper(_VIEWALGORITHM) +_VIEWSQLSECURITY = _descriptor.EnumDescriptor( + name='ViewSqlSecurity', + full_name='Mysqlx.Crud.ViewSqlSecurity', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='INVOKER', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DEFINER', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2924, + serialized_end=2967, +) +_sym_db.RegisterEnumDescriptor(_VIEWSQLSECURITY) + +ViewSqlSecurity = enum_type_wrapper.EnumTypeWrapper(_VIEWSQLSECURITY) +_VIEWCHECKOPTION = _descriptor.EnumDescriptor( + name='ViewCheckOption', + full_name='Mysqlx.Crud.ViewCheckOption', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='LOCAL', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CASCADED', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2969, + serialized_end=3011, +) +_sym_db.RegisterEnumDescriptor(_VIEWCHECKOPTION) + +ViewCheckOption = enum_type_wrapper.EnumTypeWrapper(_VIEWCHECKOPTION) +DOCUMENT = 1 +TABLE = 2 +UNDEFINED = 1 +MERGE = 2 +TEMPTABLE = 3 +INVOKER = 1 +DEFINER = 2 +LOCAL = 1 +CASCADED = 2 + + +_ORDER_DIRECTION = _descriptor.EnumDescriptor( + name='Direction', + full_name='Mysqlx.Crud.Order.Direction', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ASC', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DESC', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=418, + serialized_end=448, +) +_sym_db.RegisterEnumDescriptor(_ORDER_DIRECTION) + +_UPDATEOPERATION_UPDATETYPE = _descriptor.EnumDescriptor( + name='UpdateType', + full_name='Mysqlx.Crud.UpdateOperation.UpdateType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SET', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ITEM_REMOVE', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ITEM_SET', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ITEM_REPLACE', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ITEM_MERGE', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY_INSERT', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY_APPEND', index=6, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MERGE_PATCH', index=7, number=8, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=612, + serialized_end=751, +) +_sym_db.RegisterEnumDescriptor(_UPDATEOPERATION_UPDATETYPE) + +_FIND_ROWLOCK = _descriptor.EnumDescriptor( + name='RowLock', + full_name='Mysqlx.Crud.Find.RowLock', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SHARED_LOCK', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXCLUSIVE_LOCK', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=1229, + serialized_end=1275, +) +_sym_db.RegisterEnumDescriptor(_FIND_ROWLOCK) + +_FIND_ROWLOCKOPTIONS = _descriptor.EnumDescriptor( + name='RowLockOptions', + full_name='Mysqlx.Crud.Find.RowLockOptions', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='NOWAIT', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SKIP_LOCKED', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=1277, + serialized_end=1322, +) +_sym_db.RegisterEnumDescriptor(_FIND_ROWLOCKOPTIONS) + + +_COLUMN = _descriptor.Descriptor( + name='Column', + full_name='Mysqlx.Crud.Column', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Crud.Column.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='alias', full_name='Mysqlx.Crud.Column.alias', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='document_path', full_name='Mysqlx.Crud.Column.document_path', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=77, + serialized_end=168, +) + + +_PROJECTION = _descriptor.Descriptor( + name='Projection', + full_name='Mysqlx.Crud.Projection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='source', full_name='Mysqlx.Crud.Projection.source', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='alias', full_name='Mysqlx.Crud.Projection.alias', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=170, + serialized_end=232, +) + + +_COLLECTION = _descriptor.Descriptor( + name='Collection', + full_name='Mysqlx.Crud.Collection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Crud.Collection.name', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='schema', full_name='Mysqlx.Crud.Collection.schema', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=234, + serialized_end=276, +) + + +_LIMIT = _descriptor.Descriptor( + name='Limit', + full_name='Mysqlx.Crud.Limit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='row_count', full_name='Mysqlx.Crud.Limit.row_count', index=0, + number=1, type=4, cpp_type=4, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='offset', full_name='Mysqlx.Crud.Limit.offset', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=278, + serialized_end=320, +) + + +_ORDER = _descriptor.Descriptor( + name='Order', + full_name='Mysqlx.Crud.Order', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='expr', full_name='Mysqlx.Crud.Order.expr', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='direction', full_name='Mysqlx.Crud.Order.direction', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _ORDER_DIRECTION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=322, + serialized_end=448, +) + + +_UPDATEOPERATION = _descriptor.Descriptor( + name='UpdateOperation', + full_name='Mysqlx.Crud.UpdateOperation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='source', full_name='Mysqlx.Crud.UpdateOperation.source', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='operation', full_name='Mysqlx.Crud.UpdateOperation.operation', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Crud.UpdateOperation.value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _UPDATEOPERATION_UPDATETYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=451, + serialized_end=751, +) + + +_FIND = _descriptor.Descriptor( + name='Find', + full_name='Mysqlx.Crud.Find', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.Find.collection', index=0, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data_model', full_name='Mysqlx.Crud.Find.data_model', index=1, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='projection', full_name='Mysqlx.Crud.Find.projection', index=2, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='criteria', full_name='Mysqlx.Crud.Find.criteria', index=3, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='args', full_name='Mysqlx.Crud.Find.args', index=4, + number=11, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='limit', full_name='Mysqlx.Crud.Find.limit', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='order', full_name='Mysqlx.Crud.Find.order', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='grouping', full_name='Mysqlx.Crud.Find.grouping', index=7, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='grouping_criteria', full_name='Mysqlx.Crud.Find.grouping_criteria', index=8, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='locking', full_name='Mysqlx.Crud.Find.locking', index=9, + number=12, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='locking_options', full_name='Mysqlx.Crud.Find.locking_options', index=10, + number=13, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _FIND_ROWLOCK, + _FIND_ROWLOCKOPTIONS, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=754, + serialized_end=1322, +) + + +_INSERT_TYPEDROW = _descriptor.Descriptor( + name='TypedRow', + full_name='Mysqlx.Crud.Insert.TypedRow', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='field', full_name='Mysqlx.Crud.Insert.TypedRow.field', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1571, + serialized_end=1615, +) + +_INSERT = _descriptor.Descriptor( + name='Insert', + full_name='Mysqlx.Crud.Insert', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.Insert.collection', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data_model', full_name='Mysqlx.Crud.Insert.data_model', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='projection', full_name='Mysqlx.Crud.Insert.projection', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='row', full_name='Mysqlx.Crud.Insert.row', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='args', full_name='Mysqlx.Crud.Insert.args', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='upsert', full_name='Mysqlx.Crud.Insert.upsert', index=5, + number=6, type=8, cpp_type=7, label=1, + has_default_value=True, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_INSERT_TYPEDROW, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1325, + serialized_end=1615, +) + + +_UPDATE = _descriptor.Descriptor( + name='Update', + full_name='Mysqlx.Crud.Update', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.Update.collection', index=0, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data_model', full_name='Mysqlx.Crud.Update.data_model', index=1, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='criteria', full_name='Mysqlx.Crud.Update.criteria', index=2, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='args', full_name='Mysqlx.Crud.Update.args', index=3, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='limit', full_name='Mysqlx.Crud.Update.limit', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='order', full_name='Mysqlx.Crud.Update.order', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='operation', full_name='Mysqlx.Crud.Update.operation', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1618, + serialized_end=1911, +) + + +_DELETE = _descriptor.Descriptor( + name='Delete', + full_name='Mysqlx.Crud.Delete', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.Delete.collection', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data_model', full_name='Mysqlx.Crud.Delete.data_model', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='criteria', full_name='Mysqlx.Crud.Delete.criteria', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='args', full_name='Mysqlx.Crud.Delete.args', index=3, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='limit', full_name='Mysqlx.Crud.Delete.limit', index=4, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='order', full_name='Mysqlx.Crud.Delete.order', index=5, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1914, + serialized_end=2158, +) + + +_CREATEVIEW = _descriptor.Descriptor( + name='CreateView', + full_name='Mysqlx.Crud.CreateView', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.CreateView.collection', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='definer', full_name='Mysqlx.Crud.CreateView.definer', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='algorithm', full_name='Mysqlx.Crud.CreateView.algorithm', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='security', full_name='Mysqlx.Crud.CreateView.security', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=2, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='check', full_name='Mysqlx.Crud.CreateView.check', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='column', full_name='Mysqlx.Crud.CreateView.column', index=5, + number=6, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stmt', full_name='Mysqlx.Crud.CreateView.stmt', index=6, + number=7, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='replace_existing', full_name='Mysqlx.Crud.CreateView.replace_existing', index=7, + number=8, type=8, cpp_type=7, label=1, + has_default_value=True, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2161, + serialized_end=2477, +) + + +_MODIFYVIEW = _descriptor.Descriptor( + name='ModifyView', + full_name='Mysqlx.Crud.ModifyView', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.ModifyView.collection', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='definer', full_name='Mysqlx.Crud.ModifyView.definer', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='algorithm', full_name='Mysqlx.Crud.ModifyView.algorithm', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='security', full_name='Mysqlx.Crud.ModifyView.security', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='check', full_name='Mysqlx.Crud.ModifyView.check', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='column', full_name='Mysqlx.Crud.ModifyView.column', index=5, + number=6, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stmt', full_name='Mysqlx.Crud.ModifyView.stmt', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2480, + serialized_end=2743, +) + + +_DROPVIEW = _descriptor.Descriptor( + name='DropView', + full_name='Mysqlx.Crud.DropView', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='collection', full_name='Mysqlx.Crud.DropView.collection', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='if_exists', full_name='Mysqlx.Crud.DropView.if_exists', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=True, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2745, + serialized_end=2826, +) + +_COLUMN.fields_by_name['document_path'].message_type = mysqlx__expr__pb2._DOCUMENTPATHITEM +_PROJECTION.fields_by_name['source'].message_type = mysqlx__expr__pb2._EXPR +_ORDER.fields_by_name['expr'].message_type = mysqlx__expr__pb2._EXPR +_ORDER.fields_by_name['direction'].enum_type = _ORDER_DIRECTION +_ORDER_DIRECTION.containing_type = _ORDER +_UPDATEOPERATION.fields_by_name['source'].message_type = mysqlx__expr__pb2._COLUMNIDENTIFIER +_UPDATEOPERATION.fields_by_name['operation'].enum_type = _UPDATEOPERATION_UPDATETYPE +_UPDATEOPERATION.fields_by_name['value'].message_type = mysqlx__expr__pb2._EXPR +_UPDATEOPERATION_UPDATETYPE.containing_type = _UPDATEOPERATION +_FIND.fields_by_name['collection'].message_type = _COLLECTION +_FIND.fields_by_name['data_model'].enum_type = _DATAMODEL +_FIND.fields_by_name['projection'].message_type = _PROJECTION +_FIND.fields_by_name['criteria'].message_type = mysqlx__expr__pb2._EXPR +_FIND.fields_by_name['args'].message_type = mysqlx__datatypes__pb2._SCALAR +_FIND.fields_by_name['limit'].message_type = _LIMIT +_FIND.fields_by_name['order'].message_type = _ORDER +_FIND.fields_by_name['grouping'].message_type = mysqlx__expr__pb2._EXPR +_FIND.fields_by_name['grouping_criteria'].message_type = mysqlx__expr__pb2._EXPR +_FIND.fields_by_name['locking'].enum_type = _FIND_ROWLOCK +_FIND.fields_by_name['locking_options'].enum_type = _FIND_ROWLOCKOPTIONS +_FIND_ROWLOCK.containing_type = _FIND +_FIND_ROWLOCKOPTIONS.containing_type = _FIND +_INSERT_TYPEDROW.fields_by_name['field'].message_type = mysqlx__expr__pb2._EXPR +_INSERT_TYPEDROW.containing_type = _INSERT +_INSERT.fields_by_name['collection'].message_type = _COLLECTION +_INSERT.fields_by_name['data_model'].enum_type = _DATAMODEL +_INSERT.fields_by_name['projection'].message_type = _COLUMN +_INSERT.fields_by_name['row'].message_type = _INSERT_TYPEDROW +_INSERT.fields_by_name['args'].message_type = mysqlx__datatypes__pb2._SCALAR +_UPDATE.fields_by_name['collection'].message_type = _COLLECTION +_UPDATE.fields_by_name['data_model'].enum_type = _DATAMODEL +_UPDATE.fields_by_name['criteria'].message_type = mysqlx__expr__pb2._EXPR +_UPDATE.fields_by_name['args'].message_type = mysqlx__datatypes__pb2._SCALAR +_UPDATE.fields_by_name['limit'].message_type = _LIMIT +_UPDATE.fields_by_name['order'].message_type = _ORDER +_UPDATE.fields_by_name['operation'].message_type = _UPDATEOPERATION +_DELETE.fields_by_name['collection'].message_type = _COLLECTION +_DELETE.fields_by_name['data_model'].enum_type = _DATAMODEL +_DELETE.fields_by_name['criteria'].message_type = mysqlx__expr__pb2._EXPR +_DELETE.fields_by_name['args'].message_type = mysqlx__datatypes__pb2._SCALAR +_DELETE.fields_by_name['limit'].message_type = _LIMIT +_DELETE.fields_by_name['order'].message_type = _ORDER +_CREATEVIEW.fields_by_name['collection'].message_type = _COLLECTION +_CREATEVIEW.fields_by_name['algorithm'].enum_type = _VIEWALGORITHM +_CREATEVIEW.fields_by_name['security'].enum_type = _VIEWSQLSECURITY +_CREATEVIEW.fields_by_name['check'].enum_type = _VIEWCHECKOPTION +_CREATEVIEW.fields_by_name['stmt'].message_type = _FIND +_MODIFYVIEW.fields_by_name['collection'].message_type = _COLLECTION +_MODIFYVIEW.fields_by_name['algorithm'].enum_type = _VIEWALGORITHM +_MODIFYVIEW.fields_by_name['security'].enum_type = _VIEWSQLSECURITY +_MODIFYVIEW.fields_by_name['check'].enum_type = _VIEWCHECKOPTION +_MODIFYVIEW.fields_by_name['stmt'].message_type = _FIND +_DROPVIEW.fields_by_name['collection'].message_type = _COLLECTION +DESCRIPTOR.message_types_by_name['Column'] = _COLUMN +DESCRIPTOR.message_types_by_name['Projection'] = _PROJECTION +DESCRIPTOR.message_types_by_name['Collection'] = _COLLECTION +DESCRIPTOR.message_types_by_name['Limit'] = _LIMIT +DESCRIPTOR.message_types_by_name['Order'] = _ORDER +DESCRIPTOR.message_types_by_name['UpdateOperation'] = _UPDATEOPERATION +DESCRIPTOR.message_types_by_name['Find'] = _FIND +DESCRIPTOR.message_types_by_name['Insert'] = _INSERT +DESCRIPTOR.message_types_by_name['Update'] = _UPDATE +DESCRIPTOR.message_types_by_name['Delete'] = _DELETE +DESCRIPTOR.message_types_by_name['CreateView'] = _CREATEVIEW +DESCRIPTOR.message_types_by_name['ModifyView'] = _MODIFYVIEW +DESCRIPTOR.message_types_by_name['DropView'] = _DROPVIEW +DESCRIPTOR.enum_types_by_name['DataModel'] = _DATAMODEL +DESCRIPTOR.enum_types_by_name['ViewAlgorithm'] = _VIEWALGORITHM +DESCRIPTOR.enum_types_by_name['ViewSqlSecurity'] = _VIEWSQLSECURITY +DESCRIPTOR.enum_types_by_name['ViewCheckOption'] = _VIEWCHECKOPTION + +Column = _reflection.GeneratedProtocolMessageType('Column', (_message.Message,), dict( + DESCRIPTOR = _COLUMN, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Column) + )) +_sym_db.RegisterMessage(Column) + +Projection = _reflection.GeneratedProtocolMessageType('Projection', (_message.Message,), dict( + DESCRIPTOR = _PROJECTION, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Projection) + )) +_sym_db.RegisterMessage(Projection) + +Collection = _reflection.GeneratedProtocolMessageType('Collection', (_message.Message,), dict( + DESCRIPTOR = _COLLECTION, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Collection) + )) +_sym_db.RegisterMessage(Collection) + +Limit = _reflection.GeneratedProtocolMessageType('Limit', (_message.Message,), dict( + DESCRIPTOR = _LIMIT, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Limit) + )) +_sym_db.RegisterMessage(Limit) + +Order = _reflection.GeneratedProtocolMessageType('Order', (_message.Message,), dict( + DESCRIPTOR = _ORDER, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Order) + )) +_sym_db.RegisterMessage(Order) + +UpdateOperation = _reflection.GeneratedProtocolMessageType('UpdateOperation', (_message.Message,), dict( + DESCRIPTOR = _UPDATEOPERATION, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.UpdateOperation) + )) +_sym_db.RegisterMessage(UpdateOperation) + +Find = _reflection.GeneratedProtocolMessageType('Find', (_message.Message,), dict( + DESCRIPTOR = _FIND, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Find) + )) +_sym_db.RegisterMessage(Find) + +Insert = _reflection.GeneratedProtocolMessageType('Insert', (_message.Message,), dict( + + TypedRow = _reflection.GeneratedProtocolMessageType('TypedRow', (_message.Message,), dict( + DESCRIPTOR = _INSERT_TYPEDROW, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Insert.TypedRow) + )) + , + DESCRIPTOR = _INSERT, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Insert) + )) +_sym_db.RegisterMessage(Insert) +_sym_db.RegisterMessage(Insert.TypedRow) + +Update = _reflection.GeneratedProtocolMessageType('Update', (_message.Message,), dict( + DESCRIPTOR = _UPDATE, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Update) + )) +_sym_db.RegisterMessage(Update) + +Delete = _reflection.GeneratedProtocolMessageType('Delete', (_message.Message,), dict( + DESCRIPTOR = _DELETE, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.Delete) + )) +_sym_db.RegisterMessage(Delete) + +CreateView = _reflection.GeneratedProtocolMessageType('CreateView', (_message.Message,), dict( + DESCRIPTOR = _CREATEVIEW, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.CreateView) + )) +_sym_db.RegisterMessage(CreateView) + +ModifyView = _reflection.GeneratedProtocolMessageType('ModifyView', (_message.Message,), dict( + DESCRIPTOR = _MODIFYVIEW, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.ModifyView) + )) +_sym_db.RegisterMessage(ModifyView) + +DropView = _reflection.GeneratedProtocolMessageType('DropView', (_message.Message,), dict( + DESCRIPTOR = _DROPVIEW, + __module__ = 'mysqlx_crud_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Crud.DropView) + )) +_sym_db.RegisterMessage(DropView) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_datatypes_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_datatypes_pb2.py new file mode 100644 index 0000000..8368342 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_datatypes_pb2.py @@ -0,0 +1,482 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_datatypes.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_datatypes.proto', + package='Mysqlx.Datatypes', + syntax='proto2', + serialized_pb=_b('\n\x16mysqlx_datatypes.proto\x12\x10Mysqlx.Datatypes\"\xc6\x03\n\x06Scalar\x12+\n\x04type\x18\x01 \x02(\x0e\x32\x1d.Mysqlx.Datatypes.Scalar.Type\x12\x14\n\x0cv_signed_int\x18\x02 \x01(\x12\x12\x16\n\x0ev_unsigned_int\x18\x03 \x01(\x04\x12\x31\n\x08v_octets\x18\x05 \x01(\x0b\x32\x1f.Mysqlx.Datatypes.Scalar.Octets\x12\x10\n\x08v_double\x18\x06 \x01(\x01\x12\x0f\n\x07v_float\x18\x07 \x01(\x02\x12\x0e\n\x06v_bool\x18\x08 \x01(\x08\x12\x31\n\x08v_string\x18\t \x01(\x0b\x32\x1f.Mysqlx.Datatypes.Scalar.String\x1a*\n\x06String\x12\r\n\x05value\x18\x01 \x02(\x0c\x12\x11\n\tcollation\x18\x02 \x01(\x04\x1a-\n\x06Octets\x12\r\n\x05value\x18\x01 \x02(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x02 \x01(\r\"m\n\x04Type\x12\n\n\x06V_SINT\x10\x01\x12\n\n\x06V_UINT\x10\x02\x12\n\n\x06V_NULL\x10\x03\x12\x0c\n\x08V_OCTETS\x10\x04\x12\x0c\n\x08V_DOUBLE\x10\x05\x12\x0b\n\x07V_FLOAT\x10\x06\x12\n\n\x06V_BOOL\x10\x07\x12\x0c\n\x08V_STRING\x10\x08\"}\n\x06Object\x12\x31\n\x03\x66ld\x18\x01 \x03(\x0b\x32$.Mysqlx.Datatypes.Object.ObjectField\x1a@\n\x0bObjectField\x12\x0b\n\x03key\x18\x01 \x02(\t\x12$\n\x05value\x18\x02 \x02(\x0b\x32\x15.Mysqlx.Datatypes.Any\"-\n\x05\x41rray\x12$\n\x05value\x18\x01 \x03(\x0b\x32\x15.Mysqlx.Datatypes.Any\"\xd3\x01\n\x03\x41ny\x12(\n\x04type\x18\x01 \x02(\x0e\x32\x1a.Mysqlx.Datatypes.Any.Type\x12(\n\x06scalar\x18\x02 \x01(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12%\n\x03obj\x18\x03 \x01(\x0b\x32\x18.Mysqlx.Datatypes.Object\x12&\n\x05\x61rray\x18\x04 \x01(\x0b\x32\x17.Mysqlx.Datatypes.Array\")\n\x04Type\x12\n\n\x06SCALAR\x10\x01\x12\n\n\x06OBJECT\x10\x02\x12\t\n\x05\x41RRAY\x10\x03\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SCALAR_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.Datatypes.Scalar.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='V_SINT', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_UINT', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_NULL', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_OCTETS', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_DOUBLE', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_FLOAT', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_BOOL', index=6, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='V_STRING', index=7, number=8, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=390, + serialized_end=499, +) +_sym_db.RegisterEnumDescriptor(_SCALAR_TYPE) + +_ANY_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.Datatypes.Any.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SCALAR', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OBJECT', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=846, + serialized_end=887, +) +_sym_db.RegisterEnumDescriptor(_ANY_TYPE) + + +_SCALAR_STRING = _descriptor.Descriptor( + name='String', + full_name='Mysqlx.Datatypes.Scalar.String', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Datatypes.Scalar.String.value', index=0, + number=1, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='collation', full_name='Mysqlx.Datatypes.Scalar.String.collation', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=299, + serialized_end=341, +) + +_SCALAR_OCTETS = _descriptor.Descriptor( + name='Octets', + full_name='Mysqlx.Datatypes.Scalar.Octets', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Datatypes.Scalar.Octets.value', index=0, + number=1, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='content_type', full_name='Mysqlx.Datatypes.Scalar.Octets.content_type', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=343, + serialized_end=388, +) + +_SCALAR = _descriptor.Descriptor( + name='Scalar', + full_name='Mysqlx.Datatypes.Scalar', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Datatypes.Scalar.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_signed_int', full_name='Mysqlx.Datatypes.Scalar.v_signed_int', index=1, + number=2, type=18, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_unsigned_int', full_name='Mysqlx.Datatypes.Scalar.v_unsigned_int', index=2, + number=3, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_octets', full_name='Mysqlx.Datatypes.Scalar.v_octets', index=3, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_double', full_name='Mysqlx.Datatypes.Scalar.v_double', index=4, + number=6, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_float', full_name='Mysqlx.Datatypes.Scalar.v_float', index=5, + number=7, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_bool', full_name='Mysqlx.Datatypes.Scalar.v_bool', index=6, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='v_string', full_name='Mysqlx.Datatypes.Scalar.v_string', index=7, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_SCALAR_STRING, _SCALAR_OCTETS, ], + enum_types=[ + _SCALAR_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=45, + serialized_end=499, +) + + +_OBJECT_OBJECTFIELD = _descriptor.Descriptor( + name='ObjectField', + full_name='Mysqlx.Datatypes.Object.ObjectField', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='Mysqlx.Datatypes.Object.ObjectField.key', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Datatypes.Object.ObjectField.value', index=1, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=562, + serialized_end=626, +) + +_OBJECT = _descriptor.Descriptor( + name='Object', + full_name='Mysqlx.Datatypes.Object', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='fld', full_name='Mysqlx.Datatypes.Object.fld', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_OBJECT_OBJECTFIELD, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=501, + serialized_end=626, +) + + +_ARRAY = _descriptor.Descriptor( + name='Array', + full_name='Mysqlx.Datatypes.Array', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Datatypes.Array.value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=628, + serialized_end=673, +) + + +_ANY = _descriptor.Descriptor( + name='Any', + full_name='Mysqlx.Datatypes.Any', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Datatypes.Any.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='scalar', full_name='Mysqlx.Datatypes.Any.scalar', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='obj', full_name='Mysqlx.Datatypes.Any.obj', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='array', full_name='Mysqlx.Datatypes.Any.array', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _ANY_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=887, +) + +_SCALAR_STRING.containing_type = _SCALAR +_SCALAR_OCTETS.containing_type = _SCALAR +_SCALAR.fields_by_name['type'].enum_type = _SCALAR_TYPE +_SCALAR.fields_by_name['v_octets'].message_type = _SCALAR_OCTETS +_SCALAR.fields_by_name['v_string'].message_type = _SCALAR_STRING +_SCALAR_TYPE.containing_type = _SCALAR +_OBJECT_OBJECTFIELD.fields_by_name['value'].message_type = _ANY +_OBJECT_OBJECTFIELD.containing_type = _OBJECT +_OBJECT.fields_by_name['fld'].message_type = _OBJECT_OBJECTFIELD +_ARRAY.fields_by_name['value'].message_type = _ANY +_ANY.fields_by_name['type'].enum_type = _ANY_TYPE +_ANY.fields_by_name['scalar'].message_type = _SCALAR +_ANY.fields_by_name['obj'].message_type = _OBJECT +_ANY.fields_by_name['array'].message_type = _ARRAY +_ANY_TYPE.containing_type = _ANY +DESCRIPTOR.message_types_by_name['Scalar'] = _SCALAR +DESCRIPTOR.message_types_by_name['Object'] = _OBJECT +DESCRIPTOR.message_types_by_name['Array'] = _ARRAY +DESCRIPTOR.message_types_by_name['Any'] = _ANY + +Scalar = _reflection.GeneratedProtocolMessageType('Scalar', (_message.Message,), dict( + + String = _reflection.GeneratedProtocolMessageType('String', (_message.Message,), dict( + DESCRIPTOR = _SCALAR_STRING, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Scalar.String) + )) + , + + Octets = _reflection.GeneratedProtocolMessageType('Octets', (_message.Message,), dict( + DESCRIPTOR = _SCALAR_OCTETS, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Scalar.Octets) + )) + , + DESCRIPTOR = _SCALAR, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Scalar) + )) +_sym_db.RegisterMessage(Scalar) +_sym_db.RegisterMessage(Scalar.String) +_sym_db.RegisterMessage(Scalar.Octets) + +Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), dict( + + ObjectField = _reflection.GeneratedProtocolMessageType('ObjectField', (_message.Message,), dict( + DESCRIPTOR = _OBJECT_OBJECTFIELD, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Object.ObjectField) + )) + , + DESCRIPTOR = _OBJECT, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Object) + )) +_sym_db.RegisterMessage(Object) +_sym_db.RegisterMessage(Object.ObjectField) + +Array = _reflection.GeneratedProtocolMessageType('Array', (_message.Message,), dict( + DESCRIPTOR = _ARRAY, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Array) + )) +_sym_db.RegisterMessage(Array) + +Any = _reflection.GeneratedProtocolMessageType('Any', (_message.Message,), dict( + DESCRIPTOR = _ANY, + __module__ = 'mysqlx_datatypes_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Datatypes.Any) + )) +_sym_db.RegisterMessage(Any) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expect_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expect_pb2.py new file mode 100644 index 0000000..f19f3a4 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expect_pb2.py @@ -0,0 +1,242 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_expect.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_expect.proto', + package='Mysqlx.Expect', + syntax='proto2', + serialized_pb=_b('\n\x13mysqlx_expect.proto\x12\rMysqlx.Expect\"\xd0\x03\n\x04Open\x12\x42\n\x02op\x18\x01 \x01(\x0e\x32 .Mysqlx.Expect.Open.CtxOperation:\x14\x45XPECT_CTX_COPY_PREV\x12+\n\x04\x63ond\x18\x02 \x03(\x0b\x32\x1d.Mysqlx.Expect.Open.Condition\x1a\x96\x02\n\tCondition\x12\x15\n\rcondition_key\x18\x01 \x02(\r\x12\x17\n\x0f\x63ondition_value\x18\x02 \x01(\x0c\x12K\n\x02op\x18\x03 \x01(\x0e\x32\x30.Mysqlx.Expect.Open.Condition.ConditionOperation:\rEXPECT_OP_SET\"N\n\x03Key\x12\x13\n\x0f\x45XPECT_NO_ERROR\x10\x01\x12\x16\n\x12\x45XPECT_FIELD_EXIST\x10\x02\x12\x1a\n\x16\x45XPECT_DOCID_GENERATED\x10\x03\"<\n\x12\x43onditionOperation\x12\x11\n\rEXPECT_OP_SET\x10\x00\x12\x13\n\x0f\x45XPECT_OP_UNSET\x10\x01\">\n\x0c\x43txOperation\x12\x18\n\x14\x45XPECT_CTX_COPY_PREV\x10\x00\x12\x14\n\x10\x45XPECT_CTX_EMPTY\x10\x01\"\x07\n\x05\x43loseB\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_OPEN_CONDITION_KEY = _descriptor.EnumDescriptor( + name='Key', + full_name='Mysqlx.Expect.Open.Condition.Key', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='EXPECT_NO_ERROR', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_FIELD_EXIST', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_DOCID_GENERATED', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=299, + serialized_end=377, +) +_sym_db.RegisterEnumDescriptor(_OPEN_CONDITION_KEY) + +_OPEN_CONDITION_CONDITIONOPERATION = _descriptor.EnumDescriptor( + name='ConditionOperation', + full_name='Mysqlx.Expect.Open.Condition.ConditionOperation', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='EXPECT_OP_SET', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_OP_UNSET', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=379, + serialized_end=439, +) +_sym_db.RegisterEnumDescriptor(_OPEN_CONDITION_CONDITIONOPERATION) + +_OPEN_CTXOPERATION = _descriptor.EnumDescriptor( + name='CtxOperation', + full_name='Mysqlx.Expect.Open.CtxOperation', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='EXPECT_CTX_COPY_PREV', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_CTX_EMPTY', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=441, + serialized_end=503, +) +_sym_db.RegisterEnumDescriptor(_OPEN_CTXOPERATION) + + +_OPEN_CONDITION = _descriptor.Descriptor( + name='Condition', + full_name='Mysqlx.Expect.Open.Condition', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='condition_key', full_name='Mysqlx.Expect.Open.Condition.condition_key', index=0, + number=1, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='condition_value', full_name='Mysqlx.Expect.Open.Condition.condition_value', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='op', full_name='Mysqlx.Expect.Open.Condition.op', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _OPEN_CONDITION_KEY, + _OPEN_CONDITION_CONDITIONOPERATION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=161, + serialized_end=439, +) + +_OPEN = _descriptor.Descriptor( + name='Open', + full_name='Mysqlx.Expect.Open', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='Mysqlx.Expect.Open.op', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='cond', full_name='Mysqlx.Expect.Open.cond', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_OPEN_CONDITION, ], + enum_types=[ + _OPEN_CTXOPERATION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=39, + serialized_end=503, +) + + +_CLOSE = _descriptor.Descriptor( + name='Close', + full_name='Mysqlx.Expect.Close', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=505, + serialized_end=512, +) + +_OPEN_CONDITION.fields_by_name['op'].enum_type = _OPEN_CONDITION_CONDITIONOPERATION +_OPEN_CONDITION.containing_type = _OPEN +_OPEN_CONDITION_KEY.containing_type = _OPEN_CONDITION +_OPEN_CONDITION_CONDITIONOPERATION.containing_type = _OPEN_CONDITION +_OPEN.fields_by_name['op'].enum_type = _OPEN_CTXOPERATION +_OPEN.fields_by_name['cond'].message_type = _OPEN_CONDITION +_OPEN_CTXOPERATION.containing_type = _OPEN +DESCRIPTOR.message_types_by_name['Open'] = _OPEN +DESCRIPTOR.message_types_by_name['Close'] = _CLOSE + +Open = _reflection.GeneratedProtocolMessageType('Open', (_message.Message,), dict( + + Condition = _reflection.GeneratedProtocolMessageType('Condition', (_message.Message,), dict( + DESCRIPTOR = _OPEN_CONDITION, + __module__ = 'mysqlx_expect_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expect.Open.Condition) + )) + , + DESCRIPTOR = _OPEN, + __module__ = 'mysqlx_expect_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expect.Open) + )) +_sym_db.RegisterMessage(Open) +_sym_db.RegisterMessage(Open.Condition) + +Close = _reflection.GeneratedProtocolMessageType('Close', (_message.Message,), dict( + DESCRIPTOR = _CLOSE, + __module__ = 'mysqlx_expect_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expect.Close) + )) +_sym_db.RegisterMessage(Close) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expr_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expr_pb2.py new file mode 100644 index 0000000..9de43a4 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_expr_pb2.py @@ -0,0 +1,603 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_expr.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from mysqlx.protobuf import mysqlx_datatypes_pb2 as mysqlx__datatypes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_expr.proto', + package='Mysqlx.Expr', + syntax='proto2', + serialized_pb=_b('\n\x11mysqlx_expr.proto\x12\x0bMysqlx.Expr\x1a\x16mysqlx_datatypes.proto\"\xc4\x03\n\x04\x45xpr\x12$\n\x04type\x18\x01 \x02(\x0e\x32\x16.Mysqlx.Expr.Expr.Type\x12\x31\n\nidentifier\x18\x02 \x01(\x0b\x32\x1d.Mysqlx.Expr.ColumnIdentifier\x12\x10\n\x08variable\x18\x03 \x01(\t\x12)\n\x07literal\x18\x04 \x01(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\x12\x30\n\rfunction_call\x18\x05 \x01(\x0b\x32\x19.Mysqlx.Expr.FunctionCall\x12\'\n\x08operator\x18\x06 \x01(\x0b\x32\x15.Mysqlx.Expr.Operator\x12\x10\n\x08position\x18\x07 \x01(\r\x12#\n\x06object\x18\x08 \x01(\x0b\x32\x13.Mysqlx.Expr.Object\x12!\n\x05\x61rray\x18\t \x01(\x0b\x32\x12.Mysqlx.Expr.Array\"q\n\x04Type\x12\t\n\x05IDENT\x10\x01\x12\x0b\n\x07LITERAL\x10\x02\x12\x0c\n\x08VARIABLE\x10\x03\x12\r\n\tFUNC_CALL\x10\x04\x12\x0c\n\x08OPERATOR\x10\x05\x12\x0f\n\x0bPLACEHOLDER\x10\x06\x12\n\n\x06OBJECT\x10\x07\x12\t\n\x05\x41RRAY\x10\x08\"/\n\nIdentifier\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\x13\n\x0bschema_name\x18\x02 \x01(\t\"\xcb\x01\n\x10\x44ocumentPathItem\x12\x30\n\x04type\x18\x01 \x02(\x0e\x32\".Mysqlx.Expr.DocumentPathItem.Type\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05index\x18\x03 \x01(\r\"g\n\x04Type\x12\n\n\x06MEMBER\x10\x01\x12\x13\n\x0fMEMBER_ASTERISK\x10\x02\x12\x0f\n\x0b\x41RRAY_INDEX\x10\x03\x12\x18\n\x14\x41RRAY_INDEX_ASTERISK\x10\x04\x12\x13\n\x0f\x44OUBLE_ASTERISK\x10\x05\"\x7f\n\x10\x43olumnIdentifier\x12\x34\n\rdocument_path\x18\x01 \x03(\x0b\x32\x1d.Mysqlx.Expr.DocumentPathItem\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\ntable_name\x18\x03 \x01(\t\x12\x13\n\x0bschema_name\x18\x04 \x01(\t\"W\n\x0c\x46unctionCall\x12%\n\x04name\x18\x01 \x02(\x0b\x32\x17.Mysqlx.Expr.Identifier\x12 \n\x05param\x18\x02 \x03(\x0b\x32\x11.Mysqlx.Expr.Expr\":\n\x08Operator\x12\x0c\n\x04name\x18\x01 \x02(\t\x12 \n\x05param\x18\x02 \x03(\x0b\x32\x11.Mysqlx.Expr.Expr\"t\n\x06Object\x12,\n\x03\x66ld\x18\x01 \x03(\x0b\x32\x1f.Mysqlx.Expr.Object.ObjectField\x1a<\n\x0bObjectField\x12\x0b\n\x03key\x18\x01 \x02(\t\x12 \n\x05value\x18\x02 \x02(\x0b\x32\x11.Mysqlx.Expr.Expr\")\n\x05\x41rray\x12 \n\x05value\x18\x01 \x03(\x0b\x32\x11.Mysqlx.Expr.ExprB\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') + , + dependencies=[mysqlx__datatypes__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_EXPR_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.Expr.Expr.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='IDENT', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LITERAL', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VARIABLE', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FUNC_CALL', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OPERATOR', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PLACEHOLDER', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OBJECT', index=6, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY', index=7, number=8, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=398, + serialized_end=511, +) +_sym_db.RegisterEnumDescriptor(_EXPR_TYPE) + +_DOCUMENTPATHITEM_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.Expr.DocumentPathItem.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='MEMBER', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MEMBER_ASTERISK', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY_INDEX', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY_INDEX_ASTERISK', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DOUBLE_ASTERISK', index=4, number=5, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=663, + serialized_end=766, +) +_sym_db.RegisterEnumDescriptor(_DOCUMENTPATHITEM_TYPE) + + +_EXPR = _descriptor.Descriptor( + name='Expr', + full_name='Mysqlx.Expr.Expr', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Expr.Expr.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='identifier', full_name='Mysqlx.Expr.Expr.identifier', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='variable', full_name='Mysqlx.Expr.Expr.variable', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='literal', full_name='Mysqlx.Expr.Expr.literal', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='function_call', full_name='Mysqlx.Expr.Expr.function_call', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='operator', full_name='Mysqlx.Expr.Expr.operator', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='position', full_name='Mysqlx.Expr.Expr.position', index=6, + number=7, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='object', full_name='Mysqlx.Expr.Expr.object', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='array', full_name='Mysqlx.Expr.Expr.array', index=8, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _EXPR_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=511, +) + + +_IDENTIFIER = _descriptor.Descriptor( + name='Identifier', + full_name='Mysqlx.Expr.Identifier', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Expr.Identifier.name', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='schema_name', full_name='Mysqlx.Expr.Identifier.schema_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=513, + serialized_end=560, +) + + +_DOCUMENTPATHITEM = _descriptor.Descriptor( + name='DocumentPathItem', + full_name='Mysqlx.Expr.DocumentPathItem', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Expr.DocumentPathItem.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Expr.DocumentPathItem.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='index', full_name='Mysqlx.Expr.DocumentPathItem.index', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _DOCUMENTPATHITEM_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=563, + serialized_end=766, +) + + +_COLUMNIDENTIFIER = _descriptor.Descriptor( + name='ColumnIdentifier', + full_name='Mysqlx.Expr.ColumnIdentifier', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='document_path', full_name='Mysqlx.Expr.ColumnIdentifier.document_path', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Expr.ColumnIdentifier.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='table_name', full_name='Mysqlx.Expr.ColumnIdentifier.table_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='schema_name', full_name='Mysqlx.Expr.ColumnIdentifier.schema_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=768, + serialized_end=895, +) + + +_FUNCTIONCALL = _descriptor.Descriptor( + name='FunctionCall', + full_name='Mysqlx.Expr.FunctionCall', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Expr.FunctionCall.name', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='param', full_name='Mysqlx.Expr.FunctionCall.param', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=897, + serialized_end=984, +) + + +_OPERATOR = _descriptor.Descriptor( + name='Operator', + full_name='Mysqlx.Expr.Operator', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Expr.Operator.name', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='param', full_name='Mysqlx.Expr.Operator.param', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=986, + serialized_end=1044, +) + + +_OBJECT_OBJECTFIELD = _descriptor.Descriptor( + name='ObjectField', + full_name='Mysqlx.Expr.Object.ObjectField', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='Mysqlx.Expr.Object.ObjectField.key', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Expr.Object.ObjectField.value', index=1, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1102, + serialized_end=1162, +) + +_OBJECT = _descriptor.Descriptor( + name='Object', + full_name='Mysqlx.Expr.Object', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='fld', full_name='Mysqlx.Expr.Object.fld', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_OBJECT_OBJECTFIELD, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1046, + serialized_end=1162, +) + + +_ARRAY = _descriptor.Descriptor( + name='Array', + full_name='Mysqlx.Expr.Array', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Expr.Array.value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1164, + serialized_end=1205, +) + +_EXPR.fields_by_name['type'].enum_type = _EXPR_TYPE +_EXPR.fields_by_name['identifier'].message_type = _COLUMNIDENTIFIER +_EXPR.fields_by_name['literal'].message_type = mysqlx__datatypes__pb2._SCALAR +_EXPR.fields_by_name['function_call'].message_type = _FUNCTIONCALL +_EXPR.fields_by_name['operator'].message_type = _OPERATOR +_EXPR.fields_by_name['object'].message_type = _OBJECT +_EXPR.fields_by_name['array'].message_type = _ARRAY +_EXPR_TYPE.containing_type = _EXPR +_DOCUMENTPATHITEM.fields_by_name['type'].enum_type = _DOCUMENTPATHITEM_TYPE +_DOCUMENTPATHITEM_TYPE.containing_type = _DOCUMENTPATHITEM +_COLUMNIDENTIFIER.fields_by_name['document_path'].message_type = _DOCUMENTPATHITEM +_FUNCTIONCALL.fields_by_name['name'].message_type = _IDENTIFIER +_FUNCTIONCALL.fields_by_name['param'].message_type = _EXPR +_OPERATOR.fields_by_name['param'].message_type = _EXPR +_OBJECT_OBJECTFIELD.fields_by_name['value'].message_type = _EXPR +_OBJECT_OBJECTFIELD.containing_type = _OBJECT +_OBJECT.fields_by_name['fld'].message_type = _OBJECT_OBJECTFIELD +_ARRAY.fields_by_name['value'].message_type = _EXPR +DESCRIPTOR.message_types_by_name['Expr'] = _EXPR +DESCRIPTOR.message_types_by_name['Identifier'] = _IDENTIFIER +DESCRIPTOR.message_types_by_name['DocumentPathItem'] = _DOCUMENTPATHITEM +DESCRIPTOR.message_types_by_name['ColumnIdentifier'] = _COLUMNIDENTIFIER +DESCRIPTOR.message_types_by_name['FunctionCall'] = _FUNCTIONCALL +DESCRIPTOR.message_types_by_name['Operator'] = _OPERATOR +DESCRIPTOR.message_types_by_name['Object'] = _OBJECT +DESCRIPTOR.message_types_by_name['Array'] = _ARRAY + +Expr = _reflection.GeneratedProtocolMessageType('Expr', (_message.Message,), dict( + DESCRIPTOR = _EXPR, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Expr) + )) +_sym_db.RegisterMessage(Expr) + +Identifier = _reflection.GeneratedProtocolMessageType('Identifier', (_message.Message,), dict( + DESCRIPTOR = _IDENTIFIER, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Identifier) + )) +_sym_db.RegisterMessage(Identifier) + +DocumentPathItem = _reflection.GeneratedProtocolMessageType('DocumentPathItem', (_message.Message,), dict( + DESCRIPTOR = _DOCUMENTPATHITEM, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.DocumentPathItem) + )) +_sym_db.RegisterMessage(DocumentPathItem) + +ColumnIdentifier = _reflection.GeneratedProtocolMessageType('ColumnIdentifier', (_message.Message,), dict( + DESCRIPTOR = _COLUMNIDENTIFIER, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.ColumnIdentifier) + )) +_sym_db.RegisterMessage(ColumnIdentifier) + +FunctionCall = _reflection.GeneratedProtocolMessageType('FunctionCall', (_message.Message,), dict( + DESCRIPTOR = _FUNCTIONCALL, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.FunctionCall) + )) +_sym_db.RegisterMessage(FunctionCall) + +Operator = _reflection.GeneratedProtocolMessageType('Operator', (_message.Message,), dict( + DESCRIPTOR = _OPERATOR, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Operator) + )) +_sym_db.RegisterMessage(Operator) + +Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), dict( + + ObjectField = _reflection.GeneratedProtocolMessageType('ObjectField', (_message.Message,), dict( + DESCRIPTOR = _OBJECT_OBJECTFIELD, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Object.ObjectField) + )) + , + DESCRIPTOR = _OBJECT, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Object) + )) +_sym_db.RegisterMessage(Object) +_sym_db.RegisterMessage(Object.ObjectField) + +Array = _reflection.GeneratedProtocolMessageType('Array', (_message.Message,), dict( + DESCRIPTOR = _ARRAY, + __module__ = 'mysqlx_expr_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Expr.Array) + )) +_sym_db.RegisterMessage(Array) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_notice_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_notice_pb2.py new file mode 100644 index 0000000..2f9890e --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_notice_pb2.py @@ -0,0 +1,377 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_notice.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from mysqlx.protobuf import mysqlx_datatypes_pb2 as mysqlx__datatypes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_notice.proto', + package='Mysqlx.Notice', + syntax='proto2', + serialized_pb=_b('\n\x13mysqlx_notice.proto\x12\rMysqlx.Notice\x1a\x16mysqlx_datatypes.proto\"\xc7\x01\n\x05\x46rame\x12\x0c\n\x04type\x18\x01 \x02(\r\x12\x31\n\x05scope\x18\x02 \x01(\x0e\x32\x1a.Mysqlx.Notice.Frame.Scope:\x06GLOBAL\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"\x1e\n\x05Scope\x12\n\n\x06GLOBAL\x10\x01\x12\t\n\x05LOCAL\x10\x02\"L\n\x04Type\x12\x0b\n\x07WARNING\x10\x01\x12\x1c\n\x18SESSION_VARIABLE_CHANGED\x10\x02\x12\x19\n\x15SESSION_STATE_CHANGED\x10\x03\"\x85\x01\n\x07Warning\x12\x34\n\x05level\x18\x01 \x01(\x0e\x32\x1c.Mysqlx.Notice.Warning.Level:\x07WARNING\x12\x0c\n\x04\x63ode\x18\x02 \x02(\r\x12\x0b\n\x03msg\x18\x03 \x02(\t\")\n\x05Level\x12\x08\n\x04NOTE\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"P\n\x16SessionVariableChanged\x12\r\n\x05param\x18\x01 \x02(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\"\xf1\x02\n\x13SessionStateChanged\x12;\n\x05param\x18\x01 \x02(\x0e\x32,.Mysqlx.Notice.SessionStateChanged.Parameter\x12\'\n\x05value\x18\x02 \x03(\x0b\x32\x18.Mysqlx.Datatypes.Scalar\"\xf3\x01\n\tParameter\x12\x12\n\x0e\x43URRENT_SCHEMA\x10\x01\x12\x13\n\x0f\x41\x43\x43OUNT_EXPIRED\x10\x02\x12\x17\n\x13GENERATED_INSERT_ID\x10\x03\x12\x11\n\rROWS_AFFECTED\x10\x04\x12\x0e\n\nROWS_FOUND\x10\x05\x12\x10\n\x0cROWS_MATCHED\x10\x06\x12\x11\n\rTRX_COMMITTED\x10\x07\x12\x12\n\x0eTRX_ROLLEDBACK\x10\t\x12\x14\n\x10PRODUCED_MESSAGE\x10\n\x12\x16\n\x12\x43LIENT_ID_ASSIGNED\x10\x0b\x12\x1a\n\x16GENERATED_DOCUMENT_IDS\x10\x0c\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') + , + dependencies=[mysqlx__datatypes__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_FRAME_SCOPE = _descriptor.EnumDescriptor( + name='Scope', + full_name='Mysqlx.Notice.Frame.Scope', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='GLOBAL', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LOCAL', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=154, + serialized_end=184, +) +_sym_db.RegisterEnumDescriptor(_FRAME_SCOPE) + +_FRAME_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.Notice.Frame.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='WARNING', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESSION_VARIABLE_CHANGED', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESSION_STATE_CHANGED', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=186, + serialized_end=262, +) +_sym_db.RegisterEnumDescriptor(_FRAME_TYPE) + +_WARNING_LEVEL = _descriptor.EnumDescriptor( + name='Level', + full_name='Mysqlx.Notice.Warning.Level', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='NOTE', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WARNING', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ERROR', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=357, + serialized_end=398, +) +_sym_db.RegisterEnumDescriptor(_WARNING_LEVEL) + +_SESSIONSTATECHANGED_PARAMETER = _descriptor.EnumDescriptor( + name='Parameter', + full_name='Mysqlx.Notice.SessionStateChanged.Parameter', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='CURRENT_SCHEMA', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ACCOUNT_EXPIRED', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GENERATED_INSERT_ID', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ROWS_AFFECTED', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ROWS_FOUND', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ROWS_MATCHED', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TRX_COMMITTED', index=6, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TRX_ROLLEDBACK', index=7, number=9, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PRODUCED_MESSAGE', index=8, number=10, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CLIENT_ID_ASSIGNED', index=9, number=11, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GENERATED_DOCUMENT_IDS', index=10, number=12, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=609, + serialized_end=852, +) +_sym_db.RegisterEnumDescriptor(_SESSIONSTATECHANGED_PARAMETER) + + +_FRAME = _descriptor.Descriptor( + name='Frame', + full_name='Mysqlx.Notice.Frame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Notice.Frame.type', index=0, + number=1, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='scope', full_name='Mysqlx.Notice.Frame.scope', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='Mysqlx.Notice.Frame.payload', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _FRAME_SCOPE, + _FRAME_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=63, + serialized_end=262, +) + + +_WARNING = _descriptor.Descriptor( + name='Warning', + full_name='Mysqlx.Notice.Warning', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='level', full_name='Mysqlx.Notice.Warning.level', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=2, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='code', full_name='Mysqlx.Notice.Warning.code', index=1, + number=2, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msg', full_name='Mysqlx.Notice.Warning.msg', index=2, + number=3, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _WARNING_LEVEL, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=265, + serialized_end=398, +) + + +_SESSIONVARIABLECHANGED = _descriptor.Descriptor( + name='SessionVariableChanged', + full_name='Mysqlx.Notice.SessionVariableChanged', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='param', full_name='Mysqlx.Notice.SessionVariableChanged.param', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Notice.SessionVariableChanged.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=400, + serialized_end=480, +) + + +_SESSIONSTATECHANGED = _descriptor.Descriptor( + name='SessionStateChanged', + full_name='Mysqlx.Notice.SessionStateChanged', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='param', full_name='Mysqlx.Notice.SessionStateChanged.param', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='Mysqlx.Notice.SessionStateChanged.value', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SESSIONSTATECHANGED_PARAMETER, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=483, + serialized_end=852, +) + +_FRAME.fields_by_name['scope'].enum_type = _FRAME_SCOPE +_FRAME_SCOPE.containing_type = _FRAME +_FRAME_TYPE.containing_type = _FRAME +_WARNING.fields_by_name['level'].enum_type = _WARNING_LEVEL +_WARNING_LEVEL.containing_type = _WARNING +_SESSIONVARIABLECHANGED.fields_by_name['value'].message_type = mysqlx__datatypes__pb2._SCALAR +_SESSIONSTATECHANGED.fields_by_name['param'].enum_type = _SESSIONSTATECHANGED_PARAMETER +_SESSIONSTATECHANGED.fields_by_name['value'].message_type = mysqlx__datatypes__pb2._SCALAR +_SESSIONSTATECHANGED_PARAMETER.containing_type = _SESSIONSTATECHANGED +DESCRIPTOR.message_types_by_name['Frame'] = _FRAME +DESCRIPTOR.message_types_by_name['Warning'] = _WARNING +DESCRIPTOR.message_types_by_name['SessionVariableChanged'] = _SESSIONVARIABLECHANGED +DESCRIPTOR.message_types_by_name['SessionStateChanged'] = _SESSIONSTATECHANGED + +Frame = _reflection.GeneratedProtocolMessageType('Frame', (_message.Message,), dict( + DESCRIPTOR = _FRAME, + __module__ = 'mysqlx_notice_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Notice.Frame) + )) +_sym_db.RegisterMessage(Frame) + +Warning = _reflection.GeneratedProtocolMessageType('Warning', (_message.Message,), dict( + DESCRIPTOR = _WARNING, + __module__ = 'mysqlx_notice_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Notice.Warning) + )) +_sym_db.RegisterMessage(Warning) + +SessionVariableChanged = _reflection.GeneratedProtocolMessageType('SessionVariableChanged', (_message.Message,), dict( + DESCRIPTOR = _SESSIONVARIABLECHANGED, + __module__ = 'mysqlx_notice_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Notice.SessionVariableChanged) + )) +_sym_db.RegisterMessage(SessionVariableChanged) + +SessionStateChanged = _reflection.GeneratedProtocolMessageType('SessionStateChanged', (_message.Message,), dict( + DESCRIPTOR = _SESSIONSTATECHANGED, + __module__ = 'mysqlx_notice_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Notice.SessionStateChanged) + )) +_sym_db.RegisterMessage(SessionStateChanged) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_pb2.py new file mode 100644 index 0000000..f741286 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_pb2.py @@ -0,0 +1,372 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx.proto', + package='Mysqlx', + syntax='proto2', + serialized_pb=_b('\n\x0cmysqlx.proto\x12\x06Mysqlx\"\xf4\x02\n\x0e\x43lientMessages\"\xe1\x02\n\x04Type\x12\x18\n\x14\x43ON_CAPABILITIES_GET\x10\x01\x12\x18\n\x14\x43ON_CAPABILITIES_SET\x10\x02\x12\r\n\tCON_CLOSE\x10\x03\x12\x1b\n\x17SESS_AUTHENTICATE_START\x10\x04\x12\x1e\n\x1aSESS_AUTHENTICATE_CONTINUE\x10\x05\x12\x0e\n\nSESS_RESET\x10\x06\x12\x0e\n\nSESS_CLOSE\x10\x07\x12\x14\n\x10SQL_STMT_EXECUTE\x10\x0c\x12\r\n\tCRUD_FIND\x10\x11\x12\x0f\n\x0b\x43RUD_INSERT\x10\x12\x12\x0f\n\x0b\x43RUD_UPDATE\x10\x13\x12\x0f\n\x0b\x43RUD_DELETE\x10\x14\x12\x0f\n\x0b\x45XPECT_OPEN\x10\x18\x12\x10\n\x0c\x45XPECT_CLOSE\x10\x19\x12\x14\n\x10\x43RUD_CREATE_VIEW\x10\x1e\x12\x14\n\x10\x43RUD_MODIFY_VIEW\x10\x1f\x12\x12\n\x0e\x43RUD_DROP_VIEW\x10 \"\xe2\x02\n\x0eServerMessages\"\xcf\x02\n\x04Type\x12\x06\n\x02OK\x10\x00\x12\t\n\x05\x45RROR\x10\x01\x12\x15\n\x11\x43ONN_CAPABILITIES\x10\x02\x12\x1e\n\x1aSESS_AUTHENTICATE_CONTINUE\x10\x03\x12\x18\n\x14SESS_AUTHENTICATE_OK\x10\x04\x12\n\n\x06NOTICE\x10\x0b\x12\x1e\n\x1aRESULTSET_COLUMN_META_DATA\x10\x0c\x12\x11\n\rRESULTSET_ROW\x10\r\x12\x18\n\x14RESULTSET_FETCH_DONE\x10\x0e\x12\x1d\n\x19RESULTSET_FETCH_SUSPENDED\x10\x0f\x12(\n$RESULTSET_FETCH_DONE_MORE_RESULTSETS\x10\x10\x12\x17\n\x13SQL_STMT_EXECUTE_OK\x10\x11\x12(\n$RESULTSET_FETCH_DONE_MORE_OUT_PARAMS\x10\x12\"\x11\n\x02Ok\x12\x0b\n\x03msg\x18\x01 \x01(\t\"\x88\x01\n\x05\x45rror\x12/\n\x08severity\x18\x01 \x01(\x0e\x32\x16.Mysqlx.Error.Severity:\x05\x45RROR\x12\x0c\n\x04\x63ode\x18\x02 \x02(\r\x12\x11\n\tsql_state\x18\x04 \x02(\t\x12\x0b\n\x03msg\x18\x03 \x02(\t\" \n\x08Severity\x12\t\n\x05\x45RROR\x10\x00\x12\t\n\x05\x46\x41TAL\x10\x01\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_CLIENTMESSAGES_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.ClientMessages.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='CON_CAPABILITIES_GET', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CON_CAPABILITIES_SET', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CON_CLOSE', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_AUTHENTICATE_START', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_AUTHENTICATE_CONTINUE', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_RESET', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_CLOSE', index=6, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SQL_STMT_EXECUTE', index=7, number=12, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_FIND', index=8, number=17, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_INSERT', index=9, number=18, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_UPDATE', index=10, number=19, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_DELETE', index=11, number=20, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_OPEN', index=12, number=24, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXPECT_CLOSE', index=13, number=25, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_CREATE_VIEW', index=14, number=30, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_MODIFY_VIEW', index=15, number=31, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CRUD_DROP_VIEW', index=16, number=32, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=44, + serialized_end=397, +) +_sym_db.RegisterEnumDescriptor(_CLIENTMESSAGES_TYPE) + +_SERVERMESSAGES_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='Mysqlx.ServerMessages.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='OK', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ERROR', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CONN_CAPABILITIES', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_AUTHENTICATE_CONTINUE', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SESS_AUTHENTICATE_OK', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NOTICE', index=5, number=11, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_COLUMN_META_DATA', index=6, number=12, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_ROW', index=7, number=13, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_FETCH_DONE', index=8, number=14, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_FETCH_SUSPENDED', index=9, number=15, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_FETCH_DONE_MORE_RESULTSETS', index=10, number=16, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SQL_STMT_EXECUTE_OK', index=11, number=17, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESULTSET_FETCH_DONE_MORE_OUT_PARAMS', index=12, number=18, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=419, + serialized_end=754, +) +_sym_db.RegisterEnumDescriptor(_SERVERMESSAGES_TYPE) + +_ERROR_SEVERITY = _descriptor.EnumDescriptor( + name='Severity', + full_name='Mysqlx.Error.Severity', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ERROR', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FATAL', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=880, + serialized_end=912, +) +_sym_db.RegisterEnumDescriptor(_ERROR_SEVERITY) + + +_CLIENTMESSAGES = _descriptor.Descriptor( + name='ClientMessages', + full_name='Mysqlx.ClientMessages', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CLIENTMESSAGES_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=25, + serialized_end=397, +) + + +_SERVERMESSAGES = _descriptor.Descriptor( + name='ServerMessages', + full_name='Mysqlx.ServerMessages', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SERVERMESSAGES_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=400, + serialized_end=754, +) + + +_OK = _descriptor.Descriptor( + name='Ok', + full_name='Mysqlx.Ok', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='msg', full_name='Mysqlx.Ok.msg', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=756, + serialized_end=773, +) + + +_ERROR = _descriptor.Descriptor( + name='Error', + full_name='Mysqlx.Error', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='severity', full_name='Mysqlx.Error.severity', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=True, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='code', full_name='Mysqlx.Error.code', index=1, + number=2, type=13, cpp_type=3, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='sql_state', full_name='Mysqlx.Error.sql_state', index=2, + number=4, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msg', full_name='Mysqlx.Error.msg', index=3, + number=3, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _ERROR_SEVERITY, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=776, + serialized_end=912, +) + +_CLIENTMESSAGES_TYPE.containing_type = _CLIENTMESSAGES +_SERVERMESSAGES_TYPE.containing_type = _SERVERMESSAGES +_ERROR.fields_by_name['severity'].enum_type = _ERROR_SEVERITY +_ERROR_SEVERITY.containing_type = _ERROR +DESCRIPTOR.message_types_by_name['ClientMessages'] = _CLIENTMESSAGES +DESCRIPTOR.message_types_by_name['ServerMessages'] = _SERVERMESSAGES +DESCRIPTOR.message_types_by_name['Ok'] = _OK +DESCRIPTOR.message_types_by_name['Error'] = _ERROR + +ClientMessages = _reflection.GeneratedProtocolMessageType('ClientMessages', (_message.Message,), dict( + DESCRIPTOR = _CLIENTMESSAGES, + __module__ = 'mysqlx_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.ClientMessages) + )) +_sym_db.RegisterMessage(ClientMessages) + +ServerMessages = _reflection.GeneratedProtocolMessageType('ServerMessages', (_message.Message,), dict( + DESCRIPTOR = _SERVERMESSAGES, + __module__ = 'mysqlx_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.ServerMessages) + )) +_sym_db.RegisterMessage(ServerMessages) + +Ok = _reflection.GeneratedProtocolMessageType('Ok', (_message.Message,), dict( + DESCRIPTOR = _OK, + __module__ = 'mysqlx_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Ok) + )) +_sym_db.RegisterMessage(Ok) + +Error = _reflection.GeneratedProtocolMessageType('Error', (_message.Message,), dict( + DESCRIPTOR = _ERROR, + __module__ = 'mysqlx_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Error) + )) +_sym_db.RegisterMessage(Error) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_resultset_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_resultset_pb2.py new file mode 100644 index 0000000..21467b4 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_resultset_pb2.py @@ -0,0 +1,402 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_resultset.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_resultset.proto', + package='Mysqlx.Resultset', + syntax='proto2', + serialized_pb=_b('\n\x16mysqlx_resultset.proto\x12\x10Mysqlx.Resultset\"\x18\n\x16\x46\x65tchDoneMoreOutParams\"\x19\n\x17\x46\x65tchDoneMoreResultsets\"\x0b\n\tFetchDone\"\x9f\x03\n\x0e\x43olumnMetaData\x12\x38\n\x04type\x18\x01 \x02(\x0e\x32*.Mysqlx.Resultset.ColumnMetaData.FieldType\x12\x0c\n\x04name\x18\x02 \x01(\x0c\x12\x15\n\roriginal_name\x18\x03 \x01(\x0c\x12\r\n\x05table\x18\x04 \x01(\x0c\x12\x16\n\x0eoriginal_table\x18\x05 \x01(\x0c\x12\x0e\n\x06schema\x18\x06 \x01(\x0c\x12\x0f\n\x07\x63\x61talog\x18\x07 \x01(\x0c\x12\x11\n\tcollation\x18\x08 \x01(\x04\x12\x19\n\x11\x66ractional_digits\x18\t \x01(\r\x12\x0e\n\x06length\x18\n \x01(\r\x12\r\n\x05\x66lags\x18\x0b \x01(\r\x12\x14\n\x0c\x63ontent_type\x18\x0c \x01(\r\"\x82\x01\n\tFieldType\x12\x08\n\x04SINT\x10\x01\x12\x08\n\x04UINT\x10\x02\x12\n\n\x06\x44OUBLE\x10\x05\x12\t\n\x05\x46LOAT\x10\x06\x12\t\n\x05\x42YTES\x10\x07\x12\x08\n\x04TIME\x10\n\x12\x0c\n\x08\x44\x41TETIME\x10\x0c\x12\x07\n\x03SET\x10\x0f\x12\x08\n\x04\x45NUM\x10\x10\x12\x07\n\x03\x42IT\x10\x11\x12\x0b\n\x07\x44\x45\x43IMAL\x10\x12\"\x14\n\x03Row\x12\r\n\x05\x66ield\x18\x01 \x03(\x0c*4\n\x11\x43ontentType_BYTES\x12\x0c\n\x08GEOMETRY\x10\x01\x12\x08\n\x04JSON\x10\x02\x12\x07\n\x03XML\x10\x03*.\n\x14\x43ontentType_DATETIME\x12\x08\n\x04\x44\x41TE\x10\x01\x12\x0c\n\x08\x44\x41TETIME\x10\x02\x42\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_CONTENTTYPE_BYTES = _descriptor.EnumDescriptor( + name='ContentType_BYTES', + full_name='Mysqlx.Resultset.ContentType_BYTES', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='GEOMETRY', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='JSON', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='XML', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=550, + serialized_end=602, +) +_sym_db.RegisterEnumDescriptor(_CONTENTTYPE_BYTES) + +ContentType_BYTES = enum_type_wrapper.EnumTypeWrapper(_CONTENTTYPE_BYTES) +_CONTENTTYPE_DATETIME = _descriptor.EnumDescriptor( + name='ContentType_DATETIME', + full_name='Mysqlx.Resultset.ContentType_DATETIME', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DATE', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DATETIME', index=1, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=604, + serialized_end=650, +) +_sym_db.RegisterEnumDescriptor(_CONTENTTYPE_DATETIME) + +ContentType_DATETIME = enum_type_wrapper.EnumTypeWrapper(_CONTENTTYPE_DATETIME) +GEOMETRY = 1 +JSON = 2 +XML = 3 +DATE = 1 +DATETIME = 2 + + +_COLUMNMETADATA_FIELDTYPE = _descriptor.EnumDescriptor( + name='FieldType', + full_name='Mysqlx.Resultset.ColumnMetaData.FieldType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SINT', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UINT', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DOUBLE', index=2, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOAT', index=3, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BYTES', index=4, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TIME', index=5, number=10, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DATETIME', index=6, number=12, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SET', index=7, number=15, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ENUM', index=8, number=16, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BIT', index=9, number=17, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DECIMAL', index=10, number=18, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=396, + serialized_end=526, +) +_sym_db.RegisterEnumDescriptor(_COLUMNMETADATA_FIELDTYPE) + + +_FETCHDONEMOREOUTPARAMS = _descriptor.Descriptor( + name='FetchDoneMoreOutParams', + full_name='Mysqlx.Resultset.FetchDoneMoreOutParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=44, + serialized_end=68, +) + + +_FETCHDONEMORERESULTSETS = _descriptor.Descriptor( + name='FetchDoneMoreResultsets', + full_name='Mysqlx.Resultset.FetchDoneMoreResultsets', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=70, + serialized_end=95, +) + + +_FETCHDONE = _descriptor.Descriptor( + name='FetchDone', + full_name='Mysqlx.Resultset.FetchDone', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=97, + serialized_end=108, +) + + +_COLUMNMETADATA = _descriptor.Descriptor( + name='ColumnMetaData', + full_name='Mysqlx.Resultset.ColumnMetaData', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='Mysqlx.Resultset.ColumnMetaData.type', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=1, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='name', full_name='Mysqlx.Resultset.ColumnMetaData.name', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='original_name', full_name='Mysqlx.Resultset.ColumnMetaData.original_name', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='table', full_name='Mysqlx.Resultset.ColumnMetaData.table', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='original_table', full_name='Mysqlx.Resultset.ColumnMetaData.original_table', index=4, + number=5, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='schema', full_name='Mysqlx.Resultset.ColumnMetaData.schema', index=5, + number=6, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='catalog', full_name='Mysqlx.Resultset.ColumnMetaData.catalog', index=6, + number=7, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='collation', full_name='Mysqlx.Resultset.ColumnMetaData.collation', index=7, + number=8, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='fractional_digits', full_name='Mysqlx.Resultset.ColumnMetaData.fractional_digits', index=8, + number=9, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='length', full_name='Mysqlx.Resultset.ColumnMetaData.length', index=9, + number=10, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='flags', full_name='Mysqlx.Resultset.ColumnMetaData.flags', index=10, + number=11, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='content_type', full_name='Mysqlx.Resultset.ColumnMetaData.content_type', index=11, + number=12, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _COLUMNMETADATA_FIELDTYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=111, + serialized_end=526, +) + + +_ROW = _descriptor.Descriptor( + name='Row', + full_name='Mysqlx.Resultset.Row', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='field', full_name='Mysqlx.Resultset.Row.field', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=528, + serialized_end=548, +) + +_COLUMNMETADATA.fields_by_name['type'].enum_type = _COLUMNMETADATA_FIELDTYPE +_COLUMNMETADATA_FIELDTYPE.containing_type = _COLUMNMETADATA +DESCRIPTOR.message_types_by_name['FetchDoneMoreOutParams'] = _FETCHDONEMOREOUTPARAMS +DESCRIPTOR.message_types_by_name['FetchDoneMoreResultsets'] = _FETCHDONEMORERESULTSETS +DESCRIPTOR.message_types_by_name['FetchDone'] = _FETCHDONE +DESCRIPTOR.message_types_by_name['ColumnMetaData'] = _COLUMNMETADATA +DESCRIPTOR.message_types_by_name['Row'] = _ROW +DESCRIPTOR.enum_types_by_name['ContentType_BYTES'] = _CONTENTTYPE_BYTES +DESCRIPTOR.enum_types_by_name['ContentType_DATETIME'] = _CONTENTTYPE_DATETIME + +FetchDoneMoreOutParams = _reflection.GeneratedProtocolMessageType('FetchDoneMoreOutParams', (_message.Message,), dict( + DESCRIPTOR = _FETCHDONEMOREOUTPARAMS, + __module__ = 'mysqlx_resultset_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Resultset.FetchDoneMoreOutParams) + )) +_sym_db.RegisterMessage(FetchDoneMoreOutParams) + +FetchDoneMoreResultsets = _reflection.GeneratedProtocolMessageType('FetchDoneMoreResultsets', (_message.Message,), dict( + DESCRIPTOR = _FETCHDONEMORERESULTSETS, + __module__ = 'mysqlx_resultset_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Resultset.FetchDoneMoreResultsets) + )) +_sym_db.RegisterMessage(FetchDoneMoreResultsets) + +FetchDone = _reflection.GeneratedProtocolMessageType('FetchDone', (_message.Message,), dict( + DESCRIPTOR = _FETCHDONE, + __module__ = 'mysqlx_resultset_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Resultset.FetchDone) + )) +_sym_db.RegisterMessage(FetchDone) + +ColumnMetaData = _reflection.GeneratedProtocolMessageType('ColumnMetaData', (_message.Message,), dict( + DESCRIPTOR = _COLUMNMETADATA, + __module__ = 'mysqlx_resultset_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Resultset.ColumnMetaData) + )) +_sym_db.RegisterMessage(ColumnMetaData) + +Row = _reflection.GeneratedProtocolMessageType('Row', (_message.Message,), dict( + DESCRIPTOR = _ROW, + __module__ = 'mysqlx_resultset_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Resultset.Row) + )) +_sym_db.RegisterMessage(Row) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_session_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_session_pb2.py new file mode 100644 index 0000000..18354d1 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_session_pb2.py @@ -0,0 +1,227 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_session.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_session.proto', + package='Mysqlx.Session', + syntax='proto2', + serialized_pb=_b('\n\x14mysqlx_session.proto\x12\x0eMysqlx.Session\"S\n\x11\x41uthenticateStart\x12\x11\n\tmech_name\x18\x01 \x02(\t\x12\x11\n\tauth_data\x18\x02 \x01(\x0c\x12\x18\n\x10initial_response\x18\x03 \x01(\x0c\")\n\x14\x41uthenticateContinue\x12\x11\n\tauth_data\x18\x01 \x02(\x0c\"#\n\x0e\x41uthenticateOk\x12\x11\n\tauth_data\x18\x01 \x01(\x0c\"\x07\n\x05Reset\"\x07\n\x05\x43loseB\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_AUTHENTICATESTART = _descriptor.Descriptor( + name='AuthenticateStart', + full_name='Mysqlx.Session.AuthenticateStart', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='mech_name', full_name='Mysqlx.Session.AuthenticateStart.mech_name', index=0, + number=1, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='auth_data', full_name='Mysqlx.Session.AuthenticateStart.auth_data', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='initial_response', full_name='Mysqlx.Session.AuthenticateStart.initial_response', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=40, + serialized_end=123, +) + + +_AUTHENTICATECONTINUE = _descriptor.Descriptor( + name='AuthenticateContinue', + full_name='Mysqlx.Session.AuthenticateContinue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='auth_data', full_name='Mysqlx.Session.AuthenticateContinue.auth_data', index=0, + number=1, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=125, + serialized_end=166, +) + + +_AUTHENTICATEOK = _descriptor.Descriptor( + name='AuthenticateOk', + full_name='Mysqlx.Session.AuthenticateOk', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='auth_data', full_name='Mysqlx.Session.AuthenticateOk.auth_data', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=168, + serialized_end=203, +) + + +_RESET = _descriptor.Descriptor( + name='Reset', + full_name='Mysqlx.Session.Reset', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=205, + serialized_end=212, +) + + +_CLOSE = _descriptor.Descriptor( + name='Close', + full_name='Mysqlx.Session.Close', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=214, + serialized_end=221, +) + +DESCRIPTOR.message_types_by_name['AuthenticateStart'] = _AUTHENTICATESTART +DESCRIPTOR.message_types_by_name['AuthenticateContinue'] = _AUTHENTICATECONTINUE +DESCRIPTOR.message_types_by_name['AuthenticateOk'] = _AUTHENTICATEOK +DESCRIPTOR.message_types_by_name['Reset'] = _RESET +DESCRIPTOR.message_types_by_name['Close'] = _CLOSE + +AuthenticateStart = _reflection.GeneratedProtocolMessageType('AuthenticateStart', (_message.Message,), dict( + DESCRIPTOR = _AUTHENTICATESTART, + __module__ = 'mysqlx_session_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Session.AuthenticateStart) + )) +_sym_db.RegisterMessage(AuthenticateStart) + +AuthenticateContinue = _reflection.GeneratedProtocolMessageType('AuthenticateContinue', (_message.Message,), dict( + DESCRIPTOR = _AUTHENTICATECONTINUE, + __module__ = 'mysqlx_session_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Session.AuthenticateContinue) + )) +_sym_db.RegisterMessage(AuthenticateContinue) + +AuthenticateOk = _reflection.GeneratedProtocolMessageType('AuthenticateOk', (_message.Message,), dict( + DESCRIPTOR = _AUTHENTICATEOK, + __module__ = 'mysqlx_session_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Session.AuthenticateOk) + )) +_sym_db.RegisterMessage(AuthenticateOk) + +Reset = _reflection.GeneratedProtocolMessageType('Reset', (_message.Message,), dict( + DESCRIPTOR = _RESET, + __module__ = 'mysqlx_session_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Session.Reset) + )) +_sym_db.RegisterMessage(Reset) + +Close = _reflection.GeneratedProtocolMessageType('Close', (_message.Message,), dict( + DESCRIPTOR = _CLOSE, + __module__ = 'mysqlx_session_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Session.Close) + )) +_sym_db.RegisterMessage(Close) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_sql_pb2.py b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_sql_pb2.py new file mode 100644 index 0000000..c8fa212 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protobuf/mysqlx_sql_pb2.py @@ -0,0 +1,127 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mysqlx_sql.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from mysqlx.protobuf import mysqlx_datatypes_pb2 as mysqlx__datatypes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mysqlx_sql.proto', + package='Mysqlx.Sql', + syntax='proto2', + serialized_pb=_b('\n\x10mysqlx_sql.proto\x12\nMysqlx.Sql\x1a\x16mysqlx_datatypes.proto\"y\n\x0bStmtExecute\x12\x16\n\tnamespace\x18\x03 \x01(\t:\x03sql\x12\x0c\n\x04stmt\x18\x01 \x02(\x0c\x12#\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x15.Mysqlx.Datatypes.Any\x12\x1f\n\x10\x63ompact_metadata\x18\x04 \x01(\x08:\x05\x66\x61lse\"\x0f\n\rStmtExecuteOkB\x1b\n\x17\x63om.mysql.cj.x.protobufH\x03') + , + dependencies=[mysqlx__datatypes__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_STMTEXECUTE = _descriptor.Descriptor( + name='StmtExecute', + full_name='Mysqlx.Sql.StmtExecute', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='namespace', full_name='Mysqlx.Sql.StmtExecute.namespace', index=0, + number=3, type=9, cpp_type=9, label=1, + has_default_value=True, default_value=_b("sql").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stmt', full_name='Mysqlx.Sql.StmtExecute.stmt', index=1, + number=1, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='args', full_name='Mysqlx.Sql.StmtExecute.args', index=2, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='compact_metadata', full_name='Mysqlx.Sql.StmtExecute.compact_metadata', index=3, + number=4, type=8, cpp_type=7, label=1, + has_default_value=True, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=56, + serialized_end=177, +) + + +_STMTEXECUTEOK = _descriptor.Descriptor( + name='StmtExecuteOk', + full_name='Mysqlx.Sql.StmtExecuteOk', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=179, + serialized_end=194, +) + +_STMTEXECUTE.fields_by_name['args'].message_type = mysqlx__datatypes__pb2._ANY +DESCRIPTOR.message_types_by_name['StmtExecute'] = _STMTEXECUTE +DESCRIPTOR.message_types_by_name['StmtExecuteOk'] = _STMTEXECUTEOK + +StmtExecute = _reflection.GeneratedProtocolMessageType('StmtExecute', (_message.Message,), dict( + DESCRIPTOR = _STMTEXECUTE, + __module__ = 'mysqlx_sql_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Sql.StmtExecute) + )) +_sym_db.RegisterMessage(StmtExecute) + +StmtExecuteOk = _reflection.GeneratedProtocolMessageType('StmtExecuteOk', (_message.Message,), dict( + DESCRIPTOR = _STMTEXECUTEOK, + __module__ = 'mysqlx_sql_pb2' + # @@protoc_insertion_point(class_scope:Mysqlx.Sql.StmtExecuteOk) + )) +_sym_db.RegisterMessage(StmtExecuteOk) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\027com.mysql.cj.x.protobufH\003')) +# @@protoc_insertion_point(module_scope) diff --git a/venv/Lib/site-packages/mysqlx/protocol.py b/venv/Lib/site-packages/mysqlx/protocol.py new file mode 100644 index 0000000..87fe92b --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/protocol.py @@ -0,0 +1,628 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of the X protocol for MySQL servers.""" + +import struct + +from .compat import STRING_TYPES, INT_TYPES +from .errors import InterfaceError, OperationalError, ProgrammingError +from .expr import (ExprParser, build_expr, build_scalar, build_bool_scalar, + build_int_scalar, build_unsigned_int_scalar) +from .helpers import encode_to_bytes, get_item_or_attr +from .result import Column +from .protobuf import (SERVER_MESSAGES, PROTOBUF_REPEATED_TYPES, Message, + mysqlxpb_enum) + + +class MessageReaderWriter(object): + """Implements a Message Reader/Writer. + + Args: + socket_stream (mysqlx.connection.SocketStream): `SocketStream` object. + """ + def __init__(self, socket_stream): + self._stream = socket_stream + self._msg = None + + def _read_message(self): + """Read message. + + Raises: + :class:`mysqlx.ProgrammingError`: If e connected server does not + have the MySQL X protocol plugin + enabled. + + Returns: + mysqlx.protobuf.Message: MySQL X Protobuf Message. + """ + hdr = self._stream.read(5) + msg_len, msg_type = struct.unpack(" 0: + msg["locking_options"] = stmt.lock_contention + + self._writer.write_message( + mysqlxpb_enum("Mysqlx.ClientMessages.Type.CRUD_FIND"), msg) + + def send_update(self, stmt): + """Send update. + + Args: + stmt (Statement): A :class:`mysqlx.ModifyStatement` or + :class:`mysqlx.UpdateStatement` object. + """ + data_model = mysqlxpb_enum("Mysqlx.Crud.DataModel.DOCUMENT" + if stmt.is_doc_based() else + "Mysqlx.Crud.DataModel.TABLE") + collection = Message("Mysqlx.Crud.Collection", + name=stmt.target.name, + schema=stmt.schema.name) + msg = Message("Mysqlx.Crud.Update", data_model=data_model, + collection=collection) + self._apply_filter(msg, stmt) + for update_op in stmt.get_update_ops(): + operation = Message("Mysqlx.Crud.UpdateOperation") + operation["operation"] = update_op.update_type + operation["source"] = update_op.source + if update_op.value is not None: + operation["value"] = build_expr(update_op.value) + msg["operation"].extend([operation.get_message()]) + + self._writer.write_message( + mysqlxpb_enum("Mysqlx.ClientMessages.Type.CRUD_UPDATE"), msg) + + def send_delete(self, stmt): + """Send delete. + + Args: + stmt (Statement): A :class:`mysqlx.DeleteStatement` or + :class:`mysqlx.RemoveStatement` object. + """ + data_model = mysqlxpb_enum("Mysqlx.Crud.DataModel.DOCUMENT" + if stmt.is_doc_based() else + "Mysqlx.Crud.DataModel.TABLE") + collection = Message("Mysqlx.Crud.Collection", name=stmt.target.name, + schema=stmt.schema.name) + msg = Message("Mysqlx.Crud.Delete", data_model=data_model, + collection=collection) + self._apply_filter(msg, stmt) + self._writer.write_message( + mysqlxpb_enum("Mysqlx.ClientMessages.Type.CRUD_DELETE"), msg) + + def send_execute_statement(self, namespace, stmt, args): + """Send execute statement. + + Args: + namespace (str): The namespace. + stmt (Statement): A `Statement` based type object. + args (iterable): An iterable object. + """ + msg = Message("Mysqlx.Sql.StmtExecute", namespace=namespace, stmt=stmt, + compact_metadata=False) + + if namespace == "mysqlx": + # mysqlx namespace behavior: one object with a list of arguments + items = args[0].items() if isinstance(args, (list, tuple)) else \ + args.items() + obj_flds = [] + for key, value in items: + obj_fld = Message("Mysqlx.Datatypes.Object.ObjectField", + key=key, value=self._create_any(value)) + obj_flds.append(obj_fld.get_message()) + msg_obj = Message("Mysqlx.Datatypes.Object", fld=obj_flds) + msg_any = Message("Mysqlx.Datatypes.Any", type=2, obj=msg_obj) + msg["args"] = [msg_any.get_message()] + else: + # xplugin namespace behavior: list of arguments + for arg in args: + value = self._create_any(arg) + msg["args"].extend([value.get_message()]) + + self._writer.write_message( + mysqlxpb_enum("Mysqlx.ClientMessages.Type.SQL_STMT_EXECUTE"), msg) + + def send_insert(self, stmt): + """Send insert. + + Args: + stmt (Statement): A :class:`mysqlx.AddStatement` or + :class:`mysqlx.InsertStatement` object. + """ + data_model = mysqlxpb_enum("Mysqlx.Crud.DataModel.DOCUMENT" + if stmt.is_doc_based() else + "Mysqlx.Crud.DataModel.TABLE") + collection = Message("Mysqlx.Crud.Collection", + name=stmt.target.name, + schema=stmt.schema.name) + msg = Message("Mysqlx.Crud.Insert", data_model=data_model, + collection=collection) + + if hasattr(stmt, "_fields"): + for field in stmt._fields: + expr = ExprParser(field, not stmt.is_doc_based()) \ + .parse_table_insert_field() + msg["projection"].extend([expr.get_message()]) + + for value in stmt.get_values(): + row = Message("Mysqlx.Crud.Insert.TypedRow") + if isinstance(value, list): + for val in value: + row["field"].extend([build_expr(val).get_message()]) + else: + row["field"].extend([build_expr(value).get_message()]) + msg["row"].extend([row.get_message()]) + + if hasattr(stmt, "is_upsert"): + msg["upsert"] = stmt.is_upsert() + self._writer.write_message( + mysqlxpb_enum("Mysqlx.ClientMessages.Type.CRUD_INSERT"), msg) + + def close_result(self, result): + """Close the result. + + Args: + result (Result): A `Result` based type object. + + Raises: + :class:`mysqlx.OperationalError`: If message read is None. + """ + msg = self._read_message(result) + if msg is not None: + raise OperationalError("Expected to close the result") + + def read_row(self, result): + """Read row. + + Args: + result (Result): A `Result` based type object. + """ + msg = self._read_message(result) + if msg is None: + return None + if msg.type == "Mysqlx.Resultset.Row": + return msg + self._reader.push_message(msg) + return None + + def get_column_metadata(self, result): + """Returns column metadata. + + Args: + result (Result): A `Result` based type object. + + Raises: + :class:`mysqlx.InterfaceError`: If unexpected message. + """ + columns = [] + while True: + msg = self._read_message(result) + if msg is None: + break + if msg.type == "Mysqlx.Resultset.Row": + self._reader.push_message(msg) + break + if msg.type != "Mysqlx.Resultset.ColumnMetaData": + raise InterfaceError("Unexpected msg type") + col = Column(msg["type"], msg["catalog"], msg["schema"], + msg["table"], msg["original_table"], + msg["name"], msg["original_name"], + msg.get("length", 21), + msg.get("collation", 0), + msg.get("fractional_digits", 0), + msg.get("flags", 16), + msg.get("content_type")) + columns.append(col) + return columns + + def read_ok(self): + """Read OK. + + Raises: + :class:`mysqlx.InterfaceError`: If unexpected message. + """ + msg = self._reader.read_message() + if msg.type == "Mysqlx.Error": + raise InterfaceError("Mysqlx.Error: {}".format(msg["msg"])) + if msg.type != "Mysqlx.Ok": + raise InterfaceError("Unexpected message encountered: {}" + "".format(msg["msg"])) + + def send_connection_close(self): + """Send connection close.""" + msg = Message("Mysqlx.Connection.Close") + self._writer.write_message(mysqlxpb_enum( + "Mysqlx.ClientMessages.Type.CON_CLOSE"), msg) + + def send_close(self): + """Send close.""" + msg = Message("Mysqlx.Session.Close") + self._writer.write_message(mysqlxpb_enum( + "Mysqlx.ClientMessages.Type.SESS_CLOSE"), msg) + + def send_reset(self): + """Send reset.""" + msg = Message("Mysqlx.Session.Reset") + self._writer.write_message(mysqlxpb_enum( + "Mysqlx.ClientMessages.Type.SESS_RESET"), msg) diff --git a/venv/Lib/site-packages/mysqlx/result.py b/venv/Lib/site-packages/mysqlx/result.py new file mode 100644 index 0000000..2b4a925 --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/result.py @@ -0,0 +1,1127 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of the Result classes.""" + +import decimal +import struct +import sys + +from datetime import datetime, timedelta + +from .dbdoc import DbDoc +from .charsets import MYSQL_CHARACTER_SETS +from .compat import STRING_TYPES +from .helpers import decode_from_bytes, deprecated + + +# pylint: disable=C0111 +def from_protobuf(col_type, payload): + if len(payload) == 0: + return None + + try: + return { + ColumnProtoType.SINT: varsint_from_protobuf, + ColumnProtoType.UINT: varint_from_protobuf, + ColumnProtoType.BYTES: bytes_from_protobuf, + ColumnProtoType.DATETIME: datetime_from_protobuf, + ColumnProtoType.TIME: time_from_protobuf, + ColumnProtoType.FLOAT: float_from_protobuf, + ColumnProtoType.DOUBLE: double_from_protobuf, + ColumnProtoType.BIT: varint_from_protobuf, + ColumnProtoType.SET: set_from_protobuf, + ColumnProtoType.ENUM: bytes_from_protobuf, + ColumnProtoType.DECIMAL: decimal_from_protobuf, + }[col_type](payload) + except KeyError as err: + sys.stderr.write("{0}".format(err)) + sys.stderr.write("{0}".format(payload.encode("hex"))) + return None + + +def bytes_from_protobuf(payload): + # Strip trailing char + return decode_from_bytes(payload[:-1]) + + +def float_from_protobuf(payload): + assert len(payload) == 4 + return struct.unpack("> 1) + i |= 1 << 63 + else: + i = (i >> 1) + + return i + + +def set_from_protobuf(payload): + set_pb = [] + while True: + try: + field_len, payload = varint_from_protobuf_stream(payload) + if len(payload) < field_len: + if len(payload) == 0 and field_len == 1 and len(set_pb) == 0: + # Special case for empty set + return [] + raise ValueError("Invalid Set encoding") + + set_pb.append(payload[:field_len]) + payload = payload[field_len:] + if len(payload) == 0: + # Done + break + except ValueError: + break + return set_pb + + +def decimal_from_protobuf(payload): + digits = [] + sign = None + scale = payload[0] if isinstance(payload[0], int) else ord(payload[0]) + payload = payload[1:] + + for item in payload: + char = item if isinstance(item, int) else ord(item) + high_bcd = (char & 0xf0) >> 4 + low_bcd = char & 0x0f + if high_bcd < 0x0a: + digits.append(high_bcd) + if low_bcd < 0x0a: + digits.append(low_bcd) + elif low_bcd == 0x0c: + sign = 0 + break + elif low_bcd == 0x0d: + sign = 1 + break + else: + raise ValueError("Invalid BCD") + elif high_bcd == 0x0c: + sign = 0 + assert low_bcd == 0x00 + break + elif high_bcd == 0x0d: + sign = 1 + assert low_bcd == 0x00 + break + else: + raise ValueError("Invalid BCD: {0}".format(high_bcd)) + + return decimal.Decimal((sign, digits, -scale)) + + +def datetime_from_protobuf(payload): + # A sequence of varints + hour = 0 + minutes = 0 + seconds = 0 + useconds = 0 + year, payload = varint_from_protobuf_stream(payload) + month, payload = varint_from_protobuf_stream(payload) + day, payload = varint_from_protobuf_stream(payload) + + try: + hour, payload = varint_from_protobuf_stream(payload) + minutes, payload = varint_from_protobuf_stream(payload) + seconds, payload = varint_from_protobuf_stream(payload) + useconds, payload = varint_from_protobuf_stream(payload) + except ValueError: + pass + + return datetime(year, month, day, hour, minutes, seconds, useconds) + + +def time_from_protobuf(payload): + # A sequence of varints + hour = 0 + minutes = 0 + seconds = 0 + useconds = 0 + negate = payload[0] == 1 + payload = payload[1:] + + try: + hour, payload = varint_from_protobuf_stream(payload) + minutes, payload = varint_from_protobuf_stream(payload) + seconds, payload = varint_from_protobuf_stream(payload) + useconds, payload = varint_from_protobuf_stream(payload) + except ValueError: + pass + + if negate: + # Negate the first non-zero value + if hour: + hour *= -1 + elif minutes: + minutes *= -1 + elif seconds: + seconds *= -1 + elif useconds: + useconds *= -1 + + return timedelta(hours=hour, minutes=minutes, seconds=seconds, + microseconds=useconds) + + +class Collations(object): + UTF8_GENERAL_CI = 33 + + +class ColumnType(object): + BIT = 1 + TINYINT = 2 + SMALLINT = 3 + MEDIUMINT = 4 + INT = 5 + BIGINT = 6 + REAL = 7 + FLOAT = 8 + DECIMAL = 9 + NUMERIC = 10 + DOUBLE = 11 + JSON = 12 + STRING = 13 + BYTES = 14 + TIME = 15 + DATE = 16 + DATETIME = 17 + TIMESTAMP = 18 + SET = 19 + ENUM = 20 + GEOMETRY = 21 + XML = 22 + YEAR = 23 + CHAR = 24 + VARCHAR = 25 + BINARY = 26 + VARBINARY = 27 + TINYBLOB = 28 + BLOB = 29 + MEDIUMBLOB = 30 + LONGBLOB = 31 + TINYTEXT = 32 + TEXT = 33 + MEDIUMTEXT = 34 + LONGTEXT = 35 + + @classmethod + def to_string(cls, needle): + for key, value in vars(cls).items(): + if value == needle: + return key + return None + + @classmethod + def from_string(cls, key): + return getattr(cls, key.upper(), None) + + @classmethod + def is_char(cls, col_type): + return col_type in (cls.CHAR, cls.VARCHAR,) + + @classmethod + def is_binary(cls, col_type): + return col_type in (cls.BINARY, cls.VARBINARY,) + + @classmethod + def is_text(cls, col_type): + return col_type in (cls.TEXT, cls.TINYTEXT, cls.MEDIUMTEXT, + cls.LONGTEXT,) + + @classmethod + def is_decimals(cls, col_type): + return col_type in (cls.REAL, cls.DOUBLE, cls.FLOAT, cls.DECIMAL, + cls.NUMERIC,) + + @classmethod + def is_numeric(cls, col_type): + return col_type in (cls.BIT, cls.TINYINT, cls.SMALLINT, cls.MEDIUMINT, + cls.INT, cls.BIGINT,) + + @classmethod + def is_finite_set(cls, col_type): + return col_type in (cls.SET, cls.ENUM,) + + +class ColumnProtoType(object): + SINT = 1 + UINT = 2 + DOUBLE = 5 + FLOAT = 6 + BYTES = 7 + TIME = 10 + DATETIME = 12 + SET = 15 + ENUM = 16 + BIT = 17 + DECIMAL = 18 + + +class Flags(object): + def __init__(self, value): + self._allowed_flags = {} + self._flag_names = {} + for key, val in self.__class__.__dict__.items(): + if key.startswith("__"): + continue + if isinstance(val, int): + self._allowed_flags[key] = val + self._flag_names[val] = key + self._value = value + + def __str__(self): + mask = 1 + flag_names = [] + value = self._value + + for _ in range(0, 63): + mask <<= 1 + flag = value & mask + if flag: + # We matched something, find the name for it + try: + flag_names.append(self._flag_names[flag]) + except KeyError: + sys.stderr.write("{0}".format(self._flag_names)) + sys.stderr.write("{0}".format(self.__class__.__dict__)) + + return ",".join(flag_names) + + @property + def value(self): + return self._value + + @value.setter + def value(self, val): + self._value = val + + +class ColumnFlags(Flags): + NOT_NULL = 0x0010 + PRIMARY_KEY = 0x0020 + UNIQUE_KEY = 0x0040 + MULTIPLE_KEY = 0x0080 + AUTO_INCREMENT = 0x0100 + + +class DatetimeColumnFlags(ColumnFlags): + TIMESTAMP = 0x0001 + + +class UIntColumnFlags(ColumnFlags): + ZEROFILL = 0x0001 + + +class DoubleColumnFlags(ColumnFlags): + UNSIGNED = 0x0001 + + +class FloatColumnFlags(ColumnFlags): + UNSIGNED = 0x0001 + + +class BytesColumnFlags(ColumnFlags): + RIGHT_PAD = 0x0001 + + +class BytesContentType(ColumnFlags): + GEOMETRY = 0x0001 + JSON = 0x0002 + XML = 0x0003 +# pylint: enable=C0111 + + +class Column(object): + """Represents meta data for a table column. + + Args: + col_type (int): The column type. + catalog (str): The catalog. + schema (str): The schema name. + table (str): The table name. + original_table (str): The original table name. + name (str): The column name. + original_name (str): The original table name. + length (int): The column length, + collation (str): The collation name. + fractional_digits (int): The fractional digits. + flags (int): The flags. + content_type (int): The content type. + + .. versionchanged:: 8.0.12 + """ + def __init__(self, col_type, catalog=None, schema=None, table=None, + original_table=None, name=None, original_name=None, + length=None, collation=None, fractional_digits=None, + flags=None, content_type=None): + self._schema = decode_from_bytes(schema) + self._name = decode_from_bytes(name) + self._original_name = decode_from_bytes(original_name) + self._table = decode_from_bytes(table) + self._original_table = decode_from_bytes(original_table) + self._proto_type = col_type + self._col_type = None + self._catalog = catalog + self._length = length + self._collation = collation + self._fractional_digits = fractional_digits + self._flags = flags + self._content_type = content_type + self._number_signed = False + self._is_padded = False + self._is_binary = False + self._is_bytes = False + self._collation_name = None + self._character_set_name = None + self._zero_fill = None + + if self._collation > 0: + if self._collation >= len(MYSQL_CHARACTER_SETS): + raise ValueError("No mapping found for collation {0}" + "".format(self._collation)) + info = MYSQL_CHARACTER_SETS[self._collation] + self._character_set_name = info[0] + self._collation_name = info[1] + self._is_binary = ("binary" in self._collation_name or + "_bin" in self._collation_name) + self._map_type() + self._is_bytes = self._col_type in ( + ColumnType.GEOMETRY, ColumnType.JSON, ColumnType.XML, + ColumnType.BYTES, ColumnType.STRING) + + def __str__(self): + return str({ + "col_type": self._col_type, + "schema": self._schema, + "table": self._table, + "flags": str(self._flags), + }) + + def _map_bytes(self): + """Map bytes.""" + if self._content_type == BytesContentType.GEOMETRY: + self._col_type = ColumnType.GEOMETRY + elif self._content_type == BytesContentType.JSON: + self._col_type = ColumnType.JSON + elif self._content_type == BytesContentType.XML: + self._col_type = ColumnType.XML + elif self._is_binary: + self._col_type = ColumnType.BYTES + else: + self._col_type = ColumnType.STRING + self._is_padded = self._flags & 1 + + def _map_datetime(self): + """Map datetime.""" + if self._length == 10: + self._col_type = ColumnType.DATE + elif self._length == 19: + self._col_type = ColumnType.DATETIME + elif self._flags & DatetimeColumnFlags.TIMESTAMP > 0: + self._col_type = ColumnType.TIMESTAMP + else: + raise ValueError("Datetime mapping scenario unhandled") + + def _map_int_type(self): + """Map int type.""" + if self._length <= 4: + self._col_type = ColumnType.TINYINT + elif self._length <= 6: + self._col_type = ColumnType.SMALLINT + elif self._length <= 9: + self._col_type = ColumnType.MEDIUMINT + elif self._length <= 11: + self._col_type = ColumnType.INT + else: + self._col_type = ColumnType.BIGINT + self._number_signed = True + + def _map_uint_type(self): + """Map uint type.""" + if self._length <= 3: + self._col_type = ColumnType.TINYINT + elif self._length <= 5: + self._col_type = ColumnType.SMALLINT + elif self._length <= 8: + self._col_type = ColumnType.MEDIUMINT + elif self._length <= 10: + self._col_type = ColumnType.INT + else: + self._col_type = ColumnType.BIGINT + self._zero_fill = self._flags & 1 + + def _map_type(self): + """Map type.""" + if self._proto_type == ColumnProtoType.SINT: + self._map_int_type() + elif self._proto_type == ColumnProtoType.UINT: + self._map_uint_type() + elif self._proto_type == ColumnProtoType.FLOAT: + self._col_type = ColumnType.FLOAT + self._is_number_signed = \ + (self._flags & FloatColumnFlags.UNSIGNED) == 0 + elif self._proto_type == ColumnProtoType.DECIMAL: + self._col_type = ColumnType.DECIMAL + self._is_number_signed = \ + (self._flags & FloatColumnFlags.UNSIGNED) == 0 + elif self._proto_type == ColumnProtoType.DOUBLE: + self._col_type = ColumnType.DOUBLE + self._is_number_signed = \ + (self._flags & FloatColumnFlags.UNSIGNED) == 0 + elif self._proto_type == ColumnProtoType.BYTES: + self._map_bytes() + elif self._proto_type == ColumnProtoType.TIME: + self._col_type = ColumnType.TIME + elif self._proto_type == ColumnProtoType.DATETIME: + self._map_datetime() + elif self._proto_type == ColumnProtoType.SET: + self._col_type = ColumnType.SET + elif self._proto_type == ColumnProtoType.ENUM: + self._col_type = ColumnType.ENUM + elif self._proto_type == ColumnProtoType.BIT: + self._col_type = ColumnType.BIT + else: + raise ValueError("Unknown column type {0}".format(self._proto_type)) + + @property + def schema_name(self): + """str: The schema name. + + .. versionadded:: 8.0.12 + """ + return self._schema + + @property + def table_name(self): + """str: The table name. + + .. versionadded:: 8.0.12 + """ + return self._original_table or self._table + + @property + def table_label(self): + """str: The table label. + + .. versionadded:: 8.0.12 + """ + return self._table or self._original_table + + @property + def column_name(self): + """str: The column name. + + .. versionadded:: 8.0.12 + """ + return self._original_name or self._name + + @property + def column_label(self): + """str: The column label. + + .. versionadded:: 8.0.12 + """ + return self._name or self._original_name + + @property + def type(self): + """int: The column type. + + .. versionadded:: 8.0.12 + """ + return self._col_type + + @property + def length(self): + """int. The column length. + + .. versionadded:: 8.0.12 + """ + return self._length + + @property + def fractional_digits(self): + """int: The column fractional digits. + + .. versionadded:: 8.0.12 + """ + return self._fractional_digits + + @property + def collation_name(self): + """str: The collation name. + + .. versionadded:: 8.0.12 + """ + return self._collation_name + + @property + def character_set_name(self): + """str: The character set name. + + .. versionadded:: 8.0.12 + """ + return self._character_set_name + + def get_schema_name(self): + """Returns the schema name. + + Returns: + str: The schema name. + """ + return self._schema + + def get_table_name(self): + """Returns the table name. + + Returns: + str: The table name. + """ + return self._original_table or self._table + + def get_table_label(self): + """Returns the table label. + + Returns: + str: The table label. + """ + return self._table or self._original_table + + def get_column_name(self): + """Returns the column name. + + Returns: + str: The column name. + """ + return self._original_name or self._name + + def get_column_label(self): + """Returns the column label. + + Returns: + str: The column label. + """ + return self._name or self._original_name + + def get_proto_type(self): + """Returns the column proto type. + + Returns: + int: The column proto type. + """ + return self._proto_type + + def get_type(self): + """Returns the column type. + + Returns: + int: The column type. + """ + return self._col_type + + def get_length(self): + """Returns the column length. + + Returns: + int: The column length. + """ + return self._length + + def get_fractional_digits(self): + """Returns the column fractional digits. + + Returns: + int: The column fractional digits. + """ + return self._fractional_digits + + def get_collation_name(self): + """Returns the collation name. + + Returns: + str: The collation name. + """ + return self._collation_name + + def get_character_set_name(self): + """Returns the character set name. + + Returns: + str: The character set name. + """ + return self._character_set_name + + def is_number_signed(self): + """Returns `True` if is a number signed. + + Returns: + bool: Returns `True` if is a number signed. + """ + return self._number_signed + + def is_padded(self): + """Returns `True` if is padded. + + Returns: + bool: Returns `True` if is padded. + """ + return self._is_padded + + def is_bytes(self): + """Returns `True` if is bytes. + + Returns: + bool: Returns `True` if is bytes. + """ + return self._is_bytes + + +class Row(object): + """Represents a row element returned from a SELECT query. + + Args: + rs (mysqlx.SqlResult or mysqlx.RowResult): The result set. + fields (`list`): The list of fields. + """ + def __init__(self, rs, fields): + self._fields = fields + self._resultset = rs + + def __getitem__(self, index): + """Returns the value of a column by name or index. + + .. versionchanged:: 8.0.12 + """ + int_index = self._resultset.index_of(index) \ + if isinstance(index, STRING_TYPES) else index + if int_index == -1 and isinstance(index, STRING_TYPES): + raise ValueError("Column name '{0}' not found".format(index)) + elif int_index >= len(self._fields) or int_index < 0: + raise IndexError("Index out of range") + return self._fields[int_index] + + @deprecated("8.0.12") + def get_string(self, str_index): + """Returns the value using the column name. + + Args: + str_index (str): The column name. + + .. deprecated:: 8.0.12 + """ + int_index = self._resultset.index_of(str_index) + if int_index >= len(self._fields): + raise IndexError("Argument out of range") + if int_index == -1: + raise ValueError("Column name '{0}' not found".format(str_index)) + return str(self._fields[int_index]) + + +class BaseResult(object): + """Provides base functionality for result objects. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + """ + def __init__(self, connection): + self._connection = connection + self._closed = False + self._rows_affected = 0 + self._generated_id = -1 + self._generated_ids = [] + self._warnings = [] + + if connection is None: + self._protocol = None + else: + self._protocol = connection.protocol + connection.fetch_active_result() + + def get_affected_items_count(self): + """Returns the number of affected items for the last operation. + + Returns: + int: The number of affected items. + """ + return self._rows_affected + + def get_warnings(self): + """Returns the warnings. + + Returns: + `list`: The list of warnings. + """ + return self._warnings + + def get_warnings_count(self): + """Returns the number of warnings. + + Returns: + int: The number of warnings. + """ + return len(self._warnings) + + def set_closed(self, flag): + """Sets if resultset fetch is done. + """ + self._closed = flag + + def append_warning(self, level, code, msg): + """Append a warning. + + Args: + level (int): The warning level. + code (int): The warning code. + msg (str): The warning message. + """ + self._warnings.append({"level": level, "code": code, "msg": msg}) + + def set_generated_ids(self, generated_ids): + """Sets the generated ids. + """ + self._generated_ids = generated_ids + + def set_generated_insert_id(self, generated_id): + """Sets the generated insert id. + """ + self._generated_id = generated_id + + def set_rows_affected(self, total): + """Sets the number of rows affected. + """ + self._rows_affected = total + + +class Result(BaseResult): + """Allows retrieving information about non query operations performed on + the database. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + ids (`list`): A list of IDs. + """ + def __init__(self, connection=None, ids=None): + super(Result, self).__init__(connection) + self._ids = ids + + if connection is not None: + self._connection.close_result(self) + + def get_autoincrement_value(self): + """Returns the last insert id auto generated. + + Returns: + int: The last insert id. + """ + return self._generated_id + + @deprecated("8.0.12") + def get_document_id(self): + """Returns ID of the last document inserted into a collection. + + .. deprecated:: 8.0.12 + """ + if self._ids is None or len(self._ids) == 0: + return None + return self._ids[0] + + @deprecated("8.0.12") + def get_generated_insert_id(self): + """Returns the generated insert id. + + .. deprecated:: 8.0.12 + """ + return self._generated_id + + def get_generated_ids(self): + """Returns the generated ids. + """ + return self._generated_ids + + +class BufferingResult(BaseResult): + """Provides base functionality for buffering result objects. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + ids (`list`): A list of IDs. + """ + def __init__(self, connection): + super(BufferingResult, self).__init__(connection) + self._columns = [] + self._has_data = False + self._has_more_results = False + self._items = [] + self._page_size = 0 + self._position = -1 + self._init_result() + + def __getitem__(self, index): + return self._items[index] + + @property + def count(self): + """int: The total of items.""" + return len(self._items) + + def _init_result(self): + """Initialize the result.""" + self._columns = self._connection.get_column_metadata(self) + self._has_more_data = True if len(self._columns) > 0 else False + self._items = [] + self._page_size = 20 + self._position = -1 + self._connection.set_active_result(self if self._has_more_data + else None) + + def _read_item(self, dumping): + """Read item. + + Args: + dumping (bool): `True` for dumping. + + Returns: + :class:`mysqlx.Row`: A `Row` object. + """ + row = self._connection.read_row(self) + if row is None: + return None + item = [None] * len(row["field"]) + if not dumping: + for key in range(len(row["field"])): + col = self._columns[key] + item[key] = from_protobuf(col.get_proto_type(), + row["field"][key]) + return Row(self, item) + + def _page_in_items(self): + """Reads the page items. + + Returns: + int: Total items read. + """ + if self._closed: + return False + + count = 0 + for _ in range(self._page_size): + item = self._read_item(False) + if item is None: + break + self._items.append(item) + count += 1 + return count + + def index_of(self, col_name): + """Returns the index of the column. + + Returns: + int: The index of the column. + """ + index = 0 + for col in self._columns: + if col.get_column_name() == col_name: + return index + index += 1 + return -1 + + def fetch_one(self): + """Fetch one item. + + Returns: + :class:`mysqlx.Row` or :class:`mysqlx.DbDoc`: one result item. + """ + if self._closed: + return None + + return self._read_item(False) + + def fetch_all(self): + """Fetch all items. + + Returns: + `list`: The list of items of :class:`mysqlx.DbDoc` or + :class:`mysqlx.Row`. + """ + while True: + if not self._page_in_items(): + break + return self._items + + def set_has_data(self, flag): + """Sets if result has data. + + Args: + flag (bool): `True` if result has data. + """ + self._has_data = flag + + def set_has_more_results(self, flag): + """Sets if has more results. + + Args: + flag (bool): `True` if has more results. + """ + self._has_more_results = flag + + +class RowResult(BufferingResult): + """Allows traversing the Row objects returned by a Table.select operation. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + """ + def __init__(self, connection): + super(RowResult, self).__init__(connection) + + @property + def columns(self): + """`list`: The list of columns.""" + return self._columns + + def get_columns(self): + """Returns the list of columns. + + Returns: + `list`: The list of columns. + + .. versionadded:: 8.0.12 + """ + return self._columns + + +class SqlResult(RowResult): + """Represents a result from a SQL statement. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + """ + def __init__(self, connection): + super(SqlResult, self).__init__(connection) + + def get_autoincrement_value(self): + """Returns the identifier for the last record inserted. + + Returns: + str: The identifier of the last record inserted. + """ + return self._generated_id + + def next_result(self): + """Process the next result. + + Returns: + bool: Returns `True` if the fetch is done. + """ + if self._closed: + return False + self._has_more_results = False + self._init_result() + return True + + def has_data(self): + """Returns True if result has data. + + Returns: + bool: Returns `True` if result has data. + + .. versionadded:: 8.0.12 + """ + return self._has_data + +class DocResult(BufferingResult): + """Allows traversing the DbDoc objects returned by a Collection.find + operation. + + Args: + connection (mysqlx.connection.Connection): The Connection object. + """ + def __init__(self, connection): + super(DocResult, self).__init__(connection) + + def _read_item(self, dumping): + """Read item. + + Args: + dumping (bool): `True` for dumping. + + Returns: + :class:`mysqlx.DbDoc`: A `DbDoc` object. + """ + row = super(DocResult, self)._read_item(dumping) + if row is None: + return None + return DbDoc(decode_from_bytes(row[0])) diff --git a/venv/Lib/site-packages/mysqlx/statement.py b/venv/Lib/site-packages/mysqlx/statement.py new file mode 100644 index 0000000..8adf91c --- /dev/null +++ b/venv/Lib/site-packages/mysqlx/statement.py @@ -0,0 +1,1313 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, as +# published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an +# additional permission to link the program and your derivative works +# with the separately licensed software that they have included with +# MySQL. +# +# Without limiting anything contained in the foregoing, this file, +# which is part of MySQL Connector/Python, is also subject to the +# Universal FOSS Exception, version 1.0, a copy of which can be found at +# http://oss.oracle.com/licenses/universal-foss-exception. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Implementation of Statements.""" + +import copy +import json +import warnings + +from .errors import ProgrammingError, NotSupportedError +from .expr import ExprParser +from .compat import INT_TYPES, STRING_TYPES +from .constants import LockContention +from .dbdoc import DbDoc +from .helpers import deprecated +from .result import SqlResult, Result +from .protobuf import mysqlxpb_enum + +ERR_INVALID_INDEX_NAME = 'The given index name "{}" is not valid' + + +class Expr(object): + """Expression wrapper.""" + def __init__(self, expr): + self.expr = expr + + +def flexible_params(*values): + """Parse flexible parameters.""" + if len(values) == 1 and isinstance(values[0], (list, tuple,)): + return values[0] + return values + + +def is_quoted_identifier(identifier, sql_mode=""): + """Check if the given identifier is quoted. + + Args: + identifier (string): Identifier to check. + sql_mode (Optional[string]): SQL mode. + + Returns: + `True` if the identifier has backtick quotes, and False otherwise. + """ + if "ANSI_QUOTES" in sql_mode: + return ((identifier[0] == "`" and identifier[-1] == "`") or + (identifier[0] == '"' and identifier[-1] == '"')) + return identifier[0] == "`" and identifier[-1] == "`" + + +def quote_identifier(identifier, sql_mode=""): + """Quote the given identifier with backticks, converting backticks (`) in + the identifier name with the correct escape sequence (``). + + Args: + identifier (string): Identifier to quote. + sql_mode (Optional[string]): SQL mode. + + Returns: + A string with the identifier quoted with backticks. + """ + if len(identifier) == 0: + return "``" + if "ANSI_QUOTES" in sql_mode: + return '"{0}"'.format(identifier.replace('"', '""')) + return "`{0}`".format(identifier.replace("`", "``")) + + +def quote_multipart_identifier(identifiers, sql_mode=""): + """Quote the given multi-part identifier with backticks. + + Args: + identifiers (iterable): List of identifiers to quote. + sql_mode (Optional[string]): SQL mode. + + Returns: + A string with the multi-part identifier quoted with backticks. + """ + return ".".join([quote_identifier(identifier, sql_mode) + for identifier in identifiers]) + + +def parse_table_name(default_schema, table_name, sql_mode=""): + """Parse table name. + + Args: + default_schema (str): The default schema. + table_name (str): The table name. + sql_mode(Optional[str]): The SQL mode. + + Returns: + str: The parsed table name. + """ + quote = '"' if "ANSI_QUOTES" in sql_mode else "`" + delimiter = ".{0}".format(quote) if quote in table_name else "." + temp = table_name.split(delimiter, 1) + return (default_schema if len(temp) is 1 else temp[0].strip(quote), + temp[-1].strip(quote),) + + +class Statement(object): + """Provides base functionality for statement objects. + + Args: + target (object): The target database object, it can be + :class:`mysqlx.Collection` or :class:`mysqlx.Table`. + doc_based (bool): `True` if it is document based. + """ + def __init__(self, target, doc_based=True): + self._target = target + self._doc_based = doc_based + self._connection = target.get_connection() if target else None + + @property + def target(self): + """object: The database object target.""" + return self._target + + @property + def schema(self): + """:class:`mysqlx.Schema`: The Schema object.""" + return self._target.schema + + def is_doc_based(self): + """Check if it is document based. + + Returns: + bool: `True` if it is document based. + """ + return self._doc_based + + def execute(self): + """Execute the statement. + + Raises: + NotImplementedError: This method must be implemented. + """ + raise NotImplementedError + + +class FilterableStatement(Statement): + """A statement to be used with filterable statements. + + Args: + target (object): The target database object, it can be + :class:`mysqlx.Collection` or :class:`mysqlx.Table`. + doc_based (Optional[bool]): `True` if it is document based + (default: `True`). + condition (Optional[str]): Sets the search condition to filter + documents or records. + """ + def __init__(self, target, doc_based=True, condition=None): + super(FilterableStatement, self).__init__(target=target, + doc_based=doc_based) + self._binding_map = {} + self._bindings = [] + self._having = None + self._grouping_str = "" + self._grouping = None + self._limit_offset = 0 + self._limit_row_count = 0 + self._projection_str = "" + self._projection_expr = None + self._sort_str = "" + self._sort_expr = None + self._where_str = "" + self._where_expr = None + self.has_bindings = False + self.has_limit = False + self.has_group_by = False + self.has_having = False + self.has_projection = False + self.has_sort = False + self.has_where = False + if condition: + self._set_where(condition) + + def _bind_single(self, obj): + """Bind single object. + + Args: + obj(:class:`mysqlx.DbDoc` or str): DbDoc or JSON string object. + + Raises: + :class:`mysqlx.ProgrammingError`: If invalid JSON string to bind. + ValueError: If JSON loaded is not a dictionary. + """ + if isinstance(obj, DbDoc): + self.bind(str(obj)) + elif isinstance(obj, STRING_TYPES): + try: + res = json.loads(obj) + if not isinstance(res, dict): + raise ValueError + except ValueError: + raise ProgrammingError("Invalid JSON string to bind") + for key in res.keys(): + self.bind(key, res[key]) + else: + raise ProgrammingError("Invalid JSON string or object to bind") + + def _sort(self, *clauses): + """Sets the sorting criteria. + + Args: + *clauses: The expression strings defining the sort criteria. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + """ + self.has_sort = True + self._sort_str = ",".join(flexible_params(*clauses)) + self._sort_expr = ExprParser(self._sort_str, + not self._doc_based).parse_order_spec() + return self + + def _set_where(self, condition): + """Sets the search condition to filter. + + Args: + condition (str): Sets the search condition to filter documents or + records. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + """ + self.has_where = True + self._where_str = condition + try: + expr = ExprParser(condition, not self._doc_based) + self._where_expr = expr.expr() + except ValueError: + raise ProgrammingError("Invalid condition") + self._binding_map = expr.placeholder_name_to_position + return self + + def _set_group_by(self, *fields): + """Set group by. + + Args: + *fields: List of fields. + """ + fields = flexible_params(*fields) + self.has_group_by = True + self._grouping_str = ",".join(fields) + self._grouping = ExprParser(self._grouping_str, + not self._doc_based).parse_expr_list() + + def _set_having(self, condition): + """Set having. + + Args: + condition (str): The condition. + """ + self.has_having = True + self._having = ExprParser(condition, not self._doc_based).expr() + + def _set_projection(self, *fields): + """Set the projection. + + Args: + *fields: List of fields. + + Returns: + :class:`mysqlx.FilterableStatement`: Returns self. + """ + fields = flexible_params(*fields) + self.has_projection = True + self._projection_str = ",".join(fields) + self._projection_expr = ExprParser( + self._projection_str, + not self._doc_based).parse_table_select_projection() + return self + + def get_binding_map(self): + """Returns the binding map dictionary. + + Returns: + dict: The binding map dictionary. + """ + return self._binding_map + + def get_bindings(self): + """Returns the bindings list. + + Returns: + `list`: The bindings list. + """ + return self._bindings + + def get_grouping(self): + """Returns the grouping expression list. + + Returns: + `list`: The grouping expression list. + """ + return self._grouping + + def get_having(self): + """Returns the having expression. + + Returns: + object: The having expression. + """ + return self._having + + def get_limit_row_count(self): + """Returns the limit row count. + + Returns: + int: The limit row count. + """ + return self._limit_row_count + + def get_limit_offset(self): + """Returns the limit offset. + + Returns: + int: The limit offset. + """ + return self._limit_offset + + def get_where_expr(self): + """Returns the where expression. + + Returns: + object: The where expression. + """ + return self._where_expr + + def get_projection_expr(self): + """Returns the projection expression. + + Returns: + object: The projection expression. + """ + return self._projection_expr + + def get_sort_expr(self): + """Returns the sort expression. + + Returns: + object: The sort expression. + """ + return self._sort_expr + + @deprecated("8.0.12") + def where(self, condition): + """Sets the search condition to filter. + + Args: + condition (str): Sets the search condition to filter documents or + records. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + + .. deprecated:: 8.0.12 + """ + return self._set_where(condition) + + @deprecated("8.0.12") + def sort(self, *clauses): + """Sets the sorting criteria. + + Args: + *clauses: The expression strings defining the sort criteria. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + + .. deprecated:: 8.0.12 + """ + return self._sort(*clauses) + + def limit(self, row_count, offset=None): + """Sets the maximum number of items to be returned. + + Args: + row_count (int): The maximum number of items. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + + Raises: + ValueError: If ``row_count`` is not a positive integer. + + .. versionchanged:: 8.0.12 + The usage of ``offset`` was deprecated. + """ + if not isinstance(row_count, INT_TYPES) or row_count < 0: + raise ValueError("The 'row_count' value must be a positive integer") + self.has_limit = True + self._limit_row_count = row_count + if offset: + self.offset(offset) + warnings.warn("'limit(row_count, offset)' is deprecated, please " + "use 'offset(offset)' to set the number of items to " + "skip", category=DeprecationWarning) + return self + + def offset(self, offset): + """Sets the number of items to skip. + + Args: + offset (int): The number of items to skip. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + + Raises: + ValueError: If ``offset`` is not a positive integer. + + .. versionadded:: 8.0.12 + """ + if not isinstance(offset, INT_TYPES) or offset < 0: + raise ValueError("The 'offset' value must be a positive integer") + self._limit_offset = offset + return self + + def bind(self, *args): + """Binds a value to a specific placeholder. + + Args: + *args: The name of the placeholder and the value to bind. + A :class:`mysqlx.DbDoc` object or a JSON string + representation can be used. + + Returns: + mysqlx.FilterableStatement: FilterableStatement object. + + Raises: + ProgrammingError: If the number of arguments is invalid. + """ + self.has_bindings = True + count = len(args) + if count == 1: + self._bind_single(args[0]) + elif count > 2: + raise ProgrammingError("Invalid number of arguments to bind") + else: + self._bindings.append({"name": args[0], "value": args[1]}) + return self + + def execute(self): + """Execute the statement. + + Raises: + NotImplementedError: This method must be implemented. + """ + raise NotImplementedError + + +class SqlStatement(Statement): + """A statement for SQL execution. + + Args: + connection (mysqlx.connection.Connection): Connection object. + sql (string): The sql statement to be executed. + """ + def __init__(self, connection, sql): + super(SqlStatement, self).__init__(target=None, doc_based=False) + self._connection = connection + self._sql = sql + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.SqlResult: SqlResult object. + """ + self._connection.send_sql(self._sql) + return SqlResult(self._connection) + + +class WriteStatement(Statement): + """Provide common write operation attributes. + """ + def __init__(self, target, doc_based): + super(WriteStatement, self).__init__(target, doc_based) + self._values = [] + + def get_values(self): + """Returns the list of values. + + Returns: + `list`: The list of values. + """ + return self._values + + def execute(self): + """Execute the statement. + + Raises: + NotImplementedError: This method must be implemented. + """ + raise NotImplementedError + + +class AddStatement(WriteStatement): + """A statement for document addition on a collection. + + Args: + collection (mysqlx.Collection): The Collection object. + """ + def __init__(self, collection): + super(AddStatement, self).__init__(collection, True) + self._upsert = False + self.ids = [] + + def is_upsert(self): + """Returns `True` if it's an upsert. + + Returns: + bool: `True` if it's an upsert. + """ + return self._upsert + + def upsert(self, value=True): + """Sets the upset flag to the boolean of the value provided. + Setting of this flag allows updating of the matched rows/documents + with the provided value. + + Args: + value (optional[bool]): Set or unset the upsert flag. + """ + self._upsert = value + return self + + def add(self, *values): + """Adds a list of documents into a collection. + + Args: + *values: The documents to be added into the collection. + + Returns: + mysqlx.AddStatement: AddStatement object. + """ + for val in flexible_params(*values): + if isinstance(val, DbDoc): + self._values.append(val) + else: + self._values.append(DbDoc(val)) + return self + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + """ + if len(self._values) == 0: + return Result() + + return self._connection.send_insert(self) + + +class UpdateSpec(object): + """Update specification class implementation. + + Args: + update_type (int): The update type. + source (str): The source. + value (Optional[str]): The value. + """ + def __init__(self, update_type, source, value=None): + if update_type == mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.SET"): + self._table_set(source, value) + else: + self.update_type = update_type + self.source = source + if len(source) > 0 and source[0] == '$': + self.source = source[1:] + self.source = ExprParser(self.source, + False).document_field().identifier + self.value = value + + def _table_set(self, source, value): + """Table set. + + Args: + source (str): The source. + value (str): The value. + """ + self.update_type = mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.SET") + self.source = ExprParser(source, True).parse_table_update_field() + self.value = value + + +class ModifyStatement(FilterableStatement): + """A statement for document update operations on a Collection. + + Args: + collection (mysqlx.Collection): The Collection object. + condition (str): Sets the search condition to identify the documents + to be modified. + + .. versionchanged:: 8.0.12 + The ``condition`` parameter is now mandatory. + """ + def __init__(self, collection, condition): + super(ModifyStatement, self).__init__(target=collection, + condition=condition) + self._update_ops = [] + + def sort(self, *clauses): + """Sets the sorting criteria. + + Args: + *clauses: The expression strings defining the sort criteria. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + return self._sort(*clauses) + + def get_update_ops(self): + """Returns the list of update operations. + + Returns: + `list`: The list of update operations. + """ + return self._update_ops + + def set(self, doc_path, value): + """Sets or updates attributes on documents in a collection. + + Args: + doc_path (string): The document path of the item to be set. + value (string): The value to be set on the specified attribute. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + self._update_ops.append(UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.ITEM_SET"), + doc_path, value)) + return self + + @deprecated("8.0.12") + def change(self, doc_path, value): + """Add an update to the statement setting the field, if it exists at + the document path, to the given value. + + Args: + doc_path (string): The document path of the item to be set. + value (object): The value to be set on the specified attribute. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + + .. deprecated:: 8.0.12 + """ + self._update_ops.append(UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.ITEM_REPLACE"), + doc_path, value)) + return self + + def unset(self, *doc_paths): + """Removes attributes from documents in a collection. + + Args: + doc_path (string): The document path of the attribute to be + removed. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + self._update_ops.extend([ + UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.ITEM_REMOVE"), item) + for item in flexible_params(*doc_paths)]) + return self + + def array_insert(self, field, value): + """Insert a value into the specified array in documents of a + collection. + + Args: + field (string): A document path that identifies the array attribute + and position where the value will be inserted. + value (object): The value to be inserted. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + self._update_ops.append( + UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.ARRAY_INSERT"), + field, value)) + return self + + def array_append(self, doc_path, value): + """Inserts a value into a specific position in an array attribute in + documents of a collection. + + Args: + doc_path (string): A document path that identifies the array + attribute and position where the value will be + inserted. + value (object): The value to be inserted. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + self._update_ops.append( + UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.ARRAY_APPEND"), + doc_path, value)) + return self + + def patch(self, doc): + """Takes a :class:`mysqlx.DbDoc`, string JSON format or a dict with the + changes and applies it on all matching documents. + + Args: + doc (object): A generic document (DbDoc), string in JSON format or + dict, with the changes to apply to the matching + documents. + + Returns: + mysqlx.ModifyStatement: ModifyStatement object. + """ + if doc is None: + doc = '' + if not isinstance(doc, (ExprParser, dict, DbDoc, str)): + raise ProgrammingError( + "Invalid data for update operation on document collection " + "table") + self._update_ops.append( + UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.MERGE_PATCH"), + '', doc.expr() if isinstance(doc, ExprParser) else doc)) + return self + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + + Raises: + ProgrammingError: If condition was not set. + """ + if not self.has_where: + raise ProgrammingError("No condition was found for modify") + return self._connection.update(self) + + +class ReadStatement(FilterableStatement): + """Provide base functionality for Read operations + + Args: + target (object): The target database object, it can be + :class:`mysqlx.Collection` or :class:`mysqlx.Table`. + doc_based (Optional[bool]): `True` if it is document based + (default: `True`). + condition (Optional[str]): Sets the search condition to filter + documents or records. + """ + def __init__(self, target, doc_based=True, condition=None): + super(ReadStatement, self).__init__(target, doc_based, condition) + self._lock_exclusive = False + self._lock_shared = False + self._lock_contention = LockContention.DEFAULT + + @property + def lock_contention(self): + """:class:`mysqlx.LockContention`: The lock contention value.""" + return self._lock_contention + + def _set_lock_contention(self, lock_contention): + """Set the lock contention. + + Args: + lock_contention (:class:`mysqlx.LockContention`): Lock contention. + + Raises: + ProgrammingError: If is an invalid lock contention value. + """ + try: + # Check if is a valid lock contention value + _ = LockContention.index(lock_contention) + except ValueError: + raise ProgrammingError("Invalid lock contention mode. Use 'NOWAIT' " + "or 'SKIP_LOCKED'") + self._lock_contention = lock_contention + + def is_lock_exclusive(self): + """Returns `True` if is `EXCLUSIVE LOCK`. + + Returns: + bool: `True` if is `EXCLUSIVE LOCK`. + """ + return self._lock_exclusive + + def is_lock_shared(self): + """Returns `True` if is `SHARED LOCK`. + + Returns: + bool: `True` if is `SHARED LOCK`. + """ + return self._lock_shared + + def lock_shared(self, lock_contention=LockContention.DEFAULT): + """Execute a read operation with `SHARED LOCK`. Only one lock can be + active at a time. + + Args: + lock_contention (:class:`mysqlx.LockContention`): Lock contention. + """ + self._lock_exclusive = False + self._lock_shared = True + self._set_lock_contention(lock_contention) + return self + + def lock_exclusive(self, lock_contention=LockContention.DEFAULT): + """Execute a read operation with `EXCLUSIVE LOCK`. Only one lock can be + active at a time. + + Args: + lock_contention (:class:`mysqlx.LockContention`): Lock contention. + """ + self._lock_exclusive = True + self._lock_shared = False + self._set_lock_contention(lock_contention) + return self + + def group_by(self, *fields): + """Sets a grouping criteria for the resultset. + + Args: + *fields: The string expressions identifying the grouping criteria. + + Returns: + mysqlx.ReadStatement: ReadStatement object. + """ + self._set_group_by(*fields) + return self + + def having(self, condition): + """Sets a condition for records to be considered in agregate function + operations. + + Args: + condition (string): A condition on the agregate functions used on + the grouping criteria. + + Returns: + mysqlx.ReadStatement: ReadStatement object. + """ + self._set_having(condition) + return self + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + """ + return self._connection.find(self) + + +class FindStatement(ReadStatement): + """A statement document selection on a Collection. + + Args: + collection (mysqlx.Collection): The Collection object. + condition (Optional[str]): An optional expression to identify the + documents to be retrieved. If not specified + all the documents will be included on the + result unless a limit is set. + """ + def __init__(self, collection, condition=None): + super(FindStatement, self).__init__(collection, True, condition) + + def fields(self, *fields): + """Sets a document field filter. + + Args: + *fields: The string expressions identifying the fields to be + extracted. + + Returns: + mysqlx.FindStatement: FindStatement object. + """ + return self._set_projection(*fields) + + def sort(self, *clauses): + """Sets the sorting criteria. + + Args: + *clauses: The expression strings defining the sort criteria. + + Returns: + mysqlx.FindStatement: FindStatement object. + """ + return self._sort(*clauses) + + +class SelectStatement(ReadStatement): + """A statement for record retrieval operations on a Table. + + Args: + table (mysqlx.Table): The Table object. + *fields: The fields to be retrieved. + """ + def __init__(self, table, *fields): + super(SelectStatement, self).__init__(table, False) + self._set_projection(*fields) + + + def where(self, condition): + """Sets the search condition to filter. + + Args: + condition (str): Sets the search condition to filter records. + + Returns: + mysqlx.SelectStatement: SelectStatement object. + """ + return self._set_where(condition) + + def order_by(self, *clauses): + """Sets the order by criteria. + + Args: + *clauses: The expression strings defining the order by criteria. + + Returns: + mysqlx.SelectStatement: SelectStatement object. + """ + return self._sort(*clauses) + + def get_sql(self): + """Returns the generated SQL. + + Returns: + str: The generated SQL. + """ + where = " WHERE {0}".format(self._where_str) if self.has_where else "" + group_by = " GROUP BY {0}".format(self._grouping_str) if \ + self.has_group_by else "" + having = " HAVING {0}".format(self._having) if self.has_having else "" + order_by = " ORDER BY {0}".format(self._sort_str) if self.has_sort \ + else "" + limit = " LIMIT {0} OFFSET {1}".format(self._limit_row_count, + self._limit_offset) \ + if self.has_limit else "" + stmt = ("SELECT {select} FROM {schema}.{table}{where}{group}{having}" + "{order}{limit}".format(select=self._projection_str or "*", + schema=self.schema.name, + table=self.target.name, limit=limit, + where=where, group=group_by, + having=having, order=order_by)) + return stmt + + +class InsertStatement(WriteStatement): + """A statement for insert operations on Table. + + Args: + table (mysqlx.Table): The Table object. + *fields: The fields to be inserted. + """ + def __init__(self, table, *fields): + super(InsertStatement, self).__init__(table, False) + self._fields = flexible_params(*fields) + + def values(self, *values): + """Set the values to be inserted. + + Args: + *values: The values of the columns to be inserted. + + Returns: + mysqlx.InsertStatement: InsertStatement object. + """ + self._values.append(list(flexible_params(*values))) + return self + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + """ + return self._connection.send_insert(self) + + +class UpdateStatement(FilterableStatement): + """A statement for record update operations on a Table. + + Args: + table (mysqlx.Table): The Table object. + + .. versionchanged:: 8.0.12 + The ``fields`` parameters were removed. + """ + def __init__(self, table): + super(UpdateStatement, self).__init__(target=table, doc_based=False) + self._update_ops = [] + + def where(self, condition): + """Sets the search condition to filter. + + Args: + condition (str): Sets the search condition to filter records. + + Returns: + mysqlx.UpdateStatement: UpdateStatement object. + """ + return self._set_where(condition) + + def order_by(self, *clauses): + """Sets the order by criteria. + + Args: + *clauses: The expression strings defining the order by criteria. + + Returns: + mysqlx.UpdateStatement: UpdateStatement object. + """ + return self._sort(*clauses) + + def get_update_ops(self): + """Returns the list of update operations. + + Returns: + `list`: The list of update operations. + """ + return self._update_ops + + def set(self, field, value): + """Updates the column value on records in a table. + + Args: + field (string): The column name to be updated. + value (object): The value to be set on the specified column. + + Returns: + mysqlx.UpdateStatement: UpdateStatement object. + """ + self._update_ops.append( + UpdateSpec(mysqlxpb_enum( + "Mysqlx.Crud.UpdateOperation.UpdateType.SET"), field, value)) + return self + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object + + Raises: + ProgrammingError: If condition was not set. + """ + if not self.has_where: + raise ProgrammingError("No condition was found for update") + return self._connection.update(self) + + +class RemoveStatement(FilterableStatement): + """A statement for document removal from a collection. + + Args: + collection (mysqlx.Collection): The Collection object. + condition (str): Sets the search condition to identify the documents + to be removed. + + .. versionchanged:: 8.0.12 + The ``condition`` parameter was added. + """ + def __init__(self, collection, condition): + super(RemoveStatement, self).__init__(target=collection, + condition=condition) + + def sort(self, *clauses): + """Sets the sorting criteria. + + Args: + *clauses: The expression strings defining the sort criteria. + + Returns: + mysqlx.FindStatement: FindStatement object. + """ + return self._sort(*clauses) + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + + Raises: + ProgrammingError: If condition was not set. + """ + if not self.has_where: + raise ProgrammingError("No condition was found for remove") + return self._connection.delete(self) + + +class DeleteStatement(FilterableStatement): + """A statement that drops a table. + + Args: + table (mysqlx.Table): The Table object. + + .. versionchanged:: 8.0.12 + The ``condition`` parameter was removed. + """ + def __init__(self, table): + super(DeleteStatement, self).__init__(target=table, doc_based=False) + + def where(self, condition): + """Sets the search condition to filter. + + Args: + condition (str): Sets the search condition to filter records. + + Returns: + mysqlx.DeleteStatement: DeleteStatement object. + """ + return self._set_where(condition) + + def order_by(self, *clauses): + """Sets the order by criteria. + + Args: + *clauses: The expression strings defining the order by criteria. + + Returns: + mysqlx.DeleteStatement: DeleteStatement object. + """ + return self._sort(*clauses) + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + + Raises: + ProgrammingError: If condition was not set. + """ + if not self.has_where: + raise ProgrammingError("No condition was found for delete") + return self._connection.delete(self) + + +class CreateCollectionIndexStatement(Statement): + """A statement that creates an index on a collection. + + Args: + collection (mysqlx.Collection): Collection. + index_name (string): Index name. + index_desc (dict): A dictionary containing the fields members that + constraints the index to be created. It must have + the form as shown in the following:: + + {"fields": [{"field": member_path, + "type": member_type, + "required": member_required, + "collation": collation, + "options": options, + "srid": srid}, + # {... more members, + # repeated as many times + # as needed} + ], + "type": type} + """ + def __init__(self, collection, index_name, index_desc): + super(CreateCollectionIndexStatement, self).__init__(target=collection) + self._index_desc = copy.deepcopy(index_desc) + self._index_name = index_name + self._fields_desc = self._index_desc.pop("fields", []) + + def execute(self): + """Execute the statement. + + Returns: + mysqlx.Result: Result object. + """ + # Validate index name is a valid identifier + if self._index_name is None: + raise ProgrammingError( + ERR_INVALID_INDEX_NAME.format(self._index_name)) + try: + parsed_ident = ExprParser(self._index_name).expr().get_message() + + # The message is type dict when the Protobuf cext is used + if isinstance(parsed_ident, dict): + if parsed_ident["type"] != mysqlxpb_enum( + "Mysqlx.Expr.Expr.Type.IDENT"): + raise ProgrammingError( + ERR_INVALID_INDEX_NAME.format(self._index_name)) + else: + if parsed_ident.type != mysqlxpb_enum( + "Mysqlx.Expr.Expr.Type.IDENT"): + raise ProgrammingError( + ERR_INVALID_INDEX_NAME.format(self._index_name)) + + except (ValueError, AttributeError): + raise ProgrammingError( + ERR_INVALID_INDEX_NAME.format(self._index_name)) + + # Validate members that constraint the index + if not self._fields_desc: + raise ProgrammingError("Required member \"fields\" not found in " + "the given index description: {}" + "".format(self._index_desc)) + + if not isinstance(self._fields_desc, list): + raise ProgrammingError("Required member \"fields\" must contain a " + "list.") + + args = {} + args["name"] = self._index_name + args["collection"] = self._target.name + args["schema"] = self._target.schema.name + if "type" in self._index_desc: + args["type"] = self._index_desc.pop("type") + else: + args["type"] = "INDEX" + args["unique"] = self._index_desc.pop("unique", False) + # Currently unique indexes are not supported: + if args["unique"]: + raise NotSupportedError("Unique indexes are not supported.") + args["constraint"] = [] + + if self._index_desc: + raise ProgrammingError("Unidentified fields: {}" + "".format(self._index_desc)) + + try: + for field_desc in self._fields_desc: + constraint = {} + constraint["member"] = field_desc.pop("field") + constraint["type"] = field_desc.pop("type") + constraint["required"] = field_desc.pop("required", False) + if args["type"].upper() == "SPATIAL" and \ + not constraint["required"]: + raise ProgrammingError('Field member "required" must be ' + 'set to "True" when index type is' + ' set to "SPATIAL"') + if args["type"].upper() == "INDEX" and \ + constraint["type"] == 'GEOJSON': + raise ProgrammingError('Index "type" must be set to ' + '"SPATIAL" when field type is set ' + 'to "GEOJSON"') + if "collation" in field_desc: + if not constraint["type"].upper().startswith("TEXT"): + raise ProgrammingError( + "The \"collation\" member can only be used when " + "field type is set to \"GEOJSON\"") + else: + constraint["collation"] = field_desc.pop("collation") + # "options" and "srid" fields in IndexField can be + # present only if "type" is set to "GEOJSON" + if "options" in field_desc: + if constraint["type"].upper() != 'GEOJSON': + raise ProgrammingError( + "The \"options\" member can only be used when " + "index type is set to \"GEOJSON\"") + else: + constraint["options"] = field_desc.pop("options") + if "srid" in field_desc: + if constraint["type"].upper() != 'GEOJSON': + raise ProgrammingError( + "The \"srid\" member can only be used when index" + " type is set to \"GEOJSON\"") + else: + constraint["srid"] = field_desc.pop("srid") + args["constraint"].append(constraint) + except KeyError as err: + raise ProgrammingError("Required inner member {} not found in " + "constraint: {}".format(err, field_desc)) + + for field_desc in self._fields_desc: + if field_desc: + raise ProgrammingError("Unidentified inner fields:{}" + "".format(field_desc)) + + return self._connection.execute_nonquery( + "mysqlx", "create_collection_index", True, args)