4 ms·
Do they have stored procedures yet?
by orionblastar 1y ago
Do they have stored procedures yet?
- hu3 1y ago> Do they have stored procedures yet? MySQL has supported Stored Procedures since version 5. That was 20 years ago. No offense but I'm always curious about how people solidify easily verifiable missinformation as facts. I'm assuming most spread it out of ignorance, not malice.
- OptionOfT 1y agoThere is a whole new group / generation of people who ask questions, expecting a ready-to-consume answer, and no longer capable of doing the research themselves. I feel that as soon ChatGPT & friends are going to start with native advertising, a whole new market will open up. And it won't be good.
- kruffalon 1y agoWhy would you put someone of at least 30yrs old (but probably more like 40yrs old as I can't imagine a 10-15yr old caring that much about stored procedures) into this elusive new generation that you obviously just want to bash for no apparent reason?
- ksec 1y agoPartly to blame when MySQL hasn't been doing the right / enough marketing. And Generally hard to submit MySQL content everywhere.
- rjh29 1y agoThere should be a blog post to point to people who have a 1990s view of MySQL. It has changed a lot and has most of PostgreSQL's feature set while being faster and simpler to use for the average user.
- mdaniel 1y ago> and has most of PostgreSQL's feature set while being faster and simpler to use for the average user. I would read that blog post, because I am firmly in the "mysql/mariadb is for people who like mongo" camp but I like learning new things While I was delighted to see that 11 no longer just straight-up throws input data in the trash, I get a lot of mileage out of transactional DDL which seems to still be a PG feature docker run -d --name my -e MARIADB_ROOT_PASSWORD=sekrit docker.io/library/mariadb:11.4.7 docker exec -i my mariadb -psekrit mysql <<SQL BEGIN; CREATE TABLE just_kidding (pk int); CREATE TABLE onoz (migrations are hard, yo); ROLLBACK; SQL docker exec -i my mariadb -psekrit mysql <<SQL SELECT count(1) FROM just_kidding; SQL count(1) 0 While digging into its stored-proc story, I found these two gems https://mariadb.com/kb/en/sql_modemssql/ https://mariadb.com/kb/en/sql_modemssql/ https://mariadb.com/kb/en/sql_modeoracle/ https://mariadb.com/kb/en/sql_modeoracle/ which I would enjoy exploring more
- evanelias 1y ago> I was delighted to see that 11 no longer just straight-up throws input data in the trash You're essentially proving the upthread commenter's point here... the relevant setting is strict sql_mode, which has been available as an option for literally 20 years, and has generally been used by any serious MySQL/MariaDB shop for that whole time. Long ago it wasn't enabled by default out of the box, but it has been since MySQL 5.7 (released 10 years ago) and MariaDB 10.2 (released over 8 years ago). > I get a lot of mileage out of transactional DDL which seems to still be a PG feature Correct, MySQL and MariaDB do not support transactional DDL, and maybe never will. That's not a unique shortcoming though, as Oracle and SQLite don't support it either. MS SQL Server does support it, but if I recall correctly there are caveats depending on the isolation level in use. Postgres clearly wins out on that feature, but as with everything in computing, it comes with serious trade-offs: a rather sub-par MVCC implementation [1], and lack of DDL support in logical replication [2]. I'm biased because I work in this space, but IMO it's easy to live without transactional DDL in MySQL/MariaDB if you pair a good schema management system (which allows you to test and lint DDL) with an online schema change tool (which allows you to throw away the shadow table if something goes wrong). And generally you shouldn't be running DDL by hand directly in prod anyway... [1] https://www.cs.cmu.edu/~pavlo/blog/2023/04/the-part-of-postgresql-we-hate-the-most.html https://www.cs.cmu.edu/~pavlo/blog/2023/04/the-part-of-postg... [2] https://www.postgresql.org/docs/current/logical-replication-restrictions.html https://www.postgresql.org/docs/current/logical-replication-...