larkery / zsh-histdb

A slightly better history for zsh
MIT License
1.28k stars 75 forks source link

bad math expression on first installation #69

Open grimreaper opened 4 years ago

grimreaper commented 4 years ago

I am having some issues installing this. Note that I don't use o-m-z.

To reproduce:

  1. git clone git@github.com:larkery/zsh-histdb.git ~/z
  2. add
    . ~/z/zsh-histdb/sqlite-history.zsh
    autoload -Uz add-zsh-hook
    add-zsh-hook precmd histdb-update-outcome

    to my ~/.zshrc. this reproduces without anything else there

  3. Open new shell

What I expect to see: A functional history replacement

What I actually see:

-- Loading resources from /Users/eax/.sqliterc
/Users/eax/z/zsh-histdb/histdb-migrate:8: bad math expression: operator expected at `2'
-- Loading resources from /Users/eax/.sqliterc
Error: near line 8: misuse of aggregate function max()
BuyingEagle%
larkery commented 4 years ago

It may be that your sqlite is somehow incompatible with the query being run?

I am unable to reproduce this issue, so I guess it's caused by something else in the environment like software version.

grimreaper commented 4 years ago

sqlite information:

∴sqlite3 --version
-- Loading resources from /Users/eax/.sqliterc
3.32.0 2020-05-22 17:46:16 5998789c9c744bce92e4cff7636bba800a75574243d6977e1fc8281e360f8d5a

sqlite> PRAGMA compile_options;
compile_options
COMPILER=clang-10.0.1
DISABLE_INTRINSIC
ENABLE_COLUMN_METADATA
ENABLE_DBSTAT_VTAB
ENABLE_FTS3_PARENTHESIS
ENABLE_FTS4
ENABLE_FTS5
ENABLE_GEOPOLY
ENABLE_JSON1
ENABLE_RTREE
ENABLE_STAT4
ENABLE_STMTVTAB
ENABLE_UNLOCK_NOTIFY
SECURE_DELETE
SOUNDEX
THREADSAFE=1
Run Time: real 0.000 user 0.000060 sys 0.000036
larkery commented 4 years ago

Doesn't seem likely it's the version as yours is newer than mine.

I notice that your log speaks of .sqliterc, which I don't have. It could be that there is something in there affecting things, as I think that's run before anything else.

I don't think I can turn loading of .sqliterc off.

grimreaper commented 4 years ago
.headers on
.timer on

Is the contents of my ~/.sqliterc. There is no difference if I remove it. In addition, it is only used in interactive mode and not used in normal mode.

My guess is some compile-time option or difference of runtime default.