Skip to content

Instantly share code, notes, and snippets.

@leeclemens
leeclemens / test_segfault_ping.py
Last active February 28, 2021 02:03
Test to reproduce segmentation fault, caused by conn.ping()
"""Test to reproduce segmentation fault, caused by conn.ping()
"""
import threading
import time
import mariadb
HOST = ''
PORT = ''
USER = ''
@leeclemens
leeclemens / test_type_bug.py
Created February 5, 2021 03:08
mariadb-connector-python char type bytes if prepared
import mariadb
HOST = ''
PORT = ''
USER = ''
PASSWORD = ''
DATABASE = ''
"""
CREATE TABLE `t` (
import dis
class CSPROTO_CLASS(object):
EMPTY = b""
CLOSE = b"<F2B_CLOSE_COMMAND>"
END = b"<F2B_END_COMMAND>"
CLOSE_END = CLOSE + END
@leeclemens
leeclemens / DaemonizationThreadTest.py
Created March 17, 2012 01:33
Test case for issue with multithreading Popen with pipes when daemonized
#!/usr/bin/env python
import logging
import os
import subprocess
import sys
from threading import Event, Thread
# Only used to sleep between sends
#noinspection PyUnresolvedReferences