Код примерно такой:
import sys
import MySQLdb
import thread
cx = MySQLdb.connect (...)
cur = cx.cursor()
cur.execute("SET NAMES utf8;")
cur.execute("SET CHARACTER SET utf8;")
cur.execute("SET character_set_connection=utf8;")
def select():
try:
cur.execute ("SELECT product_id FROM product_feature;")
except Exception,e:
print "SQL Error: %s" % str(e)
n_t = 0
NTMAX = 15
for i in xrange (100):
while (n_t > NTMAX):
sys.stdout.write (".")
time.sleep (0.2)
n_t = n_t + 1
thread.start_new (select, ())
print "Waiting ..."
while (n_t > 0):
time.sleep (0.2);
Python вываливается с такой ошибкой?
$ python test.py
.SQL Error: (2006, 'MySQL server has gone away')
Segmentation fault (core dumped)
В чем проблема? Почему вылетает по SEGFAULT?