src-d / gitbase

SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Apache License 2.0
2.07k stars 123 forks source link

ERROR 1105 (HY000): unknown error: unable to cast nil to bool #902

Closed ajnavarro closed 5 years ago

ajnavarro commented 5 years ago

Error executing example query:

SELECT repository_id,
       file_path,
       uast_extract(uast(blob_content, LANGUAGE(file_path), '//uast:Import/Path'), "Value") AS imports
FROM commit_files
NATURAL JOIN refs
NATURAL JOIN blobs
WHERE ref_name = 'HEAD'
  AND LANGUAGE(file_path) = 'Go'
  AND ARRAY_LENGTH(imports) > 0;
ajnavarro commented 5 years ago

The problem appears to be when LANGUAGE is used without blob_content second param.

erizocosmico commented 5 years ago

Needs this PR https://github.com/src-d/go-mysql-server/pull/768 merged before applying the fix here.