Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling of example of MySQL fails with ghc 8.2.2 #56

Open
nakaji-dayo opened this issue Feb 12, 2018 · 2 comments
Open

Compiling of example of MySQL fails with ghc 8.2.2 #56

nakaji-dayo opened this issue Feb 12, 2018 · 2 comments
Labels

Comments

@nakaji-dayo
Copy link

nakaji-dayo commented Feb 12, 2018

I am trying to build examples/HDBC/MySQL using LTS Haskell 10.5 (ghc-8.2.2)
It fails with the following error when getting column information.

[56 of 57] Compiling Example.User     ( /Users/daishi/haskell/haskell-relational-record/examples/HDBC/MySQL/src/Example/User.hs, interpreted )

/Users/daishi/haskell/haskell-relational-record/examples/HDBC/MySQL/src/Example/User.hs:1:1: error:
    Exception when trying to run compile-time code:
      SqlError {seState = "", seNativeError = 1146, seErrorMsg = "Table 'TEST.columns' doesn't exist"}
    Code: defineTable [] "TEST" "user" [''Generic]
  |
1 | {-# LANGUAGE TemplateHaskell #-}
  | ^

I installed following versions of packages.

Cabal 2.0.1.1
HDBC 2.4.0.2
HDBC-mysql 0.7.1.0
HDBC-session 0.1.1.1
array 0.5.2.0
base 4.10.1.0
binary 0.8.5.1
bytestring 0.10.8.2
containers 0.5.10.2
convertible 1.1.1.0
deepseq 1.4.3.0
directory 1.3.0.2
dlist 0.8.0.4
filepath 1.4.1.2
ghc-boot-th 8.2.2
ghc-prim 0.5.1.1
hrr-example-HDBC-MySQL 0.1.0.0
integer-gmp 1.0.1.0
mtl 2.2.1
names-th 0.2.0.3
old-locale 1.0.0.7
old-time 1.1.0.3
persistable-record 0.6.0.0
persistable-types-HDBC-pg 0.0.1.5
pretty 1.1.3.3
process 1.6.1.0
product-isomorphic 0.0.3.1
relational-query 0.11.0.0
relational-query-HDBC 0.6.6.1
relational-record 0.2.1.2
relational-schemas 0.1.6.1
rts 1.0
sql-words 0.1.5.1
template-haskell 2.12.0.0
text 1.2.2.2
text-postgresql 0.0.2.3
th-data-compat 0.0.2.5
th-reify-compat 0.0.1.3
time 1.8.0.2
time-locale-compat 0.1.1.3
transformers 0.5.2.0
transformers-compat 0.5.1.4
unix 2.7.2.2
utf8-string 1.0.1.1

However, I can build with LTS 9.21 (GHC 8.0.2).

mysql version is 5.7.


There was an error in executing columnsQuerySQL in getColumns', but columnsQuerySQL seems to be making the correct query.

> show columnsQuerySQL
SELECT ALL T0.table_schema AS f0, T0.table_name AS f1, T0. Column_name AS f2, T 0 .ordinal_position AS f3, T0. Column_default AS f4, T0.is_nullable AS f5, T0.data _ type AS f6 FROM INFORMATION SCHEMA.columns T 0 WHERE T0.table_schema =?) AND (T0.table_name =?) ORDER BY T0.ordinal_position ASC
@khibino
Copy link
Owner

khibino commented Apr 13, 2018

Hi.

This issue is NOT re-produced both in LTS-10.5 and in LTS-9.21
with stack-1.6.5 and MySQL 5.7 executed in Debian GNU/Linux.
More custom configuration is needed?

  • lts-10.5
Building all executables for `hrr-example-HDBC-MySQL' once. After a successful build of all of them, only specified executables will be rebuilt.
hrr-example-HDBC-MySQL-0.1.0.0: configure (exe)
Configuring hrr-example-HDBC-MySQL-0.1.0.0...
hrr-example-HDBC-MySQL-0.1.0.0: build (exe)
Preprocessing executable 'example' for hrr-example-HDBC-MySQL-0.1.0.0..
Building executable 'example' for hrr-example-HDBC-MySQL-0.1.0.0..

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: Example.DataSource
                                                                                                 Example.User
[1 of 3] Compiling Example.DataSource ( src/Example/DataSource.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/example/example-tmp/Example/DataSource.o )

/mnt/stack-work/hibi/HRR/lts-10/examples/HDBC/MySQL/src/Example/DataSource.hs:34:20: warning: [-Wdeprecations]
    In the use of ‘defineTableFromDB'’
    (imported from Database.HDBC.Query.TH):
    Deprecated: "Use defineTableFromDB with updated driverConfig field of Driver argument."
   |
34 | defineTable tmap = defineTableFromDB' connect config (driverMySQL { typeMap = tmap })
   |                    ^^^^^^^^^^^^^^^^^^
[2 of 3] Compiling Example.User     ( src/Example/User.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/example/example-tmp/Example/User.o )
[3 of 3] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/example/example-tmp/Main.o )

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: Example.DataSource
                                                                                                 Example.User
Linking .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/example/example ...


Warning: The following modules should be added to exposed-modules or other-modules in /mnt/stack-work/hibi/HRR/lts-10/examples/HDBC/MySQL/hrr-example-HDBC-MySQL.cabal:
             - In example component:
                 Example.DataSource
                 Example.User

         Missing modules in the cabal file are likely to cause undefined reference errors from the linker, along with other problems.
hrr-example-HDBC-MySQL-0.1.0.0: copy/register
Installing executable example in /mnt/stack-work/hibi/HRR/lts-10/examples/HDBC/MySQL/.stack-work/install/x86_64-linux-nopie/lts-10.5/8.2.2/bin
  • lts-9.21
Building all executables for `hrr-example-HDBC-MySQL' once. After a successful build of all of them, only specified executables will be rebuilt.
hrr-example-HDBC-MySQL-0.1.0.0: configure (exe)
Configuring hrr-example-HDBC-MySQL-0.1.0.0...
hrr-example-HDBC-MySQL-0.1.0.0: build (exe)
Preprocessing executable 'example' for hrr-example-HDBC-MySQL-0.1.0.0...
[3 of 3] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0/build/example/example-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0/build/example/example ...

Warning: The following modules should be added to exposed-modules or other-modules in /mnt/stack-work/hibi/HRR/lts-9/examples/HDBC/MySQL/hrr-example-HDBC-MySQL.cabal:
             - In example component:
                 Example.DataSource
                 Example.User

         Missing modules in the cabal file are likely to cause undefined reference errors from the linker, along with other problems.
hrr-example-HDBC-MySQL-0.1.0.0: copy/register
Installing executable(s) in
/mnt/stack-work/hibi/HRR/lts-9/examples/HDBC/MySQL/.stack-work/install/x86_64-linux-nopie/lts-9.21/8.0.2/bin

@khibino
Copy link
Owner

khibino commented Apr 13, 2018

MySQL case sensitivity may concern this issue.

Maybe you shoud try the lower_case_table_names MySQL system variable.

http://khibino.github.io/haskell-relational-record/faq.html#mysql-table-does-not-exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants