From boris at codesynthesis.com Mon Jul 1 07:39:14 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 1 08:01:52 2019 Subject: [odb-users] Can you give me some information about building ODB compiler on Windows In-Reply-To: References: Message-ID: ELE <710616819@qq.com> writes: > I want to build 64bit ODB compiler on Windows, Can you give me more > information about how to build it on Windows. https://codesynthesis.com/products/odb/doc/install-build2.xhtml From boris at codesynthesis.com Thu Jul 4 10:40:22 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 4 10:40:44 2019 Subject: [odb-users] Quering with empty string parameter error. Microsoft SQL Server In-Reply-To: References: Message-ID: Andrey Paraskevopulo writes: > As I understand, the problem that param in statement exists("... WHERE > name=?"), but the value in not binded. > > Possible solutions: > > 1. Init buffer data for the empty string with empty size (for the query > param) > > [...] Thanks for the report and analysis! I've applied a slightly different implementation of this fix. Could you confirm it works as expected for you: https://git.codesynthesis.com/cgit/odb/libodb-mssql/commit/?id=847c4a22c80f9bd8ea544e23309d3575ed1be904 > Remark: solution does not affect Blob variables (they have the null buf for > the empty values). May be the query problem can be reproduced for the Blobs > too. Hm, long_query_param_impl is used as a base for query_param_impl so I would expect this fix to also work for BLOBs. Or am I missing something here? > 2. Disable skip empty binds (with null buffer) > > [...] > > This solves the problem, but for me it hard to predict side effects. Yes, I vaguely remember there being some issues with passing NULL buffers to MSSQL (ODBC) runtime. From gregs_ymb at yahoo.com Mon Jul 29 01:39:42 2019 From: gregs_ymb at yahoo.com (G G) Date: Mon Jul 29 02:15:44 2019 Subject: [odb-users] odb build error: g++ does not support plugins References: <554026659.1436312.1564378782311.ref@mail.yahoo.com> Message-ID: <554026659.1436312.1564378782311@mail.yahoo.com> I try to build odb by mingw 32bit? ( Windows 10 64bit ): D:\build2\odb-build\odb-mingw>bpkg build?odb@https://pkg.cppget.org/1/betaadded pkg:cppget.org/betafetching pkg:cppget.org/betawarning: authenticity of the certificate for repository pkg:cppget.org/beta cannot be establishedcertificate is for cppget.org, "Code Synthesis" certificate SHA256 fingerprint:86:BA:D4:DE:2C:87:1A:EE:38:C7:F1:64:7F:65:77:02:15:79:F3:C4:83:C0:AB:5A:EA:F4:F7:8C:1D:63:30:C6trust this certificate? [y/n] yfetching pkg:cppget.org/testing (complements pkg:cppget.org/beta)fetching pkg:cppget.org/stable (complements pkg:cppget.org/testing)? new libstudxml/1.1.0-b.7 (required by odb)? new libcutl/1.11.0-b.6 (required by odb)? new odb/2.5.0-b.15continue? [Y/n] ylibstudxml-1.1.0-b.7.tar.gz:################################################################################################################ 100,0%fetched libstudxml/1.1.0-b.7unpacked libstudxml/1.1.0-b.7configured libstudxml/1.1.0-b.7libcutl-1.11.0-b.6.tar.gz:################################################################################################################ 100,0%fetched libcutl/1.11.0-b.6unpacked libcutl/1.11.0-b.6configured libcutl/1.11.0-b.6odb-2.5.0-b.15.tar.gz:################################################################################################################ 100,0%fetched odb/2.5.0-b.15unpacked odb/2.5.0-b.15odb-2.5.0-b.15\build\root.build:23:3: error: g++ does not support plugins D:\build2\odb-build\odb-mingw>g++ --versiong++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 7.3.0Copyright (C) 2017 Free Software Foundation, Inc.This is free software; see the source for copying conditions.? There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. What is it mean??What should be g++ version ??? Thanx. From boris at codesynthesis.com Mon Jul 29 09:17:30 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 29 09:19:07 2019 Subject: [odb-users] odb build error: g++ does not support plugins In-Reply-To: <554026659.1436312.1564378782311@mail.yahoo.com> References: <554026659.1436312.1564378782311.ref@mail.yahoo.com> <554026659.1436312.1564378782311@mail.yahoo.com> Message-ID: G G writes: > I try to build odb by mingw 32bit ( Windows 10 64bit ): > > [...] > > D:\build2\odb-build\odb-mingw>g++ --version > g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 7.3.0 ODB needs GCC with plugin support. We make sure plugin support is enable in MinGW GCC that is supplied with build2 (in the build2-mingw package, though since build2 version 0.10.0 it is 64-bit only). Also, since GCC version 9.1, the MSYS2 project started building their MinGW GCC with plugins enabled. So I would recommend that you use build2-mingw if you can (since that is the version we test ODB with) or, if you must use the 32-bit version for some reason, try GCC 9.1. From gregs_ymb at yahoo.com Mon Jul 29 13:36:56 2019 From: gregs_ymb at yahoo.com (G G) Date: Mon Jul 29 14:09:53 2019 Subject: [odb-users] odb build error: g++ does not support plugins In-Reply-To: References: <554026659.1436312.1564378782311.ref@mail.yahoo.com> <554026659.1436312.1564378782311@mail.yahoo.com> Message-ID: <1283223024.1573094.1564421816461@mail.yahoo.com> Thank you very much for your response.?By the way, how do you determine that the compiler supports plugins? ???????????, 29 ???? 2019 ?., 14:17:35 GMT+1, Boris Kolpackov ???????(-?): G G writes: > I try to build odb by mingw 32bit ( Windows 10 64bit ): > > [...] > > D:\build2\odb-build\odb-mingw>g++ --version > g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 7.3.0 ODB needs GCC with plugin support. We make sure plugin support is enable in MinGW GCC that is supplied with build2 (in the build2-mingw package, though since build2 version 0.10.0 it is 64-bit only). Also, since GCC version 9.1, the MSYS2 project started building their MinGW GCC with plugins enabled. So I would recommend that you use build2-mingw if you can (since that is the version we test ODB with) or, if you must use the 32-bit version for some reason, try GCC 9.1. From boris at codesynthesis.com Tue Jul 30 09:37:59 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 30 09:39:39 2019 Subject: [odb-users] odb build error: g++ does not support plugins In-Reply-To: <1283223024.1573094.1564421816461@mail.yahoo.com> References: <554026659.1436312.1564378782311.ref@mail.yahoo.com> <554026659.1436312.1564378782311@mail.yahoo.com> <1283223024.1573094.1564421816461@mail.yahoo.com> Message-ID: G G writes: > By the way, how do you determine that the compiler supports plugins? Your can run: $ g++ -print-file-name=plugin If the result is a directory (instead of a word 'plugin'), then GCC supports plugins. For example: $ g++ -print-file-name=plugin /usr/lib/gcc/x86_64-linux-gnu/5/plugin From icewill9999 at vip.qq.com Wed Jul 31 03:30:58 2019 From: icewill9999 at vip.qq.com (=?gb18030?B?srvD99Xmz+A=?=) Date: Thu Aug 1 07:58:56 2019 Subject: [odb-users] inserting chinese characters into mysql error (utf8mb4 and utf8 are tried) Message-ID: When i insert some chinese characters into mysql via odb, i got the error message "Incorrect string value: '\xD6\xD0\xB9\xFA' for column 'NATION' at row 1", i know it's the wrong setting of character set, i tried my efforts to fix the issue but all in vain. firstly i used odb2.4, mysql 8.0 mysql connector c 6.1.11 and vs2015 in my project, i tried using utf8mb4 charset, below is my configuration file: [mysqld] character-set-server = utf8mb4 collation-server = utf8mb4_general_ci init_connect='SET NAMES utf8mb4' skip-character-set-client-handshake = true [mysql] default-character-set=utf8mb4 [client] default-character-set=utf8mb4and it seems nothing wrong with the mysql server: mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; +--------------------------+--------------------+ | Variable_name | Value | +--------------------------+--------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8 | | collation_connection | utf8mb4_general_ci | | collation_database | utf8mb4_general_ci | | collation_server | utf8mb4_general_ci | +--------------------------+--------------------+ mysql> show create table basininfo; ------------------------------------------------------------------------------------------------+ | basininfo | CREATE TABLE `basininfo` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `BASIN_NAME` varchar(1000) DEFAULT NULL, `NATION` varchar(1000) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 the code piece induced the error is below: auto_ptr db( new odb::mysql::database( "news" // database login name , "news123" // database password , "newsdb" // database name , "localhost" , 3306 , nullptr ,"utf8mb4" )); transaction t(db->begin()); BasinInfo binfo; binfo.setNation("??"); //chinese character insert into column 'Nation' db->persist(binfo); t.commit();after that, i changed the mysql server to 5.7, replace the connector c to the libraray and include files that bundled with mysql 5.7, and rebuild the odb-libmysql, but that effort does not do any help. finally i changed the charset to utf8 and recreate the database, but problem remains the same. i also start a post on stackoverflow at https://stackoverflow.com/questions/57283107/problem-when-inserting-chinese-characters-into-mysql-via-c-odb, for now i dont get the problem solved!do you have any idea about how to fix it, thanks!