#118 Segmentation fault in MATCH AGAINST queries

MySQLdb-1.1
closed
MySQLdb (285)
5
2012-09-19
2005-01-05
Eugene Bond
No

MySQLdb: 1.1.7, 1.1.8
MySQL: 4.1.7
System: FreeBSD

In queries "SELECT blabla, MATCH foo AGAINST ('bar') AS
rel FROM table..." I got "Segmentation fault" and
process stoped..
All other SELECTs, INSERTs, etc works fine.

Discussion

<< < 1 2 (Page 2 of 2)
  • Andy Dustman

    Andy Dustman - 2005-01-23

    Logged In: YES
    user_id=71372

    OK, here's my slightly cheesy test program:

    !/usr/bin/python

    schema = """
    CREATE TABLE my_fs (
    id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
    path VARCHAR(255) NOT NULL,
    contents TEXT NOT NULL,
    FULLTEXT (path,contents)
    )"""

    def create(c, dummy):
    c.execute(schema)

    def index(c, path):
    import os.path
    if os.path.isfile(path):
    contents = open(path).read()
    c.execute("""INSERT INTO my_fs (path, contents)
    VALUES (%s,%s)""",
    (path, contents))
    elif os.path.isdir(path):
    for file in [ os.path.join(path, f) for f in
    os.listdir(path) ]
    :
    index(c, file)

    def find(c, what):
    c.execute("""SELECT path, MATCH (path, contents) AGAINST
    (%s) AS rel
    FROM my_fs
    WHERE MATCH (path, contents) AGAINST (%s)
    LIMIT 10""", (what,what))
    for path, rel in c:
    print path, rel

    if name == "main":
    import sys, MySQLdb
    db =
    MySQLdb.connect(db='test',read_default_file="~/.my.cnf")
    c = db.cursor()
    f = globals()[sys.argv[1]]
    f(c, sys.argv[2])

    Results:

    andy@tweek MySQLdb $ python fulltexttest.py create nothin
    andy@tweek MySQLdb $ python fulltexttest.py index .
    andy@tweek MySQLdb $ python fulltexttest.py find Cursor
    ./regress3.py~ 1.0185829401
    ./regress3.py 1.016715765
    ./regress2.py 0.944855749607
    ./MySQLdb/cursors.pyc 0.809565961361
    ./doc/public/trees.html 0.777606010437
    ./build/lib.linux-i686-2.3/MySQLdb/connections.py 0.730027079582
    ./MySQLdb/connections.py 0.728077411652
    ./build/lib.linux-i686-2.4/MySQLdb/connections.py 0.706077456474
    ./build/lib.linux-i686-2.3/MySQLdb/cursors.py 0.692252576351
    ./MySQLdb/cursors.py 0.689828455448

    Test performed on Linux on i386, MySQL-4.1.8.

    In other words, I can't reproduce the problem.

     
  • Andy Dustman

    Andy Dustman - 2005-01-23

    Logged In: YES
    user_id=71372

    Additionally, I am using Python 2.4 and the CVS MySQLdb (but
    not significantly different from 1.1.9).

     
  • Eugene Bond

    Eugene Bond - 2005-01-25

    Logged In: YES
    user_id=1190738

    Your test produce same results:

    1. on running with params create and index it gives:
      Exception exceptions.AttributeError: "'Connection' object
      has no attribute 'next_result'" in <bound method="" Cursor.__del__="" of="" <MySQLdb.cursors.Cursor="" object="" at="" 0x81cce2c="">> ignored

    2. on running with param find drops down with:
      Segmentation fault (core dumped)

    Table my_fs contains all data.. Manual executing of query
    works and returns right results..

     
  • Eugene Bond

    Eugene Bond - 2005-02-15

    Logged In: YES
    user_id=1190738

    I have installed ver 1.2 and looks like there is no more
    problem.

    Thanks

     
  • Eugene Bond

    Eugene Bond - 2005-02-15

    Logged In: YES
    user_id=1190738

    This has already been fixed in the most recent release; please
    upgrade.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks