Error 1347 Is Not Base Table
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss mysql error 1347 is not view the workings and policies of this site About Us Learn more about
Error 1347 (hy000): Is Not Base Table
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow mysql error 1347 (hy000): is not base table Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each
Is Not Base Table Mysql
other. Join them; it only takes a minute: Sign up MySQL Creating trigger on view - Error 1347 up vote 4 down vote favorite 1 I'm to make a trigger that checks BEFORE INSERT whether the record already exists, and then take some actions. I'm stuck with this: Error Code: 1347. 'BazyLista3.Koncerty' is not BASE TABLE [ Solved ] error code 1347 is not base table We've established that you can not use triggers on views Here's the code for view Koncerty: CREATE VIEW Koncerty (`nazwa_klubu`, `adres_klubu`, `nazwa_zespolu`, `ilosc_czlonkow_zespolu`, `data_wystepu`) AS ( SELECT `nazwa_klubu`, `kb`.`adres`, `nazwa_zespolu`, `zs`.`ilosc_czlonkow`, `data_wystepu` FROM `Koncert` AS kc INNER JOIN `Klub` AS kb ON `kc`.`nazwa_klubu` = `kb`.`nazwa` INNER JOIN `Zespol` AS zs ON `kc`.`nazwa_zespolu` = `zs`.`nazwa` ); And my trigger, where I have this error: DROP TRIGGER IF EXISTS `before_koncerty_insert` DELIMITER $$ CREATE TRIGGER `before_koncerty_insert` BEFORE INSERT ON `Koncerty` FOR EACH ROW BEGIN DECLARE i INT DEFAULT 0; SELECT COUNT(*) INTO i FROM `Koncerty` WHERE `nazwa_klubu` = NEW.`nazwa_klubu` AND `adres_klubu` = NEW.`adres_klubu` AND `nazwa_zespolu` = NEW.`nazwa_zespolu` AND `ilosc_czlonkow_zespolu` = NEW.`ilosc_czlonkow_zespolu` AND `data_wystepu` = NEW.`data_wystepu`; IF i > 0 THEN SIGNAL SQLSTATE '58005' SET MESSAGE_TEXT = 'Blad! Taka krotka juz istnieje'; END IF; END $$ DELIMITER ; Update: base tables CREATE TABLE IF NOT EXISTS `Klub` ( `nazwa` varchar(50) NOT NULL, `adres` varchar(70) NOT NULL, PRIMARY KEY (`nazwa`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `Zespol` ( `nazwa` varchar(50) NOT NULL, `
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Error Code 1347 Is Not View
more about Stack Overflow the company Business Learn more about hiring developers or
View Is Not Base Table
posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question mysql alter view and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody http://stackoverflow.com/questions/20363805/mysql-creating-trigger-on-view-error-1347 can ask a question Anybody can answer The best answers are voted up and rise to the top Optimize command issuing “'View is not base table” and “Corrupt” error messages up vote 1 down vote favorite I have no experience with MySQL. My boss ran an optimize against a MySQL database. Against a bunch of views we got the message "tablexyz" is not BASE TABLE and the next has http://dba.stackexchange.com/questions/43671/optimize-command-issuing-view-is-not-base-table-and-corrupt-error-messages message is Corrupt It seems to be only against views, we didn't get any of these error messages against the base tables. Does this look like an incorrect error message, or do we have issues with our tables? mysql view corruption share|improve this question edited Jun 3 '13 at 18:01 Mat 6,55622234 asked Jun 3 '13 at 10:04 Worried 912 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote You cannot run OPTIMIZE TABLE against a View. I can see why the error message would be Corrupt In mysql, a view is represented as a table in INFORMATION_SCHEMA.TABLES. I have discussed views in this light before However, a View in INFORMATION_SCHEMA.TABLES has NULL as a Storage Engine. Mar 21, 2012 : How do I get the execution plan for a view? Nov 23, 2011 : How can I define the datatype of a view in MySQL? Consequently, there must be a storage engine to optimize on. Since the Storage Engine is NULL, Corrupt error message is understandable. Therefore, don't be concerned with the error message. Just run OPTIMIZE TABLE on the underlying base tables. share|improve this answer edited Jun 3 '13 at 20:23 answered Jun 3 '13 at 20:17 RolandoMySQL
Fahl Email Updates: Status: Can't repeat Impact on me: None Category:MySQL Server: Optimizer Severity:S1 (Critical) Version:5.0.18 to 5.0.22 OS:Microsoft Windows (Windows XP) Assigned to: https://bugs.mysql.com/bug.php?id=16440 Georgi Kodinov View Add Comment Files Developer Edit Submission View Progress Log https://www.drupal.org/node/1821766 Contributions [12 Jan 2006 9:17] Wolfgang Fahl Description: A simple table/view combination: CREATE TABLE testtable (oid varchar(32)); CREATE VIEW testview as select * from testtable; can not be restored with a mysqldump/mysql source combination if the following options are used for mysqldump: mysqldump --quick --add-locks --no-create-db --lock-tables --no-create-info --complete-insert is not --extended-insert=false The message ERROR 1347 (HY000): 'testbug.testview' is not BASE TABLE will appear using --no-create-db and --no-create-info seem to lead to this behaviour How to repeat: drop database testbug; create database testbug; use testbug; CREATE TABLE testtable (oid varchar(32)); CREATE VIEW testview as select * from testtable; drop database testbug; #mysqldump --quick --add-locks --lock-tables --complete-insert --extended -insert=false --host=localhost --user=root --password testbug > is not base mysqlbug9.sql # and restoring with drop database testbug; create database testbug; use testbug; source mysqlbug9.sql # works fine but mysqldump --quick --add-locks --no-create-db --lock-tables --no-create-info --complete-insert --extended-insert=false --host=localhost --user=root --password testbug > mysqlbug10.sql # and restoring with drop database testbug; create database testbug; use testbug; source mysqlbug10.sql will lead to ERROR 1347 (HY000): 'testbug.testview' is not BASE TABLE Suggested fix: make sure the view is ignored and not handled as a table - it has no extra information if the database structure is kept. The view might even have changed without notice ... [12 Jan 2006 10:14] Valerii Kravchuk Thank you for a problem report. Verified just as described. The real problem is the following. According to the manual (http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html): "--no-create-info, -t Do not write CREATE TABLE statements that re-create each dumped table." But when this option is icnluded for database with views, each views is dumped as follows: -- -- Dumping data for table `testview` -- /*!40000 ALTER TABLE `testview` DISABLE KEYS */; LOCK TABLES `testview` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `testview` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; Whil
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes DataIssues PDOException: SQLSTATE[HY000]: General error: 1347 when trying to set up index or primary key on adopted data table. ActiveProject:DataVersion:7.x-1.x-devComponent:CodePriority:NormalCategory:Bug reportAssigned:UnassignedReporter:RefineoCreated:October 24, 2012 - 11:58Updated:May 26, 2015 - 13:47 Log in or register to update this issue Jump to:Most recent comment Steps to reproduce Install Drupal 7.16 Install Webform 7.x-3.18 or Webform 7.x-3.18+24-dev Install Webform MySQL Views 7.x-1.0 Install Pathauto 7.x-1.2 Install Data 7.x-1.x-dev Got to /node/add/webform Create node "test" of content type Webform Add textfield "New textfield" Save Go to /content/test and submit the webform submission Go to /admin/content/webform/mysql Select checkbox (test) and click submit Mysql view webform_views_test_1 should be available now Go to /admin/structure/data/adopt Select checkbox (webform_views_test_1 ) and click Adobt I receive the following warning message: Field webform_views_test_1.submitted: no Schema type for mysql type datetime. Go to /admin/structure/data/edit/webform_views_test_1 For field , select checkbox "index" (or "primary key") Click button "Save" Error I receive PDOException when trying to set up index on an adopted data table. PDOException: SQLSTATE[HY000]: General error: 1347 'database.webform_views_test_1' is not BASE TABLE: ALTER TABLE {webform_views_test_1} CHANGE `submitted` `submitted` INT NULL DEFAULT NULL; Array ( ) in db_change_field() (line 2988 of /***/includes/database/database.inc). The website encountered an unexpected error. Please try again later. Comments Comment #1 Refineo CreditAttribution: Refineo commented October 24, 2012 at 12:19pm Related issues: #1089598: Webform MySQL Views for Drupal 7 Modules: Webform My