Comments (8)
This doesn't seem like an issue with stored procedures, the error message coming directly from mysql appears to be related to the delimiter syntax.
What happens if you execute this script directly using the mysql command?
from dbmate.
I'm running into this as well. Works perfectly in MySQL workbench, but fails in dbmate up
.
Ultimately we were trying to change the DELIMITER
to run a CREATE FUNCTION
statement, but on MySQL 5.7.25 we were able to just use a ;
on the END
statement as well as throughout the function body and everything appears to have just worked.
from dbmate.
I think it's probably an issue coming from the go MySQL driver. It might be ignoring the delimiter syntax and trying to send the whole statement through to MySQL.
from dbmate.
I've just googled a bit and this seems to be a feature of the MySQL command line client and various other tools. It's not part of the SQL spec that a MySQL server understands, so this might be out of scope for dbmate
as well.
from dbmate.
I'm also facing the same issue. How soon this get resolved?
@amacneil I'm trying to run this file/migration. any solution for this?
DROP TRIGGER IF EXISTS `green_production`.`Customers_BEFORE_INSERT`;
DELIMITER $$
USE `green_production` $$
CREATE DEFINER = CURRENT_USER TRIGGER `green_production`.`Customers_BEFORE_INSERT` BEFORE INSERT ON `Customers` FOR EACH ROW
BEGIN
SET new.name = CONCAT(new.firstName, ' ', new.lastName);
END$$
DELIMITER ;
DROP TRIGGER IF EXISTS `green_production`.`Customers_BEFORE_UPDATE`;
DELIMITER $$
USE `green_production`$$
CREATE DEFINER = CURRENT_USER TRIGGER `green_production`.`Customers_BEFORE_UPDATE` BEFORE UPDATE ON `Customers` FOR EACH ROW
BEGIN
SET new.name = CONCAT(new.firstName, ' ', new.lastName);
END$$
DELIMITER ;
Error
Applying: 20200221064402_customers_trigger_before_insert_update.sql
Error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$
USE `green_production`$$
CREATE DEFINER = CURRENT_USER TRIGG' at line 5
from dbmate.
Unfortunate response: go-sql-driver/mysql#351
The delimiter is not a feature of the SQL query language that the server understands. It is a feature of the mysql commandline client and can only be used there.
from dbmate.
I'm also facing the same issue. How soon this get resolved?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near delimiter $$
from dbmate.
I doubt we're looking at this one getting resolved, @zionsky79, the workaround here is to rewrite your queries so that you don't need to use the DELIMITER
statement, which is almost always possible but may require some acrobatics.
from dbmate.
Related Issues (20)
- Dbmate Unable to Create SchemaMigrations Table HOT 6
- Postgres Schemas with special characters have DBMate create migration tables then cannot find it again
- ClickHouse Cloud https connection doesn't work HOT 2
- Getting pq: syntax error at or near "transaction" when running migration with transaction:false HOT 7
- The migration lock is not released after terminating the migration HOT 2
- Comments (on columns) that include line breaks are never created. HOT 1
- dbmate requires each migration to define a down block with '-- migrate:down' when it defined HOT 5
- No Zookeeper configuration in server config
- Support all DSN variants for clickhouse DATABASE_URL HOT 8
- Wait for Postgres to be ready HOT 3
- $PGHOST & $PGPORT are not respected. HOT 2
- Add a section to the README documenting how environment variables are used by dbmate
- Table aliases don't work with ClickHouse HOT 2
- Add `--wait-interval` and `$DBMATE_WAIT_INTERVAL` to make wait interval configurable at runtime HOT 7
- The latest release is missing all the binaries HOT 2
- Could not open extension control file "/share/extension/http.control" HOT 2
- Embedded FS on Windows HOT 2
- `make docker-all` timeout when run locally. HOT 1
- DBMate always delets my database anytime I run a migration HOT 1
- Library methods not using context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbmate.