mysql

When I add xx to mysql float column, it is wrong result, Is it a bug?

十年热恋 提交于 2021-02-10 07:11:52
问题 My mysql: 5.6.16 my table info : CREATE TABLE `xxx` ( `uid` int(11) NOT NULL, `money` float(10,2) NOT NULL DEFAULT '0.00' , `real_money` float(10,2) NOT NULL , `available_invoice` float(10,2) DEFAULT NULL, PRIMARY KEY (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; my table content is : 1 100000.00 0.00 0.01 30 99992560.00 0.03 0.00 61 65216.00 0.03 0.00 79 10.00 0.00 0.00 80 10.00 0.00 0.00 81 -70.00 0.00 0.00 83 60.00 0.00 0.00 100 100.00 50.00 50.00 889 980.00 0.00 0

KeyCloak User Federation AND DYNAMIC ROLES

自闭症网瘾萝莉.ら 提交于 2021-02-10 07:08:43
问题 I am using this guide http://www.keycloak.org/docs/3.2/server_development/topics/user-storage.html to configure user federation. This works fine and my users can login. My users are stored in a Mysql Database. Users have different roles - also store in mysql. I am not not sure of how to add roles to the UserModel. I've implemented getUserXXX methods e.g @Override public UserModel getUserByEmail(String email, RealmModel realm) { LOGGER.info("LOADING BY EMAIL"); try (Connection connection = ds

KeyCloak User Federation AND DYNAMIC ROLES

醉酒当歌 提交于 2021-02-10 07:05:53
问题 I am using this guide http://www.keycloak.org/docs/3.2/server_development/topics/user-storage.html to configure user federation. This works fine and my users can login. My users are stored in a Mysql Database. Users have different roles - also store in mysql. I am not not sure of how to add roles to the UserModel. I've implemented getUserXXX methods e.g @Override public UserModel getUserByEmail(String email, RealmModel realm) { LOGGER.info("LOADING BY EMAIL"); try (Connection connection = ds

Creating tables and importing data from .sql files in Spring boot

故事扮演 提交于 2021-02-10 06:42:08
问题 Current apporach: application.properties spring.datasource.url=jdbc:mysql://localhost:3306/db_name spring.datasource.username=root spring.datasource.password=admin spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.testWhileIdle = true spring.datasource.validationQuery = SELECT 1 spring.jpa.show-sql = true spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org

How to call MySQL stored procedure with multiple input values from ASP.NET

怎甘沉沦 提交于 2021-02-10 06:39:05
问题 This is my MySQL stored procedure. create procedure InsertIntotblStudentProc (PStudentId VARCHAR(10), PStudentName VARCHAR(10)) begin insert into tblStudent (StudentId, StudentName) values (PStudentId, PStudentName); end; Here's my ASP code. `MySqlCommand cmd = new MySqlCommand("InsertIntotblStudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("PStudentId", TextBox1.Text);` I stopped here as I want to call procedure with two parameters and my other

Doctrine2 DBAL Exists query

删除回忆录丶 提交于 2021-02-10 06:34:22
问题 I would like to ask for your help with Doctrine2 DBAL query built with QueryBuilder . I'm used to ORM, but I think it's an overkill for such query which is being called in a listener. I need a query with SELECT EXISTS and I don't know how I can construct it using DBAL QueryBuilder . I have a subquery already created: $subQuery = $connection->createQueryBuilder(); $subQuery ->select('o.id') ->from('order', 'o') ->leftJoin('o', 'payment', 'p') ->where($subQuery->expr()->isNull('p.id')) ; I

year 2038 issue - 64 bit (Linux OS, php, mysql)

最后都变了- 提交于 2021-02-10 06:24:09
问题 select unix_timestamp('2038-01-19') returns 2147472000 while select unix_timestamp('2038-01-20') returns 0 I have checked out the year 2038 problem. My linux OS is 64 bit and installed mysql version is also 64 bits. What is the solution to this problem now? mysql --version returns mysql Ver 14.14 Distrib 5.5.47, for Linux (x86_64) using readline 5.1 Php is 64 bit too. Tried BigInt too, didn't work (returns the same thing). 回答1: Simply put, for MySQL , store dates as DATETIME rather than

Transpose column names to rows and put values in seperate column

佐手、 提交于 2021-02-10 06:15:17
问题 I have the following table which you can also find in the SQL fiddle here: CREATE TABLE Flows ( Product TEXT, Inbound_Date DATE, Outbound_Date DATE, Return_Date DATE, Quantity VARCHAR(255) ); INSERT INTO Flows (Product, Inbound_Date, Outbound_Date, Return_Date, Quantity) VALUES ("Product A", "2019-01-01", NULL, NULL, "400"), ("Product A", NULL, "2019-05-08", NULL, "200"), ("Product A", NULL, NULL, "2019-06-25", "600"), ("Product B", "2019-03-08", NULL, NULL, "380"), ("Product B", NULL, "2019

ERROR! The server quit without updating PID file (/usr/local/var/mysql/`username`.lan.pid)

人盡茶涼 提交于 2021-02-10 06:14:34
问题 I cannot get rid of the error below. Installed homebrew via /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install mysql mysql.server start gives the error: ERROR! The server quit without updating PID file (/usr/local/var/mysql/ username .lan.pid). Some things I have tried: ps -ef | grep mysql outputs: 501 1196 1172 0 9:08PM ttys000 0:00.00 grep mysql which I then try to kill with kill -9 1172 . This just says Process Complete but then

MySQL Crashing on SQL

会有一股神秘感。 提交于 2021-02-10 06:10:50
问题 For the past 4 days MySQL keeps crashing on running scripts, like once / day this is the error log key_buffer_size=134217728 read_buffer_size=1048576 max_used_connections=39 max_threads=100 threads_connected=34 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 336508 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd: 0x92025f38 Attempting backtrace. You can use the following information to find