Hi, ALL,
I have the following problem.
I am trying to use mySQL from the python script. Right now it uses InnoDB and have following code (pseudo-code):
connect to database
get the cursor
query = "INSERT INTO my_table VALUES(line,b,c);"
for line in range( 0, 5 ):
cursor.execute( query )
db.commit()
cursor.close()
db.close()
The problem is that one of the fields in the table has to be declared as TEXT and it is possible it will be selected to be part of the index.
Upon googling, I found that MyISAM engine support full text search, but it does not support transactions, so aforementioned code will have to be rewritten.
I also looked up MyISAM engine vs. InnoDB engine comparison and I'm afraid that I don't understand something. If I lock the table, start the loop and then somewhere on the iteration the insertion fails - does this mean the database will end up with only some records?
What is a proper way of handling such case?
There is only one table involved n the query and thats it.
Thank you.