Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P90
(An Untitled Masterwork)
Active
Public
Actions
Authored by
stwalkerster
on Jan 25 2017, 11:52 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Tags
None
Referenced Files
F7609:
Jan 25 2017, 11:52 PM
2017-01-25 23:52:25 (UTC+0)
Subscribers
None
MariaDB [test]> create table mytable (
-> id varchar(50) not null,
-> name varchar(50) null default '',
-> primary key (id));
Query OK, 0 rows affected (0.26 sec)
MariaDB [test]> create view myview as
-> select id,name from mytable;
Query OK, 0 rows affected (0.05 sec)
MariaDB [test]>
MariaDB [test]> insert into mytable values ('1','aaa');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> insert into mytable values ('2','bbb');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> insert into mytable values ('3','ccc');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> select * from mytable;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
| 2 | bbb |
| 3 | ccc |
+----+------+
3 rows in set (0.00 sec)
MariaDB [test]> select * from myview;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
| 2 | bbb |
| 3 | ccc |
+----+------+
3 rows in set (0.01 sec)
MariaDB [test]> prepare cmd from 'select id,name from mytable where id=?';
Query OK, 0 rows affected (0.00 sec)
Statement prepared
MariaDB [test]> set @param1 = '2';
Query OK, 0 rows affected (0.06 sec)
MariaDB [test]> execute cmd using @param1;
+----+------+
| id | name |
+----+------+
| 2 | bbb |
+----+------+
1 row in set (0.00 sec)
MariaDB [test]> deallocate prepare cmd;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> prepare cmd from 'select id,name from myview where id=?';
Query OK, 0 rows affected (0.00 sec)
Statement prepared
MariaDB [test]> set @param1 = '2';
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> execute cmd using @param1;
ERROR 1615 (HY000): Prepared statement needs to be re-prepared
MariaDB [test]> deallocate prepare cmd;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]>
Event Timeline
stwalkerster
created this paste.
Jan 25 2017, 11:52 PM
2017-01-25 23:52:25 (UTC+0)
•
import-bot
changed the edit policy from "All Users" to "
Community
(Project)".
Feb 3 2017, 3:03 PM
2017-02-03 15:03:28 (UTC+0)
Log In to Comment