Jump to content

Search for "or" returns SQL errors


Guest Joff
 Share

Recommended Posts

I can't find any mention of this bug but I've discovered it across a number of CubeCart store versions from 4.2.3 up to 4.4.2

Has anyone come across this before and resolved it?

In 4.4.2

1139: Got error 'empty (sub)expression' from regexp

SELECT DISTINCT(I.productId), I.*, I.name AS SearchScore FROM CubeCart_inventory AS I, CubeCart_category AS C WHERE (I.name RLIKE '' OR I.description RLIKE '' OR I.productCode RLIKE '') AND C.cat_id > 0 AND C.cat_id = I.cat_id AND C.hide = '0' AND (C.cat_desc != '##HIDDEN##' OR C.cat_desc IS NULL) AND I.disabled = '0' ORDER BY name ASC





In 4.3.3 and earlier

1054: Unknown column 'O' in 'where clause'


SELECT DISTINCT(I.productId), I.*, I.name AS SearchScore FROM CubeCart_inventory AS I, CubeCart_category AS C WHERE O AND C.cat_id > 0 AND C.cat_id = I.cat_id AND C.hide = '0' AND (C.cat_desc != '##HIDDEN##' OR C.cat_desc IS NULL) AND I.disabled = '0' ORDER BY name ASC

Link to comment
Share on other sites

If anyone's reading this, can you please try the search on your own stores and let me know if you're also affected?

I too am receiving this error. Interesting... Have you logged a bug?

Not yet, I wanted to make sure it wasn't just me going mad!

Link to comment
Share on other sites

  • 1 month later...

I can't find any mention of this bug but I've discovered it across a number of CubeCart store versions from 4.2.3 up to 4.4.2

Has anyone come across this before and resolved it?

In 4.4.2

1139: Got error 'empty (sub)expression' from regexp

SELECT DISTINCT(I.productId), I.*, I.name AS SearchScore FROM CubeCart_inventory AS I, CubeCart_category AS C WHERE (I.name RLIKE '' OR I.description RLIKE '' OR I.productCode RLIKE '') AND C.cat_id > 0 AND C.cat_id = I.cat_id AND C.hide = '0' AND (C.cat_desc != '##HIDDEN##' OR C.cat_desc IS NULL) AND I.disabled = '0' ORDER BY name ASC





In 4.3.3 and earlier

1054: Unknown column 'O' in 'where clause'


SELECT DISTINCT(I.productId), I.*, I.name AS SearchScore FROM CubeCart_inventory AS I, CubeCart_category AS C WHERE O AND C.cat_id > 0 AND C.cat_id = I.cat_id AND C.hide = '0' AND (C.cat_desc != '##HIDDEN##' OR C.cat_desc IS NULL) AND I.disabled = '0' ORDER BY name ASC

put this in the search form too ' it is straight quote mark/apostrophe, the sql error will show

Link to comment
Share on other sites

Yeah, I'm getting this too.

Not in mine, I think it's been resolved by 4.4.2. Also, the original bug I posted above was fixed by following Technocrat's solution: http://bugs.cubecart.com/view.php?id=2228

Link to comment
Share on other sites

Yeah, I'm getting this too.

Not in mine, I think it's been resolved by 4.4.2. Also, the original bug I posted above was fixed by following Technocrat's solution: http://bugs.cubecart.com/view.php?id=2228

I have change the code and it works perfect, the sql not error again to search for "or", but if search special character ' (apostrophe) the sql error still shown in CC 4.4.2.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...